@react-spectrum/s2 3.0.0-nightly-fd7075c5f-250128 → 3.0.0-nightly-e3ed3c7f6-250130

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 (268) 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 +91 -67
  23. package/dist/Badge.cjs.map +1 -1
  24. package/dist/Badge.css +163 -91
  25. package/dist/Badge.css.map +1 -1
  26. package/dist/Badge.mjs +91 -67
  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 +236 -152
  32. package/dist/Button.cjs.map +1 -1
  33. package/dist/Button.css +309 -165
  34. package/dist/Button.css.map +1 -1
  35. package/dist/Button.mjs +236 -152
  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 +264 -261
  41. package/dist/Card.cjs.map +1 -1
  42. package/dist/Card.css +210 -198
  43. package/dist/Card.css.map +1 -1
  44. package/dist/Card.mjs +264 -261
  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 +124 -73
  53. package/dist/Checkbox.cjs.map +1 -1
  54. package/dist/Checkbox.css +201 -81
  55. package/dist/Checkbox.css.map +1 -1
  56. package/dist/Checkbox.mjs +124 -73
  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 +27 -21
  74. package/dist/ColorHandle.cjs.map +1 -1
  75. package/dist/ColorHandle.css +93 -45
  76. package/dist/ColorHandle.css.map +1 -1
  77. package/dist/ColorHandle.mjs +27 -21
  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 +27 -24
  83. package/dist/ColorSwatch.cjs.map +1 -1
  84. package/dist/ColorSwatch.css +41 -29
  85. package/dist/ColorSwatch.css.map +1 -1
  86. package/dist/ColorSwatch.mjs +27 -24
  87. package/dist/ColorSwatch.mjs.map +1 -1
  88. package/dist/ColorSwatchPicker.cjs +23 -23
  89. package/dist/ColorSwatchPicker.css +60 -48
  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 +111 -108
  108. package/dist/Disclosure.cjs.map +1 -1
  109. package/dist/Disclosure.css +124 -112
  110. package/dist/Disclosure.css.map +1 -1
  111. package/dist/Disclosure.mjs +111 -108
  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 +56 -47
  117. package/dist/DropZone.cjs.map +1 -1
  118. package/dist/DropZone.css +80 -56
  119. package/dist/DropZone.css.map +1 -1
  120. package/dist/DropZone.mjs +56 -47
  121. package/dist/DropZone.mjs.map +1 -1
  122. package/dist/Field.cjs +204 -150
  123. package/dist/Field.cjs.map +1 -1
  124. package/dist/Field.css +246 -150
  125. package/dist/Field.css.map +1 -1
  126. package/dist/Field.mjs +204 -150
  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 +104 -77
  141. package/dist/InlineAlert.cjs.map +1 -1
  142. package/dist/InlineAlert.css +149 -77
  143. package/dist/InlineAlert.css.map +1 -1
  144. package/dist/InlineAlert.mjs +104 -77
  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 -264
  150. package/dist/Menu.cjs.map +1 -1
  151. package/dist/Menu.css +152 -152
  152. package/dist/Menu.css.map +1 -1
  153. package/dist/Menu.mjs +270 -265
  154. package/dist/Menu.mjs.map +1 -1
  155. package/dist/Meter.cjs +85 -85
  156. package/dist/Meter.css +81 -81
  157. package/dist/Meter.mjs +85 -85
  158. package/dist/Modal.cjs +48 -48
  159. package/dist/Modal.css +46 -46
  160. package/dist/Modal.mjs +48 -48
  161. package/dist/NumberField.cjs +115 -115
  162. package/dist/NumberField.css +114 -114
  163. package/dist/NumberField.mjs +115 -115
  164. package/dist/Picker.cjs +193 -175
  165. package/dist/Picker.cjs.map +1 -1
  166. package/dist/Picker.css +223 -163
  167. package/dist/Picker.css.map +1 -1
  168. package/dist/Picker.mjs +193 -175
  169. package/dist/Picker.mjs.map +1 -1
  170. package/dist/Popover.cjs +84 -78
  171. package/dist/Popover.cjs.map +1 -1
  172. package/dist/Popover.css +89 -65
  173. package/dist/Popover.css.map +1 -1
  174. package/dist/Popover.mjs +84 -78
  175. package/dist/Popover.mjs.map +1 -1
  176. package/dist/ProgressBar.cjs +98 -98
  177. package/dist/ProgressBar.css +92 -92
  178. package/dist/ProgressBar.mjs +98 -98
  179. package/dist/ProgressCircle.cjs +17 -17
  180. package/dist/ProgressCircle.css +15 -15
  181. package/dist/ProgressCircle.mjs +17 -17
  182. package/dist/Provider.cjs +4 -4
  183. package/dist/Provider.css +5 -5
  184. package/dist/Provider.mjs +4 -4
  185. package/dist/Radio.cjs +152 -80
  186. package/dist/Radio.cjs.map +1 -1
  187. package/dist/Radio.css +240 -96
  188. package/dist/Radio.css.map +1 -1
  189. package/dist/Radio.mjs +152 -80
  190. package/dist/Radio.mjs.map +1 -1
  191. package/dist/RadioGroup.cjs +47 -47
  192. package/dist/RadioGroup.css +41 -41
  193. package/dist/RadioGroup.mjs +47 -47
  194. package/dist/SearchField.cjs +42 -42
  195. package/dist/SearchField.css +47 -47
  196. package/dist/SearchField.mjs +42 -42
  197. package/dist/SegmentedControl.cjs +101 -89
  198. package/dist/SegmentedControl.cjs.map +1 -1
  199. package/dist/SegmentedControl.css +140 -92
  200. package/dist/SegmentedControl.css.map +1 -1
  201. package/dist/SegmentedControl.mjs +101 -89
  202. package/dist/SegmentedControl.mjs.map +1 -1
  203. package/dist/Slider.cjs +229 -196
  204. package/dist/Slider.cjs.map +1 -1
  205. package/dist/Slider.css +221 -149
  206. package/dist/Slider.css.map +1 -1
  207. package/dist/Slider.mjs +229 -196
  208. package/dist/Slider.mjs.map +1 -1
  209. package/dist/StatusLight.cjs +56 -56
  210. package/dist/StatusLight.css +59 -59
  211. package/dist/StatusLight.mjs +56 -56
  212. package/dist/Switch.cjs +107 -74
  213. package/dist/Switch.cjs.map +1 -1
  214. package/dist/Switch.css +141 -69
  215. package/dist/Switch.css.map +1 -1
  216. package/dist/Switch.mjs +107 -74
  217. package/dist/Switch.mjs.map +1 -1
  218. package/dist/TableView.cjs +280 -253
  219. package/dist/TableView.cjs.map +1 -1
  220. package/dist/TableView.css +199 -163
  221. package/dist/TableView.css.map +1 -1
  222. package/dist/TableView.mjs +280 -253
  223. package/dist/TableView.mjs.map +1 -1
  224. package/dist/Tabs.cjs +83 -83
  225. package/dist/Tabs.css +58 -58
  226. package/dist/Tabs.mjs +83 -83
  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 +60 -57
  237. package/dist/Tooltip.cjs.map +1 -1
  238. package/dist/Tooltip.css +83 -71
  239. package/dist/Tooltip.css.map +1 -1
  240. package/dist/Tooltip.mjs +60 -57
  241. package/dist/Tooltip.mjs.map +1 -1
  242. package/dist/TreeView.cjs +465 -0
  243. package/dist/TreeView.cjs.map +1 -0
  244. package/dist/TreeView.css +632 -0
  245. package/dist/TreeView.css.map +1 -0
  246. package/dist/TreeView.mjs +455 -0
  247. package/dist/TreeView.mjs.map +1 -0
  248. package/dist/main.cjs +4 -0
  249. package/dist/main.cjs.map +1 -1
  250. package/dist/module.mjs +3 -1
  251. package/dist/module.mjs.map +1 -1
  252. package/dist/types.d.ts +21 -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 +20 -19
  258. package/src/Menu.tsx +2 -0
  259. package/src/TreeView.tsx +497 -0
  260. package/src/index.ts +2 -0
  261. package/style/__tests__/style-macro.test.js +18 -18
  262. package/style/dist/spectrum-theme.cjs +20 -10
  263. package/style/dist/spectrum-theme.cjs.map +1 -1
  264. package/style/dist/spectrum-theme.mjs +20 -10
  265. package/style/dist/spectrum-theme.mjs.map +1 -1
  266. package/style/dist/types.d.ts +4 -0
  267. package/style/dist/types.d.ts.map +1 -1
  268. package/style/spectrum-theme.ts +18 -11
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAiCM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoE;AAE/G,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<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,EAAoE;AAE/G,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<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
- .jF {
2
+ .iF {
3
3
  column-gap: .714286em;
4
4
  }
5
5
 
6
- ._2d {
6
+ ._5d {
7
7
  align-items: baseline;
8
8
  }
9
9
 
10
- .le {
10
+ .ke {
11
11
  width: fit-content;
12
12
  }
13
13
 
14
- ._da {
14
+ ._ga {
15
15
  font-family: adobe-clean-variable, adobe-clean, ui-sans-serif, system-ui, sans-serif;
16
16
  }
17
17
 
18
- ._ee {
18
+ ._he {
19
19
  font-size: .875rem;
20
20
  }
21
21
 
22
- ._ea {
22
+ ._ha {
23
23
  font-size: .6875rem;
24
24
  }
25
25
 
26
- ._ec {
26
+ ._hc {
27
27
  font-size: .75rem;
28
28
  }
29
29
 
30
- ._eg {
30
+ ._hg {
31
31
  font-size: 1rem;
32
32
  }
33
33
 
34
- ._ei {
34
+ ._hi {
35
35
  font-size: 1.125rem;
36
36
  }
37
37
 
38
- ._fb {
38
+ ._ib {
39
39
  font-variation-settings: "wght" 400;
40
40
  font-synthesis-weight: none;
41
41
  font-weight: 400;
42
42
  }
43
43
 
44
- ._ga {
44
+ ._ja {
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
- ._Pb {
60
+ ._Sb {
61
61
  transition-property: color, background-color, var(--gp), border-color, text-decoration-color, fill, stroke;
62
62
  }
63
63
 
64
- .__b-e10s0d {
64
+ .__e-e10s0d {
65
65
  grid-column-start: field;
66
66
  }
67
67
 
68
- .__S-yksgrp {
68
+ .__V-yksgrp {
69
69
  -webkit-tap-highlight-color: #0000;
70
70
  }
71
71
 
72
- ._Ma {
72
+ ._Pa {
73
73
  outline-style: none;
74
74
  }
75
75
 
76
- ._Mb {
76
+ ._Pb {
77
77
  outline-style: solid;
78
78
  }
79
79
 
80
- .dx {
80
+ .cx {
81
81
  outline-color: var(--lightningcss-light, #4b75ff) var(--lightningcss-dark, #4069fd);
82
82
  }
83
83
 
84
- ._Oc {
84
+ ._Rc {
85
85
  outline-width: 2px;
86
86
  }
87
87
 
88
- ._N-3t1z {
88
+ ._Q-3t1z {
89
89
  outline-offset: 2px;
90
90
  }
91
91
 
92
- .lk {
92
+ .kk {
93
93
  width: calc(1rem * var(--s2-scale));
94
94
  }
95
95
 
96
- .ll {
96
+ .kl {
97
97
  width: calc(.875rem * var(--s2-scale));
98
98
  }
99
99
 
100
- .lm {
100
+ .km {
101
101
  width: calc(1.125rem * var(--s2-scale));
102
102
  }
103
103
 
104
- .lg {
104
+ .kg {
105
105
  width: calc(1.25rem * var(--s2-scale));
106
106
  }
107
107
 
108
- .kk {
108
+ .jk {
109
109
  height: calc(1rem * var(--s2-scale));
110
110
  }
111
111
 
112
- .kl {
112
+ .jl {
113
113
  height: calc(.875rem * var(--s2-scale));
114
114
  }
115
115
 
116
- .km {
116
+ .jm {
117
117
  height: calc(1.125rem * var(--s2-scale));
118
118
  }
119
119
 
120
- .kg {
120
+ .jg {
121
121
  height: calc(1.25rem * var(--s2-scale));
122
122
  }
123
123
 
124
- ._wi {
124
+ ._zi {
125
125
  border-start-start-radius: .285714em;
126
126
  }
127
127
 
128
- ._xi {
128
+ ._Ai {
129
129
  border-start-end-radius: .285714em;
130
130
  }
131
131
 
132
- ._yi {
132
+ ._Bi {
133
133
  border-end-start-radius: .285714em;
134
134
  }
135
135
 
136
- ._zi {
136
+ ._Ci {
137
137
  border-end-end-radius: .285714em;
138
138
  }
139
139
 
140
- ._9-3t1x {
140
+ .__c-3t1x {
141
141
  flex-shrink: 0;
142
142
  }
143
143
 
144
- ._0d {
144
+ ._3d {
145
145
  display: flex;
146
146
  }
147
147
 
148
- ._2c {
148
+ ._5c {
149
149
  align-items: center;
150
150
  }
151
151
 
152
- ._3d {
152
+ ._6d {
153
153
  justify-content: center;
154
154
  }
155
155
 
156
- .uc {
156
+ .tc {
157
157
  border-top-width: 2px;
158
158
  }
159
159
 
160
- .vc {
160
+ .uc {
161
161
  border-bottom-width: 2px;
162
162
  }
163
163
 
164
- .sc {
164
+ .rc {
165
165
  border-inline-start-width: 2px;
166
166
  }
167
167
 
168
- .tc {
168
+ .sc {
169
169
  border-inline-end-width: 2px;
170
170
  }
171
171
 
172
- .__oa {
172
+ .__ra {
173
173
  box-sizing: border-box;
174
174
  }
175
175
 
176
- .wa {
176
+ .za {
177
177
  border-style: solid;
178
178
  }
179
179
 
180
- ._Pa {
180
+ ._Sa {
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
- ._R-375x7f {
184
+ ._U-375x7f {
185
185
  transition-duration: .15s;
186
186
  }
187
187
 
188
- ._Sa {
188
+ ._Va {
189
189
  transition-timing-function: cubic-bezier(.45, 0, .4, 1);
190
190
  }
191
191
 
192
- ._Ab {
192
+ ._Db {
193
193
  forced-color-adjust: none;
194
194
  }
195
195
 
@@ -225,104 +225,188 @@
225
225
  background-color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
226
226
  }
227
227
 
228
- .cn {
229
- border-color: var(--lightningcss-light, #292929) var(--lightningcss-dark, #dbdbdb);
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);
230
314
  }
231
315
 
232
- .co {
233
- border-color: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
316
+ .wo {
317
+ border-inline-end-color: var(--lightningcss-light, #131313) var(--lightningcss-dark, #f2f2f2);
234
318
  }
235
319
 
236
- .cO {
237
- border-color: var(--lightningcss-light, #d73220) var(--lightningcss-dark, #fc432e);
320
+ .wO {
321
+ border-inline-end-color: var(--lightningcss-light, #d73220) var(--lightningcss-dark, #fc432e);
238
322
  }
239
323
 
240
- .cP {
241
- border-color: var(--lightningcss-light, #b72818) var(--lightningcss-dark, #ff6756);
324
+ .wP {
325
+ border-inline-end-color: var(--lightningcss-light, #b72818) var(--lightningcss-dark, #ff6756);
242
326
  }
243
327
 
244
- .cQ {
245
- border-color: var(--lightningcss-light, #9c2113) var(--lightningcss-dark, #ff8678);
328
+ .wQ {
329
+ border-inline-end-color: var(--lightningcss-light, #9c2113) var(--lightningcss-dark, #ff8678);
246
330
  }
247
331
 
248
- .cj {
249
- border-color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
332
+ .wj {
333
+ border-inline-end-color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
250
334
  }
251
335
 
252
- .ca {
253
- border-color: #0000;
336
+ .wa {
337
+ border-inline-end-color: #0000;
254
338
  }
255
339
 
256
- .-rwx0fg_e-B {
340
+ .-rwx0fg_d-B {
257
341
  --iconPrimary: var(--lightningcss-light, #fff) var(--lightningcss-dark, #111);
258
342
  }
259
343
  }
260
344
 
261
345
  @layer _.b {
262
- ._d-enzrfpb:lang(ar) {
346
+ ._g-enzrfpb:lang(ar) {
263
347
  font-family: myriad-arabic, ui-sans-serif, system-ui, sans-serif;
264
348
  }
265
349
 
266
- ._g-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
350
+ ._j-1x99dlob:is(:lang(ja), :lang(ko), :lang(zh), :lang(zh-Hant), :lang(zh-Hans)) {
267
351
  line-height: 1.5;
268
352
  }
269
353
  }
270
354
 
271
355
  @layer _.c {
272
- ._d-enzwzjc:lang(he) {
356
+ ._g-enzwzjc:lang(he) {
273
357
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
274
358
  }
275
359
  }
276
360
 
277
361
  @layer _.d {
278
- ._d-enzykdd:lang(ja) {
362
+ ._g-enzykdd:lang(ja) {
279
363
  font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
280
364
  }
281
365
  }
282
366
 
283
367
  @layer _.e {
284
- ._d-enzzrge:lang(ko) {
368
+ ._g-enzzrge:lang(ko) {
285
369
  font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
286
370
  }
287
371
  }
288
372
 
289
373
  @layer _.f {
290
- ._d-eo0c6sf:lang(zh) {
374
+ ._g-eo0c6sf:lang(zh) {
291
375
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
292
376
  }
293
377
  }
294
378
 
295
379
  @layer _.g {
296
- ._d-1uotwbwg:lang(zh-hant) {
380
+ ._g-1uotwbwg:lang(zh-hant) {
297
381
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
298
382
  }
299
383
  }
300
384
 
301
385
  @layer _.h {
302
- ._d-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
386
+ ._g-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
303
387
  font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
304
388
  }
305
389
  }
306
390
 
307
391
  @layer _.b.b {
308
392
  @media not ((hover: hover) and (pointer: fine)) {
309
- ._ebf {
393
+ ._hbf {
310
394
  font-size: 1.0625rem;
311
395
  }
312
396
 
313
- ._ebb {
397
+ ._hbb {
314
398
  font-size: .8125rem;
315
399
  }
316
400
 
317
- ._ebd {
401
+ ._hbd {
318
402
  font-size: .9375rem;
319
403
  }
320
404
 
321
- ._ebh {
405
+ ._hbh {
322
406
  font-size: 1.1875rem;
323
407
  }
324
408
 
325
- ._ebj {
409
+ ._hbj {
326
410
  font-size: 1.375rem;
327
411
  }
328
412
  }
@@ -334,7 +418,7 @@
334
418
  color: graytext;
335
419
  }
336
420
 
337
- .da_____M {
421
+ .ca_____M {
338
422
  outline-color: highlight;
339
423
  }
340
424
 
@@ -354,19 +438,55 @@
354
438
  background-color: graytext;
355
439
  }
356
440
 
357
- .ca_____I {
358
- border-color: buttonborder;
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;
359
479
  }
360
480
 
361
- .ca_____P {
362
- border-color: mark;
481
+ .wa_____P {
482
+ border-inline-end-color: mark;
363
483
  }
364
484
 
365
- .ca_____O {
366
- border-color: graytext;
485
+ .wa_____O {
486
+ border-inline-end-color: graytext;
367
487
  }
368
488
 
369
- .-rwx0fg_e-a______b {
489
+ .-rwx0fg_d-a______b {
370
490
  --iconPrimary: HighlightText;
371
491
  }
372
492
  }
@@ -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;;;;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<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;;;;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<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"}