@spectrum-web-components/core 0.0.1

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.
Files changed (76) hide show
  1. package/README.md +7 -0
  2. package/dist/components/alert-banner/AlertBanner.base.d.ts +38 -0
  3. package/dist/components/alert-banner/AlertBanner.base.js +66 -0
  4. package/dist/components/alert-banner/AlertBanner.base.js.map +1 -0
  5. package/dist/components/alert-banner/index.d.ts +12 -0
  6. package/dist/components/alert-banner/index.js +5 -0
  7. package/dist/components/alert-banner/index.js.map +1 -0
  8. package/dist/components/asset/Asset.base.d.ts +5 -0
  9. package/dist/components/asset/Asset.base.js +22 -0
  10. package/dist/components/asset/Asset.base.js.map +1 -0
  11. package/dist/components/asset/index.d.ts +12 -0
  12. package/dist/components/asset/index.js +5 -0
  13. package/dist/components/asset/index.js.map +1 -0
  14. package/dist/components/badge/Badge.base.d.ts +84 -0
  15. package/dist/components/badge/Badge.base.js +74 -0
  16. package/dist/components/badge/Badge.base.js.map +1 -0
  17. package/dist/components/badge/Badge.types.d.ts +21 -0
  18. package/dist/components/badge/Badge.types.js +50 -0
  19. package/dist/components/badge/Badge.types.js.map +1 -0
  20. package/dist/components/badge/index.d.ts +13 -0
  21. package/dist/components/badge/index.js +12 -0
  22. package/dist/components/badge/index.js.map +1 -0
  23. package/dist/components/divider/Divider.base.d.ts +33 -0
  24. package/dist/components/divider/Divider.base.js +35 -0
  25. package/dist/components/divider/Divider.base.js.map +1 -0
  26. package/dist/components/divider/Divider.types.d.ts +4 -0
  27. package/dist/components/divider/Divider.types.js +6 -0
  28. package/dist/components/divider/Divider.types.js.map +1 -0
  29. package/dist/components/divider/index.d.ts +13 -0
  30. package/dist/components/divider/index.js +8 -0
  31. package/dist/components/divider/index.js.map +1 -0
  32. package/dist/components/progress-circle/ProgressCircle.base.d.ts +76 -0
  33. package/dist/components/progress-circle/ProgressCircle.base.js +63 -0
  34. package/dist/components/progress-circle/ProgressCircle.base.js.map +1 -0
  35. package/dist/components/progress-circle/ProgressCircle.types.d.ts +7 -0
  36. package/dist/components/progress-circle/ProgressCircle.types.js +14 -0
  37. package/dist/components/progress-circle/ProgressCircle.types.js.map +1 -0
  38. package/dist/components/progress-circle/index.d.ts +13 -0
  39. package/dist/components/progress-circle/index.js +9 -0
  40. package/dist/components/progress-circle/index.js.map +1 -0
  41. package/dist/components/status-light/StatusLight.base.d.ts +64 -0
  42. package/dist/components/status-light/StatusLight.base.js +46 -0
  43. package/dist/components/status-light/StatusLight.base.js.map +1 -0
  44. package/dist/components/status-light/StatusLight.types.d.ts +21 -0
  45. package/dist/components/status-light/StatusLight.types.js +45 -0
  46. package/dist/components/status-light/StatusLight.types.js.map +1 -0
  47. package/dist/components/status-light/index.d.ts +13 -0
  48. package/dist/components/status-light/index.js +13 -0
  49. package/dist/components/status-light/index.js.map +1 -0
  50. package/dist/node_modules/@lit-labs/observers/mutation-controller.js +30 -0
  51. package/dist/node_modules/@lit-labs/observers/mutation-controller.js.map +1 -0
  52. package/dist/shared/base/Base.d.ts +17 -0
  53. package/dist/shared/base/Base.js +144 -0
  54. package/dist/shared/base/Base.js.map +1 -0
  55. package/dist/shared/base/define-element.d.ts +16 -0
  56. package/dist/shared/base/define-element.js +11 -0
  57. package/dist/shared/base/define-element.js.map +1 -0
  58. package/dist/shared/base/index.d.ts +15 -0
  59. package/dist/shared/base/index.js +13 -0
  60. package/dist/shared/base/index.js.map +1 -0
  61. package/dist/shared/base/sizedMixin.d.ts +20 -0
  62. package/dist/shared/base/sizedMixin.js +50 -0
  63. package/dist/shared/base/sizedMixin.js.map +1 -0
  64. package/dist/shared/base/version.d.ts +1 -0
  65. package/dist/shared/base/version.js +5 -0
  66. package/dist/shared/base/version.js.map +1 -0
  67. package/dist/shared/get-label-from-slot.d.ts +12 -0
  68. package/dist/shared/get-label-from-slot.js +10 -0
  69. package/dist/shared/get-label-from-slot.js.map +1 -0
  70. package/dist/shared/observe-slot-presence.d.ts +12 -0
  71. package/dist/shared/observe-slot-presence.js +53 -0
  72. package/dist/shared/observe-slot-presence.js.map +1 -0
  73. package/dist/shared/observe-slot-text.d.ts +11 -0
  74. package/dist/shared/observe-slot-text.js +74 -0
  75. package/dist/shared/observe-slot-text.js.map +1 -0
  76. package/package.json +76 -0
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @spectrum-web-components/core
2
+
3
+ Abstract base classes for Spectrum Web Components.
4
+
5
+ This package provides shared functionality between multiple generations of implementations and is **not intended for direct external use**.
6
+
7
+ For more information, visit the [Spectrum Web Components repository](https://github.com/adobe/spectrum-web-components).
@@ -0,0 +1,38 @@
1
+ import { CSSResultArray, PropertyValues, TemplateResult } from 'lit';
2
+ import { SpectrumElement } from '../../shared/base/index.js';
3
+ declare const VALID_VARIANTS: string[];
4
+ export type AlertBannerVariants = (typeof VALID_VARIANTS)[number];
5
+ /**
6
+ * Base class for alert banner components
7
+ */
8
+ export declare abstract class AlertBannerBase extends SpectrumElement {
9
+ static get styles(): CSSResultArray;
10
+ /**
11
+ * Controls the display of the alert banner
12
+ *
13
+ * @param {Boolean} open
14
+ */
15
+ open: boolean;
16
+ /**
17
+ * Whether to include an icon-only close button to dismiss the alert banner
18
+ *
19
+ * @param {Boolean} dismissible
20
+ */
21
+ dismissible: boolean;
22
+ /**
23
+ * The variant applies specific styling when set to `negative` or `info`;
24
+ * `variant` attribute is removed when it's passed an invalid variant.
25
+ *
26
+ * @param {String} variant
27
+ */
28
+ set variant(variant: AlertBannerVariants);
29
+ get variant(): AlertBannerVariants;
30
+ private _variant;
31
+ protected isValidVariant(variant: string): boolean;
32
+ protected abstract renderIcon(variant: string): TemplateResult;
33
+ protected shouldClose(): void;
34
+ close(): void;
35
+ protected handleKeydown(event: KeyboardEvent): void;
36
+ protected updated(changes: PropertyValues): void;
37
+ }
38
+ export {};
@@ -0,0 +1,66 @@
1
+ import { property as o } from "lit/decorators.js";
2
+ import { SpectrumElement as u } from "@spectrum-web-components/core/shared/base/index.js";
3
+ var c = Object.defineProperty, d = Object.getOwnPropertyDescriptor, l = (r, e, s, i) => {
4
+ for (var t = i > 1 ? void 0 : i ? d(e, s) : e, n = r.length - 1, a; n >= 0; n--)
5
+ (a = r[n]) && (t = (i ? a(e, s, t) : a(t)) || t);
6
+ return i && t && c(e, s, t), t;
7
+ };
8
+ const h = ["neutral", "info", "negative"];
9
+ class p extends u {
10
+ constructor() {
11
+ super(...arguments), this.open = !1, this.dismissible = !1, this._variant = "";
12
+ }
13
+ static get styles() {
14
+ return [];
15
+ }
16
+ set variant(e) {
17
+ if (e === this.variant)
18
+ return;
19
+ const s = this.variant;
20
+ this.isValidVariant(e) ? (this.setAttribute("variant", e), this._variant = e) : (this.removeAttribute("variant"), this._variant = "", window.__swc.DEBUG && window.__swc.warn(
21
+ this,
22
+ `<${this.localName}> element expects the "variant" attribute to be one of the following:`,
23
+ "https://opensource.adobe.com/spectrum-web-components/components/alert-banner/#variants",
24
+ {
25
+ issues: [...h]
26
+ }
27
+ )), this.requestUpdate("variant", s);
28
+ }
29
+ get variant() {
30
+ return this._variant;
31
+ }
32
+ isValidVariant(e) {
33
+ return h.includes(e);
34
+ }
35
+ shouldClose() {
36
+ this.dispatchEvent(
37
+ new CustomEvent("close", {
38
+ composed: !0,
39
+ bubbles: !0,
40
+ cancelable: !0
41
+ })
42
+ ) && this.close();
43
+ }
44
+ close() {
45
+ this.open = !1;
46
+ }
47
+ handleKeydown(e) {
48
+ e.code === "Escape" && this.dismissible && this.shouldClose();
49
+ }
50
+ updated(e) {
51
+ super.updated(e), e.has("open") && (this.open ? this.addEventListener("keydown", this.handleKeydown) : this.removeEventListener("keydown", this.handleKeydown));
52
+ }
53
+ }
54
+ l([
55
+ o({ type: Boolean, reflect: !0 })
56
+ ], p.prototype, "open", 2);
57
+ l([
58
+ o({ type: Boolean, reflect: !0 })
59
+ ], p.prototype, "dismissible", 2);
60
+ l([
61
+ o({ type: String })
62
+ ], p.prototype, "variant", 1);
63
+ export {
64
+ p as AlertBannerBase
65
+ };
66
+ //# sourceMappingURL=AlertBanner.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertBanner.base.js","sources":["../../../components/alert-banner/AlertBanner.base.ts"],"sourcesContent":["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { CSSResultArray, PropertyValues, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@spectrum-web-components/core/shared/base/index.js';\n\nconst VALID_VARIANTS = ['neutral', 'info', 'negative'];\nexport type AlertBannerVariants = (typeof VALID_VARIANTS)[number];\n\n/**\n * Base class for alert banner components\n */\nexport abstract class AlertBannerBase extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [];\n }\n\n /**\n * Controls the display of the alert banner\n *\n * @param {Boolean} open\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 * @param {Boolean} dismissible\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 * @param {String} variant\n */\n @property({ type: String })\n public set variant(variant: AlertBannerVariants) {\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: [...VALID_VARIANTS],\n }\n );\n }\n }\n this.requestUpdate('variant', oldValue);\n }\n\n public get variant(): AlertBannerVariants {\n return this._variant;\n }\n\n private _variant: AlertBannerVariants = '';\n\n protected isValidVariant(variant: string): boolean {\n return VALID_VARIANTS.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"],"names":["VALID_VARIANTS","AlertBannerBase","SpectrumElement","variant","oldValue","event","changes","__decorateClass","property"],"mappings":";;;;;;;AAgBA,MAAMA,IAAiB,CAAC,WAAW,QAAQ,UAAU;AAM9C,MAAeC,UAAwBC,EAAgB;AAAA,EAAvD,cAAA;AAAA,UAAA,GAAA,SAAA,GAWH,KAAO,OAAO,IAQd,KAAO,cAAc,IAwCrB,KAAQ,WAAgC;AAAA,EAAA;AAAA,EA1DxC,WAA2B,SAAyB;AAChD,WAAO,CAAA;AAAA,EACX;AAAA,EAyBA,IAAW,QAAQC,GAA8B;AAC7C,QAAIA,MAAY,KAAK;AACjB;AAEJ,UAAMC,IAAW,KAAK;AAEtB,IAAI,KAAK,eAAeD,CAAO,KAC3B,KAAK,aAAa,WAAWA,CAAO,GACpC,KAAK,WAAWA,MAEhB,KAAK,gBAAgB,SAAS,GAC9B,KAAK,WAAW,IAEZ,OAAO,MAAM,SACb,OAAO,MAAM;AAAA,MACT;AAAA,MACA,IAAI,KAAK,SAAS;AAAA,MAClB;AAAA,MACA;AAAA,QACI,QAAQ,CAAC,GAAGH,CAAc;AAAA,MAAA;AAAA,IAC9B,IAIZ,KAAK,cAAc,WAAWI,CAAQ;AAAA,EAC1C;AAAA,EAEA,IAAW,UAA+B;AACtC,WAAO,KAAK;AAAA,EAChB;AAAA,EAIU,eAAeD,GAA0B;AAC/C,WAAOH,EAAe,SAASG,CAAO;AAAA,EAC1C;AAAA,EAIU,cAAoB;AAQ1B,IAPqB,KAAK;AAAA,MACtB,IAAI,YAAY,SAAS;AAAA,QACrB,UAAU;AAAA,QACV,SAAS;AAAA,QACT,YAAY;AAAA,MAAA,CACf;AAAA,IAAA,KAGD,KAAK,MAAA;AAAA,EAEb;AAAA,EAEO,QAAc;AACjB,SAAK,OAAO;AAAA,EAChB;AAAA,EAEU,cAAcE,GAA4B;AAChD,IAAIA,EAAM,SAAS,YAAY,KAAK,eAChC,KAAK,YAAA;AAAA,EAEb;AAAA,EAEmB,QAAQC,GAA+B;AACtD,UAAM,QAAQA,CAAO,GAEjBA,EAAQ,IAAI,MAAM,MACd,KAAK,OACL,KAAK,iBAAiB,WAAW,KAAK,aAAa,IAEnD,KAAK,oBAAoB,WAAW,KAAK,aAAa;AAAA,EAGlE;AACJ;AA1FWC,EAAA;AAAA,EADNC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAVxBP,EAWX,WAAA,QAAA,CAAA;AAQAM,EAAA;AAAA,EADNC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAlBxBP,EAmBX,WAAA,eAAA,CAAA;AASIM,EAAA;AAAA,EADVC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3BRP,EA4BP,WAAA,WAAA,CAAA;"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export * from './AlertBanner.base.js';
@@ -0,0 +1,5 @@
1
+ import { AlertBannerBase as a } from "./AlertBanner.base.js";
2
+ export {
3
+ a as AlertBannerBase
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,5 @@
1
+ import { SpectrumElement } from '../../shared/base/index.js';
2
+ export declare abstract class AssetBase extends SpectrumElement {
3
+ variant: 'file' | 'folder' | undefined;
4
+ label: string;
5
+ }
@@ -0,0 +1,22 @@
1
+ import { property as a } from "lit/decorators.js";
2
+ import { SpectrumElement as f } from "@spectrum-web-components/core/shared/base/index.js";
3
+ var i = Object.defineProperty, l = (r, p, o, m) => {
4
+ for (var e = void 0, t = r.length - 1, s; t >= 0; t--)
5
+ (s = r[t]) && (e = s(p, o, e) || e);
6
+ return e && i(p, o, e), e;
7
+ };
8
+ class n extends f {
9
+ constructor() {
10
+ super(...arguments), this.label = "";
11
+ }
12
+ }
13
+ l([
14
+ a({ type: String, reflect: !0 })
15
+ ], n.prototype, "variant");
16
+ l([
17
+ a()
18
+ ], n.prototype, "label");
19
+ export {
20
+ n as AssetBase
21
+ };
22
+ //# sourceMappingURL=Asset.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Asset.base.js","sources":["../../../components/asset/Asset.base.ts"],"sourcesContent":["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@spectrum-web-components/core/shared/base/index.js';\n\nexport abstract class AssetBase extends SpectrumElement {\n @property({ type: String, reflect: true })\n public variant: 'file' | 'folder' | undefined;\n\n @property()\n public label = '';\n}\n"],"names":["AssetBase","SpectrumElement","__decorateClass","property"],"mappings":";;;;;;;AAgBO,MAAeA,UAAkBC,EAAgB;AAAA,EAAjD,cAAA;AAAA,UAAA,GAAA,SAAA,GAKH,KAAO,QAAQ;AAAA,EAAA;AACnB;AAJWC,EAAA;AAAA,EADNC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GADvBH,EAEX,WAAA,SAAA;AAGAE,EAAA;AAAA,EADNC,EAAA;AAAS,GAJQH,EAKX,WAAA,OAAA;"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export * from './Asset.base.js';
@@ -0,0 +1,5 @@
1
+ import { AssetBase as o } from "./Asset.base.js";
2
+ export {
3
+ o as AssetBase
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,84 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { SpectrumElement } from '../../shared/base/index.js';
3
+ import { BadgeVariant, FixedValues } from './Badge.types.js';
4
+ declare const BadgeBase_base: typeof SpectrumElement & {
5
+ new (...args: any[]): import('../../shared/observe-slot-presence.js').SlotPresenceObservingInterface;
6
+ prototype: import('../../shared/observe-slot-presence.js').SlotPresenceObservingInterface;
7
+ } & {
8
+ new (...args: any[]): import('../../shared/observe-slot-text.js').SlotTextObservingInterface;
9
+ prototype: import('../../shared/observe-slot-text.js').SlotTextObservingInterface;
10
+ } & {
11
+ new (...args: any[]): import('../../shared/base/index.js').SizedElementInterface;
12
+ prototype: import('../../shared/base/index.js').SizedElementInterface;
13
+ } & import('../../shared/base/sizedMixin.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
+ export declare abstract class BadgeBase extends BadgeBase_base {
24
+ /**
25
+ * @internal
26
+ *
27
+ * A readonly array of the valid color variants for the badge.
28
+ *
29
+ * This is an actual internal property, intended not for customer use
30
+ * but for use in internal validation logic, stories, tests, etc.
31
+ *
32
+ * Because S1 and S2 support different color variants, the value of this
33
+ * property must be set in each subclass.
34
+ */
35
+ static readonly VARIANTS_COLOR: readonly string[];
36
+ /**
37
+ * @internal
38
+ *
39
+ * A readonly array of all valid variants for the badge.
40
+ *
41
+ * This is an actual internal property, intended not for customer use
42
+ * but for use in internal validation logic, stories, tests, etc.
43
+ *
44
+ * Because S1 and S2 support different variants, the value of this
45
+ * property must be set in each subclass.
46
+ */
47
+ static readonly VARIANTS: readonly string[];
48
+ /**
49
+ * @internal
50
+ *
51
+ * The variant of the badge.
52
+ *
53
+ * This is a public property, but its valid values vary between S1 and S2,
54
+ * so the property (and its docs) need to be redefined in each subclass.
55
+ *
56
+ * The type declared here is a union of the valid values for S1 and S2,
57
+ * and should be narrowed in each subclass.
58
+ */
59
+ variant: BadgeVariant;
60
+ /**
61
+ * @internal
62
+ */
63
+ static readonly FIXED_VALUES: readonly string[];
64
+ /**
65
+ * @internal
66
+ */
67
+ static readonly VARIANTS_SEMANTIC: readonly string[];
68
+ /**
69
+ * The fixed position of the badge.
70
+ *
71
+ * @todo The purpose of the bespoke getter and setter is unclear, as it
72
+ * looks like they may be behaving just like a standard Lit reactive
73
+ * property. Explore replacing after the Barebones milestone.
74
+ */
75
+ get fixed(): FixedValues | undefined;
76
+ set fixed(fixed: FixedValues | undefined);
77
+ private _fixed?;
78
+ /**
79
+ * @internal Used for rendering gap when the badge has an icon.
80
+ */
81
+ protected get hasIcon(): boolean;
82
+ protected update(changedProperties: PropertyValues): void;
83
+ }
84
+ export {};
@@ -0,0 +1,74 @@
1
+ import { property as a } from "lit/decorators.js";
2
+ import { SizedMixin as u, SpectrumElement as l } from "@spectrum-web-components/core/shared/base/index.js";
3
+ import { ObserveSlotPresence as f } from "@spectrum-web-components/core/shared/observe-slot-presence.js";
4
+ import { ObserveSlotText as h } from "@spectrum-web-components/core/shared/observe-slot-text.js";
5
+ import { FIXED_VALUES as m, BADGE_VARIANTS_SEMANTIC as d } from "./Badge.types.js";
6
+ var A = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, c = (r, t, e, i) => {
7
+ for (var s = i > 1 ? void 0 : i ? _(t, e) : t, o = r.length - 1, n; o >= 0; o--)
8
+ (n = r[o]) && (s = (i ? n(t, e, s) : n(s)) || s);
9
+ return i && s && A(t, e, s), s;
10
+ };
11
+ class p extends u(
12
+ h(f(l, '[slot="icon"]'), ""),
13
+ {
14
+ noDefaultSize: !0
15
+ }
16
+ ) {
17
+ constructor() {
18
+ super(...arguments), this.variant = "informative";
19
+ }
20
+ static {
21
+ this.FIXED_VALUES = m;
22
+ }
23
+ static {
24
+ this.VARIANTS_SEMANTIC = d;
25
+ }
26
+ get fixed() {
27
+ return this._fixed;
28
+ }
29
+ set fixed(t) {
30
+ if (t === this.fixed)
31
+ return;
32
+ const e = this.fixed;
33
+ this._fixed = t, t ? this.setAttribute("fixed", t) : this.removeAttribute("fixed"), this.requestUpdate("fixed", e);
34
+ }
35
+ // ──────────────────────
36
+ // IMPLEMENTATION
37
+ // ──────────────────────
38
+ /**
39
+ * @internal Used for rendering gap when the badge has an icon.
40
+ */
41
+ get hasIcon() {
42
+ return this.slotContentIsPresent;
43
+ }
44
+ update(t) {
45
+ if (super.update(t), window.__swc?.DEBUG) {
46
+ const e = this.constructor;
47
+ e.VARIANTS.includes(this.variant) || window.__swc.warn(
48
+ this,
49
+ `<${this.localName}> element expect the "variant" attribute to be one of the following:`,
50
+ "https://opensource.adobe.com/spectrum-web-components/components/badge/#variants",
51
+ {
52
+ issues: [...e.VARIANTS]
53
+ }
54
+ ), "outline" in this && this.outline === !0 && !e.VARIANTS_SEMANTIC.includes(this.variant) && window.__swc.warn(
55
+ this,
56
+ `<${this.localName}> element only supports the outline styling if the variant is a semantic color variant.`,
57
+ "https://opensource.adobe.com/spectrum-web-components/components/badge/#variants",
58
+ {
59
+ issues: [...e.VARIANTS_SEMANTIC]
60
+ }
61
+ );
62
+ }
63
+ }
64
+ }
65
+ c([
66
+ a({ type: String, reflect: !0 })
67
+ ], p.prototype, "variant", 2);
68
+ c([
69
+ a({ reflect: !0 })
70
+ ], p.prototype, "fixed", 1);
71
+ export {
72
+ p as BadgeBase
73
+ };
74
+ //# sourceMappingURL=Badge.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.base.js","sources":["../../../components/badge/Badge.base.ts"],"sourcesContent":["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport {\n SizedMixin,\n SpectrumElement,\n} from '@spectrum-web-components/core/shared/base/index.js';\nimport { ObserveSlotPresence } from '@spectrum-web-components/core/shared/observe-slot-presence.js';\nimport { ObserveSlotText } from '@spectrum-web-components/core/shared/observe-slot-text.js';\n\nimport {\n BADGE_VARIANTS_SEMANTIC,\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 */\nexport abstract class BadgeBase extends SizedMixin(\n ObserveSlotText(ObserveSlotPresence(SpectrumElement, '[slot=\"icon\"]'), ''),\n {\n noDefaultSize: true,\n }\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 = 'informative';\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 * @todo The purpose of the bespoke getter and setter is unclear, as it\n * looks like they may be behaving just like a standard Lit reactive\n * property. Explore replacing after the Barebones milestone.\n */\n @property({ reflect: true })\n public get fixed(): FixedValues | undefined {\n return this._fixed;\n }\n\n public set fixed(fixed: FixedValues | undefined) {\n if (fixed === this.fixed) {\n return;\n }\n const oldValue = this.fixed;\n this._fixed = fixed;\n if (fixed) {\n this.setAttribute('fixed', fixed);\n } else {\n this.removeAttribute('fixed');\n }\n this.requestUpdate('fixed', oldValue);\n }\n\n private _fixed?: FixedValues;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n /**\n * @internal 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 super.update(changedProperties);\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 expect 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 }\n}\n"],"names":["BadgeBase","SizedMixin","ObserveSlotText","ObserveSlotPresence","SpectrumElement","FIXED_VALUES","BADGE_VARIANTS_SEMANTIC","fixed","oldValue","changedProperties","constructor","__decorateClass","property"],"mappings":";;;;;;;;;;AAqCO,MAAeA,UAAkBC;AAAA,EACpCC,EAAgBC,EAAoBC,GAAiB,eAAe,GAAG,EAAE;AAAA,EACzE;AAAA,IACI,eAAe;AAAA,EAAA;AAEvB,EAAE;AAAA,EALK,cAAA;AAAA,UAAA,GAAA,SAAA,GAgDH,KAAO,UAAwB;AAAA,EAAA;AAAA,EAS/B,OAAA;AAAA,SAAgB,eAAkCC;AAAA,EAAA;AAAA,EAKlD,OAAA;AAAA,SAAgB,oBACZC;AAAA,EAAA;AAAA,EAUJ,IAAW,QAAiC;AACxC,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAW,MAAMC,GAAgC;AAC7C,QAAIA,MAAU,KAAK;AACf;AAEJ,UAAMC,IAAW,KAAK;AACtB,SAAK,SAASD,GACVA,IACA,KAAK,aAAa,SAASA,CAAK,IAEhC,KAAK,gBAAgB,OAAO,GAEhC,KAAK,cAAc,SAASC,CAAQ;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,IAAc,UAAmB;AAC7B,WAAO,KAAK;AAAA,EAChB;AAAA,EAEmB,OAAOC,GAAyC;AAE/D,QADA,MAAM,OAAOA,CAAiB,GAC1B,OAAO,OAAO,OAAO;AACrB,YAAMC,IAAc,KAAK;AACzB,MAAKA,EAAY,SAAS,SAAS,KAAK,OAAO,KAC3C,OAAO,MAAM;AAAA,QACT;AAAA,QACA,IAAI,KAAK,SAAS;AAAA,QAClB;AAAA,QACA;AAAA,UACI,QAAQ,CAAC,GAAGA,EAAY,QAAQ;AAAA,QAAA;AAAA,MACpC,GAKJ,aAAa,QACZ,KAA8B,YAAY,MAC3C,CAACA,EAAY,kBAAkB,SAAS,KAAK,OAAO,KAEpD,OAAO,MAAM;AAAA,QACT;AAAA,QACA,IAAI,KAAK,SAAS;AAAA,QAClB;AAAA,QACA;AAAA,UACI,QAAQ,CAAC,GAAGA,EAAY,iBAAiB;AAAA,QAAA;AAAA,MAC7C;AAAA,IAGZ;AAAA,EACJ;AACJ;AAvFWC,EAAA;AAAA,EADNC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA/CvBZ,EAgDX,WAAA,WAAA,CAAA;AAyBIW,EAAA;AAAA,EADVC,EAAS,EAAE,SAAS,GAAA,CAAM;AAAA,GAxETZ,EAyEP,WAAA,SAAA,CAAA;"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export declare const FIXED_VALUES: readonly ["inline-start", "inline-end", "block-start", "block-end"];
13
+ export type FixedValues = (typeof FIXED_VALUES)[number];
14
+ export declare const BADGE_VARIANTS_SEMANTIC: readonly ["accent", "neutral", "informative", "positive", "negative", "notice"];
15
+ export declare const BADGE_VARIANTS_COLOR_S1: readonly ["fuchsia", "indigo", "magenta", "purple", "seafoam", "yellow", "gray", "red", "orange", "chartreuse", "celery", "green", "cyan", "blue"];
16
+ export declare const BADGE_VARIANTS_COLOR_S2: readonly ["fuchsia", "indigo", "magenta", "purple", "seafoam", "yellow", "gray", "red", "orange", "chartreuse", "celery", "green", "cyan", "blue", "pink", "turquoise", "brown", "cinnamon", "silver"];
17
+ export declare const BADGE_VARIANTS_S1: readonly ["accent", "neutral", "informative", "positive", "negative", "notice", "fuchsia", "indigo", "magenta", "purple", "seafoam", "yellow", "gray", "red", "orange", "chartreuse", "celery", "green", "cyan", "blue"];
18
+ export declare const BADGE_VARIANTS_S2: readonly ["accent", "neutral", "informative", "positive", "negative", "notice", "fuchsia", "indigo", "magenta", "purple", "seafoam", "yellow", "gray", "red", "orange", "chartreuse", "celery", "green", "cyan", "blue", "pink", "turquoise", "brown", "cinnamon", "silver"];
19
+ export type BadgeVariantS1 = (typeof BADGE_VARIANTS_S1)[number];
20
+ export type BadgeVariantS2 = (typeof BADGE_VARIANTS_S2)[number];
21
+ export type BadgeVariant = BadgeVariantS1 | BadgeVariantS2;
@@ -0,0 +1,50 @@
1
+ const o = [
2
+ "inline-start",
3
+ "inline-end",
4
+ "block-start",
5
+ "block-end"
6
+ ], e = [
7
+ "accent",
8
+ "neutral",
9
+ "informative",
10
+ "positive",
11
+ "negative",
12
+ "notice"
13
+ ], n = [
14
+ "fuchsia",
15
+ "indigo",
16
+ "magenta",
17
+ "purple",
18
+ "seafoam",
19
+ "yellow",
20
+ "gray",
21
+ "red",
22
+ "orange",
23
+ "chartreuse",
24
+ "celery",
25
+ "green",
26
+ "cyan",
27
+ "blue"
28
+ ], t = [
29
+ ...n,
30
+ "pink",
31
+ "turquoise",
32
+ "brown",
33
+ "cinnamon",
34
+ "silver"
35
+ ], i = [
36
+ ...e,
37
+ ...n
38
+ ], A = [
39
+ ...e,
40
+ ...t
41
+ ];
42
+ export {
43
+ n as BADGE_VARIANTS_COLOR_S1,
44
+ t as BADGE_VARIANTS_COLOR_S2,
45
+ i as BADGE_VARIANTS_S1,
46
+ A as BADGE_VARIANTS_S2,
47
+ e as BADGE_VARIANTS_SEMANTIC,
48
+ o as FIXED_VALUES
49
+ };
50
+ //# sourceMappingURL=Badge.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.types.js","sources":["../../../components/badge/Badge.types.ts"],"sourcesContent":["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/*\n * @todo The S1 types can be removed once we are no longer maintaining 1st-gen.\n */\n\nexport const FIXED_VALUES = [\n 'inline-start',\n 'inline-end',\n 'block-start',\n 'block-end',\n] as const;\n\nexport type FixedValues = (typeof FIXED_VALUES)[number];\n\nexport const BADGE_VARIANTS_SEMANTIC = [\n 'accent',\n 'neutral',\n 'informative',\n 'positive',\n 'negative',\n 'notice',\n] as const;\n\nexport const BADGE_VARIANTS_COLOR_S1 = [\n 'fuchsia',\n 'indigo',\n 'magenta',\n 'purple',\n 'seafoam',\n 'yellow',\n 'gray',\n 'red',\n 'orange',\n 'chartreuse',\n 'celery',\n 'green',\n 'cyan',\n 'blue',\n] as const;\n\nexport const BADGE_VARIANTS_COLOR_S2 = [\n ...BADGE_VARIANTS_COLOR_S1,\n 'pink',\n 'turquoise',\n 'brown',\n 'cinnamon',\n 'silver',\n] as const;\n\nexport const BADGE_VARIANTS_S1 = [\n ...BADGE_VARIANTS_SEMANTIC,\n ...BADGE_VARIANTS_COLOR_S1,\n] as const;\n\nexport const BADGE_VARIANTS_S2 = [\n ...BADGE_VARIANTS_SEMANTIC,\n ...BADGE_VARIANTS_COLOR_S2,\n] as const;\n\nexport type BadgeVariantS1 = (typeof BADGE_VARIANTS_S1)[number];\nexport type BadgeVariantS2 = (typeof BADGE_VARIANTS_S2)[number];\nexport type BadgeVariant = BadgeVariantS1 | BadgeVariantS2;\n"],"names":["FIXED_VALUES","BADGE_VARIANTS_SEMANTIC","BADGE_VARIANTS_COLOR_S1","BADGE_VARIANTS_COLOR_S2","BADGE_VARIANTS_S1","BADGE_VARIANTS_S2"],"mappings":"AAgBO,MAAMA,IAAe;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAIaC,IAA0B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAEaC,IAA0B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAEaC,IAA0B;AAAA,EACnC,GAAGD;AAAA,EACH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAEaE,IAAoB;AAAA,EAC7B,GAAGH;AAAA,EACH,GAAGC;AACP,GAEaG,IAAoB;AAAA,EAC7B,GAAGJ;AAAA,EACH,GAAGE;AACP;"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export * from './Badge.base.js';
13
+ export * from './Badge.types.js';
@@ -0,0 +1,12 @@
1
+ import { BadgeBase as S } from "./Badge.base.js";
2
+ import { BADGE_VARIANTS_COLOR_S1 as B, BADGE_VARIANTS_COLOR_S2 as I, BADGE_VARIANTS_S1 as R, BADGE_VARIANTS_S2 as D, BADGE_VARIANTS_SEMANTIC as N, FIXED_VALUES as T } from "./Badge.types.js";
3
+ export {
4
+ B as BADGE_VARIANTS_COLOR_S1,
5
+ I as BADGE_VARIANTS_COLOR_S2,
6
+ R as BADGE_VARIANTS_S1,
7
+ D as BADGE_VARIANTS_S2,
8
+ N as BADGE_VARIANTS_SEMANTIC,
9
+ S as BadgeBase,
10
+ T as FIXED_VALUES
11
+ };
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,33 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { SpectrumElement } from '../../shared/base/index.js';
3
+ import { DividerStaticColor } from './Divider.types.js';
4
+ declare const DividerBase_base: typeof SpectrumElement & {
5
+ new (...args: any[]): import('../../shared/base/index.js').SizedElementInterface;
6
+ prototype: import('../../shared/base/index.js').SizedElementInterface;
7
+ } & import('../../shared/base/sizedMixin.js').SizedElementConstructor;
8
+ /**
9
+ * @element swc-divider
10
+ */
11
+ export declare abstract class DividerBase extends DividerBase_base {
12
+ /**
13
+ * @internal
14
+ *
15
+ * A readonly array of the valid static color variants for the divider.
16
+ */
17
+ static readonly STATIC_COLORS: readonly string[];
18
+ /**
19
+ * Whether the divider is vertical. If false, the divider is horizontal. The default is false.
20
+ */
21
+ vertical: boolean;
22
+ /**
23
+ * The static color variant to use for the divider.
24
+ *
25
+ * @todo Add runtime validation separately. When implementing,
26
+ * access STATIC_COLORS from this.constructor.STATIC_COLORS to ensure
27
+ * correct values are used.
28
+ */
29
+ staticColor?: DividerStaticColor;
30
+ protected firstUpdated(changed: PropertyValues<this>): void;
31
+ protected updated(changed: PropertyValues<this>): void;
32
+ }
33
+ export {};
@@ -0,0 +1,35 @@
1
+ import { property as s } from "lit/decorators.js";
2
+ import { SizedMixin as u, SpectrumElement as f } from "@spectrum-web-components/core/shared/base/index.js";
3
+ import { DIVIDER_VALID_SIZES as c, DIVIDER_STATIC_COLORS as d } from "./Divider.types.js";
4
+ var n = Object.defineProperty, p = (r, t, a, v) => {
5
+ for (var e = void 0, i = r.length - 1, o; i >= 0; i--)
6
+ (o = r[i]) && (e = o(t, a, e) || e);
7
+ return e && n(t, a, e), e;
8
+ };
9
+ class l extends u(f, {
10
+ validSizes: c,
11
+ noDefaultSize: !0
12
+ }) {
13
+ constructor() {
14
+ super(...arguments), this.vertical = !1;
15
+ }
16
+ static {
17
+ this.STATIC_COLORS = d;
18
+ }
19
+ firstUpdated(t) {
20
+ super.firstUpdated(t), this.setAttribute("role", "separator");
21
+ }
22
+ updated(t) {
23
+ super.updated(t), t.has("vertical") && (this.vertical ? this.setAttribute("aria-orientation", "vertical") : this.removeAttribute("aria-orientation"));
24
+ }
25
+ }
26
+ p([
27
+ s({ type: Boolean, reflect: !0 })
28
+ ], l.prototype, "vertical");
29
+ p([
30
+ s({ reflect: !0, attribute: "static-color" })
31
+ ], l.prototype, "staticColor");
32
+ export {
33
+ l as DividerBase
34
+ };
35
+ //# sourceMappingURL=Divider.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Divider.base.js","sources":["../../../components/divider/Divider.base.ts"],"sourcesContent":["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport {\n SizedMixin,\n SpectrumElement,\n} from '@spectrum-web-components/core/shared/base/index.js';\n\nimport {\n DIVIDER_STATIC_COLORS,\n DIVIDER_VALID_SIZES,\n type DividerStaticColor,\n} from './Divider.types.js';\n\n/**\n * @element swc-divider\n */\nexport abstract class DividerBase extends SizedMixin(SpectrumElement, {\n validSizes: DIVIDER_VALID_SIZES,\n noDefaultSize: true,\n}) {\n /**\n * @internal\n *\n * A readonly array of the valid static color variants for the divider.\n */\n static readonly STATIC_COLORS: readonly string[] = DIVIDER_STATIC_COLORS;\n /**\n * Whether the divider is vertical. If false, the divider is horizontal. The default is false.\n */\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n /**\n * The static color variant to use for the divider.\n *\n * @todo Add runtime validation separately. When implementing,\n * access STATIC_COLORS from this.constructor.STATIC_COLORS to ensure\n * correct values are used.\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: DividerStaticColor;\n\n protected override firstUpdated(changed: PropertyValues<this>): void {\n super.firstUpdated(changed);\n this.setAttribute('role', 'separator');\n }\n\n protected override updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n if (changed.has('vertical')) {\n if (this.vertical) {\n this.setAttribute('aria-orientation', 'vertical');\n } else {\n this.removeAttribute('aria-orientation');\n }\n }\n }\n}\n"],"names":["DividerBase","SizedMixin","SpectrumElement","DIVIDER_VALID_SIZES","DIVIDER_STATIC_COLORS","changed","__decorateClass","property"],"mappings":";;;;;;;;AA6BO,MAAeA,UAAoBC,EAAWC,GAAiB;AAAA,EAClE,YAAYC;AAAA,EACZ,eAAe;AACnB,CAAC,EAAE;AAAA,EAHI,cAAA;AAAA,UAAA,GAAA,SAAA,GAcH,KAAO,WAAW;AAAA,EAAA;AAAA,EALlB,OAAA;AAAA,SAAgB,gBAAmCC;AAAA,EAAA;AAAA,EAiBhC,aAAaC,GAAqC;AACjE,UAAM,aAAaA,CAAO,GAC1B,KAAK,aAAa,QAAQ,WAAW;AAAA,EACzC;AAAA,EAEmB,QAAQA,GAAqC;AAC5D,UAAM,QAAQA,CAAO,GACjBA,EAAQ,IAAI,UAAU,MAClB,KAAK,WACL,KAAK,aAAa,oBAAoB,UAAU,IAEhD,KAAK,gBAAgB,kBAAkB;AAAA,EAGnD;AACJ;AA3BWC,EAAA;AAAA,EADNC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAbxBP,EAcX,WAAA,UAAA;AAUAM,EAAA;AAAA,EADNC,EAAS,EAAE,SAAS,IAAM,WAAW,gBAAgB;AAAA,GAvBpCP,EAwBX,WAAA,aAAA;"}
@@ -0,0 +1,4 @@
1
+ import { ElementSize } from '../../shared/base/index.js';
2
+ export declare const DIVIDER_VALID_SIZES: ElementSize[];
3
+ export declare const DIVIDER_STATIC_COLORS: readonly ["white", "black"];
4
+ export type DividerStaticColor = (typeof DIVIDER_STATIC_COLORS)[number];
@@ -0,0 +1,6 @@
1
+ const I = ["s", "m", "l"], D = ["white", "black"];
2
+ export {
3
+ D as DIVIDER_STATIC_COLORS,
4
+ I as DIVIDER_VALID_SIZES
5
+ };
6
+ //# sourceMappingURL=Divider.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Divider.types.js","sources":["../../../components/divider/Divider.types.ts"],"sourcesContent":["/**\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { ElementSize } from '@spectrum-web-components/core/shared/base/index.js';\n\nexport const DIVIDER_VALID_SIZES: ElementSize[] = ['s', 'm', 'l'] as const;\nexport const DIVIDER_STATIC_COLORS = ['white', 'black'] as const;\n\nexport type DividerStaticColor = (typeof DIVIDER_STATIC_COLORS)[number];\n"],"names":["DIVIDER_VALID_SIZES","DIVIDER_STATIC_COLORS"],"mappings":"AAcO,MAAMA,IAAqC,CAAC,KAAK,KAAK,GAAG,GACnDC,IAAwB,CAAC,SAAS,OAAO;"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright 2025 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export * from './Divider.base.js';
13
+ export * from './Divider.types.js';
@@ -0,0 +1,8 @@
1
+ import { DividerBase as r } from "./Divider.base.js";
2
+ import { DIVIDER_STATIC_COLORS as o, DIVIDER_VALID_SIZES as S } from "./Divider.types.js";
3
+ export {
4
+ o as DIVIDER_STATIC_COLORS,
5
+ S as DIVIDER_VALID_SIZES,
6
+ r as DividerBase
7
+ };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}