@kanso-labs/kanso-ui 0.45.21 → 0.45.23

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 (269) hide show
  1. package/dist/badge/index.js.map +1 -1
  2. package/dist/button/context.js.map +1 -1
  3. package/dist/button/group.js.map +1 -1
  4. package/dist/button/hooks.js.map +1 -1
  5. package/dist/button/index.d.ts +3 -4
  6. package/dist/button/index.js.map +1 -1
  7. package/dist/button/styles.js.map +1 -1
  8. package/dist/button/toggle.js.map +1 -1
  9. package/dist/calendar/index.js +119 -11
  10. package/dist/calendar/index.js.map +1 -1
  11. package/dist/calendar/styles.js +19 -1
  12. package/dist/calendar/styles.js.map +1 -1
  13. package/dist/carousel/arrangement.d.ts +1 -2
  14. package/dist/carousel/arrangement.js.map +1 -1
  15. package/dist/chip/index.js.map +1 -1
  16. package/dist/chip/label.js.map +1 -1
  17. package/dist/chip/styles.js.map +1 -1
  18. package/dist/collection/empty.js.map +1 -1
  19. package/dist/collection/index.js.map +1 -1
  20. package/dist/collection/styles.js.map +1 -1
  21. package/dist/collection/text.js.map +1 -1
  22. package/dist/color-scheme.d.ts +1 -2
  23. package/dist/color-scheme.js.map +1 -1
  24. package/dist/components/app-bar/index.d.ts +9 -4
  25. package/dist/components/app-bar/index.js +123 -73
  26. package/dist/components/app-bar/index.js.map +1 -1
  27. package/dist/components/autocomplete/index.d.ts +1 -2
  28. package/dist/components/autocomplete/index.js.map +1 -1
  29. package/dist/components/avatar/index.d.ts +1 -2
  30. package/dist/components/avatar/index.js.map +1 -1
  31. package/dist/components/badge/index.d.ts +1 -2
  32. package/dist/components/badge/index.js.map +1 -1
  33. package/dist/components/breadcrumbs/index.d.ts +1 -2
  34. package/dist/components/breadcrumbs/index.js.map +1 -1
  35. package/dist/components/button/index.d.ts +1 -2
  36. package/dist/components/button/index.js.map +1 -1
  37. package/dist/components/button-group/index.d.ts +1 -2
  38. package/dist/components/button-group/index.js.map +1 -1
  39. package/dist/components/calendar/index.d.ts +4 -5
  40. package/dist/components/calendar/index.js +8 -19
  41. package/dist/components/calendar/index.js.map +1 -1
  42. package/dist/components/card/index.d.ts +1 -2
  43. package/dist/components/card/index.js.map +1 -1
  44. package/dist/components/carousel/index.d.ts +22 -4
  45. package/dist/components/carousel/index.js +26 -14
  46. package/dist/components/carousel/index.js.map +1 -1
  47. package/dist/components/checkbox/index.d.ts +1 -2
  48. package/dist/components/checkbox/index.js.map +1 -1
  49. package/dist/components/checkbox-group/index.d.ts +1 -2
  50. package/dist/components/checkbox-group/index.js.map +1 -1
  51. package/dist/components/chip/index.d.ts +1 -2
  52. package/dist/components/chip/index.js.map +1 -1
  53. package/dist/components/chip-group/index.d.ts +1 -2
  54. package/dist/components/chip-group/index.js +3 -0
  55. package/dist/components/chip-group/index.js.map +1 -1
  56. package/dist/components/code/index.d.ts +1 -2
  57. package/dist/components/code/index.js.map +1 -1
  58. package/dist/components/color-area/index.d.ts +1 -2
  59. package/dist/components/color-area/index.js.map +1 -1
  60. package/dist/components/color-field/index.d.ts +1 -2
  61. package/dist/components/color-field/index.js.map +1 -1
  62. package/dist/components/color-picker/index.d.ts +1 -2
  63. package/dist/components/color-picker/index.js +64 -46
  64. package/dist/components/color-picker/index.js.map +1 -1
  65. package/dist/components/color-slider/index.d.ts +1 -2
  66. package/dist/components/color-slider/index.js.map +1 -1
  67. package/dist/components/color-swatch/index.d.ts +1 -2
  68. package/dist/components/color-swatch/index.js +20 -16
  69. package/dist/components/color-swatch/index.js.map +1 -1
  70. package/dist/components/color-swatch-picker/index.d.ts +1 -2
  71. package/dist/components/color-swatch-picker/index.js.map +1 -1
  72. package/dist/components/color-wheel/index.d.ts +1 -2
  73. package/dist/components/color-wheel/index.js.map +1 -1
  74. package/dist/components/combo-box/index.d.ts +1 -2
  75. package/dist/components/combo-box/index.js.map +1 -1
  76. package/dist/components/container/index.d.ts +1 -2
  77. package/dist/components/container/index.js.map +1 -1
  78. package/dist/components/copy-field/index.d.ts +1 -2
  79. package/dist/components/copy-field/index.js +1 -0
  80. package/dist/components/copy-field/index.js.map +1 -1
  81. package/dist/components/currency/index.d.ts +1 -2
  82. package/dist/components/currency/index.js.map +1 -1
  83. package/dist/components/date-field/index.d.ts +1 -2
  84. package/dist/components/date-field/index.js.map +1 -1
  85. package/dist/components/date-picker/index.d.ts +1 -2
  86. package/dist/components/date-picker/index.js.map +1 -1
  87. package/dist/components/date-range-picker/index.d.ts +1 -2
  88. package/dist/components/date-range-picker/index.js +165 -81
  89. package/dist/components/date-range-picker/index.js.map +1 -1
  90. package/dist/components/dialog/index.d.ts +1 -2
  91. package/dist/components/dialog/index.js.map +1 -1
  92. package/dist/components/disclosure/index.d.ts +1 -2
  93. package/dist/components/disclosure/index.js.map +1 -1
  94. package/dist/components/disclosure-group/index.d.ts +1 -2
  95. package/dist/components/disclosure-group/index.js.map +1 -1
  96. package/dist/components/drop-zone/index.d.ts +1 -2
  97. package/dist/components/drop-zone/index.js.map +1 -1
  98. package/dist/components/drop-zone/styles.js.map +1 -1
  99. package/dist/components/fab/index.d.ts +1 -2
  100. package/dist/components/fab/index.js.map +1 -1
  101. package/dist/components/fab-menu/index.d.ts +1 -2
  102. package/dist/components/fab-menu/index.js.map +1 -1
  103. package/dist/components/feed/index.d.ts +1 -2
  104. package/dist/components/feed/index.js.map +1 -1
  105. package/dist/components/form/index.d.ts +1 -2
  106. package/dist/components/form/index.js.map +1 -1
  107. package/dist/components/icon-button/index.d.ts +1 -2
  108. package/dist/components/icon-button/index.js.map +1 -1
  109. package/dist/components/index.d.ts +2 -2
  110. package/dist/components/keycap/index.d.ts +1 -2
  111. package/dist/components/keycap/index.js.map +1 -1
  112. package/dist/components/link/index.d.ts +1 -2
  113. package/dist/components/link/index.js.map +1 -1
  114. package/dist/components/list/index.d.ts +1 -2
  115. package/dist/components/list/index.js.map +1 -1
  116. package/dist/components/list-box/index.d.ts +1 -2
  117. package/dist/components/list-box/index.js.map +1 -1
  118. package/dist/components/list-detail/index.d.ts +1 -2
  119. package/dist/components/list-detail/index.js.map +1 -1
  120. package/dist/components/list-item/index.d.ts +1 -2
  121. package/dist/components/list-item/index.js.map +1 -1
  122. package/dist/components/loading-indicator/index.d.ts +1 -2
  123. package/dist/components/loading-indicator/index.js.map +1 -1
  124. package/dist/components/menu/index.d.ts +1 -2
  125. package/dist/components/menu/index.js.map +1 -1
  126. package/dist/components/meter/index.d.ts +1 -2
  127. package/dist/components/meter/index.js.map +1 -1
  128. package/dist/components/navigation-bar/index.d.ts +1 -2
  129. package/dist/components/navigation-bar/index.js.map +1 -1
  130. package/dist/components/navigation-rail/index.d.ts +1 -2
  131. package/dist/components/navigation-rail/index.js.map +1 -1
  132. package/dist/components/navigation-tree/index.d.ts +1 -2
  133. package/dist/components/navigation-tree/index.js.map +1 -1
  134. package/dist/components/number-field/index.d.ts +1 -2
  135. package/dist/components/number-field/index.js.map +1 -1
  136. package/dist/components/popover/index.d.ts +1 -2
  137. package/dist/components/popover/index.js +14 -4
  138. package/dist/components/popover/index.js.map +1 -1
  139. package/dist/components/product-icon/index.d.ts +1 -2
  140. package/dist/components/product-icon/index.js.map +1 -1
  141. package/dist/components/progress-indicator/index.d.ts +1 -2
  142. package/dist/components/progress-indicator/index.js.map +1 -1
  143. package/dist/components/radio-group/index.d.ts +1 -2
  144. package/dist/components/radio-group/index.js.map +1 -1
  145. package/dist/components/range-calendar/index.d.ts +1 -2
  146. package/dist/components/range-calendar/index.js +53 -80
  147. package/dist/components/range-calendar/index.js.map +1 -1
  148. package/dist/components/search-field/index.d.ts +1 -2
  149. package/dist/components/search-field/index.js.map +1 -1
  150. package/dist/components/search-view/index.d.ts +1 -2
  151. package/dist/components/search-view/index.js.map +1 -1
  152. package/dist/components/segmented-button/index.d.ts +1 -2
  153. package/dist/components/segmented-button/index.js +261 -145
  154. package/dist/components/segmented-button/index.js.map +1 -1
  155. package/dist/components/select/index.d.ts +1 -2
  156. package/dist/components/select/index.js.map +1 -1
  157. package/dist/components/separator/index.d.ts +1 -2
  158. package/dist/components/separator/index.js.map +1 -1
  159. package/dist/components/sheet/index.d.ts +1 -2
  160. package/dist/components/sheet/index.js +149 -82
  161. package/dist/components/sheet/index.js.map +1 -1
  162. package/dist/components/slider/index.d.ts +1 -2
  163. package/dist/components/slider/index.js.map +1 -1
  164. package/dist/components/snackbar/index.d.ts +1 -2
  165. package/dist/components/snackbar/index.js.map +1 -1
  166. package/dist/components/split-button/index.d.ts +1 -2
  167. package/dist/components/split-button/index.js.map +1 -1
  168. package/dist/components/stack/index.d.ts +1 -2
  169. package/dist/components/stack/index.js.map +1 -1
  170. package/dist/components/supporting-pane/index.d.ts +1 -2
  171. package/dist/components/supporting-pane/index.js.map +1 -1
  172. package/dist/components/switch/index.d.ts +1 -2
  173. package/dist/components/switch/index.js.map +1 -1
  174. package/dist/components/table/index.d.ts +1 -2
  175. package/dist/components/table/index.js +251 -123
  176. package/dist/components/table/index.js.map +1 -1
  177. package/dist/components/tabs/index.d.ts +1 -2
  178. package/dist/components/tabs/index.js.map +1 -1
  179. package/dist/components/tag/index.d.ts +1 -2
  180. package/dist/components/tag/index.js.map +1 -1
  181. package/dist/components/text/index.d.ts +1 -2
  182. package/dist/components/text/index.js.map +1 -1
  183. package/dist/components/text-area/index.d.ts +1 -2
  184. package/dist/components/text-area/index.js.map +1 -1
  185. package/dist/components/text-field/index.d.ts +1 -2
  186. package/dist/components/text-field/index.js.map +1 -1
  187. package/dist/components/time-field/index.d.ts +1 -2
  188. package/dist/components/time-field/index.js.map +1 -1
  189. package/dist/components/time-picker/index.d.ts +1 -2
  190. package/dist/components/time-picker/index.js.map +1 -1
  191. package/dist/components/token-field/index.d.ts +1 -2
  192. package/dist/components/token-field/index.js.map +1 -1
  193. package/dist/components/toolbar/index.d.ts +1 -2
  194. package/dist/components/toolbar/index.js.map +1 -1
  195. package/dist/components/tooltip/index.d.ts +1 -2
  196. package/dist/components/tooltip/index.js.map +1 -1
  197. package/dist/components/tree/index.d.ts +1 -2
  198. package/dist/components/tree/index.js.map +1 -1
  199. package/dist/control/index.js.map +1 -1
  200. package/dist/control/styles.js.map +1 -1
  201. package/dist/drag/hooks.d.ts +1 -2
  202. package/dist/drag/hooks.js.map +1 -1
  203. package/dist/drag/index.js.map +1 -1
  204. package/dist/drag/styles.js.map +1 -1
  205. package/dist/fab/styles.js.map +1 -1
  206. package/dist/field/index.d.ts +3 -4
  207. package/dist/field/index.js.map +1 -1
  208. package/dist/field/press.js.map +1 -1
  209. package/dist/field/root.js.map +1 -1
  210. package/dist/field/styles.js.map +1 -1
  211. package/dist/glyphs/index.js.map +1 -1
  212. package/dist/glyphs/styles.js.map +1 -1
  213. package/dist/hooks/useAppBarScroll.d.ts +1 -2
  214. package/dist/hooks/useAppBarScroll.js.map +1 -1
  215. package/dist/hooks/useBottomEdge.js.map +1 -1
  216. package/dist/hooks/useClippedTitle.js.map +1 -1
  217. package/dist/hooks/useImageLoadingStatus.js.map +1 -1
  218. package/dist/hooks/useRipple.js +3 -2
  219. package/dist/hooks/useRipple.js.map +1 -1
  220. package/dist/hooks/useScrollStop.js.map +1 -1
  221. package/dist/hooks/useToggleGroupDisabled.js.map +1 -1
  222. package/dist/i18n/index.js.map +1 -1
  223. package/dist/i18n/messages.js.map +1 -1
  224. package/dist/index.d.ts +2 -2
  225. package/dist/indicator/index.js.map +1 -1
  226. package/dist/indicator/styles.d.ts +1 -2
  227. package/dist/indicator/styles.js.map +1 -1
  228. package/dist/kanso-ui-core/defaults-DMH0HWCw.d.ts +1 -2
  229. package/dist/keycap/context.js.map +1 -1
  230. package/dist/layout.d.ts +1 -2
  231. package/dist/layout.js.map +1 -1
  232. package/dist/mark/index.js.map +1 -1
  233. package/dist/mark/initials.js.map +1 -1
  234. package/dist/mark/styles.js.map +1 -1
  235. package/dist/navigation/context.js.map +1 -1
  236. package/dist/navigation/index.d.ts +2 -3
  237. package/dist/navigation/index.js.map +1 -1
  238. package/dist/navigation/styles.js.map +1 -1
  239. package/dist/overlay/index.js.map +1 -1
  240. package/dist/render/aria.js.map +1 -1
  241. package/dist/render/content.js.map +1 -1
  242. package/dist/render/name.d.ts +1 -2
  243. package/dist/render/ref.js.map +1 -1
  244. package/dist/render/useRender.d.ts +1 -2
  245. package/dist/render/useRender.js.map +1 -1
  246. package/dist/row/index.js.map +1 -1
  247. package/dist/row/styles.js.map +1 -1
  248. package/dist/segments/index.js +2 -1
  249. package/dist/segments/index.js.map +1 -1
  250. package/dist/segments/styles.js +5 -1
  251. package/dist/segments/styles.js.map +1 -1
  252. package/dist/styles/chequer.js.map +1 -1
  253. package/dist/styles/color.js.map +1 -1
  254. package/dist/styles/focus.js.map +1 -1
  255. package/dist/styles/icon-button.js.map +1 -1
  256. package/dist/styles/merge.js.map +1 -1
  257. package/dist/styles/overlay.d.ts +2 -3
  258. package/dist/styles/overlay.js.map +1 -1
  259. package/dist/styles/picker.js.map +1 -1
  260. package/dist/styles/ripple.js.map +1 -1
  261. package/dist/styles/scheme.js.map +1 -1
  262. package/dist/styles.css +40 -8
  263. package/dist/swatch/index.js +19 -0
  264. package/dist/swatch/index.js.map +1 -0
  265. package/dist/theme-scope.d.ts +1 -2
  266. package/dist/theme-scope.js.map +1 -1
  267. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  268. package/dist/tokens/values.js.map +1 -1
  269. package/package.json +16 -16
