@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
@@ -6,9 +6,16 @@ declare const IconBase_base: typeof SpectrumElement & {
6
6
  prototype: import('../../mixins/index.js').SizedElementInterface;
7
7
  } & import('../../mixins/index.js').SizedElementConstructor;
8
8
  /**
9
- * An icon renderer that displays slotted SVG markup.
9
+ * Shared behavior for icon elements: the `size` scale, the `accessibleLabel`, and
10
+ * host-owned accessibility. Concrete elements own their own `render()` and styles;
11
+ * this base carries no template and no CSS.
10
12
  *
11
- * @attribute {string} label - Accessible label for the icon.
13
+ * The host owns semantics: when `accessibleLabel` is set the host is exposed as an
14
+ * image (`role="img"` with that label); when empty (the default) the host is marked
15
+ * `aria-hidden` and the icon is decorative. The rendered or slotted SVG is never
16
+ * given its own role, avoiding double-announcement.
17
+ *
18
+ * @attribute {string} accessible-label - Accessible label for the icon.
12
19
  * @attribute {string} size - T-shirt icon size.
13
20
  */
14
21
  export declare abstract class IconBase extends IconBase_base {
@@ -19,14 +26,11 @@ export declare abstract class IconBase extends IconBase_base {
19
26
  */
20
27
  size: (typeof ICON_VALID_SIZES)[number];
21
28
  /**
22
- * Accessible label for the icon.
29
+ * Accessible label for the icon. When empty the icon is decorative.
23
30
  */
24
- label: string;
25
- private defaultSlotElements;
31
+ accessibleLabel: string;
26
32
  protected firstUpdated(changedProperties: PropertyValues): void;
27
33
  protected updated(changedProperties: PropertyValues): void;
28
- protected handleSlotChange(): void;
29
- private updateSlottedIcon;
30
34
  private updateHostAccessibility;
31
35
  }
32
36
  export {};
@@ -1,35 +1,28 @@
1
1
  import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
2
2
  import { ICON_VALID_SIZES as t } from "./Icon.types.js";
3
- import { property as n, queryAssignedElements as r } from "lit/decorators.js";
4
- import { SpectrumElement as i } from "@adobe/spectrum-wc-core/element/index.js";
5
- import { SizedMixin as a } from "@adobe/spectrum-wc-core/mixins/index.js";
3
+ import { property as n } from "lit/decorators.js";
4
+ import { SpectrumElement as r } from "@adobe/spectrum-wc-core/element/index.js";
5
+ import { SizedMixin as i } from "@adobe/spectrum-wc-core/mixins/index.js";
6
6
  //#region components/icon/Icon.base.ts
7
- var o = class extends a(i, { validSizes: [...t] }) {
7
+ var a = class extends i(r, { validSizes: [...t] }) {
8
8
  constructor(...e) {
9
- super(...e), this.label = "";
9
+ super(...e), this.accessibleLabel = "";
10
10
  }
11
11
  firstUpdated(e) {
12
- super.firstUpdated(e), this.updateSlottedIcon(), this.updateHostAccessibility();
12
+ super.firstUpdated(e), this.updateHostAccessibility();
13
13
  }
14
14
  updated(e) {
15
- super.updated(e), e.has("label") && (this.updateSlottedIcon(), this.updateHostAccessibility());
16
- }
17
- handleSlotChange() {
18
- this.updateSlottedIcon();
19
- }
20
- updateSlottedIcon() {
21
- var e;
22
- let [t] = this.defaultSlotElements;
23
- if (!t) return;
24
- let n = t instanceof SVGElement ? t : (e = t.querySelector) == null ? void 0 : e.call(t, "svg");
25
- n && (n.setAttribute("role", "img"), this.label ? (n.setAttribute("aria-label", this.label), n.removeAttribute("aria-hidden")) : (n.setAttribute("aria-hidden", "true"), n.removeAttribute("aria-label")));
15
+ super.updated(e), e.has("accessibleLabel") && this.updateHostAccessibility();
26
16
  }
27
17
  updateHostAccessibility() {
28
- this.label ? this.removeAttribute("aria-hidden") : this.setAttribute("aria-hidden", "true");
18
+ this.accessibleLabel ? (this.setAttribute("role", "img"), this.setAttribute("aria-label", this.accessibleLabel), this.removeAttribute("aria-hidden")) : (this.removeAttribute("role"), this.removeAttribute("aria-label"), this.setAttribute("aria-hidden", "true"));
29
19
  }
30
20
  };
31
- e([n({ type: String })], o.prototype, "label", void 0), e([r({ flatten: !0 })], o.prototype, "defaultSlotElements", void 0);
21
+ e([n({
22
+ type: String,
23
+ attribute: "accessible-label"
24
+ })], a.prototype, "accessibleLabel", void 0);
32
25
  //#endregion
33
- export { o as IconBase };
26
+ export { a as IconBase };
34
27
 
35
28
  //# sourceMappingURL=Icon.base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.base.js","names":[],"sources":["../../../components/icon/Icon.base.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { PropertyValues } from 'lit';\nimport { property, 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 { ICON_VALID_SIZES } from './Icon.types.js';\n\n/**\n * An icon renderer that displays slotted SVG markup.\n *\n * @attribute {string} label - Accessible label for the icon.\n * @attribute {string} size - T-shirt icon size.\n */\nexport abstract class IconBase extends SizedMixin(SpectrumElement, {\n validSizes: [...ICON_VALID_SIZES],\n}) {\n /**\n * T-shirt icon size.\n *\n * @default m\n */\n declare public size: (typeof ICON_VALID_SIZES)[number];\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * Accessible label for the icon.\n */\n @property({ type: String })\n public label = '';\n\n @queryAssignedElements({ flatten: true })\n private defaultSlotElements!: Element[];\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected override firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n this.updateSlottedIcon();\n this.updateHostAccessibility();\n }\n\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('label')) {\n this.updateSlottedIcon();\n this.updateHostAccessibility();\n }\n }\n\n protected handleSlotChange(): void {\n this.updateSlottedIcon();\n }\n\n private updateSlottedIcon(): void {\n const [slotted] = this.defaultSlotElements;\n if (!slotted) {\n return;\n }\n const svgElement =\n slotted instanceof SVGElement ? slotted : slotted.querySelector?.('svg');\n if (!svgElement) {\n return;\n }\n svgElement.setAttribute('role', 'img');\n if (this.label) {\n svgElement.setAttribute('aria-label', this.label);\n svgElement.removeAttribute('aria-hidden');\n } else {\n svgElement.setAttribute('aria-hidden', 'true');\n svgElement.removeAttribute('aria-label');\n }\n }\n\n private updateHostAccessibility(): void {\n if (this.label) {\n this.removeAttribute('aria-hidden');\n } else {\n this.setAttribute('aria-hidden', 'true');\n }\n }\n}\n"],"mappings":";;;;;;AAyBA,IAAsB,IAAtB,cAAuC,EAAW,GAAiB,EACjE,YAAY,CAAC,GAAG,EAAiB,EAClC,CAAC,CAAC;;4BAgBc;;CASf,aAAgC,GAAyC;AAGvE,EAFA,MAAM,aAAa,EAAkB,EACrC,KAAK,mBAAmB,EACxB,KAAK,yBAAyB;;CAGhC,QAA2B,GAAyC;AAElE,EADA,MAAM,QAAQ,EAAkB,EAC5B,EAAkB,IAAI,QAAQ,KAChC,KAAK,mBAAmB,EACxB,KAAK,yBAAyB;;CAIlC,mBAAmC;AACjC,OAAK,mBAAmB;;CAG1B,oBAAkC;;EAChC,IAAM,CAAC,KAAW,KAAK;AACvB,MAAI,CAAC,EACH;EAEF,IAAM,IACJ,aAAmB,aAAa,KAAA,IAAU,EAAQ,kBAAA,OAAA,KAAA,IAAA,EAAA,KAAA,GAAgB,MAAM;AACrE,QAGL,EAAW,aAAa,QAAQ,MAAM,EAClC,KAAK,SACP,EAAW,aAAa,cAAc,KAAK,MAAM,EACjD,EAAW,gBAAgB,cAAc,KAEzC,EAAW,aAAa,eAAe,OAAO,EAC9C,EAAW,gBAAgB,aAAa;;CAI5C,0BAAwC;AACtC,EAAI,KAAK,QACP,KAAK,gBAAgB,cAAc,GAEnC,KAAK,aAAa,eAAe,OAAO;;;GApD3C,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAG1B,EAAsB,EAAE,SAAS,IAAM,CAAC,CAAA,EAAA,EAAA,WAAA,uBAAA,KAAA,EAAA"}
1
+ {"version":3,"file":"Icon.base.js","names":[],"sources":["../../../components/icon/Icon.base.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { SizedMixin } from '@adobe/spectrum-wc-core/mixins/index.js';\n\nimport { ICON_VALID_SIZES } from './Icon.types.js';\n\n/**\n * Shared behavior for icon elements: the `size` scale, the `accessibleLabel`, and\n * host-owned accessibility. Concrete elements own their own `render()` and styles;\n * this base carries no template and no CSS.\n *\n * The host owns semantics: when `accessibleLabel` is set the host is exposed as an\n * image (`role=\"img\"` with that label); when empty (the default) the host is marked\n * `aria-hidden` and the icon is decorative. The rendered or slotted SVG is never\n * given its own role, avoiding double-announcement.\n *\n * @attribute {string} accessible-label - Accessible label for the icon.\n * @attribute {string} size - T-shirt icon size.\n */\nexport abstract class IconBase extends SizedMixin(SpectrumElement, {\n validSizes: [...ICON_VALID_SIZES],\n}) {\n /**\n * T-shirt icon size.\n *\n * @default m\n */\n declare public size: (typeof ICON_VALID_SIZES)[number];\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * Accessible label for the icon. When empty the icon is decorative.\n */\n @property({ type: String, attribute: 'accessible-label' })\n public accessibleLabel = '';\n\n // ──────────────────────\n // ACCESSIBILITY\n // ──────────────────────\n\n protected override firstUpdated(changedProperties: PropertyValues): void {\n super.firstUpdated(changedProperties);\n this.updateHostAccessibility();\n }\n\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('accessibleLabel')) {\n this.updateHostAccessibility();\n }\n }\n\n private updateHostAccessibility(): void {\n if (this.accessibleLabel) {\n this.setAttribute('role', 'img');\n this.setAttribute('aria-label', this.accessibleLabel);\n this.removeAttribute('aria-hidden');\n } else {\n this.removeAttribute('role');\n this.removeAttribute('aria-label');\n this.setAttribute('aria-hidden', 'true');\n }\n }\n}\n"],"mappings":";;;;;;AAgCA,IAAsB,IAAtB,cAAuC,EAAW,GAAiB,EACjE,YAAY,CAAC,GAAG,EAAiB,EAClC,CAAC,CAAC;;sCAgBwB;;CAMzB,aAAgC,GAAyC;AAEvE,EADA,MAAM,aAAa,EAAkB,EACrC,KAAK,yBAAyB;;CAGhC,QAA2B,GAAyC;AAElE,EADA,MAAM,QAAQ,EAAkB,EAC5B,EAAkB,IAAI,kBAAkB,IAC1C,KAAK,yBAAyB;;CAIlC,0BAAwC;AACtC,EAAI,KAAK,mBACP,KAAK,aAAa,QAAQ,MAAM,EAChC,KAAK,aAAa,cAAc,KAAK,gBAAgB,EACrD,KAAK,gBAAgB,cAAc,KAEnC,KAAK,gBAAgB,OAAO,EAC5B,KAAK,gBAAgB,aAAa,EAClC,KAAK,aAAa,eAAe,OAAO;;;GA3B3C,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAoB,CAAC,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA"}
@@ -1,4 +1,5 @@
1
1
  import { PropertyValues } from 'lit';
2
+ import { SlotTextController } from '../../controllers/slot-text-controller/index.js';
2
3
  import { SpectrumElement } from '../../element/index.js';
3
4
  import { IllustratedMessageOrientation, IllustratedMessageSize } from './IllustratedMessage.types.js';
4
5
  /**
@@ -6,9 +7,9 @@ import { IllustratedMessageOrientation, IllustratedMessageSize } from './Illustr
6
7
  * used in empty states or error pages.
7
8
  *
8
9
  * @slot - Decorative or informative SVG illustration
9
- * @slot heading - The heading element, h2–h6
10
- * @todo SWC-1943 Add slot constraints once the CEM slot constraints work is complete:
11
- * `{required} {allowedChildren: h2, h3, h4, h5, h6} {maxChildren: 1}`
10
+ * @slot heading - Optional heading; when present, must be a single h2–h6 element.
11
+ * Both constraints (allowed h2–h6 children and a single heading) are validated
12
+ * in dev mode.
12
13
  * @slot description - Supporting description text
13
14
  * @slot actions - Optional action controls displayed below the description, typically a button or button group. Receives `size` automatically from the illustrated message.
14
15
  */
@@ -31,16 +32,29 @@ export declare abstract class IllustratedMessageBase extends SpectrumElement {
31
32
  * The layout orientation
32
33
  */
33
34
  orientation: IllustratedMessageOrientation;
35
+ /**
36
+ * Observes whether the default (illustration) slot has assigned content.
37
+ *
38
+ * @internal
39
+ */
40
+ protected slotText: SlotTextController;
34
41
  private readonly _sizePropagation;
35
- protected updated(changedProperties: PropertyValues): void;
42
+ /**
43
+ * Whether the default (illustration) slot has assigned content, so
44
+ * rendering subclasses can collapse the illustration wrapper when no
45
+ * illustration is provided instead of reserving its fixed size.
46
+ */
47
+ protected get hasIllustration(): boolean;
48
+ protected update(changedProperties: PropertyValues): void;
36
49
  protected handleActionsSlotChange(): void;
37
50
  /**
38
51
  * @internal
39
52
  *
40
- * Validates that the heading slot only contains `<h2>`–`<h6>` elements.
41
- * Rendering subclasses must wire this to the heading slot's `slotchange`
42
- * event (e.g. `<slot name="heading" @slotchange=${this.handleHeadingSlotChange}>`)
43
- * for the validation warning to fire.
53
+ * Validates the heading slot: children must be `<h2>`–`<h6>`, and at most a
54
+ * single heading is allowed. Rendering subclasses must wire this to the
55
+ * heading slot's `slotchange` event (e.g.
56
+ * `<slot name="heading" @slotchange=${this.handleHeadingSlotChange}>`) for the
57
+ * validation warnings to fire.
44
58
  */
45
59
  protected handleHeadingSlotChange(event: Event): void;
46
60
  }
@@ -3,44 +3,57 @@ import { SlotAttributePropagationController as t } from "../../controllers/slot-
3
3
  import { ILLUSTRATED_MESSAGE_VALID_ORIENTATIONS as n, ILLUSTRATED_MESSAGE_VALID_SIZES as r } from "./IllustratedMessage.types.js";
4
4
  import { property as i } from "lit/decorators.js";
5
5
  import { SpectrumElement as a } from "@adobe/spectrum-wc-core/element/index.js";
6
+ import { validateAllowedChildren as o, validateEnum as s, warnIf as c } from "@adobe/spectrum-wc-core/utils/index.js";
7
+ import { SlotTextController as l } from "@adobe/spectrum-wc-core/controllers/slot-text-controller/index.js";
6
8
  //#region components/illustrated-message/IllustratedMessage.base.ts
7
- var o, s = class extends a {
9
+ var u, d = class extends a {
8
10
  constructor(...e) {
9
- super(...e), this.size = "m", this.orientation = "vertical", this._sizePropagation = new t(this, {
11
+ super(...e), this.size = "m", this.orientation = "vertical", this.slotText = new l(this), this._sizePropagation = new t(this, {
10
12
  attribute: "size",
11
13
  getValue: () => this.size,
12
14
  slotName: "actions"
13
15
  });
14
16
  }
15
- updated(e) {
16
- var t;
17
- super.updated(e), (t = window.__swc) != null && t.DEBUG && (e.has("size") && !r.includes(this.size) && window.__swc.warn(this, `<${this.localName}> received an invalid "size" value of "${this.size}". Valid values are ${r.join(", ")}.`, "https://opensource.adobe.com/spectrum-web-components/components/illustrated-message/", { issues: [`size="${this.size}"`] }), e.has("orientation") && !n.includes(this.orientation) && window.__swc.warn(this, `<${this.localName}> received an invalid "orientation" value of "${this.orientation}". Valid values are ${n.join(", ")}.`, "https://opensource.adobe.com/spectrum-web-components/components/illustrated-message/", { issues: [`orientation="${this.orientation}"`] }));
17
+ get hasIllustration() {
18
+ return this.slotText.hasContent;
19
+ }
20
+ update(e) {
21
+ e.has("size") && s(this, {
22
+ prop: "size",
23
+ value: this.size,
24
+ valid: r,
25
+ url: "https://spectrum-web-components.adobe.com/?path=/docs/components-illustrated-message--docs"
26
+ }), e.has("orientation") && s(this, {
27
+ prop: "orientation",
28
+ value: this.orientation,
29
+ valid: n,
30
+ url: "https://spectrum-web-components.adobe.com/?path=/docs/components-illustrated-message--docs"
31
+ }), super.update(e);
18
32
  }
19
33
  handleActionsSlotChange() {
20
34
  this._sizePropagation.propagate();
21
35
  }
22
36
  handleHeadingSlotChange(e) {
23
- var t;
24
- if ((t = window.__swc) != null && t.DEBUG) {
25
- let t = e.target;
26
- for (let e of t.assignedElements()) [
27
- "H2",
28
- "H3",
29
- "H4",
30
- "H5",
31
- "H6"
32
- ].includes(e.tagName) || window.__swc.warn(this, `<${this.localName}> heading slot received a <${e.tagName.toLowerCase()}> element. Only <h2>–<h6> elements are allowed in the heading slot.`, "https://opensource.adobe.com/spectrum-web-components/components/illustrated-message/", { issues: [`heading slot: <${e.tagName.toLowerCase()}>`] });
33
- }
37
+ let t = e.target, n = "https://spectrum-web-components.adobe.com/?path=/docs/components-illustrated-message--docs";
38
+ o(this, t, [
39
+ "h2",
40
+ "h3",
41
+ "h4",
42
+ "h5",
43
+ "h6"
44
+ ], "heading", n);
45
+ let r = t.assignedElements().length;
46
+ c(this, r > 1, `<${this.localName}> "heading" slot accepts a single heading element but received ${r}.`, n, { issues: [`heading slot: ${r} elements`] });
34
47
  }
35
48
  };
36
- o = s, o.VALID_SIZES = r, o.VALID_ORIENTATIONS = n, e([i({
49
+ u = d, u.VALID_SIZES = r, u.VALID_ORIENTATIONS = n, e([i({
37
50
  type: String,
38
51
  reflect: !0
39
- })], s.prototype, "size", void 0), e([i({
52
+ })], d.prototype, "size", void 0), e([i({
40
53
  type: String,
41
54
  reflect: !0
42
- })], s.prototype, "orientation", void 0);
55
+ })], d.prototype, "orientation", void 0);
43
56
  //#endregion
44
- export { s as IllustratedMessageBase };
57
+ export { d as IllustratedMessageBase };
45
58
 
46
59
  //# sourceMappingURL=IllustratedMessage.base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IllustratedMessage.base.js","names":[],"sources":["../../../components/illustrated-message/IllustratedMessage.base.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\n\nimport { SlotAttributePropagationController } from '../../controllers/slot-attribute-propagation-controller/index.js';\nimport {\n ILLUSTRATED_MESSAGE_VALID_ORIENTATIONS,\n ILLUSTRATED_MESSAGE_VALID_SIZES,\n type IllustratedMessageOrientation,\n type IllustratedMessageSize,\n} from './IllustratedMessage.types.js';\n\n/**\n * An illustrated message displays an illustration and a message, typically\n * used in empty states or error pages.\n *\n * @slot - Decorative or informative SVG illustration\n * @slot heading - The heading element, h2–h6\n * @todo SWC-1943 Add slot constraints once the CEM slot constraints work is complete:\n * `{required} {allowedChildren: h2, h3, h4, h5, h6} {maxChildren: 1}`\n * @slot description - Supporting description text\n * @slot actions - Optional action controls displayed below the description, typically a button or button group. Receives `size` automatically from the illustrated message.\n */\nexport abstract class IllustratedMessageBase extends SpectrumElement {\n // ─────────────────────────\n // API TO OVERRIDE\n // ─────────────────────────\n\n /**\n * @internal\n */\n static readonly VALID_SIZES: readonly IllustratedMessageSize[] =\n ILLUSTRATED_MESSAGE_VALID_SIZES;\n\n /**\n * @internal\n */\n static readonly VALID_ORIENTATIONS: readonly IllustratedMessageOrientation[] =\n ILLUSTRATED_MESSAGE_VALID_ORIENTATIONS;\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * The size of the message\n *\n * @default m\n */\n @property({ type: String, reflect: true })\n public size: IllustratedMessageSize = 'm';\n\n /**\n * The layout orientation\n */\n @property({ type: String, reflect: true })\n public orientation: IllustratedMessageOrientation = 'vertical';\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n private readonly _sizePropagation = new SlotAttributePropagationController(\n this,\n {\n attribute: 'size',\n getValue: () => this.size,\n slotName: 'actions',\n }\n );\n\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n\n if (window.__swc?.DEBUG) {\n if (\n changedProperties.has('size') &&\n !ILLUSTRATED_MESSAGE_VALID_SIZES.includes(this.size)\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> received an invalid \"size\" value of \"${this.size}\". Valid values are ${ILLUSTRATED_MESSAGE_VALID_SIZES.join(', ')}.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/illustrated-message/',\n { issues: [`size=\"${this.size}\"`] }\n );\n }\n\n if (\n changedProperties.has('orientation') &&\n !ILLUSTRATED_MESSAGE_VALID_ORIENTATIONS.includes(this.orientation)\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> received an invalid \"orientation\" value of \"${this.orientation}\". Valid values are ${ILLUSTRATED_MESSAGE_VALID_ORIENTATIONS.join(', ')}.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/illustrated-message/',\n { issues: [`orientation=\"${this.orientation}\"`] }\n );\n }\n }\n }\n\n protected handleActionsSlotChange(): void {\n this._sizePropagation.propagate();\n }\n\n /**\n * @internal\n *\n * Validates that the heading slot only contains `<h2>`–`<h6>` elements.\n * Rendering subclasses must wire this to the heading slot's `slotchange`\n * event (e.g. `<slot name=\"heading\" @slotchange=${this.handleHeadingSlotChange}>`)\n * for the validation warning to fire.\n */\n protected handleHeadingSlotChange(event: Event): void {\n if (window.__swc?.DEBUG) {\n const headingSlot = event.target as HTMLSlotElement;\n for (const el of headingSlot.assignedElements()) {\n if (!['H2', 'H3', 'H4', 'H5', 'H6'].includes(el.tagName)) {\n window.__swc.warn(\n this,\n `<${this.localName}> heading slot received a <${el.tagName.toLowerCase()}> element. Only <h2>–<h6> elements are allowed in the heading slot.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/illustrated-message/',\n { issues: [`heading slot: <${el.tagName.toLowerCase()}>`] }\n );\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;OAoCsB,IAAtB,cAAqD,EAAgB;;2BA2B7B,wBAMc,oCAMhB,IAAI,EACtC,MACA;GACE,WAAW;GACX,gBAAgB,KAAK;GACrB,UAAU;GACX,CACF;;CAED,QAA2B,GAAyC;;AAGlE,EAFA,MAAM,QAAQ,EAAkB,GAEhC,IAAI,OAAO,UAAA,QAAA,EAAO,UAEd,EAAkB,IAAI,OAAO,IAC7B,CAAC,EAAgC,SAAS,KAAK,KAAK,IAEpD,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,yCAAyC,KAAK,KAAK,sBAAsB,EAAgC,KAAK,KAAK,CAAC,IACvI,wFACA,EAAE,QAAQ,CAAC,SAAS,KAAK,KAAK,GAAG,EAAE,CACpC,EAID,EAAkB,IAAI,cAAc,IACpC,CAAC,EAAuC,SAAS,KAAK,YAAY,IAElE,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,gDAAgD,KAAK,YAAY,sBAAsB,EAAuC,KAAK,KAAK,CAAC,IAC5J,wFACA,EAAE,QAAQ,CAAC,gBAAgB,KAAK,YAAY,GAAG,EAAE,CAClD;;CAKP,0BAA0C;AACxC,OAAK,iBAAiB,WAAW;;CAWnC,wBAAkC,GAAoB;;AACpD,OAAA,IAAI,OAAO,UAAA,QAAA,EAAO,OAAO;GACvB,IAAM,IAAc,EAAM;AAC1B,QAAK,IAAM,KAAM,EAAY,kBAAkB,CAC7C,CAAK;IAAC;IAAM;IAAM;IAAM;IAAM;IAAK,CAAC,SAAS,EAAG,QAAQ,IACtD,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,6BAA6B,EAAG,QAAQ,aAAa,CAAC,sEACzE,wFACA,EAAE,QAAQ,CAAC,kBAAkB,EAAG,QAAQ,aAAa,CAAC,GAAG,EAAE,CAC5D;;;;uBA3FP,0BAMA,MAWD,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAMzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA"}
1
+ {"version":3,"file":"IllustratedMessage.base.js","names":[],"sources":["../../../components/illustrated-message/IllustratedMessage.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 { SlotTextController } from '@adobe/spectrum-wc-core/controllers/slot-text-controller/index.js';\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport {\n validateAllowedChildren,\n validateEnum,\n warnIf,\n} from '@adobe/spectrum-wc-core/utils/index.js';\n\nimport { SlotAttributePropagationController } from '../../controllers/slot-attribute-propagation-controller/index.js';\nimport {\n ILLUSTRATED_MESSAGE_VALID_ORIENTATIONS,\n ILLUSTRATED_MESSAGE_VALID_SIZES,\n type IllustratedMessageOrientation,\n type IllustratedMessageSize,\n} from './IllustratedMessage.types.js';\n\n/**\n * An illustrated message displays an illustration and a message, typically\n * used in empty states or error pages.\n *\n * @slot - Decorative or informative SVG illustration\n * @slot heading - Optional heading; when present, must be a single h2–h6 element.\n * Both constraints (allowed h2–h6 children and a single heading) are validated\n * in dev mode.\n * @slot description - Supporting description text\n * @slot actions - Optional action controls displayed below the description, typically a button or button group. Receives `size` automatically from the illustrated message.\n */\nexport abstract class IllustratedMessageBase extends SpectrumElement {\n // ─────────────────────────\n // API TO OVERRIDE\n // ─────────────────────────\n\n /**\n * @internal\n */\n static readonly VALID_SIZES: readonly IllustratedMessageSize[] =\n ILLUSTRATED_MESSAGE_VALID_SIZES;\n\n /**\n * @internal\n */\n static readonly VALID_ORIENTATIONS: readonly IllustratedMessageOrientation[] =\n ILLUSTRATED_MESSAGE_VALID_ORIENTATIONS;\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * The size of the message\n *\n * @default m\n */\n @property({ type: String, reflect: true })\n public size: IllustratedMessageSize = 'm';\n\n /**\n * The layout orientation\n */\n @property({ type: String, reflect: true })\n public orientation: IllustratedMessageOrientation = 'vertical';\n\n // ──────────────────────\n // CONTROLLERS\n // ──────────────────────\n\n /**\n * Observes whether the default (illustration) slot has assigned content.\n *\n * @internal\n */\n protected slotText = new SlotTextController(this);\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n private readonly _sizePropagation = new SlotAttributePropagationController(\n this,\n {\n attribute: 'size',\n getValue: () => this.size,\n slotName: 'actions',\n }\n );\n\n /**\n * Whether the default (illustration) slot has assigned content, so\n * rendering subclasses can collapse the illustration wrapper when no\n * illustration is provided instead of reserving its fixed size.\n */\n protected get hasIllustration(): boolean {\n return this.slotText.hasContent;\n }\n\n protected override update(changedProperties: PropertyValues): void {\n if (changedProperties.has('size')) {\n validateEnum(this, {\n prop: 'size',\n value: this.size,\n valid: ILLUSTRATED_MESSAGE_VALID_SIZES,\n url: 'https://spectrum-web-components.adobe.com/?path=/docs/components-illustrated-message--docs',\n });\n }\n\n if (changedProperties.has('orientation')) {\n validateEnum(this, {\n prop: 'orientation',\n value: this.orientation,\n valid: ILLUSTRATED_MESSAGE_VALID_ORIENTATIONS,\n url: 'https://spectrum-web-components.adobe.com/?path=/docs/components-illustrated-message--docs',\n });\n }\n\n super.update(changedProperties);\n }\n\n protected handleActionsSlotChange(): void {\n this._sizePropagation.propagate();\n }\n\n /**\n * @internal\n *\n * Validates the heading slot: children must be `<h2>`–`<h6>`, and at most a\n * single heading is allowed. Rendering subclasses must wire this to the\n * heading slot's `slotchange` event (e.g.\n * `<slot name=\"heading\" @slotchange=${this.handleHeadingSlotChange}>`) for the\n * validation warnings to fire.\n */\n protected handleHeadingSlotChange(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const url =\n 'https://spectrum-web-components.adobe.com/?path=/docs/components-illustrated-message--docs';\n validateAllowedChildren(\n this,\n slot,\n ['h2', 'h3', 'h4', 'h5', 'h6'],\n 'heading',\n url\n );\n const headingCount = slot.assignedElements().length;\n warnIf(\n this,\n headingCount > 1,\n `<${this.localName}> \"heading\" slot accepts a single heading element but received ${headingCount}.`,\n url,\n { issues: [`heading slot: ${headingCount} elements`] }\n );\n }\n}\n"],"mappings":";;;;;;;;OA0CsB,IAAtB,cAAqD,EAAgB;;2BA2B7B,wBAMc,4BAW/B,IAAI,EAAmB,KAAK,0BAMb,IAAI,EACtC,MACA;GACE,WAAW;GACX,gBAAgB,KAAK;GACrB,UAAU;GACX,CACF;;CAOD,IAAc,kBAA2B;AACvC,SAAO,KAAK,SAAS;;CAGvB,OAA0B,GAAyC;AAmBjE,EAlBI,EAAkB,IAAI,OAAO,IAC/B,EAAa,MAAM;GACjB,MAAM;GACN,OAAO,KAAK;GACZ,OAAO;GACP,KAAK;GACN,CAAC,EAGA,EAAkB,IAAI,cAAc,IACtC,EAAa,MAAM;GACjB,MAAM;GACN,OAAO,KAAK;GACZ,OAAO;GACP,KAAK;GACN,CAAC,EAGJ,MAAM,OAAO,EAAkB;;CAGjC,0BAA0C;AACxC,OAAK,iBAAiB,WAAW;;CAYnC,wBAAkC,GAAoB;EACpD,IAAM,IAAO,EAAM,QACb,IACJ;AACF,IACE,MACA,GACA;GAAC;GAAM;GAAM;GAAM;GAAM;GAAK,EAC9B,WACA,EACD;EACD,IAAM,IAAe,EAAK,kBAAkB,CAAC;AAC7C,IACE,MACA,IAAe,GACf,IAAI,KAAK,UAAU,iEAAiE,EAAa,IACjG,GACA,EAAE,QAAQ,CAAC,iBAAiB,EAAa,WAAW,EAAE,CACvD;;;uBAhHD,0BAMA,MAWD,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAMzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA"}
@@ -0,0 +1,28 @@
1
+ import { ButtonBase } from '../button';
2
+ import { InfieldButtonSize } from './InfieldButton.types.js';
3
+ /**
4
+ * Abstract base class for infield button components. Extends ButtonBase with a
5
+ * restricted size set, quiet treatment, and non-focusable shadow root.
6
+ *
7
+ * Infield buttons are always embedded inside a form field (e.g. number field). They are
8
+ * clickable via pointer only; they are not in the tab order and not independently focusable.
9
+ * All keyboard behavior is owned by the parent field, which also provides the visible
10
+ * focus ring. The parent field is expected to set the `size` attribute.
11
+ *
12
+ * @slot icon - Icon to display inside the button.
13
+ *
14
+ * @attribute {ElementSize} size - Size delegated from the parent field. Defaults to
15
+ * medium when no parent sets it, though standalone usage is not supported.
16
+ */
17
+ export declare abstract class InfieldButtonBase extends ButtonBase {
18
+ /** @internal */
19
+ static readonly VALID_SIZES: readonly InfieldButtonSize[];
20
+ /** @internal */
21
+ static readonly NO_DEFAULT_SIZE = true;
22
+ static shadowRootOptions: ShadowRootInit;
23
+ /**
24
+ * Applies the quiet (no-background) visual treatment. Used when the infield button
25
+ * is part of a quiet field variant.
26
+ */
27
+ quiet: boolean;
28
+ }
@@ -0,0 +1,22 @@
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
2
+ import { INFIELD_BUTTON_VALID_SIZES as t } from "./InfieldButton.types.js";
3
+ import { property as n } from "lit/decorators.js";
4
+ import { SpectrumElement as r } from "@adobe/spectrum-wc-core/element/index.js";
5
+ import { ButtonBase as i } from "@adobe/spectrum-wc-core/components/button";
6
+ //#region components/infield-button/InfieldButton.base.ts
7
+ var a, o = class extends i {
8
+ constructor(...e) {
9
+ super(...e), this.quiet = !1;
10
+ }
11
+ };
12
+ a = o, a.VALID_SIZES = t, a.NO_DEFAULT_SIZE = !0, a.shadowRootOptions = {
13
+ ...r.shadowRootOptions,
14
+ delegatesFocus: !1
15
+ }, e([n({
16
+ type: Boolean,
17
+ reflect: !0
18
+ })], o.prototype, "quiet", void 0);
19
+ //#endregion
20
+ export { o as InfieldButtonBase };
21
+
22
+ //# sourceMappingURL=InfieldButton.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfieldButton.base.js","names":[],"sources":["../../../components/infield-button/InfieldButton.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 { property } from 'lit/decorators.js';\n\nimport { ButtonBase } from '@adobe/spectrum-wc-core/components/button';\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\n\nimport {\n INFIELD_BUTTON_VALID_SIZES,\n type InfieldButtonSize,\n} from './InfieldButton.types.js';\n\n/**\n * Abstract base class for infield button components. Extends ButtonBase with a\n * restricted size set, quiet treatment, and non-focusable shadow root.\n *\n * Infield buttons are always embedded inside a form field (e.g. number field). They are\n * clickable via pointer only; they are not in the tab order and not independently focusable.\n * All keyboard behavior is owned by the parent field, which also provides the visible\n * focus ring. The parent field is expected to set the `size` attribute.\n *\n * @slot icon - Icon to display inside the button.\n *\n * @attribute {ElementSize} size - Size delegated from the parent field. Defaults to\n * medium when no parent sets it, though standalone usage is not supported.\n */\nexport abstract class InfieldButtonBase extends ButtonBase {\n // ────────────────────\n // API OVERRIDES\n // ────────────────────\n\n /** @internal */\n static override readonly VALID_SIZES: readonly InfieldButtonSize[] =\n INFIELD_BUTTON_VALID_SIZES;\n\n // The parent field owns sizing; infield buttons must not auto-reflect size=\"m\"\n // when no explicit size is provided. Overriding NO_DEFAULT_SIZE lets the\n // SizedMixin setter and update() read this flag via this.constructor, so the\n // decision cascades through the full prototype chain without closure leakage.\n /** @internal */\n static override readonly NO_DEFAULT_SIZE = true;\n\n // Infield buttons are clickable but never independently focusable. The parent field\n // owns keyboard behavior and supplies the only focus ring.\n static override shadowRootOptions: ShadowRootInit = {\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: false,\n };\n\n // ───────────────────\n // API ADDITIONS\n // ───────────────────\n\n /**\n * Applies the quiet (no-background) visual treatment. Used when the infield button\n * is part of a quiet field variant.\n */\n @property({ type: Boolean, reflect: true })\n public quiet: boolean = false;\n}\n"],"mappings":";;;;;;OAoCsB,IAAtB,cAAgD,EAAW;;4BAgCjC;;;uBAzBtB,uBAOyC,0BAIS;CAClD,GAAG,EAAgB;CACnB,gBAAgB;CACjB,KAUA,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export declare const INFIELD_BUTTON_VALID_SIZES: readonly ["s", "m", "l", "xl"];
13
+ export type InfieldButtonSize = (typeof INFIELD_BUTTON_VALID_SIZES)[number];
@@ -0,0 +1,11 @@
1
+ //#region components/infield-button/InfieldButton.types.ts
2
+ var e = [
3
+ "s",
4
+ "m",
5
+ "l",
6
+ "xl"
7
+ ];
8
+ //#endregion
9
+ export { e as INFIELD_BUTTON_VALID_SIZES };
10
+
11
+ //# sourceMappingURL=InfieldButton.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfieldButton.types.js","names":[],"sources":["../../../components/infield-button/InfieldButton.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 INFIELD_BUTTON_VALID_SIZES = [\n 's',\n 'm',\n 'l',\n 'xl',\n] as const satisfies readonly ElementSize[];\n\n// ──────────────────\n// TYPES\n// ──────────────────\n\nexport type InfieldButtonSize = (typeof INFIELD_BUTTON_VALID_SIZES)[number];\n"],"mappings":";AAkBA,IAAa,IAA6B;CACxC;CACA;CACA;CACA;CACD"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export * from './InfieldButton.base.js';
13
+ export * from './InfieldButton.types.js';
@@ -0,0 +1,3 @@
1
+ import { INFIELD_BUTTON_VALID_SIZES as e } from "./InfieldButton.types.js";
2
+ import { InfieldButtonBase as t } from "./InfieldButton.base.js";
3
+ export { e as INFIELD_BUTTON_VALID_SIZES, t as InfieldButtonBase };
@@ -3,8 +3,9 @@ import { METER_VARIANTS as t } from "./Meter.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
5
  import { LINEAR_PROGRESS_VALID_SIZES as i, LinearProgressMixin as a, SizedMixin as o } from "@adobe/spectrum-wc-core/mixins/index.js";
6
+ import { validateEnum as s } from "@adobe/spectrum-wc-core/utils/index.js";
6
7
  //#region components/meter/Meter.base.ts
7
- var s, c = class extends a(o(r, {
8
+ var c, l = class extends a(o(r, {
8
9
  validSizes: i,
9
10
  defaultSize: "m"
10
11
  })) {
@@ -13,18 +14,19 @@ var s, c = class extends a(o(r, {
13
14
  }
14
15
  willUpdate(e) {
15
16
  let t = this.constructor;
16
- if (!t.VARIANTS.includes(this.variant)) {
17
- var n;
18
- (n = window.__swc) != null && n.DEBUG && window.__swc.warn(this, `<${this.localName}> element expects the "variant" attribute to be one of the following:`, "https://spectrum-web-components.adobe.com/?path=/docs/components-meter--docs", { issues: [...t.VARIANTS] }), this.variant = "informative";
19
- }
20
- super.willUpdate(e);
17
+ t.VARIANTS.includes(this.variant) || (s(this, {
18
+ prop: "variant",
19
+ value: this.variant,
20
+ valid: t.VARIANTS,
21
+ url: "https://spectrum-web-components.adobe.com/?path=/docs/components-meter--docs"
22
+ }), this.variant = "informative"), super.willUpdate(e);
21
23
  }
22
24
  };
23
- s = c, s.VARIANTS = t, e([n({
25
+ c = l, c.VARIANTS = t, e([n({
24
26
  type: String,
25
27
  reflect: !0
26
- })], c.prototype, "variant", void 0);
28
+ })], l.prototype, "variant", void 0);
27
29
  //#endregion
28
- export { c as MeterBase };
30
+ export { l as MeterBase };
29
31
 
30
32
  //# sourceMappingURL=Meter.base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Meter.base.js","names":[],"sources":["../../../components/meter/Meter.base.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport {\n LINEAR_PROGRESS_VALID_SIZES,\n LinearProgressMixin,\n SizedMixin,\n} from '@adobe/spectrum-wc-core/mixins/index.js';\n\nimport { METER_VARIANTS, type MeterVariant } from './Meter.types.js';\n\n/**\n * A non-focusable, read-only bar that shows a value inside a fixed range.\n * Implements the WAI-ARIA `meter` role on the shadow `.swc-Meter` element\n * (the host carries no ARIA).\n *\n * @attribute {ElementSize} size - The size of the meter.\n */\nexport abstract class MeterBase extends LinearProgressMixin(\n SizedMixin(SpectrumElement, {\n validSizes: LINEAR_PROGRESS_VALID_SIZES,\n defaultSize: 'm',\n })\n) {\n /**\n * The size of the meter.\n *\n * @default m\n */\n declare public size: (typeof LINEAR_PROGRESS_VALID_SIZES)[number];\n\n // ─────────────────────────\n // API TO OVERRIDE\n // ─────────────────────────\n\n /**\n * @internal\n *\n * A readonly array of all valid variants for the meter. Concrete\n * subclasses re-declare with their own valid set so validation logic\n * resolves against `(this.constructor as typeof MeterBase).VARIANTS`.\n */\n static readonly VARIANTS: readonly string[] = METER_VARIANTS;\n\n /**\n * The variant of the meter. Drives the bar fill color.\n */\n @property({ type: String, reflect: true })\n public variant: MeterVariant = 'informative';\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected override willUpdate(changes: PropertyValues): void {\n const constructor = this.constructor as typeof MeterBase;\n if (!constructor.VARIANTS.includes(this.variant)) {\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://spectrum-web-components.adobe.com/?path=/docs/components-meter--docs',\n {\n issues: [...constructor.VARIANTS],\n }\n );\n }\n // Unknown variant: fall back to the default so the reflected\n // attribute and fill color always resolve to a valid variant.\n // Normalizing in `willUpdate` (Lit's input-normalization hook) folds\n // the change into the current cycle instead of scheduling a second\n // reactive update.\n this.variant = 'informative';\n }\n super.willUpdate(changes);\n }\n}\n"],"mappings":";;;;;;OA+BsB,IAAtB,cAAwC,EACtC,EAAW,GAAiB;CAC1B,YAAY;CACZ,aAAa;CACd,CAAC,CACH,CAAC;;8BAyB+B;;CAM/B,WAA8B,GAA+B;EAC3D,IAAM,IAAc,KAAK;AACzB,MAAI,CAAC,EAAY,SAAS,SAAS,KAAK,QAAQ,EAAE;;AAgBhD,IAfA,IAAI,OAAO,UAAA,QAAA,EAAO,SAChB,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,wEACnB,gFACA,EACE,QAAQ,CAAC,GAAG,EAAY,SAAS,EAClC,CACF,EAOH,KAAK,UAAU;;AAEjB,QAAM,WAAW,EAAQ;;;oBAhCmB,MAK7C,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA"}
1
+ {"version":3,"file":"Meter.base.js","names":[],"sources":["../../../components/meter/Meter.base.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport {\n LINEAR_PROGRESS_VALID_SIZES,\n LinearProgressMixin,\n SizedMixin,\n} from '@adobe/spectrum-wc-core/mixins/index.js';\nimport { validateEnum } from '@adobe/spectrum-wc-core/utils/index.js';\n\nimport { METER_VARIANTS, type MeterVariant } from './Meter.types.js';\n\n/**\n * A non-focusable, read-only bar that shows a value inside a fixed range.\n * Implements the WAI-ARIA `meter` role on the shadow `.swc-Meter` element\n * (the host carries no ARIA).\n *\n * @attribute {ElementSize} size - The size of the meter.\n */\nexport abstract class MeterBase extends LinearProgressMixin(\n SizedMixin(SpectrumElement, {\n validSizes: LINEAR_PROGRESS_VALID_SIZES,\n defaultSize: 'm',\n })\n) {\n /**\n * The size of the meter.\n *\n * @default m\n */\n declare public size: (typeof LINEAR_PROGRESS_VALID_SIZES)[number];\n\n // ─────────────────────────\n // API TO OVERRIDE\n // ─────────────────────────\n\n /**\n * @internal\n *\n * A readonly array of all valid variants for the meter. Concrete\n * subclasses re-declare with their own valid set so validation logic\n * resolves against `(this.constructor as typeof MeterBase).VARIANTS`.\n */\n static readonly VARIANTS: readonly string[] = METER_VARIANTS;\n\n /**\n * The variant of the meter. Drives the bar fill color.\n */\n @property({ type: String, reflect: true })\n public variant: MeterVariant = 'informative';\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected override willUpdate(changes: PropertyValues): void {\n const constructor = this.constructor as typeof MeterBase;\n if (!constructor.VARIANTS.includes(this.variant)) {\n validateEnum(this, {\n prop: 'variant',\n value: this.variant,\n valid: constructor.VARIANTS,\n url: 'https://spectrum-web-components.adobe.com/?path=/docs/components-meter--docs',\n });\n // Unknown variant: fall back to the default so the reflected\n // attribute and fill color always resolve to a valid variant.\n // Normalizing in `willUpdate` (Lit's input-normalization hook) folds\n // the change into the current cycle instead of scheduling a second\n // reactive update.\n this.variant = 'informative';\n }\n super.willUpdate(changes);\n }\n}\n"],"mappings":";;;;;;;OAgCsB,IAAtB,cAAwC,EACtC,EAAW,GAAiB;CAC1B,YAAY;CACZ,aAAa;CACd,CAAC,CACH,CAAC;;8BAyB+B;;CAM/B,WAA8B,GAA+B;EAC3D,IAAM,IAAc,KAAK;AAezB,EAdK,EAAY,SAAS,SAAS,KAAK,QAAQ,KAC9C,EAAa,MAAM;GACjB,MAAM;GACN,OAAO,KAAK;GACZ,OAAO,EAAY;GACnB,KAAK;GACN,CAAC,EAMF,KAAK,UAAU,gBAEjB,MAAM,WAAW,EAAQ;;;oBA5BmB,MAK7C,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA"}
@@ -151,23 +151,7 @@ export declare abstract class PopoverBase extends SpectrumElement {
151
151
  private _interactiveElement;
152
152
  /** The positioning anchor (an element or a `VirtualTrigger`). */
153
153
  private _anchor;
154
- /** The element the click-to-toggle listeners are currently attached to. */
155
- private _clickTrigger;
156
- /**
157
- * True between a trigger press start (`pointerdown`/`touchstart`) and its
158
- * `click`, so a light-dismiss inside that window is attributed to the press.
159
- * Both events open it, covering touch (where the dismiss can fire off
160
- * `touchstart` before `pointerdown`).
161
- */
162
- private _triggerPointerActive;
163
- /** Cancels the pending press-end listeners armed in `_onTriggerPressStart`. */
164
- private _pressEndAbort;
165
- /**
166
- * Set when the trigger press light-dismissed an open popover (an `'outside'`
167
- * close observed while `_triggerPointerActive`), so the trailing `click` of
168
- * that same gesture is read as the close rather than a reopen.
169
- */
170
- private _dismissedByTriggerPress;
154
+ private readonly _pressGuard;
171
155
  /** Cause of the in-progress close, read when dispatching `swc-close`. */
172
156
  private _closeSource;
173
157
  /** Suppresses the open/close effect when `open` is synced from a native event. */
@@ -200,10 +184,6 @@ export declare abstract class PopoverBase extends SpectrumElement {
200
184
  protected updated(changedProperties: PropertyValues): void;
201
185
  private _positioningChanged;
202
186
  private _wireTrigger;
203
- private _removeTriggerListeners;
204
- private _onTriggerPressStart;
205
- private _onTriggerPressEnd;
206
- private _onTriggerClick;
207
187
  private _clearTriggerAria;
208
188
  private _isFocusWithin;
209
189
  private _startPositioning;