@kanso-labs/kanso-ui 0.43.7 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +1 -0
  2. package/dist/calendar/index.js +34 -10
  3. package/dist/calendar/index.js.map +1 -1
  4. package/dist/calendar/styles.js +30 -0
  5. package/dist/calendar/styles.js.map +1 -1
  6. package/dist/chip/index.js +27 -18
  7. package/dist/chip/index.js.map +1 -1
  8. package/dist/chip/label.js +32 -0
  9. package/dist/chip/label.js.map +1 -0
  10. package/dist/chip/styles.js +32 -2
  11. package/dist/chip/styles.js.map +1 -1
  12. package/dist/collection/text.js +24 -3
  13. package/dist/collection/text.js.map +1 -1
  14. package/dist/components/button/index.js.map +1 -1
  15. package/dist/components/calendar/index.d.ts +8 -1
  16. package/dist/components/calendar/index.js +129 -73
  17. package/dist/components/calendar/index.js.map +1 -1
  18. package/dist/components/checkbox/index.js +29 -30
  19. package/dist/components/checkbox/index.js.map +1 -1
  20. package/dist/components/checkbox-group/index.js +4 -2
  21. package/dist/components/checkbox-group/index.js.map +1 -1
  22. package/dist/components/chip/index.js +1 -1
  23. package/dist/components/chip/index.js.map +1 -1
  24. package/dist/components/chip-group/index.d.ts +35 -5
  25. package/dist/components/chip-group/index.js +137 -97
  26. package/dist/components/chip-group/index.js.map +1 -1
  27. package/dist/components/copy-field/index.js +1 -1
  28. package/dist/components/copy-field/index.js.map +1 -1
  29. package/dist/components/currency/index.d.ts +64 -6
  30. package/dist/components/currency/index.js +117 -40
  31. package/dist/components/currency/index.js.map +1 -1
  32. package/dist/components/date-picker/index.js +1 -1
  33. package/dist/components/dialog/index.d.ts +3 -1
  34. package/dist/components/dialog/index.js +121 -81
  35. package/dist/components/dialog/index.js.map +1 -1
  36. package/dist/components/disclosure-group/index.js +1 -1
  37. package/dist/components/disclosure-group/index.js.map +1 -1
  38. package/dist/components/icon-button/index.js +18 -1
  39. package/dist/components/icon-button/index.js.map +1 -1
  40. package/dist/components/index.d.ts +2 -2
  41. package/dist/components/keycap/index.d.ts +3 -0
  42. package/dist/components/keycap/index.js +30 -44
  43. package/dist/components/keycap/index.js.map +1 -1
  44. package/dist/components/list/index.d.ts +16 -2
  45. package/dist/components/list/index.js +124 -69
  46. package/dist/components/list/index.js.map +1 -1
  47. package/dist/components/list-detail/index.d.ts +11 -3
  48. package/dist/components/list-detail/index.js +13 -6
  49. package/dist/components/list-detail/index.js.map +1 -1
  50. package/dist/components/list-item/index.d.ts +16 -1
  51. package/dist/components/list-item/index.js.map +1 -1
  52. package/dist/components/menu/index.d.ts +6 -2
  53. package/dist/components/menu/index.js +22 -15
  54. package/dist/components/menu/index.js.map +1 -1
  55. package/dist/components/meter/index.d.ts +4 -1
  56. package/dist/components/meter/index.js +6 -0
  57. package/dist/components/meter/index.js.map +1 -1
  58. package/dist/components/navigation-bar/index.d.ts +14 -4
  59. package/dist/components/navigation-bar/index.js +77 -50
  60. package/dist/components/navigation-bar/index.js.map +1 -1
  61. package/dist/components/navigation-rail/index.d.ts +3 -2
  62. package/dist/components/navigation-rail/index.js +59 -52
  63. package/dist/components/navigation-rail/index.js.map +1 -1
  64. package/dist/components/navigation-tree/index.js +4 -1
  65. package/dist/components/navigation-tree/index.js.map +1 -1
  66. package/dist/components/number-field/index.d.ts +3 -2
  67. package/dist/components/number-field/index.js +91 -115
  68. package/dist/components/number-field/index.js.map +1 -1
  69. package/dist/components/popover/index.d.ts +3 -1
  70. package/dist/components/popover/index.js +102 -100
  71. package/dist/components/popover/index.js.map +1 -1
  72. package/dist/components/progress-indicator/index.d.ts +4 -2
  73. package/dist/components/progress-indicator/index.js +4 -3
  74. package/dist/components/progress-indicator/index.js.map +1 -1
  75. package/dist/components/radio-group/index.js +34 -24
  76. package/dist/components/radio-group/index.js.map +1 -1
  77. package/dist/components/search-field/index.d.ts +11 -1
  78. package/dist/components/search-field/index.js +32 -28
  79. package/dist/components/search-field/index.js.map +1 -1
  80. package/dist/components/segmented-button/index.d.ts +9 -2
  81. package/dist/components/segmented-button/index.js +1 -1
  82. package/dist/components/segmented-button/index.js.map +1 -1
  83. package/dist/components/separator/index.d.ts +19 -7
  84. package/dist/components/separator/index.js +36 -13
  85. package/dist/components/separator/index.js.map +1 -1
  86. package/dist/components/sheet/index.js +72 -61
  87. package/dist/components/sheet/index.js.map +1 -1
  88. package/dist/components/snackbar/index.d.ts +4 -1
  89. package/dist/components/snackbar/index.js +140 -55
  90. package/dist/components/snackbar/index.js.map +1 -1
  91. package/dist/components/stack/index.d.ts +6 -3
  92. package/dist/components/stack/index.js +48 -31
  93. package/dist/components/stack/index.js.map +1 -1
  94. package/dist/components/switch/index.d.ts +16 -6
  95. package/dist/components/switch/index.js +115 -62
  96. package/dist/components/switch/index.js.map +1 -1
  97. package/dist/components/text-area/index.d.ts +10 -1
  98. package/dist/components/text-area/index.js +21 -19
  99. package/dist/components/text-area/index.js.map +1 -1
  100. package/dist/components/text-field/index.d.ts +16 -2
  101. package/dist/components/text-field/index.js +49 -43
  102. package/dist/components/text-field/index.js.map +1 -1
  103. package/dist/components/time-picker/index.js +42 -38
  104. package/dist/components/time-picker/index.js.map +1 -1
  105. package/dist/components/tooltip/index.d.ts +3 -1
  106. package/dist/components/tooltip/index.js.map +1 -1
  107. package/dist/components/tree/index.d.ts +15 -3
  108. package/dist/components/tree/index.js +41 -28
  109. package/dist/components/tree/index.js.map +1 -1
  110. package/dist/control/index.js +26 -23
  111. package/dist/control/index.js.map +1 -1
  112. package/dist/control/styles.js +8 -1
  113. package/dist/control/styles.js.map +1 -1
  114. package/dist/field/index.js +149 -131
  115. package/dist/field/index.js.map +1 -1
  116. package/dist/field/styles.js +14 -1
  117. package/dist/field/styles.js.map +1 -1
  118. package/dist/glyphs/index.js +37 -1
  119. package/dist/glyphs/index.js.map +1 -1
  120. package/dist/hooks/useClippedTitle.js +44 -0
  121. package/dist/hooks/useClippedTitle.js.map +1 -0
  122. package/dist/hooks/useRipple.js +6 -5
  123. package/dist/hooks/useRipple.js.map +1 -1
  124. package/dist/hooks/useScrollStop.js +133 -0
  125. package/dist/hooks/useScrollStop.js.map +1 -0
  126. package/dist/i18n/index.js +1 -0
  127. package/dist/i18n/index.js.map +1 -1
  128. package/dist/i18n/messages.js +34 -0
  129. package/dist/i18n/messages.js.map +1 -1
  130. package/dist/index.d.ts +2 -2
  131. package/dist/indicator/index.js +18 -16
  132. package/dist/indicator/index.js.map +1 -1
  133. package/dist/indicator/styles.js +3 -0
  134. package/dist/indicator/styles.js.map +1 -1
  135. package/dist/keycap/context.js +7 -0
  136. package/dist/keycap/context.js.map +1 -0
  137. package/dist/navigation/index.d.ts +16 -2
  138. package/dist/navigation/index.js +145 -44
  139. package/dist/navigation/index.js.map +1 -1
  140. package/dist/navigation/styles.js +79 -16
  141. package/dist/navigation/styles.js.map +1 -1
  142. package/dist/overlay/modal.js +7 -0
  143. package/dist/overlay/modal.js.map +1 -0
  144. package/dist/row/index.js +92 -89
  145. package/dist/row/index.js.map +1 -1
  146. package/dist/row/styles.js +24 -1
  147. package/dist/row/styles.js.map +1 -1
  148. package/dist/styles/overlay.d.ts +6 -2
  149. package/dist/styles/overlay.js +9 -1
  150. package/dist/styles/overlay.js.map +1 -1
  151. package/dist/styles.css +177 -20
  152. package/dist/theme-scope.d.ts +5 -1
  153. package/dist/theme-scope.js +100 -51
  154. package/dist/theme-scope.js.map +1 -1
  155. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  156. package/package.json +21 -20
  157. package/dist/hooks/useScrollable.js +0 -69
  158. package/dist/hooks/useScrollable.js.map +0 -1
