@react-spectrum/s2 0.9.0 → 0.9.1

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 (262) hide show
  1. package/dist/Accordion.cjs +2 -2
  2. package/dist/Accordion.css +2 -2
  3. package/dist/Accordion.mjs +2 -2
  4. package/dist/ActionBar.cjs +60 -60
  5. package/dist/ActionBar.css +59 -59
  6. package/dist/ActionBar.mjs +60 -60
  7. package/dist/ActionButton.cjs +187 -187
  8. package/dist/ActionButton.cjs.map +1 -1
  9. package/dist/ActionButton.css +134 -134
  10. package/dist/ActionButton.css.map +1 -1
  11. package/dist/ActionButton.mjs +187 -187
  12. package/dist/ActionButton.mjs.map +1 -1
  13. package/dist/ActionButtonGroup.cjs +15 -15
  14. package/dist/ActionButtonGroup.css +9 -9
  15. package/dist/ActionButtonGroup.mjs +15 -15
  16. package/dist/Add.cjs +10 -10
  17. package/dist/Add.css +6 -6
  18. package/dist/Add.mjs +10 -10
  19. package/dist/AlertDialog.cjs +3 -3
  20. package/dist/AlertDialog.css +3 -3
  21. package/dist/AlertDialog.mjs +3 -3
  22. package/dist/Asterisk.cjs +6 -6
  23. package/dist/Asterisk.css +4 -4
  24. package/dist/Asterisk.mjs +6 -6
  25. package/dist/Avatar.cjs +14 -14
  26. package/dist/Avatar.css +14 -14
  27. package/dist/Avatar.mjs +14 -14
  28. package/dist/AvatarGroup.cjs +120 -120
  29. package/dist/AvatarGroup.css +37 -37
  30. package/dist/AvatarGroup.mjs +120 -120
  31. package/dist/Badge.cjs +196 -196
  32. package/dist/Badge.css +129 -129
  33. package/dist/Badge.mjs +196 -196
  34. package/dist/Breadcrumbs.cjs +231 -231
  35. package/dist/Breadcrumbs.css +102 -102
  36. package/dist/Breadcrumbs.mjs +231 -231
  37. package/dist/Button.cjs +328 -328
  38. package/dist/Button.cjs.map +1 -1
  39. package/dist/Button.css +176 -176
  40. package/dist/Button.css.map +1 -1
  41. package/dist/Button.mjs +328 -328
  42. package/dist/Button.mjs.map +1 -1
  43. package/dist/ButtonGroup.cjs +20 -20
  44. package/dist/ButtonGroup.css +15 -15
  45. package/dist/ButtonGroup.mjs +20 -20
  46. package/dist/Card.cjs +294 -294
  47. package/dist/Card.css +205 -205
  48. package/dist/Card.mjs +294 -294
  49. package/dist/CardView.cjs +17 -17
  50. package/dist/CardView.css +17 -17
  51. package/dist/CardView.mjs +17 -17
  52. package/dist/CenterBaseline.cjs +1 -1
  53. package/dist/CenterBaseline.css +2 -2
  54. package/dist/CenterBaseline.mjs +1 -1
  55. package/dist/Checkbox.cjs +160 -160
  56. package/dist/Checkbox.css +94 -94
  57. package/dist/Checkbox.mjs +160 -160
  58. package/dist/CheckboxGroup.cjs +43 -43
  59. package/dist/CheckboxGroup.css +41 -41
  60. package/dist/CheckboxGroup.mjs +43 -43
  61. package/dist/Checkmark.cjs +12 -12
  62. package/dist/Checkmark.css +8 -8
  63. package/dist/Checkmark.mjs +12 -12
  64. package/dist/Chevron.cjs +12 -12
  65. package/dist/Chevron.css +10 -10
  66. package/dist/Chevron.mjs +12 -12
  67. package/dist/ClearButton.cjs +29 -29
  68. package/dist/ClearButton.css +29 -29
  69. package/dist/ClearButton.mjs +29 -29
  70. package/dist/CloseButton.cjs +54 -54
  71. package/dist/CloseButton.css +46 -46
  72. package/dist/CloseButton.mjs +54 -54
  73. package/dist/ColorArea.cjs +16 -16
  74. package/dist/ColorArea.css +16 -16
  75. package/dist/ColorArea.mjs +16 -16
  76. package/dist/ColorField.cjs +31 -31
  77. package/dist/ColorField.css +31 -31
  78. package/dist/ColorField.mjs +31 -31
  79. package/dist/ColorHandle.cjs +27 -27
  80. package/dist/ColorHandle.css +42 -42
  81. package/dist/ColorHandle.mjs +27 -27
  82. package/dist/ColorSlider.cjs +108 -108
  83. package/dist/ColorSlider.css +56 -56
  84. package/dist/ColorSlider.mjs +108 -108
  85. package/dist/ColorSwatch.cjs +29 -29
  86. package/dist/ColorSwatch.css +29 -29
  87. package/dist/ColorSwatch.mjs +29 -29
  88. package/dist/ColorSwatchPicker.cjs +27 -27
  89. package/dist/ColorSwatchPicker.css +46 -46
  90. package/dist/ColorSwatchPicker.mjs +27 -27
  91. package/dist/ColorWheel.cjs +26 -26
  92. package/dist/ColorWheel.css +17 -17
  93. package/dist/ColorWheel.mjs +26 -26
  94. package/dist/ComboBox.cjs +378 -376
  95. package/dist/ComboBox.cjs.map +1 -1
  96. package/dist/ComboBox.css +179 -179
  97. package/dist/ComboBox.css.map +1 -1
  98. package/dist/ComboBox.mjs +378 -376
  99. package/dist/ComboBox.mjs.map +1 -1
  100. package/dist/ContextualHelp.cjs +5 -5
  101. package/dist/ContextualHelp.cjs.map +1 -1
  102. package/dist/ContextualHelp.css +49 -49
  103. package/dist/ContextualHelp.css.map +1 -1
  104. package/dist/ContextualHelp.mjs +5 -5
  105. package/dist/ContextualHelp.mjs.map +1 -1
  106. package/dist/Cross.cjs +14 -14
  107. package/dist/Cross.css +10 -10
  108. package/dist/Cross.mjs +14 -14
  109. package/dist/CustomDialog.cjs +25 -25
  110. package/dist/CustomDialog.css +25 -25
  111. package/dist/CustomDialog.mjs +25 -25
  112. package/dist/Dash.cjs +10 -10
  113. package/dist/Dash.css +6 -6
  114. package/dist/Dash.mjs +10 -10
  115. package/dist/Dialog.cjs +17 -17
  116. package/dist/Dialog.css +70 -70
  117. package/dist/Dialog.mjs +17 -17
  118. package/dist/Disclosure.cjs +129 -129
  119. package/dist/Disclosure.css +104 -104
  120. package/dist/Disclosure.mjs +129 -129
  121. package/dist/Divider.cjs +25 -25
  122. package/dist/Divider.css +25 -25
  123. package/dist/Divider.mjs +25 -25
  124. package/dist/DropZone.cjs +58 -58
  125. package/dist/DropZone.css +54 -54
  126. package/dist/DropZone.mjs +58 -58
  127. package/dist/Field.cjs +340 -340
  128. package/dist/Field.cjs.map +1 -1
  129. package/dist/Field.css +144 -144
  130. package/dist/Field.mjs +340 -340
  131. package/dist/Field.mjs.map +1 -1
  132. package/dist/Form.cjs +9 -9
  133. package/dist/Form.css +9 -9
  134. package/dist/Form.mjs +9 -9
  135. package/dist/FullscreenDialog.cjs +5 -5
  136. package/dist/FullscreenDialog.css +79 -79
  137. package/dist/FullscreenDialog.mjs +5 -5
  138. package/dist/IllustratedMessage.cjs +219 -219
  139. package/dist/IllustratedMessage.css +74 -74
  140. package/dist/IllustratedMessage.mjs +219 -219
  141. package/dist/Image.cjs +13 -13
  142. package/dist/Image.css +14 -14
  143. package/dist/Image.mjs +13 -13
  144. package/dist/InlineAlert.cjs +108 -108
  145. package/dist/InlineAlert.css +90 -90
  146. package/dist/InlineAlert.mjs +108 -108
  147. package/dist/Link.cjs +49 -49
  148. package/dist/Link.css +41 -41
  149. package/dist/Link.mjs +49 -49
  150. package/dist/LinkOut.cjs +8 -8
  151. package/dist/LinkOut.css +8 -8
  152. package/dist/LinkOut.mjs +8 -8
  153. package/dist/Menu.cjs +422 -422
  154. package/dist/Menu.css +180 -180
  155. package/dist/Menu.mjs +422 -422
  156. package/dist/Meter.cjs +153 -153
  157. package/dist/Meter.css +95 -95
  158. package/dist/Meter.mjs +153 -153
  159. package/dist/Modal.cjs +58 -58
  160. package/dist/Modal.css +50 -50
  161. package/dist/Modal.mjs +58 -58
  162. package/dist/NotificationBadge.cjs +56 -56
  163. package/dist/NotificationBadge.css +51 -51
  164. package/dist/NotificationBadge.mjs +56 -56
  165. package/dist/NumberField.cjs +114 -114
  166. package/dist/NumberField.css +103 -103
  167. package/dist/NumberField.mjs +114 -114
  168. package/dist/Picker.cjs +273 -271
  169. package/dist/Picker.cjs.map +1 -1
  170. package/dist/Picker.css +169 -169
  171. package/dist/Picker.css.map +1 -1
  172. package/dist/Picker.mjs +273 -271
  173. package/dist/Picker.mjs.map +1 -1
  174. package/dist/Popover.cjs +85 -85
  175. package/dist/Popover.css +66 -66
  176. package/dist/Popover.mjs +85 -85
  177. package/dist/ProgressBar.cjs +163 -163
  178. package/dist/ProgressBar.css +103 -103
  179. package/dist/ProgressBar.mjs +163 -163
  180. package/dist/ProgressCircle.cjs +17 -17
  181. package/dist/ProgressCircle.css +17 -17
  182. package/dist/ProgressCircle.mjs +17 -17
  183. package/dist/Provider.cjs +10 -10
  184. package/dist/Provider.css +9 -9
  185. package/dist/Provider.mjs +10 -10
  186. package/dist/Radio.cjs +144 -144
  187. package/dist/Radio.css +81 -81
  188. package/dist/Radio.mjs +144 -144
  189. package/dist/RadioGroup.cjs +41 -41
  190. package/dist/RadioGroup.css +41 -41
  191. package/dist/RadioGroup.mjs +41 -41
  192. package/dist/SearchField.cjs +41 -41
  193. package/dist/SearchField.css +49 -49
  194. package/dist/SearchField.mjs +41 -41
  195. package/dist/SegmentedControl.cjs +171 -171
  196. package/dist/SegmentedControl.css +120 -120
  197. package/dist/SegmentedControl.mjs +171 -171
  198. package/dist/Slider.cjs +288 -288
  199. package/dist/Slider.css +152 -152
  200. package/dist/Slider.mjs +288 -288
  201. package/dist/StatusLight.cjs +115 -115
  202. package/dist/StatusLight.css +63 -63
  203. package/dist/StatusLight.mjs +115 -115
  204. package/dist/Switch.cjs +152 -152
  205. package/dist/Switch.css +76 -76
  206. package/dist/Switch.mjs +152 -152
  207. package/dist/TableView.cjs +310 -310
  208. package/dist/TableView.css +172 -172
  209. package/dist/TableView.mjs +310 -310
  210. package/dist/Tabs.cjs +113 -110
  211. package/dist/Tabs.cjs.map +1 -1
  212. package/dist/Tabs.css +92 -92
  213. package/dist/Tabs.css.map +1 -1
  214. package/dist/Tabs.mjs +113 -110
  215. package/dist/Tabs.mjs.map +1 -1
  216. package/dist/TabsPicker.cjs +123 -123
  217. package/dist/TabsPicker.css +112 -112
  218. package/dist/TabsPicker.mjs +123 -123
  219. package/dist/TagGroup.cjs +202 -202
  220. package/dist/TagGroup.cjs.map +1 -1
  221. package/dist/TagGroup.css +147 -147
  222. package/dist/TagGroup.css.map +1 -1
  223. package/dist/TagGroup.mjs +202 -202
  224. package/dist/TagGroup.mjs.map +1 -1
  225. package/dist/TextField.cjs +57 -57
  226. package/dist/TextField.css +57 -57
  227. package/dist/TextField.mjs +57 -57
  228. package/dist/Toast.cjs +118 -118
  229. package/dist/Toast.css +105 -105
  230. package/dist/Toast.mjs +118 -118
  231. package/dist/ToggleButton.cjs +3 -3
  232. package/dist/ToggleButton.css +12 -12
  233. package/dist/ToggleButton.mjs +3 -3
  234. package/dist/Tooltip.cjs +81 -81
  235. package/dist/Tooltip.css +68 -68
  236. package/dist/Tooltip.mjs +81 -81
  237. package/dist/TreeView.cjs +143 -149
  238. package/dist/TreeView.cjs.map +1 -1
  239. package/dist/TreeView.css +143 -143
  240. package/dist/TreeView.css.map +1 -1
  241. package/dist/TreeView.mjs +143 -149
  242. package/dist/TreeView.mjs.map +1 -1
  243. package/dist/types.d.ts +2 -2
  244. package/dist/types.d.ts.map +1 -1
  245. package/icons/Icon.cjs +10 -10
  246. package/icons/Icon.css +9 -9
  247. package/icons/Icon.mjs +10 -10
  248. package/icons/Skeleton.cjs +2 -2
  249. package/icons/Skeleton.cjs.map +1 -1
  250. package/icons/Skeleton.css +6 -6
  251. package/icons/Skeleton.mjs +2 -2
  252. package/icons/Skeleton.mjs.map +1 -1
  253. package/package.json +45 -26
  254. package/src/ActionButton.tsx +1 -1
  255. package/src/Button.tsx +3 -3
  256. package/src/ComboBox.tsx +3 -2
  257. package/src/ContextualHelp.tsx +2 -2
  258. package/src/Picker.tsx +3 -2
  259. package/src/Tabs.tsx +7 -5
  260. package/src/TagGroup.tsx +1 -1
  261. package/src/TreeView.tsx +1 -6
  262. package/style/__tests__/style-macro.test.js +56 -56
