@react-spectrum/s2 3.0.0-nightly-c53ab48ec-250115 → 3.0.0-nightly-1286a652e-250116

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 (157) hide show
  1. package/dist/Accordion.css +1 -5
  2. package/dist/Accordion.css.map +1 -1
  3. package/dist/ActionBar.css +0 -6
  4. package/dist/ActionBar.css.map +1 -1
  5. package/dist/ActionButton.css +0 -6
  6. package/dist/ActionButton.css.map +1 -1
  7. package/dist/ActionButtonGroup.css +1 -5
  8. package/dist/ActionButtonGroup.css.map +1 -1
  9. package/dist/AlertDialog.css +1 -5
  10. package/dist/AlertDialog.css.map +1 -1
  11. package/dist/Avatar.css +1 -5
  12. package/dist/Avatar.css.map +1 -1
  13. package/dist/AvatarGroup.css +0 -6
  14. package/dist/AvatarGroup.css.map +1 -1
  15. package/dist/Badge.css +0 -6
  16. package/dist/Badge.css.map +1 -1
  17. package/dist/Breadcrumbs.cjs +2 -2
  18. package/dist/Breadcrumbs.cjs.map +1 -1
  19. package/dist/Breadcrumbs.css +0 -6
  20. package/dist/Breadcrumbs.css.map +1 -1
  21. package/dist/Breadcrumbs.mjs +2 -2
  22. package/dist/Breadcrumbs.mjs.map +1 -1
  23. package/dist/Button.css +0 -6
  24. package/dist/Button.css.map +1 -1
  25. package/dist/ButtonGroup.css +1 -5
  26. package/dist/ButtonGroup.css.map +1 -1
  27. package/dist/Card.cjs +1 -1
  28. package/dist/Card.cjs.map +1 -1
  29. package/dist/Card.css +0 -6
  30. package/dist/Card.css.map +1 -1
  31. package/dist/Card.mjs +2 -2
  32. package/dist/Card.mjs.map +1 -1
  33. package/dist/CardView.css +1 -5
  34. package/dist/CardView.css.map +1 -1
  35. package/dist/CenterBaseline.css +1 -5
  36. package/dist/CenterBaseline.css.map +1 -1
  37. package/dist/Checkbox.css +0 -6
  38. package/dist/Checkbox.css.map +1 -1
  39. package/dist/CheckboxGroup.css +0 -6
  40. package/dist/CheckboxGroup.css.map +1 -1
  41. package/dist/ClearButton.css +1 -5
  42. package/dist/ClearButton.css.map +1 -1
  43. package/dist/CloseButton.css +1 -5
  44. package/dist/CloseButton.css.map +1 -1
  45. package/dist/ColorArea.css +1 -5
  46. package/dist/ColorArea.css.map +1 -1
  47. package/dist/ColorField.css +0 -6
  48. package/dist/ColorField.css.map +1 -1
  49. package/dist/ColorHandle.css +1 -5
  50. package/dist/ColorHandle.css.map +1 -1
  51. package/dist/ColorSlider.css +0 -6
  52. package/dist/ColorSlider.css.map +1 -1
  53. package/dist/ColorSwatch.css +1 -5
  54. package/dist/ColorSwatch.css.map +1 -1
  55. package/dist/ColorSwatchPicker.css +1 -5
  56. package/dist/ColorSwatchPicker.css.map +1 -1
  57. package/dist/ColorWheel.css +1 -5
  58. package/dist/ColorWheel.css.map +1 -1
  59. package/dist/ComboBox.css +0 -6
  60. package/dist/ComboBox.css.map +1 -1
  61. package/dist/Content.cjs +3 -1
  62. package/dist/Content.cjs.map +1 -1
  63. package/dist/Content.mjs +3 -1
  64. package/dist/Content.mjs.map +1 -1
  65. package/dist/ContextualHelp.css +0 -6
  66. package/dist/ContextualHelp.css.map +1 -1
  67. package/dist/CustomDialog.css +1 -5
  68. package/dist/CustomDialog.css.map +1 -1
  69. package/dist/Dialog.css +0 -6
  70. package/dist/Dialog.css.map +1 -1
  71. package/dist/Disclosure.css +0 -6
  72. package/dist/Disclosure.css.map +1 -1
  73. package/dist/Divider.css +1 -5
  74. package/dist/Divider.css.map +1 -1
  75. package/dist/DropZone.css +0 -6
  76. package/dist/DropZone.css.map +1 -1
  77. package/dist/Field.css +0 -6
  78. package/dist/Field.css.map +1 -1
  79. package/dist/Form.css +1 -5
  80. package/dist/Form.css.map +1 -1
  81. package/dist/FullscreenDialog.css +0 -6
  82. package/dist/FullscreenDialog.css.map +1 -1
  83. package/dist/IllustratedMessage.css +0 -6
  84. package/dist/IllustratedMessage.css.map +1 -1
  85. package/dist/Image.css +1 -5
  86. package/dist/Image.css.map +1 -1
  87. package/dist/InlineAlert.css +0 -6
  88. package/dist/InlineAlert.css.map +1 -1
  89. package/dist/Link.css +0 -6
  90. package/dist/Link.css.map +1 -1
  91. package/dist/Menu.css +0 -6
  92. package/dist/Menu.css.map +1 -1
  93. package/dist/Meter.css +0 -6
  94. package/dist/Meter.css.map +1 -1
  95. package/dist/Modal.css +1 -5
  96. package/dist/Modal.css.map +1 -1
  97. package/dist/NumberField.css +0 -6
  98. package/dist/NumberField.css.map +1 -1
  99. package/dist/Picker.css +0 -6
  100. package/dist/Picker.css.map +1 -1
  101. package/dist/Popover.css +1 -5
  102. package/dist/Popover.css.map +1 -1
  103. package/dist/ProgressBar.css +0 -6
  104. package/dist/ProgressBar.css.map +1 -1
  105. package/dist/ProgressCircle.css +1 -5
  106. package/dist/ProgressCircle.css.map +1 -1
  107. package/dist/Provider.css +1 -5
  108. package/dist/Provider.css.map +1 -1
  109. package/dist/Radio.css +0 -6
  110. package/dist/Radio.css.map +1 -1
  111. package/dist/RadioGroup.css +0 -6
  112. package/dist/RadioGroup.css.map +1 -1
  113. package/dist/SearchField.css +0 -6
  114. package/dist/SearchField.css.map +1 -1
  115. package/dist/SegmentedControl.css +0 -6
  116. package/dist/SegmentedControl.css.map +1 -1
  117. package/dist/Slider.css +0 -6
  118. package/dist/Slider.css.map +1 -1
  119. package/dist/StatusLight.css +0 -6
  120. package/dist/StatusLight.css.map +1 -1
  121. package/dist/Switch.css +0 -6
  122. package/dist/Switch.css.map +1 -1
  123. package/dist/TableView.css +0 -6
  124. package/dist/TableView.css.map +1 -1
  125. package/dist/Tabs.css +0 -6
  126. package/dist/Tabs.css.map +1 -1
  127. package/dist/TagGroup.cjs +2 -2
  128. package/dist/TagGroup.cjs.map +1 -1
  129. package/dist/TagGroup.css +0 -6
  130. package/dist/TagGroup.css.map +1 -1
  131. package/dist/TagGroup.mjs +2 -2
  132. package/dist/TagGroup.mjs.map +1 -1
  133. package/dist/TextField.css +0 -6
  134. package/dist/TextField.css.map +1 -1
  135. package/dist/ToggleButton.css +1 -5
  136. package/dist/ToggleButton.css.map +1 -1
  137. package/dist/Tooltip.css +0 -6
  138. package/dist/Tooltip.css.map +1 -1
  139. package/dist/types.d.ts.map +1 -1
  140. package/icons/Skeleton.cjs +2 -2
  141. package/icons/Skeleton.cjs.map +1 -1
  142. package/icons/Skeleton.css +3 -5
  143. package/icons/Skeleton.css.map +1 -1
  144. package/icons/Skeleton.mjs +3 -3
  145. package/icons/Skeleton.mjs.map +1 -1
  146. package/package.json +19 -19
  147. package/src/Breadcrumbs.tsx +2 -2
  148. package/src/Card.tsx +2 -2
  149. package/src/Content.tsx +2 -1
  150. package/src/Skeleton.tsx +3 -3
  151. package/src/TagGroup.tsx +2 -2
  152. package/style/__tests__/style-macro.test.js +2 -6
  153. package/style/dist/style-macro.cjs +4 -2
  154. package/style/dist/style-macro.cjs.map +1 -1
  155. package/style/dist/style-macro.mjs +4 -2
  156. package/style/dist/style-macro.mjs.map +1 -1
  157. package/style/style-macro.ts +8 -2
@@ -1,7 +1,3 @@
1
- .\.:not(#a#b) {
2
- all: revert-layer;
3
- }
4
-
5
1
  @layer _.a {
6
2
  ._0d {
7
3
  display: flex;
@@ -12,5 +8,5 @@
12
8
  }
13
9
  }
14
10
 
15
- @layer _.b, UNSAFE_overrides;
11
+ @layer _.b;
16
12
  /*# sourceMappingURL=Accordion.css.map */
@@ -1 +1 @@
1
- {"mappings":"AAwCkB;;;;AAAA;EAAA;;;;EAAA;;;;;AAAA","sources":["packages/@react-spectrum/s2/src/Accordion.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 {ContextValue, DisclosureGroup, DisclosureGroupProps, SlotProps} from 'react-aria-components';\nimport {DisclosureContext} from './Disclosure';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef} from 'react';\nimport {style} from '../style' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends Omit<DisclosureGroupProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, SlotProps {\n /** The disclosure elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosure items.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<AccordionProps, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * An accordion is a container for multiple disclosures.\n */\nexport const Accordion = forwardRef(function Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n});\n"],"names":[],"version":3,"file":"Accordion.css.map"}
1
+ {"mappings":"AAwCkB;EAAA;;;;EAAA;;;;;AAAA","sources":["packages/@react-spectrum/s2/src/Accordion.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 {ContextValue, DisclosureGroup, DisclosureGroupProps, SlotProps} from 'react-aria-components';\nimport {DisclosureContext} from './Disclosure';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };\nimport React, {createContext, forwardRef} from 'react';\nimport {style} from '../style' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AccordionProps extends Omit<DisclosureGroupProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, SlotProps {\n /** The disclosure elements in the accordion. */\n children: React.ReactNode,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /**\n * The size of the accordion.\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The amount of space between the disclosure items.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the accordion should be displayed with a quiet style. */\n isQuiet?: boolean\n}\n\nconst accordion = style({\n display: 'flex',\n flexDirection: 'column'\n}, getAllowedOverrides({height: true}));\n\nexport const AccordionContext = createContext<ContextValue<AccordionProps, DOMRefValue<HTMLDivElement>>>(null);\n\n/**\n * An accordion is a container for multiple disclosures.\n */\nexport const Accordion = forwardRef(function Accordion(props: AccordionProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AccordionContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_style,\n UNSAFE_className = '',\n size = 'M',\n density = 'regular',\n isQuiet\n } = props;\n return (\n <DisclosureContext.Provider value={{size, isQuiet, density}}>\n <DisclosureGroup\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={(UNSAFE_className ?? '') + accordion(null, props.styles)}>\n {props.children}\n </DisclosureGroup>\n </DisclosureContext.Provider>\n );\n});\n"],"names":[],"version":3,"file":"Accordion.css.map"}
@@ -207,8 +207,6 @@
207
207
  }
208
208
  }
209
209
 