@@ -15,9 +15,10 @@ type NavigationRailProps = RenderComponentProps<'nav'> & {
15
15
  */
16
16
  isExpanded?: boolean;
17
17
  /**
18
- * The route of the current destination, matched against each
18
+ * The route of the current destination, matched exactly against each
19
19
  * destination's `href`. The match carries `aria-current="page"` and the
20
- * active indicator.
20
+ * active indicator. For a route nested under a destination, which no
21
+ * `href` matches whole, mark that destination with its own `isCurrent`.
21
22
  */
22
23
  selectedRoute?: string;
23
24
  };
@@ -2,11 +2,28 @@
2
2
  import { useRender } from "../../render/useRender.js";
3
3
  import { mergeStyles } from "../../styles/merge.js";
4
4
  import { NavigationContext } from "../../navigation/context.js";
5
- import { NavigationItem } from "../../navigation/index.js";
5
+ import { NavigationItem, NavigationList } from "../../navigation/index.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import "react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
  //#region src/components/navigation-rail/index.tsx
10
+ const styles = { destinations: {
11
+ kGNEyG: "x6s0dn4",
12
+ kSGwAc: "xkh2ocl",
13
+ kB7OPa: "x9f619",
14
+ k1xSpc: "x78zum5",
15
+ kCS8Yb: "xdl72j9",
16
+ kXwgrk: "xdt5ytf",
17
+ kzQI83: "x1iyjqo2",
18
+ kmuXW: "xs83m0k",
19
+ kqGvvJ: "x1fh6m6z",
20
+ kUOVxO: "xfll3lq",
21
+ kAzted: "x2lwn1j",
22
+ kORKVm: "x1odjw0f",
23
+ k8WAf4: "x12ulsxz",
24
+ kg3NbH: "xfn1xvj",
25
+ $$css: true
26
+ } };
10
27
  /**
11
28
  * The column of top-level destinations a medium or wider window keeps at its
12
29
  * leading edge, collapsed or, with `isExpanded`, expanded. Each destination
@@ -27,7 +44,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
27
44
  * The call site's `className` and `style` land on the `<nav>`.
28
45
  */
29
46
  function NavigationRail(t0) {
30
- const $ = c(34);
47
+ const $ = c(32);
31
48
  let children;
32
49
  let context;
33
50
  let header;
@@ -97,67 +114,57 @@ function NavigationRail(t0) {
97
114
  $[15] = t5;
98
115
  } else t5 = $[15];
99
116
  let t6;
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,
117
+ if ($[16] !== children) {
118
+ t6 = /* @__PURE__ */ jsx(NavigationList, {
119
+ layout: styles.destinations,
112
120
  children
113
121
  });
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 = {
122
+ $[16] = children;
123
+ $[17] = t6;
124
+ } else t6 = $[17];
125
+ let t7;
126
+ if ($[18] !== t5 || $[19] !== t6) {
127
+ t7 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t5, t6] });
128
+ $[18] = t5;
129
+ $[19] = t6;
130
+ $[20] = t7;
131
+ } else t7 = $[20];
132
+ let t8;
133
+ if ($[21] !== t1 || $[22] !== t2 || $[23] !== t7) {
134
+ t8 = {
128
135
  ...t1,
129
136
  ...t2,
130
- children: t9
137
+ children: t7
131
138
  };
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 = {
139
+ $[21] = t1;
140
+ $[22] = t2;
141
+ $[23] = t7;
142
+ $[24] = t8;
143
+ } else t8 = $[24];
144
+ let t9;
145
+ if ($[25] !== render || $[26] !== t3 || $[27] !== t8) {
146
+ t9 = {
140
147
  defaultTagName: t3,
141
- props: t10,
148
+ props: t8,
142
149
  render
143
150
  };
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, {
151
+ $[25] = render;
152
+ $[26] = t3;
153
+ $[27] = t8;
154
+ $[28] = t9;
155
+ } else t9 = $[28];
156
+ const rail = t4(t9);
157
+ let t10;
158
+ if ($[29] !== context || $[30] !== rail) {
159
+ t10 = /* @__PURE__ */ jsx(NavigationContext, {
153
160
  value: context,
154
161
  children: rail
155
162
  });
156
- $[31] = context;
157
- $[32] = rail;
158
- $[33] = t12;
159
- } else t12 = $[33];
160
- return t12;
163
+ $[29] = context;
164
+ $[30] = rail;
165
+ $[31] = t10;
166
+ } else t10 = $[31];
167
+ return t10;
161
168
  }
