@react-spectrum/s2 0.9.0 → 0.9.2
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.
- package/dist/Accordion.cjs +2 -2
- package/dist/Accordion.css +2 -2
- package/dist/Accordion.mjs +2 -2
- package/dist/ActionBar.cjs +60 -60
- package/dist/ActionBar.css +59 -59
- package/dist/ActionBar.mjs +60 -60
- package/dist/ActionButton.cjs +187 -187
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +134 -134
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +187 -187
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/ActionButtonGroup.cjs +15 -15
- package/dist/ActionButtonGroup.css +9 -9
- package/dist/ActionButtonGroup.mjs +15 -15
- package/dist/Add.cjs +10 -10
- package/dist/Add.css +6 -6
- package/dist/Add.mjs +10 -10
- package/dist/AlertDialog.cjs +3 -3
- package/dist/AlertDialog.css +3 -3
- package/dist/AlertDialog.mjs +3 -3
- package/dist/Asterisk.cjs +6 -6
- package/dist/Asterisk.css +4 -4
- package/dist/Asterisk.mjs +6 -6
- package/dist/Avatar.cjs +14 -14
- package/dist/Avatar.css +14 -14
- package/dist/Avatar.mjs +14 -14
- package/dist/AvatarGroup.cjs +120 -120
- package/dist/AvatarGroup.css +37 -37
- package/dist/AvatarGroup.mjs +120 -120
- package/dist/Badge.cjs +196 -196
- package/dist/Badge.css +129 -129
- package/dist/Badge.mjs +196 -196
- package/dist/Breadcrumbs.cjs +231 -231
- package/dist/Breadcrumbs.css +102 -102
- package/dist/Breadcrumbs.mjs +231 -231
- package/dist/Button.cjs +328 -328
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +176 -176
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +328 -328
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs +20 -20
- package/dist/ButtonGroup.css +15 -15
- package/dist/ButtonGroup.mjs +20 -20
- package/dist/Card.cjs +294 -294
- package/dist/Card.css +205 -205
- package/dist/Card.mjs +294 -294
- package/dist/CardView.cjs +17 -17
- package/dist/CardView.css +17 -17
- package/dist/CardView.mjs +17 -17
- package/dist/CenterBaseline.cjs +1 -1
- package/dist/CenterBaseline.css +2 -2
- package/dist/CenterBaseline.mjs +1 -1
- package/dist/Checkbox.cjs +160 -160
- package/dist/Checkbox.css +94 -94
- package/dist/Checkbox.mjs +160 -160
- package/dist/CheckboxGroup.cjs +43 -43
- package/dist/CheckboxGroup.css +41 -41
- package/dist/CheckboxGroup.mjs +43 -43
- package/dist/Checkmark.cjs +12 -12
- package/dist/Checkmark.css +8 -8
- package/dist/Checkmark.mjs +12 -12
- package/dist/Chevron.cjs +12 -12
- package/dist/Chevron.css +10 -10
- package/dist/Chevron.mjs +12 -12
- package/dist/ClearButton.cjs +29 -29
- package/dist/ClearButton.css +29 -29
- package/dist/ClearButton.mjs +29 -29
- package/dist/CloseButton.cjs +54 -54
- package/dist/CloseButton.css +46 -46
- package/dist/CloseButton.mjs +54 -54
- package/dist/ColorArea.cjs +16 -16
- package/dist/ColorArea.css +16 -16
- package/dist/ColorArea.mjs +16 -16
- package/dist/ColorField.cjs +31 -31
- package/dist/ColorField.css +31 -31
- package/dist/ColorField.mjs +31 -31
- package/dist/ColorHandle.cjs +27 -27
- package/dist/ColorHandle.css +42 -42
- package/dist/ColorHandle.mjs +27 -27
- package/dist/ColorSlider.cjs +108 -108
- package/dist/ColorSlider.css +56 -56
- package/dist/ColorSlider.mjs +108 -108
- package/dist/ColorSwatch.cjs +29 -29
- package/dist/ColorSwatch.css +29 -29
- package/dist/ColorSwatch.mjs +29 -29
- package/dist/ColorSwatchPicker.cjs +27 -27
- package/dist/ColorSwatchPicker.css +46 -46
- package/dist/ColorSwatchPicker.mjs +27 -27
- package/dist/ColorWheel.cjs +26 -26
- package/dist/ColorWheel.css +17 -17
- package/dist/ColorWheel.mjs +26 -26
- package/dist/ComboBox.cjs +378 -376
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +179 -179
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +378 -376
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +5 -5
- package/dist/ContextualHelp.cjs.map +1 -1
- package/dist/ContextualHelp.css +49 -49
- package/dist/ContextualHelp.css.map +1 -1
- package/dist/ContextualHelp.mjs +5 -5
- package/dist/ContextualHelp.mjs.map +1 -1
- package/dist/Cross.cjs +14 -14
- package/dist/Cross.css +10 -10
- package/dist/Cross.mjs +14 -14
- package/dist/CustomDialog.cjs +25 -25
- package/dist/CustomDialog.css +25 -25
- package/dist/CustomDialog.mjs +25 -25
- package/dist/Dash.cjs +10 -10
- package/dist/Dash.css +6 -6
- package/dist/Dash.mjs +10 -10
- package/dist/Dialog.cjs +17 -17
- package/dist/Dialog.css +70 -70
- package/dist/Dialog.mjs +17 -17
- package/dist/Disclosure.cjs +129 -129
- package/dist/Disclosure.css +104 -104
- package/dist/Disclosure.mjs +129 -129
- package/dist/Divider.cjs +25 -25
- package/dist/Divider.css +25 -25
- package/dist/Divider.mjs +25 -25
- package/dist/DropZone.cjs +58 -58
- package/dist/DropZone.css +54 -54
- package/dist/DropZone.mjs +58 -58
- package/dist/Field.cjs +340 -340
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +144 -144
- package/dist/Field.mjs +340 -340
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs +9 -9
- package/dist/Form.css +9 -9
- package/dist/Form.mjs +9 -9
- package/dist/FullscreenDialog.cjs +5 -5
- package/dist/FullscreenDialog.css +79 -79
- package/dist/FullscreenDialog.mjs +5 -5
- package/dist/IllustratedMessage.cjs +219 -219
- package/dist/IllustratedMessage.css +74 -74
- package/dist/IllustratedMessage.mjs +219 -219
- package/dist/Image.cjs +14 -14
- package/dist/Image.cjs.map +1 -1
- package/dist/Image.css +14 -14
- package/dist/Image.css.map +1 -1
- package/dist/Image.mjs +14 -14
- package/dist/Image.mjs.map +1 -1
- package/dist/InlineAlert.cjs +108 -108
- package/dist/InlineAlert.css +90 -90
- package/dist/InlineAlert.mjs +108 -108
- package/dist/Link.cjs +49 -49
- package/dist/Link.css +41 -41
- package/dist/Link.mjs +49 -49
- package/dist/LinkOut.cjs +8 -8
- package/dist/LinkOut.css +8 -8
- package/dist/LinkOut.mjs +8 -8
- package/dist/Menu.cjs +422 -422
- package/dist/Menu.css +180 -180
- package/dist/Menu.mjs +422 -422
- package/dist/Meter.cjs +153 -153
- package/dist/Meter.css +95 -95
- package/dist/Meter.mjs +153 -153
- package/dist/Modal.cjs +58 -58
- package/dist/Modal.css +50 -50
- package/dist/Modal.mjs +58 -58
- package/dist/NotificationBadge.cjs +56 -56
- package/dist/NotificationBadge.css +51 -51
- package/dist/NotificationBadge.mjs +56 -56
- package/dist/NumberField.cjs +114 -118
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css +103 -103
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs +115 -119
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs +273 -271
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +169 -169
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +273 -271
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs +85 -85
- package/dist/Popover.css +66 -66
- package/dist/Popover.mjs +85 -85
- package/dist/ProgressBar.cjs +163 -163
- package/dist/ProgressBar.css +103 -103
- package/dist/ProgressBar.mjs +163 -163
- package/dist/ProgressCircle.cjs +17 -17
- package/dist/ProgressCircle.css +17 -17
- package/dist/ProgressCircle.mjs +17 -17
- package/dist/Provider.cjs +10 -10
- package/dist/Provider.css +9 -9
- package/dist/Provider.mjs +10 -10
- package/dist/Radio.cjs +144 -144
- package/dist/Radio.css +81 -81
- package/dist/Radio.mjs +144 -144
- package/dist/RadioGroup.cjs +41 -41
- package/dist/RadioGroup.css +41 -41
- package/dist/RadioGroup.mjs +41 -41
- package/dist/SearchField.cjs +41 -41
- package/dist/SearchField.css +49 -49
- package/dist/SearchField.mjs +41 -41
- package/dist/SegmentedControl.cjs +171 -171
- package/dist/SegmentedControl.css +120 -120
- package/dist/SegmentedControl.mjs +171 -171
- package/dist/Slider.cjs +288 -288
- package/dist/Slider.css +152 -152
- package/dist/Slider.mjs +288 -288
- package/dist/StatusLight.cjs +115 -115
- package/dist/StatusLight.css +63 -63
- package/dist/StatusLight.mjs +115 -115
- package/dist/Switch.cjs +152 -152
- package/dist/Switch.css +76 -76
- package/dist/Switch.mjs +152 -152
- package/dist/TableView.cjs +310 -310
- package/dist/TableView.css +172 -172
- package/dist/TableView.mjs +310 -310
- package/dist/Tabs.cjs +113 -110
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +92 -92
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +113 -110
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TabsPicker.cjs +123 -123
- package/dist/TabsPicker.css +112 -112
- package/dist/TabsPicker.mjs +123 -123
- package/dist/TagGroup.cjs +202 -202
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css +147 -147
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +202 -202
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs +57 -57
- package/dist/TextField.css +57 -57
- package/dist/TextField.mjs +57 -57
- package/dist/Toast.cjs +118 -118
- package/dist/Toast.css +105 -105
- package/dist/Toast.mjs +118 -118
- package/dist/ToggleButton.cjs +3 -3
- package/dist/ToggleButton.css +12 -12
- package/dist/ToggleButton.mjs +3 -3
- package/dist/Tooltip.cjs +81 -81
- package/dist/Tooltip.css +68 -68
- package/dist/Tooltip.mjs +81 -81
- package/dist/TreeView.cjs +143 -149
- package/dist/TreeView.cjs.map +1 -1
- package/dist/TreeView.css +143 -143
- package/dist/TreeView.css.map +1 -1
- package/dist/TreeView.mjs +143 -149
- package/dist/TreeView.mjs.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/icons/Icon.cjs +10 -10
- package/icons/Icon.css +9 -9
- package/icons/Icon.mjs +10 -10
- package/icons/Skeleton.cjs +4 -3
- package/icons/Skeleton.cjs.map +1 -1
- package/icons/Skeleton.css +6 -6
- package/icons/Skeleton.css.map +1 -1
- package/icons/Skeleton.mjs +4 -3
- package/icons/Skeleton.mjs.map +1 -1
- package/package.json +45 -26
- package/src/ActionButton.tsx +1 -1
- package/src/Button.tsx +3 -3
- package/src/ComboBox.tsx +3 -2
- package/src/ContextualHelp.tsx +2 -2
- package/src/Image.tsx +1 -1
- package/src/NumberField.tsx +0 -2
- package/src/Picker.tsx +3 -2
- package/src/Skeleton.tsx +2 -1
- package/src/Tabs.tsx +7 -5
- package/src/TagGroup.tsx +1 -1
- package/src/TreeView.tsx +1 -6
- 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"}
|
package/dist/ActionButton.mjs
CHANGED
|
@@ -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 += '
|
|
122
|
-
else rules += '
|
|
123
|
-
if (props.isStaticColor) rules += '
|
|
124
|
-
else rules += '
|
|
125
|
-
rules += '
|
|
126
|
-
rules += '
|
|
127
|
-
rules += '
|
|
128
|
-
if (props.staticColor === "white") rules += ' -Ovbhqd-
|
|
129
|
-
else if (props.staticColor === "black") rules += ' -Ovbhqd-
|
|
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 += '
|
|
132
|
-
rules += '
|
|
133
|
-
rules += '
|
|
134
|
-
rules += '
|
|
135
|
-
rules += '
|
|
136
|
-
rules += '
|
|
137
|
-
rules += '
|
|
138
|
-
rules += '
|
|
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 += '
|
|
141
|
-
rules += '
|
|
142
|
-
rules += '
|
|
143
|
-
rules += '
|
|
144
|
-
rules += '
|
|
145
|
-
rules += '
|
|
146
|
-
rules += '
|
|
147
|
-
rules += '
|
|
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 += '
|
|
150
|
-
rules += '
|
|
151
|
-
rules += '
|
|
152
|
-
rules += '
|
|
153
|
-
rules += '
|
|
154
|
-
rules += '
|
|
155
|
-
rules += '
|
|
156
|
-
rules += '
|
|
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 += '
|
|
159
|
-
rules += '
|
|
160
|
-
rules += '
|
|
161
|
-
rules += '
|
|
162
|
-
rules += '
|
|
163
|
-
rules += '
|
|
164
|
-
rules += '
|
|
165
|
-
rules += '
|
|
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 += '
|
|
168
|
-
rules += '
|
|
169
|
-
rules += '
|
|
170
|
-
rules += '
|
|
171
|
-
rules += '
|
|
172
|
-
rules += '
|
|
173
|
-
rules += '
|
|
174
|
-
rules += '
|
|
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 += '
|
|
178
|
-
rules += '
|
|
177
|
+
rules += ' vg91';
|
|
178
|
+
rules += ' vsj91';
|
|
179
179
|
} else if (props.size === "L") {
|
|
180
|
-
rules += '
|
|
181
|
-
rules += '
|
|
180
|
+
rules += ' vp91';
|
|
181
|
+
rules += ' vsh91';
|
|
182
182
|
} else if (props.size === "S") {
|
|
183
|
-
rules += '
|
|
184
|
-
rules += '
|
|
183
|
+
rules += ' vb91';
|
|
184
|
+
rules += ' vse91';
|
|
185
185
|
} else if (props.size === "XS") {
|
|
186
|
-
rules += '
|
|
187
|
-
rules += '
|
|
186
|
+
rules += ' va91';
|
|
187
|
+
rules += ' vsc91';
|
|
188
188
|
} else {
|
|
189
|
-
rules += '
|
|
190
|
-
rules += '
|
|
189
|
+
rules += ' vd91';
|
|
190
|
+
rules += ' vsf91';
|
|
191
191
|
}
|
|
192
|
-
rules += '
|
|
193
|
-
rules += '
|
|
194
|
-
rules += '
|
|
192
|
+
rules += ' wc91';
|
|
193
|
+
rules += ' xc91';
|
|
194
|
+
rules += ' _xa91';
|
|
195
195
|
if (props.size === "XL") {
|
|
196
|
-
rules += '
|
|
197
|
-
rules += '
|
|
196
|
+
rules += ' _Fa91';
|
|
197
|
+
rules += ' _Ffb91';
|
|
198
198
|
} else if (props.size === "L") {
|
|
199
|
-
rules += '
|
|
200
|
-
rules += '
|
|
199
|
+
rules += ' _Fa91';
|
|
200
|
+
rules += ' _Ffb91';
|
|
201
201
|
} else if (props.size === "S") {
|
|
202
|
-
rules += '
|
|
203
|
-
rules += '
|
|
202
|
+
rules += ' _Fa91';
|
|
203
|
+
rules += ' _Ffb91';
|
|
204
204
|
} else if (props.size === "XS") {
|
|
205
|
-
rules += '
|
|
206
|
-
rules += '
|
|
205
|
+
rules += ' _Fa91';
|
|
206
|
+
rules += ' _Ffb91';
|
|
207
207
|
} else {
|
|
208
|
-
rules += '
|
|
209
|
-
rules += '
|
|
208
|
+
rules += ' _Fa91';
|
|
209
|
+
rules += ' _Ffb91';
|
|
210
210
|
}
|
|
211
211
|
if (props.isStaticColor) {
|
|
212
|
-
if (props.isDisabled) rules += '
|
|
213
|
-
else if (props.isSelected) rules += '
|
|
212
|
+
if (props.isDisabled) rules += ' pi91';
|
|
213
|
+
else if (props.isSelected) rules += ' ph91';
|
|
214
214
|
else {
|
|
215
|
-
if (props.isPressed) rules += '
|
|
216
|
-
else if (props.isFocusVisible) rules += '
|
|
217
|
-
else if (props.isHovered) rules += '
|
|
218
|
-
else rules += '
|
|
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 += '
|
|
220
|
+
} else if (props.isDisabled) rules += ' pp91';
|
|
221
221
|
else if (props.isSelected) {
|
|
222
|
-
if (props.isEmphasized) rules += '
|
|
223
|
-
else rules += '
|
|
222
|
+
if (props.isEmphasized) rules += ' px91';
|
|
223
|
+
else rules += ' pr91';
|
|
224
224
|
} else {
|
|
225
|
-
if (props.isPressed) rules += '
|
|
226
|
-
else if (props.isFocusVisible) rules += '
|
|
227
|
-
else if (props.isHovered) rules += '
|
|
228
|
-
else rules += '
|
|
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 += '
|
|
231
|
-
else if (props.isSelected) rules += '
|
|
232
|
-
else rules += '
|
|
233
|
-
rules += '
|
|
234
|
-
rules += '
|
|
235
|
-
rules += '
|
|
236
|
-
rules += '
|
|
237
|
-
rules += '
|
|
238
|
-
rules += '
|
|
239
|
-
if (!minWidth) rules += '
|
|
240
|
-
if (props.size === "XL") rules += ' -SFnbic-
|
|
241
|
-
else if (props.size === "L") rules += ' -SFnbic-
|
|
242
|
-
else if (props.size === "S") rules += ' -SFnbic-
|
|
243
|
-
else if (props.size === "XS") rules += ' -SFnbic-
|
|
244
|
-
else rules += ' -SFnbic-
|
|
245
|
-
rules += ' -Bu7z1c-
|
|
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 += '
|
|
248
|
-
rules += '
|
|
249
|
-
} else rules += '
|
|
247
|
+
rules += ' od91';
|
|
248
|
+
rules += ' obj91';
|
|
249
|
+
} else rules += ' oj91';
|
|
250
250
|
if (props.density === "compact") {
|
|
251
|
-
if (props.orientation === "vertical") rules += '
|
|
252
|
-
else if (props.orientation === "horizontal") rules += '
|
|
253
|
-
else rules += '
|
|
254
|
-
} else rules += '
|
|
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 += '
|
|
257
|
-
else if (props.orientation === "horizontal") rules += '
|
|
258
|
-
else rules += '
|
|
259
|
-
} else rules += '
|
|
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 += '
|
|
262
|
-
rules += '
|
|
263
|
-
} else rules += '
|
|
264
|
-
rules += '
|
|
265
|
-
rules += '
|
|
266
|
-
rules += ' -Qg41Lb-
|
|
267
|
-
rules += ' -Qg41Lb-
|
|
268
|
-
rules += '
|
|
269
|
-
rules += '
|
|
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 += '
|
|
272
|
-
} else if (!flexShrink) rules += '
|
|
271
|
+
if (!flexShrink) rules += ' _va91';
|
|
272
|
+
} else if (!flexShrink) rules += ' _vb91';
|
|
273
273
|
if (props.isJustified) {
|
|
274
|
-
if (!flexGrow) rules += '
|
|
274
|
+
if (!flexGrow) rules += ' _ub91';
|
|
275
275
|
}
|
|
276
276
|
if (props.isJustified) {
|
|
277
|
-
if (!flexBasis) rules += '
|
|
277
|
+
if (!flexBasis) rules += ' _sb91';
|
|
278
278
|
}
|
|
279
|
-
rules += '
|
|
280
|
-
rules += '
|
|
281
|
-
rules += '
|
|
282
|
-
rules += '
|
|
283
|
-
rules += '
|
|
284
|
-
rules += '
|
|
285
|
-
rules += ' -_8sjo0b-
|
|
286
|
-
rules += '
|
|
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 += '
|
|
288
|
+
if (!zIndex) rules += ' _9d91';
|
|
289
289
|
}
|
|
290
|
-
rules += '
|
|
291
|
-
rules += ' -B5H9Ae-
|
|
292
|
-
rules += ' -B5H9Ae-
|
|
293
|
-
rules += ' -SqFa4c-
|
|
294
|
-
rules += ' -dcAs1c-
|
|
295
|
-
rules += ' -dcAs1c-
|
|
296
|
-
rules += ' -dcAs1c-
|
|
297
|
-
if (props.size === "XL") rules += ' -F_-
|
|
298
|
-
else if (props.size === "L") rules += ' -F_-
|
|
299
|
-
else if (props.size === "S") rules += ' -F_-
|
|
300
|
-
else if (props.size === "XS") rules += ' -F_-
|
|
301
|
-
else rules += ' -F_-
|
|
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_-
|
|
306
|
-
else rules += ' -g_-
|
|
305
|
+
if (props.isQuiet) rules += ' -g_-g991';
|
|
306
|
+
else rules += ' -g_-gf91';
|
|
307
307
|
} else {
|
|
308
|
-
if (props.isPressed) rules += ' -g_-
|
|
309
|
-
else if (props.isFocusVisible) rules += ' -g_-
|
|
310
|
-
else if (props.isHovered) rules += ' -g_-
|
|
311
|
-
else rules += ' -g_-
|
|
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_-
|
|
314
|
-
else if (props.isFocusVisible) rules += ' -g_-
|
|
315
|
-
else if (props.isHovered) rules += ' -g_-
|
|
316
|
-
else if (props.isQuiet) rules += ' -g_-
|
|
317
|
-
else rules += ' -g_-
|
|
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_-
|
|
321
|
-
else rules += ' -g_-
|
|
320
|
+
if (props.isQuiet) rules += ' -g_-g991';
|
|
321
|
+
else rules += ' -g_-gH91';
|
|
322
322
|
} else if (props.isEmphasized) {
|
|
323
|
-
if (props.
|
|
324
|
-
else if (props.isPressed) rules += ' -g_-
|
|
325
|
-
else if (props.isHovered) rules += ' -g_-
|
|
326
|
-
else rules += ' -g_-
|
|
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_-
|
|
329
|
-
else if (props.isFocusVisible) rules += ' -g_-
|
|
330
|
-
else if (props.isHovered) rules += ' -g_-
|
|
331
|
-
else rules += ' -g_-
|
|
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_-
|
|
335
|
-
else if (props.isFocusVisible) rules += ' -g_-
|
|
336
|
-
else if (props.isHovered) rules += ' -g_-
|
|
337
|
-
else if (props.isQuiet) rules += ' -g_-
|
|
338
|
-
else rules += ' -g_-
|
|
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_-
|
|
342
|
-
else rules += ' -g_-
|
|
343
|
-
} else rules += ' -g_-
|
|
344
|
-
rules += ' -S_-
|
|
345
|
-
rules += ' -S_-
|
|
346
|
-
if (props.size === "XL") rules += ' -N_-
|
|
347
|
-
else if (props.size === "L") rules += ' -N_-
|
|
348
|
-
else if (props.size === "S") rules += ' -N_-
|
|
349
|
-
else if (props.size === "XS") rules += ' -N_-
|
|
350
|
-
else rules += ' -N_-
|
|
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: "
|
|
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: "
|
|
405
|
+
styles: " _Ja91"
|
|
406
406
|
}),
|
|
407
|
-
styles: "
|
|
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: "
|
|
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: "
|
|
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 += '
|
|
33
|
-
if (props.orientation === "vertical") rules += '
|
|
34
|
-
else if (props.orientation === "horizontal") rules += '
|
|
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 += '
|
|
37
|
-
else if (props.size === "L") rules += '
|
|
38
|
-
else if (props.size === "M") rules += '
|
|
39
|
-
else if (props.size === "S") rules += '
|
|
40
|
-
else if (props.size === "XS") rules += '
|
|
41
|
-
} else if (props.density === "compact") rules += '
|
|
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 += '
|
|
44
|
-
else if (props.size === "L") rules += '
|
|
45
|
-
else if (props.size === "M") rules += '
|
|
46
|
-
else if (props.size === "S") rules += '
|
|
47
|
-
else if (props.size === "XS") rules += '
|
|
48
|
-
} else if (props.density === "compact") rules += '
|
|
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);
|