@react-spectrum/s2 3.0.0-nightly-4baa1b08e-241029 → 3.0.0-nightly-dcc0752f8-241031

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 (270) hide show
  1. package/dist/ActionButton.cjs +10 -32
  2. package/dist/ActionButton.cjs.map +1 -1
  3. package/dist/ActionButton.css +20 -60
  4. package/dist/ActionButton.css.map +1 -1
  5. package/dist/ActionButton.mjs +10 -32
  6. package/dist/ActionButton.mjs.map +1 -1
  7. package/dist/Avatar.cjs +2 -4
  8. package/dist/Avatar.cjs.map +1 -1
  9. package/dist/Avatar.css +4 -16
  10. package/dist/Avatar.css.map +1 -1
  11. package/dist/Avatar.mjs +2 -4
  12. package/dist/Avatar.mjs.map +1 -1
  13. package/dist/Badge.cjs +5 -16
  14. package/dist/Badge.cjs.map +1 -1
  15. package/dist/Badge.css +10 -30
  16. package/dist/Badge.css.map +1 -1
  17. package/dist/Badge.mjs +5 -16
  18. package/dist/Badge.mjs.map +1 -1
  19. package/dist/Breadcrumbs.cjs +12 -41
  20. package/dist/Breadcrumbs.cjs.map +1 -1
  21. package/dist/Breadcrumbs.css +38 -86
  22. package/dist/Breadcrumbs.css.map +1 -1
  23. package/dist/Breadcrumbs.mjs +12 -41
  24. package/dist/Breadcrumbs.mjs.map +1 -1
  25. package/dist/Button.cjs +19 -59
  26. package/dist/Button.cjs.map +1 -1
  27. package/dist/Button.css +37 -113
  28. package/dist/Button.css.map +1 -1
  29. package/dist/Button.mjs +19 -59
  30. package/dist/Button.mjs.map +1 -1
  31. package/dist/Card.cjs +27 -67
  32. package/dist/Card.cjs.map +1 -1
  33. package/dist/Card.css +42 -117
  34. package/dist/Card.css.map +1 -1
  35. package/dist/Card.mjs +27 -67
  36. package/dist/Card.mjs.map +1 -1
  37. package/dist/Checkbox.cjs +9 -27
  38. package/dist/Checkbox.cjs.map +1 -1
  39. package/dist/Checkbox.css +17 -49
  40. package/dist/Checkbox.css.map +1 -1
  41. package/dist/Checkbox.mjs +9 -27
  42. package/dist/Checkbox.mjs.map +1 -1
  43. package/dist/CheckboxGroup.cjs +5 -16
  44. package/dist/CheckboxGroup.cjs.map +1 -1
  45. package/dist/CheckboxGroup.css +10 -30
  46. package/dist/CheckboxGroup.css.map +1 -1
  47. package/dist/CheckboxGroup.mjs +5 -16
  48. package/dist/CheckboxGroup.mjs.map +1 -1
  49. package/dist/ClearButton.cjs +6 -17
  50. package/dist/ClearButton.cjs.map +1 -1
  51. package/dist/ClearButton.css +11 -35
  52. package/dist/ClearButton.css.map +1 -1
  53. package/dist/ClearButton.mjs +6 -17
  54. package/dist/ClearButton.mjs.map +1 -1
  55. package/dist/CloseButton.cjs +10 -32
  56. package/dist/CloseButton.cjs.map +1 -1
  57. package/dist/CloseButton.css +20 -64
  58. package/dist/CloseButton.css.map +1 -1
  59. package/dist/CloseButton.mjs +10 -32
  60. package/dist/CloseButton.mjs.map +1 -1
  61. package/dist/ColorArea.cjs +4 -16
  62. package/dist/ColorArea.cjs.map +1 -1
  63. package/dist/ColorArea.css +8 -28
  64. package/dist/ColorArea.css.map +1 -1
  65. package/dist/ColorArea.mjs +4 -16
  66. package/dist/ColorArea.mjs.map +1 -1
  67. package/dist/ColorField.cjs +5 -16
  68. package/dist/ColorField.cjs.map +1 -1
  69. package/dist/ColorField.css +10 -30
  70. package/dist/ColorField.css.map +1 -1
  71. package/dist/ColorField.mjs +5 -16
  72. package/dist/ColorField.mjs.map +1 -1
  73. package/dist/ColorHandle.cjs +5 -15
  74. package/dist/ColorHandle.cjs.map +1 -1
  75. package/dist/ColorHandle.css +10 -30
  76. package/dist/ColorHandle.css.map +1 -1
  77. package/dist/ColorHandle.mjs +5 -15
  78. package/dist/ColorHandle.mjs.map +1 -1
  79. package/dist/ColorSlider.cjs +6 -17
  80. package/dist/ColorSlider.cjs.map +1 -1
  81. package/dist/ColorSlider.css +34 -50
  82. package/dist/ColorSlider.css.map +1 -1
  83. package/dist/ColorSlider.mjs +6 -17
  84. package/dist/ColorSlider.mjs.map +1 -1
  85. package/dist/ColorSwatch.cjs +8 -26
  86. package/dist/ColorSwatch.cjs.map +1 -1
  87. package/dist/ColorSwatch.css +16 -52
  88. package/dist/ColorSwatch.css.map +1 -1
  89. package/dist/ColorSwatch.mjs +8 -26
  90. package/dist/ColorSwatch.mjs.map +1 -1
  91. package/dist/ColorSwatchPicker.cjs +6 -16
  92. package/dist/ColorSwatchPicker.cjs.map +1 -1
  93. package/dist/ColorSwatchPicker.css +8 -28
  94. package/dist/ColorSwatchPicker.css.map +1 -1
  95. package/dist/ColorSwatchPicker.mjs +6 -16
  96. package/dist/ColorSwatchPicker.mjs.map +1 -1
  97. package/dist/ComboBox.cjs +23 -72
  98. package/dist/ComboBox.cjs.map +1 -1
  99. package/dist/ComboBox.css +64 -152
  100. package/dist/ComboBox.css.map +1 -1
  101. package/dist/ComboBox.mjs +24 -73
  102. package/dist/ComboBox.mjs.map +1 -1
  103. package/dist/ContextualHelp.cjs +1 -1
  104. package/dist/ContextualHelp.css +2 -6
  105. package/dist/ContextualHelp.css.map +1 -1
  106. package/dist/ContextualHelp.mjs +1 -1
  107. package/dist/Dialog.cjs +2 -2
  108. package/dist/Dialog.css +2 -2
  109. package/dist/Dialog.mjs +2 -2
  110. package/dist/Disclosure.cjs +22 -61
  111. package/dist/Disclosure.cjs.map +1 -1
  112. package/dist/Disclosure.css +47 -91
  113. package/dist/Disclosure.css.map +1 -1
  114. package/dist/Disclosure.mjs +22 -61
  115. package/dist/Disclosure.mjs.map +1 -1
  116. package/dist/DropZone.cjs +2 -4
  117. package/dist/DropZone.cjs.map +1 -1
  118. package/dist/DropZone.css +4 -16
  119. package/dist/DropZone.css.map +1 -1
  120. package/dist/DropZone.mjs +2 -4
  121. package/dist/DropZone.mjs.map +1 -1
  122. package/dist/Field.cjs +16 -47
  123. package/dist/Field.cjs.map +1 -1
  124. package/dist/Field.css +31 -95
  125. package/dist/Field.css.map +1 -1
  126. package/dist/Field.mjs +16 -47
  127. package/dist/Field.mjs.map +1 -1
  128. package/dist/IllustratedMessage.cjs +6 -20
  129. package/dist/IllustratedMessage.cjs.map +1 -1
  130. package/dist/IllustratedMessage.css +10 -24
  131. package/dist/IllustratedMessage.css.map +1 -1
  132. package/dist/IllustratedMessage.mjs +6 -20
  133. package/dist/IllustratedMessage.mjs.map +1 -1
  134. package/dist/Image.cjs +2 -2
  135. package/dist/Image.css +2 -2
  136. package/dist/Image.mjs +2 -2
  137. package/dist/InlineAlert.cjs +2 -5
  138. package/dist/InlineAlert.cjs.map +1 -1
  139. package/dist/InlineAlert.css +11 -15
  140. package/dist/InlineAlert.css.map +1 -1
  141. package/dist/InlineAlert.mjs +2 -5
  142. package/dist/InlineAlert.mjs.map +1 -1
  143. package/dist/Menu.cjs +23 -68
  144. package/dist/Menu.cjs.map +1 -1
  145. package/dist/Menu.css +32 -96
  146. package/dist/Menu.css.map +1 -1
  147. package/dist/Menu.mjs +24 -69
  148. package/dist/Menu.mjs.map +1 -1
  149. package/dist/Meter.cjs +22 -68
  150. package/dist/Meter.cjs.map +1 -1
  151. package/dist/Meter.css +63 -139
  152. package/dist/Meter.css.map +1 -1
  153. package/dist/Meter.mjs +22 -68
  154. package/dist/Meter.mjs.map +1 -1
  155. package/dist/Modal.cjs +2 -2
  156. package/dist/Modal.css +2 -2
  157. package/dist/Modal.mjs +2 -2
  158. package/dist/NumberField.cjs +23 -71
  159. package/dist/NumberField.cjs.map +1 -1
  160. package/dist/NumberField.css +63 -146
  161. package/dist/NumberField.css.map +1 -1
  162. package/dist/NumberField.mjs +23 -71
  163. package/dist/NumberField.mjs.map +1 -1
  164. package/dist/Picker.cjs +24 -68
  165. package/dist/Picker.cjs.map +1 -1
  166. package/dist/Picker.css +50 -130
  167. package/dist/Picker.css.map +1 -1
  168. package/dist/Picker.mjs +25 -69
  169. package/dist/Picker.mjs.map +1 -1
  170. package/dist/ProgressBar.cjs +23 -69
  171. package/dist/ProgressBar.cjs.map +1 -1
  172. package/dist/ProgressBar.css +64 -140
  173. package/dist/ProgressBar.css.map +1 -1
  174. package/dist/ProgressBar.mjs +23 -69
  175. package/dist/ProgressBar.mjs.map +1 -1
  176. package/dist/ProgressCircle.cjs +6 -20
  177. package/dist/ProgressCircle.cjs.map +1 -1
  178. package/dist/ProgressCircle.css +12 -40
  179. package/dist/ProgressCircle.css.map +1 -1
  180. package/dist/ProgressCircle.mjs +6 -20
  181. package/dist/ProgressCircle.mjs.map +1 -1
  182. package/dist/Provider.css +7 -0
  183. package/dist/Provider.css.map +1 -1
  184. package/dist/Radio.cjs +8 -26
  185. package/dist/Radio.cjs.map +1 -1
  186. package/dist/Radio.css +16 -48
  187. package/dist/Radio.css.map +1 -1
  188. package/dist/Radio.mjs +8 -26
  189. package/dist/Radio.mjs.map +1 -1
  190. package/dist/RadioGroup.cjs +5 -16
  191. package/dist/RadioGroup.cjs.map +1 -1
  192. package/dist/RadioGroup.css +10 -30
  193. package/dist/RadioGroup.css.map +1 -1
  194. package/dist/RadioGroup.mjs +5 -16
  195. package/dist/RadioGroup.mjs.map +1 -1
  196. package/dist/SearchField.cjs +5 -16
  197. package/dist/SearchField.cjs.map +1 -1
  198. package/dist/SearchField.css +10 -30
  199. package/dist/SearchField.css.map +1 -1
  200. package/dist/SearchField.mjs +5 -16
  201. package/dist/SearchField.mjs.map +1 -1
  202. package/dist/SegmentedControl.cjs +8 -14
  203. package/dist/SegmentedControl.cjs.map +1 -1
  204. package/dist/SegmentedControl.css +9 -29
  205. package/dist/SegmentedControl.css.map +1 -1
  206. package/dist/SegmentedControl.mjs +8 -14
  207. package/dist/SegmentedControl.mjs.map +1 -1
  208. package/dist/Slider.cjs +63 -196
  209. package/dist/Slider.cjs.map +1 -1
  210. package/dist/Slider.css +61 -181
  211. package/dist/Slider.css.map +1 -1
  212. package/dist/Slider.mjs +63 -196
  213. package/dist/Slider.mjs.map +1 -1
  214. package/dist/StatusLight.cjs +9 -27
  215. package/dist/StatusLight.cjs.map +1 -1
  216. package/dist/StatusLight.css +17 -49
  217. package/dist/StatusLight.css.map +1 -1
  218. package/dist/StatusLight.mjs +9 -27
  219. package/dist/StatusLight.mjs.map +1 -1
  220. package/dist/Switch.cjs +6 -15
  221. package/dist/Switch.cjs.map +1 -1
  222. package/dist/Switch.css +10 -26
  223. package/dist/Switch.css.map +1 -1
  224. package/dist/Switch.mjs +6 -15
  225. package/dist/Switch.mjs.map +1 -1
  226. package/dist/TableView.cjs +42 -86
  227. package/dist/TableView.cjs.map +1 -1
  228. package/dist/TableView.css +65 -129
  229. package/dist/TableView.css.map +1 -1
  230. package/dist/TableView.mjs +42 -86
  231. package/dist/TableView.mjs.map +1 -1
  232. package/dist/Tabs.cjs +4 -15
  233. package/dist/Tabs.cjs.map +1 -1
  234. package/dist/Tabs.css +18 -34
  235. package/dist/Tabs.css.map +1 -1
  236. package/dist/Tabs.mjs +4 -15
  237. package/dist/Tabs.mjs.map +1 -1
  238. package/dist/TagGroup.cjs +14 -37
  239. package/dist/TagGroup.cjs.map +1 -1
  240. package/dist/TagGroup.css +23 -67
  241. package/dist/TagGroup.css.map +1 -1
  242. package/dist/TagGroup.mjs +14 -37
  243. package/dist/TagGroup.mjs.map +1 -1
  244. package/dist/TextField.cjs +11 -34
  245. package/dist/TextField.cjs.map +1 -1
  246. package/dist/TextField.css +22 -66
  247. package/dist/TextField.css.map +1 -1
  248. package/dist/TextField.mjs +11 -34
  249. package/dist/TextField.mjs.map +1 -1
  250. package/dist/Tooltip.cjs +2 -4
  251. package/dist/Tooltip.cjs.map +1 -1
  252. package/dist/Tooltip.css +4 -12
  253. package/dist/Tooltip.css.map +1 -1
  254. package/dist/Tooltip.mjs +2 -4
  255. package/dist/Tooltip.mjs.map +1 -1
  256. package/dist/types.d.ts +2 -2
  257. package/dist/types.d.ts.map +1 -1
  258. package/package.json +17 -17
  259. package/page.css +7 -0
  260. package/src/ComboBox.tsx +3 -3
  261. package/src/Menu.tsx +5 -5
  262. package/src/Picker.tsx +3 -3
  263. package/src/page.macro.ts +11 -0
  264. package/style/dist/spectrum-theme.cjs +2 -8
  265. package/style/dist/spectrum-theme.cjs.map +1 -1
  266. package/style/dist/spectrum-theme.mjs +2 -8
  267. package/style/dist/spectrum-theme.mjs.map +1 -1
  268. package/style/dist/types.d.ts +1 -4
  269. package/style/dist/types.d.ts.map +1 -1
  270. package/style/spectrum-theme.ts +4 -4
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA0CM,MAAM,0DAA0B,CAAA,GAAA,oBAAY,EAAoE;AAEvH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCN,MAAM,sEAAkC,CAAA,GAAA,oBAAY,EAAwC,CAAC;AAE7F,SAAS,uCAAiB,KAA4B,EAAE,GAA2B;IACjF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,sBACF,kBAAkB,eAClB,WAAW,qBACX,iBAAiB,EAClB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI,UAAU,CAAA,GAAA,aAAK,EAAW;IAC9B,IAAI,qBAAqB,CAAA,GAAA,aAAK,EAAkB;IAEhD,IAAI,WAAW,CAAC;QACd,IAAI,mBAAmB,OAAO,EAC5B,QAAQ,OAAO,GAAG,oBAAoB,QAAQ;QAGhD,IAAI,mBACF,kBAAkB;IAEtB;IAEA,qBACE,gBAAC,CAAA,GAAA,iBAAS;QACP,GAAG,KAAK;QACT,OAAO;QACP,cAAc;QACd,KAAK;QACL,aAAY;QACZ,OAAO,MAAM,YAAY;QACzB,UAAU;QACV,WAAW,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK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AE,CAAC;oCAAC;gCAAC;6BAAE;4BAC/C;gCAAC,CAAA,GAAA,yCAAU;gCAAG;oCAAC,MAAM;gCAAmC;6BAAE;yBAC3D;kCACD,cAAA,gBAAC;4BAAI,KAAK;4BAAQ,OAAO,CAAA,GAAA,yCAAS,EAAE,QAAQ;2CAAC;4BAAS;4BAAI,SAAS;sCAChE,OAAO,MAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0CAAG,MAAM,QAAQ;iCAAW,MAAM,QAAQ;;;;;;AAQlG;AAEA;;CAEC,GACD,MAAM,4CAAwB,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE;AAGvD;;CAEC,GACD,MAAM,4CAAoB,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/SegmentedControl.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 {AriaLabelingProps, DOMRef, DOMRefValue, FocusableRef} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, Radio, RadioGroup, RadioGroupStateContext, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';\nimport {focusRing, size, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display in the segmented control.\n */\n children: ReactNode,\n /**\n * Whether the segmented control is disabled.\n */\n isDisabled?: boolean,\n /** The id of the currently selected item (controlled). */\n selectedKey?: string | null,\n /** The id of the initial selected item (uncontrolled). */\n defaultSelectedKey?: string,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (id: string) => void\n}\nexport interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {\n /**\n * The content to display in the segmented control item.\n */\n children: ReactNode,\n /** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */\n id: string,\n /** Whether the item is disabled or not. */\n isDisabled?: boolean\n}\n\nexport const SegmentedControlContext = createContext<ContextValue<SegmentedControlProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst segmentedControl = style<{size: string}>({\n font: 'control',\n display: 'flex',\n backgroundColor: 'gray-100',\n borderRadius: 'lg',\n width: 'full'\n}, getAllowedOverrides());\n\nconst controlItem = style({\n position: 'relative',\n display: 'flex',\n forcedColorAdjust: 'none',\n color: {\n default: 'gray-700',\n isHovered: 'neutral-subdued',\n isSelected: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText',\n isSelected: 'HighlightText'\n }\n },\n // TODO: update this padding for icon-only items when we introduce the non-track style back\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]:only-child)': size(6)\n },\n height: 32,\n alignItems: 'center',\n flexBasis: 0,\n flexGrow: 1,\n flexShrink: 0,\n minWidth: 0,\n justifyContent: 'center',\n whiteSpace: 'nowrap',\n disableTapHighlight: true,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nconst slider = style({\n ...focusRing(),\n backgroundColor: {\n default: 'gray-25',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n left: 0,\n width: 'full',\n height: 'full',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'lg'\n});\n\ninterface InternalSegmentedControlContextProps {\n register?: (value: string, isDisabled?: boolean) => void,\n prevRef?: RefObject<DOMRect | null>,\n currentSelectedRef?: RefObject<HTMLDivElement | null>\n}\n\ninterface DefaultSelectionTrackProps {\n defaultValue?: string | null,\n value?: string | null,\n children?: ReactNode,\n prevRef: RefObject<DOMRect | null>,\n currentSelectedRef: RefObject<HTMLDivElement | null>\n}\n\nconst InternalSegmentedControlContext = createContext<InternalSegmentedControlContextProps>({});\n\nfunction SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);\n let {\n defaultSelectedKey,\n selectedKey,\n onSelectionChange\n } = props;\n let domRef = useDOMRef(ref);\n\n let prevRef = useRef<DOMRect>(null);\n let currentSelectedRef = useRef<HTMLDivElement>(null);\n\n let onChange = (value: string) => {\n if (currentSelectedRef.current) {\n prevRef.current = currentSelectedRef?.current.getBoundingClientRect();\n }\n \n if (onSelectionChange) {\n onSelectionChange(value);\n }\n };\n\n return (\n <RadioGroup \n {...props}\n value={selectedKey}\n defaultValue={defaultSelectedKey}\n ref={domRef}\n orientation=\"horizontal\"\n style={props.UNSAFE_style}\n onChange={onChange}\n className={(props.UNSAFE_className || '') + segmentedControl({size: 'M'}, props.styles)}\n aria-label={props['aria-label']}>\n <DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef}>\n {props.children}\n </DefaultSelectionTracker>\n </RadioGroup>\n );\n}\n\nfunction DefaultSelectionTracker(props: DefaultSelectionTrackProps) {\n let state = useContext(RadioGroupStateContext);\n let isRegistered = useRef(!(props.defaultValue == null && props.value == null));\n\n // default select the first available item\n let register = useCallback((value: string) => {\n if (state && !isRegistered.current) {\n isRegistered.current = true;\n state.setSelectedValue(value);\n }\n }, []);\n\n return (\n <Provider\n values={[\n [InternalSegmentedControlContext, {register: register, prevRef: props.prevRef, currentSelectedRef: props.currentSelectedRef}]\n ]}> \n {props.children}\n </Provider>\n );\n}\n\nfunction SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLLabelElement>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let divRef = useRef<HTMLDivElement>(null);\n let {register, prevRef, currentSelectedRef} = useContext(InternalSegmentedControlContext);\n let state = useContext(RadioGroupStateContext);\n let isSelected = props.id === state?.selectedValue;\n // do not apply animation if a user has the prefers-reduced-motion setting\n let isReduced = false;\n if (window?.matchMedia) {\n isReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n\n useLayoutEffect(() => {\n register?.(props.id);\n }, []);\n\n useLayoutEffect(() => {\n if (isSelected && prevRef?.current && currentSelectedRef?.current && !isReduced) {\n let currentItem = currentSelectedRef?.current.getBoundingClientRect();\n\n let deltaX = prevRef?.current.left - currentItem?.left;\n\n currentSelectedRef.current.animate(\n [\n {transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},\n {transform: 'translateX(0px)', width: `${currentItem.width}px`}\n ],\n {\n duration: 200,\n easing: 'ease-out'\n }\n );\n\n prevRef.current = null;\n }\n }, [isSelected]);\n\n return (\n <Radio \n {...props}\n value={props.id}\n ref={domRef} \n inputRef={inputRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps}, props.styles)} >\n {({isSelected, isFocusVisible, isPressed, isDisabled}) => (\n <>\n {isSelected && <div className={slider({isFocusVisible, isDisabled})} ref={currentSelectedRef} />}\n <Provider \n values={[\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0, flexShrink: 0})})\n }],\n [RACTextContext, {slots: {[DEFAULT_SLOT]: {}}}],\n [TextContext, {styles: style({order: 1, truncate: true})}]\n ]}>\n <div ref={divRef} style={pressScale(divRef)({isPressed})} className={style({zIndex: 1, display: 'flex', gap: 'text-to-visual', transition: 'default', alignItems: 'center', minWidth: 0})}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </div>\n </Provider>\n </>\n )\n }\n </Radio>\n );\n}\n\n/**\n * A SegmentedControlItem represents an option within a SegmentedControl.\n */\nconst _SegmentedControlItem = /*#__PURE__*/ forwardRef(SegmentedControlItem);\nexport {_SegmentedControlItem as SegmentedControlItem};\n\n/**\n * A SegmentedControl is a mutually exclusive group of buttons used for view switching.\n */\nconst _SegmentedControl = /*#__PURE__*/ forwardRef(SegmentedControl);\nexport {_SegmentedControl as SegmentedControl};\n"],"names":[],"version":3,"file":"SegmentedControl.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA0CM,MAAM,0DAA0B,CAAA,GAAA,oBAAY,EAAoE;AAEvH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCN,MAAM,sEAAkC,CAAA,GAAA,oBAAY,EAAwC,CAAC;AAE7F,SAAS,uCAAiB,KAA4B,EAAE,GAA2B;IACjF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,sBACF,kBAAkB,eAClB,WAAW,qBACX,iBAAiB,EAClB,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI,UAAU,CAAA,GAAA,aAAK,EAAW;IAC9B,IAAI,qBAAqB,CAAA,GAAA,aAAK,EAAkB;IAEhD,IAAI,WAAW,CAAC;QACd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U;wBAAI,KAAK;;kCAC1E,gBAAC,CAAA,GAAA,eAAO;wBACN,QAAQ;4BACN;gCAAC,CAAA,GAAA,yCAAU;gCAAG;oCACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;wCAAC,MAAM;wCAAQ,MAAM;oCAAkC;gCAChF;6BAAE;4BACF;gCAAC,CAAA,GAAA,kBAAa;gCAAG;oCAAC,OAAO;wCAAC,CAAC,CAAA,GAAA,mBAAW,EAAE,EAAE,CAAC;oCAAC;gCAAC;6BAAE;4BAC/C;gCAAC,CAAA,GAAA,yCAAU;gCAAG;oCAAC,MAAM;gCAAmC;6BAAE;yBAC3D;kCACD,cAAA,gBAAC;4BAAI,KAAK;4BAAQ,OAAO,CAAA,GAAA,yCAAS,EAAE,QAAQ;2CAAC;4BAAS;4BAAI,SAAS;sCAChE,OAAO,MAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0CAAG,MAAM,QAAQ;iCAAW,MAAM,QAAQ;;;;;;AAQlG;AAEA;;CAEC,GACD,MAAM,4CAAwB,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE;AAGvD;;CAEC,GACD,MAAM,4CAAoB,WAAW,GAAG,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/SegmentedControl.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 {AriaLabelingProps, DOMRef, DOMRefValue, FocusableRef} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {ContextValue, DEFAULT_SLOT, Provider, TextContext as RACTextContext, Radio, RadioGroup, RadioGroupStateContext, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef, ReactNode, RefObject, useCallback, useContext, useRef} from 'react';\nimport {focusRing, size, style} from '../style' with {type: 'macro'};\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SegmentedControlProps extends AriaLabelingProps, StyleProps, SlotProps {\n /**\n * The content to display in the segmented control.\n */\n children: ReactNode,\n /**\n * Whether the segmented control is disabled.\n */\n isDisabled?: boolean,\n /** The id of the currently selected item (controlled). */\n selectedKey?: string | null,\n /** The id of the initial selected item (uncontrolled). */\n defaultSelectedKey?: string,\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (id: string) => void\n}\nexport interface SegmentedControlItemProps extends AriaLabelingProps, StyleProps {\n /**\n * The content to display in the segmented control item.\n */\n children: ReactNode,\n /** The id of the item, matching the value used in SegmentedControl's `selectedKey` prop. */\n id: string,\n /** Whether the item is disabled or not. */\n isDisabled?: boolean\n}\n\nexport const SegmentedControlContext = createContext<ContextValue<SegmentedControlProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst segmentedControl = style<{size: string}>({\n font: 'control',\n display: 'flex',\n backgroundColor: 'gray-100',\n borderRadius: 'lg',\n width: 'full'\n}, getAllowedOverrides());\n\nconst controlItem = style({\n position: 'relative',\n display: 'flex',\n forcedColorAdjust: 'none',\n color: {\n default: 'gray-700',\n isHovered: 'neutral-subdued',\n isSelected: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText',\n isSelected: 'HighlightText'\n }\n },\n // TODO: update this padding for icon-only items when we introduce the non-track style back\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]:only-child)': size(6)\n },\n height: 32,\n alignItems: 'center',\n flexBasis: 0,\n flexGrow: 1,\n flexShrink: 0,\n minWidth: 0,\n justifyContent: 'center',\n whiteSpace: 'nowrap',\n disableTapHighlight: true,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\nconst slider = style({\n ...focusRing(),\n backgroundColor: {\n default: 'gray-25',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n left: 0,\n width: 'full',\n height: 'full',\n position: 'absolute',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n borderRadius: 'lg'\n});\n\ninterface InternalSegmentedControlContextProps {\n register?: (value: string, isDisabled?: boolean) => void,\n prevRef?: RefObject<DOMRect | null>,\n currentSelectedRef?: RefObject<HTMLDivElement | null>\n}\n\ninterface DefaultSelectionTrackProps {\n defaultValue?: string | null,\n value?: string | null,\n children?: ReactNode,\n prevRef: RefObject<DOMRect | null>,\n currentSelectedRef: RefObject<HTMLDivElement | null>\n}\n\nconst InternalSegmentedControlContext = createContext<InternalSegmentedControlContextProps>({});\n\nfunction SegmentedControl(props: SegmentedControlProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SegmentedControlContext);\n let {\n defaultSelectedKey,\n selectedKey,\n onSelectionChange\n } = props;\n let domRef = useDOMRef(ref);\n\n let prevRef = useRef<DOMRect>(null);\n let currentSelectedRef = useRef<HTMLDivElement>(null);\n\n let onChange = (value: string) => {\n if (currentSelectedRef.current) {\n prevRef.current = currentSelectedRef?.current.getBoundingClientRect();\n }\n \n if (onSelectionChange) {\n onSelectionChange(value);\n }\n };\n\n return (\n <RadioGroup \n {...props}\n value={selectedKey}\n defaultValue={defaultSelectedKey}\n ref={domRef}\n orientation=\"horizontal\"\n style={props.UNSAFE_style}\n onChange={onChange}\n className={(props.UNSAFE_className || '') + segmentedControl({size: 'M'}, props.styles)}\n aria-label={props['aria-label']}>\n <DefaultSelectionTracker defaultValue={defaultSelectedKey} value={selectedKey} prevRef={prevRef} currentSelectedRef={currentSelectedRef}>\n {props.children}\n </DefaultSelectionTracker>\n </RadioGroup>\n );\n}\n\nfunction DefaultSelectionTracker(props: DefaultSelectionTrackProps) {\n let state = useContext(RadioGroupStateContext);\n let isRegistered = useRef(!(props.defaultValue == null && props.value == null));\n\n // default select the first available item\n let register = useCallback((value: string) => {\n if (state && !isRegistered.current) {\n isRegistered.current = true;\n state.setSelectedValue(value);\n }\n }, []);\n\n return (\n <Provider\n values={[\n [InternalSegmentedControlContext, {register: register, prevRef: props.prevRef, currentSelectedRef: props.currentSelectedRef}]\n ]}> \n {props.children}\n </Provider>\n );\n}\n\nfunction SegmentedControlItem(props: SegmentedControlItemProps, ref: FocusableRef<HTMLLabelElement>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let divRef = useRef<HTMLDivElement>(null);\n let {register, prevRef, currentSelectedRef} = useContext(InternalSegmentedControlContext);\n let state = useContext(RadioGroupStateContext);\n let isSelected = props.id === state?.selectedValue;\n // do not apply animation if a user has the prefers-reduced-motion setting\n let isReduced = false;\n if (window?.matchMedia) {\n isReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n\n useLayoutEffect(() => {\n register?.(props.id);\n }, []);\n\n useLayoutEffect(() => {\n if (isSelected && prevRef?.current && currentSelectedRef?.current && !isReduced) {\n let currentItem = currentSelectedRef?.current.getBoundingClientRect();\n\n let deltaX = prevRef?.current.left - currentItem?.left;\n\n currentSelectedRef.current.animate(\n [\n {transform: `translateX(${deltaX}px)`, width: `${prevRef?.current.width}px`},\n {transform: 'translateX(0px)', width: `${currentItem.width}px`}\n ],\n {\n duration: 200,\n easing: 'ease-out'\n }\n );\n\n prevRef.current = null;\n }\n }, [isSelected]);\n\n return (\n <Radio \n {...props}\n value={props.id}\n ref={domRef} \n inputRef={inputRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + controlItem({...renderProps}, props.styles)} >\n {({isSelected, isFocusVisible, isPressed, isDisabled}) => (\n <>\n {isSelected && <div className={slider({isFocusVisible, isDisabled})} ref={currentSelectedRef} />}\n <Provider \n values={[\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0, flexShrink: 0})})\n }],\n [RACTextContext, {slots: {[DEFAULT_SLOT]: {}}}],\n [TextContext, {styles: style({order: 1, truncate: true})}]\n ]}>\n <div ref={divRef} style={pressScale(divRef)({isPressed})} className={style({zIndex: 1, display: 'flex', gap: 'text-to-visual', transition: 'default', alignItems: 'center', minWidth: 0})}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </div>\n </Provider>\n </>\n )\n }\n </Radio>\n );\n}\n\n/**\n * A SegmentedControlItem represents an option within a SegmentedControl.\n */\nconst _SegmentedControlItem = /*#__PURE__*/ forwardRef(SegmentedControlItem);\nexport {_SegmentedControlItem as SegmentedControlItem};\n\n/**\n * A SegmentedControl is a mutually exclusive group of buttons used for view switching.\n */\nconst _SegmentedControl = /*#__PURE__*/ forwardRef(SegmentedControl);\nexport {_SegmentedControl as SegmentedControl};\n"],"names":[],"version":3,"file":"SegmentedControl.mjs.map"}
package/dist/Slider.cjs CHANGED
@@ -100,7 +100,7 @@ const $e937566cb5c6349c$var$labelContainer = function anonymous(props) {
100
100
  rules += ' __b-4e9m05';
101
101
  rules += ' __c-4e9m05';
102
102
  rules += ' __d-4e9m05';
103
- rules += ' l4';
103
+ rules += ' lG';
104
104
  if (props.labelPosition === "top") rules += ' __j-qdp51y';
105
105
  if (props.labelPosition === "top") rules += ' __h-u2tns7';
106
106
  if (props.labelPosition === "side") {
@@ -133,50 +133,23 @@ let $e937566cb5c6349c$export$6b2a7d5132615086 = function anonymous(props) {
133
133
  rules += ' __c-4ka10a';
134
134
  rules += ' __d-4ka10a';
135
135
  rules += ' Uc';
136
- rules += ' l4';
137
- if (props.size === "XL") {
138
- rules += ' kby';
139
- rules += ' kx';
140
- } else if (props.size === "L") {
141
- rules += ' kbu';
142
- rules += ' kr';
143
- } else if (props.size === "M") {
144
- rules += ' kbr';
145
- rules += ' kq';
146
- } else if (props.size === "S") {
147
- rules += ' kbn';
148
- rules += ' km';
149
- }
136
+ rules += ' lG';
137
+ if (props.size === "XL") rules += ' kn';
138
+ else if (props.size === "L") rules += ' kl';
139
+ else if (props.size === "M") rules += ' kj';
140
+ else if (props.size === "S") rules += ' kh';
150
141
  return rules;
151
142
  };
152
143
  let $e937566cb5c6349c$export$7814bee2738c4c3 = function anonymous(props) {
153
144
  let rules = " .";
154
- if (props.size === "XL") {
155
- rules += ' lbn';
156
- rules += ' lm';
157
- } else if (props.size === "L") {
158
- rules += ' lb-1u8pit0';
159
- rules += ' l-16cidj';
160
- } else if (props.size === "M") {
161
- rules += ' lbl';
162
- rules += ' lk';
163
- } else if (props.size === "S") {
164
- rules += ' lb-1nxaedl';
165
- rules += ' l-1ytbuww';
166
- }
167
- if (props.size === "XL") {
168
- rules += ' kbn';
169
- rules += ' km';
170
- } else if (props.size === "L") {
171
- rules += ' kb-1u8pit0';
172
- rules += ' k-16cidj';
173
- } else if (props.size === "M") {
174
- rules += ' kbl';
175
- rules += ' kk';
176
- } else if (props.size === "S") {
177
- rules += ' kb-1nxaedl';
178
- rules += ' k-1ytbuww';
179
- }
145
+ if (props.size === "XL") rules += ' lh';
146
+ else if (props.size === "L") rules += ' l-10sr2ub';
147
+ else if (props.size === "M") rules += ' lg';
148
+ else if (props.size === "S") rules += ' l-9ed7ss';
149
+ if (props.size === "XL") rules += ' kh';
150
+ else if (props.size === "L") rules += ' k-10sr2ub';
151
+ else if (props.size === "M") rules += ' kg';
152
+ else if (props.size === "S") rules += ' k-9ed7ss';
180
153
  rules += ' _Zb';
181
154
  rules += ' Ua';
182
155
  rules += ' X-3760fj';
@@ -185,62 +158,26 @@ let $e937566cb5c6349c$export$7814bee2738c4c3 = function anonymous(props) {
185
158
  let $e937566cb5c6349c$export$f120a3c6038107a5 = function anonymous(props) {
186
159
  let rules = " .";
187
160
  if (props.thumbStyle === "precise") {
188
- if (props.size === "XL") {
189
- rules += ' lb-1qh0xw';
190
- rules += ' l-30pu91';
191
- } else if (props.size === "L") {
192
- rules += ' lbn';
193
- rules += ' lm';
194
- } else if (props.size === "M") {
195
- rules += ' lb-1u8pit0';
196
- rules += ' l-16cidj';
197
- } else if (props.size === "S") {
198
- rules += ' lbl';
199
- rules += ' lk';
200
- }
161
+ if (props.size === "XL") rules += ' l-z22p4x';
162
+ else if (props.size === "L") rules += ' lh';
163
+ else if (props.size === "M") rules += ' l-10sr2ub';
164
+ else if (props.size === "S") rules += ' lg';
201
165
  } else if (props.thumbStyle === "default") {
202
- if (props.size === "XL") {
203
- rules += ' lbn';
204
- rules += ' lm';
205
- } else if (props.size === "L") {
206
- rules += ' lb-1u8pit0';
207
- rules += ' l-16cidj';
208
- } else if (props.size === "M") {
209
- rules += ' lbl';
210
- rules += ' lk';
211
- } else if (props.size === "S") {
212
- rules += ' lb-1nxaedl';
213
- rules += ' l-1ytbuww';
214
- }
166
+ if (props.size === "XL") rules += ' lh';
167
+ else if (props.size === "L") rules += ' l-10sr2ub';
168
+ else if (props.size === "M") rules += ' lg';
169
+ else if (props.size === "S") rules += ' l-9ed7ss';
215
170
  }
216
171
  if (props.thumbStyle === "precise") {
217
- if (props.size === "XL") {
218
- rules += ' kb-1qh0xw';
219
- rules += ' k-30pu91';
220
- } else if (props.size === "L") {
221
- rules += ' kbn';
222
- rules += ' km';
223
- } else if (props.size === "M") {
224
- rules += ' kb-1u8pit0';
225
- rules += ' k-16cidj';
226
- } else if (props.size === "S") {
227
- rules += ' kbl';
228
- rules += ' kk';
229
- }
172
+ if (props.size === "XL") rules += ' k-z22p4x';
173
+ else if (props.size === "L") rules += ' kh';
174
+ else if (props.size === "M") rules += ' k-10sr2ub';
175
+ else if (props.size === "S") rules += ' kg';
230
176
  } else if (props.thumbStyle === "default") {
231
- if (props.size === "XL") {
232
- rules += ' kbn';
233
- rules += ' km';
234
- } else if (props.size === "L") {
235
- rules += ' kb-1u8pit0';
236
- rules += ' k-16cidj';
237
- } else if (props.size === "M") {
238
- rules += ' kbl';
239
- rules += ' kk';
240
- } else if (props.size === "S") {
241
- rules += ' kb-1nxaedl';
242
- rules += ' k-1ytbuww';
243
- }
177
+ if (props.size === "XL") rules += ' kh';
178
+ else if (props.size === "L") rules += ' k-10sr2ub';
179
+ else if (props.size === "M") rules += ' kg';
180
+ else if (props.size === "S") rules += ' k-9ed7ss';
244
181
  }
245
182
  return rules;
246
183
  };
@@ -258,52 +195,23 @@ let $e937566cb5c6349c$export$becc9140d0e846f8 = function anonymous(props) {
258
195
  rules += ' X-3760fj';
259
196
  rules += ' Y-3760fj';
260
197
  rules += ' T-s83jgi';
261
- if (props.thumbStyle === "precise") {
262
- rules += ' lb-1aa9md1';
263
- rules += ' l-6njx2e';
264
- } else if (props.thumbStyle === "default") {
265
- if (props.size === "XL") {
266
- rules += ' lbn';
267
- rules += ' lm';
268
- } else if (props.size === "L") {
269
- rules += ' lb-1u8pit0';
270
- rules += ' l-16cidj';
271
- } else if (props.size === "M") {
272
- rules += ' lbl';
273
- rules += ' lk';
274
- } else if (props.size === "S") {
275
- rules += ' lb-1nxaedl';
276
- rules += ' l-1ytbuww';
277
- }
198
+ if (props.thumbStyle === "precise") rules += ' l-ve8p9e';
199
+ else if (props.thumbStyle === "default") {
200
+ if (props.size === "XL") rules += ' lh';
201
+ else if (props.size === "L") rules += ' l-10sr2ub';
202
+ else if (props.size === "M") rules += ' lg';
203
+ else if (props.size === "S") rules += ' l-9ed7ss';
278
204
  }
279
205
  if (props.thumbStyle === "precise") {
280
- if (props.size === "XL") {
281
- rules += ' kb-1qh0xw';
282
- rules += ' k-30pu91';
283
- } else if (props.size === "L") {
284
- rules += ' kbn';
285
- rules += ' km';
286
- } else if (props.size === "M") {
287
- rules += ' kb-1u8pit0';
288
- rules += ' k-16cidj';
289
- } else if (props.size === "S") {
290
- rules += ' kbl';
291
- rules += ' kk';
292
- }
206
+ if (props.size === "XL") rules += ' k-z22p4x';
207
+ else if (props.size === "L") rules += ' kh';
208
+ else if (props.size === "M") rules += ' k-10sr2ub';
209
+ else if (props.size === "S") rules += ' kg';
293
210
  } else if (props.thumbStyle === "default") {
294
- if (props.size === "XL") {
295
- rules += ' kbn';
296
- rules += ' km';
297
- } else if (props.size === "L") {
298
- rules += ' kb-1u8pit0';
299
- rules += ' k-16cidj';
300
- } else if (props.size === "M") {
301
- rules += ' kbl';
302
- rules += ' kk';
303
- } else if (props.size === "S") {
304
- rules += ' kb-1nxaedl';
305
- rules += ' k-1ytbuww';
306
- }
211
+ if (props.size === "XL") rules += ' kh';
212
+ else if (props.size === "L") rules += ' k-10sr2ub';
213
+ else if (props.size === "M") rules += ' kg';
214
+ else if (props.size === "S") rules += ' k-9ed7ss';
307
215
  }
308
216
  rules += ' _vf';
309
217
  rules += ' _wf';
@@ -339,13 +247,8 @@ const $e937566cb5c6349c$var$trackStyling = {
339
247
  };
340
248
  let $e937566cb5c6349c$export$1e1dc99b6e2204f1 = function anonymous(props) {
341
249
  let rules = " .";
342
- if (props.trackStyle === "thick") {
343
- rules += ' kbk';
344
- rules += ' kj';
345
- } else if (props.trackStyle === "thin") {
346
- rules += ' kbe';
347
- rules += ' kd';
348
- }
250
+ if (props.trackStyle === "thick") rules += ' kf';
251
+ else if (props.trackStyle === "thin") rules += ' kc';
349
252
  rules += ' X-3760fj';
350
253
  if (props.trackStyle === "thick") rules += ' _vb';
351
254
  else if (props.trackStyle === "thin") rules += ' _vd';
@@ -359,7 +262,7 @@ let $e937566cb5c6349c$export$1e1dc99b6e2204f1 = function anonymous(props) {
359
262
  if (props.isDisabled) rules += ' bg';
360
263
  else rules += ' bi';
361
264
  rules += ' Q-yj8axo';
362
- rules += ' l4';
265
+ rules += ' lG';
363
266
  rules += ' __na';
364
267
  rules += ' wa';
365
268
  rules += ' u-yj94cw';
@@ -373,13 +276,8 @@ let $e937566cb5c6349c$export$1e1dc99b6e2204f1 = function anonymous(props) {
373
276
  };
374
277
  let $e937566cb5c6349c$export$847ceef3bc944d02 = function anonymous(props) {
375
278
  let rules = " .";
376
- if (props.trackStyle === "thick") {
377
- rules += ' kbk';
378
- rules += ' kj';
379
- } else if (props.trackStyle === "thin") {
380
- rules += ' kbe';
381
- rules += ' kd';
382
- }
279
+ if (props.trackStyle === "thick") rules += ' kf';
280
+ else if (props.trackStyle === "thin") rules += ' kc';
383
281
  rules += ' X-3760fj';
384
282
  if (props.trackStyle === "thick") rules += ' _vb';
385
283
  else if (props.trackStyle === "thin") rules += ' _vd';
@@ -451,22 +349,11 @@ function $e937566cb5c6349c$export$9418495bb635ebde(props1) {
451
349
  rules += ' _1d';
452
350
  rules += ' _f-1x99dlob';
453
351
  rules += ' _fa';
454
- if (props.size === "XL") {
455
- rules += ' -aqrvqh_k-by';
456
- rules += ' -aqrvqh_k-x';
457
- } else if (props.size === "L") {
458
- rules += ' -aqrvqh_k-bu';
459
- rules += ' -aqrvqh_k-r';
460
- } else if (props.size === "S") {
461
- rules += ' -aqrvqh_k-bn';
462
- rules += ' -aqrvqh_k-m';
463
- } else if (props.size === "XS") {
464
- rules += ' -aqrvqh_k-bl';
465
- rules += ' -aqrvqh_k-k';
466
- } else {
467
- rules += ' -aqrvqh_k-br';
468
- rules += ' -aqrvqh_k-q';
469
- }
352
+ if (props.size === "XL") rules += ' -aqrvqh_k-n';
353
+ else if (props.size === "L") rules += ' -aqrvqh_k-l';
354
+ else if (props.size === "S") rules += ' -aqrvqh_k-h';
355
+ else if (props.size === "XS") rules += ' -aqrvqh_k-g';
356
+ else rules += ' -aqrvqh_k-j';
470
357
  rules += ' -_1inj1bc_i--prjw07';
471
358
  rules += ' je';
472
359
  rules += ' __R-yksgrp';
@@ -542,37 +429,17 @@ function $e937566cb5c6349c$export$9418495bb635ebde(props1) {
542
429
  rules += ' __b-4cfph1';
543
430
  rules += ' __c-4cfph1';
544
431
  rules += ' __d-4cfph1';
545
- if (props.size === "XL") {
546
- rules += ' qby';
547
- rules += ' qx';
548
- } else if (props.size === "L") {
549
- rules += ' qbu';
550
- rules += ' qr';
551
- } else if (props.size === "S") {
552
- rules += ' qbn';
553
- rules += ' qm';
554
- } else if (props.size === "XS") {
555
- rules += ' qbl';
556
- rules += ' qk';
557
- } else {
558
- rules += ' qbr';
559
- rules += ' qq';
560
- }
432
+ if (props.size === "XL") rules += ' qn';
433
+ else if (props.size === "L") rules += ' ql';
434
+ else if (props.size === "S") rules += ' qh';
435
+ else if (props.size === "XS") rules += ' qg';
436
+ else rules += ' qj';
561
437
  if (props.isQuiet) rules += ' __ma';
562
438
  else rules += ' __m-1s8glxue';
563
- if (props.size === "XL") {
564
- rules += ' -usygro_l-bV';
565
- rules += ' -usygro_l-Q';
566
- } else if (props.size === "L") {
567
- rules += ' -usygro_l-bU';
568
- rules += ' -usygro_l-T';
569
- } else if (props.size === "S") {
570
- rules += ' -usygro_l-bQ';
571
- rules += ' -usygro_l-P';
572
- } else {
573
- rules += ' -usygro_l-bS';
574
- rules += ' -usygro_l-R';
575
- }
439
+ if (props.size === "XL") rules += ' -usygro_l-A';
440
+ else if (props.size === "L") rules += ' -usygro_l-z';
441
+ else if (props.size === "S") rules += ' -usygro_l-x';
442
+ else rules += ' -usygro_l-y';
576
443
  rules += ' m-rwozxi';
577
444
  rules += ' _Ze';
578
445
  rules += ' _1c';
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAgE;AAEzG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBN,MAAM;;;;;;;;;;;;;;;;;AAoCN,MAAM;;;;;;;;;;;;;;;;AAqBC,IAAI;;;;;;;;;;;;;;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C,aAAa,EAAE,CAAC,EAAE,SAAS,IAAI,CAAC,CAAC;4BAAA;4BAAG,WAAW,0CAAY;4CAAC;8CAAY;4CAAc;4BAAU;;sCACtJ,gCAAC,CAAA,GAAA,sCAAU;4BAAG,WAAW;4BAAgB,OAAO;4BAAG,MAAM,MAAM,IAAI;4BAAE,KAAK;4BAAU,OAAO,CAAC,cAAgB,CAAA,GAAA,oCAAS,EAAE,UAAU;oCAAC,WAAW;gCAAuB,GAAG;oCAAC,GAAG,WAAW;oCAAE,WAAW,YAAY,UAAU;gCAAA;sCACtN,CAAC,4BACA,gCAAC;oCAAI,WAAW,0CAAa;8CAAC;oCAAI;8CAChC,cAAA,gCAAC;wCACC,WAAW,0CAAM;4CACf,GAAG,WAAW;kDACd;wDACA;wCACF;;;;;;YAMd;;;AAIR;AAEA,IAAI,4CAAU,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Slider.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 Slider as AriaSlider,\n SliderProps as AriaSliderProps,\n ContextValue,\n SliderOutput,\n SliderThumb,\n SliderTrack\n} from 'react-aria-components';\nimport {clamp} from '@react-aria/utils';\nimport {createContext, forwardRef, ReactNode, RefObject, useContext, useRef} from 'react';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {FocusableRef, FocusableRefValue, InputDOMProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {focusRing, size, style} from '../style' with {type: 'macro'};\nimport {FormContext, useFormProps} from './Form';\nimport {mergeStyles} from '../style/runtime';\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useLocale, useNumberFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SliderBaseProps<T> extends Omit<AriaSliderProps<T>, 'children' | 'style' | 'className' | 'orientation'>, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, StyleProps {\n children?: ReactNode,\n /**\n * The size of the Slider.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Slider should be displayed with an emphasized style.\n */\n isEmphasized?: boolean,\n /**\n * The style of the Slider's track.\n *\n * @default 'thin'\n */\n trackStyle?: 'thin' | 'thick', // TODO: add ramp\n /**\n * The style of the Slider's thumb.\n *\n * @default 'default'\n */\n thumbStyle?: 'default' | 'precise'\n // TODO\n // isEditable?: boolean,\n}\n\nexport interface SliderProps extends Omit<SliderBaseProps<number>, 'children'>, InputDOMProps {\n /**\n * The offset from which to start the fill.\n */\n fillOffset?: number\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, FocusableRefValue<HTMLDivElement>>>(null);\n\nconst slider = style({\n font: 'control',\n alignItems: {\n labelPosition: {\n side: 'center'\n }\n },\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n },\n columnGap: {\n size: {\n S: 16,\n M: 16,\n L: 20,\n XL: 24\n },\n isInForm: 12\n }\n}, getAllowedOverrides());\n\nconst labelContainer = style({\n display: {\n labelPosition: {\n top: 'grid'\n }\n },\n gridArea: 'label',\n width: 'full',\n gridTemplateAreas: {\n labelPosition: {\n top: ['label output']\n }\n },\n gridTemplateColumns: {\n labelPosition: {\n top: [\n '1fr auto'\n ]\n }\n },\n textAlign: {\n labelPosition: {\n side: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n }\n }\n },\n '--field-gap': {\n type: 'paddingBottom',\n value: 0\n }\n});\n\nconst output = style({\n gridArea: 'output',\n textAlign: {\n labelPosition: {\n top: {\n direction: {\n ltr: 'end',\n rtl: 'start'\n }\n },\n side: {\n direction: {\n ltr: 'start',\n rtl: 'end'\n },\n isInForm: 'end'\n }\n }\n }\n});\n\nexport let track = style({\n gridArea: 'track',\n position: 'relative',\n width: 'full',\n height: {\n size: {\n S: 24,\n M: 32,\n L: 40,\n XL: 48\n }\n }\n});\n\nexport let thumbContainer = style({\n size: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n display: 'inline-block',\n position: 'absolute',\n top: '[50%]'\n});\n\n// if precision thumb should have a smaller hit area, then remove this\nexport let thumbHitArea = style({\n size: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: size(22),\n L: 24,\n XL: size(26)\n }\n }\n }\n }\n});\n\nexport let thumb = style({\n ...focusRing(),\n display: 'inline-block',\n boxSizing: 'border-box',\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translateY(-50%) translateX(-50%)',\n width: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: size(6)\n }\n },\n height: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: size(22),\n L: 24,\n XL: size(26)\n }\n }\n }\n },\n borderRadius: 'full',\n borderStyle: 'solid',\n borderWidth: '[2px]',\n borderColor: {\n default: 'gray-800',\n isHovered: 'gray-900',\n isDragging: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n isDisabled: 'GrayText'\n }\n },\n backgroundColor: 'gray-25'\n});\n\nconst trackStyling = {\n height: {\n trackStyle: {\n thin: 4,\n thick: 16\n }\n },\n top: '[50%]',\n borderRadius: {\n trackStyle: {\n thin: 'lg',\n thick: 'sm'\n }\n }\n} as const;\n\nexport let upperTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-300',\n isDisabled: 'disabled'\n },\n translateY: '[-50%]',\n width: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n});\n\nexport let filledTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-700',\n isEmphasized: 'accent-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n translateY: '[-50%]'\n});\n\nexport function SliderBase<T extends number | number[]>(props: SliderBaseProps<T> & {sliderRef: RefObject<HTMLDivElement | null>}) {\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n labelPosition = 'top',\n labelAlign = 'start',\n size = 'M',\n minValue = 0,\n maxValue = 100,\n formatOptions\n } = props;\n let formatter = useNumberFormatter(formatOptions);\n let {direction} = useLocale();\n\n return (\n <AriaSlider\n {...props}\n ref={props.sliderRef}\n className={renderProps => (props.UNSAFE_className || '') + mergeStyles(style(field())({labelPosition, isInForm: !!formContext}), slider({...renderProps, labelPosition, size, isInForm: !!formContext}, props.styles))}>\n {({state}) => {\n let maxLabelLength = Math.max([...formatter.format(minValue)].length, [...formatter.format(maxValue)].length);\n switch (state.values.length) {\n case 1:\n break;\n case 2:\n // This should really use the NumberFormat#formatRange proposal...\n // https://github.com/tc39/ecma402/issues/393\n // https://github.com/tc39/proposal-intl-numberformat-v3#formatrange-ecma-402-393\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatRange\n maxLabelLength = 3 + 2 * Math.max(\n maxLabelLength,\n [...formatter.format(minValue)].length, [...formatter.format(maxValue)].length\n );\n break;\n default:\n throw new Error('Only sliders with 1 or 2 handles are supported!');\n }\n\n let outputValue = (\n <SliderOutput\n style={{width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`, fontVariantNumeric: 'tabular-nums'}}\n className={output({direction, labelPosition, isInForm: !!formContext})}>\n {({state}) =>\n state.values.map((_, i) => state.getThumbValueLabel(i)).join(' – ')}\n </SliderOutput>\n );\n\n return (\n <>\n <div className={labelContainer({labelPosition, labelAlign})}>\n <FieldLabel\n isDisabled={props.isDisabled}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {labelPosition === 'top' && outputValue}\n </div>\n <div className={style({...fieldInput(), display: 'inline-flex', alignItems: 'center', gap: {default: 16, size: {L: 20, XL: 24}}})({size})}>\n {props.children}\n {labelPosition === 'side' && outputValue}\n </div>\n </>\n );\n }}\n </AriaSlider>\n );\n}\n\nfunction Slider(props: SliderProps, ref: FocusableRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SliderContext);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n labelPosition = 'top',\n size = 'M',\n fillOffset,\n isEmphasized,\n trackStyle = 'thin',\n thumbStyle = 'default'\n } = props;\n let thumbRef = useRef(null);\n let inputRef = useRef(null); // TODO: need to pass inputRef to SliderThumb when we release the next version of RAC 1.3.0\n let domRef = useFocusableRef(ref, inputRef);\n let {direction} = useLocale();\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n\n return (\n <SliderBase\n {...props}\n sliderRef={domRef}>\n <SliderTrack\n className={track({size, labelPosition, isInForm: !!formContext})}>\n {({state, isDisabled}) => {\n\n fillOffset = fillOffset !== undefined ? clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : state.getThumbMinValue(0);\n\n let fillWidth = state.getThumbPercent(0) - state.getValuePercent(fillOffset);\n let isRightOfOffset = fillWidth > 0;\n let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);\n\n return (\n <>\n <div className={upperTrack({isDisabled, trackStyle})} />\n <div style={{width: `${Math.abs(fillWidth) * 100}%`, [cssDirection]: `${offset * 100}%`}} className={filledTrack({isDisabled, isEmphasized, trackStyle})} />\n <SliderThumb className={thumbContainer} index={0} name={props.name} ref={thumbRef} style={(renderProps) => pressScale(thumbRef, {transform: 'translate(-50%, -50%)'})({...renderProps, isPressed: renderProps.isDragging})}>\n {(renderProps) => (\n <div className={thumbHitArea({size})}>\n <div\n className={thumb({\n ...renderProps,\n size,\n thumbStyle\n })} />\n </div>\n )}\n </SliderThumb>\n </>\n );\n }}\n </SliderTrack>\n </SliderBase>\n );\n}\n\nlet _Slider = /*#__PURE__*/ forwardRef(Slider);\nexport {_Slider as Slider};\n"],"names":[],"version":3,"file":"Slider.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA0DM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAAgE;AAEzG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBN,MAAM;;;;;;;;;;;;;;;;;AAoCN,MAAM;;;;;;;;;;;;;;;;AAqBC,IAAI;;;;;;;;;;;;;;AAcJ,IAAI;;;;;;;;;;;;;;;AAeJ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBJ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDX,MAAM,qCAAe;IACnB,QAAQ;QACN,YAAY;YACV,MAAM;YACN,OAAO;QACT;IACF;IACA,KAAK;IACL,cAAc;QACZ,YAAY;YACV,MAAM;YACN,OAAO;QACT;IACF;AACF;AAEO,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBJ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/Slider.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 Slider as AriaSlider,\n SliderProps as AriaSliderProps,\n ContextValue,\n SliderOutput,\n SliderThumb,\n SliderTrack\n} from 'react-aria-components';\nimport {clamp} from '@react-aria/utils';\nimport {createContext, forwardRef, ReactNode, RefObject, useContext, useRef} from 'react';\nimport {field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {FocusableRef, FocusableRefValue, InputDOMProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {focusRing, size, style} from '../style' with {type: 'macro'};\nimport {FormContext, useFormProps} from './Form';\nimport {mergeStyles} from '../style/runtime';\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useLocale, useNumberFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface SliderBaseProps<T> extends Omit<AriaSliderProps<T>, 'children' | 'style' | 'className' | 'orientation'>, Omit<SpectrumLabelableProps, 'necessityIndicator' | 'isRequired'>, StyleProps {\n children?: ReactNode,\n /**\n * The size of the Slider.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * Whether the Slider should be displayed with an emphasized style.\n */\n isEmphasized?: boolean,\n /**\n * The style of the Slider's track.\n *\n * @default 'thin'\n */\n trackStyle?: 'thin' | 'thick', // TODO: add ramp\n /**\n * The style of the Slider's thumb.\n *\n * @default 'default'\n */\n thumbStyle?: 'default' | 'precise'\n // TODO\n // isEditable?: boolean,\n}\n\nexport interface SliderProps extends Omit<SliderBaseProps<number>, 'children'>, InputDOMProps {\n /**\n * The offset from which to start the fill.\n */\n fillOffset?: number\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, FocusableRefValue<HTMLDivElement>>>(null);\n\nconst slider = style({\n font: 'control',\n alignItems: {\n labelPosition: {\n side: 'center'\n }\n },\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n },\n columnGap: {\n size: {\n S: 16,\n M: 16,\n L: 20,\n XL: 24\n },\n isInForm: 12\n }\n}, getAllowedOverrides());\n\nconst labelContainer = style({\n display: {\n labelPosition: {\n top: 'grid'\n }\n },\n gridArea: 'label',\n width: 'full',\n gridTemplateAreas: {\n labelPosition: {\n top: ['label output']\n }\n },\n gridTemplateColumns: {\n labelPosition: {\n top: [\n '1fr auto'\n ]\n }\n },\n textAlign: {\n labelPosition: {\n side: {\n labelAlign: {\n start: 'start',\n end: 'end'\n }\n }\n }\n },\n '--field-gap': {\n type: 'paddingBottom',\n value: 0\n }\n});\n\nconst output = style({\n gridArea: 'output',\n textAlign: {\n labelPosition: {\n top: {\n direction: {\n ltr: 'end',\n rtl: 'start'\n }\n },\n side: {\n direction: {\n ltr: 'start',\n rtl: 'end'\n },\n isInForm: 'end'\n }\n }\n }\n});\n\nexport let track = style({\n gridArea: 'track',\n position: 'relative',\n width: 'full',\n height: {\n size: {\n S: 24,\n M: 32,\n L: 40,\n XL: 48\n }\n }\n});\n\nexport let thumbContainer = style({\n size: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n display: 'inline-block',\n position: 'absolute',\n top: '[50%]'\n});\n\n// if precision thumb should have a smaller hit area, then remove this\nexport let thumbHitArea = style({\n size: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: size(22),\n L: 24,\n XL: size(26)\n }\n }\n }\n }\n});\n\nexport let thumb = style({\n ...focusRing(),\n display: 'inline-block',\n boxSizing: 'border-box',\n position: 'absolute',\n top: '[50%]',\n left: '[50%]',\n transform: 'translateY(-50%) translateX(-50%)',\n width: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: size(6)\n }\n },\n height: {\n thumbStyle: {\n default: {\n size: {\n S: size(18),\n M: 20,\n L: size(22),\n XL: 24\n }\n },\n precise: {\n size: {\n S: 20,\n M: size(22),\n L: 24,\n XL: size(26)\n }\n }\n }\n },\n borderRadius: 'full',\n borderStyle: 'solid',\n borderWidth: '[2px]',\n borderColor: {\n default: 'gray-800',\n isHovered: 'gray-900',\n isDragging: 'gray-900',\n isDisabled: 'disabled',\n forcedColors: {\n isDisabled: 'GrayText'\n }\n },\n backgroundColor: 'gray-25'\n});\n\nconst trackStyling = {\n height: {\n trackStyle: {\n thin: 4,\n thick: 16\n }\n },\n top: '[50%]',\n borderRadius: {\n trackStyle: {\n thin: 'lg',\n thick: 'sm'\n }\n }\n} as const;\n\nexport let upperTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-300',\n isDisabled: 'disabled'\n },\n translateY: '[-50%]',\n width: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n }\n});\n\nexport let filledTrack = style({\n ...trackStyling,\n position: 'absolute',\n backgroundColor: {\n default: 'gray-700',\n isEmphasized: 'accent-900',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'Highlight',\n isDisabled: 'GrayText'\n }\n },\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: '[.5px]',\n borderColor: {\n default: 'transparent',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n translateY: '[-50%]'\n});\n\nexport function SliderBase<T extends number | number[]>(props: SliderBaseProps<T> & {sliderRef: RefObject<HTMLDivElement | null>}) {\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n labelPosition = 'top',\n labelAlign = 'start',\n size = 'M',\n minValue = 0,\n maxValue = 100,\n formatOptions\n } = props;\n let formatter = useNumberFormatter(formatOptions);\n let {direction} = useLocale();\n\n return (\n <AriaSlider\n {...props}\n ref={props.sliderRef}\n className={renderProps => (props.UNSAFE_className || '') + mergeStyles(style(field())({labelPosition, isInForm: !!formContext}), slider({...renderProps, labelPosition, size, isInForm: !!formContext}, props.styles))}>\n {({state}) => {\n let maxLabelLength = Math.max([...formatter.format(minValue)].length, [...formatter.format(maxValue)].length);\n switch (state.values.length) {\n case 1:\n break;\n case 2:\n // This should really use the NumberFormat#formatRange proposal...\n // https://github.com/tc39/ecma402/issues/393\n // https://github.com/tc39/proposal-intl-numberformat-v3#formatrange-ecma-402-393\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatRange\n maxLabelLength = 3 + 2 * Math.max(\n maxLabelLength,\n [...formatter.format(minValue)].length, [...formatter.format(maxValue)].length\n );\n break;\n default:\n throw new Error('Only sliders with 1 or 2 handles are supported!');\n }\n\n let outputValue = (\n <SliderOutput\n style={{width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`, fontVariantNumeric: 'tabular-nums'}}\n className={output({direction, labelPosition, isInForm: !!formContext})}>\n {({state}) =>\n state.values.map((_, i) => state.getThumbValueLabel(i)).join(' – ')}\n </SliderOutput>\n );\n\n return (\n <>\n <div className={labelContainer({labelPosition, labelAlign})}>\n <FieldLabel\n isDisabled={props.isDisabled}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {labelPosition === 'top' && outputValue}\n </div>\n <div className={style({...fieldInput(), display: 'inline-flex', alignItems: 'center', gap: {default: 16, size: {L: 20, XL: 24}}})({size})}>\n {props.children}\n {labelPosition === 'side' && outputValue}\n </div>\n </>\n );\n }}\n </AriaSlider>\n );\n}\n\nfunction Slider(props: SliderProps, ref: FocusableRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, SliderContext);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n labelPosition = 'top',\n size = 'M',\n fillOffset,\n isEmphasized,\n trackStyle = 'thin',\n thumbStyle = 'default'\n } = props;\n let thumbRef = useRef(null);\n let inputRef = useRef(null); // TODO: need to pass inputRef to SliderThumb when we release the next version of RAC 1.3.0\n let domRef = useFocusableRef(ref, inputRef);\n let {direction} = useLocale();\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n\n return (\n <SliderBase\n {...props}\n sliderRef={domRef}>\n <SliderTrack\n className={track({size, labelPosition, isInForm: !!formContext})}>\n {({state, isDisabled}) => {\n\n fillOffset = fillOffset !== undefined ? clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : state.getThumbMinValue(0);\n\n let fillWidth = state.getThumbPercent(0) - state.getValuePercent(fillOffset);\n let isRightOfOffset = fillWidth > 0;\n let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);\n\n return (\n <>\n <div className={upperTrack({isDisabled, trackStyle})} />\n <div style={{width: `${Math.abs(fillWidth) * 100}%`, [cssDirection]: `${offset * 100}%`}} className={filledTrack({isDisabled, isEmphasized, trackStyle})} />\n <SliderThumb className={thumbContainer} index={0} name={props.name} ref={thumbRef} style={(renderProps) => pressScale(thumbRef, {transform: 'translate(-50%, -50%)'})({...renderProps, isPressed: renderProps.isDragging})}>\n {(renderProps) => (\n <div className={thumbHitArea({size})}>\n <div\n className={thumb({\n ...renderProps,\n size,\n thumbStyle\n })} />\n </div>\n )}\n </SliderThumb>\n </>\n );\n }}\n </SliderTrack>\n </SliderBase>\n );\n}\n\nlet _Slider = /*#__PURE__*/ forwardRef(Slider);\nexport {_Slider as Slider};\n"],"names":[],"version":3,"file":"Slider.cjs.map"}