@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,78 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { SlotPresenceController } from '../../controllers/slot-presence-controller/index.js';
|
|
3
|
+
import { SlotTextController } from '../../controllers/slot-text-controller/index.js';
|
|
4
|
+
import { SpectrumElement } from '../../element/index.js';
|
|
5
|
+
import { ButtonSize } from './Button.types.js';
|
|
6
|
+
declare const ButtonBase_base: typeof SpectrumElement & {
|
|
7
|
+
new (...args: any[]): import('../../mixins/index.js').SizedElementInterface;
|
|
8
|
+
prototype: import('../../mixins/index.js').SizedElementInterface;
|
|
9
|
+
} & import('../../mixins/index.js').SizedElementConstructor;
|
|
10
|
+
/**
|
|
11
|
+
* Abstract base class for all button-like components. Owns shared semantic
|
|
12
|
+
* concerns: interaction state, sizing, slot-derived icon/label state,
|
|
13
|
+
* accessible-name resolution, and host-to-internal-button attribute forwarding.
|
|
14
|
+
*
|
|
15
|
+
* Visual API specific to `sp-button` (`variant`, `fill-style`, `static-color`)
|
|
16
|
+
* is intentionally absent so that ActionButton, ClearButton, CloseButton,
|
|
17
|
+
* PickerButton, and InfieldButton can extend this base without inheriting
|
|
18
|
+
* the `swc-button` visual surface.
|
|
19
|
+
*
|
|
20
|
+
* @attribute {ElementSize} size - The size of the button.
|
|
21
|
+
*/
|
|
22
|
+
export declare abstract class ButtonBase extends ButtonBase_base {
|
|
23
|
+
static shadowRootOptions: ShadowRootInit;
|
|
24
|
+
/**
|
|
25
|
+
* The size of the button.
|
|
26
|
+
*
|
|
27
|
+
* @default m
|
|
28
|
+
*/
|
|
29
|
+
size: ButtonSize;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the button is disabled. Removes focusability and prevents
|
|
32
|
+
* interaction.
|
|
33
|
+
*/
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Accessible label forwarded to the internal `<button>` element as
|
|
37
|
+
* `aria-label`. Required for icon-only buttons, which have no visible text.
|
|
38
|
+
*/
|
|
39
|
+
accessibleLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Observes whether an icon is slotted into `[slot="icon"]`.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
protected slotPresence: SlotPresenceController;
|
|
46
|
+
/**
|
|
47
|
+
* Observes whether the default slot has a meaningful text label. The default
|
|
48
|
+
* slot must bind `@slotchange=${this.slotText.handleSlotChange}` for changes
|
|
49
|
+
* after the first render to be tracked.
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
protected slotText: SlotTextController;
|
|
54
|
+
protected get hasIcon(): boolean;
|
|
55
|
+
protected get hasLabel(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the set of attributes that should be forwarded to the internal
|
|
58
|
+
* semantic `<button>` element, if not otherwise directly managed.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
protected getForwardedButtonAttributes(): Record<string, string | boolean | undefined>;
|
|
63
|
+
connectedCallback(): void;
|
|
64
|
+
disconnectedCallback(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Suppresses click activation while the button is `disabled`, or externally
|
|
67
|
+
* marked `aria-disabled` (e.g. by a disabled parent `swc-action-group`,
|
|
68
|
+
* which uses `aria-disabled` instead of native `disabled` so children
|
|
69
|
+
* remain keyboard-reachable).
|
|
70
|
+
*
|
|
71
|
+
* Slotted icon content lives in the light DOM, so pointer clicks on icons
|
|
72
|
+
* bypass the disabled inner `<button>` and bubble on the host. The host
|
|
73
|
+
* listener (capture) and inner `@click` binding both call this handler.
|
|
74
|
+
*/
|
|
75
|
+
protected readonly handleClick: (event: Event) => void;
|
|
76
|
+
protected update(changedProperties: PropertyValues): void;
|
|
77
|
+
}
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
|
|
2
|
+
import { BUTTON_VALID_SIZES as t } from "./Button.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 { SizedMixin as i } from "@adobe/spectrum-wc-core/mixins/index.js";
|
|
6
|
+
import { warnIf as a } from "@adobe/spectrum-wc-core/utils/index.js";
|
|
7
|
+
import { SlotPresenceController as o } from "@adobe/spectrum-wc-core/controllers/slot-presence-controller/index.js";
|
|
8
|
+
import { SlotTextController as s } from "@adobe/spectrum-wc-core/controllers/slot-text-controller/index.js";
|
|
9
|
+
//#region components/button/Button.base.ts
|
|
10
|
+
var c, l = class extends i(r, { validSizes: t }) {
|
|
11
|
+
constructor(...e) {
|
|
12
|
+
super(...e), this.disabled = !1, this.slotPresence = new o(this, "[slot=\"icon\"]"), this.slotText = new s(this), this.handleClick = (e) => {
|
|
13
|
+
(this.disabled || this.getAttribute("aria-disabled") === "true") && (e.preventDefault(), e.stopImmediatePropagation());
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
get hasIcon() {
|
|
17
|
+
return this.slotPresence.isPresent;
|
|
18
|
+
}
|
|
19
|
+
get hasLabel() {
|
|
20
|
+
return this.slotText.hasContent;
|
|
21
|
+
}
|
|
22
|
+
getForwardedButtonAttributes() {
|
|
23
|
+
return { disabled: this.disabled };
|
|
24
|
+
}
|
|
25
|
+
connectedCallback() {
|
|
26
|
+
super.connectedCallback(), this.addEventListener("click", this.handleClick, !0);
|
|
27
|
+
}
|
|
28
|
+
disconnectedCallback() {
|
|
29
|
+
this.removeEventListener("click", this.handleClick, !0), super.disconnectedCallback();
|
|
30
|
+
}
|
|
31
|
+
update(e) {
|
|
32
|
+
super.update(e), a(this, this.hasIcon && !this.hasLabel && !this.accessibleLabel, `<${this.localName}> with an icon and no label must have an "accessible-label" attribute to be accessible.`, "https://spectrum-web-components.adobe.com/?path=/docs/components-button--docs", {
|
|
33
|
+
type: "accessibility",
|
|
34
|
+
issues: ["accessible-label"]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
c = l, c.shadowRootOptions = {
|
|
39
|
+
...r.shadowRootOptions,
|
|
40
|
+
delegatesFocus: !0
|
|
41
|
+
}, e([n({
|
|
42
|
+
type: Boolean,
|
|
43
|
+
reflect: !0
|
|
44
|
+
})], l.prototype, "disabled", void 0), e([n({
|
|
45
|
+
type: String,
|
|
46
|
+
attribute: "accessible-label"
|
|
47
|
+
})], l.prototype, "accessibleLabel", void 0);
|
|
48
|
+
//#endregion
|
|
49
|
+
export { l as ButtonBase };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=Button.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.base.js","names":[],"sources":["../../../components/button/Button.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 } from 'lit/decorators.js';\n\nimport { SlotPresenceController } from '@adobe/spectrum-wc-core/controllers/slot-presence-controller/index.js';\nimport { SlotTextController } from '@adobe/spectrum-wc-core/controllers/slot-text-controller/index.js';\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { SizedMixin } from '@adobe/spectrum-wc-core/mixins/index.js';\nimport { warnIf } from '@adobe/spectrum-wc-core/utils/index.js';\n\nimport { BUTTON_VALID_SIZES, type ButtonSize } from './Button.types.js';\n\n/**\n * Abstract base class for all button-like components. Owns shared semantic\n * concerns: interaction state, sizing, slot-derived icon/label state,\n * accessible-name resolution, and host-to-internal-button attribute forwarding.\n *\n * Visual API specific to `sp-button` (`variant`, `fill-style`, `static-color`)\n * is intentionally absent so that ActionButton, ClearButton, CloseButton,\n * PickerButton, and InfieldButton can extend this base without inheriting\n * the `swc-button` visual surface.\n *\n * @attribute {ElementSize} size - The size of the button.\n */\nexport abstract class ButtonBase extends SizedMixin(SpectrumElement, {\n validSizes: BUTTON_VALID_SIZES,\n}) {\n static override shadowRootOptions: ShadowRootInit = {\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * The size of the button.\n *\n * @default m\n */\n declare public size: ButtonSize;\n\n /**\n * Whether the button is disabled. Removes focusability and prevents\n * interaction.\n */\n @property({ type: Boolean, reflect: true })\n public disabled: boolean = false;\n\n /**\n * Accessible label forwarded to the internal `<button>` element as\n * `aria-label`. Required for icon-only buttons, which have no visible text.\n */\n @property({ type: String, attribute: 'accessible-label' })\n public accessibleLabel?: string;\n\n // ──────────────────────\n // CONTROLLERS\n // ──────────────────────\n\n /**\n * Observes whether an icon is slotted into `[slot=\"icon\"]`.\n *\n * @internal\n */\n protected slotPresence = new SlotPresenceController(this, '[slot=\"icon\"]');\n\n /**\n * Observes whether the default slot has a meaningful text label. The default\n * slot must bind `@slotchange=${this.slotText.handleSlotChange}` for changes\n * after the first render to be tracked.\n *\n * @internal\n */\n protected slotText = new SlotTextController(this);\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected get hasIcon(): boolean {\n return this.slotPresence.isPresent;\n }\n\n protected get hasLabel(): boolean {\n return this.slotText.hasContent;\n }\n\n /**\n * Returns the set of attributes that should be forwarded to the internal\n * semantic `<button>` element, if not otherwise directly managed.\n *\n * @internal\n */\n protected getForwardedButtonAttributes(): Record<\n string,\n string | boolean | undefined\n > {\n return {\n disabled: this.disabled,\n };\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n // Capture phase so slotted light-DOM clicks are suppressed before host\n // listeners (e.g. Storybook actions) run.\n this.addEventListener('click', this.handleClick, true);\n }\n\n public override disconnectedCallback(): void {\n this.removeEventListener('click', this.handleClick, true);\n super.disconnectedCallback();\n }\n\n /**\n * Suppresses click activation while the button is `disabled`, or externally\n * marked `aria-disabled` (e.g. by a disabled parent `swc-action-group`,\n * which uses `aria-disabled` instead of native `disabled` so children\n * remain keyboard-reachable).\n *\n * Slotted icon content lives in the light DOM, so pointer clicks on icons\n * bypass the disabled inner `<button>` and bubble on the host. The host\n * listener (capture) and inner `@click` binding both call this handler.\n */\n protected readonly handleClick = (event: Event): void => {\n if (this.disabled || this.getAttribute('aria-disabled') === 'true') {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n };\n\n protected override update(changedProperties: PropertyValues): void {\n super.update(changedProperties);\n warnIf(\n this,\n this.hasIcon && !this.hasLabel && !this.accessibleLabel,\n `<${this.localName}> with an icon and no label must have an \"accessible-label\" attribute to be accessible.`,\n 'https://spectrum-web-components.adobe.com/?path=/docs/components-button--docs',\n { type: 'accessibility', issues: ['accessible-label'] }\n );\n }\n}\n"],"mappings":";;;;;;;;;OAmCsB,IAAtB,cAAyC,EAAW,GAAiB,EACnE,YAAY,GACb,CAAC,CAAC;;+BAsB0B,wBAkBF,IAAI,EAAuB,MAAM,kBAAgB,kBASrD,IAAI,EAAmB,KAAK,sBAmDf,MAAuB;AACvD,IAAI,KAAK,YAAY,KAAK,aAAa,gBAAgB,KAAK,YAC1D,EAAM,gBAAgB,EACtB,EAAM,0BAA0B;;;CAhDpC,IAAc,UAAmB;AAC/B,SAAO,KAAK,aAAa;;CAG3B,IAAc,WAAoB;AAChC,SAAO,KAAK,SAAS;;CASvB,+BAGE;AACA,SAAO,EACL,UAAU,KAAK,UAChB;;CAGH,oBAA0C;AAIxC,EAHA,MAAM,mBAAmB,EAGzB,KAAK,iBAAiB,SAAS,KAAK,aAAa,GAAK;;CAGxD,uBAA6C;AAE3C,EADA,KAAK,oBAAoB,SAAS,KAAK,aAAa,GAAK,EACzD,MAAM,sBAAsB;;CAoB9B,OAA0B,GAAyC;AAEjE,EADA,MAAM,OAAO,EAAkB,EAC/B,EACE,MACA,KAAK,WAAW,CAAC,KAAK,YAAY,CAAC,KAAK,iBACxC,IAAI,KAAK,UAAU,0FACnB,iFACA;GAAE,MAAM;GAAiB,QAAQ,CAAC,mBAAmB;GAAE,CACxD;;;6BAlHiD;CAClD,GAAG,EAAgB;CACnB,gBAAgB;CACjB,KAiBA,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAO1C,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAoB,CAAC,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 BUTTON_VALID_SIZES: readonly ["s", "m", "l", "xl"];
|
|
13
|
+
export declare const BUTTON_VARIANTS: readonly ["primary", "secondary", "accent", "negative"];
|
|
14
|
+
export declare const BUTTON_FILL_STYLES: readonly ["fill", "outline"];
|
|
15
|
+
export declare const BUTTON_STATIC_COLORS: readonly ["white", "black"];
|
|
16
|
+
export type ButtonSize = (typeof BUTTON_VALID_SIZES)[number];
|
|
17
|
+
export type ButtonVariant = (typeof BUTTON_VARIANTS)[number];
|
|
18
|
+
export type ButtonFillStyle = (typeof BUTTON_FILL_STYLES)[number];
|
|
19
|
+
export type ButtonStaticColor = (typeof BUTTON_STATIC_COLORS)[number];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region components/button/Button.types.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"s",
|
|
4
|
+
"m",
|
|
5
|
+
"l",
|
|
6
|
+
"xl"
|
|
7
|
+
], t = [
|
|
8
|
+
"primary",
|
|
9
|
+
"secondary",
|
|
10
|
+
"accent",
|
|
11
|
+
"negative"
|
|
12
|
+
], n = ["fill", "outline"], r = ["white", "black"];
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as BUTTON_FILL_STYLES, r as BUTTON_STATIC_COLORS, e as BUTTON_VALID_SIZES, t as BUTTON_VARIANTS };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=Button.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.types.js","names":[],"sources":["../../../components/button/Button.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 BUTTON_VALID_SIZES = [\n 's',\n 'm',\n 'l',\n 'xl',\n] as const satisfies readonly ElementSize[];\n\nexport const BUTTON_VARIANTS = [\n 'primary',\n 'secondary',\n 'accent',\n 'negative',\n] as const;\n\nexport const BUTTON_FILL_STYLES = ['fill', 'outline'] as const;\n\nexport const BUTTON_STATIC_COLORS = ['white', 'black'] as const;\n\n// ──────────────────\n// TYPES\n// ──────────────────\n\nexport type ButtonSize = (typeof BUTTON_VALID_SIZES)[number];\nexport type ButtonVariant = (typeof BUTTON_VARIANTS)[number];\nexport type ButtonFillStyle = (typeof BUTTON_FILL_STYLES)[number];\nexport type ButtonStaticColor = (typeof BUTTON_STATIC_COLORS)[number];\n"],"mappings":";AAkBA,IAAa,IAAqB;CAChC;CACA;CACA;CACA;CACD,EAEY,IAAkB;CAC7B;CACA;CACA;CACA;CACD,EAEY,IAAqB,CAAC,QAAQ,UAAU,EAExC,IAAuB,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 './Button.base.js';
|
|
13
|
+
export * from './Button.types.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BUTTON_FILL_STYLES as e, BUTTON_STATIC_COLORS as t, BUTTON_VALID_SIZES as n, BUTTON_VARIANTS as r } from "./Button.types.js";
|
|
2
|
+
import { ButtonBase as i } from "./Button.base.js";
|
|
3
|
+
export { e as BUTTON_FILL_STYLES, t as BUTTON_STATIC_COLORS, n as BUTTON_VALID_SIZES, r as BUTTON_VARIANTS, i as ButtonBase };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { SpectrumElement } from '../../element/index.js';
|
|
3
|
+
import { ButtonGroupAlignment, ButtonGroupOrientation, ButtonGroupSize } from './ButtonGroup.types.js';
|
|
4
|
+
declare const ButtonGroupBase_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
|
+
* A button group clusters related actions together, providing consistent
|
|
10
|
+
* spacing, sizing, and orientation. The host exposes `role="group"` and
|
|
11
|
+
* propagates `size` and `disabled` to slotted button children.
|
|
12
|
+
*
|
|
13
|
+
* This base class owns shared logic and accessibility semantics. Rendering
|
|
14
|
+
* and styling live in the concrete SWC subclass.
|
|
15
|
+
*
|
|
16
|
+
* @slot - One or more `swc-button` elements.
|
|
17
|
+
*
|
|
18
|
+
* @attribute {ElementSize} size - The size of the button group and its children.
|
|
19
|
+
*/
|
|
20
|
+
export declare abstract class ButtonGroupBase extends ButtonGroupBase_base {
|
|
21
|
+
/**
|
|
22
|
+
* The size of the button group. Propagated to all slotted button children.
|
|
23
|
+
*
|
|
24
|
+
* @default m
|
|
25
|
+
*/
|
|
26
|
+
size: ButtonGroupSize;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*
|
|
30
|
+
* Valid orientation values for validation.
|
|
31
|
+
*/
|
|
32
|
+
static readonly ORIENTATIONS: readonly string[];
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*
|
|
36
|
+
* Valid alignment values for validation.
|
|
37
|
+
*/
|
|
38
|
+
static readonly ALIGNMENTS: readonly string[];
|
|
39
|
+
/**
|
|
40
|
+
* The layout direction of the button group.
|
|
41
|
+
*
|
|
42
|
+
* Note: this property does NOT set `aria-orientation` on the host because
|
|
43
|
+
* `aria-orientation` is only meaningful for roles that manage arrow-key
|
|
44
|
+
* navigation (e.g. `toolbar`, `listbox`). Since button-group uses
|
|
45
|
+
* sequential Tab navigation (not roving tabindex), the attribute would
|
|
46
|
+
* be invalid.
|
|
47
|
+
*/
|
|
48
|
+
orientation: ButtonGroupOrientation;
|
|
49
|
+
/**
|
|
50
|
+
* Whether all buttons in the group are disabled. When `true`, forces
|
|
51
|
+
* every slotted button child to `disabled`. When `false`, children
|
|
52
|
+
* retain their individual disabled state — a button slotted with
|
|
53
|
+
* `disabled` remains disabled even when the group is enabled.
|
|
54
|
+
*/
|
|
55
|
+
disabled: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The alignment of buttons within the group along the main axis.
|
|
58
|
+
*/
|
|
59
|
+
align: ButtonGroupAlignment;
|
|
60
|
+
private buttons;
|
|
61
|
+
/**
|
|
62
|
+
* Tracks buttons that were individually disabled before the group
|
|
63
|
+
* forced all children disabled. Used to restore their state when
|
|
64
|
+
* the group becomes enabled again.
|
|
65
|
+
*/
|
|
66
|
+
private individuallyDisabled;
|
|
67
|
+
private readonly _sizePropagation;
|
|
68
|
+
protected firstUpdated(changed: PropertyValues<this>): void;
|
|
69
|
+
protected update(changedProperties: PropertyValues): void;
|
|
70
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
71
|
+
/**
|
|
72
|
+
* Handles slotchange events from the default slot. Ensures newly slotted
|
|
73
|
+
* children receive the current size and disabled state.
|
|
74
|
+
*/
|
|
75
|
+
protected handleSlotchange(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Propagates disabled state to slotted button children.
|
|
78
|
+
*
|
|
79
|
+
* Uses a one-directional model: when the group is disabled, all children
|
|
80
|
+
* are forced disabled (tracking which were already individually disabled).
|
|
81
|
+
* When the group is enabled, children are restored to their individual
|
|
82
|
+
* disabled state — a button slotted with `disabled` remains disabled.
|
|
83
|
+
*
|
|
84
|
+
* On slotchange when the group is enabled, buttons are not touched so
|
|
85
|
+
* their declarative `disabled` attribute is preserved.
|
|
86
|
+
*/
|
|
87
|
+
private propagateDisabledToChildren;
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
|
|
2
|
+
import { SlotAttributePropagationController as t } from "../../controllers/slot-attribute-propagation-controller/src/slot-attribute-propagation-controller.js";
|
|
3
|
+
import { BUTTON_GROUP_ALIGNMENTS as n, BUTTON_GROUP_ORIENTATIONS as r, BUTTON_GROUP_SIZES as i } from "./ButtonGroup.types.js";
|
|
4
|
+
import { property as a, queryAssignedElements as o } from "lit/decorators.js";
|
|
5
|
+
import { SpectrumElement as s } from "@adobe/spectrum-wc-core/element/index.js";
|
|
6
|
+
import { SizedMixin as c } from "@adobe/spectrum-wc-core/mixins/index.js";
|
|
7
|
+
import { validateEnum as l } from "@adobe/spectrum-wc-core/utils/index.js";
|
|
8
|
+
//#region components/button-group/ButtonGroup.base.ts
|
|
9
|
+
var u, d = class extends c(s, { validSizes: i }) {
|
|
10
|
+
constructor(...e) {
|
|
11
|
+
super(...e), this.orientation = "horizontal", this.disabled = !1, this.align = "start", this.individuallyDisabled = /* @__PURE__ */ new WeakSet(), this._sizePropagation = new t(this, {
|
|
12
|
+
attribute: "size",
|
|
13
|
+
getValue: () => this.size
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
firstUpdated(e) {
|
|
17
|
+
super.firstUpdated(e), this.setAttribute("role", "group");
|
|
18
|
+
}
|
|
19
|
+
update(e) {
|
|
20
|
+
let t = this.constructor;
|
|
21
|
+
l(this, {
|
|
22
|
+
prop: "orientation",
|
|
23
|
+
value: this.orientation,
|
|
24
|
+
valid: t.ORIENTATIONS,
|
|
25
|
+
url: "https://spectrum-web-components.adobe.com/?path=/docs/components-button-group--docs"
|
|
26
|
+
}), l(this, {
|
|
27
|
+
prop: "align",
|
|
28
|
+
value: this.align,
|
|
29
|
+
valid: t.ALIGNMENTS,
|
|
30
|
+
url: "https://spectrum-web-components.adobe.com/?path=/docs/components-button-group--docs"
|
|
31
|
+
}), super.update(e);
|
|
32
|
+
}
|
|
33
|
+
updated(e) {
|
|
34
|
+
if (super.updated(e), e.has("disabled")) {
|
|
35
|
+
let t = e.get("disabled");
|
|
36
|
+
(this.disabled || t) && this.propagateDisabledToChildren();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
handleSlotchange() {
|
|
40
|
+
this._sizePropagation.propagate(), this.disabled && this.propagateDisabledToChildren();
|
|
41
|
+
}
|
|
42
|
+
propagateDisabledToChildren() {
|
|
43
|
+
for (let e of this.buttons) this.disabled ? (e.disabled && this.individuallyDisabled.add(e), e.disabled = !0) : e.disabled = this.individuallyDisabled.has(e);
|
|
44
|
+
this.disabled || (this.individuallyDisabled = /* @__PURE__ */ new WeakSet());
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
u = d, u.ORIENTATIONS = r, u.ALIGNMENTS = n, e([a({
|
|
48
|
+
type: String,
|
|
49
|
+
reflect: !0
|
|
50
|
+
})], d.prototype, "orientation", void 0), e([a({
|
|
51
|
+
type: Boolean,
|
|
52
|
+
reflect: !0
|
|
53
|
+
})], d.prototype, "disabled", void 0), e([a({
|
|
54
|
+
type: String,
|
|
55
|
+
reflect: !0
|
|
56
|
+
})], d.prototype, "align", void 0), e([o({ flatten: !0 })], d.prototype, "buttons", void 0);
|
|
57
|
+
//#endregion
|
|
58
|
+
export { d as ButtonGroupBase };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=ButtonGroup.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGroup.base.js","names":[],"sources":["../../../components/button-group/ButtonGroup.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 type { ButtonBase } from '@adobe/spectrum-wc-core/components/button';\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { SizedMixin } from '@adobe/spectrum-wc-core/mixins/index.js';\nimport { validateEnum } from '@adobe/spectrum-wc-core/utils/index.js';\n\nimport { SlotAttributePropagationController } from '../../controllers/slot-attribute-propagation-controller/index.js';\nimport {\n BUTTON_GROUP_ALIGNMENTS,\n BUTTON_GROUP_ORIENTATIONS,\n BUTTON_GROUP_SIZES,\n type ButtonGroupAlignment,\n type ButtonGroupOrientation,\n type ButtonGroupSize,\n} from './ButtonGroup.types.js';\n\n/**\n * A button group clusters related actions together, providing consistent\n * spacing, sizing, and orientation. The host exposes `role=\"group\"` and\n * propagates `size` and `disabled` to slotted button children.\n *\n * This base class owns shared logic and accessibility semantics. Rendering\n * and styling live in the concrete SWC subclass.\n *\n * @slot - One or more `swc-button` elements.\n *\n * @attribute {ElementSize} size - The size of the button group and its children.\n */\nexport abstract class ButtonGroupBase extends SizedMixin(SpectrumElement, {\n validSizes: BUTTON_GROUP_SIZES,\n}) {\n /**\n * The size of the button group. Propagated to all slotted button children.\n *\n * @default m\n */\n declare public size: ButtonGroupSize;\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * @internal\n *\n * Valid orientation values for validation.\n */\n static readonly ORIENTATIONS: readonly string[] = BUTTON_GROUP_ORIENTATIONS;\n\n /**\n * @internal\n *\n * Valid alignment values for validation.\n */\n static readonly ALIGNMENTS: readonly string[] = BUTTON_GROUP_ALIGNMENTS;\n\n /**\n * The layout direction of the button group.\n *\n * Note: this property does NOT set `aria-orientation` on the host because\n * `aria-orientation` is only meaningful for roles that manage arrow-key\n * navigation (e.g. `toolbar`, `listbox`). Since button-group uses\n * sequential Tab navigation (not roving tabindex), the attribute would\n * be invalid.\n */\n @property({ type: String, reflect: true })\n public orientation: ButtonGroupOrientation = 'horizontal';\n\n /**\n * Whether all buttons in the group are disabled. When `true`, forces\n * every slotted button child to `disabled`. When `false`, children\n * retain their individual disabled state — a button slotted with\n * `disabled` remains disabled even when the group is enabled.\n */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n /**\n * The alignment of buttons within the group along the main axis.\n */\n @property({ type: String, reflect: true })\n public align: ButtonGroupAlignment = 'start';\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n @queryAssignedElements({ flatten: true })\n private buttons!: ButtonBase[];\n\n /**\n * Tracks buttons that were individually disabled before the group\n * forced all children disabled. Used to restore their state when\n * the group becomes enabled again.\n */\n private individuallyDisabled = new WeakSet<ButtonBase>();\n\n private readonly _sizePropagation = new SlotAttributePropagationController(\n this,\n {\n attribute: 'size',\n getValue: () => this.size,\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 update(changedProperties: PropertyValues): void {\n const constructor = this.constructor as typeof ButtonGroupBase;\n validateEnum(this, {\n prop: 'orientation',\n value: this.orientation,\n valid: constructor.ORIENTATIONS,\n url: 'https://spectrum-web-components.adobe.com/?path=/docs/components-button-group--docs',\n });\n validateEnum(this, {\n prop: 'align',\n value: this.align,\n valid: constructor.ALIGNMENTS,\n url: 'https://spectrum-web-components.adobe.com/?path=/docs/components-button-group--docs',\n });\n super.update(changedProperties);\n }\n\n protected override updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n\n if (changed.has('disabled')) {\n const wasDisabled = changed.get('disabled');\n if (this.disabled || wasDisabled) {\n this.propagateDisabledToChildren();\n }\n }\n }\n\n /**\n * Handles slotchange events from the default slot. Ensures newly slotted\n * children receive the current size and disabled state.\n */\n protected handleSlotchange(): void {\n this._sizePropagation.propagate();\n\n if (this.disabled) {\n this.propagateDisabledToChildren();\n }\n }\n\n /**\n * Propagates disabled state to slotted button children.\n *\n * Uses a one-directional model: when the group is disabled, all children\n * are forced disabled (tracking which were already individually disabled).\n * When the group is enabled, children are restored to their individual\n * disabled state — a button slotted with `disabled` remains disabled.\n *\n * On slotchange when the group is enabled, buttons are not touched so\n * their declarative `disabled` attribute is preserved.\n */\n private propagateDisabledToChildren(): void {\n for (const button of this.buttons) {\n if (this.disabled) {\n if (button.disabled) {\n this.individuallyDisabled.add(button);\n }\n button.disabled = true;\n } else {\n button.disabled = this.individuallyDisabled.has(button);\n }\n }\n\n if (!this.disabled) {\n this.individuallyDisabled = new WeakSet();\n }\n }\n}\n"],"mappings":";;;;;;;;OA0CsB,IAAtB,cAA8C,EAAW,GAAiB,EACxE,YAAY,GACb,CAAC,CAAC;;kCAoC4C,8BAS3B,iBAMmB,qDAcN,IAAI,SAAqB,0BAEpB,IAAI,EACtC,MACA;GACE,WAAW;GACX,gBAAgB,KAAK;GACtB,CACF;;CAED,aAAgC,GAAqC;AAEnE,EADA,MAAM,aAAa,EAAQ,EAC3B,KAAK,aAAa,QAAQ,QAAQ;;CAGpC,OAA0B,GAAyC;EACjE,IAAM,IAAc,KAAK;AAazB,EAZA,EAAa,MAAM;GACjB,MAAM;GACN,OAAO,KAAK;GACZ,OAAO,EAAY;GACnB,KAAK;GACN,CAAC,EACF,EAAa,MAAM;GACjB,MAAM;GACN,OAAO,KAAK;GACZ,OAAO,EAAY;GACnB,KAAK;GACN,CAAC,EACF,MAAM,OAAO,EAAkB;;CAGjC,QAA2B,GAAqC;AAG9D,MAFA,MAAM,QAAQ,EAAQ,EAElB,EAAQ,IAAI,WAAW,EAAE;GAC3B,IAAM,IAAc,EAAQ,IAAI,WAAW;AAC3C,IAAI,KAAK,YAAY,MACnB,KAAK,6BAA6B;;;CASxC,mBAAmC;AAGjC,EAFA,KAAK,iBAAiB,WAAW,EAE7B,KAAK,YACP,KAAK,6BAA6B;;CAetC,8BAA4C;AAC1C,OAAK,IAAM,KAAU,KAAK,QACxB,CAAI,KAAK,YACH,EAAO,YACT,KAAK,qBAAqB,IAAI,EAAO,EAEvC,EAAO,WAAW,MAElB,EAAO,WAAW,KAAK,qBAAqB,IAAI,EAAO;AAI3D,EAAK,KAAK,aACR,KAAK,uCAAuB,IAAI,SAAS;;;wBA/HK,kBAOF,MAW/C,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KASzC,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAM1C,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAOzC,EAAsB,EAAE,SAAS,IAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,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 BUTTON_GROUP_SIZES: readonly ["s", "m", "l", "xl"];
|
|
13
|
+
export declare const BUTTON_GROUP_ORIENTATIONS: readonly ["horizontal", "vertical"];
|
|
14
|
+
export declare const BUTTON_GROUP_ALIGNMENTS: readonly ["start", "center", "end"];
|
|
15
|
+
export type ButtonGroupSize = (typeof BUTTON_GROUP_SIZES)[number];
|
|
16
|
+
export type ButtonGroupOrientation = (typeof BUTTON_GROUP_ORIENTATIONS)[number];
|
|
17
|
+
export type ButtonGroupAlignment = (typeof BUTTON_GROUP_ALIGNMENTS)[number];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region components/button-group/ButtonGroup.types.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"s",
|
|
4
|
+
"m",
|
|
5
|
+
"l",
|
|
6
|
+
"xl"
|
|
7
|
+
], t = ["horizontal", "vertical"], n = [
|
|
8
|
+
"start",
|
|
9
|
+
"center",
|
|
10
|
+
"end"
|
|
11
|
+
];
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as BUTTON_GROUP_ALIGNMENTS, t as BUTTON_GROUP_ORIENTATIONS, e as BUTTON_GROUP_SIZES };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=ButtonGroup.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGroup.types.js","names":[],"sources":["../../../components/button-group/ButtonGroup.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 BUTTON_GROUP_SIZES = [\n 's',\n 'm',\n 'l',\n 'xl',\n] as const satisfies readonly ElementSize[];\n\nexport const BUTTON_GROUP_ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\nexport const BUTTON_GROUP_ALIGNMENTS = ['start', 'center', 'end'] as const;\n\n// ──────────────────\n// TYPES\n// ──────────────────\n\nexport type ButtonGroupSize = (typeof BUTTON_GROUP_SIZES)[number];\nexport type ButtonGroupOrientation = (typeof BUTTON_GROUP_ORIENTATIONS)[number];\nexport type ButtonGroupAlignment = (typeof BUTTON_GROUP_ALIGNMENTS)[number];\n"],"mappings":";AAkBA,IAAa,IAAqB;CAChC;CACA;CACA;CACA;CACD,EAEY,IAA4B,CAAC,cAAc,WAAW,EAEtD,IAA0B;CAAC;CAAS;CAAU;CAAM"}
|
|
@@ -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 './ButtonGroup.base.js';
|
|
13
|
+
export * from './ButtonGroup.types.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BUTTON_GROUP_ALIGNMENTS as e, BUTTON_GROUP_ORIENTATIONS as t, BUTTON_GROUP_SIZES as n } from "./ButtonGroup.types.js";
|
|
2
|
+
import { ButtonGroupBase as r } from "./ButtonGroup.base.js";
|
|
3
|
+
export { e as BUTTON_GROUP_ALIGNMENTS, t as BUTTON_GROUP_ORIENTATIONS, n as BUTTON_GROUP_SIZES, r as ButtonGroupBase };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { SpectrumElement } from '../../element/index.js';
|
|
3
|
+
import { SlotTextController } from '../../controllers/slot-text-controller/index.js';
|
|
4
|
+
import { CardDensity, CardVariant } from './Card.types.js';
|
|
5
|
+
declare const CardBase_base: typeof SpectrumElement & {
|
|
6
|
+
new (...args: any[]): import('../../mixins/index.js').SizedElementInterface;
|
|
7
|
+
prototype: import('../../mixins/index.js').SizedElementInterface;
|
|
8
|
+
} & import('../../mixins/index.js').SizedElementConstructor;
|
|
9
|
+
/**
|
|
10
|
+
* Abstract base class for all card-family components. Owns the semantics
|
|
11
|
+
* shared across every card type: sizing, visual variant, and density.
|
|
12
|
+
*
|
|
13
|
+
* @attribute {ElementSize} size - The size of the card.
|
|
14
|
+
*
|
|
15
|
+
* @fires swc-card-click - Dispatched when a `selectable` card is activated (click, Enter, or Space).
|
|
16
|
+
*
|
|
17
|
+
* @slot preview - Primary preview content
|
|
18
|
+
* @slot title - Card title
|
|
19
|
+
* @slot actions - Optional action controls
|
|
20
|
+
* @slot description - Supporting description text
|
|
21
|
+
* @slot footer - Optional footer content
|
|
22
|
+
* @slot - Additional body content
|
|
23
|
+
*
|
|
24
|
+
* @cssprop --swc-card-base-max-inline-size - Maximum inline size of the card. Defaults to 280px, overridden per size.
|
|
25
|
+
* @cssprop --swc-card-base-border-radius - Corner radius of the card. Defaults to the extra-large corner-radius token, overridden per size.
|
|
26
|
+
* @cssprop --swc-card-base-box-shadow - Box shadow (elevation) of the card. Defaults to the emphasized drop-shadow token; overridden by the tertiary variant, selectable focus, and title-as-link/selectable hover.
|
|
27
|
+
* @cssprop --swc-card-base-background-color - Background color of the card. Defaults to the layer-2 background token; overridden by the secondary, tertiary, and quiet variants.
|
|
28
|
+
* @cssprop --swc-card-base-preview-aspect-ratio - Aspect ratio of the preview slot. Defaults to 3/2.
|
|
29
|
+
* @cssprop --swc-card-base-title-font-size - Font size of the title slot. Defaults to the medium font-size token, overridden per size.
|
|
30
|
+
* @cssprop --swc-card-base-title-line-height - Line height of the title slot. Defaults to the medium line-height token, overridden per size.
|
|
31
|
+
* @cssprop --swc-card-base-description-font-size - Font size of the description slot and default slot content. Defaults to a smaller font-size token, overridden per size.
|
|
32
|
+
* @cssprop --swc-card-base-action-component-height - Height used to vertically balance slotted actions content. Defaults to the smallest component-height token, overridden per size.
|
|
33
|
+
* @cssprop --swc-card-base-content-header-gap - Column gap between the title and actions slots. Defaults to the medium base-gap token, overridden per size.
|
|
34
|
+
* @cssprop --swc-card-base-content-padding - Padding of the content region. Defaults to the medium container-padding token; overridden by density.
|
|
35
|
+
* @cssprop --swc-card-base-content-padding-regular - Content padding used at the default (regular) density, per size.
|
|
36
|
+
* @cssprop --swc-card-base-content-padding-compact - Content padding used at compact density, per size.
|
|
37
|
+
* @cssprop --swc-card-base-content-padding-spacious - Content padding used at spacious density, per size.
|
|
38
|
+
*/
|
|
39
|
+
export declare abstract class CardBase extends CardBase_base {
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
static readonly VARIANTS: readonly CardVariant[];
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
static readonly DENSITIES: readonly CardDensity[];
|
|
48
|
+
/**
|
|
49
|
+
* The visual variant of the card.
|
|
50
|
+
*
|
|
51
|
+
* @default primary
|
|
52
|
+
*/
|
|
53
|
+
variant: CardVariant;
|
|
54
|
+
/**
|
|
55
|
+
* The density of the card, controlling internal spacing and gaps.
|
|
56
|
+
*
|
|
57
|
+
* @default regular
|
|
58
|
+
*/
|
|
59
|
+
density: CardDensity;
|
|
60
|
+
/**
|
|
61
|
+
* Indicates the consumer has wrapped their `title` slot content in a real
|
|
62
|
+
* link. Extends that link's hit area to cover the card surface while
|
|
63
|
+
* leaving navigation entirely consumer-owned; Card accepts no `href`.
|
|
64
|
+
*/
|
|
65
|
+
titleAsLink: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Makes the card focusable and captures surface clicks (excluding nested
|
|
68
|
+
* interactive targets) to dispatch a `swc-card-click` event, independent
|
|
69
|
+
* of `titleAsLink`.
|
|
70
|
+
*
|
|
71
|
+
* @todo No ARIA role is set yet; deferred until a future `CardView`
|
|
72
|
+
* selection model determines the appropriate role.
|
|
73
|
+
*/
|
|
74
|
+
selectable: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Keeps a slotted action control's `size` one step smaller than the
|
|
77
|
+
* card's own `size`.
|
|
78
|
+
*/
|
|
79
|
+
private readonly _sizePropagation;
|
|
80
|
+
/**
|
|
81
|
+
* Observes whether the default slot has meaningful content. Each concrete
|
|
82
|
+
* card's `render()` must bind `@slotchange=${this.slotText.handleSlotChange}`
|
|
83
|
+
* on the default slot (via `renderCardTemplate`'s `onDefaultSlotChange`) for
|
|
84
|
+
* changes after the first render to be tracked.
|
|
85
|
+
*
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
protected slotText: SlotTextController;
|
|
89
|
+
/**
|
|
90
|
+
* Whether the default slot has meaningful content. Consumed by each concrete
|
|
91
|
+
* card's `render()` (through `renderCardTemplate`'s `hasDefaultSlotContent`)
|
|
92
|
+
* to toggle the `--hasDefault` class.
|
|
93
|
+
*
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
protected get slotHasContent(): boolean;
|
|
97
|
+
connectedCallback(): void;
|
|
98
|
+
disconnectedCallback(): void;
|
|
99
|
+
protected firstUpdated(changedProperties: PropertyValues): void;
|
|
100
|
+
protected update(changedProperties: PropertyValues): void;
|
|
101
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
102
|
+
/**
|
|
103
|
+
* @internal
|
|
104
|
+
*
|
|
105
|
+
* The card's own `title` slot element.
|
|
106
|
+
*/
|
|
107
|
+
protected getTitleSlotElement(): HTMLSlotElement | null;
|
|
108
|
+
/**
|
|
109
|
+
* @internal
|
|
110
|
+
*
|
|
111
|
+
* The card's own `actions` slot element.
|
|
112
|
+
*/
|
|
113
|
+
protected getActionsSlotElement(): HTMLSlotElement | null;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the `actions` slot is supported for this card's current state.
|
|
116
|
+
* `xs` cards don't have room for it. Concrete classes may override this
|
|
117
|
+
* to exclude the slot for other reasons, independent of size.
|
|
118
|
+
*/
|
|
119
|
+
protected get actionsSupported(): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* @internal
|
|
122
|
+
*
|
|
123
|
+
* Warns in dev mode when the `actions` slot has content but isn't
|
|
124
|
+
* supported for the current state. Visual suppression is handled in
|
|
125
|
+
* CSS, not here.
|
|
126
|
+
*/
|
|
127
|
+
private checkActionsSupport;
|
|
128
|
+
/**
|
|
129
|
+
* @internal
|
|
130
|
+
*
|
|
131
|
+
* The `title` slot's link: either the assigned element itself
|
|
132
|
+
* (`<a slot="title" href="...">`) or an anchor nested inside a wrapper
|
|
133
|
+
* (`<span slot="title"><a href="...">`). Requires `href`.
|
|
134
|
+
*/
|
|
135
|
+
protected getTitleLinkElement(): HTMLAnchorElement | null;
|
|
136
|
+
/**
|
|
137
|
+
* @internal
|
|
138
|
+
*
|
|
139
|
+
* Whether `node` has its own interaction/focus semantics, via the
|
|
140
|
+
* `tabIndex` IDL property rather than the `tabindex` attribute; this
|
|
141
|
+
* also correctly excludes `tabindex="-1"` and disabled controls.
|
|
142
|
+
*/
|
|
143
|
+
private static isFocusable;
|
|
144
|
+
/**
|
|
145
|
+
* @internal
|
|
146
|
+
*
|
|
147
|
+
* The size one step below `size` in `CARD_VALID_SIZES`, clamped at the
|
|
148
|
+
* smallest size.
|
|
149
|
+
*/
|
|
150
|
+
private static getSmallerSize;
|
|
151
|
+
/**
|
|
152
|
+
* Re-propagates the `actions` slot's `size` for elements assigned after
|
|
153
|
+
* the initial render, wired to the slot's `slotchange` in
|
|
154
|
+
* `firstUpdated()`.
|
|
155
|
+
*/
|
|
156
|
+
protected readonly handleActionsSlotChange: () => void;
|
|
157
|
+
/**
|
|
158
|
+
* Proxies a qualifying surface click to `titleAsLink`'s link and/or
|
|
159
|
+
* dispatches `swc-card-click` for `selectable`, after filtering out
|
|
160
|
+
* clicks that landed on a nested interactive target or followed a
|
|
161
|
+
* text-selection drag.
|
|
162
|
+
*/
|
|
163
|
+
protected readonly handleSurfaceClick: (event: Event) => void;
|
|
164
|
+
/**
|
|
165
|
+
* Enter and Space both activate the card, even though a bare link
|
|
166
|
+
* conventionally responds to Enter only; the card's own activation
|
|
167
|
+
* contract takes precedence once `selectable` makes it the focused
|
|
168
|
+
* target.
|
|
169
|
+
*/
|
|
170
|
+
protected readonly handleSelectableKeydown: (event: KeyboardEvent) => void;
|
|
171
|
+
}
|
|
172
|
+
export {};
|