162
169
  /**
163
170
  * 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","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,IAAIgB,KAAK;EAACZ,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAL;EAAAK,EAAA,KAAAJ;EAAAI,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO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AAgB;CAAA,IAAAhB,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAc,IAAA;EA/BAE,MAAA;GAAA,GACFJ;GAAK,GACLP;GAOyBJ,UAClBa;EAsBZ;EAACd,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAc;EAAAd,EAAA,MAAAgB;CAAA,OAAAA,MAAAhB,EAAA;CAAA,IAAAuB;CAAA,IAAAvB,EAAA,QAAAG,UAAAH,EAAA,QAAAgB,OAAAhB,EAAA,QAAAM,IAAA;EAlCoBiB,MAAA;GAAAC,gBACLlB;GAAKM,OACdI;GAgCNb;EAEH;EAACH,EAAA,MAAAG;EAAAH,EAAA,MAAAgB;EAAAhB,EAAA,MAAAM;EAAAN,EAAA,MAAAuB;CAAA,OAAAA,MAAAvB,EAAA;CApCD,MAAAyB,OAAapC,GAAUkC,GAoCtB;CAAE,IAAAG;CAAA,IAAA1B,EAAA,QAAAE,WAAAF,EAAA,QAAAyB,MAAA;EACIC,MAAA,oBAAC,mBAAD;GAA0BxB,OAAAA;GAAUuB,UAAAA;EAAlB,CAAA;EAA2CzB,EAAA,MAAAE;EAAAF,EAAA,MAAAyB;EAAAzB,EAAA,MAAA0B;CAAA,OAAAA,MAAA1B,EAAA;CAAA,OAA7D0B;AAA6D;;;;;;;;;;AAYtE,SAAAC,mBAAAf,OAAA;CAAA,MAAAZ,IAAApB,EAAA,CAAA;CAAA,IAAAmB;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,eAAe8B,OAAOD"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","stylex","useMemo","NavigationItemProps","RenderComponentProps","NavigationItem","NavigationList","NavigationContext","useRender","mergeStyles","colors","spacing","RING_REACH","styles","destinations","kGNEyG","kSGwAc","kB7OPa","k1xSpc","kCS8Yb","kXwgrk","kzQI83","kmuXW","kqGvvJ","kUOVxO","kAzted","kORKVm","k8WAf4","kg3NbH","$$css","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, NavigationList } 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// A collapsed destination's label stays on one line in the 88dp under its\n// indicator, about thirteen characters of label medium. A longer one is cut\n// short with an ellipsis and shows its full text in the browser's tooltip on\n// hover — see `src/navigation`. The expanded rail's labels sit beside their\n// icons, with the rest of the rail's 360dp at most.\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';\nconst styles = {\n destinations: {\n kGNEyG: \"x6s0dn4\",\n kSGwAc: \"xkh2ocl\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"xdl72j9\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kmuXW: \"xs83m0k\",\n kqGvvJ: \"x1fh6m6z\",\n kUOVxO: \"xfll3lq\",\n kAzted: \"x2lwn1j\",\n kORKVm: \"x1odjw0f\",\n k8WAf4: \"x12ulsxz\",\n kg3NbH: \"xfn1xvj\",\n $$css: true\n }\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 exactly against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator. For a route nested under a destination, which no\n * `href` matches whole, mark that destination with its own `isCurrent`.\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 <NavigationList layout={styles.destinations}>\n {children}\n </NavigationList>\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":";;;;;;;;;AAwCA,MAAMgB,SAAS,EACbC,cAAc;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;A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AM;EAAAN,EAAA,MAAAW;EAAAX,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CA7BD,MAAAsB,OAAalD,GAAU0C,EA6BtB;CAAE,IAAAE;CAAA,IAAAhB,EAAA,QAAAE,WAAAF,EAAA,QAAAsB,MAAA;EACIN,MAAA,oBAAC,mBAAD;GAA0Bd,OAAAA;GAAUoB,UAAAA;EAAlB,CAAA;EAA2CtB,EAAA,MAAAE;EAAAF,EAAA,MAAAsB;EAAAtB,EAAA,MAAAgB;CAAA,OAAAA,MAAAhB,EAAA;CAAA,OAA7DgB;AAA6D;;;;;;;;;;AAYtE,SAAAO,mBAAAX,OAAA;CAAA,MAAAZ,IAAAtC,EAAA,CAAA;CAAA,IAAAqC;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"}
@@ -55,7 +55,10 @@ function itemContent(label, leading, supporting, trailing, ripple) {
55
55
  trailing,
56
56
  variant: "drawer",
57
57
  children: label
58
- }), state.isDisabled ? null : ripple] });
58
+ }), state.isDisabled ? null : /* @__PURE__ */ jsx("span", {
59
+ ...props(rowStyles.drawerSurface),
60
+ children: ripple
61
+ })] });
59
62
  }
