@react-spectrum/s2 3.0.0-nightly-e7053dd8f-250108 → 3.0.0-nightly-e4497fdb6-250110

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 (227) hide show
  1. package/dist/Accordion.cjs +3 -3
  2. package/dist/Accordion.css +2 -2
  3. package/dist/Accordion.mjs +3 -3
  4. package/dist/ActionBar.cjs +32 -32
  5. package/dist/ActionBar.css +34 -34
  6. package/dist/ActionBar.mjs +32 -32
  7. package/dist/ActionButton.cjs +61 -61
  8. package/dist/ActionButton.css +57 -57
  9. package/dist/ActionButton.mjs +61 -61
  10. package/dist/ActionButtonGroup.cjs +4 -4
  11. package/dist/ActionButtonGroup.css +3 -3
  12. package/dist/ActionButtonGroup.mjs +4 -4
  13. package/dist/Avatar.cjs +10 -10
  14. package/dist/Avatar.css +11 -11
  15. package/dist/Avatar.mjs +10 -10
  16. package/dist/AvatarGroup.cjs +97 -97
  17. package/dist/AvatarGroup.css +31 -31
  18. package/dist/AvatarGroup.mjs +97 -97
  19. package/dist/Badge.cjs +31 -31
  20. package/dist/Badge.css +33 -33
  21. package/dist/Badge.mjs +31 -31
  22. package/dist/Breadcrumbs.cjs +83 -82
  23. package/dist/Breadcrumbs.cjs.map +1 -1
  24. package/dist/Breadcrumbs.css +66 -60
  25. package/dist/Breadcrumbs.css.map +1 -1
  26. package/dist/Breadcrumbs.mjs +83 -82
  27. package/dist/Breadcrumbs.mjs.map +1 -1
  28. package/dist/Button.cjs +179 -144
  29. package/dist/Button.cjs.map +1 -1
  30. package/dist/Button.css +167 -86
  31. package/dist/Button.css.map +1 -1
  32. package/dist/Button.mjs +180 -145
  33. package/dist/Button.mjs.map +1 -1
  34. package/dist/ButtonGroup.cjs +15 -15
  35. package/dist/ButtonGroup.css +11 -11
  36. package/dist/ButtonGroup.mjs +15 -15
  37. package/dist/Card.cjs +163 -163
  38. package/dist/Card.css +118 -118
  39. package/dist/Card.mjs +163 -163
  40. package/dist/CardView.cjs +13 -13
  41. package/dist/CardView.css +14 -14
  42. package/dist/CardView.mjs +13 -13
  43. package/dist/CenterBaseline.cjs +1 -1
  44. package/dist/CenterBaseline.css +2 -2
  45. package/dist/CenterBaseline.mjs +1 -1
  46. package/dist/Checkbox.cjs +46 -46
  47. package/dist/Checkbox.css +44 -44
  48. package/dist/Checkbox.mjs +46 -46
  49. package/dist/CheckboxGroup.cjs +39 -39
  50. package/dist/CheckboxGroup.css +32 -32
  51. package/dist/CheckboxGroup.mjs +39 -39
  52. package/dist/ClearButton.cjs +5 -5
  53. package/dist/ClearButton.css +5 -5
  54. package/dist/ClearButton.mjs +5 -5
  55. package/dist/CloseButton.cjs +17 -15
  56. package/dist/CloseButton.cjs.map +1 -1
  57. package/dist/CloseButton.css +24 -16
  58. package/dist/CloseButton.css.map +1 -1
  59. package/dist/CloseButton.mjs +17 -15
  60. package/dist/CloseButton.mjs.map +1 -1
  61. package/dist/ColorArea.cjs +9 -9
  62. package/dist/ColorArea.css +9 -9
  63. package/dist/ColorArea.mjs +9 -9
  64. package/dist/ColorField.cjs +29 -29
  65. package/dist/ColorField.css +24 -24
  66. package/dist/ColorField.mjs +29 -29
  67. package/dist/ColorHandle.cjs +9 -9
  68. package/dist/ColorHandle.css +16 -16
  69. package/dist/ColorHandle.mjs +9 -9
  70. package/dist/ColorSlider.cjs +40 -40
  71. package/dist/ColorSlider.css +42 -42
  72. package/dist/ColorSlider.mjs +40 -40
  73. package/dist/ColorSwatch.cjs +6 -6
  74. package/dist/ColorSwatch.css +14 -14
  75. package/dist/ColorSwatch.mjs +6 -6
  76. package/dist/ColorSwatchPicker.cjs +12 -12
  77. package/dist/ColorSwatchPicker.css +32 -32
  78. package/dist/ColorSwatchPicker.mjs +12 -12
  79. package/dist/ColorWheel.cjs +14 -14
  80. package/dist/ColorWheel.css +14 -14
  81. package/dist/ColorWheel.mjs +14 -14
  82. package/dist/ComboBox.cjs +54 -51
  83. package/dist/ComboBox.cjs.map +1 -1
  84. package/dist/ComboBox.css +48 -48
  85. package/dist/ComboBox.css.map +1 -1
  86. package/dist/ComboBox.mjs +54 -51
  87. package/dist/ComboBox.mjs.map +1 -1
  88. package/dist/ContextualHelp.cjs +5 -5
  89. package/dist/ContextualHelp.css +23 -23
  90. package/dist/ContextualHelp.mjs +5 -5
  91. package/dist/CustomDialog.cjs +8 -8
  92. package/dist/CustomDialog.css +9 -9
  93. package/dist/CustomDialog.mjs +8 -8
  94. package/dist/Dialog.cjs +10 -10
  95. package/dist/Dialog.css +39 -39
  96. package/dist/Dialog.mjs +10 -10
  97. package/dist/Disclosure.cjs +53 -53
  98. package/dist/Disclosure.css +48 -48
  99. package/dist/Disclosure.mjs +53 -53
  100. package/dist/Divider.cjs +5 -5
  101. package/dist/Divider.css +5 -5
  102. package/dist/Divider.mjs +5 -5
  103. package/dist/DropZone.cjs +24 -24
  104. package/dist/DropZone.css +24 -24
  105. package/dist/DropZone.mjs +24 -24
  106. package/dist/Field.cjs +107 -107
  107. package/dist/Field.cjs.map +1 -1
  108. package/dist/Field.css +69 -69
  109. package/dist/Field.mjs +107 -107
  110. package/dist/Field.mjs.map +1 -1
  111. package/dist/Form.cjs +4 -4
  112. package/dist/Form.css +3 -3
  113. package/dist/Form.mjs +4 -4
  114. package/dist/FullscreenDialog.cjs +5 -5
  115. package/dist/FullscreenDialog.css +54 -54
  116. package/dist/FullscreenDialog.mjs +5 -5
  117. package/dist/IllustratedMessage.cjs +126 -126
  118. package/dist/IllustratedMessage.css +58 -58
  119. package/dist/IllustratedMessage.mjs +126 -126
  120. package/dist/Image.cjs +10 -10
  121. package/dist/Image.css +11 -11
  122. package/dist/Image.mjs +10 -10
  123. package/dist/InlineAlert.cjs +50 -50
  124. package/dist/InlineAlert.css +44 -44
  125. package/dist/InlineAlert.mjs +50 -50
  126. package/dist/Link.cjs +27 -27
  127. package/dist/Link.css +28 -28
  128. package/dist/Link.mjs +27 -27
  129. package/dist/Menu.cjs +292 -221
  130. package/dist/Menu.cjs.map +1 -1
  131. package/dist/Menu.css +115 -113
  132. package/dist/Menu.css.map +1 -1
  133. package/dist/Menu.mjs +292 -221
  134. package/dist/Menu.mjs.map +1 -1
  135. package/dist/Meter.cjs +51 -51
  136. package/dist/Meter.css +51 -51
  137. package/dist/Meter.mjs +51 -51
  138. package/dist/Modal.cjs +37 -37
  139. package/dist/Modal.css +35 -35
  140. package/dist/Modal.mjs +37 -37
  141. package/dist/NumberField.cjs +60 -60
  142. package/dist/NumberField.css +66 -66
  143. package/dist/NumberField.mjs +60 -60
  144. package/dist/Picker.cjs +117 -114
  145. package/dist/Picker.cjs.map +1 -1
  146. package/dist/Picker.css +80 -80
  147. package/dist/Picker.css.map +1 -1
  148. package/dist/Picker.mjs +117 -114
  149. package/dist/Picker.mjs.map +1 -1
  150. package/dist/Popover.cjs +40 -40
  151. package/dist/Popover.css +37 -37
  152. package/dist/Popover.mjs +40 -40
  153. package/dist/ProgressBar.cjs +63 -63
  154. package/dist/ProgressBar.css +61 -61
  155. package/dist/ProgressBar.mjs +63 -63
  156. package/dist/ProgressCircle.cjs +3 -3
  157. package/dist/ProgressCircle.css +2 -2
  158. package/dist/ProgressCircle.mjs +3 -3
  159. package/dist/Provider.cjs +4 -4
  160. package/dist/Provider.css +5 -5
  161. package/dist/Provider.mjs +4 -4
  162. package/dist/Radio.cjs +46 -46
  163. package/dist/Radio.css +44 -44
  164. package/dist/Radio.mjs +46 -46
  165. package/dist/RadioGroup.cjs +37 -37
  166. package/dist/RadioGroup.css +32 -32
  167. package/dist/RadioGroup.mjs +37 -37
  168. package/dist/SearchField.cjs +31 -31
  169. package/dist/SearchField.css +29 -29
  170. package/dist/SearchField.mjs +31 -31
  171. package/dist/SegmentedControl.cjs +54 -54
  172. package/dist/SegmentedControl.css +55 -55
  173. package/dist/SegmentedControl.mjs +54 -54
  174. package/dist/Slider.cjs +101 -101
  175. package/dist/Slider.css +82 -82
  176. package/dist/Slider.mjs +101 -101
  177. package/dist/StatusLight.cjs +26 -26
  178. package/dist/StatusLight.css +26 -26
  179. package/dist/StatusLight.mjs +26 -26
  180. package/dist/Switch.cjs +47 -47
  181. package/dist/Switch.css +42 -42
  182. package/dist/Switch.mjs +47 -47
  183. package/dist/TableView.cjs +137 -137
  184. package/dist/TableView.css +76 -76
  185. package/dist/TableView.mjs +137 -137
  186. package/dist/Tabs.cjs +60 -60
  187. package/dist/Tabs.css +53 -53
  188. package/dist/Tabs.mjs +60 -60
  189. package/dist/TabsPicker.cjs +69 -69
  190. package/dist/TabsPicker.css +62 -62
  191. package/dist/TabsPicker.mjs +69 -69
  192. package/dist/TagGroup.cjs +108 -108
  193. package/dist/TagGroup.css +85 -85
  194. package/dist/TagGroup.mjs +108 -108
  195. package/dist/TextField.cjs +36 -36
  196. package/dist/TextField.css +33 -33
  197. package/dist/TextField.mjs +36 -36
  198. package/dist/ToggleButton.cjs +3 -3
  199. package/dist/ToggleButton.css +7 -7
  200. package/dist/ToggleButton.mjs +3 -3
  201. package/dist/Tooltip.cjs +32 -32
  202. package/dist/Tooltip.css +34 -34
  203. package/dist/Tooltip.mjs +32 -32
  204. package/dist/types.d.ts +2 -0
  205. package/dist/types.d.ts.map +1 -1
  206. package/icons/Skeleton.cjs +2 -2
  207. package/icons/Skeleton.css +5 -5
  208. package/icons/Skeleton.mjs +2 -2
  209. package/package.json +19 -19
  210. package/src/Button.tsx +107 -75
  211. package/src/CloseButton.tsx +4 -0
  212. package/src/ComboBox.tsx +2 -1
  213. package/src/Menu.tsx +40 -17
  214. package/src/Picker.tsx +2 -1
  215. package/style/dist/spectrum-theme.cjs +54 -5
  216. package/style/dist/spectrum-theme.cjs.map +1 -1
  217. package/style/dist/spectrum-theme.mjs +54 -5
  218. package/style/dist/spectrum-theme.mjs.map +1 -1
  219. package/style/dist/style-macro.cjs +1 -1
  220. package/style/dist/style-macro.cjs.map +1 -1
  221. package/style/dist/style-macro.mjs +1 -1
  222. package/style/dist/style-macro.mjs.map +1 -1
  223. package/style/dist/types.d.ts +10 -3
  224. package/style/dist/types.d.ts.map +1 -1
  225. package/style/spectrum-theme.ts +66 -7
  226. package/style/style-macro.ts +3 -3
  227. package/style/types.ts +1 -1
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAoGM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAiF;AAE1H,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDN,MAAM;AAaC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;AAcN,MAAM;;;;;;;;;;;;AAUN,MAAM;AASN,IAAI,4DAAwB,CAAA,GAAA,0BAAY,EAAkC;IAAC,MAAM;AAAG;AACpF,IAAI,+DAA2B,CAAA,GAAA,0BAAY,EAAE;AAKtC,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAyB,MAAqB,EAAE,GAAoC;IAC9J,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,CAAC,QAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,QAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B,IAAI,cAAc,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,qCAAU;IACvC,SAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,aACF,YAAY,iBACZ,QAAQ,qBACR,aAAa,iBACb,SAAS,SACT,KAAK,EACL,aAAa,kBAAkB,gBAC/B,YAAY,YACZ,QAAQ,SACR,KAAK,QACL,OAAO,oBACP,gBAAgB,mBAChB,aAAa,6BACb,kBAAkB,oB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AAE;0CAAC;gCAAI;4BAAE;4BAC7B,aAAa;gCAAC,QAAQ,CAAA,GAAA,qCAAU,EAAE;oCAAC,GAAG,WAAW;0CAAE;gCAAI;4BAAE;wBAC3D;oBACF;;wBACC,CAAC,wBAAU,gCAAC,CAAA,GAAA,iCAAY;4BAAE,MAAM,uCAAiB,CAAC,KAAK;4BAAE,WAAW,CAAA,GAAA,mCAAQ,EAAE;gCAAC,GAAG,WAAW;sCAAE;4BAAI;;wBACnG,OAAO,aAAa,yBAAW,gCAAC,CAAA,GAAA,8BAAG;4BAAE,MAAK;sCAAS;6BAAmB;;;;QAI/E;;AAGN;AAEA,uEAAuE;AACvE,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,YAAE,QAAQ,EAA2D;IAC3G,IAAI,gBAAgB,CAAA,GAAA,uBAAS,EAAE;IAC/B,IAAI,eACF,OAAO;IAGT,qBAAO,gCAAC,QAAQ,QAAQ;QAAC,OAAO;kBAAQ;;AAC1C;AAGO,SAAS,0CAAgC,KAA4B;IAC1E,qBACE;;0BACE,gCAAC,CAAA,GAAA,yCAAiB;gBACf,GAAG,KAAK;gBACT,WAAW,CAAA,GAAA,iCAAM;0BAChB,MAAM,QAAQ;;0BAEjB,gCAAC,CAAA,GAAA,iCAAM;;;AAGb","sources":["packages/@react-spectrum/s2/src/Picker.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n ListBoxSection as AriaListBoxSection,\n PopoverProps as AriaPopoverProps,\n Select as AriaSelect,\n SelectProps as AriaSelectProps,\n SelectRenderProps as AriaSelectRenderProps,\n Button,\n ButtonRenderProps,\n ContextValue,\n ListBox,\n ListBoxItem,\n ListBoxItemProps,\n ListBoxProps,\n Provider,\n SectionProps,\n SelectValue\n} from 'react-aria-components';\nimport {baseColor, edgeToText, focusRing, style} from '../style' with {type: 'macro'};\nimport {centerBaseline} from './CenterBaseline';\nimport {\n checkmark,\n description,\n Divider,\n icon,\n iconCenterWrapper,\n label,\n menuitem,\n section,\n sectionHeader,\n sectionHeading\n} from './Menu';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {\n FieldErrorIcon,\n FieldLabel,\n HelpText\n} from './Field';\nimport {FocusableRef, FocusableRefValue, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {HeaderContext, HeadingContext, Text, TextContext} from './Content';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Placement} from 'react-aria';\nimport {PopoverBase} from './Popover';\nimport {pressScale} from './pressScale';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n\nexport interface PickerStyleProps {\n /**\n * The size of the Picker.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the picker should be displayed with a quiet style.\n * @private\n */\n isQuiet?: boolean\n}\n\nexport interface PickerProps<T extends object> extends\n Omit<AriaSelectProps<T>, 'children' | 'style' | 'className'>,\n PickerStyleProps,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps,\n Pick<ListBoxProps<T>, 'items'>,\n Pick<AriaPopoverProps, 'shouldFlip'> {\n /** The contents of the collection. */\n children: ReactNode | ((item: T) => ReactNode),\n /**\n * Direction the menu will render relative to the Picker.\n *\n * @default 'bottom'\n */\n direction?: 'bottom' | 'top',\n /**\n * Alignment of the menu relative to the input target.\n *\n * @default 'start'\n */\n align?: 'start' | 'end',\n /** Width of the menu. By default, matches width of the trigger. Note that the minimum width of the dropdown is always equal to the trigger's width. */\n menuWidth?: number\n}\n\ninterface PickerButtonProps extends PickerStyleProps, ButtonRenderProps {}\n\nexport const PickerContext = createContext<ContextValue<Partial<PickerProps<any>>, FocusableRefValue<HTMLButtonElement>>>(null);\n\nconst inputButton = style<PickerButtonProps | AriaSelectRenderProps>({\n ...focusRing(),\n ...fieldInput(),\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid',\n isQuiet: 'none'\n },\n position: 'relative',\n font: 'control',\n display: 'flex',\n textAlign: 'start',\n borderStyle: {\n default: 'none',\n forcedColors: 'solid'\n },\n borderColor: {\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'control',\n alignItems: 'center',\n height: 'control',\n transition: 'default',\n columnGap: {\n default: 'text-to-control',\n isQuiet: 'text-to-visual'\n },\n paddingX: {\n default: 'edge-to-text',\n isQuiet: 0\n },\n backgroundColor: {\n default: baseColor('gray-100'),\n isOpen: 'gray-200',\n isDisabled: 'disabled',\n isQuiet: 'transparent'\n },\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n maxWidth: {\n isQuiet: 'max'\n },\n disableTapHighlight: true\n});\n\nconst quietFocusLine = style({\n width: 'full',\n // Use pixels since we are emulating a border.\n height: '[2px]',\n position: 'absolute',\n bottom: 0,\n borderRadius: 'full',\n backgroundColor: {\n default: 'blue-800',\n forcedColors: 'Highlight'\n }\n});\n\nexport let menu = style({\n outlineStyle: 'none',\n display: 'grid',\n gridTemplateColumns: {\n size: {\n S: [edgeToText(24), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(24)],\n M: [edgeToText(32), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(32)],\n L: [edgeToText(40), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(40)],\n XL: [edgeToText(48), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(48)]\n }\n },\n boxSizing: 'border-box',\n maxHeight: '[inherit]',\n overflow: 'auto',\n padding: 8,\n fontFamily: 'sans',\n fontSize: 'control'\n});\n\nconst invalidBorder = style({\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n pointerEvents: 'none',\n borderRadius: 'control',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: 'negative',\n transition: 'default'\n});\n\nconst valueStyles = style({\n flexGrow: {\n default: 1,\n isQuiet: 0\n },\n truncate: true,\n display: 'flex',\n alignItems: 'center'\n});\n\nconst iconStyles = style({\n flexShrink: 0,\n rotate: 90,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nlet InternalPickerContext = createContext<{size: 'S' | 'M' | 'L' | 'XL'}>({size: 'M'});\nlet InsideSelectValueContext = createContext(false);\n\n/**\n * Pickers allow users to choose a single option from a collapsible list of options when space is limited.\n */\nexport const Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(function Picker<T extends object>(props: PickerProps<T>, ref: FocusableRef<HTMLButtonElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, PickerContext);\n let domRef = useFocusableRef(ref);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n direction = 'bottom',\n align = 'start',\n shouldFlip = true,\n menuWidth,\n label,\n description: descriptionMessage,\n errorMessage,\n children,\n items,\n size = 'M',\n labelPosition = 'top',\n labelAlign = 'start',\n necessityIndicator,\n UNSAFE_className = '',\n UNSAFE_style,\n placeholder = stringFormatter.format('picker.placeholder'),\n isQuiet,\n ...pickerProps\n } = props;\n\n // Better way to encode this into a style? need to account for flipping\n let menuOffset: number;\n if (size === 'S') {\n menuOffset = 6;\n } else if (size === 'M') {\n menuOffset = 6;\n } else if (size === 'L') {\n menuOffset = 7;\n } else {\n menuOffset = 8;\n }\n\n return (\n <AriaSelect\n {...pickerProps}\n placeholder={placeholder}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n isInForm: !!formContext,\n labelPosition,\n size\n }, props.styles)}>\n {({isDisabled, isOpen, isFocusVisible, isInvalid, isRequired}) => (\n <>\n <InternalPickerContext.Provider value={{size}}>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n isQuiet={isQuiet}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <Button\n ref={domRef}\n style={renderProps => pressScale(domRef)(renderProps)}\n // Prevent press scale from sticking while Picker is open.\n // @ts-ignore\n isPressed={false}\n className={renderProps => inputButton({\n ...renderProps,\n size: size,\n isOpen,\n isQuiet\n })}>\n {(renderProps) => (\n <>\n <SelectValue className={valueStyles({isQuiet}) + ' ' + raw('&> * {display: none;}')}>\n {({defaultChildren}) => {\n return (\n <Provider\n values={[\n [IconContext, {\n slots: {\n icon: {\n render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}),\n styles: icon\n }\n }\n }],\n [TextContext, {\n slots: {\n description: {},\n label: {styles: style({\n display: 'block',\n flexGrow: 1,\n truncate: true\n })}\n }\n }],\n [InsideSelectValueContext, true]\n ]}>\n {defaultChildren}\n </Provider>\n );\n }}\n </SelectValue>\n {isInvalid && (\n <FieldErrorIcon isDisabled={isDisabled} />\n )}\n <ChevronIcon\n size={size}\n className={iconStyles} />\n {isFocusVisible && isQuiet && <span className={quietFocusLine} /> }\n {isInvalid && !isDisabled && !isQuiet &&\n // @ts-ignore known limitation detecting functions from the theme\n <div className={invalidBorder({...renderProps, size})} />\n }\n </>\n )}\n </Button>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {errorMessage}\n </HelpText>\n <PopoverBase\n hideArrow\n offset={menuOffset}\n placement={`${direction} ${align}` as Placement}\n shouldFlip={shouldFlip}\n UNSAFE_style={{\n width: menuWidth && !isQuiet ? `${menuWidth}px` : undefined\n }}\n styles={style({\n marginStart: {\n isQuiet: -12\n },\n minWidth: {\n default: '[var(--trigger-width)]',\n isQuiet: 192\n },\n width: {\n default: '[var(--trigger-width)]',\n isQuiet: '[calc(var(--trigger-width) + (-2 * self(marginStart)))]'\n }\n })(props)}>\n <Provider\n values={[\n [HeaderContext, {styles: sectionHeader({size})}],\n [HeadingContext, {styles: sectionHeading}],\n [TextContext, {\n slots: {\n description: {styles: description({size})}\n }\n }]\n ]}>\n <ListBox\n items={items}\n className={menu({size})}>\n {children}\n </ListBox>\n </Provider>\n </PopoverBase>\n </InternalPickerContext.Provider>\n </>\n )}\n </AriaSelect>\n );\n});\n\nexport interface PickerItemProps extends Omit<ListBoxItemProps, 'children' | 'style' | 'className'>, StyleProps {\n children: ReactNode\n}\n\nconst checkmarkIconSize = {\n S: 'XS',\n M: 'M',\n L: 'L',\n XL: 'XL'\n} as const;\n\nexport function PickerItem(props: PickerItemProps) {\n let ref = useRef(null);\n let isLink = props.href != null;\n let {size} = useContext(InternalPickerContext);\n return (\n <ListBoxItem\n {...props}\n ref={ref}\n textValue={props.textValue || (typeof props.children === 'string' ? props.children as string : undefined)}\n style={pressScale(ref, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + menuitem({...renderProps, size, isLink}, props.styles)}>\n {(renderProps) => {\n let {children} = props;\n return (\n <DefaultProvider\n context={IconContext}\n value={{slots: {\n icon: {render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}), styles: icon}\n }}}>\n <DefaultProvider\n context={TextContext}\n value={{\n slots: {\n label: {styles: label({size})},\n description: {styles: description({...renderProps, size})}\n }\n }}>\n {!isLink && <CheckmarkIcon size={checkmarkIconSize[size]} className={checkmark({...renderProps, size})} />}\n {typeof children === 'string' ? <Text slot=\"label\">{children}</Text> : children}\n </DefaultProvider>\n </DefaultProvider>\n );\n }}\n </ListBoxItem>\n );\n}\n\n// A Context.Provider that only sets a value if not inside SelectValue.\nfunction DefaultProvider({context, value, children}: {context: React.Context<any>, value: any, children: any}) {\n let inSelectValue = useContext(InsideSelectValueContext);\n if (inSelectValue) {\n return children;\n }\n\n return <context.Provider value={value}>{children}</context.Provider>;\n}\n\nexport interface PickerSectionProps<T extends object> extends SectionProps<T> {}\nexport function PickerSection<T extends object>(props: PickerSectionProps<T>) {\n return (\n <>\n <AriaListBoxSection\n {...props}\n className={section}>\n {props.children}\n </AriaListBoxSection>\n <Divider />\n </>\n );\n}\n"],"names":[],"version":3,"file":"Picker.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAoGM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAiF;AAE1H,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDN,MAAM;AAaC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBX,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;AAcN,MAAM;;;;;;;;;;;;AAUN,MAAM;AASN,IAAI,4DAAwB,CAAA,GAAA,0BAAY,EAAkC;IAAC,MAAM;AAAG;AACpF,IAAI,+DAA2B,CAAA,GAAA,0BAAY,EAAE;AAKtC,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAyB,MAAqB,EAAE,GAAoC;IAC9J,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GA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vB,MAAM,QAAQ;;0BAEjB,gCAAC,CAAA,GAAA,iCAAM;;;AAGb","sources":["packages/@react-spectrum/s2/src/Picker.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n ListBoxSection as AriaListBoxSection,\n PopoverProps as AriaPopoverProps,\n Select as AriaSelect,\n SelectProps as AriaSelectProps,\n SelectRenderProps as AriaSelectRenderProps,\n Button,\n ButtonRenderProps,\n ContextValue,\n ListBox,\n ListBoxItem,\n ListBoxItemProps,\n ListBoxProps,\n Provider,\n SectionProps,\n SelectValue\n} from 'react-aria-components';\nimport {baseColor, edgeToText, focusRing, style} from '../style' with {type: 'macro'};\nimport {centerBaseline} from './CenterBaseline';\nimport {\n checkmark,\n description,\n Divider,\n icon,\n iconCenterWrapper,\n label,\n menuitem,\n section,\n sectionHeader,\n sectionHeading\n} from './Menu';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {\n FieldErrorIcon,\n FieldLabel,\n HelpText\n} from './Field';\nimport {FocusableRef, FocusableRefValue, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {HeaderContext, HeadingContext, Text, TextContext} from './Content';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Placement} from 'react-aria';\nimport {PopoverBase} from './Popover';\nimport {pressScale} from './pressScale';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n\nexport interface PickerStyleProps {\n /**\n * The size of the Picker.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the picker should be displayed with a quiet style.\n * @private\n */\n isQuiet?: boolean\n}\n\nexport interface PickerProps<T extends object> extends\n Omit<AriaSelectProps<T>, 'children' | 'style' | 'className'>,\n PickerStyleProps,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps,\n Pick<ListBoxProps<T>, 'items'>,\n Pick<AriaPopoverProps, 'shouldFlip'> {\n /** The contents of the collection. */\n children: ReactNode | ((item: T) => ReactNode),\n /**\n * Direction the menu will render relative to the Picker.\n *\n * @default 'bottom'\n */\n direction?: 'bottom' | 'top',\n /**\n * Alignment of the menu relative to the input target.\n *\n * @default 'start'\n */\n align?: 'start' | 'end',\n /** Width of the menu. By default, matches width of the trigger. Note that the minimum width of the dropdown is always equal to the trigger's width. */\n menuWidth?: number\n}\n\ninterface PickerButtonProps extends PickerStyleProps, ButtonRenderProps {}\n\nexport const PickerContext = createContext<ContextValue<Partial<PickerProps<any>>, FocusableRefValue<HTMLButtonElement>>>(null);\n\nconst inputButton = style<PickerButtonProps | AriaSelectRenderProps>({\n ...focusRing(),\n ...fieldInput(),\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid',\n isQuiet: 'none'\n },\n position: 'relative',\n font: 'control',\n display: 'flex',\n textAlign: 'start',\n borderStyle: {\n default: 'none',\n forcedColors: 'solid'\n },\n borderColor: {\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'control',\n alignItems: 'center',\n height: 'control',\n transition: 'default',\n columnGap: {\n default: 'text-to-control',\n isQuiet: 'text-to-visual'\n },\n paddingX: {\n default: 'edge-to-text',\n isQuiet: 0\n },\n backgroundColor: {\n default: baseColor('gray-100'),\n isOpen: 'gray-200',\n isDisabled: 'disabled',\n isQuiet: 'transparent'\n },\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n maxWidth: {\n isQuiet: 'max'\n },\n disableTapHighlight: true\n});\n\nconst quietFocusLine = style({\n width: 'full',\n // Use pixels since we are emulating a border.\n height: '[2px]',\n position: 'absolute',\n bottom: 0,\n borderRadius: 'full',\n backgroundColor: {\n default: 'blue-800',\n forcedColors: 'Highlight'\n }\n});\n\nexport let menu = style({\n outlineStyle: 'none',\n display: 'grid',\n gridTemplateColumns: {\n size: {\n S: [edgeToText(24), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(24)],\n M: [edgeToText(32), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(32)],\n L: [edgeToText(40), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(40)],\n XL: [edgeToText(48), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(48)]\n }\n },\n boxSizing: 'border-box',\n maxHeight: '[inherit]',\n overflow: 'auto',\n padding: 8,\n fontFamily: 'sans',\n fontSize: 'control'\n});\n\nconst invalidBorder = style({\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n pointerEvents: 'none',\n borderRadius: 'control',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: 'negative',\n transition: 'default'\n});\n\nconst valueStyles = style({\n flexGrow: {\n default: 1,\n isQuiet: 0\n },\n truncate: true,\n display: 'flex',\n alignItems: 'center'\n});\n\nconst iconStyles = style({\n flexShrink: 0,\n rotate: 90,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nlet InternalPickerContext = createContext<{size: 'S' | 'M' | 'L' | 'XL'}>({size: 'M'});\nlet InsideSelectValueContext = createContext(false);\n\n/**\n * Pickers allow users to choose a single option from a collapsible list of options when space is limited.\n */\nexport const Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(function Picker<T extends object>(props: PickerProps<T>, ref: FocusableRef<HTMLButtonElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, PickerContext);\n let domRef = useFocusableRef(ref);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n direction = 'bottom',\n align = 'start',\n shouldFlip = true,\n menuWidth,\n label,\n description: descriptionMessage,\n errorMessage,\n children,\n items,\n size = 'M',\n labelPosition = 'top',\n labelAlign = 'start',\n necessityIndicator,\n UNSAFE_className = '',\n UNSAFE_style,\n placeholder = stringFormatter.format('picker.placeholder'),\n isQuiet,\n ...pickerProps\n } = props;\n\n // Better way to encode this into a style? need to account for flipping\n let menuOffset: number;\n if (size === 'S') {\n menuOffset = 6;\n } else if (size === 'M') {\n menuOffset = 6;\n } else if (size === 'L') {\n menuOffset = 7;\n } else {\n menuOffset = 8;\n }\n\n return (\n <AriaSelect\n {...pickerProps}\n placeholder={placeholder}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n isInForm: !!formContext,\n labelPosition,\n size\n }, props.styles)}>\n {({isDisabled, isOpen, isFocusVisible, isInvalid, isRequired}) => (\n <>\n <InternalPickerContext.Provider value={{size}}>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n isQuiet={isQuiet}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <Button\n ref={domRef}\n style={renderProps => pressScale(domRef)(renderProps)}\n // Prevent press scale from sticking while Picker is open.\n // @ts-ignore\n isPressed={false}\n className={renderProps => inputButton({\n ...renderProps,\n size: size,\n isOpen,\n isQuiet\n })}>\n {(renderProps) => (\n <>\n <SelectValue className={valueStyles({isQuiet}) + ' ' + raw('&> * {display: none;}')}>\n {({defaultChildren}) => {\n return (\n <Provider\n values={[\n [IconContext, {\n slots: {\n icon: {\n render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}),\n styles: icon\n }\n }\n }],\n [TextContext, {\n slots: {\n description: {},\n label: {styles: style({\n display: 'block',\n flexGrow: 1,\n truncate: true\n })}\n }\n }],\n [InsideSelectValueContext, true]\n ]}>\n {defaultChildren}\n </Provider>\n );\n }}\n </SelectValue>\n {isInvalid && (\n <FieldErrorIcon isDisabled={isDisabled} />\n )}\n <ChevronIcon\n size={size}\n className={iconStyles} />\n {isFocusVisible && isQuiet && <span className={quietFocusLine} /> }\n {isInvalid && !isDisabled && !isQuiet &&\n // @ts-ignore known limitation detecting functions from the theme\n <div className={invalidBorder({...renderProps, size})} />\n }\n </>\n )}\n </Button>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {errorMessage}\n </HelpText>\n <PopoverBase\n hideArrow\n offset={menuOffset}\n placement={`${direction} ${align}` as Placement}\n shouldFlip={shouldFlip}\n UNSAFE_style={{\n width: menuWidth && !isQuiet ? `${menuWidth}px` : undefined\n }}\n styles={style({\n marginStart: {\n isQuiet: -12\n },\n minWidth: {\n default: '[var(--trigger-width)]',\n isQuiet: 192\n },\n width: {\n default: '[var(--trigger-width)]',\n isQuiet: '[calc(var(--trigger-width) + (-2 * self(marginStart)))]'\n }\n })(props)}>\n <Provider\n values={[\n [HeaderContext, {styles: sectionHeader({size})}],\n [HeadingContext, {styles: sectionHeading}],\n [TextContext, {\n slots: {\n description: {styles: description({size})}\n }\n }]\n ]}>\n <ListBox\n items={items}\n className={menu({size})}>\n {children}\n </ListBox>\n </Provider>\n </PopoverBase>\n </InternalPickerContext.Provider>\n </>\n )}\n </AriaSelect>\n );\n});\n\nexport interface PickerItemProps extends Omit<ListBoxItemProps, 'children' | 'style' | 'className'>, StyleProps {\n children: ReactNode\n}\n\nconst checkmarkIconSize = {\n S: 'XS',\n M: 'M',\n L: 'L',\n XL: 'XL'\n} as const;\n\nexport function PickerItem(props: PickerItemProps) {\n let ref = useRef(null);\n let isLink = props.href != null;\n let {size} = useContext(InternalPickerContext);\n return (\n <ListBoxItem\n {...props}\n ref={ref}\n textValue={props.textValue || (typeof props.children === 'string' ? props.children as string : undefined)}\n style={pressScale(ref, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + menuitem({...renderProps, size, isLink}, props.styles)}>\n {(renderProps) => {\n let {children} = props;\n return (\n <DefaultProvider\n context={IconContext}\n value={{slots: {\n icon: {render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}), styles: icon}\n }}}>\n <DefaultProvider\n context={TextContext}\n value={{\n slots: {\n label: {styles: label({size})},\n description: {styles: description({...renderProps, size})}\n }\n }}>\n {!isLink && <CheckmarkIcon size={checkmarkIconSize[size]} className={checkmark({...renderProps, size})} />}\n {typeof children === 'string' ? <Text slot=\"label\">{children}</Text> : children}\n </DefaultProvider>\n </DefaultProvider>\n );\n }}\n </ListBoxItem>\n );\n}\n\n// A Context.Provider that only sets a value if not inside SelectValue.\nfunction DefaultProvider({context, value, children}: {context: React.Context<any>, value: any, children: any}) {\n let inSelectValue = useContext(InsideSelectValueContext);\n if (inSelectValue) {\n return children;\n }\n\n return <context.Provider value={value}>{children}</context.Provider>;\n}\n\nexport interface PickerSectionProps<T extends object> extends SectionProps<T> {}\nexport function PickerSection<T extends object>(props: PickerSectionProps<T>) {\n let {size} = useContext(InternalPickerContext);\n return (\n <>\n <AriaListBoxSection\n {...props}\n className={section({size})}>\n {props.children}\n </AriaListBoxSection>\n <Divider />\n </>\n );\n}\n"],"names":[],"version":3,"file":"Picker.cjs.map"}
package/dist/Picker.css CHANGED
@@ -1,5 +1,5 @@
1
1
  @layer _.a {
2
- ._Lb {
2
+ ._Mb {
3
3
  outline-style: solid;
4
4
  }
5
5
 
@@ -7,27 +7,27 @@
7
7
  outline-color: var(--lightningcss-light, #4b75ff) var(--lightningcss-dark, #4069fd);
8
8
  }
9
9
 
10
- ._Nc {
10
+ ._Oc {
11
11
  outline-width: 2px;
12
12
  }
13
13
 
14
- ._M-3t1z {
14
+ ._N-3t1z {
15
15
  outline-offset: 2px;
16
16
  }
17
17
 
18
- .__a-4cfph1 {
18
+ .__b-g2ozi1 {
19
19
  grid-column-start: input;
20
20
  }
21
21
 
22
- .__b-4cfph1 {
22
+ .__c-g2ozi1 {
23
23
  grid-column-end: input;
24
24
  }
25
25
 
26
- .__c-4cfph1 {
26
+ .__d-g2ozi1 {
27
27
  grid-row-start: input;
28
28
  }
29
29
 
30
- .__d-4cfph1 {
30
+ .__e-g2ozi1 {
31
31
  grid-row-end: input;
32
32
  }
33
33
 
@@ -51,7 +51,7 @@
51
51
  min-width: calc(3rem * var(--s2-scale));
52
52
  }
53
53
 
54
- .__ma {
54
+ .__na {
55
55
  contain: none;
56
56
  }
57
57
 
@@ -75,11 +75,11 @@
75
75
  contain-intrinsic-width: calc(var(--defaultWidth) - var(--C, 0px) - var(--D, 0px) - var(--s, 0px) - var(--t, 0px));
76
76
  }
77
77
 
78
- .Uc {
78
+ .Vc {
79
79
  position: relative;
80
80
  }
81
81
 
82
- ._eb {
82
+ ._fb {
83
83
  font-variation-settings: "wght" 400;
84
84
  font-synthesis-weight: none;
85
85
  font-weight: 400;
@@ -97,7 +97,7 @@
97
97
  color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
98
98
  }
99
99
 
100
- ._ja {
100
+ ._ka {
101
101
  text-align: start;
102
102
  }
103
103
 
@@ -185,19 +185,19 @@
185
185
  height: 2px;
186
186
  }
187
187
 
188
- ._vf {
188
+ ._wf {
189
189
  border-start-start-radius: 9999px;
190
190
  }
191
191
 
192
- ._wf {
192
+ ._xf {
193
193
  border-start-end-radius: 9999px;
194
194
  }
195
195
 
196
- ._xf {
196
+ ._yf {
197
197
  border-end-start-radius: 9999px;
198
198
  }
199
199
 
200
- ._yf {
200
+ ._zf {
201
201
  border-end-end-radius: 9999px;
202
202
  }
203
203
 
@@ -205,27 +205,27 @@
205
205
  background-color: var(--lightningcss-light, #4b75ff) var(--lightningcss-dark, #4069fd);
206
206
  }
207
207
 
208
- ._La {
208
+ ._Ma {
209
209
  outline-style: none;
210
210
  }
211
211
 
212
- .__h-17i5a9u {
212
+ .__i-iov3cy {
213
213
  grid-template-columns: .5625rem auto auto minmax(0, 1fr) auto auto auto .5625rem;
214
214
  }
215
215
 
216
- .__h-1kgdida {
216
+ .__i-n6rb9a {
217
217
  grid-template-columns: .75rem auto auto minmax(0, 1fr) auto auto auto .75rem;
218
218
  }
219
219
 
220
- .__h-1w0s9l0 {
220
+ .__i-1pqbi84 {
221
221
  grid-template-columns: .9375rem auto auto minmax(0, 1fr) auto auto auto .9375rem;
222
222
  }
223
223
 
224
- .__h-358ibk {
224
+ .__i-14g31og {
225
225
  grid-template-columns: 1.125rem auto auto minmax(0, 1fr) auto auto auto 1.125rem;
226
226
  }
227
227
 
228
- .__na {
228
+ .__oa {
229
229
  box-sizing: border-box;
230
230
  }
231
231
 
@@ -233,11 +233,11 @@
233
233
  max-height: inherit;
234
234
  }
235
235
 
236
- .__va {
236
+ .__wa {
237
237
  overflow-x: auto;
238
238
  }
239
239
 
240
- .__wa {
240
+ .__xa {
241
241
  overflow-y: auto;
242
242
  }
243
243
 
@@ -257,47 +257,47 @@
257
257
  padding-inline-end: .5rem;
258
258
  }
259
259
 
260
- ._ca {
260
+ ._da {
261
261
  font-family: adobe-clean-variable, adobe-clean, ui-sans-serif, system-ui, sans-serif;
262
262
  }
263
263
 
264
- .Ua {
264
+ .Va {
265
265
  position: absolute;
266
266
  }
267
267
 
268
- .Xa {
268
+ .Ya {
269
269
  top: 0;
270
270
  }
271
271
 
272
- .Ya {
272
+ .Za {
273
273
  left: 0;
274
274
  }
275
275
 
276
- .Za {
276
+ ._aa {
277
277
  bottom: 0;
278
278
  }
279
279
 
280
- ._aa {
280
+ ._ba {
281
281
  right: 0;
282
282
  }
283
283
 
284
- .__Ba {
284
+ .__Ca {
285
285
  pointer-events: none;
286
286
  }
287
287
 
288
- ._vh {
288
+ ._wh {
289
289
  border-start-start-radius: .571429em;
290
290
  }
291
291
 
292
- ._wh {
292
+ ._xh {
293
293
  border-start-end-radius: .571429em;
294
294
  }
295
295
 
296
- ._xh {
296
+ ._yh {
297
297
  border-end-start-radius: .571429em;
298
298
  }
299
299
 
300
- ._yh {
300
+ ._zh {
301
301
  border-end-end-radius: .571429em;
302
302
  }
303
303
 
@@ -333,31 +333,31 @@
333
333
  border-color: var(--lightningcss-light, #9c2113) var(--lightningcss-dark, #ff8678);
334
334
  }
335
335
 
336
- ._Oa {
337
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter;
336
+ ._Pa {
337
+ transition-property: color, background-color, var(--gp), border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, backdrop-filter;
338
338
  }
339
339
 
340
- ._Q-375x7f {
340
+ ._R-375x7f {
341
341
  transition-duration: .15s;
342
342
  }
343
343
 
344
- ._Ra {
344
+ ._Sa {
345
345
  transition-timing-function: cubic-bezier(.45, 0, .4, 1);
346
346
  }
347
347
 
348
- ._9-3t1x {
348
+ .__a-3t1x {
349
349
  flex-grow: 0;
350
350
  }
351
351
 
352
- ._Zd {
352
+ ._0d {
353
353
  display: flex;
354
354
  }
355
355
 
356
- ._1c {
356
+ ._2c {
357
357
  align-items: center;
358
358
  }
359
359
 
360
- ._8-3t1x {
360
+ ._9-3t1x {
361
361
  flex-shrink: 0;
362
362
  }
363
363
 
@@ -369,74 +369,74 @@
369
369
  --iconPrimary: currentColor;
370
370
  }
371
371
 
372
- ._Zf {
372
+ ._0f {
373
373
  display: grid;
374
374
  }
375
375
 
376
- .__a-3t1y {
376
+ .__b-3t1y {
377
377
  grid-column-start: 1;
378
378
  }
379
379
 
380
- .__b-7u9dhl {
380
+ .__c-yqnebx {
381
381
  grid-column-end: span 2;
382
382
  }
383
383
 
384
- .__h-375yi6 {
384
+ .__i-2wzs0i {
385
385
  grid-template-columns: 1fr;
386
386
  }
387
387
 
388
- .__h-jyg4vb {
388
+ .__i-ar5vcf {
389
389
  grid-template-columns: auto 1fr;
390
390
  }
391
391
 
392
- .__h-1cwd7ud {
392
+ .__i-1a97rzt {
393
393
  grid-template-columns: subgrid;
394
394
  }
395
395
 
396
- .__i-fdenls {
396
+ .__j-1a6w430 {
397
397
  grid-template-rows: auto 1fr auto;
398
398
  }
399
399
 
400
- .__i-jyg4vb {
400
+ .__j-ar5vcf {
401
401
  grid-template-rows: auto 1fr;
402
402
  }
403
403
 
404
- .__j-xlaqir {
404
+ .__k-1srn173 {
405
405
  grid-template-areas: "label"
406
406
  "input"
407
407
  "helptext";
408
408
  }
409
409
 
410
- .__j-5eez8j {
410
+ .__k-18h2yqz {
411
411
  grid-template-areas: "label input"
412
412
  "label helptext";
413
413
  }
414
414
 
415
- ._de {
415
+ ._ee {
416
416
  font-size: .875rem;
417
417
  }
418
418
 
419
- ._da {
419
+ ._ea {
420
420
  font-size: .6875rem;
421
421
  }
422
422
 
423
- ._dc {
423
+ ._ec {
424
424
  font-size: .75rem;
425
425
  }
426
426
 
427
- ._dg {
427
+ ._eg {
428
428
  font-size: 1rem;
429
429
  }
430
430
 
431
- ._di {
431
+ ._ei {
432
432
  font-size: 1.125rem;
433
433
  }
434
434
 
435
- ._1d {
435
+ ._2d {
436
436
  align-items: baseline;
437
437
  }
438
438
 
439
- ._fa {
439
+ ._ga {
440
440
  line-height: 1.3;
441
441
  }
442
442
 
@@ -468,7 +468,7 @@
468
468
  column-gap: .75rem;
469
469
  }
470
470
 
471
- .__R-yksgrp {
471
+ .__S-yksgrp {
472
472
  -webkit-tap-highlight-color: #0000;
473
473
  }
474
474
 
@@ -476,27 +476,27 @@
476
476
  display: none;
477
477
  }
478
478
 
479
- ._Za {
479
+ ._0a {
480
480
  display: block;
481
481
  }
482
482
 
483
- ._9-3t1y {
483
+ .__a-3t1y {
484
484
  flex-grow: 1;
485
485
  }
486
486
 
487
- .__vb {
487
+ .__wb {
488
488
  overflow-x: hidden;
489
489
  }
490
490
 
491
- .__wb {
491
+ .__xb {
492
492
  overflow-y: hidden;
493
493
  }
494
494
 
495
- ._ma {
495
+ ._na {
496
496
  text-overflow: ellipsis;
497
497
  }
498
498
 
499
- ._pb {
499
+ ._qb {
500
500
  white-space: nowrap;
501
501
  }
502
502
 
@@ -526,47 +526,47 @@
526
526
  }
527
527
 
528
528
  @layer _.b {
529
- ._c-enzrfpb:lang(ar) {
529
+ ._d-enzrfpb:lang(ar) {
530
530
  font-family: myriad-arabic, ui-sans-serif, system-ui, sans-serif;
531
531
  }
532
532
 
533
- ._f-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
533
+ ._g-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
534
534
  line-height: 1.5;
535
535
  }
536
536
  }
537
537
 
538
538
  @layer _.c {
539
- ._c-enzwzjc:lang(he) {
539
+ ._d-enzwzjc:lang(he) {
540
540
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
541
541
  }
542
542
  }
543
543
 
544
544
  @layer _.d {
545
- ._c-enzykdd:lang(ja) {
545
+ ._d-enzykdd:lang(ja) {
546
546
  font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
547
547
  }
548
548
  }
549
549
 
550
550
  @layer _.e {
551
- ._c-enzzrge:lang(ko) {
551
+ ._d-enzzrge:lang(ko) {
552
552
  font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
553
553
  }
554
554
  }
555
555
 
556
556
  @layer _.f {
557
- ._c-eo0c6sf:lang(zh) {
557
+ ._d-eo0c6sf:lang(zh) {
558
558
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
559
559
  }
560
560
  }
561
561
 
562
562
  @layer _.g {
563
- ._c-1uotwbwg:lang(zh-hant) {
563
+ ._d-1uotwbwg:lang(zh-hant) {
564
564
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
565
565
  }
566
566
  }
567
567
 
568
568
  @layer _.h {
569
- ._c-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
569
+ ._d-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
570
570
  font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
571
571
  }
572
572
  }
@@ -599,7 +599,7 @@
599
599
 
600
600
  @layer _.b.-_1s8glxu {
601
601
  @supports (contain-intrinsic-width: 1px) {
602
- .__m-1s8glxue {
602
+ .__n-1s8glxue {
603
603
  contain: inline-size;
604
604
  }
605
605
  }
@@ -611,23 +611,23 @@
611
611
  column-gap: .470588em;
612
612
  }
613
613
 
614
- ._dbf {
614
+ ._ebf {
615
615
  font-size: 1.0625rem;
616
616
  }
617
617
 
618
- ._dbb {
618
+ ._ebb {
619
619
  font-size: .8125rem;
620
620
  }
621
621
 
622
- ._dbd {
622
+ ._ebd {
623
623
  font-size: .9375rem;
624
624
  }
625
625
 
626
- ._dbh {
626
+ ._ebh {
627
627
  font-size: 1.1875rem;
628
628
  }
629
629
 
630
- ._dbj {
630
+ ._ebj {
631
631
  font-size: 1.375rem;
632
632
  }
633
633
  }
@@ -1 +1 @@
1
- {"mappings":"ACgHoB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA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;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAkDG;;;;;;AAlDH;EAAA;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAqKgB;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAnHb","sources":["552e27cf637b06d3","packages/@react-spectrum/s2/src/Picker.tsx"],"sourcesContent":["@import \"3ea1b03e909704b0\";\n@import \"ee9bbd6fcdd43977\";\n@import \"6c757f8583900bce\";\n@import \"5664d1276ba33182\";\n@import \"4581fd7ca88158d4\";\n@import \"6f2c83ecc9c1c922\";\n@import \"5f2bbc1985161dbd\";\n@import \"19b2c692b4947046\";\n@import \"4d3d8008ddb5ca39\";\n@import \"6c5e73b19354c1ee\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n ListBoxSection as AriaListBoxSection,\n PopoverProps as AriaPopoverProps,\n Select as AriaSelect,\n SelectProps as AriaSelectProps,\n SelectRenderProps as AriaSelectRenderProps,\n Button,\n ButtonRenderProps,\n ContextValue,\n ListBox,\n ListBoxItem,\n ListBoxItemProps,\n ListBoxProps,\n Provider,\n SectionProps,\n SelectValue\n} from 'react-aria-components';\nimport {baseColor, edgeToText, focusRing, style} from '../style' with {type: 'macro'};\nimport {centerBaseline} from './CenterBaseline';\nimport {\n checkmark,\n description,\n Divider,\n icon,\n iconCenterWrapper,\n label,\n menuitem,\n section,\n sectionHeader,\n sectionHeading\n} from './Menu';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {\n FieldErrorIcon,\n FieldLabel,\n HelpText\n} from './Field';\nimport {FocusableRef, FocusableRefValue, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {HeaderContext, HeadingContext, Text, TextContext} from './Content';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Placement} from 'react-aria';\nimport {PopoverBase} from './Popover';\nimport {pressScale} from './pressScale';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n\nexport interface PickerStyleProps {\n /**\n * The size of the Picker.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the picker should be displayed with a quiet style.\n * @private\n */\n isQuiet?: boolean\n}\n\nexport interface PickerProps<T extends object> extends\n Omit<AriaSelectProps<T>, 'children' | 'style' | 'className'>,\n PickerStyleProps,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps,\n Pick<ListBoxProps<T>, 'items'>,\n Pick<AriaPopoverProps, 'shouldFlip'> {\n /** The contents of the collection. */\n children: ReactNode | ((item: T) => ReactNode),\n /**\n * Direction the menu will render relative to the Picker.\n *\n * @default 'bottom'\n */\n direction?: 'bottom' | 'top',\n /**\n * Alignment of the menu relative to the input target.\n *\n * @default 'start'\n */\n align?: 'start' | 'end',\n /** Width of the menu. By default, matches width of the trigger. Note that the minimum width of the dropdown is always equal to the trigger's width. */\n menuWidth?: number\n}\n\ninterface PickerButtonProps extends PickerStyleProps, ButtonRenderProps {}\n\nexport const PickerContext = createContext<ContextValue<Partial<PickerProps<any>>, FocusableRefValue<HTMLButtonElement>>>(null);\n\nconst inputButton = style<PickerButtonProps | AriaSelectRenderProps>({\n ...focusRing(),\n ...fieldInput(),\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid',\n isQuiet: 'none'\n },\n position: 'relative',\n font: 'control',\n display: 'flex',\n textAlign: 'start',\n borderStyle: {\n default: 'none',\n forcedColors: 'solid'\n },\n borderColor: {\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'control',\n alignItems: 'center',\n height: 'control',\n transition: 'default',\n columnGap: {\n default: 'text-to-control',\n isQuiet: 'text-to-visual'\n },\n paddingX: {\n default: 'edge-to-text',\n isQuiet: 0\n },\n backgroundColor: {\n default: baseColor('gray-100'),\n isOpen: 'gray-200',\n isDisabled: 'disabled',\n isQuiet: 'transparent'\n },\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n maxWidth: {\n isQuiet: 'max'\n },\n disableTapHighlight: true\n});\n\nconst quietFocusLine = style({\n width: 'full',\n // Use pixels since we are emulating a border.\n height: '[2px]',\n position: 'absolute',\n bottom: 0,\n borderRadius: 'full',\n backgroundColor: {\n default: 'blue-800',\n forcedColors: 'Highlight'\n }\n});\n\nexport let menu = style({\n outlineStyle: 'none',\n display: 'grid',\n gridTemplateColumns: {\n size: {\n S: [edgeToText(24), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(24)],\n M: [edgeToText(32), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(32)],\n L: [edgeToText(40), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(40)],\n XL: [edgeToText(48), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(48)]\n }\n },\n boxSizing: 'border-box',\n maxHeight: '[inherit]',\n overflow: 'auto',\n padding: 8,\n fontFamily: 'sans',\n fontSize: 'control'\n});\n\nconst invalidBorder = style({\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n pointerEvents: 'none',\n borderRadius: 'control',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: 'negative',\n transition: 'default'\n});\n\nconst valueStyles = style({\n flexGrow: {\n default: 1,\n isQuiet: 0\n },\n truncate: true,\n display: 'flex',\n alignItems: 'center'\n});\n\nconst iconStyles = style({\n flexShrink: 0,\n rotate: 90,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nlet InternalPickerContext = createContext<{size: 'S' | 'M' | 'L' | 'XL'}>({size: 'M'});\nlet InsideSelectValueContext = createContext(false);\n\n/**\n * Pickers allow users to choose a single option from a collapsible list of options when space is limited.\n */\nexport const Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(function Picker<T extends object>(props: PickerProps<T>, ref: FocusableRef<HTMLButtonElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, PickerContext);\n let domRef = useFocusableRef(ref);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n direction = 'bottom',\n align = 'start',\n shouldFlip = true,\n menuWidth,\n label,\n description: descriptionMessage,\n errorMessage,\n children,\n items,\n size = 'M',\n labelPosition = 'top',\n labelAlign = 'start',\n necessityIndicator,\n UNSAFE_className = '',\n UNSAFE_style,\n placeholder = stringFormatter.format('picker.placeholder'),\n isQuiet,\n ...pickerProps\n } = props;\n\n // Better way to encode this into a style? need to account for flipping\n let menuOffset: number;\n if (size === 'S') {\n menuOffset = 6;\n } else if (size === 'M') {\n menuOffset = 6;\n } else if (size === 'L') {\n menuOffset = 7;\n } else {\n menuOffset = 8;\n }\n\n return (\n <AriaSelect\n {...pickerProps}\n placeholder={placeholder}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n isInForm: !!formContext,\n labelPosition,\n size\n }, props.styles)}>\n {({isDisabled, isOpen, isFocusVisible, isInvalid, isRequired}) => (\n <>\n <InternalPickerContext.Provider value={{size}}>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n isQuiet={isQuiet}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <Button\n ref={domRef}\n style={renderProps => pressScale(domRef)(renderProps)}\n // Prevent press scale from sticking while Picker is open.\n // @ts-ignore\n isPressed={false}\n className={renderProps => inputButton({\n ...renderProps,\n size: size,\n isOpen,\n isQuiet\n })}>\n {(renderProps) => (\n <>\n <SelectValue className={valueStyles({isQuiet}) + ' ' + raw('&> * {display: none;}')}>\n {({defaultChildren}) => {\n return (\n <Provider\n values={[\n [IconContext, {\n slots: {\n icon: {\n render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}),\n styles: icon\n }\n }\n }],\n [TextContext, {\n slots: {\n description: {},\n label: {styles: style({\n display: 'block',\n flexGrow: 1,\n truncate: true\n })}\n }\n }],\n [InsideSelectValueContext, true]\n ]}>\n {defaultChildren}\n </Provider>\n );\n }}\n </SelectValue>\n {isInvalid && (\n <FieldErrorIcon isDisabled={isDisabled} />\n )}\n <ChevronIcon\n size={size}\n className={iconStyles} />\n {isFocusVisible && isQuiet && <span className={quietFocusLine} /> }\n {isInvalid && !isDisabled && !isQuiet &&\n // @ts-ignore known limitation detecting functions from the theme\n <div className={invalidBorder({...renderProps, size})} />\n }\n </>\n )}\n </Button>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {errorMessage}\n </HelpText>\n <PopoverBase\n hideArrow\n offset={menuOffset}\n placement={`${direction} ${align}` as Placement}\n shouldFlip={shouldFlip}\n UNSAFE_style={{\n width: menuWidth && !isQuiet ? `${menuWidth}px` : undefined\n }}\n styles={style({\n marginStart: {\n isQuiet: -12\n },\n minWidth: {\n default: '[var(--trigger-width)]',\n isQuiet: 192\n },\n width: {\n default: '[var(--trigger-width)]',\n isQuiet: '[calc(var(--trigger-width) + (-2 * self(marginStart)))]'\n }\n })(props)}>\n <Provider\n values={[\n [HeaderContext, {styles: sectionHeader({size})}],\n [HeadingContext, {styles: sectionHeading}],\n [TextContext, {\n slots: {\n description: {styles: description({size})}\n }\n }]\n ]}>\n <ListBox\n items={items}\n className={menu({size})}>\n {children}\n </ListBox>\n </Provider>\n </PopoverBase>\n </InternalPickerContext.Provider>\n </>\n )}\n </AriaSelect>\n );\n});\n\nexport interface PickerItemProps extends Omit<ListBoxItemProps, 'children' | 'style' | 'className'>, StyleProps {\n children: ReactNode\n}\n\nconst checkmarkIconSize = {\n S: 'XS',\n M: 'M',\n L: 'L',\n XL: 'XL'\n} as const;\n\nexport function PickerItem(props: PickerItemProps) {\n let ref = useRef(null);\n let isLink = props.href != null;\n let {size} = useContext(InternalPickerContext);\n return (\n <ListBoxItem\n {...props}\n ref={ref}\n textValue={props.textValue || (typeof props.children === 'string' ? props.children as string : undefined)}\n style={pressScale(ref, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + menuitem({...renderProps, size, isLink}, props.styles)}>\n {(renderProps) => {\n let {children} = props;\n return (\n <DefaultProvider\n context={IconContext}\n value={{slots: {\n icon: {render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}), styles: icon}\n }}}>\n <DefaultProvider\n context={TextContext}\n value={{\n slots: {\n label: {styles: label({size})},\n description: {styles: description({...renderProps, size})}\n }\n }}>\n {!isLink && <CheckmarkIcon size={checkmarkIconSize[size]} className={checkmark({...renderProps, size})} />}\n {typeof children === 'string' ? <Text slot=\"label\">{children}</Text> : children}\n </DefaultProvider>\n </DefaultProvider>\n );\n }}\n </ListBoxItem>\n );\n}\n\n// A Context.Provider that only sets a value if not inside SelectValue.\nfunction DefaultProvider({context, value, children}: {context: React.Context<any>, value: any, children: any}) {\n let inSelectValue = useContext(InsideSelectValueContext);\n if (inSelectValue) {\n return children;\n }\n\n return <context.Provider value={value}>{children}</context.Provider>;\n}\n\nexport interface PickerSectionProps<T extends object> extends SectionProps<T> {}\nexport function PickerSection<T extends object>(props: PickerSectionProps<T>) {\n return (\n <>\n <AriaListBoxSection\n {...props}\n className={section}>\n {props.children}\n </AriaListBoxSection>\n <Divider />\n </>\n );\n}\n"],"names":[],"version":3,"file":"Picker.css.map"}
1
+ {"mappings":"ACgHoB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkDG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAaL;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAmBI;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAcF;;;;EAAA;;;;EAAA;;;;EAUD;;;;EAAA;;;;EAAA;;;;EA2DiB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAiCqC;;;;EAgBzB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA2C1B;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAjQF;EA+DF;;;;EAsGkB;;;;;AArKhB;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAkDG;;;;;;AAlDH;EAAA;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAqKgB;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAnHb","sources":["552e27cf637b06d3","packages/@react-spectrum/s2/src/Picker.tsx"],"sourcesContent":["@import \"3ea1b03e909704b0\";\n@import \"ee9bbd6fcdd43977\";\n@import \"6c757f8583900bce\";\n@import \"5664d1276ba33182\";\n@import \"4581fd7ca88158d4\";\n@import \"6f2c83ecc9c1c922\";\n@import \"5f2bbc1985161dbd\";\n@import \"19b2c692b4947046\";\n@import \"4d3d8008ddb5ca39\";\n@import \"6c5e73b19354c1ee\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n ListBoxSection as AriaListBoxSection,\n PopoverProps as AriaPopoverProps,\n Select as AriaSelect,\n SelectProps as AriaSelectProps,\n SelectRenderProps as AriaSelectRenderProps,\n Button,\n ButtonRenderProps,\n ContextValue,\n ListBox,\n ListBoxItem,\n ListBoxItemProps,\n ListBoxProps,\n Provider,\n SectionProps,\n SelectValue\n} from 'react-aria-components';\nimport {baseColor, edgeToText, focusRing, style} from '../style' with {type: 'macro'};\nimport {centerBaseline} from './CenterBaseline';\nimport {\n checkmark,\n description,\n Divider,\n icon,\n iconCenterWrapper,\n label,\n menuitem,\n section,\n sectionHeader,\n sectionHeading\n} from './Menu';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {\n FieldErrorIcon,\n FieldLabel,\n HelpText\n} from './Field';\nimport {FocusableRef, FocusableRefValue, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {HeaderContext, HeadingContext, Text, TextContext} from './Content';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Placement} from 'react-aria';\nimport {PopoverBase} from './Popover';\nimport {pressScale} from './pressScale';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n\nexport interface PickerStyleProps {\n /**\n * The size of the Picker.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the picker should be displayed with a quiet style.\n * @private\n */\n isQuiet?: boolean\n}\n\nexport interface PickerProps<T extends object> extends\n Omit<AriaSelectProps<T>, 'children' | 'style' | 'className'>,\n PickerStyleProps,\n StyleProps,\n SpectrumLabelableProps,\n HelpTextProps,\n Pick<ListBoxProps<T>, 'items'>,\n Pick<AriaPopoverProps, 'shouldFlip'> {\n /** The contents of the collection. */\n children: ReactNode | ((item: T) => ReactNode),\n /**\n * Direction the menu will render relative to the Picker.\n *\n * @default 'bottom'\n */\n direction?: 'bottom' | 'top',\n /**\n * Alignment of the menu relative to the input target.\n *\n * @default 'start'\n */\n align?: 'start' | 'end',\n /** Width of the menu. By default, matches width of the trigger. Note that the minimum width of the dropdown is always equal to the trigger's width. */\n menuWidth?: number\n}\n\ninterface PickerButtonProps extends PickerStyleProps, ButtonRenderProps {}\n\nexport const PickerContext = createContext<ContextValue<Partial<PickerProps<any>>, FocusableRefValue<HTMLButtonElement>>>(null);\n\nconst inputButton = style<PickerButtonProps | AriaSelectRenderProps>({\n ...focusRing(),\n ...fieldInput(),\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid',\n isQuiet: 'none'\n },\n position: 'relative',\n font: 'control',\n display: 'flex',\n textAlign: 'start',\n borderStyle: {\n default: 'none',\n forcedColors: 'solid'\n },\n borderColor: {\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'control',\n alignItems: 'center',\n height: 'control',\n transition: 'default',\n columnGap: {\n default: 'text-to-control',\n isQuiet: 'text-to-visual'\n },\n paddingX: {\n default: 'edge-to-text',\n isQuiet: 0\n },\n backgroundColor: {\n default: baseColor('gray-100'),\n isOpen: 'gray-200',\n isDisabled: 'disabled',\n isQuiet: 'transparent'\n },\n color: {\n default: 'neutral',\n isDisabled: 'disabled'\n },\n maxWidth: {\n isQuiet: 'max'\n },\n disableTapHighlight: true\n});\n\nconst quietFocusLine = style({\n width: 'full',\n // Use pixels since we are emulating a border.\n height: '[2px]',\n position: 'absolute',\n bottom: 0,\n borderRadius: 'full',\n backgroundColor: {\n default: 'blue-800',\n forcedColors: 'Highlight'\n }\n});\n\nexport let menu = style({\n outlineStyle: 'none',\n display: 'grid',\n gridTemplateColumns: {\n size: {\n S: [edgeToText(24), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(24)],\n M: [edgeToText(32), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(32)],\n L: [edgeToText(40), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(40)],\n XL: [edgeToText(48), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(48)]\n }\n },\n boxSizing: 'border-box',\n maxHeight: '[inherit]',\n overflow: 'auto',\n padding: 8,\n fontFamily: 'sans',\n fontSize: 'control'\n});\n\nconst invalidBorder = style({\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n pointerEvents: 'none',\n borderRadius: 'control',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: 'negative',\n transition: 'default'\n});\n\nconst valueStyles = style({\n flexGrow: {\n default: 1,\n isQuiet: 0\n },\n truncate: true,\n display: 'flex',\n alignItems: 'center'\n});\n\nconst iconStyles = style({\n flexShrink: 0,\n rotate: 90,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nlet InternalPickerContext = createContext<{size: 'S' | 'M' | 'L' | 'XL'}>({size: 'M'});\nlet InsideSelectValueContext = createContext(false);\n\n/**\n * Pickers allow users to choose a single option from a collapsible list of options when space is limited.\n */\nexport const Picker = /*#__PURE__*/ (forwardRef as forwardRefType)(function Picker<T extends object>(props: PickerProps<T>, ref: FocusableRef<HTMLButtonElement>) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n [props, ref] = useSpectrumContextProps(props, ref, PickerContext);\n let domRef = useFocusableRef(ref);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n direction = 'bottom',\n align = 'start',\n shouldFlip = true,\n menuWidth,\n label,\n description: descriptionMessage,\n errorMessage,\n children,\n items,\n size = 'M',\n labelPosition = 'top',\n labelAlign = 'start',\n necessityIndicator,\n UNSAFE_className = '',\n UNSAFE_style,\n placeholder = stringFormatter.format('picker.placeholder'),\n isQuiet,\n ...pickerProps\n } = props;\n\n // Better way to encode this into a style? need to account for flipping\n let menuOffset: number;\n if (size === 'S') {\n menuOffset = 6;\n } else if (size === 'M') {\n menuOffset = 6;\n } else if (size === 'L') {\n menuOffset = 7;\n } else {\n menuOffset = 8;\n }\n\n return (\n <AriaSelect\n {...pickerProps}\n placeholder={placeholder}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n isInForm: !!formContext,\n labelPosition,\n size\n }, props.styles)}>\n {({isDisabled, isOpen, isFocusVisible, isInvalid, isRequired}) => (\n <>\n <InternalPickerContext.Provider value={{size}}>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={isRequired}\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n isQuiet={isQuiet}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <Button\n ref={domRef}\n style={renderProps => pressScale(domRef)(renderProps)}\n // Prevent press scale from sticking while Picker is open.\n // @ts-ignore\n isPressed={false}\n className={renderProps => inputButton({\n ...renderProps,\n size: size,\n isOpen,\n isQuiet\n })}>\n {(renderProps) => (\n <>\n <SelectValue className={valueStyles({isQuiet}) + ' ' + raw('&> * {display: none;}')}>\n {({defaultChildren}) => {\n return (\n <Provider\n values={[\n [IconContext, {\n slots: {\n icon: {\n render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}),\n styles: icon\n }\n }\n }],\n [TextContext, {\n slots: {\n description: {},\n label: {styles: style({\n display: 'block',\n flexGrow: 1,\n truncate: true\n })}\n }\n }],\n [InsideSelectValueContext, true]\n ]}>\n {defaultChildren}\n </Provider>\n );\n }}\n </SelectValue>\n {isInvalid && (\n <FieldErrorIcon isDisabled={isDisabled} />\n )}\n <ChevronIcon\n size={size}\n className={iconStyles} />\n {isFocusVisible && isQuiet && <span className={quietFocusLine} /> }\n {isInvalid && !isDisabled && !isQuiet &&\n // @ts-ignore known limitation detecting functions from the theme\n <div className={invalidBorder({...renderProps, size})} />\n }\n </>\n )}\n </Button>\n <HelpText\n size={size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={descriptionMessage}>\n {errorMessage}\n </HelpText>\n <PopoverBase\n hideArrow\n offset={menuOffset}\n placement={`${direction} ${align}` as Placement}\n shouldFlip={shouldFlip}\n UNSAFE_style={{\n width: menuWidth && !isQuiet ? `${menuWidth}px` : undefined\n }}\n styles={style({\n marginStart: {\n isQuiet: -12\n },\n minWidth: {\n default: '[var(--trigger-width)]',\n isQuiet: 192\n },\n width: {\n default: '[var(--trigger-width)]',\n isQuiet: '[calc(var(--trigger-width) + (-2 * self(marginStart)))]'\n }\n })(props)}>\n <Provider\n values={[\n [HeaderContext, {styles: sectionHeader({size})}],\n [HeadingContext, {styles: sectionHeading}],\n [TextContext, {\n slots: {\n description: {styles: description({size})}\n }\n }]\n ]}>\n <ListBox\n items={items}\n className={menu({size})}>\n {children}\n </ListBox>\n </Provider>\n </PopoverBase>\n </InternalPickerContext.Provider>\n </>\n )}\n </AriaSelect>\n );\n});\n\nexport interface PickerItemProps extends Omit<ListBoxItemProps, 'children' | 'style' | 'className'>, StyleProps {\n children: ReactNode\n}\n\nconst checkmarkIconSize = {\n S: 'XS',\n M: 'M',\n L: 'L',\n XL: 'XL'\n} as const;\n\nexport function PickerItem(props: PickerItemProps) {\n let ref = useRef(null);\n let isLink = props.href != null;\n let {size} = useContext(InternalPickerContext);\n return (\n <ListBoxItem\n {...props}\n ref={ref}\n textValue={props.textValue || (typeof props.children === 'string' ? props.children as string : undefined)}\n style={pressScale(ref, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + menuitem({...renderProps, size, isLink}, props.styles)}>\n {(renderProps) => {\n let {children} = props;\n return (\n <DefaultProvider\n context={IconContext}\n value={{slots: {\n icon: {render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}), styles: icon}\n }}}>\n <DefaultProvider\n context={TextContext}\n value={{\n slots: {\n label: {styles: label({size})},\n description: {styles: description({...renderProps, size})}\n }\n }}>\n {!isLink && <CheckmarkIcon size={checkmarkIconSize[size]} className={checkmark({...renderProps, size})} />}\n {typeof children === 'string' ? <Text slot=\"label\">{children}</Text> : children}\n </DefaultProvider>\n </DefaultProvider>\n );\n }}\n </ListBoxItem>\n );\n}\n\n// A Context.Provider that only sets a value if not inside SelectValue.\nfunction DefaultProvider({context, value, children}: {context: React.Context<any>, value: any, children: any}) {\n let inSelectValue = useContext(InsideSelectValueContext);\n if (inSelectValue) {\n return children;\n }\n\n return <context.Provider value={value}>{children}</context.Provider>;\n}\n\nexport interface PickerSectionProps<T extends object> extends SectionProps<T> {}\nexport function PickerSection<T extends object>(props: PickerSectionProps<T>) {\n let {size} = useContext(InternalPickerContext);\n return (\n <>\n <AriaListBoxSection\n {...props}\n className={section({size})}>\n {props.children}\n </AriaListBoxSection>\n <Divider />\n </>\n );\n}\n"],"names":[],"version":3,"file":"Picker.css.map"}