@quartzds/core 1.0.0-beta.121 → 1.0.0-beta.123
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/CHANGELOG.md +66 -0
- package/components/index.js +1 -1
- package/components/{p-CkyaV9az.js → p-B7s906mS.js} +9 -9
- package/components/p-B7s906mS.js.map +1 -0
- package/components/p-BZlKeCFb.js +200 -0
- package/components/p-BZlKeCFb.js.map +1 -0
- package/components/{p-CURs27Ur.js → p-BalM52S_.js} +3 -3
- package/components/{p-CURs27Ur.js.map → p-BalM52S_.js.map} +1 -1
- package/components/{p-C1c4JVlg.js → p-BoSYRCNp.js} +47 -28
- package/components/p-BoSYRCNp.js.map +1 -0
- package/components/p-BvRd7jA2.js +102 -0
- package/components/p-BvRd7jA2.js.map +1 -0
- package/components/{p-B2ZVUvk9.js → p-C93kOEAe.js} +7 -9
- package/components/p-C93kOEAe.js.map +1 -0
- package/components/{p-DtxwXYGb.js → p-C9R8N06B.js} +5 -31
- package/components/p-C9R8N06B.js.map +1 -0
- package/components/{p-DR79BVX5.js → p-CKp062X8.js} +6 -6
- package/components/p-CKp062X8.js.map +1 -0
- package/components/{p-CjVnGhSO.js → p-CVuTVnQo.js} +3 -3
- package/components/{p-CjVnGhSO.js.map → p-CVuTVnQo.js.map} +1 -1
- package/components/{p-D82sb4oJ.js → p-CbY4T0d2.js} +5 -5
- package/components/p-CbY4T0d2.js.map +1 -0
- package/components/{p-DNHI4C-W.js → p-CowZ-pDD.js} +58 -22
- package/components/p-CowZ-pDD.js.map +1 -0
- package/components/{p-CDRwHAIT.js → p-XP2CY_fo.js} +3 -3
- package/components/p-XP2CY_fo.js.map +1 -0
- package/components/{p-5dwtV5iH.js → p-yb0Kv4Y6.js} +24 -6
- package/components/p-yb0Kv4Y6.js.map +1 -0
- package/components/qds-action-item.js +4 -4
- package/components/qds-action-item.js.map +1 -1
- package/components/qds-avatar-media.js +1 -1
- package/components/qds-badge-counter.js +1 -1
- package/components/qds-breadcrumb-item.js +5 -5
- package/components/qds-breadcrumb-item.js.map +1 -1
- package/components/qds-button.js +5 -5
- package/components/qds-button.js.map +1 -1
- package/components/qds-checkbox.js +1 -1
- package/components/qds-chip.js +10 -10
- package/components/qds-chip.js.map +1 -1
- package/components/qds-dialog.js +6 -6
- package/components/qds-divider.js +1 -1
- package/components/qds-dropdown.js +1 -1
- package/components/qds-form-message.js +4 -4
- package/components/qds-form-message.js.map +1 -1
- package/components/qds-icon-button.js +1 -1
- package/components/qds-icon-tab.js +8 -8
- package/components/qds-icon.js +1 -1
- package/components/qds-inline-link.js +4 -4
- package/components/qds-inline-link.js.map +1 -1
- package/components/qds-input.js +17 -13
- package/components/qds-input.js.map +1 -1
- package/components/qds-label.js +153 -1
- package/components/qds-label.js.map +1 -1
- package/components/qds-list-item.js +25 -29
- package/components/qds-list-item.js.map +1 -1
- package/components/qds-loader.js +3 -3
- package/components/qds-loader.js.map +1 -1
- package/components/qds-menu-item.js +6 -6
- package/components/qds-mini-button.js +1 -1
- package/components/qds-progress-bar.js +2 -2
- package/components/qds-radio.js +1 -1
- package/components/qds-select.js +6 -6
- package/components/qds-select.js.map +1 -1
- package/components/qds-standalone-link.js +5 -5
- package/components/qds-standalone-link.js.map +1 -1
- package/components/qds-switch.js +6 -6
- package/components/qds-switch.js.map +1 -1
- package/components/qds-tab.js +20 -15
- package/components/qds-tab.js.map +1 -1
- package/components/qds-tabbar.js +95 -34
- package/components/qds-tabbar.js.map +1 -1
- package/components/qds-table-cell.js +32 -4
- package/components/qds-table-cell.js.map +1 -1
- package/components/qds-table-head-cell.js +32 -4
- package/components/qds-table-head-cell.js.map +1 -1
- package/components/qds-table-row.js +2 -2
- package/components/qds-table-row.js.map +1 -1
- package/components/qds-table.js +1 -1
- package/components/qds-tag.js +1 -1
- package/components/qds-textarea.js +4 -4
- package/components/qds-textarea.js.map +1 -1
- package/components/qds-title.js +1 -1
- package/components/qds-tooltip.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qds-action-item.cjs.entry.js +1 -1
- package/dist/cjs/qds-action-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-avatar-media.qds-checkbox.qds-radio.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-avatar-media_3.cjs.entry.js +144 -41
- package/dist/cjs/qds-badge-counter.qds-badge-indicator.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-badge-counter_2.cjs.entry.js +1 -1
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +2 -2
- package/dist/cjs/qds-breadcrumb-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-button.cjs.entry.js +1 -1
- package/dist/cjs/qds-button.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-chip.cjs.entry.js +6 -6
- package/dist/cjs/qds-chip.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-dialog.cjs.entry.js +1 -1
- package/dist/cjs/qds-divider.qds-icon-button.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-divider_2.cjs.entry.js +4 -4
- package/dist/cjs/qds-dropdown.cjs.entry.js +21 -3
- package/dist/cjs/qds-dropdown.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-form-message.cjs.entry.js +2 -2
- package/dist/cjs/qds-form-message.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-icon-tab.cjs.entry.js +3 -3
- package/dist/cjs/qds-icon.cjs.entry.js +9 -29
- package/dist/cjs/qds-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-inline-link.cjs.entry.js +2 -2
- package/dist/cjs/qds-inline-link.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-input.cjs.entry.js +14 -10
- package/dist/cjs/qds-input.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-label.cjs.entry.js +2 -2
- package/dist/cjs/qds-list-item.cjs.entry.js +6 -4
- package/dist/cjs/qds-list-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-loader.cjs.entry.js +2 -2
- package/dist/cjs/qds-loader.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/qds-mini-button.cjs.entry.js +3 -5
- package/dist/cjs/qds-mini-button.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/qds-select.cjs.entry.js +4 -4
- package/dist/cjs/qds-select.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-standalone-link.cjs.entry.js +3 -3
- package/dist/cjs/qds-standalone-link.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-switch.cjs.entry.js +4 -4
- package/dist/cjs/qds-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-tab.cjs.entry.js +15 -10
- package/dist/cjs/qds-tab.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-tabbar.cjs.entry.js +83 -27
- package/dist/cjs/qds-tabbar.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-table-cell.cjs.entry.js +30 -3
- package/dist/cjs/qds-table-cell.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-table-head-cell.cjs.entry.js +30 -3
- package/dist/cjs/qds-table-head-cell.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-table-row.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-row.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-table.cjs.entry.js +1 -1
- package/dist/cjs/qds-tag.cjs.entry.js +2 -2
- package/dist/cjs/qds-tag.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-textarea.cjs.entry.js +3 -3
- package/dist/cjs/qds-textarea.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-title.cjs.entry.js +3 -3
- package/dist/cjs/qds-title.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/qds-tooltip.entry.cjs.js.map +1 -1
- package/dist/cjs/qds.cjs.js +1 -1
- package/dist/custom-elements.json +365 -30
- package/dist/docs.json +320 -64
- package/dist/esm/{helpers-eFD8hV6J.js → helpers-Fe2AA6uo.js} +3 -3
- package/dist/esm/{helpers-eFD8hV6J.js.map → helpers-Fe2AA6uo.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qds-action-item.entry.js +2 -2
- package/dist/esm/qds-action-item.entry.js.map +1 -1
- package/dist/esm/qds-avatar-media.qds-checkbox.qds-radio.entry.js.map +1 -1
- package/dist/esm/qds-avatar-media_3.entry.js +146 -43
- package/dist/esm/qds-badge-counter.qds-badge-indicator.entry.js.map +1 -1
- package/dist/esm/qds-badge-counter_2.entry.js +1 -1
- package/dist/esm/qds-breadcrumb-item.entry.js +3 -3
- package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/qds-button.entry.js +2 -2
- package/dist/esm/qds-button.entry.js.map +1 -1
- package/dist/esm/qds-chip.entry.js +7 -7
- package/dist/esm/qds-chip.entry.js.map +1 -1
- package/dist/esm/qds-dialog.entry.js +2 -2
- package/dist/esm/qds-divider.qds-icon-button.entry.js.map +1 -1
- package/dist/esm/qds-divider_2.entry.js +5 -5
- package/dist/esm/qds-dropdown.entry.js +22 -4
- package/dist/esm/qds-dropdown.entry.js.map +1 -1
- package/dist/esm/qds-form-message.entry.js +3 -3
- package/dist/esm/qds-form-message.entry.js.map +1 -1
- package/dist/esm/qds-icon-tab.entry.js +4 -4
- package/dist/esm/qds-icon.entry.js +10 -30
- package/dist/esm/qds-icon.entry.js.map +1 -1
- package/dist/esm/qds-inline-link.entry.js +3 -3
- package/dist/esm/qds-inline-link.entry.js.map +1 -1
- package/dist/esm/qds-input.entry.js +15 -11
- package/dist/esm/qds-input.entry.js.map +1 -1
- package/dist/esm/qds-label.entry.js +3 -3
- package/dist/esm/qds-list-item.entry.js +7 -5
- package/dist/esm/qds-list-item.entry.js.map +1 -1
- package/dist/esm/qds-loader.entry.js +2 -2
- package/dist/esm/qds-loader.entry.js.map +1 -1
- package/dist/esm/qds-menu-item.entry.js +3 -3
- package/dist/esm/qds-mini-button.entry.js +4 -6
- package/dist/esm/qds-mini-button.entry.js.map +1 -1
- package/dist/esm/qds-progress-bar.entry.js +2 -2
- package/dist/esm/qds-select.entry.js +5 -5
- package/dist/esm/qds-select.entry.js.map +1 -1
- package/dist/esm/qds-standalone-link.entry.js +4 -4
- package/dist/esm/qds-standalone-link.entry.js.map +1 -1
- package/dist/esm/qds-switch.entry.js +5 -5
- package/dist/esm/qds-switch.entry.js.map +1 -1
- package/dist/esm/qds-tab.entry.js +16 -11
- package/dist/esm/qds-tab.entry.js.map +1 -1
- package/dist/esm/qds-tabbar.entry.js +84 -28
- package/dist/esm/qds-tabbar.entry.js.map +1 -1
- package/dist/esm/qds-table-cell.entry.js +30 -3
- package/dist/esm/qds-table-cell.entry.js.map +1 -1
- package/dist/esm/qds-table-head-cell.entry.js +30 -3
- package/dist/esm/qds-table-head-cell.entry.js.map +1 -1
- package/dist/esm/qds-table-row.entry.js +2 -2
- package/dist/esm/qds-table-row.entry.js.map +1 -1
- package/dist/esm/qds-table.entry.js +1 -1
- package/dist/esm/qds-tag.entry.js +3 -3
- package/dist/esm/qds-tag.entry.js.map +1 -1
- package/dist/esm/qds-textarea.entry.js +4 -4
- package/dist/esm/qds-textarea.entry.js.map +1 -1
- package/dist/esm/qds-title.entry.js +3 -3
- package/dist/esm/qds-title.entry.js.map +1 -1
- package/dist/esm/qds-tooltip.entry.js +3 -3
- package/dist/esm/qds-tooltip.entry.js.map +1 -1
- package/dist/esm/qds.js +1 -1
- package/dist/types/components/avatar-media/avatar-media.d.ts +14 -5
- package/dist/types/components/checkbox/checkbox.d.ts +4 -0
- package/dist/types/components/icon/icon.d.ts +1 -2
- package/dist/types/components/radio/radio.d.ts +4 -0
- package/dist/types/components/tab/tab.d.ts +1 -1
- package/dist/types/components/tabbar/tabbar.d.ts +27 -1
- package/dist/types/components/table-cell/table-cell.d.ts +6 -0
- package/dist/types/components/table-head-cell/table-head-cell.d.ts +6 -0
- package/dist/types/components.d.ts +72 -15
- package/dist/vscode.html-custom-data.json +79 -4
- package/hydrate/index.js +969 -741
- package/hydrate/index.mjs +969 -741
- package/package.json +1 -2
- package/styles/core.css +24 -22
- package/components/p-5dwtV5iH.js.map +0 -1
- package/components/p-B2ZVUvk9.js.map +0 -1
- package/components/p-C1c4JVlg.js.map +0 -1
- package/components/p-CDRwHAIT.js.map +0 -1
- package/components/p-CkUTS1aU.js +0 -102
- package/components/p-CkUTS1aU.js.map +0 -1
- package/components/p-CkyaV9az.js.map +0 -1
- package/components/p-D82sb4oJ.js.map +0 -1
- package/components/p-D9pW936J.js +0 -164
- package/components/p-D9pW936J.js.map +0 -1
- package/components/p-DNHI4C-W.js.map +0 -1
- package/components/p-DR79BVX5.js.map +0 -1
- package/components/p-DtxwXYGb.js.map +0 -1
- package/components/p-laE-pGH7.js +0 -163
- package/components/p-laE-pGH7.js.map +0 -1
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { p as proxyCustomElement, H, c as createEvent, h } from './p-D2489VzR.js';
|
|
7
|
-
import { d as defineCustomElement$1 } from './p-
|
|
6
|
+
import { p as proxyCustomElement, H, c as createEvent, h, F as Fragment } from './p-D2489VzR.js';
|
|
7
|
+
import { d as defineCustomElement$1 } from './p-C9R8N06B.js';
|
|
8
8
|
|
|
9
|
-
const avatarMediaCss = ":host([hidden]){display:none!important}:host{display:block}.qds-container{align-items:center;align-self:stretch;background:var(--qds-theme-display-background);border:var(--qds-display-border-width) solid var(--qds-theme-display-background-contrast);border-radius:var(--qds-display-rounded-border-radius);display:flex;height:inherit;justify-content:center;width:inherit}.qds-
|
|
9
|
+
const avatarMediaCss = ":host([hidden]){display:none!important}:host{display:block}.qds-container{align-items:center;align-self:stretch;background:var(--qds-theme-display-background);border:var(--qds-display-border-width) solid var(--qds-theme-display-background-contrast);border-radius:var(--qds-display-rounded-border-radius);display:flex;height:inherit;justify-content:center;width:inherit}.qds-picture{border-radius:inherit;flex-shrink:0;height:100%;object-fit:cover;width:100%}.qds-icon,.qds-text{color:var(--qds-theme-display-background-contrast)}.qds-text{font:var(--qds-display-standard);text-align:center}.qds-sr-only{clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";
|
|
10
10
|
|
|
11
11
|
// SPDX-FileCopyrightText: © 2025 Schneider Electric
|
|
12
12
|
//
|
|
@@ -18,7 +18,7 @@ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) ||
|
|
|
18
18
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
19
19
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
20
20
|
};
|
|
21
|
-
var _AvatarMedia_renderContent, _AvatarMedia_handleImageError;
|
|
21
|
+
var _AvatarMedia_renderContent, _AvatarMedia_handleImageError, _AvatarMedia_handleImageLoad;
|
|
22
22
|
const AvatarMedia = /*@__PURE__*/ proxyCustomElement(class AvatarMedia extends H {
|
|
23
23
|
constructor(registerHost) {
|
|
24
24
|
super();
|
|
@@ -26,37 +26,35 @@ const AvatarMedia = /*@__PURE__*/ proxyCustomElement(class AvatarMedia extends H
|
|
|
26
26
|
this.__registerHost();
|
|
27
27
|
}
|
|
28
28
|
this.__attachShadow();
|
|
29
|
+
this.loadEmitter = createEvent(this, "qdsLoad", 6);
|
|
29
30
|
this.errorEmitter = createEvent(this, "qdsError", 6);
|
|
31
|
+
this.internals = this.attachInternals();
|
|
30
32
|
/**
|
|
31
|
-
* The
|
|
32
|
-
* @webnative
|
|
33
|
-
*/
|
|
34
|
-
this.alt = '';
|
|
35
|
-
/**
|
|
36
|
-
* The avatar-media's icon library.
|
|
33
|
+
* The name of a registered icon library.
|
|
37
34
|
*/
|
|
38
35
|
this.iconLibrary = 'default';
|
|
39
36
|
this.hasImageError = false;
|
|
40
37
|
_AvatarMedia_renderContent.set(this, () => {
|
|
41
|
-
if (this.src !== undefined && this.src !== '' && !this.hasImageError)
|
|
42
|
-
return (h("img", { class: "qds-picture", src: this.src, alt: this.alt, onError: __classPrivateFieldGet(this, _AvatarMedia_handleImageError, "f"), onLoad: ()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (this.text !== undefined && this.text !== '') {
|
|
47
|
-
return h("span", { class: "qds-text" }, this.initials);
|
|
48
|
-
}
|
|
49
|
-
if (this.iconName !== undefined && this.iconName !== '') {
|
|
38
|
+
if (this.src !== undefined && this.src !== '' && !this.hasImageError)
|
|
39
|
+
return (h("img", { "aria-hidden": "true", class: "qds-picture", src: this.src, alt: this.alt, onError: __classPrivateFieldGet(this, _AvatarMedia_handleImageError, "f"), onLoad: __classPrivateFieldGet(this, _AvatarMedia_handleImageLoad, "f") }));
|
|
40
|
+
if (this.text !== undefined && this.text !== '')
|
|
41
|
+
return (h(Fragment, null, h("span", { "aria-hidden": "true", class: "qds-text" }, this.initials), h("span", { class: "qds-sr-only" }, this.text)));
|
|
42
|
+
if (this.iconName !== undefined && this.iconName !== '')
|
|
50
43
|
return (h("qds-icon", { class: "qds-icon", name: this.iconName, library: this.iconLibrary }));
|
|
51
|
-
}
|
|
52
44
|
return h("qds-icon", { class: "qds-icon", name: "user", library: "core" });
|
|
53
45
|
});
|
|
54
46
|
_AvatarMedia_handleImageError.set(this, () => {
|
|
55
47
|
this.hasImageError = true;
|
|
48
|
+
this.roleChanged();
|
|
56
49
|
this.errorEmitter.emit();
|
|
57
50
|
});
|
|
51
|
+
_AvatarMedia_handleImageLoad.set(this, () => {
|
|
52
|
+
this.hasImageError = false;
|
|
53
|
+
this.roleChanged();
|
|
54
|
+
this.loadEmitter.emit();
|
|
55
|
+
});
|
|
58
56
|
}
|
|
59
|
-
|
|
57
|
+
textChanged() {
|
|
60
58
|
if (this.text === undefined || this.text === '') {
|
|
61
59
|
this.initials = undefined;
|
|
62
60
|
return;
|
|
@@ -65,14 +63,33 @@ const AvatarMedia = /*@__PURE__*/ proxyCustomElement(class AvatarMedia extends H
|
|
|
65
63
|
const [first = '', second = ''] = words.filter(Boolean);
|
|
66
64
|
this.initials = (first.charAt(0) + (second.charAt(0) || '')).toLocaleUpperCase();
|
|
67
65
|
}
|
|
66
|
+
labelChanged() {
|
|
67
|
+
this.internals.ariaLabel =
|
|
68
|
+
this.alt !== undefined && this.alt !== ''
|
|
69
|
+
? this.alt
|
|
70
|
+
: // eslint-disable-next-line unicorn/no-null
|
|
71
|
+
null;
|
|
72
|
+
}
|
|
73
|
+
roleChanged() {
|
|
74
|
+
if (this.src !== undefined && this.src !== '' && !this.hasImageError)
|
|
75
|
+
this.internals.role = 'img';
|
|
76
|
+
else if (this.text !== undefined && this.text !== '')
|
|
77
|
+
this.internals.role = 'generic';
|
|
78
|
+
else
|
|
79
|
+
this.internals.role = 'presentation';
|
|
80
|
+
}
|
|
68
81
|
componentWillLoad() {
|
|
69
|
-
this.
|
|
82
|
+
this.textChanged();
|
|
83
|
+
this.labelChanged();
|
|
84
|
+
this.roleChanged();
|
|
70
85
|
}
|
|
71
86
|
render() {
|
|
72
|
-
return h("div", { key: '
|
|
87
|
+
return h("div", { key: '52d3dd3165ee17dd49f8cdbf901af5c1c613246c', class: "qds-container" }, __classPrivateFieldGet(this, _AvatarMedia_renderContent, "f").call(this));
|
|
73
88
|
}
|
|
74
89
|
static get watchers() { return {
|
|
75
|
-
"text": ["
|
|
90
|
+
"text": ["textChanged", "roleChanged"],
|
|
91
|
+
"alt": ["labelChanged"],
|
|
92
|
+
"src": ["roleChanged"]
|
|
76
93
|
}; }
|
|
77
94
|
static get style() { return avatarMediaCss; }
|
|
78
95
|
}, [257, "qds-avatar-media", {
|
|
@@ -84,9 +101,11 @@ const AvatarMedia = /*@__PURE__*/ proxyCustomElement(class AvatarMedia extends H
|
|
|
84
101
|
"initials": [32],
|
|
85
102
|
"hasImageError": [32]
|
|
86
103
|
}, undefined, {
|
|
87
|
-
"text": ["
|
|
104
|
+
"text": ["textChanged", "roleChanged"],
|
|
105
|
+
"alt": ["labelChanged"],
|
|
106
|
+
"src": ["roleChanged"]
|
|
88
107
|
}]);
|
|
89
|
-
_AvatarMedia_renderContent = new WeakMap(), _AvatarMedia_handleImageError = new WeakMap();
|
|
108
|
+
_AvatarMedia_renderContent = new WeakMap(), _AvatarMedia_handleImageError = new WeakMap(), _AvatarMedia_handleImageLoad = new WeakMap();
|
|
90
109
|
function defineCustomElement() {
|
|
91
110
|
if (typeof customElements === "undefined") {
|
|
92
111
|
return;
|
|
@@ -107,6 +126,6 @@ function defineCustomElement() {
|
|
|
107
126
|
}
|
|
108
127
|
|
|
109
128
|
export { AvatarMedia as A, defineCustomElement as d };
|
|
110
|
-
//# sourceMappingURL=p-
|
|
129
|
+
//# sourceMappingURL=p-BoSYRCNp.js.map
|
|
111
130
|
|
|
112
|
-
//# sourceMappingURL=p-
|
|
131
|
+
//# sourceMappingURL=p-BoSYRCNp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-BoSYRCNp.js","mappings":";;;;;;;;AAAA,MAAM,cAAc,GAAG,gtBAAgtB;;ACAvuB;AACA;AACA;;;;;;;;;MAsBa,WAAW,iBAAAA,kBAAA,CAAA,MAAA,WAAA,SAAAC,CAAA,CAAA;AALxB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;AAyBE;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAY,SAAS;AAqBvC,QAAA,IAAa,CAAA,aAAA,GAAG,KAAK;AA8C7B,QAAA,0BAAA,CAAA,GAAA,CAAA,IAAA,EAAiB,MAA8B;AACtD,YAAA,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa;gBAClE,QACE,CAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EACc,MAAM,EAClB,KAAK,EAAC,aAAa,EACnB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,GAAG,EAAE,IAAI,CA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AA,OAAO,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,eAAe,EAAE,EAAA,sBAAA,CAAA,IAAI,EAAA,0BAAA,EAAA,GAAA,CAAe,CAAnB,IAAA,CAAA,IAAI,CAAiB,CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/avatar-media/avatar-media.css?tag=qds-avatar-media&encapsulation=shadow","src/components/avatar-media/avatar-media.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2025 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: block;\n}\n\n.qds-container {\n display: flex;\n justify-content: center;\n align-self: stretch;\n border-radius: var(--qds-display-rounded-border-radius);\n border: var(--qds-display-border-width) solid\n var(--qds-theme-display-background-contrast);\n background: var(--qds-theme-display-background);\n width: inherit;\n height: inherit;\n align-items: center;\n}\n\n.qds-picture {\n height: 100%;\n width: 100%;\n object-fit: cover;\n border-radius: inherit;\n flex-shrink: 0;\n}\n\n.qds-icon,\n.qds-text {\n color: var(--qds-theme-display-background-contrast);\n}\n\n.qds-text {\n text-align: center;\n font: var(--qds-display-standard);\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n}\n","// SPDX-FileCopyrightText: © 2025 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Event,\n Fragment,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-avatar-media',\n shadow: true,\n styleUrl: 'avatar-media.css',\n})\nexport class AvatarMedia implements ComponentInterface {\n /**\n * The avatar-media's image source.\n * @webnative\n */\n @Prop() public readonly src?: string\n\n /**\n * The alt text for the avatar-media's image.\n * @webnative\n */\n @Prop() public readonly alt?: string\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary?: string = 'default'\n\n /**\n * The avatar-media's text content.\n */\n @Prop() public readonly text?: string\n\n /**\n * Emitted when the avatar-media's image has loaded.\n */\n @Event({ eventName: 'qdsLoad', cancelable: false })\n private readonly loadEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the avatar-media's image fails to load due to an error.\n */\n @Event({ eventName: 'qdsError', cancelable: false })\n private readonly errorEmitter!: EventEmitter<void>\n\n @State() private initials?: string\n\n @State() private hasImageError = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n @Watch('text')\n private textChanged(): void {\n if (this.text === undefined || this.text === '') {\n this.initials = undefined\n return\n }\n const words = this.text.trim().split(' ')\n const [first = '', second = ''] = words.filter(Boolean)\n this.initials = (\n first.charAt(0) + (second.charAt(0) || '')\n ).toLocaleUpperCase()\n }\n\n @Watch('alt')\n private labelChanged(): void {\n this.internals.ariaLabel =\n this.alt !== undefined && this.alt !== ''\n ? this.alt\n : // eslint-disable-next-line unicorn/no-null\n null\n }\n\n @Watch('src')\n @Watch('text')\n private roleChanged(): void {\n if (this.src !== undefined && this.src !== '' && !this.hasImageError)\n this.internals.role = 'img'\n else if (this.text !== undefined && this.text !== '')\n this.internals.role = 'generic'\n else this.internals.role = 'presentation'\n }\n\n public componentWillLoad(): Promise<void> | void {\n this.textChanged()\n this.labelChanged()\n this.roleChanged()\n }\n\n public render() {\n return <div class=\"qds-container\">{this.#renderContent()}</div>\n }\n\n readonly #renderContent = (): HTMLElement | undefined => {\n if (this.src !== undefined && this.src !== '' && !this.hasImageError)\n return (\n <img\n aria-hidden=\"true\"\n class=\"qds-picture\"\n src={this.src}\n alt={this.alt}\n onError={this.#handleImageError}\n onLoad={this.#handleImageLoad}\n />\n )\n if (this.text !== undefined && this.text !== '')\n return (\n <>\n <span aria-hidden=\"true\" class=\"qds-text\">\n {this.initials}\n </span>\n <span class=\"qds-sr-only\">{this.text}</span>\n </>\n )\n if (this.iconName !== undefined && this.iconName !== '')\n return (\n <qds-icon\n class=\"qds-icon\"\n name={this.iconName}\n library={this.iconLibrary}\n />\n )\n return <qds-icon class=\"qds-icon\" name=\"user\" library=\"core\" />\n }\n\n readonly #handleImageError = (): void => {\n this.hasImageError = true\n this.roleChanged()\n this.errorEmitter.emit()\n }\n\n readonly #handleImageLoad = (): void => {\n this.hasImageError = false\n this.roleChanged()\n this.loadEmitter.emit()\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: © 2026 Schneider Electric
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { p as proxyCustomElement, H, h } from './p-D2489VzR.js';
|
|
7
|
+
import { d as defineCustomElement$1 } from './p-C9R8N06B.js';
|
|
8
|
+
|
|
9
|
+
const titleCss = ":host([hidden]){display:none!important}:host{display:block}.qds-titles{display:grid;grid-template-areas:\"g\"}.qds-titles.qds-has-kicker{grid-template-areas:\"h\" \"g\"}.qds-titles.qds-has-subtitle{grid-template-areas:\"g\" \"i\"}.qds-titles.qds-has-kicker.qds-has-subtitle{grid-template-areas:\"h\" \"g\" \"i\"}.qds-has-icon{grid-template-areas:\"j g\";grid-template-columns:auto 1fr}.qds-has-icon.qds-has-kicker{grid-template-areas:\". h\" \"j g\"}.qds-has-icon.qds-has-subtitle{grid-template-areas:\"j g\" \". i\"}.qds-has-icon.qds-has-kicker.qds-has-subtitle{grid-template-areas:\". h\" \"j g\" \". i\"}.qds-title,.qds-titles{hyphens:inherit}.qds-kicker,.qds-subtitle{hyphens:manual}.qds-kicker,.qds-subtitle,.qds-title{margin-block:0}.qds-title{color:var(--qds-theme-title);grid-area:g}.qds-subtitle{color:var(--qds-theme-subtitle);grid-area:i}.qds-kicker{color:var(--qds-theme-kicker);grid-area:h}.qds-icon{align-content:center;color:var(--qds-theme-text-standard);grid-area:j}.qds-root.qds-main .qds-title{font:var(--qds-main-title)}.qds-root.qds-main .qds-subtitle{font:var(--qds-main-subtitle)}.qds-root.qds-main .qds-kicker{font:var(--qds-main-kicker)}.qds-root.qds-main .qds-icon{height:var(--qds-main-titles-icon-crop-height);width:var(--qds-main-titles-icon-size)}.qds-root.qds-main.qds-titles{gap:var(--qds-main-titles-gap)}.qds-root.qds-main.qds-has-icon{gap:var(--qds-main-titles-gap) var(--qds-main-titles-icon-gap)}.qds-root.qds-navigation .qds-title{font:var(--qds-navigation-title)}.qds-root.qds-navigation .qds-subtitle{font:var(--qds-navigation-subtitle)}.qds-root.qds-navigation .qds-kicker{font:var(--qds-navigation-kicker)}.qds-root.qds-navigation .qds-icon{height:var(--qds-navigation-titles-icon-crop-height);width:var(--qds-navigation-titles-icon-size)}.qds-root.qds-navigation.qds-titles{gap:var(--qds-navigation-titles-gap)}.qds-root.qds-navigation.qds-has-icon{gap:var(--qds-navigation-titles-gap) var(--qds-navigation-titles-icon-gap)}.qds-main.qds-section.qds-titles{gap:var(--qds-main-section-titles-gap)}.qds-main.qds-section.qds-has-icon{gap:var(--qds-main-section-titles-gap) var(--qds-main-section-titles-icon-gap)}.qds-main.qds-section .qds-title{font:var(--qds-main-section-title)}.qds-main.qds-section .qds-subtitle{font:var(--qds-main-section-subtitle)}.qds-main.qds-section .qds-kicker{font:var(--qds-main-section-kicker)}.qds-main.qds-section .qds-icon{height:var(--qds-main-section-titles-icon-crop-height);width:var(--qds-main-section-titles-icon-size)}.qds-main.qds-subsection.qds-titles{gap:var(--qds-main-subsection-titles-gap)}.qds-main.qds-subsection.qds-has-icon{gap:var(--qds-main-subsection-titles-gap) var(--qds-main-subsection-titles-icon-gap)}.qds-main.qds-subsection .qds-title{font:var(--qds-main-subsection-title)}.qds-main.qds-subsection .qds-subtitle{font:var(--qds-main-subsection-subtitle)}.qds-main.qds-subsection .qds-kicker{font:var(--qds-main-subsection-kicker)}.qds-main.qds-subsection .qds-icon{height:var(--qds-main-subsection-titles-icon-crop-height);width:var(--qds-main-subsection-titles-icon-size)}.qds-panel.qds-root.qds-titles{gap:var(--qds-panel-titles-gap)}.qds-panel.qds-root.qds-has-icon{gap:var(--qds-panel-titles-gap) var(--qds-panel-titles-icon-gap)}.qds-panel.qds-root .qds-title{font:var(--qds-panel-title)}.qds-panel.qds-root .qds-subtitle{font:var(--qds-panel-subtitle)}.qds-panel.qds-root .qds-kicker{font:var(--qds-panel-kicker)}.qds-panel.qds-root .qds-icon{height:var(--qds-panel-titles-icon-crop-height);width:var(--qds-panel-titles-icon-size)}.qds-panel.qds-section.qds-titles{gap:var(--qds-panel-section-titles-gap)}.qds-panel.qds-section.qds-has-icon{gap:var(--qds-panel-section-titles-gap) var(--qds-panel-section-titles-icon-gap)}.qds-panel.qds-section .qds-title{font:var(--qds-panel-section-title)}.qds-panel.qds-section .qds-subtitle{font:var(--qds-panel-section-subtitle)}.qds-panel.qds-section .qds-kicker{font:var(--qds-panel-section-kicker)}.qds-panel.qds-section .qds-icon{height:var(--qds-panel-section-titles-icon-crop-height);width:var(--qds-panel-section-titles-icon-size)}.qds-panel.qds-subsection.qds-titles{gap:var(--qds-panel-subsection-titles-gap)}.qds-panel.qds-subsection.qds-has-icon{gap:var(--qds-panel-subsection-titles-gap) var(--qds-panel-subsection-titles-icon-gap)}.qds-panel.qds-subsection .qds-title{font:var(--qds-panel-subsection-title)}.qds-panel.qds-subsection .qds-subtitle{font:var(--qds-panel-subsection-subtitle)}.qds-panel.qds-subsection .qds-kicker{font:var(--qds-panel-subsection-kicker)}.qds-panel.qds-subsection .qds-icon{height:var(--qds-panel-subsection-titles-icon-crop-height);width:var(--qds-panel-subsection-titles-icon-size)}.qds-navigation.qds-section.qds-titles{gap:var(--qds-navigation-section-titles-gap)}.qds-navigation.qds-section.qds-has-icon{gap:var(--qds-navigation-section-titles-gap) var(--qds-navigation-section-titles-icon-gap)}.qds-navigation.qds-section .qds-title{font:var(--qds-navigation-section-title)}.qds-navigation.qds-section .qds-subtitle{font:var(--qds-navigation-section-subtitle)}.qds-navigation.qds-section .qds-kicker{font:var(--qds-navigation-section-kicker)}.qds-navigation.qds-section .qds-icon{height:var(--qds-navigation-section-titles-icon-crop-height);width:var(--qds-navigation-section-titles-icon-size)}.qds-navigation.qds-subsection.qds-titles{gap:var(--qds-navigation-subsection-titles-gap)}.qds-navigation.qds-subsection.qds-has-icon{gap:var(--qds-navigation-subsection-titles-gap) var(--qds-navigation-subsection-titles-icon-gap)}.qds-navigation.qds-subsection .qds-title{font:var(--qds-navigation-subsection-title)}.qds-navigation.qds-subsection .qds-subtitle{font:var(--qds-navigation-subsection-subtitle)}.qds-navigation.qds-subsection .qds-kicker{font:var(--qds-navigation-subsection-kicker)}.qds-navigation.qds-subsection .qds-icon{height:var(--qds-navigation-subsection-titles-icon-crop-height);width:var(--qds-navigation-subsection-titles-icon-size)}.qds-popup.qds-root.qds-titles{gap:var(--qds-popup-titles-gap)}.qds-popup.qds-root.qds-has-icon{gap:var(--qds-popup-titles-gap) var(--qds-popup-titles-icon-gap)}.qds-popup.qds-root .qds-title{font:var(--qds-popup-title)}.qds-popup.qds-root .qds-subtitle{font:var(--qds-popup-subtitle)}.qds-popup.qds-root .qds-kicker{font:var(--qds-popup-kicker)}.qds-popup.qds-root .qds-icon{height:var(--qds-popup-titles-icon-crop-height);width:var(--qds-popup-titles-icon-size)}.qds-popup.qds-section.qds-titles{gap:var(--qds-popup-section-titles-gap)}.qds-popup.qds-section.qds-has-icon{gap:var(--qds-popup-section-titles-gap) var(--qds-popup-section-titles-icon-gap)}.qds-popup.qds-section .qds-title{font:var(--qds-popup-section-title)}.qds-popup.qds-section .qds-subtitle{font:var(--qds-popup-section-subtitle)}.qds-popup.qds-section .qds-kicker{font:var(--qds-popup-section-kicker)}.qds-popup.qds-section .qds-icon{height:var(--qds-popup-section-titles-icon-crop-height);width:var(--qds-popup-section-titles-icon-size)}.qds-popup.qds-subsection.qds-titles{gap:var(--qds-popup-subsection-titles-gap)}.qds-popup.qds-subsection.qds-has-icon{gap:var(--qds-popup-subsection-titles-gap) var(--qds-popup-subsection-titles-icon-gap)}.qds-popup.qds-subsection .qds-title{font:var(--qds-popup-subsection-title)}.qds-popup.qds-subsection .qds-subtitle{font:var(--qds-popup-subsection-subtitle)}.qds-popup.qds-subsection .qds-kicker{font:var(--qds-popup-subsection-kicker)}.qds-popup.qds-subsection .qds-icon{height:var(--qds-popup-subsection-titles-icon-crop-height);width:var(--qds-popup-subsection-titles-icon-size)}.qds-accessory.qds-root.qds-titles{gap:var(--qds-accessory-titles-gap)}.qds-accessory.qds-root.qds-has-icon{gap:var(--qds-accessory-titles-gap) var(--qds-accessory-titles-icon-gap)}.qds-accessory.qds-root .qds-title{font:var(--qds-accessory-title)}.qds-accessory.qds-root .qds-subtitle{font:var(--qds-accessory-subtitle)}.qds-accessory.qds-root .qds-kicker{font:var(--qds-accessory-kicker)}.qds-accessory.qds-root .qds-icon{height:var(--qds-accessory-titles-icon-crop-height);width:var(--qds-accessory-titles-icon-size)}.qds-accessory.qds-section.qds-titles{gap:var(--qds-accessory-section-titles-gap)}.qds-accessory.qds-section.qds-has-icon{gap:var(--qds-accessory-section-titles-gap) var(--qds-accessory-section-titles-icon-gap)}.qds-accessory.qds-section .qds-title{font:var(--qds-accessory-section-title)}.qds-accessory.qds-section .qds-subtitle{font:var(--qds-accessory-section-subtitle)}.qds-accessory.qds-section .qds-kicker{font:var(--qds-accessory-section-kicker)}.qds-accessory.qds-section .qds-icon{height:var(--qds-accessory-section-titles-icon-crop-height);width:var(--qds-accessory-section-titles-icon-size)}.qds-titles[data-variant=web-main-section-promo]:is(.qds-root,.qds-section,.qds-subsection){gap:var(--qds-main-section-promo-titles-gap);margin:auto}[data-variant=web-main-section-promo]:is(.qds-root,.qds-section,.qds-subsection) .qds-title{font:var(--qds-main-section-promo-title)}[data-variant=web-main-section-promo]:is(.qds-root,.qds-section,.qds-subsection) .qds-subtitle{font:var(--qds-main-section-promo-subtitle)}[data-variant=web-main-section-promo]:is(.qds-root,.qds-section,.qds-subsection) .qds-kicker{font:var(--qds-main-section-promo-kicker)}.qds-has-icon[data-variant=web-main-section-promo]:is(.qds-root,.qds-section,.qds-subsection){gap:var(--qds-main-section-promo-titles-gap) var(--qds-main-section-promo-titles-icon-gap)}[data-variant=web-main-section-promo]:is(.qds-root,.qds-section,.qds-subsection) .qds-icon{height:var(--qds-main-section-promo-titles-icon-crop-height);width:var(--qds-main-section-promo-titles-icon-size)}[data-alignment=start]{text-align:start}[data-alignment=center]{text-align:center}[data-alignment=end]{text-align:end}.qds-titles[data-variant=web-main-section-display]:is(.qds-root,.qds-section,.qds-subsection){gap:var(--qds-main-section-display-titles-gap)}[data-variant=web-main-section-display]:is(.qds-root,.qds-section,.qds-subsection) .qds-title{font:var(--qds-main-section-display-title)}.qds-titles[data-variant=web-main-subsection-card]:is(.qds-root,.qds-section,.qds-subsection){gap:var(--qds-main-subsection-card-titles-gap)}[data-variant=web-main-subsection-card]:is(.qds-root,.qds-section,.qds-subsection) .qds-title{font:var(--qds-main-subsection-card-standard-title)}.qds-titles[data-variant=web-main-section-hero]:is(.qds-root,.qds-section,.qds-subsection){gap:var(--qds-main-section-hero-titles-gap)}[data-variant=web-main-section-hero]:is(.qds-root,.qds-section,.qds-subsection) .qds-title{font:var(--qds-main-section-hero-title)}";
|
|
10
|
+
|
|
11
|
+
// SPDX-FileCopyrightText: © 2024 Schneider Electric
|
|
12
|
+
//
|
|
13
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
14
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
15
|
+
if (kind === "a" && !f)
|
|
16
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
17
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
18
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
19
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
20
|
+
};
|
|
21
|
+
var _Title_instances, _Title_hasSubtitle_get, _Title_hasKicker_get;
|
|
22
|
+
const Title = /*@__PURE__*/ proxyCustomElement(class Title extends H {
|
|
23
|
+
constructor(registerHost) {
|
|
24
|
+
super();
|
|
25
|
+
if (registerHost !== false) {
|
|
26
|
+
this.__registerHost();
|
|
27
|
+
}
|
|
28
|
+
this.__attachShadow();
|
|
29
|
+
this.internals = this.attachInternals();
|
|
30
|
+
_Title_instances.add(this);
|
|
31
|
+
/**
|
|
32
|
+
* The alignment of the title.
|
|
33
|
+
*/
|
|
34
|
+
this.alignment = 'start';
|
|
35
|
+
/**
|
|
36
|
+
* The name of a registered icon library.
|
|
37
|
+
*/
|
|
38
|
+
this.iconLibrary = 'default';
|
|
39
|
+
this.layer = 'main';
|
|
40
|
+
this.level = 'section';
|
|
41
|
+
/**
|
|
42
|
+
* HTML tag to use to render the title.
|
|
43
|
+
*/
|
|
44
|
+
this.tag = 'h2';
|
|
45
|
+
}
|
|
46
|
+
componentWillLoad() {
|
|
47
|
+
this.internals.role = 'group';
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
const layer = `qds-${this.layer ?? 'main'}`;
|
|
51
|
+
const level = `qds-${this.level ?? 'section'}`;
|
|
52
|
+
const Tag = this.tag ?? 'h2';
|
|
53
|
+
const hasIcon = this.iconName !== undefined && this.iconName !== '';
|
|
54
|
+
return (h("hgroup", { key: 'ed0b1522df1d04ac5d4a19bfd4d801bac51aba5a', "data-alignment": this.alignment ?? 'start', "data-variant": this.variant, class: {
|
|
55
|
+
[layer]: true,
|
|
56
|
+
[level]: true,
|
|
57
|
+
'qds-titles': true,
|
|
58
|
+
'qds-has-icon': hasIcon,
|
|
59
|
+
'qds-has-kicker': __classPrivateFieldGet(this, _Title_instances, "a", _Title_hasKicker_get),
|
|
60
|
+
'qds-has-subtitle': __classPrivateFieldGet(this, _Title_instances, "a", _Title_hasSubtitle_get),
|
|
61
|
+
}, role: "none" }, h(Tag, { key: '9159ae4127d5be822227a6edd25d1297857686d7', class: "qds-title", "data-variant": this.variant }, h("slot", { key: '266cb1ded9c3d64320bd71d13393832f6e280a85' })), __classPrivateFieldGet(this, _Title_instances, "a", _Title_hasKicker_get) && h("p", { key: '5672a80281144196dc75fd811b5889afd997cf98', class: "qds-kicker" }, this.kicker), __classPrivateFieldGet(this, _Title_instances, "a", _Title_hasSubtitle_get) && h("p", { key: '499d0d4b792e9edba768472043c42b2fb08e3c62', class: "qds-subtitle" }, this.subtitle), hasIcon && (h("qds-icon", { key: 'f49f82e51dbfdefb3a1316372ee7d48ab2079e47', class: "qds-icon", name: this.iconName, library: this.iconLibrary }))));
|
|
62
|
+
}
|
|
63
|
+
static get style() { return titleCss; }
|
|
64
|
+
}, [257, "qds-title", {
|
|
65
|
+
"alignment": [1],
|
|
66
|
+
"iconName": [1, "icon-name"],
|
|
67
|
+
"iconLibrary": [1, "icon-library"],
|
|
68
|
+
"kicker": [1],
|
|
69
|
+
"layer": [1],
|
|
70
|
+
"level": [1],
|
|
71
|
+
"subtitle": [1],
|
|
72
|
+
"tag": [1],
|
|
73
|
+
"variant": [1]
|
|
74
|
+
}]);
|
|
75
|
+
_Title_instances = new WeakSet(), _Title_hasSubtitle_get = function _Title_hasSubtitle_get() {
|
|
76
|
+
return this.subtitle !== undefined && this.subtitle !== '';
|
|
77
|
+
}, _Title_hasKicker_get = function _Title_hasKicker_get() {
|
|
78
|
+
return this.kicker !== undefined && this.kicker !== '';
|
|
79
|
+
};
|
|
80
|
+
function defineCustomElement() {
|
|
81
|
+
if (typeof customElements === "undefined") {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const components = ["qds-title", "qds-icon"];
|
|
85
|
+
components.forEach(tagName => { switch (tagName) {
|
|
86
|
+
case "qds-title":
|
|
87
|
+
if (!customElements.get(tagName)) {
|
|
88
|
+
customElements.define(tagName, Title);
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
case "qds-icon":
|
|
92
|
+
if (!customElements.get(tagName)) {
|
|
93
|
+
defineCustomElement$1();
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
} });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export { Title as T, defineCustomElement as d };
|
|
100
|
+
//# sourceMappingURL=p-BvRd7jA2.js.map
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=p-BvRd7jA2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-BvRd7jA2.js","mappings":";;;;;;;;AAAA,MAAM,QAAQ,GAAG,k0UAAk0U;;ACAn1U;AACA;AACA;;;;;;;;;MAyBa,KAAK,iBAAAA,kBAAA,CAAA,MAAA,KAAA,SAAAC,CAAA,CAAA;AALlB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;AAME;;AAEG;AACqB,QAAA,IAAS,CAAA,SAAA,GAAe,OAAO;AASvD;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAO/B,QAAA,IAAK,CAAA,KAAA,GAAW,MAAM;AAEtB,QAAA,IAAK,CAAA,KAAA,GAAW,SAAS;AAOjD;;AAEG;AACqB,QAAA,IAAG,CAAA,GAAA,GAAS,IAAI;AAwDzC;IAvCQ,iBAAiB,GAAA;AACtB,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,OAAO;;IAGxB,MAAM,GAAA;QACX,MAAM,KAAK,GAAG,CAAO,IAAA,EAAA,IAAI,CAAC,KAAK,IAAI,MAAM,CAAA,CAAE;QAC3C,MAAM,KAAK,GAAG,CAAO,IAAA,EAAA,IAAI,CAAC,KAAK,IAAI,SAAS,CAAA,CAAE;AAC9C,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI;AAC5B,QAAA,MAAM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I,CAAC,QAAQ,EACnB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,CAAA,CACH,CACM;;;;;;;;;;;;;;;IA3CX,OAAO,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE;AAC5D,CAAC,EAAA,oBAAA,GAAA,SAAA,oBAAA,GAAA;IAGC,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE;AACxD,CAAC;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/title/title.css?tag=qds-title&encapsulation=shadow","src/components/title/title.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: block;\n}\n\n.qds-titles {\n display: grid;\n grid-template-areas: 'title';\n\n &.qds-has-kicker {\n grid-template-areas:\n 'kicker'\n 'title';\n }\n\n &.qds-has-subtitle {\n grid-template-areas:\n 'title'\n 'subtitle';\n }\n\n &.qds-has-kicker.qds-has-subtitle {\n grid-template-areas:\n 'kicker'\n 'title'\n 'subtitle';\n }\n}\n\n.qds-has-icon {\n grid-template-columns: auto 1fr;\n grid-template-areas: 'icon title';\n\n &.qds-has-kicker {\n grid-template-areas:\n '. kicker'\n 'icon title';\n }\n\n &.qds-has-subtitle {\n grid-template-areas:\n 'icon title'\n '. subtitle';\n }\n\n &.qds-has-kicker.qds-has-subtitle {\n grid-template-areas:\n '. kicker'\n 'icon title'\n '. subtitle';\n }\n}\n\n.qds-titles,\n.qds-title {\n hyphens: inherit;\n}\n\n.qds-subtitle,\n.qds-kicker {\n hyphens: initial;\n}\n\n.qds-title,\n.qds-subtitle,\n.qds-kicker {\n margin-block: 0;\n}\n\n.qds-title {\n grid-area: title;\n color: var(--qds-theme-title);\n}\n\n.qds-subtitle {\n grid-area: subtitle;\n color: var(--qds-theme-subtitle);\n}\n\n.qds-kicker {\n grid-area: kicker;\n color: var(--qds-theme-kicker);\n}\n\n.qds-icon {\n grid-area: icon;\n align-content: center;\n color: var(--qds-theme-text-standard);\n}\n\n.qds-root {\n &.qds-main {\n & .qds-title {\n font: var(--qds-main-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-main-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-main-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-main-titles-icon-size);\n height: var(--qds-main-titles-icon-crop-height);\n }\n\n &.qds-titles {\n gap: var(--qds-main-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-main-titles-gap) var(--qds-main-titles-icon-gap);\n }\n }\n\n &.qds-navigation {\n & .qds-title {\n font: var(--qds-navigation-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-navigation-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-navigation-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-navigation-titles-icon-size);\n height: var(--qds-navigation-titles-icon-crop-height);\n }\n\n &.qds-titles {\n gap: var(--qds-navigation-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-navigation-titles-gap)\n var(--qds-navigation-titles-icon-gap);\n }\n }\n}\n\n.qds-main {\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-main-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-main-section-titles-gap)\n var(--qds-main-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-main-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-main-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-main-section-titles-icon-size);\n height: var(--qds-main-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-main-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-main-subsection-titles-gap)\n var(--qds-main-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-main-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-main-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-main-subsection-titles-icon-size);\n height: var(--qds-main-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-panel {\n &.qds-root {\n &.qds-titles {\n gap: var(--qds-panel-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-panel-titles-gap) var(--qds-panel-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-panel-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-panel-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-panel-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-panel-titles-icon-size);\n height: var(--qds-panel-titles-icon-crop-height);\n }\n }\n\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-panel-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-panel-section-titles-gap)\n var(--qds-panel-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-panel-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-panel-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-panel-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-panel-section-titles-icon-size);\n height: var(--qds-panel-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-panel-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-panel-subsection-titles-gap)\n var(--qds-panel-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-panel-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-panel-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-panel-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-panel-subsection-titles-icon-size);\n height: var(--qds-panel-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-navigation {\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-navigation-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-navigation-section-titles-gap)\n var(--qds-navigation-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-navigation-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-navigation-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-navigation-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-navigation-section-titles-icon-size);\n height: var(--qds-navigation-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-navigation-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-navigation-subsection-titles-gap)\n var(--qds-navigation-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-navigation-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-navigation-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-navigation-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-navigation-subsection-titles-icon-size);\n height: var(--qds-navigation-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-popup {\n &.qds-root {\n &.qds-titles {\n gap: var(--qds-popup-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-popup-titles-gap) var(--qds-popup-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-popup-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-popup-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-popup-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-popup-titles-icon-size);\n height: var(--qds-popup-titles-icon-crop-height);\n }\n }\n\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-popup-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-popup-section-titles-gap)\n var(--qds-popup-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-popup-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-popup-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-popup-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-popup-section-titles-icon-size);\n height: var(--qds-popup-section-titles-icon-crop-height);\n }\n }\n\n &.qds-subsection {\n &.qds-titles {\n gap: var(--qds-popup-subsection-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-popup-subsection-titles-gap)\n var(--qds-popup-subsection-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-popup-subsection-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-popup-subsection-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-popup-subsection-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-popup-subsection-titles-icon-size);\n height: var(--qds-popup-subsection-titles-icon-crop-height);\n }\n }\n}\n\n.qds-accessory {\n &.qds-root {\n &.qds-titles {\n gap: var(--qds-accessory-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-accessory-titles-gap) var(--qds-accessory-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-accessory-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-accessory-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-accessory-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-accessory-titles-icon-size);\n height: var(--qds-accessory-titles-icon-crop-height);\n }\n }\n\n &.qds-section {\n &.qds-titles {\n gap: var(--qds-accessory-section-titles-gap);\n }\n\n &.qds-has-icon {\n gap: var(--qds-accessory-section-titles-gap)\n var(--qds-accessory-section-titles-icon-gap);\n }\n\n & .qds-title {\n font: var(--qds-accessory-section-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-accessory-section-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-accessory-section-kicker);\n }\n\n & .qds-icon {\n width: var(--qds-accessory-section-titles-icon-size);\n height: var(--qds-accessory-section-titles-icon-crop-height);\n }\n }\n}\n\n[data-variant='web-main-section-promo'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-section-promo-titles-gap);\n margin: auto;\n }\n\n & .qds-title {\n font: var(--qds-main-section-promo-title);\n }\n\n & .qds-subtitle {\n font: var(--qds-main-section-promo-subtitle);\n }\n\n & .qds-kicker {\n font: var(--qds-main-section-promo-kicker);\n }\n\n &.qds-has-icon {\n gap: var(--qds-main-section-promo-titles-gap)\n var(--qds-main-section-promo-titles-icon-gap);\n }\n\n & .qds-icon {\n width: var(--qds-main-section-promo-titles-icon-size);\n height: var(--qds-main-section-promo-titles-icon-crop-height);\n }\n }\n}\n\n[data-alignment='start'] {\n text-align: start;\n}\n\n[data-alignment='center'] {\n text-align: center;\n}\n\n[data-alignment='end'] {\n text-align: end;\n}\n\n[data-variant='web-main-section-display'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-section-display-titles-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-section-display-title);\n }\n }\n}\n\n[data-variant='web-main-subsection-card'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-subsection-card-titles-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-subsection-card-standard-title);\n }\n }\n}\n\n[data-variant='web-main-section-hero'] {\n &:is(.qds-root, .qds-section, .qds-subsection) {\n &.qds-titles {\n gap: var(--qds-main-section-hero-titles-gap);\n }\n\n & .qds-title {\n font: var(--qds-main-section-hero-title);\n }\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { AttachInternals, Component, h, Prop } from '@stencil/core'\n\nexport type Layer = 'accessory' | 'main' | 'navigation' | 'panel' | 'popup'\nexport type Level = 'root' | 'section' | 'subsection'\nexport type Tag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\nexport type TitleVariant =\n | 'web-main-section-display'\n | 'web-main-section-hero'\n | 'web-main-section-promo'\n | 'web-main-subsection-card'\n\nexport type Alignment = 'center' | 'end' | 'start'\n\n/**\n * @slot Content to display for the title.\n * @see https://quartz.se.com/build/components/title\n */\n@Component({\n tag: 'qds-title',\n shadow: true,\n styleUrl: 'title.css',\n})\nexport class Title implements ComponentInterface {\n /**\n * The alignment of the title.\n */\n @Prop() public readonly alignment?: Alignment = 'start'\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * Text to display for the kicker.\n */\n @Prop() public readonly kicker?: string\n\n @Prop() public readonly layer?: Layer = 'main'\n\n @Prop() public readonly level?: Level = 'section'\n\n /**\n * Text to display for the subtitle.\n */\n @Prop() public readonly subtitle?: string\n\n /**\n * HTML tag to use to render the title.\n */\n @Prop() public readonly tag?: Tag = 'h2'\n\n /**\n * The title's variant.\n */\n @Prop() public readonly variant?: TitleVariant\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n get #hasSubtitle(): boolean {\n return this.subtitle !== undefined && this.subtitle !== ''\n }\n\n get #hasKicker(): boolean {\n return this.kicker !== undefined && this.kicker !== ''\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'group'\n }\n\n public render() {\n const layer = `qds-${this.layer ?? 'main'}`\n const level = `qds-${this.level ?? 'section'}`\n const Tag = this.tag ?? 'h2'\n const hasIcon = this.iconName !== undefined && this.iconName !== ''\n\n return (\n <hgroup\n data-alignment={this.alignment ?? 'start'}\n data-variant={this.variant}\n class={{\n [layer]: true,\n [level]: true,\n 'qds-titles': true,\n 'qds-has-icon': hasIcon,\n 'qds-has-kicker': this.#hasKicker,\n 'qds-has-subtitle': this.#hasSubtitle,\n }}\n role=\"none\"\n >\n <Tag class=\"qds-title\" data-variant={this.variant}>\n <slot />\n </Tag>\n {this.#hasKicker && <p class=\"qds-kicker\">{this.kicker}</p>}\n {this.#hasSubtitle && <p class=\"qds-subtitle\">{this.subtitle}</p>}\n {hasIcon && (\n <qds-icon\n class=\"qds-icon\"\n name={this.iconName}\n library={this.iconLibrary}\n />\n )}\n </hgroup>\n )\n }\n}\n"],"version":3}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, c as createEvent, h } from './p-D2489VzR.js';
|
|
7
|
-
import { p as pickFocusEventAttributes } from './p-
|
|
8
|
-
import { d as defineCustomElement$1 } from './p-
|
|
7
|
+
import { p as pickFocusEventAttributes } from './p-BalM52S_.js';
|
|
8
|
+
import { d as defineCustomElement$1 } from './p-C9R8N06B.js';
|
|
9
9
|
|
|
10
|
-
const miniButtonCss = ":host{display:block}:host(:focus-visible){box-shadow:0 0 0 var(--qds-focus-heavy-border-width) var(--qds-theme-focus-border);outline:var(--qds-theme-focus-border-contrast) solid var(--qds-focus-light-border-width);outline-offset:0}.qds-mini-button{align-items:center;background-color:initial;border:none;
|
|
10
|
+
const miniButtonCss = ":host{border-radius:var(--qds-control-rounded-border-radius);display:block}:host(:focus-visible){box-shadow:0 0 0 var(--qds-focus-heavy-border-width) var(--qds-theme-focus-border);outline:var(--qds-theme-focus-border-contrast) solid var(--qds-focus-light-border-width);outline-offset:0}:host(:hover){background-color:var(--qds-theme-interactive-background-hover)}:host(:active){background-color:var(--qds-theme-interactive-background-pressed)}.qds-mini-button{align-items:center;background-color:initial;border:none;color:var(--qds-theme-control-text-standard);cursor:pointer;display:flex;justify-content:center;min-height:var(--qds-control-mini-button-standard-size);padding:0;width:var(--qds-control-mini-button-standard-size)}.qds-mini-button:focus-visible{outline:none}.qds-mini-button:disabled{pointer-events:none}.qds-icon{align-content:center;font-size:var(--qds-control-standard-icon-size);line-height:normal}";
|
|
11
11
|
|
|
12
12
|
// SPDX-FileCopyrightText: © 2025 Schneider Electric
|
|
13
13
|
//
|
|
@@ -107,7 +107,7 @@ const MiniButton = /*@__PURE__*/ proxyCustomElement(class MiniButton extends H {
|
|
|
107
107
|
}
|
|
108
108
|
render() {
|
|
109
109
|
const Tag = this.href === undefined ? 'button' : 'a';
|
|
110
|
-
return (h(Tag, { key: '
|
|
110
|
+
return (h(Tag, { key: '5ccabdd242da1682c5be8e868f1e361b45d0c708', type: Tag === 'a' ? undefined : 'button', class: "qds-mini-button", href: Tag === 'a' ? this.href : undefined, rel: Tag === 'a' ? this.rel : undefined, disabled: __classPrivateFieldGet(this, _MiniButton_instances, "a", _MiniButton_computedDisabled_get), "aria-hidden": "true", onKeyDown: preventDefault, onKeyUp: preventDefault, onKeyPress: preventDefault, tabIndex: -1 }, h("qds-icon", { key: '86e9e8fd746952beac25b4b7f0fda237387f2125', class: "qds-icon", library: this.library, name: this.name })));
|
|
111
111
|
}
|
|
112
112
|
static get formAssociated() { return true; }
|
|
113
113
|
get host() { return this; }
|
|
@@ -133,9 +133,7 @@ const MiniButton = /*@__PURE__*/ proxyCustomElement(class MiniButton extends H {
|
|
|
133
133
|
"text": ["textChanged"]
|
|
134
134
|
}]);
|
|
135
135
|
_MiniButton_savedTabIndex = new WeakMap(), _MiniButton_instances = new WeakSet(), _MiniButton_computedDisabled_get = function _MiniButton_computedDisabled_get() {
|
|
136
|
-
return
|
|
137
|
-
(this.host.hasAttribute('disabled') &&
|
|
138
|
-
this.host.getAttribute('disabled') !== 'false'));
|
|
136
|
+
return this.disabled ?? false;
|
|
139
137
|
};
|
|
140
138
|
function defineCustomElement() {
|
|
141
139
|
if (typeof customElements === "undefined") {
|
|
@@ -157,6 +155,6 @@ function defineCustomElement() {
|
|
|
157
155
|
}
|
|
158
156
|
|
|
159
157
|
export { MiniButton as M, defineCustomElement as d };
|
|
160
|
-
//# sourceMappingURL=p-
|
|
158
|
+
//# sourceMappingURL=p-C93kOEAe.js.map
|
|
161
159
|
|
|
162
|
-
//# sourceMappingURL=p-
|
|
160
|
+
//# sourceMappingURL=p-C93kOEAe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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AC;QAC/D,IAAI,CAAC,eAAe,EAAE;;IAGjB,MAAM,GAAA;AACX,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,GAAG,QAAQ,GAAG,GAAG;QAEpD,QACE,CAAC,CAAA,GAAG,EACF,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,SAAS,GAAG,QAAQ,EACxC,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI,CAAC,IAAI,GAAG,SAAS,EACzC,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,SAAS,EACvC,QAAQ,EAAE,sBAAA,CAAA,IAAI,EAAkB,qBAAA,EAAA,GAAA,EAAA,gCAAA,CAAA,EAAA,aAAA,EACpB,MAAM,EAClB,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,EAAE,EAAA,EAEZ,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAU,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAI,CAAA,CACjE;;;;;;;;;;;;;;;;;;;;;;;;;;AApFR,IAAA,OAAO,IAAI,CAAC,QAAQ,IAAI,KAAK;AAC/B,CAAC;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/mini-button/mini-button.css?tag=qds-mini-button&encapsulation=shadow","src/components/mini-button/mini-button.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2025 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n:host {\n display: block;\n border-radius: var(--qds-control-rounded-border-radius);\n}\n\n:host(:focus-visible) {\n /* inner ring */\n outline: var(--qds-theme-focus-border-contrast) solid\n var(--qds-focus-light-border-width);\n outline-offset: 0;\n\n /* outer ring */\n box-shadow: 0 0 0 var(--qds-focus-heavy-border-width)\n var(--qds-theme-focus-border);\n}\n\n:host(:hover) {\n background-color: var(--qds-theme-interactive-background-hover);\n}\n\n:host(:active) {\n background-color: var(--qds-theme-interactive-background-pressed);\n}\n\n.qds-mini-button {\n display: flex;\n width: var(--qds-control-mini-button-standard-size);\n min-height: var(--qds-control-mini-button-standard-size);\n align-items: center;\n border: none;\n justify-content: center;\n color: var(--qds-theme-control-text-standard);\n background-color: transparent;\n padding: 0;\n cursor: pointer;\n\n &:focus-visible {\n outline: none;\n }\n}\n\n.qds-mini-button:disabled {\n pointer-events: none;\n}\n\n.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n align-content: center;\n line-height: normal;\n}\n","// SPDX-FileCopyrightText: © 2025 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport { pickFocusEventAttributes } from '../../helpers'\nimport type { Target } from '../shared'\n\nconst preventDefault = (event: KeyboardEvent | MouseEvent): void => {\n event.preventDefault()\n}\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-mini-button',\n formAssociated: true,\n styleUrl: 'mini-button.css',\n shadow: true,\n})\nexport class MiniButton implements ComponentInterface {\n /**\n * Prevents the mini button from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop()\n public readonly disabled?: boolean\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly name!: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly library: string = 'default'\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target?: LiteralUnion<Target, string>\n\n /**\n * When set, the underlying button will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * When href is define and the button act as a link (`<a>`), the `rel` will be added to the element.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string = 'noopener'\n\n /**\n * The mini button's accessible name.\n */\n @Prop() public readonly text!: string\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #savedTabIndex = 0\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.#computedDisabled.toString()\n if (this.#computedDisabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('href')\n protected hrefChanged(): void {\n this.internals.role = this.href === undefined ? 'button' : 'link'\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string | null): void {\n if (newValue !== null) {\n const parsedValue = Number.parseInt(newValue, 10)\n this.#savedTabIndex =\n Number.isNaN(parsedValue) || !Number.isFinite(parsedValue)\n ? 0\n : parsedValue\n }\n if (this.#computedDisabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('text')\n protected textChanged(): void {\n this.internals.ariaLabel = this.text\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n }\n }\n\n @Listen('blur')\n protected onBlur(event: FocusEvent): void {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('focus')\n protected onFocus(event: FocusEvent): void {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('keydown')\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter') this.host.click()\n }\n\n @Listen('keyup')\n protected onKeyup(event: KeyboardEvent): void {\n if (event.key === ' ') this.host.click()\n }\n\n public componentWillLoad(): void {\n this.hrefChanged()\n this.textChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n this.disabledChanged()\n }\n\n public render() {\n const Tag = this.href === undefined ? 'button' : 'a'\n\n return (\n <Tag\n type={Tag === 'a' ? undefined : 'button'}\n class=\"qds-mini-button\"\n href={Tag === 'a' ? this.href : undefined}\n rel={Tag === 'a' ? this.rel : undefined}\n disabled={this.#computedDisabled}\n aria-hidden=\"true\"\n onKeyDown={preventDefault}\n onKeyUp={preventDefault}\n onKeyPress={preventDefault}\n tabIndex={-1}\n >\n <qds-icon class=\"qds-icon\" library={this.library} name={this.name} />\n </Tag>\n )\n }\n}\n"],"version":3}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { g as getAssetPath, p as proxyCustomElement, H, c as createEvent, h } from './p-D2489VzR.js';
|
|
7
|
-
import { c as inheritAriaAttributes } from './p-CURs27Ur.js';
|
|
8
7
|
|
|
9
8
|
const checkedSvg = 'data:image/svg+xml;base64,PCEtLSBTUERYLUZpbGVDb3B5cmlnaHRUZXh0OiDCqSAyMDI1IFNjaG5laWRlciBFbGVjdHJpYyBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogQXBhY2hlLTIuMCAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiIHN0cm9rZS1taXRlcmxpbWl0PSIxNiIgZD0ibTEyLjExMSAzLjUtNS45MTggOUwzLjg5IDkuMDI0Ii8+PC9zdmc+';
|
|
10
9
|
|
|
@@ -163,26 +162,6 @@ const requestIcon = (url) => {
|
|
|
163
162
|
|
|
164
163
|
const iconCss = ":host([hidden]){display:none!important}:host{display:inline-block;height:1em;width:1em}.qds-container{position:relative}.qds-icon-wrapper{display:contents}svg{display:block;fill:currentcolor;height:100%;width:100%}";
|
|
165
164
|
|
|
166
|
-
// SPDX-FileCopyrightText: © 2024 Schneider Electric
|
|
167
|
-
//
|
|
168
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
169
|
-
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
170
|
-
if (kind === "a" && !f)
|
|
171
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
172
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
173
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
174
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
175
|
-
};
|
|
176
|
-
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
177
|
-
if (kind === "m")
|
|
178
|
-
throw new TypeError("Private method is not writable");
|
|
179
|
-
if (kind === "a" && !f)
|
|
180
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
181
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
182
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
183
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
184
|
-
};
|
|
185
|
-
var _Icon_inheritedAttributes;
|
|
186
165
|
let parser;
|
|
187
166
|
const Icon = /*@__PURE__*/ proxyCustomElement(class Icon extends H {
|
|
188
167
|
constructor(registerHost) {
|
|
@@ -193,12 +172,12 @@ const Icon = /*@__PURE__*/ proxyCustomElement(class Icon extends H {
|
|
|
193
172
|
this.__attachShadow();
|
|
194
173
|
this.loadEmitter = createEvent(this, "qdsLoad", 6);
|
|
195
174
|
this.errorEmitter = createEvent(this, "qdsError", 6);
|
|
175
|
+
this.internals = this.attachInternals();
|
|
196
176
|
/**
|
|
197
177
|
* The name of a registered icon library.
|
|
198
178
|
*/
|
|
199
179
|
this.library = 'default';
|
|
200
180
|
this.svg = '';
|
|
201
|
-
_Icon_inheritedAttributes.set(this, {});
|
|
202
181
|
}
|
|
203
182
|
async setIcon() {
|
|
204
183
|
if (!this.name)
|
|
@@ -229,9 +208,6 @@ const Icon = /*@__PURE__*/ proxyCustomElement(class Icon extends H {
|
|
|
229
208
|
this.errorEmitter.emit();
|
|
230
209
|
}
|
|
231
210
|
else {
|
|
232
|
-
for (const [key, value] of Object.entries(__classPrivateFieldGet(this, _Icon_inheritedAttributes, "f")))
|
|
233
|
-
if (value !== undefined)
|
|
234
|
-
svgElement.setAttribute(key, value);
|
|
235
211
|
this.svg = svgElement.outerHTML;
|
|
236
212
|
this.loadEmitter.emit();
|
|
237
213
|
}
|
|
@@ -241,13 +217,12 @@ const Icon = /*@__PURE__*/ proxyCustomElement(class Icon extends H {
|
|
|
241
217
|
}
|
|
242
218
|
}
|
|
243
219
|
async componentWillLoad() {
|
|
244
|
-
|
|
220
|
+
this.internals.role = 'presentation';
|
|
245
221
|
await this.setIcon();
|
|
246
222
|
}
|
|
247
223
|
render() {
|
|
248
|
-
return (h("div", { key: '
|
|
224
|
+
return (h("div", { key: 'a572b557421a531b2247ff4bdfa3f739eddf04de', class: "qds-container", "aria-hidden": "true" }, h("span", { key: '61ffb82db95a3fc5703e5c5fa33af46281fad445', class: "qds-icon-wrapper", innerHTML: this.svg })));
|
|
249
225
|
}
|
|
250
|
-
get host() { return this; }
|
|
251
226
|
static get watchers() { return {
|
|
252
227
|
"name": ["setIcon"],
|
|
253
228
|
"library": ["setIcon"]
|
|
@@ -261,7 +236,6 @@ const Icon = /*@__PURE__*/ proxyCustomElement(class Icon extends H {
|
|
|
261
236
|
"name": ["setIcon"],
|
|
262
237
|
"library": ["setIcon"]
|
|
263
238
|
}]);
|
|
264
|
-
_Icon_inheritedAttributes = new WeakMap();
|
|
265
239
|
function defineCustomElement() {
|
|
266
240
|
if (typeof customElements === "undefined") {
|
|
267
241
|
return;
|
|
@@ -277,6 +251,6 @@ function defineCustomElement() {
|
|
|
277
251
|
}
|
|
278
252
|
|
|
279
253
|
export { Icon as I, defineCustomElement as d, registerIconLibrary as r, unregisterIconLibrary as u };
|
|
280
|
-
//# sourceMappingURL=p-
|
|
254
|
+
//# sourceMappingURL=p-C9R8N06B.js.map
|
|
281
255
|
|
|
282
|
-
//# sourceMappingURL=p-
|
|
256
|
+
//# sourceMappingURL=p-C9R8N06B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-C9R8N06B.js","mappings":";;;;;;;AAAA,MAAM,UAAU,GAAG,wZAAwZ;;ACA3a,MAAM,eAAe,GAAG,gXAAgX;;ACAxY,MAAM,QAAQ,GAAG,4eAA4e;;ACA7f,MAAM,YAAY,GAAG,oxBAAoxB;;ACAzyB,MAAM,WAAW,GAAG,wcAAwc;;ACA5d,MAAM,eAAe,GAAG,obAAob;;ACA5c,MAAM,gBAAgB,GAAG,4XAA4X;;ACArZ,MAAM,YAAY,GAAG,gvEAAgvE;;ACArwE,MAAM,qBAAqB,GAAG,gvEAAgvE;;ACA9wE,MAAM,aAAa,GAAG,4lBAA4lB;;ACAlnB,MAAM,aAAa,GAAG,4x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Gf,MAAM,GAAA;AACX,QAAA,QACE,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,eAAe,iBAAa,MAAM,EAAA,EAC3C,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,kBAAkB,EAAC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAA,CAAI,CAClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["clear","checked","checkedRadio","draggable","dropdown","externalLink","indeterminate","inputMonth","inputTel","inputWeek","inputUrl","inputTime","inputDate","inputDatetimeLocal","inputEmail","inputSearch","inputPasswordHide","inputPasswordShow","navigation","next","statusError","checkSolid","statusErrorSolid","statusWarningSolid","statusInfoSolid","toggleOff","toggleOn","defaultLibrary","__stencil_proxyCustomElement","HTMLElement"],"sources":["../../node_modules/@quartzds/generic-icons-core/dist/checked.svg","../../node_modules/@quartzds/generic-icons-core/dist/checked-radio.svg","../../node_modules/@quartzds/generic-icons-core/dist/clear.svg","../../node_modules/@quartzds/generic-icons-core/dist/draggable.svg","../../node_modules/@quartzds/generic-icons-core/dist/dropdown.svg","../../node_modules/@quartzds/generic-icons-core/dist/external-link.svg","../../node_modules/@quartzds/generic-icons-core/dist/indeterminate.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-date.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-datetime-local.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-email.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-month.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-password-hide.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-password-show.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-search.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-tel.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-time.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-url.svg","../../node_modules/@quartzds/generic-icons-core/dist/input-week.svg","../../node_modules/@quartzds/generic-icons-core/dist/navigation.svg","../../node_modules/@quartzds/generic-icons-core/dist/next.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-error.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-error-solid.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-info-solid.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-success-solid.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-warning-solid.svg","../../node_modules/@quartzds/generic-icons-core/dist/toggle-off.svg","../../node_modules/@quartzds/generic-icons-core/dist/toggle-on.svg","src/components/icon/core-library.ts","src/components/icon/default-library.ts","src/components/icon/library.ts","src/components/icon/request.ts","src/components/icon/icon.css?tag=qds-icon&encapsulation=shadow","src/components/icon/icon.tsx"],"sourcesContent":["<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"m12.111 3.5-5.918 9L3.89 9.024\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" d=\"M8 3C5.243 3 3 5.243 3 8s2.243 5 5 5 5-2.243 5-5-2.243-5-5-5Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M10.827 10.846 5.17 5.189m5.665-.027-5.657 5.657M8 .5a7.5 7.5 0 1 0 0 15 7.5 7.5 0 0 0 0-15Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 18 20\"><path fill=\"currentColor\" d=\"M4.96 0a2.148 2.148 0 1 1 0 4.297 2.148 2.148 0 0 1 0-4.296ZM2.812 17.852a2.149 2.149 0 1 0 4.298 0 2.149 2.149 0 0 0-4.298 0Zm0-7.851a2.149 2.149 0 1 0 4.298 0 2.149 2.149 0 0 0-4.298 0Zm10.079-7.852a2.149 2.149 0 1 0 4.297 0 2.149 2.149 0 0 0-4.297 0Zm0 15.703a2.149 2.149 0 1 0 4.297 0 2.149 2.149 0 0 0-4.297 0Zm0-7.851a2.149 2.149 0 1 0 4.297 0 2.149 2.149 0 0 0-4.297 0Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 17 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M15.707 4.443c-1.45 1.45-7.5 7.113-7.5 7.113s-6.05-5.663-7.5-7.113\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M10.5.5h5m0 0v5m0-5L9.696 6.305M8.5 3.5h-8v12h12v-8\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M3.5 8h9\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" d=\"M7.06 11.294q.285.38.284.939 0 .774-.568 1.232-.57.457-1.537.459-.552 0-1.062-.171a2.6 2.6 0 0 1-.866-.475.517.517 0 0 1-.089-.717.31.31 0 0 1 .251-.132q.084 0 .153.029t.187.098q.357.237.68.365c.225.087.464.13.705.127q.56 0 .833-.225t.272-.684q0-.45-.285-.667c-.285-.217-.483-.217-.879-.217h-.484a.37.37 0 0 1-.302-.132.47.47 0 0 1-.106-.301q0-.178.106-.306a.37.37 0 0 1 .302-.127h.339q1.164 0 1.164-.874 0-.41-.246-.628-.245-.22-.68-.221-.62 0-1.325.492a2 2 0 0 1-.187.098.4.4 0 0 1-.153.029.31.31 0 0 1-.251-.132.5.5 0 0 1-.106-.318.46.46 0 0 1 .047-.217c.047-.089.081-.12.149-.183q.357-.297.854-.471c.497-.174.669-.175 1.015-.175q.883 0 1.406.434.522.433.523 1.155c0 .307-.09.607-.259.862a1.43 1.43 0 0 1-.701.539q.534.136.82.514zm5.751 2.128q0 .45-.509.45H9.431q-.518 0-.518-.45 0-.434.518-.434h.883V9.115l-.815.501a.45.45 0 0 1-.213.068.37.37 0 0 1-.301-.153.53.53 0 0 1-.123-.34q0-.246.221-.382l1.317-.816a.96.96 0 0 1 .484-.153q.237 0 .382.145a.54.54 0 0 1 .144.399v4.603h.892q.51 0 .509.434z\"/><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M15.5 6.5H.5m6-4h5m-5 0v-.78C6.5 1.224 6.278.5 5.463.5h.021c-.755 0-.983.724-.983 1.22v1.324c0 .786.074 1.456 1.066 1.456h-.066m.999-2h-4l-.247.002A1.764 1.764 0 0 0 .5 4.267v9.469c0 .975.79 1.765 1.765 1.765h11.471c.975 0 1.765-.79 1.765-1.765V4.263c0-.973-.789-1.763-1.763-1.763h-1.237m.999 0h-2m0 0v-.78c0-.496-.222-1.22-1.037-1.22h.021c-.755 0-.983.724-.983 1.22v1.324c0 .786.074 1.456 1.066 1.456h-.066\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" d=\"M7.06 11.294q.285.38.284.939 0 .774-.568 1.232-.57.457-1.537.459-.552 0-1.062-.171a2.6 2.6 0 0 1-.866-.475.517.517 0 0 1-.089-.717.31.31 0 0 1 .251-.132q.084 0 .153.029t.187.098q.357.237.68.365c.225.087.464.13.705.127q.56 0 .833-.225t.272-.684q0-.45-.285-.667c-.285-.217-.483-.217-.879-.217h-.484a.37.37 0 0 1-.302-.132.47.47 0 0 1-.106-.301q0-.178.106-.306a.37.37 0 0 1 .302-.127h.339q1.164 0 1.164-.874 0-.41-.246-.628-.245-.22-.68-.221-.62 0-1.325.492a2 2 0 0 1-.187.098.4.4 0 0 1-.153.029.31.31 0 0 1-.251-.132.5.5 0 0 1-.106-.318.46.46 0 0 1 .047-.217c.047-.089.081-.12.149-.183q.357-.297.854-.471c.497-.174.669-.175 1.015-.175q.883 0 1.406.434.522.433.523 1.155c0 .307-.09.607-.259.862a1.43 1.43 0 0 1-.701.539q.534.136.82.514zm5.751 2.128q0 .45-.509.45H9.431q-.518 0-.518-.45 0-.434.518-.434h.883V9.115l-.815.501a.45.45 0 0 1-.213.068.37.37 0 0 1-.301-.153.53.53 0 0 1-.123-.34q0-.246.221-.382l1.317-.816a.96.96 0 0 1 .484-.153q.237 0 .382.145a.54.54 0 0 1 .144.399v4.603h.892q.51 0 .509.434z\"/><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M15.5 6.5H.5m6-4h5m-5 0v-.78C6.5 1.224 6.278.5 5.463.5h.021c-.755 0-.983.724-.983 1.22v1.324c0 .786.074 1.456 1.066 1.456h-.066m.999-2h-4l-.247.002A1.764 1.764 0 0 0 .5 4.267v9.469c0 .975.79 1.765 1.765 1.765h11.471c.975 0 1.765-.79 1.765-1.765V4.263c0-.973-.789-1.763-1.763-1.763h-1.237m.999 0h-2m0 0v-.78c0-.496-.222-1.22-1.037-1.22h.021c-.755 0-.983.724-.983 1.22v1.324c0 .786.074 1.456 1.066 1.456h-.066\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M15.369 3.137 7.99 8.5.734 2.734m14.635.403a1.2 1.2 0 0 0-1.06-.637H1.3a.8.8 0 0 0-.566.234m14.635.403L15.5 5.5v7.2a.8.8 0 0 1-.8.8H1.3a.8.8 0 0 1-.8-.8V3.3a.8.8 0 0 1 .234-.566\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M15.5 6.5H.5m6-4h5m-5 0v-.78C6.5 1.224 6.278.5 5.463.5h.021c-.755 0-.983.724-.983 1.22v1.324c0 .786.074 1.456 1.066 1.456h-.066m.999-2h-4l-.247.002A1.764 1.764 0 0 0 .5 4.267v9.469c0 .975.79 1.765 1.765 1.765h11.471c.975 0 1.765-.79 1.765-1.765V4.263c0-.973-.789-1.763-1.763-1.763h-1.237m.999 0h-2m0 0v-.78c0-.496-.222-1.22-1.037-1.22h.021c-.755 0-.983.724-.983 1.22v1.324c0 .786.074 1.456 1.066 1.456h-.066\"/><path fill=\"currentColor\" d=\"M3 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-9 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 17 17\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"m.707.707 15 15m0-6.646c-.365-.704-4.303-5.67-8.088-5.387C4.207 3.93 2.288 6.071.707 9.06c0 0 2.828 4.85 9.126 3.416 2.661-.606 3.477-2.397 5.874-3.415Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 17 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M15.572 8.854c-.365-.704-4.304-5.67-8.088-5.387C4.07 3.722 2.153 5.864.572 8.853c0 0 2.828 4.85 9.126 3.416 2.66-.606 3.477-2.397 5.874-3.415Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 17 17\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"m15.506 15.5-4.254-4.292m0 0a6.284 6.284 0 1 0-1.763 1.253c.755-.412 1.143-.684 1.763-1.253ZM6.565 2.849c-.99 0-1.923.386-2.624 1.087a3.68 3.68 0 0 0-1.047 2.102c-.047.34-.047.685-.003 1.024\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M12.5 13.933c0 .866-.702 1.567-1.567 1.567H5.068a1.567 1.567 0 0 1-1.567-1.567V2.062C3.501 1.199 4.2.5 5.063.5h5.876c.863 0 1.562.699 1.562 1.562z\"/><path fill=\"currentColor\" d=\"M8.5 2.5h-2Zm0 11h-1Z\"/><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M8.5 2.5h-2m2 11h-1\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M3.955 4.743 2.84 3.627m10.33-.025-1.611-1.608a2.29 2.29 0 0 1 3.94 1.582 2.3 2.3 0 0 1-.67 1.617l-.033.033-1.634-1.6-1.248 1.205m-7.296 8.362-1.374 1.769M8.262 1.2l-.217 1.607M8.262 1.2l1.037.183M8.262 1.2l-.918-.161m4.542 6.321L8.5 8.781v2.718m3.414-6.668a5.43 5.43 0 0 0-3.806-1.548A5.445 5.445 0 0 0 2.66 8.726a5.446 5.446 0 0 0 5.448 5.444 5.446 5.446 0 0 0 5.448-5.444c-.037-1.825-.357-2.65-1.642-3.895Zm-.32 8.362 1.374 1.769M4.437 1.994l-.032-.034A2.29 2.29 0 0 0 .5 3.576a2.28 2.28 0 0 0 .67 1.617l.034.033 1.609-1.609z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M7.95.5v14.987m0-14.988S3.64 4.525 3.64 8.96c0 3.294 4.308 6.528 4.308 6.528M7.948.5s4.338 4.027 4.338 8.46c0 3.295-4.338 6.528-4.338 6.528m0 0a7.5 7.5 0 0 1-5.117-2.075C1.452 12.094.602 10.205.5 8.3m7.45 7.187a7.494 7.494 0 0 0 7.534-6.975M.5 8.3C.5 5 2.08 3.027 3.63 1.912a7.494 7.494 0 0 1 11.854 6.6M.5 8.3c7.893 2.542 14.357.43 14.984.212\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M15.5 6.5H.5m6-4h5m-5 0v-.78C6.5 1.224 6.278.5 5.463.5h.021c-.755 0-.983.724-.983 1.22v1.324c0 .786.074 1.456 1.066 1.456h-.066m.999-2h-4l-.247.002A1.764 1.764 0 0 0 .5 4.267v9.469c0 .975.79 1.765 1.765 1.765h11.471c.975 0 1.765-.79 1.765-1.765V4.263c0-.973-.789-1.763-1.763-1.763h-1.237m.999 0h-2m0 0v-.78c0-.496-.222-1.22-1.037-1.22h.021c-.755 0-.983.724-.983 1.22v1.324c0 .786.074 1.456 1.066 1.456h-.066\"/><path fill=\"currentColor\" d=\"M3 12a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M4.443.5C5.893 1.95 11.556 8 11.556 8s-5.663 6.05-7.113 7.5\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M4.443.5C5.893 1.95 11.556 8 11.556 8s-5.663 6.05-7.113 7.5\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M10.827 10.846 5.17 5.189m5.665-.027-5.657 5.657M8 .5a7.5 7.5 0 1 0 0 15 7.5 7.5 0 0 0 0-15Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" d=\"M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm3.181 10.492a.5.5 0 1 1-.708.707L7.989 8.715l-2.457 2.458a.5.5 0 1 1-.708-.707l2.457-2.458-2.465-2.465a.5.5 0 0 1 .707-.707l2.465 2.465 2.492-2.493a.5.5 0 0 1 .707.707L8.695 8.007l2.484 2.484z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" d=\"M8 0C3.589 0 0 3.589 0 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8Zm.923 12.064q0 .44-.221.689-.22.248-.648.248-.414 0-.634-.248-.22-.25-.221-.689V7.003q0-.456.221-.696.22-.242.634-.242c.414 0 .49.081.641.242q.228.242.228.696zm-.11-7.522q-.262.24-.758.241-.483 0-.751-.241-.27-.242-.269-.668 0-.441.269-.676c.269-.235.43-.234.751-.234q.495 0 .758.234c.262.234.263.382.263.676q0 .428-.263.668Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" d=\"M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm3.341 5.1-4.208 6.399a.5.5 0 0 1-.882-.089c-.312-.778-.953-1.979-1.403-2.213a.5.5 0 1 1 .459-.888c.602.311 1.141 1.193 1.489 1.883l3.709-5.642a.5.5 0 1 1 .836.55Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" d=\"M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm-.724 3.142q.273-.323.803-.323.515 0 .782.323.264.323.222.853l-.43 5.479q-.014.315-.165.487a.52.52 0 0 1-.409.172.53.53 0 0 1-.423-.172q-.15-.172-.179-.487l-.43-5.479q-.045-.53.229-.853Zm1.585 9.672q-.28.3-.782.301-.487 0-.781-.301-.294-.302-.294-.774 0-.459.294-.753.294-.293.781-.294.501 0 .782.294.28.294.28.753 0 .473-.28.774Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M8 3.5a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"square\" stroke-miterlimit=\"16\" d=\"M8 3.5v9\"/></svg>","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport checked from '@quartzds/generic-icons-core/checked.svg'\nimport checkedRadio from '@quartzds/generic-icons-core/checked-radio.svg'\nimport clear from '@quartzds/generic-icons-core/clear.svg'\nimport draggable from '@quartzds/generic-icons-core/draggable.svg'\nimport dropdown from '@quartzds/generic-icons-core/dropdown.svg'\nimport externalLink from '@quartzds/generic-icons-core/external-link.svg'\nimport indeterminate from '@quartzds/generic-icons-core/indeterminate.svg'\nimport inputDate from '@quartzds/generic-icons-core/input-date.svg'\nimport inputDatetimeLocal from '@quartzds/generic-icons-core/input-datetime-local.svg'\nimport inputEmail from '@quartzds/generic-icons-core/input-email.svg'\nimport inputMonth from '@quartzds/generic-icons-core/input-month.svg'\nimport inputPasswordHide from '@quartzds/generic-icons-core/input-password-hide.svg'\nimport inputPasswordShow from '@quartzds/generic-icons-core/input-password-show.svg'\nimport inputSearch from '@quartzds/generic-icons-core/input-search.svg'\nimport inputTel from '@quartzds/generic-icons-core/input-tel.svg'\nimport inputTime from '@quartzds/generic-icons-core/input-time.svg'\nimport inputUrl from '@quartzds/generic-icons-core/input-url.svg'\nimport inputWeek from '@quartzds/generic-icons-core/input-week.svg'\nimport navigation from '@quartzds/generic-icons-core/navigation.svg'\nimport next from '@quartzds/generic-icons-core/next.svg'\nimport statusError from '@quartzds/generic-icons-core/status-error.svg'\nimport statusErrorSolid from '@quartzds/generic-icons-core/status-error-solid.svg'\nimport statusInfoSolid from '@quartzds/generic-icons-core/status-info-solid.svg'\nimport checkSolid from '@quartzds/generic-icons-core/status-success-solid.svg'\nimport statusWarningSolid from '@quartzds/generic-icons-core/status-warning-solid.svg'\nimport toggleOff from '@quartzds/generic-icons-core/toggle-off.svg'\nimport toggleOn from '@quartzds/generic-icons-core/toggle-on.svg'\n\nimport type { IconLibrary } from './library'\n\nconst icons: Record<string, string | undefined> = {\n /* eslint-disable @typescript-eslint/naming-convention */\n clear,\n checked,\n 'checked-radio': checkedRadio,\n draggable,\n dropdown,\n 'external-link': externalLink,\n 'external-new-tab-link': externalLink,\n indeterminate,\n 'input-month': inputMonth,\n 'input-tel': inputTel,\n 'input-week': inputWeek,\n 'input-url': inputUrl,\n 'input-time': inputTime,\n 'input-date': inputDate,\n 'input-datetime-local': inputDatetimeLocal,\n 'input-email': inputEmail,\n 'input-search': inputSearch,\n 'input-password-hide': inputPasswordHide,\n 'input-password-show': inputPasswordShow,\n navigation,\n next,\n close: statusError,\n 'status-success-solid': checkSolid,\n 'status-error-solid': statusErrorSolid,\n 'status-warning-solid': statusWarningSolid,\n 'status-info-solid': statusInfoSolid,\n 'toggle-off': toggleOff,\n 'toggle-on': toggleOn,\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nconst coreLibrary: IconLibrary = {\n name: 'core',\n resolver: (name) => icons[name] ?? '',\n}\n\nexport default coreLibrary\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getAssetPath } from '@stencil/core'\n\nimport type { IconLibrary } from './library'\n\nconst library: IconLibrary = {\n name: 'default',\n resolver: (name) => getAssetPath(`/icons/${name}.svg`),\n}\n\nexport default library\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Except } from 'type-fest'\n\nimport coreLibrary from './core-library'\nimport defaultLibrary from './default-library'\n\nexport type IconLibraryResolver = (name: string) => string\nexport interface IconLibrary {\n name: string\n resolver: IconLibraryResolver\n}\n\nlet registry: IconLibrary[] = [defaultLibrary, coreLibrary]\n\n/**\n * Returns a library from the registry.\n */\nexport const getIconLibrary = (name: string): IconLibrary | undefined =>\n registry.find((library) => library.name === name)\n\n/**\n * Removes an icon library from the registry.\n */\nexport const unregisterIconLibrary = (name: string): void => {\n registry = registry.filter((library) => library.name !== name)\n}\n\n/**\n * Adds an icon library to the registry or overrides an existing one.\n */\nexport const registerIconLibrary = (\n name: string,\n options: Except<IconLibrary, 'name'>,\n): void => {\n unregisterIconLibrary(name)\n registry.push({\n name,\n ...options,\n })\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\ninterface IconResponse {\n ok: boolean\n status: number\n data: string\n}\n\nconst cachedIconRequests = new Map<\n string,\n IconResponse | Promise<IconResponse>\n>()\n\nconst requestIcon = (url: string): Promise<IconResponse> => {\n const cachedIconRequest = cachedIconRequests.get(url)\n if (cachedIconRequest) return Promise.resolve(cachedIconRequest)\n\n const iconPromise = fetch(url, { mode: 'cors' }).then(async (response) => {\n const iconResponse: IconResponse = {\n ok: response.ok,\n status: response.status,\n data: await response.text(),\n }\n if (response.ok) {\n const div = document.createElement('div')\n div.innerHTML = iconResponse.data\n const child = div.firstElementChild\n iconResponse.data =\n child?.tagName.toLowerCase() === 'svg' ? child.outerHTML : ''\n }\n\n cachedIconRequests.set(url, iconResponse)\n return iconResponse\n })\n cachedIconRequests.set(url, iconPromise)\n return iconPromise\n}\n\nexport default requestIcon\n","/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n height: 1em;\n width: 1em;\n}\n\n.qds-container {\n position: relative;\n}\n\n.qds-icon-wrapper {\n display: contents;\n}\n\nsvg {\n display: block;\n fill: currentcolor;\n height: 100%;\n width: 100%;\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Event,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport { getIconLibrary } from './library'\nimport requestIcon from './request'\n\nlet parser: DOMParser | undefined\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-icon',\n shadow: true,\n styleUrl: 'icon.css',\n})\nexport class Icon implements ComponentInterface {\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly name!: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly library: string = 'default'\n\n /**\n * Emitted when the icon has loaded.\n */\n @Event({ eventName: 'qdsLoad', cancelable: false })\n private readonly loadEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the icon fails to load due to an error.\n */\n @Event({ eventName: 'qdsError', cancelable: false })\n private readonly errorEmitter!: EventEmitter<void>\n\n @State() private svg = ''\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n @Watch('name')\n @Watch('library')\n private async setIcon(): Promise<void> {\n if (!this.name) return\n\n const library = getIconLibrary(this.library)\n if (!library) return\n\n const url = library.resolver(this.name)\n if (!url) {\n this.svg = ''\n return\n }\n\n try {\n const request = await requestIcon(url)\n if (!request.ok) {\n this.svg = ''\n this.errorEmitter.emit()\n return\n }\n\n // Create an instance of the DOM parser. We do it here instead of at the\n // top-level to support SSR while maintaining a single parser instance\n // for optimal performance.\n parser ||= new DOMParser()\n const document = parser.parseFromString(request.data, 'text/html')\n const svgElement = document.body.querySelector('svg')\n if (svgElement === null) {\n this.svg = ''\n this.errorEmitter.emit()\n } else {\n this.svg = svgElement.outerHTML\n this.loadEmitter.emit()\n }\n } catch {\n this.errorEmitter.emit()\n }\n }\n\n public async componentWillLoad(): Promise<void> {\n this.internals.role = 'presentation'\n\n await this.setIcon()\n }\n\n public render() {\n return (\n <div class=\"qds-container\" aria-hidden=\"true\">\n <span class=\"qds-icon-wrapper\" innerHTML={this.svg} />\n </div>\n )\n }\n}\n"],"version":3}
|