@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","FocusableElement","DisclosurePanelProps","RACDisclosurePanelProps","DisclosureProps","RACDisclosureProps","stylex","useContext","DisclosureStateContext","Button","RACButton","Disclosure","RACDisclosure","DisclosurePanel","RACDisclosurePanel","Heading","RACHeading","ChevronEndGlyph","useRipple","RowContent","rowStyles","mergeStatefulStyles","colors","motion","spacing","styles","header","kzqmXN","k9WMMc","$$css","DisclosureHeaderProps","children","headingLevel","leading","supporting","Omit","className","style","chevronFor","isExpanded","t0","$","T0","t1","t2","t3","props","DisclosureHeader","undefined","state","ripple","headerClassName","handlers","t4","t5","surface","headerContent","t6","t7","Symbol","for","0","1","isDisabled","isHovered","isPressed","base","list","interactive","twoLine","hovered","pressed","disabled","Header","Panel","Disclosure","_c","RACDisclosure","RACButton","RACHeading","DisclosurePanel","RACDisclosurePanel","stylex.props"],"sources":["../../../src/components/disclosure/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { FocusableElement, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { DisclosureStateContext, Button as RACButton, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, Heading as RACHeading } from 'react-aria-components';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, spacing } from '../../tokens/design.tokens.stylex';\n\n// A section that opens to show what is under it, and closes again. The\n// header is the row every list here draws — `src/row`, shared with ListItem,\n// ListBox and List — so its 56dp floor, body-large headline, body-medium\n// supporting line and state layers are that module's, and a header sitting\n// above a list cannot drift from the rows below it.\n//\n// The lists page gives the expand interaction its own token set, which its\n// widget keeps behind a menu that does not open to a script. What the page\n// states in words covers the row, which is what the shared module already\n// carries; the chevron's size and the panel's inset below are the library's\n// own, taken from the row's own trailing slot and inline padding rather than\n// invented.\n//\n// Three things are this component's own.\n//\n// **The header is a heading with a button in it.** React Aria wants both —\n// the heading is what a screen reader jumps between, and the button is what\n// opens the section — so `Disclosure.Header` renders the pair rather than\n// leaving a call site to remember. `headingLevel` says where in the page's\n// outline it sits.\n//\n// **The panel opens to its own height, without one being measured.** A grid\n// whose single row goes from `0fr` to `1fr` interpolates between nothing and\n// the content's natural height, so no height is read from the DOM and no\n// number is written down. Under `prefers-reduced-motion` the row snaps\n// instead.\n//\n// **Only the opening animates, and that is React Aria's doing rather than a\n// choice here.** It marks the collapsed panel `hidden=\"until-found\"`, so on\n// the way closed the content stops being laid out at once and the track has\n// nothing left to shrink. Worth knowing before reaching for a closing\n// animation: it needs the panel kept in the layout, which would cost the\n// find-in-page behaviour that attribute buys.\n\nconst styles = {\n header: {\n kzqmXN: \"xh8yej3\",\n k9WMMc: \"x1yc453h\",\n $$css: true\n }\n};\ntype DisclosureHeaderProps = {\n /** The header's headline — what the section is about. */\n children?: ReactNode;\n /**\n * Where the header sits in the page's outline. React Aria renders the\n * trigger inside a heading, and a screen reader moves between them.\n * @default 3\n */\n headingLevel?: number;\n /** Content before the headline: an avatar, an icon. */\n leading?: ReactNode;\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n};\ntype DisclosurePanelProps = Omit<RACDisclosurePanelProps, 'className' | 'style'> & {\n /** A function may compute the class from the panel's render state. */\n className?: RACDisclosurePanelProps['className'];\n /** A function may compute the style from the panel's render state. */\n style?: RACDisclosurePanelProps['style'];\n};\ntype DisclosureProps = Omit<RACDisclosureProps, 'children'> & {\n /** A `Disclosure.Header` and a `Disclosure.Panel`. */\n children?: ReactNode;\n};\n\n// The chevron, turned or not. A call rather than JSX written at the prop,\n// which is what react-perf's jsx-no-jsx-as-prop is after; the React Compiler\n// memoises the result on `isExpanded`.\nfunction chevronFor(isExpanded: boolean) {\n return <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 x1w5n3ug x2lah0s xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 x1w5n3ug x2lah0s xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl\"\n }\n }[!!isExpanded << 0]} />;\n}\n\n/**\n * A section that opens to show what is under it. Whether it is open is React\n * Aria's: pass `isExpanded` with `onExpandedChange` to control it, or\n * `defaultExpanded` to let it keep its own.\n *\n * ```tsx\n * <Disclosure>\n * <Disclosure.Header>Headline</Disclosure.Header>\n * <Disclosure.Panel>Supporting line</Disclosure.Panel>\n * </Disclosure>\n * ```\n *\n * The header is the row every list here draws, so a section above a list of\n * rows lines up with them. The panel opens to whatever height its content\n * turns out to have, and snaps rather than sliding under\n * `prefers-reduced-motion`.\n *\n * The call site's `className` and `style` land on the container, which is the\n * element a layout positions.\n */\nfunction Disclosure({\n children,\n ...props\n}: DisclosureProps & RefAttributes<HTMLDivElement>) {\n return <RACDisclosure {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {children}\n </RACDisclosure>;\n}\n\n/**\n * The row that opens the section. It renders the heading React Aria wants\n * around the trigger and the button inside it, and draws the shared row's\n * slots with a chevron in the trailing one.\n */\nfunction DisclosureHeader({\n children,\n headingLevel = 3,\n leading,\n supporting\n}: DisclosureHeaderProps) {\n // The chevron turns with the section, and React Aria's button render state\n // reports the press states rather than what the button controls — so\n // whether the section is open comes from the disclosure's own context.\n const state = useContext(DisclosureStateContext);\n // The press ripple a list's rows draw, since this is the same row. It is a\n // button, which hears its own click, so the press ends there as Button's\n // does, and a keyboard press draws one too.\n const ripple = useRipple<FocusableElement>();\n return <RACHeading level={headingLevel} className=\"x1qlqyl8 x1pd3egz x1ghz6dp\">\n <RACButton className={headerClassName(supporting)} slot=\"trigger\" {...ripple.handlers}>\n {headerContent(children, leading, supporting, state?.isExpanded === true, ripple.surface)}\n </RACButton>\n </RACHeading>;\n}\n\n/**\n * What the section shows while it is open. Its content lines up with the\n * headline above it, and it takes the group role React Aria gives it —\n * `role=\"region\"` names it in the landmark list instead, for a section a\n * reader should be able to jump to.\n */\nfunction DisclosurePanel({\n children,\n ...props\n}: DisclosurePanelProps & RefAttributes<HTMLDivElement>) {\n // The track has to know, and React Aria hands the render state to the panel\n // rather than to what wraps it — so the state comes from its context, the\n // same one its own panel reads.\n const state = useContext(DisclosureStateContext);\n return <div {...{\n 0: {\n className: \"x12w9bfk xrvj5dj xihq33y xjvfotl x1qn9uv2 x1seskgd\"\n },\n 1: {\n className: \"x12w9bfk xrvj5dj xjvfotl x1qn9uv2 x1seskgd x1tu4anv\"\n }\n }[!!(state?.isExpanded === true) << 0]}>\n <RACDisclosurePanel {...props} {...mergeStatefulStyles({\n className: \"x9f619 x2lwn1j x7giv3 x1hm618n\"\n }, props)}>\n <div className=\"x9f619 xzfxn0k x25398y x790zyz\">{children}</div>\n </RACDisclosurePanel>\n </div>;\n}\n\n// The trigger's classes, from React Aria's render state. `isSelected` is not\n// among them — a disclosure's button reports `aria-expanded` rather than a\n// selection — so the row draws unselected throughout and only its disabled\n// state changes.\n//\n// A supporting line moves the header from the page's one-line container\n// height to its two-line one, which is a floor rather than something the\n// row's own box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as\n// an argument rather than read from the render state, since React Aria\n// reports what the trigger is doing and not what it holds; the classes are\n// built by a call for the same reason `headerContent` is.\n// No overline, and so no three-line header. The row takes the list\n// variant's metrics because a header looks like a list row, but what it\n// follows is its own page, and that page gives a headline and a supporting\n// line — the three-line item belongs to the lists page, which `List.Item`\n// and `ListBox.Item` draw.\n//\n// The hover and pressed layers come from the trigger's render state, like\n// every other row React Aria hosts — see `focusVisible` in\n// `src/row/styles.ts` for the order they are drawn in.\nfunction headerClassName(supporting: ReactNode) {\n return (state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => stylex.props(rowStyles.base, rowStyles.list, rowStyles.interactive, styles.header, supporting !== undefined && rowStyles.twoLine, state.isHovered && rowStyles.hovered, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled).className ?? '';\n}\n\n// What the header row draws. Built by a call rather than written inline at\n// the prop, which is what react-perf's no-new-function-as-prop is after; the\n// React Compiler memoises the result on its inputs.\nfunction headerContent(children: ReactNode, leading: ReactNode, supporting: ReactNode, isExpanded: boolean, ripple: ReactNode) {\n return (state: {\n isDisabled: boolean;\n }) => <>\n <RowContent isDisabled={state.isDisabled} leading={leading} supporting={supporting} trailing={chevronFor(isExpanded)}>\n {children}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\nDisclosure.Header = DisclosureHeader;\nDisclosure.Panel = DisclosurePanel;\nexport type { DisclosureHeaderProps, DisclosurePanelProps, DisclosureProps };\nexport { DisclosureHeader, DisclosurePanel };\nexport default Disclosure;"],"mappings":";;;;;;;;;;;;AAiDA,MAAM4B,SAAS,EACbC,QAAQ;CACNC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AA6BA,SAASS,WAAWC,YAAqB;CACvC,OAAO,oBAAC,iBAAD,EAAiB,GAAI;EAC1B,GAAG,EACDH,WAAW,sFACb;EACA,GAAG,EACDA,WAAW,sFACb;CACF,EAAE,CAAC,CAACG,cAAc,GAAG,CAAA;AACvB;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAA5B,aAAA6B,IAAA;CAAA,MAAAC,IAAA3C,EAAA,EAAA;CAAA,IAAA4C;CAAA,IAAAX;CAAA,IAAAY;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAoB,MAAA,EAAAT,UAAAc,IAAA,GAAAC,UAAAN;EAAAT,WAAAc;EAIVH,KAAA9B;EAAkBkC,KAAAA;EAAWF,KAAAvB,oBAAoB,EAAAe,WAC5C,yBACb,GAAGU,KAAK;EAACL,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAV;EAAAU,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAF,KAAAD,EAAA;EAAAV,WAAAU,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;CAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAC,MAAAD,EAAA,OAAAV,YAAAU,EAAA,OAAAE,MAAAF,EAAA,OAAAG,IAAA;EAFFC,KAAA,oBAAC,IAAD;GAAc,GAAKC;GAAK,GAAMF;GAGhCb;EAHgB,CAAA;EAIHU,EAAA,KAAAC;EAAAD,EAAA,KAAAV;EAAAU,EAAA,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CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAgB;CAAA,IAAAhB,EAAA,OAAAG,MAAAH,EAAA,OAAAa,IAAA;EAZlBG,KAAA,oBAAA,OAAA;GAaC,GAbQb;GAQZU,UAAAA;EAKI,CAAA;EAAAb,EAAA,KAAAG;EAAAH,EAAA,KAAAa;EAAAb,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,OAbDgB;AAaC;AAuBV,SAASN,gBAAgBjB,YAAuB;CAC9C,QAAQe,UAIF3C,MAAac,UAAU8C,MAAM9C,UAAU+C,MAAM/C,UAAUgD,aAAa3C,OAAOC,QAAQQ,eAAec,KAAAA,KAAa5B,UAAUiD,SAASpB,MAAMe,aAAa5C,UAAUkD,SAASrB,MAAMgB,aAAa7C,UAAUmD,SAAStB,MAAMc,cAAc3C,UAAUoD,QAAQ,CAAC,CAACpC,aAAa;AAC3Q;AAKA,SAASoB,cAAczB,UAAqBE,SAAoBC,YAAuBK,YAAqBW,QAAmB;CAC7H,QAAQD,UAEF,qBAAA,YAAA,EAAA,UAAA,CACF,oBAAC,YAAD;EAAY,YAAYA,MAAMc;EAAqB9B;EAAqBC;EAAY,UAAUI,WAAWC,UAAU;EAChHR;CACS,CAAA,GACXkB,MAAMc,aAAa,OAAOb,MAC7B,EAAA,CAAA;AACJ;AACAvC,aAAW8D,SAAS1B;AACpBpC,aAAW+D,QAAQ7D"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","useContext","DisclosureStateContext","Disclosure","RACDisclosure","DisclosurePanel","RACDisclosurePanel","useRipple","rowStyles","mergeStatefulStyles","styles","header","kzqmXN","k9WMMc","$$css","children","headingLevel","leading","supporting","className","chevronFor","isExpanded","t0","$","T0","t1","t2","t3","props","DisclosureHeader","undefined","state","ripple","headerClassName","handlers","t4","t5","surface","headerContent","t6","t7","Symbol","for","0","1","isDisabled","isHovered","isPressed","base","list","interactive","twoLine","hovered","pressed","disabled","Header","Panel","RACButton","RACHeading"],"sources":["../../../src/components/disclosure/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { FocusableElement, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { DisclosureStateContext, Button as RACButton, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, Heading as RACHeading } from 'react-aria-components';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, spacing } from '../../tokens/design.tokens.stylex';\n\n// A section that opens to show what is under it, and closes again. The\n// header is the row every list here draws — `src/row`, shared with ListItem,\n// ListBox and List — so its 56dp floor, body-large headline, body-medium\n// supporting line and state layers are that module's, and a header sitting\n// above a list cannot drift from the rows below it.\n//\n// The lists page gives the expand interaction its own token set, which its\n// widget keeps behind a menu that does not open to a script. What the page\n// states in words covers the row, which is what the shared module already\n// carries; the chevron's size and the panel's inset below are the library's\n// own, taken from the row's own trailing slot and inline padding rather than\n// invented.\n//\n// Three things are this component's own.\n//\n// **The header is a heading with a button in it.** React Aria wants both —\n// the heading is what a screen reader jumps between, and the button is what\n// opens the section — so `Disclosure.Header` renders the pair rather than\n// leaving a call site to remember. `headingLevel` says where in the page's\n// outline it sits.\n//\n// **The panel opens to its own height, without one being measured.** A grid\n// whose single row goes from `0fr` to `1fr` interpolates between nothing and\n// the content's natural height, so no height is read from the DOM and no\n// number is written down. Under `prefers-reduced-motion` the row snaps\n// instead.\n//\n// **Only the opening animates, and that is React Aria's doing rather than a\n// choice here.** It marks the collapsed panel `hidden=\"until-found\"`, so on\n// the way closed the content stops being laid out at once and the track has\n// nothing left to shrink. Worth knowing before reaching for a closing\n// animation: it needs the panel kept in the layout, which would cost the\n// find-in-page behaviour that attribute buys.\n\nconst styles = {\n header: {\n kzqmXN: \"xh8yej3\",\n k9WMMc: \"x1yc453h\",\n $$css: true\n }\n};\ntype DisclosureHeaderProps = {\n /** The header's headline — what the section is about. */\n children?: ReactNode;\n /**\n * Where the header sits in the page's outline. React Aria renders the\n * trigger inside a heading, and a screen reader moves between them.\n * @default 3\n */\n headingLevel?: number;\n /** Content before the headline: an avatar, an icon. */\n leading?: ReactNode;\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n};\ntype DisclosurePanelProps = Omit<RACDisclosurePanelProps, 'className' | 'style'> & {\n /** A function may compute the class from the panel's render state. */\n className?: RACDisclosurePanelProps['className'];\n /** A function may compute the style from the panel's render state. */\n style?: RACDisclosurePanelProps['style'];\n};\ntype DisclosureProps = Omit<RACDisclosureProps, 'children'> & {\n /** A `Disclosure.Header` and a `Disclosure.Panel`. */\n children?: ReactNode;\n};\n\n// The chevron, turned or not. A call rather than JSX written at the prop,\n// which is what react-perf's jsx-no-jsx-as-prop is after; the React Compiler\n// memoises the result on `isExpanded`.\nfunction chevronFor(isExpanded: boolean) {\n return <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 x1w5n3ug x2lah0s xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 x1w5n3ug x2lah0s xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl\"\n }\n }[!!isExpanded << 0]} />;\n}\n\n/**\n * A section that opens to show what is under it. Whether it is open is React\n * Aria's: pass `isExpanded` with `onExpandedChange` to control it, or\n * `defaultExpanded` to let it keep its own.\n *\n * ```tsx\n * <Disclosure>\n * <Disclosure.Header>Headline</Disclosure.Header>\n * <Disclosure.Panel>Supporting line</Disclosure.Panel>\n * </Disclosure>\n * ```\n *\n * The header is the row every list here draws, so a section above a list of\n * rows lines up with them. The panel opens to whatever height its content\n * turns out to have, and snaps rather than sliding under\n * `prefers-reduced-motion`.\n *\n * The call site's `className` and `style` land on the container, which is the\n * element a layout positions.\n */\nfunction Disclosure({\n children,\n ...props\n}: DisclosureProps & RefAttributes<HTMLDivElement>) {\n return <RACDisclosure {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {children}\n </RACDisclosure>;\n}\n\n/**\n * The row that opens the section. It renders the heading React Aria wants\n * around the trigger and the button inside it, and draws the shared row's\n * slots with a chevron in the trailing one.\n */\nfunction DisclosureHeader({\n children,\n headingLevel = 3,\n leading,\n supporting\n}: DisclosureHeaderProps) {\n // The chevron turns with the section, and React Aria's button render state\n // reports the press states rather than what the button controls — so\n // whether the section is open comes from the disclosure's own context.\n const state = useContext(DisclosureStateContext);\n // The press ripple a list's rows draw, since this is the same row. It is a\n // button, which hears its own click, so the press ends there as Button's\n // does, and a keyboard press draws one too.\n const ripple = useRipple<FocusableElement>();\n return <RACHeading level={headingLevel} className=\"x1qlqyl8 x1pd3egz x1ghz6dp\">\n <RACButton className={headerClassName(supporting)} slot=\"trigger\" {...ripple.handlers}>\n {headerContent(children, leading, supporting, state?.isExpanded === true, ripple.surface)}\n </RACButton>\n </RACHeading>;\n}\n\n/**\n * What the section shows while it is open. Its content lines up with the\n * headline above it, and it takes the group role React Aria gives it —\n * `role=\"region\"` names it in the landmark list instead, for a section a\n * reader should be able to jump to.\n */\nfunction DisclosurePanel({\n children,\n ...props\n}: DisclosurePanelProps & RefAttributes<HTMLDivElement>) {\n // The track has to know, and React Aria hands the render state to the panel\n // rather than to what wraps it — so the state comes from its context, the\n // same one its own panel reads.\n const state = useContext(DisclosureStateContext);\n return <div {...{\n 0: {\n className: \"x12w9bfk xrvj5dj xihq33y xjvfotl x1qn9uv2 x1seskgd\"\n },\n 1: {\n className: \"x12w9bfk xrvj5dj xjvfotl x1qn9uv2 x1seskgd x1tu4anv\"\n }\n }[!!(state?.isExpanded === true) << 0]}>\n <RACDisclosurePanel {...props} {...mergeStatefulStyles({\n className: \"x9f619 x2lwn1j x7giv3 x1hm618n\"\n }, props)}>\n <div className=\"x9f619 xzfxn0k x25398y x790zyz\">{children}</div>\n </RACDisclosurePanel>\n </div>;\n}\n\n// The trigger's classes, from React Aria's render state. `isSelected` is not\n// among them — a disclosure's button reports `aria-expanded` rather than a\n// selection — so the row draws unselected throughout and only its disabled\n// state changes.\n//\n// A supporting line moves the header from the page's one-line container\n// height to its two-line one, which is a floor rather than something the\n// row's own box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as\n// an argument rather than read from the render state, since React Aria\n// reports what the trigger is doing and not what it holds; the classes are\n// built by a call for the same reason `headerContent` is.\n// No overline, and so no three-line header. The row takes the list\n// variant's metrics because a header looks like a list row, but what it\n// follows is its own page, and that page gives a headline and a supporting\n// line — the three-line item belongs to the lists page, which `List.Item`\n// and `ListBox.Item` draw.\n//\n// The hover and pressed layers come from the trigger's render state, like\n// every other row React Aria hosts — see `focusVisible` in\n// `src/row/styles.ts` for the order they are drawn in.\nfunction headerClassName(supporting: ReactNode) {\n return (state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => stylex.props(rowStyles.base, rowStyles.list, rowStyles.interactive, styles.header, supporting !== undefined && rowStyles.twoLine, state.isHovered && rowStyles.hovered, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled).className ?? '';\n}\n\n// What the header row draws. Built by a call rather than written inline at\n// the prop, which is what react-perf's no-new-function-as-prop is after; the\n// React Compiler memoises the result on its inputs.\nfunction headerContent(children: ReactNode, leading: ReactNode, supporting: ReactNode, isExpanded: boolean, ripple: ReactNode) {\n return (state: {\n isDisabled: boolean;\n }) => <>\n <RowContent isDisabled={state.isDisabled} leading={leading} supporting={supporting} trailing={chevronFor(isExpanded)}>\n {children}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\nDisclosure.Header = DisclosureHeader;\nDisclosure.Panel = DisclosurePanel;\nexport type { DisclosureHeaderProps, DisclosurePanelProps, DisclosureProps };\nexport { Discl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;EAKI,CAAA;EAAAb,EAAA,KAAAG;EAAAH,EAAA,KAAAa;EAAAb,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,OAbDgB;AAaC;AAuBV,SAASN,gBAAgBf,YAAuB;CAC9C,QAAQa,UAIF/B,MAAaQ,UAAUwC,MAAMxC,UAAUyC,MAAMzC,UAAU0C,aAAaxC,OAAOC,QAAQO,eAAeY,KAAAA,KAAatB,UAAU2C,SAASpB,MAAMe,aAAatC,UAAU4C,SAASrB,MAAMgB,aAAavC,UAAU6C,SAAStB,MAAMc,cAAcrC,UAAU8C,QAAQ,CAAC,CAACnC,aAAa;AAC3Q;AAKA,SAASmB,cAAcvB,UAAqBE,SAAoBC,YAAuBG,YAAqBW,QAAmB;CAC7H,QAAQD,UAEF,qBAAA,YAAA,EAAA,UAAA,CACF,oBAAC,YAAD;EAAY,YAAYA,MAAMc;EAAqB5B;EAAqBC;EAAY,UAAUE,WAAWC,UAAU;EAChHN;CACS,CAAA,GACXgB,MAAMc,aAAa,OAAOb,MAC7B,EAAA,CAAA;AACJ;AACA7B,aAAWoD,SAAS1B;AACpB1B,aAAWqD,QAAQnD"}
@@ -31,5 +31,4 @@ type DisclosureGroupProps$1 = Omit<DisclosureGroupProps, 'children'> & {
31
31
  * element a layout positions.
32
32
  */
33
33
  declare function DisclosureGroup$1({ children, divided, ...props }: DisclosureGroupProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
34
- export { type DisclosureGroupProps$1 as DisclosureGroupProps, DisclosureGroup$1 as default };
35
- //# sourceMappingURL=index.d.ts.map
34
+ export { type DisclosureGroupProps$1 as DisclosureGroupProps, DisclosureGroup$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","DisclosureGroupProps","RACDisclosureGroupProps","stylex","Children","Fragment","isValidElement","DisclosureGroup","RACDisclosureGroup","mergeStatefulStyles","Separator","Omit","children","divided","t0","$","T0","t1","t2","t3","t4","props","undefined","className","dividedChildren","sections","flatten","map","section","index","keyOf","toArray","flatMap","child","type","key","String","DisclosureGroup","_c","RACDisclosureGroup","Separator"],"sources":["../../../src/components/disclosure-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DisclosureGroupProps as RACDisclosureGroupProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Children, Fragment, isValidElement } from 'react';\nimport { DisclosureGroup as RACDisclosureGroup } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport Separator from '../separator';\n\n// A stack of Disclosures that agree with each other about what is open —\n// the lists page's accordion. The sections are the library's own\n// `Disclosure`, unchanged: this adds only the agreement between them and the\n// rule that divides them.\n//\n// Give each section an `id`, which is the key the group reports as expanded.\n// Whether one opens at a time or several is `allowsMultipleExpanded`, and it\n// is React Aria's rather than two components — a group that closes the last\n// section when a new one opens is the same stack with a different word.\n//\n// Two things are this component's own.\n//\n// **A rule between the sections, and none at the ends.** The group renders\n// the library's `Separator` between each pair rather than asking each\n// section to draw a border, so a section drawn on its own and a section in a\n// group stay the same component. `divided={false}` leaves them undivided,\n// for a stack sitting on cards of its own.\n//\n// **Nothing else is added.** The group draws no container, no corner and no\n// colour: an accordion inside a card and one running down a page want\n// different surroundings, and the page is what knows which it is.\n//\n// The lists page keeps its expand-interaction tokens behind a token-set menu\n// that does not open to a script, so what is drawn here is what the page\n// states in words plus what `Disclosure` already carries; see that\n// component's comment for the same note.\n\ntype DisclosureGroupProps = Omit<RACDisclosureGroupProps, 'children'> & {\n /** The sections, as `Disclosure` elements each given an `id`. */\n children?: ReactNode;\n /**\n * Whether a rule is drawn between the sections. There is never one above\n * the first or below the last.\n * @default true\n */\n divided?: boolean;\n};\n\n/**\n * A stack of `Disclosure` sections that agree about what is open. Which are\n * expanded is React Aria's: pass `expandedKeys` with `onExpandedChange` to\n * control it, or `defaultExpandedKeys` to let the group keep its own.\n *\n * ```tsx\n * <DisclosureGroup defaultExpandedKeys={FIRST}>\n * <Disclosure id=\"first\">\n * <Disclosure.Header>Headline</Disclosure.Header>\n * <Disclosure.Panel>Supporting line</Disclosure.Panel>\n * </Disclosure>\n * </DisclosureGroup>\n * ```\n *\n * One section opens at a time unless `allowsMultipleExpanded` says otherwise.\n * Give every section an `id` — that is the key the group reports.\n *\n * The call site's `className` and `style` land on the container, which is the\n * element a layout positions.\n */\nfunction DisclosureGroup({\n children,\n divided = true,\n ...props\n}: DisclosureGroupProps & RefAttributes<HTMLDivElement>) {\n return <RACDisclosureGroup {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {divided ? dividedChildren(children) : children}\n </RACDisclosureGroup>;\n}\n\n// The sections with a rule between each pair, and none at the ends. The\n// rules are decorative: each section opens on a heading holding its button,\n// which already tells a reader where it starts, so a \"separator\" announced\n// between every pair would only repeat it.\nfunction dividedChildren(children: ReactNode) {\n const sections = flatten(children);\n return sections.map((section, index) => <Fragment key={keyOf(section, index)}>\n {index === 0 ? null : <Separator decorative />}\n {section}\n </Fragment>);\n}\n\n// The sections, with any fragment around them opened up first.\n// `Children.toArray` flattens arrays but hands back a fragment as one child,\n// and a call site that writes its sections inside one — or maps over data and\n// wraps the result — would otherwise get a single entry and no rules at all.\n// Recursive, since a fragment may hold another.\nfunction flatten(children: ReactNode): ReactNode[] {\n return Children.toArray(children).flatMap(child => {\n if (isValidElement<{\n children?: ReactNode;\n }>(child)) {\n if (child.type === Fragment) {\n return flatten(child.props.children);\n }\n }\n return [child];\n });\n}\n\n// The key `Children.toArray` put on the entry, falling back to its position\n// for anything that is not an element — a string between two sections is not\n// a thing this component expects, but it should render rather than throw.\nfunction keyOf(section: ReactNode, index: number) {\n if (isValidElement(section)) {\n return section.key ?? String(index);\n }\n return String(index);\n}\nexport type { DisclosureGroupProps };\nexport default DisclosureGroup;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,SAAAU,kBAAAO,IAAA;CA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AD,EAAA,UAAA,CACnCA,UAAU,IAAI,OAAO,oBAACW,aAAD,EAAW,YAAA,KAAU,CAAA,GAC1CZ,OACO,EAAA,GAH2CE,MAAMF,SAASC,KAAK,CAG/D,CAAC;AACf;AAOA,SAASH,QAAQd,UAAkC;CACjD,OAAOR,SAAS2B,QAAQnB,QAAQ,CAAC,CAACoB,SAAQC,UAAS;EACjD,IAAI3B,eAED2B,KAAK,GACFA;OAAAA,MAAMC,SAAS7B,UACjB,OAAOqB,QAAQO,MAAMZ,MAAMT,QAAQ;EAAA;EAGvC,OAAO,CAACqB,KAAK;CACf,CAAC;AACH;AAKA,SAASH,MAAMF,SAAoBC,OAAe;CAChD,IAAIvB,eAAesB,OAAO,GACxB,OAAOA,QAAQO,OAAOC,OAAOP,KAAK;CAEpC,OAAOO,OAAOP,KAAK;AACrB"}
1
+ {"version":3,"file":"index.js","names":["_c","Children","Fragment","isValidElement","DisclosureGroup","RACDisclosureGroup","mergeStatefulStyles","children","divided","t0","$","T0","t1","t2","t3","t4","props","undefined","className","dividedChildren","sections","flatten","map","section","index","keyOf","toArray","flatMap","child","type","key","String","Separator"],"sources":["../../../src/components/disclosure-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DisclosureGroupProps as RACDisclosureGroupProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Children, Fragment, isValidElement } from 'react';\nimport { DisclosureGroup as RACDisclosureGroup } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport Separator from '../separator';\n\n// A stack of Disclosures that agree with each other about what is open —\n// the lists page's accordion. The sections are the library's own\n// `Disclosure`, unchanged: this adds only the agreement between them and the\n// rule that divides them.\n//\n// Give each section an `id`, which is the key the group reports as expanded.\n// Whether one opens at a time or several is `allowsMultipleExpanded`, and it\n// is React Aria's rather than two components — a group that closes the last\n// section when a new one opens is the same stack with a different word.\n//\n// Two things are this component's own.\n//\n// **A rule between the sections, and none at the ends.** The group renders\n// the library's `Separator` between each pair rather than asking each\n// section to draw a border, so a section drawn on its own and a section in a\n// group stay the same component. `divided={false}` leaves them undivided,\n// for a stack sitting on cards of its own.\n//\n// **Nothing else is added.** The group draws no container, no corner and no\n// colour: an accordion inside a card and one running down a page want\n// different surroundings, and the page is what knows which it is.\n//\n// The lists page keeps its expand-interaction tokens behind a token-set menu\n// that does not open to a script, so what is drawn here is what the page\n// states in words plus what `Disclosure` already carries; see that\n// component's comment for the same note.\n\ntype DisclosureGroupProps = Omit<RACDisclosureGroupProps, 'children'> & {\n /** The sections, as `Disclosure` elements each given an `id`. */\n children?: ReactNode;\n /**\n * Whether a rule is drawn between the sections. There is never one above\n * the first or below the last.\n * @default true\n */\n divided?: boolean;\n};\n\n/**\n * A stack of `Disclosure` sections that agree about what is open. Which are\n * expanded is React Aria's: pass `expandedKeys` with `onExpandedChange` to\n * control it, or `defaultExpandedKeys` to let the group keep its own.\n *\n * ```tsx\n * <DisclosureGroup defaultExpandedKeys={FIRST}>\n * <Disclosure id=\"first\">\n * <Disclosure.Header>Headline</Disclosure.Header>\n * <Disclosure.Panel>Supporting line</Disclosure.Panel>\n * </Disclosure>\n * </DisclosureGroup>\n * ```\n *\n * One section opens at a time unless `allowsMultipleExpanded` says otherwise.\n * Give every section an `id` — that is the key the group reports.\n *\n * The call site's `className` and `style` land on the container, which is the\n * element a layout positions.\n */\nfunction DisclosureGroup({\n children,\n divided = true,\n ...props\n}: DisclosureGroupProps & RefAttributes<HTMLDivElement>) {\n return <RACDisclosureGroup {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {divided ? dividedChildren(children) : children}\n </RACDisclosureGroup>;\n}\n\n// The sections with a rule between each pair, and none at the ends. The\n// rules are decorative: each section opens on a heading holding its button,\n// which already tells a reader where it starts, so a \"separator\" announced\n// between every pair would only repeat it.\nfunction dividedChildren(children: ReactNode) {\n const sections = flatten(children);\n return sections.map((section, index) => <Fragment key={keyOf(section, index)}>\n {index === 0 ? null : <Separator decorative />}\n {section}\n </Fragment>);\n}\n\n// The sections, with any fragment around them opened up first.\n// `Children.toArray` flattens arrays but hands back a fragment as one child,\n// and a call site that writes its sections inside one — or maps over data and\n// wraps the result — would otherwise get a single entry and no rules at all.\n// Recursive, since a fragment may hold another.\nfunction flatten(children: ReactNode): ReactNode[] {\n return Children.toArray(children).flatMap(child => {\n if (isValidElement<{\n children?: ReactNode;\n }>(child)) {\n if (child.type === Fragment) {\n return flatten(child.props.children);\n }\n }\n return [child];\n });\n}\n\n// The key `Children.toArray` put on the entry, falling back to its position\n// for anything that is not an element — a string between two sections is not\n// a thing this component expects, but it should render rather than throw.\nfunction keyOf(section: ReactNode, index: number) {\n if (isValidElement(section)) {\n return section.key ?? String(index);\n }\n return String(index);\n}\nexport type { DisclosureGroupProps };\nexport default DisclosureGroup;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,SAAAI,kBAAAK,IAAA;CAAA,MAAAC,IAAAV,EAAA,EAAA;CAAA,IAAAW;CAAA,IAAAJ;CAAA,IAAAC;CAAA,IAAAI;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAyB,MAAA,EAAAF,UAAAO,IAAAN,SAAAO,IAAA,GAAAC,UAAAP;EAAAF,WAAAO;EAEvBN,UAAAO,OAAAE,KAAAA,IAAA,OAAAF;EAGQJ,KAAAN;EAAuBW,KAAAA;EAAWH,KAAAP,oBAAoB,EAAAY,WACjD,yBACb,GAAGF,KAAK;EAACN,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAH;EAAAG,EAAA,KAAAF;EAAAE,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAF,KAAAD,EAAA;EAAAH,WAAAG,EAAA;EAAAF,UAAAE,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;CAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAH,YAAAG,EAAA,OAAAF,SAAA;EACJM,KAAAN,UAAUW,gBAAgBZ,QAAmB,IAA7CA;EAA8CG,EAAA,KAAAH;EAAAG,EAAA,KAAAF;EAAAE,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAC,MAAAD,EAAA,QAAAE,MAAAF,EAAA,QAAAG,MAAAH,EAAA,QAAAI,IAAA;EAH5CC,KAAA,oBAAC,IAAD;GAAmB,GAAKC;GAAK,GAAMH;GAGrCC,UAAAA;EAHqB,CAAA;EAIHJ,EAAA,KAAAC;EAAAD,EAAA,MAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAJhBK;AAIgB;AAOzB,SAASI,gBAAgBZ,UAAqB;CAE5C,OADiBc,QAAQd,QAClBa,CAAQ,CAACE,KAAKC,SAASC,UAAU,qBAAC,UAAD,EAAA,UAAA,CACnCA,UAAU,IAAI,OAAO,oBAACQ,aAAD,EAAW,YAAA,KAAU,CAAA,GAC1CT,OACO,EAAA,GAH2CE,MAAMF,SAASC,KAAK,CAG/D,CAAC;AACf;AAOA,SAASH,QAAQd,UAAkC;CACjD,OAAON,SAASyB,QAAQnB,QAAQ,CAAC,CAACoB,SAAQC,UAAS;EACjD,IAAIzB,eAEDyB,KAAK,GACFA;OAAAA,MAAMC,SAAS3B,UACjB,OAAOmB,QAAQO,MAAMZ,MAAMT,QAAQ;EAAA;EAGvC,OAAO,CAACqB,KAAK;CACf,CAAC;AACH;AAKA,SAASH,MAAMF,SAAoBC,OAAe;CAChD,IAAIrB,eAAeoB,OAAO,GACxB,OAAOA,QAAQO,OAAOC,OAAOP,KAAK;CAEpC,OAAOO,OAAOP,KAAK;AACrB"}
@@ -54,5 +54,4 @@ declare function DropZone$1({ children, label, ...props }: DropZoneProps$1 & Ref
54
54
  * `defaultCamera` opens straight to a camera on a device that has one.
55
55
  */
56
56
  declare function FileTrigger$1(props: FileTriggerProps$1): import("react").JSX.Element;
57
- export { type DropZoneProps$1 as DropZoneProps, FileTrigger$1 as FileTrigger, type FileTriggerProps$1 as FileTriggerProps, DropZone$1 as default };
58
- //# sourceMappingURL=index.d.ts.map
57
+ export { type DropZoneProps$1 as DropZoneProps, FileTrigger$1 as FileTrigger, type FileTriggerProps$1 as FileTriggerProps, DropZone$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","DropZoneProps","RACDropZoneProps","FileTriggerProps","RACFileTriggerProps","stylex","DropZone","RACDropZone","FileTrigger","RACFileTrigger","mergeStatefulStyles","dropZoneStyles","rootStyles","Omit","children","className","label","style","content","isDisabled","undefined","props","labelDisabled","t0","$","T0","t1","t2","t3","t4","t5","stylex.props","DropZone","_c","RACDropZone","FileTrigger","RACFileTrigger"],"sources":["../../../src/components/drop-zone/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DropZoneProps as RACDropZoneProps, FileTriggerProps as RACFileTriggerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DropZone as RACDropZone, FileTrigger as RACFileTrigger } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { dropZoneStyles, rootStyles } from './styles';\n\n// A place to drop files, and a button that opens the file picker. The design\n// system carries no page for either — there is no drop target and no file\n// input in it — so the drop target is drawn from the nearest thing it does\n// carry, the outlined card: the same surface, the same 1dp outline-variant\n// rule and the same medium corner.\n//\n// Two departures from that card, both this component's own.\n//\n// **The rule is dashed rather than solid.** A solid rule reads as a card,\n// which is a thing that holds content; a dashed one reads as a place to put\n// something, which is what this is. It is the one convention strong enough\n// that drawing it as a card would be the surprising choice.\n//\n// **Dropping over it fills it.** The rule goes to the primary role and the\n// surface to primary container, which is the same pair a selected list row\n// takes — so \"this is the target\" looks the same here as \"this is the one\n// chosen\" does elsewhere.\n//\n// **The label names the target rather than being composed into a name.**\n// React Aria puts a visually hidden button inside and, given nothing, labels\n// it `DropZone` — its own component name, untranslated, which is what a\n// screen reader would then read out. Passing the label through as the\n// button's `aria-label` and drawing the text as ordinary content is what\n// makes the name the words the call site wrote and nothing else; React\n// Aria's own label slot would compose the two and say both.\n//\n// `FileTrigger` is beside it rather than inside it, and that is React Aria's\n// shape rather than a choice here: a file picker is useful on its own, with\n// no drop target anywhere near it. It renders nothing but a hidden input, so\n// it takes no `className` or `style` of its own — whatever it wraps is what\n// is seen, and that is normally the library's Button.\n\ntype DropZoneProps = Omit<RACDropZoneProps, 'children' | 'className' | 'style'> & {\n /** What the target holds: its label, and whatever else it offers. */\n children?: ReactNode;\n /** A function may compute the class from the target's render state. */\n className?: RACDropZoneProps['className'];\n /**\n * What the target says it is for. Drawn inside it and used as its\n * accessible name, so a target with one needs no `aria-label`. A string\n * rather than a node, since it is what names the target; anything richer\n * goes in `children` beside it.\n */\n label?: string;\n /** A function may compute the style from the target's render state. */\n style?: RACDropZoneProps['style'];\n};\ntype FileTriggerProps = RACFileTriggerProps;\n\n// What the target draws, from React Aria's render state. Written as a call\n// rather than inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\nfunction content(children: ReactNode, label: string | undefined, isDisabled: boolean) {\n return <>\n {label === undefined ? null : <p {...stylex.props(dropZoneStyles.label, isDisabled && dropZoneStyles.labelDisabled)}>\n {label}\n </p>}\n {children}\n </>;\n}\n\n/**\n * A place to drop files. What is dropped is React Aria's: `onDrop` is handed\n * the items, and `isFileDropItem`, `isDirectoryDropItem`, `isTextDropItem`\n * and `DIRECTORY_DRAG_TYPE` are exported from the package for reading them.\n *\n * ```tsx\n * <DropZone label=\"Drop here\" onDrop={handleDrop}>\n * <FileTrigger onSelect={handleSelect}>\n * <Button variant=\"outlined\">Label</Button>\n * </FileTrigger>\n * </DropZone>\n * ```\n *\n * It is drawn from the outlined card, with a dashed rule rather than a solid\n * one, and fills with the primary container while something is over it.\n * `label` both draws the words and names the target; `aria-label` names it\n * without drawing anything, for a page that already says what it takes.\n *\n * The call site's `className` and `style` land on the target itself, which\n * is the element a layout positions.\n */\nfunction DropZone({\n children,\n label,\n ...props\n}: DropZoneProps & RefAttributes<HTMLDivElement>) {\n return <RACDropZone aria-label={props['aria-label'] ?? label} {...props} {...mergeStatefulStyles(rootStyles, props)}>\n {content(children, label, props.isDisabled ?? false)}\n </RACDropZone>;\n}\n\n/**\n * A button that opens the file picker. Wrap whatever should open it —\n * normally the library's Button — and take the files from `onSelect`.\n *\n * ```tsx\n * <FileTrigger acceptedFileTypes={['image/*']} onSelect={handleSelect}>\n * <Button>Label</Button>\n * </FileTrigger>\n * ```\n *\n * It renders nothing of its own but the hidden input, so it takes no\n * `className` or `style`: what is seen is whatever it wraps. `allowsMultiple`\n * takes more than one file, `acceptDirectory` takes a folder, and\n * `defaultCamera` opens straight to a camera on a device that has one.\n */\nfunction FileTrigger(props: FileTriggerProps) {\n return <RACFileTrigger {...props} />;\n}\nexport type { DropZoneProps, FileTriggerProps };\nexport { FileTrigger };\nexport default DropZone;"],"mappings":";;;;;;;;AA8DA,SAASqB,QAAQJ,UAAqBE,OAA2BG,YAAqB;CACpF,OAAO,qBAAA,UAAA,EAAA,UAAA,CACFH,UAAUI,KAAAA,IAAY,OAAO,oBAAC,KAAD;EAAG,GAAIf,MAAaM,eAAeK,OAAOG,cAAcR,eAAeW,aAAa;EAC7GN,UAAAA;CACA,CAAA,GACJF,QACH,EAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAAR,WAAAiB,IAAA;CAAA,MAAAC,IAAA1B,EAAA,EAAA;CAAA,IAAA2B;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAkB,MAAA,EAAAT,UAAAE,OAAA,GAAAK,UAAAE;EAKRE,KAAAlB;EAAwBmB,KAAAL,MAAM,iBAANL;EAAkCK,KAAAA;EAAWO,KAAAlB,oBAAoBE,YAAYS,KAAK;EAC7GQ,KAAAX,QAAQJ,UAAUE,OAAOK,MAAKF,cAAL,KAAyB;EAACK,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAJ,KAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAC,MAAAD,EAAA,OAAAE,MAAAF,EAAA,OAAAG,MAAAH,EAAA,OAAAI,MAAAJ,EAAA,QAAAK,IAAA;EADjDC,KAAA,oBAAC,IAAD;GAAyB,cAAAJ;GAA4B,GAAML;GAAK,GAAMO;GACxEC,UAAAA;EADc,CAAA;EAEHL,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFTM;AAES;;;;;;;;;;;;;;;;AAkBlB,SAAAtB,cAAAa,OAAA;CAAA,MAAAG,IAAA1B,EAAA,CAAA;CAAA,IAAAyB;CAAA,IAAAC,EAAA,OAAAH,OAAA;EACSE,KAAA,oBAACa,aAAD,EAAe,GAAKf,MAAK,CAAA;EAAIG,EAAA,KAAAH;EAAAG,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","DropZone","RACDropZone","FileTrigger","mergeStatefulStyles","dropZoneStyles","rootStyles","children","label","content","isDisabled","undefined","props","labelDisabled","t0","$","T0","t1","t2","t3","t4","t5","RACFileTrigger"],"sources":["../../../src/components/drop-zone/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DropZoneProps as RACDropZoneProps, FileTriggerProps as RACFileTriggerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { DropZone as RACDropZone, FileTrigger as RACFileTrigger } from 'react-aria-components';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { dropZoneStyles, rootStyles } from './styles';\n\n// A place to drop files, and a button that opens the file picker. The design\n// system carries no page for either — there is no drop target and no file\n// input in it — so the drop target is drawn from the nearest thing it does\n// carry, the outlined card: the same surface, the same 1dp outline-variant\n// rule and the same medium corner.\n//\n// Two departures from that card, both this component's own.\n//\n// **The rule is dashed rather than solid.** A solid rule reads as a card,\n// which is a thing that holds content; a dashed one reads as a place to put\n// something, which is what this is. It is the one convention strong enough\n// that drawing it as a card would be the surprising choice.\n//\n// **Dropping over it fills it.** The rule goes to the primary role and the\n// surface to primary container, which is the same pair a selected list row\n// takes — so \"this is the target\" looks the same here as \"this is the one\n// chosen\" does elsewhere.\n//\n// **The label names the target rather than being composed into a name.**\n// React Aria puts a visually hidden button inside and, given nothing, labels\n// it `DropZone` — its own component name, untranslated, which is what a\n// screen reader would then read out. Passing the label through as the\n// button's `aria-label` and drawing the text as ordinary content is what\n// makes the name the words the call site wrote and nothing else; React\n// Aria's own label slot would compose the two and say both.\n//\n// `FileTrigger` is beside it rather than inside it, and that is React Aria's\n// shape rather than a choice here: a file picker is useful on its own, with\n// no drop target anywhere near it. It renders nothing but a hidden input, so\n// it takes no `className` or `style` of its own — whatever it wraps is what\n// is seen, and that is normally the library's Button.\n\ntype DropZoneProps = Omit<RACDropZoneProps, 'children' | 'className' | 'style'> & {\n /** What the target holds: its label, and whatever else it offers. */\n children?: ReactNode;\n /** A function may compute the class from the target's render state. */\n className?: RACDropZoneProps['className'];\n /**\n * What the target says it is for. Drawn inside it and used as its\n * accessible name, so a target with one needs no `aria-label`. A string\n * rather than a node, since it is what names the target; anything richer\n * goes in `children` beside it.\n */\n label?: string;\n /** A function may compute the style from the target's render state. */\n style?: RACDropZoneProps['style'];\n};\ntype FileTriggerProps = RACFileTriggerProps;\n\n// What the target draws, from React Aria's render state. Written as a call\n// rather than inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\nfunction content(children: ReactNode, label: string | undefined, isDisabled: boolean) {\n return <>\n {label === undefined ? null : <p {...stylex.props(dropZoneStyles.label, isDisabled && dropZoneStyles.labelDisabled)}>\n {label}\n </p>}\n {children}\n </>;\n}\n\n/**\n * A place to drop files. What is dropped is React Aria's: `onDrop` is handed\n * the items, and `isFileDropItem`, `isDirectoryDropItem`, `isTextDropItem`\n * and `DIRECTORY_DRAG_TYPE` are exported from the package for reading them.\n *\n * ```tsx\n * <DropZone label=\"Drop here\" onDrop={handleDrop}>\n * <FileTrigger onSelect={handleSelect}>\n * <Button variant=\"outlined\">Label</Button>\n * </FileTrigger>\n * </DropZone>\n * ```\n *\n * It is drawn from the outlined card, with a dashed rule rather than a solid\n * one, and fills with the primary container while something is over it.\n * `label` both draws the words and names the target; `aria-label` names it\n * without drawing anything, for a page that already says what it takes.\n *\n * The call site's `className` and `style` land on the target itself, which\n * is the element a layout positions.\n */\nfunction DropZone({\n children,\n label,\n ...props\n}: DropZoneProps & RefAttributes<HTMLDivElement>) {\n return <RACDropZone aria-label={props['aria-label'] ?? label} {...props} {...mergeStatefulStyles(rootStyles, props)}>\n {content(children, label, props.isDisabled ?? false)}\n </RACDropZone>;\n}\n\n/**\n * A button that opens the file picker. Wrap whatever should open it —\n * normally the library's Button — and take the files from `onSelect`.\n *\n * ```tsx\n * <FileTrigger acceptedFileTypes={['image/*']} onSelect={handleSelect}>\n * <Button>Label</Button>\n * </FileTrigger>\n * ```\n *\n * It renders nothing of its own but the hidden input, so it takes no\n * `className` or `style`: what is seen is whatever it wraps. `allowsMultiple`\n * takes more than one file, `acceptDirectory` takes a folder, and\n * `defaultCamera` opens straight to a camera on a device that has one.\n */\nfunction FileTrigger(props: FileTriggerProps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KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFTM;AAES;;;;;;;;;;;;;;;;AAkBlB,SAAAlB,cAAAS,OAAA;CAAA,MAAAG,IAAAhB,EAAA,CAAA;CAAA,IAAAe;CAAA,IAAAC,EAAA,OAAAH,OAAA;EACSE,KAAA,oBAACQ,aAAD,EAAe,GAAKV,MAAK,CAAA;EAAIG,EAAA,KAAAH;EAAAG,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["stylex","colors","motion","radii","spacing","stateLayerOpacity","typography","dropZoneStyles","label","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kogj98","k9WMMc","$$css","labelDisabled","root","k6CgDc","kGNEyG","kWkggS","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kB7OPa","k1xSpc","kXwgrk","kOIVth","kjj79g","kAzted","kjBf7l","kInvED","k3XXqK","kMeerF","kmVPX3","kIyJzY","k1ekBW","kAMwcw","rootDisabled","kkrTdU","rootFocused","rootOver","rootStyles","state","isDisabled","isDropTarget","isFocusVisible","className"],"sources":["../../../src/components/drop-zone/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// Apart from ./index.tsx so that file exports components alone, which is what\n// keeps fast refresh working for it — the same arrangement `src/row` uses.\n// `rootStyles` is here for a second reason: index.test.tsx applies it\n// directly, because React Aria enters `isDropTarget` only inside a real drag\n// session that a synthetic DragEvent does not start.\n\nconst dropZoneStyles = {\n label: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kogj98: \"x1ghz6dp\",\n k9WMMc: \"x2b8uid\",\n $$css: true\n },\n labelDisabled: {\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n root: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x14s9m32\",\n kVAM5u: \"x133yhug\",\n kaIpWk: \"x62ce2h\",\n ksu8eU: \"xbsl7fq\",\n kMzoRj: \"xmkeg23\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x1gka490\",\n kjj79g: \"xl56j7k\",\n kAzted: \"x1db3i3o\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1apw6a7\",\n kIyJzY: \"xkzkux9\",\n k1ekBW: \"xts7igz\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n rootDisabled: {\n kWkggS: \"x14s9m32\",\n kVAM5u: \"x9wqfse\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n rootFocused: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n rootOver: {\n kWkggS: \"xp89om9\",\n kVAM5u: \"x1uajy3w\",\n ksu8eU: \"x1y0btm7\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n }\n};\n\n// The target's own classes, from React Aria's render state. `disabled` is\n// applied last so it wins over the other two, and StyleX replaces a property\n// whole, so it takes their fill and their rule with it.\nfunction rootStyles(state: {\n isDisabled: boolean;\n isDropTarget: boolean;\n isFocusVisible: boolean;\n}) {\n return {\n 0: {\n className: \"x12w9bfk x6s0dn4 x14s9m32 x133yhug x62ce2h xbsl7fq xmkeg23 x9f619 x139gbkf x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7\"\n },\n 4: {\n className: \"x12w9bfk x6s0dn4 x14s9m32 x133yhug x62ce2h xbsl7fq xmkeg23 x9f619 x139gbkf x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59\"\n },\n 2: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xp89om9 x1uajy3w x1y0btm7 xscdzaa\"\n },\n 6: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59 xp89om9 x1uajy3w x1y0btm7 xscdzaa\"\n },\n 1: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xbsl7fq xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n },\n 5: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xbsl7fq xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n },\n 3: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 x1y0btm7 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n },\n 7: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59 x1y0btm7 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n }\n }[!!state.isFocusVisible << 2 | !!state.isDropTarget << 1 | !!state.isDisabled << 0];\n}\nexport { dropZoneStyles, rootStyles };"],"mappings":";AAUA,MAAMO,iBAAiB;CACrBC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,eAAe;EACbT,QAAQ;EACRQ,OAAO;CACT;CACAE,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRlB,QAAQ;EACRmB,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;EACRvB,OAAO;CACT;CACAwB,cAAc;EACZnB,QAAQ;EACRC,QAAQ;EACRd,QAAQ;EACRiC,QAAQ;EACRzB,OAAO;CACT;CACA0B,aAAa;EACXR,QAAQ;EACRlB,OAAO;CACT;CACA2B,UAAU;EACRtB,QAAQ;EACRC,QAAQ;EACRE,QAAQ;EACRhB,QAAQ;EACRQ,OAAO;CACT;AACF;AAKA,SAAS4B,WAAWC,OAIjB;CACD,OAAO;EACL,GAAG,EACDI,WAAW,0LACb;EACA,GAAG,EACDA,WAAW,yLACb;EACA,GAAG,EACDA,WAAW,yLACb;EACA,GAAG,EACDA,WAAW,wLACb;EACA,GAAG,EACDA,WAAW,kMACb;EACA,GAAG,EACDA,WAAW,iMACb;EACA,GAAG,EACDA,WAAW,mMACb;EACA,GAAG,EACDA,WAAW,kMACb;CACF,EAAE,CAAC,CAACJ,MAAMG,kBAAkB,IAAI,CAAC,CAACH,MAAME,gBAAgB,IAAI,CAAC,CAACF,MAAMC,cAAc;AACpF"}
1
+ {"version":3,"file":"styles.js","names":["dropZoneStyles","label","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kogj98","k9WMMc","$$css","labelDisabled","root","k6CgDc","kGNEyG","kWkggS","kVAM5u","kaIpWk","ksu8eU","kMzoRj","kB7OPa","k1xSpc","kXwgrk","kOIVth","kjj79g","kAzted","kjBf7l","kInvED","k3XXqK","kMeerF","kmVPX3","kIyJzY","k1ekBW","kAMwcw","rootDisabled","kkrTdU","rootFocused","rootOver","rootStyles","state","isDisabled","isDropTarget","isFocusVisible","className"],"sources":["../../../src/components/drop-zone/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// Apart from ./index.tsx so that file exports components alone, which is what\n// keeps fast refresh working for it — the same arrangement `src/row` uses.\n// `rootStyles` is here for a second reason: index.test.tsx applies it\n// directly, because React Aria enters `isDropTarget` only inside a real drag\n// session that a synthetic DragEvent does not start.\n\nconst dropZoneStyles = {\n label: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kogj98: \"x1ghz6dp\",\n k9WMMc: \"x2b8uid\",\n $$css: true\n },\n labelDisabled: {\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n root: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x14s9m32\",\n kVAM5u: \"x133yhug\",\n kaIpWk: \"x62ce2h\",\n ksu8eU: \"xbsl7fq\",\n kMzoRj: \"xmkeg23\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x1gka490\",\n kjj79g: \"xl56j7k\",\n kAzted: \"x1db3i3o\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1apw6a7\",\n kIyJzY: \"xkzkux9\",\n k1ekBW: \"xts7igz\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n rootDisabled: {\n kWkggS: \"x14s9m32\",\n kVAM5u: \"x9wqfse\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n rootFocused: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n rootOver: {\n kWkggS: \"xp89om9\",\n kVAM5u: \"x1uajy3w\",\n ksu8eU: \"x1y0btm7\",\n kMwMTN: \"xscdzaa\",\n $$css: true\n }\n};\n\n// The target's own classes, from React Aria's render state. `disabled` is\n// applied last so it wins over the other two, and StyleX replaces a property\n// whole, so it takes their fill and their rule with it.\nfunction rootStyles(state: {\n isDisabled: boolean;\n isDropTarget: boolean;\n isFocusVisible: boolean;\n}) {\n return {\n 0: {\n className: \"x12w9bfk x6s0dn4 x14s9m32 x133yhug x62ce2h xbsl7fq xmkeg23 x9f619 x139gbkf x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7\"\n },\n 4: {\n className: \"x12w9bfk x6s0dn4 x14s9m32 x133yhug x62ce2h xbsl7fq xmkeg23 x9f619 x139gbkf x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59\"\n },\n 2: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xp89om9 x1uajy3w x1y0btm7 xscdzaa\"\n },\n 6: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59 xp89om9 x1uajy3w x1y0btm7 xscdzaa\"\n },\n 1: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xbsl7fq xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n },\n 5: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xbsl7fq xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n },\n 3: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1t137rt x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 x1y0btm7 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n },\n 7: {\n className: \"x12w9bfk x6s0dn4 x62ce2h xmkeg23 x9f619 x78zum5 xdt5ytf x1gka490 xl56j7k x1db3i3o xrgy624 x2ssjo2 x1de99jn x1apw6a7 xkzkux9 xts7igz xpc4ca7 xaatb59 x1y0btm7 x14s9m32 x9wqfse x1xj74d8 x1h6gzvc\"\n }\n }[!!state.isFocusVisible << 2 | !!state.isDropTarget << 1 | !!state.isDisabled << 0];\n}\nexport { dropZoneStyles, rootStyles };"],"mappings":";AAUA,MAAMA,iBAAiB;CACrBC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,eAAe;EACbT,QAAQ;EACRQ,OAAO;CACT;CACAE,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRlB,QAAQ;EACRmB,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;EACRvB,OAAO;CACT;CACAwB,cAAc;EACZnB,QAAQ;EACRC,QAAQ;EACRd,QAAQ;EACRiC,QAAQ;EACRzB,OAAO;CACT;CACA0B,aAAa;EACXR,QAAQ;EACRlB,OAAO;CACT;CACA2B,UAAU;EACRtB,QAAQ;EACRC,QAAQ;EACRE,QAAQ;EACRhB,QAAQ;EACRQ,OAAO;CACT;AACF;AAKA,SAAS4B,WAAWC,OAIjB;CACD,OAAO;EACL,GAAG,EACDI,WAAW,0LACb;EACA,GAAG,EACDA,WAAW,yLACb;EACA,GAAG,EACDA,WAAW,yLACb;EACA,GAAG,EACDA,WAAW,wLACb;EACA,GAAG,EACDA,WAAW,kMACb;EACA,GAAG,EACDA,WAAW,iMACb;EACA,GAAG,EACDA,WAAW,mMACb;EACA,GAAG,EACDA,WAAW,kMACb;CACF,EAAE,CAAC,CAACJ,MAAMG,kBAAkB,IAAI,CAAC,CAACH,MAAME,gBAAgB,IAAI,CAAC,CAACF,MAAMC,cAAc;AACpF"}
@@ -66,5 +66,4 @@ type FabVariant = 'filled' | 'tonal';
66
66
  * ```
67
67
  */
68
68
  declare function Fab({ children, label, size, tone, variant, ...props }: FabProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>): import("react").JSX.Element;
69
- export { type FabProps, type FabSize, type FabTone, type FabVariant, Fab as default };
70
- //# sourceMappingURL=index.d.ts.map
69
+ export { type FabProps, type FabSize, type FabTone, type FabVariant, Fab as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","StyleOrFunction","stylex","ButtonDOMProps","ButtonState","ButtonBase","extendedFabSizes","fabIconSizes","fabSizes","fabStyles","fabTones","focus","FabProps","children","className","disableRipple","href","label","rel","size","FabSize","style","target","tone","FabTone","variant","FabVariant","Omit","Fab","t0","$","props","t1","t2","t3","undefined","t4","t5","fabClasses","t6","icon","t7","isExtended","state","base","ring","isHovered","hovered","isFocusVisible","focused","isPressed","pressed","isDisabled","disabled","_c","props","stylex.props"],"sources":["../../../src/components/fab/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport type { ButtonDOMProps, ButtonState } from '../../button';\nimport { ButtonBase } from '../../button';\nimport { extendedFabSizes, fabIconSizes, fabSizes, fabStyles, fabTones } from '../../fab/styles';\nimport { focus } from '../../styles/focus';\n\n// The FAB page's floating action button, and the extended FAB page's form of\n// it with a label: a screen's primary action, raised over the content on the\n// pages' level 3 shadow and lifted to level 4 under a hovering pointer.\n//\n// Three sizes, the pages' FAB, medium FAB and large FAB: `md` is 56dp with a\n// 24dp icon and a 16dp corner, `lg` 80dp with 28dp and 20dp, and `xl` 96dp\n// with 36dp and 28dp. The extended form keeps the size's height and corner\n// and sets a label after the icon in the size's type role — title medium,\n// title large and headline small — with 16dp, 26dp and 28dp of padding and\n// 8dp, 12dp and 16dp before the label. The 80dp size, the 20dp corner and\n// the 26dp and 28dp paddings fall between steps of their scales and are\n// written out. The pages' small FAB is gone from the newer set, so there is\n// no `xs`.\n//\n// Six colour pairs, by `tone` and `variant`: `tonal` draws the tone's\n// container pair — primary container is the pages' default — and `filled`\n// the tone itself, as Button's two variants of those names do.\n//\n// The hover, focus and pressed layers are the label colour at the usual 8%,\n// 10% and 10%, drawn as an image over the container, as the row module draws\n// its layers, so one style serves all six pairs. The pages give no disabled\n// FAB; a disabled one takes the 12% and 38% every disabled container takes,\n// and drops its shadow.\n//\n// Under forced colours the shadow goes and the container is painted over, so\n// the button is drawn as a 1px `ButtonText` rule, as Button's are.\n//\n// What every button does past its own styles — the ripple, the link form, a\n// parent's disabled state — is `src/button`'s, shared with Button and\n// IconButton. The styles below are `src/fab`'s, shared with FabMenu's FAB.\n\ntype FabProps = {\n /**\n * What the FAB does, in words. A FAB without a `label` is an icon alone,\n * which has no name of its own, so give it this; with a `label` the label\n * is its name.\n */\n 'aria-label'?: string;\n /** The FAB's icon, drawn at the size's icon size. */\n children?: ReactNode;\n /** A function may compute the class from the FAB's render state. */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Disables the press ripple. The state layers are unaffected.\n * @default false\n */\n disableRipple?: boolean;\n /**\n * Where the FAB leads. Given one, it is rendered as a link — an `<a>`,\n * announced as the link it is — with the same styles and ripple.\n */\n href?: string;\n /**\n * A label after the icon, which makes this the extended FAB: as tall as\n * the size, as wide as what it holds.\n */\n label?: ReactNode;\n /** The link's `rel`, when `href` is set. */\n rel?: string;\n /**\n * The pages' three sizes: `md` the FAB at 56px, `lg` the medium FAB at\n * 80px and `xl` the large FAB at 96px.\n * @default 'md'\n */\n size?: FabSize;\n /** A function may compute the style from the FAB's render state. */\n style?: StyleOrFunction<ButtonState>;\n /** The link's `target`, when `href` is set. */\n target?: string;\n /**\n * The colour role the FAB is drawn in.\n * @default 'primary'\n */\n tone?: FabTone;\n /**\n * `tonal` draws the tone's container pair, the pages' default; `filled`\n * draws the tone itself.\n * @default 'tonal'\n */\n variant?: FabVariant;\n} & Omit<ButtonDOMProps, 'aria-label' | 'isPending'>;\ntype FabSize = 'lg' | 'md' | 'xl';\ntype FabTone = 'primary' | 'secondary' | 'tertiary';\ntype FabVariant = 'filled' | 'tonal';\n\n/**\n * A screen's primary action, raised over its content. Its icon is its\n * children; given a `label` it is the extended FAB, with the label after the\n * icon. Given `href` it is a link with the same appearance.\n *\n * ```tsx\n * <Fab aria-label=\"Label\">\n * <PlusIcon />\n * </Fab>\n * ```\n */\nfunction Fab({\n children,\n label,\n size = 'md',\n tone = 'primary',\n variant = 'tonal',\n ...props\n}: FabProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>) {\n return <ButtonBase {...props} classes={fabClasses(label !== undefined, size, tone, variant)}>\n {children === undefined ? null : <span {...stylex.props(fabStyles.icon, fabIconSizes[size])}>\n {children}\n </span>}\n {label}\n </ButtonBase>;\n}\n\n// The FAB's classes, from React Aria's render state: the layers from what it\n// reports rather than from `:hover` and `:active`, for Button's reasons — see\n// its header. Built by a call rather than written inline at the prop, which\n// is what react-perf's no-new-function-as-prop is after.\nfunction fabClasses(isExtended: boolean, size: FabSize, tone: FabTone, variant: FabVariant) {\n return (state: ButtonState) => stylex.props(fabStyles.base, focus.ring, fabTones[variant][tone], isExtended ? extendedFabSizes[size] : fabSizes[size], state.isHovered && fabStyles.hovered, state.isFocusVisible && fabStyles.focused, state.isPressed && fabStyles.pressed, state.isDisabled && fabStyles.disabled);\n}\nexport type { FabProps, FabSize, FabTone, FabVariant };\nexport default Fab;"],"mappings":";;;;;;;;;;;;;;;;;;;AA0GA,SAAAgC,IAAAC,IAAA;CAAA,MAAAC,IAAAjC,EAAA,EAAA;CAAA,IAAAgB;CAAA,IAAAI;CAAA,IAAAc;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAa,CAAA,CAAAhB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,KAAA,qBAAC,YAAD;GAAW,GAAKV;GAAgB,SAAAM;GAAhC,UAAA,CACFE,IAGAtB,KAJa;;EAKHa,EAAA,MAAAb;EAAAa,EAAA,MAAAC;EAAAD,EAAA,MAAAO;EAAAP,EAAA,MAAAS;EAAAT,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OALRW;AAKQ;AAOjB,SAASH,WAAWI,YAAqBvB,MAAeI,MAAeE,SAAqB;CAC1F,QAAQkB,UAAuBzC,MAAaO,UAAUmC,MAAMjC,MAAMkC,MAAMnC,SAASe,QAAQ,CAACF,OAAOmB,aAAapC,iBAAiBa,QAAQX,SAASW,OAAOwB,MAAMG,aAAarC,UAAUsC,SAASJ,MAAMK,kBAAkBvC,UAAUwC,SAASN,MAAMO,aAAazC,UAAU0C,SAASR,MAAMS,cAAc3C,UAAU4C,QAAQ;AACtT"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","extendedFabSizes","fabIconSizes","fabSizes","fabStyles","fabTones","focus","children","label","size","tone","variant","Fab","t0","$","props","t1","t2","t3","undefined","t4","t5","fabClasses","t6","icon","t7","isExtended","state","base","ring","isHovered","hovered","isFocusVisible","focused","isPressed","pressed","isDisabled","disabled"],"sources":["../../../src/components/fab/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport type { ButtonDOMProps, ButtonState } from '../../button';\nimport { ButtonBase } from '../../button';\nimport { extendedFabSizes, fabIconSizes, fabSizes, fabStyles, fabTones } from '../../fab/styles';\nimport { focus } from '../../styles/focus';\n\n// The FAB page's floating action button, and the extended FAB page's form of\n// it with a label: a screen's primary action, raised over the content on the\n// pages' level 3 shadow and lifted to level 4 under a hovering pointer.\n//\n// Three sizes, the pages' FAB, medium FAB and large FAB: `md` is 56dp with a\n// 24dp icon and a 16dp corner, `lg` 80dp with 28dp and 20dp, and `xl` 96dp\n// with 36dp and 28dp. The extended form keeps the size's height and corner\n// and sets a label after the icon in the size's type role — title medium,\n// title large and headline small — with 16dp, 26dp and 28dp of padding and\n// 8dp, 12dp and 16dp before the label. The 80dp size, the 20dp corner and\n// the 26dp and 28dp paddings fall between steps of their scales and are\n// written out. The pages' small FAB is gone from the newer set, so there is\n// no `xs`.\n//\n// Six colour pairs, by `tone` and `variant`: `tonal` draws the tone's\n// container pair — primary container is the pages' default — and `filled`\n// the tone itself, as Button's two variants of those names do.\n//\n// The hover, focus and pressed layers are the label colour at the usual 8%,\n// 10% and 10%, drawn as an image over the container, as the row module draws\n// its layers, so one style serves all six pairs. The pages give no disabled\n// FAB; a disabled one takes the 12% and 38% every disabled container takes,\n// and drops its shadow.\n//\n// Under forced colours the shadow goes and the container is painted over, so\n// the button is drawn as a 1px `ButtonText` rule, as Button's are.\n//\n// What every button does past its own styles — the ripple, the link form, a\n// parent's disabled state — is `src/button`'s, shared with Button and\n// IconButton. The styles below are `src/fab`'s, shared with FabMenu's FAB.\n\ntype FabProps = {\n /**\n * What the FAB does, in words. A FAB without a `label` is an icon alone,\n * which has no name of its own, so give it this; with a `label` the label\n * is its name.\n */\n 'aria-label'?: string;\n /** The FAB's icon, drawn at the size's icon size. */\n children?: ReactNode;\n /** A function may compute the class from the FAB's render state. */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Disables the press ripple. The state layers are unaffected.\n * @default false\n */\n disableRipple?: boolean;\n /**\n * Where the FAB leads. Given one, it is rendered as a link — an `<a>`,\n * announced as the link it is — with the same styles and ripple.\n */\n href?: string;\n /**\n * A label after the icon, which makes this the extended FAB: as tall as\n * the size, as wide as what it holds.\n */\n label?: ReactNode;\n /** The link's `rel`, when `href` is set. */\n rel?: string;\n /**\n * The pages' three sizes: `md` the FAB at 56px, `lg` the medium FAB at\n * 80px and `xl` the large FAB at 96px.\n * @default 'md'\n */\n size?: FabSize;\n /** A function may compute the style from the FAB's render state. */\n style?: StyleOrFunction<ButtonState>;\n /** The link's `target`, when `href` is set. */\n target?: string;\n /**\n * The colour role the FAB is drawn in.\n * @default 'primary'\n */\n tone?: FabTone;\n /**\n * `tonal` draws the tone's container pair, the pages' default; `filled`\n * draws the tone itself.\n * @default 'tonal'\n */\n variant?: FabVariant;\n} & Omit<ButtonDOMProps, 'aria-label' | 'isPending'>;\ntype FabSize = 'lg' | 'md' | 'xl';\ntype FabTone = 'primary' | 'secondary' | 'tertiary';\ntype FabVariant = 'filled' | 'tonal';\n\n/**\n * A screen's primary action, raised over its content. Its icon is its\n * children; given a `label` it is the extended FAB, with the label after the\n * icon. Given `href` it is a link with the same appearance.\n *\n * ```tsx\n * <Fab aria-label=\"Label\">\n * <PlusIcon />\n * </Fab>\n * ```\n */\nfunction Fab({\n children,\n label,\n size = 'md',\n tone = 'primary',\n variant = 'tonal',\n ...props\n}: FabProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>) {\n return <ButtonBase {...props} classes={fabClasses(label !== undefined, size, tone, variant)}>\n {children === undefined ? null : <span {...stylex.props(fabStyles.icon, fabIconSizes[size])}>\n {children}\n </span>}\n {label}\n </ButtonBase>;\n}\n\n// The FAB's classes, from React Aria's render state: the layers from what it\n// reports rather than from `:hover` and `:active`, for Button's reasons — see\n// its header. Built by a call rather than written inline at the prop, which\n// is what react-perf's no-new-function-as-prop is after.\nfunction fabClasses(isExtended: boolean, size: FabSize, tone: FabTone, variant: FabVariant) {\n return (state: ButtonState) => stylex.props(fabStyles.base, focus.ring, fabTones[variant][tone], isExtended ? extendedFabSizes[size] : fabSizes[size], state.isHovered && fabStyles.hovered, state.isFocusVisible && fabStyles.focused, state.isPressed && fabStyles.pressed, state.isDisabled && fabStyles.disabled);\n}\nexport type { FabProps, FabSize, FabTone, FabVariant };\nexport default Fab;"],"mappings":";;;;;;;;;;;;;;;;;;;AA0GA,SAAAa,IAAAC,IAAA;CAAA,MAAAC,IAAAf,EAAA,EAAA;CAAA,IAAAQ;CAAA,IAAAC;CAAA,IAAAO;C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AAAN,SAAAM,EAAA,QAAAC,WAAAD,EAAA,QAAAO,MAAAP,EAAA,QAAAS,IAAA;EAHNE,KAAA,qBAAC,YAAD;GAAW,GAAKV;GAAgB,SAAAM;GAAhC,UAAA,CACFE,IAGAf,KAJa;;EAKHM,EAAA,MAAAN;EAAAM,EAAA,MAAAC;EAAAD,EAAA,MAAAO;EAAAP,EAAA,MAAAS;EAAAT,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OALRW;AAKQ;AAOjB,SAASH,WAAWI,YAAqBjB,MAAeC,MAAeC,SAAqB;CAC1F,QAAQgB,UAAuB3B,MAAaI,UAAUwB,MAAMtB,MAAMuB,MAAMxB,SAASM,QAAQ,CAACD,OAAOgB,aAAazB,iBAAiBQ,QAAQN,SAASM,OAAOkB,MAAMG,aAAa1B,UAAU2B,SAASJ,MAAMK,kBAAkB5B,UAAU6B,SAASN,MAAMO,aAAa9B,UAAU+B,SAASR,MAAMS,cAAchC,UAAUiC,QAAQ;AACtT"}
@@ -86,5 +86,4 @@ declare namespace FabMenu {
86
86
  * Choosing it closes the menu.
87
87
  */
88
88
  declare function FabMenuItem({ children, icon, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp, textValue, ...props }: FabMenuItemProps & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
89
- export { FabMenuItem, type FabMenuItemProps, type FabMenuProps, FabMenu as default };
90
- //# sourceMappingURL=index.d.ts.map
89
+ export { FabMenuItem, type FabMenuItemProps, type FabMenuProps, FabMenu as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","Key","MenuItemRenderProps","MenuItemProps","RACMenuItemProps","StyleOrFunction","stylex","createContext","useCallback","useContext","useState","Menu","RACMenu","MenuItem","RACMenuItem","MenuTrigger","RACMenuTrigger","Popover","RACPopover","Text","ButtonState","FabSize","FabTone","ButtonBase","textOf","fabIconSizes","fabSizes","fabStyles","fabTones","CloseGlyph","useRipple","focus","mergeStatefulStyles","colors","motion","radii","shadows","sizing","spacing","stateLayerOpacity","typography","FORCED_COLORS","riseIn","styles","closeButton","kZKoxP","kaIpWk","kzqmXN","$$css","closeIcon","kGuDYH","item","kGNEyG","kVAM5u","ksu8eU","kMzoRj","kGVxlE","kB7OPa","kkrTdU","k1xSpc","kMv6JI","k63SB2","kOIVth","kb6lSQ","kLWn49","kAzted","k7Eaqz","k3XXqK","kVQacm","kg3NbH","kVAEAm","khDVqt","itemDisabled","kWkggS","kMwMTN","itemFocused","kjBf7l","kInvED","kMeerF","trigger","kIyJzY","k1ekBW","kAMwcw","ToneContext","FabMenuItemProps","Omit","children","className","icon","style","FabMenuProps","container","Element","defaultOpen","isOpen","onAction","key","onOpenChange","size","tone","HTMLButtonElement","FabMenu","t0","$","label","t1","ref","t2","t3","undefined","ownOpen","setOwnOpen","open","t4","next","changeOpen","t5","triggerClasses","t6","props","t7","t8","t9","t10","t11","t12","t13","FabMenuItem","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","textValue","ripple","T0","handlers","itemClasses","md","surface","state","tonal","isHovered","hovered","isFocused","focused","isFocusVisible","isPressed","pressed","isDisabled","base","ring","filled","disabled","Item","_c","stylex.props","RACMenu","RACPopover","RACMenuTrigger","props","RACMenuItem"],"sources":["../../../src/components/fab-menu/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, Key, MenuItemRenderProps, MenuItemProps as RACMenuItemProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useState } from 'react';\nimport { Menu as RACMenu, MenuItem as RACMenuItem, MenuTrigger as RACMenuTrigger, Popover as RACPopover, Text } from 'react-aria-components';\nimport type { ButtonState } from '../../button';\nimport type { FabSize, FabTone } from '../fab';\nimport { ButtonBase } from '../../button';\nimport { textOf } from '../../collection/text';\nimport { fabIconSizes, fabSizes, fabStyles, fabTones } from '../../fab/styles';\nimport { CloseGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The FAB menu page's menu: a FAB that opens two to six related actions\n// floating above it, in place of a speed dial. Open, the FAB becomes the\n// menu's close button — the pages' 56dp circle in the tone itself, with a\n// 20dp close mark — and the actions stand in a column 8dp above it, lined up\n// on its trailing edge, each a 56dp pill on the tone's container pair with\n// 24dp at either end, a 24dp icon 8dp before a title-medium label, 4dp apart\n// and raised on the level 3 shadow. The values are the page's, read from\n// Material Design's own FAB menu tokens. The three tones are the page's three\n// colour sets: the close button takes the tone and the actions its\n// container, so the two contrast as the page draws them.\n//\n// The FAB is the menu's own rather than a child the call site places, as\n// Menu's trigger is, because what it draws depends on whether the menu is\n// open, and the menu is what knows. Closed, it is Fab at any of its sizes,\n// with Fab's styles; it shrinks to the close button's 56dp as the menu opens,\n// keeping the corner its layout anchors it by, and its corner rounds and its\n// colour deepens over the same medium duration. A reader who asks for\n// reduced motion gets the change at once.\n//\n// React Aria's `MenuTrigger`, `Menu` and `MenuItem` supply the behaviour: the\n// FAB's `aria-expanded`, the arrow keys between the actions, Escape and an\n// outside press to close, and focus returned to the FAB. The surface is\n// React Aria's `Popover` with nothing drawn on it, since each action is a\n// container of its own; it arrives over the overlay module's short duration,\n// as every popup does, and leaves at once, for the reason that module\n// gives.\n//\n// Under forced colours the shadows go and the containers are painted over,\n// so the FAB and each action are drawn as a 1px `ButtonText` rule.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The actions rise into place from just below where they settle.\nconst riseIn = \"x1uknk9t-B\";\nconst styles = {\n closeButton: {\n kZKoxP: \"xs1ryiz\",\n kaIpWk: \"x16rqkct\",\n kzqmXN: \"x1fh0d6s\",\n $$css: true\n },\n closeIcon: {\n kGuDYH: \"xwsyq91\",\n $$css: true\n },\n item: {\n kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1dkaolv\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\n kGVxlE: \"x1udv5rz\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n k63SB2: \"xrf6cl6\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n kAzted: \"xdovgog\",\n k7Eaqz: \"x13ijof9\",\n k3XXqK: \"x1t137rt\",\n kVQacm: \"xb3r6kr\",\n kg3NbH: \"xg0ps1x\",\n kVAEAm: \"x1n2onr6\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n itemDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n itemFocused: {\n kjBf7l: \"x1x84bn5\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n trigger: {\n kIyJzY: \"xioksi3 x12w9bfk\",\n k1ekBW: \"x104ni8d\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n }\n};\n\n// What a tone draws its actions in: the container pair, as the close button\n// takes the tone itself.\nconst ToneContext = createContext<FabTone>('primary');\ntype FabMenuItemProps = Omit<RACMenuItemProps, 'children' | 'className' | 'style'> & {\n /** The action's name, drawn as its label. */\n children: ReactNode;\n /** A function may compute the class from the action's render state. */\n className?: ClassNameOrFunction<MenuItemRenderProps>;\n /** An icon before the label, at the page's 24px. */\n icon?: ReactNode;\n /** A function may compute the style from the action's render state. */\n style?: StyleOrFunction<MenuItemRenderProps>;\n};\ntype FabMenuProps = {\n /**\n * What the FAB does, in words: an icon alone has no name, and the menu\n * takes its name from the FAB that opens it.\n */\n 'aria-label': string;\n /** The actions, as `FabMenu.Item`s — the page asks for two to six. */\n children: ReactNode;\n /**\n * A function may compute the class from the FAB's render state. It lands\n * on the FAB, which is what a layout positions.\n */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Where the actions are portalled to. Defaults to the container of the\n * `ThemeScope` around it, or to the end of `<body>` where there is none. A\n * subtree themed through the `themeScope` class has no container of its own,\n * so point this inside it, or they render outside and keep the page's tokens.\n */\n container?: Element;\n /**\n * Whether the menu starts open, when it keeps its own state.\n * @default false\n */\n defaultOpen?: boolean;\n /** The FAB's icon while the menu is closed. */\n icon: ReactNode;\n /** Whether the menu is open, when the call site holds the state. */\n isOpen?: boolean;\n /** Called with an action's `id` when it is chosen. */\n onAction?: (key: Key) => void;\n /** Called when the menu opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /**\n * The FAB's size while the menu is closed, as Fab's: `md` 56px, `lg` 80px\n * or `xl` 96px. Open, it is the close button's 56px whatever it was.\n * @default 'md'\n */\n size?: FabSize;\n /** A function may compute the style from the FAB's render state. */\n style?: StyleOrFunction<ButtonState>;\n /**\n * The page's three colour sets: the close button takes the tone and the\n * actions its container pair.\n * @default 'primary'\n */\n tone?: FabTone;\n} & RefAttributes<HTMLButtonElement>;\n\n/**\n * A FAB that opens a column of related actions above it, and closes them\n * again. The actions are `FabMenu.Item`s.\n *\n * ```tsx\n * <FabMenu aria-label=\"Label\" icon={<PlusIcon />}>\n * <FabMenu.Item icon={<FirstIcon />} id=\"first\">\n * First item\n * </FabMenu.Item>\n * <FabMenu.Item icon={<SecondIcon />} id=\"second\">\n * Second item\n * </FabMenu.Item>\n * </FabMenu>\n * ```\n *\n * The call site's `className`, `style` and `ref` land on the FAB.\n */\nfunction FabMenu({\n 'aria-label': label,\n children,\n className,\n container,\n defaultOpen = false,\n icon,\n isOpen,\n onAction,\n onOpenChange,\n ref,\n size = 'md',\n style,\n tone = 'primary'\n}: FabMenuProps) {\n const [ownOpen, setOwnOpen] = useState(defaultOpen);\n const open = isOpen ?? ownOpen;\n const changeOpen = useCallback((next: boolean) => {\n if (isOpen === undefined) {\n setOwnOpen(next);\n }\n onOpenChange?.(next);\n }, [isOpen, onOpenChange]);\n return <ToneContext value={tone}>\n <RACMenuTrigger isOpen={open} onOpenChange={changeOpen}>\n <ButtonBase aria-label={label} classes={triggerClasses(open, size, tone)} className={className} ref={ref} style={style}>\n <span {...stylex.props(fabStyles.icon, open ? styles.closeIcon : fabIconSizes[size])}>\n {open ? <CloseGlyph className=\"xlzyvqe x15vhz18\" /> : icon}\n </span>\n </ButtonBase>\n <RACPopover offset={8} placement=\"top end\"\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} className=\"xvhm28k x1u6grsq xhpbw76 x16dv9tl x9f619 x1t137rt\">\n <RACMenu onAction={onAction} className=\"xuk3077 x9f619 x78zum5 xdt5ytf xzoy561 x1t137rt\">\n {children}\n </RACMenu>\n </RACPopover>\n </RACMenuTrigger>\n </ToneContext>;\n}\n\n/**\n * One action: a pill holding an icon and a label, on the menu's tone.\n * Choosing it closes the menu.\n */\nfunction FabMenuItem({\n children,\n icon,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n textValue,\n ...props\n}: FabMenuItemProps & RefAttributes<HTMLDivElement>) {\n const tone = useContext(ToneContext);\n // The press ripple Menu's items draw — see MenuItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACMenuItem textValue={textValue ?? textOf(children)} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemClasses(tone), props)}>\n {icon === undefined ? null : <span {...stylex.props(fabStyles.icon, fabIconSizes.md)}>{icon}</span>}\n <Text slot=\"label\">{children}</Text>\n {ripple.surface}\n </RACMenuItem>;\n}\n\n// An action's classes, from React Aria's render state: the tone's container\n// pair, and the layers over it. Built by a call rather than written inline at\n// the prop, which is what react-perf's no-new-function-as-prop is after.\nfunction itemClasses(tone: FabTone) {\n return (state: MenuItemRenderProps) => stylex.props(styles.item, fabTones.tonal[tone], state.isHovered && fabStyles.hovered, state.isFocused && fabStyles.focused, state.isFocusVisible && styles.itemFocused, state.isPressed && fabStyles.pressed, state.isDisabled && styles.itemDisabled);\n}\n\n// The FAB's classes: Fab's own while the menu is closed, the close button's\n// while it is open. A press layer is drawn only while closed — React Aria\n// reports the FAB pressed for as long as its menu is open.\nfunction triggerClasses(isOpen: boolean, size: FabSize, tone: FabTone) {\n return (state: ButtonState) => stylex.props(fabStyles.base, focus.ring, styles.trigger, isOpen ? fabTones.filled[tone] : fabTones.tonal[tone], isOpen ? styles.closeButton : fabSizes[size], state.isHovered && fabStyles.hovered, state.isFocusVisible && fabStyles.focused, !isOpen && state.isPressed && fabStyles.pressed, state.isDisabled && fabStyles.disabled);\n}\nFabMenu.Item = FabMenuItem;\nexport type { FabMenuItemProps, FabMenuProps };\nexport { FabMenuItem };\nexport default FabMenu;"],"mappings":";;;;;;;;;;;;;;AAyDA,MAAM+C,SAAS;CACbC,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,WAAW;EACTC,QAAQ;EACRF,OAAO;CACT;CACAG,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRV,QAAQ;EACRW,QAAQ;EACRC,QAAQ;EACRC,Q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nD,UAAU8C,MAAMO,aAAaxH,UAAUyH,SAASR,MAAMS,cAAc1H,UAAU8H,QAAQ;AACvW;AACApD,QAAQqD,OAAO3B"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","createContext","useContext","useState","RACMenuItem","textOf","fabIconSizes","fabSizes","fabStyles","fabTones","useRipple","focus","mergeStatefulStyles","styles","closeButton","kZKoxP","kaIpWk","kzqmXN","$$css","closeIcon","kGuDYH","item","kGNEyG","kVAM5u","ksu8eU","kMzoRj","kGVxlE","kB7OPa","kkrTdU","k1xSpc","kMv6JI","k63SB2","kOIVth","kb6lSQ","kLWn49","kAzted","k7Eaqz","k3XXqK","kVQacm","kg3NbH","kVAEAm","khDVqt","itemDisabled","kWkggS","kMwMTN","itemFocused","kjBf7l","kInvED","kMeerF","trigger","kIyJzY","k1ekBW","kAMwcw","ToneContext","children","className","icon","style","container","defaultOpen","isOpen","onAction","onOpenChange","size","tone","FabMenu","t0","$","label","t1","ref","t2","t3","undefined","ownOpen","setOwnOpen","open","t4","next","changeOpen","t5","triggerClasses","t6","props","t7","t8","t9","t10","t11","t12","t13","FabMenuItem","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","textValue","ripple","T0","handlers","itemClasses","md","surface","state","tonal","isHovered","hovered","isFocused","focused","isFocusVisible","isPressed","pressed","isDisabled","base","ring","filled","disabled","Item","RACMenu","RACPopover","RACMenuTrigger"],"sources":["../../../src/components/fab-menu/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, Key, MenuItemRenderProps, MenuItemProps as RACMenuItemProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useCallback, useContext, useState } from 'react';\nimport { Menu as RACMenu, MenuItem as RACMenuItem, MenuTrigger as RACMenuTrigger, Popover as RACPopover, Text } from 'react-aria-components';\nimport type { ButtonState } from '../../button';\nimport type { FabSize, FabTone } from '../fab';\nimport { ButtonBase } from '../../button';\nimport { textOf } from '../../collection/text';\nimport { fabIconSizes, fabSizes, fabStyles, fabTones } from '../../fab/styles';\nimport { CloseGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The FAB menu page's menu: a FAB that opens two to six related actions\n// floating above it, in place of a speed dial. Open, the FAB becomes the\n// menu's close button — the pages' 56dp circle in the tone itself, with a\n// 20dp close mark — and the actions stand in a column 8dp above it, lined up\n// on its trailing edge, each a 56dp pill on the tone's container pair with\n// 24dp at either end, a 24dp icon 8dp before a title-medium label, 4dp apart\n// and raised on the level 3 shadow. The values are the page's, read from\n// Material Design's own FAB menu tokens. The three tones are the page's three\n// colour sets: the close button takes the tone and the actions its\n// container, so the two contrast as the page draws them.\n//\n// The FAB is the menu's own rather than a child the call site places, as\n// Menu's trigger is, because what it draws depends on whether the menu is\n// open, and the menu is what knows. Closed, it is Fab at any of its sizes,\n// with Fab's styles; it shrinks to the close button's 56dp as the menu opens,\n// keeping the corner its layout anchors it by, and its corner rounds and its\n// colour deepens over the same medium duration. A reader who asks for\n// reduced motion gets the change at once.\n//\n// React Aria's `MenuTrigger`, `Menu` and `MenuItem` supply the behaviour: the\n// FAB's `aria-expanded`, the arrow keys between the actions, Escape and an\n// outside press to close, and focus returned to the FAB. The surface is\n// React Aria's `Popover` with nothing drawn on it, since each action is a\n// container of its own; it arrives over the overlay module's short duration,\n// as every popup does, and leaves at once, for the reason that module\n// gives.\n//\n// Under forced colours the shadows go and the containers are painted over,\n// so the FAB and each action are drawn as a 1px `ButtonText` rule.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The actions rise into place from just below where they settle.\nconst riseIn = \"x1uknk9t-B\";\nconst styles = {\n closeButton: {\n kZKoxP: \"xs1ryiz\",\n kaIpWk: \"x16rqkct\",\n kzqmXN: \"x1fh0d6s\",\n $$css: true\n },\n closeIcon: {\n kGuDYH: \"xwsyq91\",\n $$css: true\n },\n item: {\n kGNEyG: \"x6s0dn4\",\n kVAM5u: \"x1ylmb6m\",\n kaIpWk: \"x1dkaolv\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\n kGVxlE: \"x1udv5rz\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n k63SB2: \"xrf6cl6\",\n kOIVth: \"x126z3so\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n kAzted: \"xdovgog\",\n k7Eaqz: \"x13ijof9\",\n k3XXqK: \"x1t137rt\",\n kVQacm: \"xb3r6kr\",\n kg3NbH: \"xg0ps1x\",\n kVAEAm: \"x1n2onr6\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n itemDisabled: {\n kWkggS: \"xepofeg\",\n kVAM5u: \"xmnqt3w\",\n kGVxlE: \"x1gnnqk1\",\n kMwMTN: \"x1xj74d8 x1bhcspo\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n itemFocused: {\n kjBf7l: \"x1x84bn5\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n trigger: {\n kIyJzY: \"xioksi3 x12w9bfk\",\n k1ekBW: \"x104ni8d\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n }\n};\n\n// What a tone draws its actions in: the container pair, as the close button\n// takes the tone itself.\nconst ToneContext = createContext<FabTone>('primary');\ntype FabMenuItemProps = Omit<RACMenuItemProps, 'children' | 'className' | 'style'> & {\n /** The action's name, drawn as its label. */\n children: ReactNode;\n /** A function may compute the class from the action's render state. */\n className?: ClassNameOrFunction<MenuItemRenderProps>;\n /** An icon before the label, at the page's 24px. */\n icon?: ReactNode;\n /** A function may compute the style from the action's render state. */\n style?: StyleOrFunction<MenuItemRenderProps>;\n};\ntype FabMenuProps = {\n /**\n * What the FAB does, in words: an icon alone has no name, and the menu\n * takes its name from the FAB that opens it.\n */\n 'aria-label': string;\n /** The actions, as `FabMenu.Item`s — the page asks for two to six. */\n children: ReactNode;\n /**\n * A function may compute the class from the FAB's render state. It lands\n * on the FAB, which is what a layout positions.\n */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Where the actions are portalled to. Defaults to the container of the\n * `ThemeScope` around it, or to the end of `<body>` where there is none. A\n * subtree themed through the `themeScope` class has no container of its own,\n * so point this inside it, or they render outside and keep the page's tokens.\n */\n container?: Element;\n /**\n * Whether the menu starts open, when it keeps its own state.\n * @default false\n */\n defaultOpen?: boolean;\n /** The FAB's icon while the menu is closed. */\n icon: ReactNode;\n /** Whether the menu is open, when the call site holds the state. */\n isOpen?: boolean;\n /** Called with an action's `id` when it is chosen. */\n onAction?: (key: Key) => void;\n /** Called when the menu opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /**\n * The FAB's size while the menu is closed, as Fab's: `md` 56px, `lg` 80px\n * or `xl` 96px. Open, it is the close button's 56px whatever it was.\n * @default 'md'\n */\n size?: FabSize;\n /** A function may compute the style from the FAB's render state. */\n style?: StyleOrFunction<ButtonState>;\n /**\n * The page's three colour sets: the close button takes the tone and the\n * actions its container pair.\n * @default 'primary'\n */\n tone?: FabTone;\n} & RefAttributes<HTMLButtonElement>;\n\n/**\n * A FAB that opens a column of related actions above it, and closes them\n * again. The actions are `FabMenu.Item`s.\n *\n * ```tsx\n * <FabMenu aria-label=\"Label\" icon={<PlusIcon />}>\n * <FabMenu.Item icon={<FirstIcon />} id=\"first\">\n * First item\n * </FabMenu.Item>\n * <FabMenu.Item icon={<SecondIcon />} id=\"second\">\n * Second item\n * </FabMenu.Item>\n * </FabMenu>\n * ```\n *\n * The call site's `className`, `style` and `ref` land on the FAB.\n */\nfunction FabMenu({\n 'aria-label': label,\n children,\n className,\n container,\n defaultOpen = false,\n icon,\n isOpen,\n onAction,\n onOpenChange,\n ref,\n size = 'md',\n style,\n tone = 'primary'\n}: FabMenuProps) {\n const [ownOpen, setOwnOpen] = useState(defaultOpen);\n const open = isOpen ?? ownOpen;\n const changeOpen = useCallback((next: boolean) => {\n if (isOpen === undefined) {\n setOwnOpen(next);\n }\n onOpenChange?.(next);\n }, [isOpen, onOpenChange]);\n return <ToneContext value={tone}>\n <RACMenuTrigger isOpen={open} onOpenChange={changeOpen}>\n <ButtonBase aria-label={label} classes={triggerClasses(open, size, tone)} className={className} ref={ref} style={style}>\n <span {...stylex.props(fabStyles.icon, open ? styles.closeIcon : fabIconSizes[size])}>\n {open ? <CloseGlyph className=\"xlzyvqe x15vhz18\" /> : icon}\n </span>\n </ButtonBase>\n <RACPopover offset={8} placement=\"top end\"\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} className=\"xvhm28k x1u6grsq xhpbw76 x16dv9tl x9f619 x1t137rt\">\n <RACMenu onAction={onAction} className=\"xuk3077 x9f619 x78zum5 xdt5ytf xzoy561 x1t137rt\">\n {children}\n </RACMenu>\n </RACPopover>\n </RACMenuTrigger>\n </ToneContext>;\n}\n\n/**\n * One action: a pill holding an icon and a label, on the menu's tone.\n * Choosing it closes the menu.\n */\nfunction FabMenuItem({\n children,\n icon,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n textValue,\n ...props\n}: FabMenuItemProps & RefAttributes<HTMLDivElement>) {\n const tone = useContext(ToneContext);\n // The press ripple Menu's items draw — see MenuItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACMenuItem textValue={textValue ?? textOf(children)} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemClasses(tone), props)}>\n {icon === undefined ? null : <span {...stylex.props(fabStyles.icon, fabIconSizes.md)}>{icon}</span>}\n <Text slot=\"label\">{children}</Text>\n {ripple.surface}\n </RACMenuItem>;\n}\n\n// An action's classes, from React Aria's render state: the tone's container\n// pair, and the layers over it. Built by a call rather than written inline at\n// the prop, which is what react-perf's no-new-function-as-prop is after.\nfunction itemClasses(tone: FabTone) {\n return (state: MenuItemRenderProps) => stylex.props(styles.item, fabTones.tonal[tone], state.isHovered && fabStyles.hovered, state.isFocused && fabStyles.focused, state.isFocusVisible && styles.itemFocused, state.isPressed && fabStyles.pressed, state.isDisabled && styles.itemDisabled);\n}\n\n// The FAB's classes: Fab's own while the menu is closed, the close button's\n// while it is open. A press layer is drawn only while closed — React Aria\n// reports the FAB pressed for as long as its menu is open.\nfunction triggerClasses(isOpen: boolean, size: FabSize, tone: FabTone) {\n return (state: ButtonState) => stylex.props(fabStyles.base, focus.ring, styles.trigger, isOpen ? fabTones.filled[tone] : fabTones.tonal[tone], isOpen ? styles.closeButton : fabSizes[size], state.isHovered && fabStyles.hovered, state.isFocusVisible && fabStyles.focused, !isOpen && state.isPressed && fabStyles.pressed, state.isDisabled && fabStyles.disabled);\n}\nFabMenu.Item = FabMenuItem;\nexport type { FabMenuItemProps, FabMenuProps };\nexport { FabMenuItem };\nexport default FabMenu;"],"mappings":";;;;;;;;;;;;;;AAyDA,MAAMc,SAAS;CACbC,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,WAAW;EACTC,QAAQ;EACRF,OAAO;CACT;CACAG,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,Q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MM,kBAAkBtG,UAAUqG,SAAS,CAACjD,UAAU4C,MAAMO,aAAavG,UAAUwG,SAASR,MAAMS,cAAczG,UAAU6G,QAAQ;AACvW;AACApD,QAAQqD,OAAO3B"}
@@ -29,5 +29,4 @@ type FeedProps = {
29
29
  * inside a pane reflows with the pane rather than with the browser.
30
30
  */
31
31
  declare function Feed({ minItemWidth, render, ...props }: FeedProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
32
- export { type FeedProps, Feed as default };
33
- //# sourceMappingURL=index.d.ts.map
32
+ export { type FeedProps, Feed as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","stylex","RenderComponentProps","useRender","mergeStyles","spacing","DEFAULT_MIN_ITEM_WIDTH","_temp","kB7OPa","k1xSpc","kOIVth","kumcoG","styles","root","minItemWidth","undefined","FeedProps","Feed","t0","$","render","t1","t2","t3","t4","t5","t6","props","defaultTagName","_c","props","stylex.props"],"sources":["../../../src/components/feed/index.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { spacing } from '../../tokens/design.tokens.stylex';\n\n// Material Design's example minimum for an adaptive grid cell, and the only\n// number the spec puts on one. It is a floor rather than a recommendation: how\n// narrow a card can get before its contents stop making sense is a property of\n// the contents, which is why Material Design leaves it a parameter rather than\n// fixing it. Most feeds should say what theirs is instead of taking this.\nconst DEFAULT_MIN_ITEM_WIDTH = '180px';\n\n// The third of Material Design's canonical layouts, after list-detail and\n// supporting pane. Where those two divide a page into panes, this arranges one\n// pane into a grid of comparable things — the spec's own examples are news and\n// social feeds, and a catalogue of cards is the same shape.\n//\n// Material Design describes the grid by its cell rather than by its columns:\n// Compose spells it `GridCells.Adaptive(minSize)`, meaning every column is at\n// least that wide and the grid fits as many as it can — and always at least\n// one, which shares out whatever room there is, so a lone column narrower\n// than the minimum is still the container's width rather than wider than it.\n// `repeat(auto-fill, minmax(min(…, 100%), 1fr))` is the same sentence in\n// CSS; without the `min()`, a lone column stayed the minimum wide and pushed\n// the page sideways.\n//\n// So there are no breakpoints here, and that is the point rather than an\n// omission. The layout answers to the room it is given instead of to the width\n// of the window, which is what lets a feed inside a pane reflow with the pane.\n// It also means none of the query emission-order care that ListDetail and\n// SupportingPane both have to document applies.\n//\n// A function style rather than a static one, because the cell minimum comes\n// from the call site and StyleX compiles its classes ahead of time. StyleX\n// resolves that by writing the value to a custom property inline, which is the\n// same mechanism the token gallery's `durationBar` uses.\nconst _temp = {\n kB7OPa: \"x9f619\",\n k1xSpc: \"xrvj5dj\",\n kOIVth: \"xj2l1yv\",\n kumcoG: \"xqketvx\",\n \"$$css\": true\n};\nconst styles = {\n root: (minItemWidth: string) => [_temp, {\n \"--x-gridTemplateColumns\": `repeat(auto-fill, minmax(min(${minItemWidth}, 100%), 1fr))` != null ? `repeat(auto-fill, minmax(min(${minItemWidth}, 100%), 1fr))` : undefined\n }]\n};\ntype FeedProps = {\n /**\n * How narrow a cell may get before the grid drops a column. Every column is\n * at least this wide and the grid fits as many as the space allows, which is\n * how Material Design describes an adaptive grid — by its cell rather than\n * by a column count per breakpoint. In a container narrower than this, the\n * one column takes the container's width rather than overflowing it.\n *\n * Worth setting. The default is the figure Material Design's own example\n * uses, and it is a floor rather than advice: only the contents know how\n * narrow they can go.\n * @default '180px'\n */\n minItemWidth?: string;\n} & RenderComponentProps<'div'>;\n\n/**\n * Material Design's feed layout: a grid of comparable items that fits as many\n * columns as the space allows, down to a single column when it allows only\n * one.\n *\n * Layout only — it paints no surface, and it gives its children no container\n * of their own, so each child is a grid cell exactly as it was written. That\n * is the difference from ListDetail and SupportingPane, which do wrap: those\n * two divide a page into named regions, where this one lays out however many\n * things it is handed.\n *\n * It reads the space it is in rather than the width of the window, so a feed\n * inside a pane reflows with the pane rather than with the browser.\n */\nfunction Feed({\n minItemWidth = DEFAULT_MIN_ITEM_WIDTH,\n render,\n ...props\n}: FeedProps) {\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n // The dynamic style carries the cell minimum as a custom property in\n // `style` rather than as a class, which is why the merge has to reach\n // `style` as well as `className` — see src/styles/merge.ts.\n ...mergeStyles(stylex.props(styles.root(minItemWidth)), props)\n },\n render\n });\n}\nexport type { FeedProps };\nexport default Feed;"],"mappings":";;;;;;AAcA,MAAMO,yBAAyB;AA0B/B,MAAMC,QAAQ;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS,EACbC,OAAOC,iBAAyB,CAACP,OAAO,EACtC,2BAA2B,gCAAgCO,aAAY,mBAAoB,OAAO,gCAAgCA,aAAY,kBAAmBC,KAAAA,EACnK,CAAC,EACH;;;;;;;;;;;;;;;AA+BA,SAAAE,KAAAC,IAAA;CAAA,MAAAC,IAAAnB,EAAA,EAAA;CAAA,IAAAoB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAc,MAAA,EAAAJ,cAAAW,IAAAL,QAAAM,IAAA,GAAAC,YAAAT;EAAAE,SAAAM;EACZ,MAAAZ,eAAAW,OAAAV,KAAAA,IAAAT,yBAAAmB;EAIOtB,KAAAA;EACWoB,KAAA;EAEXI,KAAAA;EAIAL,KAAAlB,YAAYH,MAAaW,OAAMC,KAAMC,YAAY,CAAC,GAAGa,OAAK;EAACR,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAJ,SAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAE,MAAAF,EAAA,OAAAG,IAAA;EALzDG,KAAA;GAAA,GACFE;GAAK,GAILL;EACL;EAACH,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAC,UAAAD,EAAA,QAAAI,MAAAJ,EAAA,QAAAM,IAAA;EARcC,KAAA;GAAAE,gBACCL;GAAKI,OACdF;GAMNL;EAEH;EAACD,EAAA,KAAAC;EAAAD,EAAA,MAAAI;EAAAJ,EAAA,MAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAVMhB,GAAUuB,EAUhB;AAAC"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","useRender","mergeStyles","DEFAULT_MIN_ITEM_WIDTH","_temp","kB7OPa","k1xSpc","kOIVth","kumcoG","styles","root","minItemWidth","undefined","Feed","t0","$","render","t1","t2","t3","t4","t5","t6","props","defaultTagName"],"sources":["../../../src/components/feed/index.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { spacing } from '../../tokens/design.tokens.stylex';\n\n// Material Design's example minimum for an adaptive grid cell, and the only\n// number the spec puts on one. It is a floor rather than a recommendation: how\n// narrow a card can get before its contents stop making sense is a property of\n// the contents, which is why Material Design leaves it a parameter rather than\n// fixing it. Most feeds should say what theirs is instead of taking this.\nconst DEFAULT_MIN_ITEM_WIDTH = '180px';\n\n// The third of Material Design's canonical layouts, after list-detail and\n// supporting pane. Where those two divide a page into panes, this arranges one\n// pane into a grid of comparable things — the spec's own examples are news and\n// social feeds, and a catalogue of cards is the same shape.\n//\n// Material Design describes the grid by its cell rather than by its columns:\n// Compose spells it `GridCells.Adaptive(minSize)`, meaning every column is at\n// least that wide and the grid fits as many as it can — and always at least\n// one, which shares out whatever room there is, so a lone column narrower\n// than the minimum is still the container's width rather than wider than it.\n// `repeat(auto-fill, minmax(min(…, 100%), 1fr))` is the same sentence in\n// CSS; without the `min()`, a lone column stayed the minimum wide and pushed\n// the page sideways.\n//\n// So there are no breakpoints here, and that is the point rather than an\n// omission. The layout answers to the room it is given instead of to the width\n// of the window, which is what lets a feed inside a pane reflow with the pane.\n// It also means none of the query emission-order care that ListDetail and\n// SupportingPane both have to document applies.\n//\n// A function style rather than a static one, because the cell minimum comes\n// from the call site and StyleX compiles its classes ahead of time. StyleX\n// resolves that by writing the value to a custom property inline, which is the\n// same mechanism the token gallery's `durationBar` uses.\nconst _temp = {\n kB7OPa: \"x9f619\",\n k1xSpc: \"xrvj5dj\",\n kOIVth: \"xj2l1yv\",\n kumcoG: \"xqketvx\",\n \"$$css\": true\n};\nconst styles = {\n root: (minItemWidth: string) => [_temp, {\n \"--x-gridTemplateColumns\": `repeat(auto-fill, minmax(min(${minItemWidth}, 100%), 1fr))` != null ? `repeat(auto-fill, minmax(min(${minItemWidth}, 100%), 1fr))` : undefined\n }]\n};\ntype FeedProps = {\n /**\n * How narrow a cell may get before the grid drops a column. Every column is\n * at least this wide and the grid fits as many as the space allows, which is\n * how Material Design describes an adaptive grid — by its cell rather than\n * by a column count per breakpoint. In a container narrower than this, the\n * one column takes the container's width rather than overflowing it.\n *\n * Worth setting. The default is the figure Material Design's own example\n * uses, and it is a floor rather than advice: only the contents know how\n * narrow they can go.\n * @default '180px'\n */\n minItemWidth?: string;\n} & RenderComponentProps<'div'>;\n\n/**\n * Material Design's feed layout: a grid of comparable items that fits as many\n * columns as the space allows, down to a single column when it allows only\n * one.\n *\n * Layout only — it paints no surface, and it gives its children no container\n * of their own, so each child is a grid cell exactly as it was written. That\n * is the difference from ListDetail and SupportingPane, which do wrap: those\n * two divide a page into named regions, where this one lays out however many\n * things it is handed.\n *\n * It reads the space it is in rather than the width of the window, so a feed\n * inside a pane reflows with the pane rather than with the browser.\n */\nfunction Feed({\n minItemWidth = DEFAULT_MIN_ITEM_WIDTH,\n render,\n ...props\n}: FeedProps) {\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n // The dynamic style carries the cell minimum as a custom property in\n // `style` rather than as a class, which is why the merge has to reach\n // `style` as well as `className` — see src/styles/merge.ts.\n ...mergeStyles(stylex.props(styles.root(minItemWidth)), props)\n },\n render\n });\n}\nexport type { FeedProps };\nexport default Feed;"],"mappings":";;;;;;AAcA,MAAMI,yBAAyB;AA0B/B,MAAMC,QAAQ;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS,EACbC,OAAOC,iBAAyB,CAACP,OAAO,EACtC,2BAA2B,gCAAgCO,aAAY,mBAAoB,OAAO,gCAAgCA,aAAY,kBAAmBC,KAAAA,EACnK,CAAC,EACH;;;;;;;;;;;;;;;AA+BA,SAAAC,KAAAC,IAAA;CAAA,MAAAC,IAAAhB,EAAA,EAAA;CAAA,IAAAiB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAc,MAAA,EAAAH,cAAAU,IAAAL,QAAAM,IAAA,GAAAC,YAAAT;EAAAE,SAAAM;EACZ,MAAAX,eAAAU,OAAAT,KAAAA,IAAAT,yBAAAkB;EAIOpB,KAAAA;EACWkB,KAAA;EAEXI,KAAAA;EAIAL,KAAAhB,YAAYF,MAAaS,OAAMC,KAAMC,YAAY,CAAC,GAAGY,OAAK;EAACR,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAJ,SAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAE,MAAAF,EAAA,OAAAG,IAAA;EALzDG,KAAA;GAAA,GACFE;GAAK,GAILL;EACL;EAACH,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAC,UAAAD,EAAA,QAAAI,MAAAJ,EAAA,QAAAM,IAAA;EARcC,KAAA;GAAAE,gBACCL;GAAKI,OACdF;GAMNL;EAEH;EAACD,EAAA,KAAAC;EAAAD,EAAA,MAAAI;EAAAJ,EAAA,MAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAVMd,GAAUqB,EAUhB;AAAC"}
@@ -54,5 +54,4 @@ type FormProps$1 = {
54
54
  * the element a layout positions.
55
55
  */
56
56
  declare function Form$1({ validationBehavior, ...props }: FormProps$1 & RefAttributes<HTMLFormElement>): import("react").JSX.Element;
57
- export { type FormProps$1 as FormProps, Form$1 as default };
58
- //# sourceMappingURL=index.d.ts.map
57
+ export { type FormProps$1 as FormProps, Form$1 as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","CSSProperties","RefAttributes","FormProps","RACFormProps","stylex","Form","RACForm","FIELD_VALIDATION_BEHAVIOR","mergeStyles","className","style","validationBehavior","Omit","t0","$","T0","t1","t2","t3","t4","props","undefined","Form","_c","RACForm"],"sources":["../../../src/components/form/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, RefAttributes } from 'react';\nimport type { FormProps as RACFormProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Form as RACForm } from 'react-aria-components';\nimport { FIELD_VALIDATION_BEHAVIOR } from '../../field/root';\nimport { mergeStyles } from '../../styles/merge';\n\n// No page of its own: a form is the fields inside it, and the text fields\n// page is what each of them draws — the error a form reports lands in the\n// field's supporting text, in the error role, under the box. The form\n// draws nothing, and lays nothing out either; a Stack inside it is what\n// spaces the fields.\n//\n// React Aria's `Form` is the element. It hands two things to the fields\n// inside it through context: `validationErrors`, keyed by each field's\n// `name`, which is how a server's answer reaches the fields without any of\n// them changing, and `validationBehavior`, which every field reads in place\n// of its own default. React Aria's own default for that is `native`; the\n// library's is `aria`, set here so a form and a field agree, with `native`\n// the opt-in.\n\ntype FormProps = {\n className?: string;\n style?: CSSProperties;\n /**\n * How the fields inside validate. `aria` marks a field invalid and shows\n * its message as soon as the field says so, and lets the form submit\n * regardless. `native` hands validation to the browser: a required or\n * malformed field blocks submission, and its message is the browser's\n * own, shown once submission is tried.\n *\n * Under `aria`, `isRequired` marks a field and checks nothing. The label\n * takes its asterisk and the control `aria-required`, but an empty\n * required field neither stops the form submitting nor shows a message,\n * since the control carries no `required` for the browser to enforce. A\n * form that must not go out with one empty checks it in `onSubmit` and\n * hands the field its `error`, as the Client validation story does.\n *\n * Under `aria`, moving focus after a server answers is the call site's.\n * The errors are associated — `aria-invalid` on each control, the message\n * in its `aria-describedby` — and each is read out politely as it appears\n * under its field, but nothing moves, because no part of the form knows a\n * round trip happened. `validationErrors` is a prop rather than an event,\n * so a form cannot tell a submission coming back from a first render that\n * was given errors to begin with. The Async submit story shows the move.\n * @default 'aria'\n */\n validationBehavior?: 'aria' | 'native';\n} & Omit<RACFormProps, 'className' | 'style' | 'validationBehavior'>;\n\n/**\n * A form: the fields inside it and what they are told about validation. Pass\n * `validationErrors`, an object keyed by field `name`, to show what a server\n * sent back under each field, and `validationBehavior=\"native\"` to let the\n * browser's own constraint validation block submission. `onSubmit` is handed\n * the submit event; call `preventDefault` on it to handle the submission\n * yourself, and read the values from `new FormData(event.currentTarget)`.\n *\n * Handing `validationErrors` back from a submission is where a reader has to\n * be told something arrived: see `validationBehavior` for what the form does\n * and what it leaves to the call site.\n *\n * A form also reserves each field's message line. A field on its own draws\n * that line only once it has something to say, so an error arriving after a\n * submit or an async check makes the field taller and moves everything below\n * it down the page. Inside a form the line is there from the start, empty\n * and one line tall, so a message that fits on it moves nothing when it\n * arrives — which is the whole reason a form is where a message arrives\n * after the fact. A longer message wraps, and each line past the first\n * pushes everything below it down, so keep a message that arrives after the\n * fact to one line.\n *\n * The call site's `className` and `style` land on the form element, which is\n * the element a layout positions.\n */\nfunction Form({\n validationBehavior = FIELD_VALIDATION_BEHAVIOR,\n ...props\n}: FormProps & RefAttributes<HTMLFormElement>) {\n return <RACForm validationBehavior={validationBehavior} {...props} {...mergeStyles({\n className: \"x9f619\"\n }, props)} />;\n}\nexport type { FormProps };\nexport default Form;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,SAAAO,OAAAQ,IAAA;CAAA,MAAAC,IAAAf,EAAA,EAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAc,MAAA,EAAAF,oBAAAQ,IAAA,GAAAC,UAAAP;EACZ,MAAAF,qBAAAQ,OAAAE,KAAAA,IAAAd,4BAAAY;EAGQJ,KAAAT;EAA4BK,KAAAA;EAAwBS,KAAAA;EAAWF,KAAAV,YAAY,EAAAC,WACtE,SACb,GAAGW,KAAK;EAACN,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAH,KAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAC,MAAAD,EAAA,OAAAE,MAAAF,EAAA,OAAAG,MAAAH,EAAA,OAAAI,IAAA;EAFFC,KAAA,oBAAC,IAAD;GAA6BR,oBAAAA;GAAkB,GAAMS;GAAK,GAAMF;EAE9D,CAAA;EAAIJ,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFNK;AAEM"}
1
+ {"version":3,"file":"index.js","names":["_c","Form","RACForm","FIELD_VALIDATION_BEHAVIOR","mergeStyles","className","validationBehavior","t0","$","T0","t1","t2","t3","t4","props","undefined"],"sources":["../../../src/components/form/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, RefAttributes } from 'react';\nimport type { FormProps as RACFormProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Form as RACForm } from 'react-aria-components';\nimport { FIELD_VALIDATION_BEHAVIOR } from '../../field/root';\nimport { mergeStyles } from '../../styles/merge';\n\n// No page of its own: a form is the fields inside it, and the text fields\n// page is what each of them draws — the error a form reports lands in the\n// field's supporting text, in the error role, under the box. The form\n// draws nothing, and lays nothing out either; a Stack inside it is what\n// spaces the fields.\n//\n// React Aria's `Form` is the element. It hands two things to the fields\n// inside it through context: `validationErrors`, keyed by each field's\n// `name`, which is how a server's answer reaches the fields without any of\n// them changing, and `validationBehavior`, which every field reads in place\n// of its own default. React Aria's own default for that is `native`; the\n// library's is `aria`, set here so a form and a field agree, with `native`\n// the opt-in.\n\ntype FormProps = {\n className?: string;\n style?: CSSProperties;\n /**\n * How the fields inside validate. `aria` marks a field invalid and shows\n * its message as soon as the field says so, and lets the form submit\n * regardless. `native` hands validation to the browser: a required or\n * malformed field blocks submission, and its message is the browser's\n * own, shown once submission is tried.\n *\n * Under `aria`, `isRequired` marks a field and checks nothing. The label\n * takes its asterisk and the control `aria-required`, but an empty\n * required field neither stops the form submitting nor shows a message,\n * since the control carries no `required` for the browser to enforce. A\n * form that must not go out with one empty checks it in `onSubmit` and\n * hands the field its `error`, as the Client validation story does.\n *\n * Under `aria`, moving focus after a server answers is the call site's.\n * The errors are associated — `aria-invalid` on each control, the message\n * in its `aria-describedby` — and each is read out politely as it appears\n * under its field, but nothing moves, because no part of the form knows a\n * round trip happened. `validationErrors` is a prop rather than an event,\n * so a form cannot tell a submission coming back from a first render that\n * was given errors to begin with. The Async submit story shows the move.\n * @default 'aria'\n */\n validationBehavior?: 'aria' | 'native';\n} & Omit<RACFormProps, 'className' | 'style' | 'validationBehavior'>;\n\n/**\n * A form: the fields inside it and what they are told about validation. Pass\n * `validationErrors`, an object keyed by field `name`, to show what a server\n * sent back under each field, and `validationBehavior=\"native\"` to let the\n * browser's own constraint validation block submission. `onSubmit` is handed\n * the submit event; call `preventDefault` on it to handle the submission\n * yourself, and read the values from `new FormData(event.currentTarget)`.\n *\n * Handing `validationErrors` back from a submission is where a reader has to\n * be told something arrived: see `validationBehavior` for what the form does\n * and what it leaves to the call site.\n *\n * A form also reserves each field's message line. A field on its own draws\n * that line only once it has something to say, so an error arriving after a\n * submit or an async check makes the field taller and moves everything below\n * it down the page. Inside a form the line is there from the start, empty\n * and one line tall, so a message that fits on it moves nothing when it\n * arrives — which is the whole reason a form is where a message arrives\n * after the fact. A longer message wraps, and each line past the first\n * pushes everything below it down, so keep a message that arrives after the\n * fact to one line.\n *\n * The call site's `className` and `style` land on the form element, which is\n * the element a layout positions.\n */\nfunction Form({\n validationBehavior = FIELD_VALIDATION_BEHAVIOR,\n ...props\n}: FormProps & RefAttributes<HTMLFormElement>) {\n return <RACForm validationBehavior={validationBehavior} {...props} {...mergeStyles({\n className: \"x9f619\"\n }, props)} />;\n}\nexport type { FormProps };\nexport default Form;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,SAAAC,OAAAM,IAAA;CAAA,MAAAC,IAAAR,EAAA,EAAA;CAAA,IAAAS;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAc,MAAA,EAAAD,oBAAAO,IAAA,GAAAC,UAAAP;EACZ,MAAAD,qBAAAO,OAAAE,KAAAA,IAAAZ,4BAAAU;EAGQJ,KAAAP;EAA4BI,KAAAA;EAAwBQ,KAAAA;EAAWF,KAAAR,YAAY,EAAAC,WACtE,SACb,GAAGS,KAAK;EAACN,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAH,KAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAC,MAAAD,EAAA,OAAAE,MAAAF,EAAA,OAAAG,MAAAH,EAAA,OAAAI,IAAA;EAFFC,KAAA,oBAAC,IAAD;GAA6BP,oBAAAA;GAAkB,GAAMQ;GAAK,GAAMF;EAE9D,CAAA;EAAIJ,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFNK;AAEM"}
@@ -88,5 +88,4 @@ type IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal';
88
88
  * ```
89
89
  */
90
90
  declare function IconButton({ defaultSelected, href, isPending, isSelected, onChange, pendingLabel, rel, size: ownSize, target, variant, ...props }: IconButtonProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>): import("react").JSX.Element;
91
- export { type IconButtonProps, type IconButtonSize, type IconButtonState, type IconButtonVariant, IconButton as default };
92
- //# sourceMappingURL=index.d.ts.map
91
+ export { type IconButtonProps, type IconButtonSize, type IconButtonState, type IconButtonVariant, IconButton as default };