@react-spectrum/s2 3.0.0-nightly-93c26d8bd-241028 → 3.0.0-nightly-07431f4b1-241030

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 (273) hide show
  1. package/dist/Accordion.cjs +1 -1
  2. package/dist/Accordion.cjs.map +1 -1
  3. package/dist/Accordion.css.map +1 -1
  4. package/dist/Accordion.mjs +2 -2
  5. package/dist/Accordion.mjs.map +1 -1
  6. package/dist/ActionButton.cjs +10 -32
  7. package/dist/ActionButton.cjs.map +1 -1
  8. package/dist/ActionButton.css +20 -60
  9. package/dist/ActionButton.css.map +1 -1
  10. package/dist/ActionButton.mjs +10 -32
  11. package/dist/ActionButton.mjs.map +1 -1
  12. package/dist/Avatar.cjs +2 -4
  13. package/dist/Avatar.cjs.map +1 -1
  14. package/dist/Avatar.css +4 -16
  15. package/dist/Avatar.css.map +1 -1
  16. package/dist/Avatar.mjs +2 -4
  17. package/dist/Avatar.mjs.map +1 -1
  18. package/dist/Badge.cjs +5 -16
  19. package/dist/Badge.cjs.map +1 -1
  20. package/dist/Badge.css +10 -30
  21. package/dist/Badge.css.map +1 -1
  22. package/dist/Badge.mjs +5 -16
  23. package/dist/Badge.mjs.map +1 -1
  24. package/dist/Breadcrumbs.cjs +12 -41
  25. package/dist/Breadcrumbs.cjs.map +1 -1
  26. package/dist/Breadcrumbs.css +38 -86
  27. package/dist/Breadcrumbs.css.map +1 -1
  28. package/dist/Breadcrumbs.mjs +12 -41
  29. package/dist/Breadcrumbs.mjs.map +1 -1
  30. package/dist/Button.cjs +19 -59
  31. package/dist/Button.cjs.map +1 -1
  32. package/dist/Button.css +37 -113
  33. package/dist/Button.css.map +1 -1
  34. package/dist/Button.mjs +19 -59
  35. package/dist/Button.mjs.map +1 -1
  36. package/dist/Card.cjs +27 -67
  37. package/dist/Card.cjs.map +1 -1
  38. package/dist/Card.css +42 -117
  39. package/dist/Card.css.map +1 -1
  40. package/dist/Card.mjs +27 -67
  41. package/dist/Card.mjs.map +1 -1
  42. package/dist/Checkbox.cjs +9 -27
  43. package/dist/Checkbox.cjs.map +1 -1
  44. package/dist/Checkbox.css +17 -49
  45. package/dist/Checkbox.css.map +1 -1
  46. package/dist/Checkbox.mjs +9 -27
  47. package/dist/Checkbox.mjs.map +1 -1
  48. package/dist/CheckboxGroup.cjs +5 -16
  49. package/dist/CheckboxGroup.cjs.map +1 -1
  50. package/dist/CheckboxGroup.css +10 -30
  51. package/dist/CheckboxGroup.css.map +1 -1
  52. package/dist/CheckboxGroup.mjs +5 -16
  53. package/dist/CheckboxGroup.mjs.map +1 -1
  54. package/dist/ClearButton.cjs +6 -17
  55. package/dist/ClearButton.cjs.map +1 -1
  56. package/dist/ClearButton.css +11 -35
  57. package/dist/ClearButton.css.map +1 -1
  58. package/dist/ClearButton.mjs +6 -17
  59. package/dist/ClearButton.mjs.map +1 -1
  60. package/dist/CloseButton.cjs +10 -32
  61. package/dist/CloseButton.cjs.map +1 -1
  62. package/dist/CloseButton.css +20 -64
  63. package/dist/CloseButton.css.map +1 -1
  64. package/dist/CloseButton.mjs +10 -32
  65. package/dist/CloseButton.mjs.map +1 -1
  66. package/dist/ColorArea.cjs +4 -16
  67. package/dist/ColorArea.cjs.map +1 -1
  68. package/dist/ColorArea.css +8 -28
  69. package/dist/ColorArea.css.map +1 -1
  70. package/dist/ColorArea.mjs +4 -16
  71. package/dist/ColorArea.mjs.map +1 -1
  72. package/dist/ColorField.cjs +5 -16
  73. package/dist/ColorField.cjs.map +1 -1
  74. package/dist/ColorField.css +10 -30
  75. package/dist/ColorField.css.map +1 -1
  76. package/dist/ColorField.mjs +5 -16
  77. package/dist/ColorField.mjs.map +1 -1
  78. package/dist/ColorHandle.cjs +5 -15
  79. package/dist/ColorHandle.cjs.map +1 -1
  80. package/dist/ColorHandle.css +10 -30
  81. package/dist/ColorHandle.css.map +1 -1
  82. package/dist/ColorHandle.mjs +5 -15
  83. package/dist/ColorHandle.mjs.map +1 -1
  84. package/dist/ColorSlider.cjs +6 -17
  85. package/dist/ColorSlider.cjs.map +1 -1
  86. package/dist/ColorSlider.css +34 -50
  87. package/dist/ColorSlider.css.map +1 -1
  88. package/dist/ColorSlider.mjs +6 -17
  89. package/dist/ColorSlider.mjs.map +1 -1
  90. package/dist/ColorSwatch.cjs +8 -26
  91. package/dist/ColorSwatch.cjs.map +1 -1
  92. package/dist/ColorSwatch.css +16 -52
  93. package/dist/ColorSwatch.css.map +1 -1
  94. package/dist/ColorSwatch.mjs +8 -26
  95. package/dist/ColorSwatch.mjs.map +1 -1
  96. package/dist/ColorSwatchPicker.cjs +6 -16
  97. package/dist/ColorSwatchPicker.cjs.map +1 -1
  98. package/dist/ColorSwatchPicker.css +8 -28
  99. package/dist/ColorSwatchPicker.css.map +1 -1
  100. package/dist/ColorSwatchPicker.mjs +6 -16
  101. package/dist/ColorSwatchPicker.mjs.map +1 -1
  102. package/dist/ComboBox.cjs +22 -71
  103. package/dist/ComboBox.cjs.map +1 -1
  104. package/dist/ComboBox.css +64 -152
  105. package/dist/ComboBox.css.map +1 -1
  106. package/dist/ComboBox.mjs +22 -71
  107. package/dist/ComboBox.mjs.map +1 -1
  108. package/dist/ContextualHelp.cjs +1 -1
  109. package/dist/ContextualHelp.css +2 -6
  110. package/dist/ContextualHelp.css.map +1 -1
  111. package/dist/ContextualHelp.mjs +1 -1
  112. package/dist/Dialog.cjs +2 -2
  113. package/dist/Dialog.css +2 -2
  114. package/dist/Dialog.mjs +2 -2
  115. package/dist/Disclosure.cjs +34 -68
  116. package/dist/Disclosure.cjs.map +1 -1
  117. package/dist/Disclosure.css +55 -91
  118. package/dist/Disclosure.css.map +1 -1
  119. package/dist/Disclosure.mjs +36 -70
  120. package/dist/Disclosure.mjs.map +1 -1
  121. package/dist/DropZone.cjs +2 -4
  122. package/dist/DropZone.cjs.map +1 -1
  123. package/dist/DropZone.css +4 -16
  124. package/dist/DropZone.css.map +1 -1
  125. package/dist/DropZone.mjs +2 -4
  126. package/dist/DropZone.mjs.map +1 -1
  127. package/dist/Field.cjs +16 -47
  128. package/dist/Field.cjs.map +1 -1
  129. package/dist/Field.css +31 -95
  130. package/dist/Field.css.map +1 -1
  131. package/dist/Field.mjs +16 -47
  132. package/dist/Field.mjs.map +1 -1
  133. package/dist/IllustratedMessage.cjs +6 -20
  134. package/dist/IllustratedMessage.cjs.map +1 -1
  135. package/dist/IllustratedMessage.css +10 -24
  136. package/dist/IllustratedMessage.css.map +1 -1
  137. package/dist/IllustratedMessage.mjs +6 -20
  138. package/dist/IllustratedMessage.mjs.map +1 -1
  139. package/dist/Image.cjs +2 -2
  140. package/dist/Image.css +2 -2
  141. package/dist/Image.mjs +2 -2
  142. package/dist/InlineAlert.cjs +2 -5
  143. package/dist/InlineAlert.cjs.map +1 -1
  144. package/dist/InlineAlert.css +11 -15
  145. package/dist/InlineAlert.css.map +1 -1
  146. package/dist/InlineAlert.mjs +2 -5
  147. package/dist/InlineAlert.mjs.map +1 -1
  148. package/dist/Menu.cjs +22 -67
  149. package/dist/Menu.cjs.map +1 -1
  150. package/dist/Menu.css +32 -96
  151. package/dist/Menu.css.map +1 -1
  152. package/dist/Menu.mjs +22 -67
  153. package/dist/Menu.mjs.map +1 -1
  154. package/dist/Meter.cjs +22 -68
  155. package/dist/Meter.cjs.map +1 -1
  156. package/dist/Meter.css +63 -139
  157. package/dist/Meter.css.map +1 -1
  158. package/dist/Meter.mjs +22 -68
  159. package/dist/Meter.mjs.map +1 -1
  160. package/dist/Modal.cjs +2 -2
  161. package/dist/Modal.css +2 -2
  162. package/dist/Modal.mjs +2 -2
  163. package/dist/NumberField.cjs +23 -71
  164. package/dist/NumberField.cjs.map +1 -1
  165. package/dist/NumberField.css +63 -146
  166. package/dist/NumberField.css.map +1 -1
  167. package/dist/NumberField.mjs +23 -71
  168. package/dist/NumberField.mjs.map +1 -1
  169. package/dist/Picker.cjs +23 -67
  170. package/dist/Picker.cjs.map +1 -1
  171. package/dist/Picker.css +50 -130
  172. package/dist/Picker.css.map +1 -1
  173. package/dist/Picker.mjs +23 -67
  174. package/dist/Picker.mjs.map +1 -1
  175. package/dist/ProgressBar.cjs +23 -69
  176. package/dist/ProgressBar.cjs.map +1 -1
  177. package/dist/ProgressBar.css +64 -140
  178. package/dist/ProgressBar.css.map +1 -1
  179. package/dist/ProgressBar.mjs +23 -69
  180. package/dist/ProgressBar.mjs.map +1 -1
  181. package/dist/ProgressCircle.cjs +6 -20
  182. package/dist/ProgressCircle.cjs.map +1 -1
  183. package/dist/ProgressCircle.css +12 -40
  184. package/dist/ProgressCircle.css.map +1 -1
  185. package/dist/ProgressCircle.mjs +6 -20
  186. package/dist/ProgressCircle.mjs.map +1 -1
  187. package/dist/Provider.css +7 -0
  188. package/dist/Provider.css.map +1 -1
  189. package/dist/Radio.cjs +8 -26
  190. package/dist/Radio.cjs.map +1 -1
  191. package/dist/Radio.css +16 -48
  192. package/dist/Radio.css.map +1 -1
  193. package/dist/Radio.mjs +8 -26
  194. package/dist/Radio.mjs.map +1 -1
  195. package/dist/RadioGroup.cjs +5 -16
  196. package/dist/RadioGroup.cjs.map +1 -1
  197. package/dist/RadioGroup.css +10 -30
  198. package/dist/RadioGroup.css.map +1 -1
  199. package/dist/RadioGroup.mjs +5 -16
  200. package/dist/RadioGroup.mjs.map +1 -1
  201. package/dist/SearchField.cjs +5 -16
  202. package/dist/SearchField.cjs.map +1 -1
  203. package/dist/SearchField.css +10 -30
  204. package/dist/SearchField.css.map +1 -1
  205. package/dist/SearchField.mjs +5 -16
  206. package/dist/SearchField.mjs.map +1 -1
  207. package/dist/SegmentedControl.cjs +8 -14
  208. package/dist/SegmentedControl.cjs.map +1 -1
  209. package/dist/SegmentedControl.css +9 -29
  210. package/dist/SegmentedControl.css.map +1 -1
  211. package/dist/SegmentedControl.mjs +8 -14
  212. package/dist/SegmentedControl.mjs.map +1 -1
  213. package/dist/Slider.cjs +63 -196
  214. package/dist/Slider.cjs.map +1 -1
  215. package/dist/Slider.css +61 -181
  216. package/dist/Slider.css.map +1 -1
  217. package/dist/Slider.mjs +63 -196
  218. package/dist/Slider.mjs.map +1 -1
  219. package/dist/StatusLight.cjs +9 -27
  220. package/dist/StatusLight.cjs.map +1 -1
  221. package/dist/StatusLight.css +17 -49
  222. package/dist/StatusLight.css.map +1 -1
  223. package/dist/StatusLight.mjs +9 -27
  224. package/dist/StatusLight.mjs.map +1 -1
  225. package/dist/Switch.cjs +6 -15
  226. package/dist/Switch.cjs.map +1 -1
  227. package/dist/Switch.css +10 -26
  228. package/dist/Switch.css.map +1 -1
  229. package/dist/Switch.mjs +6 -15
  230. package/dist/Switch.mjs.map +1 -1
  231. package/dist/TableView.cjs +42 -86
  232. package/dist/TableView.cjs.map +1 -1
  233. package/dist/TableView.css +65 -129
  234. package/dist/TableView.css.map +1 -1
  235. package/dist/TableView.mjs +42 -86
  236. package/dist/TableView.mjs.map +1 -1
  237. package/dist/Tabs.cjs +4 -15
  238. package/dist/Tabs.cjs.map +1 -1
  239. package/dist/Tabs.css +18 -34
  240. package/dist/Tabs.css.map +1 -1
  241. package/dist/Tabs.mjs +4 -15
  242. package/dist/Tabs.mjs.map +1 -1
  243. package/dist/TagGroup.cjs +14 -37
  244. package/dist/TagGroup.cjs.map +1 -1
  245. package/dist/TagGroup.css +23 -67
  246. package/dist/TagGroup.css.map +1 -1
  247. package/dist/TagGroup.mjs +14 -37
  248. package/dist/TagGroup.mjs.map +1 -1
  249. package/dist/TextField.cjs +11 -34
  250. package/dist/TextField.cjs.map +1 -1
  251. package/dist/TextField.css +22 -66
  252. package/dist/TextField.css.map +1 -1
  253. package/dist/TextField.mjs +11 -34
  254. package/dist/TextField.mjs.map +1 -1
  255. package/dist/Tooltip.cjs +2 -4
  256. package/dist/Tooltip.cjs.map +1 -1
  257. package/dist/Tooltip.css +4 -12
  258. package/dist/Tooltip.css.map +1 -1
  259. package/dist/Tooltip.mjs +2 -4
  260. package/dist/Tooltip.mjs.map +1 -1
  261. package/dist/types.d.ts.map +1 -1
  262. package/package.json +17 -17
  263. package/page.css +7 -0
  264. package/src/Accordion.tsx +1 -1
  265. package/src/Disclosure.tsx +13 -7
  266. package/src/page.macro.ts +11 -0
  267. package/style/dist/spectrum-theme.cjs +2 -8
  268. package/style/dist/spectrum-theme.cjs.map +1 -1
  269. package/style/dist/spectrum-theme.mjs +2 -8
  270. package/style/dist/spectrum-theme.mjs.map +1 -1
  271. package/style/dist/types.d.ts +1 -4
  272. package/style/dist/types.d.ts.map +1 -1
  273. package/style/spectrum-theme.ts +4 -4
