@quartzds/core 1.0.0-beta.92 → 1.0.0-beta.94
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/components/index.js +1 -1
- package/components/{p-e2a9e441.js → p-056195cc.js} +2 -2
- package/components/{p-e2a9e441.js.map → p-056195cc.js.map} +1 -1
- package/components/{p-ba860c62.js → p-0f913a5b.js} +2 -2
- package/components/{p-ba860c62.js.map → p-0f913a5b.js.map} +1 -1
- package/components/{p-a529eb5c.js → p-251cd601.js} +3 -3
- package/components/{p-a529eb5c.js.map → p-251cd601.js.map} +1 -1
- package/components/{p-9ffb4b49.js → p-3b3e9e52.js} +4 -4
- package/components/{p-9ffb4b49.js.map → p-3b3e9e52.js.map} +1 -1
- package/components/{p-72c09714.js → p-8e8bd915.js} +2 -2
- package/components/{p-72c09714.js.map → p-8e8bd915.js.map} +1 -1
- package/components/{p-b6c04008.js → p-95e5ad61.js} +3 -3
- package/components/{p-b6c04008.js.map → p-95e5ad61.js.map} +1 -1
- package/components/{p-b5608061.js → p-fff94876.js} +3 -3
- package/components/{p-b5608061.js.map → p-fff94876.js.map} +1 -1
- package/components/qds-button.js +1 -1
- package/components/qds-checkbox.js +1 -1
- package/components/qds-chip.js +1 -1
- package/components/qds-dialog.js +17 -5
- package/components/qds-dialog.js.map +1 -1
- package/components/qds-divider.js +1 -1
- package/components/qds-dropdown.js +2 -2
- package/components/qds-form-message.js +3 -3
- package/components/qds-icon.js +1 -1
- package/components/qds-inline-link.js +3 -3
- package/components/qds-input.js +16 -10
- package/components/qds-input.js.map +1 -1
- package/components/qds-label.js +1 -1
- package/components/qds-list-item.js +3 -3
- package/components/qds-loader.js +2 -2
- package/components/qds-nav-list-item.js +4 -4
- package/components/qds-progress-bar.js +2 -2
- package/components/qds-radio.js +4 -4
- package/components/qds-select.js +2 -2
- package/components/qds-standalone-link.js +3 -3
- package/components/qds-switch.js +3 -3
- package/components/qds-tab.js +3 -3
- package/components/qds-tabbar.js +3 -3
- package/components/qds-table-body.js +1 -1
- package/components/qds-table-cell.js +1 -1
- package/components/qds-table-head.js +1 -1
- package/components/qds-table-row.js +1 -1
- package/components/qds-table.js +1 -1
- package/components/qds-tag.js +1 -1
- package/components/qds-title.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qds-button.cjs.entry.js +1 -1
- package/dist/cjs/qds-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/qds-dialog.cjs.entry.js +14 -4
- package/dist/cjs/qds-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-divider.cjs.entry.js +1 -1
- package/dist/cjs/qds-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/qds-form-message.cjs.entry.js +2 -2
- package/dist/cjs/qds-icon.cjs.entry.js +1 -1
- package/dist/cjs/qds-inline-link.cjs.entry.js +2 -2
- package/dist/cjs/qds-input.cjs.entry.js +14 -8
- package/dist/cjs/qds-input.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-label.cjs.entry.js +2 -2
- package/dist/cjs/qds-loader.cjs.entry.js +1 -1
- package/dist/cjs/qds-nav-list-item.cjs.entry.js +3 -3
- package/dist/cjs/qds-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/qds-radio.cjs.entry.js +2 -2
- package/dist/cjs/qds-select.cjs.entry.js +1 -1
- package/dist/cjs/qds-standalone-link.cjs.entry.js +2 -2
- package/dist/cjs/qds-switch.cjs.entry.js +3 -3
- package/dist/cjs/qds-table-body.cjs.entry.js +1 -1
- package/dist/cjs/qds-table-cell.cjs.entry.js +1 -1
- package/dist/cjs/qds-table-head.cjs.entry.js +1 -1
- package/dist/cjs/qds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/qds-table.cjs.entry.js +1 -1
- package/dist/cjs/qds-tag_2.cjs.entry.js +1 -1
- package/dist/cjs/qds.cjs.js +1 -1
- package/dist/custom-elements.json +36 -0
- package/dist/docs.json +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qds-button.entry.js +1 -1
- package/dist/esm/qds-checkbox.entry.js +1 -1
- package/dist/esm/qds-dialog.entry.js +14 -4
- package/dist/esm/qds-dialog.entry.js.map +1 -1
- package/dist/esm/qds-divider.entry.js +1 -1
- package/dist/esm/qds-dropdown.entry.js +2 -2
- package/dist/esm/qds-form-message.entry.js +2 -2
- package/dist/esm/qds-icon.entry.js +1 -1
- package/dist/esm/qds-inline-link.entry.js +2 -2
- package/dist/esm/qds-input.entry.js +14 -8
- package/dist/esm/qds-input.entry.js.map +1 -1
- package/dist/esm/qds-label.entry.js +2 -2
- package/dist/esm/qds-loader.entry.js +1 -1
- package/dist/esm/qds-nav-list-item.entry.js +3 -3
- package/dist/esm/qds-progress-bar.entry.js +2 -2
- package/dist/esm/qds-radio.entry.js +2 -2
- package/dist/esm/qds-select.entry.js +1 -1
- package/dist/esm/qds-standalone-link.entry.js +2 -2
- package/dist/esm/qds-switch.entry.js +3 -3
- package/dist/esm/qds-table-body.entry.js +1 -1
- package/dist/esm/qds-table-cell.entry.js +1 -1
- package/dist/esm/qds-table-head.entry.js +1 -1
- package/dist/esm/qds-table-row.entry.js +1 -1
- package/dist/esm/qds-table.entry.js +1 -1
- package/dist/esm/qds-tag_2.entry.js +1 -1
- package/dist/esm/qds.js +1 -1
- package/dist/types/components/dialog/dialog.d.ts +3 -0
- package/hydrate/index.js +63 -45
- package/hydrate/index.mjs +63 -45
- package/package.json +1 -1
package/components/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-50f85f75.js';
|
|
7
|
-
export { r as registerIconLibrary, u as unregisterIconLibrary } from './p-
|
|
7
|
+
export { r as registerIconLibrary, u as unregisterIconLibrary } from './p-8e8bd915.js';
|
|
8
8
|
export { QdsBadgeCounter, defineCustomElement as defineCustomElementQdsBadgeCounter } from './qds-badge-counter.js';
|
|
9
9
|
export { QdsBadgeIndicator, defineCustomElement as defineCustomElementQdsBadgeIndicator } from './qds-badge-indicator.js';
|
|
10
10
|
export { QdsBreadcrumbItem, defineCustomElement as defineCustomElementQdsBreadcrumbItem } from './qds-breadcrumb-item.js';
|
|
@@ -46,7 +46,7 @@ const Divider = /*@__PURE__*/ proxyCustomElement(class Divider extends H {
|
|
|
46
46
|
this.verticalChanged();
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
|
-
return (h("hr", { key: '
|
|
49
|
+
return (h("hr", { key: '805394b1a2a1124bfd62a588afcb0b352f2e135e', class: {
|
|
50
50
|
'qds-divider': true,
|
|
51
51
|
'qds-vertical': this.vertical,
|
|
52
52
|
}, "aria-hidden": "true", "data-importance": __classPrivateFieldGet(this, _Divider_instances, "a", _Divider_computedImportance_get) }));
|
|
@@ -88,4 +88,4 @@ function defineCustomElement() {
|
|
|
88
88
|
|
|
89
89
|
export { Divider as D, defineCustomElement as d };
|
|
90
90
|
|
|
91
|
-
//# sourceMappingURL=p-
|
|
91
|
+
//# sourceMappingURL=p-056195cc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-056195cc.js","mappings":";;;;;;;;AAAA,MAAM,UAAU,GAAG,6bAA6b,CAAC;AACjd,yBAAe,UAAU;;ACDzB;AACA;AACA;;;;;;;;;MAsBa,OAAO;IALpB;;;;;;;;QAS0B,eAAU,GAAgB,UAAU,CAAA;;;;QAKpC,aAAQ,GAAY,KAAK,CAAA;;QAGxC,6BAA+B,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAA;KAsCnE;IAvBW,eAAe;QACvB,uBAAA,IAAI,0BAAW,CAAC,eAAe,GAAG,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAA;KAC5E;IAEM,iBAAiB;QACtB,uBAAA,IAAI,0BAAW,CAAC,IAAI,GAAG,WAAW,CAAA;QAClC,uBAAA,IAAI,0BAAW,CAAC,UAAU,GAAG,MAAM,CAAA;QAEnC,IAAI,CAAC,eAAe,EAAE,CAAA;KACvB;IAEM,MAAM;QACX,QACE,2DACE,KAAK,EAAE;gBACL,aAAa,EAAE,IAAI;gBACnB,cAAc,EAAE,IAAI,CAAC,QAAQ;aAC9B,iBACW,MAAM,qBACD,uBAAA,IAAI,2DAAoB,GACzC,EACH;KACF;;;;;;;;;;;;IAlCC,QAAQ,IAAI,CAAC,UAAU;QACrB,KAAK,YAAY,CAAC;QAClB,KAAK,SAAS,EAAE;YACd,OAAO,IAAI,CAAC,UAAU,CAAA;SACvB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/divider/divider.css?tag=qds-divider&encapsulation=shadow","src/components/divider/divider.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-divider {\n border: none;\n height: var(--qds-control-border-width);\n margin: 0;\n width: 100%;\n}\n\n.qds-vertical {\n height: 100%;\n width: var(--qds-control-border-width);\n}\n\n[data-importance='standard'] {\n background-color: var(--qds-theme-divider-standard);\n}\n\n[data-importance='emphasized'] {\n background-color: var(--qds-theme-divider-emphasized);\n}\n\n[data-importance='subdued'] {\n background-color: var(--qds-theme-divider-subdued);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, h, Prop, Watch } from '@stencil/core'\n\nimport { attachInternals } from '../../helpers'\nimport type { Importance } from '../shared'\n\n/**\n * The `<qds-divider>` element a thematic break between paragraph-level\n * elements: for example, a change of scene in a story, or a shift of topic\n * within a section.\n *\n * Dividers can also be used to group menu items in `<qds-dropdown>` elements.\n *\n * @see https://quartz.se.com/build/components/divider\n */\n@Component({\n tag: 'qds-divider',\n shadow: true,\n styleUrl: 'divider.css',\n})\nexport class Divider implements ComponentInterface {\n /**\n * The divider's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * Display the divider in vertical orientation.\n */\n @Prop() public readonly vertical: boolean = false\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n readonly #internals: ElementInternals = attachInternals.call(this)\n\n get #computedImportance(): Importance {\n switch (this.importance) {\n case 'emphasized':\n case 'subdued': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Watch('vertical')\n protected verticalChanged(): void {\n this.#internals.ariaOrientation = this.vertical ? 'vertical' : 'horizontal'\n }\n\n public componentWillLoad(): void {\n this.#internals.role = 'separator'\n this.#internals.ariaHidden = 'true'\n\n this.verticalChanged()\n }\n\n public render() {\n return (\n <hr\n class={{\n 'qds-divider': true,\n 'qds-vertical': this.vertical,\n }}\n aria-hidden=\"true\"\n data-importance={this.#computedImportance}\n />\n )\n }\n}\n"],"version":3}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { p as proxyCustomElement, H, h, F as Fragment } from './p-50f85f75.js';
|
|
7
7
|
import { i as inheritAriaAttributes } from './p-8abba29b.js';
|
|
8
8
|
import { d as defineCustomElement$2 } from './p-5570cc30.js';
|
|
9
|
-
import { d as defineCustomElement$1 } from './p-
|
|
9
|
+
import { d as defineCustomElement$1 } from './p-8e8bd915.js';
|
|
10
10
|
|
|
11
11
|
const tagCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-tag{align-items:center;border-radius:var(--qds-control-rounded-border-radius);box-sizing:border-box;display:inline-flex;justify-content:center;max-width:inherit;min-width:inherit;width:inherit}.qds-text{text-overflow:ellipsis}.qds-sr-only,.qds-text{overflow:hidden;white-space:nowrap}.qds-sr-only{clip:rect(0 0 0 0);height:1px;margin:-1px;padding:0;position:absolute;width:1px}.qds-icon{flex-shrink:0}[data-status=error]{color:var(--qds-theme-feedback-message-critical)}[data-status=success]{color:var(--qds-theme-feedback-message-success)}[data-status=warning]{color:var(--qds-theme-feedback-message-important)}[data-status=info]{color:var(--qds-theme-feedback-message-informational)}[data-status=neutral]{color:var(--qds-theme-feedback-message-neutral)}[data-importance=subdued] .qds-text{color:var(--qds-theme-control-text-standard)}[data-importance=standard][data-status=error]{background-color:var(--qds-theme-feedback-message-critical-dimmed)}[data-importance=standard][data-status=success]{background-color:var(--qds-theme-feedback-message-success-dimmed)}[data-importance=standard][data-status=warning]{background-color:var(--qds-theme-feedback-message-important-dimmed)}[data-importance=standard][data-status=info]{background-color:var(--qds-theme-feedback-message-informational-dimmed)}[data-importance=standard][data-status=neutral]{background-color:var(--qds-theme-feedback-message-neutral-dimmed)}[data-importance=emphasized][data-status=error]{background-color:var(--qds-theme-feedback-message-critical);color:var(--qds-theme-feedback-message-critical-contrast)}[data-importance=emphasized][data-status=success]{background-color:var(--qds-theme-feedback-message-success);color:var(--qds-theme-feedback-message-success-contrast)}[data-importance=emphasized][data-status=warning]{background-color:var(--qds-theme-feedback-message-important);color:var(--qds-theme-feedback-message-important-contrast)}[data-importance=emphasized][data-status=info]{background-color:var(--qds-theme-feedback-message-informational);color:var(--qds-theme-feedback-message-informational-contrast)}[data-importance=emphasized][data-status=neutral]{background-color:var(--qds-theme-feedback-message-neutral);color:var(--qds-theme-feedback-message-neutral-contrast)}.qds-tag[data-size=small]{font:var(--qds-control-small-text);gap:var(--qds-control-small-gap-internal);height:var(--qds-control-small-height)}.qds-padding[data-size=small]{padding-inline:var(--qds-control-chip-small-padding-horizontal)}.qds-icon[data-size=small]{height:var(--qds-control-small-icon-size);width:var(--qds-control-small-icon-size)}.qds-tag[data-size=standard]{font:var(--qds-control-standard-text);gap:var(--qds-control-standard-gap-internal);height:var(--qds-control-standard-height)}.qds-padding[data-size=standard]{padding-inline:var(--qds-control-chip-standard-padding-horizontal)}.qds-icon[data-size=standard]{height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}.qds-tag[data-size=large]{font:var(--qds-control-large-text);gap:var(--qds-control-large-gap-internal);height:var(--qds-control-large-height)}.qds-padding[data-size=large]{padding-inline:var(--qds-control-chip-large-padding-horizontal)}.qds-icon[data-size=large]{height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}";
|
|
12
12
|
const QdsTagStyle0 = tagCss;
|
|
@@ -144,4 +144,4 @@ function defineCustomElement() {
|
|
|
144
144
|
|
|
145
145
|
export { Tag as T, defineCustomElement as d };
|
|
146
146
|
|
|
147
|
-
//# sourceMappingURL=p-
|
|
147
|
+
//# sourceMappingURL=p-0f913a5b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-ba860c62.js","mappings":";;;;;;;;;;AAAA,MAAM,MAAM,GAAG,+zGAA+zG,CAAC;AAC/0G,qBAAe,MAAM;;ACDrB;AACA;AACA;;;;;;;;;;;;;;;;;;MAsBa,GAAG;IALhB;;;;;;;;QAgB0B,gBAAW,GAAW,SAAS,CAAA;;;;QAK/B,eAAU,GAAgB,UAAU,CAAA;;;;QAKpC,WAAM,GAAe,SAAS,CAAA;;;;QAK9B,SAAI,GAAU,UAAU,CAAA;;;;QAexB,UAAK,GAAa,KAAK,CAAA;QAU/C,mCAAmC,EAAE,EAAA;KA0FtC;IA7CQ,iBAAiB;QACtB,uBAAA,IAAI,4BAAwB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAA,CAAA;KAC7D;IAEM,MAAM;QACX,QACE,6DACE,KAAK,EAAE;gBACL,SAAS,EAAE,IAAI;gBACf,aAAa,EAAE,IAAI,CAAC,UAAU,KAAK,SAAS;aAC7C,qBACgB,uBAAA,IAAI,mDAAoB,eAC9B,uBAAA,IAAI,6CAAc,iBAChB,uBAAA,IAAI,+CAAgB,KAE7B,uBAAA,IAAI,gCAAqB,IAE5B,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,IAClD,kBACG,IAAI,CAAC,eAAe,KAAK,SAAS;YACjC,IAAI,C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;;;;;;;;;","names":[],"sources":["src/components/tag/tag.css?tag=qds-tag&encapsulation=shadow","src/components/tag/tag.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: inline-block;\n}\n\n.qds-tag {\n align-items: center;\n border-radius: var(--qds-control-rounded-border-radius);\n box-sizing: border-box;\n display: inline-flex;\n justify-content: center;\n max-width: inherit;\n min-width: inherit;\n width: inherit;\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n[data-status='error'] {\n color: var(--qds-theme-feedback-message-critical);\n}\n\n[data-status='success'] {\n color: var(--qds-theme-feedback-message-success);\n}\n\n[data-status='warning'] {\n color: var(--qds-theme-feedback-message-important);\n}\n\n[data-status='info'] {\n color: var(--qds-theme-feedback-message-informational);\n}\n\n[data-status='neutral'] {\n color: var(--qds-theme-feedback-message-neutral);\n}\n\n[data-importance='subdued'] .qds-text {\n color: var(--qds-theme-control-text-standard);\n}\n\n[data-importance='standard'] {\n &[data-status='error'] {\n background-color: var(--qds-theme-feedback-message-critical-dimmed);\n }\n\n &[data-status='success'] {\n background-color: var(--qds-theme-feedback-message-success-dimmed);\n }\n\n &[data-status='warning'] {\n background-color: var(--qds-theme-feedback-message-important-dimmed);\n }\n\n &[data-status='info'] {\n background-color: var(--qds-theme-feedback-message-informational-dimmed);\n }\n\n &[data-status='neutral'] {\n background-color: var(--qds-theme-feedback-message-neutral-dimmed);\n }\n}\n\n[data-importance='emphasized'] {\n &[data-status='error'] {\n background-color: var(--qds-theme-feedback-message-critical);\n color: var(--qds-theme-feedback-message-critical-contrast);\n }\n\n &[data-status='success'] {\n background-color: var(--qds-theme-feedback-message-success);\n color: var(--qds-theme-feedback-message-success-contrast);\n }\n\n &[data-status='warning'] {\n background-color: var(--qds-theme-feedback-message-important);\n color: var(--qds-theme-feedback-message-important-contrast);\n }\n\n &[data-status='info'] {\n background-color: var(--qds-theme-feedback-message-informational);\n color: var(--qds-theme-feedback-message-informational-contrast);\n }\n\n &[data-status='neutral'] {\n background-color: var(--qds-theme-feedback-message-neutral);\n color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n}\n\n[data-size='small'] {\n &.qds-tag {\n font: var(--qds-control-small-text);\n gap: var(--qds-control-small-gap-internal);\n height: var(--qds-control-small-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-control-chip-small-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-control-small-icon-size);\n height: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &.qds-tag {\n font: var(--qds-control-standard-text);\n gap: var(--qds-control-standard-gap-internal);\n height: var(--qds-control-standard-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-control-chip-standard-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-control-standard-icon-size);\n height: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &.qds-tag {\n font: var(--qds-control-large-text);\n gap: var(--qds-control-large-gap-internal);\n height: var(--qds-control-large-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-control-chip-large-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-control-large-icon-size);\n height: var(--qds-control-large-icon-size);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, Element, Fragment, h, Prop } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport type { Importance, Size, Status } from '../shared'\n\nexport type TagStatus = Status | 'neutral'\n\n/**\n * The `<qds-tag>` element is a static descriptor used for items that need to\n * be labeled, categorized, or organized using keywords that describe them.\n *\n * @see https://quartz.se.com/build/components/tag\n */\n@Component({\n tag: 'qds-tag',\n shadow: true,\n styleUrl: 'tag.css',\n})\nexport class Tag 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 iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The tag's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * The tag's status.\n */\n @Prop() public readonly status?: TagStatus = 'neutral'\n\n /**\n * The tag's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The tag's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * Provides a text description of the icon for screen readers.\n */\n @Prop() public readonly iconDescription?: string\n\n /**\n * Displays an indicator if `true`.\n */\n @Prop() public readonly badge?: boolean = false\n\n /**\n * The indicator badge's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly badgeDescription?: string\n\n @Element() private readonly host!: HTMLElement\n\n #inheritedAttributes: Attributes = {}\n\n get #computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedStatus(): TagStatus {\n switch (this.status) {\n case 'error':\n case 'info':\n case 'success':\n case 'warning': {\n return this.status\n }\n default: {\n return 'neutral'\n }\n }\n }\n\n get #hasBadge(): boolean {\n return (this.badge ?? false) && this.importance !== 'emphasized'\n }\n\n public componentWillLoad(): void {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-tag': true,\n 'qds-padding': this.importance !== 'subdued',\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n data-status={this.#computedStatus}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n >\n {this.iconName !== undefined && this.iconName !== '' ? (\n <>\n {this.iconDescription !== undefined &&\n this.iconDescription !== '' && (\n <span class=\"qds-sr-only\">{this.iconDescription}</span>\n )}\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n </>\n ) : (\n this.#hasBadge && (\n <qds-badge-indicator\n status={this.#computedStatus}\n description={this.badgeDescription}\n size={this.#computedSize}\n strokeRing\n />\n )\n )}\n <span class=\"qds-text\">{this.text}</span>\n </span>\n )\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-0f913a5b.js","mappings":";;;;;;;;;;AAAA,MAAM,MAAM,GAAG,+zGAA+zG,CAAC;AAC/0G,qBAAe,MAAM;;ACDrB;AACA;AACA;;;;;;;;;;;;;;;;;;MAsBa,GAAG;IALhB;;;;;;;;QAgB0B,gBAAW,GAAW,SAAS,CAAA;;;;QAK/B,eAAU,GAAgB,UAAU,CAAA;;;;QAKpC,WAAM,GAAe,SAAS,CAAA;;;;QAK9B,SAAI,GAAU,UAAU,CAAA;;;;QAexB,UAAK,GAAa,KAAK,CAAA;QAU/C,mCAAmC,EAAE,EAAA;KA0FtC;IA7CQ,iBAAiB;QACtB,uBAAA,IAAI,4BAAwB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAA,CAAA;KAC7D;IAEM,MAAM;QACX,QACE,6DACE,KAAK,EAAE;gBACL,SAAS,EAAE,IAAI;gBACf,aAAa,EAAE,IAAI,CAAC,UAAU,KAAK,SAAS;aAC7C,qBACgB,uBAAA,IAAI,mDAAoB,eAC9B,uBAAA,IAAI,6CAAc,iBAChB,uBAAA,IAAI,+CAAgB,KAE7B,uBAAA,IAAI,gCAAqB,IAE5B,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,IAClD,kBACG,IAAI,C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AA;AAClE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/tag/tag.css?tag=qds-tag&encapsulation=shadow","src/components/tag/tag.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: inline-block;\n}\n\n.qds-tag {\n align-items: center;\n border-radius: var(--qds-control-rounded-border-radius);\n box-sizing: border-box;\n display: inline-flex;\n justify-content: center;\n max-width: inherit;\n min-width: inherit;\n width: inherit;\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n[data-status='error'] {\n color: var(--qds-theme-feedback-message-critical);\n}\n\n[data-status='success'] {\n color: var(--qds-theme-feedback-message-success);\n}\n\n[data-status='warning'] {\n color: var(--qds-theme-feedback-message-important);\n}\n\n[data-status='info'] {\n color: var(--qds-theme-feedback-message-informational);\n}\n\n[data-status='neutral'] {\n color: var(--qds-theme-feedback-message-neutral);\n}\n\n[data-importance='subdued'] .qds-text {\n color: var(--qds-theme-control-text-standard);\n}\n\n[data-importance='standard'] {\n &[data-status='error'] {\n background-color: var(--qds-theme-feedback-message-critical-dimmed);\n }\n\n &[data-status='success'] {\n background-color: var(--qds-theme-feedback-message-success-dimmed);\n }\n\n &[data-status='warning'] {\n background-color: var(--qds-theme-feedback-message-important-dimmed);\n }\n\n &[data-status='info'] {\n background-color: var(--qds-theme-feedback-message-informational-dimmed);\n }\n\n &[data-status='neutral'] {\n background-color: var(--qds-theme-feedback-message-neutral-dimmed);\n }\n}\n\n[data-importance='emphasized'] {\n &[data-status='error'] {\n background-color: var(--qds-theme-feedback-message-critical);\n color: var(--qds-theme-feedback-message-critical-contrast);\n }\n\n &[data-status='success'] {\n background-color: var(--qds-theme-feedback-message-success);\n color: var(--qds-theme-feedback-message-success-contrast);\n }\n\n &[data-status='warning'] {\n background-color: var(--qds-theme-feedback-message-important);\n color: var(--qds-theme-feedback-message-important-contrast);\n }\n\n &[data-status='info'] {\n background-color: var(--qds-theme-feedback-message-informational);\n color: var(--qds-theme-feedback-message-informational-contrast);\n }\n\n &[data-status='neutral'] {\n background-color: var(--qds-theme-feedback-message-neutral);\n color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n}\n\n[data-size='small'] {\n &.qds-tag {\n font: var(--qds-control-small-text);\n gap: var(--qds-control-small-gap-internal);\n height: var(--qds-control-small-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-control-chip-small-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-control-small-icon-size);\n height: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &.qds-tag {\n font: var(--qds-control-standard-text);\n gap: var(--qds-control-standard-gap-internal);\n height: var(--qds-control-standard-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-control-chip-standard-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-control-standard-icon-size);\n height: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &.qds-tag {\n font: var(--qds-control-large-text);\n gap: var(--qds-control-large-gap-internal);\n height: var(--qds-control-large-height);\n }\n\n &.qds-padding {\n padding-inline: var(--qds-control-chip-large-padding-horizontal);\n }\n\n &.qds-icon {\n width: var(--qds-control-large-icon-size);\n height: var(--qds-control-large-icon-size);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, Element, Fragment, h, Prop } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport type { Importance, Size, Status } from '../shared'\n\nexport type TagStatus = Status | 'neutral'\n\n/**\n * The `<qds-tag>` element is a static descriptor used for items that need to\n * be labeled, categorized, or organized using keywords that describe them.\n *\n * @see https://quartz.se.com/build/components/tag\n */\n@Component({\n tag: 'qds-tag',\n shadow: true,\n styleUrl: 'tag.css',\n})\nexport class Tag 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 iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The tag's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * The tag's status.\n */\n @Prop() public readonly status?: TagStatus = 'neutral'\n\n /**\n * The tag's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The tag's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * Provides a text description of the icon for screen readers.\n */\n @Prop() public readonly iconDescription?: string\n\n /**\n * Displays an indicator if `true`.\n */\n @Prop() public readonly badge?: boolean = false\n\n /**\n * The indicator badge's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly badgeDescription?: string\n\n @Element() private readonly host!: HTMLElement\n\n #inheritedAttributes: Attributes = {}\n\n get #computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedStatus(): TagStatus {\n switch (this.status) {\n case 'error':\n case 'info':\n case 'success':\n case 'warning': {\n return this.status\n }\n default: {\n return 'neutral'\n }\n }\n }\n\n get #hasBadge(): boolean {\n return (this.badge ?? false) && this.importance !== 'emphasized'\n }\n\n public componentWillLoad(): void {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-tag': true,\n 'qds-padding': this.importance !== 'subdued',\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n data-status={this.#computedStatus}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n >\n {this.iconName !== undefined && this.iconName !== '' ? (\n <>\n {this.iconDescription !== undefined &&\n this.iconDescription !== '' && (\n <span class=\"qds-sr-only\">{this.iconDescription}</span>\n )}\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n </>\n ) : (\n this.#hasBadge && (\n <qds-badge-indicator\n status={this.#computedStatus}\n description={this.badgeDescription}\n size={this.#computedSize}\n strokeRing\n />\n )\n )}\n <span class=\"qds-text\">{this.text}</span>\n </span>\n )\n }\n}\n"],"version":3}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, h } from './p-50f85f75.js';
|
|
7
7
|
import { i as inheritAriaAttributes } from './p-8abba29b.js';
|
|
8
|
-
import { d as defineCustomElement$1 } from './p-
|
|
8
|
+
import { d as defineCustomElement$1 } from './p-8e8bd915.js';
|
|
9
9
|
|
|
10
|
-
const titleCss = ":host([hidden]){display:none!important}:host{display:block}.qds-titles{display:grid;grid-template-areas:\"
|
|
10
|
+
const titleCss = ":host([hidden]){display:none!important}:host{display:block}.qds-titles{display:grid;grid-template-areas:\"b\"}.qds-titles.qds-has-kicker{grid-template-areas:\"c\" \"b\"}.qds-titles.qds-has-subtitle{grid-template-areas:\"b\" \"d\"}.qds-titles.qds-has-kicker.qds-has-subtitle{grid-template-areas:\"c\" \"b\" \"d\"}.qds-has-icon{grid-template-areas:\"e b\";grid-template-columns:auto 1fr}.qds-has-icon.qds-has-kicker{grid-template-areas:\". c\" \"e b\"}.qds-has-icon.qds-has-subtitle{grid-template-areas:\"e b\" \". d\"}.qds-has-icon.qds-has-kicker.qds-has-subtitle{grid-template-areas:\". c\" \"e b\" \". d\"}.qds-kicker,.qds-subtitle,.qds-title{margin-block:0}.qds-title{color:var(--qds-theme-title);grid-area:b}.qds-subtitle{color:var(--qds-theme-subtitle);grid-area:d}.qds-kicker{color:var(--qds-theme-kicker);grid-area:c}.qds-icon{align-content:center;color:var(--qds-theme-text-standard);grid-area:e}.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-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)}";
|
|
11
11
|
const QdsTitleStyle0 = titleCss;
|
|
12
12
|
|
|
13
13
|
// SPDX-FileCopyrightText: © 2024 Schneider Electric
|
|
@@ -108,4 +108,4 @@ function defineCustomElement() {
|
|
|
108
108
|
|
|
109
109
|
export { Title as T, defineCustomElement as d };
|
|
110
110
|
|
|
111
|
-
//# sourceMappingURL=p-
|
|
111
|
+
//# sourceMappingURL=p-251cd601.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-a529eb5c.js","mappings":";;;;;;;;;AAAA,MAAM,QAAQ,GAAG,ixSAAixS,CAAC;AACnyS,uBAAe,QAAQ;;ACDvB;AACA;AACA;;;;;;;;;;;;;;;;;;MA4Ba,KAAK;IALlB;;;;;;;;QAS0B,cAAS,GAAe,OAAO,CAAA;;;;QAY/B,gBAAW,GAAW,SAAS,CAAA;QAO/B,UAAK,GAAW,MAAM,CAAA;QAEtB,UAAK,GAAW,SAAS,CAAA;;;;QAUzB,QAAG,GAAS,IAAI,CAAA;QASxC,qCAAmC,EAAE,EAAA;KAmDtC;IAzCQ,iBAAiB;QACtB,uBAAA,IAAI,8BAAwB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAA,CAAA;KAC7D;IAEM,MAAM;QACX,MAAM,KAAK,GAAG,OAAO,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE,CAAA;QAC3C,MAAM,KAAK,GAAG,OAAO,IAAI,CAAC,KAAK,IAAI,SAAS,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* 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-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-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-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 { Component, Element, h, Prop } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\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 @Element() private readonly host!: HTMLElement\n\n #inheritedAttributes: Attributes = {}\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.#inheritedAttributes = inheritAriaAttributes(this.host)\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 // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\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 aria-hidden=\"true\"\n class=\"qds-icon\"\n name={this.iconName}\n library={this.iconLibrary}\n />\n )}\n </hgroup>\n )\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-251cd601.js","mappings":";;;;;;;;;AAAA,MAAM,QAAQ,GAAG,ixSAAixS,CAAC;AACnyS,uBAAe,QAAQ;;ACDvB;AACA;AACA;;;;;;;;;;;;;;;;;;MA4Ba,KAAK;IALlB;;;;;;;;QAS0B,cAAS,GAAe,OAAO,CAAA;;;;QAY/B,gBAAW,GAAW,SAAS,CAAA;QAO/B,UAAK,GAAW,MAAM,CAAA;QAEtB,UAAK,GAAW,SAAS,CAAA;;;;QAUzB,QAAG,GAAS,IAAI,CAAA;QASxC,qCAAmC,EAAE,EAAA;KAmDtC;IAzCQ,iBAAiB;QACtB,uBAAA,IAAI,8BAAwB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAA,CAAA;KAC7D;IAEM,MAAM;QACX,MAAM,KAAK,GAAG,OAAO,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE,CAAA;QAC3C,MAAM,KAAK,GAAG,OAAO,IAAI,CAAC,KAAK,IAAI,SAAS,EAAE,CAAA;QAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAA;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,CAAA;QAEnE,QACE,iFACkB,IAAI,CAAC,SAAS,IAAI,OAAO,kBAC3B,IAAI,CAAC,OAAO,EAC1B,KAAK,EAAE;gBACL,CAAC,KAAK,GAAG,IAAI;gBACb,CAAC,KAAK,GAAG,IAAI;gBACb,YAAY,EAAE,IAAI;gBAClB,cAAc,EAAE,OAAO;gBACvB,gBAAgB,EAAE,uBAAA,IAAI,8CAAW;gBACjC,kBAAkB,EAAE,uBAAA,IAAI,gDAAa;aACtC,KAEG,uBAAA,IAAI,kCAAqB,IAE7B,EAAC,GAAG,qDAAC,KAAK,EAAC,WAAW,kBAAe,IAAI,CAAC,OAAO,IAC/C,8DAAQ,CACJ,EACL,uBAAA,IAAI,8CAAW,IAAI,0DAAG,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,MAAM,CAAK,EAC1D,uBAAA,IAAI,gDAAa,IAAI,0DAAG,KAAK,EAAC,cAAc,IAAE,IAAI,CAAC,QAAQ,CAAK,EAChE,OAAO,KACN,gFACc,MAAM,EAClB,KAAK,EAAC,UAAU,EAChB,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,OAAO,EAAE,IAAI,CAAC,WAAW,GACzB,CACH,CACM,EACV;KACF;;;;;;;;;;;;;;;IA/CC,OAAO,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,CAAA;AAC5D,CAAC;IAGC,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,CAAA;AACxD,CAAC;;;;;;;;;;;;;;;;;;;;;;","names":[],"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-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-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-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 { Component, Element, h, Prop } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\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 @Element() private readonly host!: HTMLElement\n\n #inheritedAttributes: Attributes = {}\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.#inheritedAttributes = inheritAriaAttributes(this.host)\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 // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\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 aria-hidden=\"true\"\n class=\"qds-icon\"\n name={this.iconName}\n library={this.iconLibrary}\n />\n )}\n </hgroup>\n )\n }\n}\n"],"version":3}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
import { p as proxyCustomElement, H, c as createEvent, h } from './p-50f85f75.js';
|
|
7
7
|
import { p as pickFocusEventAttributes, i as inheritAriaAttributes } from './p-8abba29b.js';
|
|
8
8
|
import { V as VALID_STATE, C as CUSTOM_ERROR_FLAGS, N as NO_ERROR_FLAGS } from './p-d107c90c.js';
|
|
9
|
-
import { d as defineCustomElement$3 } from './p-
|
|
10
|
-
import { d as defineCustomElement$2 } from './p-
|
|
9
|
+
import { d as defineCustomElement$3 } from './p-8e8bd915.js';
|
|
10
|
+
import { d as defineCustomElement$2 } from './p-fff94876.js';
|
|
11
11
|
import { d as defineCustomElement$1 } from './p-70d12c72.js';
|
|
12
12
|
|
|
13
|
-
const checkboxCss = ":host([hidden]){display:none!important}:host{display:inline-block;line-height:0}.qds-box,.qds-checkbox,.qds-icon{grid-area:
|
|
13
|
+
const checkboxCss = ":host([hidden]){display:none!important}:host{display:inline-block;line-height:0}.qds-box,.qds-checkbox,.qds-icon{grid-area:g;place-self:center}.qds-box,.qds-icon{display:none;pointer-events:none}.qds-box{border-radius:var(--qds-control-toggle-indicator-border-radius)}.qds-container{align-self:flex-start;display:grid;grid-template-areas:\"g\"}.qds-icon{color:var(--qds-theme-signature-color-contrast)}.qds-label{cursor:pointer;display:inline-flex;width:inherit}.qds-label-inner{flex:1 1 auto;min-width:0}.qds-checkbox{-webkit-appearance:none;appearance:none;background-color:var(--qds-theme-control-input-background);border:var(--qds-control-border-width) solid var(--qds-theme-control-border);border-radius:var(--qds-control-border-radius);cursor:pointer;margin:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}.qds-checkbox:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-checkbox:active~.qds-box,.qds-checkbox:hover~.qds-box{display:block}.qds-checkbox:hover~.qds-box{background-color:var(--qds-theme-signature-color-hover)}.qds-checkbox:active~.qds-box{background-color:var(--qds-theme-signature-color-pressed)}.qds-checkbox:checked~.qds-checked,.qds-checkbox:indeterminate~.qds-indeterminate{display:block}.qds-checkbox:checked,.qds-checkbox:indeterminate{background-color:var(--qds-theme-signature-color-default);border-color:#0000}.qds-checkbox:checked:hover,.qds-checkbox:indeterminate:hover{background-color:var(--qds-theme-signature-color-hover)}.qds-checkbox:checked:active,.qds-checkbox:indeterminate:active{background-color:var(--qds-theme-signature-color-pressed)}[aria-disabled=true]{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-checkbox[data-size=small]{height:var(--qds-control-toggle-box-small-size);width:var(--qds-control-toggle-box-small-size)}.qds-icon[data-size=small]{font-size:var(--qds-control-small-icon-size)}.qds-box[data-size=small]{height:var(--qds-control-toggle-indicator-small-size);width:var(--qds-control-toggle-indicator-small-size)}.qds-inline[data-size=small]{margin-block:var(--qds-control-small-padding-auto-height)}.qds-label[data-size=small]{gap:var(--qds-control-small-gap-siblings-related)}.qds-checkbox[data-size=standard]{height:var(--qds-control-toggle-box-standard-size);width:var(--qds-control-toggle-box-standard-size)}.qds-icon[data-size=standard]{font-size:var(--qds-control-standard-icon-size)}.qds-box[data-size=standard]{height:var(--qds-control-toggle-indicator-standard-size);width:var(--qds-control-toggle-indicator-standard-size)}.qds-inline[data-size=standard]{margin-block:var(--qds-control-standard-padding-auto-height)}.qds-label[data-size=standard]{gap:var(--qds-control-standard-gap-siblings-related)}.qds-checkbox[data-size=large]{height:var(--qds-control-toggle-box-large-size);width:var(--qds-control-toggle-box-large-size)}.qds-icon[data-size=large]{font-size:var(--qds-control-large-icon-size)}.qds-box[data-size=large]{height:var(--qds-control-toggle-indicator-large-size);width:var(--qds-control-toggle-indicator-large-size)}.qds-inline[data-size=large]{margin-block:var(--qds-control-large-padding-auto-height)}.qds-label[data-size=large]{gap:var(--qds-control-large-gap-siblings-related)}";
|
|
14
14
|
const QdsCheckboxStyle0 = checkboxCss;
|
|
15
15
|
|
|
16
16
|
// SPDX-FileCopyrightText: © 2024 Schneider Electric
|
|
@@ -269,4 +269,4 @@ function defineCustomElement() {
|
|
|
269
269
|
|
|
270
270
|
export { Checkbox as C, defineCustomElement as d };
|
|
271
271
|
|
|
272
|
-
//# sourceMappingURL=p-
|
|
272
|
+
//# sourceMappingURL=p-3b3e9e52.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-9ffb4b49.js","mappings":";;;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,ktGAAktG,CAAC;AACvuG,0BAAe,WAAW;;ACD1B;AACA;AACA;;;;;;;;;;;;;;;;;;MAmCa,QAAQ;IANrB;;;;;;;;;;;;;;;QAa0B,WAAM,GAAY,KAAK,CAAA;;;;QAKvB,SAAI,GAAU,UAAU,CAAA;;;;;;;;;;;;;;;;;;QA0CxB,SAAI,GAAsC,IAAI,CAAA;;;;;;;;QAwCtD,sBAAiB,GAA0C,EAAE,CAAA;;;;;;;;;QAUrD,aAAQ,GAAiC,WAAW,CAAA;;;;;;QAOpD,UAAK,GAAmB,IAAI,CAAA;;;;;;;;QAS5B,iBAAY,GAAqC,KAAK,CAAA;;;;QAKtD,iBAAY,GAAY,KAAK,CAAA;QA0BrD,wCAAmC,EAAE,EAAA;QAkK9B,kBAAa,GAAsC,MACxD,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAA;QAEzB,mBAAc,GAAuC,MAC1D,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAA;QAE1B,sBAAiB,GAA0C,CAAC,KAAK;YACtE,IAAI,KAAK;gBAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,kBAAkB,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;;gBACtE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC,CAAA;SAChD,CAAA;QAEQ,2BAAU,CAAC,KAAiB;YACnC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAA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AK,CAAA;AACpC,CAAC;IAGC,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;IAIC,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAA;AAC1D,CAAC;IAGC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,CAAA;AAC3E,CAAC,2DAgJa,CAAc,EAAE,GAAkB;IAC9C,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAA;AAChE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/checkbox/checkbox.css?tag=qds-checkbox&encapsulation=shadow","src/components/checkbox/checkbox.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: inline-block;\n line-height: 0;\n}\n\n.qds-checkbox,\n.qds-box,\n.qds-icon {\n grid-area: checkbox;\n place-self: center;\n}\n\n.qds-icon,\n.qds-box {\n display: none;\n pointer-events: none;\n}\n\n.qds-box {\n border-radius: var(--qds-control-toggle-indicator-border-radius);\n}\n\n.qds-container {\n display: grid;\n align-self: flex-start;\n grid-template-areas: 'checkbox';\n}\n\n.qds-icon {\n color: var(--qds-theme-signature-color-contrast);\n}\n\n.qds-label {\n cursor: pointer;\n display: inline-flex;\n width: inherit;\n}\n\n.qds-label-inner {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.qds-checkbox {\n appearance: none;\n background-color: var(--qds-theme-control-input-background);\n border-radius: var(--qds-control-border-radius);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n cursor: pointer;\n margin: 0;\n print-color-adjust: exact;\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n\n &:hover ~ .qds-box,\n &:active ~ .qds-box {\n display: block;\n }\n\n &:hover ~ .qds-box {\n background-color: var(--qds-theme-signature-color-hover);\n }\n\n &:active ~ .qds-box {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n\n &:checked ~ .qds-checked,\n &:indeterminate ~ .qds-indeterminate {\n display: block;\n }\n\n &:checked,\n &:indeterminate {\n background-color: var(--qds-theme-signature-color-default);\n border-color: transparent;\n\n &:hover {\n background-color: var(--qds-theme-signature-color-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-small-size);\n height: var(--qds-control-toggle-box-small-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-small-size);\n height: var(--qds-control-toggle-indicator-small-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-small-gap-siblings-related);\n }\n}\n\n[data-size='standard'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-standard-size);\n height: var(--qds-control-toggle-box-standard-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-standard-size);\n height: var(--qds-control-toggle-indicator-standard-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-standard-gap-siblings-related);\n }\n}\n\n[data-size='large'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-large-size);\n height: var(--qds-control-toggle-box-large-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-large-size);\n height: var(--qds-control-toggle-indicator-large-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-large-gap-siblings-related);\n }\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 Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\nimport { CUSTOM_ERROR_FLAGS, NO_ERROR_FLAGS, VALID_STATE } from '../controls'\nimport type { Size } from '../shared'\n\nexport type CheckboxValue = number | string | null\n\n/**\n * `<qds-checkbox>` elements are rendered as boxes that are checked (ticked)\n * when activated, like you might see in an official government paper form. A\n * checkbox allows you to select single values for submission in a form (or not).\n *\n * @see https://quartz.se.com/build/components/checkbox\n */\n@Component({\n tag: 'qds-checkbox',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'checkbox.css',\n})\nexport class Checkbox implements ComponentInterface {\n /**\n * Adds vertical margin to the checkbox for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * The checkbox's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The checkbox's text.\n *\n * Its value will also be used as the `aria-label` value when the\n * `checkbox-only` attribute is specified.\n */\n @Prop() public readonly text!: string\n\n /**\n * Sets the checkbox's state.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * Prevents the checkbox from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * The [`<form>`][] element to associate the checkbox with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-checkbox>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-checkbox>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * Sets the checkbox to an indeterminate state. This is usually applied to\n * checkboxes that represent a \"select all/none\" behavior when associated\n * checkboxes have a mix of checked and unchecked states.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public indeterminate?: boolean\n\n /**\n * The name of the checkbox, which is submitted with the form data.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * A value must be specified for the checkbox before the owning form can be\n * submitted.\n *\n * See\n * [Client-side validation](https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation)\n * and the\n * [HTML attribute: `required`](https://developer.mozilla.org/docs/Web/HTML/Attributes/required)\n * for more information.\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * The error message that would be shown to the user if the `<qds-checkbox>`\n * was to be checked for validity.\n *\n * @readonly\n * @webnative\n */\n @Prop()\n public readonly validationMessage: ElementInternals['validationMessage'] = ''\n\n /**\n * The [`ValidityState`][] object for this `<qds-checkbox>`.\n *\n * [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly validity: ElementInternals['validity'] = VALID_STATE\n\n /**\n * The value of the checkbox, submitted as a name/value pair with form data.\n *\n * @webnative\n */\n @Prop() public readonly value?: CheckboxValue = 'on'\n\n /**\n * True if `<qds-checkbox>` will be validated when the form is submitted;\n * false otherwise.\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly willValidate: ElementInternals['willValidate'] = false\n\n /**\n * Whether or not the text is displayed.\n */\n @Prop() public readonly checkboxOnly: boolean = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when a change to the checkbox's state is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the checkbox 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 @State() private tabIndex?: number\n\n #inheritedAttributes: Attributes = {}\n\n get #computedChecked(): boolean {\n return this.checked ?? false\n }\n\n get #computedDisabled(): boolean {\n return (\n (this.host.matches(':disabled') || (this.disabled ?? false)) &&\n this.host.getAttribute('disabled') !== 'false'\n )\n }\n\n get #computedIndeterminate(): boolean {\n return this.indeterminate ?? false\n }\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedValue(): string | null {\n // eslint-disable-next-line unicorn/no-null\n return this.value == null ? null : this.value.toString()\n }\n\n get #hasText(): boolean {\n return (this.text !== '' || this.required === true) && !this.checkboxOnly\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n event.preventDefault()\n\n this.checked = this.#computedIndeterminate ? true : !this.#computedChecked\n this.changeEmitter.emit()\n this.indeterminate = false\n }\n\n @Watch('checked')\n protected checkedChanged(): void {\n this.internals.setFormValue(\n this.#computedChecked && !this.#computedDisabled\n ? this.#computedValue\n : // eslint-disable-next-line unicorn/no-null\n null,\n )\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n // eslint-disable-next-line unicorn/no-null\n else this.internals.setFormValue(null)\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n @Watch('value')\n protected valueChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n }\n\n public componentWillLoad(): void {\n this.valueChanged()\n\n this.#defineGetter('form', () => this.internals.form)\n this.#defineGetter('willValidate', () => this.internals.willValidate)\n this.#defineGetter('validity', () => this.internals.validity)\n this.#defineGetter(\n 'validationMessage',\n () => this.internals.validationMessage,\n )\n\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public render() {\n return (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class={{\n 'qds-inline': this.inline,\n 'qds-label': true,\n }}\n data-size={this.#computedSize}\n >\n <div class=\"qds-container\">\n <input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n checked={this.#computedIndeterminate ? false : this.checked}\n class=\"qds-checkbox\"\n data-size={this.#computedSize}\n disabled={this.#computedDisabled}\n indeterminate={this.indeterminate}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n required={this.required}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n type=\"checkbox\"\n aria-label={this.checkboxOnly ? this.text : undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n 'qds-icon': true,\n 'qds-checked': true,\n }}\n data-size={this.#computedSize}\n library=\"core\"\n name=\"checked\"\n />\n <div class=\"qds-box\" data-size={this.#computedSize} />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n 'qds-icon': true,\n 'qds-indeterminate': true,\n }}\n data-size={this.#computedSize}\n library=\"core\"\n name=\"indeterminate\"\n />\n </div>\n {this.#hasText && (\n <qds-label\n class=\"qds-label-inner\"\n required={this.required}\n size={this.size}\n text={this.text}\n />\n )}\n </label>\n )\n }\n\n public checkValidity: ElementInternals['checkValidity'] = () =>\n this.internals.checkValidity()\n\n public reportValidity: ElementInternals['reportValidity'] = () =>\n this.internals.reportValidity()\n\n public setCustomValidity: HTMLInputElement['setCustomValidity'] = (error) => {\n if (error) this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.host)\n else this.internals.setValidity(NO_ERROR_FLAGS)\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-3b3e9e52.js","mappings":";;;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,ktGAAktG,CAAC;AACvuG,0BAAe,WAAW;;ACD1B;AACA;AACA;;;;;;;;;;;;;;;;;;MAmCa,QAAQ;IANrB;;;;;;;;;;;;;;;QAa0B,WAAM,GAAY,KAAK,CAAA;;;;QAKvB,SAAI,GAAU,UAAU,CAAA;;;;;;;;;;;;;;;;;;QA0CxB,SAAI,GAAsC,IAAI,CAAA;;;;;;;;QAwCtD,sBAAiB,GAA0C,EAAE,CAAA;;;;;;;;;QAUrD,aAAQ,GAAiC,WAAW,CAAA;;;;;;QAOpD,UAAK,GAAmB,IAAI,CAAA;;;;;;;;QAS5B,iBAA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],"sources":["src/components/checkbox/checkbox.css?tag=qds-checkbox&encapsulation=shadow","src/components/checkbox/checkbox.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: inline-block;\n line-height: 0;\n}\n\n.qds-checkbox,\n.qds-box,\n.qds-icon {\n grid-area: checkbox;\n place-self: center;\n}\n\n.qds-icon,\n.qds-box {\n display: none;\n pointer-events: none;\n}\n\n.qds-box {\n border-radius: var(--qds-control-toggle-indicator-border-radius);\n}\n\n.qds-container {\n display: grid;\n align-self: flex-start;\n grid-template-areas: 'checkbox';\n}\n\n.qds-icon {\n color: var(--qds-theme-signature-color-contrast);\n}\n\n.qds-label {\n cursor: pointer;\n display: inline-flex;\n width: inherit;\n}\n\n.qds-label-inner {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.qds-checkbox {\n appearance: none;\n background-color: var(--qds-theme-control-input-background);\n border-radius: var(--qds-control-border-radius);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n cursor: pointer;\n margin: 0;\n print-color-adjust: exact;\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n\n &:hover ~ .qds-box,\n &:active ~ .qds-box {\n display: block;\n }\n\n &:hover ~ .qds-box {\n background-color: var(--qds-theme-signature-color-hover);\n }\n\n &:active ~ .qds-box {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n\n &:checked ~ .qds-checked,\n &:indeterminate ~ .qds-indeterminate {\n display: block;\n }\n\n &:checked,\n &:indeterminate {\n background-color: var(--qds-theme-signature-color-default);\n border-color: transparent;\n\n &:hover {\n background-color: var(--qds-theme-signature-color-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-signature-color-pressed);\n }\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-small-size);\n height: var(--qds-control-toggle-box-small-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-small-size);\n height: var(--qds-control-toggle-indicator-small-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-small-gap-siblings-related);\n }\n}\n\n[data-size='standard'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-standard-size);\n height: var(--qds-control-toggle-box-standard-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-standard-size);\n height: var(--qds-control-toggle-indicator-standard-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-standard-gap-siblings-related);\n }\n}\n\n[data-size='large'] {\n &.qds-checkbox {\n width: var(--qds-control-toggle-box-large-size);\n height: var(--qds-control-toggle-box-large-size);\n }\n\n &.qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n\n &.qds-box {\n width: var(--qds-control-toggle-indicator-large-size);\n height: var(--qds-control-toggle-indicator-large-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n\n &.qds-label {\n gap: var(--qds-control-large-gap-siblings-related);\n }\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 Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\nimport { CUSTOM_ERROR_FLAGS, NO_ERROR_FLAGS, VALID_STATE } from '../controls'\nimport type { Size } from '../shared'\n\nexport type CheckboxValue = number | string | null\n\n/**\n * `<qds-checkbox>` elements are rendered as boxes that are checked (ticked)\n * when activated, like you might see in an official government paper form. A\n * checkbox allows you to select single values for submission in a form (or not).\n *\n * @see https://quartz.se.com/build/components/checkbox\n */\n@Component({\n tag: 'qds-checkbox',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'checkbox.css',\n})\nexport class Checkbox implements ComponentInterface {\n /**\n * Adds vertical margin to the checkbox for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * The checkbox's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The checkbox's text.\n *\n * Its value will also be used as the `aria-label` value when the\n * `checkbox-only` attribute is specified.\n */\n @Prop() public readonly text!: string\n\n /**\n * Sets the checkbox's state.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * Prevents the checkbox from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * The [`<form>`][] element to associate the checkbox with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-checkbox>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-checkbox>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * Sets the checkbox to an indeterminate state. This is usually applied to\n * checkboxes that represent a \"select all/none\" behavior when associated\n * checkboxes have a mix of checked and unchecked states.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public indeterminate?: boolean\n\n /**\n * The name of the checkbox, which is submitted with the form data.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * A value must be specified for the checkbox before the owning form can be\n * submitted.\n *\n * See\n * [Client-side validation](https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation)\n * and the\n * [HTML attribute: `required`](https://developer.mozilla.org/docs/Web/HTML/Attributes/required)\n * for more information.\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * The error message that would be shown to the user if the `<qds-checkbox>`\n * was to be checked for validity.\n *\n * @readonly\n * @webnative\n */\n @Prop()\n public readonly validationMessage: ElementInternals['validationMessage'] = ''\n\n /**\n * The [`ValidityState`][] object for this `<qds-checkbox>`.\n *\n * [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly validity: ElementInternals['validity'] = VALID_STATE\n\n /**\n * The value of the checkbox, submitted as a name/value pair with form data.\n *\n * @webnative\n */\n @Prop() public readonly value?: CheckboxValue = 'on'\n\n /**\n * True if `<qds-checkbox>` will be validated when the form is submitted;\n * false otherwise.\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly willValidate: ElementInternals['willValidate'] = false\n\n /**\n * Whether or not the text is displayed.\n */\n @Prop() public readonly checkboxOnly: boolean = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when a change to the checkbox's state is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the checkbox 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 @State() private tabIndex?: number\n\n #inheritedAttributes: Attributes = {}\n\n get #computedChecked(): boolean {\n return this.checked ?? false\n }\n\n get #computedDisabled(): boolean {\n return (\n (this.host.matches(':disabled') || (this.disabled ?? false)) &&\n this.host.getAttribute('disabled') !== 'false'\n )\n }\n\n get #computedIndeterminate(): boolean {\n return this.indeterminate ?? false\n }\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedValue(): string | null {\n // eslint-disable-next-line unicorn/no-null\n return this.value == null ? null : this.value.toString()\n }\n\n get #hasText(): boolean {\n return (this.text !== '' || this.required === true) && !this.checkboxOnly\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n event.preventDefault()\n\n this.checked = this.#computedIndeterminate ? true : !this.#computedChecked\n this.changeEmitter.emit()\n this.indeterminate = false\n }\n\n @Watch('checked')\n protected checkedChanged(): void {\n this.internals.setFormValue(\n this.#computedChecked && !this.#computedDisabled\n ? this.#computedValue\n : // eslint-disable-next-line unicorn/no-null\n null,\n )\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n // eslint-disable-next-line unicorn/no-null\n else this.internals.setFormValue(null)\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n @Watch('value')\n protected valueChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n }\n\n public componentWillLoad(): void {\n this.valueChanged()\n\n this.#defineGetter('form', () => this.internals.form)\n this.#defineGetter('willValidate', () => this.internals.willValidate)\n this.#defineGetter('validity', () => this.internals.validity)\n this.#defineGetter(\n 'validationMessage',\n () => this.internals.validationMessage,\n )\n\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public render() {\n return (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class={{\n 'qds-inline': this.inline,\n 'qds-label': true,\n }}\n data-size={this.#computedSize}\n >\n <div class=\"qds-container\">\n <input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n checked={this.#computedIndeterminate ? false : this.checked}\n class=\"qds-checkbox\"\n data-size={this.#computedSize}\n disabled={this.#computedDisabled}\n indeterminate={this.indeterminate}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n required={this.required}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n type=\"checkbox\"\n aria-label={this.checkboxOnly ? this.text : undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n 'qds-icon': true,\n 'qds-checked': true,\n }}\n data-size={this.#computedSize}\n library=\"core\"\n name=\"checked\"\n />\n <div class=\"qds-box\" data-size={this.#computedSize} />\n <qds-icon\n aria-hidden=\"true\"\n class={{\n 'qds-icon': true,\n 'qds-indeterminate': true,\n }}\n data-size={this.#computedSize}\n library=\"core\"\n name=\"indeterminate\"\n />\n </div>\n {this.#hasText && (\n <qds-label\n class=\"qds-label-inner\"\n required={this.required}\n size={this.size}\n text={this.text}\n />\n )}\n </label>\n )\n }\n\n public checkValidity: ElementInternals['checkValidity'] = () =>\n this.internals.checkValidity()\n\n public reportValidity: ElementInternals['reportValidity'] = () =>\n this.internals.reportValidity()\n\n public setCustomValidity: HTMLInputElement['setCustomValidity'] = (error) => {\n if (error) this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.host)\n else this.internals.setValidity(NO_ERROR_FLAGS)\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"version":3}
|
|
@@ -226,7 +226,7 @@ const Icon = /*@__PURE__*/ proxyCustomElement(class Icon extends H {
|
|
|
226
226
|
await this.setIcon();
|
|
227
227
|
}
|
|
228
228
|
render() {
|
|
229
|
-
return (h("div", { key: '
|
|
229
|
+
return (h("div", { key: '3fca209ec743cded809432d194d8c9488ba07fd8', class: "qds-container" }, h("span", { key: '0d9759a324e57446f7a00cae5365808f70500f8f', class: "qds-icon-wrapper", innerHTML: this.svg }), h("div", { key: '3f728385959c92a7386fd6495419299eb66997fc', class: "qds-click-target" })));
|
|
230
230
|
}
|
|
231
231
|
get host() { return this; }
|
|
232
232
|
static get watchers() { return {
|
|
@@ -259,4 +259,4 @@ function defineCustomElement() {
|
|
|
259
259
|
|
|
260
260
|
export { Icon as I, defineCustomElement as d, registerIconLibrary as r, unregisterIconLibrary as u };
|
|
261
261
|
|
|
262
|
-
//# sourceMappingURL=p-
|
|
262
|
+
//# sourceMappingURL=p-8e8bd915.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-72c09714.js","mappings":";;;;;;;;AAAA,MAAM,UAAU,GAAG,4UAA4U;;ACA/V,MAAM,QAAQ,GAAG,wgBAAwgB;;ACAzhB,MAAM,YAAY,GAAG,wvBAAwvB;;ACA7wB,MAAM,WAAW,GAAG,gVAAgV;;ACApW,MAAM,eAAe,GAAG,oeAAoe;;ACA5f,MAAM,gBAAgB,GAAG,gUAAgU;;ACAzV,MAAM,YAAY,GAAG,weAAwe;;ACA7f,MAAM,qBAAqB,GAAG,weAAwe;;ACAtgB,MAAM,aAAa,GAAG,4WAA4W;;ACAlY,MAAM,aAAa,GAAG,weAAwe;;ACA9f,MAAM,oBAAoB,GAAG,gpBAAgpB;;ACA7qB,MAAM,oBAAoB,GAAG,wiBAAwiB;;ACArkB,MAAM,cAAc,GAAG,4pBAA4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KAAN,MAAM,GAAK,IAAI,SAAS,EAAE,EAAA;YAC1B,MAAM,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;YAClE,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;YACrD,IAAI,UAAU,KAAK,IAAI,EAAE;gBACvB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;gBACb,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;aACzB;iBAAM;gBACL,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,uBAAA,IAAI,iCAAqB,CAAC;oBAClE,IAAI,KAAK,KAAK,SAAS;wBAAE,UAAU,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;gBAC9D,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,SAAS,CAAA;gBAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAA;aACxB;SACF;QAAC,MAAM;YACN,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;SACzB;KACF;IAEM,MAAM,iBAAiB;QAC5B,uBAAA,IAAI,6BAAwB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAA,CAAA;QAC5D,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;KACrB;IAEM,MAAM;QACX,QACE,4DAAK,KAAK,EAAC,eAAe,IACxB,6DAAM,KAAK,EAAC,kBAAkB,EAAC,SAAS,EAAE,IAAI,CAAC,GAAG,GAAI,EACtD,4DAAK,KAAK,EAAC,kBAAkB,GAAG,CAC5B,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["clear","checked","draggable","dropdown","externalLink","indeterminate","inputMonth","inputTel","inputWeek","inputUrl","inputTime","inputDate","inputDatetimeLocal","inputEmail","inputSearch","inputPasswordHide","inputPasswordShow","navigation","next","statusError","statusInfo","statusWarning","defaultLibrary"],"sources":["../../node_modules/@quartzds/generic-icons-core/dist/checked.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-info.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-warning.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 d=\"M6.31 11.86 3.08 8.63l.71-.71 2.52 2.52 5.9-5.94.71.7z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" d=\"m11.43 5.26-.71-.7-2.74 2.76-2.73-2.76-.71.7 2.74 2.77-2.74 2.77.71.71 2.73-2.77 2.74 2.77.71-.71-2.74-2.77z\"/><circle cx=\"8\" cy=\"8\" r=\"7.5\" stroke=\"currentColor\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M4.96 0a2.148 2.148 0 1 1 0 4.297A2.148 2.148 0 0 1 4.96 0zM2.812 17.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm0-7.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm10.079-7.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm0 15.704a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm0-7.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 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 16 16\"><path d=\"M7.95 12.39 2.06 4.76l.79-.61 5.11 6.62 5.23-6.63.78.62z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M13.16 0H20v6.72h-1.03V1.76l-6.46 6.46-.73-.73 6.46-6.46h-5.08zM0 3h11.05v1.02H1.03v14.95h15V8.53h1.02V20H0z\" clip-rule=\"evenodd\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"none\" stroke=\"currentColor\" d=\"M.5 10h19\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 0Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 0Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M.5 2.5h19m-19 0v15h19v-15m-19 0 9.5 8 9.5-8\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 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 20 20\"><path fill=\"none\" stroke=\"currentColor\" d=\"m.5.5 19 19m-3.443-5.82c1.006-.79 1.997-1.626 3.443-2.239-.463-.892-2.811-6.857-10.245-6.823m2.995 7.646a3.304 3.304 0 1 1-4.624-4.608l-.022-.03s-5.153.05-7.102 3.817c0 0 3.582 6.142 11.56 4.325a8.2 8.2 0 0 0 2.599-1.078m-1.781-4.367a3.305 3.305 0 0 0-2.638-3.237\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"none\" stroke=\"currentColor\" d=\"M9.255 4.258c7.435-.033 9.783 5.931 10.245 6.823-3.036 1.289-4.07 3.558-7.44 4.325C4.082 17.223.5 11.081.5 11.081c1.95-3.767 7.102-3.817 7.102-3.817l.022.03a3.304 3.304 0 1 0 2.617-.568\"/></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 d=\"M3.95 6.96h1c0-1.12.91-2.02 2.02-2.02v-1c-1.67 0-3.02 1.36-3.02 3.02Zm10.08 6.36L9.99 9.28c.63-.79 1.03-1.78 1.03-2.86a4.6 4.6 0 0 0-4.6-4.6c-2.54 0-4.6 2.07-4.6 4.6s2.06 4.6 4.6 4.6c1.09 0 2.08-.4 2.86-1.03l4.04 4.04zm-7.61-3.3c-1.99 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" stroke-linejoin=\"round\" stroke-miterlimit=\"3.864\" d=\"m1 15.502 2.472 2.272c.66-.017 1.468-1.254 2.528-2.272 2.086-2.002 2.376-2.075 2.176-2.235.161.2-2.006-1.481-2.006-1.481s1.492-1.673 3.368-3.036a117 117 0 0 1 3.442-2.403l.994 2.403s.933-.536 2.688-2.058C18.227 5.337 19.5 4.554 19.5 4.554l-2-2.552S12.82 1.79 6.933 6.228C2.574 9.513 1 15.502 1 15.502Z\"/></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 d=\"m13.31 5 .71-.71-2.32-2.32-.71.71.8.8-.64.64c-.86-.71-1.95-1.16-3.16-1.16S5.7 3.4 4.84 4.11l-.63-.63.8-.8-.71-.71-2.32 2.32.71.71.8-.8.63.63a4.97 4.97 0 0 0-1.14 3.14c0 1.68.84 3.16 2.12 4.07l-1.25 1.25.71.71 1.45-1.45c.61.26 1.28.41 1.98.41s1.31-.14 1.89-.38l1.36 1.36.71-.71-1.15-1.15c1.32-.9 2.19-2.41 2.19-4.13 0-1.19-.44-2.27-1.14-3.13l.64-.64zM8 11.97c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4Zm.49-6.59h-1v2.79l2.16 2.16.71-.71-1.87-1.87z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" stroke-linejoin=\"round\" d=\"M10.01.5v19m0-19a9.5 9.5 0 0 1 9.5 9.5M10.01.5C5.387.5.5 4.5.5 10.5m9.51-10s-5.537 3-5.537 10.716c0 5.284 5.537 8.284 5.537 8.284m0-19s5.426 3 5.426 10.716c0 5.284-5.426 8.284-5.426 8.284m0 0c-5.079 0-9.227-3.986-9.487-9.001M10.01 19.5a9.5 9.5 0 0 0 9.5-9.5m0 0c-.795.277-9.01 3.603-19.018.38\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 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 16 16\"><path d=\"m4.77 13.97-.62-.78 6.62-5.23-6.62-5.11.61-.79 7.63 5.89z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"m5.495.5 8.664 8.664c.462.462.462 1.21 0 1.672L5.495 19.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 d=\"m11.43 5.26-.71-.7-2.74 2.76-2.73-2.76-.71.7 2.74 2.77-2.74 2.77.71.71 2.73-2.77 2.74 2.77.71-.71-2.74-2.77z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M9 4h2.41v2.15H9zm.13 12.51V7.97h2.18v8.54z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M9.57 12.48c-.13-.12-.2-.29-.23-.52l-.67-7-.02-.18c0-.37.13-.67.39-.89s.58-.33.98-.33.72.11.98.33.39.52.39.89l-.02.2-.67 6.98c-.02.23-.1.4-.23.52a.65.65 0 0 1-.46.18.65.65 0 0 1-.46-.18zm-.5 3.57a1.34 1.34 0 0 1-.38-.96 1.32 1.32 0 0 1 1.33-1.35c.38 0 .7.13.95.39s.38.58.38.96a1.32 1.32 0 0 1-1.33 1.35c-.38 0-.7-.13-.95-.39Z\"/></svg>","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\n// FIXME: TypeScript and Webpack can resolve exports from the package.json\n// `exports` field but Rollup can't. `@quartzds/generic-icons-core/*.svg`\n// _should_ work but it doesn't.\n/* eslint-disable import/no-unresolved */\nimport checked from '@quartzds/generic-icons-core/dist/checked.svg'\nimport clear from '@quartzds/generic-icons-core/dist/clear.svg'\nimport draggable from '@quartzds/generic-icons-core/dist/draggable.svg'\nimport dropdown from '@quartzds/generic-icons-core/dist/dropdown.svg'\nimport externalLink from '@quartzds/generic-icons-core/dist/external-link.svg'\nimport indeterminate from '@quartzds/generic-icons-core/dist/indeterminate.svg'\nimport inputDate from '@quartzds/generic-icons-core/dist/input-date.svg'\nimport inputDatetimeLocal from '@quartzds/generic-icons-core/dist/input-datetime-local.svg'\nimport inputEmail from '@quartzds/generic-icons-core/dist/input-email.svg'\nimport inputMonth from '@quartzds/generic-icons-core/dist/input-month.svg'\nimport inputPasswordHide from '@quartzds/generic-icons-core/dist/input-password-hide.svg'\nimport inputPasswordShow from '@quartzds/generic-icons-core/dist/input-password-show.svg'\nimport inputSearch from '@quartzds/generic-icons-core/dist/input-search.svg'\nimport inputTel from '@quartzds/generic-icons-core/dist/input-tel.svg'\nimport inputTime from '@quartzds/generic-icons-core/dist/input-time.svg'\nimport inputUrl from '@quartzds/generic-icons-core/dist/input-url.svg'\nimport inputWeek from '@quartzds/generic-icons-core/dist/input-week.svg'\nimport navigation from '@quartzds/generic-icons-core/dist/navigation.svg'\nimport next from '@quartzds/generic-icons-core/dist/next.svg'\nimport statusError from '@quartzds/generic-icons-core/dist/status-error.svg'\nimport statusInfo from '@quartzds/generic-icons-core/dist/status-info.svg'\nimport statusWarning from '@quartzds/generic-icons-core/dist/status-warning.svg'\n\n/* eslint-enable import/no-unresolved */\nimport type { IconLibrary } from './library'\n\nconst icons: Record<string, string | undefined> = {\n /* eslint-disable @typescript-eslint/naming-convention */\n clear,\n checked,\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 'new-tab-link': externalLink,\n close: statusError,\n 'status-error': statusError,\n 'status-info': statusInfo,\n 'status-success': checked,\n 'status-warning': statusWarning,\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\n.qds-click-target {\n height: var(--qds-experimental-icon-click-target-size);\n left: calc(-1 * (var(--qds-experimental-icon-click-target-size) - 100%) / 2);\n position: absolute;\n top: calc(-1 * (var(--qds-experimental-icon-click-target-size) - 100%) / 2);\n width: var(--qds-experimental-icon-click-target-size);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\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 @Element() private readonly host!: HTMLElement\n\n @State() private svg = ''\n\n #inheritedAttributes: Attributes = {}\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 for (const [key, value] of Object.entries(this.#inheritedAttributes))\n if (value !== undefined) svgElement.setAttribute(key, value)\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.#inheritedAttributes = inheritAriaAttributes(this.host)\n await this.setIcon()\n }\n\n public render() {\n return (\n <div class=\"qds-container\">\n <span class=\"qds-icon-wrapper\" innerHTML={this.svg} />\n <div class=\"qds-click-target\" />\n </div>\n )\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-8e8bd915.js","mappings":";;;;;;;;AAAA,MAAM,UAAU,GAAG,4UAA4U;;ACA/V,MAAM,QAAQ,GAAG,wgBAAwgB;;ACAzhB,MAAM,YAAY,GAAG,wvBAAwvB;;ACA7wB,MAAM,WAAW,GAAG,gVAAgV;;ACApW,MAAM,eAAe,GAAG,oeAAoe;;ACA5f,MAAM,gBAAgB,GAAG,gUAAgU;;ACAzV,MAAM,YAAY,GAAG,weAAwe;;ACA7f,MAAM,qBAAqB,GAAG,weAAwe;;ACAtgB,MAAM,aAAa,GAAG,4WAA4W;;ACAlY,MAAM,aAAa,GAAG,weAAwe;;ACA9f,MAAM,oBAAoB,GAAG,gpBAAgpB;;ACA7qB,MAAM,oBAAoB,GAAG,wiBAAwiB;;ACArkB,MAAM,cAAc,GAAG,4pBAA4pB;;ACAnrB,MAAM,WAAW,GAAG,wwBAAwwB;;ACA5xB,MAAM,YAAY,GAAG,o2BAAo2B;;ACAz3B,MAAM,WAAW,GAAG,wtBAAwtB;;ACA5uB,MAAM,YAAY,GAAG,weAAwe;;ACA7f,MAAM,aAAa,GAAG,gVAAgV;;ACAtW,MAAM,OAAO,GAAG,gXAAgX;;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UAAU,KAAK,IAAI,EAAE;gBACvB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;gBACb,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;aACzB;iBAAM;gBACL,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,uBAAA,IAAI,iCAAqB,CAAC;oBAClE,IAAI,KAAK,KAAK,SAAS;wBAAE,UAAU,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;gBAC9D,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,SAAS,CAAA;gBAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAA;aACxB;SACF;QAAC,MAAM;YACN,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;SACzB;KACF;IAEM,MAAM,iBAAiB;QAC5B,uBAAA,IAAI,6BAAwB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAA,CAAA;QAC5D,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;KACrB;IAEM,MAAM;QACX,QACE,4DAAK,KAAK,EAAC,eAAe,IACxB,6DAAM,KAAK,EAAC,kBAAkB,EAAC,SAAS,EAAE,IAAI,CAAC,GAAG,GAAI,EACtD,4DAAK,KAAK,EAAC,kBAAkB,GAAG,CAC5B,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["clear","checked","draggable","dropdown","externalLink","indeterminate","inputMonth","inputTel","inputWeek","inputUrl","inputTime","inputDate","inputDatetimeLocal","inputEmail","inputSearch","inputPasswordHide","inputPasswordShow","navigation","next","statusError","statusInfo","statusWarning","defaultLibrary"],"sources":["../../node_modules/@quartzds/generic-icons-core/dist/checked.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-info.svg","../../node_modules/@quartzds/generic-icons-core/dist/status-warning.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 d=\"M6.31 11.86 3.08 8.63l.71-.71 2.52 2.52 5.9-5.94.71.7z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" d=\"m11.43 5.26-.71-.7-2.74 2.76-2.73-2.76-.71.7 2.74 2.77-2.74 2.77.71.71 2.73-2.77 2.74 2.77.71-.71-2.74-2.77z\"/><circle cx=\"8\" cy=\"8\" r=\"7.5\" stroke=\"currentColor\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M4.96 0a2.148 2.148 0 1 1 0 4.297A2.148 2.148 0 0 1 4.96 0zM2.812 17.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm0-7.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm10.079-7.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm0 15.704a2.148 2.148 0 1 0 4.297 0 2.148 2.148 0 0 0-4.297 0zm0-7.852a2.148 2.148 0 1 0 4.297 0 2.148 2.148 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 16 16\"><path d=\"M7.95 12.39 2.06 4.76l.79-.61 5.11 6.62 5.23-6.63.78.62z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M13.16 0H20v6.72h-1.03V1.76l-6.46 6.46-.73-.73 6.46-6.46h-5.08zM0 3h11.05v1.02H1.03v14.95h15V8.53h1.02V20H0z\" clip-rule=\"evenodd\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"none\" stroke=\"currentColor\" d=\"M.5 10h19\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 0Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 0Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M.5 2.5h19m-19 0v15h19v-15m-19 0 9.5 8 9.5-8\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 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 20 20\"><path fill=\"none\" stroke=\"currentColor\" d=\"m.5.5 19 19m-3.443-5.82c1.006-.79 1.997-1.626 3.443-2.239-.463-.892-2.811-6.857-10.245-6.823m2.995 7.646a3.304 3.304 0 1 1-4.624-4.608l-.022-.03s-5.153.05-7.102 3.817c0 0 3.582 6.142 11.56 4.325a8.2 8.2 0 0 0 2.599-1.078m-1.781-4.367a3.305 3.305 0 0 0-2.638-3.237\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"none\" stroke=\"currentColor\" d=\"M9.255 4.258c7.435-.033 9.783 5.931 10.245 6.823-3.036 1.289-4.07 3.558-7.44 4.325C4.082 17.223.5 11.081.5 11.081c1.95-3.767 7.102-3.817 7.102-3.817l.022.03a3.304 3.304 0 1 0 2.617-.568\"/></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 d=\"M3.95 6.96h1c0-1.12.91-2.02 2.02-2.02v-1c-1.67 0-3.02 1.36-3.02 3.02Zm10.08 6.36L9.99 9.28c.63-.79 1.03-1.78 1.03-2.86a4.6 4.6 0 0 0-4.6-4.6c-2.54 0-4.6 2.07-4.6 4.6s2.06 4.6 4.6 4.6c1.09 0 2.08-.4 2.86-1.03l4.04 4.04zm-7.61-3.3c-1.99 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6Z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" stroke-linejoin=\"round\" stroke-miterlimit=\"3.864\" d=\"m1 15.502 2.472 2.272c.66-.017 1.468-1.254 2.528-2.272 2.086-2.002 2.376-2.075 2.176-2.235.161.2-2.006-1.481-2.006-1.481s1.492-1.673 3.368-3.036a117 117 0 0 1 3.442-2.403l.994 2.403s.933-.536 2.688-2.058C18.227 5.337 19.5 4.554 19.5 4.554l-2-2.552S12.82 1.79 6.933 6.228C2.574 9.513 1 15.502 1 15.502Z\"/></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 d=\"m13.31 5 .71-.71-2.32-2.32-.71.71.8.8-.64.64c-.86-.71-1.95-1.16-3.16-1.16S5.7 3.4 4.84 4.11l-.63-.63.8-.8-.71-.71-2.32 2.32.71.71.8-.8.63.63a4.97 4.97 0 0 0-1.14 3.14c0 1.68.84 3.16 2.12 4.07l-1.25 1.25.71.71 1.45-1.45c.61.26 1.28.41 1.98.41s1.31-.14 1.89-.38l1.36 1.36.71-.71-1.15-1.15c1.32-.9 2.19-2.41 2.19-4.13 0-1.19-.44-2.27-1.14-3.13l.64-.64zM8 11.97c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4Zm.49-6.59h-1v2.79l2.16 2.16.71-.71-1.87-1.87z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" stroke-linejoin=\"round\" d=\"M10.01.5v19m0-19a9.5 9.5 0 0 1 9.5 9.5M10.01.5C5.387.5.5 4.5.5 10.5m9.51-10s-5.537 3-5.537 10.716c0 5.284 5.537 8.284 5.537 8.284m0-19s5.426 3 5.426 10.716c0 5.284-5.426 8.284-5.426 8.284m0 0c-5.079 0-9.227-3.986-9.487-9.001M10.01 19.5a9.5 9.5 0 0 0 9.5-9.5m0 0c-.795.277-9.01 3.603-19.018.38\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"M1.5 8.5h17m-12 0v9m7-9v9m-12-6h17m-17 3h17m-17-10h17v13h-17zm6-1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 2 0Zm7 0v2a1 1 0 1 1-2 0v-2a1 1 0 1 1 2 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 16 16\"><path d=\"m4.77 13.97-.62-.78 6.62-5.23-6.62-5.11.61-.79 7.63 5.89z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path stroke=\"currentColor\" d=\"m5.495.5 8.664 8.664c.462.462.462 1.21 0 1.672L5.495 19.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 d=\"m11.43 5.26-.71-.7-2.74 2.76-2.73-2.76-.71.7 2.74 2.77-2.74 2.77.71.71 2.73-2.77 2.74 2.77.71-.71-2.74-2.77z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M9 4h2.41v2.15H9zm.13 12.51V7.97h2.18v8.54z\"/></svg>","<!-- SPDX-FileCopyrightText: © 2025 Schneider Electric SPDX-License-Identifier: Apache-2.0 -->\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M9.57 12.48c-.13-.12-.2-.29-.23-.52l-.67-7-.02-.18c0-.37.13-.67.39-.89s.58-.33.98-.33.72.11.98.33.39.52.39.89l-.02.2-.67 6.98c-.02.23-.1.4-.23.52a.65.65 0 0 1-.46.18.65.65 0 0 1-.46-.18zm-.5 3.57a1.34 1.34 0 0 1-.38-.96 1.32 1.32 0 0 1 1.33-1.35c.38 0 .7.13.95.39s.38.58.38.96a1.32 1.32 0 0 1-1.33 1.35c-.38 0-.7-.13-.95-.39Z\"/></svg>","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\n// FIXME: TypeScript and Webpack can resolve exports from the package.json\n// `exports` field but Rollup can't. `@quartzds/generic-icons-core/*.svg`\n// _should_ work but it doesn't.\n/* eslint-disable import/no-unresolved */\nimport checked from '@quartzds/generic-icons-core/dist/checked.svg'\nimport clear from '@quartzds/generic-icons-core/dist/clear.svg'\nimport draggable from '@quartzds/generic-icons-core/dist/draggable.svg'\nimport dropdown from '@quartzds/generic-icons-core/dist/dropdown.svg'\nimport externalLink from '@quartzds/generic-icons-core/dist/external-link.svg'\nimport indeterminate from '@quartzds/generic-icons-core/dist/indeterminate.svg'\nimport inputDate from '@quartzds/generic-icons-core/dist/input-date.svg'\nimport inputDatetimeLocal from '@quartzds/generic-icons-core/dist/input-datetime-local.svg'\nimport inputEmail from '@quartzds/generic-icons-core/dist/input-email.svg'\nimport inputMonth from '@quartzds/generic-icons-core/dist/input-month.svg'\nimport inputPasswordHide from '@quartzds/generic-icons-core/dist/input-password-hide.svg'\nimport inputPasswordShow from '@quartzds/generic-icons-core/dist/input-password-show.svg'\nimport inputSearch from '@quartzds/generic-icons-core/dist/input-search.svg'\nimport inputTel from '@quartzds/generic-icons-core/dist/input-tel.svg'\nimport inputTime from '@quartzds/generic-icons-core/dist/input-time.svg'\nimport inputUrl from '@quartzds/generic-icons-core/dist/input-url.svg'\nimport inputWeek from '@quartzds/generic-icons-core/dist/input-week.svg'\nimport navigation from '@quartzds/generic-icons-core/dist/navigation.svg'\nimport next from '@quartzds/generic-icons-core/dist/next.svg'\nimport statusError from '@quartzds/generic-icons-core/dist/status-error.svg'\nimport statusInfo from '@quartzds/generic-icons-core/dist/status-info.svg'\nimport statusWarning from '@quartzds/generic-icons-core/dist/status-warning.svg'\n\n/* eslint-enable import/no-unresolved */\nimport type { IconLibrary } from './library'\n\nconst icons: Record<string, string | undefined> = {\n /* eslint-disable @typescript-eslint/naming-convention */\n clear,\n checked,\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 'new-tab-link': externalLink,\n close: statusError,\n 'status-error': statusError,\n 'status-info': statusInfo,\n 'status-success': checked,\n 'status-warning': statusWarning,\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\n.qds-click-target {\n height: var(--qds-experimental-icon-click-target-size);\n left: calc(-1 * (var(--qds-experimental-icon-click-target-size) - 100%) / 2);\n position: absolute;\n top: calc(-1 * (var(--qds-experimental-icon-click-target-size) - 100%) / 2);\n width: var(--qds-experimental-icon-click-target-size);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Prop, State, Watch } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\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 @Element() private readonly host!: HTMLElement\n\n @State() private svg = ''\n\n #inheritedAttributes: Attributes = {}\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 for (const [key, value] of Object.entries(this.#inheritedAttributes))\n if (value !== undefined) svgElement.setAttribute(key, value)\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.#inheritedAttributes = inheritAriaAttributes(this.host)\n await this.setIcon()\n }\n\n public render() {\n return (\n <div class=\"qds-container\">\n <span class=\"qds-icon-wrapper\" innerHTML={this.svg} />\n <div class=\"qds-click-target\" />\n </div>\n )\n }\n}\n"],"version":3}
|