@kanso-labs/kanso-ui 0.40.6 → 0.40.8

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 (46) hide show
  1. package/dist/badge/index.js +15 -0
  2. package/dist/badge/index.js.map +1 -0
  3. package/dist/components/badge/index.js +91 -47
  4. package/dist/components/badge/index.js.map +1 -1
  5. package/dist/components/dialog/index.d.ts +6 -1
  6. package/dist/components/dialog/index.js +67 -37
  7. package/dist/components/dialog/index.js.map +1 -1
  8. package/dist/components/form/index.d.ts +5 -4
  9. package/dist/components/form/index.js.map +1 -1
  10. package/dist/components/link/index.js +16 -5
  11. package/dist/components/link/index.js.map +1 -1
  12. package/dist/components/menu/index.js +29 -21
  13. package/dist/components/menu/index.js.map +1 -1
  14. package/dist/components/navigation-bar/index.js +134 -54
  15. package/dist/components/navigation-bar/index.js.map +1 -1
  16. package/dist/components/navigation-rail/index.js +56 -37
  17. package/dist/components/navigation-rail/index.js.map +1 -1
  18. package/dist/components/navigation-tree/index.js +10 -10
  19. package/dist/components/number-field/index.d.ts +13 -2
  20. package/dist/components/number-field/index.js +95 -84
  21. package/dist/components/number-field/index.js.map +1 -1
  22. package/dist/components/radio-group/index.js +10 -10
  23. package/dist/components/sheet/index.d.ts +8 -1
  24. package/dist/components/sheet/index.js +33 -17
  25. package/dist/components/sheet/index.js.map +1 -1
  26. package/dist/components/snackbar/index.d.ts +4 -0
  27. package/dist/components/snackbar/index.js +54 -49
  28. package/dist/components/snackbar/index.js.map +1 -1
  29. package/dist/components/tree/index.js +6 -6
  30. package/dist/field/index.js +303 -252
  31. package/dist/field/index.js.map +1 -1
  32. package/dist/field/root.js +8 -8
  33. package/dist/field/root.js.map +1 -1
  34. package/dist/field/styles.js +22 -0
  35. package/dist/field/styles.js.map +1 -1
  36. package/dist/hooks/useBottomEdge.js +83 -0
  37. package/dist/hooks/useBottomEdge.js.map +1 -0
  38. package/dist/navigation/context.js.map +1 -1
  39. package/dist/navigation/index.js +16 -4
  40. package/dist/navigation/index.js.map +1 -1
  41. package/dist/navigation/styles.js +35 -1
  42. package/dist/navigation/styles.js.map +1 -1
  43. package/dist/row/styles.js +2 -1
  44. package/dist/row/styles.js.map +1 -1
  45. package/dist/styles.css +90 -24
  46. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","RefAttributes","stylex","useMemo","NavigationItemProps","RenderComponentProps","NavigationItem","NavigationContext","useRender","mergeStyles","colors","media","spacing","NavigationBarProps","selectedRoute","NavigationBar","t0","$","context","render","t1","t2","t3","t4","t5","props","t6","form","const","className","defaultTagName","bar","t7","NavigationBarItem","Item","NavigationBarItemProps","_c"],"sources":["../../../src/components/navigation-bar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation bar page's flexible bar: three to five destinations across\n// the bottom of a compact window, on the surface container, 64dp tall. Below\n// the medium breakpoint each destination is vertical and the destinations\n// share the bar's width equally; at it and above, each is the page's\n// horizontal pill, as wide as what it holds, and the group sits centred with\n// the spare width at the bar's ends. The destinations are `src/navigation`'s,\n// shared with NavigationRail, which holds the two forms' values.\n//\n// The 8dp between two horizontal pills is the library's own. The page puts\n// each pill in an item of a fixed width it does not give, and with no space\n// at all the pills met edge to edge.\n//\n// The bar is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\ntype NavigationBarProps = RenderComponentProps<'nav'> & {\n /**\n * The route of the current destination, matched against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator.\n */\n selectedRoute?: string;\n};\n\n/**\n * The bar of three to five top-level destinations a compact window keeps at\n * its bottom edge. Each destination is a link, so it routes through React\n * Aria's `RouterProvider` when the app has one.\n *\n * ```tsx\n * <NavigationBar aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationBar.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationBar.Item>\n * <NavigationBar.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationBar.Item>\n * <NavigationBar.Item href=\"/third\" icon={<ThirdIcon />}>\n * Third item\n * </NavigationBar.Item>\n * </NavigationBar>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationBar({\n render,\n selectedRoute,\n ...props\n}: NavigationBarProps) {\n const context = useMemo(() => ({\n form: 'bar' as const,\n selectedRoute\n }), [selectedRoute]);\n const bar = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n className: \"x6s0dn4 x1mjdul6 x1peatla x9f619 x78zum5 xxhr3t x110hqo6 xh8yej3 xl56j7k\"\n }, props)\n },\n render\n });\n return <NavigationContext value={context}>{bar}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation bar — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationBar`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationBarItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationBar.Item = NavigationBarItem;\nexport type { NavigationItemProps as NavigationBarItemProps, NavigationBarProps };\nexport { NavigationBarItem };\nexport default NavigationBar;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,SAAAgB,cAAAC,IAAA;CAAA,MAAAC,IAAAjB,EAAA,EAAA;CAAA,IAAAkB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAA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mBAAD;GAA0Bd,OAAAA;GAAUa,UAAAA;EAAlB,CAAA;EAA0Cd,EAAA,MAAAc;EAAAd,EAAA,MAAAC;EAAAD,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAA5De;AAA4D;;;;;;;;;;AAYrE,SAAAC,kBAAAR,OAAA;CAAA,MAAAR,IAAAjB,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC,EAAA,OAAAQ,OAAA;EACST,KAAA,oBAAC,gBAAD,EAAe,GAAKS,MAAK,CAAA;EAAIR,EAAA,KAAAQ;EAAAR,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,cAAcmB,OAAOD"}
