@adobe/spectrum-wc-core 0.4.0-snapshot-test.20260714143259
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/_virtual/_@oxc-project_runtime@0.124.0/helpers/defineProperty.js +12 -0
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPrimitive.js +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPropertyKey.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/typeof.js +11 -0
- package/dist/components/accordion/Accordion.base.d.ts +61 -0
- package/dist/components/accordion/Accordion.base.js +71 -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 +86 -0
- package/dist/components/accordion/AccordionItem.base.js +90 -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/alert-banner/AlertBanner.base.d.ts +36 -0
- package/dist/components/alert-banner/AlertBanner.base.js +56 -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 +22 -0
- package/dist/components/asset/Asset.base.js +25 -0
- package/dist/components/asset/Asset.base.js.map +1 -0
- package/dist/components/asset/Asset.types.d.ts +13 -0
- package/dist/components/asset/Asset.types.js +6 -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 +56 -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 +98 -0
- package/dist/components/badge/Badge.base.js +44 -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 +99 -0
- package/dist/components/button/Button.base.js +75 -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 +53 -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 +123 -0
- package/dist/components/card/Card.base.js +75 -0
- package/dist/components/card/Card.base.js.map +1 -0
- package/dist/components/card/Card.types.d.ts +17 -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 +26 -0
- package/dist/components/color-loupe/ColorLoupe.base.js +17 -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 +37 -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/icon/Icon.base.d.ts +32 -0
- package/dist/components/icon/Icon.base.js +35 -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 +46 -0
- package/dist/components/illustrated-message/IllustratedMessage.base.js +46 -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/meter/Meter.base.d.ts +40 -0
- package/dist/components/meter/Meter.base.js +30 -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 +223 -0
- package/dist/components/popover/Popover.base.js +270 -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-circle/ProgressCircle.base.d.ts +91 -0
- package/dist/components/progress-circle/ProgressCircle.base.js +73 -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 +65 -0
- package/dist/components/status-light/StatusLight.base.js +29 -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 +235 -0
- package/dist/components/tabs/Tabs.base.js +225 -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 +154 -0
- package/dist/components/tooltip/Tooltip.base.js +163 -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 +1 -0
- package/dist/controllers/color-controller/src/color-controller.d.ts +226 -0
- package/dist/controllers/color-controller/src/color-controller.js +252 -0
- package/dist/controllers/color-controller/src/color-controller.js.map +1 -0
- package/dist/controllers/focusgroup-navigation-controller/index.d.ts +12 -0
- package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.d.ts +477 -0
- package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.js +342 -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/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 +20 -0
- package/dist/controllers/index.js +11 -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/page-scroll-lock.d.ts +20 -0
- package/dist/controllers/page-scroll-lock.js +30 -0
- package/dist/controllers/page-scroll-lock.js.map +1 -0
- package/dist/controllers/placement-controller/index.d.ts +12 -0
- package/dist/controllers/placement-controller/index.js +3 -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/index.d.ts +12 -0
- package/dist/controllers/slot-attribute-propagation/src/slot-attribute-propagation-controller.d.ts +55 -0
- package/dist/controllers/slot-attribute-propagation/src/slot-attribute-propagation-controller.js +32 -0
- package/dist/controllers/slot-attribute-propagation/src/slot-attribute-propagation-controller.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 +26 -0
- package/dist/element/spectrum-element.js +66 -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 +17 -0
- package/dist/mixins/index.js +6 -0
- package/dist/mixins/linear-progress-mixin.d.ts +42 -0
- package/dist/mixins/linear-progress-mixin.js +111 -0
- package/dist/mixins/linear-progress-mixin.js.map +1 -0
- package/dist/mixins/observe-slot-presence.d.ts +12 -0
- package/dist/mixins/observe-slot-presence.js +40 -0
- package/dist/mixins/observe-slot-presence.js.map +1 -0
- package/dist/mixins/observe-slot-text.d.ts +11 -0
- package/dist/mixins/observe-slot-text.js +60 -0
- package/dist/mixins/observe-slot-text.js.map +1 -0
- package/dist/mixins/sized-mixin.d.ts +21 -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/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 +20 -0
- package/dist/utils/index.js +10 -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 +400 -0
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
//#region components/alert-banner/AlertBanner.base.ts
|
|
6
|
+
var i = class extends r {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.open = !1, this.dismissible = !1, this._variant = "";
|
|
9
|
+
}
|
|
10
|
+
static get styles() {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
set variant(e) {
|
|
14
|
+
if (e === this.variant) return;
|
|
15
|
+
let n = this.variant;
|
|
16
|
+
if (this.isValidVariant(e)) this.setAttribute("variant", e), this._variant = e;
|
|
17
|
+
else {
|
|
18
|
+
var r;
|
|
19
|
+
this.removeAttribute("variant"), this._variant = "", (r = window.__swc) != null && r.DEBUG && window.__swc.warn(this, `<${this.localName}> element expects the "variant" attribute to be one of the following:`, "https://opensource.adobe.com/spectrum-web-components/components/alert-banner/#variants", { issues: [...t] });
|
|
20
|
+
}
|
|
21
|
+
this.requestUpdate("variant", n);
|
|
22
|
+
}
|
|
23
|
+
get variant() {
|
|
24
|
+
return this._variant;
|
|
25
|
+
}
|
|
26
|
+
isValidVariant(e) {
|
|
27
|
+
return t.includes(e);
|
|
28
|
+
}
|
|
29
|
+
shouldClose() {
|
|
30
|
+
this.dispatchEvent(new CustomEvent("close", {
|
|
31
|
+
composed: !0,
|
|
32
|
+
bubbles: !0,
|
|
33
|
+
cancelable: !0
|
|
34
|
+
})) && this.close();
|
|
35
|
+
}
|
|
36
|
+
close() {
|
|
37
|
+
this.open = !1;
|
|
38
|
+
}
|
|
39
|
+
handleKeydown(e) {
|
|
40
|
+
e.code === "Escape" && this.dismissible && this.shouldClose();
|
|
41
|
+
}
|
|
42
|
+
updated(e) {
|
|
43
|
+
super.updated(e), e.has("open") && (this.open ? this.addEventListener("keydown", this.handleKeydown) : this.removeEventListener("keydown", this.handleKeydown));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
e([n({
|
|
47
|
+
type: Boolean,
|
|
48
|
+
reflect: !0
|
|
49
|
+
})], i.prototype, "open", void 0), e([n({
|
|
50
|
+
type: Boolean,
|
|
51
|
+
reflect: !0
|
|
52
|
+
})], i.prototype, "dismissible", void 0), e([n({ type: String })], i.prototype, "variant", null);
|
|
53
|
+
//#endregion
|
|
54
|
+
export { i as AlertBannerBase };
|
|
55
|
+
|
|
56
|
+
//# 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';\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 if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"variant\" attribute to be one of the following:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/alert-banner/#variants',\n {\n issues: [...ALERT_BANNER_VALID_VARIANTS],\n }\n );\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":";;;;;AA8BA,IAAsB,IAAtB,cAA8C,EAAgB;;2BAa9C,uBAMO,oBAsCkB;;CAxDvC,WAA2B,SAAyB;AAClD,SAAO,EAAE;;CAuBX,IACW,QAAQ,GAA6B;AAC9C,MAAI,MAAY,KAAK,QACnB;EAEF,IAAM,IAAW,KAAK;AAEtB,MAAI,KAAK,eAAe,EAAQ,CAE9B,CADA,KAAK,aAAa,WAAW,EAAQ,EACrC,KAAK,WAAW;OACX;;AAIL,GAHA,KAAK,gBAAgB,UAAU,EAC/B,KAAK,WAAW,KAEhB,IAAI,OAAO,UAAA,QAAA,EAAO,SAChB,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,wEACnB,0FACA,EACE,QAAQ,CAAC,GAAG,EAA4B,EACzC,CACF;;AAGL,OAAK,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;;;GAvF5D,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,22 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { SpectrumElement } from '../../element/index.js';
|
|
3
|
+
import { AssetVariant } from './Asset.types.js';
|
|
4
|
+
export declare abstract class AssetBase extends SpectrumElement {
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*
|
|
8
|
+
* A readonly array of all valid variants for the asset.
|
|
9
|
+
*
|
|
10
|
+
* This is an actual internal property, intended not for customer use
|
|
11
|
+
*/
|
|
12
|
+
static readonly VARIANTS: readonly AssetVariant[];
|
|
13
|
+
/**
|
|
14
|
+
* The variant of the asset. When not provided, slot content is rendered (e.g., an image).
|
|
15
|
+
*/
|
|
16
|
+
variant: AssetVariant | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Accessible label for the asset’s file or folder variant.
|
|
19
|
+
*/
|
|
20
|
+
label: string;
|
|
21
|
+
protected updated(changes: PropertyValues): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
|
|
2
|
+
import { ASSET_VARIANTS as t } from "./Asset.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
|
+
//#region components/asset/Asset.base.ts
|
|
6
|
+
var i, a = class extends r {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.label = "";
|
|
9
|
+
}
|
|
10
|
+
updated(e) {
|
|
11
|
+
var t;
|
|
12
|
+
if (super.updated(e), (t = window.__swc) != null && t.DEBUG) {
|
|
13
|
+
let e = this.constructor;
|
|
14
|
+
this.variant !== void 0 && !e.VARIANTS.includes(this.variant) && window.__swc.warn(this, `<${this.localName}> element expects the "variant" attribute to be one of the following:`, "https://opensource.adobe.com/spectrum-web-components/components/asset/", { issues: [...e.VARIANTS] });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
i = a, i.VARIANTS = t, e([n({
|
|
19
|
+
type: String,
|
|
20
|
+
reflect: !0
|
|
21
|
+
})], a.prototype, "variant", void 0), e([n({ type: String })], a.prototype, "label", void 0);
|
|
22
|
+
//#endregion
|
|
23
|
+
export { a as AssetBase };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=Asset.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Asset.base.js","names":[],"sources":["../../../components/asset/Asset.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 { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\n\nimport { ASSET_VARIANTS, type AssetVariant } from './Asset.types.js';\n\nexport abstract class AssetBase extends SpectrumElement {\n // ─────────────────────────\n // API TO OVERRIDE\n // ─────────────────────────\n\n /**\n * @internal\n *\n * A readonly array of all valid variants for the asset.\n *\n * This is an actual internal property, intended not for customer use\n */\n static readonly VARIANTS: readonly AssetVariant[] = ASSET_VARIANTS;\n\n // ─────────────────\n // SHARED API\n // ─────────────────\n\n /**\n * The variant of the asset. When not provided, slot content is rendered (e.g., an image).\n */\n @property({ type: String, reflect: true })\n public variant: AssetVariant | undefined;\n\n /**\n * Accessible label for the asset’s file or folder variant.\n */\n @property({ type: String })\n public label = '';\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (window.__swc?.DEBUG) {\n const constructor = this.constructor as typeof AssetBase;\n if (\n typeof this.variant !== 'undefined' &&\n !constructor.VARIANTS.includes(this.variant)\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"variant\" attribute to be one of the following:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/asset/',\n {\n issues: [...constructor.VARIANTS],\n }\n );\n }\n }\n }\n}\n"],"mappings":";;;;;OAmBsB,IAAtB,cAAwC,EAAgB;;4BA4BvC;;CAMf,QAA2B,GAA+B;;AAExD,MADA,MAAM,QAAQ,EAAQ,GACtB,IAAI,OAAO,UAAA,QAAA,EAAO,OAAO;GACvB,IAAM,IAAc,KAAK;AACzB,GACS,KAAK,YAAY,UACxB,CAAC,EAAY,SAAS,SAAS,KAAK,QAAQ,IAE5C,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,wEACnB,0EACA,EACE,QAAQ,CAAC,GAAG,EAAY,SAAS,EAClC,CACF;;;;oBArC6C,MASnD,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,KAMzC,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA"}
|
|
@@ -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 ASSET_VARIANTS: readonly ["file", "folder"];
|
|
13
|
+
export type AssetVariant = (typeof ASSET_VARIANTS)[number];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Asset.types.js","names":[],"sources":["../../../components/asset/Asset.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 ASSET_VARIANTS = [\n 'file',\n 'folder',\n] as const satisfies readonly string[];\n\nexport type AssetVariant = (typeof ASSET_VARIANTS)[number];\n"],"mappings":";AAYA,IAAa,IAAiB,CAC5B,QACA,SACD"}
|
|
@@ -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 './Asset.base.js';
|
|
13
|
+
export * from './Asset.types.js';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { SpectrumElement } from '../../element/index.js';
|
|
3
|
+
import { AvatarSize } from './Avatar.types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Base class for the avatar component.
|
|
6
|
+
*
|
|
7
|
+
* Provides the core API for displaying a circular profile image. Concrete
|
|
8
|
+
* classes supply the stylesheet and render template.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class AvatarBase extends SpectrumElement {
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*
|
|
14
|
+
* The set of valid numeric size values for the avatar.
|
|
15
|
+
*
|
|
16
|
+
* This is an internal property not intended for consumer use, but used in
|
|
17
|
+
* internal validation logic, stories, and tests to keep them in sync with
|
|
18
|
+
* the canonical type definition in `Avatar.types.ts`.
|
|
19
|
+
*/
|
|
20
|
+
static readonly VALID_SIZES: readonly AvatarSize[];
|
|
21
|
+
/**
|
|
22
|
+
* URL of the profile image to display.
|
|
23
|
+
*/
|
|
24
|
+
src: string;
|
|
25
|
+
/**
|
|
26
|
+
* Text description of the avatar image.
|
|
27
|
+
*/
|
|
28
|
+
alt: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The size of the avatar. Invalid values fall back to the default (500).
|
|
31
|
+
*
|
|
32
|
+
* @default 500
|
|
33
|
+
*/
|
|
34
|
+
get size(): AvatarSize;
|
|
35
|
+
set size(value: AvatarSize);
|
|
36
|
+
private _size;
|
|
37
|
+
/**
|
|
38
|
+
* Renders a visual outline around the avatar image.
|
|
39
|
+
*/
|
|
40
|
+
outline: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Renders the avatar at reduced opacity, indicating the entity is inactive or unavailable.
|
|
43
|
+
*/
|
|
44
|
+
disabled: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Marks the avatar as decorative, hiding it from assistive technology.
|
|
47
|
+
*/
|
|
48
|
+
decorative: boolean;
|
|
49
|
+
protected firstUpdated(changes: PropertyValues): void;
|
|
50
|
+
protected updated(changes: PropertyValues): void;
|
|
51
|
+
private _syncAriaHidden;
|
|
52
|
+
private _warnMissingAlt;
|
|
53
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
|
|
2
|
+
import { AVATAR_VALID_SIZES as t } from "./Avatar.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
|
+
//#region components/avatar/Avatar.base.ts
|
|
6
|
+
var i, a = class extends r {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.src = "", this._size = 500, this.outline = !1, this.disabled = !1, this.decorative = !1;
|
|
9
|
+
}
|
|
10
|
+
get size() {
|
|
11
|
+
return this._size;
|
|
12
|
+
}
|
|
13
|
+
set size(e) {
|
|
14
|
+
let n = t.includes(Number(e)) ? Number(e) : 500;
|
|
15
|
+
if (this._size === n) return;
|
|
16
|
+
let r = this._size;
|
|
17
|
+
this._size = n, this.requestUpdate("size", r);
|
|
18
|
+
}
|
|
19
|
+
firstUpdated(e) {
|
|
20
|
+
var t;
|
|
21
|
+
super.firstUpdated(e), this.hasAttribute("size") || this.setAttribute("size", String(this.size)), this._syncAriaHidden(), (t = window.__swc) != null && t.DEBUG && this._warnMissingAlt();
|
|
22
|
+
}
|
|
23
|
+
updated(e) {
|
|
24
|
+
var t;
|
|
25
|
+
super.updated(e), e.has("decorative") && this._syncAriaHidden(), e.has("alt") && (t = window.__swc) != null && t.DEBUG && this._warnMissingAlt();
|
|
26
|
+
}
|
|
27
|
+
_syncAriaHidden() {
|
|
28
|
+
this.decorative ? this.setAttribute("aria-hidden", "true") : this.removeAttribute("aria-hidden");
|
|
29
|
+
}
|
|
30
|
+
_warnMissingAlt() {
|
|
31
|
+
if (this.alt === void 0 && !this.decorative) {
|
|
32
|
+
var e;
|
|
33
|
+
(e = window.__swc) == null || e.warn(this, `<${this.localName}> is missing an \`alt\` attribute. Provide a text description or pass \`alt=""\` and mark it as \`decorative\`.`, "https://opensource.adobe.com/spectrum-web-components/components/avatar/#accessibility", {
|
|
34
|
+
type: "accessibility",
|
|
35
|
+
issues: ["Provide an `alt` attribute with meaningful alternative text, or", "Set `alt=\"\"` and mark the image as `decorative` (hidden from screen readers)."]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
i = a, i.VALID_SIZES = t, e([n({ type: String })], a.prototype, "src", void 0), e([n({ type: String })], a.prototype, "alt", void 0), e([n({
|
|
41
|
+
type: Number,
|
|
42
|
+
reflect: !0
|
|
43
|
+
})], a.prototype, "size", null), e([n({
|
|
44
|
+
type: Boolean,
|
|
45
|
+
reflect: !0
|
|
46
|
+
})], a.prototype, "outline", void 0), e([n({
|
|
47
|
+
type: Boolean,
|
|
48
|
+
reflect: !0
|
|
49
|
+
})], a.prototype, "disabled", void 0), e([n({
|
|
50
|
+
type: Boolean,
|
|
51
|
+
reflect: !0
|
|
52
|
+
})], a.prototype, "decorative", void 0);
|
|
53
|
+
//#endregion
|
|
54
|
+
export { a as AvatarBase };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=Avatar.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.base.js","names":[],"sources":["../../../components/avatar/Avatar.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 { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\n\nimport {\n AVATAR_DEFAULT_SIZE,\n AVATAR_VALID_SIZES,\n type AvatarSize,\n} from './Avatar.types.js';\n\n/**\n * Base class for the avatar component.\n *\n * Provides the core API for displaying a circular profile image. Concrete\n * classes supply the stylesheet and render template.\n */\nexport abstract class AvatarBase extends SpectrumElement {\n // ─────────────────────────\n // STATIC\n // ─────────────────────────\n\n /**\n * @internal\n *\n * The set of valid numeric size values for the avatar.\n *\n * This is an internal property not intended for consumer use, but used in\n * internal validation logic, stories, and tests to keep them in sync with\n * the canonical type definition in `Avatar.types.ts`.\n */\n static readonly VALID_SIZES: readonly AvatarSize[] = AVATAR_VALID_SIZES;\n\n // ──────────────────\n // CORE API\n // ──────────────────\n\n /**\n * URL of the profile image to display.\n */\n @property({ type: String })\n public src = '';\n\n /**\n * Text description of the avatar image.\n */\n @property({ type: String })\n public alt: string | undefined;\n\n // ───────────────────\n // SIZE API\n // ───────────────────\n\n /**\n * The size of the avatar. Invalid values fall back to the default (500).\n *\n * @default 500\n */\n @property({ type: Number, reflect: true })\n public get size(): AvatarSize {\n return this._size;\n }\n\n public set size(value: AvatarSize) {\n const validSize = (AVATAR_VALID_SIZES as readonly number[]).includes(\n Number(value)\n )\n ? (Number(value) as AvatarSize)\n : AVATAR_DEFAULT_SIZE;\n\n if (this._size === validSize) {\n return;\n }\n\n const oldSize = this._size;\n this._size = validSize;\n this.requestUpdate('size', oldSize);\n }\n\n private _size: AvatarSize = AVATAR_DEFAULT_SIZE;\n\n // ───────────────────────\n // VISUAL API\n // ───────────────────────\n\n /**\n * Renders a visual outline around the avatar image.\n */\n @property({ type: Boolean, reflect: true })\n public outline = false;\n\n /**\n * Renders the avatar at reduced opacity, indicating the entity is inactive or unavailable.\n */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n // ───────────────────────────\n // ACCESSIBILITY API\n // ───────────────────────────\n\n /**\n * Marks the avatar as decorative, hiding it from assistive technology.\n */\n @property({ type: Boolean, reflect: true })\n public decorative = false;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('size')) {\n this.setAttribute('size', String(this.size));\n }\n this._syncAriaHidden();\n if (window.__swc?.DEBUG) {\n this._warnMissingAlt();\n }\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('decorative')) {\n this._syncAriaHidden();\n }\n if (changes.has('alt') && window.__swc?.DEBUG) {\n this._warnMissingAlt();\n }\n }\n\n private _syncAriaHidden(): void {\n if (this.decorative) {\n this.setAttribute('aria-hidden', 'true');\n } else {\n this.removeAttribute('aria-hidden');\n }\n }\n\n private _warnMissingAlt(): void {\n if (this.alt === undefined && !this.decorative) {\n window.__swc?.warn(\n this,\n `<${this.localName}> is missing an \\`alt\\` attribute. Provide a text description or pass \\`alt=\"\"\\` and mark it as \\`decorative\\`.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/avatar/#accessibility',\n {\n type: 'accessibility',\n issues: [\n 'Provide an `alt` attribute with meaningful alternative text, or',\n 'Set `alt=\"\"` and mark the image as `decorative` (hidden from screen readers).',\n ],\n }\n );\n }\n }\n}\n"],"mappings":";;;;;OA4BsB,IAAtB,cAAyC,EAAgB;;0BAwB1C,qCAgDI,oBAMC,sBAUE;;CA/CpB,IACW,OAAmB;AAC5B,SAAO,KAAK;;CAGd,IAAW,KAAK,GAAmB;EACjC,IAAM,IAAa,EAAyC,SAC1D,OAAO,EAAM,CACd,GACI,OAAO,EAAM,GAAA;AAGlB,MAAI,KAAK,UAAU,EACjB;EAGF,IAAM,IAAU,KAAK;AAErB,EADA,KAAK,QAAQ,GACb,KAAK,cAAc,QAAQ,EAAQ;;CAmCrC,aAAgC,GAA+B;;AAM7D,EALA,MAAM,aAAa,EAAQ,EACtB,KAAK,aAAa,OAAO,IAC5B,KAAK,aAAa,QAAQ,OAAO,KAAK,KAAK,CAAC,EAE9C,KAAK,iBAAiB,GACtB,IAAI,OAAO,UAAA,QAAA,EAAO,SAChB,KAAK,iBAAiB;;CAI1B,QAA2B,GAA+B;;AAKxD,EAJA,MAAM,QAAQ,EAAQ,EAClB,EAAQ,IAAI,aAAa,IAC3B,KAAK,iBAAiB,EAEpB,EAAQ,IAAI,MAAM,KAAA,IAAI,OAAO,UAAA,QAAA,EAAO,SACtC,KAAK,iBAAiB;;CAI1B,kBAAgC;AAC9B,EAAI,KAAK,aACP,KAAK,aAAa,eAAe,OAAO,GAExC,KAAK,gBAAgB,cAAc;;CAIvC,kBAAgC;AAC9B,MAAI,KAAK,QAAQ,KAAA,KAAa,CAAC,KAAK,YAAY;;AAC9C,IAAA,IAAA,OAAO,UAAA,QAAA,EAAO,KACZ,MACA,IAAI,KAAK,UAAU,kHACnB,yFACA;IACE,MAAM;IACN,QAAQ,CACN,mEACA,kFACD;IACF,CACF;;;;uBA1HgD,MASpD,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,OAAA,KAAA,EAAA,KAM1B,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,OAAA,KAAA,EAAA,KAY1B,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,KA8BzC,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,KAM1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAU1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,cAAA,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
|
+
/**
|
|
13
|
+
* Valid numeric size values for the Avatar component.
|
|
14
|
+
*
|
|
15
|
+
* Sizes 50–700 match 1st-gen. Sizes 800–1500 are new in Spectrum 2.
|
|
16
|
+
*/
|
|
17
|
+
export declare const AVATAR_VALID_SIZES: readonly [50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500];
|
|
18
|
+
export type AvatarSize = (typeof AVATAR_VALID_SIZES)[number];
|
|
19
|
+
export declare const AVATAR_DEFAULT_SIZE: 500;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region components/avatar/Avatar.types.ts
|
|
2
|
+
var e = [
|
|
3
|
+
50,
|
|
4
|
+
75,
|
|
5
|
+
100,
|
|
6
|
+
200,
|
|
7
|
+
300,
|
|
8
|
+
400,
|
|
9
|
+
500,
|
|
10
|
+
600,
|
|
11
|
+
700,
|
|
12
|
+
800,
|
|
13
|
+
900,
|
|
14
|
+
1e3,
|
|
15
|
+
1100,
|
|
16
|
+
1200,
|
|
17
|
+
1300,
|
|
18
|
+
1400,
|
|
19
|
+
1500
|
|
20
|
+
], t = 500;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as AVATAR_DEFAULT_SIZE, e as AVATAR_VALID_SIZES };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=Avatar.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.types.js","names":[],"sources":["../../../components/avatar/Avatar.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\n/**\n * Valid numeric size values for the Avatar component.\n *\n * Sizes 50–700 match 1st-gen. Sizes 800–1500 are new in Spectrum 2.\n */\nexport const AVATAR_VALID_SIZES = [\n 50, 75, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300,\n 1400, 1500,\n] as const;\n\nexport type AvatarSize = (typeof AVATAR_VALID_SIZES)[number];\n\nexport const AVATAR_DEFAULT_SIZE = 500 as const satisfies AvatarSize;\n"],"mappings":";AAiBA,IAAa,IAAqB;CAChC;CAAI;CAAI;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAM;CAAM;CAAM;CACvE;CAAM;CACP,EAIY,IAAsB"}
|
|
@@ -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 './Avatar.base.js';
|
|
13
|
+
export * from './Avatar.types.js';
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { SpectrumElement } from '../../element/index.js';
|
|
3
|
+
import { BadgeSize, BadgeVariant, FixedValues } from './Badge.types.js';
|
|
4
|
+
declare const BadgeBase_base: typeof SpectrumElement & {
|
|
5
|
+
new (...args: any[]): import('../../mixins/observe-slot-presence.js').SlotPresenceObservingInterface;
|
|
6
|
+
prototype: import('../../mixins/observe-slot-presence.js').SlotPresenceObservingInterface;
|
|
7
|
+
} & {
|
|
8
|
+
new (...args: any[]): import('../../mixins/observe-slot-text.js').SlotTextObservingInterface;
|
|
9
|
+
prototype: import('../../mixins/observe-slot-text.js').SlotTextObservingInterface;
|
|
10
|
+
} & {
|
|
11
|
+
new (...args: any[]): import('../../mixins/index.js').SizedElementInterface;
|
|
12
|
+
prototype: import('../../mixins/index.js').SizedElementInterface;
|
|
13
|
+
} & import('../../mixins/index.js').SizedElementConstructor;
|
|
14
|
+
/**
|
|
15
|
+
* A badge component that displays short, descriptive information about an element.
|
|
16
|
+
* Badges are typically used to indicate status, categories, or provide supplementary information.
|
|
17
|
+
*
|
|
18
|
+
* @attribute {ElementSize} size - The size of the badge.
|
|
19
|
+
*
|
|
20
|
+
* @slot - Text label of the badge.
|
|
21
|
+
* @slot icon - Optional icon that appears to the left of the label
|
|
22
|
+
*
|
|
23
|
+
* @todo review the mixin composition here. We currently have 3 levels of mixins on this class, but the mixin composition guide recommends a maximum of 2.
|
|
24
|
+
*/
|
|
25
|
+
export declare abstract class BadgeBase extends BadgeBase_base {
|
|
26
|
+
/**
|
|
27
|
+
* The size of the badge.
|
|
28
|
+
*
|
|
29
|
+
* @default s
|
|
30
|
+
*/
|
|
31
|
+
size: BadgeSize;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*
|
|
35
|
+
* A readonly array of the valid color variants for the badge.
|
|
36
|
+
*
|
|
37
|
+
* This is an actual internal property, intended not for customer use
|
|
38
|
+
* but for use in internal validation logic, stories, tests, etc.
|
|
39
|
+
*
|
|
40
|
+
* Because S1 and S2 support different color variants, the value of this
|
|
41
|
+
* property must be set in each subclass.
|
|
42
|
+
*/
|
|
43
|
+
static readonly VARIANTS_COLOR: readonly string[];
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*
|
|
47
|
+
* A readonly array of all valid variants for the badge.
|
|
48
|
+
*
|
|
49
|
+
* This is an actual internal property, intended not for customer use
|
|
50
|
+
* but for use in internal validation logic, stories, tests, etc.
|
|
51
|
+
*
|
|
52
|
+
* Because S1 and S2 support different variants, the value of this
|
|
53
|
+
* property must be set in each subclass.
|
|
54
|
+
*/
|
|
55
|
+
static readonly VARIANTS: readonly string[];
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
*
|
|
59
|
+
* The variant of the badge.
|
|
60
|
+
*
|
|
61
|
+
* This is a public property, but its valid values vary between S1 and S2,
|
|
62
|
+
* so the property (and its docs) need to be redefined in each subclass.
|
|
63
|
+
*
|
|
64
|
+
* The type declared here is a union of the valid values for S1 and S2,
|
|
65
|
+
* and should be narrowed in each subclass.
|
|
66
|
+
*/
|
|
67
|
+
variant: BadgeVariant;
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
static readonly FIXED_VALUES: readonly string[];
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
static readonly VARIANTS_SEMANTIC: readonly string[];
|
|
76
|
+
/**
|
|
77
|
+
* The fixed position of the badge.
|
|
78
|
+
*/
|
|
79
|
+
fixed?: FixedValues;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the badge is subtle.
|
|
82
|
+
*/
|
|
83
|
+
subtle: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Whether the badge is outlined.
|
|
86
|
+
*
|
|
87
|
+
* Can only be used with semantic variants.
|
|
88
|
+
*/
|
|
89
|
+
outline: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* @internal
|
|
92
|
+
*
|
|
93
|
+
* Used for rendering gap when the badge has an icon.
|
|
94
|
+
*/
|
|
95
|
+
protected get hasIcon(): boolean;
|
|
96
|
+
protected update(changedProperties: PropertyValues): void;
|
|
97
|
+
}
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
|
|
2
|
+
import { BADGE_VALID_SIZES as t, BADGE_VARIANTS_SEMANTIC as n, FIXED_VALUES as r } from "./Badge.types.js";
|
|
3
|
+
import { property as i } from "lit/decorators.js";
|
|
4
|
+
import { SpectrumElement as a } from "@adobe/spectrum-wc-core/element/index.js";
|
|
5
|
+
import { SizedMixin as o } from "@adobe/spectrum-wc-core/mixins/index.js";
|
|
6
|
+
import { ObserveSlotPresence as s } from "@adobe/spectrum-wc-core/mixins/observe-slot-presence.js";
|
|
7
|
+
import { ObserveSlotText as c } from "@adobe/spectrum-wc-core/mixins/observe-slot-text.js";
|
|
8
|
+
//#region components/badge/Badge.base.ts
|
|
9
|
+
var l, u = class extends o(c(s(a, "[slot=\"icon\"]"), ""), {
|
|
10
|
+
validSizes: t,
|
|
11
|
+
defaultSize: "s"
|
|
12
|
+
}) {
|
|
13
|
+
constructor(...e) {
|
|
14
|
+
super(...e), this.variant = "neutral", this.subtle = !1, this.outline = !1;
|
|
15
|
+
}
|
|
16
|
+
get hasIcon() {
|
|
17
|
+
return this.slotContentIsPresent;
|
|
18
|
+
}
|
|
19
|
+
update(e) {
|
|
20
|
+
var t;
|
|
21
|
+
if ((t = window.__swc) != null && t.DEBUG) {
|
|
22
|
+
let e = this.constructor;
|
|
23
|
+
e.VARIANTS.includes(this.variant) || window.__swc.warn(this, `<${this.localName}> element expects the "variant" attribute to be one of the following:`, "https://opensource.adobe.com/spectrum-web-components/components/badge/#variants", { issues: [...e.VARIANTS] }), "outline" in this && this.outline === !0 && !e.VARIANTS_SEMANTIC.includes(this.variant) && window.__swc.warn(this, `<${this.localName}> element only supports the outline styling if the variant is a semantic color variant.`, "https://opensource.adobe.com/spectrum-web-components/components/badge/#variants", { issues: [...e.VARIANTS_SEMANTIC] });
|
|
24
|
+
}
|
|
25
|
+
super.update(e);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
l = u, l.FIXED_VALUES = r, l.VARIANTS_SEMANTIC = n, e([i({
|
|
29
|
+
type: String,
|
|
30
|
+
reflect: !0
|
|
31
|
+
})], u.prototype, "variant", void 0), e([i({
|
|
32
|
+
type: String,
|
|
33
|
+
reflect: !0
|
|
34
|
+
})], u.prototype, "fixed", void 0), e([i({
|
|
35
|
+
type: Boolean,
|
|
36
|
+
reflect: !0
|
|
37
|
+
})], u.prototype, "subtle", void 0), e([i({
|
|
38
|
+
type: Boolean,
|
|
39
|
+
reflect: !0
|
|
40
|
+
})], u.prototype, "outline", void 0);
|
|
41
|
+
//#endregion
|
|
42
|
+
export { u as BadgeBase };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=Badge.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.base.js","names":[],"sources":["../../../components/badge/Badge.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 { PropertyValues } from 'lit';\nimport { property } 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';\nimport { ObserveSlotPresence } from '@adobe/spectrum-wc-core/mixins/observe-slot-presence.js';\nimport { ObserveSlotText } from '@adobe/spectrum-wc-core/mixins/observe-slot-text.js';\n\nimport {\n BADGE_VALID_SIZES,\n BADGE_VARIANTS_SEMANTIC,\n type BadgeSize,\n type BadgeVariant,\n FIXED_VALUES,\n type FixedValues,\n} from './Badge.types.js';\n\n/**\n * A badge component that displays short, descriptive information about an element.\n * Badges are typically used to indicate status, categories, or provide supplementary information.\n *\n * @attribute {ElementSize} size - The size of the badge.\n *\n * @slot - Text label of the badge.\n * @slot icon - Optional icon that appears to the left of the label\n *\n * @todo review the mixin composition here. We currently have 3 levels of mixins on this class, but the mixin composition guide recommends a maximum of 2.\n */\nexport abstract class BadgeBase extends SizedMixin(\n ObserveSlotText(ObserveSlotPresence(SpectrumElement, '[slot=\"icon\"]'), ''),\n {\n validSizes: BADGE_VALID_SIZES,\n defaultSize: 's',\n }\n) {\n /**\n * The size of the badge.\n *\n * @default s\n */\n declare public size: BadgeSize;\n\n // ─────────────────────────\n // API TO OVERRIDE\n // ─────────────────────────\n\n /**\n * @internal\n *\n * A readonly array of the valid color variants for the badge.\n *\n * This is an actual internal property, intended not for customer use\n * but for use in internal validation logic, stories, tests, etc.\n *\n * Because S1 and S2 support different color variants, the value of this\n * property must be set in each subclass.\n */\n static readonly VARIANTS_COLOR: readonly string[];\n\n /**\n * @internal\n *\n * A readonly array of all valid variants for the badge.\n *\n * This is an actual internal property, intended not for customer use\n * but for use in internal validation logic, stories, tests, etc.\n *\n * Because S1 and S2 support different variants, the value of this\n * property must be set in each subclass.\n */\n static readonly VARIANTS: readonly string[];\n\n /**\n * @internal\n *\n * The variant of the badge.\n *\n * This is a public property, but its valid values vary between S1 and S2,\n * so the property (and its docs) need to be redefined in each subclass.\n *\n * The type declared here is a union of the valid values for S1 and S2,\n * and should be narrowed in each subclass.\n */\n @property({ type: String, reflect: true })\n public variant: BadgeVariant = 'neutral';\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * @internal\n */\n static readonly FIXED_VALUES: readonly string[] = FIXED_VALUES;\n\n /**\n * @internal\n */\n static readonly VARIANTS_SEMANTIC: readonly string[] =\n BADGE_VARIANTS_SEMANTIC;\n\n /**\n * The fixed position of the badge.\n */\n @property({ type: String, reflect: true })\n public fixed?: FixedValues;\n\n /**\n * Whether the badge is subtle.\n */\n @property({ type: Boolean, reflect: true })\n public subtle: boolean = false;\n\n /**\n * Whether the badge is outlined.\n *\n * Can only be used with semantic variants.\n */\n @property({ type: Boolean, reflect: true })\n public outline: boolean = false;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n /**\n * @internal\n *\n * Used for rendering gap when the badge has an icon.\n */\n protected get hasIcon(): boolean {\n return this.slotContentIsPresent;\n }\n\n protected override update(changedProperties: PropertyValues): void {\n if (window.__swc?.DEBUG) {\n const constructor = this.constructor as typeof BadgeBase;\n if (!constructor.VARIANTS.includes(this.variant)) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"variant\" attribute to be one of the following:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/badge/#variants',\n {\n issues: [...constructor.VARIANTS],\n }\n );\n }\n // Check outline property if it exists (S2 only)\n if (\n 'outline' in this &&\n (this as { outline: boolean }).outline === true &&\n !constructor.VARIANTS_SEMANTIC.includes(this.variant)\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> element only supports the outline styling if the variant is a semantic color variant.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/badge/#variants',\n {\n issues: [...constructor.VARIANTS_SEMANTIC],\n }\n );\n }\n }\n super.update(changedProperties);\n }\n}\n"],"mappings":";;;;;;;;OAuCsB,IAAtB,cAAwC,EACtC,EAAgB,EAAoB,GAAiB,kBAAgB,EAAE,GAAG,EAC1E;CACE,YAAY;CACZ,aAAa;CACd,CACF,CAAC;;8BAkD+B,yBA2BN,mBAQC;;CAW1B,IAAc,UAAmB;AAC/B,SAAO,KAAK;;CAGd,OAA0B,GAAyC;;AACjE,OAAA,IAAI,OAAO,UAAA,QAAA,EAAO,OAAO;GACvB,IAAM,IAAc,KAAK;AAYzB,GAXK,EAAY,SAAS,SAAS,KAAK,QAAQ,IAC9C,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,wEACnB,mFACA,EACE,QAAQ,CAAC,GAAG,EAAY,SAAS,EAClC,CACF,EAID,aAAa,QACZ,KAA8B,YAAY,MAC3C,CAAC,EAAY,kBAAkB,SAAS,KAAK,QAAQ,IAErD,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,0FACnB,mFACA,EACE,QAAQ,CAAC,GAAG,EAAY,kBAAkB,EAC3C,CACF;;AAGL,QAAM,OAAO,EAAkB;;;wBAtEiB,yBAMhD,MAhBD,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,KAqBzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAMzC,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,UAAA,KAAA,EAAA,KAQ1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 BADGE_VALID_SIZES: readonly ["s", "m", "l", "xl"];
|
|
13
|
+
export declare const BADGE_VARIANTS_SEMANTIC: readonly ["accent", "informative", "neutral", "positive", "notice", "negative"];
|
|
14
|
+
export declare const BADGE_VARIANTS_COLOR: readonly ["fuchsia", "indigo", "magenta", "purple", "seafoam", "yellow", "gray", "red", "orange", "chartreuse", "celery", "green", "cyan", "blue", "pink", "turquoise", "brown", "cinnamon", "silver"];
|
|
15
|
+
export declare const FIXED_VALUES: readonly ["block-start", "block-end", "inline-start", "inline-end"];
|
|
16
|
+
export declare const BADGE_VARIANTS: readonly ["accent", "informative", "neutral", "positive", "notice", "negative", "fuchsia", "indigo", "magenta", "purple", "seafoam", "yellow", "gray", "red", "orange", "chartreuse", "celery", "green", "cyan", "blue", "pink", "turquoise", "brown", "cinnamon", "silver"];
|
|
17
|
+
export type FixedValues = (typeof FIXED_VALUES)[number];
|
|
18
|
+
export type BadgeSize = (typeof BADGE_VALID_SIZES)[number];
|
|
19
|
+
export type BadgeSemanticVariant = (typeof BADGE_VARIANTS_SEMANTIC)[number];
|
|
20
|
+
export type BadgeColorVariant = (typeof BADGE_VARIANTS_COLOR)[number];
|
|
21
|
+
export type BadgeVariant = (typeof BADGE_VARIANTS)[number];
|