@@ -93,22 +93,11 @@ function $9c5ed7ec0bc126af$var$ColorField(props, ref) {
93
93
  rules += ' _1d';
94
94
  rules += ' _f-1x99dlob';
95
95
  rules += ' _fa';
96
- if (props.size === "XL") {
97
- rules += ' -aqrvqh_k-by';
98
- rules += ' -aqrvqh_k-x';
99
- } else if (props.size === "L") {
100
- rules += ' -aqrvqh_k-bu';
101
- rules += ' -aqrvqh_k-r';
102
- } else if (props.size === "S") {
103
- rules += ' -aqrvqh_k-bn';
104
- rules += ' -aqrvqh_k-m';
105
- } else if (props.size === "XS") {
106
- rules += ' -aqrvqh_k-bl';
107
- rules += ' -aqrvqh_k-k';
108
- } else {
109
- rules += ' -aqrvqh_k-br';
110
- rules += ' -aqrvqh_k-q';
111
- }
96
+ if (props.size === "XL") rules += ' -aqrvqh_k-n';
97
+ else if (props.size === "L") rules += ' -aqrvqh_k-l';
98
+ else if (props.size === "S") rules += ' -aqrvqh_k-h';
99
+ else if (props.size === "XS") rules += ' -aqrvqh_k-g';
100
+ else rules += ' -aqrvqh_k-j';
112
101
  rules += ' -_1inj1bc_i--prjw07';
113
102
  rules += ' je';
114
103
  rules += ' __R-yksgrp';
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA0BM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAA+C;AAE5F,SAAS,iCAAW,KAAsB,EAAE,GAAsB;IAChE,CAAC,OAAO,IAAI,GAAG,C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;4BACX,2BAAa,gBAAC,CAAA,GAAA,yCAAa;gCAAE,YAAY;;;;kCAE5C,gBAAC,CAAA,GAAA,yCAAO;wBACN,MAAM,MAAM,IAAI;wBAChB,YAAY;wBACZ,WAAW;wBACX,aAAa;kCACZ;;;;;AAKX;AAEA;;CAEC,GACD,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ColorField.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 ColorField as AriaColorField,\n ColorFieldProps as AriaColorFieldProps,\n ContextValue\n} from 'react-aria-components';\nimport {createContext, forwardRef, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {style} from '../style' with {type: 'macro'};\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorFieldProps extends Omit<AriaColorFieldProps, 'children' | 'className' | 'style'>, StyleProps, SpectrumLabelableProps, HelpTextProps {\n /**\n * The size of the color field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const ColorFieldContext = createContext<ContextValue<ColorFieldProps, TextFieldRef>>(null);\n\nfunction ColorField(props: ColorFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorFieldContext);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n UNSAFE_style,\n UNSAFE_className = '',\n styles,\n ...fieldProps\n } = props;\n\n // Expose imperative interface for ref\n let domRef = useRef<HTMLDivElement>(null);\n let inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaColorField\n {...fieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, styles)}>\n {({isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup role=\"presentation\" isDisabled={isDisabled} isInvalid={isInvalid} size={props.size}>\n <Input ref={inputRef} />\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>)}\n </AriaColorField>\n );\n}\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nconst _ColorField = forwardRef(ColorField);\nexport {_ColorField as ColorField};\n"],"names":[],"version":3,"file":"ColorField.mjs.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA0BM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAA+C;AAE5F,SAAS,iCAAW,KAAsB,EAAE,GAAsB;IAChE,CAAC,OAAO,IAAI,GAAG,C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,gBAAC,CAAA,GAAA,yCAAa;gCAAE,YAAY;;;;kCAE5C,gBAAC,CAAA,GAAA,yCAAO;wBACN,MAAM,MAAM,IAAI;wBAChB,YAAY;wBACZ,WAAW;wBACX,aAAa;kCACZ;;;;;AAKX;AAEA;;CAEC,GACD,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ColorField.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 ColorField as AriaColorField,\n ColorFieldProps as AriaColorFieldProps,\n ContextValue\n} from 'react-aria-components';\nimport {createContext, forwardRef, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {style} from '../style' with {type: 'macro'};\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorFieldProps extends Omit<AriaColorFieldProps, 'children' | 'className' | 'style'>, StyleProps, SpectrumLabelableProps, HelpTextProps {\n /**\n * The size of the color field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const ColorFieldContext = createContext<ContextValue<ColorFieldProps, TextFieldRef>>(null);\n\nfunction ColorField(props: ColorFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorFieldContext);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n UNSAFE_style,\n UNSAFE_className = '',\n styles,\n ...fieldProps\n } = props;\n\n // Expose imperative interface for ref\n let domRef = useRef<HTMLDivElement>(null);\n let inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaColorField\n {...fieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, styles)}>\n {({isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <FieldGroup role=\"presentation\" isDisabled={isDisabled} isInvalid={isInvalid} size={props.size}>\n <Input ref={inputRef} />\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>)}\n </AriaColorField>\n );\n}\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nconst _ColorField = forwardRef(ColorField);\nexport {_ColorField as ColorField};\n"],"names":[],"version":3,"file":"ColorField.mjs.map"}
@@ -38,20 +38,10 @@ function $5b07976eb9e358fe$export$92862704de639678({ containerRef: containerRef,
38
38
  rules += ' _O-1oihi8a';
39
39
  rules += ' _Q-375x7f';
40
40
  rules += ' _Ra';
41
- if (props.isFocusVisible) {
42
- rules += ' lbr';
43
- rules += ' lq';
44
- } else {
45
- rules += ' lbk';
46
- rules += ' lj';
47
- }
48
- if (props.isFocusVisible) {
49
- rules += ' kbr';
50
- rules += ' kq';
51
- } else {
52
- rules += ' kbk';
53
- rules += ' kj';
54
- }
41
+ if (props.isFocusVisible) rules += ' lj';
42
+ else rules += ' lf';
43
+ if (props.isFocusVisible) rules += ' kj';
44
+ else rules += ' kf';
55
45
  if (props.isDisabled) rules += ' bg';
56
46
  rules += ' _vf';
57
47
  rules += ' _wf';
@@ -80,7 +70,7 @@ function $5b07976eb9e358fe$export$92862704de639678({ containerRef: containerRef,
80
70
  children: ({ isDragging: isDragging, color: color })=>/*#__PURE__*/ (0, $8hzuN$reactjsxruntime.jsxs)((0, $8hzuN$reactjsxruntime.Fragment), {
81
71
  children: [
82
72
  /*#__PURE__*/ (0, $8hzuN$reactjsxruntime.jsx)("div", {
83
- className: " . l4 k4 _vf _wf _xf _yf __na wa ub vb sb tb cb42 ca_____v"
73
+ className: " . lG kG _vf _wf _xf _yf __na wa ub vb sb tb cb42 ca_____v"
84
74
  }),
85
75
  /*#__PURE__*/ (0, $8hzuN$reactjsxruntime.jsx)($5b07976eb9e358fe$var$ColorLoupePortal, {
86
76
  isOpen: isDragging,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AASD,MAAM,oCAAc;AACpB,MAAM,qCAAe,IAAI,2BAA2B;AACpD,MAAM,oCAAc;AACpB,MAAM,2CAAqB;AAC3B,MAAM,qCAAe,IAAI,8BAA8B;AAOhD,SAAS,0CAAY,gBAAC,YAAY,eAAE,WAAW,EAAmB;IACvE,qBACE,gCAAC,CAAA,GAAA,qCAAS;QACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwBA,OAAO,CAAC,gBAAC,YAAY,cAAE,UAAU,EAAC,GAAM,CAAA;gBACtC,YAAY,aAAa,YAAY,CAAC,gBAAgB,EAAE,aAAa,eAAe,CAAC,EAAE,EAAE,aAAa,eAAe,C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,QAAQ,EAAC,GAAG;IAClC,YAAY,cAAc,MAAM;IAChC,aAAa,cAAc,KAAK;IAEhC,IAAI;IAOJ,IAAI;IAOJ,qBACE,iCAAC;QACC,OAAO;YACL,qCAAqC;YACrC,UAAU;YACV,KAAK,cAAc,GAAG,GAAG;YACzB,MAAM,cAAc,IAAI,GAAG;YAC3B,WAAW,CAAC,qCAAe,2CAAqB,IAAI,oCAAc,IAAI;YACtE,YAAY,CAAC,oCAAc,IAAI;YAC/B,eAAe,YAAY,gBAAgB;QAC7C;QACA,SAAS;QAQT,gBAAgB,CAAA;YACd,IAAI,EAAE,aAAa,KAAK,eACtB;QAEJ;QACA,OAAO,oCAAc,2CAAqB;QAC1C,QAAQ,qCAAe,2CAAqB;QAC5C,KAAK;QACL,eAAY;;0BACZ,iCAAC;gBAAQ,IAAI;gBAAW,GAAE;gBAAI,GAAE;gBAAI,OAAM;gBAAK,QAAO;gBAAK,cAAa;;kCACtE,gCAAC;wBAAK,MAAK;wBAAQ,GAAE;wBAAI,GAAE;wBAAI,OAAM;wBAAK,QAAO;;kCACjD,gCAAC;wBAAK,MAAK;wBAAU,GAAE;wBAAI,GAAE;wBAAI,OAAM;wBAAI,QAAO;;kCAClD,gCAAC;wBAAK,MAAK;wBAAU,GAAE;wBAAI,GAAE;wBAAI,OAAM;wBAAI,QAAO;;;;0BAEpD,gCAAC;gBACC,GAAE;gBACF,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;;0BAC5B,gCAAC;gBACC,GAAE;gBACF,MAAM,MAAM,QAAQ;;0BACtB,gCAAC;gBACC,SAAS;gBAQT,GAAE;;;;AAGV","sources":["packages/@react-spectrum/s2/src/ColorHandle.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 {cloneElement, JSX, RefObject, useState} from 'react';\nimport {ColorThumb} from 'react-aria-components';\nimport {createPortal} from 'react-dom';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useId, useLayoutEffect} from '@react-aria/utils';\n\nconst HANDLE_SIZE = 16;\nconst LOUPE_HEIGHT = 64; // Does not include borders\nconst LOUPE_WIDTH = 48;\nconst LOUPE_BORDER_WIDTH = 1;\nconst LOUPE_OFFSET = 12; // Offset from handle to loupe\n\ninterface ColorHandleProps {\n containerRef: RefObject<HTMLElement | null>,\n getPosition: () => {x: number, y: number}\n}\n\nexport function ColorHandle({containerRef, getPosition}: ColorHandleProps) {\n return (\n <ColorThumb\n className={style({\n transition: '[width, height]',\n size: {\n default: HANDLE_SIZE,\n isFocusVisible: 32\n },\n backgroundColor: {\n isDisabled: 'disabled'\n },\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'white',\n isDisabled: 'disabled'\n },\n outlineStyle: 'solid',\n outlineWidth: 1,\n outlineColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `linear-gradient(${defaultStyle.backgroundColor}, ${defaultStyle.backgroundColor}), repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`,\n backgroundColor: undefined,\n top: defaultStyle.top || '50%',\n left: defaultStyle.left || '50%'\n })}>\n {({isDragging, color}) => (<>\n <div\n className={style({\n size: 'full',\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 1,\n borderColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })} />\n <ColorLoupePortal isOpen={isDragging}>\n <ColorLoupe containerRef={containerRef} color={color} getPosition={getPosition} />\n </ColorLoupePortal>\n </>)}\n </ColorThumb>\n );\n}\n\n// ColorLoupe is rendered in a portal so that it breaks out of clipped/scrolling containers (e.g. popovers).\nfunction ColorLoupePortal({isOpen, children}: { isOpen: boolean, children: JSX.Element }) {\n let [state, setState] = useState(isOpen ? 'open' : 'closed');\n if (isOpen && state === 'closed') {\n setState('open');\n }\n\n if (!isOpen && state === 'open') {\n setState('exiting');\n }\n\n if (isOpen || state === 'exiting') {\n return createPortal(cloneElement(children, {isExiting: state === 'exiting', onExited: () => setState('closed')}), document.body);\n }\n\n return null;\n}\n\nfunction ColorLoupe({isExiting, onExited, containerRef, loupeRef, getPosition, color}: any) {\n let patternId = useId();\n\n // Get the bounding rectangle of the container (e.g. ColorArea/ColorSlider).\n let [containerRect, setContainerRect] = useState({top: 0, left: 0, width: 0, height: 0});\n useLayoutEffect(() => {\n let rect = containerRef.current?.getBoundingClientRect();\n setContainerRect({\n top: rect?.top || 0,\n left: rect?.left || 0,\n width: rect?.width || 0,\n height: rect?.height || 0\n });\n }, [containerRef]);\n\n // Compute the pixel position of the thumb.\n let {x: thumbLeft, y: thumbTop} = getPosition();\n thumbTop *= containerRect.height;\n thumbLeft *= containerRect.width;\n\n let enterAnimation = keyframes(`\n from {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n let exitAnimation = keyframes(`\n to {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n return (\n <svg\n style={{\n // Position relative to the viewport.\n position: 'fixed',\n top: containerRect.top + thumbTop,\n left: containerRect.left + thumbLeft,\n marginTop: -LOUPE_HEIGHT - LOUPE_BORDER_WIDTH * 2 - HANDLE_SIZE / 2 - LOUPE_OFFSET,\n marginLeft: -LOUPE_WIDTH / 2 - LOUPE_BORDER_WIDTH,\n animationName: isExiting ? exitAnimation : enterAnimation\n }}\n className={style({\n filter: 'elevated',\n pointerEvents: 'none',\n animationDuration: 125,\n animationFillMode: 'forwards',\n animationTimingFunction: 'in-out',\n isolation: 'isolate'\n })}\n onAnimationEnd={e => {\n if (e.animationName === exitAnimation) {\n onExited();\n }\n }}\n width={LOUPE_WIDTH + LOUPE_BORDER_WIDTH * 2}\n height={LOUPE_HEIGHT + LOUPE_BORDER_WIDTH * 2}\n ref={loupeRef}\n aria-hidden=\"true\">\n <pattern id={patternId} x=\"0\" y=\"0\" width=\"16\" height=\"16\" patternUnits=\"userSpaceOnUse\">\n <rect fill=\"white\" x=\"0\" y=\"0\" width=\"16\" height=\"16\" />\n <rect fill=\"#E1E1E1\" x=\"0\" y=\"0\" width=\"8\" height=\"8\" />\n <rect fill=\"#E1E1E1\" x=\"8\" y=\"8\" width=\"8\" height=\"8\" />\n </pattern>\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={`url(#${patternId})`} />\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={color.toString()} />\n <path\n className={style({\n strokeWidth: 1,\n stroke: {\n default: 'transparent-black-200',\n forcedColors: 'ButtonBorder'\n },\n fill: 'white'\n })}\n d=\"M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\" />\n </svg>\n );\n}\n"],"names":[],"version":3,"file":"ColorHandle.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AASD,MAAM,oCAAc;AACpB,MAAM,qCAAe,IAAI,2BAA2B;AACpD,MAAM,oCAAc;AACpB,MAAM,2CAAqB;AAC3B,MAAM,qCAAe,IAAI,8BAA8B;AAOhD,SAAS,0CAAY,gBAAC,YAAY,eAAE,WAAW,EAAmB;IAC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AGV","sources":["packages/@react-spectrum/s2/src/ColorHandle.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 {cloneElement, JSX, RefObject, useState} from 'react';\nimport {ColorThumb} from 'react-aria-components';\nimport {createPortal} from 'react-dom';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useId, useLayoutEffect} from '@react-aria/utils';\n\nconst HANDLE_SIZE = 16;\nconst LOUPE_HEIGHT = 64; // Does not include borders\nconst LOUPE_WIDTH = 48;\nconst LOUPE_BORDER_WIDTH = 1;\nconst LOUPE_OFFSET = 12; // Offset from handle to loupe\n\ninterface ColorHandleProps {\n containerRef: RefObject<HTMLElement | null>,\n getPosition: () => {x: number, y: number}\n}\n\nexport function ColorHandle({containerRef, getPosition}: ColorHandleProps) {\n return (\n <ColorThumb\n className={style({\n transition: '[width, height]',\n size: {\n default: HANDLE_SIZE,\n isFocusVisible: 32\n },\n backgroundColor: {\n isDisabled: 'disabled'\n },\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'white',\n isDisabled: 'disabled'\n },\n outlineStyle: 'solid',\n outlineWidth: 1,\n outlineColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `linear-gradient(${defaultStyle.backgroundColor}, ${defaultStyle.backgroundColor}), repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`,\n backgroundColor: undefined,\n top: defaultStyle.top || '50%',\n left: defaultStyle.left || '50%'\n })}>\n {({isDragging, color}) => (<>\n <div\n className={style({\n size: 'full',\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 1,\n borderColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })} />\n <ColorLoupePortal isOpen={isDragging}>\n <ColorLoupe containerRef={containerRef} color={color} getPosition={getPosition} />\n </ColorLoupePortal>\n </>)}\n </ColorThumb>\n );\n}\n\n// ColorLoupe is rendered in a portal so that it breaks out of clipped/scrolling containers (e.g. popovers).\nfunction ColorLoupePortal({isOpen, children}: { isOpen: boolean, children: JSX.Element }) {\n let [state, setState] = useState(isOpen ? 'open' : 'closed');\n if (isOpen && state === 'closed') {\n setState('open');\n }\n\n if (!isOpen && state === 'open') {\n setState('exiting');\n }\n\n if (isOpen || state === 'exiting') {\n return createPortal(cloneElement(children, {isExiting: state === 'exiting', onExited: () => setState('closed')}), document.body);\n }\n\n return null;\n}\n\nfunction ColorLoupe({isExiting, onExited, containerRef, loupeRef, getPosition, color}: any) {\n let patternId = useId();\n\n // Get the bounding rectangle of the container (e.g. ColorArea/ColorSlider).\n let [containerRect, setContainerRect] = useState({top: 0, left: 0, width: 0, height: 0});\n useLayoutEffect(() => {\n let rect = containerRef.current?.getBoundingClientRect();\n setContainerRect({\n top: rect?.top || 0,\n left: rect?.left || 0,\n width: rect?.width || 0,\n height: rect?.height || 0\n });\n }, [containerRef]);\n\n // Compute the pixel position of the thumb.\n let {x: thumbLeft, y: thumbTop} = getPosition();\n thumbTop *= containerRect.height;\n thumbLeft *= containerRect.width;\n\n let enterAnimation = keyframes(`\n from {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n let exitAnimation = keyframes(`\n to {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n return (\n <svg\n style={{\n // Position relative to the viewport.\n position: 'fixed',\n top: containerRect.top + thumbTop,\n left: containerRect.left + thumbLeft,\n marginTop: -LOUPE_HEIGHT - LOUPE_BORDER_WIDTH * 2 - HANDLE_SIZE / 2 - LOUPE_OFFSET,\n marginLeft: -LOUPE_WIDTH / 2 - LOUPE_BORDER_WIDTH,\n animationName: isExiting ? exitAnimation : enterAnimation\n }}\n className={style({\n filter: 'elevated',\n pointerEvents: 'none',\n animationDuration: 125,\n animationFillMode: 'forwards',\n animationTimingFunction: 'in-out',\n isolation: 'isolate'\n })}\n onAnimationEnd={e => {\n if (e.animationName === exitAnimation) {\n onExited();\n }\n }}\n width={LOUPE_WIDTH + LOUPE_BORDER_WIDTH * 2}\n height={LOUPE_HEIGHT + LOUPE_BORDER_WIDTH * 2}\n ref={loupeRef}\n aria-hidden=\"true\">\n <pattern id={patternId} x=\"0\" y=\"0\" width=\"16\" height=\"16\" patternUnits=\"userSpaceOnUse\">\n <rect fill=\"white\" x=\"0\" y=\"0\" width=\"16\" height=\"16\" />\n <rect fill=\"#E1E1E1\" x=\"0\" y=\"0\" width=\"8\" height=\"8\" />\n <rect fill=\"#E1E1E1\" x=\"8\" y=\"8\" width=\"8\" height=\"8\" />\n </pattern>\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={`url(#${patternId})`} />\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={color.toString()} />\n <path\n className={style({\n strokeWidth: 1,\n stroke: {\n default: 'transparent-black-200',\n forcedColors: 'ButtonBorder'\n },\n fill: 'white'\n })}\n d=\"M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\" />\n </svg>\n );\n}\n"],"names":[],"version":3,"file":"ColorHandle.cjs.map"}
@@ -11,20 +11,20 @@
11
11
  transition-timing-function: cubic-bezier(.45, 0, .4, 1);
12
12
  }
13
13
 
14
- .lj {
15
- width: 1rem;
14
+ .lf {
15
+ width: calc(1rem * var(--s2-scale));
16
16
  }
17
17
 
18
- .lq {
19
- width: 2rem;
18
+ .lj {
19
+ width: calc(2rem * var(--s2-scale));
20
20
  }
21
21
 
22
- .kj {
23
- height: 1rem;
22
+ .kf {
23
+ height: calc(1rem * var(--s2-scale));
24
24
  }
25
25
 
26
- .kq {
27
- height: 2rem;
26
+ .kj {
27
+ height: calc(2rem * var(--s2-scale));
28
28
  }
29
29
 
30
30
  .bg {
@@ -67,11 +67,11 @@
67
67
  outline-color: #0000006b;
68
68
  }
69
69
 
70
- .l4 {
70
+ .lG {
71
71
  width: 100%;
72
72
  }
73
73
 
74
- .k4 {
74
+ .kG {
75
75
  height: 100%;
76
76
  }
77
77
 
@@ -158,26 +158,6 @@
158
158
 
159
159
  @layer _.b, UNSAFE_overrides;
160
160
 
161
- @layer _.b.b {
162
- @media not ((hover: hover) and (pointer: fine)) {
163
- .lbk {
164
- width: 1.25rem;
165
- }
166
-
167
- .lbr {
168
- width: 2.5rem;
169
- }
170
-
171
- .kbk {
172
- height: 1.25rem;
173
- }
174
-
175
- .kbr {
176
- height: 2.5rem;
177
- }
178
- }
179
- }
180
-
181
161
  @layer _.b.a {
182
162
  @media (forced-colors: active) {
183
163
  .da_____v {
@@ -1 +1 @@
1
- {"mappings":"ACiCiB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAgCI;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkFJ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6BE;;;;EAAA;;;;EAAA;;;;;AA/IF;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAgCI;;;;IA+GF;;;;;;AAtDI;;;;;;;AAOD;;;;;;;AAkBL","sources":["e345175c46126410","packages/@react-spectrum/s2/src/ColorHandle.tsx"],"sourcesContent":["@import \"63203eb3a948f993\";\n@import \"ba33a56d675003f7\";\n@import \"bf115cb0a25c2b12\";\n@import \"5d32c8c9143517d5\";\n@import \"cf10a6b7558ccf38\";\n@import \"d7c9e49b2d44a61e\";\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 {cloneElement, JSX, RefObject, useState} from 'react';\nimport {ColorThumb} from 'react-aria-components';\nimport {createPortal} from 'react-dom';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useId, useLayoutEffect} from '@react-aria/utils';\n\nconst HANDLE_SIZE = 16;\nconst LOUPE_HEIGHT = 64; // Does not include borders\nconst LOUPE_WIDTH = 48;\nconst LOUPE_BORDER_WIDTH = 1;\nconst LOUPE_OFFSET = 12; // Offset from handle to loupe\n\ninterface ColorHandleProps {\n containerRef: RefObject<HTMLElement | null>,\n getPosition: () => {x: number, y: number}\n}\n\nexport function ColorHandle({containerRef, getPosition}: ColorHandleProps) {\n return (\n <ColorThumb\n className={style({\n transition: '[width, height]',\n size: {\n default: HANDLE_SIZE,\n isFocusVisible: 32\n },\n backgroundColor: {\n isDisabled: 'disabled'\n },\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'white',\n isDisabled: 'disabled'\n },\n outlineStyle: 'solid',\n outlineWidth: 1,\n outlineColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `linear-gradient(${defaultStyle.backgroundColor}, ${defaultStyle.backgroundColor}), repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`,\n backgroundColor: undefined,\n top: defaultStyle.top || '50%',\n left: defaultStyle.left || '50%'\n })}>\n {({isDragging, color}) => (<>\n <div\n className={style({\n size: 'full',\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 1,\n borderColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })} />\n <ColorLoupePortal isOpen={isDragging}>\n <ColorLoupe containerRef={containerRef} color={color} getPosition={getPosition} />\n </ColorLoupePortal>\n </>)}\n </ColorThumb>\n );\n}\n\n// ColorLoupe is rendered in a portal so that it breaks out of clipped/scrolling containers (e.g. popovers).\nfunction ColorLoupePortal({isOpen, children}: { isOpen: boolean, children: JSX.Element }) {\n let [state, setState] = useState(isOpen ? 'open' : 'closed');\n if (isOpen && state === 'closed') {\n setState('open');\n }\n\n if (!isOpen && state === 'open') {\n setState('exiting');\n }\n\n if (isOpen || state === 'exiting') {\n return createPortal(cloneElement(children, {isExiting: state === 'exiting', onExited: () => setState('closed')}), document.body);\n }\n\n return null;\n}\n\nfunction ColorLoupe({isExiting, onExited, containerRef, loupeRef, getPosition, color}: any) {\n let patternId = useId();\n\n // Get the bounding rectangle of the container (e.g. ColorArea/ColorSlider).\n let [containerRect, setContainerRect] = useState({top: 0, left: 0, width: 0, height: 0});\n useLayoutEffect(() => {\n let rect = containerRef.current?.getBoundingClientRect();\n setContainerRect({\n top: rect?.top || 0,\n left: rect?.left || 0,\n width: rect?.width || 0,\n height: rect?.height || 0\n });\n }, [containerRef]);\n\n // Compute the pixel position of the thumb.\n let {x: thumbLeft, y: thumbTop} = getPosition();\n thumbTop *= containerRect.height;\n thumbLeft *= containerRect.width;\n\n let enterAnimation = keyframes(`\n from {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n let exitAnimation = keyframes(`\n to {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n return (\n <svg\n style={{\n // Position relative to the viewport.\n position: 'fixed',\n top: containerRect.top + thumbTop,\n left: containerRect.left + thumbLeft,\n marginTop: -LOUPE_HEIGHT - LOUPE_BORDER_WIDTH * 2 - HANDLE_SIZE / 2 - LOUPE_OFFSET,\n marginLeft: -LOUPE_WIDTH / 2 - LOUPE_BORDER_WIDTH,\n animationName: isExiting ? exitAnimation : enterAnimation\n }}\n className={style({\n filter: 'elevated',\n pointerEvents: 'none',\n animationDuration: 125,\n animationFillMode: 'forwards',\n animationTimingFunction: 'in-out',\n isolation: 'isolate'\n })}\n onAnimationEnd={e => {\n if (e.animationName === exitAnimation) {\n onExited();\n }\n }}\n width={LOUPE_WIDTH + LOUPE_BORDER_WIDTH * 2}\n height={LOUPE_HEIGHT + LOUPE_BORDER_WIDTH * 2}\n ref={loupeRef}\n aria-hidden=\"true\">\n <pattern id={patternId} x=\"0\" y=\"0\" width=\"16\" height=\"16\" patternUnits=\"userSpaceOnUse\">\n <rect fill=\"white\" x=\"0\" y=\"0\" width=\"16\" height=\"16\" />\n <rect fill=\"#E1E1E1\" x=\"0\" y=\"0\" width=\"8\" height=\"8\" />\n <rect fill=\"#E1E1E1\" x=\"8\" y=\"8\" width=\"8\" height=\"8\" />\n </pattern>\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={`url(#${patternId})`} />\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={color.toString()} />\n <path\n className={style({\n strokeWidth: 1,\n stroke: {\n default: 'transparent-black-200',\n forcedColors: 'ButtonBorder'\n },\n fill: 'white'\n })}\n d=\"M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\" />\n </svg>\n );\n}\n"],"names":[],"version":3,"file":"ColorHandle.css.map"}
1
+ {"mappings":"ACiCiB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAgCI;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAkFJ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6BE;;;;EAAA;;;;EAAA;;;;;AA/IF;;AAAA;EAAA;IAAA;;;;IAgCI;;;;IA+GF;;;;;;AAtDI;;;;;;;AAOD;;;;;;;AAkBL","sources":["e345175c46126410","packages/@react-spectrum/s2/src/ColorHandle.tsx"],"sourcesContent":["@import \"63203eb3a948f993\";\n@import \"ba33a56d675003f7\";\n@import \"bf115cb0a25c2b12\";\n@import \"5d32c8c9143517d5\";\n@import \"cf10a6b7558ccf38\";\n@import \"d7c9e49b2d44a61e\";\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 {cloneElement, JSX, RefObject, useState} from 'react';\nimport {ColorThumb} from 'react-aria-components';\nimport {createPortal} from 'react-dom';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useId, useLayoutEffect} from '@react-aria/utils';\n\nconst HANDLE_SIZE = 16;\nconst LOUPE_HEIGHT = 64; // Does not include borders\nconst LOUPE_WIDTH = 48;\nconst LOUPE_BORDER_WIDTH = 1;\nconst LOUPE_OFFSET = 12; // Offset from handle to loupe\n\ninterface ColorHandleProps {\n containerRef: RefObject<HTMLElement | null>,\n getPosition: () => {x: number, y: number}\n}\n\nexport function ColorHandle({containerRef, getPosition}: ColorHandleProps) {\n return (\n <ColorThumb\n className={style({\n transition: '[width, height]',\n size: {\n default: HANDLE_SIZE,\n isFocusVisible: 32\n },\n backgroundColor: {\n isDisabled: 'disabled'\n },\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'white',\n isDisabled: 'disabled'\n },\n outlineStyle: 'solid',\n outlineWidth: 1,\n outlineColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `linear-gradient(${defaultStyle.backgroundColor}, ${defaultStyle.backgroundColor}), repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`,\n backgroundColor: undefined,\n top: defaultStyle.top || '50%',\n left: defaultStyle.left || '50%'\n })}>\n {({isDragging, color}) => (<>\n <div\n className={style({\n size: 'full',\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 1,\n borderColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })} />\n <ColorLoupePortal isOpen={isDragging}>\n <ColorLoupe containerRef={containerRef} color={color} getPosition={getPosition} />\n </ColorLoupePortal>\n </>)}\n </ColorThumb>\n );\n}\n\n// ColorLoupe is rendered in a portal so that it breaks out of clipped/scrolling containers (e.g. popovers).\nfunction ColorLoupePortal({isOpen, children}: { isOpen: boolean, children: JSX.Element }) {\n let [state, setState] = useState(isOpen ? 'open' : 'closed');\n if (isOpen && state === 'closed') {\n setState('open');\n }\n\n if (!isOpen && state === 'open') {\n setState('exiting');\n }\n\n if (isOpen || state === 'exiting') {\n return createPortal(cloneElement(children, {isExiting: state === 'exiting', onExited: () => setState('closed')}), document.body);\n }\n\n return null;\n}\n\nfunction ColorLoupe({isExiting, onExited, containerRef, loupeRef, getPosition, color}: any) {\n let patternId = useId();\n\n // Get the bounding rectangle of the container (e.g. ColorArea/ColorSlider).\n let [containerRect, setContainerRect] = useState({top: 0, left: 0, width: 0, height: 0});\n useLayoutEffect(() => {\n let rect = containerRef.current?.getBoundingClientRect();\n setContainerRect({\n top: rect?.top || 0,\n left: rect?.left || 0,\n width: rect?.width || 0,\n height: rect?.height || 0\n });\n }, [containerRef]);\n\n // Compute the pixel position of the thumb.\n let {x: thumbLeft, y: thumbTop} = getPosition();\n thumbTop *= containerRect.height;\n thumbLeft *= containerRect.width;\n\n let enterAnimation = keyframes(`\n from {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n let exitAnimation = keyframes(`\n to {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n return (\n <svg\n style={{\n // Position relative to the viewport.\n position: 'fixed',\n top: containerRect.top + thumbTop,\n left: containerRect.left + thumbLeft,\n marginTop: -LOUPE_HEIGHT - LOUPE_BORDER_WIDTH * 2 - HANDLE_SIZE / 2 - LOUPE_OFFSET,\n marginLeft: -LOUPE_WIDTH / 2 - LOUPE_BORDER_WIDTH,\n animationName: isExiting ? exitAnimation : enterAnimation\n }}\n className={style({\n filter: 'elevated',\n pointerEvents: 'none',\n animationDuration: 125,\n animationFillMode: 'forwards',\n animationTimingFunction: 'in-out',\n isolation: 'isolate'\n })}\n onAnimationEnd={e => {\n if (e.animationName === exitAnimation) {\n onExited();\n }\n }}\n width={LOUPE_WIDTH + LOUPE_BORDER_WIDTH * 2}\n height={LOUPE_HEIGHT + LOUPE_BORDER_WIDTH * 2}\n ref={loupeRef}\n aria-hidden=\"true\">\n <pattern id={patternId} x=\"0\" y=\"0\" width=\"16\" height=\"16\" patternUnits=\"userSpaceOnUse\">\n <rect fill=\"white\" x=\"0\" y=\"0\" width=\"16\" height=\"16\" />\n <rect fill=\"#E1E1E1\" x=\"0\" y=\"0\" width=\"8\" height=\"8\" />\n <rect fill=\"#E1E1E1\" x=\"8\" y=\"8\" width=\"8\" height=\"8\" />\n </pattern>\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={`url(#${patternId})`} />\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={color.toString()} />\n <path\n className={style({\n strokeWidth: 1,\n stroke: {\n default: 'transparent-black-200',\n forcedColors: 'ButtonBorder'\n },\n fill: 'white'\n })}\n d=\"M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\" />\n </svg>\n );\n}\n"],"names":[],"version":3,"file":"ColorHandle.css.map"}
@@ -32,20 +32,10 @@ function $b4f7db7c45cd3de9$export$92862704de639678({ containerRef: containerRef,
32
32
  rules += ' _O-1oihi8a';
33
33
  rules += ' _Q-375x7f';
34
34
  rules += ' _Ra';
35
- if (props.isFocusVisible) {
36
- rules += ' lbr';
37
- rules += ' lq';
38
- } else {
39
- rules += ' lbk';
40
- rules += ' lj';
41
- }
42
- if (props.isFocusVisible) {
43
- rules += ' kbr';
44
- rules += ' kq';
45
- } else {
46
- rules += ' kbk';
47
- rules += ' kj';
48
- }
35
+ if (props.isFocusVisible) rules += ' lj';
36
+ else rules += ' lf';
37
+ if (props.isFocusVisible) rules += ' kj';
38
+ else rules += ' kf';
49
39
  if (props.isDisabled) rules += ' bg';
50
40
  rules += ' _vf';
51
41
  rules += ' _wf';
@@ -74,7 +64,7 @@ function $b4f7db7c45cd3de9$export$92862704de639678({ containerRef: containerRef,
74
64
  children: ({ isDragging: isDragging, color: color })=>/*#__PURE__*/ (0, $kShzN$jsxs)((0, $kShzN$Fragment), {
75
65
  children: [
76
66
  /*#__PURE__*/ (0, $kShzN$jsx)("div", {
77
- className: " . l4 k4 _vf _wf _xf _yf __na wa ub vb sb tb cb42 ca_____v"
67
+ className: " . lG kG _vf _wf _xf _yf __na wa ub vb sb tb cb42 ca_____v"
78
68
  }),
79
69
  /*#__PURE__*/ (0, $kShzN$jsx)($b4f7db7c45cd3de9$var$ColorLoupePortal, {
80
70
  isOpen: isDragging,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AASD,MAAM,oCAAc;AACpB,MAAM,qCAAe,IAAI,2BAA2B;AACpD,MAAM,oCAAc;AACpB,MAAM,2CAAqB;AAC3B,MAAM,qCAAe,IAAI,8BAA8B;AAOhD,SAAS,0CAAY,gBAAC,YAAY,eAAE,WAAW,EAAmB;IACvE,qBACE,gBAAC,CAAA,GAAA,iBAAS;QACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwBA,OAAO,CAAC,gBAAC,YAAY,cAAE,UAAU,EAAC,GAAM,CAAA;gBACtC,YAAY,aAAa,YAAY,CAAC,gBAAgB,EAAE,aAAa,eAAe,CAAC,EAAE,EAAE,aAAa,eAAe,CAAC,yEAAyE,CAAC;gBAChM,iBAAiB;gBACjB,KAAK,aAAa,GAAG,IAAI;gBACzB,MAAM,aAAa,IAAI,IAAI;YAC7B,CAAA;kBACC,CAAC,cAAC,UAAU,SAAE,KAAK,E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YACV,KAAK,cAAc,GAAG,GAAG;YACzB,MAAM,cAAc,IAAI,GAAG;YAC3B,WAAW,CAAC,qCAAe,2CAAqB,IAAI,oCAAc,IAAI;YACtE,YAAY,CAAC,oCAAc,IAAI;YAC/B,eAAe,YAAY,gBAAgB;QAC7C;QACA,SAAS;QAQT,gBAAgB,CAAA;YACd,IAAI,EAAE,aAAa,KAAK,eACtB;QAEJ;QACA,OAAO,oCAAc,2CAAqB;QAC1C,QAAQ,qCAAe,2CAAqB;QAC5C,KAAK;QACL,eAAY;;0BACZ,iBAAC;gBAAQ,IAAI;gBAAW,GAAE;gBAAI,GAAE;gBAAI,OAAM;gBAAK,QAAO;gBAAK,cAAa;;kCACtE,gBAAC;wBAAK,MAAK;wBAAQ,GAAE;wBAAI,GAAE;wBAAI,OAAM;wBAAK,QAAO;;kCACjD,gBAAC;wBAAK,MAAK;wBAAU,GAAE;wBAAI,GAAE;wBAAI,OAAM;wBAAI,QAAO;;kCAClD,gBAAC;wBAAK,MAAK;wBAAU,GAAE;wBAAI,GAAE;wBAAI,OAAM;wBAAI,QAAO;;;;0BAEpD,gBAAC;gBACC,GAAE;gBACF,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;;0BAC5B,gBAAC;gBACC,GAAE;gBACF,MAAM,MAAM,QAAQ;;0BACtB,gBAAC;gBACC,SAAS;gBAQT,GAAE;;;;AAGV","sources":["packages/@react-spectrum/s2/src/ColorHandle.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 {cloneElement, JSX, RefObject, useState} from 'react';\nimport {ColorThumb} from 'react-aria-components';\nimport {createPortal} from 'react-dom';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useId, useLayoutEffect} from '@react-aria/utils';\n\nconst HANDLE_SIZE = 16;\nconst LOUPE_HEIGHT = 64; // Does not include borders\nconst LOUPE_WIDTH = 48;\nconst LOUPE_BORDER_WIDTH = 1;\nconst LOUPE_OFFSET = 12; // Offset from handle to loupe\n\ninterface ColorHandleProps {\n containerRef: RefObject<HTMLElement | null>,\n getPosition: () => {x: number, y: number}\n}\n\nexport function ColorHandle({containerRef, getPosition}: ColorHandleProps) {\n return (\n <ColorThumb\n className={style({\n transition: '[width, height]',\n size: {\n default: HANDLE_SIZE,\n isFocusVisible: 32\n },\n backgroundColor: {\n isDisabled: 'disabled'\n },\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'white',\n isDisabled: 'disabled'\n },\n outlineStyle: 'solid',\n outlineWidth: 1,\n outlineColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `linear-gradient(${defaultStyle.backgroundColor}, ${defaultStyle.backgroundColor}), repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`,\n backgroundColor: undefined,\n top: defaultStyle.top || '50%',\n left: defaultStyle.left || '50%'\n })}>\n {({isDragging, color}) => (<>\n <div\n className={style({\n size: 'full',\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 1,\n borderColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })} />\n <ColorLoupePortal isOpen={isDragging}>\n <ColorLoupe containerRef={containerRef} color={color} getPosition={getPosition} />\n </ColorLoupePortal>\n </>)}\n </ColorThumb>\n );\n}\n\n// ColorLoupe is rendered in a portal so that it breaks out of clipped/scrolling containers (e.g. popovers).\nfunction ColorLoupePortal({isOpen, children}: { isOpen: boolean, children: JSX.Element }) {\n let [state, setState] = useState(isOpen ? 'open' : 'closed');\n if (isOpen && state === 'closed') {\n setState('open');\n }\n\n if (!isOpen && state === 'open') {\n setState('exiting');\n }\n\n if (isOpen || state === 'exiting') {\n return createPortal(cloneElement(children, {isExiting: state === 'exiting', onExited: () => setState('closed')}), document.body);\n }\n\n return null;\n}\n\nfunction ColorLoupe({isExiting, onExited, containerRef, loupeRef, getPosition, color}: any) {\n let patternId = useId();\n\n // Get the bounding rectangle of the container (e.g. ColorArea/ColorSlider).\n let [containerRect, setContainerRect] = useState({top: 0, left: 0, width: 0, height: 0});\n useLayoutEffect(() => {\n let rect = containerRef.current?.getBoundingClientRect();\n setContainerRect({\n top: rect?.top || 0,\n left: rect?.left || 0,\n width: rect?.width || 0,\n height: rect?.height || 0\n });\n }, [containerRef]);\n\n // Compute the pixel position of the thumb.\n let {x: thumbLeft, y: thumbTop} = getPosition();\n thumbTop *= containerRect.height;\n thumbLeft *= containerRect.width;\n\n let enterAnimation = keyframes(`\n from {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n let exitAnimation = keyframes(`\n to {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n return (\n <svg\n style={{\n // Position relative to the viewport.\n position: 'fixed',\n top: containerRect.top + thumbTop,\n left: containerRect.left + thumbLeft,\n marginTop: -LOUPE_HEIGHT - LOUPE_BORDER_WIDTH * 2 - HANDLE_SIZE / 2 - LOUPE_OFFSET,\n marginLeft: -LOUPE_WIDTH / 2 - LOUPE_BORDER_WIDTH,\n animationName: isExiting ? exitAnimation : enterAnimation\n }}\n className={style({\n filter: 'elevated',\n pointerEvents: 'none',\n animationDuration: 125,\n animationFillMode: 'forwards',\n animationTimingFunction: 'in-out',\n isolation: 'isolate'\n })}\n onAnimationEnd={e => {\n if (e.animationName === exitAnimation) {\n onExited();\n }\n }}\n width={LOUPE_WIDTH + LOUPE_BORDER_WIDTH * 2}\n height={LOUPE_HEIGHT + LOUPE_BORDER_WIDTH * 2}\n ref={loupeRef}\n aria-hidden=\"true\">\n <pattern id={patternId} x=\"0\" y=\"0\" width=\"16\" height=\"16\" patternUnits=\"userSpaceOnUse\">\n <rect fill=\"white\" x=\"0\" y=\"0\" width=\"16\" height=\"16\" />\n <rect fill=\"#E1E1E1\" x=\"0\" y=\"0\" width=\"8\" height=\"8\" />\n <rect fill=\"#E1E1E1\" x=\"8\" y=\"8\" width=\"8\" height=\"8\" />\n </pattern>\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={`url(#${patternId})`} />\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={color.toString()} />\n <path\n className={style({\n strokeWidth: 1,\n stroke: {\n default: 'transparent-black-200',\n forcedColors: 'ButtonBorder'\n },\n fill: 'white'\n })}\n d=\"M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\" />\n </svg>\n );\n}\n"],"names":[],"version":3,"file":"ColorHandle.mjs.map"}
1
+ {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AASD,MAAM,oCAAc;AACpB,MAAM,qCAAe,IAAI,2BAA2B;AACpD,MAAM,oCAAc;AACpB,MAAM,2CAAqB;AAC3B,MAAM,qCAAe,IAAI,8BAA8B;AAOhD,SAAS,0CAAY,gBAAC,YAAY,eAAE,WAAW,EAAmB;IACvE,qBACE,gBAAC,CAAA,GAAA,iBAAS;QACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwBA,OAAO,CAAC,gBAAC,YAAY,cAAE,UAAU,EAAC,GAAM,CAAA;gBACtC,YAAY,aAAa,YAA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AAa;IAEjB,2CAA2C;IAC3C,IAAI,EAAC,GAAG,SAAS,EAAE,GAAG,QAAQ,EAAC,GAAG;IAClC,YAAY,cAAc,MAAM;IAChC,aAAa,cAAc,KAAK;IAEhC,IAAI;IAOJ,IAAI;IAOJ,qBACE,iBAAC;QACC,OAAO;YACL,qCAAqC;YACrC,UAAU;YACV,KAAK,cAAc,GAAG,GAAG;YACzB,MAAM,cAAc,IAAI,GAAG;YAC3B,WAAW,CAAC,qCAAe,2CAAqB,IAAI,oCAAc,IAAI;YACtE,YAAY,CAAC,oCAAc,IAAI;YAC/B,eAAe,YAAY,gBAAgB;QAC7C;QACA,SAAS;QAQT,gBAAgB,CAAA;YACd,IAAI,EAAE,aAAa,KAAK,eACtB;QAEJ;QACA,OAAO,oCAAc,2CAAqB;QAC1C,QAAQ,qCAAe,2CAAqB;QAC5C,KAAK;QACL,eAAY;;0BACZ,iBAAC;gBAAQ,IAAI;gBAAW,GAAE;gBAAI,GAAE;gBAAI,OAAM;gBAAK,QAAO;gBAAK,cAAa;;kCACtE,gBAAC;wBAAK,MAAK;wBAAQ,GAAE;wBAAI,GAAE;wBAAI,OAAM;wBAAK,QAAO;;kCACjD,gBAAC;wBAAK,MAAK;wBAAU,GAAE;wBAAI,GAAE;wBAAI,OAAM;wBAAI,QAAO;;kCAClD,gBAAC;wBAAK,MAAK;wBAAU,GAAE;wBAAI,GAAE;wBAAI,OAAM;wBAAI,QAAO;;;;0BAEpD,gBAAC;gBACC,GAAE;gBACF,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;;0BAC5B,gBAAC;gBACC,GAAE;gBACF,MAAM,MAAM,QAAQ;;0BACtB,gBAAC;gBACC,SAAS;gBAQT,GAAE;;;;AAGV","sources":["packages/@react-spectrum/s2/src/ColorHandle.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 {cloneElement, JSX, RefObject, useState} from 'react';\nimport {ColorThumb} from 'react-aria-components';\nimport {createPortal} from 'react-dom';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useId, useLayoutEffect} from '@react-aria/utils';\n\nconst HANDLE_SIZE = 16;\nconst LOUPE_HEIGHT = 64; // Does not include borders\nconst LOUPE_WIDTH = 48;\nconst LOUPE_BORDER_WIDTH = 1;\nconst LOUPE_OFFSET = 12; // Offset from handle to loupe\n\ninterface ColorHandleProps {\n containerRef: RefObject<HTMLElement | null>,\n getPosition: () => {x: number, y: number}\n}\n\nexport function ColorHandle({containerRef, getPosition}: ColorHandleProps) {\n return (\n <ColorThumb\n className={style({\n transition: '[width, height]',\n size: {\n default: HANDLE_SIZE,\n isFocusVisible: 32\n },\n backgroundColor: {\n isDisabled: 'disabled'\n },\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 2,\n borderColor: {\n default: 'white',\n isDisabled: 'disabled'\n },\n outlineStyle: 'solid',\n outlineWidth: 1,\n outlineColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `linear-gradient(${defaultStyle.backgroundColor}, ${defaultStyle.backgroundColor}), repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`,\n backgroundColor: undefined,\n top: defaultStyle.top || '50%',\n left: defaultStyle.left || '50%'\n })}>\n {({isDragging, color}) => (<>\n <div\n className={style({\n size: 'full',\n borderRadius: 'full',\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: 1,\n borderColor: {\n default: 'black/42',\n forcedColors: 'ButtonBorder'\n }\n })} />\n <ColorLoupePortal isOpen={isDragging}>\n <ColorLoupe containerRef={containerRef} color={color} getPosition={getPosition} />\n </ColorLoupePortal>\n </>)}\n </ColorThumb>\n );\n}\n\n// ColorLoupe is rendered in a portal so that it breaks out of clipped/scrolling containers (e.g. popovers).\nfunction ColorLoupePortal({isOpen, children}: { isOpen: boolean, children: JSX.Element }) {\n let [state, setState] = useState(isOpen ? 'open' : 'closed');\n if (isOpen && state === 'closed') {\n setState('open');\n }\n\n if (!isOpen && state === 'open') {\n setState('exiting');\n }\n\n if (isOpen || state === 'exiting') {\n return createPortal(cloneElement(children, {isExiting: state === 'exiting', onExited: () => setState('closed')}), document.body);\n }\n\n return null;\n}\n\nfunction ColorLoupe({isExiting, onExited, containerRef, loupeRef, getPosition, color}: any) {\n let patternId = useId();\n\n // Get the bounding rectangle of the container (e.g. ColorArea/ColorSlider).\n let [containerRect, setContainerRect] = useState({top: 0, left: 0, width: 0, height: 0});\n useLayoutEffect(() => {\n let rect = containerRef.current?.getBoundingClientRect();\n setContainerRect({\n top: rect?.top || 0,\n left: rect?.left || 0,\n width: rect?.width || 0,\n height: rect?.height || 0\n });\n }, [containerRef]);\n\n // Compute the pixel position of the thumb.\n let {x: thumbLeft, y: thumbTop} = getPosition();\n thumbTop *= containerRect.height;\n thumbLeft *= containerRect.width;\n\n let enterAnimation = keyframes(`\n from {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n let exitAnimation = keyframes(`\n to {\n transform: translateY(8px);\n opacity: 0;\n }\n `);\n\n return (\n <svg\n style={{\n // Position relative to the viewport.\n position: 'fixed',\n top: containerRect.top + thumbTop,\n left: containerRect.left + thumbLeft,\n marginTop: -LOUPE_HEIGHT - LOUPE_BORDER_WIDTH * 2 - HANDLE_SIZE / 2 - LOUPE_OFFSET,\n marginLeft: -LOUPE_WIDTH / 2 - LOUPE_BORDER_WIDTH,\n animationName: isExiting ? exitAnimation : enterAnimation\n }}\n className={style({\n filter: 'elevated',\n pointerEvents: 'none',\n animationDuration: 125,\n animationFillMode: 'forwards',\n animationTimingFunction: 'in-out',\n isolation: 'isolate'\n })}\n onAnimationEnd={e => {\n if (e.animationName === exitAnimation) {\n onExited();\n }\n }}\n width={LOUPE_WIDTH + LOUPE_BORDER_WIDTH * 2}\n height={LOUPE_HEIGHT + LOUPE_BORDER_WIDTH * 2}\n ref={loupeRef}\n aria-hidden=\"true\">\n <pattern id={patternId} x=\"0\" y=\"0\" width=\"16\" height=\"16\" patternUnits=\"userSpaceOnUse\">\n <rect fill=\"white\" x=\"0\" y=\"0\" width=\"16\" height=\"16\" />\n <rect fill=\"#E1E1E1\" x=\"0\" y=\"0\" width=\"8\" height=\"8\" />\n <rect fill=\"#E1E1E1\" x=\"8\" y=\"8\" width=\"8\" height=\"8\" />\n </pattern>\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={`url(#${patternId})`} />\n <path\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={color.toString()} />\n <path\n className={style({\n strokeWidth: 1,\n stroke: {\n default: 'transparent-black-200',\n forcedColors: 'ButtonBorder'\n },\n fill: 'white'\n })}\n d=\"M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\" />\n </svg>\n );\n}\n"],"names":[],"version":3,"file":"ColorHandle.mjs.map"}
@@ -51,15 +51,9 @@ function $fdd6f3d03620d438$var$ColorSlider(props, ref) {
51
51
  let $l = false;
52
52
  for (let p of matches)if (/^\s*l/.test(p)) $l = true;
53
53
  if (!$l) {
54
- if (props.orientation === "horizontal") {
55
- rules += ' lbQ';
56
- rules += ' lP';
57
- }
58
- }
59
- if (props.orientation === "vertical") {
60
- rules += ' kbQ';
61
- rules += ' kP';
54
+ if (props.orientation === "horizontal") rules += ' lx';
62
55
  }
56
+ if (props.orientation === "vertical") rules += ' kx';
63
57
  if (props.orientation === "vertical") rules += ' _Za';
64
58
  else if (props.orientation === "horizontal") rules += ' _Zf';
65
59
  rules += ' __h-1egg2pz';
@@ -134,15 +128,10 @@ function $fdd6f3d03620d438$var$ColorSlider(props, ref) {
134
128
  rules += ' __b-4ka10a';
135
129
  rules += ' __c-4ka10a';
136
130
  rules += ' __d-4ka10a';
137
- if (props.orientation === "vertical") {
138
- rules += ' lbn';
139
- rules += ' lm';
140
- } else if (props.orientation === "horizontal") rules += ' l4';
141
- if (props.orientation === "vertical") rules += ' k4';
142
- else if (props.orientation === "horizontal") {
143
- rules += ' kbn';
144
- rules += ' km';
145
- }
131
+ if (props.orientation === "vertical") rules += ' lh';
132
+ else if (props.orientation === "horizontal") rules += ' lG';
133
+ if (props.orientation === "vertical") rules += ' kG';
134
+ else if (props.orientation === "horizontal") rules += ' kh';
146
135
  rules += ' _vc';
147
136
  rules += ' _wc';
148
137
  rules += ' _xc';
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA+D;AAE7G,SAAS,kCAAY,KAAuB,EAAE,GAA2B;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,oBAAC,mBAAmB,kBAAI,YAAY,UAAE,MAAM,EAAC,GAAG;IACpD,IAAI,eAAe,CAAA,GAAA,mCAAQ,EAAE;IAC7B,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,oCAAQ;IAEvB,qBACE,gCAAC,CAAA,GAAA,sCAAc;QACZ,GAAG,KAAK;QACT,K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AA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ColorSlider.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 ColorSlider as AriaColorSlider,\n ColorSliderProps as AriaColorSliderProps,\n ContextValue,\n SliderOutput,\n SliderTrack,\n useLocale\n} from 'react-aria-components';\nimport {ColorHandle} from './ColorHandle';\nimport {createContext, forwardRef, useRef} from 'react';\nimport {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children' | 'className' | 'style'>, Pick<SpectrumLabelableProps, 'contextualHelp'>, StyleProps {\n label?: string\n}\n\nexport const ColorSliderContext = createContext<ContextValue<ColorSliderProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction ColorSlider(props: ColorSliderProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorSliderContext);\n let {UNSAFE_className = '', UNSAFE_style, styles} = props;\n let containerRef = useDOMRef(ref);\n let trackRef = useRef(null);\n let {locale} = useLocale();\n\n return (\n <AriaColorSlider\n {...props}\n ref={containerRef}\n style={UNSAFE_style}\n // The visual label is hidden when vertical, so make it an aria-label instead.\n aria-label={props['aria-label'] || (props.orientation === 'vertical' ? props.label : undefined)}\n className={renderProps => UNSAFE_className + style({\n width: {\n orientation: {\n horizontal: 192\n }\n },\n height: {\n orientation: {\n vertical: 192\n }\n },\n display: {\n orientation: {\n horizontal: 'grid',\n vertical: 'block'\n }\n },\n gridTemplateColumns: ['1fr', 'auto'],\n gridTemplateAreas: [\n 'label output',\n 'track track'\n ],\n rowGap: 4\n }, getAllowedOverrides())(renderProps, styles)}>\n {({isDisabled, orientation, state}) => (<>\n {orientation === 'horizontal' && (props.label || (props.label === undefined && !props['aria-label'] && !props['aria-labelledby'])) && (\n // If no external label, aria-label or aria-labelledby is provided,\n // default to displaying the localized channel value.\n // Specifically check if label is undefined. If label is `null` then display no visible label.\n // A default aria-label is provided by useColorSlider in that case.\n <FieldLabel isDisabled={isDisabled} contextualHelp={props.contextualHelp}>\n {props.label || state.value.getChannelName(props.channel, locale)}\n </FieldLabel>\n )}\n {orientation === 'horizontal' &&\n <SliderOutput\n className={style({\n gridArea: 'output',\n font: 'control',\n cursor: 'default',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n }\n })} />\n }\n <SliderTrack\n ref={trackRef}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `${defaultStyle.background}, repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`\n })}\n className={style({\n gridArea: 'track',\n width: {\n orientation: {\n horizontal: 'full',\n vertical: 24\n }\n },\n height: {\n orientation: {\n horizontal: 24,\n vertical: 'full'\n }\n },\n borderRadius: 'default',\n outlineColor: {\n default: 'gray-1000/10',\n forcedColors: 'ButtonBorder'\n },\n outlineWidth: 1,\n outlineOffset: -1,\n outlineStyle: {\n default: 'solid',\n isDisabled: 'none'\n },\n backgroundColor: {\n isDisabled: 'disabled'\n }\n })}>\n <ColorHandle\n containerRef={trackRef}\n getPosition={() => {\n let x = state.orientation === 'horizontal' ? state.getThumbPercent(0) : 0.5;\n let y = state.orientation === 'horizontal' ? 0.5 : 1 - state.getThumbPercent(0);\n return {x, y};\n }} />\n </SliderTrack>\n </>)}\n </AriaColorSlider>\n );\n}\n\n/**\n * A ColorSlider allows users to adjust an individual channel of a color value.\n */\nlet _ColorSlider = forwardRef(ColorSlider);\nexport {_ColorSlider as ColorSlider};\n"],"names":[],"version":3,"file":"ColorSlider.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA+D;AAE7G,SAAS,kCAAY,KAAuB,EAAE,GAA2B;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,oBAAC,mBAAmB,kBAAI,YAAY,UAAE,MAAM,EAAC,GAAG;IACpD,IAAI,eAAe,CAAA,GAAA,mCAAQ,EAAE;IAC7B,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,oCAAQ;IAEvB,qBACE,gCAAC,CAAA,GAAA,sCAAc;QACZ,GAAG,KAAK;QACT,KAAK;QACL,OAAO;QACP,8EAA8E;QAC9E,cAAY,KAAK,CAAC,aAAa,IAAK,CAAA,MAAM,WAAW,KAAK,aAAa,MAAM,KAAK,GAAG,SAAQ;QAC7F,WAAW,CAAA,cAAe,mBAAmB;;;;;;;;;;;;;;;;cAuBnB,aAAa;kBACtC,CAAC,cAAC,UAAU,eAAE,WAAW,SAAE,KAAK,EAAC,iBAAM;;oBACrC,gBAAgB,gBAAiB,CAAA,MAAM,KAAK,IAAK,MAAM,KAAK,KAAK,aAAa,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB,KAC9H,mEAAmE;oBACnE,qDAAqD;oBACrD,8FAA8F;oBAC9F,mEAAmE;kCACnE,gCAAC,CAAA,GAAA,oCAAS;wBAAE,YAAY;wBAAY,gBAAgB,MAAM,cAAc;kCACrE,MAAM,KAAK,IAAI,MAAM,KAAK,CAAC,cAAc,CAAC,MAAM,OAAO,EAAE;;oBAG7D,gBAAgB,8BACf,gCAAC,CAAA,GAAA,uCAAW;wBACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAUJ,gCAAC,CAAA,GAAA,sCAAU;wBACT,KAAK;wBACL,OAAO,CAAC,gBAAC,YAAY,cAAE,UAAU,EAAC,GAAM,CAAA;gCACtC,YAAY,aAAa,YAAY,CAAC,EAAE,aAAa,UAAU,CAAC,wEAAwE,CAAC;4BAC3I,CAAA;wBACA;;;;;;;;;;;;;;;;;;;;;;;kCA6BA,cAAA,gCAAC,CAAA,GAAA,qCAAU;4BACT,cAAc;4BACd,aAAa;gCACX,IAAI,IAAI,MAAM,WAAW,KAAK,eAAe,MAAM,eAAe,CAAC,KAAK;gCACxE,IAAI,IAAI,MAAM,WAAW,KAAK,eAAe,MAAM,IAAI,MAAM,eAAe,CAAC;gCAC7E,OAAO;uCAAC;uCAAG;gCAAC;4BACd;;;;;;AAKZ;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,uBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/ColorSlider.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 ColorSlider as AriaColorSlider,\n ColorSliderProps as AriaColorSliderProps,\n ContextValue,\n SliderOutput,\n SliderTrack,\n useLocale\n} from 'react-aria-components';\nimport {ColorHandle} from './ColorHandle';\nimport {createContext, forwardRef, useRef} from 'react';\nimport {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children' | 'className' | 'style'>, Pick<SpectrumLabelableProps, 'contextualHelp'>, StyleProps {\n label?: string\n}\n\nexport const ColorSliderContext = createContext<ContextValue<ColorSliderProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction ColorSlider(props: ColorSliderProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorSliderContext);\n let {UNSAFE_className = '', UNSAFE_style, styles} = props;\n let containerRef = useDOMRef(ref);\n let trackRef = useRef(null);\n let {locale} = useLocale();\n\n return (\n <AriaColorSlider\n {...props}\n ref={containerRef}\n style={UNSAFE_style}\n // The visual label is hidden when vertical, so make it an aria-label instead.\n aria-label={props['aria-label'] || (props.orientation === 'vertical' ? props.label : undefined)}\n className={renderProps => UNSAFE_className + style({\n width: {\n orientation: {\n horizontal: 192\n }\n },\n height: {\n orientation: {\n vertical: 192\n }\n },\n display: {\n orientation: {\n horizontal: 'grid',\n vertical: 'block'\n }\n },\n gridTemplateColumns: ['1fr', 'auto'],\n gridTemplateAreas: [\n 'label output',\n 'track track'\n ],\n rowGap: 4\n }, getAllowedOverrides())(renderProps, styles)}>\n {({isDisabled, orientation, state}) => (<>\n {orientation === 'horizontal' && (props.label || (props.label === undefined && !props['aria-label'] && !props['aria-labelledby'])) && (\n // If no external label, aria-label or aria-labelledby is provided,\n // default to displaying the localized channel value.\n // Specifically check if label is undefined. If label is `null` then display no visible label.\n // A default aria-label is provided by useColorSlider in that case.\n <FieldLabel isDisabled={isDisabled} contextualHelp={props.contextualHelp}>\n {props.label || state.value.getChannelName(props.channel, locale)}\n </FieldLabel>\n )}\n {orientation === 'horizontal' &&\n <SliderOutput\n className={style({\n gridArea: 'output',\n font: 'control',\n cursor: 'default',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n }\n })} />\n }\n <SliderTrack\n ref={trackRef}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `${defaultStyle.background}, repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`\n })}\n className={style({\n gridArea: 'track',\n width: {\n orientation: {\n horizontal: 'full',\n vertical: 24\n }\n },\n height: {\n orientation: {\n horizontal: 24,\n vertical: 'full'\n }\n },\n borderRadius: 'default',\n outlineColor: {\n default: 'gray-1000/10',\n forcedColors: 'ButtonBorder'\n },\n outlineWidth: 1,\n outlineOffset: -1,\n outlineStyle: {\n default: 'solid',\n isDisabled: 'none'\n },\n backgroundColor: {\n isDisabled: 'disabled'\n }\n })}>\n <ColorHandle\n containerRef={trackRef}\n getPosition={() => {\n let x = state.orientation === 'horizontal' ? state.getThumbPercent(0) : 0.5;\n let y = state.orientation === 'horizontal' ? 0.5 : 1 - state.getThumbPercent(0);\n return {x, y};\n }} />\n </SliderTrack>\n </>)}\n </AriaColorSlider>\n );\n}\n\n/**\n * A ColorSlider allows users to adjust an individual channel of a color value.\n */\nlet _ColorSlider = forwardRef(ColorSlider);\nexport {_ColorSlider as ColorSlider};\n"],"names":[],"version":3,"file":"ColorSlider.cjs.map"}
@@ -1,10 +1,10 @@
1
1
  @layer _.a {
2
- .lP {
3
- width: 12rem;
2
+ .lx {
3
+ width: calc(12rem * var(--s2-scale));
4
4
  }
5
5
 
6
- .kP {
7
- height: 12rem;
6
+ .kx {
7
+ height: calc(12rem * var(--s2-scale));
8
8
  }
9
9
 
10
10
  ._Zf {
@@ -110,19 +110,19 @@
110
110
  grid-row-end: track;
111
111
  }
112
112
 
113
- .l4 {
113
+ .lG {
114
114
  width: 100%;
115
115
  }
116
116
 
117
- .lm {
118
- width: 1.5rem;
117
+ .lh {
118
+ width: calc(1.5rem * var(--s2-scale));
119
119
  }
120
120
 
121
- .km {
122
- height: 1.5rem;
121
+ .kh {
122
+ height: calc(1.5rem * var(--s2-scale));
123
123
  }
124
124
 
125
- .k4 {
125
+ .kG {
126
126
  height: 100%;
127
127
  }
128
128
 
@@ -179,46 +179,6 @@
179
179
 
180
180
  @layer UNSAFE_overrides;
181
181
 
182
- @layer _.b.b {
183
- @media not ((hover: hover) and (pointer: fine)) {
184
- .lbQ {
185
- width: 15rem;
186
- }
187
-
188
- .kbQ {
189
- height: 15rem;
190
- }
191
-
192
- ._dbf {
193
- font-size: 1.0625rem;
194
- }
195
-
196
- ._dbb {
197
- font-size: .8125rem;
198
- }
199
-
200
- ._dbd {
201
- font-size: .9375rem;
202
- }
203
-
204
- ._dbh {
205
- font-size: 1.1875rem;
206
- }
207
-
208
- ._dbj {
209
- font-size: 1.375rem;
210
- }
211
-
212
- .lbn {
213
- width: 1.875rem;
214
- }
215
-
216
- .kbn {
217
- height: 1.875rem;
218
- }
219
- }
220
- }
221
-
222
182
  @layer _.c {
223
183
  ._c-enzwzjc:lang(he) {
224
184
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
@@ -255,6 +215,30 @@
255
215
  }
256
216
  }
257
217
 
218
+ @layer _.b.b {
219
+ @media not ((hover: hover) and (pointer: fine)) {
220
+ ._dbf {
221
+ font-size: 1.0625rem;
222
+ }
223
+
224
+ ._dbb {
225
+ font-size: .8125rem;
226
+ }
227
+
228
+ ._dbd {
229
+ font-size: .9375rem;
230
+ }
231
+
232
+ ._dbh {
233
+ font-size: 1.1875rem;
234
+ }
235
+
236
+ ._dbj {
237
+ font-size: 1.375rem;
238
+ }
239
+ }
240
+ }
241
+
258
242
  .\.:not(#a#b) {
259
243
  all: revert-layer;
260
244
  }
@@ -1 +1 @@
1
- {"mappings":"ACiDmD;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAoC5B;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAnD8B;EAoC5B;;;;EAAA;;;;;AApC4B;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAoC5B;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAeF;;;;IAAA;;;;;;AAfE;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAeF;;;;AAAA;EAAA;IAAA","sources":["14771332a5b9bbc4","packages/@react-spectrum/s2/src/ColorSlider.tsx"],"sourcesContent":["@import \"d6c5746f419c314b\";\n@import \"59869632975fb938\";\n@import \"927ebdef839461cd\";\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 ColorSlider as AriaColorSlider,\n ColorSliderProps as AriaColorSliderProps,\n ContextValue,\n SliderOutput,\n SliderTrack,\n useLocale\n} from 'react-aria-components';\nimport {ColorHandle} from './ColorHandle';\nimport {createContext, forwardRef, useRef} from 'react';\nimport {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children' | 'className' | 'style'>, Pick<SpectrumLabelableProps, 'contextualHelp'>, StyleProps {\n label?: string\n}\n\nexport const ColorSliderContext = createContext<ContextValue<ColorSliderProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction ColorSlider(props: ColorSliderProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorSliderContext);\n let {UNSAFE_className = '', UNSAFE_style, styles} = props;\n let containerRef = useDOMRef(ref);\n let trackRef = useRef(null);\n let {locale} = useLocale();\n\n return (\n <AriaColorSlider\n {...props}\n ref={containerRef}\n style={UNSAFE_style}\n // The visual label is hidden when vertical, so make it an aria-label instead.\n aria-label={props['aria-label'] || (props.orientation === 'vertical' ? props.label : undefined)}\n className={renderProps => UNSAFE_className + style({\n width: {\n orientation: {\n horizontal: 192\n }\n },\n height: {\n orientation: {\n vertical: 192\n }\n },\n display: {\n orientation: {\n horizontal: 'grid',\n vertical: 'block'\n }\n },\n gridTemplateColumns: ['1fr', 'auto'],\n gridTemplateAreas: [\n 'label output',\n 'track track'\n ],\n rowGap: 4\n }, getAllowedOverrides())(renderProps, styles)}>\n {({isDisabled, orientation, state}) => (<>\n {orientation === 'horizontal' && (props.label || (props.label === undefined && !props['aria-label'] && !props['aria-labelledby'])) && (\n // If no external label, aria-label or aria-labelledby is provided,\n // default to displaying the localized channel value.\n // Specifically check if label is undefined. If label is `null` then display no visible label.\n // A default aria-label is provided by useColorSlider in that case.\n <FieldLabel isDisabled={isDisabled} contextualHelp={props.contextualHelp}>\n {props.label || state.value.getChannelName(props.channel, locale)}\n </FieldLabel>\n )}\n {orientation === 'horizontal' &&\n <SliderOutput\n className={style({\n gridArea: 'output',\n font: 'control',\n cursor: 'default',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n }\n })} />\n }\n <SliderTrack\n ref={trackRef}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `${defaultStyle.background}, repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`\n })}\n className={style({\n gridArea: 'track',\n width: {\n orientation: {\n horizontal: 'full',\n vertical: 24\n }\n },\n height: {\n orientation: {\n horizontal: 24,\n vertical: 'full'\n }\n },\n borderRadius: 'default',\n outlineColor: {\n default: 'gray-1000/10',\n forcedColors: 'ButtonBorder'\n },\n outlineWidth: 1,\n outlineOffset: -1,\n outlineStyle: {\n default: 'solid',\n isDisabled: 'none'\n },\n backgroundColor: {\n isDisabled: 'disabled'\n }\n })}>\n <ColorHandle\n containerRef={trackRef}\n getPosition={() => {\n let x = state.orientation === 'horizontal' ? state.getThumbPercent(0) : 0.5;\n let y = state.orientation === 'horizontal' ? 0.5 : 1 - state.getThumbPercent(0);\n return {x, y};\n }} />\n </SliderTrack>\n </>)}\n </AriaColorSlider>\n );\n}\n\n/**\n * A ColorSlider allows users to adjust an individual channel of a color value.\n */\nlet _ColorSlider = forwardRef(ColorSlider);\nexport {_ColorSlider as ColorSlider};\n"],"names":[],"version":3,"file":"ColorSlider.css.map"}
1
+ {"mappings":"ACiDmD;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAoC5B;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAnD8B;EAoC5B;;;;EAAA;;;;;AApC4B;;AAoC5B;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAeF;;;;AAAA;EAAA;IAAA","sources":["14771332a5b9bbc4","packages/@react-spectrum/s2/src/ColorSlider.tsx"],"sourcesContent":["@import \"d6c5746f419c314b\";\n@import \"59869632975fb938\";\n@import \"927ebdef839461cd\";\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 ColorSlider as AriaColorSlider,\n ColorSliderProps as AriaColorSliderProps,\n ContextValue,\n SliderOutput,\n SliderTrack,\n useLocale\n} from 'react-aria-components';\nimport {ColorHandle} from './ColorHandle';\nimport {createContext, forwardRef, useRef} from 'react';\nimport {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared';\nimport {FieldLabel} from './Field';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ColorSliderProps extends Omit<AriaColorSliderProps, 'children' | 'className' | 'style'>, Pick<SpectrumLabelableProps, 'contextualHelp'>, StyleProps {\n label?: string\n}\n\nexport const ColorSliderContext = createContext<ContextValue<ColorSliderProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction ColorSlider(props: ColorSliderProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ColorSliderContext);\n let {UNSAFE_className = '', UNSAFE_style, styles} = props;\n let containerRef = useDOMRef(ref);\n let trackRef = useRef(null);\n let {locale} = useLocale();\n\n return (\n <AriaColorSlider\n {...props}\n ref={containerRef}\n style={UNSAFE_style}\n // The visual label is hidden when vertical, so make it an aria-label instead.\n aria-label={props['aria-label'] || (props.orientation === 'vertical' ? props.label : undefined)}\n className={renderProps => UNSAFE_className + style({\n width: {\n orientation: {\n horizontal: 192\n }\n },\n height: {\n orientation: {\n vertical: 192\n }\n },\n display: {\n orientation: {\n horizontal: 'grid',\n vertical: 'block'\n }\n },\n gridTemplateColumns: ['1fr', 'auto'],\n gridTemplateAreas: [\n 'label output',\n 'track track'\n ],\n rowGap: 4\n }, getAllowedOverrides())(renderProps, styles)}>\n {({isDisabled, orientation, state}) => (<>\n {orientation === 'horizontal' && (props.label || (props.label === undefined && !props['aria-label'] && !props['aria-labelledby'])) && (\n // If no external label, aria-label or aria-labelledby is provided,\n // default to displaying the localized channel value.\n // Specifically check if label is undefined. If label is `null` then display no visible label.\n // A default aria-label is provided by useColorSlider in that case.\n <FieldLabel isDisabled={isDisabled} contextualHelp={props.contextualHelp}>\n {props.label || state.value.getChannelName(props.channel, locale)}\n </FieldLabel>\n )}\n {orientation === 'horizontal' &&\n <SliderOutput\n className={style({\n gridArea: 'output',\n font: 'control',\n cursor: 'default',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled'\n }\n })} />\n }\n <SliderTrack\n ref={trackRef}\n style={({defaultStyle, isDisabled}) => ({\n background: isDisabled ? undefined : `${defaultStyle.background}, repeating-conic-gradient(#E1E1E1 0% 25%, white 0% 50%) 50% / 16px 16px`\n })}\n className={style({\n gridArea: 'track',\n width: {\n orientation: {\n horizontal: 'full',\n vertical: 24\n }\n },\n height: {\n orientation: {\n horizontal: 24,\n vertical: 'full'\n }\n },\n borderRadius: 'default',\n outlineColor: {\n default: 'gray-1000/10',\n forcedColors: 'ButtonBorder'\n },\n outlineWidth: 1,\n outlineOffset: -1,\n outlineStyle: {\n default: 'solid',\n isDisabled: 'none'\n },\n backgroundColor: {\n isDisabled: 'disabled'\n }\n })}>\n <ColorHandle\n containerRef={trackRef}\n getPosition={() => {\n let x = state.orientation === 'horizontal' ? state.getThumbPercent(0) : 0.5;\n let y = state.orientation === 'horizontal' ? 0.5 : 1 - state.getThumbPercent(0);\n return {x, y};\n }} />\n </SliderTrack>\n </>)}\n </AriaColorSlider>\n );\n}\n\n/**\n * A ColorSlider allows users to adjust an individual channel of a color value.\n */\nlet _ColorSlider = forwardRef(ColorSlider);\nexport {_ColorSlider as ColorSlider};\n"],"names":[],"version":3,"file":"ColorSlider.css.map"}
@@ -44,15 +44,9 @@ function $495db619596088aa$var$ColorSlider(props, ref) {
44
44
  let $l = false;
45
45
  for (let p of matches)if (/^\s*l/.test(p)) $l = true;
46
46
  if (!$l) {
47
- if (props.orientation === "horizontal") {
48
- rules += ' lbQ';
49
- rules += ' lP';
50
- }
51
- }
52
- if (props.orientation === "vertical") {
53
- rules += ' kbQ';
54
- rules += ' kP';
47
+ if (props.orientation === "horizontal") rules += ' lx';
55
48
  }
49
+ if (props.orientation === "vertical") rules += ' kx';
56
50
  if (props.orientation === "vertical") rules += ' _Za';
57
51
  else if (props.orientation === "horizontal") rules += ' _Zf';
58
52
  rules += ' __h-1egg2pz';
@@ -127,15 +121,10 @@ function $495db619596088aa$var$ColorSlider(props, ref) {
127
121
  rules += ' __b-4ka10a';
128
122
  rules += ' __c-4ka10a';
129
123
  rules += ' __d-4ka10a';
130
- if (props.orientation === "vertical") {
131
- rules += ' lbn';
132
- rules += ' lm';
133
- } else if (props.orientation === "horizontal") rules += ' l4';
134
- if (props.orientation === "vertical") rules += ' k4';
135
- else if (props.orientation === "horizontal") {
136
- rules += ' kbn';
137
- rules += ' km';
138
- }
124
+ if (props.orientation === "vertical") rules += ' lh';
125
+ else if (props.orientation === "horizontal") rules += ' lG';
126
+ if (props.orientation === "vertical") rules += ' kG';
127
+ else if (props.orientation === "horizontal") rules += ' kh';
139
128
  rules += ' _vc';
140
129
  rules += ' _wc';
141
130
  rules += ' _xc';