60
63
  function itemStyles(state) {
61
64
  return props(rowStyles.base, rowStyles.drawer, styles.indent, state.isCurrent && rowStyles.selectedDrawer, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","NavigationTreeItemRenderProps","NavigationTreeItemProps","RACNavigationTreeItemProps","NavigationTreeProps","RACNavigationTreeProps","stylex","Button","RACButton","NavigationTree","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","NavigationTreeItemContent","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection","collectionStyles","ChevronEndGlyph","useRipple","RowContent","rowStyles","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","typography","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","indent","kZCmMZ","NavigationTreeHeaderProps","children","NavigationTreeItemText","Omit","T","className","leading","style","supporting","trailing","label","textValue","NavigationTreeSectionProps","Parameters","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","ripple","isDisabled","isCurrentAncestor","isCurrent","leadingFor","itemStyles","base","drawer","selectedDrawer","isHovered","hovered","isFocusVisible","focusVisible","isPressed","pressed","disabled","$","t0","container","t1","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","T0","t2","textValueFor","t3","handlers","t4","t5","surface","t6","t7","section","undefined","Item","Section","stylex.props","RACButton","NavigationTree","_c","props","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection"],"sources":["../../../src/components/navigation-tree/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { NavigationTreeItemRenderProps, NavigationTreeItemProps as RACNavigationTreeItemProps, NavigationTreeProps as RACNavigationTreeProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NavigationTree as RACNavigationTree, NavigationTreeHeader as RACNavigationTreeHeader, NavigationTreeItem as RACNavigationTreeItem, NavigationTreeItemContent as RACNavigationTreeItemContent, NavigationTreeSection as RACNavigationTreeSection } from 'react-aria-components';\nimport { collectionStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The navigation drawer page's contents: a nested set of links with the\n// current one marked. For an app's top-level destinations Material Design has\n// the expanded navigation rail replace the drawer, and NavigationRail draws\n// it; this is for a tree of links nested deeper than a rail holds. Each row is\n// the row every list here draws — `src/row`, shared with ListItem, ListBox,\n// List, Tree and Disclosure — under that module's `drawer` variant, which is\n// the page's own 56dp row with a label-large label and a secondary-container\n// pill on the current one.\n//\n// This is Tree's shape over React Aria's navigation primitive, and the\n// difference is what the two are for. A tree selects: rows are chosen and\n// the choice is reported. A navigation tree navigates: each row is a link,\n// and which one is current is decided by matching the route rather than by\n// anything the reader selected. So this takes `selectedRoute` where Tree\n// takes `selectedKeys`, and has no selection at all — React Aria omits every\n// selection prop from it.\n//\n// Three things are this component's own.\n//\n// **A level indents by one caret's width**, exactly as Tree does and for the\n// same reason: React Aria writes the depth on each row as a custom property,\n// and 24dp is the size the drawer page gives its icon, so a level of nesting\n// is as wide as the glyph beside it.\n//\n// **An ancestor of the current row is marked too, and softly.** React Aria\n// reports it, and a drawer whose current row is collapsed out of sight would\n// otherwise show nothing at all. It takes the label's weight rather than the\n// pill, so the trail reads as a trail rather than as a second current row.\n//\n// That weight goes on the label itself, through the row module's\n// `isEmphasized`, and it has to: the row's own `font-weight` never reaches\n// the text, since `RowContent` draws the label in a span stating the\n// label-large role in full, weight included. The pair also has to differ by\n// more than a step — the label's own weight is already the medium one, so a\n// trail set in medium is a trail nobody can see.\n//\n// **The pill's shape is the library's own.** The page gives the active\n// indicator's colour, height and width but keeps its shape behind a token\n// set that does not open to a script — the same gap recorded on the buttons\n// and lists pages. It is drawn as a full pill, which is what the page's own\n// images show and what 56dp of height comes to.\n\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype NavigationTreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype NavigationTreeItemProps<T extends object = object> = NavigationTreeItemText & Omit<RACNavigationTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & {\n /** The rows nested under this one, as further `NavigationTree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACNavigationTreeItemProps<T>['className'];\n /** Content before the label: an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACNavigationTreeItemProps<T>['style'];\n /** A second line under the label, in the muted role. */\n supporting?: ReactNode;\n /** Content after the label, such as a count. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a row here wraps\n// its label in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string label is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype NavigationTreeItemText = {\n /** The row's label — where it goes. */\n label: string;\n /** What typeahead matches the row on. Defaults to the label. */\n textValue?: string;\n} | {\n /** The row's label, as something other than a plain string. */\n label?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype NavigationTreeProps<T extends object = object> = Omit<RACNavigationTreeProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the tree's render state. */\n className?: RACNavigationTreeProps<T>['className'];\n /** A function may compute the style from the tree's render state. */\n style?: RACNavigationTreeProps<T>['style'];\n};\ntype NavigationTreeSectionProps<T extends object = object> = Omit<Parameters<typeof RACNavigationTreeSection<T>>[0], 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its label lines up with the\n// label of a sibling that opens.\nfunction chevronFor(state: NavigationTreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then whatever the row was given — one order, always, which is what keeps a\n// column of rows reading down.\nfunction itemContent(label: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode, ripple: ReactNode) {\n return (state: NavigationTreeItemRenderProps): ReactNode => <>\n <RowContent isDisabled={state.isDisabled} isEmphasized={state.isCurrentAncestor} isSelected={state.isCurrent} leading={leadingFor(state, leading)} supporting={supporting} trailing={trailing} variant=\"drawer\">\n {label}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\n\n// StyleX cannot target `[data-current]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the current container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled row, so nothing has to outrank them.\n// No overline, and so no three-line row: the navigation drawer page gives\n// one item height and one line of text. `List.Item` and `ListBox.Item` take\n// the prop because the lists page is what they draw; this row follows the\n// drawer's own metrics.\nfunction itemStyles(state: NavigationTreeItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.drawer, styles.indent, state.isCurrent && rowStyles.selectedDrawer, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * The caret, then whatever the row was given. Its return type is written out\n * rather than inferred: `ReactNode` is a union that includes a promise, and\n * a function inferred as returning one has to be `async`.\n */\nfunction leadingFor(state: NavigationTreeItemRenderProps, leading: ReactNode): ReactNode {\n return <>\n {chevronFor(state)}\n {leading}\n </>;\n}\n\n/**\n * A nested set of links, with the current one marked. Which row is current\n * is React Aria's: give the tree a `selectedRoute` and each row an `href`,\n * and the row whose `href` matches is the current one — its ancestors are\n * marked too, so a collapsed trail still shows where you are.\n *\n * ```tsx\n * <NavigationTree aria-label=\"Label\" selectedRoute=\"#second\">\n * <NavigationTree.Item href=\"#first\" id=\"first\" label=\"First item\">\n * <NavigationTree.Item href=\"#second\" id=\"second\" label=\"Second item\" />\n * </NavigationTree.Item>\n * </NavigationTree>\n * ```\n *\n * There is no selection here, and that is React Aria's design rather than an\n * omission: a navigation tree navigates, so what is current comes from the\n * route rather than from anything the reader picked. `Tree` is the one that\n * selects.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction NavigationTree<T extends object>(props: NavigationTreeProps<T> & RefAttributes<HTMLDivElement>) {\n return <RACNavigationTree<T> {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction NavigationTreeHeader({\n children\n}: NavigationTreeHeaderProps) {\n return <RACNavigationTreeHeader className=\"x9f619 x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xw3mh6e x1clyivc x140yoea\">\n {children}\n </RACNavigationTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Give it an `href` — that is what\n * `selectedRoute` is matched against — and an `id`, which is the key\n * expansion is reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret.\n */\nfunction NavigationTreeItem<T extends object = object>({\n children,\n label,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n supporting,\n textValue,\n trailing,\n ...props\n}: NavigationTreeItemProps<T> & RefAttributes<HTMLDivElement>) {\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACNavigationTreeItem<T> textValue={textValueFor(textValue, label)} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n <RACNavigationTreeItemContent>\n {itemContent(label, leading, supporting, trailing, ripple.surface)}\n </RACNavigationTreeItemContent>\n {children}\n </RACNavigationTreeItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction NavigationTreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: NavigationTreeSectionProps<T> & RefAttributes<HTMLDivElement>) {\n return <RACNavigationTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <NavigationTreeHeader>{header}</NavigationTreeHeader>}\n {children}\n </RACNavigationTreeSection>;\n}\n\n// What React Aria matches typeahead on, and what names the row.\n// `NavigationTreeItemText` makes one of the two a string, so the last branch\n// is unreachable through the public type — it is there because destructuring\n// the two apart is what loses the narrowing, not because a row can arrive\n// without either.\nfunction textValueFor(textValue: string | undefined, label: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof label === 'string' ? label : '';\n}\nNavigationTree.Item = NavigationTreeItem;\nNavigationTree.Section = NavigationTreeSection;\nexport type { NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSectionProps };\nexport { NavigationTreeItem, NavigationTreeSection };\nexport default NavigationTree;"],"mappings":";;;;;;;;;;;;;AA0DA,MAAMmC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRF,OAAO;CACT;AACF;AA0DA,SAASkB,mBAAmB;CAC1B,OAAOzD,MAAa0B,OAAOC,SAAST,MAAMyC,IAAI,CAAC,CAACZ,aAAa;AAC/D;AASA,SAASa,WAAWC,OAAiD;CACnE,IAAI,CAACA,MAAMC,eACT,OAAO,oBAAC,QAAD,EAAM,WAAU,0BAAyB,CAAA;CAElD,OAAO,oBAAC2C,QAAD;EAAW,WAAWhD;EAAkB,MAAK;EAChD,UAAA,oBAAC,iBAAD,EAAiB,GAAI;GACrB,GAAG,EACDV,WAAW,qEACb;GACA,GAAG,EACDA,WAAW,qEACb;EACF,EAAE,CAAC,CAACc,MAAME,cAAc,GAAG,CAAA;CAChB,CAAA;AACf;AAKA,SAASC,YAAYZ,OAAkBJ,SAAoBE,YAAuBC,UAAqBc,QAAmB;CACxH,QAAQJ,UAAoD,qBAAA,UAAA,EAAA,UAAA,CACxD,oBAAC,YAAD;EAAY,YAAYA,MAAMK;EAAY,cAAcL,MAAMM;EAAmB,YAAYN,MAAMO;EAAW,SAASC,WAAWR,OAAOb,OAAO;EAAeE;EAAsBC;EAAU,SAAQ;EACpMC,UAAAA;CACS,CAAA,GACXS,MAAMK,aAAa,OAAOD,MAC7B,EAAA,CAAA;AACJ;AAYA,SAASK,WAAWT,OAAsC;CACxD,OAAO7D,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T,EAAA;EAAAtC,WAAAsC,EAAA;EAAAzB,SAAAyB,EAAA;EAAAG,KAAAH,EAAA;EAAAU,KAAAV,EAAA;CAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,OAAAzB,QAAA;EACxGqC,KAAArC,WAAW6C,KAAAA,IAAX,OAA8B,oBAACS,wBAAD,EAAA,UAAuBtD,OAAF,CAAA;EAAgCyB,EAAA,KAAAzB;EAAAyB,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAS,MAAAT,EAAA,OAAAtC,YAAAsC,EAAA,QAAAG,MAAAH,EAAA,QAAAU,MAAAV,EAAA,QAAAY,IAAA;EADjFE,KAAA,qBAAC,IAAD;GAAyB,GAAQrC;GAAK,GAAMiC;GAA5C,UAAA,CACFE,IACAlD,QAF2B;;EAGHsC,EAAA,KAAAS;EAAAT,EAAA,KAAAtC;EAAAsC,EAAA,MAAAG;EAAAH,EAAA,MAAAU;EAAAV,EAAA,MAAAY;EAAAZ,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAHtBc;AAGsB;AAQ/B,SAASH,aAAavC,WAA+BD,OAAkB;CACrE,IAAIC,cAAcgD,KAAAA,GAChB,OAAOhD;CAET,OAAO,OAAOD,UAAU,WAAWA,QAAQ;AAC7C;AACAjD,iBAAemG,OAAO/F;AACtBJ,iBAAeoG,UAAU5F"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","NavigationTreeItemRenderProps","NavigationTreeItemProps","RACNavigationTreeItemProps","NavigationTreeProps","RACNavigationTreeProps","stylex","Button","RACButton","NavigationTree","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","NavigationTreeItemContent","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection","collectionStyles","ChevronEndGlyph","useRipple","RowContent","rowStyles","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","typography","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","indent","kZCmMZ","NavigationTreeHeaderProps","children","NavigationTreeItemText","Omit","T","className","leading","style","supporting","trailing","label","textValue","NavigationTreeSectionProps","Parameters","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","ripple","isDisabled","isCurrentAncestor","isCurrent","leadingFor","drawerSurface","itemStyles","base","drawer","selectedDrawer","isHovered","hovered","isFocusVisible","focusVisible","isPressed","pressed","disabled","$","t0","container","t1","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","T0","t2","textValueFor","t3","handlers","t4","t5","surface","t6","t7","section","undefined","Item","Section","stylex.props","RACButton","NavigationTree","_c","props","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection"],"sources":["../../../src/components/navigation-tree/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { NavigationTreeItemRenderProps, NavigationTreeItemProps as RACNavigationTreeItemProps, NavigationTreeProps as RACNavigationTreeProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NavigationTree as RACNavigationTree, NavigationTreeHeader as RACNavigationTreeHeader, NavigationTreeItem as RACNavigationTreeItem, NavigationTreeItemContent as RACNavigationTreeItemContent, NavigationTreeSection as RACNavigationTreeSection } from 'react-aria-components';\nimport { collectionStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The navigation drawer page's contents: a nested set of links with the\n// current one marked. For an app's top-level destinations Material Design has\n// the expanded navigation rail replace the drawer, and NavigationRail draws\n// it; this is for a tree of links nested deeper than a rail holds. Each row is\n// the row every list here draws — `src/row`, shared with ListItem, ListBox,\n// List, Tree and Disclosure — under that module's `drawer` variant, which is\n// the page's own 56dp row with a label-large label and a secondary-container\n// pill on the current one.\n//\n// This is Tree's shape over React Aria's navigation primitive, and the\n// difference is what the two are for. A tree selects: rows are chosen and\n// the choice is reported. A navigation tree navigates: each row is a link,\n// and which one is current is decided by matching the route rather than by\n// anything the reader selected. So this takes `selectedRoute` where Tree\n// takes `selectedKeys`, and has no selection at all — React Aria omits every\n// selection prop from it.\n//\n// Three things are this component's own.\n//\n// **A level indents by one caret's width**, exactly as Tree does and for the\n// same reason: React Aria writes the depth on each row as a custom property,\n// and 24dp is the size the drawer page gives its icon, so a level of nesting\n// is as wide as the glyph beside it.\n//\n// **An ancestor of the current row is marked too, and softly.** React Aria\n// reports it, and a drawer whose current row is collapsed out of sight would\n// otherwise show nothing at all. It takes the label's weight rather than the\n// pill, so the trail reads as a trail rather than as a second current row.\n//\n// That weight goes on the label itself, through the row module's\n// `isEmphasized`, and it has to: the row's own `font-weight` never reaches\n// the text, since `RowContent` draws the label in a span stating the\n// label-large role in full, weight included. The pair also has to differ by\n// more than a step — the label's own weight is already the medium one, so a\n// trail set in medium is a trail nobody can see.\n//\n// **The pill's shape is the library's own.** The page gives the active\n// indicator's colour, height and width but keeps its shape behind a token\n// set that does not open to a script — the same gap recorded on the buttons\n// and lists pages. It is drawn as a full pill, which is what the page's own\n// images show and what 56dp of height comes to.\n\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype NavigationTreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype NavigationTreeItemProps<T extends object = object> = NavigationTreeItemText & Omit<RACNavigationTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & {\n /** The rows nested under this one, as further `NavigationTree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACNavigationTreeItemProps<T>['className'];\n /** Content before the label: an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACNavigationTreeItemProps<T>['style'];\n /** A second line under the label, in the muted role. */\n supporting?: ReactNode;\n /** Content after the label, such as a count. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a row here wraps\n// its label in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string label is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype NavigationTreeItemText = {\n /** The row's label — where it goes. */\n label: string;\n /** What typeahead matches the row on. Defaults to the label. */\n textValue?: string;\n} | {\n /** The row's label, as something other than a plain string. */\n label?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype NavigationTreeProps<T extends object = object> = Omit<RACNavigationTreeProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the tree's render state. */\n className?: RACNavigationTreeProps<T>['className'];\n /** A function may compute the style from the tree's render state. */\n style?: RACNavigationTreeProps<T>['style'];\n};\ntype NavigationTreeSectionProps<T extends object = object> = Omit<Parameters<typeof RACNavigationTreeSection<T>>[0], 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its label lines up with the\n// label of a sibling that opens.\nfunction chevronFor(state: NavigationTreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then whatever the row was given — one order, always, which is what keeps a\n// column of rows reading down. The ripple goes in a box carrying the row's\n// pill — see `drawerSurface` in src/row/styles.ts.\nfunction itemContent(label: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode, ripple: ReactNode) {\n return (state: NavigationTreeItemRenderProps): ReactNode => <>\n <RowContent isDisabled={state.isDisabled} isEmphasized={state.isCurrentAncestor} isSelected={state.isCurrent} leading={leadingFor(state, leading)} supporting={supporting} trailing={trailing} variant=\"drawer\">\n {label}\n </RowContent>\n {state.isDisabled ? null : <span {...stylex.props(rowStyles.drawerSurface)}>{ripple}</span>}\n </>;\n}\n\n// StyleX cannot target `[data-current]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the current container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled row, so nothing has to outrank them.\n// No overline, and so no three-line row: the navigation drawer page gives\n// one item height and one line of text. `List.Item` and `ListBox.Item` take\n// the prop because the lists page is what they draw; this row follows the\n// drawer's own metrics.\nfunction itemStyles(state: NavigationTreeItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.drawer, styles.indent, state.isCurrent && rowStyles.selectedDrawer, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * The caret, then whatever the row was given. Its return type is written out\n * rather than inferred: `ReactNode` is a union that includes a promise, and\n * a function inferred as returning one has to be `async`.\n */\nfunction leadingFor(state: NavigationTreeItemRenderProps, leading: ReactNode): ReactNode {\n return <>\n {chevronFor(state)}\n {leading}\n </>;\n}\n\n/**\n * A nested set of links, with the current one marked. Which row is current\n * is React Aria's: give the tree a `selectedRoute` and each row an `href`,\n * and the row whose `href` matches is the current one — its ancestors are\n * marked too, so a collapsed trail still shows where you are.\n *\n * ```tsx\n * <NavigationTree aria-label=\"Label\" selectedRoute=\"#second\">\n * <NavigationTree.Item href=\"#first\" id=\"first\" label=\"First item\">\n * <NavigationTree.Item href=\"#second\" id=\"second\" label=\"Second item\" />\n * </NavigationTree.Item>\n * </NavigationTree>\n * ```\n *\n * There is no selection here, and that is React Aria's design rather than an\n * omission: a navigation tree navigates, so what is current comes from the\n * route rather than from anything the reader picked. `Tree` is the one that\n * selects.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction NavigationTree<T extends object>(props: NavigationTreeProps<T> & RefAttributes<HTMLDivElement>) {\n return <RACNavigationTree<T> {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction NavigationTreeHeader({\n children\n}: NavigationTreeHeaderProps) {\n return <RACNavigationTreeHeader className=\"x9f619 x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xw3mh6e x1clyivc x140yoea\">\n {children}\n </RACNavigationTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Give it an `href` — that is what\n * `selectedRoute` is matched against — and an `id`, which is the key\n * expansion is reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret.\n */\nfunction NavigationTreeItem<T extends object = object>({\n children,\n label,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n supporting,\n textValue,\n trailing,\n ...props\n}: NavigationTreeItemProps<T> & RefAttributes<HTMLDivElement>) {\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACNavigationTreeItem<T> textValue={textValueFor(textValue, label)} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n <RACNavigationTreeItemContent>\n {itemContent(label, leading, supporting, trailing, ripple.surface)}\n </RACNavigationTreeItemContent>\n {children}\n </RACNavigationTreeItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction NavigationTreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: NavigationTreeSectionProps<T> & RefAttributes<HTMLDivElement>) {\n return <RACNavigationTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <NavigationTreeHeader>{header}</NavigationTreeHeader>}\n {children}\n </RACNavigationTreeSection>;\n}\n\n// What React Aria matches typeahead on, and what names the row.\n// `NavigationTreeItemText` makes one of the two a string, so the last branch\n// is unreachable through the public type — it is there because destructuring\n// the two apart is what loses the narrowing, not because a row can arrive\n// without either.\nfunction textValueFor(textValue: string | undefined, label: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof label === 'string' ? label : '';\n}\nNavigationTree.Item = NavigationTreeItem;\nNavigationTree.Section = NavigationTreeSection;\nexport type { NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSectionProps };\nexport { NavigationTreeItem, NavigationTreeSection };\nexport default NavigationTree;"],"mappings":";;;;;;;;;;;;;AA0DA,MAAMmC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRF,OAAO;CACT;AACF;AA0DA,SAASkB,mBAAmB;CAC1B,OAAOzD,MAAa0B,OAAOC,SAAST,MAAMyC,IAAI,CAAC,CAACZ,aAAa;AAC/D;AASA,SAASa,WAAWC,OAAiD;CACnE,IAAI,CAACA,MAAMC,eACT,OAAO,oBAAC,QAAD,EAAM,WAAU,0BAAyB,CAAA;CAElD,OAAO,oBAAC4C,QAAD;EAAW,WAAWjD;EAAkB,MAAK;EAChD,UAAA,oBAAC,iBAAD,EAAiB,GAAI;GACrB,GAAG,EACDV,WAAW,qEACb;GACA,GAAG,EACDA,WAAW,qEACb;EACF,EAAE,CAAC,CAACc,MAAME,cAAc,GAAG,CAAA;CAChB,CAAA;AACf;AAMA,SAASC,YAAYZ,OAAkBJ,SAAoBE,YAAuBC,UAAqBc,QAAmB;CACxH,QAAQJ,UAAoD,qBAAA,UAAA,EAAA,UAAA,CACxD,oBAAC,YAAD;EAAY,YAAYA,MAAMK;EAAY,cAAcL,MAAMM;EAAmB,YAAYN,MAAMO;EAAW,SAASC,WAAWR,OAAOb,OAAO;EAAeE;EAAsBC;EAAU,SAAQ;EACpMC,UAAAA;CACS,CAAA,GACXS,MAAMK,aAAa,OAAO,oBAAC,QAAD;EAAM,GAAIlE,MAAaiB,UAAUqD,aAAa;EAAIL,UAAAA;CAAa,CAAA,CAC5F,EAAA,CAAA;AACJ;AAYA,SAASM,WAAWV,OAAsC;CACxD,OAAO7D,MAAaiB,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AT,EAAA;EAAAvC,WAAAuC,EAAA;EAAA1B,SAAA0B,EAAA;EAAAG,KAAAH,EAAA;EAAAU,KAAAV,EAAA;CAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,OAAA1B,QAAA;EACxGsC,KAAAtC,WAAW8C,KAAAA,IAAX,OAA8B,oBAACS,wBAAD,EAAA,UAAuBvD,OAAF,CAAA;EAAgC0B,EAAA,KAAA1B;EAAA0B,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAS,MAAAT,EAAA,OAAAvC,YAAAuC,EAAA,QAAAG,MAAAH,EAAA,QAAAU,MAAAV,EAAA,QAAAY,IAAA;EADjFE,KAAA,qBAAC,IAAD;GAAyB,GAAQtC;GAAK,GAAMkC;GAA5C,UAAA,CACFE,IACAnD,QAF2B;;EAGHuC,EAAA,KAAAS;EAAAT,EAAA,KAAAvC;EAAAuC,EAAA,MAAAG;EAAAH,EAAA,MAAAU;EAAAV,EAAA,MAAAY;EAAAZ,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAHtBc;AAGsB;AAQ/B,SAASH,aAAaxC,WAA+BD,OAAkB;CACrE,IAAIC,cAAciD,KAAAA,GAChB,OAAOjD;CAET,OAAO,OAAOD,UAAU,WAAWA,QAAQ;AAC7C;AACAjD,iBAAeoG,OAAOhG;AACtBJ,iBAAeqG,UAAU7F"}
@@ -66,10 +66,11 @@ type NumberFieldProps$1 = {
66
66
  /**
67
67
  * How the two steppers sit at the end of the box: stacked, the plus over
68
68
  * the minus, flush with the box's edge, or side by side as extra-small
69
- * icon buttons.
69
+ * icon buttons. `'none'` draws neither, for a value that is typed rather
70
+ * than stepped; the keyboard still steps it.
70
71
  * @default 'vertical'
71
72
  */
72
- steppers?: 'horizontal' | 'vertical';
73
+ steppers?: 'horizontal' | 'none' | 'vertical';
73
74
  /**
74
75
  * The filled box, or the outlined one: no fill, an outline that thickens
75
76
  * and takes the primary role while focused, and the label cutting it once
@@ -3,8 +3,8 @@ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
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
- import IconButton from "../icon-button/index.js";
7
6
  import { fieldStyles, invalidFrom, useFieldValidationBehavior } from "../../field/root.js";
7
+ import IconButton from "../icon-button/index.js";
8
8
  import { FieldBox, FieldInput, FieldMessage } from "../../field/index.js";
9
9
  import { c } from "react/compiler-runtime";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -14,7 +14,11 @@ import { Button, NumberField } from "react-aria-components";
14
14
  `${spacing.lg}${typography.bodyLargeLineHeight}`;
15
15
  `${typography.bodyLargeLineHeight}${sizing.controlXs}`;
16
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})`;
17
+ const END_INSETS = {
18
+ horizontal: `calc(2 * ${sizing.controlXs} + ${spacing.sm} + ${spacing.md} - ${spacing.lg} + ${spacing.sm})`,
19
+ none: void 0,
20
+ vertical: STACKED_INSET
21
+ };
18
22
  const styles = {
19
23
  stepper: {
20
24
  k6CgDc: "x12w9bfk",
@@ -84,7 +88,7 @@ const styles = {
84
88
  * are the field chrome in `src/field`, shared with every other field.
85
89
  */
86
90
  function NumberField$1(t0) {
87
- const $ = c(39);
91
+ const $ = c(30);
88
92
  const { decrementLabel, description, error, floatingLabel: t1, incrementLabel, inputRef, isDisabled: t2, isWheelDisabled: t3, label, numeric: t4, steppers: t5, variant: t6, ...props$1 } = t0;
89
93
  const floatingLabel = t1 === void 0 ? true : t1;
90
94
  const isDisabled = t2 === void 0 ? false : t2;
@@ -102,138 +106,110 @@ function NumberField$1(t0) {
102
106
  $[1] = t7;
103
107
  } else t7 = $[1];
104
108
  const t8 = mergeStatefulStyles(props(fieldStyles.root), props$1);
105
- const t9 = inline ? INLINE_INSET : STACKED_INSET;
109
+ const t9 = END_INSETS[steppers];
106
110
  let t10;
107
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
108
- t10 = {
109
- 0: { className: "x1cy8zhl x9f619 x78zum5 x126z3so" },
110
- 1: { className: "x9f619 x78zum5 x126z3so x6s0dn4" }
111
- };
112
- $[2] = t10;
113
- } else t10 = $[2];
114
- const t11 = t10[!!inline << 0];
115
- let t12;
116
- if ($[3] !== inputRef || $[4] !== numeric) {
117
- t12 = /* @__PURE__ */ jsx(FieldInput, {
111
+ if ($[2] !== decrementLabel || $[3] !== incrementLabel || $[4] !== inline || $[5] !== inputRef || $[6] !== numeric || $[7] !== steppers || $[8] !== variant) {
112
+ t10 = steppers === "none" ? /* @__PURE__ */ jsx(FieldInput, {
118
113
  numeric,
119
114
  ref: inputRef
115
+ }) : /* @__PURE__ */ jsxs("div", {
116
+ ...{
117
+ 0: { className: "x1cy8zhl x9f619 x78zum5 x126z3so" },
118
+ 1: { className: "x9f619 x78zum5 x126z3so x6s0dn4" }
119
+ }[!!inline << 0],
120
+ children: [/* @__PURE__ */ jsx(FieldInput, {
121
+ numeric,
122
+ ref: inputRef
123
+ }), /* @__PURE__ */ jsx("div", {
124
+ ...{
125
+ 0: { className: "x9f619 x78zum5 xdt5ytf x2lah0s x1motrhk xk4mfur" },
126
+ 2: { className: "x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x6rec7h x1tn5xpv" },
127
+ 1: { className: "x9f619 x78zum5 xdt5ytf x2lah0s xk4mfur x17v9ssf" },
128
+ 3: { className: "x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x1tn5xpv x17v9ssf" }
129
+ }[!!inline << 1 | !!(!inline && variant === "outlined") << 0],
130
+ children: inline ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
131
+ "aria-label": decrementLabel,
132
+ size: "xs",
133
+ slot: "decrement",
134
+ children: /* @__PURE__ */ jsx(MinusGlyph, { className: "xlzyvqe x1lliihq x15vhz18" })
135
+ }), /* @__PURE__ */ jsx(IconButton, {
136
+ "aria-label": incrementLabel,
137
+ size: "xs",
138
+ slot: "increment",
139
+ children: /* @__PURE__ */ jsx(PlusGlyph, { className: "xlzyvqe x1lliihq x15vhz18" })
140
+ })] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(StackedStepper, {
141
+ label: incrementLabel,
142
+ outlined: variant === "outlined",
143
+ slot: "increment",
144
+ children: /* @__PURE__ */ jsx(PlusGlyph, { className: "x1qx5ct2 x1lliihq xw4jnvo" })
145
+ }), /* @__PURE__ */ jsx(StackedStepper, {
146
+ label: decrementLabel,
147
+ outlined: variant === "outlined",
148
+ slot: "decrement",
149
+ children: /* @__PURE__ */ jsx(MinusGlyph, { className: "x1qx5ct2 x1lliihq xw4jnvo" })
150
+ })] })
151
+ })]
120
152
  });
121
- $[3] = inputRef;
122
- $[4] = numeric;
123
- $[5] = t12;
124
- } else t12 = $[5];
125
- let t13;
126
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
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" }
132
- };
133
- $[6] = t13;
134
- } else t13 = $[6];
135
- const t14 = t13[!!inline << 1 | !!(!inline && variant === "outlined") << 0];
136
- let t15;
137
- if ($[7] !== decrementLabel || $[8] !== incrementLabel || $[9] !== inline || $[10] !== variant) {
138
- t15 = inline ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
139
- "aria-label": decrementLabel,
140
- size: "xs",
141
- slot: "decrement",
142
- children: /* @__PURE__ */ jsx(MinusGlyph, { className: "xlzyvqe x1lliihq x15vhz18" })
143
- }), /* @__PURE__ */ jsx(IconButton, {
144
- "aria-label": incrementLabel,
145
- size: "xs",
146
- slot: "increment",
147
- children: /* @__PURE__ */ jsx(PlusGlyph, { className: "xlzyvqe x1lliihq x15vhz18" })
148
- })] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(StackedStepper, {
149
- label: incrementLabel,
150
- outlined: variant === "outlined",
151
- slot: "increment",
152
- children: /* @__PURE__ */ jsx(PlusGlyph, { className: "x1qx5ct2 x1lliihq xw4jnvo" })
153
- }), /* @__PURE__ */ jsx(StackedStepper, {
154
- label: decrementLabel,
155
- outlined: variant === "outlined",
156
- slot: "decrement",
157
- children: /* @__PURE__ */ jsx(MinusGlyph, { className: "x1qx5ct2 x1lliihq xw4jnvo" })
158
- })] });
159
- $[7] = decrementLabel;
160
- $[8] = incrementLabel;
161
- $[9] = inline;
162
- $[10] = variant;
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
170
- });
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]
180
- });
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, {
153
+ $[2] = decrementLabel;
154
+ $[3] = incrementLabel;
155
+ $[4] = inline;
156
+ $[5] = inputRef;
157
+ $[6] = numeric;
158
+ $[7] = steppers;
159
+ $[8] = variant;
160
+ $[9] = t10;
161
+ } else t10 = $[9];
162
+ let t11;
163
+ if ($[10] !== floatingLabel || $[11] !== label || $[12] !== props$1.isRequired || $[13] !== t10 || $[14] !== t9 || $[15] !== variant) {
164
+ t11 = /* @__PURE__ */ jsx(FieldBox, {
189
165
  endInset: t9,
190
166
  floatingLabel,
191
167
  isRequired: props$1.isRequired,
192
168
  label,
193
169
  variant,
194
- children: t17
170
+ children: t10
195
171
  });
196
- $[19] = floatingLabel;
197
- $[20] = label;
198
- $[21] = props$1.isRequired;
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, {
172
+ $[10] = floatingLabel;
173
+ $[11] = label;
174
+ $[12] = props$1.isRequired;
175
+ $[13] = t10;
176
+ $[14] = t9;
177
+ $[15] = variant;
178
+ $[16] = t11;
179
+ } else t11 = $[16];
180
+ let t12;
181
+ if ($[17] !== description || $[18] !== error) {
182
+ t12 = /* @__PURE__ */ jsx(FieldMessage, {
207
183
  description,
208
184
  error
209
185
  });
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, {
186
+ $[17] = description;
187
+ $[18] = error;
188
+ $[19] = t12;
189
+ } else t12 = $[19];
190
+ let t13;
191
+ if ($[20] !== T0 || $[21] !== isDisabled || $[22] !== isWheelDisabled || $[23] !== props$1 || $[24] !== t11 || $[25] !== t12 || $[26] !== t7 || $[27] !== t8 || $[28] !== validationBehavior) {
192
+ t13 = /* @__PURE__ */ jsxs(T0, {
217
193
  isDisabled,
218
194
  isInvalid: t7,
219
195
  isWheelDisabled,
220
196
  validationBehavior,
221
197
  ...props$1,
222
198
  ...t8,
223
- children: [t18, t19]
199
+ children: [t11, t12]
224
200
  });
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;
201
+ $[20] = T0;
202
+ $[21] = isDisabled;
203
+ $[22] = isWheelDisabled;
204
+ $[23] = props$1;
205
+ $[24] = t11;
206
+ $[25] = t12;
207
+ $[26] = t7;
208
+ $[27] = t8;
209
+ $[28] = validationBehavior;
210
+ $[29] = t13;
211
+ } else t13 = $[29];
212
+ return t13;
237
213
  }
238
214
  function StackedStepper(t0) {
239
215
  const $ = c(8);