-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Artur/eng 11175 frosted UI icons initial setup (#81)
This PR adds initial setup for Frosted UI Icons package. - package with "generate icons" script - pulls all icons from our Figma file: https://www.figma.com/file/fxRLy35tq3pm2zNy5lAFfL/ - optimizes all SVGs using SVGO - adds `data-fui-icon` attribute to each icon - generates React component for each icon - names of icons are inferred from Figma components - generates a ZIP file with all the icons - `frosted-ui-icons` package with all generated icons This PR also adds an install guide for icons to Storybook and adds attributions for Radix/WorkOS projects on which these packages are based on
- Loading branch information
Showing
43 changed files
with
7,151 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
The MIT License (MIT) | ||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
Copyright (c) 2023 WorkOS | ||
Copyright (c) 2023 Whop | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
||
For inquiries related to this software, please contact Whop at <[email protected]>. | ||
|
||
MODIFICATIONS: | ||
|
||
- Added "success", "info", "warning" and "danger" color tokens, | ||
- Added "successColor", "infoColor", "warningColor" and "dangerColor" to `<Theme />` props, | ||
- Added new components: Calendar, RangeCalendar, DatePicker, DateRangePicker, DateField, SegmentedControl, Skeletons, Accordion, Shine, Breadcrumbs, FilterChip, StackedHorizontalBarChart, Drawer, | ||
- Removed "scaling", "radius" and "panelBackground" from `<Theme />`, | ||
- Removed "radius" prop from all components, | ||
- Changed styles of components, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FIGMA_ACCESS_TOKEN="<YOUR FIGMA ACCESS TOKEN>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# The repo's directory contents are likely generated, | ||
# so we want to whitelist what we want to keep in git. | ||
|
||
.env | ||
.size-snapshot.json | ||
.rts2* | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Contributing | ||
|
||
**To run `pnpm generate-src` you'll need to:** | ||
|
||
1. Generate a personal Figma access token | ||
2. Add it to an `.env` file under the `FIGMA_ACCESS_TOKEN` var. | ||
|
||
Further instructions can be found in the readme for `generate-icon-lib`. | ||
|
||
#### Vector Icons | ||
|
||
Access the [Figma file](https://www.figma.com/file/fxRLy35tq3pm2zNy5lAFfL/), make changes, then run `pnpm generate-src` and open a PR. | ||
|
||
There are a couple things to keep in mind when making changes: | ||
|
||
1. Name for the primary page should remain "Icons" | ||
2. Naming convention for top-level frames inform `type` and `size` groupings | ||
3. The `type` and `size` of the last top-level frame becomes the default values for the React Component | ||
|
||
_The [Figma file][figmafile] should contain additional guidelines for making changes._ | ||
|
||
#### React Component | ||
|
||
Have a look in `packages/generate-icon-lib/src/templates` for the templating code that affects the components created by running `pnpm generate-src`. | ||
|
||
Makes changes to the CLI, then re-run `pnpm generate-src`, then open a PR. Try to keep commits separated between the CLI and files created in this package. | ||
|
||
_At the time of writing, the CLI can not rerun on existing SVGs, and will instead pull down the latest SVGs from the Figma file._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Frosted UI Icons | ||
|
||
A set of icons designed by the [Whop](https://whop.com/) team. | ||
|
||
Visit [icons.radix-ui.com](https://icons.radix-ui.com) to browse the icons. | ||
|
||
--- | ||
|
||
## Documentation | ||
|
||
All icons are available as individual React components. Each icon may come in multiple sizes. | ||
|
||
Install Frosted UI Icons from npm: | ||
|
||
```bash | ||
npm install frosted-ui-icons | ||
``` | ||
|
||
Import the icons into your React project: | ||
|
||
```tsx | ||
import { Store16Icon, Store20Icon } from 'frosted-ui-icons'; | ||
|
||
function MyComponent() { | ||
return ( | ||
<div> | ||
<Store16Icon /> | ||
<Store20Icon /> | ||
</div> | ||
); | ||
} | ||
``` | ||
|
||
## Contributing | ||
|
||
Please follow our [contributing guidelines](./CONTRIBUTING.md). | ||
|
||
## Acknowledgments | ||
|
||
Frosted UI Icons library setup is based on [Radix Icons](https://github.com/radix-ui/icons). |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.