@kolkrabbi/kol-icons 0.44.0 → 0.45.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/package.json +1 -1
- package/src/Icon.jsx +18 -5
- package/src/cuts.json +5 -0
package/package.json
CHANGED
package/src/Icon.jsx
CHANGED
|
@@ -57,8 +57,9 @@ const useIconsReady = () => {
|
|
|
57
57
|
|
|
58
58
|
/* Consumer-registered icons — a repo brings its OWN svg folder and registers it,
|
|
59
59
|
* so <Icon name> resolves app-specific icons that never ship in the package. They
|
|
60
|
-
*
|
|
61
|
-
* synchronously, so custom icons render
|
|
60
|
+
* fill the names the packaged set has none for and NEVER override a shipped name
|
|
61
|
+
* (2026-10-24; they used to win). Resolves synchronously, so custom icons render
|
|
62
|
+
* without waiting on the packaged chunk. */
|
|
62
63
|
const CUSTOM = Object.create(null)
|
|
63
64
|
|
|
64
65
|
/**
|
|
@@ -95,11 +96,23 @@ export const registerIcons = (globMap) => {
|
|
|
95
96
|
* rack → rack-v (2026-10-09: beside the new rack-h) */
|
|
96
97
|
export const RENAMED_ICONS = { customize: 'nav-settings', 'user-interface': 'metrics', rack: 'rack-v' }
|
|
97
98
|
|
|
99
|
+
/* A REGISTERED GLYPH NEVER OVERRIDES A DS NAME (user 2026-10-24: kol-mirror registered its own set over the resolver and
|
|
100
|
+
* its `refresh` replaced the DS's in the settings rail's reset — *"how can it register its own in a FIXED PRESET OF
|
|
101
|
+
* SETTINGS?"*). The packaged sets win for every name they ship; a consumer's glyph resolves only for names the DS has
|
|
102
|
+
* none for. Before the packaged chunk lands a colliding custom glyph may paint once; the DS's takes over on load.
|
|
103
|
+
* Dev warns once per overridden name, so a collision is seen, not silently lost. */
|
|
104
|
+
const overridden = new Set()
|
|
98
105
|
const resolveIcon = (name) => {
|
|
99
|
-
if (CUSTOM[name]) return CUSTOM[name]
|
|
100
|
-
if (!ICONS) return undefined
|
|
101
106
|
const n = RENAMED_ICONS[name] ?? name
|
|
102
|
-
|
|
107
|
+
const shipped = ICONS ? (ICONS.V1[n] ?? ICONS.SIGNAL[n]) : undefined
|
|
108
|
+
if (shipped) {
|
|
109
|
+
if (CUSTOM[name] && import.meta.env?.DEV && !overridden.has(name)) {
|
|
110
|
+
overridden.add(name)
|
|
111
|
+
console.warn(`kol-icons: "${name}" is a DS glyph — the registered one is ignored (a registration never overrides a shipped name, 2026-10-24). Register it under another name if it is a different drawing.`)
|
|
112
|
+
}
|
|
113
|
+
return shipped
|
|
114
|
+
}
|
|
115
|
+
return CUSTOM[name]
|
|
103
116
|
}
|
|
104
117
|
|
|
105
118
|
const normalizeSize = (value) => {
|
package/src/cuts.json
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"atomic-molecule-01": "stroke",
|
|
38
38
|
"atomic-molecule-02": "stroke",
|
|
39
39
|
"atomic-molecule-03": "stroke",
|
|
40
|
+
"atomic-molecule-04": "stroke",
|
|
40
41
|
"atomic-organism-01": "stroke",
|
|
41
42
|
"atomic-organism-02": "stroke",
|
|
42
43
|
"atomic-organism-03": "stroke",
|
|
@@ -224,6 +225,7 @@
|
|
|
224
225
|
"ptrn-stripe": "stroke",
|
|
225
226
|
"pushpin": "solid",
|
|
226
227
|
"r2b2": "solid",
|
|
228
|
+
"rabbit": "stroke",
|
|
227
229
|
"rack-h": "stroke",
|
|
228
230
|
"rack-v": "stroke",
|
|
229
231
|
"radial-circle": "stroke",
|
|
@@ -237,6 +239,7 @@
|
|
|
237
239
|
"ramp-tri": "stroke",
|
|
238
240
|
"ramp-up": "stroke",
|
|
239
241
|
"rectangle": "stroke",
|
|
242
|
+
"redo": "stroke",
|
|
240
243
|
"refresh": "stroke",
|
|
241
244
|
"repeat": "stroke",
|
|
242
245
|
"resize-auto-h": "stroke",
|
|
@@ -336,6 +339,7 @@
|
|
|
336
339
|
"type": "solid",
|
|
337
340
|
"type-02": "stroke",
|
|
338
341
|
"underline": "stroke",
|
|
342
|
+
"undo": "stroke",
|
|
339
343
|
"unlock": "stroke",
|
|
340
344
|
"upload": "stroke",
|
|
341
345
|
"user": "stroke",
|
|
@@ -344,6 +348,7 @@
|
|
|
344
348
|
"video": "stroke",
|
|
345
349
|
"video-off": "stroke",
|
|
346
350
|
"view-list": "stroke",
|
|
351
|
+
"wave": "stroke",
|
|
347
352
|
"wave-rnd": "stroke",
|
|
348
353
|
"wave-saw": "stroke",
|
|
349
354
|
"wave-sin": "stroke",
|