@kungal/ui-core 2.26.2 → 2.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # @kungal/ui-core
2
2
 
3
+ ## 2.27.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5890c9c: `cn()` 现在认识 KunUI 自己的 Tailwind 比例尺;KunAutocomplete 补回输入法保护;组件文档补上事件与插槽
8
+
9
+ 上一次发布后做了一轮更严格的复测,这次修的是那轮报告里"根因还在"的部分。
10
+
11
+ ## `cn()`:把 KunUI 的比例尺教给 tailwind-merge
12
+
13
+ tailwind-merge 只认识 Tailwind 自己的比例尺,凡是它解析不了的类都原样放行、也就永远不会参与冲突消解。KunUI 在 `@theme` / `@utility` 里自己铸的那一批全都在这个盲区里:
14
+
15
+ ```ts
16
+ cn("rounded-kun-md", "rounded-full"); // 旧:两个类都留下,谁赢由 CSS 源码顺序决定
17
+ ```
18
+
19
+ 实测后果是 `KunSelect` 的 `classNames.trigger: 'rounded-full'` 传下去圆角仍然是 12px —— 也就是说 `classNames` 文档里承诺的"你的类会赢"对 `rounded-kun-*`、`shadow-kun-*`、`z-kun-*`、`ease-kun-*`、`duration-kun-*` 和自定义 `animate-*` 全部不成立。
20
+
21
+ `shadow-kun-*` 比其它几个更糟:shadow **颜色**组的校验器接受任意非任意值单词,所以 `shadow-kun-md` 被归类成了颜色,会和 `shadow-primary/20` 互相消解 —— 被丢掉的是那条真正的 box-shadow。
22
+
23
+ 现在 `cn()` 用 `extendTailwindMerge` 把这些名字注册进对应的组,`classNames` 的承诺第一次是真的。**名单由 `pnpm gen` 从 `tokens.css` 生成**(`packages/ui-core/src/twScales.generated.ts`),因为手写名单漂移之后不会报任何错,只会安静地退回旧行为。
24
+
25
+ 库内部只有两处的合并结果因此改变,两处都是"本来就想让后写的那个赢":日期面板里区间中段的月/年格子(`rounded-kun-md` 之后跟 `rounded-none`)现在稳定是方角,禁用的 `KunTextarea`(`shadow-kun-sm` 之后跟 `shadow-none`)现在稳定没有阴影。
26
+
27
+ ## KunAutocomplete:补回输入法保护
28
+
29
+ 和 KunSelect 上一轮修掉的是同一个洞。`:value` + 手写 `@input` 会绕过 Vue 自己的组合输入保护(`runtime-dom` 的 `vModelText` 在 `compositionstart` 上打 `e.target.composing` 标记,input 监听器以 `if (e.target.composing) return` 开头),于是用拼音打「你好」时列表会在每一次罗马字按键上重新过滤、塌成"无匹配项",`@search` 也会在真正那一次之前先发五次半成品。现在按 `compositionstart` / `compositionend` 跟踪,一个词只发一次。
30
+
31
+ ## KunDatePicker
32
+
33
+ - **「今天」不再无视 `minDate` / `maxDate` / `isDateDisabled`。** 它绕开网格直接提交,所以当今天本身超出边界时它是唯一一条能一键选中被禁日期的路径。现在按钮直接禁用。
34
+ - **面板的 ARIA 语义改成自洽的组合框 + 网格。** 原先面板是 `role="dialog" aria-modal="true"`,但焦点始终留在 trigger 上 —— 等于对辅助技术宣称"页面其余部分已惰性化",而被聚焦的元素恰恰在那"其余部分"里。ARIA 1.2 只在 "`aria-controls` refers to an element that supports `aria-activedescendant`" 时允许组合框保留焦点并把 `aria-activedescendant` 指进弹出层,而 `dialog` 不在该属性的适用角色里、`grid` 在。所以:弹出层就是网格,trigger 改为 `aria-haspopup="grid"`、`aria-controls` 指向网格本身,面板不再是 dialog。与 KunSelect(`combobox` + `haspopup="listbox"` + `aria-controls` 指向 listbox)完全同构。
35
+ - **三个网格补上 `role="row"`。** `role="grid"` 直接套 `role="gridcell"` 是不完整的,屏幕阅读器会把 42 个格子读成一个平铺列表,丢掉"第 3 列 / 共 7 列"。每一行现在是自己的 CSS grid,行永远是满的,所以视觉上和原来逐像素一致。星期表头按 react-aria `useCalendarGrid` 的做法标 `aria-hidden`("the day names are already included in the label of each cell",我们的格子标签是完整的 `toDateString()`)。
36
+
37
+ 如果你的测试用 `[role="dialog"]` 找日期面板、或者用 `[role="grid"] > [role="gridcell"]` 直接取格子,需要相应改一下。
38
+
39
+ ## KunTab
40
+
41
+ `setTabRef` 的开发期警告用的是 `import.meta.env.DEV`,Vite 在构建本包时会把它折叠成 `false`,警告根本不会进入发布产物。改为 `process.env.NODE_ENV !== 'production'`(由**消费方**的打包器替换),与 KunModal / KunDrawer 一致。
42
+
43
+ ## 文档:属性表之外的一半 API
44
+
45
+ - **78 个公开 prop 的说明此前写成了 `//` 注释**,而只有 JSDoc 会进入属性表和 `llms.txt`。全部转成 JSDoc;`KunImage` 的 `@nuxt/image` 那一组原先共用一条组标题注释,现在每个 prop 各有一条。
46
+ - **事件和插槽第一次出现在生成的文档里。** `gen:meta` 现在一并导出 `events`(74 个)和 `slots`(65 个),组件页新增「事件」「插槽」两张表,`<route>.md` 同步。此前 `@search`、`@invalid`、`#option` 这些不打开 SFC 就无从发现。25 个语义不能从名字读出来的事件补了 JSDoc。
47
+ - 新增生成器 `pnpm gen:scales`(`gen` 链里排在 `gen:tokens` 之后),CI 的"生成物是否最新"这一关会顺带盯住 `cn()` 的比例尺名单。
48
+
49
+ ## 2.26.3
50
+
3
51
  ## 2.26.2
