@cascivo/icons 0.3.0 → 0.3.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 +30 -3
- package/dist/index.d.mts +99 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +28 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -4
- package/readme.body.md +28 -1
- package/src/glyphs.css +265 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cascivo/icons",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Optional SVG icon components",
|
|
6
6
|
"keywords": [
|
|
@@ -22,17 +22,20 @@
|
|
|
22
22
|
"directory": "packages/icons"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
|
-
"dist"
|
|
25
|
+
"dist",
|
|
26
|
+
"src/glyphs.css"
|
|
26
27
|
],
|
|
27
28
|
"type": "module",
|
|
28
29
|
"sideEffects": false,
|
|
29
30
|
"types": "./dist/index.d.mts",
|
|
30
31
|
"exports": {
|
|
32
|
+
"./package.json": "./package.json",
|
|
31
33
|
".": {
|
|
32
|
-
"import": "./dist/index.mjs",
|
|
33
34
|
"types": "./dist/index.d.mts",
|
|
35
|
+
"import": "./dist/index.mjs",
|
|
34
36
|
"default": "./dist/index.mjs"
|
|
35
|
-
}
|
|
37
|
+
},
|
|
38
|
+
"./glyphs.css": "./src/glyphs.css"
|
|
36
39
|
},
|
|
37
40
|
"publishConfig": {
|
|
38
41
|
"access": "public",
|
package/readme.body.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
A set of **~440** React SVG icon components that inherit the cascivo token system — stroked 24×24 `currentColor` geometry, token-driven sizing, and tree-shakeable named exports.
|
|
2
2
|
|
|
3
|
-
Browse and search the full catalog — with click-to-copy imports and live size/color/theme previews — in the **[/icons gallery](https://
|
|
3
|
+
Browse and search the full catalog — with click-to-copy imports and live size/color/theme previews — in the **[/icons gallery](https://cascivo.com/icons)**.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -27,6 +27,33 @@ button svg {
|
|
|
27
27
|
|
|
28
28
|
Import only the icons you use — named exports are individually tree-shakeable, so bundle cost scales with usage, not catalog size.
|
|
29
29
|
|
|
30
|
+
## Pure-CSS glyphs (experimental)
|
|
31
|
+
|
|
32
|
+
A small, opt-in set of UI glyphs rendered with **zero SVG** — a `background: currentColor` element clipped by `clip-path: shape()`. They inherit text color like the SVG icons, resize via one custom property, and can **morph between states with a CSS transition and no JavaScript**.
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import '@cascivo/icons/glyphs.css' // import once, anywhere in the app
|
|
36
|
+
import { Glyph } from '@cascivo/icons'
|
|
37
|
+
|
|
38
|
+
// static glyph
|
|
39
|
+
;<Glyph name="chevron-down" size={20} aria-label="Expand" />
|
|
40
|
+
|
|
41
|
+
// zero-JS morph: the shape animates when `open` flips
|
|
42
|
+
;<Glyph name="chevron-toggle" open={isOpen} />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or use the class directly, without React:
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<span class="cascivo-glyph" data-glyph="check"></span>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Set size with `--cascivo-glyph-size` (default `1.5rem`); color follows `currentColor`.
|
|
52
|
+
|
|
53
|
+
v1 glyphs: `chevron-{down,up,left,right}`, `x`, `check`, `plus`, `minus`, `menu`, `arrow-{right,left,up,down}`, and the `chevron-toggle` morph. Geometry is authored in `packages/icons/src/glyphs/spec.ts` and expanded to outlines by `scripts/icons/generate-glyphs.mjs` (`pnpm glyphs:generate`).
|
|
54
|
+
|
|
55
|
+
**Support & caveats.** `clip-path: shape()` is [Baseline 2026](https://developer.mozilla.org/en-US/docs/Web/CSS/basic-shape/shape) (Chrome/Edge 135+, Safari 18.4+, Firefox 148+); the stylesheet gates all painting behind `@supports`, so older browsers render nothing rather than a broken box — use the SVG icons where you need a wider floor. A `forced-colors` fallback keeps glyphs visible in Windows High Contrast. Because the paint is a background color, glyphs **do not print** by default (browsers strip backgrounds) — prefer the SVG icons in print-critical surfaces.
|
|
56
|
+
|
|
30
57
|
## Catalog & generation
|
|
31
58
|
|
|
32
59
|
The catalog combines the original hand-authored [Feather](https://github.com/feathericons/feather)-derived icons with the [chromicons](https://github.com/lifeomic/chromicons.com) set, both MIT-licensed (see [`NOTICE`](https://github.com/cascivo/cascivo/blob/main/NOTICE)). The chromicons are vendored as SVG source under `packages/icons/svg/` and transformed into `createIcon` exports by `scripts/icons/generate.mjs` (run via `pnpm icons:generate` / `pnpm regen`) — owned code, no runtime dependency. On a name collision the existing export always wins, so the surface is purely additive.
|
package/src/glyphs.css
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/* GENERATED by scripts/icons/generate-glyphs.mjs — do not edit by hand. */
|
|
2
|
+
/* Pure-CSS glyphs via clip-path: shape(). Geometry: packages/icons/src/glyphs/spec.ts. */
|
|
3
|
+
/* Run `pnpm glyphs:generate` to refresh. */
|
|
4
|
+
|
|
5
|
+
@layer cascivo.component {
|
|
6
|
+
@supports (clip-path: shape(from 0 0, close)) {
|
|
7
|
+
.cascivo-glyph {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
inline-size: var(--cascivo-glyph-size, 1.5rem);
|
|
10
|
+
block-size: var(--cascivo-glyph-size, 1.5rem);
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
background: currentColor;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.cascivo-glyph[data-glyph='chevron-down'] {
|
|
16
|
+
clip-path: shape(
|
|
17
|
+
from 22.054% 40.446%,
|
|
18
|
+
line to 50% 68.393%,
|
|
19
|
+
line to 77.946% 40.446%,
|
|
20
|
+
arc to 72.054% 34.554% of 4.167% 4.167% cw,
|
|
21
|
+
line to 50% 56.607%,
|
|
22
|
+
line to 27.946% 34.554%,
|
|
23
|
+
arc to 22.054% 40.446% of 4.167% 4.167% cw,
|
|
24
|
+
close
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.cascivo-glyph[data-glyph='chevron-up'] {
|
|
29
|
+
clip-path: shape(
|
|
30
|
+
from 27.946% 65.446%,
|
|
31
|
+
line to 50% 43.393%,
|
|
32
|
+
line to 72.054% 65.446%,
|
|
33
|
+
arc to 77.946% 59.554% of 4.167% 4.167% cw,
|
|
34
|
+
line to 50% 31.607%,
|
|
35
|
+
line to 22.054% 59.554%,
|
|
36
|
+
arc to 27.946% 65.446% of 4.167% 4.167% cw,
|
|
37
|
+
close
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.cascivo-glyph[data-glyph='chevron-left'] {
|
|
42
|
+
clip-path: shape(
|
|
43
|
+
from 59.554% 22.054%,
|
|
44
|
+
line to 31.607% 50%,
|
|
45
|
+
line to 59.554% 77.946%,
|
|
46
|
+
arc to 65.446% 72.054% of 4.167% 4.167% cw,
|
|
47
|
+
line to 43.393% 50%,
|
|
48
|
+
line to 65.446% 27.946%,
|
|
49
|
+
arc to 59.554% 22.054% of 4.167% 4.167% cw,
|
|
50
|
+
close
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.cascivo-glyph[data-glyph='chevron-right'] {
|
|
55
|
+
clip-path: shape(
|
|
56
|
+
from 34.554% 27.946%,
|
|
57
|
+
line to 56.607% 50%,
|
|
58
|
+
line to 34.554% 72.054%,
|
|
59
|
+
arc to 40.446% 77.946% of 4.167% 4.167% cw,
|
|
60
|
+
line to 68.393% 50%,
|
|
61
|
+
line to 40.446% 22.054%,
|
|
62
|
+
arc to 34.554% 27.946% of 4.167% 4.167% cw,
|
|
63
|
+
close
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.cascivo-glyph[data-glyph='x'] {
|
|
68
|
+
clip-path: shape(
|
|
69
|
+
from 22.054% 27.946%,
|
|
70
|
+
line to 72.054% 77.946%,
|
|
71
|
+
arc to 77.946% 72.054% of 4.167% 4.167% cw,
|
|
72
|
+
line to 27.946% 22.054%,
|
|
73
|
+
arc to 22.054% 27.946% of 4.167% 4.167% cw,
|
|
74
|
+
close,
|
|
75
|
+
move to 72.054% 22.054%,
|
|
76
|
+
line to 22.054% 72.054%,
|
|
77
|
+
arc to 27.946% 77.946% of 4.167% 4.167% cw,
|
|
78
|
+
line to 77.946% 27.946%,
|
|
79
|
+
arc to 72.054% 22.054% of 4.167% 4.167% cw,
|
|
80
|
+
close
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.cascivo-glyph[data-glyph='check'] {
|
|
85
|
+
clip-path: shape(
|
|
86
|
+
from 17.887% 55.03%,
|
|
87
|
+
line to 41.89% 79.033%,
|
|
88
|
+
line to 84.403% 29.807%,
|
|
89
|
+
arc to 78.097% 24.36% of 4.167% 4.167% cw,
|
|
90
|
+
line to 41.443% 66.801%,
|
|
91
|
+
line to 23.78% 49.137%,
|
|
92
|
+
arc to 17.887% 55.03% of 4.167% 4.167% cw,
|
|
93
|
+
close
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.cascivo-glyph[data-glyph='plus'] {
|
|
98
|
+
clip-path: shape(
|
|
99
|
+
from 45.833% 25%,
|
|
100
|
+
line to 45.833% 75%,
|
|
101
|
+
arc to 54.167% 75% of 4.167% 4.167% cw,
|
|
102
|
+
line to 54.167% 25%,
|
|
103
|
+
arc to 45.833% 25% of 4.167% 4.167% cw,
|
|
104
|
+
close,
|
|
105
|
+
move to 25% 54.167%,
|
|
106
|
+
line to 75% 54.167%,
|
|
107
|
+
arc to 75% 45.833% of 4.167% 4.167% cw,
|
|
108
|
+
line to 25% 45.833%,
|
|
109
|
+
arc to 25% 54.167% of 4.167% 4.167% cw,
|
|
110
|
+
close
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.cascivo-glyph[data-glyph='minus'] {
|
|
115
|
+
clip-path: shape(
|
|
116
|
+
from 25% 54.167%,
|
|
117
|
+
line to 75% 54.167%,
|
|
118
|
+
arc to 75% 45.833% of 4.167% 4.167% cw,
|
|
119
|
+
line to 25% 45.833%,
|
|
120
|
+
arc to 25% 54.167% of 4.167% 4.167% cw,
|
|
121
|
+
close
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.cascivo-glyph[data-glyph='menu'] {
|
|
126
|
+
clip-path: shape(
|
|
127
|
+
from 16.667% 33.333%,
|
|
128
|
+
line to 83.333% 33.333%,
|
|
129
|
+
arc to 83.333% 25% of 4.167% 4.167% cw,
|
|
130
|
+
line to 16.667% 25%,
|
|
131
|
+
arc to 16.667% 33.333% of 4.167% 4.167% cw,
|
|
132
|
+
close,
|
|
133
|
+
move to 16.667% 54.167%,
|
|
134
|
+
line to 83.333% 54.167%,
|
|
135
|
+
arc to 83.333% 45.833% of 4.167% 4.167% cw,
|
|
136
|
+
line to 16.667% 45.833%,
|
|
137
|
+
arc to 16.667% 54.167% of 4.167% 4.167% cw,
|
|
138
|
+
close,
|
|
139
|
+
move to 16.667% 75%,
|
|
140
|
+
line to 83.333% 75%,
|
|
141
|
+
arc to 83.333% 66.667% of 4.167% 4.167% cw,
|
|
142
|
+
line to 16.667% 66.667%,
|
|
143
|
+
arc to 16.667% 75% of 4.167% 4.167% cw,
|
|
144
|
+
close
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.cascivo-glyph[data-glyph='arrow-right'] {
|
|
149
|
+
clip-path: shape(
|
|
150
|
+
from 16.667% 54.167%,
|
|
151
|
+
line to 83.333% 54.167%,
|
|
152
|
+
arc to 83.333% 45.833% of 4.167% 4.167% cw,
|
|
153
|
+
line to 16.667% 45.833%,
|
|
154
|
+
arc to 16.667% 54.167% of 4.167% 4.167% cw,
|
|
155
|
+
close,
|
|
156
|
+
move to 51.22% 23.78%,
|
|
157
|
+
line to 77.441% 50%,
|
|
158
|
+
line to 51.22% 76.22%,
|
|
159
|
+
arc to 57.113% 82.113% of 4.167% 4.167% cw,
|
|
160
|
+
line to 89.226% 50%,
|
|
161
|
+
line to 57.113% 17.887%,
|
|
162
|
+
arc to 51.22% 23.78% of 4.167% 4.167% cw,
|
|
163
|
+
close
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.cascivo-glyph[data-glyph='arrow-left'] {
|
|
168
|
+
clip-path: shape(
|
|
169
|
+
from 83.333% 45.833%,
|
|
170
|
+
line to 16.667% 45.833%,
|
|
171
|
+
arc to 16.667% 54.167% of 4.167% 4.167% cw,
|
|
172
|
+
line to 83.333% 54.167%,
|
|
173
|
+
arc to 83.333% 45.833% of 4.167% 4.167% cw,
|
|
174
|
+
close,
|
|
175
|
+
move to 42.887% 17.887%,
|
|
176
|
+
line to 10.774% 50%,
|
|
177
|
+
line to 42.887% 82.113%,
|
|
178
|
+
arc to 48.78% 76.22% of 4.167% 4.167% cw,
|
|
179
|
+
line to 22.559% 50%,
|
|
180
|
+
line to 48.78% 23.78%,
|
|
181
|
+
arc to 42.887% 17.887% of 4.167% 4.167% cw,
|
|
182
|
+
close
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.cascivo-glyph[data-glyph='arrow-up'] {
|
|
187
|
+
clip-path: shape(
|
|
188
|
+
from 54.167% 83.333%,
|
|
189
|
+
line to 54.167% 16.667%,
|
|
190
|
+
arc to 45.833% 16.667% of 4.167% 4.167% cw,
|
|
191
|
+
line to 45.833% 83.333%,
|
|
192
|
+
arc to 54.167% 83.333% of 4.167% 4.167% cw,
|
|
193
|
+
close,
|
|
194
|
+
move to 23.78% 48.78%,
|
|
195
|
+
line to 50% 22.559%,
|
|
196
|
+
line to 76.22% 48.78%,
|
|
197
|
+
arc to 82.113% 42.887% of 4.167% 4.167% cw,
|
|
198
|
+
line to 50% 10.774%,
|
|
199
|
+
line to 17.887% 42.887%,
|
|
200
|
+
arc to 23.78% 48.78% of 4.167% 4.167% cw,
|
|
201
|
+
close
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.cascivo-glyph[data-glyph='arrow-down'] {
|
|
206
|
+
clip-path: shape(
|
|
207
|
+
from 45.833% 16.667%,
|
|
208
|
+
line to 45.833% 83.333%,
|
|
209
|
+
arc to 54.167% 83.333% of 4.167% 4.167% cw,
|
|
210
|
+
line to 54.167% 16.667%,
|
|
211
|
+
arc to 45.833% 16.667% of 4.167% 4.167% cw,
|
|
212
|
+
close,
|
|
213
|
+
move to 17.887% 57.113%,
|
|
214
|
+
line to 50% 89.226%,
|
|
215
|
+
line to 82.113% 57.113%,
|
|
216
|
+
arc to 76.22% 51.22% of 4.167% 4.167% cw,
|
|
217
|
+
line to 50% 77.441%,
|
|
218
|
+
line to 23.78% 51.22%,
|
|
219
|
+
arc to 17.887% 57.113% of 4.167% 4.167% cw,
|
|
220
|
+
close
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.cascivo-glyph[data-glyph='chevron-toggle'] {
|
|
225
|
+
clip-path: shape(
|
|
226
|
+
from 22.054% 40.446%,
|
|
227
|
+
line to 50% 68.393%,
|
|
228
|
+
line to 77.946% 40.446%,
|
|
229
|
+
arc to 72.054% 34.554% of 4.167% 4.167% cw,
|
|
230
|
+
line to 50% 56.607%,
|
|
231
|
+
line to 27.946% 34.554%,
|
|
232
|
+
arc to 22.054% 40.446% of 4.167% 4.167% cw,
|
|
233
|
+
close
|
|
234
|
+
);
|
|
235
|
+
transition: clip-path 200ms ease;
|
|
236
|
+
}
|
|
237
|
+
.cascivo-glyph[data-glyph='chevron-toggle'][data-state='open'] {
|
|
238
|
+
clip-path: shape(
|
|
239
|
+
from 27.946% 65.446%,
|
|
240
|
+
line to 50% 43.393%,
|
|
241
|
+
line to 72.054% 65.446%,
|
|
242
|
+
arc to 77.946% 59.554% of 4.167% 4.167% cw,
|
|
243
|
+
line to 50% 31.607%,
|
|
244
|
+
line to 22.054% 59.554%,
|
|
245
|
+
arc to 27.946% 65.446% of 4.167% 4.167% cw,
|
|
246
|
+
close
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Accessibility guarantees — top-level so they win over every layer. */
|
|
253
|
+
@media (prefers-reduced-motion: reduce) {
|
|
254
|
+
.cascivo-glyph {
|
|
255
|
+
transition: none;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/* Forced-colors mode overrides background-color; repaint the silhouette */
|
|
260
|
+
/* with the system foreground so the glyph stays visible. */
|
|
261
|
+
@media (forced-colors: active) {
|
|
262
|
+
.cascivo-glyph {
|
|
263
|
+
background: CanvasText;
|
|
264
|
+
}
|
|
265
|
+
}
|