@spectrum-web-components/base 1.12.0-testing.20260223092154 → 2.0.0-next.20260512072922
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.
- package/package.json +1 -2
- package/src/Base.d.ts +15 -4
- package/src/Base.dev.js +112 -5
- package/src/Base.dev.js.map +3 -3
- package/src/Base.js +1 -1
- package/src/Base.js.map +3 -3
- package/src/define-element.d.ts +5 -1
- package/src/define-element.dev.js +12 -1
- package/src/define-element.dev.js.map +2 -2
- package/src/define-element.js +1 -1
- package/src/define-element.js.map +3 -3
- package/src/sizedMixin.d.ts +24 -2
- package/src/sizedMixin.dev.js +70 -4
- package/src/sizedMixin.dev.js.map +2 -2
- package/src/sizedMixin.js +1 -1
- package/src/sizedMixin.js.map +3 -3
- package/src/version.d.ts +2 -2
- package/src/version.dev.js +2 -2
- package/src/version.dev.js.map +1 -1
- package/src/version.js +1 -1
- package/src/version.js.map +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/base",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.20260512072922",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Adobe",
|
|
@@ -108,7 +108,6 @@
|
|
|
108
108
|
],
|
|
109
109
|
"types": "./src/index.d.ts",
|
|
110
110
|
"dependencies": {
|
|
111
|
-
"@spectrum-web-components/core": "0.0.5-testing.20260223092154",
|
|
112
111
|
"lit": "^2.5.0 || ^3.1.3"
|
|
113
112
|
},
|
|
114
113
|
"keywords": [
|
package/src/Base.d.ts
CHANGED
|
@@ -9,13 +9,22 @@
|
|
|
9
9
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
13
|
-
|
|
12
|
+
import { LitElement, ReactiveElement } from 'lit';
|
|
13
|
+
type Constructor<T = Record<string, unknown>> = {
|
|
14
|
+
new (...args: any[]): T;
|
|
15
|
+
prototype: T;
|
|
16
|
+
};
|
|
17
|
+
export interface SpectrumInterface {
|
|
18
|
+
shadowRoot: ShadowRoot;
|
|
19
|
+
isLTR: boolean;
|
|
20
|
+
hasVisibleFocusInTree(): boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function SpectrumMixin<T extends Constructor<ReactiveElement>>(constructor: T): T & Constructor<SpectrumInterface>;
|
|
23
|
+
declare const SpectrumElement_base: typeof LitElement & Constructor<SpectrumInterface>;
|
|
14
24
|
/**
|
|
15
25
|
* Base class for 1st-gen Spectrum Web Components.
|
|
16
|
-
* Extends the core SpectrumElement with 1st-gen specific version information.
|
|
17
26
|
*/
|
|
18
|
-
export declare class SpectrumElement extends
|
|
27
|
+
export declare class SpectrumElement extends SpectrumElement_base {
|
|
19
28
|
/**
|
|
20
29
|
* The version of the 1st-gen Spectrum Web Components library.
|
|
21
30
|
*/
|
|
@@ -24,4 +33,6 @@ export declare class SpectrumElement extends CoreSpectrumElement {
|
|
|
24
33
|
* The version of the core base package.
|
|
25
34
|
*/
|
|
26
35
|
static CORE_VERSION: string;
|
|
36
|
+
get dir(): CSSStyleDeclaration['direction'];
|
|
27
37
|
}
|
|
38
|
+
export {};
|
package/src/Base.dev.js
CHANGED
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
var _a, _b, _c;
|
|
3
|
+
import { LitElement } from "lit";
|
|
3
4
|
import { coreVersion, version } from "./version.dev.js";
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export function SpectrumMixin(constructor) {
|
|
6
|
+
class SpectrumMixinElement extends constructor {
|
|
7
|
+
get isLTR() {
|
|
8
|
+
return getComputedStyle(this).direction !== "rtl";
|
|
9
|
+
}
|
|
10
|
+
hasVisibleFocusInTree() {
|
|
11
|
+
const getAncestors = (root = document) => {
|
|
12
|
+
var _a2;
|
|
13
|
+
let currentNode = root.activeElement;
|
|
14
|
+
while ((currentNode == null ? void 0 : currentNode.shadowRoot) && currentNode.shadowRoot.activeElement) {
|
|
15
|
+
currentNode = currentNode.shadowRoot.activeElement;
|
|
16
|
+
}
|
|
17
|
+
const ancestors = currentNode ? [currentNode] : [];
|
|
18
|
+
while (currentNode) {
|
|
19
|
+
const ancestor = currentNode.assignedSlot || currentNode.parentElement || ((_a2 = currentNode.getRootNode()) == null ? void 0 : _a2.host);
|
|
20
|
+
if (ancestor) {
|
|
21
|
+
ancestors.push(ancestor);
|
|
22
|
+
}
|
|
23
|
+
currentNode = ancestor;
|
|
24
|
+
}
|
|
25
|
+
return ancestors;
|
|
26
|
+
};
|
|
27
|
+
const activeElement = getAncestors(this.getRootNode())[0];
|
|
28
|
+
if (!activeElement) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return activeElement.matches(":focus-visible") || activeElement.matches(".focus-visible");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return SpectrumMixinElement;
|
|
35
|
+
}
|
|
36
|
+
export class SpectrumElement extends SpectrumMixin(LitElement) {
|
|
37
|
+
get dir() {
|
|
38
|
+
var _a2;
|
|
39
|
+
return (_a2 = getComputedStyle(this).direction) != null ? _a2 : "ltr";
|
|
40
|
+
}
|
|
8
41
|
}
|
|
9
42
|
/**
|
|
10
43
|
* The version of the 1st-gen Spectrum Web Components library.
|
|
@@ -14,4 +47,78 @@ SpectrumElement.VERSION = version;
|
|
|
14
47
|
* The version of the core base package.
|
|
15
48
|
*/
|
|
16
49
|
SpectrumElement.CORE_VERSION = coreVersion;
|
|
50
|
+
if (true) {
|
|
51
|
+
const ignoreWarningTypes = {
|
|
52
|
+
default: false,
|
|
53
|
+
accessibility: false,
|
|
54
|
+
api: false
|
|
55
|
+
};
|
|
56
|
+
const ignoreWarningLevels = {
|
|
57
|
+
default: false,
|
|
58
|
+
low: false,
|
|
59
|
+
medium: false,
|
|
60
|
+
high: false,
|
|
61
|
+
deprecation: false
|
|
62
|
+
};
|
|
63
|
+
window.__swc = {
|
|
64
|
+
...window.__swc,
|
|
65
|
+
DEBUG: true,
|
|
66
|
+
ignoreWarningLocalNames: {
|
|
67
|
+
...((_a = window.__swc) == null ? void 0 : _a.ignoreWarningLocalNames) || {}
|
|
68
|
+
},
|
|
69
|
+
ignoreWarningTypes: {
|
|
70
|
+
...ignoreWarningTypes,
|
|
71
|
+
...((_b = window.__swc) == null ? void 0 : _b.ignoreWarningTypes) || {}
|
|
72
|
+
},
|
|
73
|
+
ignoreWarningLevels: {
|
|
74
|
+
...ignoreWarningLevels,
|
|
75
|
+
...((_c = window.__swc) == null ? void 0 : _c.ignoreWarningLevels) || {}
|
|
76
|
+
},
|
|
77
|
+
issuedWarnings: /* @__PURE__ */ new Set(),
|
|
78
|
+
warn: (element, message, url, { type = "api", level = "default", issues } = {}) => {
|
|
79
|
+
const { localName = "base" } = element || {};
|
|
80
|
+
const id = `${localName}:${type}:${level}`;
|
|
81
|
+
if (!window.__swc.verbose && window.__swc.issuedWarnings.has(id)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (window.__swc.ignoreWarningLocalNames[localName]) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (window.__swc.ignoreWarningTypes[type]) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (window.__swc.ignoreWarningLevels[level]) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
window.__swc.issuedWarnings.add(id);
|
|
94
|
+
let listedIssues = "";
|
|
95
|
+
if (issues && issues.length) {
|
|
96
|
+
issues.unshift("");
|
|
97
|
+
listedIssues = issues.join("\n - ") + "\n";
|
|
98
|
+
}
|
|
99
|
+
const intro = level === "deprecation" ? "DEPRECATION NOTICE: " : "";
|
|
100
|
+
const inspectElement = element ? "\nInspect this issue in the follow element:" : "";
|
|
101
|
+
const displayURL = (element ? "\n\n" : "\n") + url + "\n";
|
|
102
|
+
const messages = [];
|
|
103
|
+
messages.push(intro + message + "\n" + listedIssues + inspectElement);
|
|
104
|
+
if (element) {
|
|
105
|
+
messages.push(element);
|
|
106
|
+
}
|
|
107
|
+
messages.push(displayURL, {
|
|
108
|
+
data: {
|
|
109
|
+
localName,
|
|
110
|
+
type,
|
|
111
|
+
level
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
console.warn(...messages);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
window.__swc.warn(
|
|
118
|
+
void 0,
|
|
119
|
+
"Spectrum Web Components is in dev mode. Not recommended for production!",
|
|
120
|
+
"https://opensource.adobe.com/spectrum-web-components/dev-mode/",
|
|
121
|
+
{ type: "default" }
|
|
122
|
+
);
|
|
123
|
+
}
|
|
17
124
|
//# sourceMappingURL=Base.dev.js.map
|
package/src/Base.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Base.ts"],
|
|
4
|
-
"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 {
|
|
5
|
-
"mappings": ";AAYA,SAAS,
|
|
6
|
-
"names": []
|
|
4
|
+
"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 { coreVersion, version } from './version.dev.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 isLTR: boolean;\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 public get isLTR(): boolean {\n return getComputedStyle(this).direction !== 'rtl';\n }\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot.activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode ? [currentNode] : [];\n while (currentNode) {\n const ancestor =\n currentNode.assignedSlot ||\n currentNode.parentElement ||\n (currentNode.getRootNode() as ShadowRoot)?.host;\n if (ancestor) {\n ancestors.push(ancestor as HTMLElement);\n }\n currentNode = ancestor as HTMLElement;\n }\n return ancestors;\n };\n const activeElement = getAncestors(this.getRootNode() as Document)[0];\n if (!activeElement) {\n return false;\n }\n // Browsers without support for the `:focus-visible`\n // selector will throw on the following test (Safari, older things).\n // Some won't throw, but will be focusing item rather than the menu and\n // will rely on the polyfill to know whether focus is \"visible\" or not.\n // .focus-visible polyfill class will intentionally not be checked in 2nd-gen.\n // 2nd-gen targets browsers with native support for :focus-visible.\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n }\n }\n return SpectrumMixinElement;\n}\n\n/**\n * Base class for 1st-gen Spectrum Web Components.\n */\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n /**\n * The version of the 1st-gen Spectrum Web Components library.\n */\n static VERSION = version;\n\n /**\n * The version of the core base package.\n */\n static CORE_VERSION = coreVersion;\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"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["_a"]
|
|
7
7
|
}
|
package/src/Base.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import{
|
|
1
|
+
"use strict";import{LitElement as d}from"lit";import{coreVersion as m,version as u}from"./version.js";export function SpectrumMixin(o){class n extends o{get isLTR(){return getComputedStyle(this).direction!=="rtl"}hasVisibleFocusInTree(){const s=((r=document)=>{var a;let e=r.activeElement;for(;e!=null&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;const i=e?[e]:[];for(;e;){const t=e.assignedSlot||e.parentElement||((a=e.getRootNode())==null?void 0:a.host);t&&i.push(t),e=t}return i})(this.getRootNode())[0];return s?s.matches(":focus-visible")||s.matches(".focus-visible"):!1}}return n}export class SpectrumElement extends SpectrumMixin(d){get dir(){var n;return(n=getComputedStyle(this).direction)!=null?n:"ltr"}}SpectrumElement.VERSION=u,SpectrumElement.CORE_VERSION=m;
|
|
2
2
|
//# sourceMappingURL=Base.js.map
|
package/src/Base.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Base.ts"],
|
|
4
|
-
"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 {
|
|
5
|
-
"mappings": "aAYA,OAAS,
|
|
6
|
-
"names": ["
|
|
4
|
+
"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 { 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 isLTR: boolean;\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 public get isLTR(): boolean {\n return getComputedStyle(this).direction !== 'rtl';\n }\n public hasVisibleFocusInTree(): boolean {\n const getAncestors = (root: Document = document): HTMLElement[] => {\n let currentNode = root.activeElement as HTMLElement;\n while (\n currentNode?.shadowRoot &&\n currentNode.shadowRoot.activeElement\n ) {\n currentNode = currentNode.shadowRoot.activeElement as HTMLElement;\n }\n const ancestors: HTMLElement[] = currentNode ? [currentNode] : [];\n while (currentNode) {\n const ancestor =\n currentNode.assignedSlot ||\n currentNode.parentElement ||\n (currentNode.getRootNode() as ShadowRoot)?.host;\n if (ancestor) {\n ancestors.push(ancestor as HTMLElement);\n }\n currentNode = ancestor as HTMLElement;\n }\n return ancestors;\n };\n const activeElement = getAncestors(this.getRootNode() as Document)[0];\n if (!activeElement) {\n return false;\n }\n // Browsers without support for the `:focus-visible`\n // selector will throw on the following test (Safari, older things).\n // Some won't throw, but will be focusing item rather than the menu and\n // will rely on the polyfill to know whether focus is \"visible\" or not.\n // .focus-visible polyfill class will intentionally not be checked in 2nd-gen.\n // 2nd-gen targets browsers with native support for :focus-visible.\n return (\n activeElement.matches(':focus-visible') ||\n activeElement.matches('.focus-visible')\n );\n }\n }\n return SpectrumMixinElement;\n}\n\n/**\n * Base class for 1st-gen Spectrum Web Components.\n */\nexport class SpectrumElement extends SpectrumMixin(LitElement) {\n /**\n * The version of the 1st-gen Spectrum Web Components library.\n */\n static VERSION = version;\n\n /**\n * The version of the core base package.\n */\n static CORE_VERSION = coreVersion;\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"],
|
|
5
|
+
"mappings": "aAYA,OAAS,cAAAA,MAAmC,MAE5C,OAAS,eAAAC,EAAa,WAAAC,MAAe,eAc9B,gBAAS,cACdC,EACoC,CACpC,MAAMC,UAA6BD,CAAY,CAK7C,IAAW,OAAiB,CAC1B,OAAO,iBAAiB,IAAI,EAAE,YAAc,KAC9C,CACO,uBAAiC,CAsBtC,MAAME,GArBe,CAACC,EAAiB,WAA4B,CAxCzE,IAAAC,EAyCQ,IAAIC,EAAcF,EAAK,cACvB,KACEE,GAAA,MAAAA,EAAa,YACbA,EAAY,WAAW,eAEvBA,EAAcA,EAAY,WAAW,cAEvC,MAAMC,EAA2BD,EAAc,CAACA,CAAW,EAAI,CAAC,EAChE,KAAOA,GAAa,CAClB,MAAME,EACJF,EAAY,cACZA,EAAY,iBACXD,EAAAC,EAAY,YAAY,IAAxB,YAAAD,EAA0C,MACzCG,GACFD,EAAU,KAAKC,CAAuB,EAExCF,EAAcE,CAChB,CACA,OAAOD,CACT,GACmC,KAAK,YAAY,CAAa,EAAE,CAAC,EACpE,OAAKJ,EAUHA,EAAc,QAAQ,gBAAgB,GACtCA,EAAc,QAAQ,gBAAgB,EAV/B,EAYX,CACF,CACA,OAAOD,CACT,CAKO,aAAM,wBAAwB,cAAcJ,CAAU,CAAE,CAW7D,IAAoB,KAAwC,CA9F9D,IAAAO,EA+FI,OAAOA,EAAA,iBAAiB,IAAI,EAAE,YAAvB,KAAAA,EAAoC,KAC7C,CACF,CAda,gBAIJ,QAAUL,EAJN,gBASJ,aAAeD",
|
|
6
|
+
"names": ["LitElement", "coreVersion", "version", "constructor", "SpectrumMixinElement", "activeElement", "root", "_a", "currentNode", "ancestors", "ancestor"]
|
|
7
7
|
}
|
package/src/define-element.d.ts
CHANGED
|
@@ -9,4 +9,8 @@
|
|
|
9
9
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
interface CustomElementConstructor {
|
|
13
|
+
new (...params: unknown[]): HTMLElement;
|
|
14
|
+
}
|
|
15
|
+
export declare function defineElement(name: string, constructor: CustomElementConstructor): void;
|
|
16
|
+
export {};
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
export
|
|
2
|
+
export function defineElement(name, constructor) {
|
|
3
|
+
if (window.__swc && true) {
|
|
4
|
+
if (customElements.get(name)) {
|
|
5
|
+
window.__swc.warn(
|
|
6
|
+
void 0,
|
|
7
|
+
`Attempted to redefine <${name}>. This usually indicates that multiple versions of the same web component were loaded onto a single page.`,
|
|
8
|
+
"https://opensource.adobe.com/spectrum-web-components/registry-conflicts"
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
customElements.define(name, constructor);
|
|
13
|
+
}
|
|
3
14
|
//# sourceMappingURL=define-element.dev.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["define-element.ts"],
|
|
4
|
-
"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\
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"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\ninterface CustomElementConstructor {\n new (...params: unknown[]): HTMLElement;\n}\n\nexport function defineElement(\n name: string,\n constructor: CustomElementConstructor\n): void {\n if (window.__swc && window.__swc.DEBUG) {\n if (customElements.get(name)) {\n window.__swc.warn(\n undefined,\n `Attempted to redefine <${name}>. This usually indicates that multiple versions of the same web component were loaded onto a single page.`,\n 'https://opensource.adobe.com/spectrum-web-components/registry-conflicts'\n );\n }\n }\n customElements.define(name, constructor);\n}\n"],
|
|
5
|
+
"mappings": ";AAgBO,gBAAS,cACd,MACA,aACM;AACN,MAAI,OAAO,SAAS,MAAoB;AACtC,QAAI,eAAe,IAAI,IAAI,GAAG;AAC5B,aAAO,MAAM;AAAA,QACX;AAAA,QACA,0BAA0B,IAAI;AAAA,QAC9B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,iBAAe,OAAO,MAAM,WAAW;AACzC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/define-element.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export function defineElement(e,n){window.__swc,customElements.define(e,n)}
|
|
2
2
|
//# sourceMappingURL=define-element.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["define-element.ts"],
|
|
4
|
-
"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\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"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\ninterface CustomElementConstructor {\n new (...params: unknown[]): HTMLElement;\n}\n\nexport function defineElement(\n name: string,\n constructor: CustomElementConstructor\n): void {\n if (window.__swc && window.__swc.DEBUG) {\n if (customElements.get(name)) {\n window.__swc.warn(\n undefined,\n `Attempted to redefine <${name}>. This usually indicates that multiple versions of the same web component were loaded onto a single page.`,\n 'https://opensource.adobe.com/spectrum-web-components/registry-conflicts'\n );\n }\n }\n customElements.define(name, constructor);\n}\n"],
|
|
5
|
+
"mappings": "aAgBO,gBAAS,cACdA,EACAC,EACM,CACF,OAAO,MASX,eAAe,OAAOD,EAAMC,CAAW,CACzC",
|
|
6
|
+
"names": ["name", "constructor"]
|
|
7
7
|
}
|
package/src/sizedMixin.d.ts
CHANGED
|
@@ -9,5 +9,27 @@
|
|
|
9
9
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
export type
|
|
12
|
+
import { ReactiveElement } from 'lit';
|
|
13
|
+
export type Constructor<T = Record<string, unknown>> = {
|
|
14
|
+
new (...args: any[]): T;
|
|
15
|
+
prototype: T;
|
|
16
|
+
};
|
|
17
|
+
export declare const ELEMENT_SIZES: readonly ["xxs", "xs", "s", "m", "l", "xl", "xxl"];
|
|
18
|
+
export type ElementSize = (typeof ELEMENT_SIZES)[number];
|
|
19
|
+
export declare const DEFAULT_ELEMENT_SIZES: readonly ["s", "m", "l", "xl"];
|
|
20
|
+
export type DefaultElementSize = (typeof DEFAULT_ELEMENT_SIZES)[number];
|
|
21
|
+
export interface SizedElementInterface {
|
|
22
|
+
size: ElementSize;
|
|
23
|
+
}
|
|
24
|
+
export interface SizedElementConstructor {
|
|
25
|
+
readonly VALID_SIZES: readonly ElementSize[];
|
|
26
|
+
}
|
|
27
|
+
export declare function SizedMixin<T extends Constructor<ReactiveElement>>(constructor: T, { validSizes, noDefaultSize, defaultSize, }?: {
|
|
28
|
+
validSizes?: readonly ElementSize[];
|
|
29
|
+
noDefaultSize?: boolean;
|
|
30
|
+
defaultSize?: ElementSize;
|
|
31
|
+
}): T & Constructor<SizedElementInterface> & SizedElementConstructor;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `ELEMENT_SIZES` instead. This record will be removed in a future release.
|
|
34
|
+
*/
|
|
35
|
+
export declare const ElementSizes: Record<string, ElementSize>;
|
package/src/sizedMixin.dev.js
CHANGED
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
+
if (decorator = decorators[i])
|
|
8
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9
|
+
if (kind && result) __defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import { property } from "lit/decorators.js";
|
|
13
|
+
export const ELEMENT_SIZES = ["xxs", "xs", "s", "m", "l", "xl", "xxl"];
|
|
14
|
+
export const DEFAULT_ELEMENT_SIZES = [
|
|
15
|
+
"s",
|
|
16
|
+
"m",
|
|
17
|
+
"l",
|
|
18
|
+
"xl"
|
|
19
|
+
];
|
|
20
|
+
export function SizedMixin(constructor, {
|
|
21
|
+
validSizes = [...DEFAULT_ELEMENT_SIZES],
|
|
22
|
+
noDefaultSize,
|
|
23
|
+
defaultSize = "m"
|
|
24
|
+
} = {}) {
|
|
25
|
+
class SizedElement extends constructor {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this._size = defaultSize;
|
|
29
|
+
}
|
|
30
|
+
get size() {
|
|
31
|
+
return this._size || defaultSize;
|
|
32
|
+
}
|
|
33
|
+
set size(value) {
|
|
34
|
+
const fallbackSize = noDefaultSize ? null : defaultSize;
|
|
35
|
+
const size = value ? value.toLocaleLowerCase() : value;
|
|
36
|
+
const validSize = validSizes.includes(size) ? size : fallbackSize;
|
|
37
|
+
if (validSize) {
|
|
38
|
+
this.setAttribute("size", validSize);
|
|
39
|
+
}
|
|
40
|
+
if (this._size === validSize) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const oldSize = this._size;
|
|
44
|
+
this._size = validSize;
|
|
45
|
+
this.requestUpdate("size", oldSize);
|
|
46
|
+
}
|
|
47
|
+
update(changes) {
|
|
48
|
+
if (!this.hasAttribute("size") && !noDefaultSize) {
|
|
49
|
+
this.setAttribute("size", this.size);
|
|
50
|
+
}
|
|
51
|
+
super.update(changes);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
SizedElement.VALID_SIZES = validSizes;
|
|
58
|
+
__decorateClass([
|
|
59
|
+
property({ type: String })
|
|
60
|
+
], SizedElement.prototype, "size", 1);
|
|
61
|
+
return SizedElement;
|
|
62
|
+
}
|
|
63
|
+
export const ElementSizes = {
|
|
64
|
+
xxs: "xxs",
|
|
65
|
+
xs: "xs",
|
|
66
|
+
s: "s",
|
|
67
|
+
m: "m",
|
|
68
|
+
l: "l",
|
|
69
|
+
xl: "xl",
|
|
70
|
+
xxl: "xxl"
|
|
71
|
+
};
|
|
6
72
|
//# sourceMappingURL=sizedMixin.dev.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sizedMixin.ts"],
|
|
4
|
-
"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 */\nexport {\n
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"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\nexport type 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 ELEMENT_SIZES = ['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl'] as const;\nexport type ElementSize = (typeof ELEMENT_SIZES)[number];\n\nexport const DEFAULT_ELEMENT_SIZES = [\n 's',\n 'm',\n 'l',\n 'xl',\n] as const satisfies readonly ElementSize[];\nexport type DefaultElementSize = (typeof DEFAULT_ELEMENT_SIZES)[number];\n\nexport interface SizedElementInterface {\n size: ElementSize;\n}\n\nexport interface SizedElementConstructor {\n readonly VALID_SIZES: readonly ElementSize[];\n}\n\nexport function SizedMixin<T extends Constructor<ReactiveElement>>(\n constructor: T,\n {\n validSizes = [...DEFAULT_ELEMENT_SIZES],\n noDefaultSize,\n defaultSize = 'm',\n }: {\n validSizes?: readonly ElementSize[];\n noDefaultSize?: boolean;\n defaultSize?: ElementSize;\n } = {}\n): T & Constructor<SizedElementInterface> & SizedElementConstructor {\n class SizedElement extends constructor {\n /**\n * @internal\n */\n static readonly VALID_SIZES: readonly ElementSize[] = validSizes;\n\n @property({ type: String })\n public get size(): ElementSize {\n return this._size || defaultSize;\n }\n\n public set size(value: ElementSize) {\n const fallbackSize = noDefaultSize ? null : defaultSize;\n const size = (value ? value.toLocaleLowerCase() : value) as ElementSize;\n const validSize = (\n validSizes.includes(size) ? size : fallbackSize\n ) as ElementSize;\n if (validSize) {\n this.setAttribute('size', validSize);\n }\n if (this._size === validSize) {\n return;\n }\n const oldSize = this._size;\n this._size = validSize;\n this.requestUpdate('size', oldSize);\n }\n\n private _size: ElementSize | null = defaultSize;\n\n protected override update(changes: PropertyValues): void {\n if (!this.hasAttribute('size') && !noDefaultSize) {\n this.setAttribute('size', this.size);\n }\n super.update(changes);\n }\n }\n return SizedElement;\n}\n\n/**\n * @deprecated Use `ELEMENT_SIZES` instead. This record will be removed in a future release.\n */\nexport const ElementSizes: Record<string, ElementSize> = {\n xxs: 'xxs',\n xs: 'xs',\n s: 's',\n m: 'm',\n l: 'l',\n xl: 'xl',\n xxl: 'xxl',\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA,SAAS,gBAAgB;AAQlB,aAAM,gBAAgB,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,KAAK;AAG9D,aAAM,wBAAwB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAWO,gBAAS,WACd,aACA;AAAA,EACE,aAAa,CAAC,GAAG,qBAAqB;AAAA,EACtC;AAAA,EACA,cAAc;AAChB,IAII,CAAC,GAC6D;AAAA,EAClE,MAAM,qBAAqB,YAAY;AAAA,IAAvC;AAAA;AA4BE,WAAQ,QAA4B;AAAA;AAAA,IArBpC,IAAW,OAAoB;AAC7B,aAAO,KAAK,SAAS;AAAA,IACvB;AAAA,IAEA,IAAW,KAAK,OAAoB;AAClC,YAAM,eAAe,gBAAgB,OAAO;AAC5C,YAAM,OAAQ,QAAQ,MAAM,kBAAkB,IAAI;AAClD,YAAM,YACJ,WAAW,SAAS,IAAI,IAAI,OAAO;AAErC,UAAI,WAAW;AACb,aAAK,aAAa,QAAQ,SAAS;AAAA,MACrC;AACA,UAAI,KAAK,UAAU,WAAW;AAC5B;AAAA,MACF;AACA,YAAM,UAAU,KAAK;AACrB,WAAK,QAAQ;AACb,WAAK,cAAc,QAAQ,OAAO;AAAA,IACpC;AAAA,IAImB,OAAO,SAA+B;AACvD,UAAI,CAAC,KAAK,aAAa,MAAM,KAAK,CAAC,eAAe;AAChD,aAAK,aAAa,QAAQ,KAAK,IAAI;AAAA,MACrC;AACA,YAAM,OAAO,OAAO;AAAA,IACtB;AAAA,EACF;AAhCE;AAAA;AAAA;AAAA,EAJI,aAIY,cAAsC;AAG3C;AAAA,IADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,KANtB,aAOO;AA8Bb,SAAO;AACT;AAKO,aAAM,eAA4C;AAAA,EACvD,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,KAAK;AACP;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/sizedMixin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var m=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var S=(r,s,i,t)=>{for(var e=t>1?void 0:t?p(s,i):s,o=r.length-1,l;o>=0;o--)(l=r[o])&&(e=(t?l(s,i,e):l(e))||e);return t&&e&&m(s,i,e),e};import{property as x}from"lit/decorators.js";export const ELEMENT_SIZES=["xxs","xs","s","m","l","xl","xxl"],DEFAULT_ELEMENT_SIZES=["s","m","l","xl"];export function SizedMixin(r,{validSizes:s=[...DEFAULT_ELEMENT_SIZES],noDefaultSize:i,defaultSize:t="m"}={}){class e extends r{constructor(){super(...arguments);this._size=t}get size(){return this._size||t}set size(n){const a=i?null:t,z=n&&n.toLocaleLowerCase(),E=s.includes(z)?z:a;if(E&&this.setAttribute("size",E),this._size===E)return;const c=this._size;this._size=E,this.requestUpdate("size",c)}update(n){!this.hasAttribute("size")&&!i&&this.setAttribute("size",this.size),super.update(n)}}return e.VALID_SIZES=s,S([x({type:String})],e.prototype,"size",1),e}export const ElementSizes={xxs:"xxs",xs:"xs",s:"s",m:"m",l:"l",xl:"xl",xxl:"xxl"};
|
|
2
2
|
//# sourceMappingURL=sizedMixin.js.map
|
package/src/sizedMixin.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sizedMixin.ts"],
|
|
4
|
-
"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 */\nexport {\n
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"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\nexport type 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 ELEMENT_SIZES = ['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl'] as const;\nexport type ElementSize = (typeof ELEMENT_SIZES)[number];\n\nexport const DEFAULT_ELEMENT_SIZES = [\n 's',\n 'm',\n 'l',\n 'xl',\n] as const satisfies readonly ElementSize[];\nexport type DefaultElementSize = (typeof DEFAULT_ELEMENT_SIZES)[number];\n\nexport interface SizedElementInterface {\n size: ElementSize;\n}\n\nexport interface SizedElementConstructor {\n readonly VALID_SIZES: readonly ElementSize[];\n}\n\nexport function SizedMixin<T extends Constructor<ReactiveElement>>(\n constructor: T,\n {\n validSizes = [...DEFAULT_ELEMENT_SIZES],\n noDefaultSize,\n defaultSize = 'm',\n }: {\n validSizes?: readonly ElementSize[];\n noDefaultSize?: boolean;\n defaultSize?: ElementSize;\n } = {}\n): T & Constructor<SizedElementInterface> & SizedElementConstructor {\n class SizedElement extends constructor {\n /**\n * @internal\n */\n static readonly VALID_SIZES: readonly ElementSize[] = validSizes;\n\n @property({ type: String })\n public get size(): ElementSize {\n return this._size || defaultSize;\n }\n\n public set size(value: ElementSize) {\n const fallbackSize = noDefaultSize ? null : defaultSize;\n const size = (value ? value.toLocaleLowerCase() : value) as ElementSize;\n const validSize = (\n validSizes.includes(size) ? size : fallbackSize\n ) as ElementSize;\n if (validSize) {\n this.setAttribute('size', validSize);\n }\n if (this._size === validSize) {\n return;\n }\n const oldSize = this._size;\n this._size = validSize;\n this.requestUpdate('size', oldSize);\n }\n\n private _size: ElementSize | null = defaultSize;\n\n protected override update(changes: PropertyValues): void {\n if (!this.hasAttribute('size') && !noDefaultSize) {\n this.setAttribute('size', this.size);\n }\n super.update(changes);\n }\n }\n return SizedElement;\n}\n\n/**\n * @deprecated Use `ELEMENT_SIZES` instead. This record will be removed in a future release.\n */\nexport const ElementSizes: Record<string, ElementSize> = {\n xxs: 'xxs',\n xs: 'xs',\n s: 's',\n m: 'm',\n l: 'l',\n xl: 'xl',\n xxl: 'xxl',\n};\n"],
|
|
5
|
+
"mappings": "qNAYA,OAAS,YAAAA,MAAgB,oBAQlB,aAAM,cAAgB,CAAC,MAAO,KAAM,IAAK,IAAK,IAAK,KAAM,KAAK,EAGxD,sBAAwB,CACnC,IACA,IACA,IACA,IACF,EAWO,gBAAS,WACdC,EACA,CACE,WAAAC,EAAa,CAAC,GAAG,qBAAqB,EACtC,cAAAC,EACA,YAAAC,EAAc,GAChB,EAII,CAAC,EAC6D,CAClE,MAAMC,UAAqBJ,CAAY,CAAvC,kCA4BE,KAAQ,MAA4BG,EArBpC,IAAW,MAAoB,CAC7B,OAAO,KAAK,OAASA,CACvB,CAEA,IAAW,KAAKE,EAAoB,CAClC,MAAMC,EAAeJ,EAAgB,KAAOC,EACtCI,EAAQF,GAAQA,EAAM,kBAAkB,EACxCG,EACJP,EAAW,SAASM,CAAI,EAAIA,EAAOD,EAKrC,GAHIE,GACF,KAAK,aAAa,OAAQA,CAAS,EAEjC,KAAK,QAAUA,EACjB,OAEF,MAAMC,EAAU,KAAK,MACrB,KAAK,MAAQD,EACb,KAAK,cAAc,OAAQC,CAAO,CACpC,CAImB,OAAOC,EAA+B,CACnD,CAAC,KAAK,aAAa,MAAM,GAAK,CAACR,GACjC,KAAK,aAAa,OAAQ,KAAK,IAAI,EAErC,MAAM,OAAOQ,CAAO,CACtB,CACF,CAhCE,OAJIN,EAIY,YAAsCH,EAG3CU,EAAA,CADVZ,EAAS,CAAE,KAAM,MAAO,CAAC,GANtBK,EAOO,oBA8BNA,CACT,CAKO,aAAM,aAA4C,CACvD,IAAK,MACL,GAAI,KACJ,EAAG,IACH,EAAG,IACH,EAAG,IACH,GAAI,KACJ,IAAK,KACP",
|
|
6
|
+
"names": ["property", "constructor", "validSizes", "noDefaultSize", "defaultSize", "SizedElement", "value", "fallbackSize", "size", "validSize", "oldSize", "changes", "__decorateClass"]
|
|
7
7
|
}
|
package/src/version.d.ts
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
/**
|
|
13
13
|
* The version of the 1st-gen Spectrum Web Components library.
|
|
14
14
|
*/
|
|
15
|
-
export declare const version = "
|
|
15
|
+
export declare const version = "2.0.0-next.20260512072922";
|
|
16
16
|
/**
|
|
17
17
|
* The version of the core base package.
|
|
18
18
|
*/
|
|
19
|
-
export declare const coreVersion = "0.0
|
|
19
|
+
export declare const coreVersion = "1.0.0-next.20260512072922";
|
package/src/version.dev.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
export const version = "
|
|
3
|
-
export const coreVersion = "0.0
|
|
2
|
+
export const version = "2.0.0-next.20260512072922";
|
|
3
|
+
export const coreVersion = "1.0.0-next.20260512072922";
|
|
4
4
|
//# sourceMappingURL=version.dev.js.map
|
package/src/version.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["version.ts"],
|
|
4
|
-
"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 1st-gen/tools/base/package.json\n// Generation: 1st-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 1st-gen Spectrum Web Components library.\n */\nexport const version = '
|
|
4
|
+
"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 1st-gen/tools/base/package.json\n// Generation: 1st-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 1st-gen Spectrum Web Components library.\n */\nexport const version = '2.0.0-next.20260512072922';\n\n/**\n * The version of the core base package.\n */\nexport const coreVersion = '1.0.0-next.20260512072922';\n"],
|
|
5
5
|
"mappings": ";AAmBO,aAAM,UAAU;AAKhB,aAAM,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";export const version="
|
|
1
|
+
"use strict";export const version="2.0.0-next.20260512072922",coreVersion="1.0.0-next.20260512072922";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/src/version.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["version.ts"],
|
|
4
|
-
"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 1st-gen/tools/base/package.json\n// Generation: 1st-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 1st-gen Spectrum Web Components library.\n */\nexport const version = '
|
|
5
|
-
"mappings": "aAmBO,aAAM,QAAU,
|
|
4
|
+
"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 1st-gen/tools/base/package.json\n// Generation: 1st-gen\n// DO NOT EDIT - This file is generated by scripts/generate-versions.js\n\n/**\n * The version of the 1st-gen Spectrum Web Components library.\n */\nexport const version = '2.0.0-next.20260512072922';\n\n/**\n * The version of the core base package.\n */\nexport const coreVersion = '1.0.0-next.20260512072922';\n"],
|
|
5
|
+
"mappings": "aAmBO,aAAM,QAAU,4BAKV,YAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|