@react-spectrum/s2 3.0.0-nightly-63d4359d6-250428 → 3.0.0-nightly-1dd65ffc5-250430
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.cjs +4 -5
- package/dist/Accordion.cjs.map +1 -1
- package/dist/Accordion.css +2 -4
- package/dist/Accordion.css.map +1 -1
- package/dist/Accordion.mjs +4 -5
- package/dist/Accordion.mjs.map +1 -1
- package/dist/ActionBar.cjs +72 -63
- package/dist/ActionBar.cjs.map +1 -1
- package/dist/ActionBar.css +70 -63
- package/dist/ActionBar.css.map +1 -1
- package/dist/ActionBar.mjs +72 -63
- package/dist/ActionBar.mjs.map +1 -1
- package/dist/ActionButton.cjs +161 -160
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +174 -168
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +161 -160
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/ActionButtonGroup.cjs +17 -18
- package/dist/ActionButtonGroup.cjs.map +1 -1
- package/dist/ActionButtonGroup.css +9 -11
- package/dist/ActionButtonGroup.css.map +1 -1
- package/dist/ActionButtonGroup.mjs +17 -18
- package/dist/ActionButtonGroup.mjs.map +1 -1
- package/dist/AlertDialog.cjs +4 -4
- package/dist/AlertDialog.css +3 -5
- package/dist/AlertDialog.css.map +1 -1
- package/dist/AlertDialog.mjs +4 -4
- package/dist/Avatar.cjs +21 -21
- package/dist/Avatar.css +14 -16
- package/dist/Avatar.css.map +1 -1
- package/dist/Avatar.mjs +21 -21
- package/dist/AvatarGroup.cjs +131 -110
- package/dist/AvatarGroup.cjs.map +1 -1
- package/dist/AvatarGroup.css +43 -49
- package/dist/AvatarGroup.css.map +1 -1
- package/dist/AvatarGroup.mjs +131 -110
- package/dist/AvatarGroup.mjs.map +1 -1
- package/dist/Badge.cjs +150 -149
- package/dist/Badge.cjs.map +1 -1
- package/dist/Badge.css +140 -134
- package/dist/Badge.css.map +1 -1
- package/dist/Badge.mjs +150 -149
- package/dist/Badge.mjs.map +1 -1
- package/dist/Breadcrumbs.cjs +169 -154
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css +119 -105
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs +169 -154
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs +321 -275
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +245 -215
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +321 -275
- package/dist/Button.mjs.map +1 -1
- package/dist/ButtonGroup.cjs +27 -25
- package/dist/ButtonGroup.cjs.map +1 -1
- package/dist/ButtonGroup.css +15 -17
- package/dist/ButtonGroup.css.map +1 -1
- package/dist/ButtonGroup.mjs +27 -25
- package/dist/ButtonGroup.mjs.map +1 -1
- package/dist/Card.cjs +316 -299
- package/dist/Card.cjs.map +1 -1
- package/dist/Card.css +242 -215
- package/dist/Card.css.map +1 -1
- package/dist/Card.mjs +316 -299
- package/dist/Card.mjs.map +1 -1
- package/dist/CardView.cjs +29 -30
- package/dist/CardView.cjs.map +1 -1
- package/dist/CardView.css +19 -19
- package/dist/CardView.mjs +29 -30
- package/dist/CardView.mjs.map +1 -1
- package/dist/CenterBaseline.cjs +2 -2
- package/dist/CenterBaseline.css +3 -5
- package/dist/CenterBaseline.css.map +1 -1
- package/dist/CenterBaseline.mjs +2 -2
- package/dist/Checkbox.cjs +114 -112
- package/dist/Checkbox.cjs.map +1 -1
- package/dist/Checkbox.css +99 -93
- package/dist/Checkbox.css.map +1 -1
- package/dist/Checkbox.mjs +114 -112
- package/dist/Checkbox.mjs.map +1 -1
- package/dist/CheckboxGroup.cjs +54 -54
- package/dist/CheckboxGroup.css +42 -42
- package/dist/CheckboxGroup.mjs +54 -54
- package/dist/ClearButton.cjs +19 -19
- package/dist/ClearButton.css +19 -21
- package/dist/ClearButton.css.map +1 -1
- package/dist/ClearButton.mjs +19 -19
- package/dist/CloseButton.cjs +64 -62
- package/dist/CloseButton.cjs.map +1 -1
- package/dist/CloseButton.css +48 -48
- package/dist/CloseButton.mjs +64 -62
- package/dist/CloseButton.mjs.map +1 -1
- package/dist/ColorArea.cjs +28 -28
- package/dist/ColorArea.css +17 -17
- package/dist/ColorArea.mjs +28 -28
- package/dist/ColorField.cjs +41 -41
- package/dist/ColorField.css +33 -33
- package/dist/ColorField.mjs +41 -41
- package/dist/ColorHandle.cjs +29 -29
- package/dist/ColorHandle.css +45 -45
- package/dist/ColorHandle.mjs +29 -29
- package/dist/ColorSlider.cjs +68 -64
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css +64 -58
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs +68 -64
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs +44 -38
- package/dist/ColorSwatch.cjs.map +1 -1
- package/dist/ColorSwatch.css +29 -31
- package/dist/ColorSwatch.css.map +1 -1
- package/dist/ColorSwatch.mjs +44 -38
- package/dist/ColorSwatch.mjs.map +1 -1
- package/dist/ColorSwatchPicker.cjs +31 -32
- package/dist/ColorSwatchPicker.cjs.map +1 -1
- package/dist/ColorSwatchPicker.css +48 -48
- package/dist/ColorSwatchPicker.css.map +1 -1
- package/dist/ColorSwatchPicker.mjs +31 -32
- package/dist/ColorSwatchPicker.mjs.map +1 -1
- package/dist/ColorWheel.cjs +28 -28
- package/dist/ColorWheel.css +18 -18
- package/dist/ColorWheel.mjs +28 -28
- package/dist/ComboBox.cjs +108 -108
- package/dist/ComboBox.css +101 -101
- package/dist/ComboBox.mjs +108 -108
- package/dist/ContextualHelp.cjs +5 -5
- package/dist/ContextualHelp.css +58 -44
- package/dist/ContextualHelp.css.map +1 -1
- package/dist/ContextualHelp.mjs +5 -5
- package/dist/CustomDialog.cjs +38 -38
- package/dist/CustomDialog.css +26 -26
- package/dist/CustomDialog.mjs +38 -38
- package/dist/Dialog.cjs +18 -18
- package/dist/Dialog.css +86 -72
- package/dist/Dialog.css.map +1 -1
- package/dist/Dialog.mjs +18 -18
- package/dist/Disclosure.cjs +139 -133
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css +144 -120
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +139 -133
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/Divider.cjs +47 -47
- package/dist/Divider.css +26 -26
- package/dist/Divider.mjs +47 -47
- package/dist/DropZone.cjs +68 -64
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css +66 -60
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs +68 -64
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs +192 -186
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +167 -159
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs +192 -186
- package/dist/Field.mjs.map +1 -1
- package/dist/Form.cjs +11 -12
- package/dist/Form.cjs.map +1 -1
- package/dist/Form.css +9 -11
- package/dist/Form.css.map +1 -1
- package/dist/Form.mjs +11 -12
- package/dist/Form.mjs.map +1 -1
- package/dist/FullscreenDialog.cjs +5 -5
- package/dist/FullscreenDialog.css +94 -80
- package/dist/FullscreenDialog.css.map +1 -1
- package/dist/FullscreenDialog.mjs +5 -5
- package/dist/IllustratedMessage.cjs +185 -160
- package/dist/IllustratedMessage.cjs.map +1 -1
- package/dist/IllustratedMessage.css +93 -91
- package/dist/IllustratedMessage.css.map +1 -1
- package/dist/IllustratedMessage.mjs +185 -160
- package/dist/IllustratedMessage.mjs.map +1 -1
- package/dist/Image.cjs +14 -14
- package/dist/Image.css +14 -16
- package/dist/Image.css.map +1 -1
- package/dist/Image.mjs +14 -14
- package/dist/InlineAlert.cjs +130 -122
- package/dist/InlineAlert.cjs.map +1 -1
- package/dist/InlineAlert.css +109 -95
- package/dist/InlineAlert.css.map +1 -1
- package/dist/InlineAlert.mjs +130 -122
- package/dist/InlineAlert.mjs.map +1 -1
- package/dist/Link.cjs +57 -47
- package/dist/Link.cjs.map +1 -1
- package/dist/Link.css +52 -44
- package/dist/Link.css.map +1 -1
- package/dist/Link.mjs +57 -47
- package/dist/Link.mjs.map +1 -1
- package/dist/Menu.cjs +353 -325
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +189 -189
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +353 -325
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs +116 -114
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css +106 -104
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs +116 -114
- package/dist/Meter.mjs.map +1 -1
- package/dist/Modal.cjs +62 -59
- package/dist/Modal.cjs.map +1 -1
- package/dist/Modal.css +52 -51
- package/dist/Modal.css.map +1 -1
- package/dist/Modal.mjs +62 -59
- package/dist/Modal.mjs.map +1 -1
- package/dist/NotificationBadge.cjs +66 -62
- package/dist/NotificationBadge.cjs.map +1 -1
- package/dist/NotificationBadge.css +78 -72
- package/dist/NotificationBadge.css.map +1 -1
- package/dist/NotificationBadge.mjs +66 -62
- package/dist/NotificationBadge.mjs.map +1 -1
- package/dist/NumberField.cjs +133 -133
- package/dist/NumberField.css +120 -120
- package/dist/NumberField.mjs +133 -133
- package/dist/Picker.cjs +209 -207
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +179 -173
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +209 -207
- package/dist/Picker.mjs.map +1 -1
- package/dist/Popover.cjs +124 -93
- package/dist/Popover.cjs.map +1 -1
- package/dist/Popover.css +67 -83
- package/dist/Popover.css.map +1 -1
- package/dist/Popover.mjs +124 -93
- package/dist/Popover.mjs.map +1 -1
- package/dist/ProgressBar.cjs +132 -130
- package/dist/ProgressBar.cjs.map +1 -1
- package/dist/ProgressBar.css +119 -117
- package/dist/ProgressBar.css.map +1 -1
- package/dist/ProgressBar.mjs +132 -130
- package/dist/ProgressBar.mjs.map +1 -1
- package/dist/ProgressCircle.cjs +32 -32
- package/dist/ProgressCircle.css +20 -20
- package/dist/ProgressCircle.css.map +1 -1
- package/dist/ProgressCircle.mjs +32 -32
- package/dist/Provider.cjs +11 -11
- package/dist/Provider.css +9 -11
- package/dist/Provider.css.map +1 -1
- package/dist/Provider.mjs +11 -11
- package/dist/Radio.cjs +101 -99
- package/dist/Radio.cjs.map +1 -1
- package/dist/Radio.css +101 -95
- package/dist/Radio.css.map +1 -1
- package/dist/Radio.mjs +101 -99
- package/dist/Radio.mjs.map +1 -1
- package/dist/RadioGroup.cjs +52 -52
- package/dist/RadioGroup.css +42 -42
- package/dist/RadioGroup.mjs +52 -52
- package/dist/SearchField.cjs +52 -52
- package/dist/SearchField.css +54 -54
- package/dist/SearchField.mjs +52 -52
- package/dist/SegmentedControl.cjs +123 -119
- package/dist/SegmentedControl.cjs.map +1 -1
- package/dist/SegmentedControl.css +110 -104
- package/dist/SegmentedControl.css.map +1 -1
- package/dist/SegmentedControl.mjs +123 -119
- package/dist/SegmentedControl.mjs.map +1 -1
- package/dist/Slider.cjs +251 -248
- package/dist/Slider.cjs.map +1 -1
- package/dist/Slider.css +166 -157
- package/dist/Slider.css.map +1 -1
- package/dist/Slider.mjs +251 -248
- package/dist/Slider.mjs.map +1 -1
- package/dist/StatusLight.cjs +74 -70
- package/dist/StatusLight.cjs.map +1 -1
- package/dist/StatusLight.css +70 -64
- package/dist/StatusLight.css.map +1 -1
- package/dist/StatusLight.mjs +74 -70
- package/dist/StatusLight.mjs.map +1 -1
- package/dist/Switch.cjs +110 -108
- package/dist/Switch.cjs.map +1 -1
- package/dist/Switch.css +86 -80
- package/dist/Switch.css.map +1 -1
- package/dist/Switch.mjs +110 -108
- package/dist/Switch.mjs.map +1 -1
- package/dist/TableView.cjs +334 -329
- package/dist/TableView.cjs.map +1 -1
- package/dist/TableView.css +193 -193
- package/dist/TableView.css.map +1 -1
- package/dist/TableView.mjs +334 -329
- package/dist/TableView.mjs.map +1 -1
- package/dist/Tabs.cjs +153 -149
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +102 -96
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +153 -149
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TabsPicker.cjs +131 -129
- package/dist/TabsPicker.cjs.map +1 -1
- package/dist/TabsPicker.css +132 -126
- package/dist/TabsPicker.css.map +1 -1
- package/dist/TabsPicker.mjs +131 -129
- package/dist/TabsPicker.mjs.map +1 -1
- package/dist/TagGroup.cjs +197 -193
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css +164 -158
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +197 -193
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs +67 -65
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css +71 -65
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs +67 -65
- package/dist/TextField.mjs.map +1 -1
- package/dist/Toast.cjs +138 -136
- package/dist/Toast.cjs.map +1 -1
- package/dist/Toast.css +117 -111
- package/dist/Toast.css.map +1 -1
- package/dist/Toast.mjs +138 -136
- package/dist/Toast.mjs.map +1 -1
- package/dist/ToggleButton.cjs +3 -3
- package/dist/ToggleButton.css +12 -14
- package/dist/ToggleButton.css.map +1 -1
- package/dist/ToggleButton.mjs +3 -3
- package/dist/Tooltip.cjs +99 -72
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css +87 -87
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs +99 -72
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/TreeView.cjs +169 -157
- package/dist/TreeView.cjs.map +1 -1
- package/dist/TreeView.css +155 -153
- package/dist/TreeView.css.map +1 -1
- package/dist/TreeView.mjs +169 -157
- package/dist/TreeView.mjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/icons/Skeleton.cjs +3 -3
- package/icons/Skeleton.cjs.map +1 -1
- package/icons/Skeleton.css +8 -10
- package/icons/Skeleton.css.map +1 -1
- package/icons/Skeleton.mjs +3 -3
- package/icons/Skeleton.mjs.map +1 -1
- package/package.json +22 -22
- package/src/Card.tsx +3 -3
- package/src/Disclosure.tsx +3 -3
- package/src/TableView.tsx +1 -4
- package/src/style-utils.ts +0 -2
- package/style/__tests__/style-macro.test.js +323 -27
- package/style/dist/properties.cjs +4 -0
- package/style/dist/properties.cjs.map +1 -0
- package/style/dist/properties.mjs +6 -0
- package/style/dist/properties.mjs.map +1 -0
- package/style/dist/spectrum-theme.cjs +123 -124
- package/style/dist/spectrum-theme.cjs.map +1 -1
- package/style/dist/spectrum-theme.mjs +124 -125
- package/style/dist/spectrum-theme.mjs.map +1 -1
- package/style/dist/style-macro.cjs +244 -263
- package/style/dist/style-macro.cjs.map +1 -1
- package/style/dist/style-macro.mjs +240 -259
- package/style/dist/style-macro.mjs.map +1 -1
- package/style/dist/types.d.ts +84 -80
- package/style/dist/types.d.ts.map +1 -1
- package/style/properties.json +2422 -0
- package/style/spectrum-theme.ts +101 -110
- package/style/style-macro.ts +319 -220
- package/style/types.ts +8 -4
package/dist/TagGroup.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"ACqFuB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAwMa;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAcjB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyBQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA+BF;;;;EAwDR;;;;EA6BC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8GC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAUgB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAGb;;;;EAOA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAreC;EAmWL;;;;EAAA;;;;;AAnWK;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IA8QE;;;;IAqFP;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA8GC;;;;IAAA;;;;;;AA9GD;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA","sources":["b7ca70995960d034","packages/@react-spectrum/s2/src/TagGroup.tsx"],"sourcesContent":["@import \"53ec8c3f8184f13f\";\n@import \"39511c3f261b5ed5\";\n@import \"0adf7c6cbf3a1f42\";\n@import \"05f90dba9e9f901e\";\n@import \"76f74241f914b430\";\n@import \"0ef2aba34cf241d8\";\n@import \"f86d9fb495210c39\";\n@import \"24a7cd4eab7f1ba0\";\n@import \"ce1f7d95b3ccf3fd\";\n@import \"70bbf6109092559b\";\n@import \"07833edfdb3bfcff\";\n@import \"ffbc1ae1f89af4e1\";\n@import \"c340d154a58b1eb0\";\n@import \"27e38777e711f6a4\";\n@import \"39f1002cc14ab33a\";\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 {ActionButton} from './ActionButton';\nimport AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagGroupProps as AriaTagGroupProps,\n TagProps as AriaTagProps,\n composeRenderProps,\n ContextValue,\n Provider,\n TextContext as RACTextContext,\n TagList,\n TagListProps,\n TagRenderProps,\n useLocale,\n useSlottedContext\n} from 'react-aria-components';\nimport {AvatarContext} from './Avatar';\nimport {CenterBaseline, centerBaseline} from './CenterBaseline';\nimport {ClearButton} from './ClearButton';\nimport {Collection, CollectionBuilder} from '@react-aria/collections';\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, HelpTextProps, Node, SpectrumLabelableProps} from '@react-types/shared';\nimport {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {flushSync} from 'react-dom';\nimport {focusRing, fontRelative, style} from '../style' with { type: 'macro' };\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {IconContext} from './Icon';\nimport {ImageContext} from './Image';\nimport {inertValue, useEffectEvent, useId, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n// Get types from RSP and extend those?\nexport interface TagProps extends Omit<AriaTagProps, 'children' | 'style' | 'className'> {\n /** The children of the tag. */\n children: ReactNode\n}\n\nexport interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children' | 'style' | 'className'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'>, Omit<SpectrumLabelableProps, 'isRequired' | 'necessityIndicator'>, StyleProps, Omit<HelpTextProps, 'errorMessage'> {\n /** A description for the tag group. */\n description?: ReactNode,\n /**\n * The size of the tag group.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /** Whether the tags are displayed in an emphasized style. */\n isEmphasized?: boolean,\n /** Provides content to display when there are no items in the tag group. */\n renderEmptyState?: () => ReactNode,\n /** Whether the tags are displayed in a error state. */\n isInvalid?: boolean,\n /** An error message for the field. */\n errorMessage?: ReactNode,\n /** Limit the number of rows initially shown. This will render a button that allows the user to expand to show all tags. */\n maxRows?: number,\n /** The label to display on the action button. */\n groupActionLabel?: string,\n /** Handler that is called when the action button is pressed. */\n onGroupAction?: () => void\n}\n\nexport const TagGroupContext = createContext<ContextValue<Partial<TagGroupProps<any>>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: 'text'\n});\n\nconst InternalTagGroupContext = createContext<TagGroupProps<any>>({});\n\n/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup<T extends object>(props: TagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TagGroupContext);\n props = useFormProps(props);\n let {onRemove} = props;\n return (\n <InternalTagGroupContext.Provider value={{onRemove}}>\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </InternalTagGroupContext.Provider>\n );\n});\n\nfunction TagGroupInner<T>({\n props: {\n label,\n description,\n labelPosition = 'top',\n labelAlign = 'start',\n isEmphasized,\n isInvalid,\n errorMessage,\n UNSAFE_className = '',\n UNSAFE_style,\n size = 'M',\n ...props\n },\n forwardedRef: ref,\n collection\n}: {props: TagGroupProps<T>, forwardedRef: DOMRef<HTMLDivElement>, collection: any}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n maxRows,\n groupActionLabel,\n onGroupAction,\n renderEmptyState = () => stringFormatter.format('tag.noTags'),\n ...otherProps\n } = props;\n let {direction} = useLocale();\n let containerRef = useRef(null);\n let tagsRef = useRef<HTMLDivElement | null>(null);\n let actionsRef = useRef<HTMLDivElement | null>(null);\n let hiddenTagsRef = useRef<HTMLDivElement | null>(null);\n let [tagState, setTagState] = useState({visibleTagCount: collection.size, showCollapseButton: false});\n let [isCollapsed, setIsCollapsed] = useState(maxRows != null);\n let {onRemove} = useContext(InternalTagGroupContext);\n let isEmpty = collection.size === 0;\n let showCollapseToggleButton = tagState.showCollapseButton || tagState.visibleTagCount < collection.size;\n let formContext = useContext(FormContext);\n let domRef = useDOMRef(ref);\n\n let allItems = useMemo(\n () => Array.from(collection) as Array<Node<T>>,\n [collection]\n );\n let items = useMemo(\n () => Array.from(collection).slice(0, !isCollapsed ? collection.size : tagState.visibleTagCount) as Array<Node<T>>,\n [collection, tagState.visibleTagCount, isCollapsed]\n );\n\n let updateVisibleTagCount = useEffectEvent(() => {\n if (maxRows == null) {\n setTagState({visibleTagCount: collection.size, showCollapseButton: false});\n }\n\n if (maxRows != null && maxRows > 0) {\n let computeVisibleTagCount = () => {\n let currContainerRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currTagsRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currActionsRef: HTMLDivElement | null = actionsRef.current;\n if (!currContainerRef || !currTagsRef || collection.size === 0 || currContainerRef.parentElement == null) {\n return {\n visibleTagCount: 0,\n showCollapseButton: false\n };\n }\n\n // Count rows and show tags until we hit the maxRows.\n // I think this is still a safe assumption, and we don't need to queryAll for role=tag\n let tags = [...currTagsRef.children];\n let currY = -Infinity;\n let rowCount = 0;\n let index = 0;\n let tagWidths: number[] = [];\n for (let tag of tags) {\n let {width, y} = tag.getBoundingClientRect();\n\n if (y !== currY) {\n currY = y;\n rowCount++;\n }\n\n if (rowCount > maxRows) {\n break;\n }\n tagWidths.push(width);\n index++;\n }\n\n // Remove tags until there is space for the collapse button and action button (if present) on the last row.\n let buttons = currActionsRef ? [...currActionsRef.children] : [];\n if (buttons.length > 0 && rowCount >= maxRows) {\n let buttonsWidth = buttons.reduce((acc, curr) => acc += curr.getBoundingClientRect().width, 0);\n let margins = parseFloat(getComputedStyle(buttons[0]).marginInlineStart);\n buttonsWidth += margins * 2;\n let end = direction === 'ltr' ? 'right' : 'left';\n let containerEnd = currContainerRef.parentElement?.getBoundingClientRect()[end] - margins;\n let lastTagEnd = tags[index - 1]?.getBoundingClientRect()[end];\n lastTagEnd += margins;\n let availableWidth = containerEnd - lastTagEnd;\n\n while (availableWidth <= buttonsWidth && index > 0) {\n let tagWidth = tagWidths.pop();\n if (tagWidth != null) {\n availableWidth += tagWidth;\n }\n index--;\n }\n }\n\n return {\n visibleTagCount: Math.max(index, 1),\n showCollapseButton: index < collection.size\n };\n };\n let result = computeVisibleTagCount();\n flushSync(() => {\n setTagState(result);\n });\n }\n });\n\n useResizeObserver({ref: maxRows != null ? containerRef : undefined, onResize: updateVisibleTagCount});\n\n useLayoutEffect(() => {\n if (collection.size > 0 && (maxRows != null && maxRows > 0)) {\n queueMicrotask(updateVisibleTagCount);\n }\n }, [collection.size, updateVisibleTagCount, maxRows]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateVisibleTagCount());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let handlePressCollapse = () => {\n setIsCollapsed(prevCollapsed => !prevCollapsed);\n };\n\n let helpText: ReactNode = null;\n if (!isInvalid && description) {\n helpText = (\n <Text\n slot=\"description\"\n styles={helpTextStyles({size})}>\n {description}\n </Text>\n );\n } else if (isInvalid) {\n helpText = (\n <div\n className={helpTextStyles({size, isInvalid})}>\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n <Text slot=\"errorMessage\">\n {errorMessage}\n </Text>\n </div>\n );\n }\n\n return (\n <AriaTagGroup\n {...otherProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size,\n labelPosition: labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n <FieldLabel\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <div\n ref={containerRef}\n className={style({\n gridArea: 'input',\n minWidth: 'full',\n marginStart: {\n default: -4,\n isEmpty: 0\n },\n marginEnd: {\n default: 4,\n isEmpty: 0\n },\n position: 'relative'\n })({isEmpty})}>\n <FormContext.Provider value={{...formContext, size}}>\n <Provider\n values={[\n [RACTextContext, undefined],\n [TagGroupContext, {size, isEmphasized}]\n ]}>\n {/* invisible collection for measuring */}\n {maxRows != null && (\n <div\n // @ts-ignore\n inert={inertValue(true)}\n ref={hiddenTagsRef}\n className={style({\n display: 'inline',\n flexWrap: 'wrap',\n fontFamily: 'sans',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: -4,\n end: 4,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {allItems.map(item => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n return (\n <div\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, allowsRemoving: Boolean(onRemove)})}>\n {item.props.children({size, allowsRemoving: Boolean(onRemove), isInCtx: true})}\n </div>\n );\n })}\n </div>\n )}\n {/* real tag list */}\n <TagList\n ref={tagsRef}\n items={items}\n renderEmptyState={renderEmptyState}\n className={style({\n display: 'inline',\n minWidth: 'full',\n font: 'ui'\n })}>\n {item => <Tag {...item.props} id={item.key} textValue={item.textValue} />}\n </TagList>\n {!isEmpty && (showCollapseToggleButton || groupActionLabel) &&\n <ActionGroup\n collection={collection}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n actionsRef={actionsRef}\n tagState={tagState}\n size={size}\n isCollapsed={isCollapsed}\n handlePressCollapse={handlePressCollapse}\n onGroupAction={onGroupAction}\n groupActionLabel={groupActionLabel} />\n }\n </Provider>\n </FormContext.Provider>\n </div>\n {helpText}\n </AriaTagGroup>\n );\n}\n\nfunction ActionGroup(props) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n actionsRef,\n tagState,\n size,\n isCollapsed,\n handlePressCollapse,\n onGroupAction,\n groupActionLabel,\n collection,\n // directly use aria-labelling from the TagGroup because we can't use the id from the TagList\n // and we can't supply an id to the TagList because it'll cause an issue where all the tag ids flip back\n // and forth with their prefix in an infinite loop\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n let actionsId = useId();\n // might need to localize the aria-label which concatenates with this label\n let actionGroupLabel = stringFormatter.format('tag.actions');\n return (\n <div\n role=\"group\"\n ref={actionsRef}\n id={actionsId}\n aria-label={ariaLabel ? `${ariaLabel} ${actionGroupLabel}` : actionGroupLabel}\n aria-labelledby={ariaLabelledBy ? ariaLabelledBy : undefined}\n className={style({\n display: 'inline'\n })}>\n {tagState.showCollapseButton &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={handlePressCollapse}>\n {isCollapsed ?\n stringFormatter.format('tag.showAllButtonLabel', {tagCount: collection.size}) :\n stringFormatter.format('tag.hideButtonLabel')}\n </ActionButton>\n }\n {groupActionLabel && onGroupAction &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={() => onGroupAction?.()}>\n {groupActionLabel}\n </ActionButton>\n }\n </div>\n );\n}\n\nconst tagStyles = style<TagRenderProps & {size?: 'S' | 'M' | 'L', isEmphasized?: boolean, isLink?: boolean, allowsRemoving?: boolean}>({\n ...focusRing(),\n display: 'inline-flex',\n boxSizing: 'border-box',\n maxWidth: 'full',\n verticalAlign: 'middle',\n alignItems: 'center',\n justifyContent: 'center',\n font: 'control',\n height: 'control',\n transition: 'default',\n minWidth: 0,\n // maxWidth: '[calc(self(height) * 7)]', // s2 designs show a max width on tags but we pushed back on this in v3\n backgroundColor: {\n default: 'gray-100',\n isHovered: {\n default: 'gray-200'\n },\n isFocusVisible: {\n default: 'gray-200'\n },\n isSelected: {\n default: 'neutral',\n isEmphasized: {\n default: 'accent'\n }\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonFace',\n isSelected: 'Highlight'\n }\n },\n color: {\n default: 'neutral',\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n paddingStart: {\n default: 'edge-to-text'\n },\n paddingEnd: {\n default: 'edge-to-text',\n allowsRemoving: 0\n },\n paddingY: 0,\n margin: 4,\n borderRadius: 'control',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2)\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst avatarSize = {\n S: 16,\n M: 20,\n L: 24\n} as const;\n\n/** An individual Tag for TagGroups. */\nexport const Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tag({children, textValue, ...props}: TagProps, ref: DOMRef<HTMLDivElement>) {\n textValue ||= typeof children === 'string' ? children : undefined;\n let ctx = useSlottedContext(TagGroupContext);\n let isInRealDOM = Boolean(ctx?.size);\n let {size, isEmphasized} = ctx ?? {};\n let domRef = useDOMRef(ref);\n\n let backupRef = useRef(null);\n domRef = domRef || backupRef;\n let isLink = props.href != null;\n return (\n <AriaTag\n textValue={textValue}\n {...props}\n ref={domRef}\n style={pressScale(domRef)}\n className={renderProps => tagStyles({size, isEmphasized, isLink, ...renderProps})} >\n {composeRenderProps(children, (children, renderProps) => (\n <TagWrapper isInRealDOM={isInRealDOM} {...renderProps}>{typeof children === 'string' ? <Text>{children}</Text> : children}</TagWrapper>\n ))}\n </AriaTag>\n );\n});\n\nfunction TagWrapper({children, isDisabled, allowsRemoving, isInRealDOM}) {\n let {size = 'M'} = useSlottedContext(TagGroupContext) ?? {};\n return (\n <>\n {isInRealDOM && (\n <div\n className={style({\n display: 'flex',\n minWidth: 0,\n alignItems: 'center',\n gap: 'text-to-visual',\n forcedColorAdjust: 'none',\n backgroundColor: 'transparent'\n })}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({order: 0})\n }],\n [ImageContext, {\n styles: style({\n size: fontRelative(20),\n flexShrink: 0,\n order: 0,\n aspectRatio: 'square',\n objectFit: 'contain',\n borderRadius: 'sm'\n })\n }]\n ]}>\n {children}\n </Provider>\n </div>\n )}\n {!isInRealDOM && children}\n {allowsRemoving && isInRealDOM && (\n <ClearButton\n slot=\"remove\"\n size={size}\n isDisabled={isDisabled} />\n )}\n </>\n );\n}\n"],"names":[],"version":3,"file":"TagGroup.css.map"}
|
|
1
|
+
{"mappings":"ACqFuB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAwMa;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAcjB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAyBQ;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA+BF;;;;EAwDR;;;;EA6BC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8GC;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAUgB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAGb;;;;EAOA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAreC;EAmWL;;;;EAAA;;;;;AAnWK;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IA8QE;;;;IAqFP;;;;IAAA;;;;IAAA;;;;IAAA;;;;IA8GC;;;;IAAA;;;;;;AA9GD;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA","sources":["b7ca70995960d034","packages/@react-spectrum/s2/src/TagGroup.tsx"],"sourcesContent":["@import \"53ec8c3f8184f13f\";\n@import \"39511c3f261b5ed5\";\n@import \"0adf7c6cbf3a1f42\";\n@import \"05f90dba9e9f901e\";\n@import \"76f74241f914b430\";\n@import \"0ef2aba34cf241d8\";\n@import \"f86d9fb495210c39\";\n@import \"24a7cd4eab7f1ba0\";\n@import \"ce1f7d95b3ccf3fd\";\n@import \"70bbf6109092559b\";\n@import \"07833edfdb3bfcff\";\n@import \"ffbc1ae1f89af4e1\";\n@import \"c340d154a58b1eb0\";\n@import \"27e38777e711f6a4\";\n@import \"39f1002cc14ab33a\";\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 {ActionButton} from './ActionButton';\nimport AlertIcon from '../s2wf-icons/S2_Icon_AlertTriangle_20_N.svg';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagGroupProps as AriaTagGroupProps,\n TagProps as AriaTagProps,\n composeRenderProps,\n ContextValue,\n Provider,\n TextContext as RACTextContext,\n TagList,\n TagListProps,\n TagRenderProps,\n useLocale,\n useSlottedContext\n} from 'react-aria-components';\nimport {AvatarContext} from './Avatar';\nimport {CenterBaseline, centerBaseline} from './CenterBaseline';\nimport {ClearButton} from './ClearButton';\nimport {Collection, CollectionBuilder} from '@react-aria/collections';\nimport {createContext, forwardRef, ReactNode, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {DOMRef, DOMRefValue, HelpTextProps, Node, SpectrumLabelableProps} from '@react-types/shared';\nimport {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {FieldLabel} from './Field';\nimport {flushSync} from 'react-dom';\nimport {focusRing, fontRelative, style} from '../style' with { type: 'macro' };\nimport {FormContext, useFormProps} from './Form';\nimport {forwardRefType} from './types';\nimport {IconContext} from './Icon';\nimport {ImageContext} from './Image';\nimport {inertValue, useEffectEvent, useId, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {pressScale} from './pressScale';\nimport {Text, TextContext} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\n// Get types from RSP and extend those?\nexport interface TagProps extends Omit<AriaTagProps, 'children' | 'style' | 'className'> {\n /** The children of the tag. */\n children: ReactNode\n}\n\nexport interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children' | 'style' | 'className'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'>, Omit<SpectrumLabelableProps, 'isRequired' | 'necessityIndicator'>, StyleProps, Omit<HelpTextProps, 'errorMessage'> {\n /** A description for the tag group. */\n description?: ReactNode,\n /**\n * The size of the tag group.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /** Whether the tags are displayed in an emphasized style. */\n isEmphasized?: boolean,\n /** Provides content to display when there are no items in the tag group. */\n renderEmptyState?: () => ReactNode,\n /** Whether the tags are displayed in a error state. */\n isInvalid?: boolean,\n /** An error message for the field. */\n errorMessage?: ReactNode,\n /** Limit the number of rows initially shown. This will render a button that allows the user to expand to show all tags. */\n maxRows?: number,\n /** The label to display on the action button. */\n groupActionLabel?: string,\n /** Handler that is called when the action button is pressed. */\n onGroupAction?: () => void\n}\n\nexport const TagGroupContext = createContext<ContextValue<Partial<TagGroupProps<any>>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst helpTextStyles = style({\n gridArea: 'helptext',\n display: 'flex',\n alignItems: 'baseline',\n gap: 'text-to-visual',\n font: 'control',\n color: {\n default: 'neutral-subdued',\n isInvalid: 'negative'\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n },\n contain: 'inline-size',\n paddingTop: '--field-gap',\n cursor: 'text'\n});\n\nconst InternalTagGroupContext = createContext<TagGroupProps<any>>({});\n\n/** Tags allow users to categorize content. They can represent keywords or people, and are grouped to describe an item or a search request. */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup<T extends object>(props: TagGroupProps<T>, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TagGroupContext);\n props = useFormProps(props);\n let {onRemove} = props;\n return (\n <InternalTagGroupContext.Provider value={{onRemove}}>\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n </InternalTagGroupContext.Provider>\n );\n});\n\nfunction TagGroupInner<T>({\n props: {\n label,\n description,\n labelPosition = 'top',\n labelAlign = 'start',\n isEmphasized,\n isInvalid,\n errorMessage,\n UNSAFE_className = '',\n UNSAFE_style,\n size = 'M',\n ...props\n },\n forwardedRef: ref,\n collection\n}: {props: TagGroupProps<T>, forwardedRef: DOMRef<HTMLDivElement>, collection: any}) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n maxRows,\n groupActionLabel,\n onGroupAction,\n renderEmptyState = () => stringFormatter.format('tag.noTags'),\n ...otherProps\n } = props;\n let {direction} = useLocale();\n let containerRef = useRef(null);\n let tagsRef = useRef<HTMLDivElement | null>(null);\n let actionsRef = useRef<HTMLDivElement | null>(null);\n let hiddenTagsRef = useRef<HTMLDivElement | null>(null);\n let [tagState, setTagState] = useState({visibleTagCount: collection.size, showCollapseButton: false});\n let [isCollapsed, setIsCollapsed] = useState(maxRows != null);\n let {onRemove} = useContext(InternalTagGroupContext);\n let isEmpty = collection.size === 0;\n let showCollapseToggleButton = tagState.showCollapseButton || tagState.visibleTagCount < collection.size;\n let formContext = useContext(FormContext);\n let domRef = useDOMRef(ref);\n\n let allItems = useMemo(\n () => Array.from(collection) as Array<Node<T>>,\n [collection]\n );\n let items = useMemo(\n () => Array.from(collection).slice(0, !isCollapsed ? collection.size : tagState.visibleTagCount) as Array<Node<T>>,\n [collection, tagState.visibleTagCount, isCollapsed]\n );\n\n let updateVisibleTagCount = useEffectEvent(() => {\n if (maxRows == null) {\n setTagState({visibleTagCount: collection.size, showCollapseButton: false});\n }\n\n if (maxRows != null && maxRows > 0) {\n let computeVisibleTagCount = () => {\n let currContainerRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currTagsRef: HTMLDivElement | null = hiddenTagsRef.current;\n let currActionsRef: HTMLDivElement | null = actionsRef.current;\n if (!currContainerRef || !currTagsRef || collection.size === 0 || currContainerRef.parentElement == null) {\n return {\n visibleTagCount: 0,\n showCollapseButton: false\n };\n }\n\n // Count rows and show tags until we hit the maxRows.\n // I think this is still a safe assumption, and we don't need to queryAll for role=tag\n let tags = [...currTagsRef.children];\n let currY = -Infinity;\n let rowCount = 0;\n let index = 0;\n let tagWidths: number[] = [];\n for (let tag of tags) {\n let {width, y} = tag.getBoundingClientRect();\n\n if (y !== currY) {\n currY = y;\n rowCount++;\n }\n\n if (rowCount > maxRows) {\n break;\n }\n tagWidths.push(width);\n index++;\n }\n\n // Remove tags until there is space for the collapse button and action button (if present) on the last row.\n let buttons = currActionsRef ? [...currActionsRef.children] : [];\n if (buttons.length > 0 && rowCount >= maxRows) {\n let buttonsWidth = buttons.reduce((acc, curr) => acc += curr.getBoundingClientRect().width, 0);\n let margins = parseFloat(getComputedStyle(buttons[0]).marginInlineStart);\n buttonsWidth += margins * 2;\n let end = direction === 'ltr' ? 'right' : 'left';\n let containerEnd = currContainerRef.parentElement?.getBoundingClientRect()[end] - margins;\n let lastTagEnd = tags[index - 1]?.getBoundingClientRect()[end];\n lastTagEnd += margins;\n let availableWidth = containerEnd - lastTagEnd;\n\n while (availableWidth <= buttonsWidth && index > 0) {\n let tagWidth = tagWidths.pop();\n if (tagWidth != null) {\n availableWidth += tagWidth;\n }\n index--;\n }\n }\n\n return {\n visibleTagCount: Math.max(index, 1),\n showCollapseButton: index < collection.size\n };\n };\n let result = computeVisibleTagCount();\n flushSync(() => {\n setTagState(result);\n });\n }\n });\n\n useResizeObserver({ref: maxRows != null ? containerRef : undefined, onResize: updateVisibleTagCount});\n\n useLayoutEffect(() => {\n if (collection.size > 0 && (maxRows != null && maxRows > 0)) {\n queueMicrotask(updateVisibleTagCount);\n }\n }, [collection.size, updateVisibleTagCount, maxRows]);\n\n useEffect(() => {\n // Recalculate visible tags when fonts are loaded.\n document.fonts?.ready.then(() => updateVisibleTagCount());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n let handlePressCollapse = () => {\n setIsCollapsed(prevCollapsed => !prevCollapsed);\n };\n\n let helpText: ReactNode = null;\n if (!isInvalid && description) {\n helpText = (\n <Text\n slot=\"description\"\n styles={helpTextStyles({size})}>\n {description}\n </Text>\n );\n } else if (isInvalid) {\n helpText = (\n <div\n className={helpTextStyles({size, isInvalid})}>\n <CenterBaseline>\n <AlertIcon />\n </CenterBaseline>\n <Text slot=\"errorMessage\">\n {errorMessage}\n </Text>\n </div>\n );\n }\n\n return (\n <AriaTagGroup\n {...otherProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size,\n labelPosition: labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n <FieldLabel\n size={size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n <div\n ref={containerRef}\n className={style({\n gridArea: 'input',\n minWidth: 'full',\n marginStart: {\n default: -4,\n isEmpty: 0\n },\n marginEnd: {\n default: 4,\n isEmpty: 0\n },\n position: 'relative'\n })({isEmpty})}>\n <FormContext.Provider value={{...formContext, size}}>\n <Provider\n values={[\n [RACTextContext, undefined],\n [TagGroupContext, {size, isEmphasized}]\n ]}>\n {/* invisible collection for measuring */}\n {maxRows != null && (\n <div\n // @ts-ignore\n inert={inertValue(true)}\n ref={hiddenTagsRef}\n className={style({\n display: 'inline',\n flexWrap: 'wrap',\n fontFamily: 'sans',\n position: 'absolute',\n top: 0,\n bottom: 0,\n start: -4,\n end: 4,\n visibility: 'hidden',\n overflow: 'hidden',\n opacity: 0\n })}>\n {allItems.map(item => {\n // pull off individual props as an allow list, don't want refs or other props getting through\n return (\n <div\n style={item.props.UNSAFE_style}\n key={item.key}\n className={item.props.className({size, allowsRemoving: Boolean(onRemove)})}>\n {item.props.children({size, allowsRemoving: Boolean(onRemove), isInCtx: true})}\n </div>\n );\n })}\n </div>\n )}\n {/* real tag list */}\n <TagList\n ref={tagsRef}\n items={items}\n renderEmptyState={renderEmptyState}\n className={style({\n display: 'inline',\n minWidth: 'full',\n font: 'ui'\n })}>\n {item => <Tag {...item.props} id={item.key} textValue={item.textValue} />}\n </TagList>\n {!isEmpty && (showCollapseToggleButton || groupActionLabel) &&\n <ActionGroup\n collection={collection}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n actionsRef={actionsRef}\n tagState={tagState}\n size={size}\n isCollapsed={isCollapsed}\n handlePressCollapse={handlePressCollapse}\n onGroupAction={onGroupAction}\n groupActionLabel={groupActionLabel} />\n }\n </Provider>\n </FormContext.Provider>\n </div>\n {helpText}\n </AriaTagGroup>\n );\n}\n\nfunction ActionGroup(props) {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let {\n actionsRef,\n tagState,\n size,\n isCollapsed,\n handlePressCollapse,\n onGroupAction,\n groupActionLabel,\n collection,\n // directly use aria-labelling from the TagGroup because we can't use the id from the TagList\n // and we can't supply an id to the TagList because it'll cause an issue where all the tag ids flip back\n // and forth with their prefix in an infinite loop\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n } = props;\n\n let actionsId = useId();\n // might need to localize the aria-label which concatenates with this label\n let actionGroupLabel = stringFormatter.format('tag.actions');\n return (\n <div\n role=\"group\"\n ref={actionsRef}\n id={actionsId}\n aria-label={ariaLabel ? `${ariaLabel} ${actionGroupLabel}` : actionGroupLabel}\n aria-labelledby={ariaLabelledBy ? ariaLabelledBy : undefined}\n className={style({\n display: 'inline'\n })}>\n {tagState.showCollapseButton &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={handlePressCollapse}>\n {isCollapsed ?\n stringFormatter.format('tag.showAllButtonLabel', {tagCount: collection.size}) :\n stringFormatter.format('tag.hideButtonLabel')}\n </ActionButton>\n }\n {groupActionLabel && onGroupAction &&\n <ActionButton\n isQuiet\n size={size}\n styles={style({margin: 4})}\n UNSAFE_style={{display: 'inline-flex'}}\n onPress={() => onGroupAction?.()}>\n {groupActionLabel}\n </ActionButton>\n }\n </div>\n );\n}\n\nconst tagStyles = style<TagRenderProps & {size?: 'S' | 'M' | 'L', isEmphasized?: boolean, isLink?: boolean, allowsRemoving?: boolean}>({\n ...focusRing(),\n display: 'inline-flex',\n boxSizing: 'border-box',\n maxWidth: 'full',\n verticalAlign: 'middle',\n alignItems: 'center',\n justifyContent: 'center',\n font: 'control',\n height: 'control',\n transition: 'default',\n minWidth: 0,\n // maxWidth: '[calc(self(height) * 7)]', // s2 designs show a max width on tags but we pushed back on this in v3\n backgroundColor: {\n default: 'gray-100',\n isHovered: {\n default: 'gray-200'\n },\n isFocusVisible: {\n default: 'gray-200'\n },\n isSelected: {\n default: 'neutral',\n isEmphasized: {\n default: 'accent'\n }\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonFace',\n isSelected: 'Highlight'\n }\n },\n color: {\n default: 'neutral',\n isSelected: {\n default: 'gray-25',\n isEmphasized: 'white'\n },\n isDisabled: 'disabled',\n forcedColors: {\n default: 'ButtonText',\n isSelected: 'HighlightText',\n isDisabled: 'GrayText'\n }\n },\n borderStyle: 'none',\n paddingStart: {\n default: 'edge-to-text'\n },\n paddingEnd: {\n default: 'edge-to-text',\n allowsRemoving: 0\n },\n paddingY: 0,\n margin: 4,\n borderRadius: 'control',\n cursor: {\n default: 'default',\n isLink: 'pointer'\n },\n '--iconMargin': {\n type: 'marginTop',\n value: {\n default: fontRelative(-2)\n }\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst avatarSize = {\n S: 16,\n M: 20,\n L: 24\n} as const;\n\n/** An individual Tag for TagGroups. */\nexport const Tag = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tag({children, textValue, ...props}: TagProps, ref: DOMRef<HTMLDivElement>) {\n textValue ||= typeof children === 'string' ? children : undefined;\n let ctx = useSlottedContext(TagGroupContext);\n let isInRealDOM = Boolean(ctx?.size);\n let {size, isEmphasized} = ctx ?? {};\n let domRef = useDOMRef(ref);\n\n let backupRef = useRef(null);\n domRef = domRef || backupRef;\n let isLink = props.href != null;\n return (\n <AriaTag\n textValue={textValue}\n {...props}\n ref={domRef}\n style={pressScale(domRef)}\n className={renderProps => tagStyles({size, isEmphasized, isLink, ...renderProps})} >\n {composeRenderProps(children, (children, renderProps) => (\n <TagWrapper isInRealDOM={isInRealDOM} {...renderProps}>{typeof children === 'string' ? <Text>{children}</Text> : children}</TagWrapper>\n ))}\n </AriaTag>\n );\n});\n\nfunction TagWrapper({children, isDisabled, allowsRemoving, isInRealDOM}) {\n let {size = 'M'} = useSlottedContext(TagGroupContext) ?? {};\n return (\n <>\n {isInRealDOM && (\n <div\n className={style({\n display: 'flex',\n minWidth: 0,\n alignItems: 'center',\n gap: 'text-to-visual',\n forcedColorAdjust: 'none',\n backgroundColor: 'transparent'\n })}>\n <Provider\n values={[\n [TextContext, {styles: style({order: 1, truncate: true})}],\n [IconContext, {\n render: centerBaseline({slot: 'icon', styles: style({order: 0})}),\n styles: style({size: fontRelative(20), marginStart: '--iconMargin', flexShrink: 0})\n }],\n [AvatarContext, {\n size: avatarSize[size],\n styles: style({order: 0})\n }],\n [ImageContext, {\n styles: style({\n size: fontRelative(20),\n flexShrink: 0,\n order: 0,\n aspectRatio: 'square',\n objectFit: 'contain',\n borderRadius: 'sm'\n })\n }]\n ]}>\n {children}\n </Provider>\n </div>\n )}\n {!isInRealDOM && children}\n {allowsRemoving && isInRealDOM && (\n <ClearButton\n slot=\"remove\"\n size={size}\n isDisabled={isDisabled} />\n )}\n </>\n );\n}\n"],"names":[],"version":3,"file":"TagGroup.css.map"}
|
package/dist/TagGroup.mjs
CHANGED
|
@@ -58,59 +58,61 @@ function $parcel$interopDefault(a) {
|
|
|
58
58
|
|
|
59
59
|
const $1d63bfab43d9ffe1$export$5b07b5dd2cbd96e3 = /*#__PURE__*/ (0, $kY5I6$createContext)(null);
|
|
60
60
|
const $1d63bfab43d9ffe1$var$helpTextStyles = function anonymous(props) {
|
|
61
|
-
let rules = "
|
|
62
|
-
rules += '
|
|
63
|
-
rules += '
|
|
64
|
-
rules += '
|
|
65
|
-
rules += '
|
|
66
|
-
rules += '
|
|
67
|
-
rules += '
|
|
68
|
-
rules += '
|
|
69
|
-
rules += '
|
|
70
|
-
rules += '
|
|
71
|
-
rules += '
|
|
72
|
-
rules += '
|
|
73
|
-
rules += '
|
|
74
|
-
rules += '
|
|
75
|
-
rules += '
|
|
76
|
-
rules += '
|
|
77
|
-
rules += '
|
|
78
|
-
rules += '
|
|
79
|
-
rules += '
|
|
61
|
+
let rules = " ";
|
|
62
|
+
rules += ' LzBWQ8d';
|
|
63
|
+
rules += ' NzBWQ8d';
|
|
64
|
+
rules += ' _fzBWQ8d';
|
|
65
|
+
rules += ' _dzBWQ8d';
|
|
66
|
+
rules += ' ma';
|
|
67
|
+
rules += ' Fb';
|
|
68
|
+
rules += ' pc';
|
|
69
|
+
rules += ' pad';
|
|
70
|
+
rules += ' kb';
|
|
71
|
+
rules += ' kac';
|
|
72
|
+
rules += ' bh';
|
|
73
|
+
rules += ' bdf';
|
|
74
|
+
rules += ' beg';
|
|
75
|
+
rules += ' bfa';
|
|
76
|
+
rules += ' bgb';
|
|
77
|
+
rules += ' bhd';
|
|
78
|
+
rules += ' bje';
|
|
79
|
+
rules += ' bic';
|
|
80
80
|
if (props.size === "XL") {
|
|
81
|
-
rules += '
|
|
82
|
-
rules += '
|
|
81
|
+
rules += ' ah';
|
|
82
|
+
rules += ' aac';
|
|
83
83
|
} else if (props.size === "L") {
|
|
84
|
-
rules += '
|
|
85
|
-
rules += '
|
|
84
|
+
rules += ' ae';
|
|
85
|
+
rules += ' aad';
|
|
86
86
|
} else if (props.size === "S") {
|
|
87
|
-
rules += '
|
|
88
|
-
rules += '
|
|
87
|
+
rules += ' af';
|
|
88
|
+
rules += ' aag';
|
|
89
89
|
} else if (props.size === "XS") {
|
|
90
|
-
rules += '
|
|
91
|
-
rules += '
|
|
90
|
+
rules += ' ai';
|
|
91
|
+
rules += ' aaj';
|
|
92
92
|
} else {
|
|
93
|
-
rules += '
|
|
94
|
-
rules += '
|
|
93
|
+
rules += ' aa';
|
|
94
|
+
rules += ' aab';
|
|
95
95
|
}
|
|
96
|
-
rules += '
|
|
97
|
-
rules += '
|
|
98
|
-
rules += '
|
|
96
|
+
rules += ' Da';
|
|
97
|
+
rules += ' Ea';
|
|
98
|
+
rules += ' Ca';
|
|
99
|
+
rules += ' gb';
|
|
100
|
+
rules += ' gca';
|
|
99
101
|
if (props.isInvalid) {
|
|
100
|
-
if (props.isPressed) rules += '
|
|
101
|
-
else if (props.isFocusVisible) rules += '
|
|
102
|
-
else if (props.isHovered) rules += '
|
|
103
|
-
else rules += '
|
|
102
|
+
if (props.isPressed) rules += ' dk';
|
|
103
|
+
else if (props.isFocusVisible) rules += ' dk';
|
|
104
|
+
else if (props.isHovered) rules += ' dk';
|
|
105
|
+
else rules += ' dt';
|
|
104
106
|
} else {
|
|
105
|
-
if (props.isPressed) rules += '
|
|
106
|
-
else if (props.isFocusVisible) rules += '
|
|
107
|
-
else if (props.isHovered) rules += '
|
|
108
|
-
else rules += '
|
|
107
|
+
if (props.isPressed) rules += ' da';
|
|
108
|
+
else if (props.isFocusVisible) rules += ' da';
|
|
109
|
+
else if (props.isHovered) rules += ' da';
|
|
110
|
+
else rules += ' dg';
|
|
109
111
|
}
|
|
110
|
-
rules += ' -
|
|
111
|
-
rules += '
|
|
112
|
-
rules += '
|
|
113
|
-
rules += '
|
|
112
|
+
rules += ' -_8sjo0b-Oa';
|
|
113
|
+
rules += ' _va';
|
|
114
|
+
rules += ' rgOnRt';
|
|
115
|
+
rules += ' Ac';
|
|
114
116
|
return rules;
|
|
115
117
|
};
|
|
116
118
|
const $1d63bfab43d9ffe1$var$InternalTagGroupContext = /*#__PURE__*/ (0, $kY5I6$createContext)({});
|
|
@@ -270,60 +272,60 @@ function $1d63bfab43d9ffe1$var$TagGroupInner({ props: { label: label, descriptio
|
|
|
270
272
|
ref: domRef,
|
|
271
273
|
style: UNSAFE_style,
|
|
272
274
|
className: UNSAFE_className + function anonymous(props, overrides) {
|
|
273
|
-
let rules = "
|
|
274
|
-
let
|
|
275
|
-
|
|
276
|
-
let
|
|
277
|
-
let $__c = false;
|
|
275
|
+
let rules = " ";
|
|
276
|
+
let gridColumnStart = false;
|
|
277
|
+
let gridColumnEnd = false;
|
|
278
|
+
let matches = (overrides || '').matchAll(/(?:^|\s)(j|l|h|i|_H|_r|M|__f|_X|_M|L|N|_f|_d|K|__B|H|G|J|I|f|u|_l)[^\s]+/g);
|
|
278
279
|
for (let p of matches){
|
|
279
|
-
if (
|
|
280
|
-
if (
|
|
280
|
+
if (p[1] === "L") gridColumnStart = true;
|
|
281
|
+
if (p[1] === "N") gridColumnEnd = true;
|
|
282
|
+
rules += p[0];
|
|
281
283
|
}
|
|
282
|
-
rules += '
|
|
283
|
-
if (
|
|
284
|
-
if (
|
|
284
|
+
rules += ' mb';
|
|
285
|
+
if (props.isInForm) {
|
|
286
|
+
if (!gridColumnStart) rules += ' L2mU';
|
|
285
287
|
}
|
|
286
|
-
if (
|
|
287
|
-
if (props.
|
|
288
|
-
if (
|
|
288
|
+
if (props.isInForm) {
|
|
289
|
+
if (props.labelPosition === "side") {
|
|
290
|
+
if (!gridColumnEnd) rules += ' NvoofG';
|
|
289
291
|
}
|
|
290
292
|
}
|
|
291
|
-
if (props.isInForm) rules += '
|
|
293
|
+
if (props.isInForm) rules += ' SLwlgod';
|
|
292
294
|
else {
|
|
293
|
-
if (props.labelPosition === "side") rules += '
|
|
294
|
-
else if (props.labelPosition === "top") rules += '
|
|
295
|
+
if (props.labelPosition === "side") rules += ' SPlN5qb';
|
|
296
|
+
else if (props.labelPosition === "top") rules += ' SM8Mfn';
|
|
295
297
|
}
|
|
296
|
-
if (props.labelPosition === "side") rules += '
|
|
297
|
-
else if (props.labelPosition === "top") rules += '
|
|
298
|
-
if (props.labelPosition === "side") rules += '
|
|
299
|
-
else if (props.labelPosition === "top") rules += '
|
|
298
|
+
if (props.labelPosition === "side") rules += ' _FPlN5qb';
|
|
299
|
+
else if (props.labelPosition === "top") rules += ' _F4w1sLc';
|
|
300
|
+
if (props.labelPosition === "side") rules += ' _ubRM95c';
|
|
301
|
+
else if (props.labelPosition === "top") rules += ' _uxaocre';
|
|
300
302
|
if (props.size === "XL") {
|
|
301
|
-
rules += '
|
|
302
|
-
rules += '
|
|
303
|
+
rules += ' ah';
|
|
304
|
+
rules += ' aac';
|
|
303
305
|
} else if (props.size === "L") {
|
|
304
|
-
rules += '
|
|
305
|
-
rules += '
|
|
306
|
+
rules += ' ae';
|
|
307
|
+
rules += ' aad';
|
|
306
308
|
} else if (props.size === "S") {
|
|
307
|
-
rules += '
|
|
308
|
-
rules += '
|
|
309
|
+
rules += ' af';
|
|
310
|
+
rules += ' aag';
|
|
309
311
|
} else if (props.size === "XS") {
|
|
310
|
-
rules += '
|
|
311
|
-
rules += '
|
|
312
|
+
rules += ' ai';
|
|
313
|
+
rules += ' aaj';
|
|
312
314
|
} else {
|
|
313
|
-
rules += '
|
|
314
|
-
rules += '
|
|
315
|
+
rules += ' aa';
|
|
316
|
+
rules += ' aab';
|
|
315
317
|
}
|
|
316
|
-
rules += '
|
|
317
|
-
rules += '
|
|
318
|
-
rules += '
|
|
319
|
-
if (props.size === "XL") rules += ' -
|
|
320
|
-
else if (props.size === "L") rules += ' -
|
|
321
|
-
else if (props.size === "S") rules += ' -
|
|
322
|
-
else if (props.size === "XS") rules += ' -
|
|
323
|
-
else rules += ' -
|
|
324
|
-
rules += ' -
|
|
325
|
-
rules += '
|
|
326
|
-
rules += '
|
|
318
|
+
rules += ' Fb';
|
|
319
|
+
rules += ' gb';
|
|
320
|
+
rules += ' gca';
|
|
321
|
+
if (props.size === "XL") rules += ' -BhX7R-ee';
|
|
322
|
+
else if (props.size === "L") rules += ' -BhX7R-ed';
|
|
323
|
+
else if (props.size === "S") rules += ' -BhX7R-eb';
|
|
324
|
+
else if (props.size === "XS") rules += ' -BhX7R-ea';
|
|
325
|
+
else rules += ' -BhX7R-ec';
|
|
326
|
+
rules += ' -AJjOLd-p8R8pb';
|
|
327
|
+
rules += ' ka';
|
|
328
|
+
rules += ' _Ga';
|
|
327
329
|
return rules;
|
|
328
330
|
}({
|
|
329
331
|
size: size,
|
|
@@ -341,17 +343,17 @@ function $1d63bfab43d9ffe1$var$TagGroupInner({ props: { label: label, descriptio
|
|
|
341
343
|
/*#__PURE__*/ (0, $kY5I6$jsx)("div", {
|
|
342
344
|
ref: containerRef,
|
|
343
345
|
className: function anonymous(props) {
|
|
344
|
-
let rules = "
|
|
345
|
-
rules += '
|
|
346
|
-
rules += '
|
|
347
|
-
rules += '
|
|
348
|
-
rules += '
|
|
349
|
-
rules += '
|
|
350
|
-
if (props.isEmpty) rules += '
|
|
351
|
-
else rules += '
|
|
352
|
-
if (props.isEmpty) rules += '
|
|
353
|
-
else rules += '
|
|
354
|
-
rules += '
|
|
346
|
+
let rules = " ";
|
|
347
|
+
rules += ' LXcEWr';
|
|
348
|
+
rules += ' NXcEWr';
|
|
349
|
+
rules += ' _fXcEWr';
|
|
350
|
+
rules += ' _dXcEWr';
|
|
351
|
+
rules += ' ug';
|
|
352
|
+
if (props.isEmpty) rules += ' ha';
|
|
353
|
+
else rules += ' hh';
|
|
354
|
+
if (props.isEmpty) rules += ' ia';
|
|
355
|
+
else rules += ' ib';
|
|
356
|
+
rules += ' Ka';
|
|
355
357
|
return rules;
|
|
356
358
|
}({
|
|
357
359
|
isEmpty: isEmpty
|
|
@@ -380,7 +382,7 @@ function $1d63bfab43d9ffe1$var$TagGroupInner({ props: { label: label, descriptio
|
|
|
380
382
|
// @ts-ignore
|
|
381
383
|
inert: (0, $kY5I6$inertValue)(true),
|
|
382
384
|
ref: hiddenTagsRef,
|
|
383
|
-
className: "
|
|
385
|
+
className: " me _3a bh bdf beg bfa bgb bhd bje bic Kb Ha Ga _8a _oa _ha _La",
|
|
384
386
|
children: allItems.map((item)=>{
|
|
385
387
|
// pull off individual props as an allow list, don't want refs or other props getting through
|
|
386
388
|
return /*#__PURE__*/ (0, $kY5I6$jsx)("div", {
|
|
@@ -401,7 +403,7 @@ function $1d63bfab43d9ffe1$var$TagGroupInner({ props: { label: label, descriptio
|
|
|
401
403
|
ref: tagsRef,
|
|
402
404
|
items: items,
|
|
403
405
|
renderEmptyState: renderEmptyState,
|
|
404
|
-
className: "
|
|
406
|
+
className: " me ug bh bdf beg bfa bgb bhd bje bic aa aab Da Ea Ca gb gca da",
|
|
405
407
|
children: (item)=>/*#__PURE__*/ (0, $kY5I6$jsx)($1d63bfab43d9ffe1$export$3288d34c523a1192, {
|
|
406
408
|
...item.props,
|
|
407
409
|
id: item.key,
|
|
@@ -443,12 +445,12 @@ function $1d63bfab43d9ffe1$var$ActionGroup(props) {
|
|
|
443
445
|
id: actionsId,
|
|
444
446
|
"aria-label": ariaLabel ? `${ariaLabel} ${actionGroupLabel}` : actionGroupLabel,
|
|
445
447
|
"aria-labelledby": ariaLabelledBy ? ariaLabelledBy : undefined,
|
|
446
|
-
className: "
|
|
448
|
+
className: " me",
|
|
447
449
|
children: [
|
|
448
450
|
tagState.showCollapseButton && /*#__PURE__*/ (0, $kY5I6$jsx)((0, $da878a05ab4a403e$export$cfc7921d29ef7b80), {
|
|
449
451
|
isQuiet: true,
|
|
450
452
|
size: size,
|
|
451
|
-
styles: "
|
|
453
|
+
styles: " jb lb he ib",
|
|
452
454
|
UNSAFE_style: {
|
|
453
455
|
display: 'inline-flex'
|
|
454
456
|
},
|
|
@@ -460,7 +462,7 @@ function $1d63bfab43d9ffe1$var$ActionGroup(props) {
|
|
|
460
462
|
groupActionLabel && onGroupAction && /*#__PURE__*/ (0, $kY5I6$jsx)((0, $da878a05ab4a403e$export$cfc7921d29ef7b80), {
|
|
461
463
|
isQuiet: true,
|
|
462
464
|
size: size,
|
|
463
|
-
styles: "
|
|
465
|
+
styles: " jb lb he ib",
|
|
464
466
|
UNSAFE_style: {
|
|
465
467
|
display: 'inline-flex'
|
|
466
468
|
},
|
|
@@ -471,105 +473,107 @@ function $1d63bfab43d9ffe1$var$ActionGroup(props) {
|
|
|
471
473
|
});
|
|
472
474
|
}
|
|
473
475
|
const $1d63bfab43d9ffe1$var$tagStyles = function anonymous(props) {
|
|
474
|
-
let rules = "
|
|
475
|
-
if (props.isFocusVisible) rules += '
|
|
476
|
-
else rules += '
|
|
477
|
-
rules += '
|
|
478
|
-
rules += '
|
|
479
|
-
rules += '
|
|
480
|
-
rules += '
|
|
481
|
-
rules += '
|
|
482
|
-
rules += '
|
|
483
|
-
rules += '
|
|
484
|
-
rules += '
|
|
485
|
-
rules += '
|
|
486
|
-
rules += '
|
|
487
|
-
rules += '
|
|
488
|
-
rules += '
|
|
489
|
-
rules += '
|
|
490
|
-
rules += '
|
|
491
|
-
rules += '
|
|
492
|
-
rules += '
|
|
493
|
-
rules += '
|
|
494
|
-
rules += '
|
|
476
|
+
let rules = " ";
|
|
477
|
+
if (props.isFocusVisible) rules += ' tb';
|
|
478
|
+
else rules += ' ta';
|
|
479
|
+
rules += ' Bb';
|
|
480
|
+
rules += ' Bba';
|
|
481
|
+
rules += ' _ga';
|
|
482
|
+
rules += ' _ya';
|
|
483
|
+
rules += ' mf';
|
|
484
|
+
rules += ' _qa';
|
|
485
|
+
rules += ' _la';
|
|
486
|
+
rules += ' _Wb';
|
|
487
|
+
rules += ' Fa';
|
|
488
|
+
rules += ' _pa';
|
|
489
|
+
rules += ' bh';
|
|
490
|
+
rules += ' bdf';
|
|
491
|
+
rules += ' beg';
|
|
492
|
+
rules += ' bfa';
|
|
493
|
+
rules += ' bgb';
|
|
494
|
+
rules += ' bhd';
|
|
495
|
+
rules += ' bje';
|
|
496
|
+
rules += ' bic';
|
|
495
497
|
if (props.size === "XL") {
|
|
496
|
-
rules += '
|
|
497
|
-
rules += '
|
|
498
|
+
rules += ' ah';
|
|
499
|
+
rules += ' aac';
|
|
498
500
|
} else if (props.size === "L") {
|
|
499
|
-
rules += '
|
|
500
|
-
rules += '
|
|
501
|
+
rules += ' ae';
|
|
502
|
+
rules += ' aad';
|
|
501
503
|
} else if (props.size === "S") {
|
|
502
|
-
rules += '
|
|
503
|
-
rules += '
|
|
504
|
+
rules += ' af';
|
|
505
|
+
rules += ' aag';
|
|
504
506
|
} else if (props.size === "XS") {
|
|
505
|
-
rules += '
|
|
506
|
-
rules += '
|
|
507
|
+
rules += ' ai';
|
|
508
|
+
rules += ' aaj';
|
|
507
509
|
} else {
|
|
508
|
-
rules += '
|
|
509
|
-
rules += '
|
|
510
|
+
rules += ' aa';
|
|
511
|
+
rules += ' aab';
|
|
510
512
|
}
|
|
511
|
-
rules += '
|
|
512
|
-
rules += '
|
|
513
|
-
rules += '
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
if (props.isDisabled) rules += ' aj';
|
|
513
|
+
rules += ' Da';
|
|
514
|
+
rules += ' Ea';
|
|
515
|
+
rules += ' Ca';
|
|
516
|
+
rules += ' gb';
|
|
517
|
+
rules += ' gca';
|
|
518
|
+
if (props.isDisabled) rules += ' dc';
|
|
518
519
|
else if (props.isSelected) {
|
|
519
|
-
if (props.isEmphasized) rules += '
|
|
520
|
-
else rules += '
|
|
520
|
+
if (props.isEmphasized) rules += ' dd';
|
|
521
|
+
else rules += ' dl';
|
|
521
522
|
} else {
|
|
522
|
-
if (props.isPressed) rules += '
|
|
523
|
-
else if (props.isFocusVisible) rules += '
|
|
524
|
-
else if (props.isHovered) rules += '
|
|
525
|
-
else rules += '
|
|
523
|
+
if (props.isPressed) rules += ' db';
|
|
524
|
+
else if (props.isFocusVisible) rules += ' db';
|
|
525
|
+
else if (props.isHovered) rules += ' db';
|
|
526
|
+
else rules += ' da';
|
|
526
527
|
}
|
|
527
|
-
rules += '
|
|
528
|
-
rules += '
|
|
529
|
-
rules += '
|
|
530
|
-
rules += '
|
|
531
|
-
rules += '
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
528
|
+
if (props.isDisabled) rules += ' dbe';
|
|
529
|
+
else if (props.isSelected) rules += ' dbm';
|
|
530
|
+
else rules += ' dbf';
|
|
531
|
+
rules += ' emLFGYc';
|
|
532
|
+
rules += ' _ia';
|
|
533
|
+
rules += ' _ka';
|
|
534
|
+
rules += ' _ea';
|
|
535
|
+
rules += ' uf';
|
|
536
|
+
if (props.isDisabled) rules += ' ca';
|
|
535
537
|
else if (props.isSelected) {
|
|
536
538
|
if (props.isEmphasized) {
|
|
537
|
-
if (props.isPressed) rules += '
|
|
538
|
-
else if (props.isFocusVisible) rules += '
|
|
539
|
-
else if (props.isHovered) rules += '
|
|
540
|
-
else rules += '
|
|
539
|
+
if (props.isPressed) rules += ' cb';
|
|
540
|
+
else if (props.isFocusVisible) rules += ' cb';
|
|
541
|
+
else if (props.isHovered) rules += ' cb';
|
|
542
|
+
else rules += ' cl';
|
|
541
543
|
} else {
|
|
542
|
-
if (props.isPressed) rules += '
|
|
543
|
-
else if (props.isFocusVisible) rules += '
|
|
544
|
-
else if (props.isHovered) rules += '
|
|
545
|
-
else rules += '
|
|
544
|
+
if (props.isPressed) rules += ' cc';
|
|
545
|
+
else if (props.isFocusVisible) rules += ' cc';
|
|
546
|
+
else if (props.isHovered) rules += ' cc';
|
|
547
|
+
else rules += ' cm';
|
|
546
548
|
}
|
|
547
|
-
} else if (props.isFocusVisible) rules += '
|
|
548
|
-
else if (props.isHovered) rules += '
|
|
549
|
-
else rules += '
|
|
550
|
-
rules += '
|
|
551
|
-
rules += '
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
rules += '
|
|
555
|
-
rules += '
|
|
556
|
-
rules += '
|
|
557
|
-
rules += '
|
|
558
|
-
rules += '
|
|
559
|
-
rules += '
|
|
560
|
-
rules += '
|
|
561
|
-
rules += '
|
|
562
|
-
rules += '
|
|
563
|
-
rules += '
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
rules += '
|
|
567
|
-
rules += '
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
else if (props.size === "
|
|
572
|
-
else rules += ' -
|
|
549
|
+
} else if (props.isFocusVisible) rules += ' ce';
|
|
550
|
+
else if (props.isHovered) rules += ' ce';
|
|
551
|
+
else rules += ' ca';
|
|
552
|
+
if (props.isSelected) rules += ' cbg';
|
|
553
|
+
else rules += ' cbn';
|
|
554
|
+
rules += ' Rb';
|
|
555
|
+
rules += ' ob';
|
|
556
|
+
if (props.allowsRemoving) rules += ' na';
|
|
557
|
+
else rules += ' nb';
|
|
558
|
+
rules += ' ra';
|
|
559
|
+
rules += ' va';
|
|
560
|
+
rules += ' jb';
|
|
561
|
+
rules += ' lb';
|
|
562
|
+
rules += ' he';
|
|
563
|
+
rules += ' ib';
|
|
564
|
+
rules += ' ze';
|
|
565
|
+
rules += ' xd';
|
|
566
|
+
rules += ' wd';
|
|
567
|
+
rules += ' ye';
|
|
568
|
+
if (props.isLink) rules += ' Ab';
|
|
569
|
+
else rules += ' Aa';
|
|
570
|
+
rules += ' -Qg41Lb-jAxCW0c';
|
|
571
|
+
rules += ' -_8sjo0b-Oa';
|
|
572
|
+
if (props.size === "XL") rules += ' -e_-ee';
|
|
573
|
+
else if (props.size === "L") rules += ' -e_-ed';
|
|
574
|
+
else if (props.size === "S") rules += ' -e_-eb';
|
|
575
|
+
else if (props.size === "XS") rules += ' -e_-ea';
|
|
576
|
+
else rules += ' -e_-ec';
|
|
573
577
|
return rules;
|
|
574
578
|
};
|
|
575
579
|
const $1d63bfab43d9ffe1$var$avatarSize = {
|
|
@@ -611,13 +615,13 @@ function $1d63bfab43d9ffe1$var$TagWrapper({ children: children, isDisabled: isDi
|
|
|
611
615
|
return /*#__PURE__*/ (0, $kY5I6$jsxs)((0, $kY5I6$Fragment), {
|
|
612
616
|
children: [
|
|
613
617
|
isInRealDOM && /*#__PURE__*/ (0, $kY5I6$jsx)("div", {
|
|
614
|
-
className: "
|
|
618
|
+
className: " ma uf Fa pc pad kb kac _0a cd",
|
|
615
619
|
children: /*#__PURE__*/ (0, $kY5I6$jsx)((0, $kY5I6$Provider), {
|
|
616
620
|
values: [
|
|
617
621
|
[
|
|
618
622
|
(0, $8e847109a6ab556d$export$9afb8bc826b033ea),
|
|
619
623
|
{
|
|
620
|
-
styles: "
|
|
624
|
+
styles: " _Mb _oa _ha _Ta _za"
|
|
621
625
|
}
|
|
622
626
|
],
|
|
623
627
|
[
|
|
@@ -625,22 +629,22 @@ function $1d63bfab43d9ffe1$var$TagWrapper({ children: children, isDisabled: isDi
|
|
|
625
629
|
{
|
|
626
630
|
render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
|
|
627
631
|
slot: 'icon',
|
|
628
|
-
styles: "
|
|
632
|
+
styles: " _Ma"
|
|
629
633
|
}),
|
|
630
|
-
styles: "
|
|
634
|
+
styles: " fuUmpre euUmpre h67logd _ra"
|
|
631
635
|
}
|
|
632
636
|
],
|
|
633
637
|
[
|
|
634
638
|
(0, $3ffa2cd930156220$export$a20dad690e1279e2),
|
|
635
639
|
{
|
|
636
640
|
size: $1d63bfab43d9ffe1$var$avatarSize[size],
|
|
637
|
-
styles: "
|
|
641
|
+
styles: " _Ma"
|
|
638
642
|
}
|
|
639
643
|
],
|
|
640
644
|
[
|
|
641
645
|
(0, $dbd6f0b2503b938c$export$8151eb379fcf2442),
|
|
642
646
|
{
|
|
643
|
-
styles: "
|
|
647
|
+
styles: " fuUmpre euUmpre _ra _Ma _Oa _Rb zb xb wb yb"
|
|
644
648
|
}
|
|
645
649
|
]
|
|
646
650
|
],
|