@kolkrabbi/kol-loader 0.1.1 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +21 -417
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-loader",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "KOL icon loader — <Icon/> plus the 341-icon registry and raw SVG entries. Vite-only (uses import.meta.glob).",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -18,423 +18,27 @@ export const SVG_ENTRIES = Object.entries(svgModules).map(([path, svg]) => {
18
18
  return { id: `${folder}/${name}`, name, folder, svg }
19
19
  })
20
20
 
21
- // Icon Registry - Complete list of all 341 icons
22
- export const ICONS = {
23
- // Rack (113)
24
- rack: [
25
- 'ascii-back',
26
- 'ascii-block',
27
- 'ascii-dash',
28
- 'ascii-dot',
29
- 'ascii-equal',
30
- 'ascii-hash',
31
- 'ascii-pipe',
32
- 'ascii-plus',
33
- 'ascii-slash',
34
- 'ascii-x',
35
- 'cable-lock',
36
- 'cable-off',
37
- 'cable-on',
38
- 'cable-trans',
39
- 'cable-unlock',
40
- 'cap-butt',
41
- 'cap-round',
42
- 'cap-square',
43
- 'chevron-down',
44
- 'chevron-left',
45
- 'chevron-right',
46
- 'chevron-up',
47
- 'clr-anl',
48
- 'clr-comp',
49
- 'clr-mono',
50
- 'clr-tri',
51
- 'curve-exp',
52
- 'curve-log',
53
- 'dith-cross',
54
- 'dith-crt',
55
- 'dith-diamond',
56
- 'dith-flow',
57
- 'dith-flower',
58
- 'dith-gear',
59
- 'dith-glitch',
60
- 'dith-grid',
61
- 'dith-hex',
62
- 'dith-htone',
63
- 'dith-melt',
64
- 'dith-radial',
65
- 'dith-xhatch',
66
- 'filter-bp',
67
- 'filter-hp',
68
- 'filter-lp',
69
- 'filter-notch',
70
- 'gen-color',
71
- 'gen-gradient',
72
- 'gen-pattern',
73
- 'gen-wave',
74
- 'grad-con',
75
- 'grad-lin',
76
- 'grad-rad',
77
- 'line-circle',
78
- 'line-grid',
79
- 'line-line',
80
- 'line-lissa',
81
- 'line-spiral',
82
- 'logic-and',
83
- 'logic-nand',
84
- 'logic-nor',
85
- 'logic-not',
86
- 'logic-or',
87
- 'logic-xor',
88
- 'nav-create',
89
- 'nav-home',
90
- 'nav-library',
91
- 'nav-rack',
92
- 'nav-settings',
93
- 'ptrn-checker',
94
- 'ptrn-dot',
95
- 'ptrn-stripe',
96
- 'radial-circle',
97
- 'radial-default',
98
- 'radial-hex',
99
- 'radial-random',
100
- 'radial-rect',
101
- 'radial-star',
102
- 'radial-triangle',
103
- 'ramp-down',
104
- 'ramp-tri',
105
- 'ramp-up',
106
- 'seq-a',
107
- 'seq-b',
108
- 'seq-c',
109
- 'seq-d',
110
- 'shape-cube',
111
- 'shape-cyl',
112
- 'shape-ico',
113
- 'shape-octa',
114
- 'shape-sphere',
115
- 'shape-tetra',
116
- 'shape-torus',
117
- 'shaper-clip',
118
- 'shaper-exp',
119
- 'shaper-fold',
120
- 'shaper-log',
121
- 'shaper-scurve',
122
- 'shaper-sine',
123
- 'shaper-step',
124
- 'shaper-wrap',
125
- 'tr-carets',
126
- 'tr-fwd',
127
- 'tr-inf',
128
- 'tr-left',
129
- 'tr-pause',
130
- 'tr-rew',
131
- 'tr-right',
132
- 'tr-skip',
133
- 'wave-rnd',
134
- 'wave-saw',
135
- 'wave-sin',
136
- 'wave-sqr',
137
- 'wave-tri',
138
- ],
139
-
140
- // Navigation (21)
141
- navigation: [
142
- 'arrow-cross',
143
- 'arrow-down',
144
- 'arrow-downright',
145
- 'arrow-expand',
146
- 'arrow-left',
147
- 'arrow-right',
148
- 'arrow-up',
149
- 'caret-down',
150
- 'caret-left',
151
- 'caret-right',
152
- 'caret-up',
153
- 'chevron-down',
154
- 'chevron-right',
155
- 'chevron-up',
156
- 'control-arrow-back',
157
- 'control-arrow-end',
158
- 'control-arrow-forward',
159
- 'control-arrow-start',
160
- 'external-link',
161
- 'menu',
162
- 'x',
163
- ],
164
-
165
- // Actions & Controls (28)
166
- actions: [
167
- 'check',
168
- 'copy',
169
- 'cross',
170
- 'download',
171
- 'edit',
172
- 'filter',
173
- 'maximize',
174
- 'minimize',
175
- 'minus',
176
- 'move',
177
- 'plus',
178
- 'redo',
179
- 'refresh',
180
- 'rotate',
181
- 'rotate-left',
182
- 'rotate-right',
183
- 'save',
184
- 'search',
185
- 'search-line',
186
- 'settings-01',
187
- 'settings-02',
188
- 'share',
189
- 'snap',
190
- 'trash',
191
- 'undo',
192
- 'upload',
193
- 'zoom-in',
194
- 'zoom-out',
195
- ],
196
-
197
- // Files & Documents (16)
198
- files: [
199
- 'add-file',
200
- 'attachment',
201
- 'book-open',
202
- 'bookmark',
203
- 'clipboard-1',
204
- 'clipboard-2',
205
- 'file',
206
- 'file-image',
207
- 'file-text',
208
- 'file-video',
209
- 'folder-01',
210
- 'folder-02',
211
- 'folder-open',
212
- 'journal',
213
- 'manual-empty',
214
- 'page',
215
- ],
216
-
217
- // Communication (9)
218
- communication: [
219
- 'alarm-bell',
220
- 'dual-opponent',
221
- 'in-going',
222
- 'interactive',
223
- 'mail',
224
- 'message-circle',
225
- 'message-square',
226
- 'phone',
227
- 'send',
228
- ],
229
-
230
- // User & Authentication (16)
231
- user: [
232
- 'flag',
233
- 'heart-1',
234
- 'heart-2',
235
- 'key',
236
- 'lock',
237
- 'log-in',
238
- 'log-out',
239
- 'shield',
240
- 'social-facebook',
241
- 'social-linkedin',
242
- 'social-twitter',
243
- 'star',
244
- 'unlock',
245
- 'user',
246
- 'user-plus',
247
- 'users',
248
- ],
249
-
250
- // Status & Feedback (9)
251
- status: [
252
- 'alert-circle',
253
- 'alert-triangle',
254
- 'check-circle',
255
- 'eye-off',
256
- 'eye-on',
257
- 'help-circle',
258
- 'info',
259
- 'loader',
260
- 'x-circle',
261
- ],
262
-
263
- // Media (22)
264
- media: [
265
- 'camera',
266
- 'camera-off',
267
- 'control-pause',
268
- 'control-play',
269
- 'control-stop',
270
- 'fast-forward',
271
- 'image',
272
- 'mic',
273
- 'mic-off',
274
- 'repeat',
275
- 'repeat-1',
276
- 'rewind',
277
- 'shuffle',
278
- 'skip-back',
279
- 'skip-forward',
280
- 'stop',
281
- 'video',
282
- 'video-off',
283
- 'volume',
284
- 'volume-1',
285
- 'volume-2',
286
- 'volume-x',
287
- ],
288
-
289
- // Time & Calendar (9)
290
- time: [
291
- 'calendar',
292
- 'calendar-check',
293
- 'calendar-days',
294
- 'clock',
295
- 'clock-alert',
296
- 'clock-rotate-left',
297
- 'history',
298
- 'stopwatch',
299
- 'timer',
300
- ],
301
-
302
- // Layout & UI (21)
303
- layout: [
304
- 'columns',
305
- 'component',
306
- 'grid-01',
307
- 'grid-02',
308
- 'grid-03',
309
- 'grid-04',
310
- 'grid-05',
311
- 'grid-06',
312
- 'layers',
313
- 'layout',
314
- 'layout-01',
315
- 'layout-02',
316
- 'layout-03',
317
- 'list-01',
318
- 'list-02',
319
- 'more-horizontal',
320
- 'more-vertical',
321
- 'panel-left',
322
- 'panel-right',
323
- 'row',
324
- 'sidebar',
325
- ],
326
-
327
- // Editing & Content (18)
328
- editing: [
329
- 'align-center',
330
- 'align-left',
331
- 'align-right',
332
- 'bold',
333
- 'brush',
334
- 'color',
335
- 'flip-y',
336
- 'italic',
337
- 'list-ordered',
338
- 'list-unordered',
339
- 'pen',
340
- 'pencil',
341
- 'text-01',
342
- 'text-02',
343
- 'type-01',
344
- 'type-02',
345
- 'type-03',
346
- 'underline',
347
- ],
348
-
349
- // System & Tools (15)
350
- system: [
351
- 'atomic-atom',
352
- 'atomic-lifeform',
353
- 'atomic-molecule',
354
- 'atomic-organism',
355
- 'battery',
356
- 'code',
357
- 'database',
358
- 'frequency',
359
- 'library',
360
- 'power',
361
- 'roadmap',
362
- 'server',
363
- 'terminal',
364
- 'wifi',
365
- 'wifi-off',
366
- ],
367
-
368
- // Theme & Display (5)
369
- theme: [
370
- 'contrast',
371
- 'monitor',
372
- 'moon',
373
- 'sun',
374
- 'theme-toggle',
375
- ],
376
-
377
- // E-commerce & Shopping (8)
378
- ecommerce: [
379
- 'credit-card',
380
- 'dollar-sign',
381
- 'gift',
382
- 'package',
383
- 'receipt',
384
- 'shopping-bag',
385
- 'shopping-cart',
386
- 'tag',
387
- ],
388
-
389
- // Stats & Data Visualization (15)
390
- stats: [
391
- 'stat-abacus',
392
- 'stat-chart-a',
393
- 'stat-chart-b',
394
- 'stat-chart-c',
395
- 'stat-crown',
396
- 'stat-cycle',
397
- 'stat-donut',
398
- 'stat-medalion',
399
- 'stat-pie',
400
- 'stat-pie-c',
401
- 'stat-rocket',
402
- 'stat-stat',
403
- 'stat-winner',
404
- 'trending-down',
405
- 'trending-up',
406
- ],
407
-
408
- // Shapes & Geometric (6)
409
- shapes: [
410
- 'circle',
411
- 'cone',
412
- 'diamond',
413
- 'triangle',
414
- 'wave',
415
- 'wheel',
416
- ],
417
-
418
- // Miscellaneous (10)
419
- misc: [
420
- 'align-auto',
421
- 'bolt',
422
- 'bucket',
423
- 'foundation',
424
- 'home-1',
425
- 'home-2',
426
- 'instance',
427
- 'location',
428
- 'pills',
429
- 'rabbit',
430
- ],
431
-
432
- // Brand iconography (1)
433
- kolkrabbi: [
434
- 'signature-thick',
435
- ],
436
- };
437
-
21
+ /* Real, complete inventory derived from the canonical stroke set on disk
22
+ * (880 files / 862 unique across 21 folders). ICONS is now an alias of this
23
+ * (was a hand-maintained 341-name list that drifted). Keys-only glob: paths
24
+ * resolve at build time without loading any SVG content. */
25
+ export const ICON_ENTRIES = Object.keys(import.meta.glob('./stroke/**/*.svg'))
26
+ .map((p) => {
27
+ const parts = p.split('/')
28
+ const name = (parts.pop() || '').replace('.svg', '')
29
+ const folder = parts.pop() || 'misc'
30
+ return { name, folder }
31
+ })
32
+ .sort((a, b) => a.folder.localeCompare(b.folder) || a.name.localeCompare(b.name))
33
+
34
+ export const ICON_INDEX = ICON_ENTRIES.reduce((map, e) => {
35
+ ;(map[e.folder] ||= []).push(e.name)
36
+ return map
37
+ }, {})
38
+
39
+ /* ICONS — canonical grouped registry, now DERIVED from the on-disk stroke set
40
+ * via ICON_INDEX (was a hand-maintained 341-name list that drifted). */
41
+ export const ICONS = ICON_INDEX;
438
42
  // Flat array of all icon names
439
43
  export const ALL_ICONS = Object.values(ICONS).flat();
440
44