@kanso-labs/kanso-ui 0.45.28 → 0.45.29

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 (144) hide show
  1. package/dist/calendar/index.js +4 -4
  2. package/dist/calendar/index.js.map +1 -1
  3. package/dist/components/app-bar/index.js +1 -0
  4. package/dist/components/app-bar/index.js.map +1 -1
  5. package/dist/components/autocomplete/index.d.ts +6 -6
  6. package/dist/components/autocomplete/index.js +4 -4
  7. package/dist/components/autocomplete/index.js.map +1 -1
  8. package/dist/components/breadcrumbs/index.d.ts +5 -5
  9. package/dist/components/breadcrumbs/index.js +5 -5
  10. package/dist/components/breadcrumbs/index.js.map +1 -1
  11. package/dist/components/button/index.d.ts +3 -3
  12. package/dist/components/button/index.js +2 -2
  13. package/dist/components/button/index.js.map +1 -1
  14. package/dist/components/calendar/index.d.ts +7 -7
  15. package/dist/components/calendar/index.js +4 -4
  16. package/dist/components/calendar/index.js.map +1 -1
  17. package/dist/components/checkbox-group/index.d.ts +5 -5
  18. package/dist/components/checkbox-group/index.js +4 -4
  19. package/dist/components/checkbox-group/index.js.map +1 -1
  20. package/dist/components/color-area/index.d.ts +4 -4
  21. package/dist/components/color-area/index.js +4 -4
  22. package/dist/components/color-area/index.js.map +1 -1
  23. package/dist/components/color-field/index.d.ts +7 -7
  24. package/dist/components/color-field/index.js +4 -4
  25. package/dist/components/color-field/index.js.map +1 -1
  26. package/dist/components/color-picker/index.d.ts +4 -4
  27. package/dist/components/color-picker/index.js +4 -4
  28. package/dist/components/color-picker/index.js.map +1 -1
  29. package/dist/components/color-slider/index.d.ts +6 -6
  30. package/dist/components/color-slider/index.js +4 -4
  31. package/dist/components/color-slider/index.js.map +1 -1
  32. package/dist/components/color-swatch/index.d.ts +4 -4
  33. package/dist/components/color-swatch/index.js +4 -4
  34. package/dist/components/color-swatch/index.js.map +1 -1
  35. package/dist/components/color-swatch-picker/index.d.ts +12 -12
  36. package/dist/components/color-swatch-picker/index.js +7 -7
  37. package/dist/components/color-swatch-picker/index.js.map +1 -1
  38. package/dist/components/color-wheel/index.d.ts +6 -6
  39. package/dist/components/color-wheel/index.js +4 -4
  40. package/dist/components/color-wheel/index.js.map +1 -1
  41. package/dist/components/combo-box/index.d.ts +5 -5
  42. package/dist/components/combo-box/index.js +4 -4
  43. package/dist/components/combo-box/index.js.map +1 -1
  44. package/dist/components/date-field/index.d.ts +6 -6
  45. package/dist/components/date-field/index.js +4 -4
  46. package/dist/components/date-field/index.js.map +1 -1
  47. package/dist/components/date-picker/index.d.ts +6 -6
  48. package/dist/components/date-picker/index.js +4 -4
  49. package/dist/components/date-picker/index.js.map +1 -1
  50. package/dist/components/date-range-picker/index.d.ts +6 -6
  51. package/dist/components/date-range-picker/index.js +4 -4
  52. package/dist/components/date-range-picker/index.js.map +1 -1
  53. package/dist/components/dialog/index.d.ts +6 -6
  54. package/dist/components/dialog/index.js +9 -9
  55. package/dist/components/dialog/index.js.map +1 -1
  56. package/dist/components/disclosure/index.d.ts +10 -10
  57. package/dist/components/disclosure/index.js +8 -8
  58. package/dist/components/disclosure/index.js.map +1 -1
  59. package/dist/components/disclosure-group/index.d.ts +4 -4
  60. package/dist/components/disclosure-group/index.js +4 -4
  61. package/dist/components/disclosure-group/index.js.map +1 -1
  62. package/dist/components/drop-zone/index.d.ts +8 -8
  63. package/dist/components/drop-zone/index.js +6 -6
  64. package/dist/components/drop-zone/index.js.map +1 -1
  65. package/dist/components/form/index.d.ts +5 -5
  66. package/dist/components/form/index.js +4 -4
  67. package/dist/components/form/index.js.map +1 -1
  68. package/dist/components/link/index.d.ts +6 -6
  69. package/dist/components/link/index.js +4 -4
  70. package/dist/components/link/index.js.map +1 -1
  71. package/dist/components/list-box/index.d.ts +18 -18
  72. package/dist/components/list-box/index.js +11 -11
  73. package/dist/components/list-box/index.js.map +1 -1
  74. package/dist/components/menu/index.d.ts +16 -16
  75. package/dist/components/menu/index.js +14 -14
  76. package/dist/components/menu/index.js.map +1 -1
  77. package/dist/components/meter/index.d.ts +6 -6
  78. package/dist/components/meter/index.js +4 -4
  79. package/dist/components/meter/index.js.map +1 -1
  80. package/dist/components/navigation-tree/index.d.ts +15 -15
  81. package/dist/components/navigation-tree/index.js +13 -13
  82. package/dist/components/navigation-tree/index.js.map +1 -1
  83. package/dist/components/number-field/index.d.ts +5 -5
  84. package/dist/components/number-field/index.js +4 -4
  85. package/dist/components/number-field/index.js.map +1 -1
  86. package/dist/components/popover/index.d.ts +3 -3
  87. package/dist/components/popover/index.js +12 -12
  88. package/dist/components/popover/index.js.map +1 -1
  89. package/dist/components/radio-group/index.d.ts +5 -5
  90. package/dist/components/radio-group/index.js +4 -4
  91. package/dist/components/radio-group/index.js.map +1 -1
  92. package/dist/components/range-calendar/index.d.ts +7 -7
  93. package/dist/components/range-calendar/index.js +4 -4
  94. package/dist/components/range-calendar/index.js.map +1 -1
  95. package/dist/components/search-field/index.d.ts +6 -6
  96. package/dist/components/search-field/index.js +4 -4
  97. package/dist/components/search-field/index.js.map +1 -1
  98. package/dist/components/select/index.d.ts +5 -5
  99. package/dist/components/select/index.js +4 -4
  100. package/dist/components/select/index.js.map +1 -1
  101. package/dist/components/separator/index.d.ts +5 -5
  102. package/dist/components/separator/index.js +4 -4
  103. package/dist/components/separator/index.js.map +1 -1
  104. package/dist/components/sheet/index.d.ts +5 -5
  105. package/dist/components/sheet/index.js +12 -12
  106. package/dist/components/sheet/index.js.map +1 -1
  107. package/dist/components/slider/index.d.ts +4 -4
  108. package/dist/components/slider/index.js +4 -4
  109. package/dist/components/slider/index.js.map +1 -1
  110. package/dist/components/table/index.d.ts +20 -20
  111. package/dist/components/table/index.js +17 -17
  112. package/dist/components/table/index.js.map +1 -1
  113. package/dist/components/tabs/index.d.ts +5 -5
  114. package/dist/components/tabs/index.js +8 -8
  115. package/dist/components/tabs/index.js.map +1 -1
  116. package/dist/components/text-area/index.d.ts +2 -2
  117. package/dist/components/text-area/index.js +2 -2
  118. package/dist/components/text-area/index.js.map +1 -1
  119. package/dist/components/text-field/index.d.ts +4 -4
  120. package/dist/components/text-field/index.js +4 -4
  121. package/dist/components/text-field/index.js.map +1 -1
  122. package/dist/components/time-field/index.d.ts +6 -6
  123. package/dist/components/time-field/index.js +4 -4
  124. package/dist/components/time-field/index.js.map +1 -1
  125. package/dist/components/token-field/index.d.ts +7 -7
  126. package/dist/components/token-field/index.js +4 -4
  127. package/dist/components/token-field/index.js.map +1 -1
  128. package/dist/components/toolbar/index.d.ts +6 -6
  129. package/dist/components/toolbar/index.js +4 -4
  130. package/dist/components/toolbar/index.js.map +1 -1
  131. package/dist/components/tooltip/index.d.ts +2 -2
  132. package/dist/components/tooltip/index.js +4 -4
  133. package/dist/components/tooltip/index.js.map +1 -1
  134. package/dist/components/tree/index.d.ts +17 -17
  135. package/dist/components/tree/index.js +14 -14
  136. package/dist/components/tree/index.js.map +1 -1
  137. package/dist/drag/hooks.d.ts +3 -3
  138. package/dist/drag/hooks.js +4 -4
  139. package/dist/drag/hooks.js.map +1 -1
  140. package/dist/drag/index.js +4 -4
  141. package/dist/drag/index.js.map +1 -1
  142. package/dist/react-aria.d.ts +2 -2
  143. package/dist/react-aria.js +2 -2
  144. package/package.json +8 -8