1
+ {"version":3,"file":"index.js","names":["c","_c","RefAttributes","stylex","useLayoutEffect","useMemo","useState","NavigationItemProps","RenderComponentProps","NavigationItem","NavigationContext","mergeRefs","useRender","mergeStyles","colors","media","spacing","HORIZONTAL","NavigationBarProps","selectedRoute","NavigationBar","t0","$","props","render","element","setElement","isCramped","useCramped","t1","ref","undefined","t2","merged","t3","const","t4","form","context","t5","0","className","1","t6","t7","defaultTagName","bar","t8","NavigationBarItem","shortfallOf","HTMLElement","total","destination","children","label","lastElementChild","Math","max","scrollWidth","clientWidth","needed","setNeeded","measure","window","matchMedia","matches","shortfall","relabel","resize","ResizeObserver","observe","text","MutationObserver","characterData","childList","subtree","disconnect","Item","NavigationBarItemProps","_c"],"sources":["../../../src/components/navigation-bar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useLayoutEffect, useMemo, useState } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { mergeRefs } from '../../render/ref';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation bar page's flexible bar: three to five destinations across\n// the bottom of a compact window, on the surface container, 64dp tall. Below\n// the medium breakpoint each destination is vertical and the destinations\n// share the bar's width equally; at it and above, each is the page's\n// horizontal pill, as wide as what it holds, and the group sits centred with\n// the spare width at the bar's ends. The destinations are `src/navigation`'s,\n// shared with NavigationRail, which holds the two forms' values.\n//\n// The 8dp between two horizontal pills is the library's own. The page puts\n// each pill in an item of a fixed width it does not give, and with no space\n// at all the pills met edge to edge.\n//\n// A horizontal destination is as wide as its icon, its label and 16dp either\n// side, so five of them need far more than the 600dp the breakpoint starts\n// at: five fifteen-letter labels come to about 780. Drawn anyway, every label\n// was cut short the moment the window crossed the breakpoint, while one\n// pixel narrower the vertical form showed them whole. So the bar measures\n// what its horizontal labels lack, and keeps the vertical form until it is\n// that much wider — see `useCramped`.\n//\n// The bar is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\n// The window size the bar draws its horizontal form at, which the styles read\n// as `media.medium`. Spelled again for `matchMedia`, the one thing here that\n// has to know it outside a stylesheet — see `useCramped`.\nconst HORIZONTAL = '(width >= 600px)';\ntype NavigationBarProps = RenderComponentProps<'nav'> & {\n /**\n * The route of the current destination, matched against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator.\n */\n selectedRoute?: string;\n};\n\n/**\n * The bar of three to five top-level destinations a compact window keeps at\n * its bottom edge. Each destination is a link, so it routes through React\n * Aria's `RouterProvider` when the app has one.\n *\n * ```tsx\n * <NavigationBar aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationBar.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationBar.Item>\n * <NavigationBar.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationBar.Item>\n * <NavigationBar.Item href=\"/third\" icon={<ThirdIcon />}>\n * Third item\n * </NavigationBar.Item>\n * </NavigationBar>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationBar({\n render,\n selectedRoute,\n ...props\n}: NavigationBarProps) {\n // The element, held as state rather than in a ref object, since the bar\n // measures it from an effect and has to run again when it changes.\n const [element, setElement] = useState<HTMLElement | null>(null);\n const isCramped = useCramped(element);\n // The call site's ref lands on the same element. Read off `props` rather\n // than destructured, as `useRender` reads it, so the compiler sees a prop\n // holding still rather than a ref read during render.\n const merged = useMemo(() => mergeRefs(setElement, props.ref ?? undefined), [props.ref]);\n const context = useMemo(() => ({\n form: isCramped ? 'barCramped' as const : 'bar' as const,\n selectedRoute\n }), [isCramped, selectedRoute]);\n const bar = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"x6s0dn4 x1mjdul6 x1peatla x9f619 x78zum5 xxhr3t x110hqo6 xh8yej3 xl56j7k\"\n },\n 1: {\n className: \"x6s0dn4 x1mjdul6 x1peatla x9f619 x78zum5 xh8yej3 xl56j7k xxhr3t\"\n }\n }[!!isCramped << 0], props),\n ref: merged\n },\n render\n });\n return <NavigationContext value={context}>{bar}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation bar — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationBar`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationBarItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\n\n/**\n * How much wider the bar would have to be for none of its labels to be cut\n * short: what each one lacks of its own width, summed. A label is the last\n * part of its destination.\n */\nfunction shortfallOf(bar: HTMLElement) {\n let total = 0;\n for (const destination of bar.children) {\n const label = destination.lastElementChild;\n if (label instanceof HTMLElement) {\n total += Math.max(0, label.scrollWidth - label.clientWidth);\n }\n }\n return total;\n}\n\n/**\n * Whether `bar`, at a width that draws its horizontal form, is too narrow\n * for it, so it draws the vertical one instead.\n *\n * The horizontal form is measured as it is drawn: where it cuts labels short,\n * the bar records the width it would need and switches, and it switches back\n * once it is that wide. A change to the destinations' text clears the record,\n * since what they need has changed with it. Measured in a layout effect, so\n * a bar that cannot fit is never painted cut short.\n */\nfunction useCramped(bar: HTMLElement | null) {\n // The bar's width the horizontal form needs, while it is wider than the\n // bar; undefined while the horizontal form fits, or has not been measured.\n const [needed, setNeeded] = useState<number | undefined>(undefined);\n useLayoutEffect(() => {\n if (bar === null) {\n return undefined;\n }\n const measure = () => {\n if (needed !== undefined) {\n if (bar.clientWidth >= needed) {\n setNeeded(undefined);\n }\n return;\n }\n if (!window.matchMedia(HORIZONTAL).matches) {\n return;\n }\n const shortfall = shortfallOf(bar);\n if (shortfall > 0) {\n // A pixel over, so a bar exactly as wide as the sum of fractional\n // widths does not flip back and forth.\n setNeeded(bar.clientWidth + shortfall + 1);\n }\n };\n const relabel = () => {\n setNeeded(undefined);\n };\n measure();\n const resize = new ResizeObserver(measure);\n resize.observe(bar);\n const text = new MutationObserver(relabel);\n text.observe(bar, {\n characterData: true,\n childList: true,\n subtree: true\n });\n return () => {\n resize.disconnect();\n text.disconnect();\n };\n }, [bar, needed]);\n return needed !== undefined;\n}\nNavigationBar.Item = NavigationBarItem;\nexport type { NavigationItemProps as NavigationBarItemProps, NavigationBarProps };\nexport { NavigationBarItem };\nexport default NavigationBar;"],"mappings":";;;;;;;;;;AAyCA,MAAMiB,aAAa;;;;;;;;;;;;;;;;;;;;;;AA+BnB,SAAAG,cAAAC,IAAA;CAAA,MAAAC,IAAArB,EAAA,EAAA;CAAA,IAAAsB;CAAA,IAAAC;CAAA,IAAAL;CAAA,IAAAG,EAAA,OAAAD,IAAA;EAAuB,CAAA,CAAAG,QAAAL,eAAA,GAAAI,SAAAF;EAIFC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAH;CAAA,OAAA;EAAAI,QAAAD,EAAA;EAAAE,SAAAF,EAAA;EAAA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AIe,IAAGa,eAAgBC,QACrBC,UAAU9B,KAAAA,CAAS;KACpB;IAAA;IAGH,IAAI,CAACgC,OAAMC,WAAY/C,UAAU,CAAC,CAAAgD,SAAQ;IAG1C,MAAAC,YAAkBjB,YAAYH,GAAG;IACjC,IAAIoB,YAAY,GAGdL,UAAUf,IAAGa,cAAeO,YAAY,CAAC;GAC1C;GAEH,MAAAC,gBAAgB;IACdN,UAAU9B,KAAAA,CAAS;GAAC;GAEtB+B,QAAQ;GACR,MAAAM,SAAe,IAAIC,eAAeP,OAAO;GACzCM,OAAME,QAASxB,GAAG;GAClB,MAAAyB,OAAa,IAAIC,iBAAiBL,OAAO;GACzCI,KAAID,QAASxB,KAAK;IAAA2B,eACD;IAAIC,WACR;IAAIC,SACN;GACX,CAAC;GAAC,aACK;IACLP,OAAMQ,WAAY;IAClBL,KAAIK,WAAY;GAAC;EAClB;EACA/C,KAAA,CAACiB,KAAKc,MAAM;EAACtC,EAAA,KAAAwB;EAAAxB,EAAA,KAAAsC;EAAAtC,EAAA,KAAAD;EAAAC,EAAA,KAAAO;CAAA,OAAA;EAAAR,KAAAC,EAAA;EAAAO,KAAAP,EAAA;CAAA;CArChBlB,gBAAgBiB,IAqCbQ,EAAa;CAAC,OACV+B,WAAW7B,KAAAA;AAAS;AAE7BX,cAAcyD,OAAO7B"}
@@ -27,7 +27,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
27
27
  * The call site's `className` and `style` land on the `<nav>`.
