@sigx/lynx-icons-fa-free 0.4.1 → 0.4.2
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/README.md +22 -7
- package/dist/components.d.ts +42 -0
- package/dist/components.js +34 -0
- package/package.json +12 -5
package/README.md
CHANGED
|
@@ -19,21 +19,36 @@ import { defineLynxConfig } from '@sigx/lynx-cli/config';
|
|
|
19
19
|
|
|
20
20
|
export default defineLynxConfig({
|
|
21
21
|
iconSets: [
|
|
22
|
-
{ id: '
|
|
22
|
+
{ id: 'fas', source: '@sigx/lynx-icons-fa-free', styles: ['solid'] },
|
|
23
|
+
{ id: 'far', source: '@sigx/lynx-icons-fa-free', styles: ['regular'] },
|
|
23
24
|
{ id: 'fab', source: '@sigx/lynx-icons-fa-free', styles: ['brands'] },
|
|
24
25
|
],
|
|
25
26
|
});
|
|
26
27
|
```
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
**Set ids follow Font Awesome's own prefix convention** — the same strings FA uses in its CSS classes (`fa-solid` / `fa-regular` / `fa-brands`) and JS `IconPrefix` type (`fas` / `far` / `fab`). The pinned components below depend on these exact ids; renaming a set means those components won't find it. Declare one entry per style you want to use — they're tree-shaken independently.
|
|
29
30
|
|
|
30
31
|
## Usage
|
|
31
32
|
|
|
33
|
+
### Pinned per-style components (recommended)
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { FaSolidIcon, FaRegularIcon, FaBrandIcon } from '@sigx/lynx-icons-fa-free/components';
|
|
37
|
+
|
|
38
|
+
<FaSolidIcon name="user" />
|
|
39
|
+
<FaSolidIcon name="chevron-right" size={20} color="#0D9488" />
|
|
40
|
+
<FaRegularIcon name="bell" size={20} />
|
|
41
|
+
<FaBrandIcon name="github" size={24} />
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Each component is a thin wrapper around `<Icon>` from `@sigx/lynx-icons` with the matching `set` pre-filled. Rendering, color sanitization, and theming behavior are identical to the generic form.
|
|
45
|
+
|
|
46
|
+
### Generic `<Icon>` (dynamic `set` / non-conventional ids)
|
|
47
|
+
|
|
32
48
|
```tsx
|
|
33
49
|
import { Icon } from '@sigx/lynx-icons';
|
|
34
50
|
|
|
35
|
-
<Icon set="
|
|
36
|
-
<Icon set="fa" name="chevron-right" size={20} color="#0D9488" />
|
|
51
|
+
<Icon set="fas" name="user" />
|
|
37
52
|
<Icon set="fab" name="github" size={24} />
|
|
38
53
|
```
|
|
39
54
|
|
|
@@ -55,14 +70,14 @@ If the icon `name` comes from data (a JSON UI tree, a CMS field) the build-time
|
|
|
55
70
|
|
|
56
71
|
```ts
|
|
57
72
|
iconSets: [
|
|
58
|
-
{ id: '
|
|
73
|
+
{ id: 'fas', source: '@sigx/lynx-icons-fa-free', styles: ['solid'], include: ['*'] },
|
|
59
74
|
],
|
|
60
75
|
```
|
|
61
76
|
|
|
62
77
|
This bundles **all ~1 900 FA-solid glyphs** (~2 MB of JS). Use it only on sets that need it; mix with normally-tree-shaken sets for the rest. The build prints the exact glyph count:
|
|
63
78
|
|
|
64
79
|
```
|
|
65
|
-
[@sigx/lynx-plugin] icons:
|
|
80
|
+
[@sigx/lynx-plugin] icons: fas bundling 1956 glyphs (include: ['*'])
|
|
66
81
|
```
|
|
67
82
|
|
|
68
83
|
`@sigx/lynx-icons`'s upcoming font mode (v1.1) will swap SVG-per-glyph for a single subsetted TTF — dramatically smaller for full-catalog scenarios. Stay tuned.
|
|
@@ -82,4 +97,4 @@ The adapter is normally consumed by `@sigx/lynx-plugin`'s icons slice — these
|
|
|
82
97
|
|
|
83
98
|
## Reference app
|
|
84
99
|
|
|
85
|
-
`examples/showcase/src/screens/Settings.tsx` renders `<
|
|
100
|
+
`examples/showcase/src/screens/Settings.tsx` renders `<FaSolidIcon name="user" />`, `house`, `gear`, and `<FaBrandIcon name="github" />` in a card; the build-time scanner picks up the underlying `<Icon set="…" name="…">` calls and writes their codepoints into `node_modules/.cache/sigx-lynx-icons/codepoints.mjs`.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pinned per-style components — ergonomic shortcuts around `<Icon set= name=>`
|
|
3
|
+
* for the Font Awesome Free adapter. Set ids follow Font Awesome's own
|
|
4
|
+
* prefix convention (the same strings FA uses in its CSS classes and JS
|
|
5
|
+
* `IconPrefix` type):
|
|
6
|
+
*
|
|
7
|
+
* - `fas` — Solid (the default style most icons live in)
|
|
8
|
+
* - `far` — Regular
|
|
9
|
+
* - `fab` — Brands
|
|
10
|
+
*
|
|
11
|
+
* For these to resolve, the consumer's `signalx.config.ts` must declare a
|
|
12
|
+
* matching `iconSets` entry, e.g.
|
|
13
|
+
* `{ id: 'fas', source: '@sigx/lynx-icons-fa-free', styles: ['solid'] }`.
|
|
14
|
+
* If a different id is used, the pinned components won't find their set —
|
|
15
|
+
* fall back to the generic `<Icon set="…" name="…">` or write a one-line
|
|
16
|
+
* local pin.
|
|
17
|
+
*
|
|
18
|
+
* Rendering still goes through `@sigx/lynx-icons`' `<Icon>`, so the
|
|
19
|
+
* SVG/codepoint/missing-glyph branching, color sanitization, and theming
|
|
20
|
+
* behavior is shared with the rest of the icons pipeline. These wrappers
|
|
21
|
+
* only forward props.
|
|
22
|
+
*
|
|
23
|
+
* FA Pro styles (duotone, light, thin, sharp) are not shipped by FA Free;
|
|
24
|
+
* Pro adapters would expose their own pinned components alongside these.
|
|
25
|
+
*/
|
|
26
|
+
import { type Define } from '@sigx/lynx';
|
|
27
|
+
import { type IconPropsExtensions } from '@sigx/lynx-icons';
|
|
28
|
+
type FaIconProps = Define.Prop<'name', string, true> & Define.Prop<'size', number, false> & Define.Prop<'color', string, false> & Define.Prop<'class', string, false>
|
|
29
|
+
/**
|
|
30
|
+
* Inherit any theme-augmented props (e.g. daisy's `variant?: DaisyColor`).
|
|
31
|
+
* The augmentation happens in core `@sigx/lynx-icons`'s
|
|
32
|
+
* `IconPropsExtensions`; intersecting it here keeps the pinned
|
|
33
|
+
* component's surface in sync without extra forwarding work.
|
|
34
|
+
*/
|
|
35
|
+
& IconPropsExtensions;
|
|
36
|
+
/** Font Awesome **solid** icon — pins `set="fas"` to match FA's `IconPrefix`. */
|
|
37
|
+
export declare const FaSolidIcon: import("@sigx/runtime-core").ComponentFactory<FaIconProps, void, {}>;
|
|
38
|
+
/** Font Awesome **regular** (outlined) icon — pins `set="far"`. */
|
|
39
|
+
export declare const FaRegularIcon: import("@sigx/runtime-core").ComponentFactory<FaIconProps, void, {}>;
|
|
40
|
+
/** Font Awesome **brands** icon — pins `set="fab"`. */
|
|
41
|
+
export declare const FaBrandIcon: import("@sigx/runtime-core").ComponentFactory<FaIconProps, void, {}>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@sigx/lynx/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Pinned per-style components — ergonomic shortcuts around `<Icon set= name=>`
|
|
4
|
+
* for the Font Awesome Free adapter. Set ids follow Font Awesome's own
|
|
5
|
+
* prefix convention (the same strings FA uses in its CSS classes and JS
|
|
6
|
+
* `IconPrefix` type):
|
|
7
|
+
*
|
|
8
|
+
* - `fas` — Solid (the default style most icons live in)
|
|
9
|
+
* - `far` — Regular
|
|
10
|
+
* - `fab` — Brands
|
|
11
|
+
*
|
|
12
|
+
* For these to resolve, the consumer's `signalx.config.ts` must declare a
|
|
13
|
+
* matching `iconSets` entry, e.g.
|
|
14
|
+
* `{ id: 'fas', source: '@sigx/lynx-icons-fa-free', styles: ['solid'] }`.
|
|
15
|
+
* If a different id is used, the pinned components won't find their set —
|
|
16
|
+
* fall back to the generic `<Icon set="…" name="…">` or write a one-line
|
|
17
|
+
* local pin.
|
|
18
|
+
*
|
|
19
|
+
* Rendering still goes through `@sigx/lynx-icons`' `<Icon>`, so the
|
|
20
|
+
* SVG/codepoint/missing-glyph branching, color sanitization, and theming
|
|
21
|
+
* behavior is shared with the rest of the icons pipeline. These wrappers
|
|
22
|
+
* only forward props.
|
|
23
|
+
*
|
|
24
|
+
* FA Pro styles (duotone, light, thin, sharp) are not shipped by FA Free;
|
|
25
|
+
* Pro adapters would expose their own pinned components alongside these.
|
|
26
|
+
*/
|
|
27
|
+
import { component } from '@sigx/lynx';
|
|
28
|
+
import { Icon } from '@sigx/lynx-icons';
|
|
29
|
+
/** Font Awesome **solid** icon — pins `set="fas"` to match FA's `IconPrefix`. */
|
|
30
|
+
export const FaSolidIcon = component(({ props }) => () => (_jsx(Icon, { ...props, set: "fas" })));
|
|
31
|
+
/** Font Awesome **regular** (outlined) icon — pins `set="far"`. */
|
|
32
|
+
export const FaRegularIcon = component(({ props }) => () => (_jsx(Icon, { ...props, set: "far" })));
|
|
33
|
+
/** Font Awesome **brands** icon — pins `set="fab"`. */
|
|
34
|
+
export const FaBrandIcon = component(({ props }) => () => (_jsx(Icon, { ...props, set: "fab" })));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigx/lynx-icons-fa-free",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Font Awesome Free adapter for @sigx/lynx-icons. Provides solid/regular/brands styles via the official @fortawesome/* packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
|
+
"./components": {
|
|
15
|
+
"types": "./dist/components.d.ts",
|
|
16
|
+
"import": "./dist/components.js",
|
|
17
|
+
"default": "./dist/components.js"
|
|
18
|
+
},
|
|
14
19
|
"./package.json": "./package.json"
|
|
15
20
|
},
|
|
16
21
|
"files": [
|
|
@@ -23,7 +28,8 @@
|
|
|
23
28
|
"@fortawesome/free-brands-svg-icons": "^6.0.0",
|
|
24
29
|
"@fortawesome/free-regular-svg-icons": "^6.0.0",
|
|
25
30
|
"@fortawesome/free-solid-svg-icons": "^6.0.0",
|
|
26
|
-
"@sigx/lynx
|
|
31
|
+
"@sigx/lynx": "^0.4.2",
|
|
32
|
+
"@sigx/lynx-icons": "^0.4.2"
|
|
27
33
|
},
|
|
28
34
|
"peerDependenciesMeta": {
|
|
29
35
|
"@fortawesome/free-brands-svg-icons": {
|
|
@@ -38,10 +44,11 @@
|
|
|
38
44
|
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
39
45
|
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
40
46
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
41
|
-
"@types/node": "^25.
|
|
42
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
47
|
+
"@types/node": "^25.9.1",
|
|
48
|
+
"@typescript/native-preview": "7.0.0-dev.20260521.1",
|
|
43
49
|
"typescript": "^6.0.3",
|
|
44
|
-
"@sigx/lynx
|
|
50
|
+
"@sigx/lynx": "^0.4.2",
|
|
51
|
+
"@sigx/lynx-icons": "^0.4.2"
|
|
45
52
|
},
|
|
46
53
|
"author": "Andreas Ekdahl",
|
|
47
54
|
"license": "MIT",
|