@box-kite/react 2.2.15 → 2.2.16

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 (136) hide show
  1. package/.claude/rules/box-kite-rules.md +1 -1
  2. package/.claude/skills/box-kite/SKILL.md +1 -1
  3. package/.claude/skills/box-kite/references/styling.md +1 -1
  4. package/.cursor/rules/box-kite.mdc +1 -1
  5. package/AGENTS.md +1 -1
  6. package/BOX_AI_CONTEXT.md +16 -0
  7. package/BOX_KITE_AI_CONTEXT.md +16 -0
  8. package/behavior.cjs +1 -1
  9. package/behavior.mjs +16 -16
  10. package/catalog.cjs +1 -1
  11. package/catalog.mjs +1 -1
  12. package/client.cjs +1 -1
  13. package/client.mjs +10 -10
  14. package/components/accordion.cjs +1 -1
  15. package/components/accordion.mjs +95 -91
  16. package/components/calendar.cjs +1 -1
  17. package/components/calendar.mjs +212 -210
  18. package/components/chart.cjs +1 -1
  19. package/components/chart.d.ts +8 -3
  20. package/components/chart.mjs +70 -65
  21. package/components/combobox.cjs +1 -1
  22. package/components/combobox.mjs +187 -186
  23. package/components/dashboard.cjs +1 -1
  24. package/components/dashboard.d.ts +1 -44
  25. package/components/dashboard.mjs +202 -201
  26. package/components/dataGrid/components/dataGridListLayout.d.ts +1 -1
  27. package/components/dataGrid/contracts/dataGridContract.d.ts +1 -1
  28. package/components/dataGrid/models/gridModel.d.ts +1 -1
  29. package/components/dataGrid.cjs +2 -2
  30. package/components/dataGrid.mjs +10 -10
  31. package/components/dateField.cjs +1 -1
  32. package/components/dateField.mjs +96 -96
  33. package/components/datePicker.cjs +1 -1
  34. package/components/datePicker.mjs +177 -179
  35. package/components/dialog.cjs +1 -1
  36. package/components/dialog.d.ts +2 -64
  37. package/components/dialog.mjs +130 -126
  38. package/components/form.cjs +1 -1
  39. package/components/form.d.ts +4 -3
  40. package/components/form.mjs +25 -22
  41. package/components/menu.cjs +1 -1
  42. package/components/menu.d.ts +2 -73
  43. package/components/menu.mjs +222 -218
  44. package/components/overlay.cjs +1 -1
  45. package/components/overlay.mjs +43 -43
  46. package/components/popover.cjs +1 -1
  47. package/components/popover.d.ts +1 -41
  48. package/components/popover.mjs +55 -51
  49. package/components/radioGroup.cjs +1 -1
  50. package/components/radioGroup.mjs +59 -55
  51. package/components/slider.cjs +1 -1
  52. package/components/slider.d.ts +1 -55
  53. package/components/slider.mjs +92 -90
  54. package/components/sortableList.cjs +1 -1
  55. package/components/sortableList.mjs +149 -148
  56. package/components/swipeItem.cjs +1 -1
  57. package/components/swipeItem.mjs +100 -100
  58. package/components/tabs.cjs +1 -1
  59. package/components/tabs.mjs +135 -132
  60. package/components/toaster.cjs +1 -1
  61. package/components/toaster.d.ts +1 -37
  62. package/components/toaster.mjs +130 -128
  63. package/components/tooltip.cjs +1 -1
  64. package/components/tooltip.d.ts +1 -34
  65. package/components/tooltip.mjs +73 -69
  66. package/components/virtualList.cjs +1 -1
  67. package/components/virtualList.mjs +88 -87
  68. package/interactionListening.cjs +1 -1
  69. package/interactionListening.mjs +3 -3
  70. package/layer.cjs +1 -1
  71. package/layer.mjs +1 -1
  72. package/package.json +31 -30
  73. package/placement.cjs +1 -1
  74. package/placement.mjs +1 -1
  75. package/platform.cjs +1 -1
  76. package/platform.mjs +17 -14
  77. package/react/componentsContext.d.ts +1 -1
  78. package/react-shared.cjs +1 -1
  79. package/react-shared.mjs +1 -1
  80. package/scrolling.cjs +1 -1
  81. package/scrolling.mjs +1 -1
  82. package/utils/chart/chartUtils.d.ts +3 -2
  83. package/utils/dashboard/dashboardUtils.d.ts +1 -1
  84. package/utils/dom/domUtils.d.ts +6 -0
  85. package/create/src/agents.d.ts +0 -22
  86. package/create/src/agents.test.d.ts +0 -1
  87. package/create/src/index.d.ts +0 -1
  88. package/create/src/options.d.ts +0 -31
  89. package/create/src/options.test.d.ts +0 -1
  90. package/create/src/packageManager.d.ts +0 -5
  91. package/create/src/project.d.ts +0 -27
  92. package/create/src/project.test.d.ts +0 -1
  93. package/create/templates/ts/designs/azure.d.ts +0 -5
  94. package/create/templates/ts/designs/ember.d.ts +0 -5
  95. package/create/templates/ts/designs/mono.d.ts +0 -5
  96. package/create/templates/ts/src/App.d.ts +0 -2
  97. package/create/templates/ts/src/design.d.ts +0 -5
  98. package/create/templates/ts/src/main.d.ts +0 -0
  99. package/mcp/src/data.d.ts +0 -90
  100. package/mcp/src/data.test.d.ts +0 -1
  101. package/mcp/src/engine.d.ts +0 -23
  102. package/mcp/src/index.d.ts +0 -1
  103. package/mcp/src/search.d.ts +0 -38
  104. package/mcp/src/search.test.d.ts +0 -1
  105. package/mcp/src/server.d.ts +0 -18
  106. package/mcp/src/server.test.d.ts +0 -1
  107. package/mcp/src/styles.d.ts +0 -27
  108. package/mcp/src/styles.test.d.ts +0 -1
  109. package/mcp/src/tools.d.ts +0 -18
  110. package/mcp/src/vocabulary.d.ts +0 -41
  111. package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +0 -24
  112. package/registry/blocks/dashboard-shell/dashboard-stats.d.ts +0 -13
  113. package/registry/blocks/data-grid/invoice-rows.d.ts +0 -15
  114. package/registry/blocks/data-grid/invoices-grid.d.ts +0 -1
  115. package/registry/blocks/settings-form/settings-form.d.ts +0 -17
  116. package/registry/designs/store/address-form.d.ts +0 -11
  117. package/registry/designs/store/cart-items.d.ts +0 -10
  118. package/registry/designs/store/cart-page.d.ts +0 -4
  119. package/registry/designs/store/checkout-page.d.ts +0 -7
  120. package/registry/designs/store/credit-card-form.d.ts +0 -10
  121. package/registry/designs/store/form-field.d.ts +0 -19
  122. package/registry/designs/store/order-summary.d.ts +0 -18
  123. package/registry/designs/store/product-art.d.ts +0 -26
  124. package/registry/designs/store/product-card.d.ts +0 -11
  125. package/registry/designs/store/product-gallery.d.ts +0 -11
  126. package/registry/designs/store/product-grid.d.ts +0 -10
  127. package/registry/designs/store/product-page.d.ts +0 -5
  128. package/registry/designs/store/quantity-stepper.d.ts +0 -13
  129. package/registry/designs/store/shipping-method.d.ts +0 -14
  130. package/registry/designs/store/store-data.d.ts +0 -53
  131. package/registry/designs/store/store-design.d.ts +0 -63
  132. package/registry/designs/store/store-shell.d.ts +0 -12
  133. package/registry/designs/store/storefront-page.d.ts +0 -4
  134. package/registry/designs/store/variant-picker.d.ts +0 -15
  135. package/supabase/functions/collect/index.d.ts +0 -30
  136. package/supabase/functions/collect/index.test.d.ts +0 -1