4
52
 
5
53
  ## 2.26.1
package/README.md CHANGED
@@ -9,7 +9,7 @@ ESM/CJS with type declarations.
9
9
  | Export | Purpose |
10
10
  | --- | --- |
11
11
  | `KunUIVariant`, `KunUIColor`, `KunUISize`, `KunUIRounded` | the design-system type vocabulary |
12
- | `cn(...inputs)` | clsx + tailwind-merge class merge ("last class wins") |
12
+ | `cn(...inputs)` | clsx + tailwind-merge class merge ("last class wins"), taught KunUI's own `rounded-kun-*` / `shadow-kun-*` / `z-kun-*` / `ease-kun-*` / `duration-kun-*` scales so they resolve against Tailwind's |
13
13
  | `kunVariantClasses(variant, color)` | the 7×7 variant × color → Tailwind class matrix |
14
14
  | `kunBgClasses` / `kunTextClasses` / `kunBorderClasses` / `kunRingClasses` / `kunSoftBgClasses` | per-color static class maps |
15
15
  | `kunRoundedClasses` | radius bucket → `rounded-kun-*` class map |
package/dist/index.cjs CHANGED
@@ -4,7 +4,35 @@ var clsx = require('clsx');
4
4
  var tailwindMerge = require('tailwind-merge');
5
5
 
6
6
  // src/cn.ts
