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

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 (136) hide show
  1. package/CHANGELOG.md +75 -9
  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 +1 -1
  18. package/dist/components/asset/Asset.base.js +14 -8
  19. package/dist/components/asset/Asset.base.js.map +1 -1
  20. package/dist/components/avatar/Avatar.base.js +18 -22
  21. package/dist/components/avatar/Avatar.base.js.map +1 -1
  22. package/dist/components/badge/Badge.base.d.ts +24 -8
  23. package/dist/components/badge/Badge.base.js +22 -17
  24. package/dist/components/badge/Badge.base.js.map +1 -1
  25. package/dist/components/button/Button.base.d.ts +20 -10
  26. package/dist/components/button/Button.base.js +17 -12
  27. package/dist/components/button/Button.base.js.map +1 -1
  28. package/dist/components/button-group/ButtonGroup.base.js +19 -12
  29. package/dist/components/button-group/ButtonGroup.base.js.map +1 -1
  30. package/dist/components/card/Card.base.d.ts +95 -46
  31. package/dist/components/card/Card.base.js +71 -23
  32. package/dist/components/card/Card.base.js.map +1 -1
  33. package/dist/components/card/Card.types.d.ts +1 -0
  34. package/dist/components/card/Card.types.js +2 -2
  35. package/dist/components/card/Card.types.js.map +1 -1
  36. package/dist/components/card/index.js +3 -3
  37. package/dist/components/divider/Divider.base.js +13 -8
  38. package/dist/components/divider/Divider.base.js.map +1 -1
  39. package/dist/components/dropzone/Dropzone.base.d.ts +74 -0
  40. package/dist/components/dropzone/Dropzone.base.js +82 -0
  41. package/dist/components/dropzone/Dropzone.base.js.map +1 -0
  42. package/dist/components/dropzone/Dropzone.types.d.ts +43 -0
  43. package/dist/components/dropzone/Dropzone.types.js +15 -0
  44. package/dist/components/dropzone/Dropzone.types.js.map +1 -0
  45. package/dist/components/dropzone/index.d.ts +13 -0
  46. package/dist/components/dropzone/index.js +3 -0
  47. package/dist/components/icon/Icon.base.d.ts +11 -7
  48. package/dist/components/icon/Icon.base.js +13 -20
  49. package/dist/components/icon/Icon.base.js.map +1 -1
  50. package/dist/components/illustrated-message/IllustratedMessage.base.d.ts +22 -8
  51. package/dist/components/illustrated-message/IllustratedMessage.base.js +33 -20
  52. package/dist/components/illustrated-message/IllustratedMessage.base.js.map +1 -1
  53. package/dist/components/infield-button/InfieldButton.base.d.ts +28 -0
  54. package/dist/components/infield-button/InfieldButton.base.js +22 -0
  55. package/dist/components/infield-button/InfieldButton.base.js.map +1 -0
  56. package/dist/components/infield-button/InfieldButton.types.d.ts +13 -0
  57. package/dist/components/infield-button/InfieldButton.types.js +11 -0
  58. package/dist/components/infield-button/InfieldButton.types.js.map +1 -0
  59. package/dist/components/infield-button/index.d.ts +13 -0
  60. package/dist/components/infield-button/index.js +3 -0
  61. package/dist/components/meter/Meter.base.js +11 -9
  62. package/dist/components/meter/Meter.base.js.map +1 -1
  63. package/dist/components/popover/Popover.base.js +46 -42
  64. package/dist/components/popover/Popover.base.js.map +1 -1
  65. package/dist/components/progress-circle/ProgressCircle.base.d.ts +0 -1
  66. package/dist/components/progress-circle/ProgressCircle.base.js +26 -22
  67. package/dist/components/progress-circle/ProgressCircle.base.js.map +1 -1
  68. package/dist/components/status-light/StatusLight.base.d.ts +1 -1
  69. package/dist/components/status-light/StatusLight.base.js +12 -9
  70. package/dist/components/status-light/StatusLight.base.js.map +1 -1
  71. package/dist/components/tabs/Tabs.base.js +44 -32
  72. package/dist/components/tabs/Tabs.base.js.map +1 -1
  73. package/dist/components/tooltip/Tooltip.base.js +57 -22
  74. package/dist/components/tooltip/Tooltip.base.js.map +1 -1
  75. package/dist/controllers/color-controller/src/color-controller.js +45 -44
  76. package/dist/controllers/color-controller/src/color-controller.js.map +1 -1
  77. package/dist/controllers/drag-and-drop-controller/index.d.ts +12 -0
  78. package/dist/controllers/drag-and-drop-controller/index.js +2 -0
  79. package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.d.ts +68 -0
  80. package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.js +56 -0
  81. package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.js.map +1 -0
  82. package/dist/controllers/index.d.ts +4 -1
  83. package/dist/controllers/index.js +14 -11
  84. package/dist/controllers/page-scroll-lock-controller/index.d.ts +12 -0
  85. package/dist/controllers/page-scroll-lock-controller/index.js +2 -0
  86. package/dist/controllers/{page-scroll-lock.js → page-scroll-lock-controller/src/page-scroll-lock.js} +1 -1
  87. package/dist/controllers/page-scroll-lock-controller/src/page-scroll-lock.js.map +1 -0
  88. package/dist/controllers/slot-presence-controller/index.d.ts +12 -0
  89. package/dist/controllers/slot-presence-controller/index.js +2 -0
  90. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.d.ts +57 -0
  91. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js +44 -0
  92. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js.map +1 -0
  93. package/dist/controllers/slot-text-controller/index.d.ts +12 -0
  94. package/dist/controllers/slot-text-controller/index.js +2 -0
  95. package/dist/controllers/slot-text-controller/src/slot-text-controller.d.ts +92 -0
  96. package/dist/controllers/slot-text-controller/src/slot-text-controller.js +53 -0
  97. package/dist/controllers/slot-text-controller/src/slot-text-controller.js.map +1 -0
  98. package/dist/element/index.d.ts +1 -1
  99. package/dist/element/index.js +2 -2
  100. package/dist/element/spectrum-element.d.ts +58 -15
  101. package/dist/element/spectrum-element.js +55 -36
  102. package/dist/element/spectrum-element.js.map +1 -1
  103. package/dist/element/version.d.ts +2 -2
  104. package/dist/element/version.js +1 -1
  105. package/dist/element/version.js.map +1 -1
  106. package/dist/mixins/index.d.ts +0 -2
  107. package/dist/mixins/index.js +4 -6
  108. package/dist/mixins/linear-progress-mixin.d.ts +1 -2
  109. package/dist/mixins/linear-progress-mixin.js +35 -34
  110. package/dist/mixins/linear-progress-mixin.js.map +1 -1
  111. package/dist/mixins/pending-mixin.js +12 -11
  112. package/dist/mixins/pending-mixin.js.map +1 -1
  113. package/dist/mixins/sized-mixin.d.ts +28 -0
  114. package/dist/mixins/sized-mixin.js +6 -6
  115. package/dist/mixins/sized-mixin.js.map +1 -1
  116. package/dist/utils/dev-validation.d.ts +88 -0
  117. package/dist/utils/dev-validation.js +33 -0
  118. package/dist/utils/dev-validation.js.map +1 -0
  119. package/dist/utils/index.d.ts +2 -0
  120. package/dist/utils/index.js +12 -10
  121. package/dist/utils/is-focus-visible-in-tree.d.ts +33 -0
  122. package/dist/utils/is-focus-visible-in-tree.js +11 -0
  123. package/dist/utils/is-focus-visible-in-tree.js.map +1 -0
  124. package/package.json +68 -15
  125. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/defineProperty.js +0 -12
  126. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPrimitive.js +0 -14
  127. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPropertyKey.js +0 -9
  128. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/typeof.js +0 -11
  129. package/dist/controllers/page-scroll-lock.js.map +0 -1
  130. package/dist/mixins/observe-slot-presence.d.ts +0 -12
  131. package/dist/mixins/observe-slot-presence.js +0 -40
  132. package/dist/mixins/observe-slot-presence.js.map +0 -1
  133. package/dist/mixins/observe-slot-text.d.ts +0 -11
  134. package/dist/mixins/observe-slot-text.js +0 -60
  135. package/dist/mixins/observe-slot-text.js.map +0 -1
  136. /package/dist/controllers/{page-scroll-lock.d.ts → page-scroll-lock-controller/src/page-scroll-lock.d.ts} +0 -0