@@ -1 +1 @@
1
- {"mappings":"ACgEyB;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;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8NQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAGb;;;;EAAA;;;;EAIA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA3OK;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA","sources":["2931924df01dc677","packages/@react-spectrum/s2/src/ActionButton.tsx"],"sourcesContent":["@import \"3cf237010a171787\";\n@import \"c38bef69f8745925\";\n@import \"3059048d79d64c86\";\n@import \"9bc41819d7d08688\";\n@import \"013b65d3da939c1f\";\n@import \"972afc4b5ba1159d\";\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 {ActionButtonGroupContext} from './ActionButtonGroup';\nimport {AvatarContext} from './Avatar';\nimport {baseColor, focusRing, fontRelative, lightDark, style} from '../style' with { type: 'macro' };\nimport {ButtonProps, ButtonRenderProps, ContextValue, OverlayTriggerStateContext, Provider, Button as RACButton, useSlottedContext} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {control, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with { type: 'macro' };\nimport {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport {NotificationBadgeContext} from './NotificationBadge';\nimport {pressScale} from './pressScale';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionButtonStyleProps {\n /**\n * The size of the ActionButton.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the ActionButton appears over a color background. */\n staticColor?: 'black' | 'white' | 'auto',\n /** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */\n isQuiet?: boolean\n}\n\ninterface ToggleButtonStyleProps {\n /** Whether the ActionButton should be selected (controlled). */\n isSelected?: boolean,\n /** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */\n isEmphasized?: boolean\n}\n\ninterface ActionGroupItemStyleProps {\n density?: 'regular' | 'compact',\n orientation?: 'horizontal' | 'vertical',\n isJustified?: boolean\n}\n\nexport interface ActionButtonProps extends Omit<ButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange' | 'isPending' | 'onClick'>, StyleProps, ActionButtonStyleProps {\n /** The content to display in the ActionButton. */\n children: ReactNode\n}\n\n// These styles handle both ActionButton and ToggleButton\nconst iconOnly = ':has([slot=icon], [slot=avatar]):not(:has([data-rsp-slot=text]))';\nconst textOnly = ':has([data-rsp-slot=text]):not(:has([slot=icon], [slot=avatar]))';\nconst controlStyle = control({shape: 'default', icon: true});\nexport const btnStyles = style<ButtonRenderProps & ActionButtonStyleProps & ToggleButtonStyleProps & ActionGroupItemStyleProps & {isInGroup: boolean, isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n ...controlStyle,\n justifyContent: 'center',\n flexShrink: {\n default: 1,\n isInGroup: 0\n },\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n fontWeight: 'medium',\n userSelect: 'none',\n transition: 'default',\n forcedColorAdjust: 'none',\n backgroundColor: {\n default: {\n ...baseColor('gray-100'),\n default: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isSelected: {\n default: baseColor('neutral'),\n isEmphasized: {\n default: lightDark('accent-900', 'accent-700'),\n isHovered: lightDark('accent-1000', 'accent-600'),\n isPressed: lightDark('accent-1000', 'accent-600'),\n isFocused: lightDark('accent-1000', 'accent-600')\n },\n isDisabled: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isStaticColor: {\n ...baseColor('transparent-overlay-100'),\n default: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n },\n isSelected: {\n default: baseColor('transparent-overlay-800'),\n isDisabled: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n }\n }\n },\n forcedColors: {\n default: 'ButtonFace',\n isSelected: {\n default: 'Highlight',\n isDisabled: 'ButtonFace'\n }\n }\n },\n color: {\n default: baseColor('neutral'),\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n isStaticColor: {\n default: baseColor('transparent-overlay-800'),\n isSelected: 'auto',\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: {\n default: 'GrayText'\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n outlineColor: {\n default: 'focus-ring',\n isStaticColor: 'transparent-overlay-1000',\n forcedColors: 'Highlight'\n },\n borderStyle: 'none',\n borderTopStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':first-child': controlStyle.borderRadius\n }\n }\n },\n borderTopEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':last-child': controlStyle.borderRadius\n },\n vertical: {\n ':first-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':first-child': controlStyle.borderRadius\n },\n vertical: {\n ':last-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':last-child': controlStyle.borderRadius\n }\n }\n },\n zIndex: {\n isFocusVisible: 2\n },\n disableTapHighlight: true,\n '--badgeTop': {\n type: 'top',\n value: {\n default: 'calc(self(height)/2 - var(--iconWidth)/2)',\n [textOnly]: 0\n }\n },\n '--iconWidth': {\n type: 'width',\n value: fontRelative(20)\n },\n '--badgePosition': {\n type: 'width',\n value: {\n default: 'calc(self(paddingStart) + var(--iconWidth))',\n [iconOnly]: 'calc(self(minWidth)/2 + var(--iconWidth)/2)',\n [textOnly]: 'full'\n }\n }\n}, getAllowedOverrides());\n\n// Matching icon sizes. TBD.\nconst avatarSize = {\n XS: 14,\n S: 16,\n M: 20,\n L: 22,\n X: 26\n} as const;\n\nexport const ActionButtonContext = createContext<ContextValue<Partial<ActionButtonProps>, FocusableRefValue<HTMLButtonElement>>>(null);\n\n/**\n * ActionButtons allow users to perform an action.\n * They're used for similar, task-based options within a workflow, and are ideal for interfaces where buttons aren't meant to draw a lot of attention.\n */\nexport const ActionButton = forwardRef(function ActionButton(props: ActionButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionButtonContext);\n props = useFormProps(props as any);\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n let ctx = useSlottedContext(ActionButtonGroupContext);\n let isInGroup = !!ctx;\n let {\n density = 'regular',\n isJustified,\n orientation = 'horizontal',\n staticColor = props.staticColor,\n isQuiet = props.isQuiet,\n size = props.size || 'M',\n isDisabled = props.isDisabled\n } = ctx || {};\n\n\n return (\n <RACButton\n {...props}\n isDisabled={isDisabled}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + btnStyles({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n staticColor,\n isStaticColor: !!staticColor,\n size,\n isQuiet,\n density,\n isJustified,\n orientation,\n isInGroup\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({marginStart: '--iconMargin', flexShrink: 0, order: 0})\n }],\n [NotificationBadgeContext, {\n staticColor: staticColor,\n size: props.size === 'XS' ? undefined : props.size,\n isDisabled: props.isDisabled,\n styles: style({position: 'absolute', top: '--badgeTop', insetStart: '--badgePosition', marginTop: 'calc((self(height) * -1)/2)', marginStart: 'calc((self(height) * -1)/2)'})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACButton>\n );\n});\n"],"names":[],"version":3,"file":"ActionButton.css.map"}
1
+ {"mappings":"ACgEyB;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;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8NQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAGb;;;;EAAA;;;;EAIA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA3OK;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA","sources":["2931924df01dc677","packages/@react-spectrum/s2/src/ActionButton.tsx"],"sourcesContent":["@import \"3cf237010a171787\";\n@import \"c38bef69f8745925\";\n@import \"3059048d79d64c86\";\n@import \"9bc41819d7d08688\";\n@import \"013b65d3da939c1f\";\n@import \"972afc4b5ba1159d\";\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 {ActionButtonGroupContext} from './ActionButtonGroup';\nimport {AvatarContext} from './Avatar';\nimport {baseColor, focusRing, fontRelative, lightDark, style} from '../style' with { type: 'macro' };\nimport {ButtonProps, ButtonRenderProps, ContextValue, OverlayTriggerStateContext, Provider, Button as RACButton, useSlottedContext} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {control, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with { type: 'macro' };\nimport {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport {NotificationBadgeContext} from './NotificationBadge';\nimport {pressScale} from './pressScale';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionButtonStyleProps {\n /**\n * The size of the ActionButton.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the ActionButton appears over a color background. */\n staticColor?: 'black' | 'white' | 'auto',\n /** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */\n isQuiet?: boolean\n}\n\ninterface ToggleButtonStyleProps {\n /** Whether the ActionButton should be selected (controlled). */\n isSelected?: boolean,\n /** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */\n isEmphasized?: boolean\n}\n\ninterface ActionGroupItemStyleProps {\n density?: 'regular' | 'compact',\n orientation?: 'horizontal' | 'vertical',\n isJustified?: boolean\n}\n\nexport interface ActionButtonProps extends Omit<ButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange' | 'isPending' | 'onClick'>, StyleProps, ActionButtonStyleProps {\n /** The content to display in the ActionButton. */\n children: ReactNode\n}\n\n// These styles handle both ActionButton and ToggleButton\nconst iconOnly = ':has([slot=icon], [slot=avatar]):not(:has([data-rsp-slot=text]))';\nconst textOnly = ':has([data-rsp-slot=text]):not(:has([slot=icon], [slot=avatar]))';\nconst controlStyle = control({shape: 'default', icon: true});\nexport const btnStyles = style<ButtonRenderProps & ActionButtonStyleProps & ToggleButtonStyleProps & ActionGroupItemStyleProps & {isInGroup: boolean, isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n ...controlStyle,\n justifyContent: 'center',\n flexShrink: {\n default: 1,\n isInGroup: 0\n },\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n fontWeight: 'medium',\n userSelect: 'none',\n transition: 'default',\n forcedColorAdjust: 'none',\n backgroundColor: {\n default: {\n ...baseColor('gray-100'),\n default: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isSelected: {\n default: baseColor('neutral'),\n isEmphasized: {\n default: lightDark('accent-900', 'accent-700'),\n isHovered: lightDark('accent-1000', 'accent-600'),\n isPressed: lightDark('accent-1000', 'accent-600'),\n isFocusVisible: lightDark('accent-1000', 'accent-600')\n },\n isDisabled: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isStaticColor: {\n ...baseColor('transparent-overlay-100'),\n default: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n },\n isSelected: {\n default: baseColor('transparent-overlay-800'),\n isDisabled: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n }\n }\n },\n forcedColors: {\n default: 'ButtonFace',\n isSelected: {\n default: 'Highlight',\n isDisabled: 'ButtonFace'\n }\n }\n },\n color: {\n default: baseColor('neutral'),\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n isStaticColor: {\n default: baseColor('transparent-overlay-800'),\n isSelected: 'auto',\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: {\n default: 'GrayText'\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n outlineColor: {\n default: 'focus-ring',\n isStaticColor: 'transparent-overlay-1000',\n forcedColors: 'Highlight'\n },\n borderStyle: 'none',\n borderTopStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':first-child': controlStyle.borderRadius\n }\n }\n },\n borderTopEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':last-child': controlStyle.borderRadius\n },\n vertical: {\n ':first-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':first-child': controlStyle.borderRadius\n },\n vertical: {\n ':last-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':last-child': controlStyle.borderRadius\n }\n }\n },\n zIndex: {\n isFocusVisible: 2\n },\n disableTapHighlight: true,\n '--badgeTop': {\n type: 'top',\n value: {\n default: 'calc(self(height)/2 - var(--iconWidth)/2)',\n [textOnly]: 0\n }\n },\n '--iconWidth': {\n type: 'width',\n value: fontRelative(20)\n },\n '--badgePosition': {\n type: 'width',\n value: {\n default: 'calc(self(paddingStart) + var(--iconWidth))',\n [iconOnly]: 'calc(self(minWidth)/2 + var(--iconWidth)/2)',\n [textOnly]: 'full'\n }\n }\n}, getAllowedOverrides());\n\n// Matching icon sizes. TBD.\nconst avatarSize = {\n XS: 14,\n S: 16,\n M: 20,\n L: 22,\n X: 26\n} as const;\n\nexport const ActionButtonContext = createContext<ContextValue<Partial<ActionButtonProps>, FocusableRefValue<HTMLButtonElement>>>(null);\n\n/**\n * ActionButtons allow users to perform an action.\n * They're used for similar, task-based options within a workflow, and are ideal for interfaces where buttons aren't meant to draw a lot of attention.\n */\nexport const ActionButton = forwardRef(function ActionButton(props: ActionButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionButtonContext);\n props = useFormProps(props as any);\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n let ctx = useSlottedContext(ActionButtonGroupContext);\n let isInGroup = !!ctx;\n let {\n density = 'regular',\n isJustified,\n orientation = 'horizontal',\n staticColor = props.staticColor,\n isQuiet = props.isQuiet,\n size = props.size || 'M',\n isDisabled = props.isDisabled\n } = ctx || {};\n\n\n return (\n <RACButton\n {...props}\n isDisabled={isDisabled}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + btnStyles({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n staticColor,\n isStaticColor: !!staticColor,\n size,\n isQuiet,\n density,\n isJustified,\n orientation,\n isInGroup\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({marginStart: '--iconMargin', flexShrink: 0, order: 0})\n }],\n [NotificationBadgeContext, {\n staticColor: staticColor,\n size: props.size === 'XS' ? undefined : props.size,\n isDisabled: props.isDisabled,\n styles: style({position: 'absolute', top: '--badgeTop', insetStart: '--badgePosition', marginTop: 'calc((self(height) * -1)/2)', marginStart: 'calc((self(height) * -1)/2)'})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACButton>\n );\n});\n"],"names":[],"version":3,"file":"ActionButton.css.map"}
@@ -118,236 +118,236 @@ const $da878a05ab4a403e$export$446543cff2a0f496 = function anonymous(props, over
118
118
  if (p[1] === "_9") zIndex = true;
119
119
  rules += p[0];
120
120
  }