210
- @layer UNSAFE_overrides;
211
-
212
210
  @layer _.b.a {
213
211
  @media (forced-colors: active) {
214
212
  .da_____I {
@@ -217,10 +215,6 @@
217
215
  }
218
216
  }
219
217
 
220
- .\.:not(#a#b) {
221
- all: revert-layer;
222
- }
223
-
224
218
  @layer _.c {
225
219
  ._d-enzwzjc:lang(he) {
226
220
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
@@ -1 +1 @@
1
- {"mappings":"AC4BwB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;;;EAqIA;;;;EAAA;;;;EAQA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAKG;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAlJH;EAkJG;;;;EAAA;;;;;AAlJH;;AAAA;EAAA;IAAA;;;;;;AAqIA;;;;AAaG;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA","sources":["a1b352514784d267","packages/@react-spectrum/s2/src/ActionBar.tsx"],"sourcesContent":["@import \"ae871d7b3899fe46\";\n@import \"b12d7526a8920c7d\";\n@import \"ac539ec7d1ef9296\";\n@import \"e8e91cecf3846843\";\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 {ActionButtonGroup} from './ActionButtonGroup';\nimport {announce} from '@react-aria/live-announcer';\nimport {CloseButton} from './CloseButton';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, ForwardedRef, forwardRef, ReactElement, ReactNode, RefObject, useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, Key} from '@react-types/shared';\nimport {FocusScope, useKeyboard} from 'react-aria';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {style} from '../style' with {type: 'macro'};\nimport {useControlledState} from '@react-stately/utils';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEnterAnimation, useExitAnimation, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nconst actionBarStyles = style({\n borderRadius: 'lg',\n '--s2-container-bg': {\n type: 'backgroundColor',\n value: {\n default: 'elevated',\n isEmphasized: 'neutral'\n }\n },\n backgroundColor: '--s2-container-bg',\n boxShadow: 'elevated',\n boxSizing: 'border-box',\n outlineStyle: 'solid',\n outlineWidth: 1,\n outlineOffset: -1,\n outlineColor: {\n default: 'gray-200',\n isEmphasized: 'transparent',\n forcedColors: 'ButtonBorder'\n },\n paddingX: 8,\n paddingY: 12,\n display: 'flex',\n gap: 16,\n alignItems: 'center',\n position: {\n isInContainer: 'absolute'\n },\n bottom: 0,\n insetStart: 8,\n '--insetEnd': {\n type: 'insetEnd',\n value: 8\n },\n width: {\n default: 'full',\n isInContainer: 'auto'\n },\n marginX: 'auto',\n maxWidth: 960,\n transition: 'transform',\n transitionDuration: 200,\n translateY: {\n default: -8,\n isEntering: 'full',\n isExiting: 'full'\n }\n});\n\nexport interface ActionBarProps extends SlotProps {\n /** A list of ActionButtons to display. */\n children: ReactNode,\n /** Whether the ActionBar should be displayed with a emphasized style. */\n isEmphasized?: boolean,\n /** The number of selected items that the ActionBar is currently linked to. If 0, the ActionBar is hidden. */\n selectedItemCount?: number | 'all',\n /** Handler that is called when the ActionBar clear button is pressed. */\n onClearSelection?: () => void,\n /** A ref to the scrollable element the ActionBar appears above. */\n scrollRef?: RefObject<HTMLElement | null>\n}\n\nexport const ActionBarContext = createContext<ContextValue<Partial<ActionBarProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nexport const ActionBar = forwardRef(function ActionBar(props: ActionBarProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionBarContext);\n let domRef = useDOMRef(ref);\n\n let isOpen = props.selectedItemCount !== 0;\n let isExiting = useExitAnimation(domRef, isOpen && props.scrollRef != null);\n if (!isOpen && !isExiting) {\n return null;\n }\n\n return <ActionBarInner {...props} ref={domRef} isExiting={isExiting} />;\n});\n\nconst ActionBarInner = forwardRef(function ActionBarInner(props: ActionBarProps & {isExiting: boolean}, ref: ForwardedRef<HTMLDivElement | null>) {\n let {isEmphasized, selectedItemCount = 0, children, onClearSelection, isExiting} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n\n // Store the last count greater than zero so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n \n // Measure the width of the collection's scrollbar and offset the action bar by that amount.\n let scrollRef = props.scrollRef;\n let [scrollbarWidth, setScrollbarWidth] = useState(0);\n let updateScrollbarWidth = useCallback(() => {\n let el = scrollRef?.current;\n if (el) {\n let w = el.offsetWidth - el.clientWidth;\n setScrollbarWidth(w);\n }\n }, [scrollRef]);\n\n useResizeObserver({\n ref: scrollRef,\n onResize: updateScrollbarWidth\n });\n\n let {keyboardProps} = useKeyboard({\n onKeyDown(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClearSelection?.();\n } else {\n e.continuePropagation();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current && scrollRef) {\n isInitial.current = false;\n announce(stringFormatter.format('actionbar.actionsAvailable'));\n }\n }, [stringFormatter, scrollRef]);\n\n let objectRef = useObjectRef(ref);\n let isEntering = useEnterAnimation(objectRef, !!scrollRef);\n\n return (\n <FocusScope restoreFocus>\n <div\n ref={objectRef}\n {...keyboardProps}\n className={actionBarStyles({isEmphasized, isInContainer: !!scrollRef, isEntering, isExiting})}\n style={{insetInlineEnd: `calc(var(--insetEnd) + ${scrollbarWidth}px)`}}>\n <div className={style({order: 1, marginStart: 'auto'})}>\n <ActionButtonGroup\n staticColor={isEmphasized ? 'auto' : undefined}\n isQuiet\n aria-label={stringFormatter.format('actionbar.actions')}>\n {children}\n </ActionButtonGroup>\n </div>\n <div className={style({order: 0, display: 'flex', alignItems: 'center', gap: 4})}>\n <CloseButton\n staticColor={isEmphasized ? 'auto' : undefined}\n aria-label={stringFormatter.format('actionbar.clearSelection')}\n onPress={() => onClearSelection?.()} />\n <span className={style({font: 'ui', color: {default: 'neutral', isEmphasized: 'gray-25'}})({isEmphasized})}>\n {lastCount === 'all'\n ? stringFormatter.format('actionbar.selectedAll')\n : stringFormatter.format('actionbar.selected', {count: lastCount})}\n </span>\n </div>\n </div>\n </FocusScope>\n );\n});\n\ninterface ActionBarContainerHookProps {\n selectedKeys?: 'all' | Iterable<Key>,\n defaultSelectedKeys?: 'all' | Iterable<Key>,\n onSelectionChange?: (keys: Set<Key>) => void,\n renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement,\n scrollRef?: RefObject<HTMLElement | null>\n}\n\nexport function useActionBarContainer(props: ActionBarContainerHookProps) {\n let {renderActionBar, scrollRef} = props;\n let [selectedKeys, setSelectedKeys] = useControlledState(props.selectedKeys, props.defaultSelectedKeys || new Set(), props.onSelectionChange);\n let selectedKeysSet = useMemo(() => selectedKeys === 'all' ? selectedKeys as 'all' : new Set(selectedKeys), [selectedKeys]);\n let actionBar = useMemo(() => renderActionBar?.(selectedKeysSet), [renderActionBar, selectedKeysSet]);\n let selectedItemCount = selectedKeysSet === 'all' ? 'all' as const : selectedKeysSet.size;\n let [actionBarHeight, setActionBarHeight] = useState(0);\n let actionBarRef = useCallback((ref: DOMRefValue | null) => {\n let actionBar = ref?.UNSAFE_getDOMNode();\n if (actionBar) {\n setActionBarHeight(actionBar.offsetHeight + 8);\n } else {\n setActionBarHeight(0);\n }\n }, []);\n\n let actionBarContext = useMemo(() => ({\n ref: actionBarRef,\n scrollRef,\n selectedItemCount,\n onClearSelection: () => setSelectedKeys(new Set())\n }), [scrollRef, actionBarRef, selectedItemCount, setSelectedKeys]);\n\n let wrappedActionBar = useMemo(() => (\n <ActionBarContext.Provider value={actionBarContext}>\n {actionBar}\n </ActionBarContext.Provider>\n ), [actionBarContext, actionBar]);\n\n return {\n selectedKeys,\n onSelectionChange: setSelectedKeys,\n actionBar: wrappedActionBar,\n actionBarHeight\n };\n}\n"],"names":[],"version":3,"file":"ActionBar.css.map"}
1
+ {"mappings":"AC4BwB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;;;EAqIA;;;;EAAA;;;;EAQA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAKG;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAlJH;EAkJG;;;;EAAA;;;;;AAlJH;EAAA;IAAA;;;;;;AAkJG;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA","sources":["a1b352514784d267","packages/@react-spectrum/s2/src/ActionBar.tsx"],"sourcesContent":["@import \"ae871d7b3899fe46\";\n@import \"b12d7526a8920c7d\";\n@import \"ac539ec7d1ef9296\";\n@import \"e8e91cecf3846843\";\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 {ActionButtonGroup} from './ActionButtonGroup';\nimport {announce} from '@react-aria/live-announcer';\nimport {CloseButton} from './CloseButton';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, ForwardedRef, forwardRef, ReactElement, ReactNode, RefObject, useCallback, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, Key} from '@react-types/shared';\nimport {FocusScope, useKeyboard} from 'react-aria';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {style} from '../style' with {type: 'macro'};\nimport {useControlledState} from '@react-stately/utils';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useEnterAnimation, useExitAnimation, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nconst actionBarStyles = style({\n borderRadius: 'lg',\n '--s2-container-bg': {\n type: 'backgroundColor',\n value: {\n default: 'elevated',\n isEmphasized: 'neutral'\n }\n },\n backgroundColor: '--s2-container-bg',\n boxShadow: 'elevated',\n boxSizing: 'border-box',\n outlineStyle: 'solid',\n outlineWidth: 1,\n outlineOffset: -1,\n outlineColor: {\n default: 'gray-200',\n isEmphasized: 'transparent',\n forcedColors: 'ButtonBorder'\n },\n paddingX: 8,\n paddingY: 12,\n display: 'flex',\n gap: 16,\n alignItems: 'center',\n position: {\n isInContainer: 'absolute'\n },\n bottom: 0,\n insetStart: 8,\n '--insetEnd': {\n type: 'insetEnd',\n value: 8\n },\n width: {\n default: 'full',\n isInContainer: 'auto'\n },\n marginX: 'auto',\n maxWidth: 960,\n transition: 'transform',\n transitionDuration: 200,\n translateY: {\n default: -8,\n isEntering: 'full',\n isExiting: 'full'\n }\n});\n\nexport interface ActionBarProps extends SlotProps {\n /** A list of ActionButtons to display. */\n children: ReactNode,\n /** Whether the ActionBar should be displayed with a emphasized style. */\n isEmphasized?: boolean,\n /** The number of selected items that the ActionBar is currently linked to. If 0, the ActionBar is hidden. */\n selectedItemCount?: number | 'all',\n /** Handler that is called when the ActionBar clear button is pressed. */\n onClearSelection?: () => void,\n /** A ref to the scrollable element the ActionBar appears above. */\n scrollRef?: RefObject<HTMLElement | null>\n}\n\nexport const ActionBarContext = createContext<ContextValue<Partial<ActionBarProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nexport const ActionBar = forwardRef(function ActionBar(props: ActionBarProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionBarContext);\n let domRef = useDOMRef(ref);\n\n let isOpen = props.selectedItemCount !== 0;\n let isExiting = useExitAnimation(domRef, isOpen && props.scrollRef != null);\n if (!isOpen && !isExiting) {\n return null;\n }\n\n return <ActionBarInner {...props} ref={domRef} isExiting={isExiting} />;\n});\n\nconst ActionBarInner = forwardRef(function ActionBarInner(props: ActionBarProps & {isExiting: boolean}, ref: ForwardedRef<HTMLDivElement | null>) {\n let {isEmphasized, selectedItemCount = 0, children, onClearSelection, isExiting} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n\n // Store the last count greater than zero so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n \n // Measure the width of the collection's scrollbar and offset the action bar by that amount.\n let scrollRef = props.scrollRef;\n let [scrollbarWidth, setScrollbarWidth] = useState(0);\n let updateScrollbarWidth = useCallback(() => {\n let el = scrollRef?.current;\n if (el) {\n let w = el.offsetWidth - el.clientWidth;\n setScrollbarWidth(w);\n }\n }, [scrollRef]);\n\n useResizeObserver({\n ref: scrollRef,\n onResize: updateScrollbarWidth\n });\n\n let {keyboardProps} = useKeyboard({\n onKeyDown(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClearSelection?.();\n } else {\n e.continuePropagation();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current && scrollRef) {\n isInitial.current = false;\n announce(stringFormatter.format('actionbar.actionsAvailable'));\n }\n }, [stringFormatter, scrollRef]);\n\n let objectRef = useObjectRef(ref);\n let isEntering = useEnterAnimation(objectRef, !!scrollRef);\n\n return (\n <FocusScope restoreFocus>\n <div\n ref={objectRef}\n {...keyboardProps}\n className={actionBarStyles({isEmphasized, isInContainer: !!scrollRef, isEntering, isExiting})}\n style={{insetInlineEnd: `calc(var(--insetEnd) + ${scrollbarWidth}px)`}}>\n <div className={style({order: 1, marginStart: 'auto'})}>\n <ActionButtonGroup\n staticColor={isEmphasized ? 'auto' : undefined}\n isQuiet\n aria-label={stringFormatter.format('actionbar.actions')}>\n {children}\n </ActionButtonGroup>\n </div>\n <div className={style({order: 0, display: 'flex', alignItems: 'center', gap: 4})}>\n <CloseButton\n staticColor={isEmphasized ? 'auto' : undefined}\n aria-label={stringFormatter.format('actionbar.clearSelection')}\n onPress={() => onClearSelection?.()} />\n <span className={style({font: 'ui', color: {default: 'neutral', isEmphasized: 'gray-25'}})({isEmphasized})}>\n {lastCount === 'all'\n ? stringFormatter.format('actionbar.selectedAll')\n : stringFormatter.format('actionbar.selected', {count: lastCount})}\n </span>\n </div>\n </div>\n </FocusScope>\n );\n});\n\ninterface ActionBarContainerHookProps {\n selectedKeys?: 'all' | Iterable<Key>,\n defaultSelectedKeys?: 'all' | Iterable<Key>,\n onSelectionChange?: (keys: Set<Key>) => void,\n renderActionBar?: (selectedKeys: 'all' | Set<Key>) => ReactElement,\n scrollRef?: RefObject<HTMLElement | null>\n}\n\nexport function useActionBarContainer(props: ActionBarContainerHookProps) {\n let {renderActionBar, scrollRef} = props;\n let [selectedKeys, setSelectedKeys] = useControlledState(props.selectedKeys, props.defaultSelectedKeys || new Set(), props.onSelectionChange);\n let selectedKeysSet = useMemo(() => selectedKeys === 'all' ? selectedKeys as 'all' : new Set(selectedKeys), [selectedKeys]);\n let actionBar = useMemo(() => renderActionBar?.(selectedKeysSet), [renderActionBar, selectedKeysSet]);\n let selectedItemCount = selectedKeysSet === 'all' ? 'all' as const : selectedKeysSet.size;\n let [actionBarHeight, setActionBarHeight] = useState(0);\n let actionBarRef = useCallback((ref: DOMRefValue | null) => {\n let actionBar = ref?.UNSAFE_getDOMNode();\n if (actionBar) {\n setActionBarHeight(actionBar.offsetHeight + 8);\n } else {\n setActionBarHeight(0);\n }\n }, []);\n\n let actionBarContext = useMemo(() => ({\n ref: actionBarRef,\n scrollRef,\n selectedItemCount,\n onClearSelection: () => setSelectedKeys(new Set())\n }), [scrollRef, actionBarRef, selectedItemCount, setSelectedKeys]);\n\n let wrappedActionBar = useMemo(() => (\n <ActionBarContext.Provider value={actionBarContext}>\n {actionBar}\n </ActionBarContext.Provider>\n ), [actionBarContext, actionBar]);\n\n return {\n selectedKeys,\n onSelectionChange: setSelectedKeys,\n actionBar: wrappedActionBar,\n actionBarHeight\n };\n}\n"],"names":[],"version":3,"file":"ActionBar.css.map"}
@@ -433,8 +433,6 @@
433
433
  }
434
434
  }
435
435
 
436
- @layer UNSAFE_overrides;
437
-
438
436
  @layer _.b.a {
439
437
  @media (forced-colors: active) {
440
438
  .da_____M {
@@ -490,8 +488,4 @@
490
488
  }
491
489
  }
492
490
  }
493
-
494
- .\.:not(#a#b) {
495
- all: revert-layer;
496
- }
497
491
  /*# sourceMappingURL=ActionButton.css.map */
@@ -1 +1 @@
1
- {"mappings":"AC6DyB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAsNQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAGb;;;;EAAA;;;;EAIA;;;;EAAA;;;;EAAA;;;;;AA7NK;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAsNQ","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","/*\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, 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 {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, staticColor, StyleProps} from './style-utils' with { type: 'macro' };\nimport {IconContext} from './Icon';\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'>, 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]))';\nexport const btnStyles = style<ButtonRenderProps & ActionButtonStyleProps & ToggleButtonStyleProps & ActionGroupItemStyleProps & {isInGroup: boolean, isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n columnGap: 'text-to-visual',\n flexShrink: {\n default: 1,\n isInGroup: 0\n },\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n font: 'control',\n fontWeight: 'medium',\n userSelect: 'none',\n height: 'control',\n minWidth: 'control',\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: 'neutral',\n isEmphasized: 'accent',\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: '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 paddingX: {\n default: 'edge-to-text',\n [iconOnly]: 0\n },\n paddingY: 0,\n borderTopStartRadius: {\n default: 'control',\n density: {\n compact: {\n default: 'none',\n ':first-child': 'control'\n }\n }\n },\n borderTopEndRadius: {\n default: 'control',\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':last-child': 'control'\n },\n vertical: {\n ':first-child': 'control'\n }\n }\n }\n }\n },\n borderBottomStartRadius: {\n default: 'control',\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':first-child': 'control'\n },\n vertical: {\n ':last-child': 'control'\n }\n }\n }\n }\n },\n borderBottomEndRadius: {\n default: 'control',\n density: {\n compact: {\n default: 'none',\n ':last-child': 'control'\n }\n }\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n [iconOnly]: 0\n }\n },\n zIndex: {\n isFocusVisible: 2\n },\n disableTapHighlight: true\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<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 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({paddingY: '--labelPadding', 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 ]}>\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":"AC6DyB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAsNQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAGb;;;;EAAA;;;;EAIA;;;;EAAA;;;;EAAA;;;;;AA7NK;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;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","/*\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, 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 {createContext, forwardRef, ReactNode, useContext} from 'react';\nimport {FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, staticColor, StyleProps} from './style-utils' with { type: 'macro' };\nimport {IconContext} from './Icon';\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'>, 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]))';\nexport const btnStyles = style<ButtonRenderProps & ActionButtonStyleProps & ToggleButtonStyleProps & ActionGroupItemStyleProps & {isInGroup: boolean, isStaticColor: boolean}>({\n ...focusRing(),\n ...staticColor(),\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n columnGap: 'text-to-visual',\n flexShrink: {\n default: 1,\n isInGroup: 0\n },\n flexGrow: {\n isJustified: 1\n },\n flexBasis: {\n isJustified: 0\n },\n font: 'control',\n fontWeight: 'medium',\n userSelect: 'none',\n height: 'control',\n minWidth: 'control',\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: 'neutral',\n isEmphasized: 'accent',\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: '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 paddingX: {\n default: 'edge-to-text',\n [iconOnly]: 0\n },\n paddingY: 0,\n borderTopStartRadius: {\n default: 'control',\n density: {\n compact: {\n default: 'none',\n ':first-child': 'control'\n }\n }\n },\n borderTopEndRadius: {\n default: 'control',\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':last-child': 'control'\n },\n vertical: {\n ':first-child': 'control'\n }\n }\n }\n }\n },\n borderBottomStartRadius: {\n default: 'control',\n density: {\n compact: {\n default: 'none',\n orientation: {\n horizontal: {\n ':first-child': 'control'\n },\n vertical: {\n ':last-child': 'control'\n }\n }\n }\n }\n },\n borderBottomEndRadius: {\n default: 'control',\n density: {\n compact: {\n default: 'none',\n ':last-child': 'control'\n }\n }\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n [iconOnly]: 0\n }\n },\n zIndex: {\n isFocusVisible: 2\n },\n disableTapHighlight: true\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<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 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({paddingY: '--labelPadding', 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 ]}>\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,7 +1,3 @@
1
- .\.:not(#a#b) {
2
- all: revert-layer;
3
- }
4
-
5
1
  @layer _.a {
6
2
  ._0d {
7
3
  display: flex;
@@ -40,5 +36,5 @@
40
36
  }
41
37
  }
42
38
 
43
- @layer _.b, UNSAFE_overrides;
39
+ @layer _.b;
44
40
  /*# sourceMappingURL=ActionButtonGroup.css.map */
@@ -1 +1 @@
1
- {"mappings":"AAiDgC;;;;AAAA;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA","sources":["packages/@react-spectrum/s2/src/ActionButtonGroup.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 {AriaLabelingProps} from '@react-types/shared';\nimport {ContextValue, SlotProps, Toolbar} from 'react-aria-components';\nimport {createContext, ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionButtonGroupProps extends AriaLabelingProps, UnsafeStyles, SlotProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The children of the group. */\n children: ReactNode,\n /**\n * Size of the buttons.\n * @default \"M\"\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL',\n /**\n * Spacing between the buttons.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular',\n /** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */\n isQuiet?: boolean,\n /** Whether the buttons should divide the container width equally. */\n isJustified?: boolean,\n /** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */\n staticColor?: 'white' | 'black' | 'auto',\n /**\n * The axis the group should align with.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /** Whether the group is disabled. */\n isDisabled?: boolean\n}\n\nexport const actionGroupStyle = style({\n display: 'flex',\n flexDirection: {\n orientation: {\n horizontal: 'row',\n vertical: 'column'\n }\n },\n gap: {\n density: {\n compact: 2,\n regular: {\n size: {\n XS: 4,\n S: 4,\n M: 8,\n L: 8,\n XL: 8\n }\n }\n }\n }\n}, getAllowedOverrides({height: true}));\n\n\nexport const ActionButtonGroupContext = createContext<ContextValue<Partial<ActionButtonGroupProps>, HTMLDivElement>>(null);\n\n/**\n * An ActionButtonGroup is a grouping of related ActionButtons.\n */\nexport const ActionButtonGroup = forwardRef(function ActionButtonGroup(props: ActionButtonGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionButtonGroupContext);\n let {\n density = 'regular',\n size = 'M',\n orientation = 'horizontal',\n isJustified,\n children,\n UNSAFE_className = '',\n UNSAFE_style,\n styles\n } = props;\n\n return (\n <Toolbar\n {...props}\n ref={ref}\n style={UNSAFE_style}\n className={UNSAFE_className + actionGroupStyle({size, density, orientation, isJustified}, styles)}>\n <ActionButtonGroupContext.Provider value={props}>\n {children}\n </ActionButtonGroupContext.Provider>\n </Toolbar>\n );\n});\n"],"names":[],"version":3,"file":"ActionButtonGroup.css.map"}
1
+ {"mappings":"AAiDgC;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA","sources":["packages/@react-spectrum/s2/src/ActionButtonGroup.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 {AriaLabelingProps} from '@react-types/shared';\nimport {ContextValue, SlotProps, Toolbar} from 'react-aria-components';\nimport {createContext, ForwardedRef, forwardRef, ReactNode} from 'react';\nimport {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ActionButtonGroupProps extends AriaLabelingProps, UnsafeStyles, SlotProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight,\n /** The children of the group. */\n children: ReactNode,\n /**\n * Size of the buttons.\n * @default \"M\"\n */\n size?: 'XS' | 'S' | 'M' | 'L' | 'XL',\n /**\n * Spacing between the buttons.\n * @default \"regular\"\n */\n density?: 'compact' | 'regular',\n /** Whether the button should be displayed with a [quiet style](https://spectrum.adobe.com/page/action-button/#Quiet). */\n isQuiet?: boolean,\n /** Whether the buttons should divide the container width equally. */\n isJustified?: boolean,\n /** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */\n staticColor?: 'white' | 'black' | 'auto',\n /**\n * The axis the group should align with.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical',\n /** Whether the group is disabled. */\n isDisabled?: boolean\n}\n\nexport const actionGroupStyle = style({\n display: 'flex',\n flexDirection: {\n orientation: {\n horizontal: 'row',\n vertical: 'column'\n }\n },\n gap: {\n density: {\n compact: 2,\n regular: {\n size: {\n XS: 4,\n S: 4,\n M: 8,\n L: 8,\n XL: 8\n }\n }\n }\n }\n}, getAllowedOverrides({height: true}));\n\n\nexport const ActionButtonGroupContext = createContext<ContextValue<Partial<ActionButtonGroupProps>, HTMLDivElement>>(null);\n\n/**\n * An ActionButtonGroup is a grouping of related ActionButtons.\n */\nexport const ActionButtonGroup = forwardRef(function ActionButtonGroup(props: ActionButtonGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ActionButtonGroupContext);\n let {\n density = 'regular',\n size = 'M',\n orientation = 'horizontal',\n isJustified,\n children,\n UNSAFE_className = '',\n UNSAFE_style,\n styles\n } = props;\n\n return (\n <Toolbar\n {...props}\n ref={ref}\n style={UNSAFE_style}\n className={UNSAFE_className + actionGroupStyle({size, density, orientation, isJustified}, styles)}>\n <ActionButtonGroupContext.Provider value={props}>\n {children}\n </ActionButtonGroupContext.Provider>\n </Toolbar>\n );\n});\n"],"names":[],"version":3,"file":"ActionButtonGroup.css.map"}
@@ -1,7 +1,3 @@
1
- .\.:not(#a#b) {
2
- all: revert-layer;
3
- }
4
-
5
1
  @layer _.a {
6
2
  .zd {
7
3
  margin-inline-end: .5rem;
@@ -16,5 +12,5 @@
16
12
  }
17
13
  }
18
14
 
19
- @layer _.b, UNSAFE_overrides;
15
+ @layer _.b;
20
16
  /*# sourceMappingURL=AlertDialog.css.map */
@@ -1 +1 @@
1
- {"mappings":"AA+Da;;;;AAAA;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA","sources":["packages/@react-spectrum/s2/src/AlertDialog.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 AlertTriangle from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Button} from './Button';\nimport {ButtonGroup} from './ButtonGroup';\nimport {CenterBaseline} from './CenterBaseline';\nimport {chain} from '@react-aria/utils';\nimport {Content, Heading} from './Content';\nimport {Dialog} from './Dialog';\nimport {DOMProps, DOMRef} from '@react-types/shared';\nimport {forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport NoticeSquare from '../s2wf-icons/S2_Icon_AlertDiamond_20_N.svg';\nimport {Provider} from 'react-aria-components';\nimport {style} from '../style' with {type: 'macro'};\nimport {UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AlertDialogProps extends DOMProps, UnsafeStyles {\n /** The [visual style](https://spectrum.adobe.com/page/alert-dialog/#Options) of the AlertDialog. */\n variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning',\n /** The title of the AlertDialog. */\n title: string,\n /** The contents of the AlertDialog. */\n children: ReactNode,\n /** The label to display within the cancel button. */\n cancelLabel?: string,\n /** The label to display within the confirm button. */\n primaryActionLabel: string,\n /** The label to display within the secondary button. */\n secondaryActionLabel?: string,\n /** Whether the primary button is disabled. */\n isPrimaryActionDisabled?: boolean,\n /** Whether the secondary button is disabled. */\n isSecondaryActionDisabled?: boolean,\n /** Handler that is called when the cancel button is pressed. */\n onCancel?: () => void,\n /** Handler that is called when the primary button is pressed. */\n onPrimaryAction?: () => void,\n /** Handler that is called when the secondary button is pressed. */\n onSecondaryAction?: () => void,\n /** Button to focus by default when the dialog opens. */\n autoFocusButton?: 'cancel' | 'primary' | 'secondary',\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst icon = style({\n marginEnd: 8,\n '--iconPrimary': {\n type: 'fill',\n value: {\n variant: {\n error: 'negative',\n warning: 'notice'\n }\n }\n }\n});\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nexport const AlertDialog = forwardRef(function AlertDialog(props: AlertDialogProps, ref: DOMRef) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n autoFocusButton,\n cancelLabel,\n secondaryActionLabel,\n primaryActionLabel,\n isSecondaryActionDisabled,\n isPrimaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n title,\n children,\n variant = 'confirmation'\n } = props;\n\n let buttonVariant = 'primary';\n if (variant === 'confirmation') {\n buttonVariant = 'accent';\n } else if (variant === 'destructive') {\n buttonVariant = 'negative';\n }\n\n return (\n <Dialog\n role=\"alertdialog\"\n ref={ref}\n size={props.size}\n UNSAFE_style={props.UNSAFE_style}\n UNSAFE_className={(props.UNSAFE_className || '')}>\n {({close}) => (\n <>\n <Provider\n values={[\n [IconContext, {styles: icon({variant})}]\n ]}>\n <Heading slot=\"title\">\n <CenterBaseline>\n {variant === 'error' && <AlertTriangle aria-label={stringFormatter.format('dialog.alert')} />}\n {variant === 'warning' && <NoticeSquare aria-label={stringFormatter.format('dialog.alert')} />}\n {title}\n </CenterBaseline>\n </Heading>\n </Provider>\n <Content>{children}</Content>\n <ButtonGroup>\n {cancelLabel &&\n <Button\n onPress={() => chain(close(), onCancel())}\n variant=\"secondary\"\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'cancel'}>\n {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n onPress={() => chain(close(), onSecondaryAction())}\n variant=\"secondary\"\n isDisabled={isSecondaryActionDisabled}\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'secondary'}>\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={buttonVariant as 'primary' | 'accent' | 'negative'}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n onPress={() => chain(close(), onPrimaryAction())}>\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </>\n )}\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.css.map"}
1
+ {"mappings":"AA+Da;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA","sources":["packages/@react-spectrum/s2/src/AlertDialog.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 AlertTriangle from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {Button} from './Button';\nimport {ButtonGroup} from './ButtonGroup';\nimport {CenterBaseline} from './CenterBaseline';\nimport {chain} from '@react-aria/utils';\nimport {Content, Heading} from './Content';\nimport {Dialog} from './Dialog';\nimport {DOMProps, DOMRef} from '@react-types/shared';\nimport {forwardRef, ReactNode} from 'react';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport NoticeSquare from '../s2wf-icons/S2_Icon_AlertDiamond_20_N.svg';\nimport {Provider} from 'react-aria-components';\nimport {style} from '../style' with {type: 'macro'};\nimport {UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface AlertDialogProps extends DOMProps, UnsafeStyles {\n /** The [visual style](https://spectrum.adobe.com/page/alert-dialog/#Options) of the AlertDialog. */\n variant?: 'confirmation' | 'information' | 'destructive' | 'error' | 'warning',\n /** The title of the AlertDialog. */\n title: string,\n /** The contents of the AlertDialog. */\n children: ReactNode,\n /** The label to display within the cancel button. */\n cancelLabel?: string,\n /** The label to display within the confirm button. */\n primaryActionLabel: string,\n /** The label to display within the secondary button. */\n secondaryActionLabel?: string,\n /** Whether the primary button is disabled. */\n isPrimaryActionDisabled?: boolean,\n /** Whether the secondary button is disabled. */\n isSecondaryActionDisabled?: boolean,\n /** Handler that is called when the cancel button is pressed. */\n onCancel?: () => void,\n /** Handler that is called when the primary button is pressed. */\n onPrimaryAction?: () => void,\n /** Handler that is called when the secondary button is pressed. */\n onSecondaryAction?: () => void,\n /** Button to focus by default when the dialog opens. */\n autoFocusButton?: 'cancel' | 'primary' | 'secondary',\n /**\n * The size of the Dialog.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L'\n}\n\nconst icon = style({\n marginEnd: 8,\n '--iconPrimary': {\n type: 'fill',\n value: {\n variant: {\n error: 'negative',\n warning: 'notice'\n }\n }\n }\n});\n\n/**\n * AlertDialogs are a specific type of Dialog. They display important information that users need to acknowledge.\n */\nexport const AlertDialog = forwardRef(function AlertDialog(props: AlertDialogProps, ref: DOMRef) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n autoFocusButton,\n cancelLabel,\n secondaryActionLabel,\n primaryActionLabel,\n isSecondaryActionDisabled,\n isPrimaryActionDisabled,\n onCancel = () => {},\n onPrimaryAction = () => {},\n onSecondaryAction = () => {},\n title,\n children,\n variant = 'confirmation'\n } = props;\n\n let buttonVariant = 'primary';\n if (variant === 'confirmation') {\n buttonVariant = 'accent';\n } else if (variant === 'destructive') {\n buttonVariant = 'negative';\n }\n\n return (\n <Dialog\n role=\"alertdialog\"\n ref={ref}\n size={props.size}\n UNSAFE_style={props.UNSAFE_style}\n UNSAFE_className={(props.UNSAFE_className || '')}>\n {({close}) => (\n <>\n <Provider\n values={[\n [IconContext, {styles: icon({variant})}]\n ]}>\n <Heading slot=\"title\">\n <CenterBaseline>\n {variant === 'error' && <AlertTriangle aria-label={stringFormatter.format('dialog.alert')} />}\n {variant === 'warning' && <NoticeSquare aria-label={stringFormatter.format('dialog.alert')} />}\n {title}\n </CenterBaseline>\n </Heading>\n </Provider>\n <Content>{children}</Content>\n <ButtonGroup>\n {cancelLabel &&\n <Button\n onPress={() => chain(close(), onCancel())}\n variant=\"secondary\"\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'cancel'}>\n {cancelLabel}\n </Button>\n }\n {secondaryActionLabel &&\n <Button\n onPress={() => chain(close(), onSecondaryAction())}\n variant=\"secondary\"\n isDisabled={isSecondaryActionDisabled}\n fillStyle=\"outline\"\n autoFocus={autoFocusButton === 'secondary'}>\n {secondaryActionLabel}\n </Button>\n }\n <Button\n variant={buttonVariant as 'primary' | 'accent' | 'negative'}\n isDisabled={isPrimaryActionDisabled}\n autoFocus={autoFocusButton === 'primary'}\n onPress={() => chain(close(), onPrimaryAction())}>\n {primaryActionLabel}\n </Button>\n </ButtonGroup>\n </>\n )}\n </Dialog>\n );\n});\n"],"names":[],"version":3,"file":"AlertDialog.css.map"}
package/dist/Avatar.css CHANGED
@@ -1,7 +1,3 @@
1
- .\.:not(#a#b) {
2
- all: revert-layer;
3
- }
4
-
5
1
  @layer _.a {
6
2
  ._wf {
7
3
  border-start-start-radius: 9999px;
@@ -60,5 +56,5 @@
60
56
  }
61
57
  }
62
58
 
63
- @layer _.b, UNSAFE_overrides;
59
+ @layer _.b;
64
60
  /*# sourceMappingURL=Avatar.css.map */
@@ -1 +1 @@
1
- {"mappings":"AAsCoB;;;;AAAA;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA","sources":["packages/@react-spectrum/s2/src/Avatar.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 {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StylesPropWithoutWidth, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {Image} from './Image';\nimport {style} from '../style' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AvatarProps extends UnsafeStyles, DOMProps, SlotProps {\n /** Text description of the avatar. */\n alt?: string,\n /** The image URL for the avatar. */\n src?: string,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithoutWidth,\n /**\n * The size of the avatar.\n * @default 24\n */\n size?: 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96 | 112 | (number & {}),\n /** Whether the avatar is over a color background. */\n isOverBackground?: boolean\n}\n\nconst imageStyles = style({\n borderRadius: 'full',\n size: 20,\n flexShrink: 0,\n flexGrow: 0,\n disableTapHighlight: true,\n outlineStyle: {\n default: 'none',\n isOverBackground: 'solid'\n },\n outlineColor: '--s2-container-bg',\n outlineWidth: {\n default: 1,\n isLarge: 2\n }\n}, getAllowedOverrides({width: false}));\n\nexport const AvatarContext = createContext<ContextValue<AvatarProps, DOMRefValue<HTMLImageElement>>>(null);\n\n/**\n * An avatar is a thumbnail representation of an entity, such as a user or an organization.\n */\nexport const Avatar = forwardRef(function Avatar(props: AvatarProps, ref: DOMRef<HTMLImageElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AvatarContext);\n let domRef = useDOMRef(ref);\n let {\n alt = '',\n src,\n UNSAFE_style,\n UNSAFE_className = '',\n size = 24,\n isOverBackground,\n slot = 'avatar',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n\n let remSize = size / 16 + 'rem';\n let isLarge = size >= 64;\n return (\n <Image\n {...domProps}\n ref={domRef}\n slot={slot}\n alt={alt}\n UNSAFE_style={{\n ...UNSAFE_style,\n width: remSize,\n height: remSize\n }}\n UNSAFE_className={UNSAFE_className}\n styles={imageStyles({isOverBackground, isLarge}, props.styles)}\n src={src} />\n );\n});\n"],"names":[],"version":3,"file":"Avatar.css.map"}
1
+ {"mappings":"AAsCoB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA","sources":["packages/@react-spectrum/s2/src/Avatar.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 {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, forwardRef} from 'react';\nimport {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StylesPropWithoutWidth, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {Image} from './Image';\nimport {style} from '../style' with { type: 'macro' };\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AvatarProps extends UnsafeStyles, DOMProps, SlotProps {\n /** Text description of the avatar. */\n alt?: string,\n /** The image URL for the avatar. */\n src?: string,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithoutWidth,\n /**\n * The size of the avatar.\n * @default 24\n */\n size?: 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96 | 112 | (number & {}),\n /** Whether the avatar is over a color background. */\n isOverBackground?: boolean\n}\n\nconst imageStyles = style({\n borderRadius: 'full',\n size: 20,\n flexShrink: 0,\n flexGrow: 0,\n disableTapHighlight: true,\n outlineStyle: {\n default: 'none',\n isOverBackground: 'solid'\n },\n outlineColor: '--s2-container-bg',\n outlineWidth: {\n default: 1,\n isLarge: 2\n }\n}, getAllowedOverrides({width: false}));\n\nexport const AvatarContext = createContext<ContextValue<AvatarProps, DOMRefValue<HTMLImageElement>>>(null);\n\n/**\n * An avatar is a thumbnail representation of an entity, such as a user or an organization.\n */\nexport const Avatar = forwardRef(function Avatar(props: AvatarProps, ref: DOMRef<HTMLImageElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AvatarContext);\n let domRef = useDOMRef(ref);\n let {\n alt = '',\n src,\n UNSAFE_style,\n UNSAFE_className = '',\n size = 24,\n isOverBackground,\n slot = 'avatar',\n ...otherProps\n } = props;\n const domProps = filterDOMProps(otherProps);\n\n let remSize = size / 16 + 'rem';\n let isLarge = size >= 64;\n return (\n <Image\n {...domProps}\n ref={domRef}\n slot={slot}\n alt={alt}\n UNSAFE_style={{\n ...UNSAFE_style,\n width: remSize,\n height: remSize\n }}\n UNSAFE_className={UNSAFE_className}\n styles={imageStyles({isOverBackground, isLarge}, props.styles)}\n src={src} />\n );\n});\n"],"names":[],"version":3,"file":"Avatar.css.map"}
@@ -104,8 +104,6 @@
104
104
  }
105
105
  }
106
106
 
107
- @layer UNSAFE_overrides;
108
-
109
107
  @layer _.c {
110
108
  ._d-enzwzjc:lang(he) {
111
109
  font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;
@@ -173,8 +171,4 @@
173
171
  }
174
172
  }
175
173
  }
