
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@purple/phoenix-components
Advanced tools
Our aim is to build a simple React components library using [`styled-components`](https://styled-components.com/) and TypeScript.
Our aim is to build a simple React components library using styled-components and TypeScript.
Phoenix Components takes advantage of some 3rd party libraries to create consistently styled components
@tippyjs/react - dropdown and positioning engine for the Dropdown componentcountries-and-timezones - list of timezones for the TimezonePicker componentis-mobile - detecting mobile device for the Select componentnanoid - unique string ID generator for Checkbox and Radio componentsnoUiSlider - complete solution for the Slider (and Range) componentreact-day-picker - date picker for DatePicker and DateRangePicker componentsreact-dropzone - drag'n'drop support for the FileUpload componentreact-inlinesvg - Inline loading of SVG files (to support hover effects) across all components using iconsreact-pdf - PDF files preview for the FileUpload componentreact-select - complete solution for the Select componentreact-tabs - complete solution for the Tabs component and its subcomponents (TabList, Tab and TabPanel)To start dev server of storybook on Mac it needs few brew packages and one npm package to be installed first.
npm install -g node-gypbrew install pkg-config pixman cairo pangonode_modules/.pnpm/canvas@2.11.2/node_modules/canvas in phoenix reponode-gyp rebuild to manually resolve binaries (npx node-gyp rebuild if some problems)pnpm storybookHere are some useful links that solves some problems that can occur: pkg-config error, other path errors.
Before merging to master run npm run release:feature, this will create a new version tag. After that you can merge your branch to master and from there you can run npm run release:publish.
npm i @purple/phoenix-components
Phoenix components use by default Mulish font with weights 400 and 600. If you want to use this default font, please add it to your project, using for example Google Fonts.
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Mulish:wght@400;600&display=swap" rel="stylesheet">
Import Theme from Phoenix Components and wrap the app in <ThemeProvider> from styled-components providing the Theme object. If your repository already contains custom styled-components theme, merge both themes together. Also, import <GlobalStyles> component which provides styles such as default font and sizes, and include it once in your project.
import merge from 'lodash/merge'
import { ThemeProvider } from 'styled-components'
import { GlobalStyles, Theme as PhoenixTheme } from '@purple/phoenix-components'
import { Theme } from './CustomAppTheme'
...
function App() {
return (
<ThemeProvider theme={merge(PhoenixTheme, Theme)}>
<GlobalStyles />
{ ... your app ... }
</ThemeProvider>
)
}
You can optionally include dir key in the theme with values either 'ltr' or 'rtl'. This is not required but it will slightly optimize CSS generated to support right-to-left layouts, resulting in smaller footprint.
...
<ThemeProvider theme={merge({ dir: 'rtl' }, Theme)}>
...
Import components that you need and use them according to the docs.
import { TextInput } from '@purple/phoenix-components'
You can extend the components with styled-components.
For example:
import styled from 'styled-components'
import { TextInput } from '@purple/phoenix-components'
const StyledInput = styled(TextInput)`
// css overrides here
`
Since version 5, Phoenix components use design tokens for styling. If you want to change appearance of the components you need to provide ThemeProvider with a custom set of tokens (JSON file).
Previously (in v4), components were styled using object
$pcwithin the theme file. This object is deprecated and will be removed in version 6.
Default MyAxiory tokens bundled with Phoenix components come from this repository https://github.com/purple-technology/my-axiory-tokens. These tokens originate from designers, specifically from Figma plugin called Tokens Studio. For your own project, you need to be given an access to a similar repo with custom design tokens.
Tokens in the repo come as a generic JSON file (or multiple files) that can be used on different platforms - web, mobile (iOS, Android). But in order to use them on each platform they need to be transformed accordingly for better usability. For this transformation, a tool called style-dictionary is used. Very basic config file could look like this (style-dictionary.config.json):
{
"source": [
"my-axiory-tokens/tokens/global.json"
],
"platforms": {
"js": {
"transformGroup": "js",
"buildPath": "src/tokens/",
"files": [
{
"destination": "tokens.json",
"format": "json/nested"
}
]
}
}
}
Pull repo with custom tokens, for example:
git -C my-axiory-tokens pull || git clone https://github.com/purple-technology/my-axiory-tokens.git
Run style-dictionary build which takes by default style-dictionary.config.json file placed in root of the project.
Merge default Phoenix theme with your custom generated tokens JSON file and provide it to ThemeProvider component. Note: tokens reside within the theme object as a key tokens!
import customTokens from './customTokens.json'
(...)
<ThemeProvider theme={merge(PhoenixTheme, { tokens: customTokens })}>
Phoenix Components ver. 5 transitioned to using Design tokens. This change affected namings of several entities.
Sizes of the components have been updated to be more consistent with other sizing and spacing units.
| Previous size | Current size |
|---|---|
| tiny | xs |
| small | sm |
| medium | md |
| large | lg |
These changes affect components Button, ButtonGroup, DateInput, Heading, LinkButton, List, Modal, MultiSelect, Pagination, Paragraph, Tag and Text.
What to do?
Find all instances of
size="tiny"and replace withsize="xs". Similarly for other sizes. Don't forget that a value can be written also for examplesize={'tiny'}or that value can be calculated so you won't be able to look these instances so easily.
Also sizing types have been renamed.
| Previous size type | Current size type |
|---|---|
| ComponentSize | Sizing |
| ComponentSizeSmallMedium | SizingSmMd |
| ComponentSizeMediumLarge | SizingMdLg |
| ComponentSizeSmallMediumLarge | SizingSmMdLg |
What to do?
Replace all previous size types with the new ones.
Text colors were renamed
| Previous color | Current color |
|---|---|
| darkest | primary |
| dark | secondary |
| light | tertiary |
| lightest | quaternary |
These changes affect components Heading, Paragraph and Text.
For the ColorTheme enum and colorTheme props, the color primary has been renamed to color brand. Other colors (success, warning, error, info, neutral) remain the same.
What to do?
- Search for all
colorTheme="primary"and replace withcolorTheme="brand"- Search for all
color="darkest"and replace withcolor="primary". Same for dark, light and lightest.
Spacings were also updated to be more consistent with other units. However, these changes are backwards compatible. Old values have been deprecated and will be removed in the next major version.
| Previous value | Current value |
|---|---|
| xxxs | 3xs |
| xxs | 2xs |
| xs | xs |
| s | sm |
| m | md |
| l | lg |
| xl | xl |
| xxl | 2xl |
| xxxl | 3xl |
What to do?
Since these changes are backwards-compatible, you don't have to do anything right now. But from now on, use the new values. Also, only new values will be hinting in your editor.
Both components have now a new style available - outline. This style can be enabled by the prop named outline.
Minimal style is now available in all color themes. Default style for minimal is now brand, instead of neutral.
What to do?
If you want to keep the same styling, add
colorTheme="neutral"to Buttons withminimalprop.
Previously, this component had only a single style. Currently, there are 3 styles available that correspond with the styles of the button - primary, secondary and outline. Default style is now primary. Previous style is currently secondary and must be explicitly enabled by the prop secondary.
What to do?
Search for all instances of
Tagcomponent and addsecondaryprop.
Prop colorTheme has been removed and there's only color prop now excepting all text colors (primary, secondary, tertiary, quaternary), color theme colors (brand, success, warning, error, info, neutral) and any valid CSS value.
Instead of 3 sizes (small, medium, large), these components now include 4 sizes - xs, sm, md, lg. For Text and Paragraph components, default value is now sm. Since there's one more size, original size small is now xs.
What to do?
- Search all instances of Text, Paragraph and Heading and replace
colorThemewithcolor.- Replace
size="small"withsize="xs". (If you already replaced sizing with new sizes, you have to search forsize="sm".)
Also, Paragraph component now has a new prop lineHeight which accepts standard sizing values xs, sm, md and lg or any other valid CSS value. Default value is md.
Prop colorTheme has been removed and there's only color prop now excepting all text colors (primary, secondary, tertiary, quaternary), color theme colors (brand, success, warning, error, info, neutral) and any valid CSS value. Also, color prop now affects only text. To change color of the bullet, use bulletColor which accepts the same values.
What to do?
- Search all instances of List and ListItem and replace
colorThemewithbulletColor.- Search for all
bulletColorprops and changedarkesttoprimary,darktosecondaryetc. (see the section Colors)
Props colorTheme and light removed and replaced with a simple color prop. This prop behaves similarly like prop color in Heading/Text/Paragraph components, ie. excepting all text colors (primary, secondary, tertiary, quaternary), color theme colors (brand, success, warning, error, info, neutral) and any valid CSS value.
Also, filled icons ending with -primary are now named as -brand, so instead of icon="smartphone-primary", it's now icon="smartphone-brand" etc.
What to do?
- Search for all instances of Icon component and if there's a
lightprop, then just replace it withcolor="white"- Search for all instances of Icon component and replace all
colorThemeprops withcolor(Note: If you haven't already done it before, replace valuesprimarywithbrand- see the section Colors)- Search for all used filled brand icons. These icons were ending with
-primary. You have to replace all-primaryat the end with-brand
This component was marked as deprecated in v4 and was removed in v5. Use Box component instead.
What to do?
- Search for all instances of Spacer component and replace them with Box component. If there's a prop
worhused, use some kind of margin or padding prop instead (mt,pl,pretc.). You can also usewidthorheightprops but these do not support Spacing values (xs,sm,mdetc.).
In prop tables, all removed properties are listed with notes how to update the component.
Renamed to Notice.
| Property | Notes |
|---|---|
| text | Use children instead. |
| centerText | Too specific prop. Centered text in a notice component is discouraged. If needed, however, it can be done manually through child element with custom styling. |
| type | Use colorTheme instead. |
| contentColor | Use colorTheme instead. |
| backgroundColor | Use colorTheme instead. |
| title | Use children instead. |
| Property | Notes |
|---|---|
| color | Use colorTheme instead. |
| background | Use colorTheme instead. |
Renamed to Checkbox (B lowercase).
| Property | Notes |
|---|---|
| color | Use colorTheme instead. |
| Property | Notes |
|---|---|
| label | Removed. If needed, use standalone component Label. |
| Property | Notes |
|---|---|
| color | Use colorTheme instead. |
Renamed to Select.
| Property | Notes |
|---|---|
| autoComplete | Remove. Select does not support autoComplete prop and it was not used in the v3 anyway. |
| description | Description is not part of this component anymore. If any description above the text input is needed, use component Text or Paragraph. |
| background | Remove. Should not be desired. We strive for unified design. |
| border | Remove. Should not be desired. We strive for unified design. |
| rowHeight | Remove without replacement. |
| Property | Notes |
|---|---|
| borderColor | Use colorTheme instead. |
| label | Removed. If needed, use standalone component Label. |
| Property | Notes |
|---|---|
| type | Remove without replacement. textarea does not have an attribute type. |
| withBorder | Remove without replacement. Should not be desired. We strive for unified design. |
| Property | Notes |
|---|---|
| description | Description is not part of this component anymore. If any description above the text input is needed, create a custom element with custom styling. |
| descriptionFontSize | The same applies as for description prop. |
| background | Remove without replacement. Background color should not be modified. |
| disableErrorText | If we don't want to display error text but want to mark the input as errored, we set the property error to true (instead of string). |
| focusColor | Remove without replacement. Focus color should not be modified. |
FAQs
Our aim is to build a simple React components library using [`styled-components`](https://styled-components.com/) and TypeScript.
The npm package @purple/phoenix-components receives a total of 411 weekly downloads. As such, @purple/phoenix-components popularity was classified as not popular.
We found that @purple/phoenix-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 29 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.