121
- if (props.isFocusVisible) rules += ' _Lf9';
122
- else rules += ' _Le9';
123
- if (props.isStaticColor) rules += ' Oe9';
124
- else rules += ' Oh9';
125
- rules += ' Olc9';
126
- rules += ' _Mc9';
127
- rules += ' _Kd9';
128
- if (props.staticColor === "white") rules += ' -Ovbhqd-gcwrnr9';
129
- else if (props.staticColor === "black") rules += ' -Ovbhqd-g4hn3s9';
121
+ if (props.isFocusVisible) rules += ' _Lf91';
122
+ else rules += ' _Le91';
123
+ if (props.isStaticColor) rules += ' Oe91';
124
+ else rules += ' Oh91';
125
+ rules += ' Olc91';
126
+ rules += ' _Mc91';
127
+ rules += ' _Kd91';
128
+ if (props.staticColor === "white") rules += ' -Ovbhqd-gcwrnr91';
129
+ else if (props.staticColor === "black") rules += ' -Ovbhqd-g4hn3s91';
130
130
  if (props.size === "XL") {
131
- rules += ' ug9';
132
- rules += ' uch9';
133
- rules += ' udi9';
134
- rules += ' uea9';
135
- rules += ' ugb9';
136
- rules += ' uhd9';
137
- rules += ' uje9';
138
- rules += ' uic9';
131
+ rules += ' ug91';
132
+ rules += ' uch91';
133
+ rules += ' udi91';
134
+ rules += ' uea91';
135
+ rules += ' ugb91';
136
+ rules += ' uhd91';
137
+ rules += ' uje91';
138
+ rules += ' uic91';
139
139
  } else if (props.size === "L") {
140
- rules += ' ug9';
141
- rules += ' uch9';
142
- rules += ' udi9';
143
- rules += ' uea9';
144
- rules += ' ugb9';
145
- rules += ' uhd9';
146
- rules += ' uje9';
147
- rules += ' uic9';
140
+ rules += ' ug91';
141
+ rules += ' uch91';
142
+ rules += ' udi91';
143
+ rules += ' uea91';
144
+ rules += ' ugb91';
145
+ rules += ' uhd91';
146
+ rules += ' uje91';
147
+ rules += ' uic91';
148
148
  } else if (props.size === "S") {
149
- rules += ' ug9';
150
- rules += ' uch9';
151
- rules += ' udi9';
152
- rules += ' uea9';
153
- rules += ' ugb9';
154
- rules += ' uhd9';
155
- rules += ' uje9';
156
- rules += ' uic9';
149
+ rules += ' ug91';
150
+ rules += ' uch91';
151
+ rules += ' udi91';
152
+ rules += ' uea91';
153
+ rules += ' ugb91';
154
+ rules += ' uhd91';
155
+ rules += ' uje91';
156
+ rules += ' uic91';
157
157
  } else if (props.size === "XS") {
158
- rules += ' ug9';
159
- rules += ' uch9';
160
- rules += ' udi9';
161
- rules += ' uea9';
162
- rules += ' ugb9';
163
- rules += ' uhd9';
164
- rules += ' uje9';
165
- rules += ' uic9';
158
+ rules += ' ug91';
159
+ rules += ' uch91';
160
+ rules += ' udi91';
161
+ rules += ' uea91';
162
+ rules += ' ugb91';
163
+ rules += ' uhd91';
164
+ rules += ' uje91';
165
+ rules += ' uic91';
166
166
  } else {
167
- rules += ' ug9';
168
- rules += ' uch9';
169
- rules += ' udi9';
170
- rules += ' uea9';
171
- rules += ' ugb9';
172
- rules += ' uhd9';
173
- rules += ' uje9';
174
- rules += ' uic9';
167
+ rules += ' ug91';
168
+ rules += ' uch91';
169
+ rules += ' udi91';
170
+ rules += ' uea91';
171
+ rules += ' ugb91';
172
+ rules += ' uhd91';
173
+ rules += ' uje91';
174
+ rules += ' uic91';
175
175
  }