@@ -8,7 +8,7 @@ import { mergeStatefulStyles } from "../../styles/merge.js";
8
8
  import { c } from "react/compiler-runtime";
9
9
  import { useContext } from "react";
10
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
- import { Button, Disclosure, DisclosurePanel, DisclosureStateContext, Heading } from "react-aria-components";
11
+ import { Button, Disclosure as Disclosure$1, DisclosurePanel as DisclosurePanel$1, DisclosureStateContext, Heading } from "react-aria-components";
12
12
  // src/components/disclosure/index.tsx
13
13
  const styles = { header: {
14
14
  kzqmXN: "xh8yej3",
@@ -41,7 +41,7 @@ function chevronFor(isExpanded) {
41
41
  * The call site's `className` and `style` land on the container, which is the
42
42
  * element a layout positions.
43
43
  */
44
- function Disclosure$1(t0) {
44
+ function Disclosure(t0) {
45
45
  const $ = c(10);
46
46
  let T0;
47
47
  let children;
@@ -50,7 +50,7 @@ function Disclosure$1(t0) {
50
50
  if ($[0] !== t0) {
51
51
  const { children: t3, ...props } = t0;
52
52
  children = t3;
53
- T0 = Disclosure;
53
+ T0 = Disclosure$1;
54
54
  t1 = props;
55
55
  t2 = mergeStatefulStyles({ className: "x9f619 x78zum5 xdt5ytf" }, props);
56
56
  $[0] = t0;
@@ -140,7 +140,7 @@ function DisclosureHeader(t0) {
140
140
  * `role="region"` names it in the landmark list instead, for a section a
141
141
  * reader should be able to jump to.
142
142
  */
143
- function DisclosurePanel$1(t0) {
143
+ function DisclosurePanel(t0) {
144
144
  const $ = c(11);
145
145
  const { children, ...props } = t0;
146
146
  const state = useContext(DisclosureStateContext);
@@ -153,7 +153,7 @@ function DisclosurePanel$1(t0) {
153
153
  $[0] = t1;
154
154
  } else t1 = $[0];
155
155
  const t2 = t1[!!(state?.isExpanded === true) << 0];
156
- const T0 = DisclosurePanel;
156
+ const T0 = DisclosurePanel$1;
157
157
  const t3 = mergeStatefulStyles({ className: "x9f619 x2lwn1j x7giv3 x1hm618n" }, props);
158
158
  let t4;
159
159
  if ($[1] !== children) {
@@ -201,8 +201,8 @@ function headerContent(children, leading, supporting, isExpanded, ripple) {
201
201
  children
202
202
  }), state.isDisabled ? null : ripple] });
203
203
  }
204
- Disclosure$1.Header = DisclosureHeader;
205
- Disclosure$1.Panel = DisclosurePanel$1;
206
- export { DisclosureHeader, DisclosurePanel$1 as DisclosurePanel, Disclosure$1 as default };
204
+ Disclosure.Header = DisclosureHeader;
205
+ Disclosure.Panel = DisclosurePanel;
206
+ export { DisclosureHeader, DisclosurePanel, Disclosure as default };
207
207
 
208
208
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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 { DisclosureHeader, DisclosurePanel };\nexport default Disclosure;"],"mappings":";;;;;;;;;;;;AAiDA,MAAMW,SAAS,EACbC,QAAQ;CACNC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AA6BA,SAASM,WAAWC,YAAqB;CACvC,OAAO,oBAAC,iBAAD,EAAiB,GAAI;EAC1B,GAAG,EACDF,WAAW,sFACb;EACA,GAAG,EACDA,WAAW,sFACb;CACF,EAAE,CAAC,CAACE,cAAc,GAAG,CAAA;AACvB;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAAlB,aAAAmB,IAAA;CAAA,MAAAC,IAAAxB,EAAA,EAAA;CAAA,IAAAyB;CAAA,IAAAT;CAAA,IAAAU;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAoB,MAAA,EAAAP,UAAAY,IAAA,GAAAC,UAAAN;EAAAP,WAAAY;EAIVH,KAAApB;EAAkBwB,KAAAA;EAAWF,KAAAjB,oBAAoB,EAAAU,WAC5C,yBACb,GAAGS,KAAK;EAACL,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAR;EAAAQ,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAF,KAAAD,EAAA;EAAAR,WAAAQ,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;CAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAC,MAAAD,EAAA,OAAAR,YAAAQ,EAAA,OAAAE,MAAAF,EAAA,OAAAG,IAAA;EAFFC,KAAA,oBAAC,IAAD;GAAc,GAAKC;GAAK,GAAMF;GAGh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AAA,KAAAK;EAAAL,EAAA,KAAAI;EAAAJ,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;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,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"}
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 { DisclosureHeader, DisclosurePanel };\nexport default Disclosure;"],"mappings":";;;;;;;;;;;;AAiDA,MAAMW,SAAS,EACbC,QAAQ;CACNC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AA6BA,SAASM,WAAWC,YAAqB;CACvC,OAAO,oBAAC,iBAAD,EAAiB,GAAI;EAC1B,GAAG,EACDF,WAAW,sFACb;EACA,GAAG,EACDA,WAAW,sFACb;CACF,EAAE,CAAC,CAACE,cAAc,GAAG,CAAA;AACvB;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAAlB,WAAAmB,IAAA;CAAA,MAAAC,IAAAxB,EAAA,EAAA;CAAA,IAAAyB;CAAA,IAAAT;CAAA,IAAAU;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,IAAA;EAAoB,MAAA,EAAAP,UAAAY,IAAA,GAAAC,UAAAN;EAAAP,WAAAY;EAIVH,KAAApB;EAAkBwB,KAAAA;EAAWF,KAAAjB,oBAAoB,EAAAU,WAC5C,yBACb,GAAGS,KAAK;EAACL,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAR;EAAAQ,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAF,KAAAD,EAAA;EAAAR,WAAAQ,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;CAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAC,MAAAD,EAAA,OAAAR,YAAAQ,EAAA,OAAAE,MAAAF,EAAA,OAAAG,IAAA;EAFFC,KAAA,oBAAC,IAAD;GAAc,GAAKC;GAAK,GAAMF;GAGhCX;EAHgB,CAAA;EAIHQ,EAAA,KAAAC;EAAAD,EAAA,KAAAR;EAAAQ,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CA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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,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,WAAWoD,SAAS1B;AACpB1B,WAAWqD,QAAQnD"}
@@ -1,6 +1,6 @@
1
1
  import { ReactNode, RefAttributes } from "react";
2
- import { DisclosureGroupProps } from "react-aria-components";
3
- type DisclosureGroupProps$1 = Omit<DisclosureGroupProps, 'children'> & {
2
+ import { DisclosureGroupProps as DisclosureGroupProps$1 } from "react-aria-components";
3
+ type DisclosureGroupProps = Omit<DisclosureGroupProps$1, 'children'> & {
4
4
  /** The sections, as `Disclosure` elements each given an `id`. */
5
5
  children?: ReactNode;
6
6
  /**
@@ -30,5 +30,5 @@ type DisclosureGroupProps$1 = Omit<DisclosureGroupProps, 'children'> & {
30
30
  * The call site's `className` and `style` land on the container, which is the
31
31
  * element a layout positions.
32
32
  */
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 };
33
+ declare function DisclosureGroup({ children, divided, ...props }: DisclosureGroupProps & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
34
+ export { type DisclosureGroupProps, DisclosureGroup as default };
@@ -4,7 +4,7 @@ import Separator$1 from "../separator/index.js";
4
4
  import { c } from "react/compiler-runtime";
5
5
  import { Children, Fragment, isValidElement } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
- import { DisclosureGroup } from "react-aria-components";
7
+ import { DisclosureGroup as DisclosureGroup$1 } from "react-aria-components";
8
8
  // src/components/disclosure-group/index.tsx
9
9
  /**
10
10
  * A stack of `Disclosure` sections that agree about what is open. Which are
@@ -26,7 +26,7 @@ import { DisclosureGroup } from "react-aria-components";
26
26
  * The call site's `className` and `style` land on the container, which is the
27
27
  * element a layout positions.
28
28
  */
29
- function DisclosureGroup$1(t0) {
29
+ function DisclosureGroup(t0) {
30
30
  const $ = c(14);
31
31
  let T0;
32
32
  let children;
@@ -37,7 +37,7 @@ function DisclosureGroup$1(t0) {
37
37
  const { children: t3, divided: t4, ...props } = t0;
38
38
  children = t3;
39
39
  divided = t4 === void 0 ? true : t4;
40
- T0 = DisclosureGroup;
40
+ T0 = DisclosureGroup$1;
41
41
  t1 = props;
42
42
  t2 = mergeStatefulStyles({ className: "x9f619 x78zum5 xdt5ytf" }, props);
43
43
  $[0] = t0;
@@ -90,6 +90,6 @@ function keyOf(section, index) {
90
90
  if (isValidElement(section)) return section.key ?? String(index);
91
91
  return String(index);
92
92
  }
93
- export { DisclosureGroup$1 as default };
93
+ export { DisclosureGroup as default };
94
94
 
95
95
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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,MAAA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AAA,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"}
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,gBAAAK,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"}
@@ -1,10 +1,10 @@
1
1
  import { ReactNode, RefAttributes } from "react";
2
- import { DropZoneProps, FileTriggerProps } from "react-aria-components";
3
- type DropZoneProps$1 = Omit<DropZoneProps, 'children' | 'className' | 'style'> & {
2
+ import { DropZoneProps as DropZoneProps$1, FileTriggerProps as FileTriggerProps$1 } from "react-aria-components";
3
+ type DropZoneProps = Omit<DropZoneProps$1, 'children' | 'className' | 'style'> & {
4
4
  /** What the target holds: its label, and whatever else it offers. */
5
5
  children?: ReactNode;
6
6
  /** A function may compute the class from the target's render state. */
7
- className?: DropZoneProps['className'];
7
+ className?: DropZoneProps$1['className'];
8
8
  /**
9
9
  * What the target says it is for. Drawn inside it and used as its
10
10
  * accessible name, so a target with one needs no `aria-label`. A string
@@ -13,9 +13,9 @@ type DropZoneProps$1 = Omit<DropZoneProps, 'children' | 'className' | 'style'> &
13
13
  */
14
14
  label?: string;
15
15
  /** A function may compute the style from the target's render state. */
16
- style?: DropZoneProps['style'];
16
+ style?: DropZoneProps$1['style'];
17
17
  };
18
- type FileTriggerProps$1 = FileTriggerProps;
18
+ type FileTriggerProps = FileTriggerProps$1;
19
19
  /**
20
20
  * A place to drop files. What is dropped is React Aria's: `onDrop` is handed
21
21
  * the items, and `isFileDropItem`, `isDirectoryDropItem`, `isTextDropItem`
@@ -37,7 +37,7 @@ type FileTriggerProps$1 = FileTriggerProps;
37
37
  * The call site's `className` and `style` land on the target itself, which
38
38
  * is the element a layout positions.
39
39
  */
40
- declare function DropZone$1({ children, label, ...props }: DropZoneProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
40
+ declare function DropZone({ children, label, ...props }: DropZoneProps & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
41
41
  /**
42
42
  * A button that opens the file picker. Wrap whatever should open it —
43
43
  * normally the library's Button — and take the files from `onSelect`.
@@ -53,5 +53,5 @@ declare function DropZone$1({ children, label, ...props }: DropZoneProps$1 & Ref
53
53
  * takes more than one file, `acceptDirectory` takes a folder, and
54
54
  * `defaultCamera` opens straight to a camera on a device that has one.
55
55
  */
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 };
56
+ declare function FileTrigger(props: FileTriggerProps): import("react").JSX.Element;
57
+ export { type DropZoneProps, FileTrigger, type FileTriggerProps, DropZone as default };
@@ -4,7 +4,7 @@ import { mergeStatefulStyles } from "../../styles/merge.js";
4
4
  import { dropZoneStyles, rootStyles } from "./styles.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
- import { DropZone, FileTrigger } from "react-aria-components";
7
+ import { DropZone as DropZone$1, FileTrigger as FileTrigger$1 } from "react-aria-components";
8
8
  // src/components/drop-zone/index.tsx
9
9
  function content(children, label, isDisabled) {
10
10
  return /* @__PURE__ */ jsxs(Fragment, { children: [label === void 0 ? null : /* @__PURE__ */ jsx("p", {
@@ -33,7 +33,7 @@ function content(children, label, isDisabled) {
33
33
  * The call site's `className` and `style` land on the target itself, which
34
34
  * is the element a layout positions.
35
35
  */
36
- function DropZone$1(t0) {
36
+ function DropZone(t0) {
37
37
  const $ = c(12);
38
38
  let T0;
39
39
  let t1;
@@ -42,7 +42,7 @@ function DropZone$1(t0) {
42
42
  let t4;
43
43
  if ($[0] !== t0) {
44
44
  const { children, label, ...props } = t0;
45
- T0 = DropZone;
45
+ T0 = DropZone$1;
46
46
  t1 = props["aria-label"] ?? label;
47
47
  t2 = props;
48
48
  t3 = mergeStatefulStyles(rootStyles, props);
@@ -92,16 +92,16 @@ function DropZone$1(t0) {
92
92
  * takes more than one file, `acceptDirectory` takes a folder, and
93
93
  * `defaultCamera` opens straight to a camera on a device that has one.
94
94
  */
95
- function FileTrigger$1(props) {
95
+ function FileTrigger(props) {
96
96
  const $ = c(2);
97
97
  let t0;
98
98
  if ($[0] !== props) {
99
- t0 = /* @__PURE__ */ jsx(FileTrigger, { ...props });
99
+ t0 = /* @__PURE__ */ jsx(FileTrigger$1, { ...props });
100
100
  $[0] = props;
101
101
  $[1] = t0;
102
102
  } else t0 = $[1];
103
103
  return t0;
104
104
  }
105
- export { FileTrigger$1 as FileTrigger, DropZone$1 as default };
105
+ export { FileTrigger, DropZone as default };
106
106
 
107
107
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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) {\n return <RACFileTrigger {...props} />;\n}\nexport type { DropZoneProps, FileTriggerProps };\nexport { FileTrigger };\nexport default DropZone;"],"mappings":";;;;;;;;AA8DA,SAASU,QAAQF,UAAqBC,OAA2BE,YAAqB;CACpF,OAAO,qBAAA,UAAA,EAAA,UAAA,CACFF,UAAUG,KAAAA,IAAY,OAAO,oBAAC,KAAD;EAAG,GAAIX,MAAaK,eAAeG,OAAOE,cAAcL,eAAeQ,aAAa;EAC7GL,UAAAA;CACA,CAAA,GACJD,QACH,EAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAAN,WAAAa,IAAA;CAAA,MAAAC,IAAAhB,EAAA,EAAA;CAAA,IAAAiB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAkB,MAAA,EAAAP,UAAAC,OAAA,GAAAI,UAAAE;EAKRE,KAAAd;EAAwBe,KAAAL,MAAM,iBAANJ;EAAkCI,KAAAA;EAAWO,KAAAf,oBAAoBE,YAAYM,KAAK;EAC7GQ,KAAAX,QAAQF,UAAUC,OAAOI,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,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
+ {"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) {\n return <RACFileTrigger {...props} />;\n}\nexport type { DropZoneProps, FileTriggerProps };\nexport { FileTrigger };\nexport default DropZone;"],"mappings":";;;;;;;;AA8DA,SAASU,QAAQF,UAAqBC,OAA2BE,YAAqB;CACpF,OAAO,qBAAA,UAAA,EAAA,UAAA,CACFF,UAAUG,KAAAA,IAAY,OAAO,oBAAC,KAAD;EAAG,GAAIX,MAAaK,eAAeG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H,OAAA;EACSE,KAAA,oBAACQ,eAAD,EAAe,GAAKV,MAAK,CAAA;EAAIG,EAAA,KAAAH;EAAAG,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B"}
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties, RefAttributes } from "react";
2
- import { FormProps } from "react-aria-components";
3
- type FormProps$1 = {
2
+ import { FormProps as FormProps$1 } from "react-aria-components";
3
+ type FormProps = {
4
4
  className?: string;
5
5
  style?: CSSProperties;
6
6
  /**
@@ -27,7 +27,7 @@ type FormProps$1 = {
27
27
  * @default 'aria'
28
28
  */
29
29
  validationBehavior?: 'aria' | 'native';
30
- } & Omit<FormProps, 'className' | 'style' | 'validationBehavior'>;
30
+ } & Omit<FormProps$1, 'className' | 'style' | 'validationBehavior'>;
31
31
  /**
32
32
  * A form: the fields inside it and what they are told about validation. Pass
33
33
  * `validationErrors`, an object keyed by field `name`, to show what a server
@@ -53,5 +53,5 @@ type FormProps$1 = {
53
53
  * The call site's `className` and `style` land on the form element, which is
54
54
  * the element a layout positions.
55
55
  */
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 };
56
+ declare function Form({ validationBehavior, ...props }: FormProps & RefAttributes<HTMLFormElement>): import("react").JSX.Element;
57
+ export { type FormProps, Form as default };
@@ -3,7 +3,7 @@ import { FIELD_VALIDATION_BEHAVIOR } from "../../field/root.js";
3
3
  import { mergeStyles } from "../../styles/merge.js";
4
4
  import { c } from "react/compiler-runtime";
5
5
  import { jsx } from "react/jsx-runtime";
6
- import { Form } from "react-aria-components";
6
+ import { Form as Form$1 } from "react-aria-components";
7
7
  // src/components/form/index.tsx
8
8
  /**
9
9
  * A form: the fields inside it and what they are told about validation. Pass
@@ -30,7 +30,7 @@ import { Form } from "react-aria-components";
30
30
  * The call site's `className` and `style` land on the form element, which is
31
31
  * the element a layout positions.
32
32
  */
33
- function Form$1(t0) {
33
+ function Form(t0) {
34
34
  const $ = c(10);
35
35
  let T0;
36
36
  let t1;
@@ -39,7 +39,7 @@ function Form$1(t0) {
39
39
  if ($[0] !== t0) {
40
40
  const { validationBehavior: t4, ...props } = t0;
41
41
  const validationBehavior = t4 === void 0 ? FIELD_VALIDATION_BEHAVIOR : t4;
42
- T0 = Form;
42
+ T0 = Form$1;
43
43
  t1 = validationBehavior;
44
44
  t2 = props;
45
45
  t3 = mergeStyles({ className: "x9f619" }, props);
@@ -69,6 +69,6 @@ function Form$1(t0) {
69
69
  } else t4 = $[9];
70
70
  return t4;
71
71
  }
72
- export { Form$1 as default };
72
+ export { Form as default };
73
73
 
74
74
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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"}
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,KAAAM,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"}
@@ -1,8 +1,8 @@
1
1
  import { AriaAttributes, DOMAttributes, ReactNode, RefAttributes } from "react";
2
- import { ClassNameOrFunction, LinkProps, LinkRenderProps, StyleOrFunction } from "react-aria-components";
3
- type GlobalEventKey = Exclude<keyof DOMAttributes<HTMLElement> & keyof LinkProps, 'onBlur' | 'onClick' | 'onFocus'>;
4
- type LinkDOMProps = Omit<LinkProps, 'children' | 'className' | 'style' | GlobalEventKey> & Pick<DOMAttributes<HTMLElement>, GlobalEventKey>;
5
- type LinkProps$1 = {
2
+ import { ClassNameOrFunction, LinkProps as LinkProps$1, LinkRenderProps, StyleOrFunction } from "react-aria-components";
3
+ type GlobalEventKey = Exclude<keyof DOMAttributes<HTMLElement> & keyof LinkProps$1, 'onBlur' | 'onClick' | 'onFocus'>;
4
+ type LinkDOMProps = Omit<LinkProps$1, 'children' | 'className' | 'style' | GlobalEventKey> & Pick<DOMAttributes<HTMLElement>, GlobalEventKey>;
5
+ type LinkProps = {
6
6
  children?: ReactNode;
7
7
  /** A function may compute the class from the link's render state. */
8
8
  className?: ClassNameOrFunction<LinkRenderProps>;
@@ -44,5 +44,5 @@ type LinkUnderline = 'always' | 'hover' | 'none';
44
44
  * onto an element of its own. Every `aria-*` prop is forwarded to the element;
45
45
  * React Aria alone would keep only the labelling ones.
46
46
  */
47
- declare function Link$1({ onKeyDown, onKeyUp, render, tone, underline, ...props }: LinkProps$1 & RefAttributes<HTMLAnchorElement>): import("react").JSX.Element;
48
- export { type LinkDOMProps, type LinkProps$1 as LinkProps, type LinkTone, type LinkUnderline, Link$1 as default };
47
+ declare function Link({ onKeyDown, onKeyUp, render, tone, underline, ...props }: LinkProps & RefAttributes<HTMLAnchorElement>): import("react").JSX.Element;
48
+ export { type LinkDOMProps, type LinkProps, type LinkTone, type LinkUnderline, Link as default };
@@ -5,7 +5,7 @@ import { focus } from "../../styles/focus.js";
5
5
  import { mergeStatefulStyles } from "../../styles/merge.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import { jsx } from "react/jsx-runtime";
8
- import { Link } from "react-aria-components";
8
+ import { Link as Link$1 } from "react-aria-components";
9
9
  // src/components/link/index.tsx
10
10
  const styles = {
11
11
  base: {
@@ -82,7 +82,7 @@ const hovered = {
82
82
  * onto an element of its own. Every `aria-*` prop is forwarded to the element;
83
83
  * React Aria alone would keep only the labelling ones.
84
84
  */
85
- function Link$1(t0) {
85
+ function Link(t0) {
86
86
  const $ = c(13);
87
87
  let T0;
88
88
  let t1;
@@ -97,7 +97,7 @@ function Link$1(t0) {
97
97
  onKeyDown,
98
98
  onKeyUp
99
99
  };
100
- T0 = Link;
100
+ T0 = Link$1;
101
101
  t1 = linkRenderer(element, render);
102
102
  t2 = props$1;
103
103
  let t6;
@@ -134,6 +134,6 @@ function Link$1(t0) {
134
134
  } else t4 = $[12];
135
135
  return t4;
136
136
  }
137
- export { Link$1 as default };
137
+ export { Link as default };
138
138
 
139
139
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","stylex","Link","RACLink","ariaAttributesOf","linkRenderer","focus","mergeStatefulStyles","styles","base","k6CgDc","kaIpWk","kB7OPa","kkrTdU","kHjlTd","kNySMw","kcSHmL","kIyJzY","k1ekBW","kAMwcw","$$css","disabled","kMwMTN","k1TLXF","tones","inherit","primary","underlines","always","kMnn75","hover","none","hovered","tone","underline","t0","$","T0","t1","t2","t3","onKeyDown","onKeyUp","render","t4","t5","props","undefined","element","aria","t6","state","ring","isHovered","isDisabled"],"sources":["../../../src/components/link/index.tsx"],"sourcesContent":["'use client';\n\nimport type { AriaAttributes, DOMAttributes, ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, LinkRenderProps, LinkProps as RACLinkProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Link as RACLink } from 'react-aria-components';\nimport { ariaAttributesOf, linkRenderer } from '../../render/aria';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// No Material Design page draws an inline link. The nearest component is the\n// text button, whose label is the same primary role on no container, and this\n// takes that, with the disabled treatment every page gives content: on\n// surface at the disabled-content opacity. What belongs to a control standing\n// on its own is left out — the button's height, padding, type and state\n// layer. A link takes its size and face from the sentence it sits in, and\n// says it can be followed with its underline instead, which is this\n// component's own: a 1px rule in 70% of the primary role, or in the outline\n// role under `inherit`, turning fully primary on hover.\n//\n// 70% is the least that keeps the rule at 3:1 against the surface in every\n// scheme the library is shown in — Nordic, the closest, comes to 3.15:1. The\n// rule is what separates a link from its sentence, since the primary role\n// sits as close as 1.3:1 to body text in the dark theme, and at the 45% it\n// was drawn in before it measured 2:1 on the light surface.\n//\n// Hover is React Aria's render state rather than `:hover`, as Button's and\n// Tabs' are. A tap leaves a touch screen's emulated pointer over what was\n// tapped, so `:hover` kept a tapped link lit until the next tap, and React\n// Aria ignores that pointer; it also never reports a disabled link hovered.\n\nconst styles = {\n base: {\n k6CgDc: \"x12w9bfk\",\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n kHjlTd: \"xj0a0fe\",\n kNySMw: \"xyi4chj\",\n kcSHmL: \"x1ohr1zr\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xz1df8t\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n disabled: {\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n k1TLXF: \"x1g6epwz\",\n $$css: true\n }\n};\nconst tones = {\n inherit: {\n kMwMTN: \"x1heor9g\",\n k1TLXF: \"x1dbr5dg\",\n $$css: true\n },\n primary: {\n kMwMTN: \"x1mxwv8y\",\n k1TLXF: \"x1q3xnwu\",\n $$css: true\n }\n};\nconst underlines = {\n always: {\n kMnn75: \"xujl8zx\",\n $$css: true\n },\n hover: {\n kMnn75: \"xkrqix3\",\n $$css: true\n },\n none: {\n kMnn75: \"xkrqix3\",\n $$css: true\n }\n};\n\n// Under a pointer, from the render state — see the comment at the top. Either\n// tone turns its text and its rule fully primary, and a rule held back until\n// hover is drawn.\nconst hovered = {\n tone: {\n kMwMTN: \"x1mxwv8y\",\n k1TLXF: \"xv4vikv\",\n $$css: true\n },\n underline: {\n kMnn75: \"xujl8zx\",\n $$css: true\n }\n};\n\n// React Aria types the global DOM events against the element it renders, and\n// a handler written for an <a> does not type-check against the <span> it\n// renders while disabled. The keys are retyped against HTMLElement here, as\n// Button's are, so one set of props serves both forms; the events React Aria\n// defines itself (press, hover, focus) keep its types, since it hands those\n// its own event objects.\ntype GlobalEventKey = Exclude<keyof DOMAttributes<HTMLElement> & keyof RACLinkProps, 'onBlur' | 'onClick' | 'onFocus'>;\ntype LinkDOMProps = Omit<RACLinkProps, 'children' | 'className' | 'style' | GlobalEventKey> & Pick<DOMAttributes<HTMLElement>, GlobalEventKey>;\ntype LinkProps = {\n children?: ReactNode;\n /** A function may compute the class from the link's render state. */\n className?: ClassNameOrFunction<LinkRenderProps>;\n /** A function may compute the style from the link's render state. */\n style?: StyleOrFunction<LinkRenderProps>;\n /**\n * Which colour role to render in. `primary` marks the link out from the\n * text around it; `inherit` takes the surrounding colour and leans on the\n * underline alone, for a link in a place already understood to be links —\n * a footer, a breadcrumb, a nav.\n * @default 'primary'\n */\n tone?: LinkTone;\n /**\n * When to draw the rule. Leave it at `always` in prose: without it, colour\n * is the only thing separating the link from the sentence, which some\n * readers cannot see. `hover` and `none` are for links whose position\n * already announces them, such as a row of footer links.\n * @default 'always'\n */\n underline?: LinkUnderline;\n} & AriaAttributes & LinkDOMProps;\ntype LinkTone = 'inherit' | 'primary';\ntype LinkUnderline = 'always' | 'hover' | 'none';\n\n/**\n * A navigational link. It renders an `<a>` and sets no type of its own, so it\n * takes the size and face of the text it sits in. Without `href`, or while\n * disabled, it is a span announced as a link instead, since a disabled\n * anchor is no link at all.\n *\n * ```tsx\n * <Link href=\"#first\">Label</Link>\n * ```\n *\n * Behaviour is React Aria's: `onPress` fires for pointer, touch and keyboard\n * alike, a `RouterProvider` above it turns a navigation into a client-side\n * one, and a `Breadcrumbs` or `Menu` around it reaches it through context.\n * `render` is React Aria's function form, handed the anchor's props to spread\n * onto an element of its own. Every `aria-*` prop is forwarded to the element;\n * React Aria alone would keep only the labelling ones.\n */\nfunction Link({\n onKeyDown,\n onKeyUp,\n render,\n tone = 'primary',\n underline = 'always',\n ...props\n}: LinkProps & RefAttributes<HTMLAnchorElement>) {\n const element = {\n aria: ariaAttributesOf(props),\n onKeyDown,\n onKeyUp\n };\n return <RACLink render={linkRenderer(element, render)} {...props} {...mergeStatefulStyles((state: LinkRenderProps) => stylex.props(styles.base, focus.ring, tones[tone], underlines[underline], state.isHovered && hovered.tone, state.isHovered && underline === 'hover' && hovered.underline, state.isDisabled && styles.disabled), props)} />;\n}\nexport type { LinkDOMProps, LinkProps, LinkTone, LinkUnderline };\nexport default Link;"],"mappings":";;;;;;;;;AAiCA,MAAMQ,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRC,QAAQ;EACRT,QAAQ;EACRU,QAAQ;EACRH,OAAO;CACT;AACF;AACA,MAAMI,QAAQ;CACZC,SAAS;EACPH,QAAQ;EACRC,QAAQ;EACRH,OAAO;CACT;CACAM,SAAS;EACPJ,QAAQ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;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,IAAAQ;CAAA,IAAAR,EAAA,OAAAC,MAAAD,EAAA,OAAAE,MAAAF,EAAA,QAAAG,MAAAH,EAAA,QAAAI,IAAA;EAArUI,KAAA,oBAAC,IAAD;GAAiB,QAAAN;GAA6B,GAAMQ;GAAK,GAAMN;EAAsQ,CAAA;EAAIJ,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAAzUQ;AAAyU"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","Link","RACLink","ariaAttributesOf","linkRenderer","focus","mergeStatefulStyles","styles","base","k6CgDc","kaIpWk","kB7OPa","kkrTdU","kHjlTd","kNySMw","kcSHmL","kIyJzY","k1ekBW","kAMwcw","$$css","disabled","kMwMTN","k1TLXF","tones","inherit","primary","underlines","always","kMnn75","hover","none","hovered","tone","underline","t0","$","T0","t1","t2","t3","onKeyDown","onKeyUp","render","t4","t5","props","undefined","element","aria","t6","state","ring","isHovered","isDisabled"],"sources":["../../../src/components/link/index.tsx"],"sourcesContent":["'use client';\n\nimport type { AriaAttributes, DOMAttributes, ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, LinkRenderProps, LinkProps as RACLinkProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Link as RACLink } from 'react-aria-components';\nimport { ariaAttributesOf, linkRenderer } from '../../render/aria';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// No Material Design page draws an inline link. The nearest component is the\n// text button, whose label is the same primary role on no container, and this\n// takes that, with the disabled treatment every page gives content: on\n// surface at the disabled-content opacity. What belongs to a control standing\n// on its own is left out — the button's height, padding, type and state\n// layer. A link takes its size and face from the sentence it sits in, and\n// says it can be followed with its underline instead, which is this\n// component's own: a 1px rule in 70% of the primary role, or in the outline\n// role under `inherit`, turning fully primary on hover.\n//\n// 70% is the least that keeps the rule at 3:1 against the surface in every\n// scheme the library is shown in — Nordic, the closest, comes to 3.15:1. The\n// rule is what separates a link from its sentence, since the primary role\n// sits as close as 1.3:1 to body text in the dark theme, and at the 45% it\n// was drawn in before it measured 2:1 on the light surface.\n//\n// Hover is React Aria's render state rather than `:hover`, as Button's and\n// Tabs' are. A tap leaves a touch screen's emulated pointer over what was\n// tapped, so `:hover` kept a tapped link lit until the next tap, and React\n// Aria ignores that pointer; it also never reports a disabled link hovered.\n\nconst styles = {\n base: {\n k6CgDc: \"x12w9bfk\",\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n kHjlTd: \"xj0a0fe\",\n kNySMw: \"xyi4chj\",\n kcSHmL: \"x1ohr1zr\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xz1df8t\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n disabled: {\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n k1TLXF: \"x1g6epwz\",\n $$css: true\n }\n};\nconst tones = {\n inherit: {\n kMwMTN: \"x1heor9g\",\n k1TLXF: \"x1dbr5dg\",\n $$css: true\n },\n primary: {\n kMwMTN: \"x1mxwv8y\",\n k1TLXF: \"x1q3xnwu\",\n $$css: true\n }\n};\nconst underlines = {\n always: {\n kMnn75: \"xujl8zx\",\n $$css: true\n },\n hover: {\n kMnn75: \"xkrqix3\",\n $$css: true\n },\n none: {\n kMnn75: \"xkrqix3\",\n $$css: true\n }\n};\n\n// Under a pointer, from the render state — see the comment at the top. Either\n// tone turns its text and its rule fully primary, and a rule held back until\n// hover is drawn.\nconst hovered = {\n tone: {\n kMwMTN: \"x1mxwv8y\",\n k1TLXF: \"xv4vikv\",\n $$css: true\n },\n underline: {\n kMnn75: \"xujl8zx\",\n $$css: true\n }\n};\n\n// React Aria types the global DOM events against the element it renders, and\n// a handler written for an <a> does not type-check against the <span> it\n// renders while disabled. The keys are retyped against HTMLElement here, as\n// Button's are, so one set of props serves both forms; the events React Aria\n// defines itself (press, hover, focus) keep its types, since it hands those\n// its own event objects.\ntype GlobalEventKey = Exclude<keyof DOMAttributes<HTMLElement> & keyof RACLinkProps, 'onBlur' | 'onClick' | 'onFocus'>;\ntype LinkDOMProps = Omit<RACLinkProps, 'children' | 'className' | 'style' | GlobalEventKey> & Pick<DOMAttributes<HTMLElement>, GlobalEventKey>;\ntype LinkProps = {\n children?: ReactNode;\n /** A function may compute the class from the link's render state. */\n className?: ClassNameOrFunction<LinkRenderProps>;\n /** A function may compute the style from the link's render state. */\n style?: StyleOrFunction<LinkRenderProps>;\n /**\n * Which colour role to render in. `primary` marks the link out from the\n * text around it; `inherit` takes the surrounding colour and leans on the\n * underline alone, for a link in a place already understood to be links —\n * a footer, a breadcrumb, a nav.\n * @default 'primary'\n */\n tone?: LinkTone;\n /**\n * When to draw the rule. Leave it at `always` in prose: without it, colour\n * is the only thing separating the link from the sentence, which some\n * readers cannot see. `hover` and `none` are for links whose position\n * already announces them, such as a row of footer links.\n * @default 'always'\n */\n underline?: LinkUnderline;\n} & AriaAttributes & LinkDOMProps;\ntype LinkTone = 'inherit' | 'primary';\ntype LinkUnderline = 'always' | 'hover' | 'none';\n\n/**\n * A navigational link. It renders an `<a>` and sets no type of its own, so it\n * takes the size and face of the text it sits in. Without `href`, or while\n * disabled, it is a span announced as a link instead, since a disabled\n * anchor is no link at all.\n *\n * ```tsx\n * <Link href=\"#first\">Label</Link>\n * ```\n *\n * Behaviour is React Aria's: `onPress` fires for pointer, touch and keyboard\n * alike, a `RouterProvider` above it turns a navigation into a client-side\n * one, and a `Breadcrumbs` or `Menu` around it reaches it through context.\n * `render` is React Aria's function form, handed the anchor's props to spread\n * onto an element of its own. Every `aria-*` prop is forwarded to the element;\n * React Aria alone would keep only the labelling ones.\n */\nfunction Link({\n onKeyDown,\n onKeyUp,\n render,\n tone = 'primary',\n underline = 'always',\n ...props\n}: LinkProps & RefAttributes<HTMLAnchorElement>) {\n const element = {\n aria: ariaAttributesOf(props),\n onKeyDown,\n onKeyUp\n };\n return <RACLink render={linkRenderer(element, render)} {...props} {...mergeStatefulStyles((state: LinkRenderProps) => stylex.props(styles.base, focus.ring, tones[tone], underlines[underline], state.isHovered && hovered.tone, state.isHovered && underline === 'hover' && hovered.underline, state.isDisabled && styles.disabled), props)} />;\n}\nexport type { LinkDOMProps, LinkProps, LinkTone, LinkUnderline };\nexport default Link;"],"mappings":";;;;;;;;;AAiCA,MAAMQ,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,UAAU;EACRC,QAAQ;EACRT,QAAQ;EACRU,QAAQ;EACRH,OAAO;CACT;AACF;AACA,MAAMI,QAAQ;CACZC,SAAS;EACPH,QAAQ;EACRC,QAAQ;EACRH,OAAO;CACT;CACAM,SAAS;EACPJ,QAAQ;EACRC,QAAQ;EACRH,OAAO;CACT;AACF;AACA,MAAMO,aAAa;CACjBC,QAAQ;EACNC,QAAQ;EACRT,OAAO;CACT;CACAU,OAAO;EACLD,QAAQ;EACRT,OAAO;CACT;CACAW,MAAM;EACJF,QAAQ;EACRT,OAAO;CACT;AACF;AAKA,MAAMY,UAAU;CACdC,MAAM;EACJX,QAAQ;EACRC,QAAQ;EACRH,OAAO;CACT;CACAc,WAAW;EACTL,QAAQ;EACRT,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;;AA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