@adobe/spectrum-wc-core 2.0.0-beta.2 → 2.0.0-beta.4

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 (157) hide show
  1. package/README.md +1 -1
  2. package/dist/components/accordion/Accordion.base.js +28 -22
  3. package/dist/components/accordion/Accordion.base.js.map +1 -1
  4. package/dist/components/accordion/AccordionItem.base.d.ts +16 -6
  5. package/dist/components/accordion/AccordionItem.base.js +6 -3
  6. package/dist/components/accordion/AccordionItem.base.js.map +1 -1
  7. package/dist/components/action-group/ActionGroup.base.d.ts +108 -0
  8. package/dist/components/action-group/ActionGroup.base.js +53 -0
  9. package/dist/components/action-group/ActionGroup.base.js.map +1 -0
  10. package/dist/components/action-group/ActionGroup.types.d.ts +17 -0
  11. package/dist/components/action-group/ActionGroup.types.js +12 -0
  12. package/dist/components/action-group/ActionGroup.types.js.map +1 -0
  13. package/dist/components/action-group/index.d.ts +13 -0
  14. package/dist/components/action-group/index.js +3 -0
  15. package/dist/components/alert-banner/AlertBanner.base.js +11 -10
  16. package/dist/components/alert-banner/AlertBanner.base.js.map +1 -1
  17. package/dist/components/asset/Asset.base.d.ts +89 -10
  18. package/dist/components/asset/Asset.base.js +117 -12
  19. package/dist/components/asset/Asset.base.js.map +1 -1
  20. package/dist/components/asset/Asset.types.d.ts +20 -2
  21. package/dist/components/asset/Asset.types.js +10 -2
  22. package/dist/components/asset/Asset.types.js.map +1 -1
  23. package/dist/components/asset/index.js +3 -3
  24. package/dist/components/avatar/Avatar.base.js +18 -22
  25. package/dist/components/avatar/Avatar.base.js.map +1 -1
  26. package/dist/components/badge/Badge.base.d.ts +24 -8
  27. package/dist/components/badge/Badge.base.js +22 -17
  28. package/dist/components/badge/Badge.base.js.map +1 -1
  29. package/dist/components/button/Button.base.d.ts +20 -10
  30. package/dist/components/button/Button.base.js +17 -12
  31. package/dist/components/button/Button.base.js.map +1 -1
  32. package/dist/components/button-group/ButtonGroup.base.js +19 -12
  33. package/dist/components/button-group/ButtonGroup.base.js.map +1 -1
  34. package/dist/components/card/Card.base.d.ts +95 -46
  35. package/dist/components/card/Card.base.js +71 -23
  36. package/dist/components/card/Card.base.js.map +1 -1
  37. package/dist/components/card/Card.types.d.ts +1 -0
  38. package/dist/components/card/Card.types.js +2 -2
  39. package/dist/components/card/Card.types.js.map +1 -1
  40. package/dist/components/card/index.js +3 -3
  41. package/dist/components/divider/Divider.base.js +13 -8
  42. package/dist/components/divider/Divider.base.js.map +1 -1
  43. package/dist/components/dropzone/Dropzone.base.d.ts +74 -0
  44. package/dist/components/dropzone/Dropzone.base.js +82 -0
  45. package/dist/components/dropzone/Dropzone.base.js.map +1 -0
  46. package/dist/components/dropzone/Dropzone.types.d.ts +43 -0
  47. package/dist/components/dropzone/Dropzone.types.js +15 -0
  48. package/dist/components/dropzone/Dropzone.types.js.map +1 -0
  49. package/dist/components/dropzone/index.d.ts +13 -0
  50. package/dist/components/dropzone/index.js +3 -0
  51. package/dist/components/icon/Icon.base.d.ts +11 -7
  52. package/dist/components/icon/Icon.base.js +13 -20
  53. package/dist/components/icon/Icon.base.js.map +1 -1
  54. package/dist/components/illustrated-message/IllustratedMessage.base.d.ts +22 -8
  55. package/dist/components/illustrated-message/IllustratedMessage.base.js +33 -20
  56. package/dist/components/illustrated-message/IllustratedMessage.base.js.map +1 -1
  57. package/dist/components/infield-button/InfieldButton.base.d.ts +28 -0
  58. package/dist/components/infield-button/InfieldButton.base.js +22 -0
  59. package/dist/components/infield-button/InfieldButton.base.js.map +1 -0
  60. package/dist/components/infield-button/InfieldButton.types.d.ts +13 -0
  61. package/dist/components/infield-button/InfieldButton.types.js +11 -0
  62. package/dist/components/infield-button/InfieldButton.types.js.map +1 -0
  63. package/dist/components/infield-button/index.d.ts +13 -0
  64. package/dist/components/infield-button/index.js +3 -0
  65. package/dist/components/meter/Meter.base.js +11 -9
  66. package/dist/components/meter/Meter.base.js.map +1 -1
  67. package/dist/components/popover/Popover.base.d.ts +1 -21
  68. package/dist/components/popover/Popover.base.js +57 -77
  69. package/dist/components/popover/Popover.base.js.map +1 -1
  70. package/dist/components/progress-circle/ProgressCircle.base.d.ts +0 -1
  71. package/dist/components/progress-circle/ProgressCircle.base.js +26 -22
  72. package/dist/components/progress-circle/ProgressCircle.base.js.map +1 -1
  73. package/dist/components/status-light/StatusLight.base.d.ts +1 -1
  74. package/dist/components/status-light/StatusLight.base.js +12 -9
  75. package/dist/components/status-light/StatusLight.base.js.map +1 -1
  76. package/dist/components/tabs/TabPanel.base.d.ts +1 -1
  77. package/dist/components/tabs/TabPanel.base.js.map +1 -1
  78. package/dist/components/tabs/Tabs.base.js +44 -32
  79. package/dist/components/tabs/Tabs.base.js.map +1 -1
  80. package/dist/components/tooltip/Tooltip.base.js +57 -22
  81. package/dist/components/tooltip/Tooltip.base.js.map +1 -1
  82. package/dist/controllers/color-controller/src/color-controller.js +45 -44
  83. package/dist/controllers/color-controller/src/color-controller.js.map +1 -1
  84. package/dist/controllers/drag-and-drop-controller/index.d.ts +12 -0
  85. package/dist/controllers/drag-and-drop-controller/index.js +2 -0
  86. package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.d.ts +68 -0
  87. package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.js +56 -0
  88. package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.js.map +1 -0
  89. package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.d.ts +1 -1
  90. package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.js.map +1 -1
  91. package/dist/controllers/index.d.ts +6 -2
  92. package/dist/controllers/index.js +15 -11
  93. package/dist/controllers/language-resolution.d.ts +1 -1
  94. package/dist/controllers/language-resolution.js.map +1 -1
  95. package/dist/controllers/page-scroll-lock-controller/index.d.ts +12 -0
  96. package/dist/controllers/page-scroll-lock-controller/index.js +2 -0
  97. package/dist/controllers/{page-scroll-lock.js → page-scroll-lock-controller/src/page-scroll-lock.js} +1 -1
  98. package/dist/controllers/page-scroll-lock-controller/src/page-scroll-lock.js.map +1 -0
  99. package/dist/controllers/slot-presence-controller/index.d.ts +12 -0
  100. package/dist/controllers/slot-presence-controller/index.js +2 -0
  101. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.d.ts +57 -0
  102. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js +44 -0
  103. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js.map +1 -0
  104. package/dist/controllers/slot-text-controller/index.d.ts +12 -0
  105. package/dist/controllers/slot-text-controller/index.js +2 -0
  106. package/dist/controllers/slot-text-controller/src/slot-text-controller.d.ts +92 -0
  107. package/dist/controllers/slot-text-controller/src/slot-text-controller.js +53 -0
  108. package/dist/controllers/slot-text-controller/src/slot-text-controller.js.map +1 -0
  109. package/dist/controllers/trigger-press-controller/index.d.ts +12 -0
  110. package/dist/controllers/trigger-press-controller/index.js +2 -0
  111. package/dist/controllers/trigger-press-controller/src/trigger-press-controller.d.ts +149 -0
  112. package/dist/controllers/trigger-press-controller/src/trigger-press-controller.js +43 -0
  113. package/dist/controllers/trigger-press-controller/src/trigger-press-controller.js.map +1 -0
  114. package/dist/directives/index.d.ts +1 -1
  115. package/dist/element/define-element.js +1 -1
  116. package/dist/element/define-element.js.map +1 -1
  117. package/dist/element/index.d.ts +1 -1
  118. package/dist/element/index.js +2 -2
  119. package/dist/element/spectrum-element.d.ts +58 -15
  120. package/dist/element/spectrum-element.js +56 -37
  121. package/dist/element/spectrum-element.js.map +1 -1
  122. package/dist/element/version.d.ts +3 -3
  123. package/dist/element/version.js +1 -1
  124. package/dist/element/version.js.map +1 -1
  125. package/dist/mixins/index.d.ts +0 -2
  126. package/dist/mixins/index.js +4 -6
  127. package/dist/mixins/linear-progress-mixin.d.ts +1 -2
  128. package/dist/mixins/linear-progress-mixin.js +35 -34
  129. package/dist/mixins/linear-progress-mixin.js.map +1 -1
  130. package/dist/mixins/pending-mixin.js +12 -11
  131. package/dist/mixins/pending-mixin.js.map +1 -1
  132. package/dist/mixins/sized-mixin.d.ts +28 -0
  133. package/dist/mixins/sized-mixin.js +6 -6
  134. package/dist/mixins/sized-mixin.js.map +1 -1
  135. package/dist/utils/dev-validation.d.ts +88 -0
  136. package/dist/utils/dev-validation.js +33 -0
  137. package/dist/utils/dev-validation.js.map +1 -0
  138. package/dist/utils/index.d.ts +2 -0
  139. package/dist/utils/index.js +12 -10
  140. package/dist/utils/is-focus-visible-in-tree.d.ts +33 -0
  141. package/dist/utils/is-focus-visible-in-tree.js +11 -0
  142. package/dist/utils/is-focus-visible-in-tree.js.map +1 -0
  143. package/dist/utils/resolve-trigger.js.map +1 -1
  144. package/package.json +213 -18
  145. package/CHANGELOG.md +0 -125
  146. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/defineProperty.js +0 -12
  147. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPrimitive.js +0 -14
  148. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPropertyKey.js +0 -9
  149. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/typeof.js +0 -11
  150. package/dist/controllers/page-scroll-lock.js.map +0 -1
  151. package/dist/mixins/observe-slot-presence.d.ts +0 -12
  152. package/dist/mixins/observe-slot-presence.js +0 -40
  153. package/dist/mixins/observe-slot-presence.js.map +0 -1
  154. package/dist/mixins/observe-slot-text.d.ts +0 -11
  155. package/dist/mixins/observe-slot-text.js +0 -60
  156. package/dist/mixins/observe-slot-text.js.map +0 -1
  157. /package/dist/controllers/{page-scroll-lock.d.ts → page-scroll-lock-controller/src/page-scroll-lock.d.ts} +0 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Abstract base classes for Spectrum Web Components.