176
176
  if (props.size === "XL") {
177
- rules += ' vg9';
178
- rules += ' vsj9';
177
+ rules += ' vg91';
178
+ rules += ' vsj91';
179
179
  } else if (props.size === "L") {
180
- rules += ' vp9';
181
- rules += ' vsh9';
180
+ rules += ' vp91';
181
+ rules += ' vsh91';
182
182
  } else if (props.size === "S") {
183
- rules += ' vb9';
184
- rules += ' vse9';
183
+ rules += ' vb91';
184
+ rules += ' vse91';
185
185
  } else if (props.size === "XS") {
186
- rules += ' va9';
187
- rules += ' vsc9';
186
+ rules += ' va91';
187
+ rules += ' vsc91';
188
188
  } else {
189
- rules += ' vd9';
190
- rules += ' vsf9';
189
+ rules += ' vd91';
190
+ rules += ' vsf91';
191
191
  }
192
- rules += ' wc9';
193
- rules += ' xc9';
194
- rules += ' _xa9';
192
+ rules += ' wc91';
193
+ rules += ' xc91';
194
+ rules += ' _xa91';
195
195
  if (props.size === "XL") {
196
- rules += ' _Fa9';
197
- rules += ' _Ffb9';
196
+ rules += ' _Fa91';
197
+ rules += ' _Ffb91';
198
198
  } else if (props.size === "L") {
199
- rules += ' _Fa9';
200
- rules += ' _Ffb9';
199
+ rules += ' _Fa91';
200
+ rules += ' _Ffb91';
201
201
  } else if (props.size === "S") {
202
- rules += ' _Fa9';
203
- rules += ' _Ffb9';
202
+ rules += ' _Fa91';
203
+ rules += ' _Ffb91';
204
204
  } else if (props.size === "XS") {
205
- rules += ' _Fa9';
206
- rules += ' _Ffb9';
205
+ rules += ' _Fa91';
206
+ rules += ' _Ffb91';
207
207
  } else {
208
- rules += ' _Fa9';
209
- rules += ' _Ffb9';
208
+ rules += ' _Fa91';
209
+ rules += ' _Ffb91';
210
210
  }
211
211
  if (props.isStaticColor) {
212
- if (props.isDisabled) rules += ' pi9';
213
- else if (props.isSelected) rules += ' ph9';
212
+ if (props.isDisabled) rules += ' pi91';
213
+ else if (props.isSelected) rules += ' ph91';
214
214
  else {
215
- if (props.isPressed) rules += ' pk9';
216
- else if (props.isFocusVisible) rules += ' pk9';
217
- else if (props.isHovered) rules += ' pk9';
218
- else rules += ' pj9';
215
+ if (props.isPressed) rules += ' pk91';
216
+ else if (props.isFocusVisible) rules += ' pk91';
217
+ else if (props.isHovered) rules += ' pk91';
218
+ else rules += ' pj91';
219
219
  }
220
- } else if (props.isDisabled) rules += ' pp9';
220
+ } else if (props.isDisabled) rules += ' pp91';
221
221
  else if (props.isSelected) {
222
- if (props.isEmphasized) rules += ' px9';
223
- else rules += ' pr9';
222
+ if (props.isEmphasized) rules += ' px91';
223
+ else rules += ' pr91';
224
224
  } else {
225
- if (props.isPressed) rules += ' po9';
226
- else if (props.isFocusVisible) rules += ' po9';
227
- else if (props.isHovered) rules += ' po9';
228
- else rules += ' pt9';
225
+ if (props.isPressed) rules += ' po91';
226
+ else if (props.isFocusVisible) rules += ' po91';
227
+ else if (props.isHovered) rules += ' po91';
228
+ else rules += ' pt91';
229
229
  }