@@ -1,53 +1,53 @@
1
1
  "use client";
2
- import { c as e, d as t, p as n } from "../platform.mjs";
3
- import { t as r } from "../client.mjs";
4
- import { n as i } from "../effects.mjs";
5
- import a from "../box.mjs";
6
- import { t as o } from "../placement.mjs";
7
- import { n as s } from "../layer.mjs";
8
- import { forwardRef as c, useCallback as l, useRef as u, useState as d } from "react";
9
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
10
- import { createPortal as h } from "react-dom";
2
+ import { c as e, f as t, l as n, m as r } from "../platform.mjs";
3
+ import { t as i } from "../client.mjs";
4
+ import { n as a } from "../effects.mjs";
5
+ import o from "../box.mjs";
6
+ import { t as s } from "../placement.mjs";
7
+ import { n as c } from "../layer.mjs";
8
+ import { forwardRef as l, useCallback as u, useRef as d, useState as f } from "react";
9
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
10
+ import { createPortal as g } from "react-dom";
11
11
  //#region src/components/overlay.tsx
12
- function g(c, g) {
13
- let { side: _ = "bottom", align: v = "center", offset: y = 0, flip: b = !0, onSideChange: x, anchor: S, contentRef: C, matchWidth: w = !0, ...T } = c, [E, D] = d(null), [O, k] = d(!1), A = u(null), j = s(), M = u(null), N = r(!j), P = o({
14
- side: _,
15
- align: v,
16
- offset: y,
17
- flip: b,
18
- matchWidth: w,
19
- anchor: S ?? E,
20
- trackSide: !!x
12
+ function _(l, _) {
13
+ let { side: v = "bottom", align: y = "center", offset: b = 0, flip: x = !0, onSideChange: S, anchor: C, contentRef: w, matchWidth: T = !0, ...E } = l, [D, O] = f(null), [k, A] = f(!1), j = d(null), M = c(), N = d(null), P = i(!M), F = s({
14
+ side: v,
15
+ align: y,
16
+ offset: b,
17
+ flip: x,
18
+ matchWidth: T,
19
+ anchor: C ?? D,
20
+ trackSide: !!S
21
21
  });
22
- i(() => {
23
- let t = M.current;
24
- !j || !e() || !t || !t.isConnected || t.matches(":popover-open") || t.showPopover();
25
- }), i(() => {
26
- if (j) return;
27
- let e = t(S) ?? E;
28
- k(!!e && n(e));
22
+ a(() => {
23
+ let t = N.current;
24
+ !M || !e() || !t || !t.isConnected || t.matches(":popover-open") || t.showPopover();
25
+ }), a(() => {
26
+ if (M) return;
27
+ let e = t(C) ?? D;
28
+ A(!!e && r(e));
29
29
  }, [
30
- S,
31
- E,
32
- j
33
- ]), i(() => {
34
- A.current !== P.side && (A.current = P.side, x?.(P.side));
30
+ C,
31
+ D,
32
+ M
33
+ ]), a(() => {
34
+ j.current !== F.side && (j.current = F.side, S?.(F.side));
35
35
  });
36
- let F = P.layerProps.ref, I = l((e) => {
37
- F?.(e), M.current = e, typeof g == "function" ? g(e) : g && (g.current = e);
38
- }, [F, g]), L = /* @__PURE__ */ p(a, {
39
- ...P.layerProps,
40
- ref: I,
36
+ let I = F.layerProps.ref, L = u((e) => {
37
+ I?.(e), N.current = e, n(_, e);
38
+ }, [I, _]), R = /* @__PURE__ */ m(o, {
39
+ ...F.layerProps,
40
+ ref: L,
41
41
  transition: "none",
42
- props: j ? { popover: "manual" } : { dir: O ? "rtl" : "ltr" },
43
- children: /* @__PURE__ */ p(a, {
44
- ref: C,
45
- ...T
42
+ props: M ? { popover: "manual" } : { dir: k ? "rtl" : "ltr" },
43
+ children: /* @__PURE__ */ m(o, {
44
+ ref: w,
45
+ ...E
46
46
  })
47
47
  });
48
- return /* @__PURE__ */ m(f, { children: [!S && /* @__PURE__ */ p(a, { ref: D }), j ? L : N && h(L, N)] });
48
+ return /* @__PURE__ */ h(p, { children: [!C && /* @__PURE__ */ m(o, { ref: O }), M ? R : P && g(R, P)] });
49
49
  }
50
- var _ = c(g);
51
- _.displayName = "Overlay";
50
+ var v = l(_);
51
+ v.displayName = "Overlay";
52
52
  //#endregion
53
- export { _ as default };
53
+ export { v as default };
@@ -1 +1 @@
1
- "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../box.cjs"),t=require("../behavior.cjs"),n=require("../placement.cjs"),r=require("../layer.cjs"),i=require("./overlay.cjs");let a=require("react/jsx-runtime");function o(o){let{trigger:s,children:c,open:l,defaultOpen:u=!1,onOpenChange:d,label:f,labelledBy:p,side:m=`bottom`,align:h=`center`,offset:g=2,flip:_=!0,matchWidth:v=!1,autoFocus:y=!0,props:b,...x}=o,S=t.a(e=>{!y||e.contains(document.activeElement)||e.focus()}),{platform:C,isOpen:w,id:T,trigger:E,triggerElement:D,setPanel:O}=r.t({haspopup:`dialog`,idPrefix:`popover`,id:x.id,interaction:{component:`popover`,type:`openChange`},open:l,defaultOpen:u,onOpenChange:d,onOpened:S}),k=n.t({side:m,align:h,offset:g,flip:_,matchWidth:v,anchor:D}),A={"aria-label":f,"aria-labelledby":p},j=x;return C?(0,a.jsxs)(a.Fragment,{children:[s(E),(0,a.jsx)(e.default,{ref:O,component:`popover`,...j,variant:[j.variant,{topLayer:!0}],...k.layerProps,id:T,props:{popover:`auto`,role:`dialog`,...A,tabIndex:-1,...b},children:c})]}):(0,a.jsxs)(a.Fragment,{children:[s(E),w&&(0,a.jsx)(i.default,{contentRef:O,anchor:D,side:m,align:h,offset:g,flip:_,matchWidth:v,component:`popover`,...j,id:T,props:{role:`dialog`,...A,tabIndex:-1,...b},children:c})]})}var s=o;s.displayName=`Popover`,exports.default=s;
1
+ "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../react-shared.cjs"),t=require("../platform.cjs"),n=require("../box.cjs"),r=require("../behavior.cjs"),i=require("../placement.cjs"),a=require("../layer.cjs"),o=require("./overlay.cjs");let s=require("react"),c=require("react/jsx-runtime");function l(e,l){let{trigger:u,children:d,open:f,defaultOpen:p=!1,onOpenChange:m,label:h,labelledBy:g,side:_=`bottom`,align:v=`center`,offset:y=2,flip:b=!0,matchWidth:x=!1,autoFocus:S=!0,props:C,...w}=e,T=r.a(e=>{!S||e.contains(document.activeElement)||e.focus()}),{platform:E,isOpen:D,id:O,trigger:k,triggerElement:A,setPanel:j}=a.t({haspopup:`dialog`,idPrefix:`popover`,id:w.id,interaction:{component:`popover`,type:`openChange`},open:f,defaultOpen:p,onOpenChange:m,onOpened:T}),M=i.t({side:_,align:v,offset:y,flip:b,matchWidth:x,anchor:A}),N=(0,s.useCallback)(e=>{j(e),t.l(l,e)},[j,l]),P={"aria-label":h,"aria-labelledby":g},F=w;return E?(0,c.jsxs)(c.Fragment,{children:[u(k),(0,c.jsx)(n.default,{ref:N,component:`popover`,...F,variant:[F.variant,{topLayer:!0}],...M.layerProps,id:O,props:{popover:`auto`,role:`dialog`,...P,tabIndex:-1,...C},children:d})]}):(0,c.jsxs)(c.Fragment,{children:[u(k),D&&(0,c.jsx)(o.default,{contentRef:N,anchor:A,side:_,align:v,offset:y,flip:b,matchWidth:x,component:`popover`,...F,id:O,props:{role:`dialog`,...P,tabIndex:-1,...C},children:d})]})}var u=e.f(l,`Popover`);exports.default=u;
@@ -56,45 +56,5 @@ interface Props<TKey extends keyof ComponentsAndVariants> extends PopoverBoxProp
56
56
  */
57
57
  autoFocus?: boolean;
58
58
  }
59
- /**
60
- * A panel anchored to a trigger, on the platform's own Popover API: the top layer, light dismiss and
61
- * focus return are the browser's, and the position is CSS anchor positioning.
62
- *
63
- * ```tsx
64
- * <Popover label="Filters" trigger={(t) => <Button {...t}>Filters</Button>}>
65
- * <Checkbox label="Only mine" />
66
- * </Popover>
67
- * ```
68
- *
69
- * **There is no portal.** A top-layer element paints above every stacking context and outside every
70
- * clipped ancestor, which is the whole class of bug a portal exists to work around — and because the
71
- * panel stays where it was declared in the DOM, it inherits the theme, the custom properties and the text
72
- * direction around it, and the tab order runs trigger → panel with nothing to arrange. (Measured against a
73
- * `z-index: 9999` sibling, a `transform`ed ancestor and an `overflow: hidden` one.)
74
- *
75
- * **The panel is always rendered**, and closed means `display: none` from the UA stylesheet. That is what
76
- * lets the browser own show and hide — and what makes the exit a plain CSS transition rather than a
77
- * `<Presence>`, since nothing unmounts. Content that is expensive to render should be gated by the
78
- * consumer: `{open && <Heavy />}`.
79
- *
80
- * **The panel keeps the side it chose when it opened.** Chrome re-evaluates `position-try-fallbacks` on
81
- * scroll for an ordinary positioned element and never for one in the top layer (measured in 152), so a
82
- * panel left open while the page scrolls does not flip when its side runs out of room. Every open picks
83
- * the right side; it is only a scroll *while* open that this affects. See `Overlay`, which shares it.
84
- *
85
- * Where the browser has no Popover API the panel is an `Overlay` — a portal — with `useDismiss` and
86
- * `useFocusReturn` supplying what the platform otherwise would.
87
- *
88
- * @a11y `role="dialog"` on the panel, named by `label` or `labelledBy`; the popover attribute supplies no
89
- * role at all, and a panel with none is announced as a group of orphaned content.
90
- * @a11y The trigger carries `aria-expanded`, `aria-haspopup="dialog"` and `aria-controls`, so the control
91
- * says what it operates and what state it is in.
92
- * @a11y Focus moves into the panel on open and back to the trigger on close. Nothing is trapped: this is a
93
- * non-modal dialog, so Tab leaves it, and the panel follows the trigger in the DOM either way.
94
- * @keyboard Enter, Space — On the trigger, toggles the panel.
95
- * @keyboard Escape — Closes it and returns focus to the trigger, from anywhere inside.
96
- * @keyboard Tab — Moves into the panel from the trigger, and out of the panel to whatever follows it.
97
- */
98
- declare function PopoverImpl<TKey extends keyof ComponentsAndVariants = 'popover'>(props: Props<TKey>): import("react").JSX.Element;
99
- declare const Popover: typeof PopoverImpl;
59
+ declare const Popover: <TKey extends keyof ComponentsAndVariants = "popover">(props: Props<TKey>) => React.ReactNode;
100
60
  export default Popover;
@@ -1,73 +1,77 @@
1
1
  "use client";
2
- import e from "../box.mjs";
3
- import { a as t } from "../behavior.mjs";
4
- import { t as n } from "../placement.mjs";
5
- import { t as r } from "../layer.mjs";
6
- import i from "./overlay.mjs";
7
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
2
+ import { f as e } from "../react-shared.mjs";
3
+ import { l as t } from "../platform.mjs";
4
+ import n from "../box.mjs";
5
+ import { a as r } from "../behavior.mjs";
6
+ import { t as i } from "../placement.mjs";
7
+ import { t as a } from "../layer.mjs";
8
+ import o from "./overlay.mjs";
9
+ import { useCallback as s } from "react";
10
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
8
11
  //#region src/components/popover.tsx
9
- function c(c) {
10
- let { trigger: l, children: u, open: d, defaultOpen: f = !1, onOpenChange: p, label: m, labelledBy: h, side: g = "bottom", align: _ = "center", offset: v = 2, flip: y = !0, matchWidth: b = !1, autoFocus: x = !0, props: S, ...C } = c, w = t((e) => {
11
- !x || e.contains(document.activeElement) || e.focus();
12
- }), { platform: T, isOpen: E, id: D, trigger: O, triggerElement: k, setPanel: A } = r({
12
+ function d(e, d) {
13
+ let { trigger: f, children: p, open: m, defaultOpen: h = !1, onOpenChange: g, label: _, labelledBy: v, side: y = "bottom", align: b = "center", offset: x = 2, flip: S = !0, matchWidth: C = !1, autoFocus: w = !0, props: T, ...E } = e, D = r((e) => {
14
+ !w || e.contains(document.activeElement) || e.focus();
15
+ }), { platform: O, isOpen: k, id: A, trigger: j, triggerElement: M, setPanel: N } = a({
13
16
  haspopup: "dialog",
14
17
  idPrefix: "popover",
15
- id: C.id,
18
+ id: E.id,
16
19
  interaction: {
17
20
  component: "popover",
18
21
  type: "openChange"
19
22
  },
20
- open: d,
21
- defaultOpen: f,
22
- onOpenChange: p,
23
- onOpened: w
24
- }), j = n({
25
- side: g,
26
- align: _,
27
- offset: v,
28
- flip: y,
29
- matchWidth: b,
30
- anchor: k
31
- }), M = {
32
- "aria-label": m,
33
- "aria-labelledby": h
34
- }, N = C;
35
- return T ? /* @__PURE__ */ s(a, { children: [l(O), /* @__PURE__ */ o(e, {
36
- ref: A,
23
+ open: m,
24
+ defaultOpen: h,
25
+ onOpenChange: g,
26
+ onOpened: D
27
+ }), P = i({
28
+ side: y,
29
+ align: b,
30
+ offset: x,
31
+ flip: S,
32
+ matchWidth: C,
33
+ anchor: M
34
+ }), F = s((e) => {
35
+ N(e), t(d, e);
36
+ }, [N, d]), I = {
37
+ "aria-label": _,
38
+ "aria-labelledby": v
39
+ }, L = E;
40
+ return O ? /* @__PURE__ */ u(c, { children: [f(j), /* @__PURE__ */ l(n, {
41
+ ref: F,
37
42
  component: "popover",
38
- ...N,
39
- variant: [N.variant, { topLayer: !0 }],
40
- ...j.layerProps,
41
- id: D,
43
+ ...L,
44
+ variant: [L.variant, { topLayer: !0 }],
45
+ ...P.layerProps,
46
+ id: A,
42
47
  props: {
43
48
  popover: "auto",
44
49
  role: "dialog",
45
- ...M,
50
+ ...I,
46
51
  tabIndex: -1,
47
- ...S
52
+ ...T
48
53
  },
49
- children: u
50
- })] }) : /* @__PURE__ */ s(a, { children: [l(O), E && /* @__PURE__ */ o(i, {
51
- contentRef: A,
52
- anchor: k,
53
- side: g,
54
- align: _,
55
- offset: v,
56
- flip: y,
57
- matchWidth: b,
54
+ children: p
55
+ })] }) : /* @__PURE__ */ u(c, { children: [f(j), k && /* @__PURE__ */ l(o, {
56
+ contentRef: F,
57
+ anchor: M,
58
+ side: y,
59
+ align: b,
60
+ offset: x,
61
+ flip: S,
62
+ matchWidth: C,
58
63
  component: "popover",
59
- ...N,
60
- id: D,
64
+ ...L,
65
+ id: A,
61
66
  props: {
62
67
  role: "dialog",
63
- ...M,
68
+ ...I,
64
69
  tabIndex: -1,
65
- ...S
70
+ ...T
66
71
  },
67
- children: u
72
+ children: p
68
73
  })] });
69
74
  }
70
- var l = c;
71
- l.displayName = "Popover";
75
+ var f = e(d, "Popover");
72
76
  //#endregion
73
- export { l as default };
77
+ export { f as default };
@@ -1 +1 @@
1
- "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../behavior.cjs"),t=require("../identity.cjs"),n=require("../reporting.cjs"),r=require("./flex.cjs"),i=require("./semantics.cjs"),a=require("./radioButton.cjs");let o=require("react"),s=require("react/jsx-runtime");var c=(0,o.createContext)(null);function l(e){return[...e?.querySelectorAll(`input[type="radio"]`)??[]].filter(e=>!e.disabled)}function u(e){return e===`ArrowDown`||e===`ArrowRight`?1:e===`ArrowUp`||e===`ArrowLeft`?-1:0}function d(a){let{label:d,name:f,value:p,defaultValue:m,onValueChange:h,onChange:g,orientation:_=`vertical`,children:v,props:y,...b}=a,x=t.t(`radiogroup`),S=(0,o.useRef)(null),C=(0,o.useRef)(`click`),w=e.a((e,t)=>{h?.(e,t),g?.(e,t)}),[T,E]=n.a({value:p,defaultValue:m,onChange:w,interaction:{component:`radioGroup`,type:`valueChange`}}),D=e.a(e=>{let t=u(e.key);if(t===0||e.defaultPrevented)return;let n=l(S.current),r=n.indexOf(document.activeElement);if(r===-1)return;e.preventDefault();let i=n[(r+t+n.length)%n.length];i!==n[r]&&(C.current=`keyboard`,i.focus(),i.click(),C.current=`click`)}),O=`${x}-label`,k=d!=null,A=(0,o.useMemo)(()=>({name:f??x,value:T,select:(e,t)=>E(e,{reason:C.current,event:t})}),[x,f,T,E]);return(0,s.jsx)(c.Provider,{value:A,children:(0,s.jsxs)(r.default,{ref:S,component:`radioGroup`,variant:{horizontal:_===`horizontal`},...b,props:{role:`radiogroup`,"aria-labelledby":k?O:void 0,...y,onKeyDown:D},children:[k&&(0,s.jsx)(i.Span,{component:`radioGroup.label`,id:O,children:d}),v]})})}function f(t){let n=(0,o.useContext)(c),{value:r,...i}=t,l=e.a(e=>n?.select(r,e));return n?(0,s.jsx)(a.default,{name:n.name,value:r,checked:n.value===r,onChange:l,...i}):(0,s.jsx)(a.default,{value:r,...i})}f.displayName=`RadioGroup.Item`;var p=d;p.Item=f,p.displayName=`RadioGroup`,exports.default=p;
1
+ "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../react-shared.cjs"),t=require("../platform.cjs"),n=require("../behavior.cjs"),r=require("../identity.cjs"),i=require("../reporting.cjs"),a=require("./flex.cjs"),o=require("./semantics.cjs"),s=require("./radioButton.cjs");let c=require("react"),l=require("react/jsx-runtime");var u=(0,c.createContext)(null);function d(e){return[...e?.querySelectorAll(`input[type="radio"]`)??[]].filter(e=>!e.disabled)}function f(e){return e===`ArrowDown`||e===`ArrowRight`?1:e===`ArrowUp`||e===`ArrowLeft`?-1:0}function p(e,s){let{label:p,name:m,value:h,defaultValue:g,onValueChange:_,onChange:v,orientation:y=`vertical`,children:b,props:x,...S}=e,C=r.t(`radiogroup`),w=(0,c.useRef)(null),T=(0,c.useCallback)(e=>{w.current=e,t.l(s,e)},[s]),E=(0,c.useRef)(`click`),D=n.a((e,t)=>{_?.(e,t),v?.(e,t)}),[O,k]=i.a({value:h,defaultValue:g,onChange:D,interaction:{component:`radioGroup`,type:`valueChange`}}),A=n.a(e=>{let t=f(e.key);if(t===0||e.defaultPrevented)return;let n=d(w.current),r=n.indexOf(document.activeElement);if(r===-1)return;e.preventDefault();let i=n[(r+t+n.length)%n.length];i!==n[r]&&(E.current=`keyboard`,i.focus(),i.click(),E.current=`click`)}),j=`${C}-label`,M=p!=null,N=(0,c.useMemo)(()=>({name:m??C,value:O,select:(e,t)=>k(e,{reason:E.current,event:t})}),[C,m,O,k]);return(0,l.jsx)(u.Provider,{value:N,children:(0,l.jsxs)(a.default,{ref:T,component:`radioGroup`,variant:{horizontal:y===`horizontal`},...S,props:{role:`radiogroup`,"aria-labelledby":M?j:void 0,...x,onKeyDown:A},children:[M&&(0,l.jsx)(o.Span,{component:`radioGroup.label`,id:j,children:p}),b]})})}function m(e){let t=(0,c.useContext)(u),{value:r,...i}=e,a=n.a(e=>t?.select(r,e));return t?(0,l.jsx)(s.default,{name:t.name,value:r,checked:t.value===r,onChange:a,...i}):(0,l.jsx)(s.default,{value:r,...i})}m.displayName=`RadioGroup.Item`;var h=e.f(p,`RadioGroup`);h.Item=m,h.displayName=`RadioGroup`,exports.default=h;
@@ -1,88 +1,92 @@
1
1
  "use client";
2
- import { a as e } from "../behavior.mjs";
3
- import { t } from "../identity.mjs";
4
- import { a as n } from "../reporting.mjs";
5
- import r from "./flex.mjs";
6
- import { Span as i } from "./semantics.mjs";
7
- import a from "./radioButton.mjs";
8
- import { createContext as o, useContext as s, useMemo as c, useRef as l } from "react";
9
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
2
+ import { f as e } from "../react-shared.mjs";
3
+ import { l as t } from "../platform.mjs";
4
+ import { a as n } from "../behavior.mjs";
5
+ import { t as r } from "../identity.mjs";
6
+ import { a as i } from "../reporting.mjs";
7
+ import a from "./flex.mjs";
8
+ import { Span as o } from "./semantics.mjs";
9
+ import s from "./radioButton.mjs";
10
+ import { createContext as c, useCallback as l, useContext as u, useMemo as d, useRef as f } from "react";
11
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
12
  //#region src/components/radioGroup.tsx
11
- var f = o(null);
12
- function p(e) {
13
+ var h = c(null);
14
+ function g(e) {
13
15
  return [...e?.querySelectorAll("input[type=\"radio\"]") ?? []].filter((e) => !e.disabled);
14
16
  }
15
- function m(e) {
17
+ function _(e) {
16
18
  return e === "ArrowDown" || e === "ArrowRight" ? 1 : e === "ArrowUp" || e === "ArrowLeft" ? -1 : 0;
17
19
  }
18
- function h(a) {
19
- let { label: o, name: s, value: h, defaultValue: g, onValueChange: _, onChange: v, orientation: y = "vertical", children: b, props: x, ...S } = a, C = t("radiogroup"), w = l(null), T = l("click"), E = e((e, t) => {
20
- _?.(e, t), v?.(e, t);
21
- }), [D, O] = n({
22
- value: h,
23
- defaultValue: g,
24
- onChange: E,
20
+ function v(e, s) {
21
+ let { label: c, name: u, value: v, defaultValue: y, onValueChange: b, onChange: x, orientation: S = "vertical", children: C, props: w, ...T } = e, E = r("radiogroup"), D = f(null), O = l((e) => {
22
+ D.current = e, t(s, e);
23
+ }, [s]), k = f("click"), A = n((e, t) => {
24
+ b?.(e, t), x?.(e, t);
25
+ }), [j, M] = i({
26
+ value: v,
27
+ defaultValue: y,
28
+ onChange: A,
25
29
  interaction: {
26
30
  component: "radioGroup",
27
31
  type: "valueChange"
28
32
  }
29
- }), k = e((e) => {
30
- let t = m(e.key);
33
+ }), N = n((e) => {
34
+ let t = _(e.key);
31
35
  if (t === 0 || e.defaultPrevented) return;
32
- let n = p(w.current), r = n.indexOf(document.activeElement);
36
+ let n = g(D.current), r = n.indexOf(document.activeElement);
33
37
  if (r === -1) return;
34
38
  e.preventDefault();
35
39
  let i = n[(r + t + n.length) % n.length];
36
- i !== n[r] && (T.current = "keyboard", i.focus(), i.click(), T.current = "click");
37
- }), A = `${C}-label`, j = o != null, M = c(() => ({
38
- name: s ?? C,
39
- value: D,
40
- select: (e, t) => O(e, {
41
- reason: T.current,
40
+ i !== n[r] && (k.current = "keyboard", i.focus(), i.click(), k.current = "click");
41
+ }), P = `${E}-label`, F = c != null, I = d(() => ({
42
+ name: u ?? E,
43
+ value: j,
44
+ select: (e, t) => M(e, {
45
+ reason: k.current,
42
46
  event: t
43
47
  })
44
48
  }), [
45
- C,
46
- s,
47
- D,
48
- O
49
+ E,
50
+ u,
51
+ j,
52
+ M
49
53
  ]);
50
- return /* @__PURE__ */ u(f.Provider, {
51
- value: M,
52
- children: /* @__PURE__ */ d(r, {
53
- ref: w,
54
+ return /* @__PURE__ */ p(h.Provider, {
55
+ value: I,
56
+ children: /* @__PURE__ */ m(a, {
57
+ ref: O,
54
58
  component: "radioGroup",
55
- variant: { horizontal: y === "horizontal" },
56
- ...S,
59
+ variant: { horizontal: S === "horizontal" },
60
+ ...T,
57
61
  props: {
58
62
  role: "radiogroup",
59
- "aria-labelledby": j ? A : void 0,
60
- ...x,
61
- onKeyDown: k
63
+ "aria-labelledby": F ? P : void 0,
64
+ ...w,
65
+ onKeyDown: N
62
66
  },
63
- children: [j && /* @__PURE__ */ u(i, {
67
+ children: [F && /* @__PURE__ */ p(o, {
64
68
  component: "radioGroup.label",
65
- id: A,
66
- children: o
67
- }), b]
69
+ id: P,
70
+ children: c
71
+ }), C]
68
72
  })
69
73
  });
70
74
  }
71
- function g(t) {
72
- let n = s(f), { value: r, ...i } = t, o = e((e) => n?.select(r, e));
73
- return n ? /* @__PURE__ */ u(a, {
74
- name: n.name,
75
+ function y(e) {
76
+ let t = u(h), { value: r, ...i } = e, a = n((e) => t?.select(r, e));
77
+ return t ? /* @__PURE__ */ p(s, {
78
+ name: t.name,
75
79
  value: r,
76
- checked: n.value === r,
77
- onChange: o,
80
+ checked: t.value === r,
81
+ onChange: a,
78
82
  ...i
79
- }) : /* @__PURE__ */ u(a, {
83
+ }) : /* @__PURE__ */ p(s, {
80
84
  value: r,
81
85
  ...i
82
86
  });
83
87
  }
84
- g.displayName = "RadioGroup.Item";
85
- var _ = h;
86
- _.Item = g, _.displayName = "RadioGroup";
88
+ y.displayName = "RadioGroup.Item";
89
+ var b = e(v, "RadioGroup");
90
+ b.Item = y, b.displayName = "RadioGroup";
87
91
  //#endregion
88
- export { _ as default };
92
+ export { b as default };
@@ -1 +1 @@
1
- "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../platform.cjs"),t=require("../box.cjs"),n=require("../behavior.cjs"),r=require("../reporting.cjs");let i=require("react"),a=require("react/jsx-runtime");var o;(function(e){function t(e){let t=String(Math.abs(e));if(t.includes(`e`))return 12;let n=t.indexOf(`.`);return n===-1?0:t.length-n-1}e.decimals=t;function n(e,t){return Number(e.toFixed(Math.min(t,15)))}function r(e,t,n){return Math.min(Math.max(e,t),n)}e.clamp=r;function i(e,i){let{min:a,max:o,step:s}=i,c=r(e,a,o);return s>0?r(n(a+Math.round((c-a)/s)*s,t(s)+t(a)),a,o):c}e.snap=i;function a(e,t,n){return n<=t?0:(r(e,t,n)-t)*(100/(n-t))}e.percent=a;function o(e,t,n){return`${Math.round(a(e,t,n)*100)/100}%`}e.percentage=o;function s(e){return typeof e==`number`?[e]:[...e]}e.thumbs=s;function c(e,t){return typeof e==`number`?t[0]:[...t]}e.shaped=c;function l(e,t,n,a){let o=t>0?e[t-1]:a.min,s=t<e.length-1?e[t+1]:a.max,c=[...e];return c[t]=r(i(n,a),o,s),c}e.move=l;function u(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}e.same=u;function d(e,t){let n=0,r=1/0;return e.forEach((e,i)=>{let a=Math.abs(e-t);a<=r&&(n=i,r=a)}),n}e.nearest=d;function f(e,t,n,r,i){let a=r===`vertical`?e.height===0?0:(e.bottom-n)/e.height:e.width===0?0:i?(e.right-t)/e.width:(t-e.left)/e.width;return Math.min(Math.max(a,0),1)}e.valueAt=f;function p(e,t=!1){if(e===`Home`)return{kind:`edge`,delta:-1};if(e===`End`)return{kind:`edge`,delta:1};if(e===`PageUp`)return{kind:`page`,delta:1};if(e===`PageDown`)return{kind:`page`,delta:-1};if(e===`ArrowUp`)return{kind:`step`,delta:1};if(e===`ArrowDown`)return{kind:`step`,delta:-1};if(e===`ArrowRight`)return{kind:`step`,delta:t?-1:1};if(e===`ArrowLeft`)return{kind:`step`,delta:t?1:-1}}e.moveFor=p;function m(e,t,n,r){if(t.kind===`edge`)return t.delta>0?n.max:n.min;let i=t.kind===`page`?r:n.step;return e+t.delta*i}e.moved=m})(o||={});var s=o,c=`data-index`;function l(e,t,n){return{min:e,max:t,step:n}}function u(e,t){return t?{insetBlockEnd:e}:{insetInlineStart:e}}function d(e,t,n){let r=e.length>1?Math.min(...e):t.min,i=Math.max(...e),a=s.percent(r,t.min,t.max),o=`${Math.round((s.percent(i,t.min,t.max)-a)*100)/100}%`;return n?{insetBlockEnd:`${Math.round(a*100)/100}%`,blockSize:o}:{insetInlineStart:`${Math.round(a*100)/100}%`,inlineSize:o}}function f(o){let{value:f,defaultValue:p,onValueChange:m,onValueCommit:h,min:g=0,max:_=100,step:v=1,largeStep:y=v*10,orientation:b=`horizontal`,disabled:x=!1,label:S,labelledBy:C,thumbLabels:w,format:T,name:E,props:D,...O}=o,k=(0,i.useRef)(null),A=(0,i.useRef)(null),j=(0,i.useRef)(null),M=(0,i.useRef)(!1),[N,P]=(0,i.useState)(!1),[F,I]=n.i({value:f,defaultValue:p??g,onChange:m}),L=l(g,_,v),R=b===`vertical`,z=s.thumbs(F),B=n.o(F),V=r.r(h,`slider`,`valueCommit`),H=n.a((e,t)=>{I(t=>s.same(s.thumbs(t),e)?t:s.shaped(t,e),t)}),U=t=>{let n=A.current;if(!n)return;let r=s.valueAt(n.getBoundingClientRect(),t.clientX,t.clientY,b,e.p(n));return g+r*(_-g)},W=e=>k.current?.querySelectorAll(`[role="slider"]`)[e],G=n.a(e=>{if(x||e.button!==0||e.defaultPrevented)return;let t=U(e);if(t===void 0)return;let n=s.thumbs(B.current),r=s.nearest(n,t);j.current=r,e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),W(r)?.focus(),H(s.move(n,r,t,L),{reason:`pointer`,event:e})}),K=n.a(e=>{let t=j.current;if(t===null)return;let n=U(e);n!==void 0&&(P(!0),H(s.move(s.thumbs(B.current),t,n,L),{reason:`pointer`,event:e}))}),q=n.a(e=>{j.current!==null&&(j.current=null,P(!1),e.currentTarget.releasePointerCapture?.(e.pointerId),V(B.current,{reason:`pointer`,event:e}))}),J=n.a(t=>{if(x||t.defaultPrevented)return;let n=t.target?.closest(`[role="slider"]`),r=Number(n?.getAttribute(c)??-1);if(!n||r<0)return;let i=s.moveFor(t.key,e.p(n));if(!i)return;t.preventDefault(),M.current=!0,P(!0);let a=s.thumbs(B.current);H(s.move(a,r,s.moved(a[r],i,L,y),L),{reason:`keyboard`,event:t})}),Y=n.a(e=>{M.current&&(M.current=!1,P(!1),V(B.current,{reason:`keyboard`,event:e}))}),X=z.length>1;return(0,a.jsxs)(t.default,{ref:k,component:`slider`,...O,variant:[O.variant,{vertical:R,disabled:x}],props:{role:X?`group`:void 0,"aria-label":X?S:void 0,"aria-labelledby":X?C:void 0,...D,onPointerDown:G,onPointerMove:K,onPointerUp:q,onPointerCancel:q,onKeyDown:J,onKeyUp:Y},children:[(0,a.jsx)(t.default,{ref:A,component:`slider.track`,variant:{vertical:R},children:(0,a.jsx)(t.default,{component:`slider.fill`,variant:{vertical:R,tracking:N},style:d(z,L,R)})}),z.map((e,n)=>(0,a.jsx)(t.default,{component:`slider.thumb`,variant:{vertical:R,disabled:x,tracking:N},style:u(s.percentage(e,g,_),R),props:{role:`slider`,tabIndex:x?-1:0,"aria-valuemin":g,"aria-valuemax":_,"aria-valuenow":e,"aria-valuetext":T?.(e),"aria-orientation":b,"aria-label":w?.[n]??(X?void 0:S),"aria-labelledby":w?.[n]||X?void 0:C,"aria-disabled":x||void 0,[c]:n}},n)),E!==void 0&&z.map((e,t)=>(0,a.jsx)(`input`,{type:`hidden`,name:E,value:e,readOnly:!0},t))]})}var p=f;p.displayName=`Slider`,exports.default=p;
1
+ "use client";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../react-shared.cjs"),t=require("../platform.cjs"),n=require("../box.cjs"),r=require("../behavior.cjs"),i=require("../reporting.cjs");let a=require("react"),o=require("react/jsx-runtime");var s;(function(e){function t(e){let t=String(Math.abs(e));if(t.includes(`e`))return 12;let n=t.indexOf(`.`);return n===-1?0:t.length-n-1}e.decimals=t;function n(e,t){return Number(e.toFixed(Math.min(t,15)))}function r(e,t,n){return Math.min(Math.max(e,t),n)}e.clamp=r;function i(e,i){let{min:a,max:o,step:s}=i,c=r(e,a,o);return s>0?r(n(a+Math.round((c-a)/s)*s,t(s)+t(a)),a,o):c}e.snap=i;function a(e,t,n){return n<=t?0:(r(e,t,n)-t)*(100/(n-t))}e.percent=a;function o(e,t,n){return`${Math.round(a(e,t,n)*100)/100}%`}e.percentage=o;function s(e){return typeof e==`number`?[e]:[...e]}e.thumbs=s;function c(e,t){return typeof e==`number`?t[0]:[...t]}e.shaped=c;function l(e,t,n,a){let o=t>0?e[t-1]:a.min,s=t<e.length-1?e[t+1]:a.max,c=[...e];return c[t]=r(i(n,a),o,s),c}e.move=l;function u(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}e.same=u;function d(e,t){let n=0,r=1/0;return e.forEach((e,i)=>{let a=Math.abs(e-t);a<=r&&(n=i,r=a)}),n}e.nearest=d;function f(e,t,n,r,i){let a=r===`vertical`?e.height===0?0:(e.bottom-n)/e.height:e.width===0?0:i?(e.right-t)/e.width:(t-e.left)/e.width;return Math.min(Math.max(a,0),1)}e.valueAt=f;function p(e,t=!1){if(e===`Home`)return{kind:`edge`,delta:-1};if(e===`End`)return{kind:`edge`,delta:1};if(e===`PageUp`)return{kind:`page`,delta:1};if(e===`PageDown`)return{kind:`page`,delta:-1};if(e===`ArrowUp`)return{kind:`step`,delta:1};if(e===`ArrowDown`)return{kind:`step`,delta:-1};if(e===`ArrowRight`)return{kind:`step`,delta:t?-1:1};if(e===`ArrowLeft`)return{kind:`step`,delta:t?1:-1}}e.moveFor=p;function m(e,t,n,r){if(t.kind===`edge`)return t.delta>0?n.max:n.min;let i=t.kind===`page`?r:n.step;return e+t.delta*i}e.moved=m})(s||={});var c=s,l=`data-index`;function u(e,t,n){return{min:e,max:t,step:n}}function d(e,t){return t?{insetBlockEnd:e}:{insetInlineStart:e}}function f(e,t,n){let r=e.length>1?Math.min(...e):t.min,i=Math.max(...e),a=c.percent(r,t.min,t.max),o=`${Math.round((c.percent(i,t.min,t.max)-a)*100)/100}%`;return n?{insetBlockEnd:`${Math.round(a*100)/100}%`,blockSize:o}:{insetInlineStart:`${Math.round(a*100)/100}%`,inlineSize:o}}function p(e,s){let{value:p,defaultValue:m,onValueChange:h,onValueCommit:g,min:_=0,max:v=100,step:y=1,largeStep:b=y*10,orientation:x=`horizontal`,disabled:S=!1,label:C,labelledBy:w,thumbLabels:T,format:E,name:D,props:O,...k}=e,A=(0,a.useRef)(null),j=(0,a.useCallback)(e=>{A.current=e,t.l(s,e)},[s]),M=(0,a.useRef)(null),N=(0,a.useRef)(null),P=(0,a.useRef)(!1),[F,I]=(0,a.useState)(!1),[L,R]=r.i({value:p,defaultValue:m??_,onChange:h}),z=u(_,v,y),B=x===`vertical`,V=c.thumbs(L),H=r.o(L),U=i.r(g,`slider`,`valueCommit`),W=r.a((e,t)=>{R(t=>c.same(c.thumbs(t),e)?t:c.shaped(t,e),t)}),G=e=>{let n=M.current;if(!n)return;let r=c.valueAt(n.getBoundingClientRect(),e.clientX,e.clientY,x,t.m(n));return _+r*(v-_)},K=e=>A.current?.querySelectorAll(`[role="slider"]`)[e],q=r.a(e=>{if(S||e.button!==0||e.defaultPrevented)return;let t=G(e);if(t===void 0)return;let n=c.thumbs(H.current),r=c.nearest(n,t);N.current=r,e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),K(r)?.focus(),W(c.move(n,r,t,z),{reason:`pointer`,event:e})}),J=r.a(e=>{let t=N.current;if(t===null)return;let n=G(e);n!==void 0&&(I(!0),W(c.move(c.thumbs(H.current),t,n,z),{reason:`pointer`,event:e}))}),Y=r.a(e=>{N.current!==null&&(N.current=null,I(!1),e.currentTarget.releasePointerCapture?.(e.pointerId),U(H.current,{reason:`pointer`,event:e}))}),X=r.a(e=>{if(S||e.defaultPrevented)return;let n=e.target?.closest(`[role="slider"]`),r=Number(n?.getAttribute(l)??-1);if(!n||r<0)return;let i=c.moveFor(e.key,t.m(n));if(!i)return;e.preventDefault(),P.current=!0,I(!0);let a=c.thumbs(H.current);W(c.move(a,r,c.moved(a[r],i,z,b),z),{reason:`keyboard`,event:e})}),Z=r.a(e=>{P.current&&(P.current=!1,I(!1),U(H.current,{reason:`keyboard`,event:e}))}),Q=V.length>1;return(0,o.jsxs)(n.default,{ref:j,component:`slider`,...k,variant:[k.variant,{vertical:B,disabled:S}],props:{role:Q?`group`:void 0,"aria-label":Q?C:void 0,"aria-labelledby":Q?w:void 0,...O,onPointerDown:q,onPointerMove:J,onPointerUp:Y,onPointerCancel:Y,onKeyDown:X,onKeyUp:Z},children:[(0,o.jsx)(n.default,{ref:M,component:`slider.track`,variant:{vertical:B},children:(0,o.jsx)(n.default,{component:`slider.fill`,variant:{vertical:B,tracking:F},style:f(V,z,B)})}),V.map((e,t)=>(0,o.jsx)(n.default,{component:`slider.thumb`,variant:{vertical:B,disabled:S,tracking:F},style:d(c.percentage(e,_,v),B),props:{role:`slider`,tabIndex:S?-1:0,"aria-valuemin":_,"aria-valuemax":v,"aria-valuenow":e,"aria-valuetext":E?.(e),"aria-orientation":x,"aria-label":T?.[t]??(Q?void 0:C),"aria-labelledby":T?.[t]||Q?void 0:w,"aria-disabled":S||void 0,[l]:t}},t)),D!==void 0&&V.map((e,t)=>(0,o.jsx)(`input`,{type:`hidden`,name:D,value:e,readOnly:!0},t))]})}var m=e.f(p,`Slider`);exports.default=m;
@@ -40,59 +40,5 @@ export interface SliderProps<TKey extends keyof ComponentsAndVariants = 'slider'
40
40
  /** What the value submits under. One hidden input per thumb, so a range posts two values of that name. */
41
41
  name?: string;
42
42
  }
43
- /**
44
- * A value chosen by dragging a thumb along a track.
45
- * Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/slider/ and .../slider-multithumb/
46
- *
47
- * ```tsx
48
- * <Slider label="Volume" defaultValue={40} onValueChange={(value) => setVolume(value)} />
49
- * <Slider label="Price" defaultValue={[20, 80]} thumbLabels={['Lowest', 'Highest']} />
50
- * ```
51
- *
52
- * **A number in is a number out.** `defaultValue={40}` makes a one-thumb slider whose `onValueChange`
53
- * hands back a `number`; `defaultValue={[20, 80]}` makes a range whose handler takes a `number[]`. The
54
- * number of thumbs is the value's own shape, so there is no second prop saying which kind this is.
55
- *
56
- * **This is not `<input type="range">`, and that is the one place the platform loses.** A range input
57
- * cannot hold two thumbs, and its track and thumb are vendor pseudo-elements (`::-webkit-slider-thumb`)
58
- * that no typed prop can reach — so a styled one is a rewrite of the parts, at which point the native
59
- * element is only the keyboard. `name` still submits: a hidden input per thumb, so a form posts the
60
- * value whether or not JavaScript ran the drag.
61
- *
62
- * **The position is an inline style, deliberately.** Everything a slider paints is a shared class except
63
- * where its thumbs are — that is a per-frame value, and a class for it would be a rule per frame of a
64
- * drag, never freed. It is the exception `useAnchorPosition`'s anchor name and the travelling tab
65
- * indicator already take, and the reason a `ProgressRing` can round its fraction into a class where this
66
- * cannot: nobody drags a ring.
67
- *
68
- * **It mirrors for free.** The fill and the thumbs are placed with `inset-inline-start`, so a
69
- * right-to-left page draws the minimum on the right with no second stylesheet. The half that is not free
70
- * is the keyboard, which is why the sideways arrows swap and Up and Down never do.
71
- *
72
- * **A press travels; a nudge does not.** A press on the track is the one move the eye has to follow, so
73
- * the thumb animates the whole way. Every other move — a drag, an arrow key, a held arrow — is the
74
- * `tracking` variant instead: 60ms `ease-out` on both the thumb and the fill, which must both carry it
75
- * or they come apart (#144). Short rather than *off*, because off is exact and steps — a 1-in-100 slider
76
- * moves 3.2px at a time on a 320px track. **Eased out rather than linear or eased**: a repeat restarts
77
- * the transition every 33ms, so only its first half is ever seen, and on this curve that half is the
78
- * straight part — it glides while the key is held and still decelerates on the last transition, the one
79
- * allowed to finish. Measured against linear, which rode **1.4 steps** behind the value and stopped at
80
- * full speed, this rides 0.9 behind and lands at 0.6 of cruising (#146).
81
- *
82
- * @pattern https://www.w3.org/WAI/ARIA/apg/patterns/slider/
83
- * @a11y Each thumb is a `role="slider"` carrying `aria-valuemin`, `aria-valuemax`, `aria-valuenow` and
84
- * `aria-orientation`; `format` writes `aria-valuetext` for a value a bare number does not read as.
85
- * @a11y A thumb has to be named, so `label` names the one on a single slider — and on a range it names
86
- * the `role="group"` around the thumbs, where `thumbLabels` names them one at a time.
87
- * @a11y `disabled` is `aria-disabled` rather than the attribute: a slider a reader cannot reach is a
88
- * value they cannot read, and a div takes no `disabled` anyway.
89
- * @keyboard Tab — Every thumb is its own tab stop, so a range is two of them.
90
- * @keyboard Right / Up — One step towards the maximum. In a right-to-left page Left is the increase, and
91
- * Up never changes: the block axis has no reading order.
92
- * @keyboard Left / Down — One step towards the minimum.
93
- * @keyboard PageUp / PageDown — `largeStep`, ten steps unless it says otherwise.
94
- * @keyboard Home / End — The minimum and the maximum themselves, on or off the step grid.
95
- */
96
- declare function SliderImpl<TKey extends keyof ComponentsAndVariants = 'slider', TValue extends SliderValue = number>(props: SliderProps<TKey, TValue>): import("react").JSX.Element;
97
- declare const Slider: typeof SliderImpl;
43
+ declare const Slider: <TKey extends keyof ComponentsAndVariants = "slider", TValue extends SliderValue = number>(props: SliderProps<TKey, TValue>) => React.ReactNode;
98
44
  export default Slider;