@spectrum-web-components/action-group 1.7.0 → 1.8.0
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/package.json +5 -5
- package/sp-action-group.d.ts +11 -0
- package/sp-action-group.dev.js.map +1 -1
- package/sp-action-group.js.map +1 -1
- package/src/ActionGroup.d.ts +11 -0
- package/src/ActionGroup.dev.js.map +1 -1
- package/src/ActionGroup.js.map +1 -1
- package/src/action-group-overrides.css.dev.js.map +1 -1
- package/src/action-group-overrides.css.js.map +1 -1
- package/src/action-group.css.dev.js.map +1 -1
- package/src/action-group.css.js.map +1 -1
- package/src/index.d.ts +11 -0
- package/src/index.dev.js.map +1 -1
- package/src/index.js.map +1 -1
- package/src/spectrum-action-group.css.dev.js.map +1 -1
- package/src/spectrum-action-group.css.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/action-group",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
],
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@lit-labs/observers": "^2.0.2",
|
|
68
|
-
"@spectrum-web-components/action-button": "1.
|
|
69
|
-
"@spectrum-web-components/base": "1.
|
|
70
|
-
"@spectrum-web-components/icons-workflow": "1.
|
|
71
|
-
"@spectrum-web-components/reactive-controllers": "1.
|
|
68
|
+
"@spectrum-web-components/action-button": "1.8.0",
|
|
69
|
+
"@spectrum-web-components/base": "1.8.0",
|
|
70
|
+
"@spectrum-web-components/icons-workflow": "1.8.0",
|
|
71
|
+
"@spectrum-web-components/reactive-controllers": "1.8.0"
|
|
72
72
|
},
|
|
73
73
|
"types": "./src/index.d.ts",
|
|
74
74
|
"customElements": "custom-elements.json",
|
package/sp-action-group.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
1
12
|
import { ActionGroup } from './src/ActionGroup.js';
|
|
2
13
|
declare global {
|
|
3
14
|
interface HTMLElementTagNameMap {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-action-group.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 { ActionGroup } from './src/ActionGroup.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-action-group', ActionGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-action-group': ActionGroup;\n }\n}\n"],
|
|
5
5
|
"mappings": ";AAYA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,cAAc,mBAAmB,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/sp-action-group.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-action-group.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 { ActionGroup } from './src/ActionGroup.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-action-group', ActionGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-action-group': ActionGroup;\n }\n}\n"],
|
|
5
5
|
"mappings": "aAYA,OAAS,eAAAA,MAAmB,uBAC5B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,kBAAmBD,CAAW",
|
|
6
6
|
"names": ["ActionGroup", "defineElement"]
|
|
7
7
|
}
|
package/src/ActionGroup.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
1
12
|
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
13
|
import { ActionButton } from '@spectrum-web-components/action-button';
|
|
3
14
|
import { RovingTabindexController } from '@spectrum-web-components/reactive-controllers/src/RovingTabindex.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ActionGroup.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ActionButton } from '@spectrum-web-components/action-button';\nimport { RovingTabindexController } from '@spectrum-web-components/reactive-controllers/src/RovingTabindex.js';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\n\nimport styles from './action-group.css.js';\n\nconst EMPTY_SELECTION: string[] = [];\n\n/**\n * @element sp-action-group\n * @slot - the sp-action-button elements that make up the group\n *\n * @fires change - Announces that selection state has been changed by user\n */\nexport class ActionGroup extends SizedMixin(SpectrumElement, {\n validSizes: ['xs', 's', 'm', 'l', 'xl'],\n noDefaultSize: true,\n}) {\n static override shadowRootOptions = {\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n };\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n public set buttons(buttons: ActionButton[]) {\n /* c8 ignore next 1 */\n if (buttons === this.buttons) return;\n this._buttons = buttons;\n this.rovingTabindexController.clearElementCache();\n }\n\n public get buttons(): ActionButton[] {\n return this._buttons;\n }\n\n public _buttons: ActionButton[] = [];\n\n protected _buttonSelector = 'sp-action-button, sp-action-menu';\n\n constructor() {\n super();\n\n new MutationController(this, {\n config: {\n childList: true,\n subtree: true,\n },\n callback: () => {\n this.manageButtons();\n },\n skipInitial: true,\n });\n }\n\n rovingTabindexController = new RovingTabindexController<ActionButton>(\n this,\n {\n focusInIndex: (elements: ActionButton[]) => {\n let firstEnabledIndex = -1;\n const firstSelectedIndex = elements.findIndex((el, index) => {\n if (!elements[firstEnabledIndex] && !el.disabled) {\n firstEnabledIndex = index;\n }\n return el.selected && !el.disabled;\n });\n return elements[firstSelectedIndex]\n ? firstSelectedIndex\n : firstEnabledIndex;\n },\n elements: () => this.buttons,\n hostDelegatesFocus: true,\n isFocusableElement: (el: ActionButton) => !el.disabled,\n }\n );\n\n @property({ type: Boolean, reflect: true })\n public compact = false;\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n @property({ type: Boolean, reflect: true })\n public justified = false;\n\n @property({ type: String })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n @property({ type: String })\n public selects: undefined | 'single' | 'multiple';\n\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n private _selected: string[] = EMPTY_SELECTION;\n\n set selected(selected: string[]) {\n this.requestUpdate('selected', this._selected);\n this._selected = selected;\n this.updateComplete.then(() => {\n this.applySelects();\n this.manageChildren();\n });\n }\n\n @property({ type: Array })\n get selected(): string[] {\n return this._selected;\n }\n\n @query('slot')\n slotElement!: HTMLSlotElement;\n\n private dispatchChange(old: string[]): void {\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n if (!applyDefault) {\n this.setSelected(old);\n this.buttons.map((button) => {\n button.selected = this.selected.includes(button.value);\n });\n }\n }\n\n private setSelected(selected: string[], announce?: boolean): void {\n /* c8 ignore next 1 */\n if (selected === this.selected) return;\n\n const old = this.selected;\n this.requestUpdate('selected', old);\n this._selected = selected;\n if (!announce) return;\n this.dispatchChange(old);\n }\n\n public override focus(options?: FocusOptions): void {\n this.rovingTabindexController.focus(options);\n }\n\n private deselectSelectedButtons(): void {\n this.buttons.forEach((button) => {\n if (!button.selected) return;\n\n button.selected = false;\n button.tabIndex = -1;\n button.setAttribute(\n this.selects ? 'aria-checked' : /* c8 ignore */ 'aria-pressed',\n 'false'\n );\n });\n }\n\n private handleActionButtonChange(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n }\n\n private handleClick(event: Event): void {\n const target = event.target as ActionButton;\n if (typeof target.value === 'undefined') {\n return;\n }\n switch (this.selects) {\n case 'single': {\n this.deselectSelectedButtons();\n target.selected = true;\n target.tabIndex = 0;\n target.setAttribute('aria-checked', 'true');\n this.setSelected([target.value], true);\n break;\n }\n case 'multiple': {\n const selected = [...this.selected];\n target.selected = !target.selected;\n target.setAttribute(\n 'aria-checked',\n target.selected ? 'true' : 'false'\n );\n if (target.selected) {\n selected.push(target.value);\n } else {\n selected.splice(this.selected.indexOf(target.value), 1);\n }\n this.setSelected(selected, true);\n\n this.buttons.forEach((button) => {\n button.tabIndex = -1;\n });\n\n target.tabIndex = 0;\n\n break;\n }\n default:\n break;\n }\n }\n\n private async applySelects(): Promise<void> {\n await this.manageSelects(true);\n }\n\n private async manageSelects(applied?: boolean): Promise<void> {\n if (!this.buttons.length) {\n return;\n }\n\n const options = this.buttons;\n switch (this.selects) {\n case 'single': {\n // single behaves as a radio group\n this.setAttribute('role', 'radiogroup');\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'radio');\n option.setAttribute(\n 'aria-checked',\n option.selected ? 'true' : 'false'\n );\n if (option.selected) {\n selections.push(option);\n }\n });\n if (applied) break;\n await Promise.all(updates);\n\n const selected = selections.map((button) => {\n return button.value;\n });\n\n this.setSelected(selected || EMPTY_SELECTION);\n break;\n }\n case 'multiple': {\n // switching from single to multiple, remove role=\"radiogroup\"\n if (this.getAttribute('role') === 'radiogroup') {\n this.removeAttribute('role');\n }\n const selection: string[] = [];\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'checkbox');\n option.setAttribute(\n 'aria-checked',\n option.selected ? 'true' : 'false'\n );\n if (option.selected) {\n selection.push(option.value);\n selections.push(option);\n }\n });\n if (applied) break;\n await Promise.all(updates);\n const selected = !!selection.length\n ? selection\n : EMPTY_SELECTION;\n this.setSelected(selected);\n break;\n }\n default:\n // if user defines .selected\n if (this.selected.length) {\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'button');\n if (option.selected) {\n option.setAttribute('aria-pressed', 'true');\n selections.push(option);\n } else {\n option.removeAttribute('aria-pressed');\n }\n });\n if (applied) break;\n await Promise.all(updates);\n\n this.setSelected(\n selections.map((button) => {\n return button.value;\n })\n );\n } else {\n this.buttons.forEach((option) => {\n if (option instanceof ActionButton)\n option.setAttribute('role', 'button');\n });\n break;\n }\n }\n\n // When no other role is defined, use role=\"toolbar\", which is appropriate with roving tabindex.\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'toolbar');\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot role=\"presentation\" @slotchange=${this.manageButtons}></slot>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.addEventListener('click', this.handleClick);\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('selects')) {\n this.manageSelects();\n this.manageChildren();\n if (!!this.selects) {\n this.shadowRoot.addEventListener(\n 'change',\n this.handleActionButtonChange\n );\n } else {\n this.shadowRoot.removeEventListener(\n 'change',\n this.handleActionButtonChange\n );\n }\n }\n if (\n changes.has('quiet') ||\n changes.has('emphasized') ||\n changes.has('size') ||\n changes.has('staticColor')\n ) {\n this.manageChildren(changes);\n }\n // Update `aria-label` when `label` available or not first `updated`\n if (\n changes.has('label') &&\n (this.label || typeof changes.get('label') !== 'undefined')\n ) {\n if (this.label.length) {\n this.setAttribute('aria-label', this.label);\n } else {\n this.removeAttribute('aria-label');\n }\n }\n }\n\n private manageChildren(changes?: PropertyValues): void {\n this.buttons.forEach((button) => {\n if (this.quiet || changes?.get('quiet')) {\n button.quiet = this.quiet;\n }\n if (this.emphasized || changes?.get('emphasized')) {\n button.emphasized = this.emphasized;\n }\n if (this.staticColor || changes?.get('staticColor')) {\n button.staticColor = this.staticColor;\n }\n if (this.selects || !this.hasManaged) {\n button.selected = this.selected.includes(button.value);\n }\n if (\n this.size &&\n (this.size !== 'm' ||\n typeof changes?.get('size') !== 'undefined')\n ) {\n button.size = this.size;\n }\n });\n }\n\n private hasManaged = false;\n\n private manageButtons = (): void => {\n if (!this.slotElement) {\n return;\n }\n const assignedElements = this.slotElement.assignedElements({\n flatten: true,\n });\n const buttons = assignedElements.reduce((acc: unknown[], el) => {\n if (el.matches(this._buttonSelector)) {\n acc.push(el);\n } else {\n const buttonDescendents = Array.from(\n el.querySelectorAll(`:scope > ${this._buttonSelector}`)\n );\n acc.push(...buttonDescendents);\n }\n return acc;\n }, []);\n this.buttons = buttons as ActionButton[];\n if (this.selects || !this.hasManaged) {\n // <select> element merges selected so following paradigm here\n const currentlySelectedButtons: string[] = [];\n this.buttons.forEach((button: ActionButton) => {\n if (button.selected) {\n currentlySelectedButtons.push(button.value);\n }\n });\n this.setSelected(this.selected.concat(currentlySelectedButtons));\n }\n this.manageChildren();\n this.manageSelects();\n this.hasManaged = true;\n };\n}\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ActionButton } from '@spectrum-web-components/action-button';\nimport { RovingTabindexController } from '@spectrum-web-components/reactive-controllers/src/RovingTabindex.js';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\n\nimport styles from './action-group.css.js';\n\nconst EMPTY_SELECTION: string[] = [];\n\n/**\n * @element sp-action-group\n * @slot - the sp-action-button elements that make up the group\n *\n * @fires change - Announces that selection state has been changed by user\n */\nexport class ActionGroup extends SizedMixin(SpectrumElement, {\n validSizes: ['xs', 's', 'm', 'l', 'xl'],\n noDefaultSize: true,\n}) {\n static override shadowRootOptions = {\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n };\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n public set buttons(buttons: ActionButton[]) {\n /* c8 ignore next 1 */\n if (buttons === this.buttons) return;\n this._buttons = buttons;\n this.rovingTabindexController.clearElementCache();\n }\n\n public get buttons(): ActionButton[] {\n return this._buttons;\n }\n\n public _buttons: ActionButton[] = [];\n\n protected _buttonSelector = 'sp-action-button, sp-action-menu';\n\n constructor() {\n super();\n\n new MutationController(this, {\n config: {\n childList: true,\n subtree: true,\n },\n callback: () => {\n this.manageButtons();\n },\n skipInitial: true,\n });\n }\n\n rovingTabindexController = new RovingTabindexController<ActionButton>(\n this,\n {\n focusInIndex: (elements: ActionButton[]) => {\n let firstEnabledIndex = -1;\n const firstSelectedIndex = elements.findIndex((el, index) => {\n if (!elements[firstEnabledIndex] && !el.disabled) {\n firstEnabledIndex = index;\n }\n return el.selected && !el.disabled;\n });\n return elements[firstSelectedIndex]\n ? firstSelectedIndex\n : firstEnabledIndex;\n },\n elements: () => this.buttons,\n hostDelegatesFocus: true,\n isFocusableElement: (el: ActionButton) => !el.disabled,\n }\n );\n\n @property({ type: Boolean, reflect: true })\n public compact = false;\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n @property({ type: Boolean, reflect: true })\n public justified = false;\n\n @property({ type: String })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n @property({ type: String })\n public selects: undefined | 'single' | 'multiple';\n\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n private _selected: string[] = EMPTY_SELECTION;\n\n set selected(selected: string[]) {\n this.requestUpdate('selected', this._selected);\n this._selected = selected;\n this.updateComplete.then(() => {\n this.applySelects();\n this.manageChildren();\n });\n }\n\n @property({ type: Array })\n get selected(): string[] {\n return this._selected;\n }\n\n @query('slot')\n slotElement!: HTMLSlotElement;\n\n private dispatchChange(old: string[]): void {\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n if (!applyDefault) {\n this.setSelected(old);\n this.buttons.map((button) => {\n button.selected = this.selected.includes(button.value);\n });\n }\n }\n\n private setSelected(selected: string[], announce?: boolean): void {\n /* c8 ignore next 1 */\n if (selected === this.selected) return;\n\n const old = this.selected;\n this.requestUpdate('selected', old);\n this._selected = selected;\n if (!announce) return;\n this.dispatchChange(old);\n }\n\n public override focus(options?: FocusOptions): void {\n this.rovingTabindexController.focus(options);\n }\n\n private deselectSelectedButtons(): void {\n this.buttons.forEach((button) => {\n if (!button.selected) return;\n\n button.selected = false;\n button.tabIndex = -1;\n button.setAttribute(\n this.selects ? 'aria-checked' : /* c8 ignore */ 'aria-pressed',\n 'false'\n );\n });\n }\n\n private handleActionButtonChange(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n }\n\n private handleClick(event: Event): void {\n const target = event.target as ActionButton;\n if (typeof target.value === 'undefined') {\n return;\n }\n switch (this.selects) {\n case 'single': {\n this.deselectSelectedButtons();\n target.selected = true;\n target.tabIndex = 0;\n target.setAttribute('aria-checked', 'true');\n this.setSelected([target.value], true);\n break;\n }\n case 'multiple': {\n const selected = [...this.selected];\n target.selected = !target.selected;\n target.setAttribute(\n 'aria-checked',\n target.selected ? 'true' : 'false'\n );\n if (target.selected) {\n selected.push(target.value);\n } else {\n selected.splice(this.selected.indexOf(target.value), 1);\n }\n this.setSelected(selected, true);\n\n this.buttons.forEach((button) => {\n button.tabIndex = -1;\n });\n\n target.tabIndex = 0;\n\n break;\n }\n default:\n break;\n }\n }\n\n private async applySelects(): Promise<void> {\n await this.manageSelects(true);\n }\n\n private async manageSelects(applied?: boolean): Promise<void> {\n if (!this.buttons.length) {\n return;\n }\n\n const options = this.buttons;\n switch (this.selects) {\n case 'single': {\n // single behaves as a radio group\n this.setAttribute('role', 'radiogroup');\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'radio');\n option.setAttribute(\n 'aria-checked',\n option.selected ? 'true' : 'false'\n );\n if (option.selected) {\n selections.push(option);\n }\n });\n if (applied) break;\n await Promise.all(updates);\n\n const selected = selections.map((button) => {\n return button.value;\n });\n\n this.setSelected(selected || EMPTY_SELECTION);\n break;\n }\n case 'multiple': {\n // switching from single to multiple, remove role=\"radiogroup\"\n if (this.getAttribute('role') === 'radiogroup') {\n this.removeAttribute('role');\n }\n const selection: string[] = [];\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'checkbox');\n option.setAttribute(\n 'aria-checked',\n option.selected ? 'true' : 'false'\n );\n if (option.selected) {\n selection.push(option.value);\n selections.push(option);\n }\n });\n if (applied) break;\n await Promise.all(updates);\n const selected = !!selection.length\n ? selection\n : EMPTY_SELECTION;\n this.setSelected(selected);\n break;\n }\n default:\n // if user defines .selected\n if (this.selected.length) {\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'button');\n if (option.selected) {\n option.setAttribute('aria-pressed', 'true');\n selections.push(option);\n } else {\n option.removeAttribute('aria-pressed');\n }\n });\n if (applied) break;\n await Promise.all(updates);\n\n this.setSelected(\n selections.map((button) => {\n return button.value;\n })\n );\n } else {\n this.buttons.forEach((option) => {\n if (option instanceof ActionButton)\n option.setAttribute('role', 'button');\n });\n break;\n }\n }\n\n // When no other role is defined, use role=\"toolbar\", which is appropriate with roving tabindex.\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'toolbar');\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot role=\"presentation\" @slotchange=${this.manageButtons}></slot>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.addEventListener('click', this.handleClick);\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('selects')) {\n this.manageSelects();\n this.manageChildren();\n if (!!this.selects) {\n this.shadowRoot.addEventListener(\n 'change',\n this.handleActionButtonChange\n );\n } else {\n this.shadowRoot.removeEventListener(\n 'change',\n this.handleActionButtonChange\n );\n }\n }\n if (\n changes.has('quiet') ||\n changes.has('emphasized') ||\n changes.has('size') ||\n changes.has('staticColor')\n ) {\n this.manageChildren(changes);\n }\n // Update `aria-label` when `label` available or not first `updated`\n if (\n changes.has('label') &&\n (this.label || typeof changes.get('label') !== 'undefined')\n ) {\n if (this.label.length) {\n this.setAttribute('aria-label', this.label);\n } else {\n this.removeAttribute('aria-label');\n }\n }\n }\n\n private manageChildren(changes?: PropertyValues): void {\n this.buttons.forEach((button) => {\n if (this.quiet || changes?.get('quiet')) {\n button.quiet = this.quiet;\n }\n if (this.emphasized || changes?.get('emphasized')) {\n button.emphasized = this.emphasized;\n }\n if (this.staticColor || changes?.get('staticColor')) {\n button.staticColor = this.staticColor;\n }\n if (this.selects || !this.hasManaged) {\n button.selected = this.selected.includes(button.value);\n }\n if (\n this.size &&\n (this.size !== 'm' ||\n typeof changes?.get('size') !== 'undefined')\n ) {\n button.size = this.size;\n }\n });\n }\n\n private hasManaged = false;\n\n private manageButtons = (): void => {\n if (!this.slotElement) {\n return;\n }\n const assignedElements = this.slotElement.assignedElements({\n flatten: true,\n });\n const buttons = assignedElements.reduce((acc: unknown[], el) => {\n if (el.matches(this._buttonSelector)) {\n acc.push(el);\n } else {\n const buttonDescendents = Array.from(\n el.querySelectorAll(`:scope > ${this._buttonSelector}`)\n );\n acc.push(...buttonDescendents);\n }\n return acc;\n }, []);\n this.buttons = buttons as ActionButton[];\n if (this.selects || !this.hasManaged) {\n // <select> element merges selected so following paradigm here\n const currentlySelectedButtons: string[] = [];\n this.buttons.forEach((button: ActionButton) => {\n if (button.selected) {\n currentlySelectedButtons.push(button.value);\n }\n });\n this.setSelected(this.selected.concat(currentlySelectedButtons));\n }\n this.manageChildren();\n this.manageSelects();\n this.hasManaged = true;\n };\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,EACA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,oBAAoB;AAC7B,SAAS,gCAAgC;AACzC,SAAS,0BAA0B;AAEnC,OAAO,YAAY;AAEnB,MAAM,kBAA4B,CAAC;AAQ5B,aAAM,oBAAoB,WAAW,iBAAiB;AAAA,EACzD,YAAY,CAAC,MAAM,KAAK,KAAK,KAAK,IAAI;AAAA,EACtC,eAAe;AACnB,CAAC,EAAE;AAAA,EAwBC,cAAc;AACV,UAAM;AALV,SAAO,WAA2B,CAAC;AAEnC,SAAU,kBAAkB;AAiB5B,oCAA2B,IAAI;AAAA,MAC3B;AAAA,MACA;AAAA,QACI,cAAc,CAAC,aAA6B;AACxC,cAAI,oBAAoB;AACx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,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAlEjC,YAmEF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GArEjC,YAsEF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAxEjB,YAyEF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GA3EjC,YA4EF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA9EjB,YA+EF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,MAAM,WAAW,eAAe,CAAC;AAAA,GAjF7C,YAkFF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GApFjC,YAqFF;AAcH;AAAA,EADH,SAAS,EAAE,MAAM,MAAM,CAAC;AAAA,GAlGhB,YAmGL;AAKJ;AAAA,EADC,MAAM,MAAM;AAAA,GAvGJ,YAwGT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/ActionGroup.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ActionGroup.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ActionButton } from '@spectrum-web-components/action-button';\nimport { RovingTabindexController } from '@spectrum-web-components/reactive-controllers/src/RovingTabindex.js';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\n\nimport styles from './action-group.css.js';\n\nconst EMPTY_SELECTION: string[] = [];\n\n/**\n * @element sp-action-group\n * @slot - the sp-action-button elements that make up the group\n *\n * @fires change - Announces that selection state has been changed by user\n */\nexport class ActionGroup extends SizedMixin(SpectrumElement, {\n validSizes: ['xs', 's', 'm', 'l', 'xl'],\n noDefaultSize: true,\n}) {\n static override shadowRootOptions = {\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n };\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n public set buttons(buttons: ActionButton[]) {\n /* c8 ignore next 1 */\n if (buttons === this.buttons) return;\n this._buttons = buttons;\n this.rovingTabindexController.clearElementCache();\n }\n\n public get buttons(): ActionButton[] {\n return this._buttons;\n }\n\n public _buttons: ActionButton[] = [];\n\n protected _buttonSelector = 'sp-action-button, sp-action-menu';\n\n constructor() {\n super();\n\n new MutationController(this, {\n config: {\n childList: true,\n subtree: true,\n },\n callback: () => {\n this.manageButtons();\n },\n skipInitial: true,\n });\n }\n\n rovingTabindexController = new RovingTabindexController<ActionButton>(\n this,\n {\n focusInIndex: (elements: ActionButton[]) => {\n let firstEnabledIndex = -1;\n const firstSelectedIndex = elements.findIndex((el, index) => {\n if (!elements[firstEnabledIndex] && !el.disabled) {\n firstEnabledIndex = index;\n }\n return el.selected && !el.disabled;\n });\n return elements[firstSelectedIndex]\n ? firstSelectedIndex\n : firstEnabledIndex;\n },\n elements: () => this.buttons,\n hostDelegatesFocus: true,\n isFocusableElement: (el: ActionButton) => !el.disabled,\n }\n );\n\n @property({ type: Boolean, reflect: true })\n public compact = false;\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n @property({ type: Boolean, reflect: true })\n public justified = false;\n\n @property({ type: String })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n @property({ type: String })\n public selects: undefined | 'single' | 'multiple';\n\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n private _selected: string[] = EMPTY_SELECTION;\n\n set selected(selected: string[]) {\n this.requestUpdate('selected', this._selected);\n this._selected = selected;\n this.updateComplete.then(() => {\n this.applySelects();\n this.manageChildren();\n });\n }\n\n @property({ type: Array })\n get selected(): string[] {\n return this._selected;\n }\n\n @query('slot')\n slotElement!: HTMLSlotElement;\n\n private dispatchChange(old: string[]): void {\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n if (!applyDefault) {\n this.setSelected(old);\n this.buttons.map((button) => {\n button.selected = this.selected.includes(button.value);\n });\n }\n }\n\n private setSelected(selected: string[], announce?: boolean): void {\n /* c8 ignore next 1 */\n if (selected === this.selected) return;\n\n const old = this.selected;\n this.requestUpdate('selected', old);\n this._selected = selected;\n if (!announce) return;\n this.dispatchChange(old);\n }\n\n public override focus(options?: FocusOptions): void {\n this.rovingTabindexController.focus(options);\n }\n\n private deselectSelectedButtons(): void {\n this.buttons.forEach((button) => {\n if (!button.selected) return;\n\n button.selected = false;\n button.tabIndex = -1;\n button.setAttribute(\n this.selects ? 'aria-checked' : /* c8 ignore */ 'aria-pressed',\n 'false'\n );\n });\n }\n\n private handleActionButtonChange(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n }\n\n private handleClick(event: Event): void {\n const target = event.target as ActionButton;\n if (typeof target.value === 'undefined') {\n return;\n }\n switch (this.selects) {\n case 'single': {\n this.deselectSelectedButtons();\n target.selected = true;\n target.tabIndex = 0;\n target.setAttribute('aria-checked', 'true');\n this.setSelected([target.value], true);\n break;\n }\n case 'multiple': {\n const selected = [...this.selected];\n target.selected = !target.selected;\n target.setAttribute(\n 'aria-checked',\n target.selected ? 'true' : 'false'\n );\n if (target.selected) {\n selected.push(target.value);\n } else {\n selected.splice(this.selected.indexOf(target.value), 1);\n }\n this.setSelected(selected, true);\n\n this.buttons.forEach((button) => {\n button.tabIndex = -1;\n });\n\n target.tabIndex = 0;\n\n break;\n }\n default:\n break;\n }\n }\n\n private async applySelects(): Promise<void> {\n await this.manageSelects(true);\n }\n\n private async manageSelects(applied?: boolean): Promise<void> {\n if (!this.buttons.length) {\n return;\n }\n\n const options = this.buttons;\n switch (this.selects) {\n case 'single': {\n // single behaves as a radio group\n this.setAttribute('role', 'radiogroup');\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'radio');\n option.setAttribute(\n 'aria-checked',\n option.selected ? 'true' : 'false'\n );\n if (option.selected) {\n selections.push(option);\n }\n });\n if (applied) break;\n await Promise.all(updates);\n\n const selected = selections.map((button) => {\n return button.value;\n });\n\n this.setSelected(selected || EMPTY_SELECTION);\n break;\n }\n case 'multiple': {\n // switching from single to multiple, remove role=\"radiogroup\"\n if (this.getAttribute('role') === 'radiogroup') {\n this.removeAttribute('role');\n }\n const selection: string[] = [];\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'checkbox');\n option.setAttribute(\n 'aria-checked',\n option.selected ? 'true' : 'false'\n );\n if (option.selected) {\n selection.push(option.value);\n selections.push(option);\n }\n });\n if (applied) break;\n await Promise.all(updates);\n const selected = !!selection.length\n ? selection\n : EMPTY_SELECTION;\n this.setSelected(selected);\n break;\n }\n default:\n // if user defines .selected\n if (this.selected.length) {\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'button');\n if (option.selected) {\n option.setAttribute('aria-pressed', 'true');\n selections.push(option);\n } else {\n option.removeAttribute('aria-pressed');\n }\n });\n if (applied) break;\n await Promise.all(updates);\n\n this.setSelected(\n selections.map((button) => {\n return button.value;\n })\n );\n } else {\n this.buttons.forEach((option) => {\n if (option instanceof ActionButton)\n option.setAttribute('role', 'button');\n });\n break;\n }\n }\n\n // When no other role is defined, use role=\"toolbar\", which is appropriate with roving tabindex.\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'toolbar');\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot role=\"presentation\" @slotchange=${this.manageButtons}></slot>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.addEventListener('click', this.handleClick);\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('selects')) {\n this.manageSelects();\n this.manageChildren();\n if (!!this.selects) {\n this.shadowRoot.addEventListener(\n 'change',\n this.handleActionButtonChange\n );\n } else {\n this.shadowRoot.removeEventListener(\n 'change',\n this.handleActionButtonChange\n );\n }\n }\n if (\n changes.has('quiet') ||\n changes.has('emphasized') ||\n changes.has('size') ||\n changes.has('staticColor')\n ) {\n this.manageChildren(changes);\n }\n // Update `aria-label` when `label` available or not first `updated`\n if (\n changes.has('label') &&\n (this.label || typeof changes.get('label') !== 'undefined')\n ) {\n if (this.label.length) {\n this.setAttribute('aria-label', this.label);\n } else {\n this.removeAttribute('aria-label');\n }\n }\n }\n\n private manageChildren(changes?: PropertyValues): void {\n this.buttons.forEach((button) => {\n if (this.quiet || changes?.get('quiet')) {\n button.quiet = this.quiet;\n }\n if (this.emphasized || changes?.get('emphasized')) {\n button.emphasized = this.emphasized;\n }\n if (this.staticColor || changes?.get('staticColor')) {\n button.staticColor = this.staticColor;\n }\n if (this.selects || !this.hasManaged) {\n button.selected = this.selected.includes(button.value);\n }\n if (\n this.size &&\n (this.size !== 'm' ||\n typeof changes?.get('size') !== 'undefined')\n ) {\n button.size = this.size;\n }\n });\n }\n\n private hasManaged = false;\n\n private manageButtons = (): void => {\n if (!this.slotElement) {\n return;\n }\n const assignedElements = this.slotElement.assignedElements({\n flatten: true,\n });\n const buttons = assignedElements.reduce((acc: unknown[], el) => {\n if (el.matches(this._buttonSelector)) {\n acc.push(el);\n } else {\n const buttonDescendents = Array.from(\n el.querySelectorAll(`:scope > ${this._buttonSelector}`)\n );\n acc.push(...buttonDescendents);\n }\n return acc;\n }, []);\n this.buttons = buttons as ActionButton[];\n if (this.selects || !this.hasManaged) {\n // <select> element merges selected so following paradigm here\n const currentlySelectedButtons: string[] = [];\n this.buttons.forEach((button: ActionButton) => {\n if (button.selected) {\n currentlySelectedButtons.push(button.value);\n }\n });\n this.setSelected(this.selected.concat(currentlySelectedButtons));\n }\n this.manageChildren();\n this.manageSelects();\n this.hasManaged = true;\n };\n}\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ActionButton } from '@spectrum-web-components/action-button';\nimport { RovingTabindexController } from '@spectrum-web-components/reactive-controllers/src/RovingTabindex.js';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\n\nimport styles from './action-group.css.js';\n\nconst EMPTY_SELECTION: string[] = [];\n\n/**\n * @element sp-action-group\n * @slot - the sp-action-button elements that make up the group\n *\n * @fires change - Announces that selection state has been changed by user\n */\nexport class ActionGroup extends SizedMixin(SpectrumElement, {\n validSizes: ['xs', 's', 'm', 'l', 'xl'],\n noDefaultSize: true,\n}) {\n static override shadowRootOptions = {\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n };\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n public set buttons(buttons: ActionButton[]) {\n /* c8 ignore next 1 */\n if (buttons === this.buttons) return;\n this._buttons = buttons;\n this.rovingTabindexController.clearElementCache();\n }\n\n public get buttons(): ActionButton[] {\n return this._buttons;\n }\n\n public _buttons: ActionButton[] = [];\n\n protected _buttonSelector = 'sp-action-button, sp-action-menu';\n\n constructor() {\n super();\n\n new MutationController(this, {\n config: {\n childList: true,\n subtree: true,\n },\n callback: () => {\n this.manageButtons();\n },\n skipInitial: true,\n });\n }\n\n rovingTabindexController = new RovingTabindexController<ActionButton>(\n this,\n {\n focusInIndex: (elements: ActionButton[]) => {\n let firstEnabledIndex = -1;\n const firstSelectedIndex = elements.findIndex((el, index) => {\n if (!elements[firstEnabledIndex] && !el.disabled) {\n firstEnabledIndex = index;\n }\n return el.selected && !el.disabled;\n });\n return elements[firstSelectedIndex]\n ? firstSelectedIndex\n : firstEnabledIndex;\n },\n elements: () => this.buttons,\n hostDelegatesFocus: true,\n isFocusableElement: (el: ActionButton) => !el.disabled,\n }\n );\n\n @property({ type: Boolean, reflect: true })\n public compact = false;\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n @property({ type: Boolean, reflect: true })\n public justified = false;\n\n @property({ type: String })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n @property({ type: String })\n public selects: undefined | 'single' | 'multiple';\n\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n private _selected: string[] = EMPTY_SELECTION;\n\n set selected(selected: string[]) {\n this.requestUpdate('selected', this._selected);\n this._selected = selected;\n this.updateComplete.then(() => {\n this.applySelects();\n this.manageChildren();\n });\n }\n\n @property({ type: Array })\n get selected(): string[] {\n return this._selected;\n }\n\n @query('slot')\n slotElement!: HTMLSlotElement;\n\n private dispatchChange(old: string[]): void {\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n if (!applyDefault) {\n this.setSelected(old);\n this.buttons.map((button) => {\n button.selected = this.selected.includes(button.value);\n });\n }\n }\n\n private setSelected(selected: string[], announce?: boolean): void {\n /* c8 ignore next 1 */\n if (selected === this.selected) return;\n\n const old = this.selected;\n this.requestUpdate('selected', old);\n this._selected = selected;\n if (!announce) return;\n this.dispatchChange(old);\n }\n\n public override focus(options?: FocusOptions): void {\n this.rovingTabindexController.focus(options);\n }\n\n private deselectSelectedButtons(): void {\n this.buttons.forEach((button) => {\n if (!button.selected) return;\n\n button.selected = false;\n button.tabIndex = -1;\n button.setAttribute(\n this.selects ? 'aria-checked' : /* c8 ignore */ 'aria-pressed',\n 'false'\n );\n });\n }\n\n private handleActionButtonChange(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n }\n\n private handleClick(event: Event): void {\n const target = event.target as ActionButton;\n if (typeof target.value === 'undefined') {\n return;\n }\n switch (this.selects) {\n case 'single': {\n this.deselectSelectedButtons();\n target.selected = true;\n target.tabIndex = 0;\n target.setAttribute('aria-checked', 'true');\n this.setSelected([target.value], true);\n break;\n }\n case 'multiple': {\n const selected = [...this.selected];\n target.selected = !target.selected;\n target.setAttribute(\n 'aria-checked',\n target.selected ? 'true' : 'false'\n );\n if (target.selected) {\n selected.push(target.value);\n } else {\n selected.splice(this.selected.indexOf(target.value), 1);\n }\n this.setSelected(selected, true);\n\n this.buttons.forEach((button) => {\n button.tabIndex = -1;\n });\n\n target.tabIndex = 0;\n\n break;\n }\n default:\n break;\n }\n }\n\n private async applySelects(): Promise<void> {\n await this.manageSelects(true);\n }\n\n private async manageSelects(applied?: boolean): Promise<void> {\n if (!this.buttons.length) {\n return;\n }\n\n const options = this.buttons;\n switch (this.selects) {\n case 'single': {\n // single behaves as a radio group\n this.setAttribute('role', 'radiogroup');\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'radio');\n option.setAttribute(\n 'aria-checked',\n option.selected ? 'true' : 'false'\n );\n if (option.selected) {\n selections.push(option);\n }\n });\n if (applied) break;\n await Promise.all(updates);\n\n const selected = selections.map((button) => {\n return button.value;\n });\n\n this.setSelected(selected || EMPTY_SELECTION);\n break;\n }\n case 'multiple': {\n // switching from single to multiple, remove role=\"radiogroup\"\n if (this.getAttribute('role') === 'radiogroup') {\n this.removeAttribute('role');\n }\n const selection: string[] = [];\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'checkbox');\n option.setAttribute(\n 'aria-checked',\n option.selected ? 'true' : 'false'\n );\n if (option.selected) {\n selection.push(option.value);\n selections.push(option);\n }\n });\n if (applied) break;\n await Promise.all(updates);\n const selected = !!selection.length\n ? selection\n : EMPTY_SELECTION;\n this.setSelected(selected);\n break;\n }\n default:\n // if user defines .selected\n if (this.selected.length) {\n const selections: ActionButton[] = [];\n const updates = options.map(async (option) => {\n await option.updateComplete;\n if (option instanceof ActionButton)\n option.setAttribute('role', 'button');\n if (option.selected) {\n option.setAttribute('aria-pressed', 'true');\n selections.push(option);\n } else {\n option.removeAttribute('aria-pressed');\n }\n });\n if (applied) break;\n await Promise.all(updates);\n\n this.setSelected(\n selections.map((button) => {\n return button.value;\n })\n );\n } else {\n this.buttons.forEach((option) => {\n if (option instanceof ActionButton)\n option.setAttribute('role', 'button');\n });\n break;\n }\n }\n\n // When no other role is defined, use role=\"toolbar\", which is appropriate with roving tabindex.\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'toolbar');\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot role=\"presentation\" @slotchange=${this.manageButtons}></slot>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.addEventListener('click', this.handleClick);\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('selects')) {\n this.manageSelects();\n this.manageChildren();\n if (!!this.selects) {\n this.shadowRoot.addEventListener(\n 'change',\n this.handleActionButtonChange\n );\n } else {\n this.shadowRoot.removeEventListener(\n 'change',\n this.handleActionButtonChange\n );\n }\n }\n if (\n changes.has('quiet') ||\n changes.has('emphasized') ||\n changes.has('size') ||\n changes.has('staticColor')\n ) {\n this.manageChildren(changes);\n }\n // Update `aria-label` when `label` available or not first `updated`\n if (\n changes.has('label') &&\n (this.label || typeof changes.get('label') !== 'undefined')\n ) {\n if (this.label.length) {\n this.setAttribute('aria-label', this.label);\n } else {\n this.removeAttribute('aria-label');\n }\n }\n }\n\n private manageChildren(changes?: PropertyValues): void {\n this.buttons.forEach((button) => {\n if (this.quiet || changes?.get('quiet')) {\n button.quiet = this.quiet;\n }\n if (this.emphasized || changes?.get('emphasized')) {\n button.emphasized = this.emphasized;\n }\n if (this.staticColor || changes?.get('staticColor')) {\n button.staticColor = this.staticColor;\n }\n if (this.selects || !this.hasManaged) {\n button.selected = this.selected.includes(button.value);\n }\n if (\n this.size &&\n (this.size !== 'm' ||\n typeof changes?.get('size') !== 'undefined')\n ) {\n button.size = this.size;\n }\n });\n }\n\n private hasManaged = false;\n\n private manageButtons = (): void => {\n if (!this.slotElement) {\n return;\n }\n const assignedElements = this.slotElement.assignedElements({\n flatten: true,\n });\n const buttons = assignedElements.reduce((acc: unknown[], el) => {\n if (el.matches(this._buttonSelector)) {\n acc.push(el);\n } else {\n const buttonDescendents = Array.from(\n el.querySelectorAll(`:scope > ${this._buttonSelector}`)\n );\n acc.push(...buttonDescendents);\n }\n return acc;\n }, []);\n this.buttons = buttons as ActionButton[];\n if (this.selects || !this.hasManaged) {\n // <select> element merges selected so following paradigm here\n const currentlySelectedButtons: string[] = [];\n this.buttons.forEach((button: ActionButton) => {\n if (button.selected) {\n currentlySelectedButtons.push(button.value);\n }\n });\n this.setSelected(this.selected.concat(currentlySelectedButtons));\n }\n this.manageChildren();\n this.manageSelects();\n this.hasManaged = true;\n };\n}\n"],
|
|
5
5
|
"mappings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AC,KAAK,cACtBA,EAAO,SAAW,KAAK,SAAS,SAASA,EAAO,KAAK,GAGrD,KAAK,OACJ,KAAK,OAAS,KACX,OAAOY,GAAA,YAAAA,EAAS,IAAI,UAAY,eAEpCZ,EAAO,KAAO,KAAK,KAE3B,CAAC,CACL,CAqCJ,CAxZa,YAIO,kBAAoB,CAChC,GAAGjB,EAAgB,kBACnB,eAAgB,EACpB,EAyDO8B,EAAA,CADN7B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GA/DjC,YAgEF,uBAGA6B,EAAA,CADN7B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAlEjC,YAmEF,0BAGA6B,EAAA,CADN7B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GArEjC,YAsEF,yBAGA6B,EAAA,CADN7B,EAAS,CAAE,KAAM,MAAO,CAAC,GAxEjB,YAyEF,qBAGA6B,EAAA,CADN7B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GA3EjC,YA4EF,qBAGA6B,EAAA,CADN7B,EAAS,CAAE,KAAM,MAAO,CAAC,GA9EjB,YA+EF,uBAGA6B,EAAA,CADN7B,EAAS,CAAE,QAAS,GAAM,UAAW,cAAe,CAAC,GAjF7C,YAkFF,2BAGA6B,EAAA,CADN7B,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GApFjC,YAqFF,wBAcH6B,EAAA,CADH7B,EAAS,CAAE,KAAM,KAAM,CAAC,GAlGhB,YAmGL,wBAKJ6B,EAAA,CADC5B,EAAM,MAAM,GAvGJ,YAwGT",
|
|
6
6
|
"names": ["html", "SizedMixin", "SpectrumElement", "property", "query", "ActionButton", "RovingTabindexController", "MutationController", "styles", "EMPTY_SELECTION", "elements", "firstEnabledIndex", "firstSelectedIndex", "el", "index", "buttons", "acc", "buttonDescendents", "currentlySelectedButtons", "button", "selected", "old", "announce", "options", "event", "target", "applied", "selections", "updates", "option", "selection", "changes", "__decorateClass"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["action-group-overrides.css.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 */\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-actiongroup-gap-size-compact:var(--system-action-group-gap-size-compact);--spectrum-actiongroup-horizontal-spacing-compact:var(--system-action-group-horizontal-spacing-compact);--spectrum-actiongroup-vertical-spacing-compact:var(--system-action-group-vertical-spacing-compact)}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["action-group-overrides.css.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 */\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-actiongroup-gap-size-compact:var(--system-action-group-gap-size-compact);--spectrum-actiongroup-horizontal-spacing-compact:var(--system-action-group-horizontal-spacing-compact);--spectrum-actiongroup-vertical-spacing-compact:var(--system-action-group-vertical-spacing-compact)}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["action-group.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-actiongroup-button-spacing-reset:0;--spectrum-actiongroup-border-radius-reset:0;--spectrum-actiongroup-border-radius:var(--spectrum-corner-radius-100)}:host([size=s]),:host([size=xs]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-75);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-75)}:host([size=l]),:host,:host([size=xl]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-100);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-100)}:host{gap:var(--mod-actiongroup-horizontal-spacing-regular,var(--spectrum-actiongroup-horizontal-spacing-regular));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:3}:host(:not([vertical=true][compact=true])) ::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-actiongroup-vertical-spacing-regular,var(--spectrum-actiongroup-vertical-spacing-regular));flex-direction:column;display:inline-flex}:host([compact]){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact]:not([quiet])){flex-wrap:nowrap}:host([compact]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset));z-index:0;position:relative}:host([compact]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact]:not([quiet])) ::slotted(:not(:first-child)){--mod-actionbutton-focus-indicator-border-radius:0px;margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact))}:host([compact]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px;border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact]:not([quiet])) ::slotted([selected]){z-index:1}@media (hover:hover){:host([compact]:not([quiet])) ::slotted(:hover){z-index:2}}:host([compact]:not([quiet])) ::slotted(:focus-visible){z-index:3}:host([compact][vertical]:not([quiet])){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact][vertical]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px;border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:not(:first-child)){margin-block-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([justified]) ::slotted(*){flex-grow:1}:host{--spectrum-actiongroup-gap-size-compact:var(--system-action-group-gap-size-compact);--spectrum-actiongroup-horizontal-spacing-compact:var(--system-action-group-horizontal-spacing-compact);--spectrum-actiongroup-vertical-spacing-compact:var(--system-action-group-vertical-spacing-compact)}:host([size=xs]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-75);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-75)}:host([dir][compact][vertical]) ::slotted(:nth-child(n)){margin-left:0;margin-right:0}:host([justified]) ::slotted(:not([role])),:host([vertical]) ::slotted(:not([role])){flex-direction:column;align-items:stretch;display:flex}:host([compact]:not([quiet])) ::slotted(:not([role])){--overriden-border-radius:0;--mod-actionbutton-border-radius:var(--overriden-border-radius)}:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):first-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0}:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):last-child){--overriden-border-radius:0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:not([role]):first-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:not([role]):first-child){--overriden-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:not([role]):last-child){--overriden-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:not([role]):last-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([compact]:not([quiet])) ::slotted(*){--mod-actionbutton-focus-ring-border-radius:0}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([justified]) ::slotted(*){flex:1}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 */\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-actiongroup-button-spacing-reset:0;--spectrum-actiongroup-border-radius-reset:0;--spectrum-actiongroup-border-radius:var(--spectrum-corner-radius-100)}:host([size=s]),:host([size=xs]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-75);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-75)}:host([size=l]),:host,:host([size=xl]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-100);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-100)}:host{gap:var(--mod-actiongroup-horizontal-spacing-regular,var(--spectrum-actiongroup-horizontal-spacing-regular));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:3}:host(:not([vertical=true][compact=true])) ::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-actiongroup-vertical-spacing-regular,var(--spectrum-actiongroup-vertical-spacing-regular));flex-direction:column;display:inline-flex}:host([compact]){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact]:not([quiet])){flex-wrap:nowrap}:host([compact]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset));z-index:0;position:relative}:host([compact]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact]:not([quiet])) ::slotted(:not(:first-child)){--mod-actionbutton-focus-indicator-border-radius:0px;margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact))}:host([compact]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px;border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact]:not([quiet])) ::slotted([selected]){z-index:1}@media (hover:hover){:host([compact]:not([quiet])) ::slotted(:hover){z-index:2}}:host([compact]:not([quiet])) ::slotted(:focus-visible){z-index:3}:host([compact][vertical]:not([quiet])){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact][vertical]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px;border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:not(:first-child)){margin-block-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([justified]) ::slotted(*){flex-grow:1}:host{--spectrum-actiongroup-gap-size-compact:var(--system-action-group-gap-size-compact);--spectrum-actiongroup-horizontal-spacing-compact:var(--system-action-group-horizontal-spacing-compact);--spectrum-actiongroup-vertical-spacing-compact:var(--system-action-group-vertical-spacing-compact)}:host([size=xs]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-75);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-75)}:host([dir][compact][vertical]) ::slotted(:nth-child(n)){margin-left:0;margin-right:0}:host([justified]) ::slotted(:not([role])),:host([vertical]) ::slotted(:not([role])){flex-direction:column;align-items:stretch;display:flex}:host([compact]:not([quiet])) ::slotted(:not([role])){--overriden-border-radius:0;--mod-actionbutton-border-radius:var(--overriden-border-radius)}:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):first-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0}:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):last-child){--overriden-border-radius:0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:not([role]):first-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:not([role]):first-child){--overriden-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:not([role]):last-child){--overriden-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:not([role]):last-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([compact]:not([quiet])) ::slotted(*){--mod-actionbutton-focus-ring-border-radius:0}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([justified]) ::slotted(*){flex:1}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["action-group.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-actiongroup-button-spacing-reset:0;--spectrum-actiongroup-border-radius-reset:0;--spectrum-actiongroup-border-radius:var(--spectrum-corner-radius-100)}:host([size=s]),:host([size=xs]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-75);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-75)}:host([size=l]),:host,:host([size=xl]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-100);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-100)}:host{gap:var(--mod-actiongroup-horizontal-spacing-regular,var(--spectrum-actiongroup-horizontal-spacing-regular));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:3}:host(:not([vertical=true][compact=true])) ::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-actiongroup-vertical-spacing-regular,var(--spectrum-actiongroup-vertical-spacing-regular));flex-direction:column;display:inline-flex}:host([compact]){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact]:not([quiet])){flex-wrap:nowrap}:host([compact]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset));z-index:0;position:relative}:host([compact]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact]:not([quiet])) ::slotted(:not(:first-child)){--mod-actionbutton-focus-indicator-border-radius:0px;margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact))}:host([compact]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px;border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact]:not([quiet])) ::slotted([selected]){z-index:1}@media (hover:hover){:host([compact]:not([quiet])) ::slotted(:hover){z-index:2}}:host([compact]:not([quiet])) ::slotted(:focus-visible){z-index:3}:host([compact][vertical]:not([quiet])){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact][vertical]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px;border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:not(:first-child)){margin-block-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([justified]) ::slotted(*){flex-grow:1}:host{--spectrum-actiongroup-gap-size-compact:var(--system-action-group-gap-size-compact);--spectrum-actiongroup-horizontal-spacing-compact:var(--system-action-group-horizontal-spacing-compact);--spectrum-actiongroup-vertical-spacing-compact:var(--system-action-group-vertical-spacing-compact)}:host([size=xs]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-75);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-75)}:host([dir][compact][vertical]) ::slotted(:nth-child(n)){margin-left:0;margin-right:0}:host([justified]) ::slotted(:not([role])),:host([vertical]) ::slotted(:not([role])){flex-direction:column;align-items:stretch;display:flex}:host([compact]:not([quiet])) ::slotted(:not([role])){--overriden-border-radius:0;--mod-actionbutton-border-radius:var(--overriden-border-radius)}:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):first-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0}:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):last-child){--overriden-border-radius:0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:not([role]):first-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:not([role]):first-child){--overriden-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:not([role]):last-child){--overriden-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:not([role]):last-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([compact]:not([quiet])) ::slotted(*){--mod-actionbutton-focus-ring-border-radius:0}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([justified]) ::slotted(*){flex:1}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 */\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-actiongroup-button-spacing-reset:0;--spectrum-actiongroup-border-radius-reset:0;--spectrum-actiongroup-border-radius:var(--spectrum-corner-radius-100)}:host([size=s]),:host([size=xs]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-75);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-75)}:host([size=l]),:host,:host([size=xl]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-100);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-100)}:host{gap:var(--mod-actiongroup-horizontal-spacing-regular,var(--spectrum-actiongroup-horizontal-spacing-regular));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:3}:host(:not([vertical=true][compact=true])) ::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-actiongroup-vertical-spacing-regular,var(--spectrum-actiongroup-vertical-spacing-regular));flex-direction:column;display:inline-flex}:host([compact]){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact]:not([quiet])){flex-wrap:nowrap}:host([compact]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset));z-index:0;position:relative}:host([compact]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact]:not([quiet])) ::slotted(:not(:first-child)){--mod-actionbutton-focus-indicator-border-radius:0px;margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact))}:host([compact]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px;border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact]:not([quiet])) ::slotted([selected]){z-index:1}@media (hover:hover){:host([compact]:not([quiet])) ::slotted(:hover){z-index:2}}:host([compact]:not([quiet])) ::slotted(:focus-visible){z-index:3}:host([compact][vertical]:not([quiet])){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact][vertical]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px;border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:not(:first-child)){margin-block-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([justified]) ::slotted(*){flex-grow:1}:host{--spectrum-actiongroup-gap-size-compact:var(--system-action-group-gap-size-compact);--spectrum-actiongroup-horizontal-spacing-compact:var(--system-action-group-horizontal-spacing-compact);--spectrum-actiongroup-vertical-spacing-compact:var(--system-action-group-vertical-spacing-compact)}:host([size=xs]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-75);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-75)}:host([dir][compact][vertical]) ::slotted(:nth-child(n)){margin-left:0;margin-right:0}:host([justified]) ::slotted(:not([role])),:host([vertical]) ::slotted(:not([role])){flex-direction:column;align-items:stretch;display:flex}:host([compact]:not([quiet])) ::slotted(:not([role])){--overriden-border-radius:0;--mod-actionbutton-border-radius:var(--overriden-border-radius)}:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):first-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0}:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):last-child){--overriden-border-radius:0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:not([role]):first-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:not([role]):first-child){--overriden-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:not([role]):last-child){--overriden-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:not([role]):last-child){--overriden-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([compact]:not([quiet])) ::slotted(*){--mod-actionbutton-focus-ring-border-radius:0}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0 0}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:first-child){--mod-actionbutton-focus-ring-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:last-child){--mod-actionbutton-focus-ring-border-radius:var(--spectrum-alias-component-border-radius)0 0 var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))}:host([justified]) ::slotted(*){flex:1}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
1
12
|
export * from './ActionGroup.js';
|
package/src/index.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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\nexport * from './ActionGroup.dev.js'\n"],
|
|
5
5
|
"mappings": ";AAYA,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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\nexport * from './ActionGroup.js';\n"],
|
|
5
5
|
"mappings": "aAYA,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-action-group.css.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 */\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-actiongroup-button-spacing-reset:0;--spectrum-actiongroup-border-radius-reset:0;--spectrum-actiongroup-border-radius:var(--spectrum-corner-radius-100)}:host([size=s]),:host([size=xs]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-75);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-75)}:host([size=l]),:host,:host([size=xl]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-100);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-100)}:host{gap:var(--mod-actiongroup-horizontal-spacing-regular,var(--spectrum-actiongroup-horizontal-spacing-regular));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:3}:host(:not([vertical=true][compact=true])) ::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-actiongroup-vertical-spacing-regular,var(--spectrum-actiongroup-vertical-spacing-regular));flex-direction:column;display:inline-flex}:host([compact]){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact]:not([quiet])){flex-wrap:nowrap}:host([compact]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset));z-index:0;position:relative}:host([compact]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact]:not([quiet])) ::slotted(:not(:first-child)){--mod-actionbutton-focus-indicator-border-radius:0px;margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact))}:host([compact]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px;border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact]:not([quiet])) ::slotted([selected]){z-index:1}@media (hover:hover){:host([compact]:not([quiet])) ::slotted(:hover){z-index:2}}:host([compact]:not([quiet])) ::slotted(:focus-visible){z-index:3}:host([compact][vertical]:not([quiet])){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact][vertical]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px;border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:not(:first-child)){margin-block-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([justified]) ::slotted(*){flex-grow:1}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-action-group.css.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2025 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 */\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-actiongroup-button-spacing-reset:0;--spectrum-actiongroup-border-radius-reset:0;--spectrum-actiongroup-border-radius:var(--spectrum-corner-radius-100)}:host([size=s]),:host([size=xs]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-75);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-75)}:host([size=l]),:host,:host([size=xl]){--spectrum-actiongroup-horizontal-spacing-regular:var(--spectrum-spacing-100);--spectrum-actiongroup-vertical-spacing-regular:var(--spectrum-spacing-100)}:host{gap:var(--mod-actiongroup-horizontal-spacing-regular,var(--spectrum-actiongroup-horizontal-spacing-regular));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:3}:host(:not([vertical=true][compact=true])) ::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-actiongroup-vertical-spacing-regular,var(--spectrum-actiongroup-vertical-spacing-regular));flex-direction:column;display:inline-flex}:host([compact]){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact]:not([quiet])){flex-wrap:nowrap}:host([compact]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset));z-index:0;position:relative}:host([compact]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact]:not([quiet])) ::slotted(:not(:first-child)){--mod-actionbutton-focus-indicator-border-radius:0px;margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact))}:host([compact]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px;border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-inline-start:var(--mod-actiongroup-horizontal-spacing-compact,var(--spectrum-actiongroup-horizontal-spacing-compact));margin-inline-end:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact]:not([quiet])) ::slotted([selected]){z-index:1}@media (hover:hover){:host([compact]:not([quiet])) ::slotted(:hover){z-index:2}}:host([compact]:not([quiet])) ::slotted(:focus-visible){z-index:3}:host([compact][vertical]:not([quiet])){gap:var(--mod-actiongroup-gap-size-compact,var(--spectrum-actiongroup-gap-size-compact))}:host([compact][vertical]:not([quiet])) ::slotted(*){border-radius:var(--mod-actiongroup-border-radius-reset,var(--spectrum-actiongroup-border-radius-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--mod-actionbutton-focus-indicator-border-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))0px 0px;border-start-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-start-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:not(:first-child)){margin-block-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-block-end:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-inline-start:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset));margin-inline-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--mod-actionbutton-focus-indicator-border-radius:0px 0px var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius))var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-end-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));border-end-start-radius:var(--mod-actiongroup-border-radius,var(--spectrum-actiongroup-border-radius));margin-block-start:var(--mod-actiongroup-vertical-spacing-compact,var(--spectrum-actiongroup-vertical-spacing-compact));margin-block-end:var(--mod-actiongroup-button-spacing-reset,var(--spectrum-actiongroup-button-spacing-reset))}:host([justified]) ::slotted(*){flex-grow:1}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|