@epilot/zenith-react 0.2.0-next.5 → 0.2.0-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -152,7 +152,7 @@ page in the documentation's setup section has the steps for each agent.
152
152
  ## Which version you get
153
153
 
154
154
  `npm install @epilot/zenith-react` resolves the `latest` dist-tag, which points
155
- at `0.1.0` — published to `next`, verified, then promoted by hand.
155
+ at `0.2.0` — published to `next`, verified, then promoted by hand.
156
156
 
157
157
  Unproven builds stay on `next` with a prerelease version:
158
158
 
@@ -1,11 +1,13 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
- import { Checkbox as u } from "../../_virtual/_zenith-runtime-family_checkbox.js";
4
- import { SLOT_ATTR as n, mergeClasses as C, shorthands as e } from "@epilot/zenith-runtime/v1";
5
- import { makeZenithStyles as v } from "../../styles/make-styles.js";
6
- import { boxModel as S, nativeControl as T } from "../../styles/host-reset.js";
7
- import { accentContrast as y, accentSolid as q, accentOnSoft as R, accentA7 as b, focusRing as x, radiusSm as I, accentSoft as M, errorA8 as O, grayA4 as A } from "../../tokens/index.js";
8
- const L = i.forwardRef(function(r, t) {
3
+ import { Checkbox as b } from "../../_virtual/_zenith-runtime-family_checkbox.js";
4
+ import { SLOT_ATTR as n, mergeClasses as S, shorthands as e } from "@epilot/zenith-runtime/v1";
5
+ import { useOptionalFieldContext as T } from "../field/field.js";
6
+ import { HiddenInputBox as y } from "../../lib/hidden-input-box.js";
7
+ import { makeZenithStyles as q } from "../../styles/make-styles.js";
8
+ import { boxModel as R, nativeControl as I } from "../../styles/host-reset.js";
9
+ import { accentContrast as O, accentSolid as M, accentOnSoft as A, accentA7 as p, focusRing as f, radiusSm as B, accentSoft as L, errorA8 as E, grayA4 as F } from "../../tokens/index.js";
10
+ const N = i.forwardRef(function(r, t) {
9
11
  return /* @__PURE__ */ o(
10
12
  "svg",
11
13
  {
@@ -21,7 +23,7 @@ const L = i.forwardRef(function(r, t) {
21
23
  children: /* @__PURE__ */ o("path", { d: "m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z" })
22
24
  }
23
25
  );
24
- }), B = i.forwardRef(function(r, t) {
26
+ }), Z = i.forwardRef(function(r, t) {
25
27
  return /* @__PURE__ */ o(
26
28
  "svg",
27
29
  {
@@ -37,17 +39,17 @@ const L = i.forwardRef(function(r, t) {
37
39
  children: /* @__PURE__ */ o("path", { d: "M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z" })
38
40
  }
39
41
  );
40
- }), E = v({
42
+ }), _ = q({
41
43
  root: {
42
- ...T,
43
- ...e.border("1px", "solid", b),
44
- backgroundColor: M,
44
+ ...I,
45
+ ...e.border("1px", "solid", p),
46
+ backgroundColor: L,
45
47
  display: "inline-block",
46
48
  boxSizing: "border-box",
47
49
  width: "1rem",
48
50
  height: "1rem",
49
51
  flexShrink: 0,
50
- borderRadius: I,
52
+ borderRadius: B,
51
53
  // v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).
52
54
  boxShadow: "0 1px 2px 0 #0000000d",
53
55
  transitionProperty: "box-shadow",
@@ -60,26 +62,26 @@ const L = i.forwardRef(function(r, t) {
60
62
  outlineOffset: "2px",
61
63
  outlineWidth: "2px",
62
64
  outlineStyle: "solid",
63
- outlineColor: x
65
+ outlineColor: f
64
66
  },
65
67
  "&[data-disabled]": {
66
68
  cursor: "not-allowed",
67
69
  opacity: 0.5,
68
- ...e.borderColor(A)
70
+ ...e.borderColor(F)
69
71
  },
70
72
  "&[aria-invalid='true']": {
71
- outlineColor: x,
72
- ...e.borderColor(O)
73
+ outlineColor: f,
74
+ ...e.borderColor(E)
73
75
  },
74
76
  "&[data-indeterminate]": {
75
- backgroundColor: b,
77
+ backgroundColor: p,
76
78
  ...e.borderColor("transparent"),
77
- color: R
79
+ color: A
78
80
  },
79
81
  "&[data-checked]": {
80
- backgroundColor: q,
82
+ backgroundColor: M,
81
83
  ...e.borderWidth("0px"),
82
- color: y
84
+ color: O
83
85
  },
84
86
  "&[data-checked] svg, &[data-indeterminate] svg": {
85
87
  width: "0.875rem",
@@ -87,7 +89,7 @@ const L = i.forwardRef(function(r, t) {
87
89
  }
88
90
  },
89
91
  indicator: {
90
- ...S,
92
+ ...R,
91
93
  display: "grid",
92
94
  placeContent: "center",
93
95
  height: "100%",
@@ -98,47 +100,47 @@ const L = i.forwardRef(function(r, t) {
98
100
  height: "0.875rem"
99
101
  }
100
102
  }
101
- }), N = /* @__PURE__ */ o("button", {}), F = i.forwardRef(
103
+ }), z = /* @__PURE__ */ o("button", {}), K = i.forwardRef(
102
104
  function({
103
105
  className: r,
104
106
  checked: t,
105
- defaultChecked: p,
107
+ defaultChecked: k,
106
108
  onCheckedChange: c,
107
- asChild: Z,
108
- value: s,
109
- ...f
109
+ asChild: D,
110
+ value: l,
111
+ ...s
110
112
  }, g) {
111
- const l = E(), [k, w] = i.useState(p ?? !1), a = t === void 0 ? k : t;
112
- return /* @__PURE__ */ o(
113
- u.Root,
113
+ const h = _(), w = T() !== null, [C, v] = i.useState(k ?? !1), a = t === void 0 ? C : t, m = /* @__PURE__ */ o(
114
+ b.Root,
114
115
  {
115
116
  ref: g,
116
117
  nativeButton: !0,
117
- render: N,
118
+ render: z,
118
119
  checked: a === !0,
119
120
  indeterminate: a === "indeterminate",
120
- onCheckedChange: (h, m) => {
121
- c == null || c(h, m), m.isCanceled || w(h);
121
+ onCheckedChange: (u, x) => {
122
+ c == null || c(u, x), x.isCanceled || v(u);
122
123
  },
123
- value: s === void 0 ? void 0 : String(s),
124
+ value: l === void 0 ? void 0 : String(l),
124
125
  "data-slot": "checkbox",
125
126
  [n]: "checkbox",
126
- className: C(l.root, r),
127
- ...f,
127
+ className: S(h.root, r),
128
+ ...s,
128
129
  children: /* @__PURE__ */ o(
129
- u.Indicator,
130
+ b.Indicator,
130
131
  {
131
132
  "data-slot": "checkbox-indicator",
132
133
  [n]: "checkbox-indicator",
133
- className: l.indicator,
134
- children: a === "indeterminate" ? /* @__PURE__ */ o(B, {}) : /* @__PURE__ */ o(L, {})
134
+ className: h.indicator,
135
+ children: a === "indeterminate" ? /* @__PURE__ */ o(Z, {}) : /* @__PURE__ */ o(N, {})
135
136
  }
136
137
  )
137
138
  }
138
139
  );
140
+ return s.name === void 0 || w ? m : /* @__PURE__ */ o(y, { slot: "checkbox-box", layout: "inline-block", children: m });
139
141
  }
140
142
  );
141
143
  export {
142
- F as Checkbox
144
+ K as Checkbox
143
145
  };
144
146
  //# sourceMappingURL=checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\nconst CheckIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function CheckIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-check-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-check-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z\" />\n </svg>\n )\n})\n\nconst MinusIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function MinusIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-minus-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-minus-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z\" />\n </svg>\n )\n})\n\nconst useStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n ...shorthands.border(\"1px\", \"solid\", tokens.accentA7),\n backgroundColor: tokens.accentSoft,\n display: \"inline-block\",\n boxSizing: \"border-box\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n borderRadius: tokens.radiusSm,\n // v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).\n boxShadow: \"0 1px 2px 0 #0000000d\",\n transitionProperty: \"box-shadow\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.focusRing,\n },\n \"&[data-disabled]\": {\n cursor: \"not-allowed\",\n opacity: 0.5,\n ...shorthands.borderColor(tokens.grayA4),\n },\n \"&[aria-invalid='true']\": {\n outlineColor: tokens.focusRing,\n ...shorthands.borderColor(tokens.errorA8),\n },\n \"&[data-indeterminate]\": {\n backgroundColor: tokens.accentA7,\n ...shorthands.borderColor(\"transparent\"),\n color: tokens.accentOnSoft,\n },\n \"&[data-checked]\": {\n backgroundColor: tokens.accentSolid,\n ...shorthands.borderWidth(\"0px\"),\n color: tokens.accentContrast,\n },\n \"&[data-checked] svg, &[data-indeterminate] svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n indicator: {\n ...boxModel,\n display: \"grid\",\n placeContent: \"center\",\n height: \"100%\",\n color: \"currentColor\",\n transitionProperty: \"none\",\n \"& svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n})\n\n/**\n * `checked` and `defaultChecked` accept the same three states as on Radix; Base UI models the third\n * as its own `indeterminate` boolean, which the wrapper sets.\n */\nexport type CheckboxCheckedState = boolean | \"indeterminate\"\n\n/**\n * What `onCheckedChange` receives as its second argument: Base UI's change details, declared in\n * Zenith so that none of Base UI's internals reach the published declarations, where TypeScript 4\n * cannot parse them.\n */\ntype CheckboxCheckedChangeDetails = {\n /** Why the checkbox changed. Base UI reports every checkbox change as `none`. */\n reason: \"none\"\n /** The native event behind the change. */\n event: Event\n /** Keeps the checkbox in its current state. */\n cancel: () => void\n /** Lets the event propagate where the checkbox would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n}\n\n/**\n * The checkbox props Base UI adds to a `<button>`'s, declared in Zenith with Base UI's types, apart\n * from the three-state `checked`, `defaultChecked` and `onCheckedChange`, which keep their Radix\n * shape. The root renders a native `<button>`, so the DOM attributes, handlers, `ref`, `key`,\n * `className`, `style` and `value` stay the button's, as they were on Radix; `render`,\n * `nativeButton`, `indeterminate` and `parent` are not part of the surface.\n */\ntype CheckboxRootProps = {\n /**\n * Whether the checkbox is currently checked, or `\"indeterminate\"`.\n *\n * To render an uncontrolled checkbox, use the `defaultChecked` prop instead.\n */\n checked?: CheckboxCheckedState | undefined\n /** Whether the checkbox is initially checked, or `\"indeterminate\"`. */\n defaultChecked?: CheckboxCheckedState | undefined\n /** Whether the component should ignore user interaction. */\n disabled?: boolean | undefined\n /** A ref to access the hidden `<input>` element. */\n inputRef?: React.Ref<HTMLInputElement> | undefined\n /** Identifies the field when a form is submitted. */\n name?: string | undefined\n /**\n * Identifies the form that owns the hidden input.\n * Useful when the checkbox is rendered outside the form.\n */\n form?: string | undefined\n /**\n * Event handler called when the checkbox is checked or unchecked. Clicking an indeterminate\n * checkbox reports `true`.\n */\n onCheckedChange?:\n | ((\n checked: CheckboxCheckedState,\n eventDetails: CheckboxCheckedChangeDetails\n ) => void)\n | undefined\n /** Whether the user should be unable to check or uncheck the checkbox. */\n readOnly?: boolean | undefined\n /** Whether the user must check the checkbox before submitting a form. */\n required?: boolean | undefined\n /**\n * The value submitted with the form when the checkbox is unchecked.\n * By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.\n */\n uncheckedValue?: string | undefined\n}\n\nexport type CheckboxProps = Omit<\n React.ComponentPropsWithRef<\"button\">,\n keyof CheckboxRootProps\n> &\n CheckboxRootProps & {\n /**\n * @deprecated Has no effect. The indicator is the checkbox's only child, so on Radix this\n * rendered the indicator as the checkbox rather than an element of yours. Remove it.\n */\n asChild?: boolean\n }\n\n// Base UI renders a <span> by default and moves the caller's id onto its hidden input. A native\n// button keeps the id, the HTMLButtonElement ref, native disabled and <label for> as Radix had them.\nconst ROOT_ELEMENT = <button />\n\nexport const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n function Checkbox(\n {\n className,\n checked,\n defaultChecked,\n onCheckedChange,\n asChild: _asChild,\n value,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n // Base UI has no third state to start from or to hold uncontrolled, so the state lives here\n // and Base UI is always controlled; a cancelled change leaves it as it was.\n const [uncontrolled, setUncontrolled] =\n React.useState<CheckboxCheckedState>(defaultChecked ?? false)\n const state = checked === undefined ? uncontrolled : checked\n\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n nativeButton\n render={ROOT_ELEMENT}\n checked={state === true}\n indeterminate={state === \"indeterminate\"}\n onCheckedChange={(next, details) => {\n onCheckedChange?.(next, details)\n if (!details.isCanceled) setUncontrolled(next)\n }}\n // Radix took the button's value type; Base UI submits a string, so it is converted here\n // the way the button's value attribute stringified it.\n value={value === undefined ? undefined : String(value)}\n data-slot=\"checkbox\"\n {...{ [SLOT_ATTR]: \"checkbox\" }}\n className={mergeClasses(styles.root, className)}\n // Base UI types the root's handlers for its default <span>; the element is the button\n // above, so the caller's button-typed handlers receive exactly the events they declare.\n {...(props as CheckboxPrimitive.Root.Props)}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n {...{ [SLOT_ATTR]: \"checkbox-indicator\" }}\n className={styles.indicator}\n >\n {state === \"indeterminate\" ? <MinusIcon /> : <CheckIcon />}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n }\n)\n"],"names":["CheckIcon","React","props","ref","jsx","SLOT_ATTR","MinusIcon","useStyles","makeZenithStyles","nativeControl","shorthands","tokens.accentA7","tokens.accentSoft","tokens.radiusSm","tokens.focusRing","tokens.grayA4","tokens.errorA8","tokens.accentOnSoft","tokens.accentSolid","tokens.accentContrast","boxModel","ROOT_ELEMENT","Checkbox","className","checked","defaultChecked","onCheckedChange","_asChild","value","styles","uncontrolled","setUncontrolled","state","CheckboxPrimitive","next","details","mergeClasses"],"mappings":";;;;;;;AASA,MAAMA,IAAYC,EAAM,WAGtB,SAAmBC,GAAOC,GAAK;AAC/B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GAAG;AAAA,MACnB,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAGH;AAAA,MAEJ,UAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,uJAAA,CAAuJ;AAAA,IAAA;AAAA,EAAA;AAGrK,CAAC,GAEKE,IAAYL,EAAM,WAGtB,SAAmBC,GAAOC,GAAK;AAC/B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GA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QAAA;AAAA,MAC1D;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { useOptionalFieldContext } from \"../field/field\"\nimport { HiddenInputBox } from \"../../lib/hidden-input-box\"\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\nconst CheckIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function CheckIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-check-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-check-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z\" />\n </svg>\n )\n})\n\nconst MinusIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function MinusIcon(props, ref) {\n return (\n <svg\n ref={ref}\n data-slot=\"checkbox-minus-icon\"\n {...{ [SLOT_ATTR]: \"checkbox-minus-icon\" }}\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 -960 960 960\"\n width=\"24px\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M280-440q-17 0-28.5-11.5T240-480q0-17 11.5-28.5T280-520h400q17 0 28.5 11.5T720-480q0 17-11.5 28.5T680-440H280Z\" />\n </svg>\n )\n})\n\nconst useStyles = makeZenithStyles({\n root: {\n ...nativeControl,\n ...shorthands.border(\"1px\", \"solid\", tokens.accentA7),\n backgroundColor: tokens.accentSoft,\n display: \"inline-block\",\n boxSizing: \"border-box\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n borderRadius: tokens.radiusSm,\n // v1 `shadow-xs` — elevation comes from Tailwind's shadow scale, which has no token (B7).\n boxShadow: \"0 1px 2px 0 #0000000d\",\n transitionProperty: \"box-shadow\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.focusRing,\n },\n \"&[data-disabled]\": {\n cursor: \"not-allowed\",\n opacity: 0.5,\n ...shorthands.borderColor(tokens.grayA4),\n },\n \"&[aria-invalid='true']\": {\n outlineColor: tokens.focusRing,\n ...shorthands.borderColor(tokens.errorA8),\n },\n \"&[data-indeterminate]\": {\n backgroundColor: tokens.accentA7,\n ...shorthands.borderColor(\"transparent\"),\n color: tokens.accentOnSoft,\n },\n \"&[data-checked]\": {\n backgroundColor: tokens.accentSolid,\n ...shorthands.borderWidth(\"0px\"),\n color: tokens.accentContrast,\n },\n \"&[data-checked] svg, &[data-indeterminate] svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n indicator: {\n ...boxModel,\n display: \"grid\",\n placeContent: \"center\",\n height: \"100%\",\n color: \"currentColor\",\n transitionProperty: \"none\",\n \"& svg\": {\n width: \"0.875rem\",\n height: \"0.875rem\",\n },\n },\n})\n\n/**\n * `checked` and `defaultChecked` accept the same three states as on Radix; Base UI models the third\n * as its own `indeterminate` boolean, which the wrapper sets.\n */\nexport type CheckboxCheckedState = boolean | \"indeterminate\"\n\n/**\n * What `onCheckedChange` receives as its second argument: Base UI's change details, declared in\n * Zenith so that none of Base UI's internals reach the published declarations, where TypeScript 4\n * cannot parse them.\n */\ntype CheckboxCheckedChangeDetails = {\n /** Why the checkbox changed. Base UI reports every checkbox change as `none`. */\n reason: \"none\"\n /** The native event behind the change. */\n event: Event\n /** Keeps the checkbox in its current state. */\n cancel: () => void\n /** Lets the event propagate where the checkbox would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n}\n\n/**\n * The checkbox props Base UI adds to a `<button>`'s, declared in Zenith with Base UI's types, apart\n * from the three-state `checked`, `defaultChecked` and `onCheckedChange`, which keep their Radix\n * shape. The root renders a native `<button>`, so the DOM attributes, handlers, `ref`, `key`,\n * `className`, `style` and `value` stay the button's, as they were on Radix; `render`,\n * `nativeButton`, `indeterminate` and `parent` are not part of the surface.\n */\ntype CheckboxRootProps = {\n /**\n * Whether the checkbox is currently checked, or `\"indeterminate\"`.\n *\n * To render an uncontrolled checkbox, use the `defaultChecked` prop instead.\n */\n checked?: CheckboxCheckedState | undefined\n /** Whether the checkbox is initially checked, or `\"indeterminate\"`. */\n defaultChecked?: CheckboxCheckedState | undefined\n /** Whether the component should ignore user interaction. */\n disabled?: boolean | undefined\n /** A ref to access the hidden `<input>` element. */\n inputRef?: React.Ref<HTMLInputElement> | undefined\n /** Identifies the field when a form is submitted. */\n name?: string | undefined\n /**\n * Identifies the form that owns the hidden input.\n * Useful when the checkbox is rendered outside the form.\n */\n form?: string | undefined\n /**\n * Event handler called when the checkbox is checked or unchecked. Clicking an indeterminate\n * checkbox reports `true`.\n */\n onCheckedChange?:\n | ((\n checked: CheckboxCheckedState,\n eventDetails: CheckboxCheckedChangeDetails\n ) => void)\n | undefined\n /** Whether the user should be unable to check or uncheck the checkbox. */\n readOnly?: boolean | undefined\n /** Whether the user must check the checkbox before submitting a form. */\n required?: boolean | undefined\n /**\n * The value submitted with the form when the checkbox is unchecked.\n * By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.\n */\n uncheckedValue?: string | undefined\n}\n\nexport type CheckboxProps = Omit<\n React.ComponentPropsWithRef<\"button\">,\n keyof CheckboxRootProps\n> &\n CheckboxRootProps & {\n /**\n * @deprecated Has no effect. The indicator is the checkbox's only child, so on Radix this\n * rendered the indicator as the checkbox rather than an element of yours. Remove it.\n */\n asChild?: boolean\n }\n\n// Base UI renders a <span> by default and moves the caller's id onto its hidden input. A native\n// button keeps the id, the HTMLButtonElement ref, native disabled and <label for> as Radix had them.\nconst ROOT_ELEMENT = <button />\n\nexport const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n function Checkbox(\n {\n className,\n checked,\n defaultChecked,\n onCheckedChange,\n asChild: _asChild,\n value,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const inField = useOptionalFieldContext() !== null\n // Base UI has no third state to start from or to hold uncontrolled, so the state lives here\n // and Base UI is always controlled; a cancelled change leaves it as it was.\n const [uncontrolled, setUncontrolled] =\n React.useState<CheckboxCheckedState>(defaultChecked ?? false)\n const state = checked === undefined ? uncontrolled : checked\n\n const root = (\n <CheckboxPrimitive.Root\n ref={ref}\n nativeButton\n render={ROOT_ELEMENT}\n checked={state === true}\n indeterminate={state === \"indeterminate\"}\n onCheckedChange={(next, details) => {\n onCheckedChange?.(next, details)\n if (!details.isCanceled) setUncontrolled(next)\n }}\n // Radix took the button's value type; Base UI submits a string, so it is converted here\n // the way the button's value attribute stringified it.\n value={value === undefined ? undefined : String(value)}\n data-slot=\"checkbox\"\n {...{ [SLOT_ATTR]: \"checkbox\" }}\n className={mergeClasses(styles.root, className)}\n // Base UI types the root's handlers for its default <span>; the element is the button\n // above, so the caller's button-typed handlers receive exactly the events they declare.\n {...(props as CheckboxPrimitive.Root.Props)}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n {...{ [SLOT_ATTR]: \"checkbox-indicator\" }}\n className={styles.indicator}\n >\n {state === \"indeterminate\" ? <MinusIcon /> : <CheckIcon />}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n\n // A named checkbox's hidden input sits beside the button; the box keeps it in (#132). A Field\n // is positioned already, so inside one the checkbox stays the layout item itself.\n return props.name === undefined || inField ? (\n root\n ) : (\n <HiddenInputBox slot=\"checkbox-box\" layout=\"inline-block\">\n {root}\n </HiddenInputBox>\n )\n }\n)\n"],"names":["CheckIcon","React","props","ref","jsx","SLOT_ATTR","MinusIcon","useStyles","makeZenithStyles","nativeControl","shorthands","tokens.accentA7","tokens.accentSoft","tokens.radiusSm","tokens.focusRing","tokens.grayA4","tokens.errorA8","tokens.accentOnSoft","tokens.accentSolid","tokens.accentContrast","boxModel","ROOT_ELEMENT","Checkbox","className","checked","defaultChecked","onCheckedChange","_asChild","value","styles","inField","useOptionalFieldContext","uncontrolled","setUncontrolled","state","root","CheckboxPrimitive","next","details","mergeClasses","HiddenInputBox"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAYC,EAAM,WAGtB,SAAmBC,GAAOC,GAAK;AAC/B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GAAG;AAAA,MACnB,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAGH;AAAA,MAEJ,UAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,uJAAA,CAAuJ;AAAA,IAAA;AAAA,EAAA;AAGrK,CAAC,GAEKE,IAAYL,EAAM,WAGtB,SAAmBC,GAAOC,GAAK;AAC/B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,aAAU;AAAA,MACJ,CAACE,CAAS,GAAG;AAAA,MACnB,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAGH;AAAA,MAEJ,UAAA,gBAAAE,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,gBAAe,QAAO,gBACxC,UAAAL,EAAA,CACH;AAAA,EAEJ;AACF;"}
@@ -3,8 +3,8 @@ import * as n from "react";
3
3
  import { Radio as p } from "../../_virtual/_zenith-runtime-family_radio.js";
4
4
  import { mergeClasses as b, SLOT_ATTR as l, shorthands as i } from "@epilot/zenith-runtime/v1";
5
5
  import { makeZenithStyles as k } from "../../styles/make-styles.js";
6
- import { boxModel as m, nativeControl as y } from "../../styles/host-reset.js";
7
- import { accentContrast as f, errorA10 as v, focusRing as h, errorSoft as R, grayA3 as g, accentSolid as w, accentOnSoft as S, accentSoft as I, errorA8 as E, accentA7 as A, spacingElement3 as T } from "../../tokens/index.js";
6
+ import { boxModel as m, nativeControl as v } from "../../styles/host-reset.js";
7
+ import { accentContrast as f, errorA10 as y, focusRing as h, errorSoft as R, grayA3 as g, accentSolid as w, accentOnSoft as S, accentSoft as I, errorA8 as E, accentA7 as A, spacingElement3 as T } from "../../tokens/index.js";
8
8
  import { RadioGroupBase as j } from "./radio-group-base.js";
9
9
  const G = n.forwardRef(
10
10
  function(o, e) {
@@ -26,11 +26,14 @@ const G = n.forwardRef(
26
26
  }
27
27
  ), C = k({
28
28
  group: {
29
+ // A named group's radios each render a hidden input beside them, absolutely positioned with no
30
+ // offsets: the group is their containing block, so they cannot escape an app's scroll box (#132).
31
+ position: "relative",
29
32
  display: "grid",
30
33
  ...i.gap(T)
31
34
  },
32
35
  item: {
33
- ...y,
36
+ ...v,
34
37
  boxSizing: "border-box",
35
38
  display: "inline-flex",
36
39
  alignItems: "center",
@@ -76,7 +79,7 @@ const G = n.forwardRef(
76
79
  outlineColor: h
77
80
  },
78
81
  "&[data-checked][aria-invalid='true'], &[data-checked][data-invalid]": {
79
- backgroundColor: v,
82
+ backgroundColor: y,
80
83
  ...i.borderColor("transparent")
81
84
  }
82
85
  },
@@ -106,32 +109,32 @@ function N(a) {
106
109
  return o.length === 1 ? o[0] : void 0;
107
110
  }
108
111
  const F = n.forwardRef(
109
- function({ className: o, asChild: e, children: d, ...u }, c) {
110
- const s = C(), r = e ? N(d) : void 0;
112
+ function({ className: o, asChild: e, children: d, ...u }, s) {
113
+ const c = C(), r = e ? N(d) : void 0;
111
114
  return /* @__PURE__ */ t(
112
115
  j,
113
116
  {
114
- ref: c,
117
+ ref: s,
115
118
  "data-slot": "radio-group",
116
119
  [l]: "radio-group",
117
- className: b(s.group, o),
120
+ className: b(c.group, o),
118
121
  ...u,
119
122
  ...r ? { render: r } : { children: d }
120
123
  }
121
124
  );
122
125
  }
123
- ), L = /* @__PURE__ */ t("button", { type: "button" }), P = n.forwardRef(function({ className: o, children: e, asChild: d, checked: u, ...c }, s) {
126
+ ), L = /* @__PURE__ */ t("button", { type: "button" }), P = n.forwardRef(function({ className: o, children: e, asChild: d, checked: u, ...s }, c) {
124
127
  const r = C();
125
128
  return /* @__PURE__ */ x(
126
129
  p.Root,
127
130
  {
128
- ref: s,
131
+ ref: c,
129
132
  nativeButton: !0,
130
133
  render: L,
131
134
  "data-slot": "radio-group-item",
132
135
  [l]: "radio-group-item",
133
136
  className: b(r.item, o),
134
- ...c,
137
+ ...s,
135
138
  children: [
136
139
  /* @__PURE__ */ t(
137
140
  p.Indicator,
@@ -1 +1 @@
1
- {"version":3,"file":"radio.js","sources":["../../../src/components/radio/radio.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Radio } from \"@base-ui/react/radio\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport {\n RadioGroupBase,\n type RadioGroupBaseProps,\n type RadioGroupOrientation,\n} from \"./radio-group-base\"\n\nconst CircleIcon = React.forwardRef<SVGSVGElement, React.ComponentProps<\"svg\">>(\n function CircleIcon(props, ref) {\n return (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n </svg>\n )\n }\n)\n\nconst useStyles = makeZenithStyles({\n group: {\n display: \"grid\",\n ...shorthands.gap(tokens.spacingElement3),\n },\n item: {\n ...nativeControl,\n boxSizing: \"border-box\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n position: \"relative\",\n aspectRatio: \"1 / 1\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n borderRadius: \"9999px\",\n ...shorthands.border(\"1px\", \"solid\", tokens.accentA7),\n backgroundColor: tokens.accentSoft,\n color: tokens.accentOnSoft,\n // Tailwind `shadow-xs` — literal per CONVENTIONS B7\n boxShadow: \"0 1px 2px 0 #0000000d\",\n transitionProperty: \"color, box-shadow\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.focusRing,\n },\n \"&[data-disabled]\": {\n cursor: \"not-allowed\",\n backgroundColor: tokens.grayA3,\n ...shorthands.borderColor(\"transparent\"),\n },\n \"&[data-checked]\": {\n backgroundColor: tokens.accentSolid,\n color: tokens.accentContrast,\n },\n \"&[data-checked][data-disabled]\": {\n backgroundColor: tokens.grayA3,\n },\n \"&[aria-invalid='true'], &[data-invalid]\": {\n backgroundColor: tokens.errorSoft,\n ...shorthands.borderColor(tokens.errorA8),\n outlineColor: tokens.focusRing,\n },\n \"&[data-checked][aria-invalid='true'], &[data-checked][data-invalid]\": {\n backgroundColor: tokens.errorA10,\n ...shorthands.borderColor(\"transparent\"),\n },\n },\n indicator: {\n ...boxModel,\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n height: \"100%\",\n },\n icon: {\n ...boxModel,\n color: tokens.accentContrast,\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n width: \"0.5rem\",\n height: \"0.5rem\",\n transform: \"translate(-50%, -50%)\",\n pointerEvents: \"none\",\n },\n})\n\n/**\n * What `onValueChange` receives as its second argument: Base UI's change details, declared in\n * Zenith so that none of Base UI's internals reach the published declarations, where TypeScript 4\n * cannot parse them.\n */\nexport type RadioGroupChangeDetails = {\n /** Why the value changed. Base UI reports every radio group change as `none`. */\n reason: \"none\"\n /** The native event behind the change. */\n event: Event\n /** Keeps the group's current value. */\n cancel: () => void\n /** Lets the event propagate where the group would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n}\n\ntype RadioGroupRootProps = {\n /**\n * The controlled value of the radio item that should be currently selected.\n *\n * To render an uncontrolled radio group, use the `defaultValue` prop instead.\n */\n value?: string | null | undefined\n /** The value of the radio item that should be initially selected. */\n defaultValue?: string | undefined\n /** Event handler called when the value changes. */\n onValueChange?:\n ((value: string, eventDetails: RadioGroupChangeDetails) => void) | undefined\n /** Whether the component should ignore user interaction. */\n disabled?: boolean | undefined\n /** Whether the user must choose a value before submitting a form. */\n required?: boolean | undefined\n /** Identifies the field when a form is submitted. */\n name?: string | undefined\n /**\n * The axis the arrow keys move along. When set, only that axis' keys move between the options\n * (Up and Down for `vertical`) and it is restated as `aria-orientation`. Unset, all four work.\n */\n orientation?: RadioGroupOrientation | undefined\n /** The reading direction, which decides what Left and Right mean. */\n dir?: \"ltr\" | \"rtl\" | undefined\n /** Whether the arrow keys wrap from the last option to the first and back. Defaults to `true`. */\n loop?: boolean | undefined\n /** Renders the single child element as the group, merging the group's props and behaviour onto it. */\n asChild?: boolean | undefined\n}\n\nexport type RadioGroupProps = Omit<\n React.ComponentPropsWithRef<\"div\">,\n keyof RadioGroupRootProps\n> &\n RadioGroupRootProps\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime, which\n// Radix's Slot normalised.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup({ className, asChild, children, ...props }, ref) {\n const styles = useStyles()\n const child = asChild ? onlySlotChild(children) : undefined\n\n return (\n <RadioGroupBase\n ref={ref}\n data-slot=\"radio-group\"\n {...{ [SLOT_ATTR]: \"radio-group\" }}\n className={mergeClasses(styles.group, className)}\n // Base UI types the group's handlers for its <div>, which is the element rendered; the\n // caller's div-typed handlers receive exactly the events they declare.\n {...(props as RadioGroupBaseProps)}\n {...(child ? { render: child } : { children })}\n />\n )\n }\n)\n\ntype RadioGroupItemOwnProps = {\n /** The value this item submits and selects the group with. */\n value: string\n /** Whether the item should ignore user interaction. */\n disabled?: boolean | undefined\n /** Whether the user must choose this item before submitting a form. */\n required?: boolean | undefined\n /**\n * @deprecated Has no effect. The group decides which item is checked, as it did on Radix, which\n * ignored this prop.\n */\n checked?: boolean | undefined\n /**\n * @deprecated Has no effect. The indicator is the item's only child, so on Radix this rendered\n * the indicator as the item rather than an element of yours. Remove it.\n */\n asChild?: boolean | undefined\n}\n\n// `name` belongs to the group, which submits it, so it is not an item prop, as on Radix.\nexport type RadioGroupItemProps = Omit<\n React.ComponentPropsWithRef<\"button\">,\n keyof RadioGroupItemOwnProps | \"name\"\n> &\n RadioGroupItemOwnProps\n\n// Base UI renders a <span> by default and moves the caller's id onto its hidden input. A native\n// button keeps the id, the HTMLButtonElement ref, native disabled and <label for> as Radix had them.\nconst ITEM_ELEMENT = <button type=\"button\" />\n\nexport const RadioGroupItem = React.forwardRef<\n HTMLButtonElement,\n RadioGroupItemProps\n>(function RadioGroupItem(\n { className, children, asChild: _asChild, checked: _checked, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <Radio.Root\n ref={ref}\n nativeButton\n render={ITEM_ELEMENT}\n data-slot=\"radio-group-item\"\n {...{ [SLOT_ATTR]: \"radio-group-item\" }}\n className={mergeClasses(styles.item, className)}\n // Base UI types the item's handlers for its default <span>; the element is the button above.\n {...(props as Radio.Root.Props<string>)}\n >\n <Radio.Indicator\n data-slot=\"radio-group-indicator\"\n {...{ [SLOT_ATTR]: \"radio-group-indicator\" }}\n className={styles.indicator}\n >\n <CircleIcon className={styles.icon} />\n </Radio.Indicator>\n {children}\n </Radio.Root>\n )\n})\n"],"names":["CircleIcon","React","props","ref","jsx","useStyles","makeZenithStyles","shorthands","tokens.spacingElement3","nativeControl","tokens.accentA7","tokens.accentSoft","tokens.accentOnSoft","tokens.focusRing","tokens.grayA3","tokens.accentSolid","tokens.accentContrast","tokens.errorSoft","tokens.errorA8","tokens.errorA10","boxModel","onlySlotChild","children","elements","RadioGroup","className","asChild","styles","child","RadioGroupBase","SLOT_ATTR","mergeClasses","ITEM_ELEMENT","RadioGroupItem","_asChild","_checked","jsxs","Radio"],"mappings":";;;;;;;;AAcA,MAAMA,IAAaC,EAAM;AAAA,EACvB,SAAoBC,GAAOC,GAAK;AAC9B,WACE,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAD;AAAA,QACA,OAAM;AAAA,QACN,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,QAAO;AAAA,QACP,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,gBAAe;AAAA,QACd,GAAGD;AAAA,QAEJ,4BAAC,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,KAAA,CAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAGrC;AACF,GAEMG,IAAYC,EAAiB;AAAA,EACjC,OAAO;AAAA,IACL,SAAS;AAAA,IACT,GAAGC,EAAW,IAAIC,CAAsB;AAAA,EAAA;AAAA,EAE1C,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,W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AM;AAAA,UAAN;AAAA,YACC,aAAU;AAAA,YACJ,CAACP,CAAS,GAAG;AAAA,YACnB,WAAWH,EAAO;AAAA,YAElB,UAAA,gBAAAvB,EAACJ,GAAA,EAAW,WAAW2B,EAAO,KAAA,CAAM;AAAA,UAAA;AAAA,QAAA;AAAA,QAErCL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
1
+ {"version":3,"file":"radio.js","sources":["../../../src/components/radio/radio.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Radio } from \"@base-ui/react/radio\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\nimport {\n RadioGroupBase,\n type RadioGroupBaseProps,\n type RadioGroupOrientation,\n} from \"./radio-group-base\"\n\nconst CircleIcon = React.forwardRef<SVGSVGElement, React.ComponentProps<\"svg\">>(\n function CircleIcon(props, ref) {\n return (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n </svg>\n )\n }\n)\n\nconst useStyles = makeZenithStyles({\n group: {\n // A named group's radios each render a hidden input beside them, absolutely positioned with no\n // offsets: the group is their containing block, so they cannot escape an app's scroll box (#132).\n position: \"relative\",\n display: \"grid\",\n ...shorthands.gap(tokens.spacingElement3),\n },\n item: {\n ...nativeControl,\n boxSizing: \"border-box\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n position: \"relative\",\n aspectRatio: \"1 / 1\",\n width: \"1rem\",\n height: \"1rem\",\n flexShrink: 0,\n borderRadius: \"9999px\",\n ...shorthands.border(\"1px\", \"solid\", tokens.accentA7),\n backgroundColor: tokens.accentSoft,\n color: tokens.accentOnSoft,\n // Tailwind `shadow-xs` — literal per CONVENTIONS B7\n boxShadow: \"0 1px 2px 0 #0000000d\",\n transitionProperty: \"color, box-shadow\",\n transitionDuration: \"150ms\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineColor: tokens.focusRing,\n },\n \"&[data-disabled]\": {\n cursor: \"not-allowed\",\n backgroundColor: tokens.grayA3,\n ...shorthands.borderColor(\"transparent\"),\n },\n \"&[data-checked]\": {\n backgroundColor: tokens.accentSolid,\n color: tokens.accentContrast,\n },\n \"&[data-checked][data-disabled]\": {\n backgroundColor: tokens.grayA3,\n },\n \"&[aria-invalid='true'], &[data-invalid]\": {\n backgroundColor: tokens.errorSoft,\n ...shorthands.borderColor(tokens.errorA8),\n outlineColor: tokens.focusRing,\n },\n \"&[data-checked][aria-invalid='true'], &[data-checked][data-invalid]\": {\n backgroundColor: tokens.errorA10,\n ...shorthands.borderColor(\"transparent\"),\n },\n },\n indicator: {\n ...boxModel,\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n height: \"100%\",\n },\n icon: {\n ...boxModel,\n color: tokens.accentContrast,\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n width: \"0.5rem\",\n height: \"0.5rem\",\n transform: \"translate(-50%, -50%)\",\n pointerEvents: \"none\",\n },\n})\n\n/**\n * What `onValueChange` receives as its second argument: Base UI's change details, declared in\n * Zenith so that none of Base UI's internals reach the published declarations, where TypeScript 4\n * cannot parse them.\n */\nexport type RadioGroupChangeDetails = {\n /** Why the value changed. Base UI reports every radio group change as `none`. */\n reason: \"none\"\n /** The native event behind the change. */\n event: Event\n /** Keeps the group's current value. */\n cancel: () => void\n /** Lets the event propagate where the group would otherwise stop it. */\n allowPropagation: () => void\n isCanceled: boolean\n isPropagationAllowed: boolean\n /** The element that caused the change, if any. */\n trigger: Element | undefined\n}\n\ntype RadioGroupRootProps = {\n /**\n * The controlled value of the radio item that should be currently selected.\n *\n * To render an uncontrolled radio group, use the `defaultValue` prop instead.\n */\n value?: string | null | undefined\n /** The value of the radio item that should be initially selected. */\n defaultValue?: string | undefined\n /** Event handler called when the value changes. */\n onValueChange?:\n ((value: string, eventDetails: RadioGroupChangeDetails) => void) | undefined\n /** Whether the component should ignore user interaction. */\n disabled?: boolean | undefined\n /** Whether the user must choose a value before submitting a form. */\n required?: boolean | undefined\n /** Identifies the field when a form is submitted. */\n name?: string | undefined\n /**\n * The axis the arrow keys move along. When set, only that axis' keys move between the options\n * (Up and Down for `vertical`) and it is restated as `aria-orientation`. Unset, all four work.\n */\n orientation?: RadioGroupOrientation | undefined\n /** The reading direction, which decides what Left and Right mean. */\n dir?: \"ltr\" | \"rtl\" | undefined\n /** Whether the arrow keys wrap from the last option to the first and back. Defaults to `true`. */\n loop?: boolean | undefined\n /** Renders the single child element as the group, merging the group's props and behaviour onto it. */\n asChild?: boolean | undefined\n}\n\nexport type RadioGroupProps = Omit<\n React.ComponentPropsWithRef<\"div\">,\n keyof RadioGroupRootProps\n> &\n RadioGroupRootProps\n\n// A single child can arrive wrapped in a one-element array depending on the JSX runtime, which\n// Radix's Slot normalised.\nfunction onlySlotChild(children: React.ReactNode) {\n const elements = React.Children.toArray(children).filter(React.isValidElement)\n return elements.length === 1 ? elements[0] : undefined\n}\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup({ className, asChild, children, ...props }, ref) {\n const styles = useStyles()\n const child = asChild ? onlySlotChild(children) : undefined\n\n return (\n <RadioGroupBase\n ref={ref}\n data-slot=\"radio-group\"\n {...{ [SLOT_ATTR]: \"radio-group\" }}\n className={mergeClasses(styles.group, className)}\n // Base UI types the group's handlers for its <div>, which is the element rendered; the\n // caller's div-typed handlers receive exactly the events they declare.\n {...(props as RadioGroupBaseProps)}\n {...(child ? { render: child } : { children })}\n />\n )\n }\n)\n\ntype RadioGroupItemOwnProps = {\n /** The value this item submits and selects the group with. */\n value: string\n /** Whether the item should ignore user interaction. */\n disabled?: boolean | undefined\n /** Whether the user must choose this item before submitting a form. */\n required?: boolean | undefined\n /**\n * @deprecated Has no effect. The group decides which item is checked, as it did on Radix, which\n * ignored this prop.\n */\n checked?: boolean | undefined\n /**\n * @deprecated Has no effect. The indicator is the item's only child, so on Radix this rendered\n * the indicator as the item rather than an element of yours. Remove it.\n */\n asChild?: boolean | undefined\n}\n\n// `name` belongs to the group, which submits it, so it is not an item prop, as on Radix.\nexport type RadioGroupItemProps = Omit<\n React.ComponentPropsWithRef<\"button\">,\n keyof RadioGroupItemOwnProps | \"name\"\n> &\n RadioGroupItemOwnProps\n\n// Base UI renders a <span> by default and moves the caller's id onto its hidden input. A native\n// button keeps the id, the HTMLButtonElement ref, native disabled and <label for> as Radix had them.\nconst ITEM_ELEMENT = <button type=\"button\" />\n\nexport const RadioGroupItem = React.forwardRef<\n HTMLButtonElement,\n RadioGroupItemProps\n>(function RadioGroupItem(\n { className, children, asChild: _asChild, checked: _checked, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <Radio.Root\n ref={ref}\n nativeButton\n render={ITEM_ELEMENT}\n data-slot=\"radio-group-item\"\n {...{ [SLOT_ATTR]: \"radio-group-item\" }}\n className={mergeClasses(styles.item, className)}\n // Base UI types the item's handlers for its default <span>; the element is the button above.\n {...(props as Radio.Root.Props<string>)}\n >\n <Radio.Indicator\n data-slot=\"radio-group-indicator\"\n {...{ [SLOT_ATTR]: \"radio-group-indicator\" }}\n className={styles.indicator}\n >\n <CircleIcon className={styles.icon} />\n </Radio.Indicator>\n {children}\n </Radio.Root>\n )\n})\n"],"names":["CircleIcon","React","props","ref","jsx","useStyles","makeZenithStyles","shorthands","tokens.spacingElement3","nativeControl","tokens.accentA7","tokens.accentSoft","tokens.accentOnSoft","tokens.focusRing","tokens.grayA3","tokens.accentSolid","tokens.accentContrast","tokens.errorSoft","tokens.errorA8","tokens.errorA10","boxModel","onlySlotChild","children","elements","RadioGroup","className","asChild","styles","child","RadioGroupBase","SLOT_ATTR","mergeClasses","ITEM_ELEMENT","RadioGroupItem","_asChild","_checked","jsxs","Radio"],"mappings":";;;;;;;;AAcA,MAAMA,IAAaC,EAAM;AAAA,EACvB,SAAoBC,GAAOC,GAAK;AAC9B,WACE,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAD;AAAA,QACA,OAAM;AAAA,QACN,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,QAAO;AAAA,QACP,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,gBAAe;AAAA,QACd,GAAGD;AAAA,QAEJ,4BAAC,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,KAAA,CAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAGrC;AACF,GAEMG,IAAYC,EAAiB;AAAA,EACjC,OAAO;AAAA;AAAA;AAAA,IAGL,UAAU;AAAA,IACV,SAAS;AAAA,IACT,GAAGC,EAAW,IAAIC,CAAsB;AAAA,EAAA;AAAA,EAE1C,MAAM;AAAA,IACJ,GAAGC;AAAA,IACH,WAAW;AAAA,IACX,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,UAAU;AAAA,IACV,aAAa;AAAA,IACb,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,GAAGF,EAAW,OAAO,OAAO,SAASG,CAAe;AAAA,IACpD,iBAAiBC;AAAAA,IACjB,OAAOC;AAAAA;AAAAA,IAEP,WAAW;AAAA,IACX,oBAAoB;AAAA,IACpB,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,IAC1B,2CAA2C;AAAA,MACzC,oBAAoB;AAA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