@adobe/spectrum-wc-core 0.0.0-snapshot.20260922095923
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/README.md +39 -0
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js +9 -0
- package/dist/components/accordion/Accordion.base.d.ts +59 -0
- package/dist/components/accordion/Accordion.base.js +69 -0
- package/dist/components/accordion/Accordion.base.js.map +1 -0
- package/dist/components/accordion/Accordion.types.d.ts +22 -0
- package/dist/components/accordion/Accordion.types.js +21 -0
- package/dist/components/accordion/Accordion.types.js.map +1 -0
- package/dist/components/accordion/AccordionItem.base.d.ts +96 -0
- package/dist/components/accordion/AccordionItem.base.js +93 -0
- package/dist/components/accordion/AccordionItem.base.js.map +1 -0
- package/dist/components/accordion/index.d.ts +14 -0
- package/dist/components/accordion/index.js +4 -0
- package/dist/components/action-button/ActionButton.types.d.ts +15 -0
- package/dist/components/action-button/ActionButton.types.js +12 -0
- package/dist/components/action-button/ActionButton.types.js.map +1 -0
- package/dist/components/action-button/index.d.ts +12 -0
- package/dist/components/action-button/index.js +2 -0
- package/dist/components/action-group/ActionGroup.base.d.ts +108 -0
- package/dist/components/action-group/ActionGroup.base.js +53 -0
- package/dist/components/action-group/ActionGroup.base.js.map +1 -0
- package/dist/components/action-group/ActionGroup.types.d.ts +17 -0
- package/dist/components/action-group/ActionGroup.types.js +12 -0
- package/dist/components/action-group/ActionGroup.types.js.map +1 -0
- package/dist/components/action-group/index.d.ts +13 -0
- package/dist/components/action-group/index.js +3 -0
- package/dist/components/alert-banner/AlertBanner.base.d.ts +36 -0
- package/dist/components/alert-banner/AlertBanner.base.js +57 -0
- package/dist/components/alert-banner/AlertBanner.base.js.map +1 -0
- package/dist/components/alert-banner/AlertBanner.types.d.ts +13 -0
- package/dist/components/alert-banner/AlertBanner.types.js +10 -0
- package/dist/components/alert-banner/AlertBanner.types.js.map +1 -0
- package/dist/components/alert-banner/index.d.ts +13 -0
- package/dist/components/alert-banner/index.js +3 -0
- package/dist/components/asset/Asset.base.d.ts +101 -0
- package/dist/components/asset/Asset.base.js +130 -0
- package/dist/components/asset/Asset.base.js.map +1 -0
- package/dist/components/asset/Asset.types.d.ts +31 -0
- package/dist/components/asset/Asset.types.js +14 -0
- package/dist/components/asset/Asset.types.js.map +1 -0
- package/dist/components/asset/index.d.ts +13 -0
- package/dist/components/asset/index.js +3 -0
- package/dist/components/avatar/Avatar.base.d.ts +53 -0
- package/dist/components/avatar/Avatar.base.js +52 -0
- package/dist/components/avatar/Avatar.base.js.map +1 -0
- package/dist/components/avatar/Avatar.types.d.ts +19 -0
- package/dist/components/avatar/Avatar.types.js +24 -0
- package/dist/components/avatar/Avatar.types.js.map +1 -0
- package/dist/components/avatar/index.d.ts +13 -0
- package/dist/components/avatar/index.js +3 -0
- package/dist/components/badge/Badge.base.d.ts +114 -0
- package/dist/components/badge/Badge.base.js +49 -0
- package/dist/components/badge/Badge.base.js.map +1 -0
- package/dist/components/badge/Badge.types.d.ts +21 -0
- package/dist/components/badge/Badge.types.js +43 -0
- package/dist/components/badge/Badge.types.js.map +1 -0
- package/dist/components/badge/index.d.ts +13 -0
- package/dist/components/badge/index.js +3 -0
- package/dist/components/button/Button.base.d.ts +78 -0
- package/dist/components/button/Button.base.js +51 -0
- package/dist/components/button/Button.base.js.map +1 -0
- package/dist/components/button/Button.types.d.ts +19 -0
- package/dist/components/button/Button.types.js +16 -0
- package/dist/components/button/Button.types.js.map +1 -0
- package/dist/components/button/index.d.ts +13 -0
- package/dist/components/button/index.js +3 -0
- package/dist/components/button-group/ButtonGroup.base.d.ts +89 -0
- package/dist/components/button-group/ButtonGroup.base.js +60 -0
- package/dist/components/button-group/ButtonGroup.base.js.map +1 -0
- package/dist/components/button-group/ButtonGroup.types.d.ts +17 -0
- package/dist/components/button-group/ButtonGroup.types.js +15 -0
- package/dist/components/button-group/ButtonGroup.types.js.map +1 -0
- package/dist/components/button-group/index.d.ts +13 -0
- package/dist/components/button-group/index.js +3 -0
- package/dist/components/card/Card.base.d.ts +172 -0
- package/dist/components/card/Card.base.js +123 -0
- package/dist/components/card/Card.base.js.map +1 -0
- package/dist/components/card/Card.types.d.ts +18 -0
- package/dist/components/card/Card.types.js +21 -0
- package/dist/components/card/Card.types.js.map +1 -0
- package/dist/components/card/index.d.ts +13 -0
- package/dist/components/card/index.js +3 -0
- package/dist/components/color-handle/ColorHandle.base.d.ts +51 -0
- package/dist/components/color-handle/ColorHandle.base.js +39 -0
- package/dist/components/color-handle/ColorHandle.base.js.map +1 -0
- package/dist/components/color-handle/ColorHandle.types.d.ts +30 -0
- package/dist/components/color-handle/color-contrast.d.ts +55 -0
- package/dist/components/color-handle/color-contrast.js +49 -0
- package/dist/components/color-handle/color-contrast.js.map +1 -0
- package/dist/components/color-handle/index.d.ts +14 -0
- package/dist/components/color-handle/index.js +3 -0
- package/dist/components/color-loupe/ColorLoupe.base.d.ts +41 -0
- package/dist/components/color-loupe/ColorLoupe.base.js +21 -0
- package/dist/components/color-loupe/ColorLoupe.base.js.map +1 -0
- package/dist/components/color-loupe/index.d.ts +12 -0
- package/dist/components/color-loupe/index.js +2 -0
- package/dist/components/divider/Divider.base.d.ts +43 -0
- package/dist/components/divider/Divider.base.js +42 -0
- package/dist/components/divider/Divider.base.js.map +1 -0
- package/dist/components/divider/Divider.types.d.ts +15 -0
- package/dist/components/divider/Divider.types.js +10 -0
- package/dist/components/divider/Divider.types.js.map +1 -0
- package/dist/components/divider/index.d.ts +13 -0
- package/dist/components/divider/index.js +3 -0
- package/dist/components/dropzone/Dropzone.base.d.ts +74 -0
- package/dist/components/dropzone/Dropzone.base.js +82 -0
- package/dist/components/dropzone/Dropzone.base.js.map +1 -0
- package/dist/components/dropzone/Dropzone.types.d.ts +43 -0
- package/dist/components/dropzone/Dropzone.types.js +15 -0
- package/dist/components/dropzone/Dropzone.types.js.map +1 -0
- package/dist/components/dropzone/index.d.ts +13 -0
- package/dist/components/dropzone/index.js +3 -0
- package/dist/components/icon/Icon.base.d.ts +36 -0
- package/dist/components/icon/Icon.base.js +28 -0
- package/dist/components/icon/Icon.base.js.map +1 -0
- package/dist/components/icon/Icon.types.d.ts +13 -0
- package/dist/components/icon/Icon.types.js +12 -0
- package/dist/components/icon/Icon.types.js.map +1 -0
- package/dist/components/icon/index.d.ts +13 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/illustrated-message/IllustratedMessage.base.d.ts +60 -0
- package/dist/components/illustrated-message/IllustratedMessage.base.js +59 -0
- package/dist/components/illustrated-message/IllustratedMessage.base.js.map +1 -0
- package/dist/components/illustrated-message/IllustratedMessage.types.d.ts +15 -0
- package/dist/components/illustrated-message/IllustratedMessage.types.js +10 -0
- package/dist/components/illustrated-message/IllustratedMessage.types.js.map +1 -0
- package/dist/components/illustrated-message/index.d.ts +13 -0
- package/dist/components/illustrated-message/index.js +3 -0
- package/dist/components/infield-button/InfieldButton.base.d.ts +28 -0
- package/dist/components/infield-button/InfieldButton.base.js +22 -0
- package/dist/components/infield-button/InfieldButton.base.js.map +1 -0
- package/dist/components/infield-button/InfieldButton.types.d.ts +13 -0
- package/dist/components/infield-button/InfieldButton.types.js +11 -0
- package/dist/components/infield-button/InfieldButton.types.js.map +1 -0
- package/dist/components/infield-button/index.d.ts +13 -0
- package/dist/components/infield-button/index.js +3 -0
- package/dist/components/meter/Meter.base.d.ts +40 -0
- package/dist/components/meter/Meter.base.js +32 -0
- package/dist/components/meter/Meter.base.js.map +1 -0
- package/dist/components/meter/Meter.types.d.ts +13 -0
- package/dist/components/meter/Meter.types.js +11 -0
- package/dist/components/meter/Meter.types.js.map +1 -0
- package/dist/components/meter/index.d.ts +13 -0
- package/dist/components/meter/index.js +3 -0
- package/dist/components/popover/Popover.base.d.ts +226 -0
- package/dist/components/popover/Popover.base.js +287 -0
- package/dist/components/popover/Popover.base.js.map +1 -0
- package/dist/components/popover/Popover.types.d.ts +39 -0
- package/dist/components/popover/Popover.types.js +24 -0
- package/dist/components/popover/Popover.types.js.map +1 -0
- package/dist/components/popover/index.d.ts +13 -0
- package/dist/components/popover/index.js +3 -0
- package/dist/components/progress-bar/ProgressBar.base.d.ts +34 -0
- package/dist/components/progress-bar/ProgressBar.base.js +21 -0
- package/dist/components/progress-bar/ProgressBar.base.js.map +1 -0
- package/dist/components/progress-bar/ProgressBar.types.d.ts +12 -0
- package/dist/components/progress-bar/index.d.ts +13 -0
- package/dist/components/progress-bar/index.js +2 -0
- package/dist/components/progress-circle/ProgressCircle.base.d.ts +83 -0
- package/dist/components/progress-circle/ProgressCircle.base.js +77 -0
- package/dist/components/progress-circle/ProgressCircle.base.js.map +1 -0
- package/dist/components/progress-circle/ProgressCircle.types.d.ts +15 -0
- package/dist/components/progress-circle/ProgressCircle.types.js +10 -0
- package/dist/components/progress-circle/ProgressCircle.types.js.map +1 -0
- package/dist/components/progress-circle/index.d.ts +13 -0
- package/dist/components/progress-circle/index.js +3 -0
- package/dist/components/status-light/StatusLight.base.d.ts +69 -0
- package/dist/components/status-light/StatusLight.base.js +32 -0
- package/dist/components/status-light/StatusLight.base.js.map +1 -0
- package/dist/components/status-light/StatusLight.types.d.ts +19 -0
- package/dist/components/status-light/StatusLight.types.js +32 -0
- package/dist/components/status-light/StatusLight.types.js.map +1 -0
- package/dist/components/status-light/index.d.ts +13 -0
- package/dist/components/status-light/index.js +3 -0
- package/dist/components/tabs/Tab.base.d.ts +49 -0
- package/dist/components/tabs/Tab.base.js +39 -0
- package/dist/components/tabs/Tab.base.js.map +1 -0
- package/dist/components/tabs/Tab.types.d.ts +17 -0
- package/dist/components/tabs/TabPanel.base.d.ts +49 -0
- package/dist/components/tabs/TabPanel.base.js +36 -0
- package/dist/components/tabs/TabPanel.base.js.map +1 -0
- package/dist/components/tabs/TabPanel.types.d.ts +17 -0
- package/dist/components/tabs/Tabs.base.d.ts +221 -0
- package/dist/components/tabs/Tabs.base.js +213 -0
- package/dist/components/tabs/Tabs.base.js.map +1 -0
- package/dist/components/tabs/Tabs.types.d.ts +55 -0
- package/dist/components/tabs/Tabs.types.js +6 -0
- package/dist/components/tabs/Tabs.types.js.map +1 -0
- package/dist/components/tabs/index.d.ts +17 -0
- package/dist/components/tabs/index.js +5 -0
- package/dist/components/tooltip/Tooltip.base.d.ts +159 -0
- package/dist/components/tooltip/Tooltip.base.js +198 -0
- package/dist/components/tooltip/Tooltip.base.js.map +1 -0
- package/dist/components/tooltip/Tooltip.types.d.ts +18 -0
- package/dist/components/tooltip/Tooltip.types.js +15 -0
- package/dist/components/tooltip/Tooltip.types.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +13 -0
- package/dist/components/tooltip/index.js +3 -0
- package/dist/controllers/color-controller/index.d.ts +12 -0
- package/dist/controllers/color-controller/index.js +2 -0
- package/dist/controllers/color-controller/src/color-controller.d.ts +226 -0
- package/dist/controllers/color-controller/src/color-controller.js +253 -0
- package/dist/controllers/color-controller/src/color-controller.js.map +1 -0
- package/dist/controllers/drag-and-drop-controller/index.d.ts +12 -0
- package/dist/controllers/drag-and-drop-controller/index.js +2 -0
- package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.d.ts +68 -0
- package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.js +56 -0
- package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.js.map +1 -0
- package/dist/controllers/focusgroup-navigation-controller/index.d.ts +12 -0
- package/dist/controllers/focusgroup-navigation-controller/index.js +2 -0
- package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.d.ts +496 -0
- package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.js +345 -0
- package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.js.map +1 -0
- package/dist/controllers/hover-controller/index.d.ts +12 -0
- package/dist/controllers/hover-controller/index.js +2 -0
- package/dist/controllers/hover-controller/src/hover-controller.d.ts +118 -0
- package/dist/controllers/hover-controller/src/hover-controller.js +90 -0
- package/dist/controllers/hover-controller/src/hover-controller.js.map +1 -0
- package/dist/controllers/index.d.ts +26 -0
- package/dist/controllers/index.js +18 -0
- package/dist/controllers/language-resolution.d.ts +87 -0
- package/dist/controllers/language-resolution.js +56 -0
- package/dist/controllers/language-resolution.js.map +1 -0
- package/dist/controllers/live-selection-controller/index.d.ts +12 -0
- package/dist/controllers/live-selection-controller/index.js +2 -0
- package/dist/controllers/live-selection-controller/src/live-selection-controller.d.ts +144 -0
- package/dist/controllers/live-selection-controller/src/live-selection-controller.js +36 -0
- package/dist/controllers/live-selection-controller/src/live-selection-controller.js.map +1 -0
- package/dist/controllers/page-scroll-lock-controller/index.d.ts +12 -0
- package/dist/controllers/page-scroll-lock-controller/index.js +2 -0
- package/dist/controllers/page-scroll-lock-controller/src/page-scroll-lock.d.ts +20 -0
- package/dist/controllers/page-scroll-lock-controller/src/page-scroll-lock.js +30 -0
- package/dist/controllers/page-scroll-lock-controller/src/page-scroll-lock.js.map +1 -0
- package/dist/controllers/pending-controller/index.d.ts +12 -0
- package/dist/controllers/pending-controller/index.js +2 -0
- package/dist/controllers/pending-controller/src/pending-controller.d.ts +95 -0
- package/dist/controllers/pending-controller/src/pending-controller.js +55 -0
- package/dist/controllers/pending-controller/src/pending-controller.js.map +1 -0
- package/dist/controllers/placement-controller/index.d.ts +12 -0
- package/dist/controllers/placement-controller/index.js +4 -0
- package/dist/controllers/placement-controller/src/fallback-placements.d.ts +9 -0
- package/dist/controllers/placement-controller/src/fallback-placements.js +71 -0
- package/dist/controllers/placement-controller/src/fallback-placements.js.map +1 -0
- package/dist/controllers/placement-controller/src/placement-controller.d.ts +152 -0
- package/dist/controllers/placement-controller/src/placement-controller.js +129 -0
- package/dist/controllers/placement-controller/src/placement-controller.js.map +1 -0
- package/dist/controllers/placement-controller/src/placement-conversion.d.ts +35 -0
- package/dist/controllers/placement-controller/src/placement-conversion.js +54 -0
- package/dist/controllers/placement-controller/src/placement-conversion.js.map +1 -0
- package/dist/controllers/placement-controller/src/types.d.ts +128 -0
- package/dist/controllers/placement-controller/src/types.js +29 -0
- package/dist/controllers/placement-controller/src/types.js.map +1 -0
- package/dist/controllers/slot-attribute-propagation-controller/index.d.ts +12 -0
- package/dist/controllers/slot-attribute-propagation-controller/index.js +2 -0
- package/dist/controllers/slot-attribute-propagation-controller/src/slot-attribute-propagation-controller.d.ts +65 -0
- package/dist/controllers/slot-attribute-propagation-controller/src/slot-attribute-propagation-controller.js +33 -0
- package/dist/controllers/slot-attribute-propagation-controller/src/slot-attribute-propagation-controller.js.map +1 -0
- package/dist/controllers/slot-presence-controller/index.d.ts +12 -0
- package/dist/controllers/slot-presence-controller/index.js +2 -0
- package/dist/controllers/slot-presence-controller/src/slot-presence-controller.d.ts +57 -0
- package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js +44 -0
- package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js.map +1 -0
- package/dist/controllers/slot-text-controller/index.d.ts +12 -0
- package/dist/controllers/slot-text-controller/index.js +2 -0
- package/dist/controllers/slot-text-controller/src/slot-text-controller.d.ts +92 -0
- package/dist/controllers/slot-text-controller/src/slot-text-controller.js +53 -0
- package/dist/controllers/slot-text-controller/src/slot-text-controller.js.map +1 -0
- package/dist/directives/index.d.ts +15 -0
- package/dist/directives/index.js +3 -0
- package/dist/directives/pending-spinner/index.d.ts +12 -0
- package/dist/directives/pending-spinner/index.js +1 -0
- package/dist/directives/pending-spinner/src/pending-spinner.d.ts +22 -0
- package/dist/directives/pending-spinner/src/pending-spinner.js +39 -0
- package/dist/directives/pending-spinner/src/pending-spinner.js.map +1 -0
- package/dist/element/define-element.d.ts +16 -0
- package/dist/element/define-element.js +8 -0
- package/dist/element/define-element.js.map +1 -0
- package/dist/element/index.d.ts +14 -0
- package/dist/element/index.js +4 -0
- package/dist/element/spectrum-element.d.ts +69 -0
- package/dist/element/spectrum-element.js +85 -0
- package/dist/element/spectrum-element.js.map +1 -0
- package/dist/element/version.d.ts +19 -0
- package/dist/element/version.js +6 -0
- package/dist/element/version.js.map +1 -0
- package/dist/mixins/disabled-mixin.d.ts +30 -0
- package/dist/mixins/disabled-mixin.js +27 -0
- package/dist/mixins/disabled-mixin.js.map +1 -0
- package/dist/mixins/index.d.ts +16 -0
- package/dist/mixins/index.js +5 -0
- package/dist/mixins/linear-progress-mixin.d.ts +41 -0
- package/dist/mixins/linear-progress-mixin.js +115 -0
- package/dist/mixins/linear-progress-mixin.js.map +1 -0
- package/dist/mixins/pending-mixin.d.ts +45 -0
- package/dist/mixins/pending-mixin.js +50 -0
- package/dist/mixins/pending-mixin.js.map +1 -0
- package/dist/mixins/sized-mixin.d.ts +49 -0
- package/dist/mixins/sized-mixin.js +42 -0
- package/dist/mixins/sized-mixin.js.map +1 -0
- package/dist/utils/actual-placement.d.ts +10 -0
- package/dist/utils/actual-placement.js +8 -0
- package/dist/utils/actual-placement.js.map +1 -0
- package/dist/utils/capitalize.d.ts +26 -0
- package/dist/utils/capitalize.js +8 -0
- package/dist/utils/capitalize.js.map +1 -0
- package/dist/utils/deep-contains.d.ts +26 -0
- package/dist/utils/deep-contains.js +14 -0
- package/dist/utils/deep-contains.js.map +1 -0
- package/dist/utils/dev-validation.d.ts +88 -0
- package/dist/utils/dev-validation.js +33 -0
- package/dist/utils/dev-validation.js.map +1 -0
- package/dist/utils/dismissible-stack.d.ts +26 -0
- package/dist/utils/dismissible-stack.js +16 -0
- package/dist/utils/dismissible-stack.js.map +1 -0
- package/dist/utils/focusable-selectors.d.ts +43 -0
- package/dist/utils/focusable-selectors.js +18 -0
- package/dist/utils/focusable-selectors.js.map +1 -0
- package/dist/utils/get-active-element.d.ts +31 -0
- package/dist/utils/get-active-element.js +11 -0
- package/dist/utils/get-active-element.js.map +1 -0
- package/dist/utils/get-label-from-slot.d.ts +12 -0
- package/dist/utils/get-label-from-slot.js +10 -0
- package/dist/utils/get-label-from-slot.js.map +1 -0
- package/dist/utils/index.d.ts +22 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/is-focus-visible-in-tree.d.ts +33 -0
- package/dist/utils/is-focus-visible-in-tree.js +11 -0
- package/dist/utils/is-focus-visible-in-tree.js.map +1 -0
- package/dist/utils/resolve-trigger.d.ts +42 -0
- package/dist/utils/resolve-trigger.js +23 -0
- package/dist/utils/resolve-trigger.js.map +1 -0
- package/dist/utils/transition.d.ts +53 -0
- package/dist/utils/transition.js +26 -0
- package/dist/utils/transition.js.map +1 -0
- package/package.json +644 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { SpectrumElement } from '../../element/index.js';
|
|
3
|
+
import { ActionGroupOrientation, ActionGroupSize } from './ActionGroup.types.js';
|
|
4
|
+
declare const ActionGroupBase_base: typeof SpectrumElement & {
|
|
5
|
+
new (...args: any[]): import('../../mixins/index.js').SizedElementInterface;
|
|
6
|
+
prototype: import('../../mixins/index.js').SizedElementInterface;
|
|
7
|
+
} & import('../../mixins/index.js').SizedElementConstructor;
|
|
8
|
+
/**
|
|
9
|
+
* An action group clusters related actions together with consistent
|
|
10
|
+
* spacing, sizing, and orientation. It treats the whole strip as a single
|
|
11
|
+
* stop in the keyboard sequence, with arrow keys moving between children.
|
|
12
|
+
*
|
|
13
|
+
* This base class owns the accessibility semantics, `accessible-label` →
|
|
14
|
+
* `aria-label` management, `disabled` state contract, and child collection logic.
|
|
15
|
+
* Rendering and styling live in the concrete SWC subclass.
|
|
16
|
+
*
|
|
17
|
+
* @slot - One or more `swc-action-button` or `swc-action-menu` elements.
|
|
18
|
+
*
|
|
19
|
+
* @attribute {ActionGroupSize} size - The size of the group and its children.
|
|
20
|
+
*/
|
|
21
|
+
export declare abstract class ActionGroupBase extends ActionGroupBase_base {
|
|
22
|
+
static shadowRootOptions: {
|
|
23
|
+
delegatesFocus: boolean;
|
|
24
|
+
clonable?: boolean;
|
|
25
|
+
customElementRegistry?: CustomElementRegistry;
|
|
26
|
+
mode: ShadowRootMode;
|
|
27
|
+
serializable?: boolean;
|
|
28
|
+
slotAssignment?: SlotAssignmentMode;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The size of the action group. Propagated to all slotted children.
|
|
32
|
+
*/
|
|
33
|
+
size: ActionGroupSize;
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*
|
|
37
|
+
* Valid orientation values for validation.
|
|
38
|
+
*/
|
|
39
|
+
static readonly ORIENTATIONS: readonly string[];
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*
|
|
43
|
+
* Valid static-color values for validation.
|
|
44
|
+
*/
|
|
45
|
+
static readonly STATIC_COLORS: readonly string[];
|
|
46
|
+
/**
|
|
47
|
+
* The layout direction of the action group.
|
|
48
|
+
*
|
|
49
|
+
* When set to `"vertical"`, the group stacks children vertically and
|
|
50
|
+
* `FocusgroupNavigationController` moves focus with the Up/Down arrow
|
|
51
|
+
* keys instead of Left/Right.
|
|
52
|
+
*
|
|
53
|
+
* Note: this property does NOT set `aria-orientation` on the host. The
|
|
54
|
+
* host's role is fixed to `role="group"`, and `aria-orientation` is only
|
|
55
|
+
* a supported ARIA attribute on roles that expose it (`toolbar`,
|
|
56
|
+
* `listbox`, `menu`, etc.), not `group`, regardless of this component's
|
|
57
|
+
* roving-tabindex keyboard model. Setting it anyway fails axe's
|
|
58
|
+
* `aria-allowed-attr` rule.
|
|
59
|
+
*
|
|
60
|
+
* @default horizontal
|
|
61
|
+
*/
|
|
62
|
+
orientation: ActionGroupOrientation;
|
|
63
|
+
/**
|
|
64
|
+
* Accessible label for the group. Reflected to `aria-label` on the host.
|
|
65
|
+
*
|
|
66
|
+
* Providing a label is recommended whenever the strip has a distinct
|
|
67
|
+
* purpose (e.g., "Image adjustments" or "Edit"). An empty value removes
|
|
68
|
+
* the `aria-label` attribute.
|
|
69
|
+
*/
|
|
70
|
+
accessibleLabel: string;
|
|
71
|
+
/**
|
|
72
|
+
* Whether the group and all of its children are disabled.
|
|
73
|
+
*
|
|
74
|
+
* Sets `aria-disabled="true"` on the host and propagates `aria-disabled`
|
|
75
|
+
* to each managed child. Children remain keyboard-reachable so that screen
|
|
76
|
+
* reader users can still discover the group. Native `disabled` is not
|
|
77
|
+
* applied to children.
|
|
78
|
+
*/
|
|
79
|
+
disabled: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*
|
|
83
|
+
* The managed children: all `swc-action-button` and `swc-action-menu`
|
|
84
|
+
* elements assigned to the default slot. Populated by the concrete
|
|
85
|
+
* subclass via `@queryAssignedElements`.
|
|
86
|
+
*/
|
|
87
|
+
protected managedChildren: HTMLElement[];
|
|
88
|
+
/**
|
|
89
|
+
* Focuses the first enabled child in the group.
|
|
90
|
+
*
|
|
91
|
+
* The SWC concrete class overrides this with `FocusgroupNavigationController`,
|
|
92
|
+
* restoring focus to the last active item when memory is enabled. This
|
|
93
|
+
* implementation serves as a fallback for non-SWC subclasses.
|
|
94
|
+
*/
|
|
95
|
+
focus(options?: FocusOptions): void;
|
|
96
|
+
/**
|
|
97
|
+
* @internal
|
|
98
|
+
*
|
|
99
|
+
* Handles slot-change events. Propagates `aria-disabled` to newly slotted
|
|
100
|
+
* children when the group is disabled. Concrete subclasses call
|
|
101
|
+
* `super.handleSlotchange()` and then propagate visual attributes.
|
|
102
|
+
*/
|
|
103
|
+
protected handleSlotchange(): void;
|
|
104
|
+
protected firstUpdated(changed: PropertyValues<this>): void;
|
|
105
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
106
|
+
private propagateDisabledToChildren;
|
|
107
|
+
}
|
|
108
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
|
|
2
|
+
import { ACTION_GROUP_ORIENTATIONS as t, ACTION_GROUP_STATIC_COLORS as n, ACTION_GROUP_VALID_SIZES as r } from "./ActionGroup.types.js";
|
|
3
|
+
import { property as i, queryAssignedElements as a } from "lit/decorators.js";
|
|
4
|
+
import { SpectrumElement as o } from "@adobe/spectrum-wc-core/element/index.js";
|
|
5
|
+
import { SizedMixin as s } from "@adobe/spectrum-wc-core/mixins/index.js";
|
|
6
|
+
//#region components/action-group/ActionGroup.base.ts
|
|
7
|
+
var c, l = class extends s(o, {
|
|
8
|
+
validSizes: r,
|
|
9
|
+
noDefaultSize: !0
|
|
10
|
+
}) {
|
|
11
|
+
constructor(...e) {
|
|
12
|
+
super(...e), this.orientation = "horizontal", this.accessibleLabel = "", this.disabled = !1;
|
|
13
|
+
}
|
|
14
|
+
focus(e) {
|
|
15
|
+
var t;
|
|
16
|
+
let n = (t = this.managedChildren) == null ? void 0 : t.find((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-disabled") !== "true");
|
|
17
|
+
n == null || n.focus(e);
|
|
18
|
+
}
|
|
19
|
+
handleSlotchange() {
|
|
20
|
+
this.disabled && this.propagateDisabledToChildren();
|
|
21
|
+
}
|
|
22
|
+
firstUpdated(e) {
|
|
23
|
+
super.firstUpdated(e), this.setAttribute("role", "group");
|
|
24
|
+
}
|
|
25
|
+
updated(e) {
|
|
26
|
+
var t;
|
|
27
|
+
if (super.updated(e), e.has("accessibleLabel") && (this.accessibleLabel ? this.setAttribute("aria-label", this.accessibleLabel) : this.removeAttribute("aria-label")), e.has("disabled") && (this.disabled ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled"), this.propagateDisabledToChildren()), (t = window.__swc) != null && t.DEBUG) {
|
|
28
|
+
let e = this.constructor;
|
|
29
|
+
e.ORIENTATIONS.includes(this.orientation) || window.__swc.warn(this, `<${this.localName}> element expects the "orientation" attribute to be one of the following: ${e.ORIENTATIONS.join(", ")}.`, "https://spectrum-web-components.adobe.com/components/action-group/", { issues: [...e.ORIENTATIONS] });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
propagateDisabledToChildren() {
|
|
33
|
+
var e;
|
|
34
|
+
for (let t of (e = this.managedChildren) == null ? [] : e) this.disabled ? t.setAttribute("aria-disabled", "true") : t.removeAttribute("aria-disabled");
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
c = l, c.shadowRootOptions = {
|
|
38
|
+
...o.shadowRootOptions,
|
|
39
|
+
delegatesFocus: !0
|
|
40
|
+
}, c.ORIENTATIONS = t, c.STATIC_COLORS = n, e([i({
|
|
41
|
+
type: String,
|
|
42
|
+
reflect: !0
|
|
43
|
+
})], l.prototype, "orientation", void 0), e([i({
|
|
44
|
+
type: String,
|
|
45
|
+
attribute: "accessible-label"
|
|
46
|
+
})], l.prototype, "accessibleLabel", void 0), e([i({
|
|
47
|
+
type: Boolean,
|
|
48
|
+
reflect: !0
|
|
49
|
+
})], l.prototype, "disabled", void 0), e([a({ flatten: !0 })], l.prototype, "managedChildren", void 0);
|
|
50
|
+
//#endregion
|
|
51
|
+
export { l as ActionGroupBase };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=ActionGroup.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionGroup.base.js","names":[],"sources":["../../../components/action-group/ActionGroup.base.ts"],"sourcesContent":["/**\n * Copyright 2026 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 { PropertyValues } from 'lit';\nimport { property, queryAssignedElements } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { SizedMixin } from '@adobe/spectrum-wc-core/mixins/index.js';\n\nimport {\n ACTION_GROUP_ORIENTATIONS,\n ACTION_GROUP_STATIC_COLORS,\n ACTION_GROUP_VALID_SIZES,\n type ActionGroupOrientation,\n type ActionGroupSize,\n} from './ActionGroup.types.js';\n\n/**\n * An action group clusters related actions together with consistent\n * spacing, sizing, and orientation. It treats the whole strip as a single\n * stop in the keyboard sequence, with arrow keys moving between children.\n *\n * This base class owns the accessibility semantics, `accessible-label` →\n * `aria-label` management, `disabled` state contract, and child collection logic.\n * Rendering and styling live in the concrete SWC subclass.\n *\n * @slot - One or more `swc-action-button` or `swc-action-menu` elements.\n *\n * @attribute {ActionGroupSize} size - The size of the group and its children.\n */\nexport abstract class ActionGroupBase extends SizedMixin(SpectrumElement, {\n validSizes: ACTION_GROUP_VALID_SIZES,\n noDefaultSize: true,\n}) {\n static override shadowRootOptions = {\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * The size of the action group. Propagated to all slotted children.\n */\n declare public size: ActionGroupSize;\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * @internal\n *\n * Valid orientation values for validation.\n */\n static readonly ORIENTATIONS: readonly string[] = ACTION_GROUP_ORIENTATIONS;\n\n /**\n * @internal\n *\n * Valid static-color values for validation.\n */\n static readonly STATIC_COLORS: readonly string[] = ACTION_GROUP_STATIC_COLORS;\n\n /**\n * The layout direction of the action group.\n *\n * When set to `\"vertical\"`, the group stacks children vertically and\n * `FocusgroupNavigationController` moves focus with the Up/Down arrow\n * keys instead of Left/Right.\n *\n * Note: this property does NOT set `aria-orientation` on the host. The\n * host's role is fixed to `role=\"group\"`, and `aria-orientation` is only\n * a supported ARIA attribute on roles that expose it (`toolbar`,\n * `listbox`, `menu`, etc.), not `group`, regardless of this component's\n * roving-tabindex keyboard model. Setting it anyway fails axe's\n * `aria-allowed-attr` rule.\n *\n * @default horizontal\n */\n @property({ type: String, reflect: true })\n public orientation: ActionGroupOrientation = 'horizontal';\n\n /**\n * Accessible label for the group. Reflected to `aria-label` on the host.\n *\n * Providing a label is recommended whenever the strip has a distinct\n * purpose (e.g., \"Image adjustments\" or \"Edit\"). An empty value removes\n * the `aria-label` attribute.\n */\n @property({ type: String, attribute: 'accessible-label' })\n public accessibleLabel = '';\n\n /**\n * Whether the group and all of its children are disabled.\n *\n * Sets `aria-disabled=\"true\"` on the host and propagates `aria-disabled`\n * to each managed child. Children remain keyboard-reachable so that screen\n * reader users can still discover the group. Native `disabled` is not\n * applied to children.\n */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n /**\n * @internal\n *\n * The managed children: all `swc-action-button` and `swc-action-menu`\n * elements assigned to the default slot. Populated by the concrete\n * subclass via `@queryAssignedElements`.\n */\n @queryAssignedElements({ flatten: true })\n protected managedChildren!: HTMLElement[];\n\n /**\n * Focuses the first enabled child in the group.\n *\n * The SWC concrete class overrides this with `FocusgroupNavigationController`,\n * restoring focus to the last active item when memory is enabled. This\n * implementation serves as a fallback for non-SWC subclasses.\n */\n public override focus(options?: FocusOptions): void {\n const firstEnabled = this.managedChildren?.find(\n (el) =>\n !el.hasAttribute('disabled') &&\n el.getAttribute('aria-disabled') !== 'true'\n );\n firstEnabled?.focus(options);\n }\n\n /**\n * @internal\n *\n * Handles slot-change events. Propagates `aria-disabled` to newly slotted\n * children when the group is disabled. Concrete subclasses call\n * `super.handleSlotchange()` and then propagate visual attributes.\n */\n protected handleSlotchange(): void {\n if (this.disabled) {\n this.propagateDisabledToChildren();\n }\n }\n\n protected override firstUpdated(changed: PropertyValues<this>): void {\n super.firstUpdated(changed);\n this.setAttribute('role', 'group');\n }\n\n protected override updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n\n if (changed.has('accessibleLabel')) {\n if (this.accessibleLabel) {\n this.setAttribute('aria-label', this.accessibleLabel);\n } else {\n this.removeAttribute('aria-label');\n }\n }\n\n if (changed.has('disabled')) {\n if (this.disabled) {\n this.setAttribute('aria-disabled', 'true');\n } else {\n this.removeAttribute('aria-disabled');\n }\n this.propagateDisabledToChildren();\n }\n\n if (window.__swc?.DEBUG) {\n const constructor = this.constructor as typeof ActionGroupBase;\n if (!constructor.ORIENTATIONS.includes(this.orientation)) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"orientation\" attribute to be one of the following: ${constructor.ORIENTATIONS.join(', ')}.`,\n 'https://spectrum-web-components.adobe.com/components/action-group/',\n { issues: [...constructor.ORIENTATIONS] }\n );\n }\n }\n }\n\n private propagateDisabledToChildren(): void {\n // `aria-disabled` is set on the child host element. For AT to announce the\n // child as disabled, each child component must forward the host attribute to\n // its inner interactive element. `swc-action-button` already does this\n // (observes `aria-disabled` and forwards to its inner <button>).\n // `swc-action-menu` will need the same treatment when it is built — it must\n // forward `aria-disabled` from its host to its inner trigger element and\n // apply disabled appearance via :host([aria-disabled=\"true\"]) CSS.\n for (const child of this.managedChildren ?? []) {\n if (this.disabled) {\n child.setAttribute('aria-disabled', 'true');\n } else {\n child.removeAttribute('aria-disabled');\n }\n }\n }\n}\n"],"mappings":";;;;;;OAuCsB,IAAtB,cAA8C,EAAW,GAAiB;CACxE,YAAY;CACZ,eAAe;CAChB,CAAC,CAAC;;kCA8C4C,qCAUpB,oBAWP;;CAuBlB,MAAsB,GAA8B;;EAClD,IAAM,KAAA,IAAe,KAAK,oBAAA,OAAA,KAAA,IAAA,EAAiB,MACxC,MACC,CAAC,EAAG,aAAa,WAAW,IAC5B,EAAG,aAAa,gBAAgB,KAAK,OACxC;AACD,OAAA,QAAA,EAAc,MAAM,EAAQ;;CAU9B,mBAAmC;AACjC,EAAI,KAAK,YACP,KAAK,6BAA6B;;CAItC,aAAgC,GAAqC;AAEnE,EADA,MAAM,aAAa,EAAQ,EAC3B,KAAK,aAAa,QAAQ,QAAQ;;CAGpC,QAA2B,GAAqC;;AAoB9D,MAnBA,MAAM,QAAQ,EAAQ,EAElB,EAAQ,IAAI,kBAAkB,KAC5B,KAAK,kBACP,KAAK,aAAa,cAAc,KAAK,gBAAgB,GAErD,KAAK,gBAAgB,aAAa,GAIlC,EAAQ,IAAI,WAAW,KACrB,KAAK,WACP,KAAK,aAAa,iBAAiB,OAAO,GAE1C,KAAK,gBAAgB,gBAAgB,EAEvC,KAAK,6BAA6B,IAGpC,IAAI,OAAO,UAAA,QAAA,EAAO,OAAO;GACvB,IAAM,IAAc,KAAK;AACzB,GAAK,EAAY,aAAa,SAAS,KAAK,YAAY,IACtD,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,4EAA4E,EAAY,aAAa,KAAK,KAAK,CAAC,IACnI,sEACA,EAAE,QAAQ,CAAC,GAAG,EAAY,aAAa,EAAE,CAC1C;;;CAKP,8BAA4C;;AAQ1C,OAAK,IAAM,MAAA,IAAS,KAAK,oBAAA,OAAmB,EAAE,GAArB,EACvB,CAAI,KAAK,WACP,EAAM,aAAa,iBAAiB,OAAO,GAE3C,EAAM,gBAAgB,gBAAgB;;;6BAjKR;CAClC,GAAG,EAAgB;CACnB,gBAAgB;CACjB,mBAgBiD,qBAOC,MAkBlD,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAUzC,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAoB,CAAC,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA,KAWzD,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAc1C,EAAsB,EAAE,SAAS,IAAM,CAAC,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 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
|
+
*/
|
|
12
|
+
export declare const ACTION_GROUP_VALID_SIZES: readonly ["xs", "s", "m", "l", "xl"];
|
|
13
|
+
export declare const ACTION_GROUP_ORIENTATIONS: readonly ["horizontal", "vertical"];
|
|
14
|
+
export declare const ACTION_GROUP_STATIC_COLORS: readonly ["white", "black"];
|
|
15
|
+
export type ActionGroupSize = (typeof ACTION_GROUP_VALID_SIZES)[number];
|
|
16
|
+
export type ActionGroupOrientation = (typeof ACTION_GROUP_ORIENTATIONS)[number];
|
|
17
|
+
export type ActionGroupStaticColor = (typeof ACTION_GROUP_STATIC_COLORS)[number];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region components/action-group/ActionGroup.types.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"xs",
|
|
4
|
+
"s",
|
|
5
|
+
"m",
|
|
6
|
+
"l",
|
|
7
|
+
"xl"
|
|
8
|
+
], t = ["horizontal", "vertical"], n = ["white", "black"];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as ACTION_GROUP_ORIENTATIONS, n as ACTION_GROUP_STATIC_COLORS, e as ACTION_GROUP_VALID_SIZES };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=ActionGroup.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionGroup.types.js","names":[],"sources":["../../../components/action-group/ActionGroup.types.ts"],"sourcesContent":["/**\n * Copyright 2026 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 type { ElementSize } from '@adobe/spectrum-wc-core/mixins/index.js';\n\n// ──────────────────\n// SHARED\n// ──────────────────\n\nexport const ACTION_GROUP_VALID_SIZES = [\n 'xs',\n 's',\n 'm',\n 'l',\n 'xl',\n] as const satisfies readonly ElementSize[];\n\nexport const ACTION_GROUP_ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\nexport const ACTION_GROUP_STATIC_COLORS = ['white', 'black'] as const;\n\n// ──────────────────\n// TYPES\n// ──────────────────\n\nexport type ActionGroupSize = (typeof ACTION_GROUP_VALID_SIZES)[number];\nexport type ActionGroupOrientation = (typeof ACTION_GROUP_ORIENTATIONS)[number];\nexport type ActionGroupStaticColor =\n (typeof ACTION_GROUP_STATIC_COLORS)[number];\n"],"mappings":";AAkBA,IAAa,IAA2B;CACtC;CACA;CACA;CACA;CACA;CACD,EAEY,IAA4B,CAAC,cAAc,WAAW,EAEtD,IAA6B,CAAC,SAAS,QAAQ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 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
|
+
*/
|
|
12
|
+
export * from './ActionGroup.base.js';
|
|
13
|
+
export * from './ActionGroup.types.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ACTION_GROUP_ORIENTATIONS as e, ACTION_GROUP_STATIC_COLORS as t, ACTION_GROUP_VALID_SIZES as n } from "./ActionGroup.types.js";
|
|
2
|
+
import { ActionGroupBase as r } from "./ActionGroup.base.js";
|
|
3
|
+
export { e as ACTION_GROUP_ORIENTATIONS, t as ACTION_GROUP_STATIC_COLORS, n as ACTION_GROUP_VALID_SIZES, r as ActionGroupBase };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CSSResultArray, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { SpectrumElement } from '../../element/index.js';
|
|
3
|
+
import { AlertBannerVariant } from './AlertBanner.types.js';
|
|
4
|
+
/**
|
|
5
|
+
* An alert banner shows pressing and high-signal messages, such as system alerts.
|
|
6
|
+
* It is meant to be noticed and prompt users to take action.
|
|
7
|
+
*
|
|
8
|
+
* @slot - The main content of the alert banner.
|
|
9
|
+
* @slot action - An optional action button for the alert banner.
|
|
10
|
+
*
|
|
11
|
+
* @fires close - Dispatched when the alert banner is dismissed. Cancelable.
|
|
12
|
+
*/
|
|
13
|
+
export declare abstract class AlertBannerBase extends SpectrumElement {
|
|
14
|
+
static get styles(): CSSResultArray;
|
|
15
|
+
/**
|
|
16
|
+
* Controls the display of the alert banner.
|
|
17
|
+
*/
|
|
18
|
+
open: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to include an icon-only close button to dismiss the alert banner.
|
|
21
|
+
*/
|
|
22
|
+
dismissible: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The variant applies specific styling when set to `negative` or `info`;
|
|
25
|
+
* `variant` attribute is removed when it's passed an invalid variant.
|
|
26
|
+
*/
|
|
27
|
+
set variant(variant: AlertBannerVariant);
|
|
28
|
+
get variant(): AlertBannerVariant;
|
|
29
|
+
private _variant;
|
|
30
|
+
protected isValidVariant(variant: string): boolean;
|
|
31
|
+
protected abstract renderIcon(variant: string): TemplateResult;
|
|
32
|
+
protected shouldClose(): void;
|
|
33
|
+
close(): void;
|
|
34
|
+
protected handleKeydown(event: KeyboardEvent): void;
|
|
35
|
+
protected updated(changes: PropertyValues): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
|
|
2
|
+
import { ALERT_BANNER_VALID_VARIANTS as t } from "./AlertBanner.types.js";
|
|
3
|
+
import { property as n } from "lit/decorators.js";
|
|
4
|
+
import { SpectrumElement as r } from "@adobe/spectrum-wc-core/element/index.js";
|
|
5
|
+
import { validateEnum as i } from "@adobe/spectrum-wc-core/utils/index.js";
|
|
6
|
+
//#region components/alert-banner/AlertBanner.base.ts
|
|
7
|
+
var a = class extends r {
|
|
8
|
+
constructor(...e) {
|
|
9
|
+
super(...e), this.open = !1, this.dismissible = !1, this._variant = "";
|
|
10
|
+
}
|
|
11
|
+
static get styles() {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
set variant(e) {
|
|
15
|
+
if (e === this.variant) return;
|
|
16
|
+
let n = this.variant;
|
|
17
|
+
this.isValidVariant(e) ? (this.setAttribute("variant", e), this._variant = e) : (this.removeAttribute("variant"), this._variant = "", i(this, {
|
|
18
|
+
prop: "variant",
|
|
19
|
+
value: e,
|
|
20
|
+
valid: t,
|
|
21
|
+
url: "https://spectrum-web-components.adobe.com/?path=/docs/components-alert-banner--docs"
|
|
22
|
+
})), this.requestUpdate("variant", n);
|
|
23
|
+
}
|
|
24
|
+
get variant() {
|
|
25
|
+
return this._variant;
|
|
26
|
+
}
|
|
27
|
+
isValidVariant(e) {
|
|
28
|
+
return t.includes(e);
|
|
29
|
+
}
|
|
30
|
+
shouldClose() {
|
|
31
|
+
this.dispatchEvent(new CustomEvent("close", {
|
|
32
|
+
composed: !0,
|
|
33
|
+
bubbles: !0,
|
|
34
|
+
cancelable: !0
|
|
35
|
+
})) && this.close();
|
|
36
|
+
}
|
|
37
|
+
close() {
|
|
38
|
+
this.open = !1;
|
|
39
|
+
}
|
|
40
|
+
handleKeydown(e) {
|
|
41
|
+
e.code === "Escape" && this.dismissible && this.shouldClose();
|
|
42
|
+
}
|
|
43
|
+
updated(e) {
|
|
44
|
+
super.updated(e), e.has("open") && (this.open ? this.addEventListener("keydown", this.handleKeydown) : this.removeEventListener("keydown", this.handleKeydown));
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
e([n({
|
|
48
|
+
type: Boolean,
|
|
49
|
+
reflect: !0
|
|
50
|
+
})], a.prototype, "open", void 0), e([n({
|
|
51
|
+
type: Boolean,
|
|
52
|
+
reflect: !0
|
|
53
|
+
})], a.prototype, "dismissible", void 0), e([n({ type: String })], a.prototype, "variant", null);
|
|
54
|
+
//#endregion
|
|
55
|
+
export { a as AlertBannerBase };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=AlertBanner.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertBanner.base.js","names":[],"sources":["../../../components/alert-banner/AlertBanner.base.ts"],"sourcesContent":["/**\n * Copyright 2026 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 { CSSResultArray, PropertyValues, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { validateEnum } from '@adobe/spectrum-wc-core/utils/index.js';\n\nimport {\n ALERT_BANNER_VALID_VARIANTS,\n type AlertBannerVariant,\n} from './AlertBanner.types.js';\n\n/**\n * An alert banner shows pressing and high-signal messages, such as system alerts.\n * It is meant to be noticed and prompt users to take action.\n *\n * @slot - The main content of the alert banner.\n * @slot action - An optional action button for the alert banner.\n *\n * @fires close - Dispatched when the alert banner is dismissed. Cancelable.\n */\nexport abstract class AlertBannerBase extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [];\n }\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * Controls the display of the alert banner.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Whether to include an icon-only close button to dismiss the alert banner.\n */\n @property({ type: Boolean, reflect: true })\n public dismissible = false;\n\n /**\n * The variant applies specific styling when set to `negative` or `info`;\n * `variant` attribute is removed when it's passed an invalid variant.\n */\n @property({ type: String })\n public set variant(variant: AlertBannerVariant) {\n if (variant === this.variant) {\n return;\n }\n const oldValue = this.variant;\n\n if (this.isValidVariant(variant)) {\n this.setAttribute('variant', variant);\n this._variant = variant;\n } else {\n this.removeAttribute('variant');\n this._variant = '';\n\n validateEnum(this, {\n prop: 'variant',\n value: variant,\n valid: ALERT_BANNER_VALID_VARIANTS,\n url: 'https://spectrum-web-components.adobe.com/?path=/docs/components-alert-banner--docs',\n });\n }\n this.requestUpdate('variant', oldValue);\n }\n\n public get variant(): AlertBannerVariant {\n return this._variant;\n }\n\n private _variant: AlertBannerVariant = '';\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected isValidVariant(variant: string): boolean {\n return (ALERT_BANNER_VALID_VARIANTS as readonly string[]).includes(variant);\n }\n\n protected abstract renderIcon(variant: string): TemplateResult;\n\n protected shouldClose(): void {\n const applyDefault = this.dispatchEvent(\n new CustomEvent('close', {\n composed: true,\n bubbles: true,\n cancelable: true,\n })\n );\n if (applyDefault) {\n this.close();\n }\n }\n\n public close(): void {\n this.open = false;\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n if (event.code === 'Escape' && this.dismissible) {\n this.shouldClose();\n }\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n\n if (changes.has('open')) {\n if (this.open) {\n this.addEventListener('keydown', this.handleKeydown);\n } else {\n this.removeEventListener('keydown', this.handleKeydown);\n }\n }\n }\n}\n"],"mappings":";;;;;;AA+BA,IAAsB,IAAtB,cAA8C,EAAgB;;2BAa9C,uBAMO,oBAkCkB;;CApDvC,WAA2B,SAAyB;AAClD,SAAO,EAAE;;CAuBX,IACW,QAAQ,GAA6B;AAC9C,MAAI,MAAY,KAAK,QACnB;EAEF,IAAM,IAAW,KAAK;AAgBtB,EAdI,KAAK,eAAe,EAAQ,IAC9B,KAAK,aAAa,WAAW,EAAQ,EACrC,KAAK,WAAW,MAEhB,KAAK,gBAAgB,UAAU,EAC/B,KAAK,WAAW,IAEhB,EAAa,MAAM;GACjB,MAAM;GACN,OAAO;GACP,OAAO;GACP,KAAK;GACN,CAAC,GAEJ,KAAK,cAAc,WAAW,EAAS;;CAGzC,IAAW,UAA8B;AACvC,SAAO,KAAK;;CASd,eAAyB,GAA0B;AACjD,SAAQ,EAAkD,SAAS,EAAQ;;CAK7E,cAA8B;AAQ5B,EAPqB,KAAK,cACxB,IAAI,YAAY,SAAS;GACvB,UAAU;GACV,SAAS;GACT,YAAY;GACb,CAAC,CACH,IAEC,KAAK,OAAO;;CAIhB,QAAqB;AACnB,OAAK,OAAO;;CAGd,cAAwB,GAA4B;AAClD,EAAI,EAAM,SAAS,YAAY,KAAK,eAClC,KAAK,aAAa;;CAItB,QAA2B,GAA+B;AAGxD,EAFA,MAAM,QAAQ,EAAQ,EAElB,EAAQ,IAAI,OAAO,KACjB,KAAK,OACP,KAAK,iBAAiB,WAAW,KAAK,cAAc,GAEpD,KAAK,oBAAoB,WAAW,KAAK,cAAc;;;GAnF5D,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAM1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAO1C,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 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
|
+
*/
|
|
12
|
+
export declare const ALERT_BANNER_VALID_VARIANTS: readonly ["neutral", "info", "negative"];
|
|
13
|
+
export type AlertBannerVariant = (typeof ALERT_BANNER_VALID_VARIANTS)[number] | '';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertBanner.types.js","names":[],"sources":["../../../components/alert-banner/AlertBanner.types.ts"],"sourcesContent":["/**\n * Copyright 2026 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 const ALERT_BANNER_VALID_VARIANTS = [\n 'neutral',\n 'info',\n 'negative',\n] as const satisfies readonly string[];\n\nexport type AlertBannerVariant =\n | (typeof ALERT_BANNER_VALID_VARIANTS)[number]\n | '';\n"],"mappings":";AAYA,IAAa,IAA8B;CACzC;CACA;CACA;CACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 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
|
+
*/
|
|
12
|
+
export * from './AlertBanner.base.js';
|
|
13
|
+
export * from './AlertBanner.types.js';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { SpectrumElement } from '../../element/index.js';
|
|
3
|
+
import { AssetBackground, AssetFit, AssetLoadState } from './Asset.types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Base class for the `<swc-asset>` general image/media primitive.
|
|
6
|
+
*
|
|
7
|
+
* @slot - a single `<img>` or `<svg>` element to display
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class AssetBase extends SpectrumElement {
|
|
10
|
+
private _aspectRatio;
|
|
11
|
+
private _rawAspectRatio;
|
|
12
|
+
/**
|
|
13
|
+
* The aspect ratio to apply to the asset, in CSS `<ratio>` syntax (e.g.
|
|
14
|
+
* `"16/9"`), plus the `square` keyword. `:`-separated ratios (e.g.
|
|
15
|
+
* `"16:9"`) are normalized to `/`. Falls through to an ancestor-supplied
|
|
16
|
+
* default, else `auto`, when unset. Has no effect when both `width` and
|
|
17
|
+
* `height` are also set.
|
|
18
|
+
*/
|
|
19
|
+
get aspectRatio(): string | undefined;
|
|
20
|
+
set aspectRatio(value: string | undefined);
|
|
21
|
+
/**
|
|
22
|
+
* An explicit width, as a CSS `<length-percentage>` (e.g. `"100px"`,
|
|
23
|
+
* `"90%"`). An alternative to `aspectRatio` for sizing the asset.
|
|
24
|
+
*/
|
|
25
|
+
width: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* An explicit height, as a CSS `<length-percentage>` (e.g. `"100px"`,
|
|
28
|
+
* `"90%"`). An alternative to `aspectRatio` for sizing the asset.
|
|
29
|
+
*/
|
|
30
|
+
height: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* How slotted image/SVG content fits within the asset's box.
|
|
33
|
+
*
|
|
34
|
+
* @default cover
|
|
35
|
+
*/
|
|
36
|
+
fit: AssetFit;
|
|
37
|
+
/**
|
|
38
|
+
* Marks the asset as decorative, removing it from the accessibility tree
|
|
39
|
+
* (`aria-hidden="true"` on the host) regardless of slotted content or
|
|
40
|
+
* `accessibleLabel`.
|
|
41
|
+
*/
|
|
42
|
+
decorative: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* A fallback accessible name, applied to the slotted `<img>` or `<svg>`
|
|
45
|
+
* only when it doesn't already carry its own accessible name.
|
|
46
|
+
*/
|
|
47
|
+
accessibleLabel: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The background shown behind slotted content: `transparent` (no
|
|
50
|
+
* background), a `solid` color, or an opacity `checkerboard`.
|
|
51
|
+
*
|
|
52
|
+
* @default transparent
|
|
53
|
+
*/
|
|
54
|
+
background: AssetBackground;
|
|
55
|
+
/**
|
|
56
|
+
* The load status of the slotted `<img>`: `'loading'` while its request is
|
|
57
|
+
* in flight, `'loaded'` on success, `'error'` on failure. Immediately
|
|
58
|
+
* `'loaded'` for a slotted `<svg>` or no slotted content, since there's
|
|
59
|
+
* nothing asynchronous to wait for. Set internally by Asset; a consumer
|
|
60
|
+
* influences it only by changing what's slotted, not by setting it
|
|
61
|
+
* directly.
|
|
62
|
+
*/
|
|
63
|
+
loadState: AssetLoadState;
|
|
64
|
+
private _appliedAriaHidden;
|
|
65
|
+
private _trackedImg;
|
|
66
|
+
private _preserveAspectRatioAppliedTo;
|
|
67
|
+
private _appliedAccessibleLabelTo;
|
|
68
|
+
protected update(changes: PropertyValues): void;
|
|
69
|
+
/**
|
|
70
|
+
* Warns when the default slot receives more than one child, or a child
|
|
71
|
+
* that isn't an `<img>` or `<svg>`. There is exactly one (default) slot,
|
|
72
|
+
* so its assigned elements are the host's own light DOM children.
|
|
73
|
+
*/
|
|
74
|
+
private validateSlottedContent;
|
|
75
|
+
/**
|
|
76
|
+
* Implements `decorative` and the `accessibleLabel` fallback, in priority
|
|
77
|
+
* order: `decorative` > the child's own name (self-healing a missing
|
|
78
|
+
* `role="img"` on a named `<svg>`) > `accessibleLabel` > warn.
|
|
79
|
+
*/
|
|
80
|
+
private resolveAccessibleName;
|
|
81
|
+
/**
|
|
82
|
+
* Whether `child` already has its own accessible name. The `<svg>` branch
|
|
83
|
+
* doesn't require `role="img"` — `resolveAccessibleName` self-heals a
|
|
84
|
+
* missing role separately.
|
|
85
|
+
*/
|
|
86
|
+
private hasOwnAccessibleName;
|
|
87
|
+
/**
|
|
88
|
+
* Applies `fit` to a slotted `<svg>` via `preserveAspectRatio`, without
|
|
89
|
+
* overwriting a consumer-set value or writing on every update.
|
|
90
|
+
*/
|
|
91
|
+
private applyFitToSvg;
|
|
92
|
+
/**
|
|
93
|
+
* Tracks `loadState` against the slotted `<img>`, re-wiring listeners only
|
|
94
|
+
* when the tracked element actually changes (a no-op on every other
|
|
95
|
+
* property update, since re-running this for the same `<img>` would
|
|
96
|
+
* incorrectly reset an already-resolved `loadState` back to `'loading'`).
|
|
97
|
+
*/
|
|
98
|
+
private updateLoadState;
|
|
99
|
+
private readonly handleImgLoad;
|
|
100
|
+
private readonly handleImgError;
|
|
101
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
|
|
2
|
+
import { ASSET_BACKGROUND_VALUES as t, ASSET_FIT_VALUES as n, ASSET_LOAD_STATE_VALUES as r, SWC_ASSET_ERROR_EVENT as i, SWC_ASSET_LOAD_EVENT as a } from "./Asset.types.js";
|
|
3
|
+
import { property as o } from "lit/decorators.js";
|
|
4
|
+
import { SpectrumElement as s } from "@adobe/spectrum-wc-core/element/index.js";
|
|
5
|
+
import { isDebug as c, validateEnum as l, warnIf as u } from "@adobe/spectrum-wc-core/utils/index.js";
|
|
6
|
+
//#region components/asset/Asset.base.ts
|
|
7
|
+
var d = "https://spectrum-web-components.adobe.com/?path=/docs/components-asset--docs", f = String.raw`(?:\d+\.?\d*|\.\d+)`, p = String.raw`${f}(?:\s*\/\s*${f})?`, m = RegExp(`^(?:auto|${p}|auto\\s+${p}|${p}\\s+auto)$`), h = {
|
|
8
|
+
cover: "xMidYMid slice",
|
|
9
|
+
contain: "xMidYMid meet"
|
|
10
|
+
};
|
|
11
|
+
function g(e) {
|
|
12
|
+
return e && (e === "square" ? "1/1" : e.replace(":", "/"));
|
|
13
|
+
}
|
|
14
|
+
var _ = class extends s {
|
|
15
|
+
constructor(...e) {
|
|
16
|
+
super(...e), this.fit = "cover", this.decorative = !1, this.background = "transparent", this.loadState = "loading", this._appliedAriaHidden = !1, this._trackedImg = void 0, this._preserveAspectRatioAppliedTo = null, this._appliedAccessibleLabelTo = null, this.handleImgLoad = () => {
|
|
17
|
+
this.loadState = "loaded", this.dispatchEvent(new CustomEvent(a, {
|
|
18
|
+
bubbles: !0,
|
|
19
|
+
composed: !0
|
|
20
|
+
}));
|
|
21
|
+
}, this.handleImgError = () => {
|
|
22
|
+
var e, t;
|
|
23
|
+
this.loadState = "error", this.dispatchEvent(new CustomEvent(i, {
|
|
24
|
+
bubbles: !0,
|
|
25
|
+
composed: !0,
|
|
26
|
+
detail: { src: (e = (t = this._trackedImg) == null ? void 0 : t.currentSrc) == null ? "" : e }
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
get aspectRatio() {
|
|
31
|
+
return this._aspectRatio;
|
|
32
|
+
}
|
|
33
|
+
set aspectRatio(e) {
|
|
34
|
+
let t = this._aspectRatio;
|
|
35
|
+
this._rawAspectRatio = e, this._aspectRatio = g(e), this.requestUpdate("aspectRatio", t);
|
|
36
|
+
}
|
|
37
|
+
update(e) {
|
|
38
|
+
e.has("fit") && l(this, {
|
|
39
|
+
prop: "fit",
|
|
40
|
+
value: this.fit,
|
|
41
|
+
valid: n,
|
|
42
|
+
url: d
|
|
43
|
+
}), e.has("background") && l(this, {
|
|
44
|
+
prop: "background",
|
|
45
|
+
value: this.background,
|
|
46
|
+
valid: t,
|
|
47
|
+
url: d
|
|
48
|
+
}), e.has("loadState") && l(this, {
|
|
49
|
+
prop: "load-state",
|
|
50
|
+
value: this.loadState,
|
|
51
|
+
valid: r,
|
|
52
|
+
url: d
|
|
53
|
+
}), (e.has("aspectRatio") || e.has("width") || e.has("height")) && (u(this, this.aspectRatio !== void 0 && !m.test(this.aspectRatio), `<${this.localName}> expects "aspect-ratio" to be a CSS <ratio> (e.g. "16/9"), the "square" keyword, or a ":"-separated ratio (e.g. "16:9"). Received "${this._rawAspectRatio}".`, d), u(this, this.aspectRatio !== void 0 && this.width !== void 0 && this.height !== void 0, `<${this.localName}> "aspect-ratio" has no effect when both "width" and "height" are set.`, d));
|
|
54
|
+
let i = Array.from(this.children);
|
|
55
|
+
c() && this.validateSlottedContent(i), this.resolveAccessibleName(i), this.applyFitToSvg(i), this.updateLoadState(i), super.update(e);
|
|
56
|
+
}
|
|
57
|
+
validateSlottedContent(e) {
|
|
58
|
+
u(this, e.length > 1, `<${this.localName}> only supports a single slotted <img> or <svg> element. Received ${e.length} children.`, d);
|
|
59
|
+
let [t] = e;
|
|
60
|
+
if (t) {
|
|
61
|
+
let e = t.tagName.toLowerCase();
|
|
62
|
+
u(this, e !== "img" && e !== "svg", `<${this.localName}> expects its slotted content to be an <img> or <svg> element. Received <${e}>.`, d);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
resolveAccessibleName(e) {
|
|
66
|
+
if (this.decorative) {
|
|
67
|
+
this.hasAttribute("aria-hidden") || (this._appliedAriaHidden = !0, this.setAttribute("aria-hidden", "true"));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this._appliedAriaHidden && (this.removeAttribute("aria-hidden"), this._appliedAriaHidden = !1);
|
|
71
|
+
let [t] = e, n = t == null ? void 0 : t.tagName.toLowerCase();
|
|
72
|
+
if (t && n !== "img" && n !== "svg") return;
|
|
73
|
+
let r = !!t && this._appliedAccessibleLabelTo === t, i = !!t && !r && this.hasOwnAccessibleName(t, n);
|
|
74
|
+
t && (i ? n === "svg" && !t.hasAttribute("role") && t.setAttribute("role", "img") : this.accessibleLabel ? (n === "img" ? t.alt = this.accessibleLabel : (t.setAttribute("role", "img"), t.setAttribute("aria-label", this.accessibleLabel)), this._appliedAccessibleLabelTo = t) : r && (n === "img" ? t.removeAttribute("alt") : (t.removeAttribute("role"), t.removeAttribute("aria-label")), this._appliedAccessibleLabelTo = null)), u(this, !i && !this.accessibleLabel, `<${this.localName}> requires an accessible name: set "alt" on the slotted <img> (or "aria-label"/"aria-labelledby"/a child <title> on the slotted <svg>), set "accessible-label" on <${this.localName}>, or set "decorative".`, d);
|
|
75
|
+
}
|
|
76
|
+
hasOwnAccessibleName(e, t) {
|
|
77
|
+
let n = e.hasAttribute("aria-label") || e.hasAttribute("aria-labelledby");
|
|
78
|
+
if (t === "img") return n || e.hasAttribute("alt");
|
|
79
|
+
let r = !!e.querySelector(":scope > title");
|
|
80
|
+
return n || r;
|
|
81
|
+
}
|
|
82
|
+
applyFitToSvg(e) {
|
|
83
|
+
var t;
|
|
84
|
+
let [n] = e;
|
|
85
|
+
if ((n == null ? void 0 : n.tagName.toLowerCase()) !== "svg") {
|
|
86
|
+
this._preserveAspectRatioAppliedTo = null;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
let r = this._preserveAspectRatioAppliedTo === n;
|
|
90
|
+
if (n.hasAttribute("preserveAspectRatio") && !r) return;
|
|
91
|
+
let i = (t = h[this.fit]) == null ? h.cover : t;
|
|
92
|
+
n.getAttribute("preserveAspectRatio") !== i && n.setAttribute("preserveAspectRatio", i), this._preserveAspectRatioAppliedTo = n;
|
|
93
|
+
}
|
|
94
|
+
updateLoadState(e) {
|
|
95
|
+
let [t] = e, n = (t == null ? void 0 : t.tagName.toLowerCase()) === "img" ? t : null;
|
|
96
|
+
if (n !== this._trackedImg) {
|
|
97
|
+
if (this._trackedImg && (this._trackedImg.removeEventListener("load", this.handleImgLoad), this._trackedImg.removeEventListener("error", this.handleImgError)), this._trackedImg = n, !n) {
|
|
98
|
+
this.loadState = "loaded";
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (this.loadState = "loading", n.addEventListener("load", this.handleImgLoad), n.addEventListener("error", this.handleImgError), n.complete && n.currentSrc) {
|
|
102
|
+
let e = n.naturalWidth > 0;
|
|
103
|
+
queueMicrotask(() => {
|
|
104
|
+
this._trackedImg === n && (e ? this.handleImgLoad() : this.handleImgError());
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
e([o({ attribute: "aspect-ratio" })], _.prototype, "aspectRatio", null), e([o({ type: String })], _.prototype, "width", void 0), e([o({ type: String })], _.prototype, "height", void 0), e([o({
|
|
111
|
+
type: String,
|
|
112
|
+
reflect: !0
|
|
113
|
+
})], _.prototype, "fit", void 0), e([o({
|
|
114
|
+
type: Boolean,
|
|
115
|
+
reflect: !0
|
|
116
|
+
})], _.prototype, "decorative", void 0), e([o({
|
|
117
|
+
type: String,
|
|
118
|
+
attribute: "accessible-label"
|
|
119
|
+
})], _.prototype, "accessibleLabel", void 0), e([o({
|
|
120
|
+
type: String,
|
|
121
|
+
reflect: !0
|
|
122
|
+
})], _.prototype, "background", void 0), e([o({
|
|
123
|
+
type: String,
|
|
124
|
+
reflect: !0,
|
|
125
|
+
attribute: "load-state"
|
|
126
|
+
})], _.prototype, "loadState", void 0);
|
|
127
|
+
//#endregion
|
|
128
|
+
export { _ as AssetBase };
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=Asset.base.js.map
|