@enablo/swirlcn-icons 0.0.0-stage → 0.5.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,58 @@
1
- # Temporary Holding Version
1
+ # @enablo/swirlcn-icons
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Flip's Swirl icons and illustrations as tree-shakeable React components. Generated from
4
+ `@getflip/swirl-icons` and `@getflip/swirl-components`.
5
+
6
+ ```tsx
7
+ import { Add, Search } from "@enablo/swirlcn-icons";
8
+
9
+ <Add size={24} />
10
+ <Search size={16} label="Search" />
11
+ ```
12
+
13
+ 278 icons, each at the three optical sizes Swirl draws them at — **16, 24 and 28** — defaulting to
14
+ 24. They are genuinely different artwork per size, not one path scaled, so `size` picks the right
15
+ drawing rather than resizing a box.
16
+
17
+ `fill` follows `currentColor`, so an icon takes its parent's colour. Deliberate secondary fills in
18
+ the source artwork are preserved.
19
+
20
+ Icons are `aria-hidden` unless you pass `label`, which is the correct default for an icon sitting
21
+ beside visible text. Pass `label` when the icon is the only thing conveying meaning.
22
+
23
+ A handful of icons use `clipPath`; their ids are scoped per instance with `useId`, so two of the
24
+ same icon on one page cannot collide.
25
+
26
+ ## Illustrations
27
+
28
+ Swirl's 35 illustrations, generated from `@getflip/swirl-components` (the only place Swirl ships
29
+ them). Each is 120×120 and filled with Swirl's decorative colour tokens, so it follows the theme.
30
+
31
+ ```tsx
32
+ import { Illustration, IllustrationAbsence } from "@enablo/swirlcn-icons";
33
+
34
+ <IllustrationAbsence /> // bundles just this one
35
+ <Illustration svg="absence" /> // by Swirl's name; bundles all 35, like swirl-illustration
36
+ <IllustrationAbsence width={64} height={64} label="Out of office" />
37
+ ```
38
+
39
+ `illustrationNames` lists the names `svg` accepts.
40
+
41
+ ## Custom icons
42
+
43
+ ```tsx
44
+ import { createSwirlIcon } from "@enablo/swirlcn-icons";
45
+
46
+ export const Logo = createSwirlIcon("Logo", {
47
+ 16: () => <path d="…" fill="currentColor" />,
48
+ 24: () => <path d="…" fill="currentColor" />,
49
+ 28: () => <path d="…" fill="currentColor" />,
50
+ });
51
+ ```
52
+
53
+ ## Regenerating
54
+
55
+ ```bash
56
+ pnpm --filter @enablo/swirlcn-icons add -D @getflip/swirl-icons@latest
57
+ pnpm icons
58
+ ```