230
- if (props.isDisabled) rules += ' plc9';
231
- else if (props.isSelected) rules += ' ple9';
232
- else rules += ' plb9';
233
- rules += ' sd9';
234
- rules += ' eb9';
235
- rules += ' _oa9';
236
- rules += ' SMBFGYc9';
237
- rules += ' Rv9';
238
- rules += ' RgLWx3bd9';
239
- if (!minWidth) rules += ' N7yFGYc9';
240
- if (props.size === "XL") rules += ' -SFnbic-_JaP8ec9';
241
- else if (props.size === "L") rules += ' -SFnbic-_J0K2hn9';
242
- else if (props.size === "S") rules += ' -SFnbic-_JJOW22b9';
243
- else if (props.size === "XS") rules += ' -SFnbic-_JICefdd9';
244
- else rules += ' -SFnbic-_Jb9';
245
- rules += ' -Bu7z1c-ob9';
230
+ if (props.isDisabled) rules += ' plc91';
231
+ else if (props.isSelected) rules += ' ple91';
232
+ else rules += ' plb91';
233
+ rules += ' sd91';
234
+ rules += ' eb91';
235
+ rules += ' _oa91';
236
+ rules += ' SMBFGYc91';
237
+ rules += ' Rv91';
238
+ rules += ' RgLWx3bd91';
239
+ if (!minWidth) rules += ' N7yFGYc91';
240
+ if (props.size === "XL") rules += ' -SFnbic-_JaP8ec91';
241
+ else if (props.size === "L") rules += ' -SFnbic-_J0K2hn91';
242
+ else if (props.size === "S") rules += ' -SFnbic-_JJOW22b91';
243
+ else if (props.size === "XS") rules += ' -SFnbic-_JICefdd91';
244
+ else rules += ' -SFnbic-_Jb91';
245
+ rules += ' -Bu7z1c-ob91';
246
246
  if (props.density === "compact") {
247
- rules += ' od9';
248
- rules += ' obj9';
249
- } else rules += ' oj9';
247
+ rules += ' od91';
248
+ rules += ' obj91';
249
+ } else rules += ' oj91';
250
250
  if (props.density === "compact") {
251
- if (props.orientation === "vertical") rules += ' nbj9';
252
- else if (props.orientation === "horizontal") rules += ' nkj9';
253
- else rules += ' nd9';
254
- } else rules += ' nj9';
251
+ if (props.orientation === "vertical") rules += ' nbj91';
252
+ else if (props.orientation === "horizontal") rules += ' nkj91';
253
+ else rules += ' nd91';
254
+ } else rules += ' nj91';
255
255
  if (props.density === "compact") {
256
- if (props.orientation === "vertical") rules += ' kkj9';
257
- else if (props.orientation === "horizontal") rules += ' kbj9';
258
- else rules += ' kd9';
259
- } else rules += ' kj9';
256
+ if (props.orientation === "vertical") rules += ' kkj91';
257
+ else if (props.orientation === "horizontal") rules += ' kbj91';
258
+ else rules += ' kd91';
259
+ } else rules += ' kj91';
260
260
  if (props.density === "compact") {
261
- rules += ' jd9';
262
- rules += ' jkj9';
263
- } else rules += ' jj9';
264
- rules += ' qc9';
265
- rules += ' qsd9';
266
- rules += ' -Qg41Lb-IAxCW0c9';
267
- rules += ' -Qg41Lb-gLWx3bIy9';
268
- rules += ' FRuFGYc9';
269
- rules += ' _Ca9';
261
+ rules += ' jd91';
262
+ rules += ' jkj91';
263
+ } else rules += ' jj91';
264
+ rules += ' qc91';
265
+ rules += ' qsd91';
266
+ rules += ' -Qg41Lb-IAxCW0c91';
267
+ rules += ' -Qg41Lb-gLWx3bIy91';
268
+ rules += ' FRuFGYc91';
269
+ rules += ' _Ca91';
270
270
  if (props.isInGroup) {
271
- if (!flexShrink) rules += ' _va9';
272
- } else if (!flexShrink) rules += ' _vb9';
271
+ if (!flexShrink) rules += ' _va91';
272
+ } else if (!flexShrink) rules += ' _vb91';
273
273
  if (props.isJustified) {
274
- if (!flexGrow) rules += ' _ub9';
274
+ if (!flexGrow) rules += ' _ub91';
275
275
  }
276
276
  if (props.isJustified) {
277
- if (!flexBasis) rules += ' _sb9';
277
+ if (!flexBasis) rules += ' _sb91';
278
278
  }
279
- rules += ' _4c9';
280
- rules += ' Yd9';
281
- rules += ' Xb9';
282
- rules += ' _2b9';
283
- rules += ' _yb9';
284
- rules += ' gqMFGYc9';
285
- rules += ' -_8sjo0b-t5ZbAob9';
286
- rules += ' _je9';
279
+ rules += ' _4c91';
280
+ rules += ' Yd91';
281
+ rules += ' Xb91';
282
+ rules += ' _2b91';
283
+ rules += ' _yb91';
284
+ rules += ' gqMFGYc91';
285
+ rules += ' -_8sjo0b-t5ZbAob91';
286
+ rules += ' _je91';
287
287
  if (props.isFocusVisible) {
288
- if (!zIndex) rules += ' _9d9';
288
+ if (!zIndex) rules += ' _9d91';
289
289
  }
290
- rules += ' __ca9';
291
- rules += ' -B5H9Ae-WXN7eQb9';
292
- rules += ' -B5H9Ae-wAP22cWr9';
293
- rules += ' -SqFa4c-ZuUmpre9';
294
- rules += ' -dcAs1c-ZaYffXd9';
295
- rules += ' -dcAs1c-y5UFLdZt9HF59';
296
- rules += ' -dcAs1c-wAP22cZa9';
297
- if (props.size === "XL") rules += ' -F_-Fz9';
298
- else if (props.size === "L") rules += ' -F_-Fv9';
299
- else if (props.size === "S") rules += ' -F_-Fp9';
300
- else if (props.size === "XS") rules += ' -F_-Fn9';
301
- else rules += ' -F_-Fx9';
290
+ rules += ' __ca91';
291
+ rules += ' -B5H9Ae-WXN7eQb91';
292
+ rules += ' -B5H9Ae-wAP22cWr91';
293
+ rules += ' -SqFa4c-ZuUmpre91';
294
+ rules += ' -dcAs1c-ZaYffXd91';
295
+ rules += ' -dcAs1c-y5UFLdZt9HF591';
296
+ rules += ' -dcAs1c-wAP22cZa91';
297
+ if (props.size === "XL") rules += ' -F_-Fz91';
298
+ else if (props.size === "L") rules += ' -F_-Fv91';
299
+ else if (props.size === "S") rules += ' -F_-Fp91';
300
+ else if (props.size === "XS") rules += ' -F_-Fn91';
301
+ else rules += ' -F_-Fx91';
302
302
  if (props.isStaticColor) {
303
303
  if (props.isSelected) {
304
304
  if (props.isDisabled) {
305
- if (props.isQuiet) rules += ' -g_-g99';
306
- else rules += ' -g_-gf9';
305
+ if (props.isQuiet) rules += ' -g_-g991';
306
+ else rules += ' -g_-gf91';
307
307
  } else {
308
- if (props.isPressed) rules += ' -g_-gj9';
309
- else if (props.isFocusVisible) rules += ' -g_-gj9';
310
- else if (props.isHovered) rules += ' -g_-gj9';
311
- else rules += ' -g_-gi9';
308
+ if (props.isPressed) rules += ' -g_-gj91';
309
+ else if (props.isFocusVisible) rules += ' -g_-gj91';
310
+ else if (props.isHovered) rules += ' -g_-gj91';
311
+ else rules += ' -g_-gi91';
312
312
  }
313
- } else if (props.isPressed) rules += ' -g_-gg9';
314
- else if (props.isFocusVisible) rules += ' -g_-gg9';
315
- else if (props.isHovered) rules += ' -g_-gg9';
316
- else if (props.isQuiet) rules += ' -g_-g99';
317
- else rules += ' -g_-gf9';
313
+ } else if (props.isPressed) rules += ' -g_-gg91';
314
+ else if (props.isFocusVisible) rules += ' -g_-gg91';
315
+ else if (props.isHovered) rules += ' -g_-gg91';
316
+ else if (props.isQuiet) rules += ' -g_-g991';
317
+ else rules += ' -g_-gf91';
318
318
  } else if (props.isSelected) {
319
319
  if (props.isDisabled) {
320
- if (props.isQuiet) rules += ' -g_-g99';
321
- else rules += ' -g_-gH9';
320
+ if (props.isQuiet) rules += ' -g_-g991';
321
+ else rules += ' -g_-gH91';
322
322
  } else if (props.isEmphasized) {
323
- if (props.isFocused) rules += ' -g_-gUgARdd9';
324
- else if (props.isPressed) rules += ' -g_-gUgARdd9';
325
- else if (props.isHovered) rules += ' -g_-gUgARdd9';
326
- else rules += ' -g_-g5qAiPc9';
323
+ if (props.isFocusVisible) rules += ' -g_-gUgARdd91';
324
+ else if (props.isPressed) rules += ' -g_-gUgARdd91';
325
+ else if (props.isHovered) rules += ' -g_-gUgARdd91';
326
+ else rules += ' -g_-g5qAiPc91';
327
327
  } else {
328
- if (props.isPressed) rules += ' -g_-gu9';
329
- else if (props.isFocusVisible) rules += ' -g_-gu9';
330
- else if (props.isHovered) rules += ' -g_-gu9';
331
- else rules += ' -g_-g09';
328
+ if (props.isPressed) rules += ' -g_-gu91';
329
+ else if (props.isFocusVisible) rules += ' -g_-gu91';
330
+ else if (props.isHovered) rules += ' -g_-gu91';
331
+ else rules += ' -g_-g091';
332
332
  }
333
333
  } else {
334
- if (props.isPressed) rules += ' -g_-gF9';
335
- else if (props.isFocusVisible) rules += ' -g_-gF9';
336
- else if (props.isHovered) rules += ' -g_-gF9';
337
- else if (props.isQuiet) rules += ' -g_-g99';
338
- else rules += ' -g_-gH9';
334
+ if (props.isPressed) rules += ' -g_-gF91';
335
+ else if (props.isFocusVisible) rules += ' -g_-gF91';
336
+ else if (props.isHovered) rules += ' -g_-gF91';
337
+ else if (props.isQuiet) rules += ' -g_-g991';
338
+ else rules += ' -g_-gH91';
339
339
  }
