@kungal/ui-core 1.6.1 → 1.6.3

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/CHANGELOG.md ADDED
@@ -0,0 +1,362 @@
1
+ # @kungal/ui-core
2
+
3
+ ## 1.6.3
4
+
5
+ ## 1.6.2
6
+
7
+ ### Patch Changes
8
+
9
+ - 05f2bee: chore: ship CHANGELOG.md in the published packages
10
+
11
+ `CHANGELOG.md` is now included in each package's npm tarball (added to `files`),
12
+ so downstream can read the per-version changes straight from the npm package
13
+ page — not only from the GitHub repo. (Releases also now appear on GitHub
14
+ Releases and the docs site's auto-generated /changelog page.)
15
+
16
+ ## 1.6.1
17
+
18
+ ## 1.6.0
19
+
20
+ ## 1.5.0
21
+
22
+ ### Minor Changes
23
+
24
+ - 13005ea: fix(vue): legible foreground on solid/filled color variants (esp. dark mode)
25
+
26
+ Solid fills painted white text on `bg-{color}`, which has two problems verified
27
+ by contrast measurement:
28
+
29
+ 1. The dark color scale is inverted, so a plain `bg-{color}` renders **pale** in
30
+ dark mode — white text dropped to ~1.0–2.5:1 (the `solid` Info `info` callout
31
+ was essentially invisible, white on near-white).
32
+ 2. The light hues (secondary / success / warning / info) are light in **both**
33
+ modes, so white text fails WCAG everywhere (~2:1), not just in dark mode.
34
+
35
+ New single source of truth in `@kungal/ui-core` — `kunSolidClasses`,
36
+ `kunSolidBgClasses`, `kunSolidFgClasses` — pairs each fill with a `dark:bg-*`
37
+ pin (stays saturated in dark mode) and a contrast-correct foreground: the dark
38
+ hues (default / primary / danger) keep white, the light hues take dark text.
39
+ Every solid foreground now clears WCAG AA in both modes (≈4.1–10.3:1).
40
+
41
+ Applied to: Button / Chip (shared variant matrix), Info (`solid` / `shadow` — the
42
+ reported bug; its title no longer overrides the box foreground), Badge, Progress
43
+ (on-bar label), Tab (`solid` / `pills`), DatePicker (selected day), CheckBox
44
+ (checked fill + check/dash mark), Switch (on-track).
45
+
46
+ Visible change: `secondary` / `success` / `warning` / `info` solid components now
47
+ use dark text instead of (illegible) white.
48
+
49
+ ## 1.4.2
50
+
51
+ ## 1.4.1
52
+
53
+ ## 1.4.0
54
+
55
+ ## 1.3.0
56
+
57
+ ## 1.2.0
58
+
59
+ ## 1.1.1
60
+
61
+ ## 1.1.0
62
+
63
+ ## 1.0.0
64
+
65
+ ### Major Changes
66
+
67
+ - ac0bd4e: 1.0.0 — first stable release.
68
+
69
+ The component set (57 Vue components) and the design-token system are stable and
70
+ documented. Over the 0.14 → 0.22 line every cross-cutting surface was routed
71
+ through a single source of truth: borders (`--color-kun-border` / `border-kun`),
72
+ focus rings (`kunFocusRingClasses`), corner radius (`rounded-kun-*` /
73
+ `--kun-radius-scale`), elevation (`--shadow-kun-*`), motion (`--kun-dur-*` +
74
+ `duration-kun-*` + `ease-kun-*`), and sizing (`kunControlSize` /
75
+ `kunSelectionSize` / `kunChipSize`).
76
+
77
+ Also fixes a registration gap surfaced while completing the docs: `KunAutocomplete`,
78
+ `KunNumberInput`, and `KunPinInput` (added in 0.14.0) were never added to the Nuxt
79
+ layer's auto-import list, so Nuxt consumers hit "Failed to resolve component". They
80
+ now auto-import like every other component (plain-Vue `app.use(KunUI)` already
81
+ registered them). Their docs pages, prop tables, and `llms.txt` entries are added.
82
+
83
+ ## 0.22.4
84
+
85
+ ## 0.22.3
86
+
87
+ ## 0.22.2
88
+
89
+ ### Patch Changes
90
+
91
+ - 957cb52: fix(core): `shadow` button variant now actually casts its colored glow
92
+
93
+ The `shadow` variant set a shadow _color_ (`shadow-{color}/40`) but never a shadow
94
+ _size_, so `--tw-shadow` stayed empty and the button rendered with `box-shadow:
95
+ none` — it looked identical to `solid`. Added `shadow-lg` to every entry so the
96
+ geometry exists and the tint applies: each shadow button now floats with a soft
97
+ diffuse glow in its own color (the button's `overflow-hidden` doesn't clip an
98
+ outset box-shadow, so it shows in both themes).
99
+
100
+ ## 0.22.1
101
+
102
+ ### Patch Changes
103
+
104
+ - be17775: fix(core): consistent dark-mode fill for solid / shadow buttons
105
+
106
+ Filled (`solid` / `shadow`) buttons keep white text in both themes, but the dark
107
+ color scale is inverted — `bg-{color}` (a `-500`/`-600` step) renders _light_ in
108
+ dark mode, so the fills came out pale and at wildly different levels: `info`
109
+ ≈ L88% (near-white, white text barely legible), `default` ≈ L65%, `secondary`
110
+ ≈ L72%, and `success` disagreed between the two variants (solid pinned
111
+ `dark:bg-success-300` ≈ L35% while shadow used the un-pinned `bg-success-600`
112
+ ≈ L66%).
113
+
114
+ Each color now pins a `dark:bg-{color}-{n}` so every solid/shadow button lands at
115
+ a consistent ~L44–55% in dark mode (info/success/default → ~L44–46, the rest
116
+ ~L47–55) — one saturated tier with legible white text. Light mode is unchanged.
117
+
118
+ ## 0.22.0
119
+
120
+ ## 0.21.0
121
+
122
+ ### Minor Changes
123
+
124
+ - 3e841f0: feat: align form labels / error text and unify the chip-tag size scale
125
+
126
+ The core size system was already consistent (form controls share
127
+ `kunControlSizeClasses`, checkbox/radio share `kunSelectionSizeClasses`). The
128
+ drift was in the peripheral bits:
129
+
130
+ - **Form labels** now identical everywhere: `KunTextarea` and `KunDatePicker`
131
+ labels gained the `text-default-700` tint, and `KunDatePicker` dropped its odd
132
+ `mb-2` for the standard `mb-1`.
133
+ - **Error messages** now identical: `KunTextarea` switched from `text-danger-600`
134
+ (and a `<div>`) to the standard `text-danger` `<p>`; `KunDatePicker` and
135
+ `KunRadioGroup` dropped `mt-2` for `mt-1`.
136
+ - **Chip / tag size**: new `kunChipSizeClasses` in `@kungal/ui-core` is the single
137
+ source for chip/tag pills. `KunChip` and the tags inside `KunTagInput` now share
138
+ it (and the pill `rounded-full` shape), so a tag looks identical to a standalone
139
+ `<KunChip>` of the same size instead of being a one-off smaller rounded-rect.
140
+
141
+ Tab keeps its intentionally-compact tab scale; Switch/Slider keep their
142
+ dimension-specific scales.
143
+
144
+ ## 0.20.0
145
+
146
+ ## 0.19.1
147
+
148
+ ## 0.19.0
149
+
150
+ ### Minor Changes
151
+
152
+ - d8e7e76: feat: KunTab `align` prop + one unified focus ring across every control
153
+
154
+ **KunTab `align`** — new `align?: 'start' | 'center' | 'end'` (default `'center'`)
155
+ controls how each tab's content sits inside its box. Mainly for vertical /
156
+ full-width tabs, where the box is wider than its label.
157
+
158
+ **Unified focus ring** — focus indication was a mess: `:focus` vs `:focus-within`
159
+ vs `:focus-visible`, ring widths `1`/`2`/`4`, opacities `/25`/`/40`/`/50`/full,
160
+ some controls dropped their border to fake a ring (a jarring jump), and Button /
161
+ CheckBox had **no** focus ring at all. Everything now routes through one recipe:
162
+
163
+ - New `kunFocusRingClasses` (direct controls) and `kunFocusRingWithinClasses`
164
+ (composite wrappers) in `@kungal/ui-core`. One recipe: keyboard-only
165
+ (`focus-visible`; text fields still show it on click), a flush **2px** ring in
166
+ the control's semantic color at **/50**, no border-transparent jump.
167
+ - Migrated Input, Textarea, Select, Autocomplete, NumberInput, DatePicker,
168
+ PinInput, TagInput, Pagination, RadioGroup, **Button** (offset ring, added) and
169
+ **CheckBox** (added) onto it. Composite widgets (NumberInput / TagInput) ring
170
+ the wrapper via `focus-within` and the inner `<input>` has no ring of its own,
171
+ so there's exactly one indicator.
172
+ - Invalid controls turn the ring **danger** (same mechanism, swapped color).
173
+ - **Deprecated:** `kunRingClasses` (mixed `:focus`/`:focus-within`, off-opacity).
174
+ Use `kunFocusRingClasses` / `kunFocusRingWithinClasses`.
175
+
176
+ No prop/API removals — purely additive plus a visual refinement of focus states.
177
+
178
+ ## 0.18.1
179
+
180
+ ## 0.18.0
181
+
182
+ ## 0.17.2
183
+
184
+ ## 0.17.1
185
+
186
+ ## 0.17.0
187
+
188
+ ## 0.16.0
189
+
190
+ ## 0.15.0
191
+
192
+ ## 0.14.0
193
+
194
+ ### Minor Changes
195
+
196
+ - cd404aa: 表单 / 输入控件第一批升级:对标 HeroUI / Mantine / Ant Design / PrimeVue / Naive,补齐 API 完备性、一致性与高级控件。
197
+
198
+ 新增组件
199
+
200
+ - **KunNumberInput** —— 数字步进输入:`min`/`max`/`step`/`precision` 钳制与四舍五入、−/+ 步进按钮(到边界自动禁用)、`ArrowUp/Down`·`PageUp/Down` 键盘、`role="spinbutton"` 无障碍、`name` 原生表单收集。
201
+ - **KunPinInput** —— OTP / 验证码分段输入:`length`、`type`(numeric/text)、`mask`、自动前进/退格回退、粘贴自动分发、方向键、`complete` 事件、`autocomplete="one-time-code"`。
202
+ - **KunAutocomplete** —— 组合框(combobox):文本输入 + 建议列表,客户端过滤或 `manualFilter` + `@search`(远程),`allowCustomValue`、`clearable`、键盘导航、`aria-autocomplete`。
203
+
204
+ 升级
205
+
206
+ - **KunSelect** —— 补齐键盘可达性(P0):方向键 / Enter / Space / Esc / Home / End / 首字母 type-ahead + `aria-activedescendant`,禁用项自动跳过;新增 `searchable`(列表内过滤)、`multiple`(可移除 chips)、`clearable`、`description`、`name`(隐藏域)、选项 `disabled`。
207
+ - **KunSlider** —— 默认 `min`/`max` 由 17–77 改为 **0–100**;修复 `reactive(props)` 拷贝导致改 prop 不更新的响应式缺陷;新增 `disabled`、`label`/`ariaLabel`、`error`/`description`、`color`、`marks`、值气泡 `showTooltip`、`showValue`、`formatValue`、`change` 事件。
208
+ - **KunCheckBox** —— 新增 `indeterminate`(三态,用于全选)+ `error`/`description`。
209
+ - **KunInput** —— 新增 `isClearable`、`revealPassword`(密码可见性切换)、`isInvalid` + `aria-invalid`/`aria-describedby`。
210
+ - **KunSwitch** —— 新增 `error`/`description`。
211
+
212
+ 统一
213
+
214
+ - 辅助文案统一为 `description`(对齐 HeroUI / React-Aria);`helperText`(Input/TagInput)与 `hint`(Textarea/FileInput/Upload)保留为 **已弃用别名**,仍可用,内部回退到 `description`。
215
+
216
+ Breaking(0.x minor)
217
+
218
+ - `KunSlider` 默认 `min`/`max` 改为 0–100(此前 17–77):依赖旧默认值的调用需显式传入。
219
+ - `KunSelect` 的 v-model 类型放宽为 `T | T[] | null`(支持 `multiple` 与清除);单选用法不受运行时影响,仅 TS 类型变宽。
220
+
221
+ 新增打包图标(构建期内联,运行时零请求):`lucide:minus`、`eye`、`eye-off`、`search`。
222
+
223
+ ## 0.13.0
224
+
225
+ ## 0.12.0
226
+
227
+ ## 0.11.0
228
+
229
+ ## 0.10.0
230
+
231
+ ## 0.9.0
232
+
233
+ ## 0.8.0
234
+
235
+ ### Minor Changes
236
+
237
+ - 7624924: Extend the unified size system to the non-text controls.
238
+
239
+ The first sizing pass only covered text controls (button/input/select/…). This
240
+ brings the selection + display controls onto the same coherent system, grounded
241
+ in how HeroUI / PrimeVue / Naive UI / Mantine / Ant size them.
242
+
243
+ - **New shared selection scale (`kunSelectionSizeClasses`, @kungal/ui-core)** —
244
+ KunCheckBox and KunRadioGroup now use **identical** box sizes (every major
245
+ library does this), so a checkbox and a radio of the same size match. Box px by
246
+ size: 12 / 14 / 16 / 20 / 24 — ≈ 0.5× the text-control height and ≈ 1.2–1.4× the
247
+ label font, so the box sits optically level with its label.
248
+ - **KunCheckBox gains a `size` prop** (`xs`–`xl`, default `md`). It was hardcoded
249
+ at 20px while its sibling KunRadioGroup scaled 12→24 — now they share one scale
250
+ (md box is 16px). The check glyph and label scale with it.
251
+ - **KunSwitch gains a `size` prop.** Track/thumb scale on clean steps (track
252
+ 28×16 → 64×32, thumb = track height − 4); `md` is the original switch size.
253
+ - **KunSlider gains a `size` prop.** Track 4→12px, thumb 14→28px; `md` unchanged.
254
+ - **KunChip** moved onto its proper compact sub-scale (≈ 0.7× the button height at
255
+ the same keyword — a tag is text + tight padding, not a tap target); its `md`/
256
+ `lg`/`xl` vertical padding is slightly tighter so chips no longer read as tall
257
+ as buttons.
258
+
259
+ Components sized by their content/padding rather than a height (KunTooltip,
260
+ KunDropdown/KunContextMenu menus, KunPopover, KunInfo) intentionally keep no
261
+ `size` prop — no surveyed library gives them one.
262
+
263
+ ## 0.7.0
264
+
265
+ ### Minor Changes
266
+
267
+ - 29a39a7: Unify form-control sizing on one shared scale, and fix the `lg`/`xl` button
268
+ proportions.
269
+
270
+ - **New `kunControlSizeClasses` (@kungal/ui-core)** — a single source of truth for
271
+ the per-size font + padding of every text-like form control. Padding-driven,
272
+ `md` (~38px) as the anchor, `px:py` a clean 2:1, horizontal padding growing
273
+ faster than vertical so a bigger control gets wider, not flatter.
274
+ - **KunButton `lg`/`xl` fixed** — `lg` was `px-6 py-2` (3:1) and `xl` was
275
+ `px-8 py-2.5` (3.2:1, a wide flat bar). They're now `px-5 py-2.5` and
276
+ `px-6 py-3` (both 2:1), so large buttons look proportional. `md` is unchanged.
277
+ - **One scale across controls** — KunButton, KunInput, KunSelect, KunDatePicker,
278
+ KunTextarea and KunTagInput all consume the shared scale, so a button, input,
279
+ select and date-picker of the same size line up at the same height in a row
280
+ (md = 38px).
281
+ - **KunSelect / KunDatePicker / KunTextarea gain a `size` prop** (`xs`–`xl`,
282
+ default `md`). Previously they had no size and were locked one notch tighter
283
+ than buttons (`px-3` / `p-3`); their default horizontal padding is now `px-4`,
284
+ matching KunButton/KunInput `md`.
285
+
286
+ Pill/compact display components (KunChip, KunBadge, KunAvatar) are intentionally
287
+ not part of this form-control scale and keep their compact sizing.
288
+
289
+ ## 0.6.2
290
+
291
+ ## 0.6.1
292
+
293
+ ## 0.6.0
294
+
295
+ ## 0.5.2
296
+
297
+ ## 0.5.1
298
+
299
+ ## 0.5.0
300
+
301
+ ## 0.4.1
302
+
303
+ ## 0.4.0
304
+
305
+ ## 0.3.4
306
+
307
+ ## 0.3.3
308
+
309
+ ## 0.3.2
310
+
311
+ ## 0.3.1
312
+
313
+ ## 0.3.0
314
+
315
+ ### Minor Changes
316
+
317
+ - 9b8cbae: Remove the `faded` variant.
318
+
319
+ `faded` (tinted fill + border) was visually almost indistinguishable from
320
+ `ghost`, so it's been dropped from `KunUIVariant`. This affects every variant
321
+ consumer — `KunButton`, `KunChip`, `KunDropdown` and `KunInfo`.
322
+
323
+ **Migration:** replace `variant="faded"` with `variant="flat"` (tinted fill, no
324
+ border) or `variant="bordered"` (visible colored border); `ghost` stays for the
325
+ outline look it overlapped with.
326
+
327
+ ## 0.2.5
328
+
329
+ ## 0.2.4
330
+
331
+ ### Patch Changes
332
+
333
+ - 0ec98f9: Fix invisible outline variants (`bordered` / `faded` / `ghost`) and the
334
+ off-center checkbox check.
335
+
336
+ - **Variant table**: entries set `border-{color}` but never a border _width_ —
337
+ which paints nothing in Tailwind v4, so `bordered` / `faded` / `ghost` showed
338
+ no border on KunButton, KunChip and KunDropdown. Every variant now carries an
339
+ explicit `border` width (transparent on `solid` / `light` / `flat` / `shadow`
340
+ so box sizes stay uniform when switching variants), so the outline variants
341
+ render again.
342
+ - **KunCheckBox**: the checkmark was a full-size (1em) icon nudged down by its
343
+ baseline offset, so it sat off-center and cramped the 20px box edge-to-edge.
344
+ It's now an explicitly-sized 14px check centered with flexbox.
345
+
346
+ ## 0.2.3
347
+
348
+ ## 0.2.2
349
+
350
+ ## 0.2.1
351
+
352
+ ## 0.2.0
353
+
354
+ ### Minor Changes
355
+
356
+ - 35358f2: Settle on the `@kungal/ui-*` package namespace; the four packages are versioned and released together.
357
+
358
+ ## 0.1.1
359
+
360
+ ### Patch Changes
361
+
362
+ - c532a02: Add npm `keywords` to every package for better discoverability on the npm registry.
package/dist/index.cjs CHANGED
@@ -188,6 +188,13 @@ var kunControlSizeClasses = {
188
188
  lg: "text-base px-5 py-2.5",
189
189
  xl: "text-lg px-6 py-3"
190
190
  };
191
+ var kunControlSquareClasses = {
192
+ xs: "size-[26px] p-0",
193
+ sm: "size-[34px] p-0",
194
+ md: "size-[38px] p-0",
195
+ lg: "size-[46px] p-0",
196
+ xl: "size-[54px] p-0"
197
+ };
191
198
  var kunSelectionSizeClasses = {
192
199
  xs: { box: "size-3", dot: "size-1.5", check: "size-2", text: "text-xs", gap: "gap-1.5" },
193
200
  sm: { box: "size-3.5", dot: "size-1.5", check: "size-2.5", text: "text-sm", gap: "gap-2" },
@@ -289,6 +296,7 @@ exports.kunBgClasses = kunBgClasses;
289
296
  exports.kunBorderClasses = kunBorderClasses;
290
297
  exports.kunChipSizeClasses = kunChipSizeClasses;
291
298
  exports.kunControlSizeClasses = kunControlSizeClasses;
299
+ exports.kunControlSquareClasses = kunControlSquareClasses;
292
300
  exports.kunFocusRingClasses = kunFocusRingClasses;
293
301
  exports.kunFocusRingWithinClasses = kunFocusRingWithinClasses;
294
302
  exports.kunRingClasses = kunRingClasses;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cn.ts","../src/variants.ts","../src/rounded.ts","../src/controlSize.ts","../src/random.ts","../src/decodeIfEncoded.ts","../src/getRandomSticker.ts","../src/icons-data.ts","../src/icons.ts"],"names":["twMerge","clsx"],"mappings":";;;;;;AAMO,IAAM,KAAK,CAAA,GAAI,MAAA,KAAiCA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC;;;ACO3E,IAAM,KAAA,GAA0D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU9D,KAAA,EAAO;AAAA,IACL,OAAA,EAAS,qEAAA;AAAA,IACT,OAAA,EAAS,qEAAA;AAAA,IACT,SAAA,EAAW,yEAAA;AAAA,IACX,OAAA,EAAS,yEAAA;AAAA,IACT,OAAA,EAAS,qEAAA;AAAA,IACT,MAAA,EAAQ,mEAAA;AAAA,IACR,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAA,EAAS,sCAAA;AAAA,IACT,OAAA,EAAS,mDAAA;AAAA,IACT,SAAA,EAAW,uDAAA;AAAA,IACX,OAAA,EAAS,mDAAA;AAAA,IACT,OAAA,EAAS,mDAAA;AAAA,IACT,MAAA,EAAQ,iDAAA;AAAA,IACR,IAAA,EAAM;AAAA,GACR;AAAA,EACA,KAAA,EAAO;AAAA,IACL,OAAA,EAAS,8DAAA;AAAA,IACT,OAAA,EAAS,2EAAA;AAAA,IACT,SAAA,EAAW,+EAAA;AAAA,IACX,OAAA,EAAS,2EAAA;AAAA,IACT,OAAA,EAAS,2EAAA;AAAA,IACT,MAAA,E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B,EAAC,MAAA,EAAO,sNAAA,EAAwO;AAAA,EACnQ,YAAA,EAAc,EAAC,MAAA,EAAO,2PAAA,EAA6Q;AAAA,EACnS,gBAAA,EAAkB,EAAC,MAAA,EAAO,oWAAA,EAAkX;AAAA,EAC5Y,eAAA,EAAiB,EAAC,MAAA,EAAO,uKAAA,EAAyL;AAAA,EAClN,8BAAA,EAAgC,EAAC,MAAA,EAAO,wbAAA;AAC1C,CAAA;;;ACvBA,IAAM,WAAW,IAAI,GAAA,CAAyB,MAAA,CAAO,OAAA,CAAQ,iBAAiB,CAAC,CAAA;AAExE,IAAM,eAAA,GAAkB,CAAC,IAAA,EAAc,IAAA,KAA4B;AACxE,EAAA,QAAA,CAAS,GAAA,CAAI,MAAM,IAAI,CAAA;AACzB;AAIO,IAAM,gBAAA,GAAmB,CAC9B,KAAA,KACS;AACT,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,IAAI,CAAA,IAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG,QAAA,CAAS,GAAA,CAAI,IAAA,EAAM,IAAI,CAAA;AAC3E;AAEO,IAAM,UAAA,GAAa,CAAC,IAAA,KACzB,QAAA,CAAS,IAAI,IAAI;AAEZ,IAAM,UAAA,GAAa,CAAC,IAAA,KAA0B,QAAA,CAAS,IAAI,IAAI","file":"index.cjs","sourcesContent":["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\n// Merge Tailwind class names with conflict resolution. Framework-agnostic:\n// the Vue and React layers both import this so \"last class wins\" semantics\n// are identical everywhere.\nexport const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs))\n\nexport type { ClassValue }\n","import type { KunUIVariant, KunUIColor } from './types'\n\n// Single source of truth for the variant × color → Tailwind class table.\n// Button / Badge / Chip / Tab / Info / Progress etc. (in every framework\n// layer) consume this so the 7 × 7 matrix lives in exactly one place.\n//\n// All keys MUST be static string literals so the Tailwind JIT picks them\n// up — never construct class names with template strings at runtime.\n// Every entry carries an explicit `border` WIDTH so the outline variants\n// (bordered / ghost) actually render — `border-{color}` alone sets only the\n// color and paints nothing in Tailwind v4. Filled / light variants use a\n// transparent border of the same width so switching variants never shifts the\n// box by a pixel.\nconst TABLE: Record<KunUIVariant, Record<KunUIColor, string>> = {\n // Filled buttons keep white text in BOTH modes, so the fill must stay dark\n // enough for contrast. The dark color scale is inverted (`-500`/`-600` become\n // LIGHT in dark mode), so a plain `bg-{color}` renders pale — worst on the\n // light hues (info ≈ L88%, default/secondary ≈ L65–72%). Each entry pins a\n // `dark:bg-{color}-{n}` that lands every color at a consistent ~L44–55% so the\n // whole row reads as one saturated tier with legible white text.\n // Foreground: the dark hues take white; the light hues (success / warning /\n // info) are light in BOTH modes, so white text fails WCAG on them (~1.5–3.4:1)\n // — they take dark text (≈6–18:1). See kunSolidFgClasses.\n solid: {\n default: 'border border-transparent bg-default text-white dark:bg-default-400',\n primary: 'border border-transparent bg-primary text-white dark:bg-primary-400',\n secondary: 'border border-transparent bg-secondary text-black dark:bg-secondary-300',\n success: 'border border-transparent bg-success-600 text-black dark:bg-success-400',\n warning: 'border border-transparent bg-warning text-black dark:bg-warning-400',\n danger: 'border border-transparent bg-danger text-white dark:bg-danger-400',\n info: 'border border-transparent bg-info-600 text-black dark:bg-info-300',\n },\n bordered: {\n default: 'border border-default bg-transparent',\n primary: 'border border-primary bg-transparent text-primary',\n secondary: 'border border-secondary bg-transparent text-secondary',\n success: 'border border-success bg-transparent text-success',\n warning: 'border border-warning bg-transparent text-warning',\n danger: 'border border-danger bg-transparent text-danger',\n info: 'border border-info bg-transparent text-info',\n },\n light: {\n default: 'border border-transparent bg-transparent hover:bg-default/20',\n primary: 'border border-transparent bg-transparent text-primary hover:bg-primary/20',\n secondary: 'border border-transparent bg-transparent text-secondary hover:bg-secondary/20',\n success: 'border border-transparent bg-transparent text-success hover:bg-success/20',\n warning: 'border border-transparent bg-transparent text-warning hover:bg-warning/20',\n danger: 'border border-transparent bg-transparent text-danger hover:bg-danger/20',\n info: 'border border-transparent bg-transparent text-info hover:bg-info/20',\n },\n flat: {\n default: 'border border-transparent bg-default/20 text-default-700',\n primary: 'border border-transparent bg-primary/20 text-primary-600',\n secondary: 'border border-transparent bg-secondary/20 text-secondary-600',\n success: 'border border-transparent bg-success/20 text-success-700 dark:text-success',\n warning: 'border border-transparent bg-warning/20 text-warning-700 dark:text-warning',\n danger: 'border border-transparent bg-danger/20 text-danger-600 dark:text-danger-500',\n info: 'border border-transparent bg-info/20 text-info-700 dark:text-info-500',\n },\n // Same fill logic as `solid` (see note above) plus a COLORED glow. The glow\n // needs both a size (`shadow-lg` — the geometry) AND a tint (`shadow-{color}/40`\n // — sets --tw-shadow-color): a color utility alone leaves --tw-shadow empty, so\n // the button rendered with NO shadow at all. `overflow-hidden` on the button\n // doesn't clip its own outset box-shadow, so the glow shows.\n shadow: {\n default: 'border border-transparent shadow-lg shadow-default/40 bg-default text-white dark:bg-default-400',\n primary: 'border border-transparent shadow-lg shadow-primary/40 bg-primary text-white dark:bg-primary-400',\n secondary: 'border border-transparent shadow-lg shadow-secondary/40 bg-secondary text-black dark:bg-secondary-300',\n success: 'border border-transparent shadow-lg shadow-success/40 bg-success-600 text-black dark:bg-success-400',\n warning: 'border border-transparent shadow-lg shadow-warning/40 bg-warning text-black dark:bg-warning-400',\n danger: 'border border-transparent shadow-lg shadow-danger/40 bg-danger text-white dark:bg-danger-400',\n info: 'border border-transparent shadow-lg shadow-info/40 bg-info-600 text-black dark:bg-info-300',\n },\n ghost: {\n default: 'border border-default bg-transparent hover:bg-default/10',\n primary: 'border border-primary bg-transparent text-primary hover:bg-primary/10',\n secondary: 'border border-secondary bg-transparent text-secondary hover:bg-secondary/10',\n success: 'border border-success bg-transparent text-success hover:bg-success/10',\n warning: 'border border-warning bg-transparent text-warning hover:bg-warning/10',\n danger: 'border border-danger bg-transparent text-danger hover:bg-danger/10',\n info: 'border border-info bg-transparent text-info hover:bg-info/10',\n },\n}\n\nexport const kunVariantClasses = (\n variant: KunUIVariant,\n color: KunUIColor\n): string => TABLE[variant][color]\n\n// Static maps for narrower use cases (just the fill color, just the text\n// color, etc.) — same JIT-safety requirement: keys must be literals.\n\nexport const kunBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default',\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-danger',\n info: 'bg-info',\n}\n\n// ─── Solid fills (a colored fill that carries text / icons) ──────────────────\n// Two facts shape these, both verified by contrast measurement:\n// 1. The dark color scale is INVERTED, so a plain `bg-{color}` renders pale in\n// dark mode — each fill pins a `dark:bg-{color}-{n}` to stay saturated\n// enough for its foreground. (Same pins as the Button `solid` row.)\n// 2. The light hues (success / warning / info) are light in BOTH modes, so\n// white text fails WCAG on them everywhere (~1.2–3.4:1). They take DARK\n// text (≈6–18:1); the darker hues keep white.\n// Reach for these — NOT plain `kunBgClasses` — whenever a colored fill carries a\n// foreground. `kunBgClasses` stays for tints / bars / dots that carry no text.\n\n/** Just the fill (with the dark-mode pin). Pair with {@link kunSolidFgClasses}\n * when the fill and its text live on different elements. */\nexport const kunSolidBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default dark:bg-default-400',\n primary: 'bg-primary dark:bg-primary-400',\n secondary: 'bg-secondary dark:bg-secondary-300',\n success: 'bg-success-600 dark:bg-success-400',\n warning: 'bg-warning dark:bg-warning-400',\n danger: 'bg-danger dark:bg-danger-400',\n info: 'bg-info-600 dark:bg-info-300',\n}\n\n/** The foreground that stays legible on the matching solid fill in both modes. */\n// secondary is a bright magenta — white fails on it (≈2.9:1 in light); it takes\n// dark text. danger keeps white (the red+white convention; ≈4.1:1, legible).\nexport const kunSolidFgClasses: Record<KunUIColor, string> = {\n default: 'text-white',\n primary: 'text-white',\n secondary: 'text-black',\n success: 'text-black',\n warning: 'text-black',\n danger: 'text-white',\n info: 'text-black',\n}\n\n/** Fill + matching foreground — the common case (text sits on the fill). */\nexport const kunSolidClasses: Record<KunUIColor, string> = {\n default: 'bg-default text-white dark:bg-default-400',\n primary: 'bg-primary text-white dark:bg-primary-400',\n secondary: 'bg-secondary text-black dark:bg-secondary-300',\n success: 'bg-success-600 text-black dark:bg-success-400',\n warning: 'bg-warning text-black dark:bg-warning-400',\n danger: 'bg-danger text-white dark:bg-danger-400',\n info: 'bg-info-600 text-black dark:bg-info-300',\n}\n\nexport const kunTextClasses: Record<KunUIColor, string> = {\n default: 'text-foreground',\n primary: 'text-primary',\n secondary: 'text-secondary',\n success: 'text-success',\n warning: 'text-warning',\n danger: 'text-danger',\n info: 'text-info',\n}\n\nexport const kunBorderClasses: Record<KunUIColor, string> = {\n default: 'border-default',\n primary: 'border-primary',\n secondary: 'border-secondary',\n success: 'border-success',\n warning: 'border-warning',\n danger: 'border-danger',\n info: 'border-info',\n}\n\n/**\n * @deprecated Use {@link kunFocusRingClasses} (or {@link kunFocusRingWithinClasses}\n * for composite widgets). This mixed `:focus` + `:focus-within` so a mouse click\n * lit the ring, and used a different opacity from the rest of the library.\n */\nexport const kunRingClasses: Record<KunUIColor, string> = {\n default: 'focus-within:ring-default/40 focus:ring-default/40',\n primary: 'focus-within:ring-primary/40 focus:ring-primary/40',\n secondary: 'focus-within:ring-secondary/40 focus:ring-secondary/40',\n success: 'focus-within:ring-success/40 focus:ring-success/40',\n warning: 'focus-within:ring-warning/40 focus:ring-warning/40',\n danger: 'focus-within:ring-danger/40 focus:ring-danger/40',\n info: 'focus-within:ring-info/40 focus:ring-info/40',\n}\n\n/**\n * Unified focus ring — ONE recipe for every directly-focusable control (inputs,\n * textarea, select trigger, buttons, checkbox/radio, links, tabs, menu items…).\n * Keyboard focus only (`:focus-visible`, so a mouse click on a button shows no\n * ring; text fields still show it on click via the browser's focus-visible\n * heuristic). A flush 2px ring in the control's semantic color at 50% — replaces\n * the old scatter of `:focus`/`:focus-within` × `ring-1|2|4` × `/25|/40|/50|full`.\n * Pair with `border-kun` at rest; on an invalid control use the `danger` entry.\n */\nexport const kunFocusRingClasses: Record<KunUIColor, string> = {\n default: 'outline-none focus-visible:ring-2 focus-visible:ring-default/50',\n primary: 'outline-none focus-visible:ring-2 focus-visible:ring-primary/50',\n secondary: 'outline-none focus-visible:ring-2 focus-visible:ring-secondary/50',\n success: 'outline-none focus-visible:ring-2 focus-visible:ring-success/50',\n warning: 'outline-none focus-visible:ring-2 focus-visible:ring-warning/50',\n danger: 'outline-none focus-visible:ring-2 focus-visible:ring-danger/50',\n info: 'outline-none focus-visible:ring-2 focus-visible:ring-info/50',\n}\n\n/**\n * Composite-widget variant of {@link kunFocusRingClasses}: the focusable element\n * is an inner `<input>` but the ring should sit on the WRAPPER. Put this on the\n * wrapper and give the inner input `outline-none` (and no ring of its own) so\n * there's exactly one indicator. Used by KunNumberInput / KunTagInput.\n *\n * Uses `focus-within` (not `has-[:focus-visible]`): for a text-field wrapper the\n * two are equivalent — a text input matches `:focus-visible` on click too — and\n * `focus-within` is a native variant that reliably compiles, whereas the\n * `has-[:focus-visible]` arbitrary variant isn't extracted from this TS source.\n */\nexport const kunFocusRingWithinClasses: Record<KunUIColor, string> = {\n default: 'focus-within:ring-2 focus-within:ring-default/50',\n primary: 'focus-within:ring-2 focus-within:ring-primary/50',\n secondary: 'focus-within:ring-2 focus-within:ring-secondary/50',\n success: 'focus-within:ring-2 focus-within:ring-success/50',\n warning: 'focus-within:ring-2 focus-within:ring-warning/50',\n danger: 'focus-within:ring-2 focus-within:ring-danger/50',\n info: 'focus-within:ring-2 focus-within:ring-info/50',\n}\n\n// Very light tint of the semantic color — \"selected card\" backgrounds in\n// RadioGroup and any \"barely there\" colored fill. Keys are static literals.\nexport const kunSoftBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default/5',\n primary: 'bg-primary/5',\n secondary: 'bg-secondary/5',\n success: 'bg-success/5',\n warning: 'bg-warning/5',\n danger: 'bg-danger/5',\n info: 'bg-info/5',\n}\n","import type { KunUIRounded } from './types'\n\n// Static class map for the 5-bucket Kun radius system. All keys are literal\n// strings so the Tailwind JIT picks them up — the `rounded-kun-*` utilities\n// come from the --radius-kun-* tokens shipped by @kungal/ui-tokens.\nexport const kunRoundedClasses: Record<KunUIRounded, string> = {\n none: 'rounded-kun-none',\n sm: 'rounded-kun-sm',\n md: 'rounded-kun-md',\n lg: 'rounded-kun-lg',\n full: 'rounded-kun-full',\n}\n\n// Global default radius bucket (matches the source layer's behaviour where\n// the un-configured fallback is 'md'). A render layer's config provider may\n// override this per subtree.\nexport const KUN_DEFAULT_ROUNDED: KunUIRounded = 'md'\n\n// Pure precedence resolver for a component's effective radius:\n// prop > component built-in fallback > app/provider default\n//\n// This is the framework-agnostic core of the original Vue\n// `useResolvedRounded` composable. Each render layer wraps it in its own\n// reactivity primitive:\n// Vue: computed(() => resolveRounded(props.rounded, fallback, cfg.rounded))\n// React: useMemo(() => resolveRounded(rounded, fallback, cfg.rounded), [...])\nexport const resolveRounded = (\n prop: KunUIRounded | undefined,\n fallback: KunUIRounded | undefined,\n configDefault: KunUIRounded = KUN_DEFAULT_ROUNDED\n): KunUIRounded => prop ?? fallback ?? configDefault\n","import type { KunUISize } from './types'\n\n// The single source of truth for the size of every text-like form control —\n// Button, Input, Select, DatePicker, Textarea, TagInput. They reference this so\n// they share one scale and line up in a row.\n//\n// Padding-driven (not fixed-height): height = font line-height + 2·py + border.\n// `md` is the anchor (~38px, the modern default). px:py is a clean 2:1 (xs/sm a\n// touch looser); horizontal padding grows faster than vertical from md→xl, so a\n// bigger control gets wider, not flatter. Approx heights with a 1px border and\n// text line-heights 16 / 20 / 20 / 24 / 28:\n// xs ≈ 26 · sm ≈ 34 · md ≈ 38 · lg ≈ 46 · xl ≈ 54\nexport const kunControlSizeClasses: Record<KunUISize, string> = {\n xs: 'text-xs px-2.5 py-1',\n sm: 'text-sm px-3.5 py-1.5',\n md: 'text-sm px-4 py-2',\n lg: 'text-base px-5 py-2.5',\n xl: 'text-lg px-6 py-3',\n}\n\nexport interface KunSelectionSize {\n box: string // the square: checkbox box / radio indicator outer ring\n dot: string // radio's inner filled dot (unused by checkbox)\n check: string // checkbox's check glyph (unused by radio)\n text: string // the adjacent label\n gap: string // box ↔ label spacing\n}\n\n// The shared scale for selection controls — KunCheckBox and KunRadioGroup use\n// identical box sizes (every major library does this), so a checkbox and a radio\n// of the same size match. The box is ≈ 0.5× the text-control height and ≈ 1.2–1.4×\n// the label font, so it sits optically level with the label beside it.\n// Box px by size: 12 / 14 / 16 / 20 / 24.\nexport const kunSelectionSizeClasses: Record<KunUISize, KunSelectionSize> = {\n xs: { box: 'size-3', dot: 'size-1.5', check: 'size-2', text: 'text-xs', gap: 'gap-1.5' },\n sm: { box: 'size-3.5', dot: 'size-1.5', check: 'size-2.5', text: 'text-sm', gap: 'gap-2' },\n md: { box: 'size-4', dot: 'size-2', check: 'size-3', text: 'text-sm', gap: 'gap-2' },\n lg: { box: 'size-5', dot: 'size-2.5', check: 'size-3.5', text: 'text-base', gap: 'gap-2.5' },\n xl: { box: 'size-6', dot: 'size-3', check: 'size-4', text: 'text-lg', gap: 'gap-3' },\n}\n\n// The single source of truth for chip / tag pills — a standalone KunChip and the\n// tags inside KunTagInput share it, so a tag looks identical either way. A\n// compact sub-scale (~0.7× the form-control height): vertical padding is tighter\n// than kunControlSizeClasses because a chip is text + tight padding, not a tap\n// target. Pair with `gap-1` + `rounded-full`.\nexport const kunChipSizeClasses: Record<KunUISize, string> = {\n xs: 'px-2 py-0.5 text-xs',\n sm: 'px-2 py-1 text-xs',\n md: 'px-3 py-1 text-sm',\n lg: 'px-4 py-1.5 text-sm',\n xl: 'px-6 py-2 text-base',\n}\n","// Generate a random integer within an inclusive [lower, upper] range.\nexport const randomNum = (lowerValue: number, upperValue: number): number =>\n Math.floor(Math.random() * (upperValue - lowerValue + 1) + lowerValue)\n","// Decode a possibly percent-encoded string, returning the original when it\n// is not encoded (or when decoding throws on malformed input).\nexport const decodeIfEncoded = (text: string): string => {\n try {\n const decoded = decodeURIComponent(text)\n return decoded !== text ? decoded : text\n } catch {\n return text\n }\n}\n","// Deterministic sticker picker for fallback/empty states (avatars without\n// an image, KunNull's empty illustration, etc.).\n//\n// The original was random-per-call + Nuxt `useState` to freeze the pick\n// across SSR hydration. This version derives the URL deterministically from\n// the `id` (a cheap string hash) instead: the same id always yields the same\n// sticker on both server and client, so there is no hydration mismatch and\n// no framework state needed — fully portable.\n//\n// The CDN is the KunUI sticker host; consumers don't need to ship assets.\n\nconst KUN_STICKER_DOMAIN = 'https://sticker.kungal.com'\nconst PACKS = 5\nconst PER_PACK = 80\n\nconst hash = (s: string): number => {\n let h = 0\n for (let i = 0; i < s.length; i++) {\n h = (Math.imul(h, 31) + s.charCodeAt(i)) >>> 0\n }\n return h\n}\n\nexport const getRandomSticker = (id = ''): string => {\n const h = hash(id)\n const pack = (h % PACKS) + 1\n const sticker = (Math.floor(h / PACKS) % PER_PACK) + 1\n return `${KUN_STICKER_DOMAIN}/stickers/KUNgal${pack}/${sticker}.webp`\n}\n","// AUTO-GENERATED by scripts/gen-icons.mjs — do not edit by hand.\n// Regenerate: pnpm --filter @kungal/ui-core gen:icons\nimport type { KunIconData } from './icons'\n\n// SVG data for the icons KunUI components render, bundled inline so the\n// library never fetches an icon at runtime. Bodies use currentColor.\nexport const KUN_BUNDLED_ICONS: Record<string, KunIconData> = {\n \"lucide:x\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M18 6L6 18M6 6l12 12\\\"/>\"},\n \"lucide:check\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M20 6L9 17l-5-5\\\"/>\"},\n \"lucide:info\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"M12 16v-4m0-4h.01\\\"/></g>\"},\n \"lucide:circle-check\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"m9 12l2 2l4-4\\\"/></g>\"},\n \"lucide:circle-x\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"m15 9l-6 6m0-6l6 6\\\"/></g>\"},\n \"lucide:triangle-alert\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01\\\"/>\"},\n \"lucide:chevron-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m9 18l6-6l-6-6\\\"/>\"},\n \"lucide:chevron-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m15 18l-6-6l6-6\\\"/>\"},\n \"lucide:chevron-down\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m6 9l6 6l6-6\\\"/>\"},\n \"lucide:chevrons-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m6 17l5-5l-5-5m7 10l5-5l-5-5\\\"/>\"},\n \"lucide:chevrons-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m11 17l-5-5l5-5m7 10l-5-5l5-5\\\"/>\"},\n \"lucide:arrow-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14m-7-7l7 7l-7 7\\\"/>\"},\n \"lucide:arrow-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m12 19l-7-7l7-7m7 7H5\\\"/>\"},\n \"lucide:plus\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14m-7-7v14\\\"/>\"},\n \"lucide:minus\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14\\\"/>\"},\n \"lucide:upload\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\\\"/>\"},\n \"lucide:zoom-in\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.35-4.35M11 8v6m-3-3h6\\\"/></g>\"},\n \"lucide:zoom-out\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.35-4.35M8 11h6\\\"/></g>\"},\n \"lucide:rotate-cw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\\\"/><path d=\\\"M21 3v5h-5\\\"/></g>\"},\n \"lucide:rotate-ccw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8\\\"/><path d=\\\"M3 3v5h5\\\"/></g>\"},\n \"lucide:refresh-ccw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M21 12a9 9 0 0 0-9-9a9.75 9.75 0 0 0-6.74 2.74L3 8\\\"/><path d=\\\"M3 3v5h5m-5 4a9 9 0 0 0 9 9a9.75 9.75 0 0 0 6.74-2.74L21 16\\\"/><path d=\\\"M16 16h5v5\\\"/></g>\"},\n \"lucide:external-link\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\\\"/>\"},\n \"lucide:download\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\\\"/><path d=\\\"m7 10l5 5l5-5\\\"/></g>\"},\n \"lucide:copy\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><rect width=\\\"14\\\" height=\\\"14\\\" x=\\\"8\\\" y=\\\"8\\\" rx=\\\"2\\\" ry=\\\"2\\\"/><path d=\\\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\\\"/></g>\"},\n \"lucide:calendar\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M8 2v4m8-4v4\\\"/><rect width=\\\"18\\\" height=\\\"18\\\" x=\\\"3\\\" y=\\\"4\\\" rx=\\\"2\\\"/><path d=\\\"M3 10h18\\\"/></g>\"},\n \"lucide:lollipop\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.3-4.3M11 11a2 2 0 0 0 4 0a4 4 0 0 0-8 0a6 6 0 0 0 12 0\\\"/></g>\"},\n \"lucide:eye\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0\\\"/><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"3\\\"/></g>\"},\n \"lucide:eye-off\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242\\\"/><path d=\\\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20\\\"/></g>\"},\n \"lucide:search\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"m21 21l-4.34-4.34\\\"/><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/></g>\"},\n \"svg-spinners:90-ring-with-bg\": {\"body\":\"<path fill=\\\"currentColor\\\" d=\\\"M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z\\\" opacity=\\\".25\\\"/><path fill=\\\"currentColor\\\" d=\\\"M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z\\\"><animateTransform attributeName=\\\"transform\\\" dur=\\\"0.75s\\\" repeatCount=\\\"indefinite\\\" type=\\\"rotate\\\" values=\\\"0 12 12;360 12 12\\\"/></path>\"},\n}\n","import { KUN_BUNDLED_ICONS } from './icons-data'\n\n// Iconify-compatible icon shape: `body` is the inner SVG markup (using\n// `currentColor`), rendered into a `0 0 width height` viewBox (default 24).\nexport interface KunIconData {\n body: string\n width?: number\n height?: number\n}\n\n// The registry is SEEDED with KunUI's bundled internal icons (referenced via\n// the data import, so it is never tree-shaken away — no side-effect needed).\n// Consumers add their own icons with registerKunIcon(s). KunIcon renders from\n// this registry and NEVER fetches from a network/API.\nconst registry = new Map<string, KunIconData>(Object.entries(KUN_BUNDLED_ICONS))\n\nexport const registerKunIcon = (name: string, data: KunIconData): void => {\n registry.set(name, data)\n}\n\n// Bulk register — pass a Record<name, data>, e.g. icons extracted from\n// `@iconify-json/*` at build time, or your own custom SVGs.\nexport const registerKunIcons = (\n icons: Record<string, KunIconData>\n): void => {\n for (const [name, data] of Object.entries(icons)) registry.set(name, data)\n}\n\nexport const getKunIcon = (name: string): KunIconData | undefined =>\n registry.get(name)\n\nexport const hasKunIcon = (name: string): boolean => registry.has(name)\n"]}
1
+ {"version":3,"sources":["../src/cn.ts","../src/variants.ts","../src/rounded.ts","../src/controlSize.ts","../src/random.ts","../src/decodeIfEncoded.ts","../src/getRandomSticker.ts","../src/icons-data.ts","../src/icons.ts"],"names":["twMerge","clsx"],"mappings":";;;;;;AAMO,IAAM,KAAK,CAAA,GAAI,MAAA,KAAiCA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC;;;ACO3E,IAAM,KAAA,GAA0D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU9D,KAAA,EAAO;AAAA,IACL,OAAA,EAAS,qEAAA;AAAA,IACT,OAAA,EAAS,qEAAA;AAAA,IACT,SAAA,EAAW,yEAAA;AAAA,IACX,OAAA,EAAS,yEAAA;AAAA,IACT,OAAA,EAAS,qEAAA;AAAA,IACT,MAAA,EAAQ,mEAAA;AAAA,IACR,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA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AS,GAAA,CAAI,IAAA,EAAM,IAAI,CAAA;AAC3E;AAEO,IAAM,UAAA,GAAa,CAAC,IAAA,KACzB,QAAA,CAAS,IAAI,IAAI;AAEZ,IAAM,UAAA,GAAa,CAAC,IAAA,KAA0B,QAAA,CAAS,IAAI,IAAI","file":"index.cjs","sourcesContent":["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\n// Merge Tailwind class names with conflict resolution. Framework-agnostic:\n// the Vue and React layers both import this so \"last class wins\" semantics\n// are identical everywhere.\nexport const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs))\n\nexport type { ClassValue }\n","import type { KunUIVariant, KunUIColor } from './types'\n\n// Single source of truth for the variant × color → Tailwind class table.\n// Button / Badge / Chip / Tab / Info / Progress etc. (in every framework\n// layer) consume this so the 7 × 7 matrix lives in exactly one place.\n//\n// All keys MUST be static string literals so the Tailwind JIT picks them\n// up — never construct class names with template strings at runtime.\n// Every entry carries an explicit `border` WIDTH so the outline variants\n// (bordered / ghost) actually render — `border-{color}` alone sets only the\n// color and paints nothing in Tailwind v4. Filled / light variants use a\n// transparent border of the same width so switching variants never shifts the\n// box by a pixel.\nconst TABLE: Record<KunUIVariant, Record<KunUIColor, string>> = {\n // Filled buttons keep white text in BOTH modes, so the fill must stay dark\n // enough for contrast. The dark color scale is inverted (`-500`/`-600` become\n // LIGHT in dark mode), so a plain `bg-{color}` renders pale — worst on the\n // light hues (info ≈ L88%, default/secondary ≈ L65–72%). Each entry pins a\n // `dark:bg-{color}-{n}` that lands every color at a consistent ~L44–55% so the\n // whole row reads as one saturated tier with legible white text.\n // Foreground: the dark hues take white; the light hues (success / warning /\n // info) are light in BOTH modes, so white text fails WCAG on them (~1.5–3.4:1)\n // — they take dark text (≈6–18:1). See kunSolidFgClasses.\n solid: {\n default: 'border border-transparent bg-default text-white dark:bg-default-400',\n primary: 'border border-transparent bg-primary text-white dark:bg-primary-400',\n secondary: 'border border-transparent bg-secondary text-black dark:bg-secondary-300',\n success: 'border border-transparent bg-success-600 text-black dark:bg-success-400',\n warning: 'border border-transparent bg-warning text-black dark:bg-warning-400',\n danger: 'border border-transparent bg-danger text-white dark:bg-danger-400',\n info: 'border border-transparent bg-info-600 text-black dark:bg-info-300',\n },\n bordered: {\n default: 'border border-default bg-transparent',\n primary: 'border border-primary bg-transparent text-primary',\n secondary: 'border border-secondary bg-transparent text-secondary',\n success: 'border border-success bg-transparent text-success',\n warning: 'border border-warning bg-transparent text-warning',\n danger: 'border border-danger bg-transparent text-danger',\n info: 'border border-info bg-transparent text-info',\n },\n light: {\n default: 'border border-transparent bg-transparent hover:bg-default/20',\n primary: 'border border-transparent bg-transparent text-primary hover:bg-primary/20',\n secondary: 'border border-transparent bg-transparent text-secondary hover:bg-secondary/20',\n success: 'border border-transparent bg-transparent text-success hover:bg-success/20',\n warning: 'border border-transparent bg-transparent text-warning hover:bg-warning/20',\n danger: 'border border-transparent bg-transparent text-danger hover:bg-danger/20',\n info: 'border border-transparent bg-transparent text-info hover:bg-info/20',\n },\n flat: {\n default: 'border border-transparent bg-default/20 text-default-700',\n primary: 'border border-transparent bg-primary/20 text-primary-600',\n secondary: 'border border-transparent bg-secondary/20 text-secondary-600',\n success: 'border border-transparent bg-success/20 text-success-700 dark:text-success',\n warning: 'border border-transparent bg-warning/20 text-warning-700 dark:text-warning',\n danger: 'border border-transparent bg-danger/20 text-danger-600 dark:text-danger-500',\n info: 'border border-transparent bg-info/20 text-info-700 dark:text-info-500',\n },\n // Same fill logic as `solid` (see note above) plus a COLORED glow. The glow\n // needs both a size (`shadow-lg` — the geometry) AND a tint (`shadow-{color}/40`\n // — sets --tw-shadow-color): a color utility alone leaves --tw-shadow empty, so\n // the button rendered with NO shadow at all. `overflow-hidden` on the button\n // doesn't clip its own outset box-shadow, so the glow shows.\n shadow: {\n default: 'border border-transparent shadow-lg shadow-default/40 bg-default text-white dark:bg-default-400',\n primary: 'border border-transparent shadow-lg shadow-primary/40 bg-primary text-white dark:bg-primary-400',\n secondary: 'border border-transparent shadow-lg shadow-secondary/40 bg-secondary text-black dark:bg-secondary-300',\n success: 'border border-transparent shadow-lg shadow-success/40 bg-success-600 text-black dark:bg-success-400',\n warning: 'border border-transparent shadow-lg shadow-warning/40 bg-warning text-black dark:bg-warning-400',\n danger: 'border border-transparent shadow-lg shadow-danger/40 bg-danger text-white dark:bg-danger-400',\n info: 'border border-transparent shadow-lg shadow-info/40 bg-info-600 text-black dark:bg-info-300',\n },\n ghost: {\n default: 'border border-default bg-transparent hover:bg-default/10',\n primary: 'border border-primary bg-transparent text-primary hover:bg-primary/10',\n secondary: 'border border-secondary bg-transparent text-secondary hover:bg-secondary/10',\n success: 'border border-success bg-transparent text-success hover:bg-success/10',\n warning: 'border border-warning bg-transparent text-warning hover:bg-warning/10',\n danger: 'border border-danger bg-transparent text-danger hover:bg-danger/10',\n info: 'border border-info bg-transparent text-info hover:bg-info/10',\n },\n}\n\nexport const kunVariantClasses = (\n variant: KunUIVariant,\n color: KunUIColor\n): string => TABLE[variant][color]\n\n// Static maps for narrower use cases (just the fill color, just the text\n// color, etc.) — same JIT-safety requirement: keys must be literals.\n\nexport const kunBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default',\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-danger',\n info: 'bg-info',\n}\n\n// ─── Solid fills (a colored fill that carries text / icons) ──────────────────\n// Two facts shape these, both verified by contrast measurement:\n// 1. The dark color scale is INVERTED, so a plain `bg-{color}` renders pale in\n// dark mode — each fill pins a `dark:bg-{color}-{n}` to stay saturated\n// enough for its foreground. (Same pins as the Button `solid` row.)\n// 2. The light hues (success / warning / info) are light in BOTH modes, so\n// white text fails WCAG on them everywhere (~1.2–3.4:1). They take DARK\n// text (≈6–18:1); the darker hues keep white.\n// Reach for these — NOT plain `kunBgClasses` — whenever a colored fill carries a\n// foreground. `kunBgClasses` stays for tints / bars / dots that carry no text.\n\n/** Just the fill (with the dark-mode pin). Pair with {@link kunSolidFgClasses}\n * when the fill and its text live on different elements. */\nexport const kunSolidBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default dark:bg-default-400',\n primary: 'bg-primary dark:bg-primary-400',\n secondary: 'bg-secondary dark:bg-secondary-300',\n success: 'bg-success-600 dark:bg-success-400',\n warning: 'bg-warning dark:bg-warning-400',\n danger: 'bg-danger dark:bg-danger-400',\n info: 'bg-info-600 dark:bg-info-300',\n}\n\n/** The foreground that stays legible on the matching solid fill in both modes. */\n// secondary is a bright magenta — white fails on it (≈2.9:1 in light); it takes\n// dark text. danger keeps white (the red+white convention; ≈4.1:1, legible).\nexport const kunSolidFgClasses: Record<KunUIColor, string> = {\n default: 'text-white',\n primary: 'text-white',\n secondary: 'text-black',\n success: 'text-black',\n warning: 'text-black',\n danger: 'text-white',\n info: 'text-black',\n}\n\n/** Fill + matching foreground — the common case (text sits on the fill). */\nexport const kunSolidClasses: Record<KunUIColor, string> = {\n default: 'bg-default text-white dark:bg-default-400',\n primary: 'bg-primary text-white dark:bg-primary-400',\n secondary: 'bg-secondary text-black dark:bg-secondary-300',\n success: 'bg-success-600 text-black dark:bg-success-400',\n warning: 'bg-warning text-black dark:bg-warning-400',\n danger: 'bg-danger text-white dark:bg-danger-400',\n info: 'bg-info-600 text-black dark:bg-info-300',\n}\n\nexport const kunTextClasses: Record<KunUIColor, string> = {\n default: 'text-foreground',\n primary: 'text-primary',\n secondary: 'text-secondary',\n success: 'text-success',\n warning: 'text-warning',\n danger: 'text-danger',\n info: 'text-info',\n}\n\nexport const kunBorderClasses: Record<KunUIColor, string> = {\n default: 'border-default',\n primary: 'border-primary',\n secondary: 'border-secondary',\n success: 'border-success',\n warning: 'border-warning',\n danger: 'border-danger',\n info: 'border-info',\n}\n\n/**\n * @deprecated Use {@link kunFocusRingClasses} (or {@link kunFocusRingWithinClasses}\n * for composite widgets). This mixed `:focus` + `:focus-within` so a mouse click\n * lit the ring, and used a different opacity from the rest of the library.\n */\nexport const kunRingClasses: Record<KunUIColor, string> = {\n default: 'focus-within:ring-default/40 focus:ring-default/40',\n primary: 'focus-within:ring-primary/40 focus:ring-primary/40',\n secondary: 'focus-within:ring-secondary/40 focus:ring-secondary/40',\n success: 'focus-within:ring-success/40 focus:ring-success/40',\n warning: 'focus-within:ring-warning/40 focus:ring-warning/40',\n danger: 'focus-within:ring-danger/40 focus:ring-danger/40',\n info: 'focus-within:ring-info/40 focus:ring-info/40',\n}\n\n/**\n * Unified focus ring — ONE recipe for every directly-focusable control (inputs,\n * textarea, select trigger, buttons, checkbox/radio, links, tabs, menu items…).\n * Keyboard focus only (`:focus-visible`, so a mouse click on a button shows no\n * ring; text fields still show it on click via the browser's focus-visible\n * heuristic). A flush 2px ring in the control's semantic color at 50% — replaces\n * the old scatter of `:focus`/`:focus-within` × `ring-1|2|4` × `/25|/40|/50|full`.\n * Pair with `border-kun` at rest; on an invalid control use the `danger` entry.\n */\nexport const kunFocusRingClasses: Record<KunUIColor, string> = {\n default: 'outline-none focus-visible:ring-2 focus-visible:ring-default/50',\n primary: 'outline-none focus-visible:ring-2 focus-visible:ring-primary/50',\n secondary: 'outline-none focus-visible:ring-2 focus-visible:ring-secondary/50',\n success: 'outline-none focus-visible:ring-2 focus-visible:ring-success/50',\n warning: 'outline-none focus-visible:ring-2 focus-visible:ring-warning/50',\n danger: 'outline-none focus-visible:ring-2 focus-visible:ring-danger/50',\n info: 'outline-none focus-visible:ring-2 focus-visible:ring-info/50',\n}\n\n/**\n * Composite-widget variant of {@link kunFocusRingClasses}: the focusable element\n * is an inner `<input>` but the ring should sit on the WRAPPER. Put this on the\n * wrapper and give the inner input `outline-none` (and no ring of its own) so\n * there's exactly one indicator. Used by KunNumberInput / KunTagInput.\n *\n * Uses `focus-within` (not `has-[:focus-visible]`): for a text-field wrapper the\n * two are equivalent — a text input matches `:focus-visible` on click too — and\n * `focus-within` is a native variant that reliably compiles, whereas the\n * `has-[:focus-visible]` arbitrary variant isn't extracted from this TS source.\n */\nexport const kunFocusRingWithinClasses: Record<KunUIColor, string> = {\n default: 'focus-within:ring-2 focus-within:ring-default/50',\n primary: 'focus-within:ring-2 focus-within:ring-primary/50',\n secondary: 'focus-within:ring-2 focus-within:ring-secondary/50',\n success: 'focus-within:ring-2 focus-within:ring-success/50',\n warning: 'focus-within:ring-2 focus-within:ring-warning/50',\n danger: 'focus-within:ring-2 focus-within:ring-danger/50',\n info: 'focus-within:ring-2 focus-within:ring-info/50',\n}\n\n// Very light tint of the semantic color — \"selected card\" backgrounds in\n// RadioGroup and any \"barely there\" colored fill. Keys are static literals.\nexport const kunSoftBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default/5',\n primary: 'bg-primary/5',\n secondary: 'bg-secondary/5',\n success: 'bg-success/5',\n warning: 'bg-warning/5',\n danger: 'bg-danger/5',\n info: 'bg-info/5',\n}\n","import type { KunUIRounded } from './types'\n\n// Static class map for the 5-bucket Kun radius system. All keys are literal\n// strings so the Tailwind JIT picks them up — the `rounded-kun-*` utilities\n// come from the --radius-kun-* tokens shipped by @kungal/ui-tokens.\nexport const kunRoundedClasses: Record<KunUIRounded, string> = {\n none: 'rounded-kun-none',\n sm: 'rounded-kun-sm',\n md: 'rounded-kun-md',\n lg: 'rounded-kun-lg',\n full: 'rounded-kun-full',\n}\n\n// Global default radius bucket (matches the source layer's behaviour where\n// the un-configured fallback is 'md'). A render layer's config provider may\n// override this per subtree.\nexport const KUN_DEFAULT_ROUNDED: KunUIRounded = 'md'\n\n// Pure precedence resolver for a component's effective radius:\n// prop > component built-in fallback > app/provider default\n//\n// This is the framework-agnostic core of the original Vue\n// `useResolvedRounded` composable. Each render layer wraps it in its own\n// reactivity primitive:\n// Vue: computed(() => resolveRounded(props.rounded, fallback, cfg.rounded))\n// React: useMemo(() => resolveRounded(rounded, fallback, cfg.rounded), [...])\nexport const resolveRounded = (\n prop: KunUIRounded | undefined,\n fallback: KunUIRounded | undefined,\n configDefault: KunUIRounded = KUN_DEFAULT_ROUNDED\n): KunUIRounded => prop ?? fallback ?? configDefault\n","import type { KunUISize } from './types'\n\n// The single source of truth for the size of every text-like form control —\n// Button, Input, Select, DatePicker, Textarea, TagInput. They reference this so\n// they share one scale and line up in a row.\n//\n// Padding-driven (not fixed-height): height = font line-height + 2·py + border.\n// `md` is the anchor (~38px, the modern default). px:py is a clean 2:1 (xs/sm a\n// touch looser); horizontal padding grows faster than vertical from md→xl, so a\n// bigger control gets wider, not flatter. Approx heights with a 1px border and\n// text line-heights 16 / 20 / 20 / 24 / 28:\n// xs ≈ 26 · sm ≈ 34 · md ≈ 38 · lg ≈ 46 · xl ≈ 54\nexport const kunControlSizeClasses: Record<KunUISize, string> = {\n xs: 'text-xs px-2.5 py-1',\n sm: 'text-sm px-3.5 py-1.5',\n md: 'text-sm px-4 py-2',\n lg: 'text-base px-5 py-2.5',\n xl: 'text-lg px-6 py-3',\n}\n\n// Icon-only buttons: a fixed SQUARE whose side equals the text-button height at\n// the same size, so an icon button lines up with text buttons in a row.\n//\n// Why this exists: kunControlSizeClasses is padding-driven (height = line-height\n// + 2·py + border). A text label contributes a full line-box (≈1.5em), but a lone\n// 1em icon does not — with the same padding the icon button would come out\n// shorter and break the row. Mainstream libraries dodge this by giving buttons a\n// fixed height and making the icon button a square of that height (shadcn\n// `size-9`, HeroUI/Chakra/Ant `isIconOnly`/`.ant-btn-icon-only`). We do the same,\n// ONLY for icon-only, keeping the icon at its natural 1em centered in the box.\n//\n// Sides MUST equal the kunControlSizeClasses heights (incl. the 1px border every\n// variant carries): xs 26 · sm 34 · md 38 · lg 46 · xl 54. (size-* is border-box,\n// so the value already accounts for the icon button's own 1px border.)\nexport const kunControlSquareClasses: Record<KunUISize, string> = {\n xs: 'size-[26px] p-0',\n sm: 'size-[34px] p-0',\n md: 'size-[38px] p-0',\n lg: 'size-[46px] p-0',\n xl: 'size-[54px] p-0',\n}\n\nexport interface KunSelectionSize {\n box: string // the square: checkbox box / radio indicator outer ring\n dot: string // radio's inner filled dot (unused by checkbox)\n check: string // checkbox's check glyph (unused by radio)\n text: string // the adjacent label\n gap: string // box ↔ label spacing\n}\n\n// The shared scale for selection controls — KunCheckBox and KunRadioGroup use\n// identical box sizes (every major library does this), so a checkbox and a radio\n// of the same size match. The box is ≈ 0.5× the text-control height and ≈ 1.2–1.4×\n// the label font, so it sits optically level with the label beside it.\n// Box px by size: 12 / 14 / 16 / 20 / 24.\nexport const kunSelectionSizeClasses: Record<KunUISize, KunSelectionSize> = {\n xs: { box: 'size-3', dot: 'size-1.5', check: 'size-2', text: 'text-xs', gap: 'gap-1.5' },\n sm: { box: 'size-3.5', dot: 'size-1.5', check: 'size-2.5', text: 'text-sm', gap: 'gap-2' },\n md: { box: 'size-4', dot: 'size-2', check: 'size-3', text: 'text-sm', gap: 'gap-2' },\n lg: { box: 'size-5', dot: 'size-2.5', check: 'size-3.5', text: 'text-base', gap: 'gap-2.5' },\n xl: { box: 'size-6', dot: 'size-3', check: 'size-4', text: 'text-lg', gap: 'gap-3' },\n}\n\n// The single source of truth for chip / tag pills — a standalone KunChip and the\n// tags inside KunTagInput share it, so a tag looks identical either way. A\n// compact sub-scale (~0.7× the form-control height): vertical padding is tighter\n// than kunControlSizeClasses because a chip is text + tight padding, not a tap\n// target. Pair with `gap-1` + `rounded-full`.\nexport const kunChipSizeClasses: Record<KunUISize, string> = {\n xs: 'px-2 py-0.5 text-xs',\n sm: 'px-2 py-1 text-xs',\n md: 'px-3 py-1 text-sm',\n lg: 'px-4 py-1.5 text-sm',\n xl: 'px-6 py-2 text-base',\n}\n","// Generate a random integer within an inclusive [lower, upper] range.\nexport const randomNum = (lowerValue: number, upperValue: number): number =>\n Math.floor(Math.random() * (upperValue - lowerValue + 1) + lowerValue)\n","// Decode a possibly percent-encoded string, returning the original when it\n// is not encoded (or when decoding throws on malformed input).\nexport const decodeIfEncoded = (text: string): string => {\n try {\n const decoded = decodeURIComponent(text)\n return decoded !== text ? decoded : text\n } catch {\n return text\n }\n}\n","// Deterministic sticker picker for fallback/empty states (avatars without\n// an image, KunNull's empty illustration, etc.).\n//\n// The original was random-per-call + Nuxt `useState` to freeze the pick\n// across SSR hydration. This version derives the URL deterministically from\n// the `id` (a cheap string hash) instead: the same id always yields the same\n// sticker on both server and client, so there is no hydration mismatch and\n// no framework state needed — fully portable.\n//\n// The CDN is the KunUI sticker host; consumers don't need to ship assets.\n\nconst KUN_STICKER_DOMAIN = 'https://sticker.kungal.com'\nconst PACKS = 5\nconst PER_PACK = 80\n\nconst hash = (s: string): number => {\n let h = 0\n for (let i = 0; i < s.length; i++) {\n h = (Math.imul(h, 31) + s.charCodeAt(i)) >>> 0\n }\n return h\n}\n\nexport const getRandomSticker = (id = ''): string => {\n const h = hash(id)\n const pack = (h % PACKS) + 1\n const sticker = (Math.floor(h / PACKS) % PER_PACK) + 1\n return `${KUN_STICKER_DOMAIN}/stickers/KUNgal${pack}/${sticker}.webp`\n}\n","// AUTO-GENERATED by scripts/gen-icons.mjs — do not edit by hand.\n// Regenerate: pnpm --filter @kungal/ui-core gen:icons\nimport type { KunIconData } from './icons'\n\n// SVG data for the icons KunUI components render, bundled inline so the\n// library never fetches an icon at runtime. Bodies use currentColor.\nexport const KUN_BUNDLED_ICONS: Record<string, KunIconData> = {\n \"lucide:x\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M18 6L6 18M6 6l12 12\\\"/>\"},\n \"lucide:check\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M20 6L9 17l-5-5\\\"/>\"},\n \"lucide:info\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"M12 16v-4m0-4h.01\\\"/></g>\"},\n \"lucide:circle-check\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"m9 12l2 2l4-4\\\"/></g>\"},\n \"lucide:circle-x\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"m15 9l-6 6m0-6l6 6\\\"/></g>\"},\n \"lucide:triangle-alert\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01\\\"/>\"},\n \"lucide:chevron-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m9 18l6-6l-6-6\\\"/>\"},\n \"lucide:chevron-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m15 18l-6-6l6-6\\\"/>\"},\n \"lucide:chevron-down\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m6 9l6 6l6-6\\\"/>\"},\n \"lucide:chevrons-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m6 17l5-5l-5-5m7 10l5-5l-5-5\\\"/>\"},\n \"lucide:chevrons-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m11 17l-5-5l5-5m7 10l-5-5l5-5\\\"/>\"},\n \"lucide:arrow-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14m-7-7l7 7l-7 7\\\"/>\"},\n \"lucide:arrow-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m12 19l-7-7l7-7m7 7H5\\\"/>\"},\n \"lucide:plus\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14m-7-7v14\\\"/>\"},\n \"lucide:minus\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14\\\"/>\"},\n \"lucide:upload\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\\\"/>\"},\n \"lucide:zoom-in\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.35-4.35M11 8v6m-3-3h6\\\"/></g>\"},\n \"lucide:zoom-out\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.35-4.35M8 11h6\\\"/></g>\"},\n \"lucide:rotate-cw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\\\"/><path d=\\\"M21 3v5h-5\\\"/></g>\"},\n \"lucide:rotate-ccw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8\\\"/><path d=\\\"M3 3v5h5\\\"/></g>\"},\n \"lucide:refresh-ccw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M21 12a9 9 0 0 0-9-9a9.75 9.75 0 0 0-6.74 2.74L3 8\\\"/><path d=\\\"M3 3v5h5m-5 4a9 9 0 0 0 9 9a9.75 9.75 0 0 0 6.74-2.74L21 16\\\"/><path d=\\\"M16 16h5v5\\\"/></g>\"},\n \"lucide:external-link\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\\\"/>\"},\n \"lucide:download\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\\\"/><path d=\\\"m7 10l5 5l5-5\\\"/></g>\"},\n \"lucide:copy\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><rect width=\\\"14\\\" height=\\\"14\\\" x=\\\"8\\\" y=\\\"8\\\" rx=\\\"2\\\" ry=\\\"2\\\"/><path d=\\\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\\\"/></g>\"},\n \"lucide:calendar\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M8 2v4m8-4v4\\\"/><rect width=\\\"18\\\" height=\\\"18\\\" x=\\\"3\\\" y=\\\"4\\\" rx=\\\"2\\\"/><path d=\\\"M3 10h18\\\"/></g>\"},\n \"lucide:lollipop\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.3-4.3M11 11a2 2 0 0 0 4 0a4 4 0 0 0-8 0a6 6 0 0 0 12 0\\\"/></g>\"},\n \"lucide:eye\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0\\\"/><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"3\\\"/></g>\"},\n \"lucide:eye-off\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242\\\"/><path d=\\\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20\\\"/></g>\"},\n \"lucide:search\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"m21 21l-4.34-4.34\\\"/><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/></g>\"},\n \"svg-spinners:90-ring-with-bg\": {\"body\":\"<path fill=\\\"currentColor\\\" d=\\\"M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z\\\" opacity=\\\".25\\\"/><path fill=\\\"currentColor\\\" d=\\\"M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z\\\"><animateTransform attributeName=\\\"transform\\\" dur=\\\"0.75s\\\" repeatCount=\\\"indefinite\\\" type=\\\"rotate\\\" values=\\\"0 12 12;360 12 12\\\"/></path>\"},\n}\n","import { KUN_BUNDLED_ICONS } from './icons-data'\n\n// Iconify-compatible icon shape: `body` is the inner SVG markup (using\n// `currentColor`), rendered into a `0 0 width height` viewBox (default 24).\nexport interface KunIconData {\n body: string\n width?: number\n height?: number\n}\n\n// The registry is SEEDED with KunUI's bundled internal icons (referenced via\n// the data import, so it is never tree-shaken away — no side-effect needed).\n// Consumers add their own icons with registerKunIcon(s). KunIcon renders from\n// this registry and NEVER fetches from a network/API.\nconst registry = new Map<string, KunIconData>(Object.entries(KUN_BUNDLED_ICONS))\n\nexport const registerKunIcon = (name: string, data: KunIconData): void => {\n registry.set(name, data)\n}\n\n// Bulk register — pass a Record<name, data>, e.g. icons extracted from\n// `@iconify-json/*` at build time, or your own custom SVGs.\nexport const registerKunIcons = (\n icons: Record<string, KunIconData>\n): void => {\n for (const [name, data] of Object.entries(icons)) registry.set(name, data)\n}\n\nexport const getKunIcon = (name: string): KunIconData | undefined =>\n registry.get(name)\n\nexport const hasKunIcon = (name: string): boolean => registry.has(name)\n"]}
package/dist/index.d.cts CHANGED
@@ -54,6 +54,7 @@ declare const KUN_DEFAULT_ROUNDED: KunUIRounded;
54
54
  declare const resolveRounded: (prop: KunUIRounded | undefined, fallback: KunUIRounded | undefined, configDefault?: KunUIRounded) => KunUIRounded;
55
55
 
56
56
  declare const kunControlSizeClasses: Record<KunUISize, string>;
57
+ declare const kunControlSquareClasses: Record<KunUISize, string>;
57
58
  interface KunSelectionSize {
58
59
  box: string;
59
60
  dot: string;
@@ -86,4 +87,4 @@ declare const registerKunIcons: (icons: Record<string, KunIconData>) => void;
86
87
  declare const getKunIcon: (name: string) => KunIconData | undefined;
87
88
  declare const hasKunIcon: (name: string) => boolean;
88
89
 
89
- export { KUN_DEFAULT_ROUNDED, type KunIconData, type KunSelectionSize, type KunUIColor, type KunUIRounded, type KunUISize, type KunUIVariant, type KunUser, cn, decodeIfEncoded, getKunIcon, getRandomSticker, hasKunIcon, kunBgClasses, kunBorderClasses, kunChipSizeClasses, kunControlSizeClasses, kunFocusRingClasses, kunFocusRingWithinClasses, kunRingClasses, kunRoundedClasses, kunSelectionSizeClasses, kunSoftBgClasses, kunSolidBgClasses, kunSolidClasses, kunSolidFgClasses, kunTextClasses, kunVariantClasses, randomNum, registerKunIcon, registerKunIcons, resolveRounded };
90
+ export { KUN_DEFAULT_ROUNDED, type KunIconData, type KunSelectionSize, type KunUIColor, type KunUIRounded, type KunUISize, type KunUIVariant, type KunUser, cn, decodeIfEncoded, getKunIcon, getRandomSticker, hasKunIcon, kunBgClasses, kunBorderClasses, kunChipSizeClasses, kunControlSizeClasses, kunControlSquareClasses, kunFocusRingClasses, kunFocusRingWithinClasses, kunRingClasses, kunRoundedClasses, kunSelectionSizeClasses, kunSoftBgClasses, kunSolidBgClasses, kunSolidClasses, kunSolidFgClasses, kunTextClasses, kunVariantClasses, randomNum, registerKunIcon, registerKunIcons, resolveRounded };
package/dist/index.d.ts CHANGED
@@ -54,6 +54,7 @@ declare const KUN_DEFAULT_ROUNDED: KunUIRounded;
54
54
  declare const resolveRounded: (prop: KunUIRounded | undefined, fallback: KunUIRounded | undefined, configDefault?: KunUIRounded) => KunUIRounded;
55
55
 
56
56
  declare const kunControlSizeClasses: Record<KunUISize, string>;
57
+ declare const kunControlSquareClasses: Record<KunUISize, string>;
57
58
  interface KunSelectionSize {
58
59
  box: string;
59
60
  dot: string;
@@ -86,4 +87,4 @@ declare const registerKunIcons: (icons: Record<string, KunIconData>) => void;
86
87
  declare const getKunIcon: (name: string) => KunIconData | undefined;
87
88
  declare const hasKunIcon: (name: string) => boolean;
88
89
 
89
- export { KUN_DEFAULT_ROUNDED, type KunIconData, type KunSelectionSize, type KunUIColor, type KunUIRounded, type KunUISize, type KunUIVariant, type KunUser, cn, decodeIfEncoded, getKunIcon, getRandomSticker, hasKunIcon, kunBgClasses, kunBorderClasses, kunChipSizeClasses, kunControlSizeClasses, kunFocusRingClasses, kunFocusRingWithinClasses, kunRingClasses, kunRoundedClasses, kunSelectionSizeClasses, kunSoftBgClasses, kunSolidBgClasses, kunSolidClasses, kunSolidFgClasses, kunTextClasses, kunVariantClasses, randomNum, registerKunIcon, registerKunIcons, resolveRounded };
90
+ export { KUN_DEFAULT_ROUNDED, type KunIconData, type KunSelectionSize, type KunUIColor, type KunUIRounded, type KunUISize, type KunUIVariant, type KunUser, cn, decodeIfEncoded, getKunIcon, getRandomSticker, hasKunIcon, kunBgClasses, kunBorderClasses, kunChipSizeClasses, kunControlSizeClasses, kunControlSquareClasses, kunFocusRingClasses, kunFocusRingWithinClasses, kunRingClasses, kunRoundedClasses, kunSelectionSizeClasses, kunSoftBgClasses, kunSolidBgClasses, kunSolidClasses, kunSolidFgClasses, kunTextClasses, kunVariantClasses, randomNum, registerKunIcon, registerKunIcons, resolveRounded };
package/dist/index.js CHANGED
@@ -186,6 +186,13 @@ var kunControlSizeClasses = {
186
186
  lg: "text-base px-5 py-2.5",
187
187
  xl: "text-lg px-6 py-3"
188
188
  };
189
+ var kunControlSquareClasses = {
190
+ xs: "size-[26px] p-0",
191
+ sm: "size-[34px] p-0",
192
+ md: "size-[38px] p-0",
193
+ lg: "size-[46px] p-0",
194
+ xl: "size-[54px] p-0"
195
+ };
189
196
  var kunSelectionSizeClasses = {
190
197
  xs: { box: "size-3", dot: "size-1.5", check: "size-2", text: "text-xs", gap: "gap-1.5" },
191
198
  sm: { box: "size-3.5", dot: "size-1.5", check: "size-2.5", text: "text-sm", gap: "gap-2" },
@@ -277,6 +284,6 @@ var registerKunIcons = (icons) => {
277
284
  var getKunIcon = (name) => registry.get(name);
278
285
  var hasKunIcon = (name) => registry.has(name);
279
286
 
280
- export { KUN_DEFAULT_ROUNDED, cn, decodeIfEncoded, getKunIcon, getRandomSticker, hasKunIcon, kunBgClasses, kunBorderClasses, kunChipSizeClasses, kunControlSizeClasses, kunFocusRingClasses, kunFocusRingWithinClasses, kunRingClasses, kunRoundedClasses, kunSelectionSizeClasses, kunSoftBgClasses, kunSolidBgClasses, kunSolidClasses, kunSolidFgClasses, kunTextClasses, kunVariantClasses, randomNum, registerKunIcon, registerKunIcons, resolveRounded };
287
+ export { KUN_DEFAULT_ROUNDED, cn, decodeIfEncoded, getKunIcon, getRandomSticker, hasKunIcon, kunBgClasses, kunBorderClasses, kunChipSizeClasses, kunControlSizeClasses, kunControlSquareClasses, kunFocusRingClasses, kunFocusRingWithinClasses, kunRingClasses, kunRoundedClasses, kunSelectionSizeClasses, kunSoftBgClasses, kunSolidBgClasses, kunSolidClasses, kunSolidFgClasses, kunTextClasses, kunVariantClasses, randomNum, registerKunIcon, registerKunIcons, resolveRounded };
281
288
  //# sourceMappingURL=index.js.map
282
289
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cn.ts","../src/variants.ts","../src/rounded.ts","../src/controlSize.ts","../src/random.ts","../src/decodeIfEncoded.ts","../src/getRandomSticker.ts","../src/icons-data.ts","../src/icons.ts"],"names":[],"mappings":";;;;AAMO,IAAM,KAAK,CAAA,GAAI,MAAA,KAAiC,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC;;;ACO3E,IAAM,KAAA,GAA0D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU9D,KAAA,EAAO;AAAA,IACL,OAAA,EAAS,qEAAA;AAAA,IACT,OAAA,EAAS,qEAAA;AAAA,IACT,SAAA,EAAW,yEAAA;AAAA,IACX,OAAA,EAAS,yEAAA;AAAA,IACT,OAAA,EAAS,qEAAA;AAAA,IACT,MAAA,EAAQ,mEAAA;AAAA,IACR,IAAA,EAAM;AAAA,GACR;AAAA,EACA,QAAA,EAAU;AAAA,IACR,OAAA,EAAS,sCAAA;AAAA,IACT,OAAA,EAAS,mDAAA;AAAA,IACT,SAAA,EAAW,uDAAA;AAAA,IACX,OAAA,EAAS,mDAAA;AAAA,IACT,OAAA,EAAS,mDAAA;AAAA,IACT,MAAA,EAAQ,iDAAA;AAAA,IACR,IAAA,EAAM;AAAA,GACR;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xO,iBAAA,EAAmB,EAAC,MAAA,EAAO,gMAAA,EAA8M;AAAA,EACzO,aAAA,EAAe,EAAC,MAAA,EAAO,sOAAA,EAA8P;AAAA,EACrR,iBAAA,EAAmB,EAAC,MAAA,EAAO,wMAAA,EAAgO;AAAA,EAC3P,iBAAA,EAAmB,EAAC,MAAA,EAAO,sNAAA,EAAwO;AAAA,EACnQ,YAAA,EAAc,EAAC,MAAA,EAAO,2PAAA,EAA6Q;AAAA,EACnS,gBAAA,EAAkB,EAAC,MAAA,EAAO,oWAAA,EAAkX;AAAA,EAC5Y,eAAA,EAAiB,EAAC,MAAA,EAAO,uKAAA,EAAyL;AAAA,EAClN,8BAAA,EAAgC,EAAC,MAAA,EAAO,wbAAA;AAC1C,CAAA;;;ACvBA,IAAM,WAAW,IAAI,GAAA,CAAyB,MAAA,CAAO,OAAA,CAAQ,iBAAiB,CAAC,CAAA;AAExE,IAAM,eAAA,GAAkB,CAAC,IAAA,EAAc,IAAA,KAA4B;AACxE,EAAA,QAAA,CAAS,GAAA,CAAI,MAAM,IAAI,CAAA;AACzB;AAIO,IAAM,gBAAA,GAAmB,CAC9B,KAAA,KACS;AACT,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,IAAI,CAAA,IAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG,QAAA,CAAS,GAAA,CAAI,IAAA,EAAM,IAAI,CAAA;AAC3E;AAEO,IAAM,UAAA,GAAa,CAAC,IAAA,KACzB,QAAA,CAAS,IAAI,IAAI;AAEZ,IAAM,UAAA,GAAa,CAAC,IAAA,KAA0B,QAAA,CAAS,IAAI,IAAI","file":"index.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\n// Merge Tailwind class names with conflict resolution. Framework-agnostic:\n// the Vue and React layers both import this so \"last class wins\" semantics\n// are identical everywhere.\nexport const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs))\n\nexport type { ClassValue }\n","import type { KunUIVariant, KunUIColor } from './types'\n\n// Single source of truth for the variant × color → Tailwind class table.\n// Button / Badge / Chip / Tab / Info / Progress etc. (in every framework\n// layer) consume this so the 7 × 7 matrix lives in exactly one place.\n//\n// All keys MUST be static string literals so the Tailwind JIT picks them\n// up — never construct class names with template strings at runtime.\n// Every entry carries an explicit `border` WIDTH so the outline variants\n// (bordered / ghost) actually render — `border-{color}` alone sets only the\n// color and paints nothing in Tailwind v4. Filled / light variants use a\n// transparent border of the same width so switching variants never shifts the\n// box by a pixel.\nconst TABLE: Record<KunUIVariant, Record<KunUIColor, string>> = {\n // Filled buttons keep white text in BOTH modes, so the fill must stay dark\n // enough for contrast. The dark color scale is inverted (`-500`/`-600` become\n // LIGHT in dark mode), so a plain `bg-{color}` renders pale — worst on the\n // light hues (info ≈ L88%, default/secondary ≈ L65–72%). Each entry pins a\n // `dark:bg-{color}-{n}` that lands every color at a consistent ~L44–55% so the\n // whole row reads as one saturated tier with legible white text.\n // Foreground: the dark hues take white; the light hues (success / warning /\n // info) are light in BOTH modes, so white text fails WCAG on them (~1.5–3.4:1)\n // — they take dark text (≈6–18:1). See kunSolidFgClasses.\n solid: {\n default: 'border border-transparent bg-default text-white dark:bg-default-400',\n primary: 'border border-transparent bg-primary text-white dark:bg-primary-400',\n secondary: 'border border-transparent bg-secondary text-black dark:bg-secondary-300',\n success: 'border border-transparent bg-success-600 text-black dark:bg-success-400',\n warning: 'border border-transparent bg-warning text-black dark:bg-warning-400',\n danger: 'border border-transparent bg-danger text-white dark:bg-danger-400',\n info: 'border border-transparent bg-info-600 text-black dark:bg-info-300',\n },\n bordered: {\n default: 'border border-default bg-transparent',\n primary: 'border border-primary bg-transparent text-primary',\n secondary: 'border border-secondary bg-transparent text-secondary',\n success: 'border border-success bg-transparent text-success',\n warning: 'border border-warning bg-transparent text-warning',\n danger: 'border border-danger bg-transparent text-danger',\n info: 'border border-info bg-transparent text-info',\n },\n light: {\n default: 'border border-transparent bg-transparent hover:bg-default/20',\n primary: 'border border-transparent bg-transparent text-primary hover:bg-primary/20',\n secondary: 'border border-transparent bg-transparent text-secondary hover:bg-secondary/20',\n success: 'border border-transparent bg-transparent text-success hover:bg-success/20',\n warning: 'border border-transparent bg-transparent text-warning hover:bg-warning/20',\n danger: 'border border-transparent bg-transparent text-danger hover:bg-danger/20',\n info: 'border border-transparent bg-transparent text-info hover:bg-info/20',\n },\n flat: {\n default: 'border border-transparent bg-default/20 text-default-700',\n primary: 'border border-transparent bg-primary/20 text-primary-600',\n secondary: 'border border-transparent bg-secondary/20 text-secondary-600',\n success: 'border border-transparent bg-success/20 text-success-700 dark:text-success',\n warning: 'border border-transparent bg-warning/20 text-warning-700 dark:text-warning',\n danger: 'border border-transparent bg-danger/20 text-danger-600 dark:text-danger-500',\n info: 'border border-transparent bg-info/20 text-info-700 dark:text-info-500',\n },\n // Same fill logic as `solid` (see note above) plus a COLORED glow. The glow\n // needs both a size (`shadow-lg` — the geometry) AND a tint (`shadow-{color}/40`\n // — sets --tw-shadow-color): a color utility alone leaves --tw-shadow empty, so\n // the button rendered with NO shadow at all. `overflow-hidden` on the button\n // doesn't clip its own outset box-shadow, so the glow shows.\n shadow: {\n default: 'border border-transparent shadow-lg shadow-default/40 bg-default text-white dark:bg-default-400',\n primary: 'border border-transparent shadow-lg shadow-primary/40 bg-primary text-white dark:bg-primary-400',\n secondary: 'border border-transparent shadow-lg shadow-secondary/40 bg-secondary text-black dark:bg-secondary-300',\n success: 'border border-transparent shadow-lg shadow-success/40 bg-success-600 text-black dark:bg-success-400',\n warning: 'border border-transparent shadow-lg shadow-warning/40 bg-warning text-black dark:bg-warning-400',\n danger: 'border border-transparent shadow-lg shadow-danger/40 bg-danger text-white dark:bg-danger-400',\n info: 'border border-transparent shadow-lg shadow-info/40 bg-info-600 text-black dark:bg-info-300',\n },\n ghost: {\n default: 'border border-default bg-transparent hover:bg-default/10',\n primary: 'border border-primary bg-transparent text-primary hover:bg-primary/10',\n secondary: 'border border-secondary bg-transparent text-secondary hover:bg-secondary/10',\n success: 'border border-success bg-transparent text-success hover:bg-success/10',\n warning: 'border border-warning bg-transparent text-warning hover:bg-warning/10',\n danger: 'border border-danger bg-transparent text-danger hover:bg-danger/10',\n info: 'border border-info bg-transparent text-info hover:bg-info/10',\n },\n}\n\nexport const kunVariantClasses = (\n variant: KunUIVariant,\n color: KunUIColor\n): string => TABLE[variant][color]\n\n// Static maps for narrower use cases (just the fill color, just the text\n// color, etc.) — same JIT-safety requirement: keys must be literals.\n\nexport const kunBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default',\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-danger',\n info: 'bg-info',\n}\n\n// ─── Solid fills (a colored fill that carries text / icons) ──────────────────\n// Two facts shape these, both verified by contrast measurement:\n// 1. The dark color scale is INVERTED, so a plain `bg-{color}` renders pale in\n// dark mode — each fill pins a `dark:bg-{color}-{n}` to stay saturated\n// enough for its foreground. (Same pins as the Button `solid` row.)\n// 2. The light hues (success / warning / info) are light in BOTH modes, so\n// white text fails WCAG on them everywhere (~1.2–3.4:1). They take DARK\n// text (≈6–18:1); the darker hues keep white.\n// Reach for these — NOT plain `kunBgClasses` — whenever a colored fill carries a\n// foreground. `kunBgClasses` stays for tints / bars / dots that carry no text.\n\n/** Just the fill (with the dark-mode pin). Pair with {@link kunSolidFgClasses}\n * when the fill and its text live on different elements. */\nexport const kunSolidBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default dark:bg-default-400',\n primary: 'bg-primary dark:bg-primary-400',\n secondary: 'bg-secondary dark:bg-secondary-300',\n success: 'bg-success-600 dark:bg-success-400',\n warning: 'bg-warning dark:bg-warning-400',\n danger: 'bg-danger dark:bg-danger-400',\n info: 'bg-info-600 dark:bg-info-300',\n}\n\n/** The foreground that stays legible on the matching solid fill in both modes. */\n// secondary is a bright magenta — white fails on it (≈2.9:1 in light); it takes\n// dark text. danger keeps white (the red+white convention; ≈4.1:1, legible).\nexport const kunSolidFgClasses: Record<KunUIColor, string> = {\n default: 'text-white',\n primary: 'text-white',\n secondary: 'text-black',\n success: 'text-black',\n warning: 'text-black',\n danger: 'text-white',\n info: 'text-black',\n}\n\n/** Fill + matching foreground — the common case (text sits on the fill). */\nexport const kunSolidClasses: Record<KunUIColor, string> = {\n default: 'bg-default text-white dark:bg-default-400',\n primary: 'bg-primary text-white dark:bg-primary-400',\n secondary: 'bg-secondary text-black dark:bg-secondary-300',\n success: 'bg-success-600 text-black dark:bg-success-400',\n warning: 'bg-warning text-black dark:bg-warning-400',\n danger: 'bg-danger text-white dark:bg-danger-400',\n info: 'bg-info-600 text-black dark:bg-info-300',\n}\n\nexport const kunTextClasses: Record<KunUIColor, string> = {\n default: 'text-foreground',\n primary: 'text-primary',\n secondary: 'text-secondary',\n success: 'text-success',\n warning: 'text-warning',\n danger: 'text-danger',\n info: 'text-info',\n}\n\nexport const kunBorderClasses: Record<KunUIColor, string> = {\n default: 'border-default',\n primary: 'border-primary',\n secondary: 'border-secondary',\n success: 'border-success',\n warning: 'border-warning',\n danger: 'border-danger',\n info: 'border-info',\n}\n\n/**\n * @deprecated Use {@link kunFocusRingClasses} (or {@link kunFocusRingWithinClasses}\n * for composite widgets). This mixed `:focus` + `:focus-within` so a mouse click\n * lit the ring, and used a different opacity from the rest of the library.\n */\nexport const kunRingClasses: Record<KunUIColor, string> = {\n default: 'focus-within:ring-default/40 focus:ring-default/40',\n primary: 'focus-within:ring-primary/40 focus:ring-primary/40',\n secondary: 'focus-within:ring-secondary/40 focus:ring-secondary/40',\n success: 'focus-within:ring-success/40 focus:ring-success/40',\n warning: 'focus-within:ring-warning/40 focus:ring-warning/40',\n danger: 'focus-within:ring-danger/40 focus:ring-danger/40',\n info: 'focus-within:ring-info/40 focus:ring-info/40',\n}\n\n/**\n * Unified focus ring — ONE recipe for every directly-focusable control (inputs,\n * textarea, select trigger, buttons, checkbox/radio, links, tabs, menu items…).\n * Keyboard focus only (`:focus-visible`, so a mouse click on a button shows no\n * ring; text fields still show it on click via the browser's focus-visible\n * heuristic). A flush 2px ring in the control's semantic color at 50% — replaces\n * the old scatter of `:focus`/`:focus-within` × `ring-1|2|4` × `/25|/40|/50|full`.\n * Pair with `border-kun` at rest; on an invalid control use the `danger` entry.\n */\nexport const kunFocusRingClasses: Record<KunUIColor, string> = {\n default: 'outline-none focus-visible:ring-2 focus-visible:ring-default/50',\n primary: 'outline-none focus-visible:ring-2 focus-visible:ring-primary/50',\n secondary: 'outline-none focus-visible:ring-2 focus-visible:ring-secondary/50',\n success: 'outline-none focus-visible:ring-2 focus-visible:ring-success/50',\n warning: 'outline-none focus-visible:ring-2 focus-visible:ring-warning/50',\n danger: 'outline-none focus-visible:ring-2 focus-visible:ring-danger/50',\n info: 'outline-none focus-visible:ring-2 focus-visible:ring-info/50',\n}\n\n/**\n * Composite-widget variant of {@link kunFocusRingClasses}: the focusable element\n * is an inner `<input>` but the ring should sit on the WRAPPER. Put this on the\n * wrapper and give the inner input `outline-none` (and no ring of its own) so\n * there's exactly one indicator. Used by KunNumberInput / KunTagInput.\n *\n * Uses `focus-within` (not `has-[:focus-visible]`): for a text-field wrapper the\n * two are equivalent — a text input matches `:focus-visible` on click too — and\n * `focus-within` is a native variant that reliably compiles, whereas the\n * `has-[:focus-visible]` arbitrary variant isn't extracted from this TS source.\n */\nexport const kunFocusRingWithinClasses: Record<KunUIColor, string> = {\n default: 'focus-within:ring-2 focus-within:ring-default/50',\n primary: 'focus-within:ring-2 focus-within:ring-primary/50',\n secondary: 'focus-within:ring-2 focus-within:ring-secondary/50',\n success: 'focus-within:ring-2 focus-within:ring-success/50',\n warning: 'focus-within:ring-2 focus-within:ring-warning/50',\n danger: 'focus-within:ring-2 focus-within:ring-danger/50',\n info: 'focus-within:ring-2 focus-within:ring-info/50',\n}\n\n// Very light tint of the semantic color — \"selected card\" backgrounds in\n// RadioGroup and any \"barely there\" colored fill. Keys are static literals.\nexport const kunSoftBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default/5',\n primary: 'bg-primary/5',\n secondary: 'bg-secondary/5',\n success: 'bg-success/5',\n warning: 'bg-warning/5',\n danger: 'bg-danger/5',\n info: 'bg-info/5',\n}\n","import type { KunUIRounded } from './types'\n\n// Static class map for the 5-bucket Kun radius system. All keys are literal\n// strings so the Tailwind JIT picks them up — the `rounded-kun-*` utilities\n// come from the --radius-kun-* tokens shipped by @kungal/ui-tokens.\nexport const kunRoundedClasses: Record<KunUIRounded, string> = {\n none: 'rounded-kun-none',\n sm: 'rounded-kun-sm',\n md: 'rounded-kun-md',\n lg: 'rounded-kun-lg',\n full: 'rounded-kun-full',\n}\n\n// Global default radius bucket (matches the source layer's behaviour where\n// the un-configured fallback is 'md'). A render layer's config provider may\n// override this per subtree.\nexport const KUN_DEFAULT_ROUNDED: KunUIRounded = 'md'\n\n// Pure precedence resolver for a component's effective radius:\n// prop > component built-in fallback > app/provider default\n//\n// This is the framework-agnostic core of the original Vue\n// `useResolvedRounded` composable. Each render layer wraps it in its own\n// reactivity primitive:\n// Vue: computed(() => resolveRounded(props.rounded, fallback, cfg.rounded))\n// React: useMemo(() => resolveRounded(rounded, fallback, cfg.rounded), [...])\nexport const resolveRounded = (\n prop: KunUIRounded | undefined,\n fallback: KunUIRounded | undefined,\n configDefault: KunUIRounded = KUN_DEFAULT_ROUNDED\n): KunUIRounded => prop ?? fallback ?? configDefault\n","import type { KunUISize } from './types'\n\n// The single source of truth for the size of every text-like form control —\n// Button, Input, Select, DatePicker, Textarea, TagInput. They reference this so\n// they share one scale and line up in a row.\n//\n// Padding-driven (not fixed-height): height = font line-height + 2·py + border.\n// `md` is the anchor (~38px, the modern default). px:py is a clean 2:1 (xs/sm a\n// touch looser); horizontal padding grows faster than vertical from md→xl, so a\n// bigger control gets wider, not flatter. Approx heights with a 1px border and\n// text line-heights 16 / 20 / 20 / 24 / 28:\n// xs ≈ 26 · sm ≈ 34 · md ≈ 38 · lg ≈ 46 · xl ≈ 54\nexport const kunControlSizeClasses: Record<KunUISize, string> = {\n xs: 'text-xs px-2.5 py-1',\n sm: 'text-sm px-3.5 py-1.5',\n md: 'text-sm px-4 py-2',\n lg: 'text-base px-5 py-2.5',\n xl: 'text-lg px-6 py-3',\n}\n\nexport interface KunSelectionSize {\n box: string // the square: checkbox box / radio indicator outer ring\n dot: string // radio's inner filled dot (unused by checkbox)\n check: string // checkbox's check glyph (unused by radio)\n text: string // the adjacent label\n gap: string // box ↔ label spacing\n}\n\n// The shared scale for selection controls — KunCheckBox and KunRadioGroup use\n// identical box sizes (every major library does this), so a checkbox and a radio\n// of the same size match. The box is ≈ 0.5× the text-control height and ≈ 1.2–1.4×\n// the label font, so it sits optically level with the label beside it.\n// Box px by size: 12 / 14 / 16 / 20 / 24.\nexport const kunSelectionSizeClasses: Record<KunUISize, KunSelectionSize> = {\n xs: { box: 'size-3', dot: 'size-1.5', check: 'size-2', text: 'text-xs', gap: 'gap-1.5' },\n sm: { box: 'size-3.5', dot: 'size-1.5', check: 'size-2.5', text: 'text-sm', gap: 'gap-2' },\n md: { box: 'size-4', dot: 'size-2', check: 'size-3', text: 'text-sm', gap: 'gap-2' },\n lg: { box: 'size-5', dot: 'size-2.5', check: 'size-3.5', text: 'text-base', gap: 'gap-2.5' },\n xl: { box: 'size-6', dot: 'size-3', check: 'size-4', text: 'text-lg', gap: 'gap-3' },\n}\n\n// The single source of truth for chip / tag pills — a standalone KunChip and the\n// tags inside KunTagInput share it, so a tag looks identical either way. A\n// compact sub-scale (~0.7× the form-control height): vertical padding is tighter\n// than kunControlSizeClasses because a chip is text + tight padding, not a tap\n// target. Pair with `gap-1` + `rounded-full`.\nexport const kunChipSizeClasses: Record<KunUISize, string> = {\n xs: 'px-2 py-0.5 text-xs',\n sm: 'px-2 py-1 text-xs',\n md: 'px-3 py-1 text-sm',\n lg: 'px-4 py-1.5 text-sm',\n xl: 'px-6 py-2 text-base',\n}\n","// Generate a random integer within an inclusive [lower, upper] range.\nexport const randomNum = (lowerValue: number, upperValue: number): number =>\n Math.floor(Math.random() * (upperValue - lowerValue + 1) + lowerValue)\n","// Decode a possibly percent-encoded string, returning the original when it\n// is not encoded (or when decoding throws on malformed input).\nexport const decodeIfEncoded = (text: string): string => {\n try {\n const decoded = decodeURIComponent(text)\n return decoded !== text ? decoded : text\n } catch {\n return text\n }\n}\n","// Deterministic sticker picker for fallback/empty states (avatars without\n// an image, KunNull's empty illustration, etc.).\n//\n// The original was random-per-call + Nuxt `useState` to freeze the pick\n// across SSR hydration. This version derives the URL deterministically from\n// the `id` (a cheap string hash) instead: the same id always yields the same\n// sticker on both server and client, so there is no hydration mismatch and\n// no framework state needed — fully portable.\n//\n// The CDN is the KunUI sticker host; consumers don't need to ship assets.\n\nconst KUN_STICKER_DOMAIN = 'https://sticker.kungal.com'\nconst PACKS = 5\nconst PER_PACK = 80\n\nconst hash = (s: string): number => {\n let h = 0\n for (let i = 0; i < s.length; i++) {\n h = (Math.imul(h, 31) + s.charCodeAt(i)) >>> 0\n }\n return h\n}\n\nexport const getRandomSticker = (id = ''): string => {\n const h = hash(id)\n const pack = (h % PACKS) + 1\n const sticker = (Math.floor(h / PACKS) % PER_PACK) + 1\n return `${KUN_STICKER_DOMAIN}/stickers/KUNgal${pack}/${sticker}.webp`\n}\n","// AUTO-GENERATED by scripts/gen-icons.mjs — do not edit by hand.\n// Regenerate: pnpm --filter @kungal/ui-core gen:icons\nimport type { KunIconData } from './icons'\n\n// SVG data for the icons KunUI components render, bundled inline so the\n// library never fetches an icon at runtime. Bodies use currentColor.\nexport const KUN_BUNDLED_ICONS: Record<string, KunIconData> = {\n \"lucide:x\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M18 6L6 18M6 6l12 12\\\"/>\"},\n \"lucide:check\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M20 6L9 17l-5-5\\\"/>\"},\n \"lucide:info\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"M12 16v-4m0-4h.01\\\"/></g>\"},\n \"lucide:circle-check\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"m9 12l2 2l4-4\\\"/></g>\"},\n \"lucide:circle-x\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"m15 9l-6 6m0-6l6 6\\\"/></g>\"},\n \"lucide:triangle-alert\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01\\\"/>\"},\n \"lucide:chevron-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m9 18l6-6l-6-6\\\"/>\"},\n \"lucide:chevron-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m15 18l-6-6l6-6\\\"/>\"},\n \"lucide:chevron-down\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m6 9l6 6l6-6\\\"/>\"},\n \"lucide:chevrons-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m6 17l5-5l-5-5m7 10l5-5l-5-5\\\"/>\"},\n \"lucide:chevrons-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m11 17l-5-5l5-5m7 10l-5-5l5-5\\\"/>\"},\n \"lucide:arrow-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14m-7-7l7 7l-7 7\\\"/>\"},\n \"lucide:arrow-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m12 19l-7-7l7-7m7 7H5\\\"/>\"},\n \"lucide:plus\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14m-7-7v14\\\"/>\"},\n \"lucide:minus\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14\\\"/>\"},\n \"lucide:upload\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\\\"/>\"},\n \"lucide:zoom-in\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.35-4.35M11 8v6m-3-3h6\\\"/></g>\"},\n \"lucide:zoom-out\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.35-4.35M8 11h6\\\"/></g>\"},\n \"lucide:rotate-cw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\\\"/><path d=\\\"M21 3v5h-5\\\"/></g>\"},\n \"lucide:rotate-ccw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8\\\"/><path d=\\\"M3 3v5h5\\\"/></g>\"},\n \"lucide:refresh-ccw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M21 12a9 9 0 0 0-9-9a9.75 9.75 0 0 0-6.74 2.74L3 8\\\"/><path d=\\\"M3 3v5h5m-5 4a9 9 0 0 0 9 9a9.75 9.75 0 0 0 6.74-2.74L21 16\\\"/><path d=\\\"M16 16h5v5\\\"/></g>\"},\n \"lucide:external-link\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\\\"/>\"},\n \"lucide:download\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\\\"/><path d=\\\"m7 10l5 5l5-5\\\"/></g>\"},\n \"lucide:copy\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><rect width=\\\"14\\\" height=\\\"14\\\" x=\\\"8\\\" y=\\\"8\\\" rx=\\\"2\\\" ry=\\\"2\\\"/><path d=\\\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\\\"/></g>\"},\n \"lucide:calendar\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M8 2v4m8-4v4\\\"/><rect width=\\\"18\\\" height=\\\"18\\\" x=\\\"3\\\" y=\\\"4\\\" rx=\\\"2\\\"/><path d=\\\"M3 10h18\\\"/></g>\"},\n \"lucide:lollipop\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.3-4.3M11 11a2 2 0 0 0 4 0a4 4 0 0 0-8 0a6 6 0 0 0 12 0\\\"/></g>\"},\n \"lucide:eye\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0\\\"/><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"3\\\"/></g>\"},\n \"lucide:eye-off\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242\\\"/><path d=\\\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20\\\"/></g>\"},\n \"lucide:search\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"m21 21l-4.34-4.34\\\"/><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/></g>\"},\n \"svg-spinners:90-ring-with-bg\": {\"body\":\"<path fill=\\\"currentColor\\\" d=\\\"M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z\\\" opacity=\\\".25\\\"/><path fill=\\\"currentColor\\\" d=\\\"M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z\\\"><animateTransform attributeName=\\\"transform\\\" dur=\\\"0.75s\\\" repeatCount=\\\"indefinite\\\" type=\\\"rotate\\\" values=\\\"0 12 12;360 12 12\\\"/></path>\"},\n}\n","import { KUN_BUNDLED_ICONS } from './icons-data'\n\n// Iconify-compatible icon shape: `body` is the inner SVG markup (using\n// `currentColor`), rendered into a `0 0 width height` viewBox (default 24).\nexport interface KunIconData {\n body: string\n width?: number\n height?: number\n}\n\n// The registry is SEEDED with KunUI's bundled internal icons (referenced via\n// the data import, so it is never tree-shaken away — no side-effect needed).\n// Consumers add their own icons with registerKunIcon(s). KunIcon renders from\n// this registry and NEVER fetches from a network/API.\nconst registry = new Map<string, KunIconData>(Object.entries(KUN_BUNDLED_ICONS))\n\nexport const registerKunIcon = (name: string, data: KunIconData): void => {\n registry.set(name, data)\n}\n\n// Bulk register — pass a Record<name, data>, e.g. icons extracted from\n// `@iconify-json/*` at build time, or your own custom SVGs.\nexport const registerKunIcons = (\n icons: Record<string, KunIconData>\n): void => {\n for (const [name, data] of Object.entries(icons)) registry.set(name, data)\n}\n\nexport const getKunIcon = (name: string): KunIconData | undefined =>\n registry.get(name)\n\nexport const hasKunIcon = (name: string): boolean => registry.has(name)\n"]}
1
+ {"version":3,"sources":["../src/cn.ts","../src/variants.ts","../src/rounded.ts","../src/controlSize.ts","../src/random.ts","../src/decodeIfEncoded.ts","../src/getRandomSticker.ts","../src/icons-data.ts","../src/icons.ts"],"names":[],"mappings":";;;;AAMO,IAAM,KAAK,CAAA,GAAI,MAAA,KAAiC,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC;;;ACO3E,IAAM,KAAA,GAA0D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU9D,KAAA,EAAO;AAAA,IACL,OAAA,EAAS,qEAAA;AAAA,IACT,OAAA,EAAS,qEAA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IAAI,CAAA;AACzB;AAIO,IAAM,gBAAA,GAAmB,CAC9B,KAAA,KACS;AACT,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,IAAI,CAAA,IAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG,QAAA,CAAS,GAAA,CAAI,IAAA,EAAM,IAAI,CAAA;AAC3E;AAEO,IAAM,UAAA,GAAa,CAAC,IAAA,KACzB,QAAA,CAAS,IAAI,IAAI;AAEZ,IAAM,UAAA,GAAa,CAAC,IAAA,KAA0B,QAAA,CAAS,IAAI,IAAI","file":"index.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\n// Merge Tailwind class names with conflict resolution. Framework-agnostic:\n// the Vue and React layers both import this so \"last class wins\" semantics\n// are identical everywhere.\nexport const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs))\n\nexport type { ClassValue }\n","import type { KunUIVariant, KunUIColor } from './types'\n\n// Single source of truth for the variant × color → Tailwind class table.\n// Button / Badge / Chip / Tab / Info / Progress etc. (in every framework\n// layer) consume this so the 7 × 7 matrix lives in exactly one place.\n//\n// All keys MUST be static string literals so the Tailwind JIT picks them\n// up — never construct class names with template strings at runtime.\n// Every entry carries an explicit `border` WIDTH so the outline variants\n// (bordered / ghost) actually render — `border-{color}` alone sets only the\n// color and paints nothing in Tailwind v4. Filled / light variants use a\n// transparent border of the same width so switching variants never shifts the\n// box by a pixel.\nconst TABLE: Record<KunUIVariant, Record<KunUIColor, string>> = {\n // Filled buttons keep white text in BOTH modes, so the fill must stay dark\n // enough for contrast. The dark color scale is inverted (`-500`/`-600` become\n // LIGHT in dark mode), so a plain `bg-{color}` renders pale — worst on the\n // light hues (info ≈ L88%, default/secondary ≈ L65–72%). Each entry pins a\n // `dark:bg-{color}-{n}` that lands every color at a consistent ~L44–55% so the\n // whole row reads as one saturated tier with legible white text.\n // Foreground: the dark hues take white; the light hues (success / warning /\n // info) are light in BOTH modes, so white text fails WCAG on them (~1.5–3.4:1)\n // — they take dark text (≈6–18:1). See kunSolidFgClasses.\n solid: {\n default: 'border border-transparent bg-default text-white dark:bg-default-400',\n primary: 'border border-transparent bg-primary text-white dark:bg-primary-400',\n secondary: 'border border-transparent bg-secondary text-black dark:bg-secondary-300',\n success: 'border border-transparent bg-success-600 text-black dark:bg-success-400',\n warning: 'border border-transparent bg-warning text-black dark:bg-warning-400',\n danger: 'border border-transparent bg-danger text-white dark:bg-danger-400',\n info: 'border border-transparent bg-info-600 text-black dark:bg-info-300',\n },\n bordered: {\n default: 'border border-default bg-transparent',\n primary: 'border border-primary bg-transparent text-primary',\n secondary: 'border border-secondary bg-transparent text-secondary',\n success: 'border border-success bg-transparent text-success',\n warning: 'border border-warning bg-transparent text-warning',\n danger: 'border border-danger bg-transparent text-danger',\n info: 'border border-info bg-transparent text-info',\n },\n light: {\n default: 'border border-transparent bg-transparent hover:bg-default/20',\n primary: 'border border-transparent bg-transparent text-primary hover:bg-primary/20',\n secondary: 'border border-transparent bg-transparent text-secondary hover:bg-secondary/20',\n success: 'border border-transparent bg-transparent text-success hover:bg-success/20',\n warning: 'border border-transparent bg-transparent text-warning hover:bg-warning/20',\n danger: 'border border-transparent bg-transparent text-danger hover:bg-danger/20',\n info: 'border border-transparent bg-transparent text-info hover:bg-info/20',\n },\n flat: {\n default: 'border border-transparent bg-default/20 text-default-700',\n primary: 'border border-transparent bg-primary/20 text-primary-600',\n secondary: 'border border-transparent bg-secondary/20 text-secondary-600',\n success: 'border border-transparent bg-success/20 text-success-700 dark:text-success',\n warning: 'border border-transparent bg-warning/20 text-warning-700 dark:text-warning',\n danger: 'border border-transparent bg-danger/20 text-danger-600 dark:text-danger-500',\n info: 'border border-transparent bg-info/20 text-info-700 dark:text-info-500',\n },\n // Same fill logic as `solid` (see note above) plus a COLORED glow. The glow\n // needs both a size (`shadow-lg` — the geometry) AND a tint (`shadow-{color}/40`\n // — sets --tw-shadow-color): a color utility alone leaves --tw-shadow empty, so\n // the button rendered with NO shadow at all. `overflow-hidden` on the button\n // doesn't clip its own outset box-shadow, so the glow shows.\n shadow: {\n default: 'border border-transparent shadow-lg shadow-default/40 bg-default text-white dark:bg-default-400',\n primary: 'border border-transparent shadow-lg shadow-primary/40 bg-primary text-white dark:bg-primary-400',\n secondary: 'border border-transparent shadow-lg shadow-secondary/40 bg-secondary text-black dark:bg-secondary-300',\n success: 'border border-transparent shadow-lg shadow-success/40 bg-success-600 text-black dark:bg-success-400',\n warning: 'border border-transparent shadow-lg shadow-warning/40 bg-warning text-black dark:bg-warning-400',\n danger: 'border border-transparent shadow-lg shadow-danger/40 bg-danger text-white dark:bg-danger-400',\n info: 'border border-transparent shadow-lg shadow-info/40 bg-info-600 text-black dark:bg-info-300',\n },\n ghost: {\n default: 'border border-default bg-transparent hover:bg-default/10',\n primary: 'border border-primary bg-transparent text-primary hover:bg-primary/10',\n secondary: 'border border-secondary bg-transparent text-secondary hover:bg-secondary/10',\n success: 'border border-success bg-transparent text-success hover:bg-success/10',\n warning: 'border border-warning bg-transparent text-warning hover:bg-warning/10',\n danger: 'border border-danger bg-transparent text-danger hover:bg-danger/10',\n info: 'border border-info bg-transparent text-info hover:bg-info/10',\n },\n}\n\nexport const kunVariantClasses = (\n variant: KunUIVariant,\n color: KunUIColor\n): string => TABLE[variant][color]\n\n// Static maps for narrower use cases (just the fill color, just the text\n// color, etc.) — same JIT-safety requirement: keys must be literals.\n\nexport const kunBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default',\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-danger',\n info: 'bg-info',\n}\n\n// ─── Solid fills (a colored fill that carries text / icons) ──────────────────\n// Two facts shape these, both verified by contrast measurement:\n// 1. The dark color scale is INVERTED, so a plain `bg-{color}` renders pale in\n// dark mode — each fill pins a `dark:bg-{color}-{n}` to stay saturated\n// enough for its foreground. (Same pins as the Button `solid` row.)\n// 2. The light hues (success / warning / info) are light in BOTH modes, so\n// white text fails WCAG on them everywhere (~1.2–3.4:1). They take DARK\n// text (≈6–18:1); the darker hues keep white.\n// Reach for these — NOT plain `kunBgClasses` — whenever a colored fill carries a\n// foreground. `kunBgClasses` stays for tints / bars / dots that carry no text.\n\n/** Just the fill (with the dark-mode pin). Pair with {@link kunSolidFgClasses}\n * when the fill and its text live on different elements. */\nexport const kunSolidBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default dark:bg-default-400',\n primary: 'bg-primary dark:bg-primary-400',\n secondary: 'bg-secondary dark:bg-secondary-300',\n success: 'bg-success-600 dark:bg-success-400',\n warning: 'bg-warning dark:bg-warning-400',\n danger: 'bg-danger dark:bg-danger-400',\n info: 'bg-info-600 dark:bg-info-300',\n}\n\n/** The foreground that stays legible on the matching solid fill in both modes. */\n// secondary is a bright magenta — white fails on it (≈2.9:1 in light); it takes\n// dark text. danger keeps white (the red+white convention; ≈4.1:1, legible).\nexport const kunSolidFgClasses: Record<KunUIColor, string> = {\n default: 'text-white',\n primary: 'text-white',\n secondary: 'text-black',\n success: 'text-black',\n warning: 'text-black',\n danger: 'text-white',\n info: 'text-black',\n}\n\n/** Fill + matching foreground — the common case (text sits on the fill). */\nexport const kunSolidClasses: Record<KunUIColor, string> = {\n default: 'bg-default text-white dark:bg-default-400',\n primary: 'bg-primary text-white dark:bg-primary-400',\n secondary: 'bg-secondary text-black dark:bg-secondary-300',\n success: 'bg-success-600 text-black dark:bg-success-400',\n warning: 'bg-warning text-black dark:bg-warning-400',\n danger: 'bg-danger text-white dark:bg-danger-400',\n info: 'bg-info-600 text-black dark:bg-info-300',\n}\n\nexport const kunTextClasses: Record<KunUIColor, string> = {\n default: 'text-foreground',\n primary: 'text-primary',\n secondary: 'text-secondary',\n success: 'text-success',\n warning: 'text-warning',\n danger: 'text-danger',\n info: 'text-info',\n}\n\nexport const kunBorderClasses: Record<KunUIColor, string> = {\n default: 'border-default',\n primary: 'border-primary',\n secondary: 'border-secondary',\n success: 'border-success',\n warning: 'border-warning',\n danger: 'border-danger',\n info: 'border-info',\n}\n\n/**\n * @deprecated Use {@link kunFocusRingClasses} (or {@link kunFocusRingWithinClasses}\n * for composite widgets). This mixed `:focus` + `:focus-within` so a mouse click\n * lit the ring, and used a different opacity from the rest of the library.\n */\nexport const kunRingClasses: Record<KunUIColor, string> = {\n default: 'focus-within:ring-default/40 focus:ring-default/40',\n primary: 'focus-within:ring-primary/40 focus:ring-primary/40',\n secondary: 'focus-within:ring-secondary/40 focus:ring-secondary/40',\n success: 'focus-within:ring-success/40 focus:ring-success/40',\n warning: 'focus-within:ring-warning/40 focus:ring-warning/40',\n danger: 'focus-within:ring-danger/40 focus:ring-danger/40',\n info: 'focus-within:ring-info/40 focus:ring-info/40',\n}\n\n/**\n * Unified focus ring — ONE recipe for every directly-focusable control (inputs,\n * textarea, select trigger, buttons, checkbox/radio, links, tabs, menu items…).\n * Keyboard focus only (`:focus-visible`, so a mouse click on a button shows no\n * ring; text fields still show it on click via the browser's focus-visible\n * heuristic). A flush 2px ring in the control's semantic color at 50% — replaces\n * the old scatter of `:focus`/`:focus-within` × `ring-1|2|4` × `/25|/40|/50|full`.\n * Pair with `border-kun` at rest; on an invalid control use the `danger` entry.\n */\nexport const kunFocusRingClasses: Record<KunUIColor, string> = {\n default: 'outline-none focus-visible:ring-2 focus-visible:ring-default/50',\n primary: 'outline-none focus-visible:ring-2 focus-visible:ring-primary/50',\n secondary: 'outline-none focus-visible:ring-2 focus-visible:ring-secondary/50',\n success: 'outline-none focus-visible:ring-2 focus-visible:ring-success/50',\n warning: 'outline-none focus-visible:ring-2 focus-visible:ring-warning/50',\n danger: 'outline-none focus-visible:ring-2 focus-visible:ring-danger/50',\n info: 'outline-none focus-visible:ring-2 focus-visible:ring-info/50',\n}\n\n/**\n * Composite-widget variant of {@link kunFocusRingClasses}: the focusable element\n * is an inner `<input>` but the ring should sit on the WRAPPER. Put this on the\n * wrapper and give the inner input `outline-none` (and no ring of its own) so\n * there's exactly one indicator. Used by KunNumberInput / KunTagInput.\n *\n * Uses `focus-within` (not `has-[:focus-visible]`): for a text-field wrapper the\n * two are equivalent — a text input matches `:focus-visible` on click too — and\n * `focus-within` is a native variant that reliably compiles, whereas the\n * `has-[:focus-visible]` arbitrary variant isn't extracted from this TS source.\n */\nexport const kunFocusRingWithinClasses: Record<KunUIColor, string> = {\n default: 'focus-within:ring-2 focus-within:ring-default/50',\n primary: 'focus-within:ring-2 focus-within:ring-primary/50',\n secondary: 'focus-within:ring-2 focus-within:ring-secondary/50',\n success: 'focus-within:ring-2 focus-within:ring-success/50',\n warning: 'focus-within:ring-2 focus-within:ring-warning/50',\n danger: 'focus-within:ring-2 focus-within:ring-danger/50',\n info: 'focus-within:ring-2 focus-within:ring-info/50',\n}\n\n// Very light tint of the semantic color — \"selected card\" backgrounds in\n// RadioGroup and any \"barely there\" colored fill. Keys are static literals.\nexport const kunSoftBgClasses: Record<KunUIColor, string> = {\n default: 'bg-default/5',\n primary: 'bg-primary/5',\n secondary: 'bg-secondary/5',\n success: 'bg-success/5',\n warning: 'bg-warning/5',\n danger: 'bg-danger/5',\n info: 'bg-info/5',\n}\n","import type { KunUIRounded } from './types'\n\n// Static class map for the 5-bucket Kun radius system. All keys are literal\n// strings so the Tailwind JIT picks them up — the `rounded-kun-*` utilities\n// come from the --radius-kun-* tokens shipped by @kungal/ui-tokens.\nexport const kunRoundedClasses: Record<KunUIRounded, string> = {\n none: 'rounded-kun-none',\n sm: 'rounded-kun-sm',\n md: 'rounded-kun-md',\n lg: 'rounded-kun-lg',\n full: 'rounded-kun-full',\n}\n\n// Global default radius bucket (matches the source layer's behaviour where\n// the un-configured fallback is 'md'). A render layer's config provider may\n// override this per subtree.\nexport const KUN_DEFAULT_ROUNDED: KunUIRounded = 'md'\n\n// Pure precedence resolver for a component's effective radius:\n// prop > component built-in fallback > app/provider default\n//\n// This is the framework-agnostic core of the original Vue\n// `useResolvedRounded` composable. Each render layer wraps it in its own\n// reactivity primitive:\n// Vue: computed(() => resolveRounded(props.rounded, fallback, cfg.rounded))\n// React: useMemo(() => resolveRounded(rounded, fallback, cfg.rounded), [...])\nexport const resolveRounded = (\n prop: KunUIRounded | undefined,\n fallback: KunUIRounded | undefined,\n configDefault: KunUIRounded = KUN_DEFAULT_ROUNDED\n): KunUIRounded => prop ?? fallback ?? configDefault\n","import type { KunUISize } from './types'\n\n// The single source of truth for the size of every text-like form control —\n// Button, Input, Select, DatePicker, Textarea, TagInput. They reference this so\n// they share one scale and line up in a row.\n//\n// Padding-driven (not fixed-height): height = font line-height + 2·py + border.\n// `md` is the anchor (~38px, the modern default). px:py is a clean 2:1 (xs/sm a\n// touch looser); horizontal padding grows faster than vertical from md→xl, so a\n// bigger control gets wider, not flatter. Approx heights with a 1px border and\n// text line-heights 16 / 20 / 20 / 24 / 28:\n// xs ≈ 26 · sm ≈ 34 · md ≈ 38 · lg ≈ 46 · xl ≈ 54\nexport const kunControlSizeClasses: Record<KunUISize, string> = {\n xs: 'text-xs px-2.5 py-1',\n sm: 'text-sm px-3.5 py-1.5',\n md: 'text-sm px-4 py-2',\n lg: 'text-base px-5 py-2.5',\n xl: 'text-lg px-6 py-3',\n}\n\n// Icon-only buttons: a fixed SQUARE whose side equals the text-button height at\n// the same size, so an icon button lines up with text buttons in a row.\n//\n// Why this exists: kunControlSizeClasses is padding-driven (height = line-height\n// + 2·py + border). A text label contributes a full line-box (≈1.5em), but a lone\n// 1em icon does not — with the same padding the icon button would come out\n// shorter and break the row. Mainstream libraries dodge this by giving buttons a\n// fixed height and making the icon button a square of that height (shadcn\n// `size-9`, HeroUI/Chakra/Ant `isIconOnly`/`.ant-btn-icon-only`). We do the same,\n// ONLY for icon-only, keeping the icon at its natural 1em centered in the box.\n//\n// Sides MUST equal the kunControlSizeClasses heights (incl. the 1px border every\n// variant carries): xs 26 · sm 34 · md 38 · lg 46 · xl 54. (size-* is border-box,\n// so the value already accounts for the icon button's own 1px border.)\nexport const kunControlSquareClasses: Record<KunUISize, string> = {\n xs: 'size-[26px] p-0',\n sm: 'size-[34px] p-0',\n md: 'size-[38px] p-0',\n lg: 'size-[46px] p-0',\n xl: 'size-[54px] p-0',\n}\n\nexport interface KunSelectionSize {\n box: string // the square: checkbox box / radio indicator outer ring\n dot: string // radio's inner filled dot (unused by checkbox)\n check: string // checkbox's check glyph (unused by radio)\n text: string // the adjacent label\n gap: string // box ↔ label spacing\n}\n\n// The shared scale for selection controls — KunCheckBox and KunRadioGroup use\n// identical box sizes (every major library does this), so a checkbox and a radio\n// of the same size match. The box is ≈ 0.5× the text-control height and ≈ 1.2–1.4×\n// the label font, so it sits optically level with the label beside it.\n// Box px by size: 12 / 14 / 16 / 20 / 24.\nexport const kunSelectionSizeClasses: Record<KunUISize, KunSelectionSize> = {\n xs: { box: 'size-3', dot: 'size-1.5', check: 'size-2', text: 'text-xs', gap: 'gap-1.5' },\n sm: { box: 'size-3.5', dot: 'size-1.5', check: 'size-2.5', text: 'text-sm', gap: 'gap-2' },\n md: { box: 'size-4', dot: 'size-2', check: 'size-3', text: 'text-sm', gap: 'gap-2' },\n lg: { box: 'size-5', dot: 'size-2.5', check: 'size-3.5', text: 'text-base', gap: 'gap-2.5' },\n xl: { box: 'size-6', dot: 'size-3', check: 'size-4', text: 'text-lg', gap: 'gap-3' },\n}\n\n// The single source of truth for chip / tag pills — a standalone KunChip and the\n// tags inside KunTagInput share it, so a tag looks identical either way. A\n// compact sub-scale (~0.7× the form-control height): vertical padding is tighter\n// than kunControlSizeClasses because a chip is text + tight padding, not a tap\n// target. Pair with `gap-1` + `rounded-full`.\nexport const kunChipSizeClasses: Record<KunUISize, string> = {\n xs: 'px-2 py-0.5 text-xs',\n sm: 'px-2 py-1 text-xs',\n md: 'px-3 py-1 text-sm',\n lg: 'px-4 py-1.5 text-sm',\n xl: 'px-6 py-2 text-base',\n}\n","// Generate a random integer within an inclusive [lower, upper] range.\nexport const randomNum = (lowerValue: number, upperValue: number): number =>\n Math.floor(Math.random() * (upperValue - lowerValue + 1) + lowerValue)\n","// Decode a possibly percent-encoded string, returning the original when it\n// is not encoded (or when decoding throws on malformed input).\nexport const decodeIfEncoded = (text: string): string => {\n try {\n const decoded = decodeURIComponent(text)\n return decoded !== text ? decoded : text\n } catch {\n return text\n }\n}\n","// Deterministic sticker picker for fallback/empty states (avatars without\n// an image, KunNull's empty illustration, etc.).\n//\n// The original was random-per-call + Nuxt `useState` to freeze the pick\n// across SSR hydration. This version derives the URL deterministically from\n// the `id` (a cheap string hash) instead: the same id always yields the same\n// sticker on both server and client, so there is no hydration mismatch and\n// no framework state needed — fully portable.\n//\n// The CDN is the KunUI sticker host; consumers don't need to ship assets.\n\nconst KUN_STICKER_DOMAIN = 'https://sticker.kungal.com'\nconst PACKS = 5\nconst PER_PACK = 80\n\nconst hash = (s: string): number => {\n let h = 0\n for (let i = 0; i < s.length; i++) {\n h = (Math.imul(h, 31) + s.charCodeAt(i)) >>> 0\n }\n return h\n}\n\nexport const getRandomSticker = (id = ''): string => {\n const h = hash(id)\n const pack = (h % PACKS) + 1\n const sticker = (Math.floor(h / PACKS) % PER_PACK) + 1\n return `${KUN_STICKER_DOMAIN}/stickers/KUNgal${pack}/${sticker}.webp`\n}\n","// AUTO-GENERATED by scripts/gen-icons.mjs — do not edit by hand.\n// Regenerate: pnpm --filter @kungal/ui-core gen:icons\nimport type { KunIconData } from './icons'\n\n// SVG data for the icons KunUI components render, bundled inline so the\n// library never fetches an icon at runtime. Bodies use currentColor.\nexport const KUN_BUNDLED_ICONS: Record<string, KunIconData> = {\n \"lucide:x\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M18 6L6 18M6 6l12 12\\\"/>\"},\n \"lucide:check\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M20 6L9 17l-5-5\\\"/>\"},\n \"lucide:info\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"M12 16v-4m0-4h.01\\\"/></g>\"},\n \"lucide:circle-check\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"m9 12l2 2l4-4\\\"/></g>\"},\n \"lucide:circle-x\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/><path d=\\\"m15 9l-6 6m0-6l6 6\\\"/></g>\"},\n \"lucide:triangle-alert\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01\\\"/>\"},\n \"lucide:chevron-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m9 18l6-6l-6-6\\\"/>\"},\n \"lucide:chevron-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m15 18l-6-6l6-6\\\"/>\"},\n \"lucide:chevron-down\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m6 9l6 6l6-6\\\"/>\"},\n \"lucide:chevrons-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m6 17l5-5l-5-5m7 10l5-5l-5-5\\\"/>\"},\n \"lucide:chevrons-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m11 17l-5-5l5-5m7 10l-5-5l5-5\\\"/>\"},\n \"lucide:arrow-right\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14m-7-7l7 7l-7 7\\\"/>\"},\n \"lucide:arrow-left\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"m12 19l-7-7l7-7m7 7H5\\\"/>\"},\n \"lucide:plus\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14m-7-7v14\\\"/>\"},\n \"lucide:minus\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M5 12h14\\\"/>\"},\n \"lucide:upload\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\\\"/>\"},\n \"lucide:zoom-in\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.35-4.35M11 8v6m-3-3h6\\\"/></g>\"},\n \"lucide:zoom-out\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.35-4.35M8 11h6\\\"/></g>\"},\n \"lucide:rotate-cw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\\\"/><path d=\\\"M21 3v5h-5\\\"/></g>\"},\n \"lucide:rotate-ccw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8\\\"/><path d=\\\"M3 3v5h5\\\"/></g>\"},\n \"lucide:refresh-ccw\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M21 12a9 9 0 0 0-9-9a9.75 9.75 0 0 0-6.74 2.74L3 8\\\"/><path d=\\\"M3 3v5h5m-5 4a9 9 0 0 0 9 9a9.75 9.75 0 0 0 6.74-2.74L21 16\\\"/><path d=\\\"M16 16h5v5\\\"/></g>\"},\n \"lucide:external-link\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\\\"/>\"},\n \"lucide:download\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\\\"/><path d=\\\"m7 10l5 5l5-5\\\"/></g>\"},\n \"lucide:copy\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><rect width=\\\"14\\\" height=\\\"14\\\" x=\\\"8\\\" y=\\\"8\\\" rx=\\\"2\\\" ry=\\\"2\\\"/><path d=\\\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\\\"/></g>\"},\n \"lucide:calendar\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M8 2v4m8-4v4\\\"/><rect width=\\\"18\\\" height=\\\"18\\\" x=\\\"3\\\" y=\\\"4\\\" rx=\\\"2\\\"/><path d=\\\"M3 10h18\\\"/></g>\"},\n \"lucide:lollipop\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/><path d=\\\"m21 21l-4.3-4.3M11 11a2 2 0 0 0 4 0a4 4 0 0 0-8 0a6 6 0 0 0 12 0\\\"/></g>\"},\n \"lucide:eye\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0\\\"/><circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"3\\\"/></g>\"},\n \"lucide:eye-off\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242\\\"/><path d=\\\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20\\\"/></g>\"},\n \"lucide:search\": {\"body\":\"<g fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\"><path d=\\\"m21 21l-4.34-4.34\\\"/><circle cx=\\\"11\\\" cy=\\\"11\\\" r=\\\"8\\\"/></g>\"},\n \"svg-spinners:90-ring-with-bg\": {\"body\":\"<path fill=\\\"currentColor\\\" d=\\\"M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z\\\" opacity=\\\".25\\\"/><path fill=\\\"currentColor\\\" d=\\\"M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z\\\"><animateTransform attributeName=\\\"transform\\\" dur=\\\"0.75s\\\" repeatCount=\\\"indefinite\\\" type=\\\"rotate\\\" values=\\\"0 12 12;360 12 12\\\"/></path>\"},\n}\n","import { KUN_BUNDLED_ICONS } from './icons-data'\n\n// Iconify-compatible icon shape: `body` is the inner SVG markup (using\n// `currentColor`), rendered into a `0 0 width height` viewBox (default 24).\nexport interface KunIconData {\n body: string\n width?: number\n height?: number\n}\n\n// The registry is SEEDED with KunUI's bundled internal icons (referenced via\n// the data import, so it is never tree-shaken away — no side-effect needed).\n// Consumers add their own icons with registerKunIcon(s). KunIcon renders from\n// this registry and NEVER fetches from a network/API.\nconst registry = new Map<string, KunIconData>(Object.entries(KUN_BUNDLED_ICONS))\n\nexport const registerKunIcon = (name: string, data: KunIconData): void => {\n registry.set(name, data)\n}\n\n// Bulk register — pass a Record<name, data>, e.g. icons extracted from\n// `@iconify-json/*` at build time, or your own custom SVGs.\nexport const registerKunIcons = (\n icons: Record<string, KunIconData>\n): void => {\n for (const [name, data] of Object.entries(icons)) registry.set(name, data)\n}\n\nexport const getKunIcon = (name: string): KunIconData | undefined =>\n registry.get(name)\n\nexport const hasKunIcon = (name: string): boolean => registry.has(name)\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungal/ui-core",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "KunUI framework-agnostic core — design types, cn(), variant matrix, radius system, utils. No Vue/React.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -25,6 +25,7 @@
25
25
  },
26
26
  "sideEffects": false,
27
27
  "files": [
28
+ "CHANGELOG.md",
28
29
  "dist"
29
30
  ],
30
31
  "main": "./dist/index.cjs",