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

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 (58) hide show
  1. package/dist/components/accordion/AccordionItem.base.d.ts +16 -6
  2. package/dist/components/accordion/AccordionItem.base.js +6 -3
  3. package/dist/components/accordion/AccordionItem.base.js.map +1 -1
  4. package/dist/components/badge/Badge.base.d.ts +24 -8
  5. package/dist/components/badge/Badge.base.js +8 -5
  6. package/dist/components/badge/Badge.base.js.map +1 -1
  7. package/dist/components/button/Button.base.d.ts +16 -9
  8. package/dist/components/button/Button.base.js +7 -5
  9. package/dist/components/button/Button.base.js.map +1 -1
  10. package/dist/components/card/Card.base.d.ts +94 -46
  11. package/dist/components/card/Card.base.js +58 -19
  12. package/dist/components/card/Card.base.js.map +1 -1
  13. package/dist/components/card/Card.types.d.ts +1 -0
  14. package/dist/components/card/Card.types.js +2 -2
  15. package/dist/components/card/Card.types.js.map +1 -1
  16. package/dist/components/card/index.js +3 -3
  17. package/dist/controllers/index.d.ts +2 -0
  18. package/dist/controllers/index.js +13 -11
  19. package/dist/controllers/slot-presence-controller/index.d.ts +12 -0
  20. package/dist/controllers/slot-presence-controller/index.js +2 -0
  21. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.d.ts +57 -0
  22. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js +44 -0
  23. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js.map +1 -0
  24. package/dist/controllers/slot-text-controller/index.d.ts +12 -0
  25. package/dist/controllers/slot-text-controller/index.js +2 -0
  26. package/dist/controllers/slot-text-controller/src/slot-text-controller.d.ts +92 -0
  27. package/dist/controllers/slot-text-controller/src/slot-text-controller.js +53 -0
  28. package/dist/controllers/slot-text-controller/src/slot-text-controller.js.map +1 -0
  29. package/dist/element/index.d.ts +1 -1
  30. package/dist/element/index.js +2 -2
  31. package/dist/element/spectrum-element.d.ts +2 -17
  32. package/dist/element/spectrum-element.js +9 -26
  33. package/dist/element/spectrum-element.js.map +1 -1
  34. package/dist/element/version.d.ts +2 -2
  35. package/dist/element/version.js +1 -1
  36. package/dist/element/version.js.map +1 -1
  37. package/dist/mixins/index.d.ts +0 -2
  38. package/dist/mixins/index.js +4 -6
  39. package/dist/mixins/linear-progress-mixin.d.ts +1 -2
  40. package/dist/mixins/linear-progress-mixin.js +5 -5
  41. package/dist/mixins/linear-progress-mixin.js.map +1 -1
  42. package/dist/utils/index.d.ts +1 -0
  43. package/dist/utils/index.js +10 -9
  44. package/dist/utils/is-focus-visible-in-tree.d.ts +33 -0
  45. package/dist/utils/is-focus-visible-in-tree.js +11 -0
  46. package/dist/utils/is-focus-visible-in-tree.js.map +1 -0
  47. package/package.json +30 -16
  48. package/CHANGELOG.md +0 -125
  49. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/defineProperty.js +0 -12
  50. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPrimitive.js +0 -14
  51. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPropertyKey.js +0 -9
  52. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/typeof.js +0 -11
  53. package/dist/mixins/observe-slot-presence.d.ts +0 -12
  54. package/dist/mixins/observe-slot-presence.js +0 -40
  55. package/dist/mixins/observe-slot-presence.js.map +0 -1
  56. package/dist/mixins/observe-slot-text.d.ts +0 -11
  57. package/dist/mixins/observe-slot-text.js +0 -60
  58. package/dist/mixins/observe-slot-text.js.map +0 -1
@@ -1,4 +1,4 @@
1
1
  import { defineElement as e } from "./define-element.js";
2
2
  import { coreVersion as t, version as n } from "./version.js";