7
- var cn = (...inputs) => tailwindMerge.twMerge(clsx.clsx(inputs));
7
+
8
+ // src/twScales.generated.ts
9
+ var KUN_TW_SCALES = {
10
+ radius: ["kun-full", "kun-lg", "kun-md", "kun-none", "kun-sm"],
11
+ shadow: ["kun-lg", "kun-md", "kun-sm"],
12
+ ease: ["kun-emphasized", "kun-in", "kun-out", "kun-standard"],
13
+ animate: ["bounce", "bounceInDown", "bounceInRight", "fadeInUp", "fadeOutDown", "shake", "swing", "tada"],
14
+ z: ["kun-alert", "kun-message", "kun-modal", "kun-popover", "kun-sticky"],
15
+ duration: ["kun-base", "kun-exit", "kun-fast", "kun-slow"]
16
+ };
17
+
18
+ // src/cn.ts
19
+ var twMerge = tailwindMerge.extendTailwindMerge({
20
+ extend: {
21
+ theme: {
22
+ radius: [...KUN_TW_SCALES.radius],
23
+ shadow: [...KUN_TW_SCALES.shadow],
24
+ ease: [...KUN_TW_SCALES.ease],
25
+ animate: [...KUN_TW_SCALES.animate]
26
+ },
27
+ // z-index and transition-duration are not Tailwind v4 theme namespaces —
28
+ // these are `@utility` blocks, so they extend the class group directly.
29
+ classGroups: {
30
+ z: [{ z: [...KUN_TW_SCALES.z] }],
31
+ duration: [{ duration: [...KUN_TW_SCALES.duration] }]
32
+ }
33
+ }
34
+ });
35
+ var cn = (...inputs) => twMerge(clsx.clsx(inputs));
8
36
 
9
37
  // src/variants.ts
