@kanso-labs/kanso-ui 0.47.5 → 0.48.1

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 (194) hide show
  1. package/dist/button/hooks.js +38 -4
  2. package/dist/button/hooks.js.map +1 -1
  3. package/dist/button/index.js +80 -67
  4. package/dist/button/index.js.map +1 -1
  5. package/dist/calendar/index.js +5 -5
  6. package/dist/calendar/styles.js +5 -5
  7. package/dist/calendar/styles.js.map +1 -1
  8. package/dist/chip/label.js +1 -1
  9. package/dist/chip/styles.js +1 -1
  10. package/dist/chip/styles.js.map +1 -1
  11. package/dist/collection/context.js +6 -0
  12. package/dist/collection/context.js.map +1 -0
  13. package/dist/collection/index.js +2 -2
  14. package/dist/collection/styles.js +29 -6
  15. package/dist/collection/styles.js.map +1 -1
  16. package/dist/components/app-bar/index.d.ts +1 -1
  17. package/dist/components/app-bar/index.js +2 -2
  18. package/dist/components/autocomplete/index.js +2 -2
  19. package/dist/components/avatar/index.d.ts +1 -1
  20. package/dist/components/avatar/index.js +1 -1
  21. package/dist/components/badge/index.js +3 -3
  22. package/dist/components/breadcrumbs/index.js +2 -2
  23. package/dist/components/button/index.d.ts +1 -1
  24. package/dist/components/button/index.js +3 -3
  25. package/dist/components/button/index.js.map +1 -1
  26. package/dist/components/button-group/index.d.ts +1 -1
  27. package/dist/components/button-group/index.js +3 -3
  28. package/dist/components/calendar/index.js +11 -4
  29. package/dist/components/calendar/index.js.map +1 -1
  30. package/dist/components/card/index.js +2 -2
  31. package/dist/components/carousel/index.d.ts +1 -1
  32. package/dist/components/carousel/index.js +2 -2
  33. package/dist/components/checkbox/index.js +13 -10
  34. package/dist/components/checkbox/index.js.map +1 -1
  35. package/dist/components/checkbox-group/index.js +4 -3
  36. package/dist/components/checkbox-group/index.js.map +1 -1
  37. package/dist/components/chip/index.js +2 -2
  38. package/dist/components/chip-group/index.js +72 -69
  39. package/dist/components/chip-group/index.js.map +1 -1
  40. package/dist/components/code/index.js +1 -1
  41. package/dist/components/color-area/index.js +2 -2
  42. package/dist/components/color-field/index.d.ts +1 -1
  43. package/dist/components/color-field/index.js +2 -2
  44. package/dist/components/color-picker/index.js +2 -2
  45. package/dist/components/color-slider/index.js +3 -3
  46. package/dist/components/color-swatch/index.js +3 -3
  47. package/dist/components/color-swatch-picker/index.js +3 -2
  48. package/dist/components/color-swatch-picker/index.js.map +1 -1
  49. package/dist/components/color-wheel/index.js +2 -2
  50. package/dist/components/combo-box/index.d.ts +1 -1
  51. package/dist/components/combo-box/index.js +8 -4
  52. package/dist/components/combo-box/index.js.map +1 -1
  53. package/dist/components/container/index.js +1 -1
  54. package/dist/components/copy-field/index.js +2 -2
  55. package/dist/components/currency/index.js +3 -3
  56. package/dist/components/date-field/index.d.ts +1 -1
  57. package/dist/components/date-field/index.js +2 -2
  58. package/dist/components/date-picker/index.d.ts +2 -2
  59. package/dist/components/date-picker/index.js +5 -5
  60. package/dist/components/date-range-picker/index.d.ts +2 -2
  61. package/dist/components/date-range-picker/index.js +3 -3
  62. package/dist/components/dialog/index.js +4 -4
  63. package/dist/components/disclosure/index.js +3 -3
  64. package/dist/components/disclosure-group/index.js +3 -3
  65. package/dist/components/drop-zone/index.js +2 -2
  66. package/dist/components/drop-zone/styles.js +11 -11
  67. package/dist/components/drop-zone/styles.js.map +1 -1
  68. package/dist/components/fab/index.d.ts +1 -1
  69. package/dist/components/fab/index.js +1 -1
  70. package/dist/components/fab-menu/index.d.ts +2 -2
  71. package/dist/components/fab-menu/index.js +6 -6
  72. package/dist/components/fab-menu/index.js.map +1 -1
  73. package/dist/components/feed/index.js +1 -1
  74. package/dist/components/form/index.js +2 -2
  75. package/dist/components/icon-button/index.d.ts +1 -1
  76. package/dist/components/icon-button/index.js +3 -3
  77. package/dist/components/icon-button/index.js.map +1 -1
  78. package/dist/components/keycap/index.js +2 -2
  79. package/dist/components/link/index.js +2 -2
  80. package/dist/components/list/index.js +61 -14
  81. package/dist/components/list/index.js.map +1 -1
  82. package/dist/components/list-box/index.js +84 -105
  83. package/dist/components/list-box/index.js.map +1 -1
  84. package/dist/components/list-detail/index.d.ts +1 -1
  85. package/dist/components/list-detail/index.js +1 -1
  86. package/dist/components/list-item/index.js +1 -1
  87. package/dist/components/loading-indicator/index.js +2 -2
  88. package/dist/components/menu/index.d.ts +2 -2
  89. package/dist/components/menu/index.js +3 -3
  90. package/dist/components/meter/index.d.ts +1 -1
  91. package/dist/components/meter/index.js +2 -2
  92. package/dist/components/navigation-bar/index.d.ts +1 -1
  93. package/dist/components/navigation-bar/index.js +2 -2
  94. package/dist/components/navigation-rail/index.d.ts +1 -1
  95. package/dist/components/navigation-rail/index.js +6 -6
  96. package/dist/components/navigation-rail/index.js.map +1 -1
  97. package/dist/components/navigation-tree/index.js +2 -2
  98. package/dist/components/number-field/index.d.ts +1 -1
  99. package/dist/components/number-field/index.js +5 -5
  100. package/dist/components/number-field/index.js.map +1 -1
  101. package/dist/components/popover/index.d.ts +1 -1
  102. package/dist/components/popover/index.js +7 -7
  103. package/dist/components/popover/index.js.map +1 -1
  104. package/dist/components/product-icon/index.d.ts +1 -1
  105. package/dist/components/product-icon/index.js +1 -1
  106. package/dist/components/progress-indicator/index.d.ts +1 -1
  107. package/dist/components/progress-indicator/index.js +2 -2
  108. package/dist/components/radio-group/index.js +14 -13
  109. package/dist/components/radio-group/index.js.map +1 -1
  110. package/dist/components/range-calendar/index.js +3 -3
  111. package/dist/components/search-field/index.js +6 -6
  112. package/dist/components/search-field/index.js.map +1 -1
  113. package/dist/components/search-view/index.d.ts +1 -1
  114. package/dist/components/search-view/index.js +2 -2
  115. package/dist/components/segmented-button/index.d.ts +1 -1
  116. package/dist/components/segmented-button/index.js +3 -3
  117. package/dist/components/select/index.d.ts +1 -1
  118. package/dist/components/select/index.js +8 -4
  119. package/dist/components/select/index.js.map +1 -1
  120. package/dist/components/separator/index.js +3 -3
  121. package/dist/components/sheet/index.js +4 -4
  122. package/dist/components/sheet/index.js.map +1 -1
  123. package/dist/components/slider/index.js +4 -4
  124. package/dist/components/slider/index.js.map +1 -1
  125. package/dist/components/snackbar/index.js +6 -6
  126. package/dist/components/snackbar/index.js.map +1 -1
  127. package/dist/components/split-button/index.d.ts +1 -1
  128. package/dist/components/split-button/index.js +56 -44
  129. package/dist/components/split-button/index.js.map +1 -1
  130. package/dist/components/stack/index.js +2 -2
  131. package/dist/components/supporting-pane/index.d.ts +1 -1
  132. package/dist/components/supporting-pane/index.js +1 -1
  133. package/dist/components/switch/index.d.ts +1 -1
  134. package/dist/components/switch/index.js +3 -3
  135. package/dist/components/table/index.js +61 -48
  136. package/dist/components/table/index.js.map +1 -1
  137. package/dist/components/tabs/index.js +84 -33
  138. package/dist/components/tabs/index.js.map +1 -1
  139. package/dist/components/tag/index.js +1 -1
  140. package/dist/components/text/index.js +1 -1
  141. package/dist/components/text-area/index.d.ts +1 -1
  142. package/dist/components/text-area/index.js +2 -2
  143. package/dist/components/text-field/index.d.ts +1 -1
  144. package/dist/components/text-field/index.js +2 -2
  145. package/dist/components/time-field/index.d.ts +1 -1
  146. package/dist/components/time-field/index.js +2 -2
  147. package/dist/components/time-picker/index.d.ts +1 -1
  148. package/dist/components/time-picker/index.js +9 -9
  149. package/dist/components/time-picker/index.js.map +1 -1
  150. package/dist/components/token-field/index.d.ts +1 -1
  151. package/dist/components/token-field/index.js +3 -3
  152. package/dist/components/toolbar/index.js +3 -3
  153. package/dist/components/tooltip/index.d.ts +1 -1
  154. package/dist/components/tooltip/index.js +2 -2
  155. package/dist/components/tree/index.js +81 -24
  156. package/dist/components/tree/index.js.map +1 -1
  157. package/dist/control/index.js +2 -2
  158. package/dist/drag/hooks.js +2 -2
  159. package/dist/drag/index.js +2 -2
  160. package/dist/field/index.js +106 -107
  161. package/dist/field/index.js.map +1 -1
  162. package/dist/field/styles.js +1 -1
  163. package/dist/field/styles.js.map +1 -1
  164. package/dist/glyphs/index.js +1 -1
  165. package/dist/hooks/useClippedTitle.js +1 -1
  166. package/dist/hooks/useEnlargedText.js +1 -1
  167. package/dist/hooks/useRipple.js +2 -2
  168. package/dist/hooks/useScrollEdges.js +73 -0
  169. package/dist/hooks/useScrollEdges.js.map +1 -0
  170. package/dist/i18n/index.js +2 -2
  171. package/dist/index.js +1 -1
  172. package/dist/indicator/index.js +2 -2
  173. package/dist/mark/index.js +2 -2
  174. package/dist/navigation/index.js +3 -3
  175. package/dist/navigation/styles.js +5 -5
  176. package/dist/navigation/styles.js.map +1 -1
  177. package/dist/overlay/index.js +1 -1
  178. package/dist/render/useRender.js +1 -1
  179. package/dist/row/index.js +2 -2
  180. package/dist/row/styles.js +7 -7
  181. package/dist/row/styles.js.map +1 -1
  182. package/dist/segments/index.js +1 -1
  183. package/dist/segments/literal.js +3 -3
  184. package/dist/styles/color.js +16 -16
  185. package/dist/styles/color.js.map +1 -1
  186. package/dist/styles/focus.js +4 -4
  187. package/dist/styles/focus.js.map +1 -1
  188. package/dist/styles/overlay.js +3 -3
  189. package/dist/styles/overlay.js.map +1 -1
  190. package/dist/styles/scroll-fade.js +33 -0
  191. package/dist/styles/scroll-fade.js.map +1 -0
  192. package/dist/styles.css +61 -20
  193. package/dist/theme-scope.js +4 -4
  194. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","stylex","RadioGroup","RACRadioGroup","RadioField","controlStyles","invalidFrom","useFieldValidationBehavior","fieldGroupStyles","useRipple","focus","mergeStatefulStyles","styles","control","kMwMTN","$$css","itemsHorizontal","k1C7PZ","kXwgrk","kwnvtZ","toneActive","toneDisabled","toneSelected","hoverLayers","selected","kWkggS","unselected","focusLayers","pressedLayers","children","description","error","label","buttonContent","ripple","state","interactive","isDisabled","isReadOnly","tone","isSelected","active","isHovered","isPressed","isFocusVisible","handlers","props","disc","controlReadOnly","controlDisabled","ringVisible","className","surface","groupContent","horizontal","isRequired","stack","optionContent","button","Radio","t0","$","T0","t1","field","t2","t3","t4","t5","orientation","undefined","validationBehavior","root","t6"],"sources":["../../../src/components/radio-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { RadioGroupProps as RACRadioGroupProps, RadioButtonRenderProps, RadioFieldProps, RadioFieldRenderProps, RadioGroupRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { RadioGroup as RACRadioGroup, RadioButton, RadioField } from 'react-aria-components';\nimport { ControlDescription, ControlLabel } from '../../control';\nimport { controlStyles } from '../../control/styles';\nimport { FieldLabel, FieldMessage } from '../../field';\nimport { invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { groupStyles as fieldGroupStyles } from '../../field/styles';\nimport { useRipple } from '../../hooks/useRipple';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// The radio button page: a 20dp ring inside a 40dp state layer, with a 48dp\n// target. Unselected, the ring is 2dp of on surface variant that turns on\n// surface while hovered, pressed or focused; selected, the ring and the 10dp\n// dot inside it are primary. Disabled is on surface at the disabled opacity\n// for both. The state layer is on surface over an unselected button and\n// primary over a selected one while hovered, and the two swap once pressed.\n// The page draws no error state for the button itself: an invalid group\n// says so through its label and message, and the buttons keep their colours.\n//\n// Two components from one module, since neither means anything without the\n// other: a radio button is a member of a group, and the group is what holds\n// the value. React Aria's `RadioGroup` is the group, a div with the label,\n// description and error slots; `RadioField` is one button's root, a div with\n// its description slot; and `RadioButton` is the label around the visually\n// hidden input, whose children draw the button from the render state React\n// Aria hands them. The field is the same two-column grid Checkbox uses, with\n// the label `display: contents` so the description lines up under the text.\n//\n// The adjacent label is body-large on surface, which the page keeps the same\n// whether or not the button is selected.\n//\n// A change of selection moves together: the ring's colour fades, and the dot\n// grows in from nothing or shrinks away, over the same duration and curve.\n// The dot is always drawn, at no size while the button is not selected.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n control: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n itemsHorizontal: {\n k1C7PZ: \"xpamuu5\",\n kXwgrk: \"x1q0g3np\",\n kwnvtZ: \"x1a02dak\",\n $$css: true\n },\n toneActive: {\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n toneDisabled: {\n kMwMTN: \"x1gpw424 x1bhcspo\",\n $$css: true\n },\n toneSelected: {\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n }\n};\n\n// The state layer follows the button: on surface over an unselected one and\n// primary over a selected one while hovered, the two swapped once pressed.\nconst hoverLayers = {\n selected: {\n kWkggS: \"x659ado\",\n $$css: true\n },\n unselected: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n }\n};\n\n// A keyboard's focus draws the hover layer's colour at the focus opacity.\nconst focusLayers = {\n selected: {\n kWkggS: \"x1sog3nf\",\n $$css: true\n },\n unselected: {\n kWkggS: \"xwqhyid\",\n $$css: true\n }\n};\nconst pressedLayers = {\n selected: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n unselected: {\n kWkggS: \"x1dvjsmr\",\n $$css: true\n }\n};\ntype RadioGroupProps = {\n /** The radio buttons, each with a `value` of its own. */\n children?: ReactNode;\n /**\n * A hint under the group. Replaced by `error` when there is one, so the\n * two never stack.\n */\n description?: string;\n /**\n * The problem with the current selection, in words. Its presence is what\n * puts the group in its error state — the message, the label's colour and\n * `aria-invalid` on the group all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * What the group is for. Required rather than optional: a set of radio\n * buttons with no name is a set a screen reader cannot introduce.\n */\n label: string;\n} & Omit<RACRadioGroupProps, 'children' | 'isInvalid' | 'validationBehavior'>;\ntype RadioProps = Omit<RadioFieldProps, 'children'> & {\n /**\n * The label, beside the button. A button that a row labels some other way\n * leaves it out and passes `aria-label` instead.\n *\n * A link or a button in it acts on its own, as in a native label, and\n * leaves the selection as it was. A press anywhere else in the label\n * selects this option.\n */\n children?: ReactNode;\n /** A hint under the label, read with the button. */\n description?: string;\n};\ntype Ripple = ReturnType<typeof useRipple<HTMLSpanElement>>;\n\n// What the label draws, chosen from the render state React Aria hands it.\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its inputs. The ripple's handlers and surface go on the\n// control while the button can change, and are left off while it cannot,\n// since a press that changes nothing should not look like one.\nfunction buttonContent(children: ReactNode, ripple: Ripple) {\n return (state: RadioButtonRenderProps) => {\n const interactive = !state.isDisabled && !state.isReadOnly;\n const tone = state.isSelected ? 'selected' : 'unselected';\n const active = state.isHovered || state.isPressed || state.isFocusVisible;\n return <>\n <span {...interactive ? ripple.handlers : {}} {...stylex.props(controlStyles.disc, styles.control, state.isSelected && styles.toneSelected, !state.isSelected && interactive && active && styles.toneActive, state.isDisabled && styles.toneDisabled, state.isReadOnly && controlStyles.controlReadOnly, state.isDisabled && controlStyles.controlDisabled, interactive && state.isHovered && hoverLayers[tone], interactive && state.isFocusVisible && focusLayers[tone], interactive && state.isPressed && pressedLayers[tone], state.isFocusVisible && focus.ringVisible)}>\n <span className=\"x12w9bfk x6s0dn4 x1qx5ct2 x1r7ld26 x16fbrrb x1y0btm7 xdh2fpr x9f619 x78zum5 xw4jnvo xl56j7k x1qno0dh xshfolx xpc4ca7\">\n <span {...{\n 0: {\n className: \"x12w9bfk xtwfq29 x1jzqe4 x170jfvy x16fbrrb x1fsd2vl x1f85oc2 x1qno0dh xuo13n2 xpc4ca7\"\n },\n 2: {\n className: \"x12w9bfk xtwfq29 x1jzqe4 x170jfvy x16fbrrb x1fsd2vl x1qno0dh xuo13n2 xpc4ca7 x3oybdh\"\n },\n 1: {\n className: \"x12w9bfk x170jfvy x16fbrrb x1fsd2vl x1f85oc2 x1qno0dh xuo13n2 xpc4ca7 xtwfq29 x1o55y2u\"\n },\n 3: {\n className: \"x12w9bfk x170jfvy x16fbrrb x1fsd2vl x1qno0dh xuo13n2 xpc4ca7 x3oybdh xtwfq29 x1o55y2u\"\n }\n }[!!state.isSelected << 1 | !!state.isDisabled << 0]} />\n </span>\n {interactive ? ripple.surface : null}\n </span>\n <ControlLabel state={state}>{children}</ControlLabel>\n </>;\n };\n}\n\n// The group's parts, from its render state: the label's colour follows\n// disabled and invalid the way a field's follows its box.\nfunction groupContent(label: string, children: ReactNode, description: string | undefined, error: string | undefined, horizontal: boolean) {\n return (state: RadioGroupRenderProps) => <>\n <FieldLabel isRequired={state.isRequired} state={state} variant=\"group\">\n {label}\n </FieldLabel>\n <div {...stylex.props(controlStyles.stack, horizontal && styles.itemsHorizontal)}>\n {children}\n </div>\n <FieldMessage description={description} error={error} inset={false} isDisabled={state.isDisabled} />\n </>;\n}\n\n// The option's button and its description, from the option's render state:\n// the description fades with the option whether the option is disabled by\n// itself or by its group, as its label does.\nfunction optionContent(button: ReactNode, description: string | undefined) {\n return ({\n isDisabled\n }: RadioFieldRenderProps) => <>\n {button}\n <ControlDescription isDisabled={isDisabled}>\n {description}\n </ControlDescription>\n </>;\n}\n\n/**\n * One option of a `RadioGroup`, with its label and optionally a description\n * under it. It names the entry it stands for with `value`; the selection is\n * the group's. Rendered on its own, outside a group, it has no state to\n * belong to.\n *\n * The call site's `className` and `style` land on the option as a whole,\n * which is the element a layout positions.\n */\nfunction Radio({\n children,\n description,\n ...props\n}: RadioProps & RefAttributes<HTMLDivElement>) {\n const ripple = useRipple<HTMLSpanElement>();\n return <RadioField {...props} {...mergeStatefulStyles(stylex.props(controlStyles.field), props)}>\n {optionContent(<RadioButton className=\"xjp7ctv\">\n {buttonContent(children, ripple)}\n </RadioButton>, description)}\n </RadioField>;\n}\n\n/**\n * A labelled set of radio buttons with one selected value between them. The\n * value is React Aria's: pass `value` with `onChange` to control it, or\n * `defaultValue` to let the group keep its own, and each `Radio` inside\n * names the entry it stands for. Arrow keys move the selection; disabled,\n * read-only and the error state reach every button from here, and\n * `orientation=\"horizontal\"` lays the buttons along a line.\n *\n * ```tsx\n * <RadioGroup defaultValue=\"first\" label=\"Label\">\n * <Radio value=\"first\">First item</Radio>\n * <Radio value=\"second\">Second item</Radio>\n * </RadioGroup>\n * ```\n *\n * The call site's `className` and `style` land on the group as a whole,\n * which is the element a layout positions.\n */\nfunction RadioGroup({\n children,\n description,\n error,\n label,\n orientation = 'vertical',\n ...props\n}: RadioGroupProps & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACRadioGroup isInvalid={invalidFrom(error)} orientation={orientation} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldGroupStyles.root), props)}>\n {groupContent(label, children, description, error, orientation === 'horizontal')}\n </RACRadioGroup>;\n}\nexport type { RadioGroupProps, RadioProps };\nexport { Radio };\nexport default RadioGroup;"],"mappings":";;;;;;;;;;;;;;AA+CA,MAAMY,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,OAAO;CACT;CACAC,iBAAiB;EACfC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,YAAY;EACVN,QAAQ;EACRC,OAAO;CACT;CACAM,cAAc;EACZP,QAAQ;EACRC,OAAO;CACT;CACAO,cAAc;EACZR,QAAQ;EACRC,OAAO;CACT;AACF;AAIA,MAAMQ,cAAc;CAClBC,UAAU;EACRC,QAAQ;EACRV,OAAO;CACT;CACAW,YAAY;EACVD,QAAQ;EACRV,OAAO;CACT;AACF;AAGA,MAAMY,cAAc;CAClBH,UAAU;EACRC,QAAQ;EACRV,OAAO;CACT;CACAW,YAAY;EACVD,QAAQ;EACRV,OAAO;CACT;AACF;AACA,MAAMa,gBAAgB;CACpBJ,UAAU;EACRC,QAAQ;EACRV,OAAO;CACT;CACAW,YAAY;EACVD,QAAQ;E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AAAN,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,OAAAC,MAAAD,EAAA,OAAAQ,eAAAR,EAAA,QAAAf,WAAAe,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAO,MAAAP,EAAA,QAAAU,oBAAA;EAD7EE,KAAA,oBAAC,IAAD;GAA0B,WAAAR;GAAiCI;GAAiCE;GAAkB,GAAMzB;GAAK,GAAMoB;GACjIE,UAAAA;EADgB,CAAA;EAEHP,EAAA,KAAAC;EAAAD,EAAA,KAAAQ;EAAAR,EAAA,MAAAf;EAAAe,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAO;EAAAP,EAAA,MAAAU;EAAAV,EAAA,MAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAFXY;AAEW"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","RadioGroup","RACRadioGroup","RadioField","controlStyles","invalidFrom","useFieldValidationBehavior","fieldGroupStyles","useRipple","focus","mergeStatefulStyles","styles","control","kMwMTN","$$css","itemsHorizontal","k1C7PZ","kXwgrk","kwnvtZ","toneActive","toneDisabled","toneSelected","hoverLayers","selected","kWkggS","unselected","focusLayers","pressedLayers","children","description","error","label","buttonContent","ripple","state","interactive","isDisabled","isReadOnly","tone","isSelected","active","isHovered","isPressed","isFocusVisible","handlers","props","disc","controlReadOnly","controlDisabled","ringVisible","className","surface","groupContent","horizontal","isInvalid","isRequired","stack","optionContent","button","Radio","t0","$","T0","t1","field","t2","t3","t4","t5","orientation","undefined","validationBehavior","root","t6"],"sources":["../../../src/components/radio-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { RadioGroupProps as RACRadioGroupProps, RadioButtonRenderProps, RadioFieldProps, RadioFieldRenderProps, RadioGroupRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { RadioGroup as RACRadioGroup, RadioButton, RadioField } from 'react-aria-components';\nimport { ControlDescription, ControlLabel } from '../../control';\nimport { controlStyles } from '../../control/styles';\nimport { FieldLabel, FieldMessage } from '../../field';\nimport { invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { groupStyles as fieldGroupStyles } from '../../field/styles';\nimport { useRipple } from '../../hooks/useRipple';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// The radio button page: a 20dp ring inside a 40dp state layer, with a 48dp\n// target. Unselected, the ring is 2dp of on surface variant that turns on\n// surface while hovered, pressed or focused; selected, the ring and the 10dp\n// dot inside it are primary. Disabled is on surface at the disabled opacity\n// for both. The state layer is on surface over an unselected button and\n// primary over a selected one while hovered, and the two swap once pressed.\n// The page draws no error state for the button itself: an invalid group\n// says so through its label and message, and the buttons keep their colours.\n//\n// Two components from one module, since neither means anything without the\n// other: a radio button is a member of a group, and the group is what holds\n// the value. React Aria's `RadioGroup` is the group, a div with the label,\n// description and error slots; `RadioField` is one button's root, a div with\n// its description slot; and `RadioButton` is the label around the visually\n// hidden input, whose children draw the button from the render state React\n// Aria hands them. The field is the same two-column grid Checkbox uses, with\n// the label `display: contents` so the description lines up under the text.\n//\n// The adjacent label is body-large on surface, which the page keeps the same\n// whether or not the button is selected.\n//\n// A change of selection moves together: the ring's colour fades, and the dot\n// grows in from nothing or shrinks away, over the same duration and curve.\n// The dot is always drawn, at no size while the button is not selected.\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n control: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n itemsHorizontal: {\n k1C7PZ: \"xpamuu5\",\n kXwgrk: \"x1q0g3np\",\n kwnvtZ: \"x1a02dak\",\n $$css: true\n },\n toneActive: {\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n toneDisabled: {\n kMwMTN: \"x1gpw424 x1bhcspo\",\n $$css: true\n },\n toneSelected: {\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n }\n};\n\n// The state layer follows the button: on surface over an unselected one and\n// primary over a selected one while hovered, the two swapped once pressed.\nconst hoverLayers = {\n selected: {\n kWkggS: \"x659ado\",\n $$css: true\n },\n unselected: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n }\n};\n\n// A keyboard's focus draws the hover layer's colour at the focus opacity.\nconst focusLayers = {\n selected: {\n kWkggS: \"x1sog3nf\",\n $$css: true\n },\n unselected: {\n kWkggS: \"xwqhyid\",\n $$css: true\n }\n};\nconst pressedLayers = {\n selected: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n unselected: {\n kWkggS: \"x1dvjsmr\",\n $$css: true\n }\n};\ntype RadioGroupProps = {\n /** The radio buttons, each with a `value` of its own. */\n children?: ReactNode;\n /**\n * A hint under the group. Replaced by `error` when there is one, so the\n * two never stack.\n */\n description?: string;\n /**\n * The problem with the current selection, in words. Its presence is what\n * puts the group in its error state — the message, the label's colour and\n * `aria-invalid` on the group all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * What the group is for. Required rather than optional: a set of radio\n * buttons with no name is a set a screen reader cannot introduce.\n */\n label: string;\n} & Omit<RACRadioGroupProps, 'children' | 'isInvalid' | 'validationBehavior'>;\ntype RadioProps = Omit<RadioFieldProps, 'children'> & {\n /**\n * The label, beside the button. A button that a row labels some other way\n * leaves it out and passes `aria-label` instead.\n *\n * A link or a button in it acts on its own, as in a native label, and\n * leaves the selection as it was. A press anywhere else in the label\n * selects this option.\n */\n children?: ReactNode;\n /** A hint under the label, read with the button. */\n description?: string;\n};\ntype Ripple = ReturnType<typeof useRipple<HTMLSpanElement>>;\n\n// What the label draws, chosen from the render state React Aria hands it.\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its inputs. The ripple's handlers and surface go on the\n// control while the button can change, and are left off while it cannot,\n// since a press that changes nothing should not look like one.\nfunction buttonContent(children: ReactNode, ripple: Ripple) {\n return (state: RadioButtonRenderProps) => {\n const interactive = !state.isDisabled && !state.isReadOnly;\n const tone = state.isSelected ? 'selected' : 'unselected';\n const active = state.isHovered || state.isPressed || state.isFocusVisible;\n return <>\n <span {...interactive ? ripple.handlers : {}} {...stylex.props(controlStyles.disc, styles.control, state.isSelected && styles.toneSelected, !state.isSelected && interactive && active && styles.toneActive, state.isDisabled && styles.toneDisabled, state.isReadOnly && controlStyles.controlReadOnly, state.isDisabled && controlStyles.controlDisabled, interactive && state.isHovered && hoverLayers[tone], interactive && state.isFocusVisible && focusLayers[tone], interactive && state.isPressed && pressedLayers[tone], state.isFocusVisible && focus.ringVisible)}>\n <span className=\"x12w9bfk x6s0dn4 x1qx5ct2 x1r7ld26 x16fbrrb x1y0btm7 xdh2fpr x9f619 x78zum5 xw4jnvo xl56j7k x1qno0dh xshfolx xpc4ca7\">\n <span {...{\n 0: {\n className: \"x12w9bfk xtwfq29 x1jzqe4 x170jfvy x16fbrrb x1fsd2vl x1f85oc2 x1qno0dh xuo13n2 xpc4ca7\"\n },\n 2: {\n className: \"x12w9bfk xtwfq29 x1jzqe4 x170jfvy x16fbrrb x1fsd2vl x1qno0dh xuo13n2 xpc4ca7 x3oybdh\"\n },\n 1: {\n className: \"x12w9bfk x170jfvy x16fbrrb x1fsd2vl x1f85oc2 x1qno0dh xuo13n2 xpc4ca7 xtwfq29 x1o55y2u\"\n },\n 3: {\n className: \"x12w9bfk x170jfvy x16fbrrb x1fsd2vl x1qno0dh xuo13n2 xpc4ca7 x3oybdh xtwfq29 x1o55y2u\"\n }\n }[!!state.isSelected << 1 | !!state.isDisabled << 0]} />\n </span>\n {interactive ? ripple.surface : null}\n </span>\n <ControlLabel state={state}>{children}</ControlLabel>\n </>;\n };\n}\n\n// The group's parts, from its render state: the label's colour follows\n// disabled and invalid the way a field's follows its box.\nfunction groupContent(label: string, children: ReactNode, description: string | undefined, error: string | undefined, horizontal: boolean) {\n return (state: RadioGroupRenderProps) => <>\n <FieldLabel isDisabled={state.isDisabled} isInvalid={state.isInvalid} isRequired={state.isRequired} variant=\"group\">\n {label}\n </FieldLabel>\n <div {...stylex.props(controlStyles.stack, horizontal && styles.itemsHorizontal)}>\n {children}\n </div>\n <FieldMessage description={description} error={error} inset={false} isDisabled={state.isDisabled} />\n </>;\n}\n\n// The option's button and its description, from the option's render state:\n// the description fades with the option whether the option is disabled by\n// itself or by its group, as its label does.\nfunction optionContent(button: ReactNode, description: string | undefined) {\n return ({\n isDisabled\n }: RadioFieldRenderProps) => <>\n {button}\n <ControlDescription isDisabled={isDisabled}>\n {description}\n </ControlDescription>\n </>;\n}\n\n/**\n * One option of a `RadioGroup`, with its label and optionally a description\n * under it. It names the entry it stands for with `value`; the selection is\n * the group's. Rendered on its own, outside a group, it has no state to\n * belong to.\n *\n * The call site's `className` and `style` land on the option as a whole,\n * which is the element a layout positions.\n */\nfunction Radio({\n children,\n description,\n ...props\n}: RadioProps & RefAttributes<HTMLDivElement>) {\n const ripple = useRipple<HTMLSpanElement>();\n return <RadioField {...props} {...mergeStatefulStyles(stylex.props(controlStyles.field), props)}>\n {optionContent(<RadioButton className=\"xjp7ctv\">\n {buttonContent(children, ripple)}\n </RadioButton>, description)}\n </RadioField>;\n}\n\n/**\n * A labelled set of radio buttons with one selected value between them. The\n * value is React Aria's: pass `value` with `onChange` to control it, or\n * `defaultValue` to let the group keep its own, and each `Radio` inside\n * names the entry it stands for. Arrow keys move the selection; disabled,\n * read-only and the error state reach every button from here, and\n * `orientation=\"horizontal\"` lays the buttons along a line.\n *\n * ```tsx\n * <RadioGroup defaultValue=\"first\" label=\"Label\">\n * <Radio value=\"first\">First item</Radio>\n * <Radio value=\"second\">Second item</Radio>\n * </RadioGroup>\n * ```\n *\n * The call site's `className` and `style` land on the group as a whole,\n * which is the element a layout positions.\n */\nfunction RadioGroup({\n children,\n description,\n error,\n label,\n orientation = 'vertical',\n ...props\n}: RadioGroupProps & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACRadioGroup isInvalid={invalidFrom(error)} orientation={orientation} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldGroupStyles.root), props)}>\n {groupContent(label, children, description, error, orientation === 'horizontal')}\n </RACRadioGroup>;\n}\nexport type { RadioGroupProps, RadioProps };\nexport { Radio };\nexport default RadioGroup;"],"mappings":";;;;;;;;;;;;;;AA+CA,MAAMY,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,OAAO;CACT;CACAC,iBAAiB;EACfC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,YAAY;EACVN,QAAQ;EACRC,OAAO;CACT;CACAM,cAAc;EACZP,QAAQ;EACRC,OAAO;CACT;CACAO,cAAc;EACZR,QAAQ;EACRC,OAAO;CACT;AACF;AAIA,MAAMQ,cAAc;CAClBC,UAAU;EACRC,QAAQ;EACRV,OAAO;CACT;CACAW,YAAY;EACVD,QAAQ;EACRV,OAAO;CACT;AACF;AAGA,MAAMY,cAAc;CAClBH,UAAU;EACRC,QAAQ;EACRV,OAAO;CACT;CACAW,YAAY;EACVD,QAAQ;EACRV,OAAO;CACT;AACF;AACA,MAAMa,gBAAgB;CACpBJ,UAAU;EACRC,QAAQ;EACRV,OAAO;CACT;CACAW,YAAY;EACVD,QAAQ;EACRV,OAAO;CACT;AACF;AA8CA,SAASkB,cAAcJ,UAAqBK,QAAgB;CAC1D,QAAQC,UAAkC;EACxC,MAAMC,cAAc,CAACD,MAAME,cAAc,CAACF,MAAMG;EAChD,MAAMC,OAAOJ,MAAMK,aAAa,aAAa;EAC7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AAA,QAAAI,MAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAO,MAAAP,EAAA,QAAAU,oBAAA;EAD7EE,KAAA,oBAAC,IAAD;GAA0B,WAAAR;GAAiCI;GAAiCE;GAAkB,GAAM1B;GAAK,GAAMqB;GACjIE,UAAAA;EADgB,CAAA;EAEHP,EAAA,KAAAC;EAAAD,EAAA,KAAAQ;EAAAR,EAAA,MAAAhB;EAAAgB,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAO;EAAAP,EAAA,MAAAU;EAAAV,EAAA,MAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAFXY;AAEW"}
@@ -1,13 +1,13 @@
1
1
  "use client";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
4
+ import { useContext } from "react";
5
+ import { CalendarCell, RangeCalendar as RangeCalendar$1, RangeCalendarStateContext } from "react-aria-components";
3
6
  import { CalendarFrame, CalendarMonths } from "../../calendar/index.js";
4
7
  import { calendarStyles, dateLayers } from "../../calendar/styles.js";
5
8
  import { focus } from "../../styles/focus.js";
6
9
  import { mergeStatefulStyles } from "../../styles/merge.js";
7
- import { c } from "react/compiler-runtime";
8
- import { useContext } from "react";
9
10
  import { jsx } from "react/jsx-runtime";
10
- import { CalendarCell, RangeCalendar as RangeCalendar$1, RangeCalendarStateContext } from "react-aria-components";
11
11
  // src/components/range-calendar/index.tsx
12
12
  function cellClassName(state, isInRange) {
13
13
  const isEnd = state.isSelected && (state.isSelectionStart || state.isSelectionEnd);
@@ -1,14 +1,14 @@
1
1
  "use client";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
4
+ import { FieldInputContext, Label, SearchField as SearchField$1, VisuallyHidden, useSlottedContext } from "react-aria-components";
3
5
  import { FieldInput, FieldMessage } from "../../field/index.js";
4
6
  import { focusesControl } from "../../field/press.js";
5
7
  import { fieldStyles, invalidFrom, useFieldValidationBehavior } from "../../field/root.js";
6
8
  import { CloseGlyph, SearchGlyph } from "../../glyphs/index.js";
7
9
  import { mergeStatefulStyles } from "../../styles/merge.js";
8
10
  import IconButton from "../icon-button/index.js";
9
- import { c } from "react/compiler-runtime";
10
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- import { FieldInputContext, Label, SearchField as SearchField$1, VisuallyHidden, useSlottedContext } from "react-aria-components";
12
12
  // src/components/search-field/index.tsx
13
13
  function fieldContent(label, placeholder, clearLabel, description, error, inputRef) {
14
14
  return (state) => /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -16,10 +16,10 @@ function fieldContent(label, placeholder, clearLabel, description, error, inputR
16
16
  /* @__PURE__ */ jsxs("div", {
17
17
  onPointerDown: focusesControl(void 0),
18
18
  ...{
19
- 0: { className: "x12w9bfk x6s0dn4 x5u4zhu x17m4uoy xuwmtp3 xmaqtb8 x9qvdww x42wrt3 xvkjz1l xs1ryiz x1ylmb6m x1dkaolv xx61lck x13rsnn2 x19i8hm1 x1gnnqk1 x9f619 x1w5n3ug x1ed109x x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1jrff4x x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7" },
20
- 2: { className: "x12w9bfk x6s0dn4 x5u4zhu x17m4uoy xuwmtp3 xmaqtb8 x9qvdww x42wrt3 xvkjz1l xs1ryiz x1ylmb6m x1dkaolv xx61lck x13rsnn2 x9f619 x1w5n3ug x1ed109x x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1jrff4x x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 x1bll8u6 x19irva8" },
21
- 1: { className: "x12w9bfk x6s0dn4 xs1ryiz x1dkaolv xx61lck x13rsnn2 x9f619 x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1jrff4x x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 xepofeg xmnqt3w x1gnnqk1 x1xj74d8 x1bhcspo x1h6gzvc" },
22
- 3: { className: "x12w9bfk x6s0dn4 xs1ryiz x1dkaolv xx61lck x13rsnn2 x9f619 x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1jrff4x x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 xepofeg xmnqt3w x1gnnqk1 x1xj74d8 x1bhcspo x1h6gzvc" }
19
+ 0: { className: "x12w9bfk x6s0dn4 x5u4zhu x17m4uoy xuwmtp3 xmaqtb8 x9qvdww x42wrt3 xvkjz1l xs1ryiz x1ylmb6m x1dkaolv xx61lck x13rsnn2 x19i8hm1 x1gnnqk1 x9f619 x1w5n3ug x1ed109x x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1nrpzel x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7" },
20
+ 2: { className: "x12w9bfk x6s0dn4 x5u4zhu x17m4uoy xuwmtp3 xmaqtb8 x9qvdww x42wrt3 xvkjz1l xs1ryiz x1ylmb6m x1dkaolv xx61lck x13rsnn2 x9f619 x1w5n3ug x1ed109x x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1nrpzel x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 x1bll8u6 x19irva8" },
21
+ 1: { className: "x12w9bfk x6s0dn4 xs1ryiz x1dkaolv xx61lck x13rsnn2 x9f619 x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1nrpzel x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 xepofeg xmnqt3w x1gnnqk1 x1xj74d8 x1bhcspo x1h6gzvc" },
22
+ 3: { className: "x12w9bfk x6s0dn4 xs1ryiz x1dkaolv xx61lck x13rsnn2 x9f619 x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1nrpzel x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 xepofeg xmnqt3w x1gnnqk1 x1xj74d8 x1bhcspo x1h6gzvc" }
23
23
  }[!!state.isInvalid << 1 | !!state.isDisabled << 0],
24
24
  children: [
25
25
  /* @__PURE__ */ jsx(SearchGlyph, { ...{
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","stylex","FieldInputContext","SearchField","RACSearchField","useSlottedContext","focusesControl","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","clearLabel","description","enterKeyHint","error","inputRef","label","placeholder","fieldContent","state","undefined","className","isInvalid","isDisabled","isEmpty","t0","$","t1","props","validationBehavior","inherited","T0","t2","t3","t4","root","t5","t6"],"sources":["../../../src/components/search-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { Ref, RefAttributes } from 'react';\nimport type { SearchFieldProps as RACSearchFieldProps, SearchFieldRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { FieldInputContext, Label, SearchField as RACSearchField, useSlottedContext, VisuallyHidden } from 'react-aria-components';\nimport { FieldInput, FieldMessage } from '../../field';\nimport { focusesControl } from '../../field/press';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CloseGlyph, SearchGlyph } from '../../glyphs';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, spacing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\nimport IconButton from '../icon-button';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// A pointer that can hover: a mouse or a trackpad, not a finger. The bar is a\n// plain element around the input rather than a part React Aria hosts, so its\n// hover layer is a pseudo-class, and Chromium leaves `:hover` on whatever a\n// touch last tapped. Inside this query a touch screen draws no hover at all;\n// a touchscreen laptop still matches it for its trackpad.\nconst HOVER_CAPABLE = '@media (hover: hover)';\n\n// The search page's search bar, on its own: a 56dp container with a full\n// corner on surface container high, a 24dp magnifier in on surface at the\n// start, the supporting text in on surface variant and the input text in on\n// surface, both body-large, and a trailing icon button in on surface\n// variant that clears the field while it holds anything. The page's\n// 16dp of padding is to a 48dp tap target, and the icon sits 12dp inside\n// that, so the magnifier starts 28dp in and the text 4dp past the target,\n// at 68dp; the clear button is the medium icon button, 40dp around a 24dp\n// icon, set 4dp in from the padding so its icon ends 28dp from the end. The\n// container follows its own width up to the page's 720dp; the page's 360dp\n// floor is left to the call site, since a phone's width less its margins is\n// under it. The list of suggestions the page draws under the bar is\n// Autocomplete's, and nothing here.\n//\n// The page gives the container level 3 elevation, and the bar casts no\n// shadow for it. Surface container high is the tone that level stands for,\n// and Google's own search bars draw it so: Compose's defaults give the bar\n// a shadow elevation of level 0, and the Android library keeps its 6dp but\n// makes the shadow transparent. The docked SearchView, which floats over\n// the page, is what casts level 3.\n//\n// The page's hovered and pressed states are on surface state layers over\n// the container, at the opacities the tokens hold. It names a focused state\n// and draws nothing for it, so the bar takes the 2dp primary ring the text\n// fields page gives a focused field, drawn inside the pill as a shadow for\n// the reason the chrome's box draws its underline that way: a shadow\n// changes nothing about the bar's size, and clipped to the corner it stays\n// inside the pill. It shows on any focus, as the underline does; a text\n// control matches `:focus-visible` on every focus anyway. Disabled takes\n// the chrome's dimmed container and content, since the page has no disabled\n// state and the sibling fields already agree on one.\n//\n// React Aria's `SearchField` is the root, a div holding the label,\n// description and error slots and the clear button's context; the bar is\n// its own element around the field chrome's input, and the label is\n// visually hidden, since the bar carries no label of its own and the\n// supporting text is what a person reads.\n\ntype SearchFieldProps = {\n /**\n * The name of the button that clears the field, for a screen reader.\n * Left out, React Aria names it in the reader's locale — \"Clear search\" in\n * English.\n */\n clearLabel?: string;\n /**\n * A hint shown under the bar. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The action an on-screen keyboard labels its Enter key with. A search\n * field asks for Search, which iOS otherwise shows only for a search input\n * inside a form with an action, so a field submitted through `onSubmit`\n * alone gets it too. Inside an `Autocomplete` the field takes the Go key\n * React Aria gives it there, for the option Enter picks.\n *\n * @default 'search'\n */\n enterKeyHint?: RACSearchFieldProps['enterKeyHint'];\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message and `aria-invalid` follow\n * from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * What the field searches, for a screen reader. The bar draws no label,\n * so this is read and never shown; `placeholder` is what is seen.\n *\n * Write it so it contains the placeholder's words — `Search` beside a\n * `Search` placeholder, or `Search people`. The placeholder is the only\n * text a sighted reader has to call the field by, so it is what someone\n * driving the page by voice says, and a name that does not contain it\n * leaves them nothing to say.\n */\n label: string;\n /** The supporting text in the empty bar, which is what a person reads. */\n placeholder?: string;\n} & Omit<RACSearchFieldProps, 'children' | 'enterKeyHint' | 'isInvalid' | 'validationBehavior'>;\n\n// What the bar draws, from the field's render state: the clear button only\n// while the field holds something, and the error ring while it is invalid. Built by a call rather than written\n// inline at the prop, which is what react-perf's no-new-function-as-prop is\n// after; the React Compiler memoises the result on its inputs.\n//\n// A press anywhere on the bar focuses the input, as a press anywhere on the\n// box of every other field does. The bar is 56dp and the input's line 24dp\n// of it, so the magnifier, the padding at either end and the strips above\n// and below the text took a press, darkened the bar for it, and focused\n// nothing. A press on the input itself or on the clear button is left to\n// them, and a disabled field takes none.\nfunction fieldContent(label: string, placeholder: string | undefined, clearLabel: string | undefined, description: string | undefined, error: string | undefined, inputRef: Ref<HTMLInputElement> | undefined) {\n return (state: SearchFieldRenderProps) => <>\n <VisuallyHidden>\n <Label>{label}</Label>\n </VisuallyHidden>\n <div onPointerDown={focusesControl(undefined)} {...{\n 0: {\n className: \"x12w9bfk x6s0dn4 x5u4zhu x17m4uoy xuwmtp3 xmaqtb8 x9qvdww x42wrt3 xvkjz1l xs1ryiz x1ylmb6m x1dkaolv xx61lck x13rsnn2 x19i8hm1 x1gnnqk1 x9f619 x1w5n3ug x1ed109x x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1jrff4x x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7\"\n },\n 2: {\n className: \"x12w9bfk x6s0dn4 x5u4zhu x17m4uoy xuwmtp3 xmaqtb8 x9qvdww x42wrt3 xvkjz1l xs1ryiz x1ylmb6m x1dkaolv xx61lck x13rsnn2 x9f619 x1w5n3ug x1ed109x x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1jrff4x x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 x1bll8u6 x19irva8\"\n },\n 1: {\n className: \"x12w9bfk x6s0dn4 xs1ryiz x1dkaolv xx61lck x13rsnn2 x9f619 x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1jrff4x x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 xepofeg xmnqt3w x1gnnqk1 x1xj74d8 x1bhcspo x1h6gzvc\"\n },\n 3: {\n className: \"x12w9bfk x6s0dn4 xs1ryiz x1dkaolv xx61lck x13rsnn2 x9f619 x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1jrff4x x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 xepofeg xmnqt3w x1gnnqk1 x1xj74d8 x1bhcspo x1h6gzvc\"\n }\n }[!!state.isInvalid << 1 | !!state.isDisabled << 0]}>\n <SearchGlyph {...{\n 0: {\n className: \"xxk0z11 x139gbkf x1lliihq x2lah0s xvy4d1p\"\n },\n 1: {\n className: \"xxk0z11 x1lliihq x2lah0s xvy4d1p x1heor9g\"\n }\n }[!!state.isDisabled << 0]} />\n <FieldInput placeholder={placeholder} ref={inputRef} className=\"x1hcrkkg xzwh6sb xjyslct xmper1u x1iyjqo2 xeuugli\" />\n {state.isEmpty ? null : <IconButton aria-label={clearLabel} className=\"x15ir4sr\">\n <CloseGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />\n </IconButton>}\n </div>\n <FieldMessage description={description} error={error} />\n </>;\n}\n\n/**\n * A search bar: a keyword typed into a pill, submitted with Enter and\n * cleared with Escape or its button. Its value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue` to let it keep\n * its own; `onSubmit` is handed the value on Enter and `onClear` is called\n * when it is emptied.\n *\n * ```tsx\n * <SearchField label=\"Search\" onSubmit={search} placeholder=\"Search\" />\n * ```\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions. The input and the message are\n * drawn as every field in the library draws them; the pill around them is\n * Material Design's search bar rather than the box of its text fields.\n */\nfunction SearchField({\n clearLabel,\n description,\n enterKeyHint,\n error,\n inputRef,\n isDisabled = false,\n label,\n placeholder,\n ...props\n}: RefAttributes<HTMLDivElement> & SearchFieldProps) {\n const validationBehavior = useFieldValidationBehavior();\n // An Autocomplete hands its input `go` through this context, and a prop\n // written here would replace it, so the default steps aside for it; an\n // undefined prop leaves the context's value standing.\n const inherited = useSlottedContext(FieldInputContext)?.enterKeyHint;\n return <RACSearchField enterKeyHint={enterKeyHint ?? (inherited === undefined ? 'search' : undefined)} isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n {fieldContent(label, placeholder, clearLabel, description, error, inputRef)}\n </RACSearchField>;\n}\nexport type { SearchFieldProps };\nexport default SearchField;"],"mappings":";;;;;;;;;;;;AAiIA,SAASkB,aAAaF,OAAeC,aAAiCN,YAAgCC,aAAiCE,OAA2BC,UAA6C;CAC7M,QAAQI,UAAkC,qBAA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;EAAqCmB,KAAAzB,YAAYM,KAAK;EAACY,EAAA,KAAAZ;EAAAY,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAyD,MAAAQ,KAAAxB,oBAAoBT,MAAaM,YAAW4B,IAAK,GAAGP,OAAK;CAAC,IAAAQ;CAAA,IAAAV,EAAA,OAAAf,cAAAe,EAAA,OAAAd,eAAAc,EAAA,OAAAZ,SAAAY,EAAA,OAAAX,YAAAW,EAAA,OAAAV,SAAAU,EAAA,OAAAT,aAAA;EAC1QmB,KAAAlB,aAAaF,OAAOC,aAAaN,YAAYC,aAAaE,OAAOC,QAAQ;EAACW,EAAA,KAAAf;EAAAe,EAAA,KAAAd;EAAAc,EAAA,KAAAZ;EAAAY,EAAA,KAAAX;EAAAW,EAAA,KAAAV;EAAAU,EAAA,KAAAT;EAAAS,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,OAAAK,MAAAL,EAAA,QAAAH,cAAAG,EAAA,QAAAE,WAAAF,EAAA,QAAAM,MAAAN,EAAA,QAAAO,MAAAP,EAAA,QAAAQ,MAAAR,EAAA,QAAAU,MAAAV,EAAA,QAAAG,oBAAA;EADxEQ,KAAA,oBAAC,IAAD;GAA8B,cAAAL;GAA8ET;GAAuB,WAAAU;GAAwCJ;GAAkB,GAAMD;GAAK,GAAMM;GAChNE,UAAAA;EADiB,CAAA;EAEHV,EAAA,KAAAK;EAAAL,EAAA,MAAAH;EAAAG,EAAA,MAAAE;EAAAF,EAAA,MAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;EAAAR,EAAA,MAAAU;EAAAV,EAAA,MAAAG;EAAAH,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAFZW;AAEY"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","FieldInputContext","SearchField","RACSearchField","useSlottedContext","focusesControl","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","clearLabel","description","enterKeyHint","error","inputRef","label","placeholder","fieldContent","state","undefined","className","isInvalid","isDisabled","isEmpty","t0","$","t1","props","validationBehavior","inherited","T0","t2","t3","t4","root","t5","t6"],"sources":["../../../src/components/search-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { Ref, RefAttributes } from 'react';\nimport type { SearchFieldProps as RACSearchFieldProps, SearchFieldRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { FieldInputContext, Label, SearchField as RACSearchField, useSlottedContext, VisuallyHidden } from 'react-aria-components';\nimport { FieldInput, FieldMessage } from '../../field';\nimport { focusesControl } from '../../field/press';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CloseGlyph, SearchGlyph } from '../../glyphs';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, spacing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\nimport IconButton from '../icon-button';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// A pointer that can hover: a mouse or a trackpad, not a finger. The bar is a\n// plain element around the input rather than a part React Aria hosts, so its\n// hover layer is a pseudo-class, and Chromium leaves `:hover` on whatever a\n// touch last tapped. Inside this query a touch screen draws no hover at all;\n// a touchscreen laptop still matches it for its trackpad.\nconst HOVER_CAPABLE = '@media (hover: hover)';\n\n// The search page's search bar, on its own: a 56dp container with a full\n// corner on surface container high, a 24dp magnifier in on surface at the\n// start, the supporting text in on surface variant and the input text in on\n// surface, both body-large, and a trailing icon button in on surface\n// variant that clears the field while it holds anything. The page's\n// 16dp of padding is to a 48dp tap target, and the icon sits 12dp inside\n// that, so the magnifier starts 28dp in and the text 4dp past the target,\n// at 68dp; the clear button is the medium icon button, 40dp around a 24dp\n// icon, set 4dp in from the padding so its icon ends 28dp from the end. The\n// container follows its own width up to the page's 720dp; the page's 360dp\n// floor is left to the call site, since a phone's width less its margins is\n// under it. The list of suggestions the page draws under the bar is\n// Autocomplete's, and nothing here.\n//\n// The page gives the container level 3 elevation, and the bar casts no\n// shadow for it. Surface container high is the tone that level stands for,\n// and Google's own search bars draw it so: Compose's defaults give the bar\n// a shadow elevation of level 0, and the Android library keeps its 6dp but\n// makes the shadow transparent. The docked SearchView, which floats over\n// the page, is what casts level 3.\n//\n// The page's hovered and pressed states are on surface state layers over\n// the container, at the opacities the tokens hold. It names a focused state\n// and draws nothing for it, so the bar takes the 2dp primary ring the text\n// fields page gives a focused field, drawn inside the pill as a shadow for\n// the reason the chrome's box draws its underline that way: a shadow\n// changes nothing about the bar's size, and clipped to the corner it stays\n// inside the pill. It shows on any focus, as the underline does; a text\n// control matches `:focus-visible` on every focus anyway. Disabled takes\n// the chrome's dimmed container and content, since the page has no disabled\n// state and the sibling fields already agree on one.\n//\n// React Aria's `SearchField` is the root, a div holding the label,\n// description and error slots and the clear button's context; the bar is\n// its own element around the field chrome's input, and the label is\n// visually hidden, since the bar carries no label of its own and the\n// supporting text is what a person reads.\n\ntype SearchFieldProps = {\n /**\n * The name of the button that clears the field, for a screen reader.\n * Left out, React Aria names it in the reader's locale — \"Clear search\" in\n * English.\n */\n clearLabel?: string;\n /**\n * A hint shown under the bar. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The action an on-screen keyboard labels its Enter key with. A search\n * field asks for Search, which iOS otherwise shows only for a search input\n * inside a form with an action, so a field submitted through `onSubmit`\n * alone gets it too. Inside an `Autocomplete` the field takes the Go key\n * React Aria gives it there, for the option Enter picks.\n *\n * @default 'search'\n */\n enterKeyHint?: RACSearchFieldProps['enterKeyHint'];\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message and `aria-invalid` follow\n * from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * What the field searches, for a screen reader. The bar draws no label,\n * so this is read and never shown; `placeholder` is what is seen.\n *\n * Write it so it contains the placeholder's words — `Search` beside a\n * `Search` placeholder, or `Search people`. The placeholder is the only\n * text a sighted reader has to call the field by, so it is what someone\n * driving the page by voice says, and a name that does not contain it\n * leaves them nothing to say.\n */\n label: string;\n /** The supporting text in the empty bar, which is what a person reads. */\n placeholder?: string;\n} & Omit<RACSearchFieldProps, 'children' | 'enterKeyHint' | 'isInvalid' | 'validationBehavior'>;\n\n// What the bar draws, from the field's render state: the clear button only\n// while the field holds something, and the error ring while it is invalid. Built by a call rather than written\n// inline at the prop, which is what react-perf's no-new-function-as-prop is\n// after; the React Compiler memoises the result on its inputs.\n//\n// A press anywhere on the bar focuses the input, as a press anywhere on the\n// box of every other field does. The bar is 56dp and the input's line 24dp\n// of it, so the magnifier, the padding at either end and the strips above\n// and below the text took a press, darkened the bar for it, and focused\n// nothing. A press on the input itself or on the clear button is left to\n// them, and a disabled field takes none.\nfunction fieldContent(label: string, placeholder: string | undefined, clearLabel: string | undefined, description: string | undefined, error: string | undefined, inputRef: Ref<HTMLInputElement> | undefined) {\n return (state: SearchFieldRenderProps) => <>\n <VisuallyHidden>\n <Label>{label}</Label>\n </VisuallyHidden>\n <div onPointerDown={focusesControl(undefined)} {...{\n 0: {\n className: \"x12w9bfk x6s0dn4 x5u4zhu x17m4uoy xuwmtp3 xmaqtb8 x9qvdww x42wrt3 xvkjz1l xs1ryiz x1ylmb6m x1dkaolv xx61lck x13rsnn2 x19i8hm1 x1gnnqk1 x9f619 x1w5n3ug x1ed109x x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1nrpzel x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7\"\n },\n 2: {\n className: \"x12w9bfk x6s0dn4 x5u4zhu x17m4uoy xuwmtp3 xmaqtb8 x9qvdww x42wrt3 xvkjz1l xs1ryiz x1ylmb6m x1dkaolv xx61lck x13rsnn2 x9f619 x1w5n3ug x1ed109x x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1nrpzel x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 x1bll8u6 x19irva8\"\n },\n 1: {\n className: \"x12w9bfk x6s0dn4 xs1ryiz x1dkaolv xx61lck x13rsnn2 x9f619 x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1nrpzel x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 xepofeg xmnqt3w x1gnnqk1 x1xj74d8 x1bhcspo x1h6gzvc\"\n },\n 3: {\n className: \"x12w9bfk x6s0dn4 xs1ryiz x1dkaolv xx61lck x13rsnn2 x9f619 x78zum5 xxj4525 xh8yej3 xwnkcuf x1x84bn5 x12iqurn xi9ts3s x1nrpzel x1glmgrm xtrd051 x1qno0dh x106061f xpc4ca7 xepofeg xmnqt3w x1gnnqk1 x1xj74d8 x1bhcspo x1h6gzvc\"\n }\n }[!!state.isInvalid << 1 | !!state.isDisabled << 0]}>\n <SearchGlyph {...{\n 0: {\n className: \"xxk0z11 x139gbkf x1lliihq x2lah0s xvy4d1p\"\n },\n 1: {\n className: \"xxk0z11 x1lliihq x2lah0s xvy4d1p x1heor9g\"\n }\n }[!!state.isDisabled << 0]} />\n <FieldInput placeholder={placeholder} ref={inputRef} className=\"x1hcrkkg xzwh6sb xjyslct xmper1u x1iyjqo2 xeuugli\" />\n {state.isEmpty ? null : <IconButton aria-label={clearLabel} className=\"x15ir4sr\">\n <CloseGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />\n </IconButton>}\n </div>\n <FieldMessage description={description} error={error} />\n </>;\n}\n\n/**\n * A search bar: a keyword typed into a pill, submitted with Enter and\n * cleared with Escape or its button. Its value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue` to let it keep\n * its own; `onSubmit` is handed the value on Enter and `onClear` is called\n * when it is emptied.\n *\n * ```tsx\n * <SearchField label=\"Search\" onSubmit={search} placeholder=\"Search\" />\n * ```\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions. The input and the message are\n * drawn as every field in the library draws them; the pill around them is\n * Material Design's search bar rather than the box of its text fields.\n */\nfunction SearchField({\n clearLabel,\n description,\n enterKeyHint,\n error,\n inputRef,\n isDisabled = false,\n label,\n placeholder,\n ...props\n}: RefAttributes<HTMLDivElement> & SearchFieldProps) {\n const validationBehavior = useFieldValidationBehavior();\n // An Autocomplete hands its input `go` through this context, and a prop\n // written here would replace it, so the default steps aside for it; an\n // undefined prop leaves the context's value standing.\n const inherited = useSlottedContext(FieldInputContext)?.enterKeyHint;\n return <RACSearchField enterKeyHint={enterKeyHint ?? (inherited === undefined ? 'search' : undefined)} isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n {fieldContent(label, placeholder, clearLabel, description, error, inputRef)}\n </RACSearchField>;\n}\nexport type { SearchFieldProps };\nexport default SearchField;"],"mappings":";;;;;;;;;;;;AAiIA,SAASkB,aAAaF,OAAeC,aAAiCN,YAAgCC,aAAiCE,OAA2BC,UAA6C;CAC7M,QAAQI,UAAkC,qBAAA,UAAA,EAAA,UAAA;EACtC,oBAAC,gBAAD,EAAA,UACE,oBAAC,OAAD,EAAA,UAAQH,MAAa,CAAA,EACP,CAAA;EAChB,qBAAC,OAAD;GAAK,eAAeV,eAAec,KAAAA,CAAS;GAAG,GAAI;IACnD,GAAG,EACDC,WAAW,gRACb;IACA,GAAG,EACDA,WAAW,gRACb;IACA,GAAG,EACDA,WAAW,8NACb;IACA,GAAG,EACDA,WAAW,8NACb;GACF,EAAE,CAAC,CAACF,MAAMG,aAAa,IA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AC1QmB,KAAAlB,aAAaF,OAAOC,aAAaN,YAAYC,aAAaE,OAAOC,QAAQ;EAACW,EAAA,KAAAf;EAAAe,EAAA,KAAAd;EAAAc,EAAA,KAAAZ;EAAAY,EAAA,KAAAX;EAAAW,EAAA,KAAAV;EAAAU,EAAA,KAAAT;EAAAS,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,OAAAK,MAAAL,EAAA,QAAAH,cAAAG,EAAA,QAAAE,WAAAF,EAAA,QAAAM,MAAAN,EAAA,QAAAO,MAAAP,EAAA,QAAAQ,MAAAR,EAAA,QAAAU,MAAAV,EAAA,QAAAG,oBAAA;EADxEQ,KAAA,oBAAC,IAAD;GAA8B,cAAAL;GAA8ET;GAAuB,WAAAU;GAAwCJ;GAAkB,GAAMD;GAAK,GAAMM;GAChNE,UAAAA;EADiB,CAAA;EAEHV,EAAA,KAAAK;EAAAL,EAAA,MAAAH;EAAAG,EAAA,MAAAE;EAAAF,EAAA,MAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;EAAAR,EAAA,MAAAU;EAAAV,EAAA,MAAAG;EAAAH,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAFZW;AAEY"}
@@ -1,6 +1,6 @@
1
- import { AutocompleteProps as AutocompleteProps$1 } from "../autocomplete/index.js";
2
1
  import { ReactNode, RefAttributes } from "react";
3
2
  import { ClassNameOrFunction, DialogTriggerProps, PopoverRenderProps, StyleOrFunction } from "react-aria-components";
3
+ import { AutocompleteProps as AutocompleteProps$1 } from "../autocomplete/index.js";
4
4
  type SearchViewContentProps<T extends object = object> = {
5
5
  /**
6
6
  * What the back button is called, for a screen reader. Left out, the
@@ -1,5 +1,7 @@
1
1
  "use client";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
4
+ import { Dialog, DialogTrigger, Label, Popover, SearchField, VisuallyHidden } from "react-aria-components";
3
5
  import { FieldInput } from "../../field/index.js";
4
6
  import { ArrowBackGlyph, CloseGlyph } from "../../glyphs/index.js";
5
7
  import { useMessages } from "../../i18n/index.js";
@@ -7,9 +9,7 @@ import { mergeStatefulStyles } from "../../styles/merge.js";
7
9
  import { overlay } from "../../styles/overlay.js";
8
10
  import Autocomplete$1 from "../autocomplete/index.js";
9
11
  import IconButton from "../icon-button/index.js";
10
- import { c } from "react/compiler-runtime";
11
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
- import { Dialog, DialogTrigger, Label, Popover, SearchField, VisuallyHidden } from "react-aria-components";
13
13
  // src/components/search-view/index.tsx
14
14
  const SIDE_OFFSET = 8;
15
15
  const styles = { view: {
@@ -1,6 +1,6 @@
1
- import { LabelledByAttribute } from "../../render/name.js";
2
1
  import { ReactNode, RefAttributes } from "react";
3
2
  import { Key, ToggleButtonGroupProps, ToggleButtonProps } from "react-aria-components";
3
+ import { LabelledByAttribute } from "../../render/name.js";
4
4
  type SegmentedButtonProps = LabelledByAttribute & Omit<ToggleButtonGroupProps, 'className' | 'disallowEmptySelection' | 'orientation' | 'style'> & {
5
5
  /** A function may compute the class from the set's render state. */
6
6
  className?: ToggleButtonGroupProps['className'];
@@ -1,5 +1,8 @@
1
1
  "use client";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
4
+ import { createContext, useContext, useEffect, useLayoutEffect, useState } from "react";
5
+ import { SelectionIndicator, ToggleButton, ToggleButtonGroup } from "react-aria-components";
3
6
  import { CheckGlyph } from "../../glyphs/index.js";
4
7
  import { useRipple } from "../../hooks/useRipple.js";
5
8
  import { useToggleGroupDisabled } from "../../hooks/useToggleGroupDisabled.js";
@@ -8,10 +11,7 @@ import { focus } from "../../styles/focus.js";
8
11
  import { mergeStatefulStyles } from "../../styles/merge.js";
9
12
  import { toggleGroupRenderer, useRadioItem } from "../../toggle-group/index.js";
10
13
  import { spacing } from "../../tokens/design.tokens.stylex.js";
11
- import { c } from "react/compiler-runtime";
12
- import { createContext, useContext, useEffect, useLayoutEffect, useState } from "react";
13
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
- import { SelectionIndicator, ToggleButton, ToggleButtonGroup } from "react-aria-components";
15
15
  // src/components/segmented-button/index.tsx
16
16
  const ShowSelectedIconContext = createContext(true);
17
17
  const SelectionModeContext = createContext("single");
@@ -1,6 +1,6 @@
1
- import { FieldVariant } from "../../field/index.js";
2
1
  import { ReactNode, RefAttributes } from "react";
3
2
  import { SelectProps as SelectProps$1 } from "react-aria-components";
3
+ import { FieldVariant } from "../../field/index.js";
4
4
  type SelectProps<T extends object = object> = {
5
5
  /**
6
6
  * Where to portal the list. Defaults to the container of the `ThemeScope`
@@ -1,5 +1,9 @@
1
1
  "use client";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
4
+ import { useContext, useRef } from "react";
5
+ import { Popover, Select as Select$1, SelectStateContext, SelectValue } from "react-aria-components";
6
+ import { OptionRowContext } from "../../collection/context.js";
3
7
  import { FieldBox, FieldMessage, FieldTrigger, FieldValue } from "../../field/index.js";
4
8
  import { fieldStyles, invalidFrom, useFieldValidationBehavior } from "../../field/root.js";
5
9
  import { ChevronEndGlyph } from "../../glyphs/index.js";
@@ -7,10 +11,7 @@ import { RowOnValueLineContext } from "../../row/context.js";
7
11
  import { mergeStatefulStyles } from "../../styles/merge.js";
8
12
  import { overlay, popupOrigin } from "../../styles/overlay.js";
9
13
  import ListBox$1 from "../list-box/index.js";
10
- import { c } from "react/compiler-runtime";
11
- import { useContext, useRef } from "react";
12
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
- import { Popover, Select as Select$1, SelectStateContext, SelectValue } from "react-aria-components";
14
15
  // src/components/select/index.tsx
15
16
  const TRIGGER = /* @__PURE__ */ jsx(FieldTrigger, {});
16
17
  function chevronFor(isOpen) {
@@ -132,7 +133,10 @@ function selectContent(label, leadingIcon, floatingLabel, variant, description,
132
133
  className: listClassName,
133
134
  triggerRef: boxRef,
134
135
  UNSTABLE_portalContainer: container,
135
- children: /* @__PURE__ */ jsx(ListBox$1, { children: options })
136
+ children: /* @__PURE__ */ jsx(OptionRowContext, {
137
+ value: "menu",
138
+ children: /* @__PURE__ */ jsx(ListBox$1, { children: options })
139
+ })
136
140
  })
137
141
  ] });
138
142
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","stylex","useContext","useRef","Select","RACSelect","SelectStateContext","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","overlay","popupOrigin","TRIGGER","chevronFor","isOpen","className","listClassName","state","props","popup","styles","list","placement","kWkggS","kaIpWk","kzqmXN","kskxy","ks0D6T","k7Eaqz","kORKVm","$$css","container","description","error","floatingLabel","label","leadingIcon","options","variant","t0","$","t1","isDisabled","t2","t3","undefined","validationBehavior","boxRef","T0","t4","t5","root","t6","selectContent","t7","isInvalid","isRequired","isFocused","SelectedValue","isPlaceholder","selectionManager","selectedKeys","size","Symbol","for","RACPopover","ListBox","RACSelectValue"],"sources":["../../../src/components/select/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes, RefObject } from 'react';\nimport type { PopoverRenderProps, SelectProps as RACSelectProps, SelectRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext, useRef } from 'react';\nimport { Popover as RACPopover, Select as RACSelect, SelectValue as RACSelectValue, SelectStateContext } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldTrigger, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { RowOnValueLineContext } from '../../row/context';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii } from '../../tokens/design.tokens.stylex';\nimport ListBox from '../list-box';\n\n// The menus page's exposed dropdown menu: a text field that opens a list\n// rather than taking a keystroke. Everything above the list is the field\n// chrome in `src/field` — the same box, label, supporting line and error\n// treatment every other field draws — and the list is ListBox on the shared\n// overlay surface. What is here is React Aria's `Select` around the two, and\n// the three things that are this component's own.\n//\n// **The whole box opens the list.** The chrome's `FieldTrigger` covers the\n// box rather than sitting on the value's line, so the padding, the label and\n// the icons all open it, which is what the page draws and what a native\n// select does. It draws nothing itself: the box already carries the fill,\n// the underline and the focus indicator.\n//\n// **The chevron turns.** The page's trailing icon points down while the list\n// is closed and up while it is open. React Aria reports which through the\n// select's render state, so it is drawn from that rather than swapped for a\n// second glyph.\n//\n// **The list is the field's width.** The page draws it under the field and\n// as wide as it, which React Aria reports as `--trigger-width` — of whatever\n// it is anchored to. Left alone that is the button, which fills the box's\n// value column rather than the box, so the list came out narrower than the\n// field by the icons either side of it. Pointing the popover's `triggerRef`\n// at the box is what makes the two agree. The overlay's own 112 to 280 range\n// is a menu opened from a button rather than from a field, so it goes.\n//\n// A select's value is chosen rather than typed, which the chrome had no\n// notion of until this component: `useFieldPopulated` now reads the select's\n// own state, so the floating label floats once something is chosen.\n\n// Hoisted, and the chevron built by a call, so neither is a new element on\n// every render — which is what react-perf's jsx-no-jsx-as-prop is after.\nconst TRIGGER = <FieldTrigger />;\nfunction chevronFor(isOpen: boolean) {\n return <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p x1iffjtl xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 x9tu13d\"\n }\n }[!!isOpen << 0]} />;\n}\n\n// The list's classes, from React Aria's render state: it grows from the\n// edge it is anchored by, as every anchored overlay does, so a list that\n// opens above the field grows upward.\nfunction listClassName(state: PopoverRenderProps) {\n return stylex.props(overlay.popup, styles.list, popupOrigin(state.placement)).className ?? '';\n}\nconst styles = {\n list: {\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1tfhd1\",\n kzqmXN: \"xlvufjm\",\n kskxy: \"xedcshv\",\n ks0D6T: \"x1x1rfll\",\n k7Eaqz: \"xeuugli\",\n kORKVm: \"x1odjw0f\",\n $$css: true\n }\n};\ntype SelectProps<T extends object = object> = {\n /**\n * Where to portal the list. Defaults to the container of the `ThemeScope`\n * around it, which keeps the list on that scope's tokens, or to the end of\n * `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the list\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or something is chosen. `false` keeps it small at the\n * top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * What the field is for. Required rather than optional: a select with no\n * label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the value: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em` takes\n * that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * The options. `ListBox.Item` for each, and `ListBox.Section` to group\n * them — the list inside is a ListBox, and takes everything one does.\n */\n options?: ReactNode;\n /**\n * The filled box, or the outlined one, as the text fields page draws them.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACSelectProps<T>, 'children' | 'defaultSelectedKey' | 'isInvalid' | 'onSelectionChange' | 'selectedKey' | 'validationBehavior'>;\n\n/**\n * A labelled field that opens a list to choose from. Its value is React\n * Aria's: pass `value` with `onChange` to control it, or `defaultValue` to\n * let it keep its own. The value is an option's `id`, so give every option\n * one. React Aria's older `selectedKey` names are deprecated and are left\n * out of this component's props rather than passed through.\n *\n * ```tsx\n * <Select\n * label=\"Label\"\n * options={\n * <>\n * <ListBox.Item id=\"first\">First item</ListBox.Item>\n * <ListBox.Item id=\"second\">Second item</ListBox.Item>\n * </>\n * }\n * />\n * ```\n *\n * The box, label, supporting line and error are the field chrome in\n * `src/field`, shared with every other field; the list is ListBox on the\n * overlay surface every anchored panel here draws.\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions.\n */\nfunction Select<T extends object = object>({\n container,\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n options,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & SelectProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n // What the list is anchored to and takes its width from — see the note at\n // the top of the file.\n const boxRef = useRef<HTMLDivElement>(null);\n return <RACSelect<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n {selectContent(label, leadingIcon, floatingLabel, variant, description, error, options, container, boxRef)}\n </RACSelect>;\n}\n\n// What the field draws, from React Aria's render state. Built by a call\n// rather than written 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.\n//\n// The state is read for the chevron alone — which way it points — since\n// everything else the box shows it reads from its own focus and validity.\nfunction selectContent(label: string, leadingIcon: ReactNode, floatingLabel: boolean, variant: FieldVariant, description: string | undefined, error: string | undefined, options: ReactNode, container: Element | undefined, boxRef: RefObject<HTMLDivElement | null>) {\n return (state: SelectRenderProps) => <>\n <FieldBox floatingLabel={floatingLabel}\n // React Aria's `TextField` hands its group the field's disabled and\n // invalid state through context; its `Select` does not, so the box is\n // told outright or its label and its underline never turn.\n isDisabled={state.isDisabled}\n // Opening the list moves focus into it, out of the box, so the box\n // is told it is focused while the list is open — otherwise its label\n // fell back onto the placeholder the select still shows.\n isFocused={state.isOpen} isInvalid={state.isInvalid} isRequired={state.isRequired} label={label} leading={leadingIcon} ref={boxRef} trailing={chevronFor(state.isOpen)} trigger={TRIGGER} variant={variant}>\n <SelectedValue isFocused={state.isFocused} />\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover className={listClassName} triggerRef={boxRef}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container}>\n <ListBox>{options}</ListBox>\n </RACPopover>\n </>;\n}\n\n/**\n * What has been chosen, drawn on the value's line. The chrome's `FieldValue`\n * is the styled element and React Aria's `SelectValue` sits inside it, since\n * the wrapper is the box's flex item.\n */\nfunction SelectedValue({\n isFocused\n}: {\n isFocused: boolean;\n}) {\n const state = useContext(SelectStateContext);\n const isPlaceholder = (state?.selectionManager.selectedKeys.size ?? 0) === 0;\n return <FieldValue isFocused={isFocused} isPlaceholder={isPlaceholder}>\n <RowOnValueLineContext value>\n <RACSelectValue className=\"xb3r6kr xlyipyv xuxw1ft\" />\n </RowOnValueLineContext>\n </FieldValue>;\n}\nexport type { SelectProps };\nexport default Select;"],"mappings":";;;;;;;;;;;;;;AAkDA,MAAMa,UAAU,oBAAC,cAAD,CAAa,CAAA;AAC7B,SAASC,WAAWC,QAAiB;CACnC,OAAO,oBAAC,iBAAD,EAAiB,GAAI;EAC1B,GAAG,EACDC,WAAW,6DACb;EACA,GAAG,EACDA,WAAW,4DACb;CACF,EAAE,CAAC,CAACD,UAAU,GAAG,CAAA;AACnB;AAKA,SAASE,cAAcC,OAA2B;CAChD,OAAOjB,MAAaU,QAAQS,OAAOC,OAAOC,MAAMV,YAAYM,MAAMK,SAAS,CAAC,CAAC,CAACP,aAAa;AAC7F;AACA,MAAMK,SAAS,EACbC,MAAM;CACJE,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;;;;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,aAAKC,QAAzC,OAAoD;CAAE,IAAArB;CAAA,IAAAD,EAAA,OAAAuB,OAAAC,IAAA,2BAAA,GAAA;EAEzEvB,KAAA,oBAAC,uBAAD;GAAuB,OAAA;GACrB,UAAA,oBAAC0B,aAAD,EAA0B,WAAA,0BAAyB,CAAA;EAD/B,CAAA;EAEE3B,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAiB,aAAAjB,EAAA,OAAAmB,eAAA;EAHrBhB,KAAA,oBAAC,YAAD;GAAuBc;GAA0BE;GACpDlB,UAAAA;EADc,CAAA;EAIHD,EAAA,KAAAiB;EAAAjB,EAAA,KAAAmB;EAAAnB,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAJRG;AAIQ"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","useContext","useRef","Select","RACSelect","SelectStateContext","fieldStyles","invalidFrom","useFieldValidationBehavior","mergeStatefulStyles","overlay","popupOrigin","TRIGGER","chevronFor","isOpen","className","listClassName","state","props","popup","styles","list","placement","kWkggS","kaIpWk","kzqmXN","kskxy","ks0D6T","k7Eaqz","kORKVm","$$css","container","description","error","floatingLabel","label","leadingIcon","options","variant","t0","$","t1","isDisabled","t2","t3","undefined","validationBehavior","boxRef","T0","t4","t5","root","t6","selectContent","t7","isInvalid","isRequired","isFocused","SelectedValue","isPlaceholder","selectionManager","selectedKeys","size","Symbol","for","RACPopover","ListBox","RACSelectValue"],"sources":["../../../src/components/select/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes, RefObject } from 'react';\nimport type { PopoverRenderProps, SelectProps as RACSelectProps, SelectRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext, useRef } from 'react';\nimport { Popover as RACPopover, Select as RACSelect, SelectValue as RACSelectValue, SelectStateContext } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { OptionRowContext } from '../../collection/context';\nimport { FieldBox, FieldMessage, FieldTrigger, FieldValue } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { RowOnValueLineContext } from '../../row/context';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii } from '../../tokens/design.tokens.stylex';\nimport ListBox from '../list-box';\n\n// The menus page's exposed dropdown menu: a text field that opens a list\n// rather than taking a keystroke. Everything above the list is the field\n// chrome in `src/field` — the same box, label, supporting line and error\n// treatment every other field draws — and the list is ListBox on the shared\n// overlay surface, its options drawn as the menus page's rows: 48dp at the\n// menu's 12dp inset, with the menu's selected container, since Material\n// Design draws an exposed dropdown menu as a menu. `OptionRowContext` around\n// the list is what tells ListBox so. What is here is React Aria's `Select`\n// around the two, and the three things that are this component's own.\n//\n// **The whole box opens the list.** The chrome's `FieldTrigger` covers the\n// box rather than sitting on the value's line, so the padding, the label and\n// the icons all open it, which is what the page draws and what a native\n// select does. It draws nothing itself: the box already carries the fill,\n// the underline and the focus indicator.\n//\n// **The chevron turns.** The page's trailing icon points down while the list\n// is closed and up while it is open. React Aria reports which through the\n// select's render state, so it is drawn from that rather than swapped for a\n// second glyph.\n//\n// **The list is the field's width.** The page draws it under the field and\n// as wide as it, which React Aria reports as `--trigger-width` — of whatever\n// it is anchored to. Left alone that is the button, which fills the box's\n// value column rather than the box, so the list came out narrower than the\n// field by the icons either side of it. Pointing the popover's `triggerRef`\n// at the box is what makes the two agree. The overlay's own 112 to 280 range\n// is a menu opened from a button rather than from a field, so it goes.\n//\n// A select's value is chosen rather than typed, which the chrome had no\n// notion of until this component: `useFieldPopulated` now reads the select's\n// own state, so the floating label floats once something is chosen.\n\n// Hoisted, and the chevron built by a call, so neither is a new element on\n// every render — which is what react-perf's jsx-no-jsx-as-prop is after.\nconst TRIGGER = <FieldTrigger />;\nfunction chevronFor(isOpen: boolean) {\n return <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p x1iffjtl xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 x9tu13d\"\n }\n }[!!isOpen << 0]} />;\n}\n\n// The list's classes, from React Aria's render state: it grows from the\n// edge it is anchored by, as every anchored overlay does, so a list that\n// opens above the field grows upward.\nfunction listClassName(state: PopoverRenderProps) {\n return stylex.props(overlay.popup, styles.list, popupOrigin(state.placement)).className ?? '';\n}\nconst styles = {\n list: {\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1tfhd1\",\n kzqmXN: \"xlvufjm\",\n kskxy: \"xedcshv\",\n ks0D6T: \"x1x1rfll\",\n k7Eaqz: \"xeuugli\",\n kORKVm: \"x1odjw0f\",\n $$css: true\n }\n};\ntype SelectProps<T extends object = object> = {\n /**\n * Where to portal the list. Defaults to the container of the `ThemeScope`\n * around it, which keeps the list on that scope's tokens, or to the end of\n * `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the list\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or something is chosen. `false` keeps it small at the\n * top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * What the field is for. Required rather than optional: a select with no\n * label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * An icon at the start of the box, before the label and the value: the\n * page's 24dp leading icon, in the muted role. An icon drawn in `em` takes\n * that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * The options. `ListBox.Item` for each, and `ListBox.Section` to group\n * them — the list inside is a ListBox, and takes everything one does.\n */\n options?: ReactNode;\n /**\n * The filled box, or the outlined one, as the text fields page draws them.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACSelectProps<T>, 'children' | 'defaultSelectedKey' | 'isInvalid' | 'onSelectionChange' | 'selectedKey' | 'validationBehavior'>;\n\n/**\n * A labelled field that opens a list to choose from. Its value is React\n * Aria's: pass `value` with `onChange` to control it, or `defaultValue` to\n * let it keep its own. The value is an option's `id`, so give every option\n * one. React Aria's older `selectedKey` names are deprecated and are left\n * out of this component's props rather than passed through.\n *\n * ```tsx\n * <Select\n * label=\"Label\"\n * options={\n * <>\n * <ListBox.Item id=\"first\">First item</ListBox.Item>\n * <ListBox.Item id=\"second\">Second item</ListBox.Item>\n * </>\n * }\n * />\n * ```\n *\n * The box, label, supporting line and error are the field chrome in\n * `src/field`, shared with every other field; the list is ListBox on the\n * overlay surface every anchored panel here draws.\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions.\n */\nfunction Select<T extends object = object>({\n container,\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n options,\n variant = 'filled',\n ...props\n}: RefAttributes<HTMLDivElement> & SelectProps<T>) {\n const validationBehavior = useFieldValidationBehavior();\n // What the list is anchored to and takes its width from — see the note at\n // the top of the file.\n const boxRef = useRef<HTMLDivElement>(null);\n return <RACSelect<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n {selectContent(label, leadingIcon, floatingLabel, variant, description, error, options, container, boxRef)}\n </RACSelect>;\n}\n\n// What the field draws, from React Aria's render state. Built by a call\n// rather than written 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.\n//\n// The state is read for the chevron alone — which way it points — since\n// everything else the box shows it reads from its own focus and validity.\nfunction selectContent(label: string, leadingIcon: ReactNode, floatingLabel: boolean, variant: FieldVariant, description: string | undefined, error: string | undefined, options: ReactNode, container: Element | undefined, boxRef: RefObject<HTMLDivElement | null>) {\n return (state: SelectRenderProps) => <>\n <FieldBox floatingLabel={floatingLabel}\n // React Aria's `TextField` hands its group the field's disabled and\n // invalid state through context; its `Select` does not, so the box is\n // told outright or its label and its underline never turn.\n isDisabled={state.isDisabled}\n // Opening the list moves focus into it, out of the box, so the box\n // is told it is focused while the list is open — otherwise its label\n // fell back onto the placeholder the select still shows.\n isFocused={state.isOpen} isInvalid={state.isInvalid} isRequired={state.isRequired} label={label} leading={leadingIcon} ref={boxRef} trailing={chevronFor(state.isOpen)} trigger={TRIGGER} variant={variant}>\n <SelectedValue isFocused={state.isFocused} />\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover className={listClassName} triggerRef={boxRef}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container}>\n <OptionRowContext value=\"menu\">\n <ListBox>{options}</ListBox>\n </OptionRowContext>\n </RACPopover>\n </>;\n}\n\n/**\n * What has been chosen, drawn on the value's line. The chrome's `FieldValue`\n * is the styled element and React Aria's `SelectValue` sits inside it, since\n * the wrapper is the box's flex item.\n */\nfunction SelectedValue({\n isFocused\n}: {\n isFocused: boolean;\n}) {\n const state = useContext(SelectStateContext);\n const isPlaceholder = (state?.selectionManager.selectedKeys.size ?? 0) === 0;\n return <FieldValue isFocused={isFocused} isPlaceholder={isPlaceholder}>\n <RowOnValueLineContext value>\n <RACSelectValue className=\"xb3r6kr xlyipyv xuxw1ft\" />\n </RowOnValueLineContext>\n </FieldValue>;\n}\nexport type { SelectProps };\nexport default Select;"],"mappings":";;;;;;;;;;;;;;;AAsDA,MAAMa,UAAU,oBAAC,cAAD,CAAa,CAAA;AAC7B,SAASC,WAAWC,QAAiB;CACnC,OAAO,oBAAC,iBAAD,EAAiB,GAAI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,CAAA;EAClC,CAAA;EACV,oBAAC,cAAD;GAA2BzB;GAAoBC;EAAM,CAAA;EACrD,oBAACgC,SAAD;GAAY,WAAWjD;GAAe,YAAY+B;GAEpD,0BAA0BhB;GACtB,UAAA,oBAAC,kBAAD;IAAkB,OAAM;IACtB,UAAA,oBAACmC,WAAD,EAAA,UAAU7B,QAAiB,CAAA;GACX,CAAA;EACR,CAAA;CACd,EAAA,CAAA;AACJ;;;;;;AAOA,SAAAqB,cAAAnB,IAAA;CAAA,MAAAC,IAAAzC,EAAA,CAAA;CAAuB,MAAA,EAAA0D,cAAAlB;CAMrB,MAAAoB,iBADc1D,WAAWI,kBACFY,CAAK,EAAA2C,iBAA+BC,aAAKC,QAAzC,OAAoD;CAAE,IAAArB;CAAA,IAAAD,EAAA,OAAAuB,OAAAC,IAAA,2BAAA,GAAA;EAEzEvB,KAAA,oBAAC,uBAAD;GAAuB,OAAA;GACrB,UAAA,oBAAC0B,aAAD,EAA0B,WAAA,0BAAyB,CAAA;EAD/B,CAAA;EAEE3B,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAiB,aAAAjB,EAAA,OAAAmB,eAAA;EAHrBhB,KAAA,oBAAC,YAAD;GAAuBc;GAA0BE;GACpDlB,UAAAA;EADc,CAAA;EAIHD,EAAA,KAAAiB;EAAAjB,EAAA,KAAAmB;EAAAnB,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAJRG;AAIQ"}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
- import { mergeStyles } from "../../styles/merge.js";
4
2
  import { c } from "react/compiler-runtime";
3
+ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
5
4
  import { createElement } from "react";
6
- import { jsx } from "react/jsx-runtime";
7
5
  import { Separator as Separator$1, SeparatorContext, useSlottedContext } from "react-aria-components";
6
+ import { mergeStyles } from "../../styles/merge.js";
7
+ import { jsx } from "react/jsx-runtime";
8
8
  // src/components/separator/index.tsx
9
9
  const styles = {
10
10
  base: {
@@ -1,5 +1,8 @@
1
1
  "use client";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
4
+ import { createContext, useContext, useLayoutEffect, useRef, useSyncExternalStore } from "react";
5
+ import { Button, Heading, HeadingContext, OverlayTriggerStateContext, Sheet as Sheet$1, SheetBackdrop, SheetContent as SheetContent$1, SheetOverlay, SheetTrigger, useSlottedContext } from "react-aria-components";
3
6
  import { useHoldBottomEdge } from "../../hooks/useBottomEdge.js";
4
7
  import { useScrollStop } from "../../hooks/useScrollStop.js";
5
8
  import { useMessages } from "../../i18n/index.js";
@@ -7,10 +10,7 @@ import { OverlayScope } from "../../overlay/index.js";
7
10
  import { mergeRefs } from "../../render/ref.js";
8
11
  import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
9
12
  import { overlay } from "../../styles/overlay.js";
10
- import { c } from "react/compiler-runtime";
11
- import { createContext, useContext, useLayoutEffect, useRef, useSyncExternalStore } from "react";
12
13
  import { jsx, jsxs } from "react/jsx-runtime";
13
- import { Button, Heading, HeadingContext, OverlayTriggerStateContext, Sheet as Sheet$1, SheetBackdrop, SheetContent as SheetContent$1, SheetOverlay, SheetTrigger, useSlottedContext } from "react-aria-components";
14
14
  // src/components/sheet/index.tsx
15
15
  const scrimIn = "x18re5ia-B";
16
16
  const BOTTOM_SHEET = "(width < 600px)";
@@ -592,7 +592,7 @@ function SheetHandle(t0) {
592
592
  "aria-expanded": t3,
593
593
  "aria-label": t4,
594
594
  onPress: moveToNextSnapPoint,
595
- className: "x6s0dn4 xjbqb8w xsdox4t x1dkaolv xng3xce x9f619 x1ypdohk x78zum5 x1useyqa xl56j7k x1ghz6dp xrgy624 x2ssjo2 x9v5kkp x1t137rt x1de99jn x1717udv",
595
+ className: "x6s0dn4 xjbqb8w xsdox4t x1dkaolv xng3xce x9f619 x1ypdohk x78zum5 x1useyqa xl56j7k x1ghz6dp xat36cu x1v57pqu x9v5kkp x1t137rt x1s780dp x1717udv",
596
596
  children: bar
597
597
  });
598
598
  $[1] = bar;