3
- import { SpectrumElement as r, SpectrumMixin as i } from "./spectrum-element.js";
4
- export { r as SpectrumElement, i as SpectrumMixin, t as coreVersion, e as defineElement, n as version };
3
+ import { SpectrumElement as r } from "./spectrum-element.js";
4
+ export { r as SpectrumElement, t as coreVersion, e as defineElement, n as version };
@@ -1,15 +1,5 @@
1
- import { LitElement, ReactiveElement } from 'lit';
2
- type Constructor<T = Record<string, unknown>> = {
3
- new (...args: any[]): T;
4
- prototype: T;
5
- };
6
- export interface SpectrumInterface {
7
- shadowRoot: ShadowRoot;
8
- hasVisibleFocusInTree(): boolean;
9
- }
10
- export declare function SpectrumMixin<T extends Constructor<ReactiveElement>>(constructor: T): T & Constructor<SpectrumInterface>;
11
- declare const SpectrumElement_base: typeof LitElement & Constructor<SpectrumInterface>;
12
- export declare class SpectrumElement extends SpectrumElement_base {
1
+ import { LitElement } from 'lit';
2
+ export declare class SpectrumElement extends LitElement {
13
3
  /**
14
4
  * @internal
15
5
  */
@@ -18,9 +8,4 @@ export declare class SpectrumElement extends SpectrumElement_base {
18
8
  * @internal
19
9
  */
20
10
  static CORE_VERSION: string;
21
- /**
22
- * @internal
23
- */
24
- get dir(): CSSStyleDeclaration['direction'];
25
11
  }
26
- export {};
@@ -1,26 +1,9 @@
1
- import { getActiveElement as e } from "../utils/get-active-element.js";
2
- import { coreVersion as t, version as n } from "./version.js";
3
- import { LitElement as r } from "lit";
1
+ import { coreVersion as e, version as t } from "./version.js";
2
+ import { LitElement as n } from "lit";
4
3
  //#region element/spectrum-element.ts
5
- var i;
6
- function a(t) {
7
- class n extends t {
8
- hasVisibleFocusInTree() {
9
- var t;
10
- let n = e(this.getRootNode());
11
- return (t = n == null ? void 0 : n.matches(":focus-visible")) == null ? !1 : t;
12
- }
13
- }
14
- return n;
15
- }
16
- var o = class extends a(r) {
17
- get dir() {
18
- var e;
19
- return (e = getComputedStyle(this).direction) == null ? "ltr" : e;
20
- }
21
- };
22
- if (i = o, i.VERSION = n, i.CORE_VERSION = t, process.env.NODE_ENV === "development") {
23
- var s, c, l;
4
+ var r, i = class extends n {};
5
+ if (r = i, r.VERSION = t, r.CORE_VERSION = e, process.env.NODE_ENV === "development") {
6
+ var a, o, s;
24
7
  let e = {
25
8
  default: !1,
26
9
  accessibility: !1,
@@ -35,14 +18,14 @@ if (i = o, i.VERSION = n, i.CORE_VERSION = t, process.env.NODE_ENV === "developm
35
18
  window.__swc = {
36
19
  ...window.__swc,
37
20
  DEBUG: !0,
38
- ignoreWarningLocalNames: { ...((s = window.__swc) == null ? void 0 : s.ignoreWarningLocalNames) || {} },
21
+ ignoreWarningLocalNames: { ...((a = window.__swc) == null ? void 0 : a.ignoreWarningLocalNames) || {} },
39
22
  ignoreWarningTypes: {
40
23
  ...e,
41
- ...((c = window.__swc) == null ? void 0 : c.ignoreWarningTypes) || {}
24
+ ...((o = window.__swc) == null ? void 0 : o.ignoreWarningTypes) || {}
42
25
  },
43
26
  ignoreWarningLevels: {
44
27
  ...t,
45
- ...((l = window.__swc) == null ? void 0 : l.ignoreWarningLevels) || {}
28
+ ...((s = window.__swc) == null ? void 0 : s.ignoreWarningLevels) || {}
46
29
  },
47
30
  issuedWarnings: /* @__PURE__ */ new Set(),
48
31
  warn: (e, t, n, { type: r = "api", level: i = "default", issues: a } = {}) => {
@@ -61,6 +44,6 @@ if (i = o, i.VERSION = n, i.CORE_VERSION = t, process.env.NODE_ENV === "developm
61
44
  }, window.__swc.warn(void 0, "Spectrum Web Components is in dev mode. Not recommended for production!", "https://opensource.adobe.com/spectrum-web-components/dev-mode/", { type: "default" });
62
45
  }
63
46
  //#endregion
64
- export { o as SpectrumElement, a as SpectrumMixin };
47
+ export { i as SpectrumElement };
65
48
 
66
49
  //# sourceMappingURL=spectrum-element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spectrum-element.js","names":[],"sources":["../../element/spectrum-element.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 { LitElement, ReactiveElement } from 'lit';\n\nimport { getActiveElement } from '../utils/get-active-element.js';\nimport { coreVersion, version } from './version.js';\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport interface SpectrumInterface {\n shadowRoot: ShadowRoot;\n hasVisibleFocusInTree(): boolean;\n}\n\nexport function SpectrumMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<SpectrumInterface> {\n class SpectrumMixinElement extends constructor {\n /**\n * @internal\n */\n public override shadowRoot!: ShadowRoot;\n\n /**\n * @internal\n */\n public hasVisibleFocusInTree(): boolean {\n const active = getActiveElement(\n this.getRootNode() as Document | ShadowRoot\n );\n\n return active?.matches(':focus-visible') ?? false;\n }\n }\n return SpectrumMixinElement;\n}\n\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n /**\n * @internal\n */\n static VERSION = version;\n\n /**\n * @internal\n */\n static CORE_VERSION = coreVersion;\n\n /**\n * @internal\n */\n public override get dir(): CSSStyleDeclaration['direction'] {\n return getComputedStyle(this).direction ?? 'ltr';\n }\n}\n\nif (process.env.NODE_ENV === 'development') {\n const ignoreWarningTypes = {\n default: false,\n accessibility: false,\n api: false,\n };\n const ignoreWarningLevels = {\n default: false,\n low: false,\n medium: false,\n high: false,\n deprecation: false,\n };\n window.__swc = {\n ...window.__swc,\n DEBUG: true,\n ignoreWarningLocalNames: {\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n ...(window.__swc?.ignoreWarningLevels || {}),\n },\n issuedWarnings: new Set(),\n warn: (\n element,\n message,\n url,\n { type = 'api', level = 'default', issues } = {}\n ): void => {\n const { localName = 'base' } = element || {};\n const id = `${localName}:${type}:${level}` as BrandedSWCWarningID;\n if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id)) {\n return;\n }\n if (window.__swc.ignoreWarningLocalNames[localName]) {\n return;\n }\n if (window.__swc.ignoreWarningTypes[type]) {\n return;\n }\n if (window.__swc.ignoreWarningLevels[level]) {\n return;\n }\n window.__swc.issuedWarnings.add(id);\n let listedIssues = '';\n if (issues && issues.length) {\n issues.unshift('');\n listedIssues = issues.join('\\n - ') + '\\n';\n }\n const intro = level === 'deprecation' ? 'DEPRECATION NOTICE: ' : '';\n const inspectElement = element\n ? '\\nInspect this issue in the follow element:'\n : '';\n const displayURL = (element ? '\\n\\n' : '\\n') + url + '\\n';\n const messages: unknown[] = [];\n messages.push(intro + message + '\\n' + listedIssues + inspectElement);\n if (element) {\n messages.push(element);\n }\n messages.push(displayURL, {\n data: {\n localName,\n type,\n level,\n },\n });\n console.warn(...messages);\n },\n };\n\n window.__swc.warn(\n undefined,\n 'Spectrum Web Components is in dev mode. Not recommended for production!',\n 'https://opensource.adobe.com/spectrum-web-components/dev-mode/',\n { type: 'default' }\n );\n}\n"],"mappings":";;;;;AA4BA,SAAgB,EACd,GACoC;CACpC,MAAM,UAA6B,EAAY;EAS7C,wBAAwC;;GACtC,IAAM,IAAS,EACb,KAAK,aAAa,CACnB;AAED,WAAA,IAAA,KAAA,OAAA,KAAA,IAAO,EAAQ,QAAQ,iBAAiB,KAAA,OAAI,KAAJ;;;AAG5C,QAAO;;AAGT,IAAa,IAAb,cAAqC,EAAc,EAAW,CAAC;CAc7D,IAAoB,MAAwC;;AAC1D,UAAA,IAAO,iBAAiB,KAAK,CAAC,cAAA,OAAa,QAAb;;;AAIlC,uBAfmB,oBAKK,GAUxB,QAAA,IAAA,aAA6B,eAAe;;CAC1C,IAAM,IAAqB;EACzB,SAAS;EACT,eAAe;EACf,KAAK;EACN,EACK,IAAsB;EAC1B,SAAS;EACT,KAAK;EACL,QAAQ;EACR,MAAM;EACN,aAAa;EACd;AA+DD,CA9DA,OAAO,QAAQ;EACb,GAA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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 { LitElement } from 'lit';\n\nimport { coreVersion, version } from './version.js';\n\nexport class SpectrumElement extends LitElement {\n /**\n * @internal\n */\n static VERSION = version;\n\n /**\n * @internal\n */\n static CORE_VERSION = coreVersion;\n}\n\nif (process.env.NODE_ENV === 'development') {\n const ignoreWarningTypes = {\n default: false,\n accessibility: false,\n api: false,\n };\n const ignoreWarningLevels = {\n default: false,\n low: false,\n medium: false,\n high: false,\n deprecation: false,\n };\n window.__swc = {\n ...window.__swc,\n DEBUG: true,\n ignoreWarningLocalNames: {\n ...(window.__swc?.ignoreWarningLocalNames || {}),\n },\n ignoreWarningTypes: {\n ...ignoreWarningTypes,\n ...(window.__swc?.ignoreWarningTypes || {}),\n },\n ignoreWarningLevels: {\n ...ignoreWarningLevels,\n ...(window.__swc?.ignoreWarningLevels || {}),\n },\n issuedWarnings: new Set(),\n warn: (\n element,\n message,\n url,\n { type = 'api', level = 'default', issues } = {}\n ): void => {\n const { localName = 'base' } = element || {};\n const id = `${localName}:${type}:${level}` as BrandedSWCWarningID;\n if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id)) {\n return;\n }\n if (window.__swc.ignoreWarningLocalNames[localName]) {\n return;\n }\n if (window.__swc.ignoreWarningTypes[type]) {\n return;\n }\n if (window.__swc.ignoreWarningLevels[level]) {\n return;\n }\n window.__swc.issuedWarnings.add(id);\n let listedIssues = '';\n if (issues && issues.length) {\n issues.unshift('');\n listedIssues = issues.join('\\n - ') + '\\n';\n }\n const intro = level === 'deprecation' ? 'DEPRECATION NOTICE: ' : '';\n const inspectElement = element\n ? '\\nInspect this issue in the follow element:'\n : '';\n const displayURL = (element ? '\\n\\n' : '\\n') + url + '\\n';\n const messages: unknown[] = [];\n messages.push(intro + message + '\\n' + listedIssues + inspectElement);\n if (element) {\n messages.push(element);\n }\n messages.push(displayURL, {\n data: {\n localName,\n type,\n level,\n },\n });\n console.warn(...messages);\n },\n };\n\n window.__swc.warn(\n undefined,\n 'Spectrum Web Components is in dev mode. Not recommended for production!',\n 'https://opensource.adobe.com/spectrum-web-components/dev-mode/',\n { type: 'default' }\n );\n}\n"],"mappings":";;;OAgBa,IAAb,cAAqC,EAAW;AAYhD,uBARmB,oBAKK,GAGxB,QAAA,IAAA,aAA6B,eAAe;;CAC1C,IAAM,IAAqB;EACzB,SAAS;EACT,eAAe;EACf,KAAK;EACN,EACK,IAAsB;EAC1B,SAAS;EACT,KAAK;EACL,QAAQ;EACR,MAAM;EACN,aAAa;EACd;AA+DD,CA9DA,OAAO,QAAQ;EACb,GAAG,OAAO;EACV,OAAO;EACP,yBAAyB,EACvB,KAAA,IAAI,OAAO,UAAA,OAAA,KAAA,IAAA,EAAO,4BAA2B,EAAE,EAChD;EACD,oBAAoB;GAClB,GAAG;GACH,KAAA,IAAI,OAAO,UAAA,OAAA,KAAA,IAAA,EAAO,uBAAsB,EAAE;GAC3C;EACD,qBAAqB;GACnB,GAAG;GACH,KAAA,IAAI,OAAO,UAAA,OAAA,KAAA,IAAA,EAAO,wBAAuB,EAAE;GAC5C;EACD,gCAAgB,IAAI,KAAK;EACzB,OACE,GACA,GACA,GACA,EAAE,UAAO,OAAO,WAAQ,WAAW,cAAW,EAAE,KACvC;GACT,IAAM,EAAE,eAAY,WAAW,KAAW,EAAE,EACtC,IAAK,GAAG,EAAU,GAAG,EAAK,GAAG;AAUnC,OATI,CAAC,OAAO,MAAM,WAAW,OAAO,MAAM,eAAe,IAAI,EAAG,IAG5D,OAAO,MAAM,wBAAwB,MAGrC,OAAO,MAAM,mBAAmB,MAGhC,OAAO,MAAM,oBAAoB,GACnC;AAEF,UAAO,MAAM,eAAe,IAAI,EAAG;GACnC,IAAI,IAAe;AACnB,GAAI,KAAU,EAAO,WACnB,EAAO,QAAQ,GAAG,EAClB,IAAe,EAAO,KAAK,WAAW,GAAG;GAE3C,IAAM,IAAQ,MAAU,gBAAgB,yBAAyB,IAC3D,IAAiB,IACnB,gDACA,IACE,KAAc,IAAU,SAAS,QAAQ,IAAM,MAC/C,IAAsB,EAAE;AAY9B,GAXA,EAAS,KAAK,IAAQ,IAAU,OAAO,IAAe,EAAe,EACjE,KACF,EAAS,KAAK,EAAQ,EAExB,EAAS,KAAK,GAAY,EACxB,MAAM;IACJ;IACA;IACA;IACD,EACF,CAAC,EACF,QAAQ,KAAK,GAAG,EAAS;;EAE5B,EAED,OAAO,MAAM,KACX,KAAA,GACA,2EACA,kEACA,EAAE,MAAM,WAAW,CACpB"}
@@ -12,8 +12,8 @@
12
12
  /**
13
13
  * The version of the 2nd-gen Spectrum Web Components library.
14
14
  */
15
- export declare const version = "2.0.0-beta.1";
15
+ export declare const version = "2.0.0-next.20260728161641";
16
16
  /**
17
17
  * The version of the core base package.
18
18
  */
19
- export declare const coreVersion = "2.0.0-beta.1";
19
+ export declare const coreVersion = "2.0.0-next.20260728161641";
@@ -1,5 +1,5 @@
1
1
  //#region element/version.ts
2
- var e = "2.0.0-beta.1", t = "2.0.0-beta.1";
2
+ var e = "2.0.0-next.20260728161641", t = "2.0.0-next.20260728161641";
3
3
  //#endregion
4
4
  export { t as coreVersion, e as version };
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","names":[],"sources":["../../element/version.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// Auto-generated from 2nd-gen/packages/core/package.json\n// Generation: 2nd-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 2nd-gen Spectrum Web Components library.\n */\nexport const version = '2.0.0-beta.1';\n\n/**\n * The version of the core base package.\n */\nexport const coreVersion = '2.0.0-beta.1';\n"],"mappings":";AAmBA,IAAa,IAAU,gBAKV,IAAc"}
1
+ {"version":3,"file":"version.js","names":[],"sources":["../../element/version.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// Auto-generated from 2nd-gen/packages/core/package.json\n// Generation: 2nd-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 2nd-gen Spectrum Web Components library.\n */\nexport const version = '2.0.0-next.20260728161641';\n\n/**\n * The version of the core base package.\n */\nexport const coreVersion = '2.0.0-next.20260728161641';\n"],"mappings":";AAmBA,IAAa,IAAU,6BAKV,IAAc"}
@@ -11,8 +11,6 @@
11
11
  */
12
12
  export { DisabledMixin, type DisabledInterface } from './disabled-mixin.js';
13
13
  export { LINEAR_PROGRESS_LABEL_POSITIONS, LINEAR_PROGRESS_STATIC_COLORS, LINEAR_PROGRESS_VALID_SIZES, LinearProgressMixin, type LinearProgressInterface, type LinearProgressLabelPosition, type LinearProgressSize, type LinearProgressStaticColor, } from './linear-progress-mixin.js';
14
- export { ObserveSlotPresence, type SlotPresenceObservingInterface, } from './observe-slot-presence.js';
15
- export { ObserveSlotText, type SlotTextObservingInterface, } from './observe-slot-text.js';
16
14
  export { PendingMixin, type PendingInterface } from './pending-mixin.js';
17
15
  export { DEFAULT_ELEMENT_SIZES, ELEMENT_SIZES, SizedMixin, } from './sized-mixin.js';
18
16
  export type { DefaultElementSize, ElementSize, SizedElementConstructor, SizedElementInterface, } from './sized-mixin.js';
@@ -1,7 +1,5 @@
1
1
  import { DisabledMixin as e } from "./disabled-mixin.js";
2
- import { ObserveSlotPresence as t } from "./observe-slot-presence.js";
3
- import { LINEAR_PROGRESS_LABEL_POSITIONS as n, LINEAR_PROGRESS_STATIC_COLORS as r, LINEAR_PROGRESS_VALID_SIZES as i, LinearProgressMixin as a } from "./linear-progress-mixin.js";
4
- import { ObserveSlotText as o } from "./observe-slot-text.js";
5
- import { PendingMixin as s } from "./pending-mixin.js";
6
- import { DEFAULT_ELEMENT_SIZES as c, ELEMENT_SIZES as l, SizedMixin as u } from "./sized-mixin.js";
7
- export { c as DEFAULT_ELEMENT_SIZES, e as DisabledMixin, l as ELEMENT_SIZES, n as LINEAR_PROGRESS_LABEL_POSITIONS, r as LINEAR_PROGRESS_STATIC_COLORS, i as LINEAR_PROGRESS_VALID_SIZES, a as LinearProgressMixin, t as ObserveSlotPresence, o as ObserveSlotText, s as PendingMixin, u as SizedMixin };
2
+ import { LINEAR_PROGRESS_LABEL_POSITIONS as t, LINEAR_PROGRESS_STATIC_COLORS as n, LINEAR_PROGRESS_VALID_SIZES as r, LinearProgressMixin as i } from "./linear-progress-mixin.js";
3
+ import { PendingMixin as a } from "./pending-mixin.js";
4
+ import { DEFAULT_ELEMENT_SIZES as o, ELEMENT_SIZES as s, SizedMixin as c } from "./sized-mixin.js";
5
+ export { o as DEFAULT_ELEMENT_SIZES, e as DisabledMixin, s as ELEMENT_SIZES, t as LINEAR_PROGRESS_LABEL_POSITIONS, n as LINEAR_PROGRESS_STATIC_COLORS, r as LINEAR_PROGRESS_VALID_SIZES, i as LinearProgressMixin, a as PendingMixin, c as SizedMixin };
@@ -1,5 +1,4 @@
1
1
  import { ReactiveElement } from 'lit';
2
- import { SlotPresenceObservingInterface } from './observe-slot-presence.js';
3
2
  type Constructor<T = Record<string, unknown>> = {
4
3
  new (...args: any[]): T;
5
4
  prototype: T;
@@ -10,7 +9,7 @@ export declare const LINEAR_PROGRESS_STATIC_COLORS: readonly ["white", "black"];
10
9
  export type LinearProgressStaticColor = (typeof LINEAR_PROGRESS_STATIC_COLORS)[number];
11
10
  export declare const LINEAR_PROGRESS_LABEL_POSITIONS: readonly ["top", "side"];
12
11
  export type LinearProgressLabelPosition = (typeof LINEAR_PROGRESS_LABEL_POSITIONS)[number];
13
- export interface LinearProgressInterface extends SlotPresenceObservingInterface {
12
+ export interface LinearProgressInterface {
14
13
  value: number;
15
14
  minValue: number;
16
15
  maxValue: number;
@@ -1,6 +1,6 @@
1
1
  import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
2
2
  import { LanguageResolutionController as t } from "../controllers/language-resolution.js";
3
- import { ObserveSlotPresence as n } from "./observe-slot-presence.js";
3
+ import { SlotPresenceController as n } from "../controllers/slot-presence-controller/src/slot-presence-controller.js";
4
4
  import { property as r } from "lit/decorators.js";
5
5
  //#region mixins/linear-progress-mixin.ts
6
6
  var i = [
@@ -10,9 +10,9 @@ var i = [
10
10
  "xl"
11
11
  ], a = ["white", "black"], o = ["top", "side"], s = { style: "percent" }, c = "[slot=\"label\"]", l = "[slot=\"description\"]", u = 0;
12
12
  function d(i) {
13
- class a extends n(i, [c, l]) {
13
+ class a extends i {
14
14
  constructor(...e) {
15
- super(...e), this.value = 0, this.minValue = 0, this.maxValue = 100, this.accessibleLabel = "", this.labelPosition = "top", this.languageResolver = new t(this), this._instanceId = ++u, this._hasWarnedNoAccessibleName = !1, this._hasWarnedValueOutOfRange = !1;
15
+ super(...e), this.slotPresence = new n(this, [c, l]), this.value = 0, this.minValue = 0, this.maxValue = 100, this.accessibleLabel = "", this.labelPosition = "top", this.languageResolver = new t(this), this._instanceId = ++u, this._hasWarnedNoAccessibleName = !1, this._hasWarnedValueOutOfRange = !1;
16
16
  }
17
17
  get docsHref() {
18
18
  return `https://spectrum-web-components.adobe.com/?path=/docs/components-${this.localName.replace(/^swc-/, "")}--docs`;
@@ -24,10 +24,10 @@ function d(i) {
24
24
  return `swc-linear-progress-description-${this._instanceId}`;
25
25
  }
26
26
  get hasLabelSlotContent() {
27
- return this.getSlotContentPresence(c);
27
+ return this.slotPresence.getPresence(c);
28
28
  }
29
29
  get hasDescriptionSlotContent() {
30
- return this.getSlotContentPresence(l);
30
+ return this.slotPresence.getPresence(l);
31
31
  }
32
32
  get sanitizedMin() {
33
33
  let e = Number.isFinite(this.minValue) ? this.minValue : 0, t = Number.isFinite(this.maxValue) ? this.maxValue : 100;
@@ -1 +1 @@
1
- {"version":3,"file":"linear-progress-mixin.js","names":[],"sources":["../../mixins/linear-progress-mixin.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, ReactiveElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { LanguageResolutionController } from '../controllers/language-resolution.js';\nimport {\n ObserveSlotPresence,\n type SlotPresenceObservingInterface,\n} from './observe-slot-presence.js';\nimport type { ElementSize } from './sized-mixin.js';\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport const LINEAR_PROGRESS_VALID_SIZES = [\n 's',\n 'm',\n 'l',\n 'xl',\n] as const satisfies readonly ElementSize[];\nexport type LinearProgressSize = (typeof LINEAR_PROGRESS_VALID_SIZES)[number];\n\nexport const LINEAR_PROGRESS_STATIC_COLORS = ['white', 'black'] as const;\nexport type LinearProgressStaticColor =\n (typeof LINEAR_PROGRESS_STATIC_COLORS)[number];\n\nexport const LINEAR_PROGRESS_LABEL_POSITIONS = ['top', 'side'] as const;\nexport type LinearProgressLabelPosition =\n (typeof LINEAR_PROGRESS_LABEL_POSITIONS)[number];\n\nconst DEFAULT_FORMAT_OPTIONS: Intl.NumberFormatOptions = { style: 'percent' };\n\nconst LABEL_SLOT_SELECTOR = '[slot=\"label\"]';\nconst DESCRIPTION_SLOT_SELECTOR = '[slot=\"description\"]';\n\nexport interface LinearProgressInterface extends SlotPresenceObservingInterface {\n value: number;\n minValue: number;\n maxValue: number;\n accessibleLabel: string;\n valueLabel?: string;\n formatOptions?: Intl.NumberFormatOptions;\n labelPosition: LinearProgressLabelPosition;\n staticColor?: LinearProgressStaticColor;\n readonly sanitizedMin: number;\n readonly sanitizedMax: number;\n readonly clampedValue: number;\n readonly fillPercent: number;\n readonly formattedValue: string;\n readonly hasLabelSlotContent: boolean;\n readonly hasDescriptionSlotContent: boolean;\n readonly labelContainerId: string;\n readonly descriptionContainerId: string;\n}\n\nlet nextLinearProgressId = 0;\n\n/**\n * Mixin for linear progress components. Owns the typed property\n * declarations, sanitized range + value, locale formatting, light-DOM\n * slot presence tracking (so the shadow-DOM containers and slots can\n * be fully conditional), and the DEBUG accessible-name warning.\n *\n * Intentionally silent on `role` and animation — those stay in each\n * component's own base class.\n */\nexport function LinearProgressMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<LinearProgressInterface> {\n class LinearProgressElement\n extends ObserveSlotPresence(constructor, [\n LABEL_SLOT_SELECTOR,\n DESCRIPTION_SLOT_SELECTOR,\n ])\n implements LinearProgressInterface\n {\n /**\n * Current value. Sanitized via `clampedValue` for rendering and\n * `aria-valuenow`.\n */\n @property({ type: Number, reflect: true })\n public value = 0;\n\n /**\n * Bottom of the value range.\n */\n @property({ type: Number, reflect: true, attribute: 'min-value' })\n public minValue = 0;\n\n /**\n * Top of the value range.\n */\n @property({ type: Number, reflect: true, attribute: 'max-value' })\n public maxValue = 100;\n\n /**\n * Rare-case accessible-name fallback used when there is no visible\n * `label` slot content (for example, a data grid of meters).\n * Renders into `aria-label` on the role element when set.\n */\n @property({ type: String, attribute: 'accessible-label' })\n public accessibleLabel = '';\n\n /**\n * Custom value text (e.g. `\"1 of 4\"`). Overrides the auto-formatted\n * value in both rendered text and `aria-valuetext`.\n */\n @property({ type: String, attribute: 'value-label' })\n public valueLabel?: string;\n\n /**\n * `Intl.NumberFormatOptions` used to format the visible value and\n * `aria-valuetext` when `valueLabel` is unset. JS property only —\n * no attribute (full `Intl.NumberFormat` pass-through).\n */\n @property({ attribute: false })\n public formatOptions?: Intl.NumberFormatOptions;\n\n /**\n * Position of the label relative to the bar.\n */\n @property({ type: String, reflect: true, attribute: 'label-position' })\n public labelPosition: LinearProgressLabelPosition = 'top';\n\n /**\n * Static color override for use on images or colored backgrounds.\n */\n @property({ type: String, reflect: true, attribute: 'static-color' })\n public staticColor?: LinearProgressStaticColor;\n\n private readonly languageResolver = new LanguageResolutionController(this);\n\n private readonly _instanceId = ++nextLinearProgressId;\n\n /**\n * @internal\n *\n * Documentation URL used in DEBUG warnings. Derived from the custom\n * element tag name so each concrete component gets an accurate link\n * with no per-subclass override needed (e.g. `swc-meter` →\n * `components-meter--docs`, `swc-progress-bar` →\n * `components-progress-bar--docs`).\n */\n protected get docsHref(): string {\n const name = this.localName.replace(/^swc-/, '');\n return `https://spectrum-web-components.adobe.com/?path=/docs/components-${name}--docs`;\n }\n\n /**\n * @internal\n */\n public get labelContainerId(): string {\n return `swc-linear-progress-label-${this._instanceId}`;\n }\n\n /**\n * @internal\n */\n public get descriptionContainerId(): string {\n return `swc-linear-progress-description-${this._instanceId}`;\n }\n\n /**\n * @internal\n */\n public get hasLabelSlotContent(): boolean {\n return this.getSlotContentPresence(LABEL_SLOT_SELECTOR);\n }\n\n /**\n * @internal\n */\n public get hasDescriptionSlotContent(): boolean {\n return this.getSlotContentPresence(DESCRIPTION_SLOT_SELECTOR);\n }\n\n /**\n * @internal\n *\n * Sanitized lower bound: falls back to 0 when `minValue` is non-finite,\n * and to the smaller of (min, max) when the two are reversed. ARIA\n * `aria-valuemin`, `aria-valuenow`, `aria-valuetext`, and the rendered\n * fill all read from the same sanitized range so screen-reader output\n * stays internally consistent.\n */\n public get sanitizedMin(): number {\n const min = Number.isFinite(this.minValue) ? this.minValue : 0;\n const max = Number.isFinite(this.maxValue) ? this.maxValue : 100;\n return Math.min(min, max);\n }\n\n /**\n * @internal\n *\n * Sanitized upper bound. See `sanitizedMin`.\n */\n public get sanitizedMax(): number {\n const min = Number.isFinite(this.minValue) ? this.minValue : 0;\n const max = Number.isFinite(this.maxValue) ? this.maxValue : 100;\n return Math.max(min, max);\n }\n\n /**\n * @internal\n */\n public get clampedValue(): number {\n const value = Number.isFinite(this.value) ? this.value : 0;\n return Math.min(this.sanitizedMax, Math.max(this.sanitizedMin, value));\n }\n\n /**\n * @internal\n */\n public get fillPercent(): number {\n const min = this.sanitizedMin;\n const max = this.sanitizedMax;\n if (max === min) {\n return 0;\n }\n const fraction = (this.clampedValue - min) / (max - min);\n return Math.min(100, Math.max(0, fraction * 100));\n }\n\n /**\n * @internal\n */\n public get formattedValue(): string {\n if (this.valueLabel) {\n return this.valueLabel;\n }\n const min = this.sanitizedMin;\n const max = this.sanitizedMax;\n // Treat anything that is not a plain options object (null, undefined,\n // empty string from Storybook helpers, etc.) as \"no override\" and\n // fall back to the percent default.\n const providedOptions =\n this.formatOptions &&\n typeof this.formatOptions === 'object' &&\n Object.keys(this.formatOptions).length > 0\n ? this.formatOptions\n : DEFAULT_FORMAT_OPTIONS;\n const formatter = new Intl.NumberFormat(\n this.languageResolver.language,\n providedOptions\n );\n // Percent style consumes a fraction; every other style consumes the\n // raw value.\n if (providedOptions.style === 'percent') {\n const fraction =\n max === min ? 0 : (this.clampedValue - min) / (max - min);\n return formatter.format(fraction);\n }\n return formatter.format(this.clampedValue);\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n\n // Locale changes are picked up automatically: the\n // `LanguageResolutionController` requests an update with\n // `languageResolverUpdatedSymbol`, which re-runs `render()`. The\n // render template reads `formattedValue` (which reads\n // `languageResolver.language` lazily), so the new locale is already\n // reflected in this render cycle. No second `requestUpdate()`\n // needed here.\n\n // Only re-evaluate the accessible-name fallback when the inputs\n // that determine it actually change, so the warning does not fire\n // on every property update during development.\n if (\n window.__swc?.DEBUG &&\n (changes.has('accessibleLabel') || !this._hasWarnedNoAccessibleName)\n ) {\n this.warnMissingAccessibleName();\n }\n\n // Surface a dev warning when `value` falls outside the resolved\n // range. The value is still clamped for rendering and ARIA, but the\n // clamp is otherwise silent, so flag it as a likely authoring error.\n if (\n window.__swc?.DEBUG &&\n (changes.has('value') ||\n changes.has('minValue') ||\n changes.has('maxValue'))\n ) {\n this.warnValueOutOfRange();\n }\n }\n\n private _hasWarnedNoAccessibleName = false;\n\n private _hasWarnedValueOutOfRange = false;\n\n private warnValueOutOfRange(): void {\n const value = this.value;\n const min = this.sanitizedMin;\n const max = this.sanitizedMax;\n if (!Number.isFinite(value) || (value >= min && value <= max)) {\n this._hasWarnedValueOutOfRange = false;\n return;\n }\n if (this._hasWarnedValueOutOfRange) {\n return;\n }\n this._hasWarnedValueOutOfRange = true;\n window.__swc?.warn(\n this,\n `<${this.localName}> \"value\" (${value}) is outside the [${min}, ${max}] range and was clamped to ${this.clampedValue}.`,\n this.docsHref,\n {\n issues: [\n 'set \"value\" within the \"min-value\" and \"max-value\" range, or',\n 'adjust \"min-value\"/\"max-value\" so the range includes the value.',\n ],\n }\n );\n }\n\n private warnMissingAccessibleName(): void {\n if (this.hasLabelSlotContent || this.accessibleLabel) {\n this._hasWarnedNoAccessibleName = false;\n return;\n }\n this._hasWarnedNoAccessibleName = true;\n window.__swc?.warn(\n this,\n `<${this.localName}> requires an accessible name.`,\n this.docsHref,\n {\n type: 'accessibility',\n issues: [\n 'add visible label content via the \"label\" named slot, or',\n 'set the \"accessible-label\" attribute (or \"accessibleLabel\" property) when there is no visible label.',\n ],\n }\n );\n }\n }\n return LinearProgressElement as unknown as T &\n Constructor<LinearProgressInterface>;\n}\n"],"mappings":";;;;;AA2BA,IAAa,IAA8B;CACzC;CACA;CACA;CACA;CACD,EAGY,IAAgC,CAAC,SAAS,QAAQ,EAIlD,IAAkC,CAAC,OAAO,OAAO,EAIxD,IAAmD,EAAE,OAAO,WAAW,EAEvE,IAAsB,oBACtB,IAA4B,0BAsB9B,IAAuB;AAW3B,SAAgB,EACd,GAC0C;CAC1C,MAAM,UACI,EAAoB,GAAa,CACvC,GACA,EACD,CAAC,CAEJ;;6BAMiB,mBAMG,mBAMA,4BAQO,yBAqB2B,+BAQhB,IAAI,EAA6B,KAAK,qBAE3C,EAAE,qCA6JI,qCAED;;EApJpC,IAAc,WAAmB;AAE/B,UAAO,oEADM,KAAK,UAAU,QAAQ,SAAS,GAAG,CACgC;;EAMlF,IAAW,mBAA2B;AACpC,UAAO,6BAA6B,KAAK;;EAM3C,IAAW,yBAAiC;AAC1C,UAAO,mCAAmC,KAAK;;EAMjD,IAAW,sBAA+B;AACxC,UAAO,KAAK,uBAAuB,EAAoB;;EAMzD,IAAW,4BAAqC;AAC9C,UAAO,KAAK,uBAAuB,EAA0B;;EAY/D,IAAW,eAAuB;GAChC,IAAM,IAAM,OAAO,SAAS,KAAK,SAAS,GAAG,KAAK,WAAW,GACvD,IAAM,OAAO,SAAS,KAAK,SAAS,GAAG,KAAK,WAAW;AAC7D,UAAO,KAAK,IAAI,GAAK,EAAI;;EAQ3B,IAAW,eAAuB;GAChC,IAAM,IAAM,OAAO,SAAS,KAAK,SAAS,GAAG,KAAK,WAAW,GACvD,IAAM,OAAO,SAAS,KAAK,SAAS,GAAG,KAAK,WAAW;AAC7D,UAAO,KAAK,I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,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,EAmNhE"}
1
+ {"version":3,"file":"linear-progress-mixin.js","names":[],"sources":["../../mixins/linear-progress-mixin.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, ReactiveElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { LanguageResolutionController } from '../controllers/language-resolution.js';\nimport { SlotPresenceController } from '../controllers/slot-presence-controller/index.js';\nimport type { ElementSize } from './sized-mixin.js';\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport const LINEAR_PROGRESS_VALID_SIZES = [\n 's',\n 'm',\n 'l',\n 'xl',\n] as const satisfies readonly ElementSize[];\nexport type LinearProgressSize = (typeof LINEAR_PROGRESS_VALID_SIZES)[number];\n\nexport const LINEAR_PROGRESS_STATIC_COLORS = ['white', 'black'] as const;\nexport type LinearProgressStaticColor =\n (typeof LINEAR_PROGRESS_STATIC_COLORS)[number];\n\nexport const LINEAR_PROGRESS_LABEL_POSITIONS = ['top', 'side'] as const;\nexport type LinearProgressLabelPosition =\n (typeof LINEAR_PROGRESS_LABEL_POSITIONS)[number];\n\nconst DEFAULT_FORMAT_OPTIONS: Intl.NumberFormatOptions = { style: 'percent' };\n\nconst LABEL_SLOT_SELECTOR = '[slot=\"label\"]';\nconst DESCRIPTION_SLOT_SELECTOR = '[slot=\"description\"]';\n\nexport interface LinearProgressInterface {\n value: number;\n minValue: number;\n maxValue: number;\n accessibleLabel: string;\n valueLabel?: string;\n formatOptions?: Intl.NumberFormatOptions;\n labelPosition: LinearProgressLabelPosition;\n staticColor?: LinearProgressStaticColor;\n readonly sanitizedMin: number;\n readonly sanitizedMax: number;\n readonly clampedValue: number;\n readonly fillPercent: number;\n readonly formattedValue: string;\n readonly hasLabelSlotContent: boolean;\n readonly hasDescriptionSlotContent: boolean;\n readonly labelContainerId: string;\n readonly descriptionContainerId: string;\n}\n\nlet nextLinearProgressId = 0;\n\n/**\n * Mixin for linear progress components. Owns the typed property\n * declarations, sanitized range + value, locale formatting, light-DOM\n * slot presence tracking (so the shadow-DOM containers and slots can\n * be fully conditional), and the DEBUG accessible-name warning.\n *\n * Intentionally silent on `role` and animation — those stay in each\n * component's own base class.\n */\nexport function LinearProgressMixin<T extends Constructor<ReactiveElement>>(\n constructor: T\n): T & Constructor<LinearProgressInterface> {\n class LinearProgressElement\n extends constructor\n implements LinearProgressInterface\n {\n /**\n * Observes the light-DOM `label` and `description` slots so the shadow-DOM\n * containers and slots can be fully conditional.\n */\n private readonly slotPresence = new SlotPresenceController(this, [\n LABEL_SLOT_SELECTOR,\n DESCRIPTION_SLOT_SELECTOR,\n ]);\n\n /**\n * Current value. Sanitized via `clampedValue` for rendering and\n * `aria-valuenow`.\n */\n @property({ type: Number, reflect: true })\n public value = 0;\n\n /**\n * Bottom of the value range.\n */\n @property({ type: Number, reflect: true, attribute: 'min-value' })\n public minValue = 0;\n\n /**\n * Top of the value range.\n */\n @property({ type: Number, reflect: true, attribute: 'max-value' })\n public maxValue = 100;\n\n /**\n * Rare-case accessible-name fallback used when there is no visible\n * `label` slot content (for example, a data grid of meters).\n * Renders into `aria-label` on the role element when set.\n */\n @property({ type: String, attribute: 'accessible-label' })\n public accessibleLabel = '';\n\n /**\n * Custom value text (e.g. `\"1 of 4\"`). Overrides the auto-formatted\n * value in both rendered text and `aria-valuetext`.\n */\n @property({ type: String, attribute: 'value-label' })\n public valueLabel?: string;\n\n /**\n * `Intl.NumberFormatOptions` used to format the visible value and\n * `aria-valuetext` when `valueLabel` is unset. JS property only —\n * no attribute (full `Intl.NumberFormat` pass-through).\n */\n @property({ attribute: false })\n public formatOptions?: Intl.NumberFormatOptions;\n\n /**\n * Position of the label relative to the bar.\n */\n @property({ type: String, reflect: true, attribute: 'label-position' })\n public labelPosition: LinearProgressLabelPosition = 'top';\n\n /**\n * Static color override for use on images or colored backgrounds.\n */\n @property({ type: String, reflect: true, attribute: 'static-color' })\n public staticColor?: LinearProgressStaticColor;\n\n private readonly languageResolver = new LanguageResolutionController(this);\n\n private readonly _instanceId = ++nextLinearProgressId;\n\n /**\n * @internal\n *\n * Documentation URL used in DEBUG warnings. Derived from the custom\n * element tag name so each concrete component gets an accurate link\n * with no per-subclass override needed (e.g. `swc-meter` →\n * `components-meter--docs`, `swc-progress-bar` →\n * `components-progress-bar--docs`).\n */\n protected get docsHref(): string {\n const name = this.localName.replace(/^swc-/, '');\n return `https://spectrum-web-components.adobe.com/?path=/docs/components-${name}--docs`;\n }\n\n /**\n * @internal\n */\n public get labelContainerId(): string {\n return `swc-linear-progress-label-${this._instanceId}`;\n }\n\n /**\n * @internal\n */\n public get descriptionContainerId(): string {\n return `swc-linear-progress-description-${this._instanceId}`;\n }\n\n /**\n * @internal\n */\n public get hasLabelSlotContent(): boolean {\n return this.slotPresence.getPresence(LABEL_SLOT_SELECTOR);\n }\n\n /**\n * @internal\n */\n public get hasDescriptionSlotContent(): boolean {\n return this.slotPresence.getPresence(DESCRIPTION_SLOT_SELECTOR);\n }\n\n /**\n * @internal\n *\n * Sanitized lower bound: falls back to 0 when `minValue` is non-finite,\n * and to the smaller of (min, max) when the two are reversed. ARIA\n * `aria-valuemin`, `aria-valuenow`, `aria-valuetext`, and the rendered\n * fill all read from the same sanitized range so screen-reader output\n * stays internally consistent.\n */\n public get sanitizedMin(): number {\n const min = Number.isFinite(this.minValue) ? this.minValue : 0;\n const max = Number.isFinite(this.maxValue) ? this.maxValue : 100;\n return Math.min(min, max);\n }\n\n /**\n * @internal\n *\n * Sanitized upper bound. See `sanitizedMin`.\n */\n public get sanitizedMax(): number {\n const min = Number.isFinite(this.minValue) ? this.minValue : 0;\n const max = Number.isFinite(this.maxValue) ? this.maxValue : 100;\n return Math.max(min, max);\n }\n\n /**\n * @internal\n */\n public get clampedValue(): number {\n const value = Number.isFinite(this.value) ? this.value : 0;\n return Math.min(this.sanitizedMax, Math.max(this.sanitizedMin, value));\n }\n\n /**\n * @internal\n */\n public get fillPercent(): number {\n const min = this.sanitizedMin;\n const max = this.sanitizedMax;\n if (max === min) {\n return 0;\n }\n const fraction = (this.clampedValue - min) / (max - min);\n return Math.min(100, Math.max(0, fraction * 100));\n }\n\n /**\n * @internal\n */\n public get formattedValue(): string {\n if (this.valueLabel) {\n return this.valueLabel;\n }\n const min = this.sanitizedMin;\n const max = this.sanitizedMax;\n // Treat anything that is not a plain options object (null, undefined,\n // empty string from Storybook helpers, etc.) as \"no override\" and\n // fall back to the percent default.\n const providedOptions =\n this.formatOptions &&\n typeof this.formatOptions === 'object' &&\n Object.keys(this.formatOptions).length > 0\n ? this.formatOptions\n : DEFAULT_FORMAT_OPTIONS;\n const formatter = new Intl.NumberFormat(\n this.languageResolver.language,\n providedOptions\n );\n // Percent style consumes a fraction; every other style consumes the\n // raw value.\n if (providedOptions.style === 'percent') {\n const fraction =\n max === min ? 0 : (this.clampedValue - min) / (max - min);\n return formatter.format(fraction);\n }\n return formatter.format(this.clampedValue);\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n\n // Locale changes are picked up automatically: the\n // `LanguageResolutionController` requests an update with\n // `languageResolverUpdatedSymbol`, which re-runs `render()`. The\n // render template reads `formattedValue` (which reads\n // `languageResolver.language` lazily), so the new locale is already\n // reflected in this render cycle. No second `requestUpdate()`\n // needed here.\n\n // Only re-evaluate the accessible-name fallback when the inputs\n // that determine it actually change, so the warning does not fire\n // on every property update during development.\n if (\n window.__swc?.DEBUG &&\n (changes.has('accessibleLabel') || !this._hasWarnedNoAccessibleName)\n ) {\n this.warnMissingAccessibleName();\n }\n\n // Surface a dev warning when `value` falls outside the resolved\n // range. The value is still clamped for rendering and ARIA, but the\n // clamp is otherwise silent, so flag it as a likely authoring error.\n if (\n window.__swc?.DEBUG &&\n (changes.has('value') ||\n changes.has('minValue') ||\n changes.has('maxValue'))\n ) {\n this.warnValueOutOfRange();\n }\n }\n\n private _hasWarnedNoAccessibleName = false;\n\n private _hasWarnedValueOutOfRange = false;\n\n private warnValueOutOfRange(): void {\n const value = this.value;\n const min = this.sanitizedMin;\n const max = this.sanitizedMax;\n if (!Number.isFinite(value) || (value >= min && value <= max)) {\n this._hasWarnedValueOutOfRange = false;\n return;\n }\n if (this._hasWarnedValueOutOfRange) {\n return;\n }\n this._hasWarnedValueOutOfRange = true;\n window.__swc?.warn(\n this,\n `<${this.localName}> \"value\" (${value}) is outside the [${min}, ${max}] range and was clamped to ${this.clampedValue}.`,\n this.docsHref,\n {\n issues: [\n 'set \"value\" within the \"min-value\" and \"max-value\" range, or',\n 'adjust \"min-value\"/\"max-value\" so the range includes the value.',\n ],\n }\n );\n }\n\n private warnMissingAccessibleName(): void {\n if (this.hasLabelSlotContent || this.accessibleLabel) {\n this._hasWarnedNoAccessibleName = false;\n return;\n }\n this._hasWarnedNoAccessibleName = true;\n window.__swc?.warn(\n this,\n `<${this.localName}> requires an accessible name.`,\n this.docsHref,\n {\n type: 'accessibility',\n issues: [\n 'add visible label content via the \"label\" named slot, or',\n 'set the \"accessible-label\" attribute (or \"accessibleLabel\" property) when there is no visible label.',\n ],\n }\n );\n }\n }\n return LinearProgressElement as unknown as T &\n Constructor<LinearProgressInterface>;\n}\n"],"mappings":";;;;;AAwBA,IAAa,IAA8B;CACzC;CACA;CACA;CACA;CACD,EAGY,IAAgC,CAAC,SAAS,QAAQ,EAIlD,IAAkC,CAAC,OAAO,OAAO,EAIxD,IAAmD,EAAE,OAAO,WAAW,EAEvE,IAAsB,oBACtB,IAA4B,0BAsB9B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,MACA,IAAI,KAAK,UAAU,iCACnB,KAAK,UACL;IACE,MAAM;IACN,QAAQ,CACN,8DACA,2GACD;IACF,CACF;;;AAGL,WAlQG,EAAS;EAAE,MAAM;EAAQ,SAAS;EAAM,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAMzC,EAAS;EAAE,MAAM;EAAQ,SAAS;EAAM,WAAW;EAAa,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAMjE,EAAS;EAAE,MAAM;EAAQ,SAAS;EAAM,WAAW;EAAa,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAQjE,EAAS;EAAE,MAAM;EAAQ,WAAW;EAAoB,CAAC,CAAA,EAAA,EAAA,WAAA,mBAAA,KAAA,EAAA,KAOzD,EAAS;EAAE,MAAM;EAAQ,WAAW;EAAe,CAAC,CAAA,EAAA,EAAA,WAAA,cAAA,KAAA,EAAA,KAQpD,EAAS,EAAE,WAAW,IAAO,CAAC,CAAA,EAAA,EAAA,WAAA,iBAAA,KAAA,EAAA,KAM9B,EAAS;EAAE,MAAM;EAAQ,SAAS;EAAM,WAAW;EAAkB,CAAC,CAAA,EAAA,EAAA,WAAA,iBAAA,KAAA,EAAA,KAMtE,EAAS;EAAE,MAAM;EAAQ,SAAS;EAAM,WAAW;EAAgB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,EAmNhE"}
@@ -16,5 +16,6 @@ export { isTopDismissible, registerDismissible, unregisterDismissible, } from '.
16
16
  export { getActiveElement } from './get-active-element.js';
17
17
  export { focusableSelector, tabbableSelector } from './focusable-selectors.js';
18
18
  export { getLabelFromSlot } from './get-label-from-slot.js';
19
+ export { isFocusVisibleInTree } from './is-focus-visible-in-tree.js';
19
20
  export { resolveTrigger, type ResolvedTrigger, type ResolveTriggerOptions, } from './resolve-trigger.js';
20
21
  export { hasActiveTransition, maxTransitionDurationMs, runAfterTransition, } from './transition.js';
@@ -1,10 +1,11 @@
1
- import { getActiveElement as e } from "./get-active-element.js";
2
- import { physicalSide as t } from "./actual-placement.js";
3
- import { capitalize as n } from "./capitalize.js";
4
- import { deepContains as r } from "./deep-contains.js";
5
- import { isTopDismissible as i, registerDismissible as a, unregisterDismissible as o } from "./dismissible-stack.js";
6
- import { focusableSelector as s, tabbableSelector as c } from "./focusable-selectors.js";
1
+ import { physicalSide as e } from "./actual-placement.js";
2
+ import { capitalize as t } from "./capitalize.js";
3
+ import { deepContains as n } from "./deep-contains.js";
4
+ import { isTopDismissible as r, registerDismissible as i, unregisterDismissible as a } from "./dismissible-stack.js";
5
+ import { focusableSelector as o, tabbableSelector as s } from "./focusable-selectors.js";
6
+ import { getActiveElement as c } from "./get-active-element.js";
7
7
  import { getLabelFromSlot as l } from "./get-label-from-slot.js";
8
- import { resolveTrigger as u } from "./resolve-trigger.js";
9
- import { hasActiveTransition as d, maxTransitionDurationMs as f, runAfterTransition as p } from "./transition.js";
10
- export { n as capitalize, r as deepContains, s as focusableSelector, e as getActiveElement, l as getLabelFromSlot, d as hasActiveTransition, i as isTopDismissible, f as maxTransitionDurationMs, t as physicalSide, a as registerDismissible, u as resolveTrigger, p as runAfterTransition, c as tabbableSelector, o as unregisterDismissible };
8
+ import { isFocusVisibleInTree as u } from "./is-focus-visible-in-tree.js";
9
+ import { resolveTrigger as d } from "./resolve-trigger.js";
10
+ import { hasActiveTransition as f, maxTransitionDurationMs as p, runAfterTransition as m } from "./transition.js";
11
+ export { t as capitalize, n as deepContains, o as focusableSelector, c as getActiveElement, l as getLabelFromSlot, f as hasActiveTransition, u as isFocusVisibleInTree, r as isTopDismissible, p as maxTransitionDurationMs, e as physicalSide, i as registerDismissible, d as resolveTrigger, m as runAfterTransition, s as tabbableSelector, a as unregisterDismissible };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /**
13
+ * Returns whether the deepest focused element in a tree is matched by
14
+ * `:focus-visible` (i.e. the platform would show a focus ring).
15
+ *
16
+ * Traverses shadow DOM boundaries via {@link getActiveElement} before testing
17
+ * the pseudo-class, so it reports the truly focused element rather than stopping
18
+ * at a shadow host.
19
+ *
20
+ * @param root - The document or shadow root to start traversal from. Pass a
21
+ * component's root node (`el.getRootNode()`) to scope the check to
22
+ * that tree. Defaults to `document`.
23
+ * @returns `true` if the active element matches `:focus-visible`, otherwise `false`.
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * // Inside a component, mirror focus-visible state to a reactive property.
28
+ * this.focused = isFocusVisibleInTree(
29
+ * this.getRootNode() as Document | ShadowRoot
30
+ * );
31
+ * ```
32
+ */
33
+ export declare function isFocusVisibleInTree(root?: Document | ShadowRoot): boolean;
@@ -0,0 +1,11 @@
1
+ import { getActiveElement as e } from "./get-active-element.js";
2
+ //#region utils/is-focus-visible-in-tree.ts
3
+ function t(t = document) {
4
+ var n;
5
+ let r = e(t);
6
+ return (n = r == null ? void 0 : r.matches(":focus-visible")) == null ? !1 : n;
7
+ }
8
+ //#endregion
9
+ export { t as isFocusVisibleInTree };
10
+
11
+ //# sourceMappingURL=is-focus-visible-in-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-focus-visible-in-tree.js","names":[],"sources":["../../utils/is-focus-visible-in-tree.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 { getActiveElement } from './get-active-element.js';\n\n/**\n * Returns whether the deepest focused element in a tree is matched by\n * `:focus-visible` (i.e. the platform would show a focus ring).\n *\n * Traverses shadow DOM boundaries via {@link getActiveElement} before testing\n * the pseudo-class, so it reports the truly focused element rather than stopping\n * at a shadow host.\n *\n * @param root - The document or shadow root to start traversal from. Pass a\n * component's root node (`el.getRootNode()`) to scope the check to\n * that tree. Defaults to `document`.\n * @returns `true` if the active element matches `:focus-visible`, otherwise `false`.\n *\n * @example\n * ```typescript\n * // Inside a component, mirror focus-visible state to a reactive property.\n * this.focused = isFocusVisibleInTree(\n * this.getRootNode() as Document | ShadowRoot\n * );\n * ```\n */\nexport function isFocusVisibleInTree(\n root: Document | ShadowRoot = document\n): boolean {\n const active = getActiveElement(root);\n return active?.matches(':focus-visible') ?? false;\n}\n"],"mappings":";;AAmCA,SAAgB,EACd,IAA8B,UACrB;;CACT,IAAM,IAAS,EAAiB,EAAK;AACrC,SAAA,IAAA,KAAA,OAAA,KAAA,IAAO,EAAQ,QAAQ,iBAAiB,KAAA,OAAI,KAAJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spectrum-wc-core",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-next.20260728161641",
4
4
  "description": "Abstract base classes for Spectrum Web Components",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Adobe",
@@ -171,6 +171,22 @@
171
171
  "types": "./dist/controllers/slot-attribute-propagation-controller/index.d.ts",
172
172
  "import": "./dist/controllers/slot-attribute-propagation-controller/index.js"
173
173
  },
174
+ "./controllers/slot-presence-controller": {
175
+ "types": "./dist/controllers/slot-presence-controller/index.d.ts",
176
+ "import": "./dist/controllers/slot-presence-controller/index.js"
177
+ },
178
+ "./controllers/slot-presence-controller/index.js": {
179
+ "types": "./dist/controllers/slot-presence-controller/index.d.ts",
180
+ "import": "./dist/controllers/slot-presence-controller/index.js"
181
+ },
182
+ "./controllers/slot-text-controller": {
183
+ "types": "./dist/controllers/slot-text-controller/index.d.ts",
184
+ "import": "./dist/controllers/slot-text-controller/index.js"
185
+ },
186
+ "./controllers/slot-text-controller/index.js": {
187
+ "types": "./dist/controllers/slot-text-controller/index.d.ts",
188
+ "import": "./dist/controllers/slot-text-controller/index.js"
189
+ },
174
190
  "./directives": {
175
191
  "types": "./dist/directives/index.d.ts",
176
192
  "import": "./dist/directives/index.js"
@@ -215,14 +231,6 @@
215
231
  "types": "./dist/mixins/index.d.ts",
216
232
  "import": "./dist/mixins/index.js"
217
233
  },
218
- "./mixins/observe-slot-presence.js": {
219
- "types": "./dist/mixins/observe-slot-presence.d.ts",
220
- "import": "./dist/mixins/observe-slot-presence.js"
221
- },
222
- "./mixins/observe-slot-text.js": {
223
- "types": "./dist/mixins/observe-slot-text.d.ts",
224
- "import": "./dist/mixins/observe-slot-text.js"
225
- },
226
234
  "./mixins/sized-mixin.js": {
227
235
  "types": "./dist/mixins/sized-mixin.d.ts",
228
236
  "import": "./dist/mixins/sized-mixin.js"
@@ -376,6 +384,18 @@
376
384
  "controllers/slot-attribute-propagation-controller.js": [
377
385
  "dist/controllers/slot-attribute-propagation-controller/index.d.ts"
378
386
  ],
387
+ "controllers/slot-presence-controller": [
388
+ "dist/controllers/slot-presence-controller/index.d.ts"
389
+ ],
390
+ "controllers/slot-presence-controller/index.js": [
391
+ "dist/controllers/slot-presence-controller/index.d.ts"
392
+ ],
393
+ "controllers/slot-text-controller": [
394
+ "dist/controllers/slot-text-controller/index.d.ts"
395
+ ],
396
+ "controllers/slot-text-controller/index.js": [
397
+ "dist/controllers/slot-text-controller/index.d.ts"
398
+ ],
379
399
  "directives": [
380
400
  "dist/directives/index.d.ts"
381
401
  ],
@@ -409,12 +429,6 @@
409
429
  "mixins/index.js": [
410
430
  "dist/mixins/index.d.ts"
411
431
  ],
412
- "mixins/observe-slot-presence.js": [
413
- "dist/mixins/observe-slot-presence.d.ts"
414
- ],
415
- "mixins/observe-slot-text.js": [
416
- "dist/mixins/observe-slot-text.d.ts"
417
- ],
418
432
  "mixins/sized-mixin.js": [
419
433
  "dist/mixins/sized-mixin.d.ts"
420
434
  ],
@@ -460,4 +474,4 @@
460
474
  "publishConfig": {
461
475
  "access": "public"
462
476
  }
463
- }
477
+ }