4
4
 
5
- This package provides the behavior layer for 2nd-gen Spectrum Web Components and is **not intended for direct external use**. It is independent from 1st-gen — there is no runtime dependency between them.
5
+ This package provides the behavior layer for gen2 Spectrum Web Components and is **not intended for direct external use**. It is independent from 1st-gen — there is no runtime dependency between them.
6
6
 
7
7
  For more information, visit the [Spectrum Web Components repository](https://github.com/adobe/spectrum-web-components).
8
8
 
@@ -1,30 +1,31 @@
1
- import { ACCORDION_VALID_SIZES as e, SWC_ACCORDION_ITEM_TOGGLE_EVENT as t } from "./Accordion.types.js";
2
- import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
3
- import { AccordionItemBase as r } from "./AccordionItem.base.js";
4
- import { property as i } from "lit/decorators.js";
5
- import { LiveSelectionController as a } from "@adobe/spectrum-wc-core/controllers/index.js";
6
- import { SpectrumElement as o } from "@adobe/spectrum-wc-core/element/index.js";
7
- import { SizedMixin as s } from "@adobe/spectrum-wc-core/mixins/index.js";
1
+ import { ACCORDION_DENSITIES as e, ACCORDION_VALID_SIZES as t, SWC_ACCORDION_ITEM_TOGGLE_EVENT as n } from "./Accordion.types.js";
2
+ import { __decorate as r } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
3
+ import { AccordionItemBase as i } from "./AccordionItem.base.js";
4
+ import { property as a } from "lit/decorators.js";
5
+ import { LiveSelectionController as o } from "@adobe/spectrum-wc-core/controllers/index.js";
6
+ import { SpectrumElement as s } from "@adobe/spectrum-wc-core/element/index.js";
7
+ import { SizedMixin as c } from "@adobe/spectrum-wc-core/mixins/index.js";
8
+ import { validateEnum as l } from "@adobe/spectrum-wc-core/utils/index.js";
8
9
  //#region components/accordion/Accordion.base.ts
9
- var c = class extends s(o, {
10
- validSizes: e,
10
+ var u = class extends c(s, {
11
+ validSizes: t,
11
12
  defaultSize: "m"
12
13
  }) {
13
14
  constructor(...e) {
14
- super(...e), this.allowMultiple = !1, this.level = 3, this.density = "regular", this.quiet = !1, this.disabled = !1, this.selectionController = new a(this, {
15
+ super(...e), this.allowMultiple = !1, this.level = 3, this.density = "regular", this.quiet = !1, this.disabled = !1, this.selectionController = new o(this, {
15
16
  getItems: () => this.assignedItems(),
16
17
  readSelected: (e) => e.open,
17
18
  deselect: (e) => {
18
19
  e.open = !1;
19
20
  },
20
- observeEvent: t,
21
+ observeEvent: n,
21
22
  mode: () => this.allowMultiple ? "multiple" : "single"
22
23
  });
23
24
  }
24
25
  assignedItems() {
25
26
  var e;
26
27
  let t = (e = this.renderRoot) == null ? void 0 : e.querySelector("slot");
27
- return t ? t.assignedElements({ flatten: !0 }).filter((e) => e instanceof r) : [];
28
+ return t ? t.assignedElements({ flatten: !0 }).filter((e) => e instanceof i) : [];
28
29
  }
29
30
  firstUpdated(e) {
30
31
  super.firstUpdated(e), this.selectionController.refresh();
@@ -32,32 +33,37 @@ var c = class extends s(o, {
32
33
  syncAccordionItems() {
33
34
  for (let e of this.assignedItems()) e.setManagedHeading(this.level), e.size = this.size, e.setManagedParentDisabled(this.disabled);
34
35
  }
35
- update(e) {
36
- if (e.has("level")) {
36
+ update(t) {
37
+ if (t.has("density") && l(this, {
38
+ prop: "density",
39
+ value: this.density,
40
+ valid: e,
41
+ url: "https://spectrum-web-components.adobe.com/?path=/docs/components-accordion--docs"
42
+ }), t.has("level")) {
37
43
  let e = Math.min(6, Math.max(2, this.level));
38
44
  this.level !== e && (this.level = e);
39
45
  }
40
- (e.has("level") || e.has("size") || e.has("disabled")) && this.syncAccordionItems(), e.has("allowMultiple") && e.get("allowMultiple") === !0 && !this.allowMultiple && this.selectionController.refresh(), e.has("disabled") && e.get("disabled") === !0 && !this.disabled && !this.allowMultiple && this.selectionController.refresh(), super.update(e);
46
+ (t.has("level") || t.has("size") || t.has("disabled")) && this.syncAccordionItems(), t.has("allowMultiple") && t.get("allowMultiple") === !0 && !this.allowMultiple && this.selectionController.refresh(), t.has("disabled") && t.get("disabled") === !0 && !this.disabled && !this.allowMultiple && this.selectionController.refresh(), super.update(t);
41
47
  }
42
48
  };
43
- n([i({
49
+ r([a({
44
50
  type: Boolean,
45
51
  reflect: !0,
46
52
  attribute: "allow-multiple"
47
- })], c.prototype, "allowMultiple", void 0), n([i({
53
+ })], u.prototype, "allowMultiple", void 0), r([a({
48
54
  type: Number,
49
55
  reflect: !0
50
- })], c.prototype, "level", void 0), n([i({
56
+ })], u.prototype, "level", void 0), r([a({
51
57
  type: String,
52
58
  reflect: !0
53
- })], c.prototype, "density", void 0), n([i({
59
+ })], u.prototype, "density", void 0), r([a({
54
60
  type: Boolean,
55
61
  reflect: !0
56
- })], c.prototype, "quiet", void 0), n([i({
62
+ })], u.prototype, "quiet", void 0), r([a({
57
63
  type: Boolean,
58
64
  reflect: !0
59
- })], c.prototype, "disabled", void 0);
65
+ })], u.prototype, "disabled", void 0);
60
66
  //#endregion
61
- export { c as AccordionBase };
67
+ export { u as AccordionBase };
62
68
 
63
69
  //# sourceMappingURL=Accordion.base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.base.js","names":[],"sources":["../../../components/accordion/Accordion.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 { LiveSelectionController } from '@adobe/spectrum-wc-core/controllers/index.js';\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { SizedMixin } from '@adobe/spectrum-wc-core/mixins/index.js';\n\nimport {\n ACCORDION_VALID_SIZES,\n type AccordionDensity,\n type AccordionHeadingLevel,\n type AccordionSize,\n SWC_ACCORDION_ITEM_TOGGLE_EVENT,\n} from './Accordion.types.js';\nimport { AccordionItemBase } from './AccordionItem.base.js';\n\n/**\n * Base class for accordion components. Manages item propagation, heading\n * level, density, and the exclusive-open constraint.\n *\n * @attribute {boolean} allowMultiple - Reflected as `allow-multiple`. When set,\n * multiple items may be open at the same time.\n * @attribute {number} level - Heading level (2–6) applied to every item header.\n * Values outside that range are clamped.\n * @attribute {AccordionSize} size - Size applied to all items.\n * @attribute {AccordionDensity} density - Vertical spacing between items.\n * @attribute {boolean} quiet - Renders the accordion in its quiet visual variant.\n * @attribute {boolean} disabled - Disables all items in the accordion.\n *\n * @slot - One or more `swc-accordion-item` elements.\n */\nexport abstract class AccordionBase extends SizedMixin(SpectrumElement, {\n validSizes: ACCORDION_VALID_SIZES,\n defaultSize: 'm',\n}) {\n // ──────────────────\n // PUBLIC API\n // ──────────────────\n\n /**\n * When set, multiple items may be open at the same time. By default only\n * one item can be open.\n */\n @property({ type: Boolean, reflect: true, attribute: 'allow-multiple' })\n public allowMultiple: boolean = false;\n\n /**\n * Heading level applied to every item header (2–6). Defaults to 3.\n * Values outside that range are clamped.\n */\n @property({ type: Number, reflect: true })\n public level: AccordionHeadingLevel = 3;\n\n /**\n * Size applied to all items. Defaults to `m`.\n */\n declare public size: AccordionSize;\n\n /**\n * Controls vertical spacing between items.\n *\n * @default regular\n */\n @property({ type: String, reflect: true })\n public density: AccordionDensity = 'regular';\n\n /**\n * Renders the accordion in its quiet (no-border) visual variant.\n */\n @property({ type: Boolean, reflect: true })\n public quiet: boolean = false;\n\n /**\n * Disables all items in the accordion. Individual items may also be\n * disabled independently.\n */\n @property({ type: Boolean, reflect: true })\n public disabled: boolean = false;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n private assignedItems(): AccordionItemBase[] {\n const slot = this.renderRoot?.querySelector('slot');\n if (!slot) {\n return [];\n }\n return slot\n .assignedElements({ flatten: true })\n .filter((el): el is AccordionItemBase => el instanceof AccordionItemBase);\n }\n\n // LiveSelectionController observes swc-accordion-item-toggle events and\n // enforces the exclusive-open constraint when allowMultiple is false. Items\n // own their own open state; the controller only closes siblings.\n private readonly selectionController = new LiveSelectionController(this, {\n getItems: () => this.assignedItems(),\n readSelected: (item) => item.open,\n deselect: (item) => {\n item.open = false;\n },\n observeEvent: SWC_ACCORDION_ITEM_TOGGLE_EVENT,\n mode: () => (this.allowMultiple ? 'multiple' : 'single'),\n });\n\n protected override firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n // The controller is event-driven and won't catch items that start open via\n // HTML attributes; read the initial DOM state and enforce the constraint now.\n this.selectionController.refresh();\n }\n\n protected syncAccordionItems(): void {\n for (const item of this.assignedItems()) {\n item.setManagedHeading(this.level);\n item.size = this.size;\n item.setManagedParentDisabled(this.disabled);\n }\n }\n\n protected override update(changedProperties: PropertyValues): void {\n if (changedProperties.has('level')) {\n const clamped = Math.min(\n 6,\n Math.max(2, this.level)\n ) as AccordionHeadingLevel;\n if (this.level !== clamped) {\n this.level = clamped;\n }\n }\n if (\n changedProperties.has('level') ||\n changedProperties.has('size') ||\n changedProperties.has('disabled')\n ) {\n this.syncAccordionItems();\n }\n // When allow-multiple is removed, enforce the stricter single-select\n // constraint over the current DOM state.\n if (\n changedProperties.has('allowMultiple') &&\n changedProperties.get('allowMultiple') === true &&\n !this.allowMultiple\n ) {\n this.selectionController.refresh();\n }\n // When the accordion is re-enabled after being disabled, enforce\n // exclusive-open so items that were opened while disabled are corrected.\n if (\n changedProperties.has('disabled') &&\n changedProperties.get('disabled') === true &&\n !this.disabled &&\n !this.allowMultiple\n ) {\n this.selectionController.refresh();\n }\n super.update(changedProperties);\n }\n}\n"],"mappings":";;;;;;;;AA2CA,IAAsB,IAAtB,cAA4C,EAAW,GAAiB;CACtE,YAAY;CACZ,aAAa;CACd,CAAC,CAAC;;oCAU+B,iBAOM,kBAaH,wBAMX,oBAOG,+BAmBY,IAAI,EAAwB,MAAM;GACvE,gBAAgB,KAAK,eAAe;GACpC,eAAe,MAAS,EAAK;GAC7B,WAAW,MAAS;AAClB,MAAK,OAAO;;GAEd,cAAc;GACd,YAAa,KAAK,gBAAgB,aAAa;GAChD,CAAC;;CArBF,gBAA6C;;EAC3C,IAAM,KAAA,IAAO,KAA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AAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAO1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA"}
1
+ {"version":3,"file":"Accordion.base.js","names":[],"sources":["../../../components/accordion/Accordion.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 { LiveSelectionController } from '@adobe/spectrum-wc-core/controllers/index.js';\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { SizedMixin } from '@adobe/spectrum-wc-core/mixins/index.js';\nimport { validateEnum } from '@adobe/spectrum-wc-core/utils/index.js';\n\nimport {\n ACCORDION_DENSITIES,\n ACCORDION_VALID_SIZES,\n type AccordionDensity,\n type AccordionHeadingLevel,\n type AccordionSize,\n SWC_ACCORDION_ITEM_TOGGLE_EVENT,\n} from './Accordion.types.js';\nimport { AccordionItemBase } from './AccordionItem.base.js';\n\n/**\n * Base class for accordion components. Manages item propagation, heading\n * level, density, and the exclusive-open constraint.\n *\n * @attribute {boolean} allowMultiple - Reflected as `allow-multiple`. When set,\n * multiple items may be open at the same time.\n * @attribute {number} level - Heading level (2–6) applied to every item header.\n * Values outside that range are clamped.\n * @attribute {AccordionSize} size - Size applied to all items.\n * @attribute {AccordionDensity} density - Vertical spacing between items.\n * @attribute {boolean} quiet - Renders the accordion in its quiet visual variant.\n * @attribute {boolean} disabled - Disables all items in the accordion.\n *\n * @slot - One or more `swc-accordion-item` elements.\n */\nexport abstract class AccordionBase extends SizedMixin(SpectrumElement, {\n validSizes: ACCORDION_VALID_SIZES,\n defaultSize: 'm',\n}) {\n // ──────────────────\n // PUBLIC API\n // ──────────────────\n\n /**\n * When set, multiple items may be open at the same time. By default only\n * one item can be open.\n */\n @property({ type: Boolean, reflect: true, attribute: 'allow-multiple' })\n public allowMultiple: boolean = false;\n\n /**\n * Heading level applied to every item header (2–6). Defaults to 3.\n * Values outside that range are clamped.\n */\n @property({ type: Number, reflect: true })\n public level: AccordionHeadingLevel = 3;\n\n /**\n * Size applied to all items. Defaults to `m`.\n */\n declare public size: AccordionSize;\n\n /**\n * Controls vertical spacing between items.\n *\n * @default regular\n */\n @property({ type: String, reflect: true })\n public density: AccordionDensity = 'regular';\n\n /**\n * Renders the accordion in its quiet (no-border) visual variant.\n */\n @property({ type: Boolean, reflect: true })\n public quiet: boolean = false;\n\n /**\n * Disables all items in the accordion. Individual items may also be\n * disabled independently.\n */\n @property({ type: Boolean, reflect: true })\n public disabled: boolean = false;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n private assignedItems(): AccordionItemBase[] {\n const slot = this.renderRoot?.querySelector('slot');\n if (!slot) {\n return [];\n }\n return slot\n .assignedElements({ flatten: true })\n .filter((el): el is AccordionItemBase => el instanceof AccordionItemBase);\n }\n\n // LiveSelectionController observes swc-accordion-item-toggle events and\n // enforces the exclusive-open constraint when allowMultiple is false. Items\n // own their own open state; the controller only closes siblings.\n private readonly selectionController = new LiveSelectionController(this, {\n getItems: () => this.assignedItems(),\n readSelected: (item) => item.open,\n deselect: (item) => {\n item.open = false;\n },\n observeEvent: SWC_ACCORDION_ITEM_TOGGLE_EVENT,\n mode: () => (this.allowMultiple ? 'multiple' : 'single'),\n });\n\n protected override firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n // The controller is event-driven and won't catch items that start open via\n // HTML attributes; read the initial DOM state and enforce the constraint now.\n this.selectionController.refresh();\n }\n\n protected syncAccordionItems(): void {\n for (const item of this.assignedItems()) {\n item.setManagedHeading(this.level);\n item.size = this.size;\n item.setManagedParentDisabled(this.disabled);\n }\n }\n\n protected override update(changedProperties: PropertyValues): void {\n if (changedProperties.has('density')) {\n validateEnum(this, {\n prop: 'density',\n value: this.density,\n valid: ACCORDION_DENSITIES,\n url: 'https://spectrum-web-components.adobe.com/?path=/docs/components-accordion--docs',\n });\n }\n if (changedProperties.has('level')) {\n const clamped = Math.min(\n 6,\n Math.max(2, this.level)\n ) as AccordionHeadingLevel;\n if (this.level !== clamped) {\n this.level = clamped;\n }\n }\n if (\n changedProperties.has('level') ||\n changedProperties.has('size') ||\n changedProperties.has('disabled')\n ) {\n this.syncAccordionItems();\n }\n // When allow-multiple is removed, enforce the stricter single-select\n // constraint over the current DOM state.\n if (\n changedProperties.has('allowMultiple') &&\n changedProperties.get('allowMultiple') === true &&\n !this.allowMultiple\n ) {\n this.selectionController.refresh();\n }\n // When the accordion is re-enabled after being disabled, enforce\n // exclusive-open so items that were opened while disabled are corrected.\n if (\n changedProperties.has('disabled') &&\n changedProperties.get('disabled') === true &&\n !this.disabled &&\n !this.allowMultiple\n ) {\n this.selectionController.refresh();\n }\n super.update(changedProperties);\n }\n}\n"],"mappings":";;;;;;;;;AA6CA,IAAsB,IAAtB,cAA4C,EAAW,GAAiB;CACtE,YAAY;CACZ,aAAa;CACd,CAAC,CAAC;;oCAU+B,iBAOM,kBAaH,wBAMX,oBAOG,+BAmBY,IAAI,EAAwB,MAAM;GACvE,gBAAgB,KAAK,eAAe;GACpC,eAAe,MAAS,EAAK;GAC7B,WAAW,MAAS;AAClB,MAAK,OAAO;;GAEd,cAAc;GACd,YAAa,KAAK,gBAAgB,aAAa;GAChD,CAAC;;CArBF,gBAA6C;;EAC3C,IAAM,KAAA,IAAO,KAAK,eAAA,OAAA,KAAA,IAAA,EAAY,cAAc,OAAO;AAInD,SAHK,IAGE,EACJ,iBAAiB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A,KAAA,EAAA,KAMzC,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAO1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA"}
@@ -1,10 +1,7 @@
1
1
  import { PropertyValues } from 'lit';
2
+ import { SlotPresenceController } from '../../controllers/slot-presence-controller/index.js';
2
3
  import { SpectrumElement } from '../../element/index.js';
3
4
  import { AccordionHeadingLevel, AccordionSize } from './Accordion.types.js';
4
- declare const AccordionItemBase_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
5
  /**
9
6
  * Base class for accordion item components. Manages open/disabled state,
10
7
  * heading level (set by the parent accordion), and the toggle event.
@@ -19,7 +16,14 @@ declare const AccordionItemBase_base: typeof SpectrumElement & {
19
16
  * the toggle button so they remain independently interactive.
20
17
  * @slot - The panel content revealed when the item is open.
21
18
  */
22
- export declare abstract class AccordionItemBase extends AccordionItemBase_base {
19
+ export declare abstract class AccordionItemBase extends SpectrumElement {
20
+ /**
21
+ * Observes whether content is slotted into `[slot="actions"]` so the header
22
+ * can conditionally render the actions container.
23
+ *
24
+ * @internal
25
+ */
26
+ protected slotPresence: SlotPresenceController;
23
27
  /**
24
28
  * Whether the accordion item panel is expanded.
25
29
  */
@@ -50,6 +54,13 @@ export declare abstract class AccordionItemBase extends AccordionItemBase_base {
50
54
  * when the accordion is re-enabled.
51
55
  */
52
56
  protected parentDisabled: boolean;
57
+ /**
58
+ * @internal
59
+ * Whether content is slotted into `[slot="actions"]`. Consumed by the
60
+ * concrete element's `render()` to conditionally render the actions
61
+ * container.
62
+ */
63
+ protected get hasActions(): boolean;
53
64
  /**
54
65
  * @internal
55
66
  * Whether the item may change `open` (expand or collapse). When false, the
@@ -83,4 +94,3 @@ export declare abstract class AccordionItemBase extends AccordionItemBase_base {
83
94
  connectedCallback(): void;
84
95
  disconnectedCallback(): void;
85
96
  }
86
- export {};
@@ -2,11 +2,11 @@ import { SWC_ACCORDION_ITEM_AFTER_CLOSE_EVENT as e, SWC_ACCORDION_ITEM_AFTER_OPE
2
2
  import { __decorate as a } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
3
3
  import { property as o, state as s } from "lit/decorators.js";
4
4
  import { SpectrumElement as c } from "@adobe/spectrum-wc-core/element/index.js";
5
- import { ObserveSlotPresence as l } from "@adobe/spectrum-wc-core/mixins/observe-slot-presence.js";
5
+ import { SlotPresenceController as l } from "@adobe/spectrum-wc-core/controllers/slot-presence-controller/index.js";
6
6
  //#region components/accordion/AccordionItem.base.ts
7
- var u = class extends l(c, "[slot=\"actions\"]") {
7
+ var u = class extends c {
8
8
  constructor(...e) {
9
- super(...e), this.disabled = !1, this._open = !1, this.headingLevel = 3, this.parentDisabled = !1, this.afterEventPending = !1, this.handleTransitionEnd = (e) => {
9
+ super(...e), this.slotPresence = new l(this, "[slot=\"actions\"]"), this.disabled = !1, this._open = !1, this.headingLevel = 3, this.parentDisabled = !1, this.afterEventPending = !1, this.handleTransitionEnd = (e) => {
10
10
  e.target !== this.contentPanel || e.propertyName !== "height" || !this.afterEventPending || (this.afterEventPending = !1, this.dispatchAfterEvent(this.open));
11
11
  }, this.handleTransitionCancel = (e) => {
12
12
  e.target !== this.contentPanel || e.propertyName !== "height" || !this.afterEventPending || (this.afterEventPending = !1, this.dispatchAfterEvent(this.open));
@@ -20,6 +20,9 @@ var u = class extends l(c, "[slot=\"actions\"]") {
20
20
  let t = this._open;
21
21
  this._open = e, e ? this.setAttribute("open", "") : this.removeAttribute("open"), this.requestUpdate("open", t);
22
22
  }
23
+ get hasActions() {
24
+ return this.slotPresence.isPresent;
25
+ }
23
26
  mayExpand() {
24
27
  return !this.disabled && !this.parentDisabled;
25
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.base.js","names":[],"sources":["../../../components/accordion/AccordionItem.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, state } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { ObserveSlotPresence } from '@adobe/spectrum-wc-core/mixins/observe-slot-presence.js';\n\nimport {\n type AccordionHeadingLevel,\n type AccordionSize,\n SWC_ACCORDION_ITEM_AFTER_CLOSE_EVENT,\n SWC_ACCORDION_ITEM_AFTER_OPEN_EVENT,\n SWC_ACCORDION_ITEM_CLOSE_EVENT,\n SWC_ACCORDION_ITEM_OPEN_EVENT,\n SWC_ACCORDION_ITEM_TOGGLE_EVENT,\n} from './Accordion.types.js';\n\n/**\n * Base class for accordion item components. Manages open/disabled state,\n * heading level (set by the parent accordion), and the toggle event.\n *\n * @attribute {boolean} open - Whether the accordion item panel is expanded.\n * @attribute {boolean} disabled - Whether the accordion item is disabled.\n * @attribute {AccordionSize} size - Size of the item. Inherited from the parent\n * accordion when slotted; controls the chevron icon when used standalone.\n *\n * @slot label - The heading text for this accordion item.\n * @slot actions - Optional actions rendered adjacent to the heading, outside\n * the toggle button so they remain independently interactive.\n * @slot - The panel content revealed when the item is open.\n */\nexport abstract class AccordionItemBase extends ObserveSlotPresence(\n SpectrumElement,\n '[slot=\"actions\"]'\n) {\n // ──────────────────\n // PUBLIC API\n // ──────────────────\n\n /**\n * Whether the accordion item panel is expanded.\n */\n @property({ type: Boolean, reflect: true })\n public get open(): boolean {\n return this._open;\n }\n\n public set open(value: boolean) {\n if (this.hasUpdated && !this.mayExpand() && value !== this._open) {\n return;\n }\n if (value === this._open) {\n return;\n }\n const oldValue = this._open;\n this._open = value;\n if (value) {\n this.setAttribute('open', '');\n } else {\n this.removeAttribute('open');\n }\n this.requestUpdate('open', oldValue);\n }\n\n /**\n * Whether the accordion item is disabled. A disabled item keeps its header\n * in the tab order but blocks toggling.\n */\n @property({ type: Boolean, reflect: true })\n public disabled: boolean = false;\n\n /**\n * The size of the item. Inherited from the parent accordion; controls which\n * chevron icon is displayed. Has no effect when the item is used standalone.\n */\n @property({ type: String, reflect: true })\n public size?: AccordionSize;\n\n private _open = false;\n\n // ──────────────────────\n // INTERNAL STATE\n // ──────────────────────\n\n /**\n * @internal\n * Heading level (2–6) propagated by the parent accordion. Defaults to 3\n * for standalone items.\n */\n @state()\n protected headingLevel: AccordionHeadingLevel = 3;\n\n /**\n * @internal\n * Set by the parent accordion when its own `disabled` is true. Causes the\n * item to render as disabled (aria-disabled + inert panel) without clobbering\n * the item's own `disabled` property, so the per-item state is preserved\n * when the accordion is re-enabled.\n */\n @state()\n protected parentDisabled: boolean = false;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n /**\n * @internal\n * Whether the item may change `open` (expand or collapse). When false, the\n * `open` setter and `toggle()` leave state unchanged.\n */\n protected mayExpand(): boolean {\n return !this.disabled && !this.parentDisabled;\n }\n\n private get contentPanel(): HTMLElement | null {\n return this.shadowRoot?.getElementById('content') ?? null;\n }\n\n private dispatchAfterEvent(isOpen: boolean): void {\n this.dispatchEvent(\n new Event(\n isOpen\n ? SWC_ACCORDION_ITEM_AFTER_OPEN_EVENT\n : SWC_ACCORDION_ITEM_AFTER_CLOSE_EVENT,\n { bubbles: true, composed: true }\n )\n );\n }\n\n // Guards dispatchAfterEvent so only one after-event fires per open/close\n // cycle. transitionend fires once per CSS property; height is the only match.\n private afterEventPending = false;\n\n private readonly handleTransitionEnd = (event: TransitionEvent): void => {\n if (\n event.target !== this.contentPanel ||\n event.propertyName !== 'height' ||\n !this.afterEventPending\n ) {\n return;\n }\n this.afterEventPending = false;\n this.dispatchAfterEvent(this.open);\n };\n\n // Reused for transitioncancel: an externally interrupted transition must still\n // resolve afterEventPending so the after-event is not silently lost.\n private readonly handleTransitionCancel = (event: TransitionEvent): void => {\n if (\n event.target !== this.contentPanel ||\n event.propertyName !== 'height' ||\n !this.afterEventPending\n ) {\n return;\n }\n this.afterEventPending = false;\n this.dispatchAfterEvent(this.open);\n };\n\n /**\n * @internal\n * Toggles the item open state. Guards for disabled, flips `open`, dispatches\n * the toggle event, and reverts if the event is canceled. On success, dispatches\n * `swc-after-open` or `swc-after-close` after the panel height transition ends,\n * or immediately if no transition is active.\n */\n protected toggle(): void {\n if (!this.mayExpand()) {\n return;\n }\n this.open = !this.open;\n const toggleEvent = new Event(SWC_ACCORDION_ITEM_TOGGLE_EVENT, {\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n if (!this.dispatchEvent(toggleEvent)) {\n this.open = !this.open;\n return;\n }\n const isOpen = this.open;\n this.dispatchEvent(\n new Event(\n isOpen ? SWC_ACCORDION_ITEM_OPEN_EVENT : SWC_ACCORDION_ITEM_CLOSE_EVENT,\n {\n bubbles: true,\n composed: true,\n }\n )\n );\n const panel = this.contentPanel;\n if (!panel || getComputedStyle(panel).transitionDuration === '0s') {\n this.dispatchAfterEvent(isOpen);\n } else {\n this.afterEventPending = true;\n }\n }\n\n /**\n * @internal\n * Synchronizes parent-managed heading level onto the item.\n */\n public setManagedHeading(heading: AccordionHeadingLevel): void {\n this.headingLevel = heading;\n }\n\n /**\n * @internal\n * Synchronizes parent-managed disabled state onto the item.\n */\n public setManagedParentDisabled(disabled: boolean): void {\n this.parentDisabled = disabled;\n }\n\n protected override firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n this.contentPanel?.addEventListener(\n 'transitionend',\n this.handleTransitionEnd\n );\n this.contentPanel?.addEventListener(\n 'transitioncancel',\n this.handleTransitionCancel\n );\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (this.hasUpdated) {\n this.contentPanel?.addEventListener(\n 'transitionend',\n this.handleTransitionEnd\n );\n this.contentPanel?.addEventListener(\n 'transitioncancel',\n this.handleTransitionCancel\n );\n }\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.contentPanel?.removeEventListener(\n 'transitionend',\n this.handleTransitionEnd\n );\n this.contentPanel?.removeEventListener(\n 'transitioncancel',\n this.handleTransitionCancel\n );\n }\n}\n"],"mappings":";;;;;;AA0CA,IAAsB,IAAtB,cAAgD,EAC9C,GACA,qBACD,CAAC;;+BAmC2B,iBASX,wBAYgC,yBAUZ,6BAgCR,gCAEY,MAAiC;AAErE,KAAM,WAAW,KAAK,gBACtB,EAAM,iBAAiB,YACvB,CAAC,KAAK,sBAIR,KAAK,oBAAoB,IACzB,KAAK,mBAAmB,KAAK,KAAK;oCAKO,MAAiC;AAExE,KAAM,WAAW,KAAK,gBACtB,EAAM,iBAAiB,YACvB,CAAC,KAAK,sBAIR,KAAK,oBAAoB,IACzB,KAAK,mBAAmB,KAAK,KAAK;;;CAnHpC,IACW,OAAgB;AACzB,SAAO,KAAK;;CAGd,IAAW,KAAK,GAAgB;AAI9B,MAHI,KAAK,cAAc,CAAC,KAAK,WAAW,IAAI,MAAU,KAAK,SAGvD,MAAU,KAAK,MACjB;EAEF,IAAM,IAAW,KAAK;AAOtB,EANA,KAAK,QAAQ,GACT,IACF,KAAK,aAAa,QAAQ,GAAG,GAE7B,KAAK,gBAAgB,OAAO,EAE9B,KAAK,cAAc,QAAQ,EAAS;;CAkDtC,YAA+B;AAC7B,SAAO,CAAC,KAAK,YAAY,CAAC,KAAK;;CAGjC,IAAY,eAAmC;;AAC7C,UAAA,KAAA,IAAO,KAAK,eAAA,OAAA,KAAA,IAAA,EAAY,eAAe,UAAU,KAAA,OAAI,OAAJ;;CAGnD,mBAA2B,GAAuB;AAChD,O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C,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,KA0B1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAO1C,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAczC,GAAO,CAAA,EAAA,EAAA,WAAA,gBAAA,KAAA,EAAA,KAUP,GAAO,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA"}
1
+ {"version":3,"file":"AccordionItem.base.js","names":[],"sources":["../../../components/accordion/AccordionItem.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, state } from 'lit/decorators.js';\n\nimport { SlotPresenceController } from '@adobe/spectrum-wc-core/controllers/slot-presence-controller/index.js';\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\n\nimport {\n type AccordionHeadingLevel,\n type AccordionSize,\n SWC_ACCORDION_ITEM_AFTER_CLOSE_EVENT,\n SWC_ACCORDION_ITEM_AFTER_OPEN_EVENT,\n SWC_ACCORDION_ITEM_CLOSE_EVENT,\n SWC_ACCORDION_ITEM_OPEN_EVENT,\n SWC_ACCORDION_ITEM_TOGGLE_EVENT,\n} from './Accordion.types.js';\n\n/**\n * Base class for accordion item components. Manages open/disabled state,\n * heading level (set by the parent accordion), and the toggle event.\n *\n * @attribute {boolean} open - Whether the accordion item panel is expanded.\n * @attribute {boolean} disabled - Whether the accordion item is disabled.\n * @attribute {AccordionSize} size - Size of the item. Inherited from the parent\n * accordion when slotted; controls the chevron icon when used standalone.\n *\n * @slot label - The heading text for this accordion item.\n * @slot actions - Optional actions rendered adjacent to the heading, outside\n * the toggle button so they remain independently interactive.\n * @slot - The panel content revealed when the item is open.\n */\nexport abstract class AccordionItemBase extends SpectrumElement {\n // ──────────────────────\n // CONTROLLERS\n // ──────────────────────\n\n /**\n * Observes whether content is slotted into `[slot=\"actions\"]` so the header\n * can conditionally render the actions container.\n *\n * @internal\n */\n protected slotPresence = new SlotPresenceController(this, '[slot=\"actions\"]');\n\n // ──────────────────\n // PUBLIC API\n // ──────────────────\n\n /**\n * Whether the accordion item panel is expanded.\n */\n @property({ type: Boolean, reflect: true })\n public get open(): boolean {\n return this._open;\n }\n\n public set open(value: boolean) {\n if (this.hasUpdated && !this.mayExpand() && value !== this._open) {\n return;\n }\n if (value === this._open) {\n return;\n }\n const oldValue = this._open;\n this._open = value;\n if (value) {\n this.setAttribute('open', '');\n } else {\n this.removeAttribute('open');\n }\n this.requestUpdate('open', oldValue);\n }\n\n /**\n * Whether the accordion item is disabled. A disabled item keeps its header\n * in the tab order but blocks toggling.\n */\n @property({ type: Boolean, reflect: true })\n public disabled: boolean = false;\n\n /**\n * The size of the item. Inherited from the parent accordion; controls which\n * chevron icon is displayed. Has no effect when the item is used standalone.\n */\n @property({ type: String, reflect: true })\n public size?: AccordionSize;\n\n private _open = false;\n\n // ──────────────────────\n // INTERNAL STATE\n // ──────────────────────\n\n /**\n * @internal\n * Heading level (2–6) propagated by the parent accordion. Defaults to 3\n * for standalone items.\n */\n @state()\n protected headingLevel: AccordionHeadingLevel = 3;\n\n /**\n * @internal\n * Set by the parent accordion when its own `disabled` is true. Causes the\n * item to render as disabled (aria-disabled + inert panel) without clobbering\n * the item's own `disabled` property, so the per-item state is preserved\n * when the accordion is re-enabled.\n */\n @state()\n protected parentDisabled: boolean = false;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n /**\n * @internal\n * Whether content is slotted into `[slot=\"actions\"]`. Consumed by the\n * concrete element's `render()` to conditionally render the actions\n * container.\n */\n protected get hasActions(): boolean {\n return this.slotPresence.isPresent;\n }\n\n /**\n * @internal\n * Whether the item may change `open` (expand or collapse). When false, the\n * `open` setter and `toggle()` leave state unchanged.\n */\n protected mayExpand(): boolean {\n return !this.disabled && !this.parentDisabled;\n }\n\n private get contentPanel(): HTMLElement | null {\n return this.shadowRoot?.getElementById('content') ?? null;\n }\n\n private dispatchAfterEvent(isOpen: boolean): void {\n this.dispatchEvent(\n new Event(\n isOpen\n ? SWC_ACCORDION_ITEM_AFTER_OPEN_EVENT\n : SWC_ACCORDION_ITEM_AFTER_CLOSE_EVENT,\n { bubbles: true, composed: true }\n )\n );\n }\n\n // Guards dispatchAfterEvent so only one after-event fires per open/close\n // cycle. transitionend fires once per CSS property; height is the only match.\n private afterEventPending = false;\n\n private readonly handleTransitionEnd = (event: TransitionEvent): void => {\n if (\n event.target !== this.contentPanel ||\n event.propertyName !== 'height' ||\n !this.afterEventPending\n ) {\n return;\n }\n this.afterEventPending = false;\n this.dispatchAfterEvent(this.open);\n };\n\n // Reused for transitioncancel: an externally interrupted transition must still\n // resolve afterEventPending so the after-event is not silently lost.\n private readonly handleTransitionCancel = (event: TransitionEvent): void => {\n if (\n event.target !== this.contentPanel ||\n event.propertyName !== 'height' ||\n !this.afterEventPending\n ) {\n return;\n }\n this.afterEventPending = false;\n this.dispatchAfterEvent(this.open);\n };\n\n /**\n * @internal\n * Toggles the item open state. Guards for disabled, flips `open`, dispatches\n * the toggle event, and reverts if the event is canceled. On success, dispatches\n * `swc-after-open` or `swc-after-close` after the panel height transition ends,\n * or immediately if no transition is active.\n */\n protected toggle(): void {\n if (!this.mayExpand()) {\n return;\n }\n this.open = !this.open;\n const toggleEvent = new Event(SWC_ACCORDION_ITEM_TOGGLE_EVENT, {\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n if (!this.dispatchEvent(toggleEvent)) {\n this.open = !this.open;\n return;\n }\n const isOpen = this.open;\n this.dispatchEvent(\n new Event(\n isOpen ? SWC_ACCORDION_ITEM_OPEN_EVENT : SWC_ACCORDION_ITEM_CLOSE_EVENT,\n {\n bubbles: true,\n composed: true,\n }\n )\n );\n const panel = this.contentPanel;\n if (!panel || getComputedStyle(panel).transitionDuration === '0s') {\n this.dispatchAfterEvent(isOpen);\n } else {\n this.afterEventPending = true;\n }\n }\n\n /**\n * @internal\n * Synchronizes parent-managed heading level onto the item.\n */\n public setManagedHeading(heading: AccordionHeadingLevel): void {\n this.headingLevel = heading;\n }\n\n /**\n * @internal\n * Synchronizes parent-managed disabled state onto the item.\n */\n public setManagedParentDisabled(disabled: boolean): void {\n this.parentDisabled = disabled;\n }\n\n protected override firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n this.contentPanel?.addEventListener(\n 'transitionend',\n this.handleTransitionEnd\n );\n this.contentPanel?.addEventListener(\n 'transitioncancel',\n this.handleTransitionCancel\n );\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (this.hasUpdated) {\n this.contentPanel?.addEventListener(\n 'transitionend',\n this.handleTransitionEnd\n );\n this.contentPanel?.addEventListener(\n 'transitioncancel',\n this.handleTransitionCancel\n );\n }\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.contentPanel?.removeEventListener(\n 'transitionend',\n this.handleTransitionEnd\n );\n this.contentPanel?.removeEventListener(\n 'transitioncancel',\n this.handleTransitionCancel\n );\n }\n}\n"],"mappings":";;;;;;AA0CA,IAAsB,IAAtB,cAAgD,EAAgB;;mCAWrC,IAAI,EAAuB,MAAM,qBAAmB,kBAoClD,iBASX,wBAYgC,yBAUZ,6BA0CR,gCAEY,MAAiC;AAErE,KAAM,WAAW,KAAK,gBACtB,EAAM,iBAAiB,YACvB,CAAC,KAAK,sBAIR,KAAK,oBAAoB,IACzB,KAAK,mBAAmB,KAAK,KAAK;oCAKO,MAAiC;AAExE,KAAM,WAAW,KAAK,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OAAK,eAAe;;CAOtB,yBAAgC,GAAyB;AACvD,OAAK,iBAAiB;;CAGxB,aAAgC,GAAyC;;AAMvE,EALA,MAAM,aAAa,EAAkB,GACrC,IAAA,KAAK,iBAAA,QAAA,EAAc,iBACjB,iBACA,KAAK,oBACN,GACD,IAAA,KAAK,iBAAA,QAAA,EAAc,iBACjB,oBACA,KAAK,uBACN;;CAGH,oBAA0C;AAExC,MADA,MAAM,mBAAmB,EACrB,KAAK,YAAY;;AAKnB,IAJA,IAAA,KAAK,iBAAA,QAAA,EAAc,iBACjB,iBACA,KAAK,oBACN,GACD,IAAA,KAAK,iBAAA,QAAA,EAAc,iBACjB,oBACA,KAAK,uBACN;;;CAIL,uBAA6C;;AAM3C,EALA,MAAM,sBAAsB,GAC5B,IAAA,KAAK,iBAAA,QAAA,EAAc,oBACjB,iBACA,KAAK,oBACN,GACD,IAAA,KAAK,iBAAA,QAAA,EAAc,oBACjB,oBACA,KAAK,uBACN;;;GA1NF,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,KA0B1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAO1C,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAczC,GAAO,CAAA,EAAA,EAAA,WAAA,gBAAA,KAAA,EAAA,KAUP,GAAO,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA"}
@@ -0,0 +1,108 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { SpectrumElement } from '../../element/index.js';
3
+ import { ActionGroupOrientation, ActionGroupSize } from './ActionGroup.types.js';
4
+ declare const ActionGroupBase_base: typeof SpectrumElement & {
5
+ new (...args: any[]): import('../../mixins/index.js').SizedElementInterface;
6
+ prototype: import('../../mixins/index.js').SizedElementInterface;
7
+ } & import('../../mixins/index.js').SizedElementConstructor;
8
+ /**
9
+ * An action group clusters related actions together with consistent
10
+ * spacing, sizing, and orientation. It treats the whole strip as a single
11
+ * stop in the keyboard sequence, with arrow keys moving between children.
12
+ *
13
+ * This base class owns the accessibility semantics, `accessible-label` →
14
+ * `aria-label` management, `disabled` state contract, and child collection logic.
15
+ * Rendering and styling live in the concrete SWC subclass.
16
+ *
17
+ * @slot - One or more `swc-action-button` or `swc-action-menu` elements.
18
+ *
19
+ * @attribute {ActionGroupSize} size - The size of the group and its children.
20
+ */
21
+ export declare abstract class ActionGroupBase extends ActionGroupBase_base {
22
+ static shadowRootOptions: {
23
+ delegatesFocus: boolean;
24
+ clonable?: boolean;
25
+ customElementRegistry?: CustomElementRegistry;
26
+ mode: ShadowRootMode;
27
+ serializable?: boolean;
28
+ slotAssignment?: SlotAssignmentMode;
29
+ };
30
+ /**
31
+ * The size of the action group. Propagated to all slotted children.
32
+ */
33
+ size: ActionGroupSize;
34
+ /**
35
+ * @internal
36
+ *
37
+ * Valid orientation values for validation.
38
+ */
39
+ static readonly ORIENTATIONS: readonly string[];
40
+ /**
41
+ * @internal
42
+ *
43
+ * Valid static-color values for validation.
44
+ */
45
+ static readonly STATIC_COLORS: readonly string[];
46
+ /**
47
+ * The layout direction of the action group.
48
+ *
49
+ * When set to `"vertical"`, the group stacks children vertically and
50
+ * `FocusgroupNavigationController` moves focus with the Up/Down arrow
51
+ * keys instead of Left/Right.
52
+ *
53
+ * Note: this property does NOT set `aria-orientation` on the host. The
54
+ * host's role is fixed to `role="group"`, and `aria-orientation` is only
55
+ * a supported ARIA attribute on roles that expose it (`toolbar`,
56
+ * `listbox`, `menu`, etc.), not `group`, regardless of this component's
57
+ * roving-tabindex keyboard model. Setting it anyway fails axe's
58
+ * `aria-allowed-attr` rule.
59
+ *
60
+ * @default horizontal
61
+ */
62
+ orientation: ActionGroupOrientation;
63
+ /**
64
+ * Accessible label for the group. Reflected to `aria-label` on the host.
65
+ *
66
+ * Providing a label is recommended whenever the strip has a distinct
67
+ * purpose (e.g., "Image adjustments" or "Edit"). An empty value removes
68
+ * the `aria-label` attribute.
69
+ */
70
+ accessibleLabel: string;
71
+ /**
72
+ * Whether the group and all of its children are disabled.
73
+ *
74
+ * Sets `aria-disabled="true"` on the host and propagates `aria-disabled`
75
+ * to each managed child. Children remain keyboard-reachable so that screen
76
+ * reader users can still discover the group. Native `disabled` is not
77
+ * applied to children.
78
+ */
79
+ disabled: boolean;
80
+ /**
81
+ * @internal
82
+ *
83
+ * The managed children: all `swc-action-button` and `swc-action-menu`
84
+ * elements assigned to the default slot. Populated by the concrete
85
+ * subclass via `@queryAssignedElements`.
86
+ */
87
+ protected managedChildren: HTMLElement[];
88
+ /**
89
+ * Focuses the first enabled child in the group.
90
+ *
91
+ * The SWC concrete class overrides this with `FocusgroupNavigationController`,
92
+ * restoring focus to the last active item when memory is enabled. This
93
+ * implementation serves as a fallback for non-SWC subclasses.
94
+ */
95
+ focus(options?: FocusOptions): void;
96
+ /**
97
+ * @internal
98
+ *
99
+ * Handles slot-change events. Propagates `aria-disabled` to newly slotted
100
+ * children when the group is disabled. Concrete subclasses call
101
+ * `super.handleSlotchange()` and then propagate visual attributes.
102
+ */
103
+ protected handleSlotchange(): void;
104
+ protected firstUpdated(changed: PropertyValues<this>): void;
105
+ protected updated(changed: PropertyValues<this>): void;
106
+ private propagateDisabledToChildren;
107
+ }
108
+ export {};
@@ -0,0 +1,53 @@
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
2
+ import { ACTION_GROUP_ORIENTATIONS as t, ACTION_GROUP_STATIC_COLORS as n, ACTION_GROUP_VALID_SIZES as r } from "./ActionGroup.types.js";
3
+ import { property as i, queryAssignedElements as a } from "lit/decorators.js";
4
+ import { SpectrumElement as o } from "@adobe/spectrum-wc-core/element/index.js";
5
+ import { SizedMixin as s } from "@adobe/spectrum-wc-core/mixins/index.js";
6
+ //#region components/action-group/ActionGroup.base.ts
7
+ var c, l = class extends s(o, {
8
+ validSizes: r,
9
+ noDefaultSize: !0
10
+ }) {
11
+ constructor(...e) {
12
+ super(...e), this.orientation = "horizontal", this.accessibleLabel = "", this.disabled = !1;
13
+ }
14
+ focus(e) {
15
+ var t;
16
+ let n = (t = this.managedChildren) == null ? void 0 : t.find((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-disabled") !== "true");
17
+ n == null || n.focus(e);
18
+ }
19
+ handleSlotchange() {
20
+ this.disabled && this.propagateDisabledToChildren();
21
+ }
22
+ firstUpdated(e) {
23
+ super.firstUpdated(e), this.setAttribute("role", "group");
24
+ }
25
+ updated(e) {
26
+ var t;
27
+ if (super.updated(e), e.has("accessibleLabel") && (this.accessibleLabel ? this.setAttribute("aria-label", this.accessibleLabel) : this.removeAttribute("aria-label")), e.has("disabled") && (this.disabled ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled"), this.propagateDisabledToChildren()), (t = window.__swc) != null && t.DEBUG) {
28
+ let e = this.constructor;
29
+ e.ORIENTATIONS.includes(this.orientation) || window.__swc.warn(this, `<${this.localName}> element expects the "orientation" attribute to be one of the following: ${e.ORIENTATIONS.join(", ")}.`, "https://spectrum-web-components.adobe.com/components/action-group/", { issues: [...e.ORIENTATIONS] });
30
+ }
31
+ }
32
+ propagateDisabledToChildren() {
33
+ var e;
34
+ for (let t of (e = this.managedChildren) == null ? [] : e) this.disabled ? t.setAttribute("aria-disabled", "true") : t.removeAttribute("aria-disabled");
35
+ }
36
+ };
37
+ c = l, c.shadowRootOptions = {
38
+ ...o.shadowRootOptions,
39
+ delegatesFocus: !0
40
+ }, c.ORIENTATIONS = t, c.STATIC_COLORS = n, e([i({
41
+ type: String,
42
+ reflect: !0
43
+ })], l.prototype, "orientation", void 0), e([i({
44
+ type: String,
45
+ attribute: "accessible-label"
46
+ })], l.prototype, "accessibleLabel", void 0), e([i({
47
+ type: Boolean,
48
+ reflect: !0
49
+ })], l.prototype, "disabled", void 0), e([a({ flatten: !0 })], l.prototype, "managedChildren", void 0);
50
+ //#endregion
51
+ export { l as ActionGroupBase };
52
+
53
+ //# sourceMappingURL=ActionGroup.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionGroup.base.js","names":[],"sources":["../../../components/action-group/ActionGroup.base.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { PropertyValues } from 'lit';\nimport { property, queryAssignedElements } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { SizedMixin } from '@adobe/spectrum-wc-core/mixins/index.js';\n\nimport {\n ACTION_GROUP_ORIENTATIONS,\n ACTION_GROUP_STATIC_COLORS,\n ACTION_GROUP_VALID_SIZES,\n type ActionGroupOrientation,\n type ActionGroupSize,\n} from './ActionGroup.types.js';\n\n/**\n * An action group clusters related actions together with consistent\n * spacing, sizing, and orientation. It treats the whole strip as a single\n * stop in the keyboard sequence, with arrow keys moving between children.\n *\n * This base class owns the accessibility semantics, `accessible-label` →\n * `aria-label` management, `disabled` state contract, and child collection logic.\n * Rendering and styling live in the concrete SWC subclass.\n *\n * @slot - One or more `swc-action-button` or `swc-action-menu` elements.\n *\n * @attribute {ActionGroupSize} size - The size of the group and its children.\n */\nexport abstract class ActionGroupBase extends SizedMixin(SpectrumElement, {\n validSizes: ACTION_GROUP_VALID_SIZES,\n noDefaultSize: true,\n}) {\n static override shadowRootOptions = {\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * The size of the action group. Propagated to all slotted children.\n */\n declare public size: ActionGroupSize;\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * @internal\n *\n * Valid orientation values for validation.\n */\n static readonly ORIENTATIONS: readonly string[] = ACTION_GROUP_ORIENTATIONS;\n\n /**\n * @internal\n *\n * Valid static-color values for validation.\n */\n static readonly STATIC_COLORS: readonly string[] = ACTION_GROUP_STATIC_COLORS;\n\n /**\n * The layout direction of the action group.\n *\n * When set to `\"vertical\"`, the group stacks children vertically and\n * `FocusgroupNavigationController` moves focus with the Up/Down arrow\n * keys instead of Left/Right.\n *\n * Note: this property does NOT set `aria-orientation` on the host. The\n * host's role is fixed to `role=\"group\"`, and `aria-orientation` is only\n * a supported ARIA attribute on roles that expose it (`toolbar`,\n * `listbox`, `menu`, etc.), not `group`, regardless of this component's\n * roving-tabindex keyboard model. Setting it anyway fails axe's\n * `aria-allowed-attr` rule.\n *\n * @default horizontal\n */\n @property({ type: String, reflect: true })\n public orientation: ActionGroupOrientation = 'horizontal';\n\n /**\n * Accessible label for the group. Reflected to `aria-label` on the host.\n *\n * Providing a label is recommended whenever the strip has a distinct\n * purpose (e.g., \"Image adjustments\" or \"Edit\"). An empty value removes\n * the `aria-label` attribute.\n */\n @property({ type: String, attribute: 'accessible-label' })\n public accessibleLabel = '';\n\n /**\n * Whether the group and all of its children are disabled.\n *\n * Sets `aria-disabled=\"true\"` on the host and propagates `aria-disabled`\n * to each managed child. Children remain keyboard-reachable so that screen\n * reader users can still discover the group. Native `disabled` is not\n * applied to children.\n */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n /**\n * @internal\n *\n * The managed children: all `swc-action-button` and `swc-action-menu`\n * elements assigned to the default slot. Populated by the concrete\n * subclass via `@queryAssignedElements`.\n */\n @queryAssignedElements({ flatten: true })\n protected managedChildren!: HTMLElement[];\n\n /**\n * Focuses the first enabled child in the group.\n *\n * The SWC concrete class overrides this with `FocusgroupNavigationController`,\n * restoring focus to the last active item when memory is enabled. This\n * implementation serves as a fallback for non-SWC subclasses.\n */\n public override focus(options?: FocusOptions): void {\n const firstEnabled = this.managedChildren?.find(\n (el) =>\n !el.hasAttribute('disabled') &&\n el.getAttribute('aria-disabled') !== 'true'\n );\n firstEnabled?.focus(options);\n }\n\n /**\n * @internal\n *\n * Handles slot-change events. Propagates `aria-disabled` to newly slotted\n * children when the group is disabled. Concrete subclasses call\n * `super.handleSlotchange()` and then propagate visual attributes.\n */\n protected handleSlotchange(): void {\n if (this.disabled) {\n this.propagateDisabledToChildren();\n }\n }\n\n protected override firstUpdated(changed: PropertyValues<this>): void {\n super.firstUpdated(changed);\n this.setAttribute('role', 'group');\n }\n\n protected override updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n\n if (changed.has('accessibleLabel')) {\n if (this.accessibleLabel) {\n this.setAttribute('aria-label', this.accessibleLabel);\n } else {\n this.removeAttribute('aria-label');\n }\n }\n\n if (changed.has('disabled')) {\n if (this.disabled) {\n this.setAttribute('aria-disabled', 'true');\n } else {\n this.removeAttribute('aria-disabled');\n }\n this.propagateDisabledToChildren();\n }\n\n if (window.__swc?.DEBUG) {\n const constructor = this.constructor as typeof ActionGroupBase;\n if (!constructor.ORIENTATIONS.includes(this.orientation)) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"orientation\" attribute to be one of the following: ${constructor.ORIENTATIONS.join(', ')}.`,\n 'https://spectrum-web-components.adobe.com/components/action-group/',\n { issues: [...constructor.ORIENTATIONS] }\n );\n }\n }\n }\n\n private propagateDisabledToChildren(): void {\n // `aria-disabled` is set on the child host element. For AT to announce the\n // child as disabled, each child component must forward the host attribute to\n // its inner interactive element. `swc-action-button` already does this\n // (observes `aria-disabled` and forwards to its inner <button>).\n // `swc-action-menu` will need the same treatment when it is built — it must\n // forward `aria-disabled` from its host to its inner trigger element and\n // apply disabled appearance via :host([aria-disabled=\"true\"]) CSS.\n for (const child of this.managedChildren ?? []) {\n if (this.disabled) {\n child.setAttribute('aria-disabled', 'true');\n } else {\n child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ACnB,gBAAgB;CACjB,mBAgBiD,qBAOC,MAkBlD,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAUzC,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAoB,CAAC,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA,KAWzD,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAc1C,EAAsB,EAAE,SAAS,IAAM,CAAC,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export declare const ACTION_GROUP_VALID_SIZES: readonly ["xs", "s", "m", "l", "xl"];
13
+ export declare const ACTION_GROUP_ORIENTATIONS: readonly ["horizontal", "vertical"];
14
+ export declare const ACTION_GROUP_STATIC_COLORS: readonly ["white", "black"];
15
+ export type ActionGroupSize = (typeof ACTION_GROUP_VALID_SIZES)[number];
16
+ export type ActionGroupOrientation = (typeof ACTION_GROUP_ORIENTATIONS)[number];
17
+ export type ActionGroupStaticColor = (typeof ACTION_GROUP_STATIC_COLORS)[number];
@@ -0,0 +1,12 @@
1
+ //#region components/action-group/ActionGroup.types.ts
2
+ var e = [
3
+ "xs",
4
+ "s",
5
+ "m",
6
+ "l",
7
+ "xl"
8
+ ], t = ["horizontal", "vertical"], n = ["white", "black"];
9
+ //#endregion
10
+ export { t as ACTION_GROUP_ORIENTATIONS, n as ACTION_GROUP_STATIC_COLORS, e as ACTION_GROUP_VALID_SIZES };
11
+
12
+ //# sourceMappingURL=ActionGroup.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionGroup.types.js","names":[],"sources":["../../../components/action-group/ActionGroup.types.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { ElementSize } from '@adobe/spectrum-wc-core/mixins/index.js';\n\n// ──────────────────\n// SHARED\n// ──────────────────\n\nexport const ACTION_GROUP_VALID_SIZES = [\n 'xs',\n 's',\n 'm',\n 'l',\n 'xl',\n] as const satisfies readonly ElementSize[];\n\nexport const ACTION_GROUP_ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\nexport const ACTION_GROUP_STATIC_COLORS = ['white', 'black'] as const;\n\n// ──────────────────\n// TYPES\n// ──────────────────\n\nexport type ActionGroupSize = (typeof ACTION_GROUP_VALID_SIZES)[number];\nexport type ActionGroupOrientation = (typeof ACTION_GROUP_ORIENTATIONS)[number];\nexport type ActionGroupStaticColor =\n (typeof ACTION_GROUP_STATIC_COLORS)[number];\n"],"mappings":";AAkBA,IAAa,IAA2B;CACtC;CACA;CACA;CACA;CACA;CACD,EAEY,IAA4B,CAAC,cAAc,WAAW,EAEtD,IAA6B,CAAC,SAAS,QAAQ"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export * from './ActionGroup.base.js';
13
+ export * from './ActionGroup.types.js';
@@ -0,0 +1,3 @@
1
+ import { ACTION_GROUP_ORIENTATIONS as e, ACTION_GROUP_STATIC_COLORS as t, ACTION_GROUP_VALID_SIZES as n } from "./ActionGroup.types.js";
2
+ import { ActionGroupBase as r } from "./ActionGroup.base.js";
3
+ export { e as ACTION_GROUP_ORIENTATIONS, t as ACTION_GROUP_STATIC_COLORS, n as ACTION_GROUP_VALID_SIZES, r as ActionGroupBase };
@@ -2,8 +2,9 @@ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/he
2
2
  import { ALERT_BANNER_VALID_VARIANTS as t } from "./AlertBanner.types.js";
3
3
  import { property as n } from "lit/decorators.js";
4
4
  import { SpectrumElement as r } from "@adobe/spectrum-wc-core/element/index.js";
5
+ import { validateEnum as i } from "@adobe/spectrum-wc-core/utils/index.js";
5
6
  //#region components/alert-banner/AlertBanner.base.ts
6
- var i = class extends r {
7
+ var a = class extends r {
7
8
  constructor(...e) {
8
9
  super(...e), this.open = !1, this.dismissible = !1, this._variant = "";
9
10
  }
@@ -13,12 +14,12 @@ var i = class extends r {
13
14
  set variant(e) {
14
15
  if (e === this.variant) return;
15
16
  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);
17
+ this.isValidVariant(e) ? (this.setAttribute("variant", e), this._variant = e) : (this.removeAttribute("variant"), this._variant = "", i(this, {
18
+ prop: "variant",
19
+ value: e,
20
+ valid: t,
21
+ url: "https://spectrum-web-components.adobe.com/?path=/docs/components-alert-banner--docs"
22
+ })), this.requestUpdate("variant", n);
22
23
  }
23
24
  get variant() {
24
25
  return this._variant;
@@ -46,11 +47,11 @@ var i = class extends r {
46
47
  e([n({
47
48
  type: Boolean,
48
49
  reflect: !0
49
- })], i.prototype, "open", void 0), e([n({
50
+ })], a.prototype, "open", void 0), e([n({
50
51
  type: Boolean,
51
52
  reflect: !0
52
- })], i.prototype, "dismissible", void 0), e([n({ type: String })], i.prototype, "variant", null);
53
+ })], a.prototype, "dismissible", void 0), e([n({ type: String })], a.prototype, "variant", null);
53
54
  //#endregion
54
- export { i as AlertBannerBase };
55
+ export { a as AlertBannerBase };
55
56
 
56
57
  //# sourceMappingURL=AlertBanner.base.js.map
@@ -1 +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.addE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AC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAO1C,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA"}
1
+ {"version":3,"file":"AlertBanner.base.js","names":[],"sources":["../../../components/alert-banner/AlertBanner.base.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { CSSResultArray, PropertyValues, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { validateEnum } from '@adobe/spectrum-wc-core/utils/index.js';\n\nimport {\n ALERT_BANNER_VALID_VARIANTS,\n type AlertBannerVariant,\n} from './AlertBanner.types.js';\n\n/**\n * An alert banner shows pressing and high-signal messages, such as system alerts.\n * It is meant to be noticed and prompt users to take action.\n *\n * @slot - The main content of the alert banner.\n * @slot action - An optional action button for the alert banner.\n *\n * @fires close - Dispatched when the alert banner is dismissed. Cancelable.\n */\nexport abstract class AlertBannerBase extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [];\n }\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * Controls the display of the alert banner.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Whether to include an icon-only close button to dismiss the alert banner.\n */\n @property({ type: Boolean, reflect: true })\n public dismissible = false;\n\n /**\n * The variant applies specific styling when set to `negative` or `info`;\n * `variant` attribute is removed when it's passed an invalid variant.\n */\n @property({ type: String })\n public set variant(variant: AlertBannerVariant) {\n if (variant === this.variant) {\n return;\n }\n const oldValue = this.variant;\n\n if (this.isValidVariant(variant)) {\n this.setAttribute('variant', variant);\n this._variant = variant;\n } else {\n this.removeAttribute('variant');\n this._variant = '';\n\n validateEnum(this, {\n prop: 'variant',\n value: variant,\n valid: ALERT_BANNER_VALID_VARIANTS,\n url: 'https://spectrum-web-components.adobe.com/?path=/docs/components-alert-banner--docs',\n });\n }\n this.requestUpdate('variant', oldValue);\n }\n\n public get variant(): AlertBannerVariant {\n return this._variant;\n }\n\n private _variant: AlertBannerVariant = '';\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected isValidVariant(variant: string): boolean {\n return (ALERT_BANNER_VALID_VARIANTS as readonly string[]).includes(variant);\n }\n\n protected abstract renderIcon(variant: string): TemplateResult;\n\n protected shouldClose(): void {\n const applyDefault = this.dispatchEvent(\n new CustomEvent('close', {\n composed: true,\n bubbles: true,\n cancelable: true,\n })\n );\n if (applyDefault) {\n this.close();\n }\n }\n\n public close(): void {\n this.open = false;\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n if (event.code === 'Escape' && this.dismissible) {\n this.shouldClose();\n }\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n\n if (changes.has('open')) {\n if (this.open) {\n this.addEventListener('keydown', this.handleKeydown);\n } else {\n this.removeEventListener('keydown', this.handleKeydown);\n }\n }\n }\n}\n"],"mappings":";;;;;;AA+BA,IAAsB,IAAtB,cAA8C,EAAgB;;2BAa9C,uBAMO,oBAkCkB;;CApDvC,WAA2B,SAAyB;AAClD,SAAO,EAAE;;CAuBX,IACW,QAAQ,GAA6B;AAC9C,MAAI,MAAY,KAAK,QACnB;EAEF,IAAM,IAAW,KAAK;AAgBtB,EAdI,KAAK,eAAe,EAAQ,IAC9B,KAAK,aAAa,WAAW,EAAQ,EACrC,KAAK,WAAW,MAEhB,KAAK,gBAAgB,UAAU,EAC/B,KAAK,WAAW,IAEhB,EAAa,MAAM;GACjB,MAAM;GACN,OAAO;GACP,OAAO;GACP,KA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