28
28
  */
29
29
  function NavigationRail(t0) {
30
- const $ = c(30);
30
+ const $ = c(34);
31
31
  let children;
32
32
  let context;
33
33
  let header;
@@ -59,8 +59,8 @@ function NavigationRail(t0) {
59
59
  t3 = "nav";
60
60
  t1 = props;
61
61
  t2 = mergeStyles({
62
- 0: { className: "x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x8i8c5o xlaft8j xzoy561 x13oubkp" },
63
- 1: { className: "x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl" }
62
+ 0: { className: "x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp" },
63
+ 1: { className: "x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl" }
64
64
  }[!!isExpanded << 0], props);
65
65
  $[0] = t0;
66
66
  $[1] = children;
@@ -88,7 +88,7 @@ function NavigationRail(t0) {
88
88
  t5 = header === void 0 ? null : /* @__PURE__ */ jsx("div", {
89
89
  ...{
90
90
  0: { className: "x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y" },
91
- 1: { className: "x9f619 x78zum5 xdt5ytf x1cy8zhl x1mgj515" }
91
+ 1: { className: "x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515 xdxifnh" }
92
92
  }[!!isExpanded << 0],
93
93
  children: header
94
94
  });
@@ -97,48 +97,67 @@ function NavigationRail(t0) {
97
97
  $[15] = t5;
98
98
  } else t5 = $[15];
99
99
  let t6;
100
- if ($[16] !== children || $[17] !== t5) {
101
- t6 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t5, children] });
102
- $[16] = children;
103
- $[17] = t5;
104
- $[18] = t6;
105
- } else t6 = $[18];
106
- let t7;
107
- if ($[19] !== t1 || $[20] !== t2 || $[21] !== t6) {
108
- t7 = {
100
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
101
+ t6 = {
102
+ 0: { className: "x6s0dn4 xkh2ocl x9f619 x78zum5 xdl72j9 xdt5ytf x1iyjqo2 xs83m0k x1fh6m6z xfll3lq x2lwn1j x1odjw0f x12ulsxz xfn1xvj" },
103
+ 1: { className: "x6s0dn4 xkh2ocl x9f619 x78zum5 xdl72j9 xdt5ytf x1iyjqo2 xs83m0k x1fh6m6z xfll3lq x2lwn1j x1odjw0f x12ulsxz xfn1xvj xzoy561" }
104
+ };
105
+ $[16] = t6;
106
+ } else t6 = $[16];
107
+ const t7 = t6[!!!isExpanded << 0];
108
+ let t8;
109
+ if ($[17] !== children || $[18] !== t7) {
110
+ t8 = /* @__PURE__ */ jsx("div", {
111
+ ...t7,
112
+ children
113
+ });
114
+ $[17] = children;
115
+ $[18] = t7;
116
+ $[19] = t8;
117
+ } else t8 = $[19];
118
+ let t9;
119
+ if ($[20] !== t5 || $[21] !== t8) {
120
+ t9 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t5, t8] });
121
+ $[20] = t5;
122
+ $[21] = t8;
123
+ $[22] = t9;
124
+ } else t9 = $[22];
125
+ let t10;
126
+ if ($[23] !== t1 || $[24] !== t2 || $[25] !== t9) {
127
+ t10 = {
109
128
  ...t1,
110
129
  ...t2,
111
- children: t6
130
+ children: t9
112
131
  };
113
- $[19] = t1;
114
- $[20] = t2;
115
- $[21] = t6;
116
- $[22] = t7;
117
- } else t7 = $[22];
118
- let t8;
119
- if ($[23] !== render || $[24] !== t3 || $[25] !== t7) {
120
- t8 = {
132
+ $[23] = t1;
133
+ $[24] = t2;
134
+ $[25] = t9;
135
+ $[26] = t10;
136
+ } else t10 = $[26];
137
+ let t11;
138
+ if ($[27] !== render || $[28] !== t10 || $[29] !== t3) {
139
+ t11 = {
121
140
  defaultTagName: t3,
122
- props: t7,
141
+ props: t10,
123
142
  render
124
143
  };
125
- $[23] = render;
126
- $[24] = t3;
127
- $[25] = t7;
128
- $[26] = t8;
129
- } else t8 = $[26];
130
- const rail = t4(t8);
131
- let t9;
132
- if ($[27] !== context || $[28] !== rail) {
133
- t9 = /* @__PURE__ */ jsx(NavigationContext, {
144
+ $[27] = render;
145
+ $[28] = t10;
146
+ $[29] = t3;
147
+ $[30] = t11;
148
+ } else t11 = $[30];
149
+ const rail = t4(t11);
150
+ let t12;
151
+ if ($[31] !== context || $[32] !== rail) {
152
+ t12 = /* @__PURE__ */ jsx(NavigationContext, {
134
153
  value: context,
135
154
  children: rail
136
155
  });
137
- $[27] = context;
138
- $[28] = rail;
139
- $[29] = t9;
140
- } else t9 = $[29];
141
- return t9;
156
+ $[31] = context;
157
+ $[32] = rail;
158
+ $[33] = t12;
159
+ } else t12 = $[33];
160
+ return t12;
142
161
  }
143
162
  /**
144
163
  * One destination of a navigation rail — an icon, a label and, when it is the
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","stylex","useMemo","NavigationItemProps","RenderComponentProps","NavigationItem","NavigationContext","useRender","mergeStyles","colors","spacing","NavigationRailProps","header","isExpanded","selectedRoute","NavigationRail","t0","$","children","context","render","t1","t2","t3","t4","t5","t6","t7","t8","props","undefined","t9","const","t10","form","0","className","1","defaultTagName","rail","NavigationRailItem","Item","NavigationRailItemProps","_c"],"sources":["../../../src/components/navigation-rail/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation rail page's rail, in both its forms: collapsed, a 96dp\n// column of vertical destinations down the leading edge of a medium or wider\n// window, and expanded, between 220dp and 360dp with each destination the\n// page's 56dp horizontal pill. The expanded rail is what the page has\n// replace the navigation drawer, so an app's top-level destinations reach\n// every window size between this and NavigationBar. Both forms are on the\n// surface role, with their contents 44dp from the top: the first destination,\n// or a header when the rail has one — a menu button that expands it, say —\n// with the first destination 40dp under it. The destinations are\n// `src/navigation`'s, shared with NavigationBar, which holds their values.\n//\n// The rail is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\ntype NavigationRailProps = RenderComponentProps<'nav'> & {\n /**\n * What the rail draws above its destinations: a menu button that expands\n * it, or a floating action button.\n */\n header?: ReactNode;\n /**\n * Whether the rail is in its expanded form, each destination a pill with\n * its label beside the icon, rather than collapsed with the label under it.\n * @default false\n */\n isExpanded?: boolean;\n /**\n * The route of the current destination, matched against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator.\n */\n selectedRoute?: string;\n};\n\n/**\n * The column of top-level destinations a medium or wider window keeps at its\n * leading edge, collapsed or, with `isExpanded`, expanded. Each destination\n * is a link, so it routes through React Aria's `RouterProvider` when the app\n * has one.\n *\n * ```tsx\n * <NavigationRail aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationRail.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationRail.Item>\n * <NavigationRail.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationRail.Item>\n * </NavigationRail>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationRail({\n children,\n header,\n isExpanded = false,\n render,\n selectedRoute,\n ...props\n}: NavigationRailProps) {\n const context = useMemo(() => ({\n form: isExpanded ? 'expanded' as const : 'collapsed' as const,\n selectedRoute\n }), [isExpanded, selectedRoute]);\n const rail = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x8i8c5o xlaft8j xzoy561 x13oubkp\"\n },\n 1: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl\"\n }\n }[!!isExpanded << 0], props),\n children: <>\n {header === undefined ? null : <div {...{\n 0: {\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cy8zhl x1mgj515\"\n }\n }[!!isExpanded << 0]}>\n {header}\n </div>}\n {children}\n </>\n },\n render\n });\n return <NavigationContext value={context}>{rail}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation rail — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationRail`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationRail.Item = NavigationRailItem;\nexport type { NavigationItemProps as NavigationRailItemProps, NavigationRailProps };\nexport { NavigationRailItem };\nexport default NavigationRail;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,SAAAkB,eAAAC,IAAA;CAAA,MAAAC,IAAAnB,EAAA,EAAA;CAAA,IAAAoB;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAwB,MAAA,EAAAE,UAAAO,IAAAb,QAAAc,IAAAb,YAAAc,IAAAP,QAAAQ,IAAAd,eAAA,GAAAe,UAAAb;EAAAE,WAAAO;EAAAb,SAAAc;EAAAN,SAAAQ;EAGtBf,aAAAc,OAAAG,KAAAA,IAAA,QAAAH;EAMQ,MAAAI,KAAAlB,aAAa,aAAsB;EAAoB,IAAAoB;EAAA,IAAAhB,EAAA,QAAAH,iBAAAG,EAAA,QAAAc,IAAA;GADhCE,MAAA;IAAAC,MACvBH;IAAuDjB;GAE/D;GAACG,EAAA,MAAAH;GAAAG,EAAA,MAAAc;GAAAd,EAAA,MAAAgB;EAAA,OAAAA,MAAAhB,EAAA;EAHDE,UAA+Bc;EAIlB1B,KAAAA;EACKgB,KAAA;EAEXM,KAAAA;EACAP,KAAAd,YAAY;GAAA2B,GACV,EAAAC,WACU,mFACb;GAACC,G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MAAAK;EAAAL,EAAA,MAAAS;EAAAT,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,QAAAG,UAAAH,EAAA,QAAAM,MAAAN,EAAA,QAAAU,IAAA;EAzBoBC,KAAA;GAAAU,gBACLf;GAAKM,OACdF;GAuBNP;EAEH;EAACH,EAAA,MAAAG;EAAAH,EAAA,MAAAM;EAAAN,EAAA,MAAAU;EAAAV,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CA3BD,MAAAsB,OAAahC,GAAUqB,EA2BtB;CAAE,IAAAG;CAAA,IAAAd,EAAA,QAAAE,WAAAF,EAAA,QAAAsB,MAAA;EACIR,KAAA,oBAAC,mBAAD;GAA0BZ,OAAAA;GAAUoB,UAAAA;EAAlB,CAAA;EAA2CtB,EAAA,MAAAE;EAAAF,EAAA,MAAAsB;EAAAtB,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAA7Dc;AAA6D;;;;;;;;;;AAYtE,SAAAS,mBAAAX,OAAA;CAAA,MAAAZ,IAAAnB,EAAA,CAAA;CAAA,IAAAkB;CAAA,IAAAC,EAAA,OAAAY,OAAA;EACSb,KAAA,oBAAC,gBAAD,EAAe,GAAKa,MAAK,CAAA;EAAIZ,EAAA,KAAAY;EAAAZ,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,eAAe0B,OAAOD"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","stylex","useMemo","NavigationItemProps","RenderComponentProps","NavigationItem","NavigationContext","useRender","mergeStyles","colors","spacing","RING_REACH","NavigationRailProps","header","isExpanded","selectedRoute","NavigationRail","t0","$","children","context","render","t1","t2","t3","t4","t5","t6","t7","t8","props","undefined","t9","const","t10","form","0","className","1","Symbol","for","t11","defaultTagName","rail","t12","NavigationRailItem","Item","NavigationRailItemProps","_c"],"sources":["../../../src/components/navigation-rail/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation rail page's rail, in both its forms: collapsed, a 96dp\n// column of vertical destinations down the leading edge of a medium or wider\n// window, and expanded, between 220dp and 360dp with each destination the\n// page's 56dp horizontal pill. The expanded rail is what the page has\n// replace the navigation drawer, so an app's top-level destinations reach\n// every window size between this and NavigationBar. Both forms are on the\n// surface role, with their contents 44dp from the top: the first destination,\n// or a header when the rail has one — a menu button that expands it, say —\n// with the first destination 40dp under it. The destinations are\n// `src/navigation`'s, shared with NavigationBar, which holds their values.\n//\n// The rail is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\n// How far a destination's focus ring reaches past it: the 2dp offset and\n// the 2dp ring. The destinations scroll, and a scroll container clips what\n// overflows it, so the block they scroll in is padded by this much and\n// pulled back out by as much, which leaves every destination where it was\n// and every ring whole.\nconst RING_REACH = '4px';\ntype NavigationRailProps = RenderComponentProps<'nav'> & {\n /**\n * What the rail draws above its destinations: a menu button that expands\n * it, or a floating action button.\n */\n header?: ReactNode;\n /**\n * Whether the rail is in its expanded form, each destination a pill with\n * its label beside the icon, rather than collapsed with the label under it.\n * @default false\n */\n isExpanded?: boolean;\n /**\n * The route of the current destination, matched against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator.\n */\n selectedRoute?: string;\n};\n\n/**\n * The column of top-level destinations a medium or wider window keeps at its\n * leading edge, collapsed or, with `isExpanded`, expanded. Each destination\n * is a link, so it routes through React Aria's `RouterProvider` when the app\n * has one.\n *\n * ```tsx\n * <NavigationRail aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationRail.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationRail.Item>\n * <NavigationRail.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationRail.Item>\n * </NavigationRail>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationRail({\n children,\n header,\n isExpanded = false,\n render,\n selectedRoute,\n ...props\n}: NavigationRailProps) {\n const context = useMemo(() => ({\n form: isExpanded ? 'expanded' as const : 'collapsed' as const,\n selectedRoute\n }), [isExpanded, selectedRoute]);\n const rail = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp\"\n },\n 1: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl\"\n }\n }[!!isExpanded << 0], props),\n children: <>\n {header === undefined ? null : <div {...{\n 0: {\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515 xdxifnh\"\n }\n }[!!isExpanded << 0]}>\n {header}\n </div>}\n <div {...{\n 0: {\n className: \"x6s0dn4 xkh2ocl x9f619 x78zum5 xdl72j9 xdt5ytf x1iyjqo2 xs83m0k x1fh6m6z xfll3lq x2lwn1j x1odjw0f x12ulsxz xfn1xvj\"\n },\n 1: {\n className: \"x6s0dn4 xkh2ocl x9f619 x78zum5 xdl72j9 xdt5ytf x1iyjqo2 xs83m0k x1fh6m6z xfll3lq x2lwn1j x1odjw0f x12ulsxz xfn1xvj xzoy561\"\n }\n }[!!!isExpanded << 0]}>\n {children}\n </div>\n </>\n },\n render\n });\n return <NavigationContext value={context}>{rail}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation rail — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationRail`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationRail.Item = NavigationRailItem;\nexport type { NavigationItemProps as NavigationRailItemProps, NavigationRailProps };\nexport { NavigationRailItem };\nexport default NavigationRail;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,SAAAmB,eAAAC,IAAA;CAAA,MAAAC,IAAApB,EAAA,EAAA;CAAA,IAAAqB;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAwB,MAAA,EAAAE,UAAAO,IAAAb,QAAAc,IAAAb,YAAAc,IAAAP,QAAAQ,IAAAd,eAAA,GAAAe,UAAAb;EAAAE,WAAAO;EAAAb,SAAAc;EAAAN,SAAAQ;EAGtBf,aAAAc,OAAAG,KAAAA,IAAA,QAAAH;EAMQ,MAAAI,KAAAlB,aAAa,aAAsB;EAAoB,IAAAoB;EAAA,IAAAhB,EAAA,QAAAH,iBAAAG,EAAA,QAAAc,IAAA;GADhCE,MAAA;IAAAC,MACvBH;IAAuDjB;GAE/D;GAACG,EAAA,MAAAH;GAAAG,EAAA,MAAAc;GAAAd,EAAA,MAAAgB;EAAA,OAAAA,MAAAhB,EAAA;EAHDE,UAA+Bc;EAIlB3B,KAAAA;EACKiB,KAAA;EAEXM,KAAAA;EACAP,KAAAf,YAAY;GAAA4B,GACV,EAAAC,WACU,2FACb;GAACC,GACE,EAAAD,WACU,4GACb;EACF,EAAE,CAAC,CAACvB,cAAc,IAA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AZ,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,eAAe8B,OAAOD"}
@@ -90,21 +90,21 @@ function leadingFor(state, leading) {
90
90
  * The call site's `className` and `style` land on the container, which is
91
91
  * the element a layout positions.
92
92
  */