340
340
  if (props.isSelected) {
341
- if (props.isDisabled) rules += ' -g_-lgb9';
342
- else rules += ' -g_-lge9';
343
- } else rules += ' -g_-lgb9';
344
- rules += ' -S_-Sv9';
345
- rules += ' -S_-gLWx3bSd9';
346
- if (props.size === "XL") rules += ' -N_-Nl9';
347
- else if (props.size === "L") rules += ' -N_-Nj9';
348
- else if (props.size === "S") rules += ' -N_-Nf9';
349
- else if (props.size === "XS") rules += ' -N_-Ne9';
350
- else rules += ' -N_-Nk9';
341
+ if (props.isDisabled) rules += ' -g_-lgb91';
342
+ else rules += ' -g_-lge91';
343
+ } else rules += ' -g_-lgb91';
344
+ rules += ' -S_-Sv91';
345
+ rules += ' -S_-gLWx3bSd91';
346
+ if (props.size === "XL") rules += ' -N_-Nl91';
347
+ else if (props.size === "L") rules += ' -N_-Nj91';
348
+ else if (props.size === "S") rules += ' -N_-Nf91';
349
+ else if (props.size === "XS") rules += ' -N_-Ne91';
350
+ else rules += ' -N_-Nk91';
351
351
  return rules;
352
352
  };
353
353
  // Matching icon sizes. TBD.
@@ -394,7 +394,7 @@ const $da878a05ab4a403e$export$cfc7921d29ef7b80 = /*#__PURE__*/ (0, $hl1Zj$forwa
394
394
  [
395
395
  (0, $8e847109a6ab556d$export$9afb8bc826b033ea),
396
396
  {
397
- styles: " _Jb9 _Nc9 Pc9 _Yb9 _7c9"
397
+ styles: " _Jb91 _Nc91 Pc91 _Yb91 _7c91"
398
398
  }
399
399
  ],
400
400
  [
@@ -402,16 +402,16 @@ const $da878a05ab4a403e$export$cfc7921d29ef7b80 = /*#__PURE__*/ (0, $hl1Zj$forwa
402
402
  {
403
403
  render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
404
404
  slot: 'icon',
405
- styles: " _Ja9"
405
+ styles: " _Ja91"
406
406
  }),
407
- styles: " ZuUmpre9 FuUmpre9 I67logd9 _va9"
407
+ styles: " ZuUmpre91 FuUmpre91 I67logd91 _va91"
408
408
  }
409
409
  ],
410
410
  [
411
411
  (0, $3ffa2cd930156220$export$a20dad690e1279e2),
412
412
  {
413
413
  size: $da878a05ab4a403e$var$avatarSize[size],
414
- styles: " I67logd9 _va9 _Ja9"
414
+ styles: " I67logd91 _va91 _Ja91"
415
415
  }
416
416
  ],
417
417
  [
@@ -420,7 +420,7 @@ const $da878a05ab4a403e$export$cfc7921d29ef7b80 = /*#__PURE__*/ (0, $hl1Zj$forwa
420
420
  staticColor: staticColor,
421
421
  size: props.size === 'XS' ? undefined : props.size,
422
422
  isDisabled: props.isDisabled,
423
- styles: " _Pa9 WtedXZc9 _A1IiWH9 JlZStSb9 IlZStSb9"
423
+ styles: " _Pa91 WtedXZc91 _A1IiWH91 JlZStSb91 IlZStSb91"
424
424
  }
425
425
  ]
