@kanzo-tech/ui 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/analytics.d.ts +1 -0
  2. package/dist/analytics.d.ts.map +1 -1
  3. package/dist/charts/chart-inputs.d.ts +6 -5
  4. package/dist/charts/chart-inputs.d.ts.map +1 -1
  5. package/dist/charts/chart-inputs.js +78 -77
  6. package/dist/charts/chart-inputs.js.map +1 -1
  7. package/dist/charts/chart-marks.d.ts +2 -1
  8. package/dist/charts/chart-marks.d.ts.map +1 -1
  9. package/dist/charts/chart-marks.js.map +1 -1
  10. package/dist/charts/chart-root.d.ts +8 -3
  11. package/dist/charts/chart-root.d.ts.map +1 -1
  12. package/dist/charts/chart-root.js +60 -60
  13. package/dist/charts/chart-root.js.map +1 -1
  14. package/dist/charts/chart-spec.d.ts +11 -4
  15. package/dist/charts/chart-spec.d.ts.map +1 -1
  16. package/dist/charts/chart-spec.js +44 -40
  17. package/dist/charts/chart-spec.js.map +1 -1
  18. package/dist/charts/chart-stat.d.ts +3 -2
  19. package/dist/charts/chart-stat.d.ts.map +1 -1
  20. package/dist/charts/chart-stat.js +10 -9
  21. package/dist/charts/chart-stat.js.map +1 -1
  22. package/dist/composites/language-picker.d.ts +7 -0
  23. package/dist/composites/language-picker.d.ts.map +1 -1
  24. package/dist/composites/language-picker.js +38 -36
  25. package/dist/composites/language-picker.js.map +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +661 -660
  29. package/dist/lib/control-size.d.ts +26 -0
  30. package/dist/lib/control-size.d.ts.map +1 -0
  31. package/dist/lib/control-size.js +11 -0
  32. package/dist/lib/control-size.js.map +1 -0
  33. package/dist/simples/button.d.ts.map +1 -1
  34. package/dist/simples/button.js +34 -33
  35. package/dist/simples/button.js.map +1 -1
  36. package/dist/simples/checkbox.d.ts.map +1 -1
  37. package/dist/simples/checkbox.js +42 -42
  38. package/dist/simples/checkbox.js.map +1 -1
  39. package/dist/simples/combobox.d.ts.map +1 -1
  40. package/dist/simples/combobox.js +48 -49
  41. package/dist/simples/combobox.js.map +1 -1
  42. package/dist/simples/date-picker.d.ts +58 -2
  43. package/dist/simples/date-picker.d.ts.map +1 -1
  44. package/dist/simples/date-picker.js +207 -76
  45. package/dist/simples/date-picker.js.map +1 -1
  46. package/dist/simples/input-group.d.ts +9 -9
  47. package/dist/simples/input-group.d.ts.map +1 -1
  48. package/dist/simples/input-group.js +68 -78
  49. package/dist/simples/input-group.js.map +1 -1
  50. package/dist/simples/input.d.ts +9 -9
  51. package/dist/simples/input.d.ts.map +1 -1
  52. package/dist/simples/input.js +13 -14
  53. package/dist/simples/input.js.map +1 -1
  54. package/dist/simples/native-select.d.ts +9 -9
  55. package/dist/simples/native-select.d.ts.map +1 -1
  56. package/dist/simples/native-select.js +29 -28
  57. package/dist/simples/native-select.js.map +1 -1
  58. package/dist/simples/number-input.d.ts +9 -9
  59. package/dist/simples/number-input.d.ts.map +1 -1
  60. package/dist/simples/number-input.js +27 -27
  61. package/dist/simples/number-input.js.map +1 -1
  62. package/dist/simples/password-input.d.ts.map +1 -1
  63. package/dist/simples/password-input.js +24 -20
  64. package/dist/simples/password-input.js.map +1 -1
  65. package/dist/simples/pin-input.d.ts +9 -9
  66. package/dist/simples/pin-input.d.ts.map +1 -1
  67. package/dist/simples/pin-input.js +30 -29
  68. package/dist/simples/pin-input.js.map +1 -1
  69. package/dist/simples/radio-group.d.ts.map +1 -1
  70. package/dist/simples/radio-group.js +44 -43
  71. package/dist/simples/radio-group.js.map +1 -1
  72. package/dist/simples/segment-group.d.ts +8 -0
  73. package/dist/simples/segment-group.d.ts.map +1 -1
  74. package/dist/simples/segment-group.js +55 -47
  75. package/dist/simples/segment-group.js.map +1 -1
  76. package/dist/simples/switch.d.ts.map +1 -1
  77. package/dist/simples/switch.js +18 -12
  78. package/dist/simples/switch.js.map +1 -1
  79. package/dist/simples/tags-input.d.ts.map +1 -1
  80. package/dist/simples/tags-input.js +44 -39
  81. package/dist/simples/tags-input.js.map +1 -1
  82. package/dist/simples/toggle.d.ts +9 -9
  83. package/dist/simples/toggle.d.ts.map +1 -1
  84. package/dist/simples/toggle.js +24 -23
  85. package/dist/simples/toggle.js.map +1 -1
  86. package/package.json +5 -5
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The height of a single-line control, written once.
3
+ *
4
+ * A control's size is one custom property, `--size`, and its height is one utility that reads it.
5
+ * `controlSizes` assigns the property per size token — a multiple of `--size-field`, the knob a
6
+ * tenant turns to ask for tighter controls without asking for tighter text — and `controlHeight`
7
+ * reads it. Every recipe for a control that sits in a form row spreads the first into its `size`
8
+ * variant and puts the second on its `base`, so a text input, a select, a combobox, a date picker
9
+ * and a segment group are the same height at the same token, at every density, by construction.
10
+ *
11
+ * **On the base, not on the size, and not on a `data-slot`**: the reason is on `/docs/design/naming`.
12
+ *
13
+ * A control that grows (a tags input with a second row, a textarea) takes `controlMinHeight`
14
+ * instead; one that lives inside another control's border (an input inside a group) is the group's
15
+ * height less its border, and is written that way in `input-group.tsx`.
16
+ *
17
+ * `control-size.test.ts` fails when a recipe listed there stops using these.
18
+ */
19
+ export declare const controlSizes: {
20
+ readonly sm: "[--size:calc(var(--size-field)*7)]";
21
+ readonly md: "[--size:calc(var(--size-field)*8)]";
22
+ readonly lg: "[--size:calc(var(--size-field)*9)]";
23
+ };
24
+ export declare const controlHeight = "h-(--size)";
25
+ export declare const controlMinHeight = "min-h-(--size)";
26
+ //# sourceMappingURL=control-size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-size.d.ts","sourceRoot":"","sources":["../../src/lib/control-size.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,aAAa,eAAe,CAAC;AAC1C,eAAO,MAAM,gBAAgB,mBAAmB,CAAC"}
@@ -0,0 +1,11 @@
1
+ const i = {
2
+ sm: "[--size:calc(var(--size-field)*7)]",
3
+ md: "[--size:calc(var(--size-field)*8)]",
4
+ lg: "[--size:calc(var(--size-field)*9)]"
5
+ }, e = "h-(--size)", s = "min-h-(--size)";
6
+ export {
7
+ e as controlHeight,
8
+ s as controlMinHeight,
9
+ i as controlSizes
10
+ };
11
+ //# sourceMappingURL=control-size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-size.js","sources":["../../src/lib/control-size.ts"],"sourcesContent":["/**\n * The height of a single-line control, written once.\n *\n * A control's size is one custom property, `--size`, and its height is one utility that reads it.\n * `controlSizes` assigns the property per size token — a multiple of `--size-field`, the knob a\n * tenant turns to ask for tighter controls without asking for tighter text — and `controlHeight`\n * reads it. Every recipe for a control that sits in a form row spreads the first into its `size`\n * variant and puts the second on its `base`, so a text input, a select, a combobox, a date picker\n * and a segment group are the same height at the same token, at every density, by construction.\n *\n * **On the base, not on the size, and not on a `data-slot`**: the reason is on `/docs/design/naming`.\n *\n * A control that grows (a tags input with a second row, a textarea) takes `controlMinHeight`\n * instead; one that lives inside another control's border (an input inside a group) is the group's\n * height less its border, and is written that way in `input-group.tsx`.\n *\n * `control-size.test.ts` fails when a recipe listed there stops using these.\n */\nexport const controlSizes = {\n sm: \"[--size:calc(var(--size-field)*7)]\",\n md: \"[--size:calc(var(--size-field)*8)]\",\n lg: \"[--size:calc(var(--size-field)*9)]\",\n} as const;\n\nexport const controlHeight = \"h-(--size)\";\nexport const controlMinHeight = \"min-h-(--size)\";\n"],"names":["controlSizes","controlHeight","controlMinHeight"],"mappings":"AAkBO,MAAMA,IAAe;AAAA,EAC1B,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAAgB,cAChBC,IAAmB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/simples/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,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ACrC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,sBA6CxC,CAAC"}
@@ -1,14 +1,15 @@
1
- import { jsx as e, jsxs as b, Fragment as v } from "react/jsx-runtime";
2
- import { ark as p } from "@ark-ui/react/factory";
1
+ import { jsx as r, jsxs as v, Fragment as p } from "react/jsx-runtime";
2
+ import { ark as g } from "@ark-ui/react/factory";
3
3
  import { tv as f } from "tailwind-variants";