93
- function NavigationTree$1(props$1) {
93
+ function NavigationTree$1(props$2) {
94
94
  const $ = c(5);
95
95
  let t0;
96
- if ($[0] !== props$1) {
97
- t0 = mergeStatefulStyles(props(collectionStyles.container), props$1);
98
- $[0] = props$1;
96
+ if ($[0] !== props$2) {
97
+ t0 = mergeStatefulStyles(props(collectionStyles.container), props$2);
98
+ $[0] = props$2;
99
99
  $[1] = t0;
100
100
  } else t0 = $[1];
101
101
  let t1;
102
- if ($[2] !== props$1 || $[3] !== t0) {
102
+ if ($[2] !== props$2 || $[3] !== t0) {
103
103
  t1 = /* @__PURE__ */ jsx(NavigationTree, {
104
- ...props$1,
104
+ ...props$2,
105
105
  ...t0
106
106
  });
107
- $[2] = props$1;
107
+ $[2] = props$2;
108
108
  $[3] = t0;
109
109
  $[4] = t1;
110
110
  } else t1 = $[4];
@@ -213,12 +213,12 @@ function NavigationTreeSection$1(t0) {
213
213
  let t1;
214
214
  let t2;
215
215
  if ($[0] !== t0) {
216
- const { children: t3, header: t4, ...props$2 } = t0;
216
+ const { children: t3, header: t4, ...props$1 } = t0;
217
217
  children = t3;
218
218
  header = t4;
219
219
  T0 = NavigationTreeSection;
220
- t1 = props$2;
221
- t2 = mergeStyles(props(collectionStyles.section), props$2);
220
+ t1 = props$1;
221
+ t2 = mergeStyles(props(collectionStyles.section), props$1);
222
222
  $[0] = t0;
223
223
  $[1] = T0;
224
224
  $[2] = children;
@@ -42,6 +42,15 @@ type NumberFieldProps$1 = {
42
42
  * focus to — after a server's error, say. `ref` is the field as a whole.
43
43
  */
44
44
  inputRef?: Ref<HTMLInputElement>;
45
+ /**
46
+ * Whether the mouse wheel and a trackpad's scroll leave the value alone.
47
+ * React Aria steps a focused number field's value with the wheel, so a
48
+ * reader scrolling a long form past a field they had left focused changed
49
+ * its value instead of moving the page. Stepping from the wheel is the
50
+ * call site's to ask for, with `false`.
51
+ * @default true
52
+ */
53
+ isWheelDisabled?: boolean;
45
54
  /**
46
55
  * What the field is for. Required rather than optional: a field with no
47
56
  * label is a box a screen reader cannot name.
@@ -68,7 +77,7 @@ type NumberFieldProps$1 = {
68
77
  * @default 'filled'
69
78
  */
70
79
  variant?: FieldVariant;
71
- } & Omit<NumberFieldProps, 'children' | 'isInvalid' | 'validationBehavior'>;
80
+ } & Omit<NumberFieldProps, 'children' | 'isInvalid' | 'isWheelDisabled' | 'validationBehavior'>;
72
81
  /**
73
82
  * A labelled number input with steppers. Its value is React Aria's: pass
74
83
  * `value` with `onChange` to control it, or `defaultValue` to let it keep
@@ -76,12 +85,14 @@ type NumberFieldProps$1 = {
76
85
  * empty. `minValue`, `maxValue` and `step` shape it, and `formatOptions`
77
86
  * says how it reads, in the locale the page is in: a currency, a percentage,
78
87
  * a unit. Arrow keys step the value, and Page Up and Page Down by ten steps.
88
+ * The mouse wheel scrolls the page past it rather than stepping it, unless
89
+ * `isWheelDisabled` is `false`.
79
90
  *
80
91
  * The call site's `className` and `style` land on the field as a whole,
81
92
  * which is the element a layout positions. The box, label, input and message
82
93
  * are the field chrome in `src/field`, shared with every other field.
83
94
  */
84
- declare function NumberField$1({ decrementLabel, description, error, floatingLabel, incrementLabel, inputRef, isDisabled, label, numeric, steppers, variant, ...props }: NumberFieldProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
95
+ declare function NumberField$1({ decrementLabel, description, error, floatingLabel, incrementLabel, inputRef, isDisabled, isWheelDisabled, label, numeric, steppers, variant, ...props }: NumberFieldProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
85
96
  //#endregion
86
97
  export { type NumberFieldProps$1 as NumberFieldProps, NumberField$1 as default };
87
98
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
- import { spacing, typography } from "../../tokens/design.tokens.stylex.js";
3
+ import { sizing, spacing, typography } from "../../tokens/design.tokens.stylex.js";
4
4
  import { mergeStatefulStyles } from "../../styles/merge.js";
5
5
  import { MinusGlyph, PlusGlyph } from "../../glyphs/index.js";
6
6
  import IconButton from "../icon-button/index.js";
@@ -12,6 +12,9 @@ import { Button, NumberField } from "react-aria-components";
12
12
  //#region src/components/number-field/index.tsx
13
13
  `${spacing.sm}${typography.bodySmallLineHeight}${typography.bodyLargeLineHeight}`;
14
14
  `${spacing.lg}${typography.bodyLargeLineHeight}`;
15
+ `${typography.bodyLargeLineHeight}${sizing.controlXs}`;
16
+ const STACKED_INSET = `calc(32px - ${spacing.lg} + ${spacing.sm})`;
17
+ const INLINE_INSET = `calc(2 * ${sizing.controlXs} + ${spacing.sm} + ${spacing.md} - ${spacing.lg} + ${spacing.sm})`;
15
18
  const styles = {
16
19
  stepper: {
17
20
  k6CgDc: "x12w9bfk",
@@ -73,62 +76,66 @@ const styles = {
73
76
  * empty. `minValue`, `maxValue` and `step` shape it, and `formatOptions`
74
77
  * says how it reads, in the locale the page is in: a currency, a percentage,
75
78
  * a unit. Arrow keys step the value, and Page Up and Page Down by ten steps.
79
+ * The mouse wheel scrolls the page past it rather than stepping it, unless
80
+ * `isWheelDisabled` is `false`.
76
81
  *
77
82
  * The call site's `className` and `style` land on the field as a whole,
78
83
  * which is the element a layout positions. The box, label, input and message
79
84
  * are the field chrome in `src/field`, shared with every other field.
80
85
  */
81
86
  function NumberField$1(t0) {
82
- const $ = c(37);
83
- const { decrementLabel, description, error, floatingLabel: t1, incrementLabel, inputRef, isDisabled: t2, label, numeric: t3, steppers: t4, variant: t5, ...props$1 } = t0;
87
+ const $ = c(39);
88
+ const { decrementLabel, description, error, floatingLabel: t1, incrementLabel, inputRef, isDisabled: t2, isWheelDisabled: t3, label, numeric: t4, steppers: t5, variant: t6, ...props$1 } = t0;
84
89
  const floatingLabel = t1 === void 0 ? true : t1;
85
90
  const isDisabled = t2 === void 0 ? false : t2;
86
- const numeric = t3 === void 0 ? true : t3;
87
- const steppers = t4 === void 0 ? "vertical" : t4;
88
- const variant = t5 === void 0 ? "filled" : t5;
91
+ const isWheelDisabled = t3 === void 0 ? true : t3;
92
+ const numeric = t4 === void 0 ? true : t4;
93
+ const steppers = t5 === void 0 ? "vertical" : t5;
94
+ const variant = t6 === void 0 ? "filled" : t6;
89
95
  const inline = steppers === "horizontal";
90
96
  const validationBehavior = useFieldValidationBehavior();
91
97
  const T0 = NumberField;
92
- let t6;
98
+ let t7;
93
99
  if ($[0] !== error) {
94
- t6 = invalidFrom(error);
100
+ t7 = invalidFrom(error);
95
101
  $[0] = error;
96
- $[1] = t6;
97
- } else t6 = $[1];
98
- const t7 = mergeStatefulStyles(props(fieldStyles.root), props$1);
99
- let t8;
102
+ $[1] = t7;
103
+ } else t7 = $[1];
104
+ const t8 = mergeStatefulStyles(props(fieldStyles.root), props$1);
105
+ const t9 = inline ? INLINE_INSET : STACKED_INSET;
106
+ let t10;
100
107
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
101
- t8 = {
108
+ t10 = {
102
109
  0: { className: "x1cy8zhl x9f619 x78zum5 x126z3so" },
103
110
  1: { className: "x9f619 x78zum5 x126z3so x6s0dn4" }
104
111
  };
105
- $[2] = t8;
106
- } else t8 = $[2];
107
- const t9 = t8[!!inline << 0];
108
- let t10;
112
+ $[2] = t10;
113
+ } else t10 = $[2];
114
+ const t11 = t10[!!inline << 0];
115
+ let t12;
109
116
  if ($[3] !== inputRef || $[4] !== numeric) {
110
- t10 = /* @__PURE__ */ jsx(FieldInput, {
117
+ t12 = /* @__PURE__ */ jsx(FieldInput, {
111
118
  numeric,
112
119
  ref: inputRef
113
120
  });
114
121
  $[3] = inputRef;
115
122
  $[4] = numeric;
116
- $[5] = t10;
117
- } else t10 = $[5];
118
- let t11;
123
+ $[5] = t12;
124
+ } else t12 = $[5];
125
+ let t13;
119
126
  if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
120
- t11 = {
121
- 0: { className: "x78zum5 xdt5ytf x2lah0s x1motrhk xk4mfur" },
122
- 2: { className: "x78zum5 x2lah0s x1q0g3np x126z3so xdj266r x1tn5xpv" },
123
- 1: { className: "x78zum5 xdt5ytf x2lah0s xk4mfur x17v9ssf" },
124
- 3: { className: "x78zum5 x2lah0s x1q0g3np x126z3so x1tn5xpv x17v9ssf" }
127
+ t13 = {
128
+ 0: { className: "x9f619 x78zum5 xdt5ytf x2lah0s x1motrhk xk4mfur" },
129
+ 2: { className: "x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x6rec7h x1tn5xpv" },
130
+ 1: { className: "x9f619 x78zum5 xdt5ytf x2lah0s xk4mfur x17v9ssf" },
131
+ 3: { className: "x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x1tn5xpv x17v9ssf" }
125
132
  };
126
- $[6] = t11;
127
- } else t11 = $[6];
128
- const t12 = t11[!!inline << 1 | !!(!inline && variant === "outlined") << 0];
129
- let t13;
133
+ $[6] = t13;
134
+ } else t13 = $[6];
135
+ const t14 = t13[!!inline << 1 | !!(!inline && variant === "outlined") << 0];
136
+ let t15;
130
137
  if ($[7] !== decrementLabel || $[8] !== incrementLabel || $[9] !== inline || $[10] !== variant) {
131
- t13 = inline ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
138
+ t15 = inline ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
132
139
  "aria-label": decrementLabel,
133
140
  size: "xs",
134
141
  slot: "decrement",
@@ -153,76 +160,80 @@ function NumberField$1(t0) {
153
160
  $[8] = incrementLabel;
154
161
  $[9] = inline;
155
162
  $[10] = variant;
156
- $[11] = t13;
157
- } else t13 = $[11];
158
- let t14;
159
- if ($[12] !== t12 || $[13] !== t13) {
160
- t14 = /* @__PURE__ */ jsx("div", {
161
- ...t12,
162
- children: t13
163
+ $[11] = t15;
164
+ } else t15 = $[11];
165
+ let t16;
166
+ if ($[12] !== t14 || $[13] !== t15) {
167
+ t16 = /* @__PURE__ */ jsx("div", {
168
+ ...t14,
169
+ children: t15
163
170
  });
164
- $[12] = t12;
165
- $[13] = t13;
166
- $[14] = t14;
167
- } else t14 = $[14];
168
- let t15;
169
- if ($[15] !== t10 || $[16] !== t14 || $[17] !== t9) {
170
- t15 = /* @__PURE__ */ jsxs("div", {
171
- ...t9,
172
- children: [t10, t14]
171
+ $[12] = t14;
172
+ $[13] = t15;
173
+ $[14] = t16;
174
+ } else t16 = $[14];
175
+ let t17;
176
+ if ($[15] !== t11 || $[16] !== t12 || $[17] !== t16) {
177
+ t17 = /* @__PURE__ */ jsxs("div", {
178
+ ...t11,
179
+ children: [t12, t16]
173
180
  });
174
- $[15] = t10;
175
- $[16] = t14;
176
- $[17] = t9;
177
- $[18] = t15;
178
- } else t15 = $[18];
179
- let t16;
180
- if ($[19] !== floatingLabel || $[20] !== label || $[21] !== props$1.isRequired || $[22] !== t15 || $[23] !== variant) {
181
- t16 = /* @__PURE__ */ jsx(FieldBox, {
181
+ $[15] = t11;
182
+ $[16] = t12;
183
+ $[17] = t16;
184
+ $[18] = t17;
185
+ } else t17 = $[18];
186
+ let t18;
187
+ if ($[19] !== floatingLabel || $[20] !== label || $[21] !== props$1.isRequired || $[22] !== t17 || $[23] !== t9 || $[24] !== variant) {
188
+ t18 = /* @__PURE__ */ jsx(FieldBox, {
189
+ endInset: t9,
182
190
  floatingLabel,
183
191
  isRequired: props$1.isRequired,
184
192
  label,
185
193
  variant,
186
- children: t15
194
+ children: t17
187
195
  });
188
196
  $[19] = floatingLabel;
189
197
  $[20] = label;
190
198
  $[21] = props$1.isRequired;
191
- $[22] = t15;
192
- $[23] = variant;
193
- $[24] = t16;
194
- } else t16 = $[24];
195
- let t17;
196
- if ($[25] !== description || $[26] !== error) {
197
- t17 = /* @__PURE__ */ jsx(FieldMessage, {
199
+ $[22] = t17;
200
+ $[23] = t9;
201
+ $[24] = variant;
202
+ $[25] = t18;
203
+ } else t18 = $[25];
204
+ let t19;
205
+ if ($[26] !== description || $[27] !== error) {
206
+ t19 = /* @__PURE__ */ jsx(FieldMessage, {
198
207
  description,
199
208
  error
200
209
  });
201
- $[25] = description;
202
- $[26] = error;
203
- $[27] = t17;
204
- } else t17 = $[27];
205
- let t18;
206
- if ($[28] !== T0 || $[29] !== isDisabled || $[30] !== props$1 || $[31] !== t16 || $[32] !== t17 || $[33] !== t6 || $[34] !== t7 || $[35] !== validationBehavior) {
207
- t18 = /* @__PURE__ */ jsxs(T0, {
210
+ $[26] = description;
211
+ $[27] = error;
212
+ $[28] = t19;
213
+ } else t19 = $[28];
214
+ let t20;
215
+ if ($[29] !== T0 || $[30] !== isDisabled || $[31] !== isWheelDisabled || $[32] !== props$1 || $[33] !== t18 || $[34] !== t19 || $[35] !== t7 || $[36] !== t8 || $[37] !== validationBehavior) {
216
+ t20 = /* @__PURE__ */ jsxs(T0, {
208
217
  isDisabled,
209
- isInvalid: t6,
218
+ isInvalid: t7,
219
+ isWheelDisabled,
210
220
  validationBehavior,
211
221
  ...props$1,
212
- ...t7,
213
- children: [t16, t17]
222
+ ...t8,
223
+ children: [t18, t19]
214
224
  });
215
- $[28] = T0;
216
- $[29] = isDisabled;
217
- $[30] = props$1;
218
- $[31] = t16;
219
- $[32] = t17;
220
- $[33] = t6;
221
- $[34] = t7;
222
- $[35] = validationBehavior;
223
- $[36] = t18;
224
- } else t18 = $[36];
225
- return t18;
225
+ $[29] = T0;
226
+ $[30] = isDisabled;
227
+ $[31] = isWheelDisabled;
228
+ $[32] = props$1;
229
+ $[33] = t18;
230
+ $[34] = t19;
231
+ $[35] = t7;
232
+ $[36] = t8;
233
+ $[37] = validationBehavior;
234
+ $[38] = t20;
235
+ } else t20 = $[38];
236
+ return t20;
226
237
  }
227
238
  function StackedStepper(t0) {
228
239
  const $ = c(8);