@fiscozen/icons 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +29 -3
- package/dist/icons.js +3085 -0
- package/dist/icons.umd.cjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/src/FzIcon.vue.d.ts +30 -0
- package/dist/src/FzIconBackground.vue.d.ts +33 -0
- package/dist/src/__tests__/FzIcon.spec.d.ts +1 -0
- package/dist/src/__tests__/FzIconBackground.spec.d.ts +1 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/types.d.ts +12 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vitest.config.d.ts +2 -0
- package/package.json +23 -6
- package/src/FzIcon.vue +18 -7
- package/src/FzIconBackground.vue +25 -0
- package/src/__tests__/FzIcon.spec.ts +514 -0
- package/src/__tests__/FzIconBackground.spec.ts +380 -0
- package/src/__tests__/__snapshots__/FzIcon.spec.ts.snap +11 -0
- package/src/__tests__/__snapshots__/FzIconBackground.spec.ts.snap +13 -0
- package/src/index.ts +4 -2
- package/src/types.ts +5 -1
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.ts +34 -0
- package/vitest.config.ts +27 -0
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
# @fiscozen/icons
|
|
2
2
|
|
|
3
|
+
Design system icon components (Font Awesome). For usage documentation and examples, see Storybook (Documentation/Media/FzIcon and Documentation/Media/FzIconBackground).
|
|
4
|
+
|
|
5
|
+
## FzIcon
|
|
6
|
+
|
|
7
|
+
Base icon component. Renders a single icon with configurable size and variant.
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Default | Description |
|
|
10
|
+
|-----------|----------|---------|-------------|
|
|
11
|
+
| `name` | `string` | required | Font Awesome icon name (e.g. `bell`, `check`). |
|
|
12
|
+
| `size` | `IconSize` | `'lg'` | Size: `xs`, `sm`, `md`, `lg`, `xl`, `2xl`. |
|
|
13
|
+
| `variant` | `IconVariant` | `'far'` | Font Awesome style (e.g. `fas`, `far`, `fal`). |
|
|
14
|
+
| `spin` | `boolean` | `false` | Enables spinning animation. |
|
|
15
|
+
|
|
16
|
+
To apply design system text color, use the <code>v-color</code> directive on the component (e.g. <code><FzIcon v-color:blue="500" /></code>). The root element is a <code><span role="presentation"></code>, so v-color is valid (SPAN is allowed in @fiscozen/style) and the icon can be nested inside <code><p></code> or <code><span></code> without invalid HTML.
|
|
17
|
+
|
|
18
|
+
## FzIconBackground
|
|
19
|
+
|
|
20
|
+
Wrapper around FzIcon that adds a configurable background to the icon container (rounded, padded). Same props as FzIcon plus <code>backgroundColor</code>; use when you need an icon with a visible background (e.g. status indicators, badges).
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
|--------------------|----------|-----------------|-------------|
|
|
24
|
+
| `name` | `string` | required | Font Awesome icon name (e.g. `bell`, `check`). |
|
|
25
|
+
| `size` | `IconSize` | `'lg'` | Size: `xs`, `sm`, `md`, `lg`, `xl`, `2xl`. |
|
|
26
|
+
| `variant` | `IconVariant` | `'far'` | Font Awesome style (e.g. `fas`, `far`, `fal`). |
|
|
27
|
+
| `spin` | `boolean` | `false` | Enables spinning animation. |
|
|
28
|
+
| `backgroundColor` | `string` | `'core-white'` | Tailwind background color token (e.g. core-white, grey-100). Applied as <code>bg-{value}</code>. |
|
|
29
|
+
|
|
3
30
|
## Notes
|
|
4
31
|
|
|
5
|
-
- For the current iteration we decided to ship icons in a bundle (svg + js style), no API or lazy loading is currently happening
|
|
6
|
-
-
|
|
7
|
-
To avoid exposing secrets the Font Awesome Pro token should be configured in a environment variable as `FONTAWESOME_PACKAGE_TOKEN`
|
|
32
|
+
- For the current iteration we decided to ship icons in a bundle (svg + js style), no API or lazy loading is currently happening.
|
|
33
|
+
- To keep the bundle size low we use Font Awesome "icon kits" (Pro), so the shipped set is tailored. Configure `.npmrc` in the app root (see this repo); set `FONTAWESOME_PACKAGE_TOKEN` in the environment for the Pro token.
|