176
-
177
- .\.:not(#a#b) {
178
- all: revert-layer;
179
- }
180
174
  /*# sourceMappingURL=AvatarGroup.css.map */
@@ -1 +1 @@
1
- {"mappings":"ACuCe;EAAA;;;;EAOF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;;;;;;;;;;;;;EAAA;;;;EAAA;;;;EAgBK;;;;EAAA;;;;;AAvBH;EAAA;;;;EAOF;;;;EAAA;;;;;AAPE;;AAOF;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAgBK","sources":["0a4c7ff616b39f15","packages/@react-spectrum/s2/src/AvatarGroup.tsx"],"sourcesContent":["@import \"4466692f07e15352\";\n@import \"a5389b273a848c34\";\n@import \"443fa43b7b24f112\";\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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {AvatarContext} from './Avatar';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, CSSProperties, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StylesPropWithoutWidth, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLabel} from 'react-aria';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AvatarGroupProps extends UnsafeStyles, DOMProps, AriaLabelingProps, SlotProps {\n /** Avatar children of the avatar group. */\n children: ReactNode,\n /** The label for the avatar group. */\n label?: string,\n /**\n * The size of the avatar group.\n * @default 24\n */\n size?: 16 | 20 | 24 | 28 | 32 | 36 | 40,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithoutWidth\n}\n\nexport const AvatarGroupContext = createContext<ContextValue<AvatarGroupProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst avatar = style({\n marginStart: {\n default: '[calc(var(--size) / -4)]',\n ':first-child': 0\n }\n});\n\nconst text = style({\n marginStart: 8,\n truncate: true,\n font: {\n size: {\n 16: 'ui-xs',\n 20: 'ui-sm',\n 24: 'ui',\n 28: 'ui-lg',\n 32: 'ui-xl',\n 36: 'ui-2xl',\n 40: 'ui-3xl'\n }\n }\n});\n\nconst container = style({\n display: 'flex',\n alignItems: 'center'\n}, getAllowedOverrides({width: false}));\n\n/**\n * An avatar group is a grouping of avatars that are related to each other.\n */\nexport const AvatarGroup = forwardRef(function AvatarGroup(props: AvatarGroupProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AvatarGroupContext);\n let domRef = useDOMRef(ref);\n let {children, label, size = 24, styles, UNSAFE_style, UNSAFE_className, ...otherProps} = props;\n let {labelProps, fieldProps} = useLabel({\n ...props,\n labelElementType: 'span'\n });\n\n return (\n <AvatarContext.Provider value={{styles: avatar, size, isOverBackground: true}}>\n <div\n ref={domRef}\n {...filterDOMProps(otherProps)}\n {...fieldProps}\n role=\"group\"\n className={(UNSAFE_className ?? '') + container(null, styles)}\n style={{\n ...UNSAFE_style,\n '--size': size / 16 + 'rem'\n } as CSSProperties}>\n {children}\n {label && <span {...labelProps} className={text({size: String(size)})}>{label}</span>}\n </div>\n </AvatarContext.Provider>\n );\n});\n"],"names":[],"version":3,"file":"AvatarGroup.css.map"}
1
+ {"mappings":"ACuCe;EAAA;;;;EAOF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;;;;;;;;;;;;;EAAA;;;;EAAA;;;;EAgBK;;;;EAAA;;;;;AAvBH;EAAA;;;;EAOF;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA","sources":["0a4c7ff616b39f15","packages/@react-spectrum/s2/src/AvatarGroup.tsx"],"sourcesContent":["@import \"4466692f07e15352\";\n@import \"a5389b273a848c34\";\n@import \"443fa43b7b24f112\";\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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {AvatarContext} from './Avatar';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {createContext, CSSProperties, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {getAllowedOverrides, StylesPropWithoutWidth, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLabel} from 'react-aria';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface AvatarGroupProps extends UnsafeStyles, DOMProps, AriaLabelingProps, SlotProps {\n /** Avatar children of the avatar group. */\n children: ReactNode,\n /** The label for the avatar group. */\n label?: string,\n /**\n * The size of the avatar group.\n * @default 24\n */\n size?: 16 | 20 | 24 | 28 | 32 | 36 | 40,\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithoutWidth\n}\n\nexport const AvatarGroupContext = createContext<ContextValue<AvatarGroupProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst avatar = style({\n marginStart: {\n default: '[calc(var(--size) / -4)]',\n ':first-child': 0\n }\n});\n\nconst text = style({\n marginStart: 8,\n truncate: true,\n font: {\n size: {\n 16: 'ui-xs',\n 20: 'ui-sm',\n 24: 'ui',\n 28: 'ui-lg',\n 32: 'ui-xl',\n 36: 'ui-2xl',\n 40: 'ui-3xl'\n }\n }\n});\n\nconst container = style({\n display: 'flex',\n alignItems: 'center'\n}, getAllowedOverrides({width: false}));\n\n/**\n * An avatar group is a grouping of avatars that are related to each other.\n */\nexport const AvatarGroup = forwardRef(function AvatarGroup(props: AvatarGroupProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, AvatarGroupContext);\n let domRef = useDOMRef(ref);\n let {children, label, size = 24, styles, UNSAFE_style, UNSAFE_className, ...otherProps} = props;\n let {labelProps, fieldProps} = useLabel({\n ...props,\n labelElementType: 'span'\n });\n\n return (\n <AvatarContext.Provider value={{styles: avatar, size, isOverBackground: true}}>\n <div\n ref={domRef}\n {...filterDOMProps(otherProps)}\n {...fieldProps}\n role=\"group\"\n className={(UNSAFE_className ?? '') + container(null, styles)}\n style={{\n ...UNSAFE_style,\n '--size': size / 16 + 'rem'\n } as CSSProperties}>\n {children}\n {label && <span {...labelProps} className={text({size: String(size)})}>{label}</span>}\n </div>\n </AvatarContext.Provider>\n );\n});\n"],"names":[],"version":3,"file":"AvatarGroup.css.map"}
package/dist/Badge.css CHANGED
@@ -444,8 +444,6 @@
444
444
  }
