kanto-ds 1.6.0 → 1.6.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/README.md +4 -2
- package/dist/chunks/defaults-Cpeg13O5.js +68 -0
- package/dist/chunks/defaults-Cpeg13O5.js.map +1 -0
- package/dist/components/core/kt-icon/kt-icon.js +1 -1
- package/dist/icons/defaults.d.ts +9 -0
- package/dist/icons/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +7 -2
- package/dist/chunks/defaults-CFrjqae2.js +0 -59
- package/dist/chunks/defaults-CFrjqae2.js.map +0 -1
package/README.md
CHANGED
|
@@ -121,8 +121,10 @@ import 'kanto-ds/components/core/kt-button'; // just this one
|
|
|
121
121
|
## Icons
|
|
122
122
|
|
|
123
123
|
`<kt-icon>` resolves [Lucide](https://lucide.dev) icons by name at render time,
|
|
124
|
-
which means the set cannot be tree-shaken. So Kanto ships
|
|
125
|
-
elements draw
|
|
124
|
+
which means the set cannot be tree-shaken. So Kanto ships the 24 its own
|
|
125
|
+
elements draw and nine a first screen reaches for (`plus`, `pencil`,
|
|
126
|
+
`settings`, `download`, `upload`, `external-link`, `filter`, `ellipsis`,
|
|
127
|
+
`refresh-cw`). Register what else your application uses:
|
|
126
128
|
|
|
127
129
|
```js
|
|
128
130
|
import { Rocket, Wallet } from 'lucide';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { X as s, User as a, Upload as i, TriangleAlert as c, Trash2 as l, Settings as f, Search as g, RefreshCw as p, Plus as u, Pencil as C, Minus as y, Menu as A, LoaderCircle as w, Info as d, Filter as h, FileUp as I, File as $, EyeOff as b, Eye as U, ExternalLink as k, Ellipsis as v, Download as E, Copy as L, CircleCheck as Z, CircleAlert as m, ChevronUp as z, ChevronRight as D, ChevronLeft as F, ChevronDown as M, Check as j, Calendar as x, ArrowUp as O, ArrowDown as P } from "lucide";
|
|
2
|
+
const n = /* @__PURE__ */ new Map();
|
|
3
|
+
function t(e) {
|
|
4
|
+
return e.replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-zA-Z])(\d)/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
5
|
+
}
|
|
6
|
+
function R(e, r) {
|
|
7
|
+
n.set(t(e), r);
|
|
8
|
+
}
|
|
9
|
+
function S(e) {
|
|
10
|
+
for (const [r, o] of Object.entries(e))
|
|
11
|
+
T(o) && R(r, o);
|
|
12
|
+
}
|
|
13
|
+
function X(e) {
|
|
14
|
+
return n.get(t(e));
|
|
15
|
+
}
|
|
16
|
+
function _() {
|
|
17
|
+
return [...n.keys()].sort();
|
|
18
|
+
}
|
|
19
|
+
function T(e) {
|
|
20
|
+
return Array.isArray(e) && e.every(
|
|
21
|
+
(r) => Array.isArray(r) && typeof r[0] == "string" && typeof r[1] == "object" && r[1] !== null
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
const K = {
|
|
25
|
+
ArrowDown: P,
|
|
26
|
+
ArrowUp: O,
|
|
27
|
+
Calendar: x,
|
|
28
|
+
Check: j,
|
|
29
|
+
ChevronDown: M,
|
|
30
|
+
ChevronLeft: F,
|
|
31
|
+
ChevronRight: D,
|
|
32
|
+
ChevronUp: z,
|
|
33
|
+
CircleAlert: m,
|
|
34
|
+
CircleCheck: Z,
|
|
35
|
+
Copy: L,
|
|
36
|
+
Download: E,
|
|
37
|
+
Ellipsis: v,
|
|
38
|
+
ExternalLink: k,
|
|
39
|
+
Eye: U,
|
|
40
|
+
EyeOff: b,
|
|
41
|
+
File: $,
|
|
42
|
+
FileUp: I,
|
|
43
|
+
Filter: h,
|
|
44
|
+
Info: d,
|
|
45
|
+
LoaderCircle: w,
|
|
46
|
+
Menu: A,
|
|
47
|
+
Minus: y,
|
|
48
|
+
Pencil: C,
|
|
49
|
+
Plus: u,
|
|
50
|
+
RefreshCw: p,
|
|
51
|
+
Search: g,
|
|
52
|
+
Settings: f,
|
|
53
|
+
Trash2: l,
|
|
54
|
+
TriangleAlert: c,
|
|
55
|
+
Upload: i,
|
|
56
|
+
User: a,
|
|
57
|
+
X: s
|
|
58
|
+
};
|
|
59
|
+
S(K);
|
|
60
|
+
export {
|
|
61
|
+
S as a,
|
|
62
|
+
_ as b,
|
|
63
|
+
K as d,
|
|
64
|
+
X as g,
|
|
65
|
+
R as r,
|
|
66
|
+
t
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=defaults-Cpeg13O5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults-Cpeg13O5.js","sources":["../../src/icons/registry.ts","../../src/icons/defaults.ts"],"sourcesContent":["/**\n * The icon registry.\n *\n * `<kt-icon>` looks icons up by name at render time, which means the set of\n * icons cannot be statically analysed and a bundler cannot tree-shake it. So\n * Kanto does not bundle all two thousand Lucide icons: the elements register\n * the handful they need themselves, and an application registers whatever else\n * it uses.\n *\n * import { Rocket, Wallet } from 'lucide';\n * import { registerIcons } from 'kanto-ds/icons';\n *\n * registerIcons({ Rocket, Wallet });\n *\n * Names are normalised to kebab-case, so `Rocket`, `rocket` and\n * `ChevronDown` / `chevron-down` all resolve.\n */\n\n/** A Lucide icon: a flat list of SVG children, each `[tag, attributes]`. */\nexport type IconNode = [tag: string, attrs: Record<string, string | number | undefined>][];\n\nconst registry = new Map<string, IconNode>();\n\n/**\n * `ChevronDown` → `chevron-down`, `Trash2` → `trash-2`, `AArrowDown` →\n * `a-arrow-down`.\n *\n * The digit boundary matters: Lucide names that icon `trash-2`, so a rule that\n * only splits on case produces `trash2` and the lookup quietly misses.\n */\nexport function toKebabCase(name: string): string {\n return name\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2') // acronym run before a word\n .replace(/([a-zA-Z])(\\d)/g, '$1-$2') // letter before a digit\n .replace(/([a-z])([A-Z])/g, '$1-$2') // ordinary camel boundary\n .replace(/[\\s_]+/g, '-')\n .toLowerCase();\n}\n\n/** Registers a single icon under `name`. */\nexport function registerIcon(name: string, node: IconNode): void {\n registry.set(toKebabCase(name), node);\n}\n\n/**\n * Registers a map of icons. Accepts a Lucide namespace import directly:\n * every non-icon export (`createElement`, `createIcons`, …) is skipped.\n */\nexport function registerIcons(icons: Record<string, unknown>): void {\n for (const [name, node] of Object.entries(icons)) {\n if (isIconNode(node)) registerIcon(name, node);\n }\n}\n\n/** Returns the icon registered under `name`, or `undefined`. */\nexport function getIcon(name: string): IconNode | undefined {\n return registry.get(toKebabCase(name));\n}\n\n/** Every registered name, kebab-cased and sorted. Useful for docs and tests. */\nexport function registeredIcons(): string[] {\n return [...registry.keys()].sort();\n}\n\nfunction isIconNode(value: unknown): value is IconNode {\n return (\n Array.isArray(value) &&\n value.every(\n (child) =>\n Array.isArray(child) &&\n typeof child[0] === 'string' &&\n typeof child[1] === 'object' &&\n child[1] !== null,\n )\n );\n}\n","/**\n * The icons the design system uses in its own elements, and the few a first\n * screen reaches for — plus, pencil, settings, download, upload, an external\n * link, a filter, an ellipsis, a refresh — so a button copied from the docs\n * draws its icon without a registration step.\n *\n * Importing any Kanto element pulls this set in — roughly 3 kB of path data,\n * the price of `<kt-select>` drawing its own chevron and a first `icon=\"plus\"`\n * working. Other application icons are registered through `registerIcons`.\n */\nimport {\n ArrowDown,\n ArrowUp,\n Calendar,\n Check,\n ChevronDown,\n ChevronLeft,\n ChevronRight,\n ChevronUp,\n CircleAlert,\n CircleCheck,\n Copy,\n Download,\n Ellipsis,\n ExternalLink,\n Eye,\n EyeOff,\n File,\n FileUp,\n Filter,\n Info,\n LoaderCircle,\n Menu,\n Minus,\n Pencil,\n Plus,\n RefreshCw,\n Search,\n Settings,\n Trash2,\n TriangleAlert,\n Upload,\n User,\n X,\n} from 'lucide';\n// The sibling registry, not the `kanto-ds` barrel: the barrel pulls in every\n// element, and one of them pulls in this file — a cycle that leaves\n// `registerIcons` undefined by the time the call below runs.\nimport { registerIcons } from './registry.js';\n\n/** Icons referenced by Kanto elements, keyed by their Lucide name. */\nexport const defaultIcons = {\n ArrowDown,\n ArrowUp,\n Calendar,\n Check,\n ChevronDown,\n ChevronLeft,\n ChevronRight,\n ChevronUp,\n CircleAlert,\n CircleCheck,\n Copy,\n Download,\n Ellipsis,\n ExternalLink,\n Eye,\n EyeOff,\n File,\n FileUp,\n Filter,\n Info,\n LoaderCircle,\n Menu,\n Minus,\n Pencil,\n Plus,\n RefreshCw,\n Search,\n Settings,\n Trash2,\n TriangleAlert,\n Upload,\n User,\n X,\n};\n\nregisterIcons(defaultIcons);\n"],"names":["registry","toKebabCase","name","registerIcon","node","registerIcons","icons","isIconNode","getIcon","registeredIcons","value","child","defaultIcons","ArrowDown","ArrowUp","Calendar","Check","ChevronDown","ChevronLeft","ChevronRight","ChevronUp","CircleAlert","CircleCheck","Copy","Download","Ellipsis","ExternalLink","Eye","EyeOff","File","FileUp","Filter","Info","LoaderCircle","Menu","Minus","Pencil","Plus","RefreshCw","Search","Settings","Trash2","TriangleAlert","Upload","User","X"],"mappings":";AAqBA,MAAMA,wBAAe,IAAA;AASd,SAASC,EAAYC,GAAsB;AAChD,SAAOA,EACJ,QAAQ,yBAAyB,OAAO,EACxC,QAAQ,mBAAmB,OAAO,EAClC,QAAQ,mBAAmB,OAAO,EAClC,QAAQ,WAAW,GAAG,EACtB,YAAA;AACL;AAGO,SAASC,EAAaD,GAAcE,GAAsB;AAC/D,EAAAJ,EAAS,IAAIC,EAAYC,CAAI,GAAGE,CAAI;AACtC;AAMO,SAASC,EAAcC,GAAsC;AAClE,aAAW,CAACJ,GAAME,CAAI,KAAK,OAAO,QAAQE,CAAK;AAC7C,IAAIC,EAAWH,CAAI,KAAGD,EAAaD,GAAME,CAAI;AAEjD;AAGO,SAASI,EAAQN,GAAoC;AAC1D,SAAOF,EAAS,IAAIC,EAAYC,CAAI,CAAC;AACvC;AAGO,SAASO,IAA4B;AAC1C,SAAO,CAAC,GAAGT,EAAS,KAAA,CAAM,EAAE,KAAA;AAC9B;AAEA,SAASO,EAAWG,GAAmC;AACrD,SACE,MAAM,QAAQA,CAAK,KACnBA,EAAM;AAAA,IACJ,CAACC,MACC,MAAM,QAAQA,CAAK,KACnB,OAAOA,EAAM,CAAC,KAAM,YACpB,OAAOA,EAAM,CAAC,KAAM,YACpBA,EAAM,CAAC,MAAM;AAAA,EAAA;AAGrB;ACxBO,MAAMC,IAAe;AAAA,EAC1B,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,GAAAC;AACF;AAEAxC,EAAcO,CAAY;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css as f, html as c, nothing as l } from "lit";
|
|
2
2
|
import { property as n } from "lit/decorators.js";
|
|
3
3
|
import { K as m, d as u } from "../../../chunks/kt-element-T0VbIBNp.js";
|
|
4
|
-
import { g as v } from "../../../chunks/defaults-
|
|
4
|
+
import { g as v } from "../../../chunks/defaults-Cpeg13O5.js";
|
|
5
5
|
var w = Object.defineProperty, o = (i, e, r, h) => {
|
|
6
6
|
for (var t = void 0, a = i.length - 1, d; a >= 0; a--)
|
|
7
7
|
(d = i[a]) && (t = d(e, r, t) || t);
|
package/dist/icons/defaults.d.ts
CHANGED
|
@@ -11,17 +11,26 @@ export declare const defaultIcons: {
|
|
|
11
11
|
CircleAlert: import("lucide").IconNode;
|
|
12
12
|
CircleCheck: import("lucide").IconNode;
|
|
13
13
|
Copy: import("lucide").IconNode;
|
|
14
|
+
Download: import("lucide").IconNode;
|
|
15
|
+
Ellipsis: import("lucide").IconNode;
|
|
16
|
+
ExternalLink: import("lucide").IconNode;
|
|
14
17
|
Eye: import("lucide").IconNode;
|
|
15
18
|
EyeOff: import("lucide").IconNode;
|
|
16
19
|
File: import("lucide").IconNode;
|
|
17
20
|
FileUp: import("lucide").IconNode;
|
|
21
|
+
Filter: import("lucide").IconNode;
|
|
18
22
|
Info: import("lucide").IconNode;
|
|
19
23
|
LoaderCircle: import("lucide").IconNode;
|
|
20
24
|
Menu: import("lucide").IconNode;
|
|
21
25
|
Minus: import("lucide").IconNode;
|
|
26
|
+
Pencil: import("lucide").IconNode;
|
|
27
|
+
Plus: import("lucide").IconNode;
|
|
28
|
+
RefreshCw: import("lucide").IconNode;
|
|
22
29
|
Search: import("lucide").IconNode;
|
|
30
|
+
Settings: import("lucide").IconNode;
|
|
23
31
|
Trash2: import("lucide").IconNode;
|
|
24
32
|
TriangleAlert: import("lucide").IconNode;
|
|
33
|
+
Upload: import("lucide").IconNode;
|
|
25
34
|
User: import("lucide").IconNode;
|
|
26
35
|
X: import("lucide").IconNode;
|
|
27
36
|
};
|
package/dist/icons/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -48,7 +48,7 @@ import { KtPagination as He } from "./components/data/kt-pagination/kt-paginatio
|
|
|
48
48
|
import { KtStat as je } from "./components/data/kt-stat/kt-stat.js";
|
|
49
49
|
import { KtTable as ze } from "./components/data/kt-table/kt-table.js";
|
|
50
50
|
import { KtTimeline as Xe, KtTimelineItem as We } from "./components/data/kt-timeline/kt-timeline.js";
|
|
51
|
-
import { g as Ze, r as qe, a as Je, b as Qe } from "./chunks/defaults-
|
|
51
|
+
import { g as Ze, r as qe, a as Je, b as Qe } from "./chunks/defaults-Cpeg13O5.js";
|
|
52
52
|
import { d as eo, s as oo, r as ro, a as no } from "./chunks/index-TWJzttLX.js";
|
|
53
53
|
import { K as so, d as co } from "./chunks/kt-element-T0VbIBNp.js";
|
|
54
54
|
const C = (t) => {
|
package/dist/web-types.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kanto-ds",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Framework-agnostic design system for data-dense product interfaces.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
"type": "module",
|
|
24
24
|
"sideEffects": [
|
|
25
25
|
"*.css",
|
|
26
|
+
"./dist/index.js",
|
|
27
|
+
"./dist/vue/index.js",
|
|
28
|
+
"./src/index.ts",
|
|
29
|
+
"./src/vue/index.ts",
|
|
26
30
|
"./dist/components/**",
|
|
27
31
|
"./dist/icons/defaults.js",
|
|
28
32
|
"./src/components/**",
|
|
@@ -298,8 +302,9 @@
|
|
|
298
302
|
"format:check": "prettier --check .",
|
|
299
303
|
"clean": "node -e \"fs.rmSync(dist,{recursive:true,force:true})\"",
|
|
300
304
|
"check:exports": "node scripts/check-exports.js",
|
|
305
|
+
"check:consumer": "node scripts/check-consumer.js",
|
|
301
306
|
"check:size": "node scripts/check-size.js",
|
|
302
|
-
"verify": "npm run format:check && npm run lint && npm run typecheck && npm run test && npm run build && npm run check:exports && npm run check:size && npm run build:demo",
|
|
307
|
+
"verify": "npm run format:check && npm run lint && npm run typecheck && npm run test && npm run build && npm run check:exports && npm run check:consumer && npm run check:size && npm run build:demo",
|
|
303
308
|
"release": "node scripts/release.js",
|
|
304
309
|
"release:dry": "node scripts/release.js --dry-run",
|
|
305
310
|
"prepublishOnly": "npm run verify"
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { X as s, User as a, TriangleAlert as c, Trash2 as i, Search as f, Minus as g, Menu as p, LoaderCircle as u, Info as C, FileUp as l, File as y, EyeOff as A, Eye as I, Copy as h, CircleCheck as w, CircleAlert as $, ChevronUp as b, ChevronRight as d, ChevronLeft as v, ChevronDown as U, Check as Z, Calendar as k, ArrowUp as m, ArrowDown as z } from "lucide";
|
|
2
|
-
const n = /* @__PURE__ */ new Map();
|
|
3
|
-
function t(e) {
|
|
4
|
-
return e.replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-zA-Z])(\d)/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
5
|
-
}
|
|
6
|
-
function L(e, r) {
|
|
7
|
-
n.set(t(e), r);
|
|
8
|
-
}
|
|
9
|
-
function M(e) {
|
|
10
|
-
for (const [r, o] of Object.entries(e))
|
|
11
|
-
j(o) && L(r, o);
|
|
12
|
-
}
|
|
13
|
-
function F(e) {
|
|
14
|
-
return n.get(t(e));
|
|
15
|
-
}
|
|
16
|
-
function O() {
|
|
17
|
-
return [...n.keys()].sort();
|
|
18
|
-
}
|
|
19
|
-
function j(e) {
|
|
20
|
-
return Array.isArray(e) && e.every(
|
|
21
|
-
(r) => Array.isArray(r) && typeof r[0] == "string" && typeof r[1] == "object" && r[1] !== null
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
const D = {
|
|
25
|
-
ArrowDown: z,
|
|
26
|
-
ArrowUp: m,
|
|
27
|
-
Calendar: k,
|
|
28
|
-
Check: Z,
|
|
29
|
-
ChevronDown: U,
|
|
30
|
-
ChevronLeft: v,
|
|
31
|
-
ChevronRight: d,
|
|
32
|
-
ChevronUp: b,
|
|
33
|
-
CircleAlert: $,
|
|
34
|
-
CircleCheck: w,
|
|
35
|
-
Copy: h,
|
|
36
|
-
Eye: I,
|
|
37
|
-
EyeOff: A,
|
|
38
|
-
File: y,
|
|
39
|
-
FileUp: l,
|
|
40
|
-
Info: C,
|
|
41
|
-
LoaderCircle: u,
|
|
42
|
-
Menu: p,
|
|
43
|
-
Minus: g,
|
|
44
|
-
Search: f,
|
|
45
|
-
Trash2: i,
|
|
46
|
-
TriangleAlert: c,
|
|
47
|
-
User: a,
|
|
48
|
-
X: s
|
|
49
|
-
};
|
|
50
|
-
M(D);
|
|
51
|
-
export {
|
|
52
|
-
M as a,
|
|
53
|
-
O as b,
|
|
54
|
-
D as d,
|
|
55
|
-
F as g,
|
|
56
|
-
L as r,
|
|
57
|
-
t
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=defaults-CFrjqae2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaults-CFrjqae2.js","sources":["../../src/icons/registry.ts","../../src/icons/defaults.ts"],"sourcesContent":["/**\n * The icon registry.\n *\n * `<kt-icon>` looks icons up by name at render time, which means the set of\n * icons cannot be statically analysed and a bundler cannot tree-shake it. So\n * Kanto does not bundle all two thousand Lucide icons: the elements register\n * the handful they need themselves, and an application registers whatever else\n * it uses.\n *\n * import { Rocket, Wallet } from 'lucide';\n * import { registerIcons } from 'kanto-ds/icons';\n *\n * registerIcons({ Rocket, Wallet });\n *\n * Names are normalised to kebab-case, so `Rocket`, `rocket` and\n * `ChevronDown` / `chevron-down` all resolve.\n */\n\n/** A Lucide icon: a flat list of SVG children, each `[tag, attributes]`. */\nexport type IconNode = [tag: string, attrs: Record<string, string | number | undefined>][];\n\nconst registry = new Map<string, IconNode>();\n\n/**\n * `ChevronDown` → `chevron-down`, `Trash2` → `trash-2`, `AArrowDown` →\n * `a-arrow-down`.\n *\n * The digit boundary matters: Lucide names that icon `trash-2`, so a rule that\n * only splits on case produces `trash2` and the lookup quietly misses.\n */\nexport function toKebabCase(name: string): string {\n return name\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2') // acronym run before a word\n .replace(/([a-zA-Z])(\\d)/g, '$1-$2') // letter before a digit\n .replace(/([a-z])([A-Z])/g, '$1-$2') // ordinary camel boundary\n .replace(/[\\s_]+/g, '-')\n .toLowerCase();\n}\n\n/** Registers a single icon under `name`. */\nexport function registerIcon(name: string, node: IconNode): void {\n registry.set(toKebabCase(name), node);\n}\n\n/**\n * Registers a map of icons. Accepts a Lucide namespace import directly:\n * every non-icon export (`createElement`, `createIcons`, …) is skipped.\n */\nexport function registerIcons(icons: Record<string, unknown>): void {\n for (const [name, node] of Object.entries(icons)) {\n if (isIconNode(node)) registerIcon(name, node);\n }\n}\n\n/** Returns the icon registered under `name`, or `undefined`. */\nexport function getIcon(name: string): IconNode | undefined {\n return registry.get(toKebabCase(name));\n}\n\n/** Every registered name, kebab-cased and sorted. Useful for docs and tests. */\nexport function registeredIcons(): string[] {\n return [...registry.keys()].sort();\n}\n\nfunction isIconNode(value: unknown): value is IconNode {\n return (\n Array.isArray(value) &&\n value.every(\n (child) =>\n Array.isArray(child) &&\n typeof child[0] === 'string' &&\n typeof child[1] === 'object' &&\n child[1] !== null,\n )\n );\n}\n","/**\n * The icons the design system uses in its own elements.\n *\n * Importing any Kanto element pulls this set in — roughly 2 kB of path data,\n * the price of `<kt-select>` being able to draw its own chevron. Application\n * icons are registered separately through `registerIcons`.\n */\nimport {\n ArrowDown,\n ArrowUp,\n Calendar,\n Check,\n ChevronDown,\n ChevronLeft,\n ChevronRight,\n ChevronUp,\n CircleAlert,\n CircleCheck,\n Copy,\n Eye,\n EyeOff,\n File,\n FileUp,\n Info,\n LoaderCircle,\n Menu,\n Minus,\n Search,\n Trash2,\n TriangleAlert,\n User,\n X,\n} from 'lucide';\n// The sibling registry, not the `kanto-ds` barrel: the barrel pulls in every\n// element, and one of them pulls in this file — a cycle that leaves\n// `registerIcons` undefined by the time the call below runs.\nimport { registerIcons } from './registry.js';\n\n/** Icons referenced by Kanto elements, keyed by their Lucide name. */\nexport const defaultIcons = {\n ArrowDown,\n ArrowUp,\n Calendar,\n Check,\n ChevronDown,\n ChevronLeft,\n ChevronRight,\n ChevronUp,\n CircleAlert,\n CircleCheck,\n Copy,\n Eye,\n EyeOff,\n File,\n FileUp,\n Info,\n LoaderCircle,\n Menu,\n Minus,\n Search,\n Trash2,\n TriangleAlert,\n User,\n X,\n};\n\nregisterIcons(defaultIcons);\n"],"names":["registry","toKebabCase","name","registerIcon","node","registerIcons","icons","isIconNode","getIcon","registeredIcons","value","child","defaultIcons","ArrowDown","ArrowUp","Calendar","Check","ChevronDown","ChevronLeft","ChevronRight","ChevronUp","CircleAlert","CircleCheck","Copy","Eye","EyeOff","File","FileUp","Info","LoaderCircle","Menu","Minus","Search","Trash2","TriangleAlert","User","X"],"mappings":";AAqBA,MAAMA,wBAAe,IAAA;AASd,SAASC,EAAYC,GAAsB;AAChD,SAAOA,EACJ,QAAQ,yBAAyB,OAAO,EACxC,QAAQ,mBAAmB,OAAO,EAClC,QAAQ,mBAAmB,OAAO,EAClC,QAAQ,WAAW,GAAG,EACtB,YAAA;AACL;AAGO,SAASC,EAAaD,GAAcE,GAAsB;AAC/D,EAAAJ,EAAS,IAAIC,EAAYC,CAAI,GAAGE,CAAI;AACtC;AAMO,SAASC,EAAcC,GAAsC;AAClE,aAAW,CAACJ,GAAME,CAAI,KAAK,OAAO,QAAQE,CAAK;AAC7C,IAAIC,EAAWH,CAAI,KAAGD,EAAaD,GAAME,CAAI;AAEjD;AAGO,SAASI,EAAQN,GAAoC;AAC1D,SAAOF,EAAS,IAAIC,EAAYC,CAAI,CAAC;AACvC;AAGO,SAASO,IAA4B;AAC1C,SAAO,CAAC,GAAGT,EAAS,KAAA,CAAM,EAAE,KAAA;AAC9B;AAEA,SAASO,EAAWG,GAAmC;AACrD,SACE,MAAM,QAAQA,CAAK,KACnBA,EAAM;AAAA,IACJ,CAACC,MACC,MAAM,QAAQA,CAAK,KACnB,OAAOA,EAAM,CAAC,KAAM,YACpB,OAAOA,EAAM,CAAC,KAAM,YACpBA,EAAM,CAAC,MAAM;AAAA,EAAA;AAGrB;ACpCO,MAAMC,IAAe;AAAA,EAC1B,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,MAAAC;AAAA,EACA,GAAAC;AACF;AAEA/B,EAAcO,CAAY;"}
|