426
426
  ],
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAkDD,yDAAyD;AACzD,MAAM,iCAAW;AACjB,MAAM,iCAAW;AACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuKb,4BAA4B;AAC5B,MAAM,mCAAa;IACjB,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;AACL;AAEO,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAkF;AAM1H,MAAM,0DAAe,CAAA,GAAA,iBAAS,EAAE,SAAS,aAAa,KAAwB,EAAE,GAAoC;IACzH,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE;IAC7B,IAAI,sBAAsB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,iCAAyB;IAC9D,IAAI,MAAM,CAAA,GAAA,wBAAgB,EAAE,CAAA,GAAA,yCAAuB;IACnD,IAAI,YAAY,CAAC,CAAC;IAClB,IAAI,WACF,UAAU,wBACV,WAAW,eACX,cAAc,2BACd,cAAc,MAAM,WAAW,WAC/B,UAAU,MAAM,OAAO,QACvB,OAAO,MAAM,IAAI,IAAI,iBACrB,aAAa,MAAM,UAAU,EAC9B,GAAG,OAAO,CAAC;IAGZ,qBACE,gBAAC,CAAA,GAAA,aAAQ;QACN,GAAG,KAAK;QACT,YAAY;QACZ,KAAK;QACL,OAAO,CAAA,GAAA,yCAAS,EAAE,QAAQ,MAAM,YAAY;QAC5C,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,0CAAU;gBACnE,GAAG,WAAW;gBACd,+CAA+C;gBAC/C,WAAW,YAAY,SAAS,IAAI,qBAAqB,UAAU;6BACnE;gBACA,eAAe,CAAC,CAAC;sBACjB;yBACA;yBACA;6BACA;6BACA;2BACA;YACF,GAAG,MAAM,MAAM;kBACf,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBAAC,CAAA,GAAA,yCAAc;oBAAG;iBAAK;gBACvB;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBAAC,MAAM;oBAAmC;iBAAE;gBAC1D;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;4BAAC,MAAM;4BAAQ,MAAM;wBAAmB;wBAC/D,MAAM;oBACR;iBAAE;gBACF;oBAAC,CAAA,GAAA,yCAAY;oBAAG;wBACd,MAAM,gCAAU,CAAC,KAAK;wBACtB,MAAM;oBACR;iBAAE;gBACF;oBAAC,CAAA,GAAA,yCAAuB;oBAAG;wBACzB,aAAa;wBACb,MAAM,MAAM,IAAI,KAAK,OAAO,YAAY,MAAM,IAAI;wBAClD,YAAY,MAAM,UAAU;wBAC5B,MAAM;oBACR;iBAAE;aACH;sBACA,OAAO,MAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0BAAG,MAAM,QAAQ;iBAAW,MAAM,QAAQ;;;AAI5F","sources":["packages/@react-spectrum/s2/src/ActionButton.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 {ActionButtonGroupContext} from './ActionButtonGroup';\nimport {AvatarContext} from './Avatar';\nimport {baseColor, focusRing, fontRelative, lightDark, style} from '../style' with { type: 'macro' };\nimport {ButtonProps, ButtonRenderProps, ContextValue, OverlayTriggerStateContext, Provider, Button as RACButton, useSlottedContext} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {control, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with { type: 'macro' };\nimport {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport {NotificationBadgeContext} from './NotificationBadge';\nimport {pressScale} from './pressScale';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionButtonStyleProps {\n /**\n * The size of the ActionButton.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the ActionButton appears over a color background. */\n staticColor?: 'black' | 'white' | 'auto',\n /** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */\n isQuiet?: boolean\n}\n\ninterface ToggleButtonStyleProps {\n /** Whether the ActionButton should be selected (controlled). */\n isSelected?: boolean,\n /** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */\n isEmphasized?: boolean\n}\n\ninterface ActionGroupItemStyleProps {\n density?: 'regular' | 'compact',\n orientation?: 'horizontal' | 'vertical',\n isJustified?: boolean\n}\n\nexport interface ActionButtonProps extends Omit<ButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange' | 'isPending' | 'onClick'>, StyleProps, ActionButtonStyleProps {\n /** The content to display in the ActionButton. */\n children: ReactNode\n}\n\n// These styles handle both ActionButton and ToggleButton\nconst iconOnly = ':has([slot=icon], [slot=avatar]):not(:has([data-rsp-slot=text]))';\nconst textOnly = ':has([data-rsp-slot=text]):not(:has([slot=icon], [slot=avatar]))';\nconst controlStyle = control({shape: 'default', icon: true});\nexport const btnStyles = style<ButtonRenderProps & ActionButtonStyleProps & ToggleButtonStyleProps & ActionGroupItemStyleProps & {isInGroup: boolean, isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n ...controlStyle,\n justifyContent: 'center',\n flexShrink: {\n default: 1,\n isInGroup: 0\n },\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n fontWeight: 'medium',\n userSelect: 'none',\n transition: 'default',\n forcedColorAdjust: 'none',\n backgroundColor: {\n default: {\n ...baseColor('gray-100'),\n default: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isSelected: {\n default: baseColor('neutral'),\n isEmphasized: {\n default: lightDark('accent-900', 'accent-700'),\n isHovered: lightDark('accent-1000', 'accent-600'),\n isPressed: lightDark('accent-1000', 'accent-600'),\n isFocused: lightDark('accent-1000', 'accent-600')\n },\n isDisabled: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isStaticColor: {\n ...baseColor('transparent-overlay-100'),\n default: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n },\n isSelected: {\n default: baseColor('transparent-overlay-800'),\n isDisabled: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n }\n }\n },\n forcedColors: {\n default: 'ButtonFace',\n isSelected: {\n default: 'Highlight',\n isDisabled: 'ButtonFace'\n }\n }\n },\n color: {\n default: baseColor('neutral'),\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n isStaticColor: {\n default: baseColor('transparent-overlay-800'),\n isSelected: 'auto',\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: {\n default: 'GrayText'\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n outlineColor: {\n default: 'focus-ring',\n isStaticColor: 'transparent-overlay-1000',\n forcedColors: 'Highlight'\n },\n borderStyle: 'none',\n borderTopStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':first-child': controlStyle.borderRadius\n }\n }\n },\n borderTopEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':last-child': controlStyle.borderRadius\n },\n vertical: {\n ':first-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':first-child': controlStyle.borderRadius\n },\n vertical: {\n ':last-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':last-child': controlStyle.borderRadius\n }\n }\n },\n zIndex: {\n isFocusVisible: 2\n },\n disableTapHighlight: true,\n '--badgeTop': {\n type: 'top',\n value: {\n default: 'calc(self(height)/2 - var(--iconWidth)/2)',\n [textOnly]: 0\n }\n },\n '--iconWidth': {\n type: 'width',\n value: fontRelative(20)\n },\n '--badgePosition': {\n type: 'width',\n value: {\n default: 'calc(self(paddingStart) + var(--iconWidth))',\n [iconOnly]: 'calc(self(minWidth)/2 + var(--iconWidth)/2)',\n [textOnly]: 'full'\n }\n }\n}, getAllowedOverrides());\n\n// Matching icon sizes. TBD.\nconst avatarSize = {\n XS: 14,\n S: 16,\n M: 20,\n L: 22,\n X: 26\n} as const;\n\nexport const ActionButtonContext = createContext<ContextValue<Partial<ActionButtonProps>, FocusableRefValue<HTMLButtonElement>>>(null);\n\n/**\n * ActionButtons allow users to perform an action.\n * They're used for similar, task-based options within a workflow, and are ideal for interfaces where buttons aren't meant to draw a lot of attention.\n */\nexport const ActionButton = forwardRef(function ActionButton(props: ActionButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionButtonContext);\n props = useFormProps(props as any);\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n let ctx = useSlottedContext(ActionButtonGroupContext);\n let isInGroup = !!ctx;\n let {\n density = 'regular',\n isJustified,\n orientation = 'horizontal',\n staticColor = props.staticColor,\n isQuiet = props.isQuiet,\n size = props.size || 'M',\n isDisabled = props.isDisabled\n } = ctx || {};\n\n\n return (\n <RACButton\n {...props}\n isDisabled={isDisabled}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + btnStyles({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n staticColor,\n isStaticColor: !!staticColor,\n size,\n isQuiet,\n density,\n isJustified,\n orientation,\n isInGroup\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({marginStart: '--iconMargin', flexShrink: 0, order: 0})\n }],\n [NotificationBadgeContext, {\n staticColor: staticColor,\n size: props.size === 'XS' ? undefined : props.size,\n isDisabled: props.isDisabled,\n styles: style({position: 'absolute', top: '--badgeTop', insetStart: '--badgePosition', marginTop: 'calc((self(height) * -1)/2)', marginStart: 'calc((self(height) * -1)/2)'})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACButton>\n );\n});\n"],"names":[],"version":3,"file":"ActionButton.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAkDD,yDAAyD;AACzD,MAAM,iCAAW;AACjB,MAAM,iCAAW;AACjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuKb,4BAA4B;AAC5B,MAAM,mCAAa;IACjB,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;AACL;AAEO,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAkF;AAM1H,MAAM,0DAAe,CAAA,GAAA,iBAAS,EAAE,SAAS,aAAa,KAAwB,EAAE,GAAoC;IACzH,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE;IAC7B,IAAI,sBAAsB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,iCAAyB;IAC9D,IAAI,MAAM,CAAA,GAAA,wBAAgB,EAAE,CAAA,GAAA,yCAAuB;IACnD,IAAI,YAAY,CAAC,CAAC;IAClB,IAAI,WACF,UAAU,wBACV,WAAW,eACX,cAAc,2BACd,cAAc,MAAM,WAAW,WAC/B,UAAU,MAAM,OAAO,QACvB,OAAO,MAAM,IAAI,IAAI,iBACrB,aAAa,MAAM,UAAU,EAC9B,GAAG,OAAO,CAAC;IAGZ,qBACE,gBAAC,CAAA,GAAA,aAAQ;QACN,GAAG,KAAK;QACT,YAAY;QACZ,KAAK;QACL,OAAO,CAAA,GAAA,yCAAS,EAAE,QAAQ,MAAM,YAAY;QAC5C,WAAW,CAAA,cAAe,AAAC,CAAA,MAAM,gBAAgB,IAAI,EAAC,IAAK,0CAAU;gBACnE,GAAG,WAAW;gBACd,+CAA+C;gBAC/C,WAAW,YAAY,SAAS,IAAI,qBAAqB,UAAU;6BACnE;gBACA,eAAe,CAAC,CAAC;sBACjB;yBACA;yBACA;6BACA;6BACA;2BACA;YACF,GAAG,MAAM,MAAM;kBACf,cAAA,gBAAC,CAAA,GAAA,eAAO;YACN,QAAQ;gBACN;oBAAC,CAAA,GAAA,yCAAc;oBAAG;iBAAK;gBACvB;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBAAC,MAAM;oBAAmC;iBAAE;gBAC1D;oBAAC,CAAA,GAAA,yCAAU;oBAAG;wBACZ,QAAQ,CAAA,GAAA,yCAAa,EAAE;4BAAC,MAAM;4BAAQ,MAAM;wBAAmB;wBAC/D,MAAM;oBACR;iBAAE;gBACF;oBAAC,CAAA,GAAA,yCAAY;oBAAG;wBACd,MAAM,gCAAU,CAAC,KAAK;wBACtB,MAAM;oBACR;iBAAE;gBACF;oBAAC,CAAA,GAAA,yCAAuB;oBAAG;wBACzB,aAAa;wBACb,MAAM,MAAM,IAAI,KAAK,OAAO,YAAY,MAAM,IAAI;wBAClD,YAAY,MAAM,UAAU;wBAC5B,MAAM;oBACR;iBAAE;aACH;sBACA,OAAO,MAAM,QAAQ,KAAK,yBAAW,gBAAC,CAAA,GAAA,yCAAG;0BAAG,MAAM,QAAQ;iBAAW,MAAM,QAAQ;;;AAI5F","sources":["packages/@react-spectrum/s2/src/ActionButton.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 {ActionButtonGroupContext} from './ActionButtonGroup';\nimport {AvatarContext} from './Avatar';\nimport {baseColor, focusRing, fontRelative, lightDark, style} from '../style' with { type: 'macro' };\nimport {ButtonProps, ButtonRenderProps, ContextValue, OverlayTriggerStateContext, Provider, Button as RACButton, useSlottedContext} from 'react-aria-components';\nimport {centerBaseline} from './CenterBaseline';\nimport {control, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with { type: 'macro' };\nimport {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {IconContext} from './Icon';\nimport {NotificationBadgeContext} from './NotificationBadge';\nimport {pressScale} from './pressScale';\nimport {SkeletonContext} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useFocusableRef} from '@react-spectrum/utils';\nimport {useFormProps} from './Form';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionButtonStyleProps {\n /**\n * The size of the ActionButton.\n *\n * @default 'M'\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL',\n /** The static color style to apply. Useful when the ActionButton appears over a color background. */\n staticColor?: 'black' | 'white' | 'auto',\n /** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */\n isQuiet?: boolean\n}\n\ninterface ToggleButtonStyleProps {\n /** Whether the ActionButton should be selected (controlled). */\n isSelected?: boolean,\n /** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */\n isEmphasized?: boolean\n}\n\ninterface ActionGroupItemStyleProps {\n density?: 'regular' | 'compact',\n orientation?: 'horizontal' | 'vertical',\n isJustified?: boolean\n}\n\nexport interface ActionButtonProps extends Omit<ButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange' | 'isPending' | 'onClick'>, StyleProps, ActionButtonStyleProps {\n /** The content to display in the ActionButton. */\n children: ReactNode\n}\n\n// These styles handle both ActionButton and ToggleButton\nconst iconOnly = ':has([slot=icon], [slot=avatar]):not(:has([data-rsp-slot=text]))';\nconst textOnly = ':has([data-rsp-slot=text]):not(:has([slot=icon], [slot=avatar]))';\nconst controlStyle = control({shape: 'default', icon: true});\nexport const btnStyles = style<ButtonRenderProps & ActionButtonStyleProps & ToggleButtonStyleProps & ActionGroupItemStyleProps & {isInGroup: boolean, isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n ...controlStyle,\n justifyContent: 'center',\n flexShrink: {\n default: 1,\n isInGroup: 0\n },\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n fontWeight: 'medium',\n userSelect: 'none',\n transition: 'default',\n forcedColorAdjust: 'none',\n backgroundColor: {\n default: {\n ...baseColor('gray-100'),\n default: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isSelected: {\n default: baseColor('neutral'),\n isEmphasized: {\n default: lightDark('accent-900', 'accent-700'),\n isHovered: lightDark('accent-1000', 'accent-600'),\n isPressed: lightDark('accent-1000', 'accent-600'),\n isFocusVisible: lightDark('accent-1000', 'accent-600')\n },\n isDisabled: {\n default: 'gray-100',\n isQuiet: 'transparent'\n }\n },\n isStaticColor: {\n ...baseColor('transparent-overlay-100'),\n default: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n },\n isSelected: {\n default: baseColor('transparent-overlay-800'),\n isDisabled: {\n default: 'transparent-overlay-100',\n isQuiet: 'transparent'\n }\n }\n },\n forcedColors: {\n default: 'ButtonFace',\n isSelected: {\n default: 'Highlight',\n isDisabled: 'ButtonFace'\n }\n }\n },\n color: {\n default: baseColor('neutral'),\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n isStaticColor: {\n default: baseColor('transparent-overlay-800'),\n isSelected: 'auto',\n isDisabled: 'transparent-overlay-400'\n },\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: {\n default: 'GrayText'\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n outlineColor: {\n default: 'focus-ring',\n isStaticColor: 'transparent-overlay-1000',\n forcedColors: 'Highlight'\n },\n borderStyle: 'none',\n borderTopStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':first-child': controlStyle.borderRadius\n }\n }\n },\n borderTopEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':last-child': controlStyle.borderRadius\n },\n vertical: {\n ':first-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomStartRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':first-child': controlStyle.borderRadius\n },\n vertical: {\n ':last-child': controlStyle.borderRadius\n }\n }\n }\n }\n },\n borderBottomEndRadius: {\n default: controlStyle.borderRadius,\n density: {\n compact: {\n default: 'none',\n ':last-child': controlStyle.borderRadius\n }\n }\n },\n zIndex: {\n isFocusVisible: 2\n },\n disableTapHighlight: true,\n '--badgeTop': {\n type: 'top',\n value: {\n default: 'calc(self(height)/2 - var(--iconWidth)/2)',\n [textOnly]: 0\n }\n },\n '--iconWidth': {\n type: 'width',\n value: fontRelative(20)\n },\n '--badgePosition': {\n type: 'width',\n value: {\n default: 'calc(self(paddingStart) + var(--iconWidth))',\n [iconOnly]: 'calc(self(minWidth)/2 + var(--iconWidth)/2)',\n [textOnly]: 'full'\n }\n }\n}, getAllowedOverrides());\n\n// Matching icon sizes. TBD.\nconst avatarSize = {\n XS: 14,\n S: 16,\n M: 20,\n L: 22,\n X: 26\n} as const;\n\nexport const ActionButtonContext = createContext<ContextValue<Partial<ActionButtonProps>, FocusableRefValue<HTMLButtonElement>>>(null);\n\n/**\n * ActionButtons allow users to perform an action.\n * They're used for similar, task-based options within a workflow, and are ideal for interfaces where buttons aren't meant to draw a lot of attention.\n */\nexport const ActionButton = forwardRef(function ActionButton(props: ActionButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionButtonContext);\n props = useFormProps(props as any);\n let domRef = useFocusableRef(ref);\n let overlayTriggerState = useContext(OverlayTriggerStateContext);\n let ctx = useSlottedContext(ActionButtonGroupContext);\n let isInGroup = !!ctx;\n let {\n density = 'regular',\n isJustified,\n orientation = 'horizontal',\n staticColor = props.staticColor,\n isQuiet = props.isQuiet,\n size = props.size || 'M',\n isDisabled = props.isDisabled\n } = ctx || {};\n\n\n return (\n <RACButton\n {...props}\n isDisabled={isDisabled}\n ref={domRef}\n style={pressScale(domRef, props.UNSAFE_style)}\n className={renderProps => (props.UNSAFE_className || '') + btnStyles({\n ...renderProps,\n // Retain hover styles when an overlay is open.\n isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,\n staticColor,\n isStaticColor: !!staticColor,\n size,\n isQuiet,\n density,\n isJustified,\n orientation,\n isInGroup\n }, props.styles)}>\n <Provider\n values={[\n [SkeletonContext, null],\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({marginStart: '--iconMargin', flexShrink: 0, order: 0})\n }],\n [NotificationBadgeContext, {\n staticColor: staticColor,\n size: props.size === 'XS' ? undefined : props.size,\n isDisabled: props.isDisabled,\n styles: style({position: 'absolute', top: '--badgeTop', insetStart: '--badgePosition', marginTop: 'calc((self(height) * -1)/2)', marginStart: 'calc((self(height) * -1)/2)'})\n }]\n ]}>\n {typeof props.children === 'string' ? <Text>{props.children}</Text> : props.children}\n </Provider>\n </RACButton>\n );\n});\n"],"names":[],"version":3,"file":"ActionButton.mjs.map"}
@@ -29,23 +29,23 @@ $parcel$export(module.exports, "ActionButtonGroup", () => $7a26131f6144af2b$expo
29
29
  const $7a26131f6144af2b$export$641cbcd1f6f6802f = function anonymous(props, overrides) {
30
30
  let rules = " ";
31
31
  rules += ((overrides || '').match(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|Z|N|L|F|M|K)[^\s]+/g) || []).join('');
32
- rules += ' sd9';
33
- if (props.orientation === "vertical") rules += ' _ta9';
34
- else if (props.orientation === "horizontal") rules += ' _tc9';
32
+ rules += ' sd91';
33
+ if (props.orientation === "vertical") rules += ' _ta91';
34
+ else if (props.orientation === "horizontal") rules += ' _tc91';
35
35
  if (props.density === "regular") {
36
- if (props.size === "XL") rules += ' Ue9';
37
- else if (props.size === "L") rules += ' Ue9';
38
- else if (props.size === "M") rules += ' Ue9';
39
- else if (props.size === "S") rules += ' Ub9';
40
- else if (props.size === "XS") rules += ' Ub9';
41
- } else if (props.density === "compact") rules += ' Ua9';
36
+ if (props.size === "XL") rules += ' Ue91';
37
+ else if (props.size === "L") rules += ' Ue91';
38
+ else if (props.size === "M") rules += ' Ue91';
39
+ else if (props.size === "S") rules += ' Ub91';
40
+ else if (props.size === "XS") rules += ' Ub91';
41
+ } else if (props.density === "compact") rules += ' Ua91';
42
42
  if (props.density === "regular") {
43
- if (props.size === "XL") rules += ' qe9';
44
- else if (props.size === "L") rules += ' qe9';
45
- else if (props.size === "M") rules += ' qe9';
46
- else if (props.size === "S") rules += ' qb9';
47
- else if (props.size === "XS") rules += ' qb9';
48
- } else if (props.density === "compact") rules += ' qa9';
43
+ if (props.size === "XL") rules += ' qe91';
44
+ else if (props.size === "L") rules += ' qe91';
45
+ else if (props.size === "M") rules += ' qe91';
46
+ else if (props.size === "S") rules += ' qb91';
47
+ else if (props.size === "XS") rules += ' qb91';
48
+ } else if (props.density === "compact") rules += ' qa91';
49
49
  return rules;
50
50
  };
51
51
  const $7a26131f6144af2b$export$33f5f2f2cb85d743 = /*#__PURE__*/ (0, $jGK4W$react.createContext)(null);