@@ -1 +1 @@
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;AACT,EACF;;;;;;;;;;;;;;;;;;;;AAyCA,SAAAK,eAAAC,IAAA;CAAA,MAAAC,IAAAtC,EAAA,EAAA;CAAA,IAAAuC;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,QA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AAA,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"}
1
+ {"version":3,"file":"index.js","names":["_c","useRender","mergeStyles","styles","destinations","kGNEyG","kSGwAc","kB7OPa","k1xSpc","kCS8Yb","kXwgrk","kzQI83","kmuXW","kqGvvJ","kUOVxO","kAzted","kORKVm","k8WAf4","kg3NbH","$$css","header","isExpanded","selectedRoute","NavigationRail","t0","$","children","context","render","t1","t2","t3","t4","t5","t6","t7","t8","props","undefined","t9","t10","form","0","className","1","defaultTagName","rail","NavigationRailItem","Item"],"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,MAAMG,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;AACT,EACF;;;;;;;;;;;;;;;;;;;;AAyCA,SAAAI,eAAAC,IAAA;CAAA,MAAAC,IAAAzB,EAAA,EAAA;CAAA,IAAA0B;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,IAAAmB;EAAA,IAAAf,EAAA,QAAAH,iBAAAG,EAAA,QAAAc,IAAA;GADhCC,MAAA;IAAAC,MACvBF;IAAuDjB;GAE/D;GAACG,EAAA,MAAAH;GAAAG,EAAA,MAAAc;GAAAd,EAAA,MAAAe;EAAA,OAAAA,MAAAf,EAAA;EAHDE,UAA+Ba;EAIlBvC,KAAAA;EACK8B,KAAA;EAEXM,KAAAA;EACAP,KAAA5B,YAAY;GAAAwC,GACV,EAAAC,WACU,2FACb;GAACC,GACE,EAAAD,WACU,4GACb;EACF,EAAE,CAAC,CAACtB,cAAc,IAAIgB,KA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AAL,EAAA,QAAAU,IAAA;EAxBAC,KAAA;GAAA,GACFC;GAAK,GACLP;GAOyBJ,UAClBS;EAeZ;EAACV,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAU;EAAAV,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,QAAAG,UAAAH,EAAA,QAAAM,MAAAN,EAAA,QAAAW,IAAA;EA3BoBG,KAAA;GAAAM,gBACLd;GAAKM,OACdD;GAyBNR;EAEH;EAACH,EAAA,MAAAG;EAAAH,EAAA,MAAAM;EAAAN,EAAA,MAAAW;EAAAX,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CA7BD,MAAAqB,OAAa7C,GAAUsC,EA6BtB;CAAE,IAAAC;CAAA,IAAAf,EAAA,QAAAE,WAAAF,EAAA,QAAAqB,MAAA;EACIN,MAAA,oBAAC,mBAAD;GAA0Bb,OAAAA;GAAUmB,UAAAA;EAAlB,CAAA;EAA2CrB,EAAA,MAAAE;EAAAF,EAAA,MAAAqB;EAAArB,EAAA,MAAAe;CAAA,OAAAA,MAAAf,EAAA;CAAA,OAA7De;AAA6D;;;;;;;;;;AAYtE,SAAAO,mBAAAV,OAAA;CAAA,MAAAZ,IAAAzB,EAAA,CAAA;CAAA,IAAAwB;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,eAAeyB,OAAOD"}
@@ -84,5 +84,4 @@ declare function NavigationTreeItem$1<T extends object = object>({ children, lab
84
84
  * A named group of rows, with its heading above them.
85
85
  */
86
86
  declare function NavigationTreeSection$1<T extends object = object>({ children, header, ...props }: NavigationTreeSectionProps<T> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
87
- export { NavigationTreeItem$1 as NavigationTreeItem, type NavigationTreeItemProps$1 as NavigationTreeItemProps, type NavigationTreeProps$1 as NavigationTreeProps, NavigationTreeSection$1 as NavigationTreeSection, type NavigationTreeSectionProps, NavigationTree$1 as default };
88
- //# sourceMappingURL=index.d.ts.map
87
+ export { NavigationTreeItem$1 as NavigationTreeItem, type NavigationTreeItemProps$1 as NavigationTreeItemProps, type NavigationTreeProps$1 as NavigationTreeProps, NavigationTreeSection$1 as NavigationTreeSection, type NavigationTreeSectionProps, NavigationTree$1 as default };
@@ -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","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 chevron={chevronFor(state)} isDisabled={state.isDisabled} isEmphasized={state.isCurrentAncestor} isSelected={state.isCurrent} leading={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 * 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,C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J,iBAAeoG,UAAU5F"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","NavigationTree","NavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","NavigationTreeSection","RACNavigationTreeSection","collectionStyles","useRipple","rowStyles","focus","mergeStatefulStyles","mergeStyles","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","indent","kZCmMZ","children","className","leading","supporting","trailing","label","textValue","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","ripple","isDisabled","isCurrentAncestor","isCurrent","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","RACButton","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","RACNavigationTreeItemContent"],"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 chevron={chevronFor(state)} isDisabled={state.isDisabled} isEmphasized={state.isCurrentAncestor} isSelected={state.isCurrent} leading={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 * 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,MAAMc,SAAS;CACbC,SAAS;EACPC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AZ,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAS,MAAAT,EAAA,OAAAhC,YAAAgC,EAAA,QAAAG,MAAAH,EAAA,QAAAU,MAAAV,EAAA,QAAAY,IAAA;EADjFE,KAAA,qBAAC,IAAD;GAAyB,GAAQrC;GAAK,GAAMiC;GAA5C,UAAA,CACFE,IACA5C,QAF2B;;EAGHgC,EAAA,KAAAS;EAAAT,EAAA,KAAAhC;EAAAgC,EAAA,MAAAG;EAAAH,EAAA,MAAAU;EAAAV,EAAA,MAAAY;EAAAZ,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAHtBc;AAGsB;AAQ/B,SAASH,aAAarC,WAA+BD,OAAkB;CACrE,IAAIC,cAAc8C,KAAAA,GAChB,OAAO9C;CAET,OAAO,OAAOD,UAAU,WAAWA,QAAQ;AAC7C;AACAjC,iBAAeiF,OAAO/E;AACtBF,iBAAekF,UAAU9E"}
@@ -99,5 +99,4 @@ type NumberFieldProps$1 = {
99
99
  * are the field chrome in `src/field`, shared with every other field.
100
100
  */
101
101
  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;
102
- export { type NumberFieldProps$1 as NumberFieldProps, NumberField$1 as default };
103
- //# sourceMappingURL=index.d.ts.map
102
+ export { type NumberFieldProps$1 as NumberFieldProps, NumberField$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","Ref","RefAttributes","ButtonRenderProps","NumberFieldProps","RACNumberFieldProps","stylex","Button","RACButton","NumberField","RACNumberField","FieldVariant","FieldBox","FieldInput","FieldMessage","fieldStyles","invalidFrom","useFieldValidationBehavior","MinusGlyph","PlusGlyph","mergeStatefulStyles","colors","motion","radii","sizing","spacing","stateLayerOpacity","typography","IconButton","BOX_HALF","sm","bodySmallLineHeight","bodyLargeLineHeight","BOX_OUTLINED_HALF","lg","STEPPER_REACH","controlXs","STACKED_INSET","INLINE_INSET","md","END_INSETS","horizontal","none","undefined","vertical","const","styles","stepper","k6CgDc","kGNEyG","kWkggS","kZKoxP","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kzqmXN","kjj79g","kjBf7l","kInvED","k3XXqK","kMeerF","kmVPX3","kIyJzY","k1ekBW","kAMwcw","$$css","stepperBottomOutlined","kT0f0o","stepperDisabled","stepperFocused","stepperHovered","stepperOutlined","stepperPressed","stepperTop","kfmiAY","decrementLabel","description","error","floatingLabel","incrementLabel","inputRef","HTMLInputElement","isWheelDisabled","label","numeric","steppers","variant","Omit","t0","$","t1","isDisabled","t2","t3","t4","t5","t6","props","inline","validationBehavior","T0","t7","t8","root","t9","t10","0","className","1","2","3","t11","isRequired","t12","t13","StackedStepper","children","outlined","slot","stepperStyles","top","state","isHovered","isPressed","isFocusVisible","NumberField","_c","props","RACNumberField","stylex.props","RACButton"],"sources":["../../../src/components/number-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { ButtonRenderProps, NumberFieldProps as RACNumberFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NumberField as RACNumberField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { MinusGlyph, PlusGlyph } from '../../glyphs';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport IconButton from '../icon-button';\n\n// The text fields page's field, holding a number: the same box, floating\n// label, underline and message as TextField, with the value in the mono\n// face and tabular figures by default, since a number is what those are\n// for, and two steppers at the trailing end.\n//\n// The steppers come in two layouts. Stacked, the plus over the minus, they\n// are a column flush with the box's top, end and bottom, each half of the\n// box's 56dp and 32dp wide, drawn here since the smallest icon button is\n// 32dp and two of those do not fit; the glyph is the icon buttons page's\n// 20dp for that size, and the hover, pressed, focus and disabled treatments\n// are the standard icon button's. Side by side, they are extra-small icon\n// buttons, the page's trailing icons in the library's own control, 12dp\n// from the end where the page puts a field's icons — the box's 16dp of\n// padding less the 4dp they pull back.\n//\n// **The stacked pair is the one control here that does not reach the 48dp\n// target**, and it is the layout rather than an oversight. Every other small\n// control in the library draws that target out of flow, over whatever sits\n// beside it — src/control/styles.ts carries the decision. These two have only\n// each other beside them: the column is 56dp tall in total, so two 48dp\n// targets inside it would overlap across most of their height, and the half\n// of a press that landed in the overlap would go to whichever box was\n// uppermost rather than to the glyph under the finger. Incrementing when a\n// reader meant to decrement is worse than a target that is short, so the\n// stacked layout keeps its 32 by 28 and the reader who needs the larger one\n// has `steppers=\"horizontal\"`, where each is an extra-small icon button and\n// gets the target from there — with the gap that keeps those two targets off\n// each other, which is the room the column has none of.\n//\n// A value that is typed rather than stepped — an amount, a year, an\n// identifier — can leave the steppers out with `steppers=\"none\"`. The box is\n// then a text field's, the input running to the box's own end padding, and\n// the arrow keys and Page Up and Page Down still step the value.\n//\n// React Aria's `NumberField` is the root and the box is its `Group`, which\n// is what names the box and the two steppers as one control; the steppers\n// are its increment and decrement buttons through context, disabled at the\n// ends of the range and kept out of the tab order, and the formatting is its\n// `formatOptions`.\n// Half the box, spelled from the same tokens the box derives its height\n// from rather than as the 28 that half of 56 comes to. A theme with a longer\n// body line makes the box taller — `Editorial` in kanso-ui-core's themes does\n// — and a stated half leaves the pair short of the bottom edge they are\n// flush with.\n//\n// Written here rather than imported from src/field/styles.ts, which spells\n// the same two expressions: the StyleX compiler resolves a constant across\n// files only out of a `.stylex.ts` module, the same reason that file gives\n// for re-declaring the forced-colours query. The two have to move together.\nconst BOX_HALF = `calc((2 * ${spacing.sm} + ${typography.bodySmallLineHeight} + ${typography.bodyLargeLineHeight}) / 2)`;\nconst BOX_OUTLINED_HALF = `calc((2 * ${spacing.lg} + ${typography.bodyLargeLineHeight}) / 2)`;\n\n// How much of the end of the box's column the steppers take, with the 8dp\n// between them and the input, which the label stops short of — FieldBox's\n// `endInset`. Without it the label ran the column's width, under the\n// steppers, and a long one was cut short beneath them. Each is the input's\n// own end, so the label ends where the value does.\n//\n// Stacked, the 32dp column less the 16dp of the box's padding it reaches\n// into; side by side, the two extra-small buttons and the 8dp between them,\n// less the 4dp they reach into the padding.\n// How far a side-by-side stepper reaches past the control's line above and\n// below it: a negative margin, half the difference between the two.\nconst STEPPER_REACH = `calc((${typography.bodyLargeLineHeight} - ${sizing.controlXs}) / 2)`;\nconst STACKED_INSET = `calc(32px - ${spacing.lg} + ${spacing.sm})`;\nconst INLINE_INSET = `calc(2 * ${sizing.controlXs} + ${spacing.sm} + ${spacing.md} - ${spacing.lg} + ${spacing.sm})`;\n\n// Each layout's inset, keyed by the prop. With no steppers there is nothing\n// for the label to stop short of, so the box's own default holds.\nconst END_INSETS = {\n horizontal: INLINE_INSET,\n none: undefined,\n vertical: STACKED_INSET\n} as const;\nconst styles = {\n stepper: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1viytl0\",\n kaIpWk: \"x2u8bby\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kzqmXN: \"x1td3qas\",\n kjj79g: \"xl56j7k\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1717udv\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n stepperBottomOutlined: {\n kT0f0o: \"x4gcak0\",\n $$css: true\n },\n stepperDisabled: {\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n stepperFocused: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n stepperHovered: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n stepperOutlined: {\n kZKoxP: \"x1o675yb\",\n $$css: true\n },\n stepperPressed: {\n kWkggS: \"x123fei2\",\n $$css: true\n },\n stepperTop: {\n kfmiAY: \"xirz1nw\",\n $$css: true\n }\n};\ntype NumberFieldProps = {\n /**\n * The name of the stepper that lowers the value, for a screen reader. Left\n * out, React Aria names it in the reader's locale, followed by the field's\n * own label — \"Decrease Quantity\" in English.\n */\n decrementLabel?: string;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * The name of the stepper that raises the value, for a screen reader. Left\n * out, React Aria names it in the reader's locale, followed by the field's\n * own label — \"Increase Quantity\" in English.\n */\n incrementLabel?: string;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * Whether the mouse wheel and a trackpad's scroll leave the value alone.\n * React Aria steps a focused number field's value with the wheel, so a\n * reader scrolling a long form past a field they had left focused changed\n * its value instead of moving the page. Stepping from the wheel is the\n * call site's to ask for, with `false`.\n * @default true\n */\n isWheelDisabled?: boolean;\n /**\n * What the field is for. Required rather than optional: a field with no\n * label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column. On by default, since a\n * number field holds nothing else.\n * @default true\n */\n numeric?: boolean;\n /**\n * How the two steppers sit at the end of the box: stacked, the plus over\n * the minus, flush with the box's edge, or side by side as extra-small\n * icon buttons. `'none'` draws neither, for a value that is typed rather\n * than stepped; the keyboard still steps it.\n * @default 'vertical'\n */\n steppers?: 'horizontal' | 'none' | 'vertical';\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats — the text fields page's two fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACNumberFieldProps, 'children' | 'isInvalid' | 'isWheelDisabled' | 'validationBehavior'>;\n\n/**\n * A labelled number input with steppers. Its value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue` to let it keep\n * its own — and `onChange` is handed the number, `NaN` while the field is\n * empty. `minValue`, `maxValue` and `step` shape it, and `formatOptions`\n * says how it reads, in the locale the page is in: a currency, a percentage,\n * a unit. The arrow keys and Page Up and Page Down step the value by one\n * `step` each. Given a `minValue`, Home sets the value to it, and given a\n * `maxValue`, End sets it to the last step that does not pass it.\n * The mouse wheel scrolls the page past it rather than stepping it, unless\n * `isWheelDisabled` is `false`.\n *\n * ```tsx\n * <NumberField defaultValue={1} label=\"Label\" minValue={0} />\n * ```\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions. The box, label, input and message\n * are the field chrome in `src/field`, shared with every other field.\n */\nfunction NumberField({\n decrementLabel,\n description,\n error,\n floatingLabel = true,\n incrementLabel,\n inputRef,\n isDisabled = false,\n isWheelDisabled = true,\n label,\n numeric = true,\n steppers = 'vertical',\n variant = 'filled',\n ...props\n}: NumberFieldProps & RefAttributes<HTMLDivElement>) {\n const inline = steppers === 'horizontal';\n const validationBehavior = useFieldValidationBehavior();\n return <RACNumberField isDisabled={isDisabled} isInvalid={invalidFrom(error)} isWheelDisabled={isWheelDisabled} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox endInset={END_INSETS[steppers]} floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} variant={variant}>\n {steppers === 'none' ? <FieldInput numeric={numeric} ref={inputRef} /> : <div {...{\n 0: {\n className: \"x1cy8zhl x9f619 x78zum5 x126z3so\"\n },\n 1: {\n className: \"x9f619 x78zum5 x126z3so x6s0dn4\"\n }\n }[!!inline << 0]}>\n <FieldInput numeric={numeric} ref={inputRef} />\n <div {...{\n 0: {\n className: \"x9f619 x78zum5 xdt5ytf x2lah0s x1motrhk xk4mfur\"\n },\n 2: {\n className: \"x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x6rec7h x1tn5xpv\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x2lah0s xk4mfur x17v9ssf\"\n },\n 3: {\n className: \"x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x1tn5xpv x17v9ssf\"\n }\n }[!!inline << 1 | !!(!inline && variant === 'outlined') << 0]}>\n {inline ? <>\n <IconButton aria-label={decrementLabel} size=\"xs\" slot=\"decrement\">\n <MinusGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />\n </IconButton>\n <IconButton aria-label={incrementLabel} size=\"xs\" slot=\"increment\">\n <PlusGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />\n </IconButton>\n </> : <>\n <StackedStepper label={incrementLabel} outlined={variant === 'outlined'} slot=\"increment\">\n <PlusGlyph className=\"x1qx5ct2 x1lliihq xw4jnvo\" />\n </StackedStepper>\n <StackedStepper label={decrementLabel} outlined={variant === 'outlined'} slot=\"decrement\">\n <MinusGlyph className=\"x1qx5ct2 x1lliihq xw4jnvo\" />\n </StackedStepper>\n </>}\n </div>\n </div>}\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACNumberField>;\n}\nfunction StackedStepper({\n children,\n label,\n outlined,\n slot\n}: {\n children: ReactNode;\n label: string | undefined;\n outlined: boolean;\n slot: 'decrement' | 'increment';\n}) {\n return <RACButton aria-label={label} slot={slot} {...mergeStatefulStyles(stepperStyles(slot === 'increment', outlined), {})}>\n {children}\n </RACButton>;\n}\n\n// A stacked stepper: React Aria's button with the slot the field's context\n// looks for, drawn from its render state. Built by a call rather than\n// written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after.\nfunction stepperStyles(top: boolean, outlined: boolean) {\n return (state: ButtonRenderProps) => stylex.props(styles.stepper, outlined && styles.stepperOutlined, top && styles.stepperTop, !top && outlined && styles.stepperBottomOutlined, state.isHovered && !state.isDisabled && styles.stepperHovered, state.isPressed && !state.isDisabled && styles.stepperPressed, state.isFocusVisible && styles.stepperFocused, state.isDisabled && styles.stepperDisabled);\n}\nexport type { NumberFieldProps };\nexport default NumberField;"],"mappings":";;;;;;;;;;;;AAgEiB,GAAa2B,QAAQK,KAAQH,WAAWI,sBAAyBJ,WAAWK;AACnE,GAAaP,QAAQS,KAAQP,WAAWK;AAa5C,GAASL,WAAWK,sBAAyBR,OAAOY;AAC1E,MAAMC,gBAAgB,eAAeZ,QAAQS,GAAE,KAAMT,QAAQK,GAAE;AAK/D,MAAMU,aAAa;CACjBC,YAAYH,YALmBd,OAAOY,UAAS,KAAMX,QAAQK,GAAE,KAAML,QAAQc,GAAE,KAAMd,QAAQS,GAAE,KAAMT,QAAQK,GAAE;CAM/GY,MAAMC,KAAAA;CACNC,UAAUP;AACZ;AACA,MAAMS,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,uBAAuB;EACrBC,QAAQ;EACRF,OAAO;CACT;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AAchD,OAAO2B,gBAAgBmD,MAAME,aAAa,CAACF,MAAM9B,cAAchD,OAAO6B,gBAAgBiD,MAAMG,kBAAkBjF,OAAO0B,gBAAgBoD,MAAM9B,cAAchD,OAAOyB,eAAe;AAC3Y"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","NumberField","RACNumberField","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","sizing","spacing","typography","sm","bodySmallLineHeight","bodyLargeLineHeight","lg","controlXs","STACKED_INSET","INLINE_INSET","md","END_INSETS","horizontal","none","undefined","vertical","styles","stepper","k6CgDc","kGNEyG","kWkggS","kZKoxP","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kzqmXN","kjj79g","kjBf7l","kInvED","k3XXqK","kMeerF","kmVPX3","kIyJzY","k1ekBW","kAMwcw","$$css","stepperBottomOutlined","kT0f0o","stepperDisabled","stepperFocused","stepperHovered","stepperOutlined","stepperPressed","stepperTop","kfmiAY","decrementLabel","description","error","floatingLabel","incrementLabel","inputRef","isWheelDisabled","label","numeric","steppers","variant","t0","$","t1","isDisabled","t2","t3","t4","t5","t6","props","inline","validationBehavior","T0","t7","t8","root","t9","t10","0","className","1","2","3","t11","isRequired","t12","t13","StackedStepper","children","outlined","slot","stepperStyles","top","state","isHovered","isPressed","isFocusVisible","RACButton"],"sources":["../../../src/components/number-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { ButtonRenderProps, NumberFieldProps as RACNumberFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NumberField as RACNumberField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { MinusGlyph, PlusGlyph } from '../../glyphs';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport IconButton from '../icon-button';\n\n// The text fields page's field, holding a number: the same box, floating\n// label, underline and message as TextField, with the value in the mono\n// face and tabular figures by default, since a number is what those are\n// for, and two steppers at the trailing end.\n//\n// The steppers come in two layouts. Stacked, the plus over the minus, they\n// are a column flush with the box's top, end and bottom, each half of the\n// box's 56dp and 32dp wide, drawn here since the smallest icon button is\n// 32dp and two of those do not fit; the glyph is the icon buttons page's\n// 20dp for that size, and the hover, pressed, focus and disabled treatments\n// are the standard icon button's. Side by side, they are extra-small icon\n// buttons, the page's trailing icons in the library's own control, 12dp\n// from the end where the page puts a field's icons — the box's 16dp of\n// padding less the 4dp they pull back.\n//\n// **The stacked pair is the one control here that does not reach the 48dp\n// target**, and it is the layout rather than an oversight. Every other small\n// control in the library draws that target out of flow, over whatever sits\n// beside it — src/control/styles.ts carries the decision. These two have only\n// each other beside them: the column is 56dp tall in total, so two 48dp\n// targets inside it would overlap across most of their height, and the half\n// of a press that landed in the overlap would go to whichever box was\n// uppermost rather than to the glyph under the finger. Incrementing when a\n// reader meant to decrement is worse than a target that is short, so the\n// stacked layout keeps its 32 by 28 and the reader who needs the larger one\n// has `steppers=\"horizontal\"`, where each is an extra-small icon button and\n// gets the target from there — with the gap that keeps those two targets off\n// each other, which is the room the column has none of.\n//\n// A value that is typed rather than stepped — an amount, a year, an\n// identifier — can leave the steppers out with `steppers=\"none\"`. The box is\n// then a text field's, the input running to the box's own end padding, and\n// the arrow keys and Page Up and Page Down still step the value.\n//\n// React Aria's `NumberField` is the root and the box is its `Group`, which\n// is what names the box and the two steppers as one control; the steppers\n// are its increment and decrement buttons through context, disabled at the\n// ends of the range and kept out of the tab order, and the formatting is its\n// `formatOptions`.\n// Half the box, spelled from the same tokens the box derives its height\n// from rather than as the 28 that half of 56 comes to. A theme with a longer\n// body line makes the box taller — `Editorial` in kanso-ui-core's themes does\n// — and a stated half leaves the pair short of the bottom edge they are\n// flush with.\n//\n// Written here rather than imported from src/field/styles.ts, which spells\n// the same two expressions: the StyleX compiler resolves a constant across\n// files only out of a `.stylex.ts` module, the same reason that file gives\n// for re-declaring the forced-colours query. The two have to move together.\nconst BOX_HALF = `calc((2 * ${spacing.sm} + ${typography.bodySmallLineHeight} + ${typography.bodyLargeLineHeight}) / 2)`;\nconst BOX_OUTLINED_HALF = `calc((2 * ${spacing.lg} + ${typography.bodyLargeLineHeight}) / 2)`;\n\n// How much of the end of the box's column the steppers take, with the 8dp\n// between them and the input, which the label stops short of — FieldBox's\n// `endInset`. Without it the label ran the column's width, under the\n// steppers, and a long one was cut short beneath them. Each is the input's\n// own end, so the label ends where the value does.\n//\n// Stacked, the 32dp column less the 16dp of the box's padding it reaches\n// into; side by side, the two extra-small buttons and the 8dp between them,\n// less the 4dp they reach into the padding.\n// How far a side-by-side stepper reaches past the control's line above and\n// below it: a negative margin, half the difference between the two.\nconst STEPPER_REACH = `calc((${typography.bodyLargeLineHeight} - ${sizing.controlXs}) / 2)`;\nconst STACKED_INSET = `calc(32px - ${spacing.lg} + ${spacing.sm})`;\nconst INLINE_INSET = `calc(2 * ${sizing.controlXs} + ${spacing.sm} + ${spacing.md} - ${spacing.lg} + ${spacing.sm})`;\n\n// Each layout's inset, keyed by the prop. With no steppers there is nothing\n// for the label to stop short of, so the box's own default holds.\nconst END_INSETS = {\n horizontal: INLINE_INSET,\n none: undefined,\n vertical: STACKED_INSET\n} as const;\nconst styles = {\n stepper: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1viytl0\",\n kaIpWk: \"x2u8bby\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kzqmXN: \"x1td3qas\",\n kjj79g: \"xl56j7k\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1717udv\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n stepperBottomOutlined: {\n kT0f0o: \"x4gcak0\",\n $$css: true\n },\n stepperDisabled: {\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n stepperFocused: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n stepperHovered: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n stepperOutlined: {\n kZKoxP: \"x1o675yb\",\n $$css: true\n },\n stepperPressed: {\n kWkggS: \"x123fei2\",\n $$css: true\n },\n stepperTop: {\n kfmiAY: \"xirz1nw\",\n $$css: true\n }\n};\ntype NumberFieldProps = {\n /**\n * The name of the stepper that lowers the value, for a screen reader. Left\n * out, React Aria names it in the reader's locale, followed by the field's\n * own label — \"Decrease Quantity\" in English.\n */\n decrementLabel?: string;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * The name of the stepper that raises the value, for a screen reader. Left\n * out, React Aria names it in the reader's locale, followed by the field's\n * own label — \"Increase Quantity\" in English.\n */\n incrementLabel?: string;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * Whether the mouse wheel and a trackpad's scroll leave the value alone.\n * React Aria steps a focused number field's value with the wheel, so a\n * reader scrolling a long form past a field they had left focused changed\n * its value instead of moving the page. Stepping from the wheel is the\n * call site's to ask for, with `false`.\n * @default true\n */\n isWheelDisabled?: boolean;\n /**\n * What the field is for. Required rather than optional: a field with no\n * label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column. On by default, since a\n * number field holds nothing else.\n * @default true\n */\n numeric?: boolean;\n /**\n * How the two steppers sit at the end of the box: stacked, the plus over\n * the minus, flush with the box's edge, or side by side as extra-small\n * icon buttons. `'none'` draws neither, for a value that is typed rather\n * than stepped; the keyboard still steps it.\n * @default 'vertical'\n */\n steppers?: 'horizontal' | 'none' | 'vertical';\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats — the text fields page's two fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACNumberFieldProps, 'children' | 'isInvalid' | 'isWheelDisabled' | 'validationBehavior'>;\n\n/**\n * A labelled number input with steppers. Its value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue` to let it keep\n * its own — and `onChange` is handed the number, `NaN` while the field is\n * empty. `minValue`, `maxValue` and `step` shape it, and `formatOptions`\n * says how it reads, in the locale the page is in: a currency, a percentage,\n * a unit. The arrow keys and Page Up and Page Down step the value by one\n * `step` each. Given a `minValue`, Home sets the value to it, and given a\n * `maxValue`, End sets it to the last step that does not pass it.\n * The mouse wheel scrolls the page past it rather than stepping it, unless\n * `isWheelDisabled` is `false`.\n *\n * ```tsx\n * <NumberField defaultValue={1} label=\"Label\" minValue={0} />\n * ```\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions. The box, label, input and message\n * are the field chrome in `src/field`, shared with every other field.\n */\nfunction NumberField({\n decrementLabel,\n description,\n error,\n floatingLabel = true,\n incrementLabel,\n inputRef,\n isDisabled = false,\n isWheelDisabled = true,\n label,\n numeric = true,\n steppers = 'vertical',\n variant = 'filled',\n ...props\n}: NumberFieldProps & RefAttributes<HTMLDivElement>) {\n const inline = steppers === 'horizontal';\n const validationBehavior = useFieldValidationBehavior();\n return <RACNumberField isDisabled={isDisabled} isInvalid={invalidFrom(error)} isWheelDisabled={isWheelDisabled} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox endInset={END_INSETS[steppers]} floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} variant={variant}>\n {steppers === 'none' ? <FieldInput numeric={numeric} ref={inputRef} /> : <div {...{\n 0: {\n className: \"x1cy8zhl x9f619 x78zum5 x126z3so\"\n },\n 1: {\n className: \"x9f619 x78zum5 x126z3so x6s0dn4\"\n }\n }[!!inline << 0]}>\n <FieldInput numeric={numeric} ref={inputRef} />\n <div {...{\n 0: {\n className: \"x9f619 x78zum5 xdt5ytf x2lah0s x1motrhk xk4mfur\"\n },\n 2: {\n className: \"x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x6rec7h x1tn5xpv\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x2lah0s xk4mfur x17v9ssf\"\n },\n 3: {\n className: \"x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x1tn5xpv x17v9ssf\"\n }\n }[!!inline << 1 | !!(!inline && variant === 'outlined') << 0]}>\n {inline ? <>\n <IconButton aria-label={decrementLabel} size=\"xs\" slot=\"decrement\">\n <MinusGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />\n </IconButton>\n <IconButton aria-label={incrementLabel} size=\"xs\" slot=\"increment\">\n <PlusGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />\n </IconButton>\n </> : <>\n <StackedStepper label={incrementLabel} outlined={variant === 'outlined'} slot=\"increment\">\n <PlusGlyph className=\"x1qx5ct2 x1lliihq xw4jnvo\" />\n </StackedStepper>\n <StackedStepper label={decrementLabel} outlined={variant === 'outlined'} slot=\"decrement\">\n <MinusGlyph className=\"x1qx5ct2 x1lliihq xw4jnvo\" />\n </StackedStepper>\n </>}\n </div>\n </div>}\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACNumberField>;\n}\nfunction StackedStepper({\n children,\n label,\n outlined,\n slot\n}: {\n children: ReactNode;\n label: string | undefined;\n outlined: boolean;\n slot: 'decrement' | 'increment';\n}) {\n return <RACButton aria-label={label} slot={slot} {...mergeStatefulStyles(stepperStyles(slot === 'increment', outlined), {})}>\n {children}\n </RACButton>;\n}\n\n// A stacked stepper: React Aria's button with the slot the field's context\n// looks for, drawn from its render state. Built by a call rather than\n// written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after.\nfunction stepperStyles(top: boolean, outlined: boolean) {\n return (state: ButtonRenderProps) => stylex.props(styles.stepper, outlined && styles.stepperOutlined, top && styles.stepperTop, !top && outlined && styles.stepperBottomOutlined, state.isHovered && !state.isDisabled && styles.stepperHovered, state.isPressed && !state.isDisabled && styles.stepperPressed, state.isFocusVisible && styles.stepperFocused, state.isDisabled && styles.stepperDisabled);\n}\nexport type { NumberFieldProps };\nexport default NumberField;"],"mappings":";;;;;;;;;;;;AAgEiB,GAAaS,QAAQE,KAAQD,WAAWE,sBAAyBF,WAAWG;AACnE,GAAaJ,QAAQK,KAAQJ,WAAWG;AAa5C,GAASH,WAAWG,sBAAyBL,OAAOO;AAC1E,MAAMC,gBAAgB,eAAeP,QAAQK,GAAE,KAAML,QAAQE,GAAE;AAK/D,MAAMQ,aAAa;CACjBC,YAAYH,YALmBT,OAAOO,UAAS,KAAMN,QAAQE,GAAE,KAAMF,QAAQS,GAAE,KAAMT,QAAQK,GAAE,KAAML,QAAQE,GAAE;CAM/GU,MAAMC,KAAAA;CACNC,UAAUP;AACZ;AACA,MAAMQ,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QA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AEO;AAOhB,SAAS2B,cAAcC,KAAcH,UAAmB;CACtD,QAAQI,UAA6BnG,MAAauB,OAAOC,SAASuE,YAAYxE,OAAO4B,iBAAiB+C,OAAO3E,OAAO8B,YAAY,CAAC6C,OAAOH,YAAYxE,OAAOuB,uBAAuBqD,MAAMC,aAAa,CAACD,MAAM9B,cAAc9C,OAAO2B,gBAAgBiD,MAAME,aAAa,CAACF,MAAM9B,cAAc9C,OAAO6B,gBAAgB+C,MAAMG,kBAAkB/E,OAAO0B,gBAAgBkD,MAAM9B,cAAc9C,OAAOyB,eAAe;AAC3Y"}
@@ -140,5 +140,4 @@ type PopoverContentProps = Omit<DialogProps, 'children' | 'className' | 'style'>
140
140
  };
141
141
  type PopoverDescriptionProps = TextProps;
142
142
  type PopoverTitleProps = HeadingProps;
143
- export { type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, Popover$1 as default };
144
- //# sourceMappingURL=index.d.ts.map
143
+ export { type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, Popover$1 as default };
@@ -2,7 +2,6 @@
2
2
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
3
  import { OverlayScope } from "../../overlay/index.js";
4
4
  import { mergeRefs } from "../../render/ref.js";
5
- import { focus } from "../../styles/focus.js";
6
5
  import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
7
6
  import { overlay, placementOf, popupOrigin } from "../../styles/overlay.js";
8
7
  import { c } from "react/compiler-runtime";
@@ -30,6 +29,17 @@ const styles = {
30
29
  kogj98: "x1ghz6dp",
31
30
  $$css: true
32
31
  },
32
+ dialog: {
33
+ k3XXqK: "x1t137rt",
34
+ $$css: true
35
+ },
36
+ dialogRing: {
37
+ kjBf7l: "xrgy624",
38
+ kInvED: "x2ssjo2",
39
+ k3XXqK: "xbrmr3i x1t137rt",
40
+ kMeerF: "x1de99jn",
41
+ $$css: true
42
+ },
33
43
  md: {
34
44
  ks0D6T: "x10u2fgw",
35
45
  $$css: true
@@ -196,7 +206,7 @@ function PanelDialog(t0) {
196
206
  const t13 = slot ?? void 0;
197
207
  let t14;
198
208
  if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
199
- t14 = props(overlay.popupDialog, focus.ring);
209
+ t14 = props(overlay.popupDialog, styles.dialog);
200
210
  $[21] = t14;
201
211
  } else t14 = $[21];
202
212
  let t15;
@@ -558,7 +568,7 @@ function PopoverContent(t0) {
558
568
  const t19 = modal ? void 0 : isOutsideTrigger;
559
569
  let t20;
560
570
  if ($[35] !== size) {
561
- t20 = (render) => props(overlay.popup, styles.content, styles[size], popupOrigin(render.placement));
571
+ t20 = (render) => props(overlay.popup, styles.content, styles.dialogRing, styles[size], popupOrigin(render.placement));
562
572
  $[35] = size;
563
573
  $[36] = t20;
564
574
  } else t20 = $[36];
@@ -578,7 +588,7 @@ function PopoverContent(t0) {
578
588
  t22 = modal ? /* @__PURE__ */ jsx(Dialog, {
579
589
  "aria-describedby": describedBy,
580
590
  ...props$1,
581
- ...props(overlay.popupDialog, focus.ring),
591
+ ...props(overlay.popupDialog, styles.dialog),
582
592
  children: /* @__PURE__ */ jsx(DescriptionContext, {
583
593
  value: registerDescription,
584
594
  children
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","RefObject","ClassNameOrFunction","DialogProps","DialogTriggerProps","HeadingProps","PopoverRenderProps","StyleOrFunction","TextProps","stylex","createContext","useCallback","useContext","useEffect","useId","useMemo","useRef","useState","useInteractOutside","ButtonContext","DEFAULT_SLOT","Dialog","DialogContext","DialogTrigger","Heading","HeadingContext","OverlayTriggerStateContext","PreviewTrigger","Popover","RACPopover","PopoverContext","RACPopoverContext","Text","TextContext","useSlottedContext","OverlayAlign","OverlaySide","OverlayScope","mergeRefs","focus","mergeStatefulStyles","mergeStyles","overlay","placementOf","popupOrigin","colors","spacing","typography","DEFAULT_SIDE_OFFSET","styles","content","kGO01o","kLKAdn","kg3NbH","$$css","description","kB7OPa","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kogj98","md","ks0D6T","sm","title","DEFAULT_HOVER_DELAY","DEFAULT_HOVER_CLOSE_DELAY","PopoverAlign","PopoverSide","PopoverSize","modal","size","DescriptionContext","id","TitleContext","TEXT_SLOTS","slots","PopoverProps","Omit","children","closeDelay","delay","trigger","PopoverTrigger","PanelDialog","t0","$","labelledBy","onPressWithin","props","slot","t1","t2","t3","t4","render","_render","t5","t6","ref","state","triggerOf","pressed","undefined","titleId","titled","setTitled","Symbol","for","registerTitle","level","headings","onPress","close","t7","t8","buttons","t10","t9","element","current","contains","document","activeElement","preventScroll","t11","t12","t13","t14","popupDialog","ring","t15","t16","t17","t18","context","PopoverContent","alignOffset","className","container","style","triggerRef","align","side","sideOffset","handed","panel","merged","pressedWithin","markPressWithin","own","triggers","fromTrigger","isOutsideTrigger","isOpen","event","target","Element","isDisabled","onInteractOutside","onInteractOutsideStart","descriptions","setDescriptions","ids","ids_0","at","indexOf","slice","registerDescription","length","Set","join","describedBy","t19","t20","popup","placement","t21","t22","t23","PopoverDescription","register","generated","PopoverTitle","Content","Description","Title","PopoverContentProps","PopoverDescriptionProps","PopoverTitleProps","PopoverContext","_c","props","stylex.props","Popover","RACPopoverContext","RACPopover"],"sources":["../../../src/components/popover/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes, RefObject } from 'react';\nimport type { ClassNameOrFunction, DialogProps, DialogTriggerProps, HeadingProps, PopoverRenderProps, StyleOrFunction, TextProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';\nimport { useInteractOutside } from 'react-aria';\nimport { ButtonContext, DEFAULT_SLOT, Dialog, DialogContext, DialogTrigger, Heading, HeadingContext, OverlayTriggerStateContext, PreviewTrigger, Popover as RACPopover, PopoverContext as RACPopoverContext, Text, TextContext, useSlottedContext } from 'react-aria-components';\nimport type { OverlayAlign, OverlaySide } from '../../styles/overlay';\nimport { OverlayScope } from '../../overlay';\nimport { mergeRefs } from '../../render/ref';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay, placementOf, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The gap between the anchor and the panel, matching `spacing.sm`'s default.\n// A number rather than the token, because React Aria computes the position in\n// JavaScript and so cannot read a CSS custom property — this is the one place\n// in the component where a step of the spacing scale is spelled out. React\n// Aria's own default is 8 as well, but the value is this component's decision\n// rather than an inherited one.\nconst DEFAULT_SIDE_OFFSET = 8;\n\n// The surface, its entry and the dialog's focus ring are the overlay module's,\n// shared with every anchored overlay; what is here is Popover's own — its\n// inset, its two widths, and the type of its title and description.\n//\n// Popover has no page of its own, so the inset and the type follow the rich\n// tooltip, the nearest thing the Material Design pages draw: a plain rounded\n// panel offset from its anchor, with no caret drawn between the two, holding\n// a subhead over supporting text.\n//\n// React Aria's popover is two elements — the positioned panel and the dialog\n// inside it — so the styles are split the same way: the surface, `content`\n// and a size on the panel, the dialog style on the element that carries the\n// role.\nconst styles = {\n content: {\n kGO01o: \"xqf7pud\",\n kLKAdn: \"x6gmt8y\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n description: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n },\n md: {\n ks0D6T: \"x10u2fgw\",\n $$css: true\n },\n sm: {\n ks0D6T: \"xjjheoa\",\n $$css: true\n },\n title: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n }\n};\n\n// How long a pointer rests on the trigger before a hovered popover opens,\n// and how long it has to leave before it closes. React Aria's own defaults,\n// spelled out because they are the whole feel of a hover trigger and worth\n// finding in the component rather than in a changelog.\nconst DEFAULT_HOVER_DELAY = 600;\nconst DEFAULT_HOVER_CLOSE_DELAY = 200;\n\n// The overlay module's, since which side a surface opens on is the same\n// question for every anchored overlay. Aliased rather than re-declared so\n// the names a call site imports stay this component's.\ntype PopoverAlign = OverlayAlign;\ntype PopoverSide = OverlaySide;\ntype PopoverSize = 'md' | 'sm';\n\n// `size` and `modal` are declared on the root, where a reader expects to set\n// the shape of the whole popover, but it is `Popover.Content` that has to\n// apply them. Through context rather than making the call site repeat them —\n// the same arrangement Sheet uses, and worth keeping identical between the\n// two panels a consumer is most likely to reach for in the same afternoon.\nconst PopoverContext = createContext<{\n modal: boolean;\n size: PopoverSize;\n}>({\n modal: false,\n size: 'md'\n});\n\n// React Aria points a dialog's `aria-describedby` at its description slot\n// only for an alert dialog, on the grounds that an ordinary dialog's content\n// is read anyway. A popover's description names what the panel is for, so it\n// is pointed at here: each description reports the id it renders while it is\n// mounted, and the dialog follows those ids, since an `aria-describedby` with\n// nothing at the other end is an invalid reference rather than a harmless one.\n// The id is the one the element carries, a call site's own included, and each\n// description has one of its own, so a second description adds its id rather\n// than sharing the first's, and unmounting either leaves the other.\nconst DescriptionContext = createContext<(id: string) => () => void>(() => () => {});\n\n// The same for the title, which the non-modal panel names itself by — see\n// PanelDialog. React Aria's own Dialog finds its title by looking for it;\n// the panel here is told it is there.\nconst TitleContext = createContext<() => () => void>(() => () => {});\n\n// The text slot the description fills, with the default beside it so a\n// plain `Text` still renders. Hoisted, since it never changes.\nconst TEXT_SLOTS = {\n slots: {\n [DEFAULT_SLOT]: {},\n description: {}\n }\n};\ntype PopoverProps = Omit<DialogTriggerProps, 'children'> & {\n children?: ReactNode;\n /**\n * How long the pointer has to leave a hovered popover before it closes, in\n * milliseconds. Ignored by a pressed one.\n * @default 200\n */\n closeDelay?: number;\n /**\n * How long the pointer has to rest on the trigger before a hovered popover\n * opens, in milliseconds. Ignored by a pressed one.\n * @default 600\n */\n delay?: number;\n /**\n * Blocks the page behind the panel while it is open, as a dialog would.\n * Off by default: a popover leaves the page interactive, which is the\n * difference from `Sheet`.\n * @default false\n */\n modal?: boolean;\n /**\n * Panel width: `sm` caps at 240px, `md` at 320px. Either way the panel is\n * only as wide as its contents, and never wider than the viewport.\n * @default 'md'\n */\n size?: PopoverSize;\n /**\n * What opens the panel: a press, or a pointer resting on the trigger.\n * `hover` is the tooltips page's rich tooltip — it opens on hover, focus\n * or a long press, and stays open while the pointer is inside it, so the\n * panel's own buttons and links can be reached.\n * @default 'press'\n */\n trigger?: PopoverTrigger;\n};\ntype PopoverTrigger = 'hover' | 'press';\n\n/**\n * The element that carries the dialog role in a non-modal popover: what\n * React Aria's `Dialog` gives a modal one — the role, the name from the\n * title, the description, and the close slot — without the two things that\n * make `Dialog` a modal's.\n *\n * `Dialog` moves focus into itself as it mounts, whatever opened it, and\n * holds focus inside the overlay until it closes. A hover popover therefore\n * took focus from wherever the reader was typing the moment a pointer\n * rested on its trigger, and Tab in an open popover went round its own\n * controls forever, though the page behind a non-modal popover is meant to\n * stay in reach. Here a pressed popover still takes focus as it opens, since\n * a press asked for the panel, but a hovered one leaves it where it is, and\n * Tab past the panel's last control carries on from the trigger in the\n * page. React Aria's popover sees a dialog inside it and so adds no role or\n * focus handling of its own.\n */\nfunction PanelDialog({\n 'aria-labelledby': labelledBy,\n children,\n id,\n onPressWithin,\n // React Aria's render prop is the one part of a dialog's props this\n // element cannot honour, being an element of its own rather than React\n // Aria's; left out rather than spread onto the DOM.\n render: _render,\n slot,\n ...props\n}: Omit<PopoverContentProps, 'align' | 'alignOffset' | 'className' | 'container' | 'side' | 'sideOffset' | 'style' | 'triggerRef'> & {\n /**\n * Called when a press starts anywhere inside the panel in React's tree,\n * which takes in what an overlay opened from the panel draws elsewhere in\n * the document — see `PopoverContent`.\n */\n onPressWithin: () => void;\n}) {\n const ref = useRef<HTMLElement>(null);\n const state = useContext(OverlayTriggerStateContext);\n // What the trigger hands its overlay: the id the trigger's\n // `aria-controls` points at, and the trigger itself as the name of a\n // panel with no title. A hover trigger hands nothing, and is a hover\n // trigger for exactly that reason.\n const trigger = triggerOf(useContext(DialogContext));\n const pressed = trigger !== undefined;\n const titleId = useId();\n const [titled, setTitled] = useState(false);\n const registerTitle = useCallback(() => {\n setTitled(true);\n return () => {\n setTitled(false);\n };\n }, []);\n const headings = useMemo(() => ({\n slots: {\n [DEFAULT_SLOT]: {},\n title: {\n id: titleId,\n level: 2\n }\n }\n }), [titleId]);\n const buttons = useMemo(() => ({\n slots: {\n close: {\n onPress: () => {\n state?.close();\n }\n },\n [DEFAULT_SLOT]: {}\n }\n }), [state]);\n useEffect(() => {\n const element = ref.current;\n if (pressed && element !== null && !element.contains(document.activeElement)) {\n element.focus({\n preventScroll: true\n });\n }\n }, [pressed]);\n return (\n // A section with the role, as React Aria's own dialog is: a `<dialog>`\n // element brings the browser's own positioning, border, padding and top\n // layer, all of which the panel around it already decides.\n <section {...props} aria-labelledby={labelledBy ?? (titled ? titleId : trigger?.labelledBy)} id={id ?? trigger?.id} onPointerDownCapture={onPressWithin} ref={ref}\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- a `<dialog>` element would bring the browser's own positioning and top layer, which the panel around it already decides\n role=\"dialog\" slot={slot ?? undefined} tabIndex={-1} {...stylex.props(overlay.popupDialog, focus.ring)}>\n <HeadingContext value={headings}>\n <TextContext value={TEXT_SLOTS}>\n <ButtonContext value={buttons}>\n <TitleContext value={registerTitle}>{children}</TitleContext>\n </ButtonContext>\n </TextContext>\n </HeadingContext>\n </section>\n );\n}\n\n/**\n * A panel anchored to the control that opened it. Open state is React Aria's:\n * pass `isOpen` with `onOpenChange` to control it, or `defaultOpen` to let it\n * keep its own.\n *\n * Non-modal by design — the page behind stays scrollable and clickable, which\n * is the difference from `Sheet`. Pass `modal` to change that. Escape, a press\n * anywhere outside the panel and a button given `slot=\"close\"` close it, and\n * a press on its trigger toggles it. Inside a dialog, a press on the scrim\n * closes the popover first and the dialog on the next, as a menu does.\n *\n * Composed rather than configured by props, because a popover's contents are\n * arbitrary — the parts are `Popover.Content`, `Popover.Title`, and\n * `Popover.Description`. A `Button` or `IconButton` placed directly inside\n * `Popover` opens it, and one given `slot=\"close\"` inside the content closes\n * it; neither needs a part of its own. Where the panel sits against its\n * trigger is `Popover.Content`'s `side` and `align`.\n *\n * ```tsx\n * <Popover>\n * <Button>Open</Button>\n * <Popover.Content side=\"end\">\n * <Popover.Title>Headline</Popover.Title>\n * <Popover.Description>Supporting line</Popover.Description>\n * <Button slot=\"close\" variant=\"text\">\n * Dismiss\n * </Button>\n * </Popover.Content>\n * </Popover>\n * ```\n */\nfunction Popover({\n children,\n closeDelay = DEFAULT_HOVER_CLOSE_DELAY,\n delay = DEFAULT_HOVER_DELAY,\n modal = false,\n size = 'md',\n trigger = 'press',\n ...props\n}: PopoverProps) {\n // A hovered popover is React Aria's preview trigger, which is a different\n // element around the same parts rather than a mode of the pressed one: it\n // opens from hover, focus or a long press, and it is always non-modal,\n // since a panel that blocked the page while the pointer merely rested on\n // something would be a trap. `modal` is ignored there rather than\n // refused, so the content draws the non-modal panel whatever it says.\n const context = useMemo(() => ({\n modal: modal && trigger !== 'hover',\n size\n }), [modal, size, trigger]);\n if (trigger === 'hover') {\n return <PopoverContext value={context}>\n <PreviewTrigger closeDelay={closeDelay} delay={delay} {...props}>\n {children}\n </PreviewTrigger>\n </PopoverContext>;\n }\n return <PopoverContext value={context}>\n <DialogTrigger {...props}>{children}</DialogTrigger>\n </PopoverContext>;\n}\n\n/**\n * The panel itself. Everything the popover shows goes in here; the trigger\n * stays outside it, since the trigger lives in the page while this is\n * portalled out to the end of the body.\n *\n * Placement is React Aria's anchor positioning, so the panel flips to the\n * opposite side and shifts along the edge of the viewport on its own rather\n * than being clipped by it.\n */\nfunction PopoverContent({\n align = 'center',\n alignOffset,\n children,\n className,\n container,\n ref,\n side = 'bottom',\n sideOffset = DEFAULT_SIDE_OFFSET,\n style,\n triggerRef,\n ...props\n}: PopoverContentProps & RefAttributes<HTMLElement>) {\n const {\n modal,\n size\n } = useContext(PopoverContext);\n const state = useContext(OverlayTriggerStateContext);\n // The trigger React Aria hands its popover, for a content part given no\n // `triggerRef` of its own.\n const handed = useSlottedContext(RACPopoverContext)?.triggerRef;\n\n // A non-modal popover is one React Aria closes on blur alone: a press on\n // blank page left it open, and a press on its own trigger closed it as\n // focus left the panel and opened it again on the same press. Here a\n // press anywhere outside the panel closes it, and a press on the trigger\n // is left to the trigger, which toggles it.\n //\n // What an overlay opened from inside the panel draws — a select's list, a\n // menu — is portalled elsewhere in the document, so a press there is\n // outside the panel's element though it is within the panel's tree. React\n // carries the press up that tree, and the panel marks it as within before\n // the press ends; the outside press is read on its end, so the mark is\n // there to read. Each press outside clears it as it starts.\n const panel = useRef<HTMLElement>(null);\n const merged = useMemo(() => mergeRefs(panel, ref ?? undefined), [ref]);\n const pressedWithin = useRef(false);\n const markPressWithin = useCallback(() => {\n pressedWithin.current = true;\n }, []);\n // The two refs the trigger may come through, kept where a callback can\n // read them at the moment of a press rather than as dependencies, which a\n // ref is not.\n const triggers = useRef({\n handed,\n own: triggerRef\n });\n useEffect(() => {\n triggers.current = {\n handed,\n own: triggerRef\n };\n });\n const isOutsideTrigger = useCallback((element: Element) => {\n const {\n handed: fromTrigger,\n own\n } = triggers.current;\n const trigger = own?.current ?? fromTrigger?.current;\n return !(trigger?.contains(element) ?? false);\n }, []);\n useInteractOutside({\n isDisabled: modal || state === null || !state.isOpen,\n onInteractOutside: event => {\n if (pressedWithin.current) {\n pressedWithin.current = false;\n return;\n }\n if (event.target instanceof Element && !isOutsideTrigger(event.target)) {\n return;\n }\n state?.close();\n },\n onInteractOutsideStart: () => {\n pressedWithin.current = false;\n },\n ref: panel\n });\n\n // The ids of the descriptions mounted in the panel, one entry per\n // description, in the order they mounted.\n const [descriptions, setDescriptions] = useState<readonly string[]>([]);\n const registerDescription = useCallback((id: string) => {\n setDescriptions(ids => [...ids, id]);\n return () => {\n setDescriptions(ids => {\n const at = ids.indexOf(id);\n return at === -1 ? ids : [...ids.slice(0, at), ...ids.slice(at + 1)];\n });\n };\n }, []);\n const describedBy = descriptions.length > 0 ? [...new Set(descriptions)].join(' ') : undefined;\n return <OverlayScope>\n <RACPopover crossOffset={alignOffset} isNonModal={!modal} offset={sideOffset} placement={placementOf(side, align)}\n // The surface, where the call site's class and style land, rather than\n // the dialog inside it, which takes the rest of the props.\n ref={merged}\n // Focus leaving for the trigger closes nothing: the trigger's own\n // press toggles the panel, and closing it first reopened it.\n shouldCloseOnInteractOutside={modal ? undefined : isOutsideTrigger} triggerRef={triggerRef}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...mergeStatefulStyles((render: PopoverRenderProps) => stylex.props(overlay.popup, styles.content, styles[size], popupOrigin(render.placement)), {\n className,\n style\n })}>\n {modal ? <Dialog aria-describedby={describedBy} {...props} {...stylex.props(overlay.popupDialog, focus.ring)}>\n <DescriptionContext value={registerDescription}>\n {children}\n </DescriptionContext>\n </Dialog> : <PanelDialog aria-describedby={describedBy} onPressWithin={markPressWithin} {...props}>\n <DescriptionContext value={registerDescription}>\n {children}\n </DescriptionContext>\n </PanelDialog>}\n </RACPopover>\n </OverlayScope>;\n}\n\n/**\n * Supporting copy under the title. The panel's `aria-describedby` points at\n * it — see DescriptionContext for why that is this component's doing.\n */\nfunction PopoverDescription(props: PopoverDescriptionProps & RefAttributes<HTMLElement>) {\n const register = useContext(DescriptionContext);\n const generated = useId();\n const id = props.id ?? generated;\n useEffect(() => register(id), [id, register]);\n return <Text slot=\"description\" {...props} id={id} {...mergeStyles({\n className: \"x9f619 x1w5n3ug xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh x1ghz6dp\"\n }, props)} />;\n}\n\n/**\n * Names the popover. Rendered through React Aria's title slot, which is what\n * points the panel's `aria-labelledby` at it — a popover without one announces\n * itself unnamed.\n */\nfunction PopoverTitle(props: PopoverTitleProps & RefAttributes<HTMLHeadingElement>) {\n const register = useContext(TitleContext);\n useEffect(() => register(), [register]);\n return <Heading slot=\"title\" {...props} {...mergeStyles({\n className: \"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q x1ghz6dp\"\n }, props)} />;\n}\n\n/**\n * What a pressed trigger hands the overlay it opens: the id its\n * `aria-controls` points at, and its own id to name a panel with no title.\n * Read field by field, since the context's type also admits a slotted\n * value; a hover trigger hands nothing.\n */\nfunction triggerOf(context: unknown) {\n if (typeof context !== 'object' || context === null || 'slots' in context) {\n return undefined;\n }\n return {\n id: 'id' in context && typeof context.id === 'string' ? context.id : undefined,\n labelledBy: 'aria-labelledby' in context && typeof context['aria-labelledby'] === 'string' ? context['aria-labelledby'] : undefined\n };\n}\nPopover.Content = PopoverContent;\nPopover.Description = PopoverDescription;\nPopover.Title = PopoverTitle;\n\n// The dialog's own props, plus the four that place the panel and its\n// styling. Those belong to the positioned panel rather than to the dialog,\n// but a call site has no reason to know there are two elements — `className`\n// and `style` reach the panel, which is the one worth restyling, and\n// everything else lands on the dialog.\ntype PopoverContentProps = Omit<DialogProps, 'children' | 'className' | 'style'> & {\n /**\n * Where the panel sits along the side it opens on.\n * @default 'center'\n */\n align?: PopoverAlign;\n /** Moves the panel along that side, in pixels. */\n alignOffset?: number;\n children?: ReactNode;\n /** A function may compute the class from the panel's render state. */\n className?: ClassNameOrFunction<PopoverRenderProps>;\n /**\n * Where to portal the panel. Defaults to the container of the `ThemeScope`\n * around it, which keeps the popover on that scope's tokens, or to the end of\n * `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the popover\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Which side of the trigger the panel opens on. It flips to the opposite\n * side when there is no room. `start` and `end` follow the writing\n * direction, so `end` is the right in English and the left in Arabic;\n * `left` and `right` stay put in either.\n * @default 'bottom'\n */\n side?: PopoverSide;\n /**\n * The gap between the trigger and the panel, in pixels.\n * @default 8\n */\n sideOffset?: number;\n /** A function may compute the style from the panel's render state. */\n style?: StyleOrFunction<PopoverRenderProps>;\n /**\n * An element to anchor the panel to other than the trigger that opened it.\n */\n triggerRef?: RefObject<Element | null>;\n};\ntype PopoverDescriptionProps = TextProps;\ntype PopoverTitleProps = HeadingProps;\nexport type { PopoverAlign, PopoverContentProps, PopoverDescriptionProps, PopoverProps, PopoverSide, PopoverSize, PopoverTitleProps, PopoverTrigger };\nexport { PopoverContent, PopoverDescription, PopoverTitle };\nexport default Popover;"],"mappings":";;;;;;;;;;;;;AAuBA,MAAMmD,sBAAsB;AAe5B,MAAMC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,IAAI;EACFC,QAAQ;EACRX,OAAO;CACT;CACAY,IAAI;EACFD,QAAQ;EACRX,OAAO;CACT;CACAa,OAAO;EACLX,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;AACF;AAMA,MAAMc,sBAAsB;AAC5B,MAAMC,4BAA4B;AAclC,MAAMvC,mBAAiBpB,cAGpB;CAC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AAAM;EAAAN,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAFNO;AAEM;;;;;;;AASf,SAASQ,UAAUkC,SAAkB;CACnC,IAAI,OAAOA,YAAY,YAAYA,YAAY,QAAQ,WAAWA,SAChE;CAEF,OAAO;EACL9D,IAAI,QAAQ8D,WAAW,OAAOA,QAAQ9D,OAAO,WAAW8D,QAAQ9D,KAAK8B,KAAAA;EACrEhB,YAAY,qBAAqBgD,WAAW,OAAOA,QAAQ,uBAAuB,WAAWA,QAAQ,qBAAqBhC,KAAAA;CAC5H;AACF;AACA9E,UAAQ+J,UAAUhD;AAClB/G,UAAQgK,cAAcL;AACtB3J,UAAQiK,QAAQH"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","createContext","useContext","useEffect","useId","useRef","useState","useInteractOutside","DEFAULT_SLOT","DialogContext","OverlayTriggerStateContext","Popover","PopoverContext","RACPopoverContext","useSlottedContext","mergeRefs","mergeStatefulStyles","mergeStyles","overlay","placementOf","popupOrigin","DEFAULT_SIDE_OFFSET","styles","content","kGO01o","kLKAdn","kg3NbH","$$css","description","kB7OPa","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kogj98","dialog","k3XXqK","dialogRing","kjBf7l","kInvED","kMeerF","md","ks0D6T","sm","title","DEFAULT_HOVER_DELAY","DEFAULT_HOVER_CLOSE_DELAY","modal","size","DescriptionContext","id","TitleContext","TEXT_SLOTS","slots","children","closeDelay","delay","trigger","PanelDialog","t0","$","labelledBy","onPressWithin","props","slot","t1","t2","t3","t4","render","_render","t5","t6","ref","state","triggerOf","pressed","undefined","titleId","titled","setTitled","Symbol","for","registerTitle","level","headings","onPress","close","t7","t8","buttons","t10","t9","element","current","contains","document","activeElement","focus","preventScroll","t11","t12","t13","t14","popupDialog","t15","t16","t17","t18","context","PopoverContent","alignOffset","className","container","style","triggerRef","align","side","sideOffset","handed","panel","merged","pressedWithin","markPressWithin","own","triggers","fromTrigger","isOutsideTrigger","isOpen","event","target","Element","isDisabled","onInteractOutside","onInteractOutsideStart","descriptions","setDescriptions","ids","ids_0","at","indexOf","slice","registerDescription","length","Set","join","describedBy","t19","t20","popup","placement","t21","t22","t23","PopoverDescription","register","generated","PopoverTitle","Content","Description","Title","PopoverContext","RACPopover"],"sources":["../../../src/components/popover/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes, RefObject } from 'react';\nimport type { ClassNameOrFunction, DialogProps, DialogTriggerProps, HeadingProps, PopoverRenderProps, StyleOrFunction, TextProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';\nimport { useInteractOutside } from 'react-aria';\nimport { ButtonContext, DEFAULT_SLOT, Dialog, DialogContext, DialogTrigger, Heading, HeadingContext, OverlayTriggerStateContext, PreviewTrigger, Popover as RACPopover, PopoverContext as RACPopoverContext, Text, TextContext, useSlottedContext } from 'react-aria-components';\nimport type { OverlayAlign, OverlaySide } from '../../styles/overlay';\nimport { OverlayScope } from '../../overlay';\nimport { mergeRefs } from '../../render/ref';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay, placementOf, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The gap between the anchor and the panel, matching `spacing.sm`'s default.\n// A number rather than the token, because React Aria computes the position in\n// JavaScript and so cannot read a CSS custom property — this is the one place\n// in the component where a step of the spacing scale is spelled out. React\n// Aria's own default is 8 as well, but the value is this component's decision\n// rather than an inherited one.\nconst DEFAULT_SIDE_OFFSET = 8;\n\n// The surface and its entry are the overlay module's, shared with every\n// anchored overlay; what is here is Popover's own — its inset, its two\n// widths, the type of its title and description, and where the dialog's\n// focus ring is drawn.\n//\n// Popover has no page of its own, so the inset and the type follow the rich\n// tooltip, the nearest thing the Material Design pages draw: a plain rounded\n// panel offset from its anchor, with no caret drawn between the two, holding\n// a subhead over supporting text.\n//\n// React Aria's popover is two elements — the positioned panel and the dialog\n// inside it — so the styles are split the same way: the surface, `content`,\n// a size and the dialog's focus ring on the panel, the dialog style on the\n// element that carries the role.\nconst styles = {\n content: {\n kGO01o: \"xqf7pud\",\n kLKAdn: \"x6gmt8y\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n description: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n },\n dialog: {\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n dialogRing: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xbrmr3i x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n md: {\n ks0D6T: \"x10u2fgw\",\n $$css: true\n },\n sm: {\n ks0D6T: \"xjjheoa\",\n $$css: true\n },\n title: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n }\n};\n\n// How long a pointer rests on the trigger before a hovered popover opens,\n// and how long it has to leave before it closes. React Aria's own defaults,\n// spelled out because they are the whole feel of a hover trigger and worth\n// finding in the component rather than in a changelog.\nconst DEFAULT_HOVER_DELAY = 600;\nconst DEFAULT_HOVER_CLOSE_DELAY = 200;\n\n// The overlay module's, since which side a surface opens on is the same\n// question for every anchored overlay. Aliased rather than re-declared so\n// the names a call site imports stay this component's.\ntype PopoverAlign = OverlayAlign;\ntype PopoverSide = OverlaySide;\ntype PopoverSize = 'md' | 'sm';\n\n// `size` and `modal` are declared on the root, where a reader expects to set\n// the shape of the whole popover, but it is `Popover.Content` that has to\n// apply them. Through context rather than making the call site repeat them —\n// the same arrangement Sheet uses, and worth keeping identical between the\n// two panels a consumer is most likely to reach for in the same afternoon.\nconst PopoverContext = createContext<{\n modal: boolean;\n size: PopoverSize;\n}>({\n modal: false,\n size: 'md'\n});\n\n// React Aria points a dialog's `aria-describedby` at its description slot\n// only for an alert dialog, on the grounds that an ordinary dialog's content\n// is read anyway. A popover's description names what the panel is for, so it\n// is pointed at here: each description reports the id it renders while it is\n// mounted, and the dialog follows those ids, since an `aria-describedby` with\n// nothing at the other end is an invalid reference rather than a harmless one.\n// The id is the one the element carries, a call site's own included, and each\n// description has one of its own, so a second description adds its id rather\n// than sharing the first's, and unmounting either leaves the other.\nconst DescriptionContext = createContext<(id: string) => () => void>(() => () => {});\n\n// The same for the title, which the non-modal panel names itself by — see\n// PanelDialog. React Aria's own Dialog finds its title by looking for it;\n// the panel here is told it is there.\nconst TitleContext = createContext<() => () => void>(() => () => {});\n\n// The text slot the description fills, with the default beside it so a\n// plain `Text` still renders. Hoisted, since it never changes.\nconst TEXT_SLOTS = {\n slots: {\n [DEFAULT_SLOT]: {},\n description: {}\n }\n};\ntype PopoverProps = Omit<DialogTriggerProps, 'children'> & {\n children?: ReactNode;\n /**\n * How long the pointer has to leave a hovered popover before it closes, in\n * milliseconds. Ignored by a pressed one.\n * @default 200\n */\n closeDelay?: number;\n /**\n * How long the pointer has to rest on the trigger before a hovered popover\n * opens, in milliseconds. Ignored by a pressed one.\n * @default 600\n */\n delay?: number;\n /**\n * Blocks the page behind the panel while it is open, as a dialog would.\n * Off by default: a popover leaves the page interactive, which is the\n * difference from `Sheet`.\n * @default false\n */\n modal?: boolean;\n /**\n * Panel width: `sm` caps at 240px, `md` at 320px. Either way the panel is\n * only as wide as its contents, and never wider than the viewport.\n * @default 'md'\n */\n size?: PopoverSize;\n /**\n * What opens the panel: a press, or a pointer resting on the trigger.\n * `hover` is the tooltips page's rich tooltip — it opens on hover, focus\n * or a long press, and stays open while the pointer is inside it, so the\n * panel's own buttons and links can be reached.\n * @default 'press'\n */\n trigger?: PopoverTrigger;\n};\ntype PopoverTrigger = 'hover' | 'press';\n\n/**\n * The element that carries the dialog role in a non-modal popover: what\n * React Aria's `Dialog` gives a modal one — the role, the name from the\n * title, the description, and the close slot — without the two things that\n * make `Dialog` a modal's.\n *\n * `Dialog` moves focus into itself as it mounts, whatever opened it, and\n * holds focus inside the overlay until it closes. A hover popover therefore\n * took focus from wherever the reader was typing the moment a pointer\n * rested on its trigger, and Tab in an open popover went round its own\n * controls forever, though the page behind a non-modal popover is meant to\n * stay in reach. Here a pressed popover still takes focus as it opens, since\n * a press asked for the panel, but a hovered one leaves it where it is, and\n * Tab past the panel's last control carries on from the trigger in the\n * page. React Aria's popover sees a dialog inside it and so adds no role or\n * focus handling of its own.\n */\nfunction PanelDialog({\n 'aria-labelledby': labelledBy,\n children,\n id,\n onPressWithin,\n // React Aria's render prop is the one part of a dialog's props this\n // element cannot honour, being an element of its own rather than React\n // Aria's; left out rather than spread onto the DOM.\n render: _render,\n slot,\n ...props\n}: Omit<PopoverContentProps, 'align' | 'alignOffset' | 'className' | 'container' | 'side' | 'sideOffset' | 'style' | 'triggerRef'> & {\n /**\n * Called when a press starts anywhere inside the panel in React's tree,\n * which takes in what an overlay opened from the panel draws elsewhere in\n * the document — see `PopoverContent`.\n */\n onPressWithin: () => void;\n}) {\n const ref = useRef<HTMLElement>(null);\n const state = useContext(OverlayTriggerStateContext);\n // What the trigger hands its overlay: the id the trigger's\n // `aria-controls` points at, and the trigger itself as the name of a\n // panel with no title. A hover trigger hands nothing, and is a hover\n // trigger for exactly that reason.\n const trigger = triggerOf(useContext(DialogContext));\n const pressed = trigger !== undefined;\n const titleId = useId();\n const [titled, setTitled] = useState(false);\n const registerTitle = useCallback(() => {\n setTitled(true);\n return () => {\n setTitled(false);\n };\n }, []);\n const headings = useMemo(() => ({\n slots: {\n [DEFAULT_SLOT]: {},\n title: {\n id: titleId,\n level: 2\n }\n }\n }), [titleId]);\n const buttons = useMemo(() => ({\n slots: {\n close: {\n onPress: () => {\n state?.close();\n }\n },\n [DEFAULT_SLOT]: {}\n }\n }), [state]);\n useEffect(() => {\n const element = ref.current;\n if (pressed && element !== null && !element.contains(document.activeElement)) {\n element.focus({\n preventScroll: true\n });\n }\n }, [pressed]);\n return (\n // A section with the role, as React Aria's own dialog is: a `<dialog>`\n // element brings the browser's own positioning, border, padding and top\n // layer, all of which the panel around it already decides.\n <section {...props} aria-labelledby={labelledBy ?? (titled ? titleId : trigger?.labelledBy)} id={id ?? trigger?.id} onPointerDownCapture={onPressWithin} ref={ref}\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- a `<dialog>` element would bring the browser's own positioning and top layer, which the panel around it already decides\n role=\"dialog\" slot={slot ?? undefined} tabIndex={-1} {...stylex.props(overlay.popupDialog, styles.dialog)}>\n <HeadingContext value={headings}>\n <TextContext value={TEXT_SLOTS}>\n <ButtonContext value={buttons}>\n <TitleContext value={registerTitle}>{children}</TitleContext>\n </ButtonContext>\n </TextContext>\n </HeadingContext>\n </section>\n );\n}\n\n/**\n * A panel anchored to the control that opened it. Open state is React Aria's:\n * pass `isOpen` with `onOpenChange` to control it, or `defaultOpen` to let it\n * keep its own.\n *\n * Non-modal by design — the page behind stays scrollable and clickable, which\n * is the difference from `Sheet`. Pass `modal` to change that. Escape, a press\n * anywhere outside the panel and a button given `slot=\"close\"` close it, and\n * a press on its trigger toggles it. Inside a dialog, a press on the scrim\n * closes the popover first and the dialog on the next, as a menu does.\n *\n * Composed rather than configured by props, because a popover's contents are\n * arbitrary — the parts are `Popover.Content`, `Popover.Title`, and\n * `Popover.Description`. A `Button` or `IconButton` placed directly inside\n * `Popover` opens it, and one given `slot=\"close\"` inside the content closes\n * it; neither needs a part of its own. Where the panel sits against its\n * trigger is `Popover.Content`'s `side` and `align`.\n *\n * ```tsx\n * <Popover>\n * <Button>Open</Button>\n * <Popover.Content side=\"end\">\n * <Popover.Title>Headline</Popover.Title>\n * <Popover.Description>Supporting line</Popover.Description>\n * <Button slot=\"close\" variant=\"text\">\n * Dismiss\n * </Button>\n * </Popover.Content>\n * </Popover>\n * ```\n */\nfunction Popover({\n children,\n closeDelay = DEFAULT_HOVER_CLOSE_DELAY,\n delay = DEFAULT_HOVER_DELAY,\n modal = false,\n size = 'md',\n trigger = 'press',\n ...props\n}: PopoverProps) {\n // A hovered popover is React Aria's preview trigger, which is a different\n // element around the same parts rather than a mode of the pressed one: it\n // opens from hover, focus or a long press, and it is always non-modal,\n // since a panel that blocked the page while the pointer merely rested on\n // something would be a trap. `modal` is ignored there rather than\n // refused, so the content draws the non-modal panel whatever it says.\n const context = useMemo(() => ({\n modal: modal && trigger !== 'hover',\n size\n }), [modal, size, trigger]);\n if (trigger === 'hover') {\n return <PopoverContext value={context}>\n <PreviewTrigger closeDelay={closeDelay} delay={delay} {...props}>\n {children}\n </PreviewTrigger>\n </PopoverContext>;\n }\n return <PopoverContext value={context}>\n <DialogTrigger {...props}>{children}</DialogTrigger>\n </PopoverContext>;\n}\n\n/**\n * The panel itself. Everything the popover shows goes in here; the trigger\n * stays outside it, since the trigger lives in the page while this is\n * portalled out to the end of the body.\n *\n * Placement is React Aria's anchor positioning, so the panel flips to the\n * opposite side and shifts along the edge of the viewport on its own rather\n * than being clipped by it.\n */\nfunction PopoverContent({\n align = 'center',\n alignOffset,\n children,\n className,\n container,\n ref,\n side = 'bottom',\n sideOffset = DEFAULT_SIDE_OFFSET,\n style,\n triggerRef,\n ...props\n}: PopoverContentProps & RefAttributes<HTMLElement>) {\n const {\n modal,\n size\n } = useContext(PopoverContext);\n const state = useContext(OverlayTriggerStateContext);\n // The trigger React Aria hands its popover, for a content part given no\n // `triggerRef` of its own.\n const handed = useSlottedContext(RACPopoverContext)?.triggerRef;\n\n // A non-modal popover is one React Aria closes on blur alone: a press on\n // blank page left it open, and a press on its own trigger closed it as\n // focus left the panel and opened it again on the same press. Here a\n // press anywhere outside the panel closes it, and a press on the trigger\n // is left to the trigger, which toggles it.\n //\n // What an overlay opened from inside the panel draws — a select's list, a\n // menu — is portalled elsewhere in the document, so a press there is\n // outside the panel's element though it is within the panel's tree. React\n // carries the press up that tree, and the panel marks it as within before\n // the press ends; the outside press is read on its end, so the mark is\n // there to read. Each press outside clears it as it starts.\n const panel = useRef<HTMLElement>(null);\n const merged = useMemo(() => mergeRefs(panel, ref ?? undefined), [ref]);\n const pressedWithin = useRef(false);\n const markPressWithin = useCallback(() => {\n pressedWithin.current = true;\n }, []);\n // The two refs the trigger may come through, kept where a callback can\n // read them at the moment of a press rather than as dependencies, which a\n // ref is not.\n const triggers = useRef({\n handed,\n own: triggerRef\n });\n useEffect(() => {\n triggers.current = {\n handed,\n own: triggerRef\n };\n });\n const isOutsideTrigger = useCallback((element: Element) => {\n const {\n handed: fromTrigger,\n own\n } = triggers.current;\n const trigger = own?.current ?? fromTrigger?.current;\n return !(trigger?.contains(element) ?? false);\n }, []);\n useInteractOutside({\n isDisabled: modal || state === null || !state.isOpen,\n onInteractOutside: event => {\n if (pressedWithin.current) {\n pressedWithin.current = false;\n return;\n }\n if (event.target instanceof Element && !isOutsideTrigger(event.target)) {\n return;\n }\n state?.close();\n },\n onInteractOutsideStart: () => {\n pressedWithin.current = false;\n },\n ref: panel\n });\n\n // The ids of the descriptions mounted in the panel, one entry per\n // description, in the order they mounted.\n const [descriptions, setDescriptions] = useState<readonly string[]>([]);\n const registerDescription = useCallback((id: string) => {\n setDescriptions(ids => [...ids, id]);\n return () => {\n setDescriptions(ids => {\n const at = ids.indexOf(id);\n return at === -1 ? ids : [...ids.slice(0, at), ...ids.slice(at + 1)];\n });\n };\n }, []);\n const describedBy = descriptions.length > 0 ? [...new Set(descriptions)].join(' ') : undefined;\n return <OverlayScope>\n <RACPopover crossOffset={alignOffset} isNonModal={!modal} offset={sideOffset} placement={placementOf(side, align)}\n // The surface, where the call site's class and style land, rather than\n // the dialog inside it, which takes the rest of the props.\n ref={merged}\n // Focus leaving for the trigger closes nothing: the trigger's own\n // press toggles the panel, and closing it first reopened it.\n shouldCloseOnInteractOutside={modal ? undefined : isOutsideTrigger} triggerRef={triggerRef}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...mergeStatefulStyles((render: PopoverRenderProps) => stylex.props(overlay.popup, styles.content, styles.dialogRing, styles[size], popupOrigin(render.placement)), {\n className,\n style\n })}>\n {modal ? <Dialog aria-describedby={describedBy} {...props} {...stylex.props(overlay.popupDialog, styles.dialog)}>\n <DescriptionContext value={registerDescription}>\n {children}\n </DescriptionContext>\n </Dialog> : <PanelDialog aria-describedby={describedBy} onPressWithin={markPressWithin} {...props}>\n <DescriptionContext value={registerDescription}>\n {children}\n </DescriptionContext>\n </PanelDialog>}\n </RACPopover>\n </OverlayScope>;\n}\n\n/**\n * Supporting copy under the title. The panel's `aria-describedby` points at\n * it — see DescriptionContext for why that is this component's doing.\n */\nfunction PopoverDescription(props: PopoverDescriptionProps & RefAttributes<HTMLElement>) {\n const register = useContext(DescriptionContext);\n const generated = useId();\n const id = props.id ?? generated;\n useEffect(() => register(id), [id, register]);\n return <Text slot=\"description\" {...props} id={id} {...mergeStyles({\n className: \"x9f619 x1w5n3ug xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh x1ghz6dp\"\n }, props)} />;\n}\n\n/**\n * Names the popover. Rendered through React Aria's title slot, which is what\n * points the panel's `aria-labelledby` at it — a popover without one announces\n * itself unnamed.\n */\nfunction PopoverTitle(props: PopoverTitleProps & RefAttributes<HTMLHeadingElement>) {\n const register = useContext(TitleContext);\n useEffect(() => register(), [register]);\n return <Heading slot=\"title\" {...props} {...mergeStyles({\n className: \"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q x1ghz6dp\"\n }, props)} />;\n}\n\n/**\n * What a pressed trigger hands the overlay it opens: the id its\n * `aria-controls` points at, and its own id to name a panel with no title.\n * Read field by field, since the context's type also admits a slotted\n * value; a hover trigger hands nothing.\n */\nfunction triggerOf(context: unknown) {\n if (typeof context !== 'object' || context === null || 'slots' in context) {\n return undefined;\n }\n return {\n id: 'id' in context && typeof context.id === 'string' ? context.id : undefined,\n labelledBy: 'aria-labelledby' in context && typeof context['aria-labelledby'] === 'string' ? context['aria-labelledby'] : undefined\n };\n}\nPopover.Content = PopoverContent;\nPopover.Description = PopoverDescription;\nPopover.Title = PopoverTitle;\n\n// The dialog's own props, plus the four that place the panel and its\n// styling. Those belong to the positioned panel rather than to the dialog,\n// but a call site has no reason to know there are two elements — `className`\n// and `style` reach the panel, which is the one worth restyling, and\n// everything else lands on the dialog.\ntype PopoverContentProps = Omit<DialogProps, 'children' | 'className' | 'style'> & {\n /**\n * Where the panel sits along the side it opens on.\n * @default 'center'\n */\n align?: PopoverAlign;\n /** Moves the panel along that side, in pixels. */\n alignOffset?: number;\n children?: ReactNode;\n /** A function may compute the class from the panel's render state. */\n className?: ClassNameOrFunction<PopoverRenderProps>;\n /**\n * Where to portal the panel. Defaults to the container of the `ThemeScope`\n * around it, which keeps the popover on that scope's tokens, or to the end of\n * `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the popover\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Which side of the trigger the panel opens on. It flips to the opposite\n * side when there is no room. `start` and `end` follow the writing\n * direction, so `end` is the right in English and the left in Arabic;\n * `left` and `right` stay put in either.\n * @default 'bottom'\n */\n side?: PopoverSide;\n /**\n * The gap between the trigger and the panel, in pixels.\n * @default 8\n */\n sideOffset?: number;\n /** A function may compute the style from the panel's render state. */\n style?: StyleOrFunction<PopoverRenderProps>;\n /**\n * An element to anchor the panel to other than the trigger that opened it.\n */\n triggerRef?: RefObject<Element | null>;\n};\ntype PopoverDescriptionProps = TextProps;\ntype PopoverTitleProps = HeadingProps;\nexport type { PopoverAlign, PopoverContentProps, PopoverDescriptionProps, PopoverProps, PopoverSide, PopoverSize, PopoverTitleProps, PopoverTrigger };\nexport { PopoverContent, PopoverDescription, PopoverTitle };\nexport default Popover;"],"mappings":";;;;;;;;;;;;AAsBA,MAAMsB,sBAAsB;AAgB5B,MAAMC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,QAAQ;EACNC,QAAQ;EACRX,OAAO;CACT;CACAY,YAAY;EACVC,QAAQ;EACRC,QAAQ;EACRH,QAAQ;EACRI,QAAQ;EACRf,OAAO;CACT;CACAgB,IAAI;EACFC,QAAQ;EACRjB,OAAO;CACT;CACAkB,IAAI;EACFD,QAAQ;EACRjB,OAAO;CACT;CACAmB,OAAO;EACLjB,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;AACF;AAMA,MAAMoB,sBAAsB;AAC5B,MAAMC,4BAA4B;AAclC,MAAMpC,mBAAiBX,cAGpB;CACDgD,OAAO;CACPC,MAAM;AACR,CAAC;AAWD,MAAMC,qBAAqBlD,0BAAsD,CAAC,CAAC;AAKnF,MAAMoD,eAAepD,0BAA4C,CAAC,CAAC;AAInE,MAAMqD,aAAa,EACjBC,OAAO;EACJ/C,eAAe,CAAC;CACjBoB,aAAa,CAAC;AAChB,EACF;;;;;;;;;;;;;;;;;;AAwDA,SAAAgC,YAAAC,IAAA;CAAA,MAAAC,IAAA/D,EAAA,EAAA;CAAA,IAAAyD;CAAA,IAAAJ;CAAA,IAAAW;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAqB,MAAA,EAAA,mBAAAM,IAAAX,UAAAY,IA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4 @@ type ProductIconProps = Omit<RenderComponentProps<'span'>, 'children'> & {
60
60
  * The call site's `className`, `style` and `ref` land on the square.
61
61
  */
62
62
  declare function ProductIcon({ size, tone, ...props }: ProductIconProps): import("react").JSX.Element;
63
- export { type ProductIconProps, ProductIcon as default };
64
- //# sourceMappingURL=index.d.ts.map
63
+ export { type ProductIconProps, ProductIcon as default };