@react-spectrum/s2 3.0.0-nightly-56da82e3e-250212 → 3.0.0-nightly-260eb700f-250213

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 (267) hide show
  1. package/dist/Accordion.cjs +3 -3
  2. package/dist/Accordion.css +2 -2
  3. package/dist/Accordion.mjs +3 -3
  4. package/dist/ActionBar.cjs +47 -47
  5. package/dist/ActionBar.css +51 -51
  6. package/dist/ActionBar.mjs +47 -47
  7. package/dist/ActionButton.cjs +97 -97
  8. package/dist/ActionButton.css +96 -96
  9. package/dist/ActionButton.mjs +97 -97
  10. package/dist/ActionButtonGroup.cjs +11 -11
  11. package/dist/ActionButtonGroup.css +9 -9
  12. package/dist/ActionButtonGroup.mjs +11 -11
  13. package/dist/AlertDialog.cjs +3 -3
  14. package/dist/AlertDialog.css +3 -3
  15. package/dist/AlertDialog.mjs +3 -3
  16. package/dist/Avatar.cjs +17 -17
  17. package/dist/Avatar.css +14 -14
  18. package/dist/Avatar.mjs +17 -17
  19. package/dist/AvatarGroup.cjs +100 -100
  20. package/dist/AvatarGroup.css +34 -34
  21. package/dist/AvatarGroup.mjs +100 -100
  22. package/dist/Badge.cjs +68 -92
  23. package/dist/Badge.cjs.map +1 -1
  24. package/dist/Badge.css +92 -164
  25. package/dist/Badge.css.map +1 -1
  26. package/dist/Badge.mjs +68 -92
  27. package/dist/Badge.mjs.map +1 -1
  28. package/dist/Breadcrumbs.cjs +115 -115
  29. package/dist/Breadcrumbs.css +89 -89
  30. package/dist/Breadcrumbs.mjs +115 -115
  31. package/dist/Button.cjs +152 -236
  32. package/dist/Button.cjs.map +1 -1
  33. package/dist/Button.css +165 -309
  34. package/dist/Button.css.map +1 -1
  35. package/dist/Button.mjs +152 -236
  36. package/dist/Button.mjs.map +1 -1
  37. package/dist/ButtonGroup.cjs +19 -19
  38. package/dist/ButtonGroup.css +15 -15
  39. package/dist/ButtonGroup.mjs +19 -19
  40. package/dist/Card.cjs +261 -264
  41. package/dist/Card.cjs.map +1 -1
  42. package/dist/Card.css +198 -210
  43. package/dist/Card.css.map +1 -1
  44. package/dist/Card.mjs +261 -264
  45. package/dist/Card.mjs.map +1 -1
  46. package/dist/CardView.cjs +15 -15
  47. package/dist/CardView.css +18 -18
  48. package/dist/CardView.mjs +15 -15
  49. package/dist/CenterBaseline.cjs +1 -1
  50. package/dist/CenterBaseline.css +2 -2
  51. package/dist/CenterBaseline.mjs +1 -1
  52. package/dist/Checkbox.cjs +73 -124
  53. package/dist/Checkbox.cjs.map +1 -1
  54. package/dist/Checkbox.css +81 -201
  55. package/dist/Checkbox.css.map +1 -1
  56. package/dist/Checkbox.mjs +73 -124
  57. package/dist/Checkbox.mjs.map +1 -1
  58. package/dist/CheckboxGroup.cjs +49 -49
  59. package/dist/CheckboxGroup.css +41 -41
  60. package/dist/CheckboxGroup.mjs +49 -49
  61. package/dist/ClearButton.cjs +15 -15
  62. package/dist/ClearButton.css +17 -17
  63. package/dist/ClearButton.mjs +15 -15
  64. package/dist/CloseButton.cjs +35 -35
  65. package/dist/CloseButton.css +33 -33
  66. package/dist/CloseButton.mjs +35 -35
  67. package/dist/ColorArea.cjs +22 -22
  68. package/dist/ColorArea.css +15 -15
  69. package/dist/ColorArea.mjs +22 -22
  70. package/dist/ColorField.cjs +38 -38
  71. package/dist/ColorField.css +32 -32
  72. package/dist/ColorField.mjs +38 -38
  73. package/dist/ColorHandle.cjs +21 -27
  74. package/dist/ColorHandle.cjs.map +1 -1
  75. package/dist/ColorHandle.css +45 -93
  76. package/dist/ColorHandle.css.map +1 -1
  77. package/dist/ColorHandle.mjs +21 -27
  78. package/dist/ColorHandle.mjs.map +1 -1
  79. package/dist/ColorSlider.cjs +52 -52
  80. package/dist/ColorSlider.css +51 -51
  81. package/dist/ColorSlider.mjs +52 -52
  82. package/dist/ColorSwatch.cjs +24 -27
  83. package/dist/ColorSwatch.cjs.map +1 -1
  84. package/dist/ColorSwatch.css +29 -41
  85. package/dist/ColorSwatch.css.map +1 -1
  86. package/dist/ColorSwatch.mjs +24 -27
  87. package/dist/ColorSwatch.mjs.map +1 -1
  88. package/dist/ColorSwatchPicker.cjs +23 -23
  89. package/dist/ColorSwatchPicker.css +48 -60
  90. package/dist/ColorSwatchPicker.css.map +1 -1
  91. package/dist/ColorSwatchPicker.mjs +23 -23
  92. package/dist/ColorWheel.cjs +22 -22
  93. package/dist/ColorWheel.css +16 -16
  94. package/dist/ColorWheel.mjs +22 -22
  95. package/dist/ComboBox.cjs +80 -80
  96. package/dist/ComboBox.css +88 -88
  97. package/dist/ComboBox.mjs +80 -80
  98. package/dist/ContextualHelp.cjs +5 -5
  99. package/dist/ContextualHelp.css +38 -38
  100. package/dist/ContextualHelp.mjs +5 -5
  101. package/dist/CustomDialog.cjs +31 -31
  102. package/dist/CustomDialog.css +25 -25
  103. package/dist/CustomDialog.mjs +31 -31
  104. package/dist/Dialog.cjs +17 -17
  105. package/dist/Dialog.css +64 -64
  106. package/dist/Dialog.mjs +17 -17
  107. package/dist/Disclosure.cjs +108 -111
  108. package/dist/Disclosure.cjs.map +1 -1
  109. package/dist/Disclosure.css +112 -124
  110. package/dist/Disclosure.css.map +1 -1
  111. package/dist/Disclosure.mjs +108 -111
  112. package/dist/Disclosure.mjs.map +1 -1
  113. package/dist/Divider.cjs +26 -26
  114. package/dist/Divider.css +16 -16
  115. package/dist/Divider.mjs +26 -26
  116. package/dist/DropZone.cjs +47 -56
  117. package/dist/DropZone.cjs.map +1 -1
  118. package/dist/DropZone.css +56 -80
  119. package/dist/DropZone.css.map +1 -1
  120. package/dist/DropZone.mjs +47 -56
  121. package/dist/DropZone.mjs.map +1 -1
  122. package/dist/Field.cjs +150 -204
  123. package/dist/Field.cjs.map +1 -1
  124. package/dist/Field.css +150 -246
  125. package/dist/Field.css.map +1 -1
  126. package/dist/Field.mjs +150 -204
  127. package/dist/Field.mjs.map +1 -1
  128. package/dist/Form.cjs +10 -10
  129. package/dist/Form.css +9 -9
  130. package/dist/Form.mjs +10 -10
  131. package/dist/FullscreenDialog.cjs +5 -5
  132. package/dist/FullscreenDialog.css +72 -72
  133. package/dist/FullscreenDialog.mjs +5 -5
  134. package/dist/IllustratedMessage.cjs +134 -134
  135. package/dist/IllustratedMessage.css +69 -69
  136. package/dist/IllustratedMessage.mjs +134 -134
  137. package/dist/Image.cjs +12 -12
  138. package/dist/Image.css +13 -13
  139. package/dist/Image.mjs +12 -12
  140. package/dist/InlineAlert.cjs +77 -104
  141. package/dist/InlineAlert.cjs.map +1 -1
  142. package/dist/InlineAlert.css +77 -149
  143. package/dist/InlineAlert.css.map +1 -1
  144. package/dist/InlineAlert.mjs +77 -104
  145. package/dist/InlineAlert.mjs.map +1 -1
  146. package/dist/Link.cjs +31 -31
  147. package/dist/Link.css +30 -30
  148. package/dist/Link.mjs +31 -31
  149. package/dist/Menu.cjs +269 -269
  150. package/dist/Menu.css +155 -155
  151. package/dist/Menu.mjs +269 -269
  152. package/dist/Meter.cjs +85 -85
  153. package/dist/Meter.css +81 -81
  154. package/dist/Meter.mjs +85 -85
  155. package/dist/Modal.cjs +48 -48
  156. package/dist/Modal.css +46 -46
  157. package/dist/Modal.mjs +48 -48
  158. package/dist/NumberField.cjs +115 -115
  159. package/dist/NumberField.css +114 -114
  160. package/dist/NumberField.mjs +115 -115
  161. package/dist/Picker.cjs +177 -195
  162. package/dist/Picker.cjs.map +1 -1
  163. package/dist/Picker.css +164 -224
  164. package/dist/Picker.css.map +1 -1
  165. package/dist/Picker.mjs +177 -195
  166. package/dist/Picker.mjs.map +1 -1
  167. package/dist/Popover.cjs +79 -85
  168. package/dist/Popover.cjs.map +1 -1
  169. package/dist/Popover.css +65 -89
  170. package/dist/Popover.css.map +1 -1
  171. package/dist/Popover.mjs +79 -85
  172. package/dist/Popover.mjs.map +1 -1
  173. package/dist/ProgressBar.cjs +98 -98
  174. package/dist/ProgressBar.css +92 -92
  175. package/dist/ProgressBar.mjs +98 -98
  176. package/dist/ProgressCircle.cjs +17 -17
  177. package/dist/ProgressCircle.css +15 -15
  178. package/dist/ProgressCircle.mjs +17 -17
  179. package/dist/Provider.cjs +4 -4
  180. package/dist/Provider.css +5 -5
  181. package/dist/Provider.mjs +4 -4
  182. package/dist/Radio.cjs +80 -152
  183. package/dist/Radio.cjs.map +1 -1
  184. package/dist/Radio.css +96 -240
  185. package/dist/Radio.css.map +1 -1
  186. package/dist/Radio.mjs +80 -152
  187. package/dist/Radio.mjs.map +1 -1
  188. package/dist/RadioGroup.cjs +47 -47
  189. package/dist/RadioGroup.css +41 -41
  190. package/dist/RadioGroup.mjs +47 -47
  191. package/dist/SearchField.cjs +42 -42
  192. package/dist/SearchField.css +47 -47
  193. package/dist/SearchField.mjs +42 -42
  194. package/dist/SegmentedControl.cjs +89 -101
  195. package/dist/SegmentedControl.cjs.map +1 -1
  196. package/dist/SegmentedControl.css +92 -140
  197. package/dist/SegmentedControl.css.map +1 -1
  198. package/dist/SegmentedControl.mjs +89 -101
  199. package/dist/SegmentedControl.mjs.map +1 -1
  200. package/dist/Slider.cjs +196 -229
  201. package/dist/Slider.cjs.map +1 -1
  202. package/dist/Slider.css +149 -221
  203. package/dist/Slider.css.map +1 -1
  204. package/dist/Slider.mjs +196 -229
  205. package/dist/Slider.mjs.map +1 -1
  206. package/dist/StatusLight.cjs +56 -56
  207. package/dist/StatusLight.css +59 -59
  208. package/dist/StatusLight.mjs +56 -56
  209. package/dist/Switch.cjs +74 -107
  210. package/dist/Switch.cjs.map +1 -1
  211. package/dist/Switch.css +69 -141
  212. package/dist/Switch.css.map +1 -1
  213. package/dist/Switch.mjs +74 -107
  214. package/dist/Switch.mjs.map +1 -1
  215. package/dist/TableView.cjs +253 -280
  216. package/dist/TableView.cjs.map +1 -1
  217. package/dist/TableView.css +163 -199
  218. package/dist/TableView.css.map +1 -1
  219. package/dist/TableView.mjs +253 -280
  220. package/dist/TableView.mjs.map +1 -1
  221. package/dist/Tabs.cjs +108 -108
  222. package/dist/Tabs.css +81 -81
  223. package/dist/Tabs.mjs +108 -108
  224. package/dist/TabsPicker.cjs +105 -105
  225. package/dist/TabsPicker.css +111 -111
  226. package/dist/TabsPicker.mjs +105 -105
  227. package/dist/TagGroup.cjs +148 -148
  228. package/dist/TagGroup.css +134 -134
  229. package/dist/TagGroup.mjs +148 -148
  230. package/dist/TextField.cjs +59 -59
  231. package/dist/TextField.css +62 -62
  232. package/dist/TextField.mjs +59 -59
  233. package/dist/ToggleButton.cjs +3 -3
  234. package/dist/ToggleButton.css +12 -12
  235. package/dist/ToggleButton.mjs +3 -3
  236. package/dist/Tooltip.cjs +57 -60
  237. package/dist/Tooltip.cjs.map +1 -1
  238. package/dist/Tooltip.css +71 -83
  239. package/dist/Tooltip.css.map +1 -1
  240. package/dist/Tooltip.mjs +57 -60
  241. package/dist/Tooltip.mjs.map +1 -1
  242. package/dist/TreeView.cjs +199 -248
  243. package/dist/TreeView.cjs.map +1 -1
  244. package/dist/TreeView.css +131 -175
  245. package/dist/TreeView.css.map +1 -1
  246. package/dist/TreeView.mjs +202 -248
  247. package/dist/TreeView.mjs.map +1 -1
  248. package/dist/main.cjs +1 -0
  249. package/dist/main.cjs.map +1 -1
  250. package/dist/module.mjs +2 -2
  251. package/dist/module.mjs.map +1 -1
  252. package/dist/types.d.ts +4 -1
  253. package/dist/types.d.ts.map +1 -1
  254. package/icons/Skeleton.cjs +2 -2
  255. package/icons/Skeleton.css +5 -5
  256. package/icons/Skeleton.mjs +2 -2
  257. package/package.json +21 -21
  258. package/src/TreeView.tsx +66 -134
  259. package/src/index.ts +1 -1
  260. package/style/__tests__/style-macro.test.js +18 -18
  261. package/style/dist/spectrum-theme.cjs +10 -20
  262. package/style/dist/spectrum-theme.cjs.map +1 -1
  263. package/style/dist/spectrum-theme.mjs +10 -20
  264. package/style/dist/spectrum-theme.mjs.map +1 -1
  265. package/style/dist/types.d.ts +0 -4
  266. package/style/dist/types.d.ts.map +1 -1
  267. package/style/spectrum-theme.ts +11 -19
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAiCM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA6E;AAExH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CN,MAAM;AAUb,MAAM,iCAAW;IACf,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;AACN;AAMO,MAAM,0DAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAAS,YAAC,QAAQ,EAAE,GAAG,OAAqB,EAAE,GAAmC;IAC3H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAE;IACpB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,IAAI,WAAW,CAAC,CAAC,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,qCAAU;IACtC,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,oBAAoB,CAAC,CAAC,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,oDAAwB;IAC7D,IAAI,MAAM,CAAA,GAAA,4CAAgB,EAAE,2CAAiB,MAAM,IAAI;IAEvD,qBACE,gCAAC,CAAA,GAAA,mCAAW;QACT,GAAG,KAAK;QACT,KAAK;QACL,UAAU;QACV,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,8BAAQ;gBAAC,GAAG,WAAW;0BAAE;gBAAU,MAAM,MAAM,IAAI,IAAI;YAAG,GAAG,MAAM,MAAM;kBACnI,CAAA;YACC,IAAI,yBACF,iCAAC;gBACC,KAAK;gBACL,OAAO,CAAA,GAAA,oCAAS,EAAE,QAAQ;gBAC1B,WAAW,wCAAI;oBACb,GAAG,WAAW;oBACd,YAAY,YAAY,UAAU,IAAI,YAAY,eAAe;oBACjE,MAAM,MAAM,IAAI,IAAI;oBACpB,cAAc,oBAAoB,KAAK,eAAe,MAAM,YAAY;gBAC1E;;oBACC,YAAY,eAAe,kBAC1B,gCAAC,CAAA,GAAA,iCAAO;wBAAE,MAAM,8BAAQ,CAAC,MAAM,IAAI,IAAI,IAAI;wBAAE,WAAW;;oBAEzD,YAAY,UAAU,IAAI,CAAC,YAAY,eAAe,kBACrD,gCAAC,CAAA,GAAA,iCAAY;wBAAE,MAAM,8BAAQ,CAAC,MAAM,IAAI,IAAI,IAAI;wBAAE,WAAW;;;;YAKnE,4DAA4D;YAC5D,uEAAuE;YACvE,IAAI,CAAC,UACH,OAAO;YAGT,qBACE;;kCACE,gCAAC,CAAA,GAAA,wCAAa;kCACX;;oBAEF;;;QAGP;;AAGN","sources":["packages/@react-spectrum/s2/src/Checkbox.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 {Checkbox as AriaCheckbox, CheckboxProps as AriaCheckboxProps, CheckboxGroupStateContext, CheckboxRenderProps, ContextValue, useSlottedContext} from 'react-aria-components';\nimport {baseColor, focusRing, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport DashIcon from '../ui-icons/Dash';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface CheckboxStyleProps {\n /**\n * The size of the Checkbox.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** Whether the Checkbox should be displayed with an emphasized style. */\n isEmphasized?: boolean\n}\n\ninterface RenderProps extends CheckboxRenderProps, CheckboxStyleProps {}\n\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, CheckboxStyleProps {\n /** The label for the element. */\n children?: ReactNode\n}\n\nexport const CheckboxContext = createContext<ContextValue<Partial<CheckboxProps>, FocusableRefValue<HTMLLabelElement>>>(null);\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n transition: 'colors',\n color: {\n default: 'neutral',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n gridColumnStart: {\n isInForm: 'field'\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nexport const box = style<RenderProps>({\n ...focusRing(),\n size: 'control-sm',\n borderRadius: 'control-sm',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 2,\n boxSizing: 'border-box',\n borderStyle: 'solid',\n transition: 'default',\n forcedColorAdjust: 'none',\n backgroundColor: {\n default: 'gray-25',\n forcedColors: 'Background',\n isSelected: {\n default: 'neutral',\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight',\n isInvalid: {\n default: baseColor('negative-900'),\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n },\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isInvalid: {\n default: 'negative',\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'transparent'\n }\n});\n\nexport const iconStyles = style({\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'gray-25',\n forcedColors: 'HighlightText'\n }\n }\n});\n\nconst iconSize = {\n S: 'XS',\n M: 'S',\n L: 'M',\n XL: 'L'\n} as const;\n\n/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nexport const Checkbox = forwardRef(function Checkbox({children, ...props}: CheckboxProps, ref: FocusableRef<HTMLLabelElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, CheckboxContext);\n let boxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let isInForm = !!useContext(FormContext);\n props = useFormProps(props);\n let isInCheckboxGroup = !!useContext(CheckboxGroupStateContext);\n let ctx = useSlottedContext(CheckboxContext, props.slot);\n\n return (\n <AriaCheckbox\n {...props}\n ref={domRef}\n inputRef={inputRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + wrapper({...renderProps, isInForm, size: props.size || 'M'}, props.styles)}>\n {renderProps => {\n let checkbox = (\n <div\n ref={boxRef}\n style={pressScale(boxRef)(renderProps)}\n className={box({\n ...renderProps,\n isSelected: renderProps.isSelected || renderProps.isIndeterminate,\n size: props.size || 'M',\n isEmphasized: isInCheckboxGroup ? ctx?.isEmphasized : props.isEmphasized\n })}>\n {renderProps.isIndeterminate &&\n <DashIcon size={iconSize[props.size || 'M']} className={iconStyles} />\n }\n {renderProps.isSelected && !renderProps.isIndeterminate &&\n <CheckmarkIcon size={iconSize[props.size || 'M']} className={iconStyles} />\n }\n </div>\n );\n\n // Only render checkbox without center baseline if no label.\n // This avoids expanding the checkbox height to the font's line height.\n if (!children) {\n return checkbox;\n }\n\n return (\n <>\n <CenterBaseline>\n {checkbox}\n </CenterBaseline>\n {children}\n </>\n );\n }}\n </AriaCheckbox>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAiCM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA6E;AAExH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CN,MAAM;AAUb,MAAM,iCAAW;IACf,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;AACN;AAMO,MAAM,0DAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAAS,YAAC,QAAQ,EAAE,GAAG,OAAqB,EAAE,GAAmC;IAC3H,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAE;IACpB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,IAAI,WAAW,CAAC,CAAC,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,qCAAU;IACtC,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,oBAAoB,CAAC,CAAC,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,oDAAwB;IAC7D,IAAI,MAAM,CAAA,GAAA,4CAAgB,EAAE,2CAAiB,MAAM,IAAI;IAEvD,qBACE,gCAAC,CAAA,GAAA,mCAAW;QACT,GAAG,KAAK;QACT,KAAK;QACL,UAAU;QACV,OAAO,MAAM,YAAY;QACzB,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,8BAAQ;gBAAC,GAAG,WAAW;0BAAE;gBAAU,MAAM,MAAM,IAAI,IAAI;YAAG,GAAG,MAAM,MAAM;kBACnI,CAAA;YACC,IAAI,yBACF,iCAAC;gBACC,KAAK;gBACL,OAAO,CAAA,GAAA,oCAAS,EAAE,QAAQ;gBAC1B,WAAW,wCAAI;oBACb,GAAG,WAAW;oBACd,YAAY,YAAY,UAAU,IAAI,YAAY,eAAe;oBACjE,MAAM,MAAM,IAAI,IAAI;oBACpB,cAAc,oBAAoB,KAAK,eAAe,MAAM,YAAY;gBAC1E;;oBACC,YAAY,eAAe,kBAC1B,gCAAC,CAAA,GAAA,iCAAO;wBAAE,MAAM,8BAAQ,CAAC,MAAM,IAAI,IAAI,IAAI;wBAAE,WAAW;;oBAEzD,YAAY,UAAU,IAAI,CAAC,YAAY,eAAe,kBACrD,gCAAC,CAAA,GAAA,iCAAY;wBAAE,MAAM,8BAAQ,CAAC,MAAM,IAAI,IAAI,IAAI;wBAAE,WAAW;;;;YAKnE,4DAA4D;YAC5D,uEAAuE;YACvE,IAAI,CAAC,UACH,OAAO;YAGT,qBACE;;kCACE,gCAAC,CAAA,GAAA,wCAAa;kCACX;;oBAEF;;;QAGP;;AAGN","sources":["packages/@react-spectrum/s2/src/Checkbox.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 {Checkbox as AriaCheckbox, CheckboxProps as AriaCheckboxProps, CheckboxGroupStateContext, CheckboxRenderProps, ContextValue, useSlottedContext} from 'react-aria-components';\nimport {baseColor, focusRing, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport DashIcon from '../ui-icons/Dash';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface CheckboxStyleProps {\n /**\n * The size of the Checkbox.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** Whether the Checkbox should be displayed with an emphasized style. */\n isEmphasized?: boolean\n}\n\ninterface RenderProps extends CheckboxRenderProps, CheckboxStyleProps {}\n\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, CheckboxStyleProps {\n /** The label for the element. */\n children?: ReactNode\n}\n\nexport const CheckboxContext = createContext<ContextValue<Partial<CheckboxProps>, FocusableRefValue<HTMLLabelElement>>>(null);\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n transition: 'colors',\n color: {\n default: 'neutral',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n gridColumnStart: {\n isInForm: 'field'\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nexport const box = style<RenderProps>({\n ...focusRing(),\n size: 'control-sm',\n borderRadius: 'control-sm',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 2,\n boxSizing: 'border-box',\n borderStyle: 'solid',\n transition: 'default',\n forcedColorAdjust: 'none',\n backgroundColor: {\n default: 'gray-25',\n forcedColors: 'Background',\n isSelected: {\n default: 'neutral',\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight',\n isInvalid: {\n default: baseColor('negative-900'),\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n },\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isInvalid: {\n default: 'negative',\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'transparent'\n }\n});\n\nexport const iconStyles = style({\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'gray-25',\n forcedColors: 'HighlightText'\n }\n }\n});\n\nconst iconSize = {\n S: 'XS',\n M: 'S',\n L: 'M',\n XL: 'L'\n} as const;\n\n/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nexport const Checkbox = forwardRef(function Checkbox({children, ...props}: CheckboxProps, ref: FocusableRef<HTMLLabelElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, CheckboxContext);\n let boxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let isInForm = !!useContext(FormContext);\n props = useFormProps(props);\n let isInCheckboxGroup = !!useContext(CheckboxGroupStateContext);\n let ctx = useSlottedContext(CheckboxContext, props.slot);\n\n return (\n <AriaCheckbox\n {...props}\n ref={domRef}\n inputRef={inputRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + wrapper({...renderProps, isInForm, size: props.size || 'M'}, props.styles)}>\n {renderProps => {\n let checkbox = (\n <div\n ref={boxRef}\n style={pressScale(boxRef)(renderProps)}\n className={box({\n ...renderProps,\n isSelected: renderProps.isSelected || renderProps.isIndeterminate,\n size: props.size || 'M',\n isEmphasized: isInCheckboxGroup ? ctx?.isEmphasized : props.isEmphasized\n })}>\n {renderProps.isIndeterminate &&\n <DashIcon size={iconSize[props.size || 'M']} className={iconStyles} />\n }\n {renderProps.isSelected && !renderProps.isIndeterminate &&\n <CheckmarkIcon size={iconSize[props.size || 'M']} className={iconStyles} />\n }\n </div>\n );\n\n // Only render checkbox without center baseline if no label.\n // This avoids expanding the checkbox height to the font's line height.\n if (!children) {\n return checkbox;\n }\n\n return (\n <>\n <CenterBaseline>\n {checkbox}\n </CenterBaseline>\n {children}\n </>\n );\n }}\n </AriaCheckbox>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.cjs.map"}
package/dist/Checkbox.css CHANGED
@@ -1,47 +1,47 @@
1
1
  @layer _.a {
2
- .iF {
2
+ .jF {
3
3
  column-gap: .714286em;
4
4
  }
5
5
 
6
- ._5d {
6
+ ._2d {
7
7
  align-items: baseline;
8
8
  }
9
9
 
10
- .ke {
10
+ .le {
11
11
  width: fit-content;
12
12
  }
13
13
 
14
- ._ga {
14
+ ._da {
15
15
  font-family: adobe-clean-variable, adobe-clean, ui-sans-serif, system-ui, sans-serif;
16
16
  }
17
17
 
18
- ._he {
18
+ ._ee {
19
19
  font-size: .875rem;
20
20
  }
21
21
 
22
- ._ha {
22
+ ._ea {
23
23
  font-size: .6875rem;
24
24
  }
25
25
 
26
- ._hc {
26
+ ._ec {
27
27
  font-size: .75rem;
28
28
  }
29
29
 
30
- ._hg {
30
+ ._eg {
31
31
  font-size: 1rem;
32
32
  }
33
33
 
34
- ._hi {
34
+ ._ei {
35
35
  font-size: 1.125rem;
36
36
  }
37
37
 
38
- ._ib {
38
+ ._fb {
39
39
  font-variation-settings: "wght" 400;
40
40
  font-synthesis-weight: none;
41
41
  font-weight: 400;
42
42
  }
43
43
 
44
- ._ja {
44
+ ._ga {
45
45
  line-height: 1.3;
46
46
  }
47
47
 
@@ -57,139 +57,139 @@
57
57
  color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
58
58
  }
59
59
 
60
- ._Sb {
60
+ ._Pb {
61
61
  transition-property: color, background-color, var(--gp), border-color, text-decoration-color, fill, stroke;
62
62
  }
63
63
 
64
- .__e-e10s0d {
64
+ .__b-e10s0d {
65
65
  grid-column-start: field;
66
66
  }
67
67
 
68
- .__V-yksgrp {
68
+ .__S-yksgrp {
69
69
  -webkit-tap-highlight-color: #0000;
70
70
  }
71
71
 
72
- ._Pa {
72
+ ._Ma {
73
73
  outline-style: none;
74
74
  }
75
75
 
76
- ._Pb {
76
+ ._Mb {
77
77
  outline-style: solid;
78
78
  }
79
79
 
80
- .cx {
80
+ .dx {
81
81
  outline-color: var(--lightningcss-light, #4b75ff) var(--lightningcss-dark, #4069fd);
82
82
  }
83
83
 
84
- ._Rc {
84
+ ._Oc {
85
85
  outline-width: 2px;
86
86
  }
87
87
 
88
- ._Q-3t1z {
88
+ ._N-3t1z {
89
89
  outline-offset: 2px;
90
90
  }
91
91
 
92
- .kk {
92
+ .lk {
93
93
  width: calc(1rem * var(--s2-scale));
94
94
  }
95
95
 
96
- .kl {
96
+ .ll {
97
97
  width: calc(.875rem * var(--s2-scale));
98
98
  }
99
99
 
100
- .km {
100
+ .lm {
101
101
  width: calc(1.125rem * var(--s2-scale));
102
102
  }
103
103
 
104
- .kg {
104
+ .lg {
105
105
  width: calc(1.25rem * var(--s2-scale));
106
106
  }
107
107
 
108
- .jk {
108
+ .kk {
109
109
  height: calc(1rem * var(--s2-scale));
110
110
  }
111
111
 
112
- .jl {
112
+ .kl {
113
113
  height: calc(.875rem * var(--s2-scale));
114
114
  }
115
115
 
116
- .jm {
116
+ .km {
117
117
  height: calc(1.125rem * var(--s2-scale));
118
118
  }
119
119
 
120
- .jg {
120
+ .kg {
121
121
  height: calc(1.25rem * var(--s2-scale));
122
122
  }
123
123
 
124
- ._zi {
124
+ ._wi {
125
125
  border-start-start-radius: .285714em;
126
126
  }
127
127
 
128
- ._Ai {
128
+ ._xi {
129
129
  border-start-end-radius: .285714em;
130
130
  }
131
131
 
132
- ._Bi {
132
+ ._yi {
133
133
  border-end-start-radius: .285714em;
134
134
  }
135
135
 
136
- ._Ci {
136
+ ._zi {
137
137
  border-end-end-radius: .285714em;
138
138
  }
139
139
 
140
- .__c-3t1x {
140
+ ._9-3t1x {
141
141
  flex-shrink: 0;
142
142
  }
143
143
 
144
- ._3d {
144
+ ._0d {
145
145
  display: flex;
146
146
  }
147
147
 
148
- ._5c {
148
+ ._2c {
149
149
  align-items: center;
150
150
  }
151
151
 
152
- ._6d {
152
+ ._3d {
153
153
  justify-content: center;
154
154
  }
155
155
 
156
- .tc {
156
+ .uc {
157
157
  border-top-width: 2px;
158
158
  }
159
159
 
160
- .uc {
160
+ .vc {
161
161
  border-bottom-width: 2px;
162
162
  }
163
163
 
164
- .rc {
164
+ .sc {
165
165
  border-inline-start-width: 2px;
166
166
  }
167
167
 
168
- .sc {
168
+ .tc {
169
169
  border-inline-end-width: 2px;
170
170
  }
171
171
 
172
- .__ra {
172
+ .__oa {
173
173
  box-sizing: border-box;
174
174
  }
175
175
 
176
- .za {
176
+ .wa {
177
177
  border-style: solid;
178
178
  }
179
179
 
180
- ._Sa {
180
+ ._Pa {
181
181
  transition-property: color, background-color, var(--gp), border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, backdrop-filter;
182
182
  }
183
183
 
184
- ._U-375x7f {
184
+ ._R-375x7f {
185
185
  transition-duration: .15s;
186
186
  }
187
187
 
188
- ._Va {
188
+ ._Sa {
189
189
  transition-timing-function: cubic-bezier(.45, 0, .4, 1);
190
190
  }
191
191
 
192
- ._Db {
192
+ ._Ab {
193
193
  forced-color-adjust: none;
194
194
  }
195
195
 
@@ -225,188 +225,104 @@
225
225
  background-color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
226
226
  }
227
227
 
228
- .xn {
229
- border-top-color: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
230
- }
231
-
232
- .xo {
233
- border-top-color: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
234
- }
235
-
236
- .xO {
237
- border-top-color: var(--lightningcss-light, #d73220) var(--lightningcss-dark, #fc432e);
238
- }
239
-
240
- .xP {
241
- border-top-color: var(--lightningcss-light, #b72818) var(--lightningcss-dark, #ff6756);
242
- }
243
-
244
- .xQ {
245
- border-top-color: var(--lightningcss-light, #9c2113) var(--lightningcss-dark, #ff8678);
246
- }
247
-
248
- .xj {
249
- border-top-color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
250
- }
251
-
252
- .xa {
253
- border-top-color: #0000;
254
- }
255
-
256
- .yn {
257
- border-bottom-color: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
258
- }
259
-
260
- .yo {
261
- border-bottom-color: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
262
- }
263
-
264
- .yO {
265
- border-bottom-color: var(--lightningcss-light, #d73220) var(--lightningcss-dark, #fc432e);
266
- }
267
-
268
- .yP {
269
- border-bottom-color: var(--lightningcss-light, #b72818) var(--lightningcss-dark, #ff6756);
270
- }
271
-
272
- .yQ {
273
- border-bottom-color: var(--lightningcss-light, #9c2113) var(--lightningcss-dark, #ff8678);
274
- }
275
-
276
- .yj {
277
- border-bottom-color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
278
- }
279
-
280
- .ya {
281
- border-bottom-color: #0000;
282
- }
283
-
284
- .vn {
285
- border-inline-start-color: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
286
- }
287
-
288
- .vo {
289
- border-inline-start-color: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
290
- }
291
-
292
- .vO {
293
- border-inline-start-color: var(--lightningcss-light, #d73220) var(--lightningcss-dark, #fc432e);
294
- }
295
-
296
- .vP {
297
- border-inline-start-color: var(--lightningcss-light, #b72818) var(--lightningcss-dark, #ff6756);
298
- }
299
-
300
- .vQ {
301
- border-inline-start-color: var(--lightningcss-light, #9c2113) var(--lightningcss-dark, #ff8678);
302
- }
303
-
304
- .vj {
305
- border-inline-start-color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
306
- }
307
-
308
- .va {
309
- border-inline-start-color: #0000;
310
- }
311
-
312
- .wn {
313
- border-inline-end-color: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
228
+ .cn {
229
+ border-color: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
314
230
  }
315
231
 
316
- .wo {
317
- border-inline-end-color: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
232
+ .co {
233
+ border-color: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
318
234
  }
319
235
 
320
- .wO {
321
- border-inline-end-color: var(--lightningcss-light, #d73220) var(--lightningcss-dark, #fc432e);
236
+ .cO {
237
+ border-color: var(--lightningcss-light, #d73220) var(--lightningcss-dark, #fc432e);
322
238
  }
323
239
 
324
- .wP {
325
- border-inline-end-color: var(--lightningcss-light, #b72818) var(--lightningcss-dark, #ff6756);
240
+ .cP {
241
+ border-color: var(--lightningcss-light, #b72818) var(--lightningcss-dark, #ff6756);
326
242
  }
327
243
 
328
- .wQ {
329
- border-inline-end-color: var(--lightningcss-light, #9c2113) var(--lightningcss-dark, #ff8678);
244
+ .cQ {
245
+ border-color: var(--lightningcss-light, #9c2113) var(--lightningcss-dark, #ff8678);
330
246
  }
331
247
 
332
- .wj {
333
- border-inline-end-color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
248
+ .cj {
249
+ border-color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
334
250
  }
335
251
 
336
- .wa {
337
- border-inline-end-color: #0000;
252
+ .ca {
253
+ border-color: #0000;
338
254
  }
339
255
 
340
- .-rwx0fg_d-B {
256
+ .-rwx0fg_e-B {
341
257
  --iconPrimary: var(--lightningcss-light, #fff) var(--lightningcss-dark, #111);
342
258
  }
343
259
  }
344
260
 
345
261
  @layer _.b {
346
- ._g-enzrfpb:lang(ar) {
262
+ ._d-enzrfpb:lang(ar) {
347
263
  font-family: myriad-arabic, ui-sans-serif, system-ui, sans-serif;
348
264
  }
349
265
 
350
- ._j-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
266
+ ._g-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
351
267
  line-height: 1.5;
352
268
  }
353
269
  }
354
270
 
355
271
  @layer _.c {
356
- ._g-enzwzjc:lang(he) {
272
+ ._d-enzwzjc:lang(he) {
357
273
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
358
274
  }
359
275
  }
360
276
 
361
277
  @layer _.d {
362
- ._g-enzykdd:lang(ja) {
278
+ ._d-enzykdd:lang(ja) {
363
279
  font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
364
280
  }
365
281
  }
366
282
 
367
283
  @layer _.e {
368
- ._g-enzzrge:lang(ko) {
284
+ ._d-enzzrge:lang(ko) {
369
285
  font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
370
286
  }
371
287
  }
372
288
 
373
289
  @layer _.f {
374
- ._g-eo0c6sf:lang(zh) {
290
+ ._d-eo0c6sf:lang(zh) {
375
291
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
376
292
  }
377
293
  }
378
294
 
379
295
  @layer _.g {
380
- ._g-1uotwbwg:lang(zh-hant) {
296
+ ._d-1uotwbwg:lang(zh-hant) {
381
297
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
382
298
  }
383
299
  }
384
300
 
385
301
  @layer _.h {
386
- ._g-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
302
+ ._d-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
387
303
  font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
388
304
  }
389
305
  }
390
306
 
391
307
  @layer _.b.b {
392
308
  @media not ((hover: hover) and (pointer: fine)) {
393
- ._hbf {
309
+ ._ebf {
394
310
  font-size: 1.0625rem;
395
311
  }
396
312
 
397
- ._hbb {
313
+ ._ebb {
398
314
  font-size: .8125rem;
399
315
  }
400
316
 
401
- ._hbd {
317
+ ._ebd {
402
318
  font-size: .9375rem;
403
319
  }
404
320
 
405
- ._hbh {
321
+ ._ebh {
406
322
  font-size: 1.1875rem;
407
323
  }
408
324
 
409
- ._hbj {
325
+ ._ebj {
410
326
  font-size: 1.375rem;
411
327
  }
412
328
  }
@@ -418,7 +334,7 @@
418
334
  color: graytext;
419
335
  }
420
336
 
421
- .ca_____M {
337
+ .da_____M {
422
338
  outline-color: highlight;
423
339
  }
424
340
 
@@ -438,55 +354,19 @@
438
354
  background-color: graytext;
439
355
  }
440
356
 
441
- .xa_____I {
442
- border-top-color: buttonborder;
443
- }
444
-
445
- .xa_____P {
446
- border-top-color: mark;
447
- }
448
-
449
- .xa_____O {
450
- border-top-color: graytext;
451
- }
452
-
453
- .ya_____I {
454
- border-bottom-color: buttonborder;
455
- }
456
-
457
- .ya_____P {
458
- border-bottom-color: mark;
459
- }
460
-
461
- .ya_____O {
462
- border-bottom-color: graytext;
463
- }
464
-
465
- .va_____I {
466
- border-inline-start-color: buttonborder;
467
- }
468
-
469
- .va_____P {
470
- border-inline-start-color: mark;
471
- }
472
-
473
- .va_____O {
474
- border-inline-start-color: graytext;
475
- }
476
-
477
- .wa_____I {
478
- border-inline-end-color: buttonborder;
357
+ .ca_____I {
358
+ border-color: buttonborder;
479
359
  }
480
360
 
481
- .wa_____P {
482
- border-inline-end-color: mark;
361
+ .ca_____P {
362
+ border-color: mark;
483
363
  }
484
364
 
485
- .wa_____O {
486
- border-inline-end-color: graytext;
365
+ .ca_____O {
366
+ border-color: graytext;
487
367
  }
488
368
 
489
- .-rwx0fg_d-a______b {
369
+ .-rwx0fg_e-a______b {
490
370
  --iconPrimary: HighlightText;
491
371
  }
492
372
  }
@@ -1 +1 @@
1
- {"mappings":"AC6CgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAoBG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6CO;;;;;AAjEV;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAoBG;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA6CO","sources":["547feb480bf9b133","packages/@react-spectrum/s2/src/Checkbox.tsx"],"sourcesContent":["@import \"bc01646daa9aaa9a\";\n@import \"4050adff4afc0e3e\";\n@import \"57a225a6b7ca79cd\";\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 {Checkbox as AriaCheckbox, CheckboxProps as AriaCheckboxProps, CheckboxGroupStateContext, CheckboxRenderProps, ContextValue, useSlottedContext} from 'react-aria-components';\nimport {baseColor, focusRing, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport DashIcon from '../ui-icons/Dash';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface CheckboxStyleProps {\n /**\n * The size of the Checkbox.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** Whether the Checkbox should be displayed with an emphasized style. */\n isEmphasized?: boolean\n}\n\ninterface RenderProps extends CheckboxRenderProps, CheckboxStyleProps {}\n\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, CheckboxStyleProps {\n /** The label for the element. */\n children?: ReactNode\n}\n\nexport const CheckboxContext = createContext<ContextValue<Partial<CheckboxProps>, FocusableRefValue<HTMLLabelElement>>>(null);\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n transition: 'colors',\n color: {\n default: 'neutral',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n gridColumnStart: {\n isInForm: 'field'\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nexport const box = style<RenderProps>({\n ...focusRing(),\n size: 'control-sm',\n borderRadius: 'control-sm',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 2,\n boxSizing: 'border-box',\n borderStyle: 'solid',\n transition: 'default',\n forcedColorAdjust: 'none',\n backgroundColor: {\n default: 'gray-25',\n forcedColors: 'Background',\n isSelected: {\n default: 'neutral',\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight',\n isInvalid: {\n default: baseColor('negative-900'),\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n },\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isInvalid: {\n default: 'negative',\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'transparent'\n }\n});\n\nexport const iconStyles = style({\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'gray-25',\n forcedColors: 'HighlightText'\n }\n }\n});\n\nconst iconSize = {\n S: 'XS',\n M: 'S',\n L: 'M',\n XL: 'L'\n} as const;\n\n/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nexport const Checkbox = forwardRef(function Checkbox({children, ...props}: CheckboxProps, ref: FocusableRef<HTMLLabelElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, CheckboxContext);\n let boxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let isInForm = !!useContext(FormContext);\n props = useFormProps(props);\n let isInCheckboxGroup = !!useContext(CheckboxGroupStateContext);\n let ctx = useSlottedContext(CheckboxContext, props.slot);\n\n return (\n <AriaCheckbox\n {...props}\n ref={domRef}\n inputRef={inputRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + wrapper({...renderProps, isInForm, size: props.size || 'M'}, props.styles)}>\n {renderProps => {\n let checkbox = (\n <div\n ref={boxRef}\n style={pressScale(boxRef)(renderProps)}\n className={box({\n ...renderProps,\n isSelected: renderProps.isSelected || renderProps.isIndeterminate,\n size: props.size || 'M',\n isEmphasized: isInCheckboxGroup ? ctx?.isEmphasized : props.isEmphasized\n })}>\n {renderProps.isIndeterminate &&\n <DashIcon size={iconSize[props.size || 'M']} className={iconStyles} />\n }\n {renderProps.isSelected && !renderProps.isIndeterminate &&\n <CheckmarkIcon size={iconSize[props.size || 'M']} className={iconStyles} />\n }\n </div>\n );\n\n // Only render checkbox without center baseline if no label.\n // This avoids expanding the checkbox height to the font's line height.\n if (!children) {\n return checkbox;\n }\n\n return (\n <>\n <CenterBaseline>\n {checkbox}\n </CenterBaseline>\n {children}\n </>\n );\n }}\n </AriaCheckbox>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.css.map"}
1
+ {"mappings":"AC6CgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAoBG;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA6CO;;;;;AAjEV;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAoBG;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA6CO","sources":["547feb480bf9b133","packages/@react-spectrum/s2/src/Checkbox.tsx"],"sourcesContent":["@import \"bc01646daa9aaa9a\";\n@import \"4050adff4afc0e3e\";\n@import \"57a225a6b7ca79cd\";\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 {Checkbox as AriaCheckbox, CheckboxProps as AriaCheckboxProps, CheckboxGroupStateContext, CheckboxRenderProps, ContextValue, useSlottedContext} from 'react-aria-components';\nimport {baseColor, focusRing, style} from '../style' with {type: 'macro'};\nimport {CenterBaseline} from './CenterBaseline';\nimport CheckmarkIcon from '../ui-icons/Checkmark';\nimport {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport DashIcon from '../ui-icons/Dash';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {FormContext, useFormProps} from './Form';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {pressScale} from './pressScale';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface CheckboxStyleProps {\n /**\n * The size of the Checkbox.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /** Whether the Checkbox should be displayed with an emphasized style. */\n isEmphasized?: boolean\n}\n\ninterface RenderProps extends CheckboxRenderProps, CheckboxStyleProps {}\n\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, CheckboxStyleProps {\n /** The label for the element. */\n children?: ReactNode\n}\n\nexport const CheckboxContext = createContext<ContextValue<Partial<CheckboxProps>, FocusableRefValue<HTMLLabelElement>>>(null);\n\nconst wrapper = style({\n display: 'flex',\n columnGap: 'text-to-control',\n alignItems: 'baseline',\n width: 'fit',\n font: 'control',\n transition: 'colors',\n color: {\n default: 'neutral',\n isDisabled: {\n default: 'disabled',\n forcedColors: 'GrayText'\n }\n },\n gridColumnStart: {\n isInForm: 'field'\n },\n disableTapHighlight: true\n}, getAllowedOverrides());\n\nexport const box = style<RenderProps>({\n ...focusRing(),\n size: 'control-sm',\n borderRadius: 'control-sm',\n flexShrink: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 2,\n boxSizing: 'border-box',\n borderStyle: 'solid',\n transition: 'default',\n forcedColorAdjust: 'none',\n backgroundColor: {\n default: 'gray-25',\n forcedColors: 'Background',\n isSelected: {\n default: 'neutral',\n isEmphasized: baseColor('accent-900'),\n forcedColors: 'Highlight',\n isInvalid: {\n default: baseColor('negative-900'),\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n }\n }\n },\n borderColor: {\n default: baseColor('gray-800'),\n forcedColors: 'ButtonBorder',\n isInvalid: {\n default: 'negative',\n forcedColors: 'Mark'\n },\n isDisabled: {\n default: 'gray-400',\n forcedColors: 'GrayText'\n },\n isSelected: 'transparent'\n }\n});\n\nexport const iconStyles = style({\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'gray-25',\n forcedColors: 'HighlightText'\n }\n }\n});\n\nconst iconSize = {\n S: 'XS',\n M: 'S',\n L: 'M',\n XL: 'L'\n} as const;\n\n/**\n * Checkboxes allow users to select multiple items from a list of individual items,\n * or to mark one individual item as selected.\n */\nexport const Checkbox = forwardRef(function Checkbox({children, ...props}: CheckboxProps, ref: FocusableRef<HTMLLabelElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, CheckboxContext);\n let boxRef = useRef(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n let isInForm = !!useContext(FormContext);\n props = useFormProps(props);\n let isInCheckboxGroup = !!useContext(CheckboxGroupStateContext);\n let ctx = useSlottedContext(CheckboxContext, props.slot);\n\n return (\n <AriaCheckbox\n {...props}\n ref={domRef}\n inputRef={inputRef}\n style={props.UNSAFE_style}\n className={renderProps => (props.UNSAFE_className || '') + wrapper({...renderProps, isInForm, size: props.size || 'M'}, props.styles)}>\n {renderProps => {\n let checkbox = (\n <div\n ref={boxRef}\n style={pressScale(boxRef)(renderProps)}\n className={box({\n ...renderProps,\n isSelected: renderProps.isSelected || renderProps.isIndeterminate,\n size: props.size || 'M',\n isEmphasized: isInCheckboxGroup ? ctx?.isEmphasized : props.isEmphasized\n })}>\n {renderProps.isIndeterminate &&\n <DashIcon size={iconSize[props.size || 'M']} className={iconStyles} />\n }\n {renderProps.isSelected && !renderProps.isIndeterminate &&\n <CheckmarkIcon size={iconSize[props.size || 'M']} className={iconStyles} />\n }\n </div>\n );\n\n // Only render checkbox without center baseline if no label.\n // This avoids expanding the checkbox height to the font's line height.\n if (!children) {\n return checkbox;\n }\n\n return (\n <>\n <CenterBaseline>\n {checkbox}\n </CenterBaseline>\n {children}\n </>\n );\n }}\n </AriaCheckbox>\n );\n});\n"],"names":[],"version":3,"file":"Checkbox.css.map"}