Skip to content

Commit

Permalink
Artur/eng 11175 frosted UI icons initial setup (#81)
Browse files Browse the repository at this point in the history
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
arturbien authored Feb 22, 2024
1 parent fcc69a1 commit 34d393a
Show file tree
Hide file tree
Showing 43 changed files with 7,151 additions and 109 deletions.
34 changes: 30 additions & 4 deletions license.md
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,
1 change: 1 addition & 0 deletions packages/frosted-ui-icons/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FIGMA_ACCESS_TOKEN="<YOUR FIGMA ACCESS TOKEN>"
7 changes: 7 additions & 0 deletions packages/frosted-ui-icons/.gitignore
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
28 changes: 28 additions & 0 deletions packages/frosted-ui-icons/CONTRIBUTING.md
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._
40 changes: 40 additions & 0 deletions packages/frosted-ui-icons/README.md
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 added packages/frosted-ui-icons/frosted-ui-icons.zip
Binary file not shown.
40 changes: 40 additions & 0 deletions packages/frosted-ui-icons/icons/gear-20.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions packages/frosted-ui-icons/icons/grid-16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions packages/frosted-ui-icons/icons/store-16.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions packages/frosted-ui-icons/icons/store-20.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 34d393a

Please sign in to comment.