@@ -3,16 +3,21 @@ import { DIVIDER_STATIC_COLORS as t, DIVIDER_VALID_SIZES as n } from "./Divider.
3
3
  import { property as r } from "lit/decorators.js";
4
4
  import { SpectrumElement as i } from "@adobe/spectrum-wc-core/element/index.js";
5
5
  import { SizedMixin as a } from "@adobe/spectrum-wc-core/mixins/index.js";
6
+ import { validateEnum as o } from "@adobe/spectrum-wc-core/utils/index.js";
6
7
  //#region components/divider/Divider.base.ts
7
- var o, s = class extends a(i, { validSizes: n }) {
8
+ var s, c = class extends a(i, { validSizes: n }) {
8
9
  constructor(...e) {
9
10
  super(...e), this.vertical = !1;
10
11
  }
11
12
  update(e) {
12
- var t;
13
- if ((t = window.__swc) != null && t.DEBUG) {
13
+ if (this.staticColor !== void 0) {
14
14
  let e = this.constructor;
15
- this.staticColor !== void 0 && !e.STATIC_COLORS.includes(this.staticColor) && window.__swc.warn(this, `<${this.localName}> element expects the "static-color" attribute to be one of the following:`, "https://opensource.adobe.com/spectrum-web-components/components/divider/", { issues: [...e.STATIC_COLORS] });
15
+ o(this, {
16
+ prop: "static-color",
17
+ value: this.staticColor,
18
+ valid: e.STATIC_COLORS,
19
+ url: "https://spectrum-web-components.adobe.com/?path=/docs/components-divider--docs"
20
+ });
16
21
  }
17
22
  super.update(e);
18
23
  }
@@ -23,15 +28,15 @@ var o, s = class extends a(i, { validSizes: n }) {
23
28
  super.updated(e), e.has("vertical") && (this.vertical ? this.setAttribute("aria-orientation", "vertical") : this.removeAttribute("aria-orientation"));
24
29
  }
25
30
  };
26
- o = s, o.STATIC_COLORS = t, e([r({
31
+ s = c, s.STATIC_COLORS = t, e([r({
27
32
  type: Boolean,
28
33
  reflect: !0
29
- })], s.prototype, "vertical", void 0), e([r({
34
+ })], c.prototype, "vertical", void 0), e([r({
30
35
  type: String,
31
36
  reflect: !0,
32
37
  attribute: "static-color"
33
- })], s.prototype, "staticColor", void 0);
38
+ })], c.prototype, "staticColor", void 0);
34
39
  //#endregion
35
- export { s as DividerBase };
40
+ export { c as DividerBase };
36
41
 
37
42
  //# sourceMappingURL=Divider.base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Divider.base.js","names":[],"sources":["../../../components/divider/Divider.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 { SizedMixin } from '@adobe/spectrum-wc-core/mixins/index.js';\n\nimport {\n DIVIDER_STATIC_COLORS,\n DIVIDER_VALID_SIZES,\n type DividerSize,\n type DividerStaticColor,\n} from './Divider.types.js';\n\n/**\n * A divider separates and distinguishes sections of content or groups of menu items.\n *\n * Layout sizing: horizontal dividers fill the **inline size** of the container (`inline-size: 100%`\n * with a minimum track); vertical dividers fill the **block size** (`block-size: 100%` with a minimum\n * track). When the percentage basis does not resolve (for example a lone flex item in a row),\n * set a definite width or height on the host or an ancestor so the line can render predictably.\n *\n * @attribute {ElementSize} size - The size of the divider.\n */\nexport abstract class DividerBase extends SizedMixin(SpectrumElement, {\n validSizes: DIVIDER_VALID_SIZES,\n}) {\n /**\n * The size of the divider.\n *\n * @default m\n */\n declare public size: DividerSize;\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * @internal\n *\n * A readonly array of the valid static color variants for the divider.\n */\n static readonly STATIC_COLORS: readonly string[] = DIVIDER_STATIC_COLORS;\n\n /**\n * Whether the divider is vertical. If false, the divider is horizontal. The default is false.\n */\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n /**\n * The static color variant to use for the divider.\n */\n @property({ type: String, reflect: true, attribute: 'static-color' })\n public staticColor?: DividerStaticColor;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected override update(changedProperties: PropertyValues): void {\n if (window.__swc?.DEBUG) {\n const constructor = this.constructor as typeof DividerBase;\n if (\n typeof this.staticColor !== 'undefined' &&\n !constructor.STATIC_COLORS.includes(this.staticColor)\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> element expects the \"static-color\" attribute to be one of the following:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/divider/',\n {\n issues: [...constructor.STATIC_COLORS],\n }\n );\n }\n }\n super.update(changedProperties);\n }\n\n protected override firstUpdated(changed: PropertyValues<this>): void {\n super.firstUpdated(changed);\n this.setAttribute('role', 'separator');\n }\n\n protected override updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n if (changed.has('vertical')) {\n if (this.vertical) {\n this.setAttribute('aria-orientation', 'vertical');\n } else {\n this.removeAttribute('aria-orientation');\n }\n }\n }\n}\n"],"mappings":";;;;;;OAmCsB,IAAtB,cAA0C,EAAW,GAAiB,EACpE,YAAY,GACb,CAAC,CAAC;;+BAuBiB;;CAYlB,OAA0B,GAAyC;;AACjE,OAAA,IAAI,OAAO,UAAA,QAAA,EAAO,OAAO;GACvB,IAAM,IAAc,KAAK;AACzB,GACS,KAAK,gBAAgB,UAC5B,CAAC,EAAY,cAAc,SAAS,KAAK,YAAY,IAErD,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,6EACnB,4EACA,EACE,QAAQ,CAAC,GAAG,EAAY,cAAc,EACvC,CACF;;AAGL,QAAM,OAAO,EAAkB;;CAGjC,aAAgC,GAAqC;AAEnE,EADA,MAAM,aAAa,EAAQ,EAC3B,KAAK,aAAa,QAAQ,YAAY;;CAGxC,QAA2B,GAAqC;AAE9D,EADA,MAAM,QAAQ,EAAQ,EAClB,EAAQ,IAAI,WAAW,KACrB,KAAK,WACP,KAAK,aAAa,oBAAoB,WAAW,GAEjD,KAAK,gBAAgB,mBAAmB;;;yBAjDK,MAKlD,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAM1C,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,WAAW;CAAgB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA"}
1
+ {"version":3,"file":"Divider.base.js","names":[],"sources":["../../../components/divider/Divider.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 { SizedMixin } from '@adobe/spectrum-wc-core/mixins/index.js';\nimport { validateEnum } from '@adobe/spectrum-wc-core/utils/index.js';\n\nimport {\n DIVIDER_STATIC_COLORS,\n DIVIDER_VALID_SIZES,\n type DividerSize,\n type DividerStaticColor,\n} from './Divider.types.js';\n\n/**\n * A divider separates and distinguishes sections of content or groups of menu items.\n *\n * Layout sizing: horizontal dividers fill the **inline size** of the container (`inline-size: 100%`\n * with a minimum track); vertical dividers fill the **block size** (`block-size: 100%` with a minimum\n * track). When the percentage basis does not resolve (for example a lone flex item in a row),\n * set a definite width or height on the host or an ancestor so the line can render predictably.\n *\n * @attribute {ElementSize} size - The size of the divider.\n */\nexport abstract class DividerBase extends SizedMixin(SpectrumElement, {\n validSizes: DIVIDER_VALID_SIZES,\n}) {\n /**\n * The size of the divider.\n *\n * @default m\n */\n declare public size: DividerSize;\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * @internal\n *\n * A readonly array of the valid static color variants for the divider.\n */\n static readonly STATIC_COLORS: readonly string[] = DIVIDER_STATIC_COLORS;\n\n /**\n * Whether the divider is vertical. If false, the divider is horizontal. The default is false.\n */\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n /**\n * The static color variant to use for the divider.\n */\n @property({ type: String, reflect: true, attribute: 'static-color' })\n public staticColor?: DividerStaticColor;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n protected override update(changedProperties: PropertyValues): void {\n if (typeof this.staticColor !== 'undefined') {\n const constructor = this.constructor as typeof DividerBase;\n validateEnum(this, {\n prop: 'static-color',\n value: this.staticColor,\n valid: constructor.STATIC_COLORS,\n url: 'https://spectrum-web-components.adobe.com/?path=/docs/components-divider--docs',\n });\n }\n super.update(changedProperties);\n }\n\n protected override firstUpdated(changed: PropertyValues<this>): void {\n super.firstUpdated(changed);\n this.setAttribute('role', 'separator');\n }\n\n protected override updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n if (changed.has('vertical')) {\n if (this.vertical) {\n this.setAttribute('aria-orientation', 'vertical');\n } else {\n this.removeAttribute('aria-orientation');\n }\n }\n }\n}\n"],"mappings":";;;;;;;OAoCsB,IAAtB,cAA0C,EAAW,GAAiB,EACpE,YAAY,GACb,CAAC,CAAC;;+BAuBiB;;CAYlB,OAA0B,GAAyC;AACjE,MAAW,KAAK,gBAAgB,QAAa;GAC3C,IAAM,IAAc,KAAK;AACzB,KAAa,MAAM;IACjB,MAAM;IACN,OAAO,KAAK;IACZ,OAAO,EAAY;IACnB,KAAK;IACN,CAAC;;AAEJ,QAAM,OAAO,EAAkB;;CAGjC,aAAgC,GAAqC;AAEnE,EADA,MAAM,aAAa,EAAQ,EAC3B,KAAK,aAAa,QAAQ,YAAY;;CAGxC,QAA2B,GAAqC;AAE9D,EADA,MAAM,QAAQ,EAAQ,EAClB,EAAQ,IAAI,WAAW,KACrB,KAAK,WACP,KAAK,aAAa,oBAAoB,WAAW,GAEjD,KAAK,gBAAgB,mBAAmB;;;yBA1CK,MAKlD,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAM1C,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,WAAW;CAAgB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA"}
@@ -0,0 +1,74 @@
1
+ import { SpectrumElement } from '../../element/index.js';
2
+ import { DropEffect, DropzoneSize } from './Dropzone.types.js';
3
+ declare const DropzoneBase_base: typeof SpectrumElement & {
4
+ new (...args: any[]): import('../../mixins/index.js').SizedElementInterface;
5
+ prototype: import('../../mixins/index.js').SizedElementInterface;
6
+ } & import('../../mixins/index.js').SizedElementConstructor;
7
+ /**
8
+ * Base class for the `<swc-dropzone>` drop zone component.
9
+ *
10
+ * Encapsulates all drag-and-drop event handling, state management, and
11
+ * validation logic. Rendering, ARIA, and CSS are provided by the concrete
12
+ * SWC subclass.
13
+ *
14
+ * @attribute {DropzoneSize} size - Controls the illustrated icon scale and container dimensions.
15
+ *
16
+ * @slot - Slot for the illustrated message and browse control. Hidden automatically when `filled` is true.
17
+ * @slot filled-content - Slot for the uploaded-state content (e.g. an image preview). Shown automatically when `filled` is true; hidden otherwise.
18
+ *
19
+ * @fires swc-dropzone-should-accept - Cancelable event fired on every native `dragover`
20
+ * tick while a drag is over the zone, not just on entry. Cancel to reject the dragged
21
+ * payload and set the cursor to `none`.
22
+ * @fires swc-dropzone-dragover - Fired once when dragged files enter the zone and are
23
+ * accepted; does not repeat on subsequent `dragover` ticks while still hovering.
24
+ * @fires swc-dropzone-dragleave - Fired when an accepted drag leaves the zone after a
25
+ * 100 ms debounce, or immediately when it becomes rejected. Detail is a plain snapshot
26
+ * `{ clientX, clientY, relatedTarget }` captured synchronously from the native event.
27
+ * @fires swc-dropzone-drop - Fired when files are dropped on the zone. `element.dragged`
28
+ * is still `true` when this event fires; it transitions to `false` after dispatch.
29
+ */
30
+ export declare abstract class DropzoneBase extends DropzoneBase_base {
31
+ /**
32
+ * The size of the drop zone.
33
+ *
34
+ * @default m
35
+ */
36
+ size: DropzoneSize;
37
+ /**
38
+ * Whether files are currently being dragged over the drop zone.
39
+ * Set automatically by the component; also settable to reflect programmatic state.
40
+ *
41
+ * @attr dragged
42
+ * @default false
43
+ */
44
+ dragged: boolean;
45
+ /**
46
+ * Whether the drop zone has received a file and is in the filled state.
47
+ * Set by consuming code after a successful drop or browse-file selection to
48
+ * switch the zone to its filled visual.
49
+ *
50
+ * @attr filled
51
+ * @default false
52
+ */
53
+ filled: boolean;
54
+ /**
55
+ * The OS drag-cursor feedback shown while a file is held over the zone.
56
+ * Maps directly to `DataTransfer.dropEffect`. Settable via the `drop-effect`
57
+ * attribute, but property changes do not reflect back to the attribute
58
+ * because it controls browser chrome, not component state.
59
+ *
60
+ * @attr drop-effect
61
+ * @type {'copy' | 'move' | 'link' | 'none'}
62
+ * @default 'copy'
63
+ */
64
+ get dropEffect(): DropEffect;
65
+ set dropEffect(value: DropEffect | null);
66
+ /** @internal */
67
+ private _dropEffect;
68
+ protected constructor();
69
+ /** @internal */
70
+ private readonly _sizePropagation;
71
+ /** @internal */
72
+ protected handleDefaultSlotChange(): void;
73
+ }
74
+ export {};
@@ -0,0 +1,82 @@
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
2
+ import { SlotAttributePropagationController as t } from "../../controllers/slot-attribute-propagation-controller/src/slot-attribute-propagation-controller.js";
3
+ import { DragAndDropController as n } from "../../controllers/drag-and-drop-controller/src/drag-and-drop-controller.js";
4
+ import { DROPZONE_DEFAULT_DROP_EFFECT as r, DROPZONE_VALID_SIZES as i, DROP_EFFECTS as a, SWC_DROPZONE_DRAGLEAVE_EVENT as o, SWC_DROPZONE_DRAGOVER_EVENT as s, SWC_DROPZONE_DROP_EVENT as c, SWC_DROPZONE_SHOULD_ACCEPT_EVENT as l } from "./Dropzone.types.js";
5
+ import { property as u } from "lit/decorators.js";
6
+ import { SpectrumElement as d } from "@adobe/spectrum-wc-core/element/index.js";
7
+ import { SizedMixin as f } from "@adobe/spectrum-wc-core/mixins/index.js";
8
+ import { validateEnum as p } from "@adobe/spectrum-wc-core/utils/index.js";
9
+ //#region components/dropzone/Dropzone.base.ts
10
+ var m = class extends f(d, { validSizes: i }) {
11
+ get dropEffect() {
12
+ return this._dropEffect;
13
+ }
14
+ set dropEffect(e) {
15
+ if (e === null) {
16
+ let e = this._dropEffect;
17
+ this._dropEffect = r, this.requestUpdate("dropEffect", e);
18
+ } else if (a.includes(e)) {
19
+ let t = this._dropEffect;
20
+ this._dropEffect = e, this.requestUpdate("dropEffect", t);
21
+ } else p(this, {
22
+ prop: "drop-effect",
23
+ value: e,
24
+ valid: a,
25
+ url: "https://spectrum-web-components.adobe.com/?path=/docs/components-dropzone--docs"
26
+ });
27
+ }
28
+ constructor() {
29
+ super(), this.dragged = !1, this.filled = !1, this._dropEffect = r, this._sizePropagation = new t(this, {
30
+ attribute: "size",
31
+ getValue: () => this.size,
32
+ selector: "swc-illustrated-message"
33
+ }), new n(this, {
34
+ isDragged: () => this.dragged,
35
+ shouldAccept: (e) => this.dispatchEvent(new CustomEvent(l, {
36
+ bubbles: !0,
37
+ cancelable: !0,
38
+ composed: !0,
39
+ detail: e
40
+ })),
41
+ dropEffect: () => this._dropEffect,
42
+ onDragEnter: (e) => {
43
+ this.dragged = !0, this.dispatchEvent(new CustomEvent(s, {
44
+ bubbles: !0,
45
+ composed: !0,
46
+ detail: e
47
+ }));
48
+ },
49
+ onDragLeave: (e) => {
50
+ this.dragged = !1, this.dispatchEvent(new CustomEvent(o, {
51
+ bubbles: !0,
52
+ composed: !0,
53
+ detail: e
54
+ }));
55
+ },
56
+ onDrop: (e) => {
57
+ this.dispatchEvent(new CustomEvent(c, {
58
+ bubbles: !0,
59
+ composed: !0,
60
+ detail: e
61
+ })), this.dragged = !1;
62
+ }
63
+ });
64
+ }
65
+ handleDefaultSlotChange() {
66
+ this._sizePropagation.propagate();
67
+ }
68
+ };
69
+ e([u({
70
+ type: Boolean,
71
+ reflect: !0
72
+ })], m.prototype, "dragged", void 0), e([u({
73
+ type: Boolean,
74
+ reflect: !0
75
+ })], m.prototype, "filled", void 0), e([u({
76
+ type: String,
77
+ attribute: "drop-effect"
78
+ })], m.prototype, "dropEffect", null);
79
+ //#endregion
80
+ export { m as DropzoneBase };
81
+
82
+ //# sourceMappingURL=Dropzone.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropzone.base.js","names":[],"sources":["../../../components/dropzone/Dropzone.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 { 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 { DragAndDropController } from '../../controllers/drag-and-drop-controller/index.js';\nimport { SlotAttributePropagationController } from '../../controllers/slot-attribute-propagation-controller/index.js';\nimport {\n DROP_EFFECTS,\n type DropEffect,\n DROPZONE_DEFAULT_DROP_EFFECT,\n DROPZONE_VALID_SIZES,\n type DropzoneDragLeaveDetail,\n type DropzoneSize,\n SWC_DROPZONE_DRAGLEAVE_EVENT,\n SWC_DROPZONE_DRAGOVER_EVENT,\n SWC_DROPZONE_DROP_EVENT,\n SWC_DROPZONE_SHOULD_ACCEPT_EVENT,\n} from './Dropzone.types.js';\n\n/**\n * Base class for the `<swc-dropzone>` drop zone component.\n *\n * Encapsulates all drag-and-drop event handling, state management, and\n * validation logic. Rendering, ARIA, and CSS are provided by the concrete\n * SWC subclass.\n *\n * @attribute {DropzoneSize} size - Controls the illustrated icon scale and container dimensions.\n *\n * @slot - Slot for the illustrated message and browse control. Hidden automatically when `filled` is true.\n * @slot filled-content - Slot for the uploaded-state content (e.g. an image preview). Shown automatically when `filled` is true; hidden otherwise.\n *\n * @fires swc-dropzone-should-accept - Cancelable event fired on every native `dragover`\n * tick while a drag is over the zone, not just on entry. Cancel to reject the dragged\n * payload and set the cursor to `none`.\n * @fires swc-dropzone-dragover - Fired once when dragged files enter the zone and are\n * accepted; does not repeat on subsequent `dragover` ticks while still hovering.\n * @fires swc-dropzone-dragleave - Fired when an accepted drag leaves the zone after a\n * 100 ms debounce, or immediately when it becomes rejected. Detail is a plain snapshot\n * `{ clientX, clientY, relatedTarget }` captured synchronously from the native event.\n * @fires swc-dropzone-drop - Fired when files are dropped on the zone. `element.dragged`\n * is still `true` when this event fires; it transitions to `false` after dispatch.\n */\nexport abstract class DropzoneBase extends SizedMixin(SpectrumElement, {\n validSizes: DROPZONE_VALID_SIZES,\n}) {\n /**\n * The size of the drop zone.\n *\n * @default m\n */\n declare public size: DropzoneSize;\n\n // ──────────────────────────\n // SHARED API\n // ──────────────────────────\n\n /**\n * Whether files are currently being dragged over the drop zone.\n * Set automatically by the component; also settable to reflect programmatic state.\n *\n * @attr dragged\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public dragged = false;\n\n /**\n * Whether the drop zone has received a file and is in the filled state.\n * Set by consuming code after a successful drop or browse-file selection to\n * switch the zone to its filled visual.\n *\n * @attr filled\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public filled = false;\n\n /**\n * The OS drag-cursor feedback shown while a file is held over the zone.\n * Maps directly to `DataTransfer.dropEffect`. Settable via the `drop-effect`\n * attribute, but property changes do not reflect back to the attribute\n * because it controls browser chrome, not component state.\n *\n * @attr drop-effect\n * @type {'copy' | 'move' | 'link' | 'none'}\n * @default 'copy'\n */\n @property({ type: String, attribute: 'drop-effect' })\n public get dropEffect(): DropEffect {\n return this._dropEffect;\n }\n\n public set dropEffect(value: DropEffect | null) {\n // Lit passes `null` here when the `drop-effect` attribute is removed;\n // treat that as \"reset to the default\" rather than an invalid value.\n if (value === null) {\n const oldValue = this._dropEffect;\n this._dropEffect = DROPZONE_DEFAULT_DROP_EFFECT;\n this.requestUpdate('dropEffect', oldValue);\n } else if ((DROP_EFFECTS as readonly string[]).includes(value)) {\n const oldValue = this._dropEffect;\n this._dropEffect = value;\n this.requestUpdate('dropEffect', oldValue);\n } else {\n validateEnum(this, {\n prop: 'drop-effect',\n value,\n valid: DROP_EFFECTS,\n url: 'https://spectrum-web-components.adobe.com/?path=/docs/components-dropzone--docs',\n });\n }\n }\n\n /** @internal */\n private _dropEffect: DropEffect = DROPZONE_DEFAULT_DROP_EFFECT;\n\n // ──────────────────────────\n // IMPLEMENTATION\n // ──────────────────────────\n\n protected constructor() {\n super();\n new DragAndDropController(this, {\n isDragged: () => this.dragged,\n shouldAccept: (event) =>\n this.dispatchEvent(\n new CustomEvent<DragEvent>(SWC_DROPZONE_SHOULD_ACCEPT_EVENT, {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: event,\n })\n ),\n dropEffect: () => this._dropEffect,\n onDragEnter: (event) => {\n this.dragged = true;\n this.dispatchEvent(\n new CustomEvent<DragEvent>(SWC_DROPZONE_DRAGOVER_EVENT, {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n },\n onDragLeave: (snapshot) => {\n this.dragged = false;\n this.dispatchEvent(\n new CustomEvent<DropzoneDragLeaveDetail>(\n SWC_DROPZONE_DRAGLEAVE_EVENT,\n {\n bubbles: true,\n composed: true,\n detail: snapshot,\n }\n )\n );\n },\n onDrop: (event) => {\n // Dispatch before clearing `dragged`; `updated()` handles the status region after `filled` settles.\n this.dispatchEvent(\n new CustomEvent<DragEvent>(SWC_DROPZONE_DROP_EVENT, {\n bubbles: true,\n composed: true,\n detail: event,\n })\n );\n this.dragged = false;\n },\n });\n }\n\n /** @internal */\n private readonly _sizePropagation = new SlotAttributePropagationController(\n this,\n {\n attribute: 'size',\n getValue: () => this.size,\n selector: 'swc-illustrated-message',\n }\n );\n\n /** @internal */\n protected handleDefaultSlotChange(): void {\n this._sizePropagation.propagate();\n }\n}\n"],"mappings":";;;;;;;;;AAwDA,IAAsB,IAAtB,cAA2C,EAAW,GAAiB,EACrE,YAAY,GACb,CAAC,CAAC;CA2CD,IACW,aAAyB;AAClC,SAAO,KAAK;;CAGd,IAAW,WAAW,GAA0B;AAG9C,MAAI,MAAU,MAAM;GAClB,IAAM,IAAW,KAAK;AAEtB,GADA,KAAK,cAAc,GACnB,KAAK,cAAc,cAAc,EAAS;aAChC,EAAmC,SAAS,EAAM,EAAE;GAC9D,IAAM,IAAW,KAAK;AAEtB,GADA,KAAK,cAAc,GACnB,KAAK,cAAc,cAAc,EAAS;QAE1C,GAAa,MAAM;GACjB,MAAM;GACN;GACA,OAAO;GACP,KAAK;GACN,CAAC;;CAWN,cAAwB;AAEtB,EADA,OAAO,iBAzDQ,kBAWD,uBAuCkB,2BA0DE,IAAI,EACtC,MACA;GACE,WAAW;GACX,gBAAgB,KAAK;GACrB,UAAU;GACX,CACF,EAzDC,IAAI,EAAsB,MAAM;GAC9B,iBAAiB,KAAK;GACtB,eAAe,MACb,KAAK,cACH,IAAI,YAAuB,GAAkC;IAC3D,SAAS;IACT,YAAY;IACZ,UAAU;IACV,QAAQ;IACT,CAAC,CACH;GACH,kBAAkB,KAAK;GACvB,cAAc,MAAU;AAEtB,IADA,KAAK,UAAU,IACf,KAAK,cACH,IAAI,YAAuB,GAA6B;KACtD,SAAS;KACT,UAAU;KACV,QAAQ;KACT,CAAC,CACH;;GAEH,cAAc,MAAa;AAEzB,IADA,KAAK,UAAU,IACf,KAAK,cACH,IAAI,YACF,GACA;KACE,SAAS;KACT,UAAU;KACV,QAAQ;KACT,CACF,CACF;;GAEH,SAAS,MAAU;AASjB,IAPA,KAAK,cACH,IAAI,YAAuB,GAAyB;KAClD,SAAS;KACT,UAAU;KACV,QAAQ;KACT,CAAC,CACH,EACD,KAAK,UAAU;;GAElB,CAAC;;CAcJ,0BAA0C;AACxC,OAAK,iBAAiB,WAAW;;;GAxHlC,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,KAW1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,UAAA,KAAA,EAAA,KAa1C,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAe,CAAC,CAAA,EAAA,EAAA,WAAA,cAAA,KAAA"}
@@ -0,0 +1,43 @@
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 type DropzoneSize = 's' | 'm' | 'l';
13
+ export declare const DROPZONE_VALID_SIZES: readonly ["s", "m", "l"];
14
+ /** Valid OS drag-cursor feedback values for the drop zone. */
15
+ export type DropEffect = 'copy' | 'move' | 'link' | 'none';
16
+ export declare const DROP_EFFECTS: readonly ["copy", "move", "link", "none"];
17
+ export declare const DROPZONE_DEFAULT_DROP_EFFECT: "copy";
18
+ /** Fired when files are dragged over the drop zone; cancelable to reject. */
19
+ export declare const SWC_DROPZONE_SHOULD_ACCEPT_EVENT = "swc-dropzone-should-accept";
20
+ /** Fired when files are dragged over the drop zone and accepted. */
21
+ export declare const SWC_DROPZONE_DRAGOVER_EVENT = "swc-dropzone-dragover";
22
+ /** Fired when an accepted drag leaves the drop zone or becomes rejected. */
23
+ export declare const SWC_DROPZONE_DRAGLEAVE_EVENT = "swc-dropzone-dragleave";
24
+ /** Fired when files are dropped on the drop zone. */
25
+ export declare const SWC_DROPZONE_DROP_EVENT = "swc-dropzone-drop";
26
+ /**
27
+ * Detail emitted with `swc-dropzone-dragleave`. Values are captured synchronously
28
+ * from the native `DragEvent` before the 100 ms debounce timer fires, preventing
29
+ * stale reads from a recycled event object.
30
+ */
31
+ export interface DropzoneDragLeaveDetail {
32
+ clientX: number;
33
+ clientY: number;
34
+ relatedTarget: EventTarget | null;
35
+ }
36
+ declare global {
37
+ interface GlobalEventHandlersEventMap {
38
+ [SWC_DROPZONE_SHOULD_ACCEPT_EVENT]: CustomEvent<DragEvent>;
39
+ [SWC_DROPZONE_DRAGOVER_EVENT]: CustomEvent<DragEvent>;
40
+ [SWC_DROPZONE_DRAGLEAVE_EVENT]: CustomEvent<DropzoneDragLeaveDetail>;
41
+ [SWC_DROPZONE_DROP_EVENT]: CustomEvent<DragEvent>;
42
+ }
43
+ }
@@ -0,0 +1,15 @@
1
+ //#region components/dropzone/Dropzone.types.ts
2
+ var e = [
3
+ "s",
4
+ "m",
5
+ "l"
6
+ ], t = [
7
+ "copy",
8
+ "move",
9
+ "link",
10
+ "none"
11
+ ], n = "copy", r = "swc-dropzone-should-accept", i = "swc-dropzone-dragover", a = "swc-dropzone-dragleave", o = "swc-dropzone-drop";
12
+ //#endregion
13
+ export { n as DROPZONE_DEFAULT_DROP_EFFECT, e as DROPZONE_VALID_SIZES, t as DROP_EFFECTS, a as SWC_DROPZONE_DRAGLEAVE_EVENT, i as SWC_DROPZONE_DRAGOVER_EVENT, o as SWC_DROPZONE_DROP_EVENT, r as SWC_DROPZONE_SHOULD_ACCEPT_EVENT };
14
+
15
+ //# sourceMappingURL=Dropzone.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropzone.types.js","names":[],"sources":["../../../components/dropzone/Dropzone.types.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// ──────────────────\n// SIZES\n// ──────────────────\n\nexport type DropzoneSize = 's' | 'm' | 'l';\n\nexport const DROPZONE_VALID_SIZES = [\n 's',\n 'm',\n 'l',\n] as const satisfies readonly DropzoneSize[];\n\n// ──────────────────\n// DROP EFFECT\n// ──────────────────\n\n/** Valid OS drag-cursor feedback values for the drop zone. */\nexport type DropEffect = 'copy' | 'move' | 'link' | 'none';\n\nexport const DROP_EFFECTS = [\n 'copy',\n 'move',\n 'link',\n 'none',\n] as const satisfies readonly DropEffect[];\n\nexport const DROPZONE_DEFAULT_DROP_EFFECT =\n 'copy' as const satisfies DropEffect;\n\n// ──────────────────\n// EVENTS\n// ──────────────────\n\n/** Fired when files are dragged over the drop zone; cancelable to reject. */\nexport const SWC_DROPZONE_SHOULD_ACCEPT_EVENT = 'swc-dropzone-should-accept';\n\n/** Fired when files are dragged over the drop zone and accepted. */\nexport const SWC_DROPZONE_DRAGOVER_EVENT = 'swc-dropzone-dragover';\n\n/** Fired when an accepted drag leaves the drop zone or becomes rejected. */\nexport const SWC_DROPZONE_DRAGLEAVE_EVENT = 'swc-dropzone-dragleave';\n\n/** Fired when files are dropped on the drop zone. */\nexport const SWC_DROPZONE_DROP_EVENT = 'swc-dropzone-drop';\n\n/**\n * Detail emitted with `swc-dropzone-dragleave`. Values are captured synchronously\n * from the native `DragEvent` before the 100 ms debounce timer fires, preventing\n * stale reads from a recycled event object.\n */\nexport interface DropzoneDragLeaveDetail {\n clientX: number;\n clientY: number;\n relatedTarget: EventTarget | null;\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n [SWC_DROPZONE_SHOULD_ACCEPT_EVENT]: CustomEvent<DragEvent>;\n [SWC_DROPZONE_DRAGOVER_EVENT]: CustomEvent<DragEvent>;\n [SWC_DROPZONE_DRAGLEAVE_EVENT]: CustomEvent<DropzoneDragLeaveDetail>;\n [SWC_DROPZONE_DROP_EVENT]: CustomEvent<DragEvent>;\n }\n}\n"],"mappings":";AAkBA,IAAa,IAAuB;CAClC;CACA;CACA;CACD,EASY,IAAe;CAC1B;CACA;CACA;CACA;CACD,EAEY,IACX,QAOW,IAAmC,8BAGnC,IAA8B,yBAG9B,IAA+B,0BAG/B,IAA0B"}
@@ -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 './Dropzone.base.js';
13
+ export * from './Dropzone.types.js';
@@ -0,0 +1,3 @@
1
+ import { DROPZONE_DEFAULT_DROP_EFFECT as e, DROPZONE_VALID_SIZES as t, DROP_EFFECTS as n, SWC_DROPZONE_DRAGLEAVE_EVENT as r, SWC_DROPZONE_DRAGOVER_EVENT as i, SWC_DROPZONE_DROP_EVENT as a, SWC_DROPZONE_SHOULD_ACCEPT_EVENT as o } from "./Dropzone.types.js";
2
+ import { DropzoneBase as s } from "./Dropzone.base.js";
3
+ export { e as DROPZONE_DEFAULT_DROP_EFFECT, t as DROPZONE_VALID_SIZES, n as DROP_EFFECTS, s as DropzoneBase, r as SWC_DROPZONE_DRAGLEAVE_EVENT, i as SWC_DROPZONE_DRAGOVER_EVENT, a as SWC_DROPZONE_DROP_EVENT, o as SWC_DROPZONE_SHOULD_ACCEPT_EVENT };
@@ -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