4
- import { cn as g } from "../lib/cn.js";
5
- import { Spinner as u } from "./spinner.js";
6
- const m = f({
4
+ import { cn as u } from "../lib/cn.js";
5
+ import { controlSizes as e, controlHeight as m } from "../lib/control-size.js";
6
+ import { Spinner as x } from "./spinner.js";
7
+ const z = f({
7
8
  base: [
8
9
  "relative",
9
10
  // Nothing below may be keyed on `data-slot`. See the docblock: `--size` was moved here first,
10
11
  // in `05f3a0a`, and the paint followed it once the same rename was measured against the colour.
11
- "h-(--size)",
12
+ m,
12
13
  // The only one of the three locals a variant may leave unset — `outline` is the sole variant
13
14
  // that assigns `--btn-bd`, while all six assign the fill and the ink. A default for those two
14
15
  // would be a line that is overwritten every single render.
@@ -122,15 +123,15 @@ const m = f({
122
123
  * density, and nothing was published to break.
123
124
  */
124
125
  size: {
125
- sm: ["[--size:calc(var(--size-field)*7)]", "px-2.5", "gap-1.5", "[&_svg:not([class*='size-'])]:size-3.5"],
126
- md: ["[--size:calc(var(--size-field)*8)]", "px-3", "py-2"],
127
- lg: ["[--size:calc(var(--size-field)*9)]", "px-3.5"],
126
+ sm: [e.sm, "px-2.5", "gap-1.5", "[&_svg:not([class*='size-'])]:size-3.5"],
127
+ md: [e.md, "px-3", "py-2"],
128
+ lg: [e.lg, "px-3.5"],
128
129
  xl: ["[--size:calc(var(--size-field)*10)]", "text-base", "px-4"],
129
130
  // Square, and the width is stated rather than left to `aspect-ratio`: a caller who writes
130
131
  // `w-fit` on top of an aspect ratio gets the icon's own width and a control twice as tall.
131
- "icon-sm": ["[--size:calc(var(--size-field)*7)]", "w-(--size)", "px-0"],
132
- "icon-md": ["[--size:calc(var(--size-field)*8)]", "w-(--size)", "px-0"],
133
- "icon-lg": ["[--size:calc(var(--size-field)*9)]", "w-(--size)", "px-0"],
132
+ "icon-sm": [e.sm, "w-(--size)", "px-0"],
133
+ "icon-md": [e.md, "w-(--size)", "px-0"],
134
+ "icon-lg": [e.lg, "w-(--size)", "px-0"],
134
135
  "icon-xl": [
135
136
  "[--size:calc(var(--size-field)*10)]",
136
137
  "w-(--size)",
@@ -157,43 +158,43 @@ const m = f({
157
158
  clickEffect: !0,
158
159
  pill: !1
159
160
  }
160
- }), k = (s) => {
161
+ }), j = (s) => {
161
162
  const {
162
- variant: r = "default",
163
- size: t = "md",
164
- clickEffect: n = !0,
165
- pill: o = !1,
163
+ variant: i = "default",
164
+ size: n = "md",
165
+ clickEffect: o = !0,
166
+ pill: d = !1,
166
167
  isLoading: a = !1,
167
168
  className: l,
168
- children: i,
169
- slot: d,
169
+ children: t,
170
+ slot: b,
170
171
  ...c
171
172
  } = s;
172
- return /* @__PURE__ */ e(
173
- p.button,
173
+ return /* @__PURE__ */ r(
174
+ g.button,
174
175
  {
175
- className: g(
176
- m({ variant: r, size: t, clickEffect: n, pill: o }),
176
+ className: u(
177
+ z({ variant: i, size: n, clickEffect: o, pill: d }),
177
178
  l
178
179
  ),
179
- "data-size": t,
180
+ "data-size": n,
180
181
  "data-state": a ? "loading" : "idle",
181
- "data-variant": r,
182
+ "data-variant": i,
182
183
  type: "button",
183
184
  ...c,
184
- "data-slot": d ?? "button",
185
+ "data-slot": b ?? "button",
185
186
  "aria-busy": a,
186
187
  "aria-disabled": a,
187
- children: a ? /* @__PURE__ */ b(v, { children: [
188
- /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "invisible", children: i }),
189
- /* @__PURE__ */ e("span", { className: "sr-only", children: i }),
190
- /* @__PURE__ */ e("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e(u, { "aria-hidden": !0 }) })
191
- ] }) : i
188
+ children: a ? /* @__PURE__ */ v(p, { children: [
189
+ /* @__PURE__ */ r("span", { "aria-hidden": !0, className: "invisible", children: t }),
190
+ /* @__PURE__ */ r("span", { className: "sr-only", children: t }),
191
+ /* @__PURE__ */ r("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ r(x, { "aria-hidden": !0 }) })
192
+ ] }) : t
192
193
  }
193
194
  );
194
195
  };
195
196
  export {
196
- k as Button,
197
- m as buttonVariants
197
+ j as Button,
198
+ z as buttonVariants
198
199
  };
199
200
  //# sourceMappingURL=button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sources":["../../src/simples/button.tsx"],"sourcesContent":["import { ark } from \"@ark-ui/react/factory\";\nimport type React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\nimport { cn } from \"../lib/cn\";\nimport { Spinner } from \"./spinner\";\n\n/**\n * The whole control: the fill, the ink, the edge, the lift, both washes and the height, all on the\n * `base` and all written once in terms of three locals a variant assigns.\n *\n * **The shape is daisyUI's.** Their `.btn-primary` is two custom-property assignments over a `.btn`\n * that derives every state; ours was six variants of five to six utilities each, naming eight\n * different tokens between them, with the hover of each written separately. A hover rule that lives\n * in six places is a hover rule that drifts in six places.\n *\n * **The placement is daisyUI's too, and that half arrived late.** The derivations sat in\n * the stylesheet under `[data-slot=\"button\"]`, which is the one attribute this library invites a\n * caller to RENAME — every part takes `slot?: string`. So every component of ours that renames a\n * `Button` got the variant's three assignments and no rule that read them: `AlertDialogAction` and\n * `AlertDialogCancel` reported their `data-variant` correctly and `background-color:\n * rgba(0, 0, 0, 0)` in a live document, and twenty-nine more call sites sat on the same fault.\n * `05f3a0a` had already moved the *height* here for exactly this reason and left the colour behind,\n * on the argument that losing a colour on a rename is a caller asking for a different look — which\n * is true of a caller and was never true of us. `no-paint-on-a-renameable-slot.test.ts` holds it.\n *\n * What a variant may set: `--btn-bg`, `--btn-fg`, `--btn-bd`. Nothing else here paints.\n */\nexport const buttonVariants = tv({\n base: [\n \"relative\",\n // Nothing below may be keyed on `data-slot`. See the docblock: `--size` was moved here first,\n // in `05f3a0a`, and the paint followed it once the same rename was measured against the colour.\n \"h-(--size)\",\n // The only one of the three locals a variant may leave unset — `outline` is the sole variant\n // that assigns `--btn-bd`, while all six assign the fill and the ink. A default for those two\n // would be a line that is overwritten every single render.\n \"[--btn-bd:transparent]\",\n // Derived, never assigned by a variant. `--depth: 0` collapses the edge and the lift to\n // nothing, which is what the library looks like today; `1` gives it relief. Same classes.\n //\n // daisyUI darkens a fill with `color-mix(in oklab, var(--btn-bg), #000 5%)`. Mixing toward\n // `--foreground` instead is a divergence taken on a reason: `black` is only \"darker\" in a light\n // theme, and on a dark one the hover of a pale button should move toward white. One formula\n // reads as \"push this fill away from the page and toward the ink\" in both, and it follows a\n // tenant's document instead of a constant — which is also why `--depth` can be a single number.\n // Their half-pixel inset gloss needs a colour that is toward the light side in both modes and\n // neither `--foreground` nor `--background` is that, so it waits for a reason to exist.\n \"[--btn-edge:color-mix(in_oklab,var(--btn-bd),var(--foreground)_calc(var(--depth)*8%))]\",\n \"[--btn-lift:color-mix(in_oklab,var(--btn-bg)_calc(var(--depth)*30%),transparent)]\",\n \"bg-(--btn-bg) text-(--btn-fg)\",\n // The grain, and the whole of the conditional that switches it off: at `--noise: 0` the layer\n // is sized to zero and never painted, at `1` it tiles. No variant — which is the property that\n // lets it be a value a tenant sets rather than a look somebody has to write. It defaults to `0`\n // here rather than in every theme, because a theme that wants no texture is saying nothing.\n \"bg-(image:--fx-noise) bg-size-[calc(var(--noise,0)*100%)]\",\n // `rounded-[var(--radius-field)]` and not `rounded-field`, which is the same radius and the\n // spelling every other recipe here uses: `tailwind-merge` knows nothing about a theme key it\n // was never configured with, so `rounded-field` and a caller's `rounded-full` both survive the\n // merge and the winner is whichever Tailwind happened to emit last. The `pill` variant is that\n // caller. An arbitrary value is in a group the merge does know.\n \"border-[length:var(--stroke)] border-(--btn-edge) rounded-[var(--radius-field)]\",\n // As `shadow-*` rather than a raw `box-shadow`, so it composes with `focus-visible:ring-[3px]`\n // through Tailwind's shadow chain instead of being replaced by it. At `--depth: 0` the lift is\n // transparent and nothing is drawn either way, which is why that was invisible before.\n \"shadow-[0_3px_2px_-2px_var(--btn-lift),0_4px_3px_-2px_var(--btn-lift)]\",\n // One hover and one active for every variant, solid and transparent alike — and the transparent\n // case is the tell that the formula is right. Mixing `transparent` with the foreground at 10%\n // IS the foreground at 10% alpha, which is exactly the wash a ghost button wants.\n //\n // The CSS rule guarded these with `:not(:disabled, [aria-disabled=\"true\"], [data-disabled])`.\n // All three spellings already carry `pointer-events-none` on this same base and an element with\n // `pointer-events: none` can match neither `:hover` nor `:active`, so the guard was\n // belt-and-braces. Dropping it is not tidiness: with the plain modifier, `tailwind-merge` can\n // see a variant's own `hover:bg-*` as the same utility and let it win — which is how `link`\n // opts out in one class, instead of losing to a longer selector on specificity.\n \"hover:bg-[color-mix(in_oklab,var(--btn-bg),var(--foreground)_10%)]\",\n \"active:bg-[color-mix(in_oklab,var(--btn-bg),var(--foreground)_16%)]\",\n \"inline-flex shrink-0 items-center justify-center gap-2\",\n \"whitespace-nowrap font-medium text-sm\",\n \"border-solid\",\n \"transition-all\",\n \"outline-none focus-visible:ring-[3px] focus-visible:ring-ring\",\n \"disabled:pointer-events-none disabled:opacity-64\",\n \"data-disabled:pointer-events-none data-disabled:opacity-64\",\n \"aria-disabled:pointer-events-none aria-disabled:opacity-64\",\n \"data-[state=loading]:pointer-events-none\",\n \"aria-invalid:border-destructive aria-invalid:ring-destructive/24\",\n \"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n \"motion-reduce:transition-none!\",\n ],\n variants: {\n variant: {\n default: [\n \"[--btn-bg:var(--primary)]\",\n \"[--btn-fg:var(--primary-foreground)]\",\n \"focus-visible:border-background\",\n ],\n outline: [\n \"[--btn-bg:transparent]\",\n \"[--btn-fg:var(--foreground)]\",\n \"[--btn-bd:var(--input)]\",\n \"focus-visible:border-primary\",\n ],\n destructive: [\n \"[--btn-bg:var(--destructive)]\",\n // Was `text-white` at 3.81 on red-500. The fill moved to `-600` and the ink became a token,\n // because no choice of ink rescued red-500: white 3.81, near-black 4.15, AA needs 4.5.\n \"[--btn-fg:var(--destructive-content)]\",\n \"focus-visible:border-background focus-visible:ring-destructive-foreground/32\",\n ],\n secondary: [\n \"[--btn-bg:var(--secondary)]\",\n \"[--btn-fg:var(--secondary-foreground)]\",\n \"focus-visible:border-primary\",\n ],\n ghost: [\n \"[--btn-bg:transparent]\",\n \"[--btn-fg:var(--foreground)]\",\n \"focus-visible:border-primary\",\n ],\n // The one variant that opts OUT of the shared hover, because a link's hover is an underline\n // and not a wash. Same modifier and same utility group as the base's wash, so\n // `tailwind-variants` merges the two and the variant wins — which is what makes opting out\n // one class rather than an exception somewhere else.\n link: [\n \"[--btn-bg:transparent]\",\n \"[--btn-fg:var(--primary)]\",\n \"underline-offset-4\",\n \"hover:bg-transparent hover:underline active:bg-transparent\",\n \"focus-visible:border-primary\",\n ],\n },\n /**\n * Padding, gaps and icon sizes. A size variant only **moves `--size`** — the height that reads\n * it is on the `base` — so a tenant can ask for compact controls, through `--size-field`,\n * without asking for tighter text.\n *\n * The floor is still measured rather than chosen. `xs` and `icon-xs` were both `1.5rem`, and\n * every size is a `rem` against a root the density axis sets — 16px default, 14px compact, 18px\n * comfortable — so they measured **21px in compact**, under the 24×24 WCAG 2.5.8 states in CSS\n * pixels. `sm` is the smallest size that clears the bar in all three densities. No call site was\n * failing: the spacing exception saves a clustered control, and every measured `xs` was in a\n * cluster. The variant went because its NAME promised a size it could not deliver at one\n * density, and nothing was published to break.\n */\n size: {\n sm: [\"[--size:calc(var(--size-field)*7)]\", \"px-2.5\", \"gap-1.5\", \"[&_svg:not([class*='size-'])]:size-3.5\"],\n md: [\"[--size:calc(var(--size-field)*8)]\", \"px-3\", \"py-2\"],\n lg: [\"[--size:calc(var(--size-field)*9)]\", \"px-3.5\"],\n xl: [\"[--size:calc(var(--size-field)*10)]\", \"text-base\", \"px-4\"],\n // Square, and the width is stated rather than left to `aspect-ratio`: a caller who writes\n // `w-fit` on top of an aspect ratio gets the icon's own width and a control twice as tall.\n \"icon-sm\": [\"[--size:calc(var(--size-field)*7)]\", \"w-(--size)\", \"px-0\"],\n \"icon-md\": [\"[--size:calc(var(--size-field)*8)]\", \"w-(--size)\", \"px-0\"],\n \"icon-lg\": [\"[--size:calc(var(--size-field)*9)]\", \"w-(--size)\", \"px-0\"],\n \"icon-xl\": [\n \"[--size:calc(var(--size-field)*10)]\",\n \"w-(--size)\",\n \"px-0\",\n \"[&_svg:not([class*='size-'])]:size-5\",\n ],\n },\n clickEffect: {\n true: \"active:not-aria-[haspopup]:scale-[0.98]\",\n },\n pill: {\n true: [\n \"rounded-full\",\n \"has-[>svg]:data-[size=sm]:pe-3.5\",\n \"has-[>svg]:data-[size=md]:pe-4\",\n \"has-[>svg]:data-[size=lg]:pe-4.5\",\n \"has-[>svg]:data-[size=xl]:pe-5\",\n ],\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n clickEffect: true,\n pill: false,\n },\n});\n\nexport interface ButtonProps\n extends React.ComponentProps<typeof ark.button>,\n VariantProps<typeof buttonVariants> {\n /**\n * Apply a click effect to the button\n *\n * @default true\n */\n clickEffect?: boolean;\n /**\n * Show a loading indicator\n *\n * @default false\n */\n isLoading?: boolean;\n}\n\nexport const Button = (props: ButtonProps) => {\n const {\n variant = \"default\",\n size = \"md\",\n clickEffect = true,\n pill = false,\n isLoading = false,\n className,\n children,\n slot,\n ...rest\n } = props;\n\n return (\n <ark.button\n className={cn(\n buttonVariants({ variant, size, clickEffect, pill }),\n className\n )}\n data-size={size}\n data-state={isLoading ? \"loading\" : \"idle\"}\n data-variant={variant}\n type=\"button\"\n {...rest}\n data-slot={slot ?? \"button\"}\n aria-busy={isLoading}\n aria-disabled={isLoading}\n >\n {isLoading ? (\n <>\n <span aria-hidden className=\"invisible\">\n {children}\n </span>\n\n <span className=\"sr-only\">{children}</span>\n\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <Spinner aria-hidden />\n </span>\n </>\n ) : (\n children\n )}\n </ark.button>\n );\n};\n"],"names":["buttonVariants","tv","Button","props","variant","size","clickEffect","pill","isLoading","className","children","slot","rest","jsx","ark","cn","jsxs","Fragment","Spinner"],"mappings":";;;;;AA2BO,MAAMA,IAAiBC,EAAG;AAAA,EAC/B,MAAM;AAAA,IACJ;AAAA;AAAA;AAAA,IAGA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,SAAS;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,aAAa;AAAA,QACX;AAAA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MAA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WAAWC;AAAA,QACTf,EAAe,EAAE,SAAAI,GAAS,MAAAC,GAAM,aAAAC,GAAa,MAAAC,GAAM;AAAA,QACnDE;AAAA,MAAA;AAAA,MAEF,aAAWJ;AAAA,MACX,cAAYG,IAAY,YAAY;AAAA,MACpC,gBAAcJ;AAAA,MACd,MAAK;AAAA,MACJ,GAAGQ;AAAA,MACJ,aAAWD,KAAQ;AAAA,MACnB,aAAWH;AAAA,MACX,iBAAeA;AAAA,MAEd,cACC,gBAAAQ,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAJ,EAAC,QAAA,EAAK,eAAW,IAAC,WAAU,aACzB,UAAAH,GACH;AAAA,QAEA,gBAAAG,EAAC,QAAA,EAAK,WAAU,WAAW,UAAAH,EAAA,CAAS;AAAA,QAEpC,gBAAAG,EAAC,UAAK,WAAU,qDACd,4BAACK,GAAA,EAAQ,eAAW,IAAC,EAAA,CACvB;AAAA,MAAA,EAAA,CACF,IAEAR;AAAA,IAAA;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"button.js","sources":["../../src/simples/button.tsx"],"sourcesContent":["import { ark } from \"@ark-ui/react/factory\";\nimport type React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\nimport { cn } from \"../lib/cn\";\nimport { controlHeight, controlSizes } from \"../lib/control-size\";\nimport { Spinner } from \"./spinner\";\n\n/**\n * The whole control: the fill, the ink, the edge, the lift, both washes and the height, all on the\n * `base` and all written once in terms of three locals a variant assigns.\n *\n * **The shape is daisyUI's.** Their `.btn-primary` is two custom-property assignments over a `.btn`\n * that derives every state; ours was six variants of five to six utilities each, naming eight\n * different tokens between them, with the hover of each written separately. A hover rule that lives\n * in six places is a hover rule that drifts in six places.\n *\n * **The placement is daisyUI's too, and that half arrived late.** The derivations sat in\n * the stylesheet under `[data-slot=\"button\"]`, which is the one attribute this library invites a\n * caller to RENAME — every part takes `slot?: string`. So every component of ours that renames a\n * `Button` got the variant's three assignments and no rule that read them: `AlertDialogAction` and\n * `AlertDialogCancel` reported their `data-variant` correctly and `background-color:\n * rgba(0, 0, 0, 0)` in a live document, and twenty-nine more call sites sat on the same fault.\n * `05f3a0a` had already moved the *height* here for exactly this reason and left the colour behind,\n * on the argument that losing a colour on a rename is a caller asking for a different look — which\n * is true of a caller and was never true of us. `no-paint-on-a-renameable-slot.test.ts` holds it.\n *\n * What a variant may set: `--btn-bg`, `--btn-fg`, `--btn-bd`. Nothing else here paints.\n */\nexport const buttonVariants = tv({\n base: [\n \"relative\",\n // Nothing below may be keyed on `data-slot`. See the docblock: `--size` was moved here first,\n // in `05f3a0a`, and the paint followed it once the same rename was measured against the colour.\n controlHeight,\n // The only one of the three locals a variant may leave unset — `outline` is the sole variant\n // that assigns `--btn-bd`, while all six assign the fill and the ink. A default for those two\n // would be a line that is overwritten every single render.\n \"[--btn-bd:transparent]\",\n // Derived, never assigned by a variant. `--depth: 0` collapses the edge and the lift to\n // nothing, which is what the library looks like today; `1` gives it relief. Same classes.\n //\n // daisyUI darkens a fill with `color-mix(in oklab, var(--btn-bg), #000 5%)`. Mixing toward\n // `--foreground` instead is a divergence taken on a reason: `black` is only \"darker\" in a light\n // theme, and on a dark one the hover of a pale button should move toward white. One formula\n // reads as \"push this fill away from the page and toward the ink\" in both, and it follows a\n // tenant's document instead of a constant — which is also why `--depth` can be a single number.\n // Their half-pixel inset gloss needs a colour that is toward the light side in both modes and\n // neither `--foreground` nor `--background` is that, so it waits for a reason to exist.\n \"[--btn-edge:color-mix(in_oklab,var(--btn-bd),var(--foreground)_calc(var(--depth)*8%))]\",\n \"[--btn-lift:color-mix(in_oklab,var(--btn-bg)_calc(var(--depth)*30%),transparent)]\",\n \"bg-(--btn-bg) text-(--btn-fg)\",\n // The grain, and the whole of the conditional that switches it off: at `--noise: 0` the layer\n // is sized to zero and never painted, at `1` it tiles. No variant — which is the property that\n // lets it be a value a tenant sets rather than a look somebody has to write. It defaults to `0`\n // here rather than in every theme, because a theme that wants no texture is saying nothing.\n \"bg-(image:--fx-noise) bg-size-[calc(var(--noise,0)*100%)]\",\n // `rounded-[var(--radius-field)]` and not `rounded-field`, which is the same radius and the\n // spelling every other recipe here uses: `tailwind-merge` knows nothing about a theme key it\n // was never configured with, so `rounded-field` and a caller's `rounded-full` both survive the\n // merge and the winner is whichever Tailwind happened to emit last. The `pill` variant is that\n // caller. An arbitrary value is in a group the merge does know.\n \"border-[length:var(--stroke)] border-(--btn-edge) rounded-[var(--radius-field)]\",\n // As `shadow-*` rather than a raw `box-shadow`, so it composes with `focus-visible:ring-[3px]`\n // through Tailwind's shadow chain instead of being replaced by it. At `--depth: 0` the lift is\n // transparent and nothing is drawn either way, which is why that was invisible before.\n \"shadow-[0_3px_2px_-2px_var(--btn-lift),0_4px_3px_-2px_var(--btn-lift)]\",\n // One hover and one active for every variant, solid and transparent alike — and the transparent\n // case is the tell that the formula is right. Mixing `transparent` with the foreground at 10%\n // IS the foreground at 10% alpha, which is exactly the wash a ghost button wants.\n //\n // The CSS rule guarded these with `:not(:disabled, [aria-disabled=\"true\"], [data-disabled])`.\n // All three spellings already carry `pointer-events-none` on this same base and an element with\n // `pointer-events: none` can match neither `:hover` nor `:active`, so the guard was\n // belt-and-braces. Dropping it is not tidiness: with the plain modifier, `tailwind-merge` can\n // see a variant's own `hover:bg-*` as the same utility and let it win — which is how `link`\n // opts out in one class, instead of losing to a longer selector on specificity.\n \"hover:bg-[color-mix(in_oklab,var(--btn-bg),var(--foreground)_10%)]\",\n \"active:bg-[color-mix(in_oklab,var(--btn-bg),var(--foreground)_16%)]\",\n \"inline-flex shrink-0 items-center justify-center gap-2\",\n \"whitespace-nowrap font-medium text-sm\",\n \"border-solid\",\n \"transition-all\",\n \"outline-none focus-visible:ring-[3px] focus-visible:ring-ring\",\n \"disabled:pointer-events-none disabled:opacity-64\",\n \"data-disabled:pointer-events-none data-disabled:opacity-64\",\n \"aria-disabled:pointer-events-none aria-disabled:opacity-64\",\n \"data-[state=loading]:pointer-events-none\",\n \"aria-invalid:border-destructive aria-invalid:ring-destructive/24\",\n \"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n \"motion-reduce:transition-none!\",\n ],\n variants: {\n variant: {\n default: [\n \"[--btn-bg:var(--primary)]\",\n \"[--btn-fg:var(--primary-foreground)]\",\n \"focus-visible:border-background\",\n ],\n outline: [\n \"[--btn-bg:transparent]\",\n \"[--btn-fg:var(--foreground)]\",\n \"[--btn-bd:var(--input)]\",\n \"focus-visible:border-primary\",\n ],\n destructive: [\n \"[--btn-bg:var(--destructive)]\",\n // Was `text-white` at 3.81 on red-500. The fill moved to `-600` and the ink became a token,\n // because no choice of ink rescued red-500: white 3.81, near-black 4.15, AA needs 4.5.\n \"[--btn-fg:var(--destructive-content)]\",\n \"focus-visible:border-background focus-visible:ring-destructive-foreground/32\",\n ],\n secondary: [\n \"[--btn-bg:var(--secondary)]\",\n \"[--btn-fg:var(--secondary-foreground)]\",\n \"focus-visible:border-primary\",\n ],\n ghost: [\n \"[--btn-bg:transparent]\",\n \"[--btn-fg:var(--foreground)]\",\n \"focus-visible:border-primary\",\n ],\n // The one variant that opts OUT of the shared hover, because a link's hover is an underline\n // and not a wash. Same modifier and same utility group as the base's wash, so\n // `tailwind-variants` merges the two and the variant wins — which is what makes opting out\n // one class rather than an exception somewhere else.\n link: [\n \"[--btn-bg:transparent]\",\n \"[--btn-fg:var(--primary)]\",\n \"underline-offset-4\",\n \"hover:bg-transparent hover:underline active:bg-transparent\",\n \"focus-visible:border-primary\",\n ],\n },\n /**\n * Padding, gaps and icon sizes. A size variant only **moves `--size`** — the height that reads\n * it is on the `base` — so a tenant can ask for compact controls, through `--size-field`,\n * without asking for tighter text.\n *\n * The floor is still measured rather than chosen. `xs` and `icon-xs` were both `1.5rem`, and\n * every size is a `rem` against a root the density axis sets — 16px default, 14px compact, 18px\n * comfortable — so they measured **21px in compact**, under the 24×24 WCAG 2.5.8 states in CSS\n * pixels. `sm` is the smallest size that clears the bar in all three densities. No call site was\n * failing: the spacing exception saves a clustered control, and every measured `xs` was in a\n * cluster. The variant went because its NAME promised a size it could not deliver at one\n * density, and nothing was published to break.\n */\n size: {\n sm: [controlSizes.sm, \"px-2.5\", \"gap-1.5\", \"[&_svg:not([class*='size-'])]:size-3.5\"],\n md: [controlSizes.md, \"px-3\", \"py-2\"],\n lg: [controlSizes.lg, \"px-3.5\"],\n xl: [\"[--size:calc(var(--size-field)*10)]\", \"text-base\", \"px-4\"],\n // Square, and the width is stated rather than left to `aspect-ratio`: a caller who writes\n // `w-fit` on top of an aspect ratio gets the icon's own width and a control twice as tall.\n \"icon-sm\": [controlSizes.sm, \"w-(--size)\", \"px-0\"],\n \"icon-md\": [controlSizes.md, \"w-(--size)\", \"px-0\"],\n \"icon-lg\": [controlSizes.lg, \"w-(--size)\", \"px-0\"],\n \"icon-xl\": [\n \"[--size:calc(var(--size-field)*10)]\",\n \"w-(--size)\",\n \"px-0\",\n \"[&_svg:not([class*='size-'])]:size-5\",\n ],\n },\n clickEffect: {\n true: \"active:not-aria-[haspopup]:scale-[0.98]\",\n },\n pill: {\n true: [\n \"rounded-full\",\n \"has-[>svg]:data-[size=sm]:pe-3.5\",\n \"has-[>svg]:data-[size=md]:pe-4\",\n \"has-[>svg]:data-[size=lg]:pe-4.5\",\n \"has-[>svg]:data-[size=xl]:pe-5\",\n ],\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n clickEffect: true,\n pill: false,\n },\n});\n\nexport interface ButtonProps\n extends React.ComponentProps<typeof ark.button>,\n VariantProps<typeof buttonVariants> {\n /**\n * Apply a click effect to the button\n *\n * @default true\n */\n clickEffect?: boolean;\n /**\n * Show a loading indicator\n *\n * @default false\n */\n isLoading?: boolean;\n}\n\nexport const Button = (props: ButtonProps) => {\n const {\n variant = \"default\",\n size = \"md\",\n clickEffect = true,\n pill = false,\n isLoading = false,\n className,\n children,\n slot,\n ...rest\n } = props;\n\n return (\n <ark.button\n className={cn(\n buttonVariants({ variant, size, clickEffect, pill }),\n className\n )}\n data-size={size}\n data-state={isLoading ? \"loading\" : \"idle\"}\n data-variant={variant}\n type=\"button\"\n {...rest}\n data-slot={slot ?? \"button\"}\n aria-busy={isLoading}\n aria-disabled={isLoading}\n >\n {isLoading ? (\n <>\n <span aria-hidden className=\"invisible\">\n {children}\n </span>\n\n <span className=\"sr-only\">{children}</span>\n\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <Spinner aria-hidden />\n </span>\n </>\n ) : (\n children\n )}\n </ark.button>\n );\n};\n"],"names":["buttonVariants","tv","controlHeight","controlSizes","Button","props","variant","size","clickEffect","pill","isLoading","className","children","slot","rest","jsx","ark","cn","jsxs","Fragment","Spinner"],"mappings":";;;;;;AA4BO,MAAMA,IAAiBC,EAAG;AAAA,EAC/B,MAAM;AAAA,IACJ;AAAA;AAAA;AAAA,IAGAC;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,SAAS;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,aAAa;AAAA,QACX;AAAA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA,MAAA;AAAA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K,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC,sBA+CrD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,SAAS,CAAC,sBAoB1D,CAAC"}
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/simples/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,IAAI,WAAW,EAExB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,WAAW,kDAAqB,CAAC;AAE9C,eAAO,MAAM,aAAa,GACxB,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,KAAK,CAAC,sBAWtD,CAAC;AAaF,eAAO,MAAM,gBAAgB,sMAgB3B,CAAC;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,GACnB,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC,sBA2CrD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,OAAO,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,SAAS,CAAC,sBAoB1D,CAAC"}
@@ -1,19 +1,23 @@
1
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import { useCheckboxContext as f, Checkbox as o } from "@ark-ui/react/checkbox";
3
- import { CheckIcon as x, MinusIcon as h } from "lucide-react";
4
- import { tv as m } from "tailwind-variants";
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { useCheckboxContext as f, Checkbox as i } from "@ark-ui/react/checkbox";
3
+ import { CheckIcon as m, MinusIcon as h } from "lucide-react";
4
+ import { tv as l } from "tailwind-variants";
5
5
  import { cn as d } from "../lib/cn.js";
6
- const N = f, I = (a) => {
7
- const { className: t, slot: r, ...i } = a;
6
+ import { controlSizes as k, controlMinHeight as p } from "../lib/control-size.js";
7
+ const G = f, H = (a) => {
8
+ const { className: t, slot: r, ...o } = a;
8
9
  return /* @__PURE__ */ e(
9
- o.Group,
10
+ i.Group,
10
11
  {
11
12
  className: d("flex flex-col gap-2", t),
12
- ...i,
13
+ ...o,
13
14
  "data-slot": r ?? "checkbox-group"
14
15
  }
15
16
  );
16
- }, k = m({
17
+ }, v = l({
18
+ base: ["inline-flex items-center gap-2", "text-sm", "data-disabled:opacity-64"],
19
+ variants: { labelled: { true: [k.md, p] } }
20
+ }), g = l({
17
21
  base: [
18
22
  "relative",
19
23
  "inline-flex shrink-0 items-center justify-center",
@@ -29,54 +33,50 @@ const N = f, I = (a) => {
29
33
  "dark:not-data-checked:bg-field",
30
34
  "motion-reduce:transition-none!"
31
35
  ]
32
- }), j = (a) => {
36
+ }), L = (a) => {
33
37
  const {
34
38
  className: t,
35
39
  tabIndex: r,
36
- slot: i,
37
- children: c,
38
- "aria-label": l,
39
- "aria-labelledby": b,
40
- ...u
40
+ slot: o,
41
+ children: s,
42
+ "aria-label": b,
43
+ "aria-labelledby": u,
44
+ ...x
41
45
  } = a;
42
- return /* @__PURE__ */ s(
43
- o.Root,
46
+ return /* @__PURE__ */ n(
47
+ i.Root,
44
48
  {
45
- className: d(
46
- "inline-flex items-center gap-2",
47
- "data-disabled:opacity-64",
48
- t
49
- ),
50
- ...u,
51
- "data-slot": i ?? "checkbox",
49
+ className: d(v({ labelled: s != null }), t),
50
+ ...x,
51
+ "data-slot": o ?? "checkbox",
52
52
  children: [
53
- /* @__PURE__ */ s(
54
- o.Control,
53
+ /* @__PURE__ */ n(
54
+ i.Control,
55
55
  {
56
- className: k(),
56
+ className: g(),
57
57
  "data-slot": "checkbox-control",
58
58
  children: [
59
- /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(x, {}) }),
60
- /* @__PURE__ */ e(n, { indeterminate: !0, children: /* @__PURE__ */ e(h, {}) })
59
+ /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(m, {}) }),
60
+ /* @__PURE__ */ e(c, { indeterminate: !0, children: /* @__PURE__ */ e(h, {}) })
61
61
  ]
62
62
  }
63
63
  ),
64
- c,
64
+ s,
65
65
  /* @__PURE__ */ e(
66
- o.HiddenInput,
66
+ i.HiddenInput,
67
67
  {
68
- "aria-label": l,
69
- "aria-labelledby": b,
68
+ "aria-label": b,
69
+ "aria-labelledby": u,
70
70
  tabIndex: r
71
71
  }
72
72
  )
73
73
  ]
74
74
  }
75
75
  );
76
- }, n = (a) => {
77
- const { className: t, slot: r, ...i } = a;
76
+ }, c = (a) => {
77
+ const { className: t, slot: r, ...o } = a;
78
78
  return /* @__PURE__ */ e(
79
- o.Indicator,
79
+ i.Indicator,
80
80
  {
81
81
  className: d(
82
82
  "absolute -inset-px",
@@ -88,16 +88,16 @@ const N = f, I = (a) => {
88
88
  "data-[state=indeterminate]:text-foreground",
89
89
  t
90
90
  ),
91
- ...i,
91
+ ...o,
92
92
  "data-slot": r ?? "checkbox-indicator"
93
93
  }
94
94
  );
95
95
  };
96
96
  export {
97
- j as Checkbox,
98
- I as CheckboxGroup,
99
- n as CheckboxIndicator,
100
- k as checkboxVariants,
101
- N as useCheckbox
97
+ L as Checkbox,
98
+ H as CheckboxGroup,
99
+ c as CheckboxIndicator,
100
+ g as checkboxVariants,
101
+ G as useCheckbox
102
102
  };
103
103
  //# sourceMappingURL=checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sources":["../../src/simples/checkbox.tsx"],"sourcesContent":["import {\n Checkbox as ArkCheckbox,\n useCheckboxContext,\n} from \"@ark-ui/react/checkbox\";\nimport { CheckIcon, MinusIcon } from \"lucide-react\";\nimport type React from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport { cn } from \"../lib/cn\";\n\nexport const useCheckbox = useCheckboxContext;\n\nexport const CheckboxGroup = (\n props: React.ComponentProps<typeof ArkCheckbox.Group>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ArkCheckbox.Group\n className={cn(\"flex flex-col gap-2\", className)}\n {...rest}\n data-slot={slot ?? \"checkbox-group\"}\n />\n );\n};\n\nexport const checkboxVariants = tv({\n base: [\n \"relative\",\n \"inline-flex shrink-0 items-center justify-center\",\n \"bg-transparent\",\n \"rounded-selector border border-input shadow-xs/5\",\n \"transition-shadow\",\n \"data-focus-visible:border-primary data-focus-visible:ring-[3px] data-focus-visible:ring-ring data-focus-visible:ring-offset-1 data-focus-visible:ring-offset-background\",\n \"dark:data-focus-visible:data-invalid:border-destructive-foreground/64 dark:data-focus-visible:data-invalid:ring-destructive-foreground/48\",\n \"data-disabled:opacity-64\",\n \"[[data-disabled],[data-checked],[data-invalid]]:shadow-none\",\n \"data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24\",\n \"dark:data-invalid:text-destructive-foreground\",\n \"dark:not-data-checked:bg-field\",\n \"motion-reduce:transition-none!\",\n ],\n});\n\n/**\n * Two defects this component carried for as long as it existed, both found by a composite trying to\n * use it and both measured before the fix.\n *\n * The box styling sat on the **root**, so the root was the box and there was nowhere for a label to\n * go: `children` arrived through `...rest` above hardcoded JSX children, JSX children win, and\n * `<Checkbox>Sealed orders</Checkbox>` rendered `textContent: \"\"`. Four docs examples are written\n * that way, the default one included, so the Checkbox page shipped unlabelled boxes\n *. `RadioGroupItem` one file over already had\n * the right shape — box on the control, root as the row, children beside it — and this now matches\n * it. `checkboxVariants` still names the box; what changed is which element wears it.\n *\n * And `role=\"checkbox\"` sat on that root, which is Ark's `<label>`, while `HiddenInput` renders a\n * real `<input type=\"checkbox\">` underneath. Two elements answered to the role, the outer carrying\n * the name and the inner the focus. Ark declares no role there on purpose: the input is the\n * control, and the label names it through the `htmlFor` Ark already sets.\n */\nexport const Checkbox = (\n props: React.ComponentProps<typeof ArkCheckbox.Root>\n) => {\n const {\n className,\n tabIndex,\n slot,\n children,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...rest\n } = props;\n\n return (\n <ArkCheckbox.Root\n className={cn(\n \"inline-flex items-center gap-2\",\n \"data-disabled:opacity-64\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"checkbox\"}\n >\n <ArkCheckbox.Control\n className={checkboxVariants()}\n data-slot=\"checkbox-control\"\n >\n <CheckboxIndicator>\n <CheckIcon />\n </CheckboxIndicator>\n\n <CheckboxIndicator indeterminate>\n <MinusIcon />\n </CheckboxIndicator>\n </ArkCheckbox.Control>\n\n {children}\n\n {/* The name belongs to the control, and the control is this input. Ark's root is a\n `<label htmlFor>`, so visible children name it for free — but an `aria-label` on a\n `<label>` names nothing, which is why the two naming props are forwarded here. */}\n <ArkCheckbox.HiddenInput\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n tabIndex={tabIndex}\n />\n </ArkCheckbox.Root>\n );\n};\n\nexport const CheckboxIndicator = (\n props: React.ComponentProps<typeof ArkCheckbox.Indicator>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ArkCheckbox.Indicator\n className={cn(\n \"absolute -inset-px\",\n \"flex items-center justify-center\",\n \"rounded-selector\",\n \"text-primary-foreground\",\n \"data-[state=checked]:bg-primary\",\n \"data-[state=unchecked]:hidden\",\n \"data-[state=indeterminate]:text-foreground\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"checkbox-indicator\"}\n />\n );\n};\n"],"names":["useCheckbox","useCheckboxContext","CheckboxGroup","props","className","slot","rest","jsx","ArkCheckbox","cn","checkboxVariants","tv","Checkbox","tabIndex","children","ariaLabel","ariaLabelledBy","jsxs","CheckboxIndicator","CheckIcon","MinusIcon"],"mappings":";;;;;AASO,MAAMA,IAAcC,GAEdC,IAAgB,CAC3BC,MACG;AACH,QAAM,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,MAASH;AAErC,SACE,gBAAAI;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,WAAWC,EAAG,uBAAuBL,CAAS;AAAA,MAC7C,GAAGE;AAAA,MACJ,aAAWD,KAAQ;AAAA,IAAA;AAAA,E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AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAL;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,MACJ,aAAWD,KAAQ;AAAA,IAAA;AAAA,EAAA;AAGzB;"}
1
+ {"version":3,"file":"checkbox.js","sources":["../../src/simples/checkbox.tsx"],"sourcesContent":["import {\n Checkbox as ArkCheckbox,\n useCheckboxContext,\n} from \"@ark-ui/react/checkbox\";\nimport { CheckIcon, MinusIcon } from \"lucide-react\";\nimport type React from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport { cn } from \"../lib/cn\";\nimport { controlMinHeight, controlSizes } from \"../lib/control-size\";\n\nexport const useCheckbox = useCheckboxContext;\n\nexport const CheckboxGroup = (\n props: React.ComponentProps<typeof ArkCheckbox.Group>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ArkCheckbox.Group\n className={cn(\"flex flex-col gap-2\", className)}\n {...rest}\n data-slot={slot ?? \"checkbox-group\"}\n />\n );\n};\n\n/**\n * The row an indicator and its label sit in. **Labelled, it is one control tall** — the shared\n * height, centred — so a switch, a checkbox or a radio lines up with an input beside it and with the\n * rows above and below in a form. Alone (no children: a cell in a table) it is the indicator and\n * nothing else, and the height is not asked of it.\n */\nconst checkboxRowVariants = tv({\n base: [\"inline-flex items-center gap-2\", \"text-sm\", \"data-disabled:opacity-64\"],\n variants: { labelled: { true: [controlSizes.md, controlMinHeight] } },\n});\n\nexport const checkboxVariants = tv({\n base: [\n \"relative\",\n \"inline-flex shrink-0 items-center justify-center\",\n \"bg-transparent\",\n \"rounded-selector border border-input shadow-xs/5\",\n \"transition-shadow\",\n \"data-focus-visible:border-primary data-focus-visible:ring-[3px] data-focus-visible:ring-ring data-focus-visible:ring-offset-1 data-focus-visible:ring-offset-background\",\n \"dark:data-focus-visible:data-invalid:border-destructive-foreground/64 dark:data-focus-visible:data-invalid:ring-destructive-foreground/48\",\n \"data-disabled:opacity-64\",\n \"[[data-disabled],[data-checked],[data-invalid]]:shadow-none\",\n \"data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24\",\n \"dark:data-invalid:text-destructive-foreground\",\n \"dark:not-data-checked:bg-field\",\n \"motion-reduce:transition-none!\",\n ],\n});\n\n/**\n * Two defects this component carried for as long as it existed, both found by a composite trying to\n * use it and both measured before the fix.\n *\n * The box styling sat on the **root**, so the root was the box and there was nowhere for a label to\n * go: `children` arrived through `...rest` above hardcoded JSX children, JSX children win, and\n * `<Checkbox>Sealed orders</Checkbox>` rendered `textContent: \"\"`. Four docs examples are written\n * that way, the default one included, so the Checkbox page shipped unlabelled boxes\n *. `RadioGroupItem` one file over already had\n * the right shape — box on the control, root as the row, children beside it — and this now matches\n * it. `checkboxVariants` still names the box; what changed is which element wears it.\n *\n * And `role=\"checkbox\"` sat on that root, which is Ark's `<label>`, while `HiddenInput` renders a\n * real `<input type=\"checkbox\">` underneath. Two elements answered to the role, the outer carrying\n * the name and the inner the focus. Ark declares no role there on purpose: the input is the\n * control, and the label names it through the `htmlFor` Ark already sets.\n */\nexport const Checkbox = (\n props: React.ComponentProps<typeof ArkCheckbox.Root>\n) => {\n const {\n className,\n tabIndex,\n slot,\n children,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n ...rest\n } = props;\n\n return (\n <ArkCheckbox.Root\n className={cn(checkboxRowVariants({ labelled: children != null }), className)}\n {...rest}\n data-slot={slot ?? \"checkbox\"}\n >\n <ArkCheckbox.Control\n className={checkboxVariants()}\n data-slot=\"checkbox-control\"\n >\n <CheckboxIndicator>\n <CheckIcon />\n </CheckboxIndicator>\n\n <CheckboxIndicator indeterminate>\n <MinusIcon />\n </CheckboxIndicator>\n </ArkCheckbox.Control>\n\n {children}\n\n {/* The name belongs to the control, and the control is this input. Ark's root is a\n `<label htmlFor>`, so visible children name it for free — but an `aria-label` on a\n `<label>` names nothing, which is why the two naming props are forwarded here. */}\n <ArkCheckbox.HiddenInput\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n tabIndex={tabIndex}\n />\n </ArkCheckbox.Root>\n );\n};\n\nexport const CheckboxIndicator = (\n props: React.ComponentProps<typeof ArkCheckbox.Indicator>\n) => {\n const { className, slot, ...rest } = props;\n\n return (\n <ArkCheckbox.Indicator\n className={cn(\n \"absolute -inset-px\",\n \"flex items-center justify-center\",\n \"rounded-selector\",\n \"text-primary-foreground\",\n \"data-[state=checked]:bg-primary\",\n \"data-[state=unchecked]:hidden\",\n \"data-[state=indeterminate]:text-foreground\",\n className\n )}\n {...rest}\n data-slot={slot ?? \"checkbox-indicator\"}\n />\n );\n};\n"],"names":["useCheckbox","useCheckboxContext","CheckboxGroup","props","className","slot","rest","jsx","ArkCheckbox","cn","checkboxRowVariants","tv","controlSizes","controlMinHeight","checkboxVariants","Checkbox","tabIndex","children","ariaLabel","ariaLabelledBy","jsxs","CheckboxIndicator","CheckIcon","MinusIcon"],"mappings":";;;;;;AAUO,MAAMA,IAAcC,GAEdC,IAAgB,CAC3BC,MACG;AACH,QAAM,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,MAASH;AAErC,SACE,gBAAAI;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,WAAWC,EAAG,uBAAuBL,CAAS;AAAA,MAC7C,GAAGE;AAAA,MACJ,aAAWD,KAAQ;AAAA,IAAA;AAAA,EAAA;AAGzB,GAQMK,IAAsBC,EAAG;AAAA,EAC7B,MAAM,CAAC,kCAAkC,WAAW,0BAA0B;AAAA,EAC9E,UAAU,EAAE,UAAU,EAAE,MAAM,CAACC,EAAa,IAAIC,CAAgB,EAAA,EAAE;AACpE,CAAC,GAEYC,IAAmBH,EAAG;AAAA,EACjC,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;A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