10
38
  var TABLE = {
@@ -263,6 +291,7 @@ var KUN_BUNDLED_ICONS = {
263
291
  "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>' },
264
292
  "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>' },
265
293
  "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>' },
294
+ "lucide:filter": { "body": '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M22 3H2l8 9.46V19l4 2v-8.54z"/>' },
266
295
  "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>' }
267
296
  };
268
297
 
@@ -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;AA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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 variant\n// `bordered` actually renders — `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-default-foreground',\n primary: 'border border-transparent bg-primary text-primary-foreground',\n secondary: 'border border-transparent bg-secondary text-secondary-foreground',\n success: 'border border-transparent bg-success text-success-foreground',\n warning: 'border border-transparent bg-warning text-warning-foreground',\n danger: 'border border-transparent bg-danger text-danger-foreground',\n info: 'border border-transparent bg-info text-info-foreground',\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-default-foreground',\n primary: 'border border-transparent shadow-lg shadow-primary/40 bg-primary text-primary-foreground',\n secondary: 'border border-transparent shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground',\n success: 'border border-transparent shadow-lg shadow-success/40 bg-success text-success-foreground',\n warning: 'border border-transparent shadow-lg shadow-warning/40 bg-warning text-warning-foreground',\n danger: 'border border-transparent shadow-lg shadow-danger/40 bg-danger text-danger-foreground',\n info: 'border border-transparent shadow-lg shadow-info/40 bg-info text-info-foreground',\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// Each semantic color ships a paired on-color token — `--color-{c}` (the vivid\n// fill) + `--color-{c}-foreground` (the text that stays legible on it) — both\n// generated in OKLCH and WCAG-AA-verified in BOTH light and dark by\n// scripts/gen-tokens.mjs (the build fails if any pair regresses). So a solid is\n// just `bg-{c} text-{c}-foreground`: no per-color white/black guess, no `dark:`\n// pin (the tokens are mode-correct by construction). Medium hues land white,\n// the bright hues (magenta/green/cyan/amber) land a refined dark tint.\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. Pair with {@link kunSolidFgClasses} when the fill and its text\n * live on different elements. */\nexport const kunSolidBgClasses: 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/** The generated on-color that stays legible on the matching solid fill in both\n * modes (white on medium hues, a dark hue-tint on the bright ones). */\nexport const kunSolidFgClasses: Record<KunUIColor, string> = {\n default: 'text-default-foreground',\n primary: 'text-primary-foreground',\n secondary: 'text-secondary-foreground',\n success: 'text-success-foreground',\n warning: 'text-warning-foreground',\n danger: 'text-danger-foreground',\n info: 'text-info-foreground',\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-default-foreground',\n primary: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n success: 'bg-success text-success-foreground',\n warning: 'bg-warning text-warning-foreground',\n danger: 'bg-danger text-danger-foreground',\n info: 'bg-info text-info-foreground',\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"]}
1
+ {"version":3,"sources":["../src/twScales.generated.ts","../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":["extendTailwindMerge","clsx"],"mappings":";;;;;;;;AAKO,IAAM,aAAA,GAAgB;AAAA,EAC3B,QAAQ,CAAC,UAAA,EAAY,QAAA,EAAU,QAAA,EAAU,YAAY,QAAQ,CAAA;AAAA,EAC7D,MAAA,EAAQ,CAAC,QAAA,EAAU,QAAA,EAAU,QAAQ,CAAA;AAAA,EACrC,IAAA,EAAM,CAAC,gBAAA,EAAkB,QAAA,EAAU,WAAW,cAAc,CAAA;AAAA,EAC5D,OAAA,EAAS,CAAC,QAAA,EAAU,cAAA,EAAgB,iBAAiB,UAAA,EAAY,aAAA,EAAe,OAAA,EAAS,OAAA,EAAS,MAAM,CAAA;AAAA,EACxG,GAAG,CAAC,WAAA,EAAa,aAAA,EAAe,WAAA,EAAa,eAAe,YAAY,CAAA;AAAA,EACxE,QAAA,EAAU,CAAC,UAAA,EAAY,UAAA,EAAY,YAAY,UAAU;AAC3D,CAAA;;;ACSA,IAAM,UAAUA,iCAAA,CAAoB;AAAA,EAClC,MAAA,EAAQ;AAAA,IACN,KAAA,EAAO;AAAA,MACL,MAAA,EAAQ,CAAC,GAAG,aAAA,CAAc,MAAM,CAAA;AAAA,MAChC,MAAA,EAAQ,CAAC,GAAG,aAAA,CAAc,MAAM,CAAA;AAAA,MAChC,IAAA,EAAM,CAAC,GAAG,aAAA,CAAc,IAAI,CAAA;AAAA,MAC5B,OAAA,EAAS,CAAC,GAAG,aAAA,CAAc,OAAO;AAAA,KACpC;AAAA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A,EAAyL;AAAA,EAClN,eAAA,EAAiB,EAAC,MAAA,EAAO,4IAAA,EAAwJ;AAAA,EACjL,8BAAA,EAAgC,EAAC,MAAA,EAAO,wbAAA;AAC1C,CAAA;;;ACxBA,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":["// AUTO-GENERATED by scripts/gen-tw-scales.mjs from @kungal/ui-tokens — do not edit.\n//\n// The Tailwind scale names KunUI mints itself. `cn()` feeds them to\n// tailwind-merge, which otherwise cannot parse them and silently keeps two\n// conflicting classes.\nexport const KUN_TW_SCALES = {\n radius: ['kun-full', 'kun-lg', 'kun-md', 'kun-none', 'kun-sm'],\n shadow: ['kun-lg', 'kun-md', 'kun-sm'],\n ease: ['kun-emphasized', 'kun-in', 'kun-out', 'kun-standard'],\n animate: ['bounce', 'bounceInDown', 'bounceInRight', 'fadeInUp', 'fadeOutDown', 'shake', 'swing', 'tada'],\n z: ['kun-alert', 'kun-message', 'kun-modal', 'kun-popover', 'kun-sticky'],\n duration: ['kun-base', 'kun-exit', 'kun-fast', 'kun-slow'],\n} as const\n","import { clsx, type ClassValue } from 'clsx'\nimport { extendTailwindMerge } from 'tailwind-merge'\nimport { KUN_TW_SCALES } from './twScales.generated'\n\n// tailwind-merge only ships Tailwind's OWN scales, so every name KunUI mints in\n// `@theme` / `@utility` was invisible to it and got passed through untouched:\n// `cn('rounded-kun-md', 'rounded-full')` returned both classes and left CSS\n// source order to pick the winner. Measured, a consumer passing\n// `classNames.trigger: 'rounded-full'` to KunSelect still rendered a 12px\n// radius — the documented \"your class wins\" contract was false for the whole\n// `rounded-kun-*`, `shadow-kun-*`, `z-kun-*`, `ease-kun-*` and `duration-kun-*`\n// surface.\n//\n// `shadow-kun-*` failed worse than the rest. The shadow COLOUR group's\n// validator accepts any non-arbitrary word, so `shadow-kun-md` was classified\n// as a colour: it resolved against `shadow-primary/20` and the box-shadow was\n// the class that got dropped.\n//\n// The scale names are generated from tokens.css (`pnpm gen`) because a drifted\n// hand-written list fails silently — nothing errors, the classes just stop\n// merging again.\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n radius: [...KUN_TW_SCALES.radius],\n shadow: [...KUN_TW_SCALES.shadow],\n ease: [...KUN_TW_SCALES.ease],\n animate: [...KUN_TW_SCALES.animate],\n },\n // z-index and transition-duration are not Tailwind v4 theme namespaces —\n // these are `@utility` blocks, so they extend the class group directly.\n classGroups: {\n z: [{ z: [...KUN_TW_SCALES.z] }],\n duration: [{ duration: [...KUN_TW_SCALES.duration] }],\n },\n },\n})\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 variant\n// `bordered` actually renders — `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-default-foreground',\n primary: 'border border-transparent bg-primary text-primary-foreground',\n secondary: 'border border-transparent bg-secondary text-secondary-foreground',\n success: 'border border-transparent bg-success text-success-foreground',\n warning: 'border border-transparent bg-warning text-warning-foreground',\n danger: 'border border-transparent bg-danger text-danger-foreground',\n info: 'border border-transparent bg-info text-info-foreground',\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-default-foreground',\n primary: 'border border-transparent shadow-lg shadow-primary/40 bg-primary text-primary-foreground',\n secondary: 'border border-transparent shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground',\n success: 'border border-transparent shadow-lg shadow-success/40 bg-success text-success-foreground',\n warning: 'border border-transparent shadow-lg shadow-warning/40 bg-warning text-warning-foreground',\n danger: 'border border-transparent shadow-lg shadow-danger/40 bg-danger text-danger-foreground',\n info: 'border border-transparent shadow-lg shadow-info/40 bg-info text-info-foreground',\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// Each semantic color ships a paired on-color token — `--color-{c}` (the vivid\n// fill) + `--color-{c}-foreground` (the text that stays legible on it) — both\n// generated in OKLCH and WCAG-AA-verified in BOTH light and dark by\n// scripts/gen-tokens.mjs (the build fails if any pair regresses). So a solid is\n// just `bg-{c} text-{c}-foreground`: no per-color white/black guess, no `dark:`\n// pin (the tokens are mode-correct by construction). Medium hues land white,\n// the bright hues (magenta/green/cyan/amber) land a refined dark tint.\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. Pair with {@link kunSolidFgClasses} when the fill and its text\n * live on different elements. */\nexport const kunSolidBgClasses: 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/** The generated on-color that stays legible on the matching solid fill in both\n * modes (white on medium hues, a dark hue-tint on the bright ones). */\nexport const kunSolidFgClasses: Record<KunUIColor, string> = {\n default: 'text-default-foreground',\n primary: 'text-primary-foreground',\n secondary: 'text-secondary-foreground',\n success: 'text-success-foreground',\n warning: 'text-warning-foreground',\n danger: 'text-danger-foreground',\n info: 'text-info-foreground',\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-default-foreground',\n primary: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n success: 'bg-success text-success-foreground',\n warning: 'bg-warning text-warning-foreground',\n danger: 'bg-danger text-danger-foreground',\n info: 'bg-info text-info-foreground',\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 \"lucide:filter\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M22 3H2l8 9.46V19l4 2v-8.54z\\\"/>\"},\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.js CHANGED
@@ -1,7 +1,35 @@
1
1
  import { clsx } from 'clsx';
2
- import { twMerge } from 'tailwind-merge';
2
+ import { extendTailwindMerge } from 'tailwind-merge';
3
3
 
4
4
  // src/cn.ts
5
+
6
+ // src/twScales.generated.ts
7
+ var KUN_TW_SCALES = {
8
+ radius: ["kun-full", "kun-lg", "kun-md", "kun-none", "kun-sm"],
9
+ shadow: ["kun-lg", "kun-md", "kun-sm"],
10
+ ease: ["kun-emphasized", "kun-in", "kun-out", "kun-standard"],
11
+ animate: ["bounce", "bounceInDown", "bounceInRight", "fadeInUp", "fadeOutDown", "shake", "swing", "tada"],
12
+ z: ["kun-alert", "kun-message", "kun-modal", "kun-popover", "kun-sticky"],
13
+ duration: ["kun-base", "kun-exit", "kun-fast", "kun-slow"]
14
+ };
15
+
16
+ // src/cn.ts
17
+ var twMerge = extendTailwindMerge({
18
+ extend: {
19
+ theme: {
20
+ radius: [...KUN_TW_SCALES.radius],
21
+ shadow: [...KUN_TW_SCALES.shadow],
22
+ ease: [...KUN_TW_SCALES.ease],
23
+ animate: [...KUN_TW_SCALES.animate]
24
+ },
25
+ // z-index and transition-duration are not Tailwind v4 theme namespaces —
26
+ // these are `@utility` blocks, so they extend the class group directly.
27
+ classGroups: {
28
+ z: [{ z: [...KUN_TW_SCALES.z] }],
29
+ duration: [{ duration: [...KUN_TW_SCALES.duration] }]
30
+ }
31
+ }
32
+ });
5
33
  var cn = (...inputs) => twMerge(clsx(inputs));
6
34
 
7
35
  // src/variants.ts
@@ -261,6 +289,7 @@ var KUN_BUNDLED_ICONS = {
261
289
  "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>' },
262
290
  "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>' },
263
291
  "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>' },
292
+ "lucide:filter": { "body": '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M22 3H2l8 9.46V19l4 2v-8.54z"/>' },
264
293
  "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>' }
265
294
  };
266
295
 
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,8DAAA;AAAA,IACT,OAAA,EAAS,8DAAA;AAAA,IACT,SAAA,EAAW,kEAAA;AAAA,IACX,OAAA,EAAS,8DAAA;AAAA,IACT,OAAA,EAAS,8DAAA;AAAA,IACT,MAAA,EAAQ,4DAAA;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;AAA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AA,EACpT,sBAAA,EAAwB,EAAC,MAAA,EAAO,4LAAA,EAAwM;AAAA,EACxO,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 variant\n// `bordered` actually renders — `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-default-foreground',\n primary: 'border border-transparent bg-primary text-primary-foreground',\n secondary: 'border border-transparent bg-secondary text-secondary-foreground',\n success: 'border border-transparent bg-success text-success-foreground',\n warning: 'border border-transparent bg-warning text-warning-foreground',\n danger: 'border border-transparent bg-danger text-danger-foreground',\n info: 'border border-transparent bg-info text-info-foreground',\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-default-foreground',\n primary: 'border border-transparent shadow-lg shadow-primary/40 bg-primary text-primary-foreground',\n secondary: 'border border-transparent shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground',\n success: 'border border-transparent shadow-lg shadow-success/40 bg-success text-success-foreground',\n warning: 'border border-transparent shadow-lg shadow-warning/40 bg-warning text-warning-foreground',\n danger: 'border border-transparent shadow-lg shadow-danger/40 bg-danger text-danger-foreground',\n info: 'border border-transparent shadow-lg shadow-info/40 bg-info text-info-foreground',\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// Each semantic color ships a paired on-color token — `--color-{c}` (the vivid\n// fill) + `--color-{c}-foreground` (the text that stays legible on it) — both\n// generated in OKLCH and WCAG-AA-verified in BOTH light and dark by\n// scripts/gen-tokens.mjs (the build fails if any pair regresses). So a solid is\n// just `bg-{c} text-{c}-foreground`: no per-color white/black guess, no `dark:`\n// pin (the tokens are mode-correct by construction). Medium hues land white,\n// the bright hues (magenta/green/cyan/amber) land a refined dark tint.\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. Pair with {@link kunSolidFgClasses} when the fill and its text\n * live on different elements. */\nexport const kunSolidBgClasses: 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/** The generated on-color that stays legible on the matching solid fill in both\n * modes (white on medium hues, a dark hue-tint on the bright ones). */\nexport const kunSolidFgClasses: Record<KunUIColor, string> = {\n default: 'text-default-foreground',\n primary: 'text-primary-foreground',\n secondary: 'text-secondary-foreground',\n success: 'text-success-foreground',\n warning: 'text-warning-foreground',\n danger: 'text-danger-foreground',\n info: 'text-info-foreground',\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-default-foreground',\n primary: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n success: 'bg-success text-success-foreground',\n warning: 'bg-warning text-warning-foreground',\n danger: 'bg-danger text-danger-foreground',\n info: 'bg-info text-info-foreground',\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"]}
1
+ {"version":3,"sources":["../src/twScales.generated.ts","../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":";;;;;;AAKO,IAAM,aAAA,GAAgB;AAAA,EAC3B,QAAQ,CAAC,UAAA,EAAY,Q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I,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":["// AUTO-GENERATED by scripts/gen-tw-scales.mjs from @kungal/ui-tokens — do not edit.\n//\n// The Tailwind scale names KunUI mints itself. `cn()` feeds them to\n// tailwind-merge, which otherwise cannot parse them and silently keeps two\n// conflicting classes.\nexport const KUN_TW_SCALES = {\n radius: ['kun-full', 'kun-lg', 'kun-md', 'kun-none', 'kun-sm'],\n shadow: ['kun-lg', 'kun-md', 'kun-sm'],\n ease: ['kun-emphasized', 'kun-in', 'kun-out', 'kun-standard'],\n animate: ['bounce', 'bounceInDown', 'bounceInRight', 'fadeInUp', 'fadeOutDown', 'shake', 'swing', 'tada'],\n z: ['kun-alert', 'kun-message', 'kun-modal', 'kun-popover', 'kun-sticky'],\n duration: ['kun-base', 'kun-exit', 'kun-fast', 'kun-slow'],\n} as const\n","import { clsx, type ClassValue } from 'clsx'\nimport { extendTailwindMerge } from 'tailwind-merge'\nimport { KUN_TW_SCALES } from './twScales.generated'\n\n// tailwind-merge only ships Tailwind's OWN scales, so every name KunUI mints in\n// `@theme` / `@utility` was invisible to it and got passed through untouched:\n// `cn('rounded-kun-md', 'rounded-full')` returned both classes and left CSS\n// source order to pick the winner. Measured, a consumer passing\n// `classNames.trigger: 'rounded-full'` to KunSelect still rendered a 12px\n// radius — the documented \"your class wins\" contract was false for the whole\n// `rounded-kun-*`, `shadow-kun-*`, `z-kun-*`, `ease-kun-*` and `duration-kun-*`\n// surface.\n//\n// `shadow-kun-*` failed worse than the rest. The shadow COLOUR group's\n// validator accepts any non-arbitrary word, so `shadow-kun-md` was classified\n// as a colour: it resolved against `shadow-primary/20` and the box-shadow was\n// the class that got dropped.\n//\n// The scale names are generated from tokens.css (`pnpm gen`) because a drifted\n// hand-written list fails silently — nothing errors, the classes just stop\n// merging again.\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n radius: [...KUN_TW_SCALES.radius],\n shadow: [...KUN_TW_SCALES.shadow],\n ease: [...KUN_TW_SCALES.ease],\n animate: [...KUN_TW_SCALES.animate],\n },\n // z-index and transition-duration are not Tailwind v4 theme namespaces —\n // these are `@utility` blocks, so they extend the class group directly.\n classGroups: {\n z: [{ z: [...KUN_TW_SCALES.z] }],\n duration: [{ duration: [...KUN_TW_SCALES.duration] }],\n },\n },\n})\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 variant\n// `bordered` actually renders — `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-default-foreground',\n primary: 'border border-transparent bg-primary text-primary-foreground',\n secondary: 'border border-transparent bg-secondary text-secondary-foreground',\n success: 'border border-transparent bg-success text-success-foreground',\n warning: 'border border-transparent bg-warning text-warning-foreground',\n danger: 'border border-transparent bg-danger text-danger-foreground',\n info: 'border border-transparent bg-info text-info-foreground',\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-default-foreground',\n primary: 'border border-transparent shadow-lg shadow-primary/40 bg-primary text-primary-foreground',\n secondary: 'border border-transparent shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground',\n success: 'border border-transparent shadow-lg shadow-success/40 bg-success text-success-foreground',\n warning: 'border border-transparent shadow-lg shadow-warning/40 bg-warning text-warning-foreground',\n danger: 'border border-transparent shadow-lg shadow-danger/40 bg-danger text-danger-foreground',\n info: 'border border-transparent shadow-lg shadow-info/40 bg-info text-info-foreground',\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// Each semantic color ships a paired on-color token — `--color-{c}` (the vivid\n// fill) + `--color-{c}-foreground` (the text that stays legible on it) — both\n// generated in OKLCH and WCAG-AA-verified in BOTH light and dark by\n// scripts/gen-tokens.mjs (the build fails if any pair regresses). So a solid is\n// just `bg-{c} text-{c}-foreground`: no per-color white/black guess, no `dark:`\n// pin (the tokens are mode-correct by construction). Medium hues land white,\n// the bright hues (magenta/green/cyan/amber) land a refined dark tint.\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. Pair with {@link kunSolidFgClasses} when the fill and its text\n * live on different elements. */\nexport const kunSolidBgClasses: 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/** The generated on-color that stays legible on the matching solid fill in both\n * modes (white on medium hues, a dark hue-tint on the bright ones). */\nexport const kunSolidFgClasses: Record<KunUIColor, string> = {\n default: 'text-default-foreground',\n primary: 'text-primary-foreground',\n secondary: 'text-secondary-foreground',\n success: 'text-success-foreground',\n warning: 'text-warning-foreground',\n danger: 'text-danger-foreground',\n info: 'text-info-foreground',\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-default-foreground',\n primary: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n success: 'bg-success text-success-foreground',\n warning: 'bg-warning text-warning-foreground',\n danger: 'bg-danger text-danger-foreground',\n info: 'bg-info text-info-foreground',\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 \"lucide:filter\": {\"body\":\"<path fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\" stroke-width=\\\"2\\\" d=\\\"M22 3H2l8 9.46V19l4 2v-8.54z\\\"/>\"},\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": "2.26.2",
3
+ "version": "2.27.0",
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": [
@@ -53,6 +53,7 @@
53
53
  "dev": "tsup --watch",
54
54
  "typecheck": "tsc --noEmit",
55
55
  "gen:icons": "node scripts/gen-icons.mjs",
56
+ "gen:scales": "node scripts/gen-tw-scales.mjs",
56
57
  "clean": "rm -rf dist"
57
58
  }
58
59
  }