445
445
  }
446
446
 
447
- @layer UNSAFE_overrides;
448
-
449
447
  @layer _.b.b {
450
448
  @media not ((hover: hover) and (pointer: fine)) {
451
449
  ._ebf {
@@ -473,8 +471,4 @@
473
471
  }
474
472
  }
475
473
  }
476
-
477
- .\.:not(#a#b) {
478
- all: revert-layer;
479
- }
480
474
  /*# sourceMappingURL=Badge.css.map */
@@ -1 +1 @@
1
- {"mappings":"ACsDc;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAmJiB;;;;EAAA;;;;EAAA;;;;EAEyB;;;;EACtC;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAtJJ;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAmJiB","sources":["31052c90be0d94da","packages/@react-spectrum/s2/src/Badge.tsx"],"sourcesContent":["@import \"08c4d7ffd2baa021\";\n@import \"1aad76937c73131b\";\n@import \"7989dc282effbbd8\";\n@import \"a50d3ac159f93c2b\";\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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {fontRelative, lightDark, style} from '../style' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {SkeletonWrapper} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface BadgeStyleProps {\n /**\n * The size of the badge.\n *\n * @default 'S'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The variant changes the background color of the badge. When badge has a semantic meaning, they should use the variant for semantic colors.\n *\n * @default 'neutral'\n */\n variant?: 'accent' | 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'gray' | 'red' | 'orange' | 'yellow' | 'charteuse' | 'celery' | 'green' | 'seafoam' | 'cyan' | 'blue' | 'indigo' | 'purple' | 'fuchsia' | 'magenta' | 'pink' | 'turquoise' | 'brown' | 'cinnamon' | 'silver',\n /**\n * The fill of the badge.\n * @default 'bold'\n */\n fillStyle?: 'bold' | 'subtle' | 'outline'\n}\n\nexport interface BadgeProps extends DOMProps, AriaLabelingProps, StyleProps, BadgeStyleProps, SlotProps {\n /**\n * The content to display in the badge.\n */\n children: ReactNode\n}\n\nexport const BadgeContext = createContext<ContextValue<Partial<BadgeProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst badge = style<BadgeStyleProps>({\n display: 'flex',\n font: 'control',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 'control',\n minHeight: 'control',\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]:only-child)': 0\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n aspectRatio: {\n ':has([slot=icon]:only-child)': 'square'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n ':has([slot=icon]:only-child)': 0\n }\n },\n columnGap: 'text-to-visual',\n color: {\n fillStyle: {\n bold: {\n default: 'white',\n variant: {\n notice: 'black',\n orange: 'black',\n yellow: 'black',\n charteuse: 'black',\n celery: 'black'\n }\n },\n subtle: 'gray-1000',\n outline: 'gray-1000'\n }\n },\n backgroundColor: {\n fillStyle: {\n bold: {\n variant: {\n accent: 'accent',\n informative: 'informative',\n neutral: 'neutral-subdued',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n gray: 'gray',\n red: 'red',\n orange: 'orange',\n yellow: 'yellow',\n charteuse: 'chartreuse',\n celery: 'celery',\n green: 'green',\n seafoam: 'seafoam',\n cyan: 'cyan',\n blue: 'blue',\n indigo: 'indigo',\n purple: 'purple',\n fuchsia: 'fuchsia',\n magenta: 'magenta',\n pink: 'pink',\n turquoise: 'turquoise',\n brown: 'brown',\n cinnamon: 'cinnamon',\n silver: 'silver'\n }\n },\n subtle: {\n variant: {\n accent: 'accent-subtle',\n informative: 'informative-subtle',\n neutral: 'neutral-subtle',\n positive: 'positive-subtle',\n notice: 'notice-subtle',\n negative: 'negative-subtle',\n gray: 'gray-subtle',\n red: 'red-subtle',\n orange: 'orange-subtle',\n yellow: 'yellow-subtle',\n charteuse: 'chartreuse-subtle',\n celery: 'celery-subtle',\n green: 'green-subtle',\n seafoam: 'seafoam-subtle',\n cyan: 'cyan-subtle',\n blue: 'blue-subtle',\n indigo: 'indigo-subtle',\n purple: 'purple-subtle',\n fuchsia: 'fuchsia-subtle',\n magenta: 'magenta-subtle',\n pink: 'pink-subtle',\n turquoise: 'turquoise-subtle',\n brown: 'brown-subtle',\n cinnamon: 'cinnamon-subtle',\n silver: 'silver-subtle'\n }\n },\n outline: 'layer-2'\n }\n },\n borderStyle: 'solid',\n boxSizing: 'border-box',\n borderWidth: 2,\n borderColor: {\n default: 'transparent',\n fillStyle: {\n outline: {\n variant: {\n accent: lightDark('accent-800', 'accent-900'), // accent-visual-color\n informative: lightDark('informative-800', 'informative-900'), // informative-visual-color\n neutral: lightDark('gray-500', 'gray-600'), // neutral-visual-color\n positive: lightDark('positive-800', 'positive-900'), // positive-visual-color\n notice: lightDark('notice-800', 'notice-900'), // notice-visual-color\n negative: lightDark('negative-800', 'negative-900') // negative-visual-color\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nexport const Badge = forwardRef(function Badge(props: BadgeProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, BadgeContext);\n let {\n children,\n variant = 'neutral',\n size = 'S',\n fillStyle = 'bold',\n ...otherProps\n } = props; // useProviderProps(props) in v3\n let domRef = useDOMRef(ref);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <Provider\n values={[\n [TextContext, {styles: style({paddingY: '--labelPadding', order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n <SkeletonWrapper>\n <span\n {...filterDOMProps(otherProps)}\n role=\"presentation\"\n className={(props.UNSAFE_className || '') + badge({variant, size, fillStyle}, props.styles)}\n style={props.UNSAFE_style}\n ref={domRef}>\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </span>\n </SkeletonWrapper>\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"Badge.css.map"}
1
+ {"mappings":"ACsDc;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAmJiB;;;;EAAA;;;;EAAA;;;;EAEyB;;;;EACtC;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAtJJ;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA","sources":["31052c90be0d94da","packages/@react-spectrum/s2/src/Badge.tsx"],"sourcesContent":["@import \"08c4d7ffd2baa021\";\n@import \"1aad76937c73131b\";\n@import \"7989dc282effbbd8\";\n@import \"a50d3ac159f93c2b\";\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 {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';\nimport {centerBaseline} from './CenterBaseline';\nimport {centerPadding, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {ContextValue, Provider, SlotProps} from 'react-aria-components';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {fontRelative, lightDark, style} from '../style' with {type: 'macro'};\nimport {IconContext} from './Icon';\nimport React, {createContext, forwardRef, ReactNode} from 'react';\nimport {SkeletonWrapper} from './Skeleton';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface BadgeStyleProps {\n /**\n * The size of the badge.\n *\n * @default 'S'\n */\n size?: 'S' | 'M' | 'L' | 'XL',\n /**\n * The variant changes the background color of the badge. When badge has a semantic meaning, they should use the variant for semantic colors.\n *\n * @default 'neutral'\n */\n variant?: 'accent' | 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'gray' | 'red' | 'orange' | 'yellow' | 'charteuse' | 'celery' | 'green' | 'seafoam' | 'cyan' | 'blue' | 'indigo' | 'purple' | 'fuchsia' | 'magenta' | 'pink' | 'turquoise' | 'brown' | 'cinnamon' | 'silver',\n /**\n * The fill of the badge.\n * @default 'bold'\n */\n fillStyle?: 'bold' | 'subtle' | 'outline'\n}\n\nexport interface BadgeProps extends DOMProps, AriaLabelingProps, StyleProps, BadgeStyleProps, SlotProps {\n /**\n * The content to display in the badge.\n */\n children: ReactNode\n}\n\nexport const BadgeContext = createContext<ContextValue<Partial<BadgeProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst badge = style<BadgeStyleProps>({\n display: 'flex',\n font: 'control',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 'control',\n minHeight: 'control',\n paddingX: {\n default: 'edge-to-text',\n ':has([slot=icon]:only-child)': 0\n },\n '--labelPadding': {\n type: 'paddingTop',\n value: centerPadding()\n },\n aspectRatio: {\n ':has([slot=icon]:only-child)': 'square'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2),\n ':has([slot=icon]:only-child)': 0\n }\n },\n columnGap: 'text-to-visual',\n color: {\n fillStyle: {\n bold: {\n default: 'white',\n variant: {\n notice: 'black',\n orange: 'black',\n yellow: 'black',\n charteuse: 'black',\n celery: 'black'\n }\n },\n subtle: 'gray-1000',\n outline: 'gray-1000'\n }\n },\n backgroundColor: {\n fillStyle: {\n bold: {\n variant: {\n accent: 'accent',\n informative: 'informative',\n neutral: 'neutral-subdued',\n positive: 'positive',\n notice: 'notice',\n negative: 'negative',\n gray: 'gray',\n red: 'red',\n orange: 'orange',\n yellow: 'yellow',\n charteuse: 'chartreuse',\n celery: 'celery',\n green: 'green',\n seafoam: 'seafoam',\n cyan: 'cyan',\n blue: 'blue',\n indigo: 'indigo',\n purple: 'purple',\n fuchsia: 'fuchsia',\n magenta: 'magenta',\n pink: 'pink',\n turquoise: 'turquoise',\n brown: 'brown',\n cinnamon: 'cinnamon',\n silver: 'silver'\n }\n },\n subtle: {\n variant: {\n accent: 'accent-subtle',\n informative: 'informative-subtle',\n neutral: 'neutral-subtle',\n positive: 'positive-subtle',\n notice: 'notice-subtle',\n negative: 'negative-subtle',\n gray: 'gray-subtle',\n red: 'red-subtle',\n orange: 'orange-subtle',\n yellow: 'yellow-subtle',\n charteuse: 'chartreuse-subtle',\n celery: 'celery-subtle',\n green: 'green-subtle',\n seafoam: 'seafoam-subtle',\n cyan: 'cyan-subtle',\n blue: 'blue-subtle',\n indigo: 'indigo-subtle',\n purple: 'purple-subtle',\n fuchsia: 'fuchsia-subtle',\n magenta: 'magenta-subtle',\n pink: 'pink-subtle',\n turquoise: 'turquoise-subtle',\n brown: 'brown-subtle',\n cinnamon: 'cinnamon-subtle',\n silver: 'silver-subtle'\n }\n },\n outline: 'layer-2'\n }\n },\n borderStyle: 'solid',\n boxSizing: 'border-box',\n borderWidth: 2,\n borderColor: {\n default: 'transparent',\n fillStyle: {\n outline: {\n variant: {\n accent: lightDark('accent-800', 'accent-900'), // accent-visual-color\n informative: lightDark('informative-800', 'informative-900'), // informative-visual-color\n neutral: lightDark('gray-500', 'gray-600'), // neutral-visual-color\n positive: lightDark('positive-800', 'positive-900'), // positive-visual-color\n notice: lightDark('notice-800', 'notice-900'), // notice-visual-color\n negative: lightDark('negative-800', 'negative-900') // negative-visual-color\n }\n }\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n}, getAllowedOverrides());\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nexport const Badge = forwardRef(function Badge(props: BadgeProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, BadgeContext);\n let {\n children,\n variant = 'neutral',\n size = 'S',\n fillStyle = 'bold',\n ...otherProps\n } = props; // useProviderProps(props) in v3\n let domRef = useDOMRef(ref);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <Provider\n values={[\n [TextContext, {styles: style({paddingY: '--labelPadding', order: 1})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }]\n ]}>\n <SkeletonWrapper>\n <span\n {...filterDOMProps(otherProps)}\n role=\"presentation\"\n className={(props.UNSAFE_className || '') + badge({variant, size, fillStyle}, props.styles)}\n style={props.UNSAFE_style}\n ref={domRef}>\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </span>\n </SkeletonWrapper>\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"Badge.css.map"}
@@ -10,8 +10,8 @@ var $PCemd$reactjsxruntime = require("react/jsx-runtime");
10
10
  var $PCemd$react = require("react");
11
11
  var $PCemd$reactariacomponents = require("react-aria-components");
12
12
  var $PCemd$reactaria = require("react-aria");
13
- var $PCemd$reactspectrumutils = require("@react-spectrum/utils");
14
13
  var $PCemd$reactariautils = require("@react-aria/utils");
14
+ var $PCemd$reactspectrumutils = require("@react-spectrum/utils");
15
15
  var $PCemd$reactariai18n = require("@react-aria/i18n");
16
16
 
17
17
 
@@ -186,7 +186,7 @@ let $4130f4e17f7081aa$var$HiddenBreadcrumbs = function(props) {
186
186
  let { listRef: listRef, items: items, size: size } = props;
187
187
  return /*#__PURE__*/ (0, $PCemd$reactjsxruntime.jsxs)("div", {
188
188
  // @ts-ignore
189
- inert: "true",
189
+ inert: (0, $PCemd$reactariautils.inertValue)(true),
190
190
  ref: listRef,
191
191
  className: " . _0-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,WAAW,GAAG;QACtF,mBAAmB,GAAG,wCAAwC;QAC9D,KAAK,IAAI,SAAS,OAAO,OAAO,GAAI;YAClC,kBAAkB;YAClB,IAAI,kBAAkB,GACpB;YAEF,kBAAkB;YAClB;QACF;QAEA,gBAAgB,KAAK,GAAG,CAAC,yCAAmB,KAAK,GAAG,CAAC,iBAAiB;IACxE,GAAG;QAAC,WAAW,IAAI;QAAE;KAAgB;IAErC,4FAA4F;IAC5F,CAAA,GAAA,2CAAgB,EAAE;QAAC,KAAK;QAAc,UAAU;IAAc;IAE9D,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,WAAW,IAAI,GAAG,GACpB,eAAe;IAEnB,GAAG;QAAC,WAAW,IAAI;QAAE;KAAe;IAEpC,CAAA,GAAA,sBAAQ,EAAE;QACR,kDAAkD;QAClD,SAAS,KAAK,EAAE,MAAM,KAAK,IAAM;IACjC,uDAAuD;IACzD,GAAG,EAAE;IACL,IAAI,aAAa,WAAW,IAAI,GAAG;IAEnC,qBACE;;0BACE,gCAAC;gBAAkB,OAAO;gBAAU,MAAM;gBAAM,SAAS;;YACxD,eAAe,WAAW,IAAI,IAAI,WAAW,IAAI,GAAG,kBACnD;;oBACG,QAAQ,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE;kCACjC,gCAAC;wBAAe,OAAO,SAAS,KAAK,CAAC,GAAG;wBAAa,UAAU;;oBAC/D,SAAS,KAAK,CAAC,YAAY,GAAG,CAAC,CAAA,qBAAQ,gCAAC,CAAA,GAAA,qBAAO;sCAAkB,KAAK,MAAM,GAAG;2BAAzB,KAAK,GAAG;;+BAGjE;0BACG,SAAS,GAAG,CAAC,CAAA,qBAAQ,gCAAC,CAAA,GAAA,qBAAO;kCAAkB,KAAK,MAAM,GAAG;uBAAzB,KAAK,GAAG;;;;AAKvD","sources":["packages/@react-spectrum/s2/src/Breadcrumbs.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 {ActionButton} from './ActionButton';\nimport {\n Breadcrumb as AriaBreadcrumb,\n BreadcrumbsProps as AriaBreadcrumbsProps,\n CollectionRenderer,\n ContextValue,\n HeadingContext,\n Link,\n Provider,\n Breadcrumbs as RACBreadcrumbs,\n UNSTABLE_CollectionRendererContext,\n UNSTABLE_DefaultCollectionRenderer\n} from 'react-aria-components';\nimport {AriaBreadcrumbItemProps, useLocale} from 'react-aria';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {Collection, DOMRef, DOMRefValue, LinkDOMProps, Node} from '@react-types/shared';\nimport {createContext, forwardRef, Fragment, ReactNode, RefObject, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {focusRing, size, style} from '../style' with { type: 'macro' };\nimport FolderIcon from '../s2wf-icons/S2_Icon_FolderBreadcrumb_20_N.svg';\nimport {forwardRefType} from './types';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Menu, MenuItem, MenuTrigger} from './Menu';\nimport {Text} from './Content';\nimport {useDOMRef, useResizeObserver} from '@react-spectrum/utils';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nconst MIN_VISIBLE_ITEMS = 1;\nconst MAX_VISIBLE_ITEMS = 4;\n\ninterface BreadcrumbsStyleProps {\n /**\n * Size of the Breadcrumbs including spacing and layout.\n *\n * @default 'M'\n */\n size?: 'M' | 'L',\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean\n /**\n * Whether to place the last Breadcrumb item onto a new line.\n */\n // TODO: isMultiline?: boolean\n /** Whether to always show the root item if the items are collapsed. */\n // TODO: showRoot?: boolean,\n}\n\nexport interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps<T>, 'children' | 'items' | 'style' | 'className'>, BreadcrumbsStyleProps, StyleProps {\n /** The children of the Breadcrumbs. */\n children?: ReactNode\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, DOMRefValue<HTMLOListElement>>>(null);\n\nconst wrapper = style<BreadcrumbsStyleProps>({\n position: 'relative',\n display: 'flex',\n justifyContent: 'start',\n listStyleType: 'none',\n flexWrap: 'nowrap',\n flexGrow: 1,\n flexShrink: 0,\n flexBasis: 0,\n gap: {\n size: {\n // TODO: why do these scale but other spacings don't?\n M: size(6), // breadcrumbs-text-to-separator-medium\n L: size(9) // breadcrumbs-text-to-separator-large\n }\n },\n padding: 0,\n transition: 'default',\n marginTop: 0,\n marginBottom: 0,\n marginStart: {\n size: {\n M: size(6),\n L: size(9)\n }\n }\n}, getAllowedOverrides());\n\nconst InternalBreadcrumbsContext = createContext<BreadcrumbsProps<any>>({});\n\n/** Breadcrumbs show hierarchy and navigational context for a user’s location within an application. */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<HTMLOListElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, BreadcrumbsContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_className = '',\n UNSAFE_style,\n styles,\n size = 'M',\n children,\n isDisabled,\n ...otherProps\n } = props;\n\n return (\n <Provider\n values={[\n [InternalBreadcrumbsContext, {size, isDisabled}]\n ]}>\n <CollapsingCollection containerRef={domRef} onAction={props.onAction}>\n <RACBreadcrumbs\n {...otherProps}\n isDisabled={isDisabled}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({\n size\n }, styles)}>\n {children}\n </RACBreadcrumbs>\n </CollapsingCollection>\n </Provider>\n );\n});\n\nlet BreadcrumbMenu = (props: {items: Array<Node<any>>, onAction: BreadcrumbsProps<unknown>['onAction']}) => {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {items, onAction} = props;\n let {direction} = useLocale();\n let {size, isDisabled} = useContext(InternalBreadcrumbsContext);\n let label = stringFormatter.format('breadcrumbs.more');\n return (\n <UNSTABLE_CollectionRendererContext.Provider value={UNSTABLE_DefaultCollectionRenderer}>\n <li className={breadcrumbStyles({size, isDisabled, isMenu: true})}>\n <MenuTrigger>\n <ActionButton isDisabled={isDisabled} isQuiet aria-label={label}><FolderIcon /></ActionButton>\n <Menu items={items} onAction={onAction}>\n {(item: Node<any>) => (\n <MenuItem\n {...item.props.originalProps}\n key={item.key}>\n <Text slot=\"label\">\n {item.props.children({size, isCurrent: false, isMenu: true})}\n </Text>\n </MenuItem>\n )}\n </Menu>\n </MenuTrigger>\n <ChevronIcon\n size={size}\n className={chevronStyles({direction, isMenu: true})} />\n </li>\n </UNSTABLE_CollectionRendererContext.Provider>\n );\n};\n\nlet HiddenBreadcrumbs = function (props: {listRef: RefObject<HTMLDivElement | null>, items: Array<Node<any>>, size: string}) {\n let {listRef, items, size} = props;\n return (\n <div\n // @ts-ignore\n inert=\"true\"\n ref={listRef}\n className={style({\n display: '[inherit]',\n gap: '[inherit]',\n flexWrap: '[inherit]',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: 0,\n end: 0,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {items.map((item, idx) => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n return (\n <div\n data-hidden-breadcrumb\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, isCurrent: idx === items.length - 1})}>\n {item.props.children({size, isCurrent: idx === items.length - 1})}\n </div>\n );\n })}\n <ActionButton data-hidden-button isQuiet><FolderIcon /></ActionButton>\n </div>\n );\n};\n\nconst breadcrumbStyles = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'start',\n height: 'control',\n transition: 'default',\n position: 'relative',\n flexShrink: 0,\n color: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n marginStart: {\n // adjusts with the parent flex gap\n isMenu: size(-6)\n }\n});\n\nconst chevronStyles = style({\n scale: {\n direction: {\n rtl: -1\n }\n },\n marginStart: {\n default: 'text-to-visual',\n isMenu: 0\n },\n color: {\n default: 'neutral',\n forcedColors: {\n default: 'LinkText'\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst linkStyles = style({\n ...focusRing(),\n borderRadius: 'sm',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled',\n isCurrent: 'neutral',\n forcedColors: {\n default: 'LinkText',\n isDisabled: 'GrayText'\n }\n },\n transition: 'default',\n textDecoration: {\n default: 'none',\n isHovered: 'underline',\n isFocusVisible: 'underline',\n isDisabled: 'none'\n },\n cursor: {\n default: 'pointer',\n isDisabled: 'default'\n },\n outlineColor: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n },\n disableTapHighlight: true\n});\n\nconst currentStyles = style<{size: string}>({\n font: 'control',\n fontWeight: 'bold'\n});\n\n// TODO: support user heading size customization, for now just set it to large\nconst heading = style({\n margin: 0,\n font: 'heading-lg',\n fontWeight: 'extra-bold'\n});\n\nexport interface BreadcrumbProps extends Omit<AriaBreadcrumbItemProps, 'children' | 'style' | 'className' | 'autoFocus'>, LinkDOMProps {\n /** The children of the breadcrumb item. */\n children?: ReactNode\n}\n\n/** An individual Breadcrumb for Breadcrumbs. */\nexport const Breadcrumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumb({children, ...props}: BreadcrumbProps, ref: DOMRef<HTMLLIElement>) {\n let {href, target, rel, download, ping, referrerPolicy} = props;\n let {size = 'M'} = useContext(InternalBreadcrumbsContext) ?? {};\n let domRef = useDOMRef(ref);\n let {direction} = useLocale();\n return (\n <AriaBreadcrumb\n {...props}\n ref={domRef}\n // @ts-ignore\n originalProps={props}\n className={({isCurrent, isDisabled}) => breadcrumbStyles({size, isCurrent, isDisabled})}>\n {({\n isCurrent,\n isDisabled,\n // @ts-ignore\n isMenu\n }) => {\n if (isMenu) {\n return children;\n }\n return (\n isCurrent ?\n <div\n className={currentStyles({size})}>\n <Provider\n values={[\n [HeadingContext, {className: heading}]\n ]}>\n {children}\n </Provider>\n </div>\n : (\n <>\n <Link\n style={({isFocusVisible}) => ({clipPath: isFocusVisible ? 'none' : 'margin-box'})}\n href={href}\n target={target}\n rel={rel}\n download={download}\n ping={ping}\n referrerPolicy={referrerPolicy}\n isDisabled={isDisabled || isCurrent}\n className={({isFocused, isFocusVisible, isHovered, isDisabled, isPressed}) => linkStyles({isFocused, isFocusVisible, isHovered, isDisabled, size, isPressed})}>\n {children}\n </Link>\n <ChevronIcon\n size=\"M\"\n className={chevronStyles({direction})} />\n </>\n )\n );\n }}\n </AriaBreadcrumb>\n );\n});\n\n// Context for passing the count for the custom renderer\nlet CollapseContext = createContext<{\n containerRef: RefObject<HTMLOListElement | null>,\n onAction: BreadcrumbsProps<unknown>['onAction']\n} | null>(null);\n\nfunction CollapsingCollection({children, containerRef, onAction}) {\n return (\n <CollapseContext.Provider value={{containerRef, onAction}}>\n <UNSTABLE_CollectionRendererContext.Provider value={CollapsingCollectionRenderer}>\n {children}\n </UNSTABLE_CollectionRendererContext.Provider>\n </CollapseContext.Provider>\n );\n}\n\nlet CollapsingCollectionRenderer: CollectionRenderer = {\n CollectionRoot({collection}) {\n return useCollectionRender(collection);\n },\n CollectionBranch({collection}) {\n return useCollectionRender(collection);\n }\n};\n\nlet useCollectionRender = (collection: Collection<Node<unknown>>) => {\n let {containerRef, onAction} = useContext(CollapseContext) ?? {};\n let [visibleItems, setVisibleItems] = useState(collection.size);\n let {size = 'M'} = useContext(InternalBreadcrumbsContext);\n\n let children = useMemo(() => {\n let result: Node<any>[] = [];\n for (let key of collection.getKeys()) {\n result.push(collection.getItem(key)!);\n }\n return result;\n }, [collection]);\n\n let listRef = useRef<HTMLDivElement | null>(null);\n let updateOverflow = useCallback(() => {\n let currListRef: HTMLDivElement | null = listRef.current;\n if (!currListRef) {\n setVisibleItems(collection.size);\n return;\n }\n let container = currListRef.parentElement;\n if (!container) {\n setVisibleItems(collection.size);\n return;\n }\n\n let listItems = Array.from(currListRef.querySelectorAll('[data-hidden-breadcrumb]')) as HTMLLIElement[];\n let folder = currListRef.querySelector('button') as HTMLButtonElement;\n if (listItems.length <= 0) {\n setVisibleItems(collection.size);\n return;\n }\n let containerWidth = container.offsetWidth;\n let containerGap = parseInt(getComputedStyle(container).gap, 10);\n let folderGap = parseInt(getComputedStyle(folder).marginInlineStart, 10);\n let newVisibleItems = 0;\n let maxVisibleItems = MAX_VISIBLE_ITEMS;\n\n let widths: Array<number> = [];\n let totalWidth = 0;\n for (let breadcrumb of listItems) {\n let width = breadcrumb.offsetWidth + 1; // offsetWidth is rounded down\n widths.push(width);\n totalWidth += width;\n }\n\n // can we fit all the items without collapsing\n if (totalWidth <= containerWidth - (collection.size * containerGap) && collection.size <= MAX_VISIBLE_ITEMS) {\n setVisibleItems(collection.size);\n return;\n }\n\n // we know there is always at least one item because of the listItems.length check up above\n let widthOfFirst = widths.shift()!;\n let availableWidth = containerWidth - widthOfFirst - folderGap - folder.offsetWidth - containerGap;\n maxVisibleItems -= 2; // account for the first item and folder\n for (let width of widths.reverse()) {\n availableWidth -= width;\n if (availableWidth <= 0) {\n break;\n }\n availableWidth -= containerGap;\n newVisibleItems++;\n }\n\n setVisibleItems(Math.max(MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems)));\n }, [collection.size, setVisibleItems]);\n\n // making bad assumption that i can listen to containerRef when it's declared in the parent?\n useResizeObserver({ref: containerRef, onResize: updateOverflow});\n\n useLayoutEffect(() => {\n if (collection.size > 0) {\n queueMicrotask(updateOverflow);\n }\n }, [collection.size, updateOverflow]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateOverflow());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let sliceIndex = collection.size - visibleItems;\n\n return (\n <>\n <HiddenBreadcrumbs items={children} size={size} listRef={listRef} />\n {visibleItems < collection.size && collection.size > 2 ? (\n <>\n {children[0].render?.(children[0])}\n <BreadcrumbMenu items={children.slice(1, sliceIndex)} onAction={onAction} />\n {children.slice(sliceIndex).map(node => <Fragment key={node.key}>{node.render?.(node)}</Fragment >)}\n </>\n ) : (\n <>\n {children.map(node => <Fragment key={node.key}>{node.render?.(node)}</Fragment>)}\n </>\n )}\n </>\n );\n};\n"],"names":[],"version":3,"file":"Breadcrumbs.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;AAgCD,MAAM,0CAAoB;AAC1B,MAAM,0CAAoB;AAwBnB,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAsE;AAEpH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BN,MAAM,iEAA6B,CAAA,GAAA,0BAAY,EAAyB,CAAC;AAGlE,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAA6B;IACtK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,oBACF,mBAAmB,kBACnB,YAAY,UACZ,MAAM,QACN,OAAO,eACP,QAAQ,cACR,UAAU,EACV,GAAG,YACJ,GAAG;IAEJ,qBACE,gCAAC,CAAA,GAAA,mCAAO;QACN,QAAQ;YACN;gBAAC;gBAA4B;0BAAC;gCAAM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C,MAAM,GAAG,QAAQ,CAAC,EAAE;kCACjC,gCAAC;wBAAe,OAAO,SAAS,KAAK,CAAC,GAAG;wBAAa,UAAU;;oBAC/D,SAAS,KAAK,CAAC,YAAY,GAAG,CAAC,CAAA,qBAAQ,gCAAC,CAAA,GAAA,qBAAO;sCAAkB,KAAK,MAAM,GAAG;2BAAzB,KAAK,GAAG;;+BAGjE;0BACG,SAAS,GAAG,CAAC,CAAA,qBAAQ,gCAAC,CAAA,GAAA,qBAAO;kCAAkB,KAAK,MAAM,GAAG;uBAAzB,KAAK,GAAG;;;;AAKvD","sources":["packages/@react-spectrum/s2/src/Breadcrumbs.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 {ActionButton} from './ActionButton';\nimport {\n Breadcrumb as AriaBreadcrumb,\n BreadcrumbsProps as AriaBreadcrumbsProps,\n CollectionRenderer,\n ContextValue,\n HeadingContext,\n Link,\n Provider,\n Breadcrumbs as RACBreadcrumbs,\n UNSTABLE_CollectionRendererContext,\n UNSTABLE_DefaultCollectionRenderer\n} from 'react-aria-components';\nimport {AriaBreadcrumbItemProps, useLocale} from 'react-aria';\nimport ChevronIcon from '../ui-icons/Chevron';\nimport {Collection, DOMRef, DOMRefValue, LinkDOMProps, Node} from '@react-types/shared';\nimport {createContext, forwardRef, Fragment, ReactNode, RefObject, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {focusRing, size, style} from '../style' with { type: 'macro' };\nimport FolderIcon from '../s2wf-icons/S2_Icon_FolderBreadcrumb_20_N.svg';\nimport {forwardRefType} from './types';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {inertValue, useLayoutEffect} from '@react-aria/utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Menu, MenuItem, MenuTrigger} from './Menu';\nimport {Text} from './Content';\nimport {useDOMRef, useResizeObserver} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nconst MIN_VISIBLE_ITEMS = 1;\nconst MAX_VISIBLE_ITEMS = 4;\n\ninterface BreadcrumbsStyleProps {\n /**\n * Size of the Breadcrumbs including spacing and layout.\n *\n * @default 'M'\n */\n size?: 'M' | 'L',\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean\n /**\n * Whether to place the last Breadcrumb item onto a new line.\n */\n // TODO: isMultiline?: boolean\n /** Whether to always show the root item if the items are collapsed. */\n // TODO: showRoot?: boolean,\n}\n\nexport interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps<T>, 'children' | 'items' | 'style' | 'className'>, BreadcrumbsStyleProps, StyleProps {\n /** The children of the Breadcrumbs. */\n children?: ReactNode\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, DOMRefValue<HTMLOListElement>>>(null);\n\nconst wrapper = style<BreadcrumbsStyleProps>({\n position: 'relative',\n display: 'flex',\n justifyContent: 'start',\n listStyleType: 'none',\n flexWrap: 'nowrap',\n flexGrow: 1,\n flexShrink: 0,\n flexBasis: 0,\n gap: {\n size: {\n // TODO: why do these scale but other spacings don't?\n M: size(6), // breadcrumbs-text-to-separator-medium\n L: size(9) // breadcrumbs-text-to-separator-large\n }\n },\n padding: 0,\n transition: 'default',\n marginTop: 0,\n marginBottom: 0,\n marginStart: {\n size: {\n M: size(6),\n L: size(9)\n }\n }\n}, getAllowedOverrides());\n\nconst InternalBreadcrumbsContext = createContext<BreadcrumbsProps<any>>({});\n\n/** Breadcrumbs show hierarchy and navigational context for a user’s location within an application. */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<HTMLOListElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, BreadcrumbsContext);\n let domRef = useDOMRef(ref);\n let {\n UNSAFE_className = '',\n UNSAFE_style,\n styles,\n size = 'M',\n children,\n isDisabled,\n ...otherProps\n } = props;\n\n return (\n <Provider\n values={[\n [InternalBreadcrumbsContext, {size, isDisabled}]\n ]}>\n <CollapsingCollection containerRef={domRef} onAction={props.onAction}>\n <RACBreadcrumbs\n {...otherProps}\n isDisabled={isDisabled}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + wrapper({\n size\n }, styles)}>\n {children}\n </RACBreadcrumbs>\n </CollapsingCollection>\n </Provider>\n );\n});\n\nlet BreadcrumbMenu = (props: {items: Array<Node<any>>, onAction: BreadcrumbsProps<unknown>['onAction']}) => {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {items, onAction} = props;\n let {direction} = useLocale();\n let {size, isDisabled} = useContext(InternalBreadcrumbsContext);\n let label = stringFormatter.format('breadcrumbs.more');\n return (\n <UNSTABLE_CollectionRendererContext.Provider value={UNSTABLE_DefaultCollectionRenderer}>\n <li className={breadcrumbStyles({size, isDisabled, isMenu: true})}>\n <MenuTrigger>\n <ActionButton isDisabled={isDisabled} isQuiet aria-label={label}><FolderIcon /></ActionButton>\n <Menu items={items} onAction={onAction}>\n {(item: Node<any>) => (\n <MenuItem\n {...item.props.originalProps}\n key={item.key}>\n <Text slot=\"label\">\n {item.props.children({size, isCurrent: false, isMenu: true})}\n </Text>\n </MenuItem>\n )}\n </Menu>\n </MenuTrigger>\n <ChevronIcon\n size={size}\n className={chevronStyles({direction, isMenu: true})} />\n </li>\n </UNSTABLE_CollectionRendererContext.Provider>\n );\n};\n\nlet HiddenBreadcrumbs = function (props: {listRef: RefObject<HTMLDivElement | null>, items: Array<Node<any>>, size: string}) {\n let {listRef, items, size} = props;\n return (\n <div\n // @ts-ignore\n inert={inertValue(true)}\n ref={listRef}\n className={style({\n display: '[inherit]',\n gap: '[inherit]',\n flexWrap: '[inherit]',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: 0,\n end: 0,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {items.map((item, idx) => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n return (\n <div\n data-hidden-breadcrumb\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, isCurrent: idx === items.length - 1})}>\n {item.props.children({size, isCurrent: idx === items.length - 1})}\n </div>\n );\n })}\n <ActionButton data-hidden-button isQuiet><FolderIcon /></ActionButton>\n </div>\n );\n};\n\nconst breadcrumbStyles = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'start',\n height: 'control',\n transition: 'default',\n position: 'relative',\n flexShrink: 0,\n color: {\n default: 'neutral',\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n marginStart: {\n // adjusts with the parent flex gap\n isMenu: size(-6)\n }\n});\n\nconst chevronStyles = style({\n scale: {\n direction: {\n rtl: -1\n }\n },\n marginStart: {\n default: 'text-to-visual',\n isMenu: 0\n },\n color: {\n default: 'neutral',\n forcedColors: {\n default: 'LinkText'\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst linkStyles = style({\n ...focusRing(),\n borderRadius: 'sm',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isDisabled: 'disabled',\n isCurrent: 'neutral',\n forcedColors: {\n default: 'LinkText',\n isDisabled: 'GrayText'\n }\n },\n transition: 'default',\n textDecoration: {\n default: 'none',\n isHovered: 'underline',\n isFocusVisible: 'underline',\n isDisabled: 'none'\n },\n cursor: {\n default: 'pointer',\n isDisabled: 'default'\n },\n outlineColor: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n },\n disableTapHighlight: true\n});\n\nconst currentStyles = style<{size: string}>({\n font: 'control',\n fontWeight: 'bold'\n});\n\n// TODO: support user heading size customization, for now just set it to large\nconst heading = style({\n margin: 0,\n font: 'heading-lg',\n fontWeight: 'extra-bold'\n});\n\nexport interface BreadcrumbProps extends Omit<AriaBreadcrumbItemProps, 'children' | 'style' | 'className' | 'autoFocus'>, LinkDOMProps {\n /** The children of the breadcrumb item. */\n children?: ReactNode\n}\n\n/** An individual Breadcrumb for Breadcrumbs. */\nexport const Breadcrumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumb({children, ...props}: BreadcrumbProps, ref: DOMRef<HTMLLIElement>) {\n let {href, target, rel, download, ping, referrerPolicy} = props;\n let {size = 'M'} = useContext(InternalBreadcrumbsContext) ?? {};\n let domRef = useDOMRef(ref);\n let {direction} = useLocale();\n return (\n <AriaBreadcrumb\n {...props}\n ref={domRef}\n // @ts-ignore\n originalProps={props}\n className={({isCurrent, isDisabled}) => breadcrumbStyles({size, isCurrent, isDisabled})}>\n {({\n isCurrent,\n isDisabled,\n // @ts-ignore\n isMenu\n }) => {\n if (isMenu) {\n return children;\n }\n return (\n isCurrent ?\n <div\n className={currentStyles({size})}>\n <Provider\n values={[\n [HeadingContext, {className: heading}]\n ]}>\n {children}\n </Provider>\n </div>\n : (\n <>\n <Link\n style={({isFocusVisible}) => ({clipPath: isFocusVisible ? 'none' : 'margin-box'})}\n href={href}\n target={target}\n rel={rel}\n download={download}\n ping={ping}\n referrerPolicy={referrerPolicy}\n isDisabled={isDisabled || isCurrent}\n className={({isFocused, isFocusVisible, isHovered, isDisabled, isPressed}) => linkStyles({isFocused, isFocusVisible, isHovered, isDisabled, size, isPressed})}>\n {children}\n </Link>\n <ChevronIcon\n size=\"M\"\n className={chevronStyles({direction})} />\n </>\n )\n );\n }}\n </AriaBreadcrumb>\n );\n});\n\n// Context for passing the count for the custom renderer\nlet CollapseContext = createContext<{\n containerRef: RefObject<HTMLOListElement | null>,\n onAction: BreadcrumbsProps<unknown>['onAction']\n} | null>(null);\n\nfunction CollapsingCollection({children, containerRef, onAction}) {\n return (\n <CollapseContext.Provider value={{containerRef, onAction}}>\n <UNSTABLE_CollectionRendererContext.Provider value={CollapsingCollectionRenderer}>\n {children}\n </UNSTABLE_CollectionRendererContext.Provider>\n </CollapseContext.Provider>\n );\n}\n\nlet CollapsingCollectionRenderer: CollectionRenderer = {\n CollectionRoot({collection}) {\n return useCollectionRender(collection);\n },\n CollectionBranch({collection}) {\n return useCollectionRender(collection);\n }\n};\n\nlet useCollectionRender = (collection: Collection<Node<unknown>>) => {\n let {containerRef, onAction} = useContext(CollapseContext) ?? {};\n let [visibleItems, setVisibleItems] = useState(collection.size);\n let {size = 'M'} = useContext(InternalBreadcrumbsContext);\n\n let children = useMemo(() => {\n let result: Node<any>[] = [];\n for (let key of collection.getKeys()) {\n result.push(collection.getItem(key)!);\n }\n return result;\n }, [collection]);\n\n let listRef = useRef<HTMLDivElement | null>(null);\n let updateOverflow = useCallback(() => {\n let currListRef: HTMLDivElement | null = listRef.current;\n if (!currListRef) {\n setVisibleItems(collection.size);\n return;\n }\n let container = currListRef.parentElement;\n if (!container) {\n setVisibleItems(collection.size);\n return;\n }\n\n let listItems = Array.from(currListRef.querySelectorAll('[data-hidden-breadcrumb]')) as HTMLLIElement[];\n let folder = currListRef.querySelector('button') as HTMLButtonElement;\n if (listItems.length <= 0) {\n setVisibleItems(collection.size);\n return;\n }\n let containerWidth = container.offsetWidth;\n let containerGap = parseInt(getComputedStyle(container).gap, 10);\n let folderGap = parseInt(getComputedStyle(folder).marginInlineStart, 10);\n let newVisibleItems = 0;\n let maxVisibleItems = MAX_VISIBLE_ITEMS;\n\n let widths: Array<number> = [];\n let totalWidth = 0;\n for (let breadcrumb of listItems) {\n let width = breadcrumb.offsetWidth + 1; // offsetWidth is rounded down\n widths.push(width);\n totalWidth += width;\n }\n\n // can we fit all the items without collapsing\n if (totalWidth <= containerWidth - (collection.size * containerGap) && collection.size <= MAX_VISIBLE_ITEMS) {\n setVisibleItems(collection.size);\n return;\n }\n\n // we know there is always at least one item because of the listItems.length check up above\n let widthOfFirst = widths.shift()!;\n let availableWidth = containerWidth - widthOfFirst - folderGap - folder.offsetWidth - containerGap;\n maxVisibleItems -= 2; // account for the first item and folder\n for (let width of widths.reverse()) {\n availableWidth -= width;\n if (availableWidth <= 0) {\n break;\n }\n availableWidth -= containerGap;\n newVisibleItems++;\n }\n\n setVisibleItems(Math.max(MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems)));\n }, [collection.size, setVisibleItems]);\n\n // making bad assumption that i can listen to containerRef when it's declared in the parent?\n useResizeObserver({ref: containerRef, onResize: updateOverflow});\n\n useLayoutEffect(() => {\n if (collection.size > 0) {\n queueMicrotask(updateOverflow);\n }\n }, [collection.size, updateOverflow]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateOverflow());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let sliceIndex = collection.size - visibleItems;\n\n return (\n <>\n <HiddenBreadcrumbs items={children} size={size} listRef={listRef} />\n {visibleItems < collection.size && collection.size > 2 ? (\n <>\n {children[0].render?.(children[0])}\n <BreadcrumbMenu items={children.slice(1, sliceIndex)} onAction={onAction} />\n {children.slice(sliceIndex).map(node => <Fragment key={node.key}>{node.render?.(node)}</Fragment >)}\n </>\n ) : (\n <>\n {children.map(node => <Fragment key={node.key}>{node.render?.(node)}</Fragment>)}\n </>\n )}\n </>\n );\n};\n"],"names":[],"version":3,"file":"Breadcrumbs.cjs.map"}
@@ -328,8 +328,6 @@
328
328
  }
329
329
  }
330
330
 
331
- @layer UNSAFE_overrides;
332
-
333
331
  @layer _.b.a {
334
332
  @media (forced-colors: active) {
335
333
  .aa_____K {
@@ -417,8 +415,4 @@
417
415
  font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
418
416
  }
419
417
  }
420
-
421
- .\.:not(#a#b) {
422
- all: revert-layer;
423
- }
424
418
  /*# sourceMappingURL=Breadcrumbs.css.map */