@quartzds/core 1.0.0-beta.81 → 1.0.0-beta.82
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 +2 -2
- package/components/{p-7b04d43e.js → p-002e77af.js} +656 -328
- package/components/p-002e77af.js.map +1 -0
- package/components/{p-9df62f97.js → p-065d722e.js} +18 -7
- package/components/{p-9df62f97.js.map → p-065d722e.js.map} +1 -1
- package/components/{p-d279ae53.js → p-2e88c3cc.js} +11 -3
- package/components/p-2e88c3cc.js.map +1 -0
- package/components/{p-b82bac0a.js → p-84aae53b.js} +20 -11
- package/components/p-84aae53b.js.map +1 -0
- package/components/{p-698edde1.js → p-86778e81.js} +79 -44
- package/components/p-86778e81.js.map +1 -0
- package/components/{p-028b9d2e.js → p-86a0fdf3.js} +11 -4
- package/components/p-86a0fdf3.js.map +1 -0
- package/components/{p-7f6e797a.js → p-938d74a8.js} +17 -12
- package/components/p-938d74a8.js.map +1 -0
- package/components/{p-82461767.js → p-9a9561a8.js} +8 -80
- package/components/p-9a9561a8.js.map +1 -0
- package/components/{p-f5ba28ff.js → p-ae6eda4e.js} +41 -30
- package/components/p-ae6eda4e.js.map +1 -0
- package/components/{p-f85b490c.js → p-ed500f42.js} +72 -28
- package/components/p-ed500f42.js.map +1 -0
- package/components/{p-355efdb1.js → p-ee2621aa.js} +11 -5
- package/components/p-ee2621aa.js.map +1 -0
- package/components/{p-4141d6ed.js → p-efdb8fa2.js} +2 -2
- package/components/p-efdb8fa2.js.map +1 -0
- package/components/qds-badge-counter.js +1 -1
- package/components/qds-badge-indicator.js +1 -1
- package/components/qds-breadcrumb-item.js +65 -15
- package/components/qds-breadcrumb-item.js.map +1 -1
- package/components/qds-button.js +1 -1
- package/components/qds-checkbox.js +1 -1
- package/components/qds-chip.js +46 -25
- package/components/qds-chip.js.map +1 -1
- package/components/qds-dialog.js +9 -4
- package/components/qds-dialog.js.map +1 -1
- package/components/qds-divider.js +1 -1
- package/components/qds-dropdown.js +25 -18
- package/components/qds-dropdown.js.map +1 -1
- package/components/qds-form-message.js +18 -8
- package/components/qds-form-message.js.map +1 -1
- package/components/qds-icon.js +1 -1
- package/components/qds-inline-link.js +18 -17
- package/components/qds-inline-link.js.map +1 -1
- package/components/qds-input.js +116 -51
- package/components/qds-input.js.map +1 -1
- package/components/qds-label.js +1 -1
- package/components/qds-list-item.js +21 -22
- package/components/qds-list-item.js.map +1 -1
- package/components/qds-loader.js +6 -4
- package/components/qds-loader.js.map +1 -1
- package/components/qds-nav-list-item.js +32 -16
- package/components/qds-nav-list-item.js.map +1 -1
- package/components/qds-progress-bar.js +26 -8
- package/components/qds-progress-bar.js.map +1 -1
- package/components/qds-radio.js +25 -24
- package/components/qds-radio.js.map +1 -1
- package/components/qds-select.js +117 -27
- package/components/qds-select.js.map +1 -1
- package/components/qds-standalone-link.js +26 -19
- package/components/qds-standalone-link.js.map +1 -1
- package/components/qds-switch.js +70 -21
- package/components/qds-switch.js.map +1 -1
- package/components/qds-tab.js +71 -45
- package/components/qds-tab.js.map +1 -1
- package/components/qds-tabbar.js +34 -27
- package/components/qds-tabbar.js.map +1 -1
- package/components/qds-table-body.js +3 -3
- package/components/qds-table-body.js.map +1 -1
- package/components/qds-table-cell.js +3 -5
- package/components/qds-table-cell.js.map +1 -1
- package/components/qds-table-head-cell.js +3 -7
- package/components/qds-table-head-cell.js.map +1 -1
- package/components/qds-table-head.js +3 -3
- package/components/qds-table-head.js.map +1 -1
- package/components/qds-table-row.js +3 -3
- package/components/qds-table-row.js.map +1 -1
- package/components/qds-table.js +3 -3
- package/components/qds-table.js.map +1 -1
- package/components/qds-tag.js +1 -1
- package/components/qds-textarea.js +92 -35
- package/components/qds-textarea.js.map +1 -1
- package/components/qds-title.js +1 -1
- package/components/qds-tooltip.js +1 -1
- package/dist/cjs/helpers-cdd65bd0.js.map +1 -1
- package/dist/cjs/{index-a9985af0.js → index-644fe556.js} +720 -273
- package/dist/cjs/index-644fe556.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{library-57845012.js → library-1fda56bc.js} +2 -2
- package/dist/cjs/{library-57845012.js.map → library-1fda56bc.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/qds-badge-counter_2.cjs.entry.js +151 -0
- package/dist/cjs/qds-badge-counter_2.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +53 -12
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-button.cjs.entry.js +73 -38
- package/dist/cjs/qds-button.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-checkbox.cjs.entry.js +67 -22
- package/dist/cjs/qds-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-chip.cjs.entry.js +43 -21
- package/dist/cjs/qds-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-dialog.cjs.entry.js +8 -3
- package/dist/cjs/qds-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-divider.cjs.entry.js +9 -3
- package/dist/cjs/qds-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-dropdown.cjs.entry.js +24 -17
- package/dist/cjs/qds-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-form-message.cjs.entry.js +16 -6
- package/dist/cjs/qds-form-message.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-icon.cjs.entry.js +7 -5
- package/dist/cjs/qds-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-inline-link.cjs.entry.js +16 -15
- package/dist/cjs/qds-inline-link.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-input.cjs.entry.js +109 -41
- package/dist/cjs/qds-input.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-label.cjs.entry.js +16 -5
- package/dist/cjs/qds-label.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-list-item.cjs.entry.js +17 -18
- package/dist/cjs/qds-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-loader.cjs.entry.js +5 -3
- package/dist/cjs/qds-loader.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-nav-list-item.cjs.entry.js +29 -13
- package/dist/cjs/qds-nav-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-progress-bar.cjs.entry.js +26 -8
- package/dist/cjs/qds-progress-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-radio.cjs.entry.js +22 -21
- package/dist/cjs/qds-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-select.cjs.entry.js +114 -23
- package/dist/cjs/qds-select.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-standalone-link.cjs.entry.js +24 -17
- package/dist/cjs/qds-standalone-link.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-switch.cjs.entry.js +68 -18
- package/dist/cjs/qds-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-tab.cjs.entry.js +64 -38
- package/dist/cjs/qds-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-tabbar.cjs.entry.js +27 -20
- package/dist/cjs/qds-tabbar.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table-body.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-body.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table-cell.cjs.entry.js +2 -4
- package/dist/cjs/qds-table-cell.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table-head-cell.cjs.entry.js +2 -6
- package/dist/cjs/qds-table-head-cell.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table-head.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-head.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table-row.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-row.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table.cjs.entry.js +2 -2
- package/dist/cjs/qds-table.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-tag_2.cjs.entry.js +30 -16
- package/dist/cjs/qds-tag_2.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-textarea.cjs.entry.js +90 -30
- package/dist/cjs/qds-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/{qds-badge-counter_3.cjs.entry.js → qds-tooltip.cjs.entry.js} +40 -152
- package/dist/cjs/qds-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/qds.cjs.js +3 -3
- package/dist/cjs/qds.cjs.js.map +1 -1
- package/dist/custom-elements.json +102 -201
- package/dist/docs.d.ts +8 -0
- package/dist/docs.json +870 -630
- package/dist/esm/{helpers-4eb4fa44.js → helpers-d08540f8.js} +2 -2
- package/dist/esm/helpers-d08540f8.js.map +1 -0
- package/dist/esm/{index-5291e8ff.js → index-be1284b6.js} +720 -273
- package/dist/esm/index-be1284b6.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/{library-9edbe354.js → library-a92b7d9e.js} +2 -2
- package/dist/esm/{library-9edbe354.js.map → library-a92b7d9e.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/qds-badge-counter_2.entry.js +146 -0
- package/dist/esm/qds-badge-counter_2.entry.js.map +1 -0
- package/dist/esm/qds-breadcrumb-item.entry.js +54 -13
- package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/qds-button.entry.js +74 -39
- package/dist/esm/qds-button.entry.js.map +1 -1
- package/dist/esm/qds-checkbox.entry.js +69 -24
- package/dist/esm/qds-checkbox.entry.js.map +1 -1
- package/dist/esm/qds-chip.entry.js +44 -22
- package/dist/esm/qds-chip.entry.js.map +1 -1
- package/dist/esm/qds-dialog.entry.js +9 -4
- package/dist/esm/qds-dialog.entry.js.map +1 -1
- package/dist/esm/qds-divider.entry.js +10 -4
- package/dist/esm/qds-divider.entry.js.map +1 -1
- package/dist/esm/qds-dropdown.entry.js +25 -18
- package/dist/esm/qds-dropdown.entry.js.map +1 -1
- package/dist/esm/qds-form-message.entry.js +17 -7
- package/dist/esm/qds-form-message.entry.js.map +1 -1
- package/dist/esm/qds-icon.entry.js +8 -6
- package/dist/esm/qds-icon.entry.js.map +1 -1
- package/dist/esm/qds-inline-link.entry.js +17 -16
- package/dist/esm/qds-inline-link.entry.js.map +1 -1
- package/dist/esm/qds-input.entry.js +111 -43
- package/dist/esm/qds-input.entry.js.map +1 -1
- package/dist/esm/qds-label.entry.js +17 -6
- package/dist/esm/qds-label.entry.js.map +1 -1
- package/dist/esm/qds-list-item.entry.js +18 -19
- package/dist/esm/qds-list-item.entry.js.map +1 -1
- package/dist/esm/qds-loader.entry.js +5 -3
- package/dist/esm/qds-loader.entry.js.map +1 -1
- package/dist/esm/qds-nav-list-item.entry.js +30 -14
- package/dist/esm/qds-nav-list-item.entry.js.map +1 -1
- package/dist/esm/qds-progress-bar.entry.js +26 -8
- package/dist/esm/qds-progress-bar.entry.js.map +1 -1
- package/dist/esm/qds-radio.entry.js +23 -22
- package/dist/esm/qds-radio.entry.js.map +1 -1
- package/dist/esm/qds-select.entry.js +116 -25
- package/dist/esm/qds-select.entry.js.map +1 -1
- package/dist/esm/qds-standalone-link.entry.js +25 -18
- package/dist/esm/qds-standalone-link.entry.js.map +1 -1
- package/dist/esm/qds-switch.entry.js +70 -20
- package/dist/esm/qds-switch.entry.js.map +1 -1
- package/dist/esm/qds-tab.entry.js +65 -39
- package/dist/esm/qds-tab.entry.js.map +1 -1
- package/dist/esm/qds-tabbar.entry.js +28 -21
- package/dist/esm/qds-tabbar.entry.js.map +1 -1
- package/dist/esm/qds-table-body.entry.js +3 -3
- package/dist/esm/qds-table-body.entry.js.map +1 -1
- package/dist/esm/qds-table-cell.entry.js +3 -5
- package/dist/esm/qds-table-cell.entry.js.map +1 -1
- package/dist/esm/qds-table-head-cell.entry.js +3 -7
- package/dist/esm/qds-table-head-cell.entry.js.map +1 -1
- package/dist/esm/qds-table-head.entry.js +3 -3
- package/dist/esm/qds-table-head.entry.js.map +1 -1
- package/dist/esm/qds-table-row.entry.js +3 -3
- package/dist/esm/qds-table-row.entry.js.map +1 -1
- package/dist/esm/qds-table.entry.js +3 -3
- package/dist/esm/qds-table.entry.js.map +1 -1
- package/dist/esm/qds-tag_2.entry.js +31 -17
- package/dist/esm/qds-tag_2.entry.js.map +1 -1
- package/dist/esm/qds-textarea.entry.js +92 -32
- package/dist/esm/qds-textarea.entry.js.map +1 -1
- package/dist/esm/{qds-badge-counter_3.entry.js → qds-tooltip.entry.js} +42 -152
- package/dist/esm/qds-tooltip.entry.js.map +1 -0
- package/dist/esm/qds.js +4 -4
- package/dist/esm/qds.js.map +1 -1
- package/dist/types/components/breadcrumb-item/breadcrumb-item.d.ts +4 -0
- package/dist/types/components/checkbox/checkbox.d.ts +0 -6
- package/dist/types/components/chip/chip.d.ts +0 -6
- package/dist/types/components/input/input.d.ts +1 -29
- package/dist/types/components/select/select.d.ts +0 -6
- package/dist/types/components/switch/switch.d.ts +0 -6
- package/dist/types/components/tag/tag.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -28
- package/dist/types/components.d.ts +623 -91
- package/dist/types/stencil-public-runtime.d.ts +6 -0
- package/dist/vscode.html-custom-data.json +0 -80
- package/hydrate/index.d.ts +28 -5
- package/hydrate/index.js +2748 -1041
- package/hydrate/index.mjs +2748 -1041
- package/package.json +3 -3
- package/components/p-028b9d2e.js.map +0 -1
- package/components/p-355efdb1.js.map +0 -1
- package/components/p-4141d6ed.js.map +0 -1
- package/components/p-698edde1.js.map +0 -1
- package/components/p-7b04d43e.js.map +0 -1
- package/components/p-7f6e797a.js.map +0 -1
- package/components/p-82461767.js.map +0 -1
- package/components/p-b82bac0a.js.map +0 -1
- package/components/p-d279ae53.js.map +0 -1
- package/components/p-f5ba28ff.js.map +0 -1
- package/components/p-f85b490c.js.map +0 -1
- package/dist/cjs/index-a9985af0.js.map +0 -1
- package/dist/cjs/qds-badge-counter_3.cjs.entry.js.map +0 -1
- package/dist/esm/helpers-4eb4fa44.js.map +0 -1
- package/dist/esm/index-5291e8ff.js.map +0 -1
- package/dist/esm/qds-badge-counter_3.entry.js.map +0 -1
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { p as proxyCustomElement, H, h } from './p-
|
|
7
|
-
import { i as inheritAriaAttributes } from './p-
|
|
6
|
+
import { p as proxyCustomElement, H, h } from './p-002e77af.js';
|
|
7
|
+
import { i as inheritAriaAttributes } from './p-efdb8fa2.js';
|
|
8
8
|
|
|
9
9
|
const labelCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-label{box-sizing:border-box;color:var(--qds-theme-control-text-standard);display:inline-flex;gap:var(--qds-text-icon-gap)}.qds-required{color:var(--qds-theme-feedback-field-required);-webkit-user-select:none;user-select:none}[data-size=small]{font:var(--qds-control-small-text)}.qds-inline[data-size=small]{margin-block:var(--qds-control-small-padding-auto-height)}[data-size=standard]{font:var(--qds-control-standard-text)}.qds-inline[data-size=standard]{margin-block:var(--qds-control-standard-padding-auto-height)}[data-size=large]{font:var(--qds-control-large-text)}.qds-inline[data-size=large]{margin-block:var(--qds-control-large-padding-auto-height)}";
|
|
10
10
|
const QdsLabelStyle0 = labelCss;
|
|
@@ -35,20 +35,31 @@ const Label = /*@__PURE__*/ proxyCustomElement(class Label extends H {
|
|
|
35
35
|
this.__registerHost();
|
|
36
36
|
this.__attachShadow();
|
|
37
37
|
_Label_instances.add(this);
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Adds vertical margin to the label for alignment.
|
|
40
|
+
*
|
|
41
|
+
* This is useful when creating inline layouts so that the first lines have
|
|
42
|
+
* the correct vertical centering.
|
|
43
|
+
*/
|
|
39
44
|
this.inline = false;
|
|
45
|
+
/**
|
|
46
|
+
* Specify the labelled item as required by appending a red asterisk (*).
|
|
47
|
+
*/
|
|
40
48
|
this.required = false;
|
|
49
|
+
/**
|
|
50
|
+
* The label's size.
|
|
51
|
+
*/
|
|
41
52
|
this.size = 'standard';
|
|
42
|
-
this
|
|
53
|
+
_Label_inheritedAttributes.set(this, {});
|
|
43
54
|
}
|
|
44
55
|
componentWillLoad() {
|
|
45
56
|
__classPrivateFieldSet(this, _Label_inheritedAttributes, inheritAriaAttributes(this.host), "f");
|
|
46
57
|
}
|
|
47
58
|
render() {
|
|
48
|
-
return (h("span", { key: '
|
|
59
|
+
return (h("span", { key: 'f0e4013ec415bfb235d5c1cf8aba11424e5d1c5f', class: {
|
|
49
60
|
'qds-inline': this.inline,
|
|
50
61
|
'qds-label': true,
|
|
51
|
-
}, "data-size": __classPrivateFieldGet(this, _Label_instances, "a", _Label_computedSize_get), ...__classPrivateFieldGet(this, _Label_inheritedAttributes, "f") }, this.required && h("span", { key: '
|
|
62
|
+
}, "data-size": __classPrivateFieldGet(this, _Label_instances, "a", _Label_computedSize_get), ...__classPrivateFieldGet(this, _Label_inheritedAttributes, "f") }, this.required && h("span", { key: 'b94533963eb74c7c02ddd6823b4aff3f73078254', class: "qds-required" }, "*"), this.text));
|
|
52
63
|
}
|
|
53
64
|
get host() { return this; }
|
|
54
65
|
static get style() { return QdsLabelStyle0; }
|
|
@@ -86,4 +97,4 @@ function defineCustomElement() {
|
|
|
86
97
|
|
|
87
98
|
export { Label as L, defineCustomElement as d };
|
|
88
99
|
|
|
89
|
-
//# sourceMappingURL=p-
|
|
100
|
+
//# sourceMappingURL=p-065d722e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-065d722e.js","mappings":";;;;;;;;AAAA,MAAM,QAAQ,GAAG,0tBAA0tB,CAAC;AAC5uB,uBAAe,QAAQ;;ACDvB;AACA;AACA;;;;;;;;;;;;;;;;;;MAmBa,KAAK;IALlB;;;;;;;;;;;QAY0B,WAAM,GAAY,KAAK,CAAA;;;;QAKvB,aAAQ,GAAY,KAAK,CAAA;;;;QAKzB,SAAI,GAAU,UAAU,CAAA;QAShD,qCAAmC,EAAE,EAAA;KAmCtC;IApBQ,iBAAiB;QACtB,uBAAA,IAAI,8BAAwB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAA,CAAA;KAC7D;IAEM,MAAM;QACX,QACE,6DACE,KAAK,EAAE;gBACL,YAAY,EAAE,IAAI,CAAC,MAAM;gBACzB,WAAW,EAAE,IAAI;aAClB,eACU,uBAAA,IAAI,iDAAc,KAEzB,uBAAA,IAAI,kCAAqB,IAE5B,IAAI,CAAC,QAAQ,IAAI,6DAAM,KAAK,EAAC,cAAc,QAAS,EACpD,IAAI,CAAC,IAAI,CACL,EACR;KACF;;;;;;;;;;IA/BC,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;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/label/label.css?tag=qds-label&encapsulation=shadow","src/components/label/label.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-label {\n box-sizing: border-box;\n color: var(--qds-theme-control-text-standard);\n display: inline-flex;\n gap: var(--qds-text-icon-gap);\n}\n\n.qds-required {\n color: var(--qds-theme-feedback-field-required);\n user-select: none;\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n\n &.qds-inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n\n &.qds-inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n\n &.qds-inline {\n margin-block: var(--qds-control-large-padding-auto-height);\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'\nimport type { Size } from '../shared'\n\n/**\n * `<qds-label>` elements represent a caption for an item in a user interface.\n *\n * @see https://quartz.se.com/build/components/label\n */\n@Component({\n tag: 'qds-label',\n shadow: true,\n styleUrl: 'label.css',\n})\nexport class Label implements ComponentInterface {\n /**\n * Adds vertical margin to the label 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 * Specify the labelled item as required by appending a red asterisk (*).\n */\n @Prop() public readonly required: boolean = false\n\n /**\n * The label's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The label's text.\n */\n @Prop() public readonly text?: string\n\n @Element() private readonly host!: HTMLElement\n\n #inheritedAttributes: Attributes = {}\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 public componentWillLoad(): void {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-inline': this.inline,\n 'qds-label': true,\n }}\n data-size={this.#computedSize}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n >\n {this.required && <span class=\"qds-required\">*</span>}\n {this.text}\n </span>\n )\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { p as proxyCustomElement, H, h } from './p-
|
|
6
|
+
import { p as proxyCustomElement, H, h } from './p-002e77af.js';
|
|
7
7
|
|
|
8
8
|
const badgeIndicatorCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-badge-indicator{align-items:center;background-color:var(--qds-theme-feedback-message-neutral);border-radius:var(--qds-control-toggle-indicator-rounded-border-radius);display:flex;height:var(--qds-badge-indicator-standard-height);justify-content:center;width:var(--qds-badge-indicator-standard-height)}.qds-stroke-ring{border:var(--qds-badge-border-width) solid var(--qds-theme-feedback-message-neutral-contrast)}.qds-sr-only{clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}[data-status=error]{background-color:var(--qds-theme-feedback-message-critical)}.qds-stroke-ring[data-status=error]{border-color:var(--qds-theme-feedback-message-neutral-contrast)}[data-status=info]{background-color:var(--qds-theme-feedback-message-informational)}.qds-stroke-ring[data-status=info]{border-color:var(--qds-theme-feedback-message-neutral-contrast)}[data-status=neutral]{background-color:var(--qds-theme-feedback-availability-unavailable)}.qds-stroke-ring[data-status=neutral]{border-color:var(--qds-theme-feedback-message-neutral-contrast)}[data-status=success]{background-color:var(--qds-theme-signature-color-default)}.qds-stroke-ring[data-status=success]{border-color:var(--qds-theme-feedback-message-neutral-contrast)}[data-status=warning]{background-color:var(--qds-theme-feedback-message-important)}.qds-stroke-ring[data-status=warning]{border-color:var(--qds-theme-feedback-message-neutral-contrast)}[data-size=small]{height:var(--qds-badge-indicator-small-height);width:var(--qds-badge-indicator-small-height)}[data-size=standard]{height:var(--qds-badge-indicator-standard-height);width:var(--qds-badge-indicator-standard-height)}[data-size=large]{height:var(--qds-badge-indicator-large-height);width:var(--qds-badge-indicator-large-height)}[data-size=hero]{height:var(--qds-badge-indicator-hero-height);width:var(--qds-badge-indicator-hero-height)}";
|
|
9
9
|
const QdsBadgeIndicatorStyle0 = badgeIndicatorCss;
|
|
@@ -25,9 +25,17 @@ const BadgeIndicator = /*@__PURE__*/ proxyCustomElement(class BadgeIndicator ext
|
|
|
25
25
|
this.__registerHost();
|
|
26
26
|
this.__attachShadow();
|
|
27
27
|
_BadgeIndicator_instances.add(this);
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* The badge indicator's size.
|
|
30
|
+
*/
|
|
29
31
|
this.size = 'standard';
|
|
32
|
+
/**
|
|
33
|
+
* The badge indicator's status.
|
|
34
|
+
*/
|
|
30
35
|
this.status = 'neutral';
|
|
36
|
+
/**
|
|
37
|
+
* Shows a stroke ring around the badge indicator for better visibility.
|
|
38
|
+
*/
|
|
31
39
|
this.strokeRing = false;
|
|
32
40
|
}
|
|
33
41
|
render() {
|
|
@@ -83,4 +91,4 @@ function defineCustomElement() {
|
|
|
83
91
|
|
|
84
92
|
export { BadgeIndicator as B, defineCustomElement as d };
|
|
85
93
|
|
|
86
|
-
//# sourceMappingURL=p-
|
|
94
|
+
//# sourceMappingURL=p-2e88c3cc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-2e88c3cc.js","mappings":";;;;;;;AAAA,MAAM,iBAAiB,GAAG,i8DAAi8D,CAAC;AAC59D,gCAAe,iBAAiB;;ACDhC;AACA;AACA;;;;;;;;;MAqBa,cAAc;IAL3B;;;;;;;;QAmB0B,SAAI,GAAwB,UAAU,CAAA;;;;QAKtC,WAAM,GAA0B,SAAS,CAAA;;;;QAKzC,eAAU,GAAY,KAAK,CAAA;KA2CpD;IAdQ,MAAM;QACX,QACE,4DACE,KAAK,EAAE;gBACL,qBAAqB,EAAE,IAAI;gBAC3B,iBAAiB,EAAE,IAAI,CAAC,UAAU;aACnC,eACU,uBAAA,IAAI,mEAAc,iBAChB,uBAAA,IAAI,qEAAgB,IAEjC,6DAAM,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,WAAW,CAAQ,CAC/C,EACP;KACF;;;;;;;;;IAvCC,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,KAAK,SAAS,CAAC;QACf,KAAK,SAAS,EAAE;YACd,OAAO,IAAI,CAAC,MAAM,CAAA;SACnB;QACD,SAAS;YACP,OAAO,SAAS,CAAA;SACjB;KACF;AACH,CAAC;IAGC,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/badge-indicator/badge-indicator.css?tag=qds-badge-indicator&encapsulation=shadow","src/components/badge-indicator/badge-indicator.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-badge-indicator {\n align-items: center;\n background-color: var(--qds-theme-feedback-message-neutral);\n border-radius: var(--qds-control-toggle-indicator-rounded-border-radius);\n display: flex;\n height: var(--qds-badge-indicator-standard-height);\n justify-content: center;\n width: var(--qds-badge-indicator-standard-height);\n}\n\n.qds-stroke-ring {\n border: var(--qds-badge-border-width) solid\n var(--qds-theme-feedback-message-neutral-contrast);\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n}\n\n[data-status='error'] {\n background-color: var(--qds-theme-feedback-message-critical);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n}\n\n[data-status='info'] {\n background-color: var(--qds-theme-feedback-message-informational);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n}\n\n[data-status='neutral'] {\n background-color: var(--qds-theme-feedback-availability-unavailable);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n}\n\n[data-status='success'] {\n background-color: var(--qds-theme-signature-color-default);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n}\n\n[data-status='warning'] {\n background-color: var(--qds-theme-feedback-message-important);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-neutral-contrast);\n }\n}\n\n[data-size='small'] {\n height: var(--qds-badge-indicator-small-height);\n width: var(--qds-badge-indicator-small-height);\n}\n\n[data-size='standard'] {\n height: var(--qds-badge-indicator-standard-height);\n width: var(--qds-badge-indicator-standard-height);\n}\n\n[data-size='large'] {\n height: var(--qds-badge-indicator-large-height);\n width: var(--qds-badge-indicator-large-height);\n}\n\n[data-size='hero'] {\n height: var(--qds-badge-indicator-hero-height);\n width: var(--qds-badge-indicator-hero-height);\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 } from '@stencil/core'\n\nimport type { Size, Status } from '../shared'\n\nexport type BadgeIndicatorSize = Size | 'hero'\nexport type BadgeIndicatorStatus = Status | 'neutral'\n\n/**\n * The `<qds-badge-indicator>` element is a small, rounded UI element used to\n * display status indicators. It is designed to draw the user's eye to\n * important or dynamic content by providing a visual cue that an event has\n * occurred or is waiting to be addressed.\n */\n@Component({\n tag: 'qds-badge-indicator',\n shadow: true,\n styleUrl: 'badge-indicator.css',\n})\nexport class BadgeIndicator implements ComponentInterface {\n /**\n * Adds accessible text to the qds-badge-indicator that will be used by\n * screen readers.\n *\n * @example\n * <qds-badge-indicator description=\"success\"></qds-badge-indicator>\n * // This qds-badge-indicator will be read by screen readers as \"success\"\n */\n @Prop() public readonly description?: string\n\n /**\n * The badge indicator's size.\n */\n @Prop() public readonly size?: BadgeIndicatorSize = 'standard'\n\n /**\n * The badge indicator's status.\n */\n @Prop() public readonly status?: BadgeIndicatorStatus = 'neutral'\n\n /**\n * Shows a stroke ring around the badge indicator for better visibility.\n */\n @Prop() public readonly strokeRing: boolean = false\n\n get #computedStatus(): BadgeIndicatorStatus {\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 #computedSize(): BadgeIndicatorSize {\n switch (this.size) {\n case 'hero':\n case 'large':\n case 'small': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n public render() {\n return (\n <div\n class={{\n 'qds-badge-indicator': true,\n 'qds-stroke-ring': this.strokeRing,\n }}\n data-size={this.#computedSize}\n data-status={this.#computedStatus}\n >\n <span class=\"qds-sr-only\">{this.description}</span>\n </div>\n )\n }\n}\n"],"version":3}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { p as proxyCustomElement, H, h, F as Fragment } from './p-
|
|
7
|
-
import { i as inheritAriaAttributes } from './p-
|
|
8
|
-
import { d as defineCustomElement$1 } from './p-
|
|
6
|
+
import { p as proxyCustomElement, H, h, F as Fragment } from './p-002e77af.js';
|
|
7
|
+
import { i as inheritAriaAttributes } from './p-efdb8fa2.js';
|
|
8
|
+
import { d as defineCustomElement$1 } from './p-9a9561a8.js';
|
|
9
9
|
|
|
10
|
-
const tagCss = ":host([hidden]){display:none!important}:host{display:inline-block
|
|
10
|
+
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-result-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-result-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-result-success);color:var(--qds-theme-feedback-result-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);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);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);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)}";
|
|
11
11
|
const QdsTagStyle0 = tagCss;
|
|
12
12
|
|
|
13
13
|
// SPDX-FileCopyrightText: © 2024 Schneider Electric
|
|
@@ -36,21 +36,30 @@ const Tag = /*@__PURE__*/ proxyCustomElement(class Tag extends H {
|
|
|
36
36
|
this.__registerHost();
|
|
37
37
|
this.__attachShadow();
|
|
38
38
|
_Tag_instances.add(this);
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The name of a registered icon library.
|
|
41
|
+
*/
|
|
41
42
|
this.iconLibrary = 'default';
|
|
43
|
+
/**
|
|
44
|
+
* The tag's importance.
|
|
45
|
+
*/
|
|
42
46
|
this.importance = 'standard';
|
|
47
|
+
/**
|
|
48
|
+
* The tag's status.
|
|
49
|
+
*/
|
|
43
50
|
this.status = 'neutral';
|
|
51
|
+
/**
|
|
52
|
+
* The tag's size.
|
|
53
|
+
*/
|
|
44
54
|
this.size = 'standard';
|
|
45
|
-
this
|
|
46
|
-
this.iconDescription = undefined;
|
|
55
|
+
_Tag_inheritedAttributes.set(this, {});
|
|
47
56
|
}
|
|
48
57
|
componentWillLoad() {
|
|
49
58
|
__classPrivateFieldSet(this, _Tag_inheritedAttributes, inheritAriaAttributes(this.host), "f");
|
|
50
59
|
}
|
|
51
60
|
render() {
|
|
52
|
-
return (h("span", { key: '
|
|
53
|
-
this.iconDescription !== '' && (h("span", { key: '
|
|
61
|
+
return (h("span", { key: '374627092aa5279ebaa3f84297e1157a56cca01f', class: "qds-tag", "data-importance": __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedSize_get), "data-status": __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedStatus_get), ...__classPrivateFieldGet(this, _Tag_inheritedAttributes, "f") }, this.iconName !== undefined && this.iconName !== '' && (h(Fragment, null, this.iconDescription !== undefined &&
|
|
62
|
+
this.iconDescription !== '' && (h("span", { key: '5d85fe5b675bd4211befa67ad28dd3368db98994', class: "qds-sr-only" }, this.iconDescription)), h("qds-icon", { key: 'e39f3f03240a915c72cad6143ce5b4b6fc761072', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Tag_instances, "a", _Tag_computedSize_get), library: this.iconLibrary, name: this.iconName }))), h("span", { key: '1f650a5ab5ed763ba212a5f6596dce109e5a8fb5', class: "qds-text" }, this.text)));
|
|
54
63
|
}
|
|
55
64
|
get host() { return this; }
|
|
56
65
|
static get style() { return QdsTagStyle0; }
|
|
@@ -118,4 +127,4 @@ function defineCustomElement() {
|
|
|
118
127
|
|
|
119
128
|
export { Tag as T, defineCustomElement as d };
|
|
120
129
|
|
|
121
|
-
//# sourceMappingURL=p-
|
|
130
|
+
//# sourceMappingURL=p-84aae53b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-84aae53b.js","mappings":";;;;;;;;;AAAA,MAAM,MAAM,GAAG,8tGAA8tG,CAAC;AAC9uG,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;QAchD,mCAAmC,EAAE,EAAA;KA0EtC;IAjCQ,iBAAiB;QACtB,uBAAA,IAAI,4BAAwB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAA,CAAA;KAC7D;IAEM,MAAM;QACX,QACE,6DACE,KAAK,EAAC,SAAS,qBACE,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,KAClD,kBACG,IAAI,CAAC,eAAe,KAAK,SAAS;YACjC,IAAI,CAAC,eAAe,KAAK,EAAE,KACzB,6DAAM,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,eAAe,CAAQ,CACxD,EACH,gFACc,MAAM,EAClB,KAAK,EAAC,UAAU,eACL,uBAAA,IAAI,6CAAc,EAC7B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAE,IAAI,CAAC,QAAQ,GACnB,CACD,CACJ,EACD,6DAAM,KAAK,EAAC,UAAU,IAAE,IAAI,CAAC,IAAI,CAAQ,CACpC,EACR;KACF;;;;;;;;;;;;;IAtEC,QAAQ,IAAI,CAAC,UAAU;QACrB,KAAK,SAAS,CAAC;QACf,KAAK,YAAY,EAAE;YACjB,OAAO,IAAI,CAAC,UAAU,CAAA;SACvB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,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;IAGC,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,KAAK,SAAS,CAAC;QACf,KAAK,SAAS,EAAE;YACd,OAAO,IAAI,CAAC,MAAM,CAAA;SACnB;QACD,SAAS;YACP,OAAO,SAAS,CAAA;SACjB;KACF;AACH,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-result-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-result-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-result-success);\n color: var(--qds-theme-feedback-result-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 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 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 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 @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 public componentWillLoad(): void {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n }\n\n public render() {\n return (\n <span\n class=\"qds-tag\"\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 <span class=\"qds-text\">{this.text}</span>\n </span>\n )\n }\n}\n"],"version":3}
|
|
@@ -3,19 +3,26 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { p as proxyCustomElement, H, c as createEvent, h } from './p-
|
|
7
|
-
import { p as pickFocusEventAttributes,
|
|
8
|
-
import { d as defineCustomElement$4 } from './p-
|
|
9
|
-
import { d as defineCustomElement$3 } from './p-
|
|
10
|
-
import { d as defineCustomElement$2 } from './p-
|
|
11
|
-
import { d as defineCustomElement$1 } from './p-
|
|
6
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './p-002e77af.js';
|
|
7
|
+
import { p as pickFocusEventAttributes, b as isOverflowing, i as inheritAriaAttributes } from './p-efdb8fa2.js';
|
|
8
|
+
import { d as defineCustomElement$4 } from './p-86a0fdf3.js';
|
|
9
|
+
import { d as defineCustomElement$3 } from './p-2e88c3cc.js';
|
|
10
|
+
import { d as defineCustomElement$2 } from './p-9a9561a8.js';
|
|
11
|
+
import { d as defineCustomElement$1 } from './p-ae6eda4e.js';
|
|
12
12
|
|
|
13
|
-
const buttonCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-button,.qds-container,.qds-overflow{width:inherit}.qds-button:disabled,[aria-disabled=true]{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-overflow{line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-action{transform:scaleX(var(--qds-direction-factor,1))}.qds-container{display:grid;grid-template-areas:\"
|
|
13
|
+
const buttonCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-button,.qds-container,.qds-overflow{width:inherit}.qds-button:disabled,[aria-disabled=true]{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-overflow{line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-action{transform:scaleX(var(--qds-direction-factor,1))}.qds-container{display:grid;grid-template-areas:\"d\"}.qds-focus-ring{border-radius:max(1px,var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-top-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n ));grid-area:d;height:calc(100% + var(--qds-control-border-width) - var(--qds-control-border-width-block-end, var(--qds-control-border-width)));isolation:isolate;outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset);pointer-events:none;visibility:hidden;width:calc(100% + var(--qds-control-border-width) - var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n ))}.qds-button{align-items:center;-webkit-appearance:none;appearance:none;background-color:initial;border:none;border-radius:var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n ) var(--qds-control-border-radius-top-right,var(--qds-control-border-radius)) var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n ) var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n );box-sizing:border-box;cursor:pointer;display:inline-flex;grid-area:d;justify-content:center;outline:none;padding-block:0;position:relative;-webkit-print-color-adjust:exact;print-color-adjust:exact;text-align:center;-webkit-user-select:none;user-select:none}.qds-button:any-link{-webkit-text-decoration:none;text-decoration:none}.qds-button:focus-visible~.qds-focus-ring{visibility:visible}.qds-icon{flex-shrink:0}.qds-indicator{inset-block-start:0;inset-inline-end:0;position:absolute;transform:translate(50%,-50%)}[data-size=small]{font:var(--qds-control-small-text)}.qds-button[data-size=small]{gap:var(--qds-control-small-gap-internal);height:var(--qds-control-small-height);padding-inline:var(--qds-control-button-small-padding-horizontal)}.qds-button.qds-icon-only[data-size=small]{padding-inline:0;width:var(--qds-control-small-height)}.qds-icon[data-size=small]{font-size:var(--qds-control-small-icon-size)}[data-size=standard]{font:var(--qds-control-standard-text)}.qds-button[data-size=standard]{gap:var(--qds-control-standard-gap-internal);height:var(--qds-control-standard-height);padding-inline:var(--qds-control-button-standard-padding-horizontal)}.qds-button.qds-icon-only[data-size=standard]{padding-inline:0;width:var(--qds-control-standard-height)}.qds-icon[data-size=standard]{font-size:var(--qds-control-standard-icon-size)}[data-size=large]{font:var(--qds-control-large-text)}.qds-button[data-size=large]{gap:var(--qds-control-large-gap-internal);height:var(--qds-control-large-height);padding-inline:var(--qds-control-button-large-padding-horizontal)}.qds-button.qds-icon-only[data-size=large]{padding-inline:0;width:var(--qds-control-large-height)}.qds-icon[data-size=large]{font-size:var(--qds-control-large-icon-size)}[data-size=hero]{font:var(--qds-control-hero-text)}.qds-button[data-size=hero]{border-radius:var(\n --qds-control-border-radius-top-left,var(--qds-control-hero-border-radius)\n ) var(\n --qds-control-border-radius-top-right,var(--qds-control-hero-border-radius)\n ) var(\n --qds-control-border-radius-bottom-right,var(--qds-control-hero-border-radius)\n ) var(\n --qds-control-border-radius-bottom-left,var(--qds-control-hero-border-radius)\n );gap:var(--qds-control-hero-gap-internal);padding-block:var(--qds-control-hero-padding-auto-height);padding-inline:var(--qds-control-button-hero-padding-horizontal)}.qds-button.qds-icon-only[data-size=hero]{height:var(--qds-control-hero-height);padding-inline:0;width:var(--qds-control-hero-height)}.qds-focus-ring[data-size=hero]{border-radius:max(1px,var(\n --qds-control-border-radius-top-left,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-top-right,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-right,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-left,var(--qds-control-hero-border-radius)\n ))}.qds-icon[data-size=hero]{font-size:var(--qds-control-hero-icon-size)}[data-importance=subdued]{color:var(--qds-theme-link-standard-default)}.qds-button[data-importance=subdued]{border-block-end:var(--qds-control-border-width) solid #0000;padding-inline:0}.qds-button[data-importance=subdued]:hover{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-link-standard-hover);color:var(--qds-theme-link-standard-hover)}.qds-button[data-importance=subdued]:active{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-link-standard-pressed);color:var(--qds-theme-link-standard-pressed)}.qds-button[data-importance=subdued]:not(.qds-icon-only){border-radius:0}.qds-button.qds-icon-only[data-importance=subdued]{border:none;color:var(--qds-theme-control-text-standard)}.qds-button.qds-icon-only[data-importance=subdued]:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-button.qds-icon-only[data-importance=subdued]:active{background-color:var(--qds-theme-interactive-background-pressed)}[data-importance=standard]{color:var(--qds-theme-control-text-standard)}.qds-button[data-importance=standard]{border-color:var(--qds-theme-control-border);border-style:solid;border-width:var(--qds-control-border-width) var(\n --qds-control-border-width-inline-end,var(--qds-control-border-width)\n ) var(--qds-control-border-width-block-end,var(--qds-control-border-width)) var(--qds-control-border-width)}.qds-button[data-importance=standard]:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-button[data-importance=standard]:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-button[data-importance=emphasized]{background-color:var(--qds-theme-signature-color-default);color:var(--qds-theme-signature-color-contrast)}.qds-button[data-importance=emphasized]:hover{background-color:var(--qds-theme-signature-color-hover)}.qds-button[data-importance=emphasized]:active{background-color:var(--qds-theme-signature-color-pressed)}.qds-button[data-importance=destructive]{background-color:var(--qds-theme-feedback-action-destructive-default);color:var(--qds-theme-feedback-action-destructive-contrast)}.qds-button[data-importance=destructive]:hover{background-color:var(--qds-theme-feedback-action-destructive-hover)}.qds-button[data-importance=destructive]:active{background-color:var(--qds-theme-feedback-action-destructive-pressed)}[data-importance=subdued-destructive]{color:var(--qds-theme-feedback-action-destructive-default)}.qds-button[data-importance=subdued-destructive]{border-block-end:var(--qds-control-border-width) solid #0000;padding-inline:0}.qds-button[data-importance=subdued-destructive]:hover{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-feedback-action-destructive-hover);color:var(--qds-theme-feedback-action-destructive-hover)}.qds-button[data-importance=subdued-destructive]:active{border-block-end:var(--qds-control-border-width) solid var(--qds-theme-feedback-action-destructive-pressed);color:var(--qds-theme-feedback-action-destructive-pressed)}.qds-button[data-importance=subdued-destructive]:not(.qds-icon-only){border-radius:0}.qds-button.qds-icon-only[data-importance=subdued-destructive]{border:none}.qds-button.qds-icon-only[data-importance=subdued-destructive]:hover{background-color:var(--qds-theme-interactive-background-hover);color:var(--qds-theme-feedback-action-destructive-default)}.qds-button.qds-icon-only[data-importance=subdued-destructive]:active{background-color:var(--qds-theme-interactive-background-pressed);color:var(--qds-theme-feedback-action-destructive-default)}:is([data-action=dropdown],[data-action=dropdown-close]) .qds-action{margin-inline-start:auto;transition-duration:.3s;transition-property:transform}[data-importance=standard]:is([data-action=dropdown],[data-action=dropdown-close]){background-color:var(--qds-theme-control-input-background)}:is([data-action=dropdown],[data-action=dropdown-close]):not([data-importance=subdued]):not([data-importance=subdued-destructive]){padding-inline:var(--qds-control-input-padding-horizontal)}[data-action=dropdown-close] .qds-action{transform:rotate(-180deg)}";
|
|
14
14
|
const QdsButtonStyle0 = buttonCss;
|
|
15
15
|
|
|
16
16
|
// SPDX-FileCopyrightText: © 2024 Schneider Electric
|
|
17
17
|
//
|
|
18
18
|
// SPDX-License-Identifier: Apache-2.0
|
|
19
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
20
|
+
if (kind === "a" && !f)
|
|
21
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
22
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
23
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
24
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
25
|
+
};
|
|
19
26
|
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
20
27
|
if (kind === "m")
|
|
21
28
|
throw new TypeError("Private method is not writable");
|
|
@@ -25,13 +32,6 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
|
|
|
25
32
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
26
33
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
27
34
|
};
|
|
28
|
-
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
29
|
-
if (kind === "a" && !f)
|
|
30
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
31
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
32
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
33
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
34
|
-
};
|
|
35
35
|
var _Button_instances, _Button_button, _Button_span, _Button_ro, _Button_inheritedAttributes, _Button_ariaExpanded_get, _Button_ariaHaspopup_get, _Button_formElement_get, _Button_buttonType_get, _Button_iconOnly_get, _Button_computedAction_get, _Button_computedActionIcon_get, _Button_computedDisabled_get, _Button_computedImportance_get, _Button_computedSize_get, _Button_onBlur, _Button_onFocus, _Button_buttonRef, _Button_spanRef, _Button_tooltipRef;
|
|
36
36
|
const isCounter = (value) => typeof value === 'string'
|
|
37
37
|
? !Number.isNaN(Number.parseFloat(value))
|
|
@@ -45,6 +45,66 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends H {
|
|
|
45
45
|
this.blurEmitter = createEvent(this, "qdsBlur", 2);
|
|
46
46
|
this.focusEmitter = createEvent(this, "qdsFocus", 2);
|
|
47
47
|
_Button_instances.add(this);
|
|
48
|
+
/**
|
|
49
|
+
* The indicator's status.
|
|
50
|
+
*/
|
|
51
|
+
this.badgeIndicatorStatus = 'neutral';
|
|
52
|
+
/**
|
|
53
|
+
* The name of a registered icon library.
|
|
54
|
+
*/
|
|
55
|
+
this.iconLibrary = 'default';
|
|
56
|
+
/**
|
|
57
|
+
* The button's importance.
|
|
58
|
+
*/
|
|
59
|
+
this.importance = 'standard';
|
|
60
|
+
/**
|
|
61
|
+
* The button's size.
|
|
62
|
+
*/
|
|
63
|
+
this.size = 'standard';
|
|
64
|
+
/**
|
|
65
|
+
* If the button is a submit button, this attribute specifies that the form
|
|
66
|
+
* is not to be
|
|
67
|
+
* [validated](https://developer.mozilla.org/docs/Learn/Forms/Form_validation)
|
|
68
|
+
* when it is submitted. If this attribute is specified, it overrides the
|
|
69
|
+
* [`novalidate`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-novalidate)
|
|
70
|
+
* attribute of the button's form owner.
|
|
71
|
+
*
|
|
72
|
+
* @webnative
|
|
73
|
+
*/
|
|
74
|
+
this.formNoValidate = false;
|
|
75
|
+
/**
|
|
76
|
+
* If the button is a submit button, this attribute is an author-defined name
|
|
77
|
+
* or standardized, underscore-prefixed keyword indicating where to display
|
|
78
|
+
* the response from submitting the form. This is the `name` of, or keyword
|
|
79
|
+
* for, a browsing context (a tab, window, or
|
|
80
|
+
* [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe)).
|
|
81
|
+
* If this attribute is specified, it overrides the
|
|
82
|
+
* [`target`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-target)
|
|
83
|
+
* attribute of the button's form owner. The following keywords have special
|
|
84
|
+
* meanings:
|
|
85
|
+
*
|
|
86
|
+
* - `_blank`: Load the response into a new unnamed browsing context — usually
|
|
87
|
+
* a new tab or window, depending on the user's browser settings.
|
|
88
|
+
* - `_parent`: Load the response into the parent browsing context of the
|
|
89
|
+
* current one. If there is no parent, this option behaves the same way as
|
|
90
|
+
* `_self`.
|
|
91
|
+
* - `_self`: Load the response into the same browsing context as the current
|
|
92
|
+
* one.
|
|
93
|
+
* - `_top`: Load the response into the top-level browsing context (that is,
|
|
94
|
+
* the browsing context that is an ancestor of the current one, and has no
|
|
95
|
+
* parent). If there is no parent, this option behaves the same way as
|
|
96
|
+
* `_self`.
|
|
97
|
+
*
|
|
98
|
+
* @webnative
|
|
99
|
+
*/
|
|
100
|
+
this.formTarget = '_self';
|
|
101
|
+
/**
|
|
102
|
+
* When href is define and the button act as a link (`<a>`), the `rel` will be added to the element.
|
|
103
|
+
*
|
|
104
|
+
* @webnative
|
|
105
|
+
*/
|
|
106
|
+
this.rel = 'noopener';
|
|
107
|
+
this.tooltip = false;
|
|
48
108
|
_Button_button.set(this, void 0);
|
|
49
109
|
_Button_span.set(this, void 0);
|
|
50
110
|
_Button_ro.set(this, void 0);
|
|
@@ -66,31 +126,6 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends H {
|
|
|
66
126
|
// eslint-disable-next-line no-param-reassign
|
|
67
127
|
tooltip.target = __classPrivateFieldGet(this, _Button_button, "f");
|
|
68
128
|
});
|
|
69
|
-
this.action = undefined;
|
|
70
|
-
this.badge = undefined;
|
|
71
|
-
this.badgeDescription = undefined;
|
|
72
|
-
this.badgeIndicatorStatus = 'neutral';
|
|
73
|
-
this.iconName = undefined;
|
|
74
|
-
this.iconLibrary = 'default';
|
|
75
|
-
this.importance = 'standard';
|
|
76
|
-
this.popupType = undefined;
|
|
77
|
-
this.size = 'standard';
|
|
78
|
-
this.text = undefined;
|
|
79
|
-
this.disabled = undefined;
|
|
80
|
-
this.download = undefined;
|
|
81
|
-
this.form = undefined;
|
|
82
|
-
this.formAction = undefined;
|
|
83
|
-
this.formMethod = undefined;
|
|
84
|
-
this.formNoValidate = false;
|
|
85
|
-
this.formTarget = '_self';
|
|
86
|
-
this.href = undefined;
|
|
87
|
-
this.rel = 'noopener';
|
|
88
|
-
this.name = undefined;
|
|
89
|
-
this.target = undefined;
|
|
90
|
-
this.type = undefined;
|
|
91
|
-
this.value = undefined;
|
|
92
|
-
this.tabIndex = undefined;
|
|
93
|
-
this.tooltip = false;
|
|
94
129
|
}
|
|
95
130
|
onClick(event) {
|
|
96
131
|
if (__classPrivateFieldGet(this, _Button_instances, "a", _Button_computedDisabled_get)) {
|
|
@@ -148,15 +183,15 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends H {
|
|
|
148
183
|
const Tag = this.href === undefined ? 'button' : 'a';
|
|
149
184
|
const ariaDisabled = __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedDisabled_get) ? 'true' : undefined;
|
|
150
185
|
const disabledTabIndex = Tag === 'a' ? -1 : undefined;
|
|
151
|
-
return (h("div", { key: '
|
|
186
|
+
return (h("div", { key: '5cdd51227ed36d5eaaba6763656b7957bf70666c', class: "qds-container" }, h(Tag, { key: 'a234f8a9193d6303bd33615b7def0abe838a6461', "aria-disabled": Tag === 'a' ? ariaDisabled : undefined, class: {
|
|
152
187
|
'qds-button': true,
|
|
153
188
|
'qds-icon-only': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
|
|
154
|
-
}, "aria-expanded": __classPrivateFieldGet(this, _Button_instances, "a", _Button_ariaExpanded_get), "aria-haspopup": __classPrivateFieldGet(this, _Button_instances, "a", _Button_ariaHaspopup_get), "data-importance": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), "data-action": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedAction_get), disabled: Tag === 'a' ? undefined : this.disabled, download: Tag === 'a' ? this.download : undefined, href: Tag === 'a' ? this.href : undefined, name: Tag === 'a' ? undefined : this.name, onBlur: __classPrivateFieldGet(this, _Button_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _Button_onFocus, "f"), ref: __classPrivateFieldGet(this, _Button_buttonRef, "f"), rel: Tag === 'a' ? this.rel : undefined, role: Tag === 'a' && this.download !== undefined ? 'button' : undefined, tabIndex: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedDisabled_get) ? disabledTabIndex : this.tabIndex, target: Tag === 'a' ? this.target : undefined, type: Tag === 'a' ? undefined : __classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get), value: Tag === 'a' ? undefined : this.value, ...__classPrivateFieldGet(this, _Button_inheritedAttributes, "f") }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '
|
|
189
|
+
}, "aria-expanded": __classPrivateFieldGet(this, _Button_instances, "a", _Button_ariaExpanded_get), "aria-haspopup": __classPrivateFieldGet(this, _Button_instances, "a", _Button_ariaHaspopup_get), "data-importance": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), "data-action": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedAction_get), disabled: Tag === 'a' ? undefined : this.disabled, download: Tag === 'a' ? this.download : undefined, href: Tag === 'a' ? this.href : undefined, name: Tag === 'a' ? undefined : this.name, onBlur: __classPrivateFieldGet(this, _Button_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _Button_onFocus, "f"), ref: __classPrivateFieldGet(this, _Button_buttonRef, "f"), rel: Tag === 'a' ? this.rel : undefined, role: Tag === 'a' && this.download !== undefined ? 'button' : undefined, tabIndex: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedDisabled_get) ? disabledTabIndex : this.tabIndex, target: Tag === 'a' ? this.target : undefined, type: Tag === 'a' ? undefined : __classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get), value: Tag === 'a' ? undefined : this.value, ...__classPrivateFieldGet(this, _Button_inheritedAttributes, "f") }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '92cab2787f190438cac4ebebf71c3c6a75874671', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), library: this.iconLibrary, name: this.iconName })), this.text !== undefined && this.text !== '' && (h("span", { key: '1ca22863b76c4df621cd9d62d5954e614f63304e', class: { 'qds-overflow': __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get) !== 'hero' }, ref: __classPrivateFieldGet(this, _Button_spanRef, "f") }, this.text)), isIndicator(this.badge) && (h("qds-badge-indicator", { key: '5d82e28096b645f7a620cfc59c9dcc137a470711', class: "qds-indicator", status: this.badgeIndicatorStatus, description: this.badgeDescription, size: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), strokeRing: true })), isCounter(this.badge) && (h("qds-badge-counter", { key: 'a62babec62ca6469137745da0d338be24d5a8209', class: {
|
|
155
190
|
'qds-indicator': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
|
|
156
|
-
}, description: this.badgeDescription, importance: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), size: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), strokeRing: true, value: this.badge })), __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedActionIcon_get) !== undefined && (h("qds-icon", { key: '
|
|
191
|
+
}, description: this.badgeDescription, importance: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), size: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), strokeRing: true, value: this.badge })), __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedActionIcon_get) !== undefined && (h("qds-icon", { key: '77d137f92e445618906b00709ce21788e4bb1b00', "aria-hidden": "true", class: "qds-icon qds-action", "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), library: "core", name: __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedActionIcon_get) }))), h("div", { key: '829f5d15bc99f9e201c5ae047d04e4895adb7452', class: {
|
|
157
192
|
'qds-focus-ring': true,
|
|
158
193
|
'qds-icon-only': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
|
|
159
|
-
}, "data-importance": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get) }), this.tooltip && (h("qds-tooltip", { key: '
|
|
194
|
+
}, "data-importance": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedImportance_get), "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get) }), this.tooltip && (h("qds-tooltip", { key: 'd2c4fc34e0aed857c166fec10ca90b7d547059cd', "aria-hidden": "true", ref: __classPrivateFieldGet(this, _Button_tooltipRef, "f") }, this.text))));
|
|
160
195
|
}
|
|
161
196
|
static get delegatesFocus() { return true; }
|
|
162
197
|
get host() { return this; }
|
|
@@ -318,4 +353,4 @@ function defineCustomElement() {
|
|
|
318
353
|
|
|
319
354
|
export { Button as B, defineCustomElement as d };
|
|
320
355
|
|
|
321
|
-
//# sourceMappingURL=p-
|
|
356
|
+
//# sourceMappingURL=p-86778e81.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-86778e81.js","mappings":";;;;;;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AAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,CAAA;IAE9D,OAAO,OAAO,IAAI,UAAU,CAAA;AAC9B,CAAC;IAGC,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,UAAU,CAAC;QAChB,KAAK,gBAAgB,CAAC;QACtB,KAAK,MAAM,EAAE;YACX,OAAO,IAAI,CAAC,MAAM,CAAA;SACnB;QACD,SAAS;YACP,OAAO,SAAS,CAAA;SACjB;KACF;AACH,CAAC;IAGC,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,UAAU,CAAC;QAChB,KAAK,MAAM,EAAE;YACX,OAAO,IAAI,CAAC,MAAM,CAAA;SACnB;QACD,KAAK,gBAAgB,EAAE;YACrB,OAAO,UAAU,CAAA;SAClB;QACD,SAAS;YACP,OAAO,SAAS,CAAA;SACjB;KACF;AACH,CAAC;IAGC,OAAO,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAA;AAC/B,CAAC;IAGC,QAAQ,IAAI,CAAC,UAAU;QACrB,KAAK,YAAY,CAAC;QAClB,KAAK,SAAS,CAAC;QACf,KAAK,aAAa,CAAC;QACnB,KAAK,qBAAqB,EAAE;YAC1B,OAAO,IAAI,CAAC,UAAU,CAAA;SACvB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;IAGC,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,EAAE;YACX,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/button/button.css?tag=qds-button&encapsulation=shadow","src/components/button/button.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-container,\n.qds-button,\n.qds-overflow {\n width: inherit;\n}\n\n.qds-button:disabled,\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-overflow {\n line-height: normal;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.qds-action {\n transform: scaleX(var(--qds-direction-factor, 1));\n}\n\n.qds-container {\n display: grid;\n grid-template-areas: 'button';\n}\n\n.qds-focus-ring {\n border-radius: max(\n 1px,\n var(\n --qds-control-border-radius-top-left,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-top-right,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-border-radius)\n )\n );\n grid-area: button;\n isolation: isolate;\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n pointer-events: none;\n visibility: hidden;\n width: calc(\n 100% + var(--qds-control-border-width) -\n var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n )\n );\n height: calc(\n 100% + var(--qds-control-border-width) -\n var(--qds-control-border-width-block-end, var(--qds-control-border-width))\n );\n}\n\n.qds-button {\n position: relative;\n align-items: center;\n appearance: none;\n background-color: initial;\n border: none;\n border-radius: var(\n --qds-control-border-radius-top-left,\n var(--qds-control-border-radius)\n )\n var(--qds-control-border-radius-top-right, var(--qds-control-border-radius))\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-border-radius)\n )\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-border-radius)\n );\n box-sizing: border-box;\n cursor: pointer;\n display: inline-flex;\n grid-area: button;\n justify-content: center;\n outline: none;\n padding-block: 0;\n print-color-adjust: exact;\n text-align: center;\n user-select: none;\n\n &:any-link {\n text-decoration: none;\n }\n\n &:focus-visible ~ .qds-focus-ring {\n visibility: visible;\n }\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n.qds-indicator {\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n transform: translate(50%, -50%);\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n\n &.qds-button {\n gap: var(--qds-control-small-gap-internal);\n height: var(--qds-control-small-height);\n padding-inline: var(--qds-control-button-small-padding-horizontal);\n\n &.qds-icon-only {\n padding-inline: 0;\n width: var(--qds-control-small-height);\n }\n }\n\n &.qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n\n &.qds-button {\n gap: var(--qds-control-standard-gap-internal);\n height: var(--qds-control-standard-height);\n padding-inline: var(--qds-control-button-standard-padding-horizontal);\n\n &.qds-icon-only {\n padding-inline: 0;\n width: var(--qds-control-standard-height);\n }\n }\n\n &.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n\n &.qds-button {\n gap: var(--qds-control-large-gap-internal);\n height: var(--qds-control-large-height);\n padding-inline: var(--qds-control-button-large-padding-horizontal);\n\n &.qds-icon-only {\n padding-inline: 0;\n width: var(--qds-control-large-height);\n }\n }\n\n &.qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n}\n\n[data-size='hero'] {\n font: var(--qds-control-hero-text);\n\n &.qds-button {\n border-radius: var(\n --qds-control-border-radius-top-left,\n var(--qds-control-hero-border-radius)\n )\n var(\n --qds-control-border-radius-top-right,\n var(--qds-control-hero-border-radius)\n )\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-hero-border-radius)\n )\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-hero-border-radius)\n );\n gap: var(--qds-control-hero-gap-internal);\n padding-block: var(--qds-control-hero-padding-auto-height);\n padding-inline: var(--qds-control-button-hero-padding-horizontal);\n\n &.qds-icon-only {\n height: var(--qds-control-hero-height);\n padding-inline: 0;\n width: var(--qds-control-hero-height);\n }\n }\n\n &.qds-focus-ring {\n border-radius: max(\n 1px,\n var(\n --qds-control-border-radius-top-left,\n var(--qds-control-hero-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-top-right,\n var(--qds-control-hero-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-hero-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-hero-border-radius)\n )\n );\n }\n\n &.qds-icon {\n font-size: var(--qds-control-hero-icon-size);\n }\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-standard-default);\n\n &.qds-button {\n border-block-end: var(--qds-control-border-width) solid transparent;\n padding-inline: 0;\n\n &:hover {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-hover);\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-link-standard-pressed);\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:not(.qds-icon-only) {\n border-radius: 0;\n }\n\n &.qds-icon-only {\n border: none;\n color: var(--qds-theme-control-text-standard);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-control-text-standard);\n\n &.qds-button {\n border-color: var(--qds-theme-control-border);\n border-style: solid;\n border-width: var(--qds-control-border-width)\n var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n )\n var(--qds-control-border-width-block-end, var(--qds-control-border-width))\n var(--qds-control-border-width);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n}\n\n[data-importance='emphasized'] {\n &.qds-button {\n background-color: var(--qds-theme-signature-color-default);\n color: var(--qds-theme-signature-color-contrast);\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[data-importance='destructive'] {\n &.qds-button {\n background-color: var(--qds-theme-feedback-action-destructive-default);\n color: var(--qds-theme-feedback-action-destructive-contrast);\n\n &:hover {\n background-color: var(--qds-theme-feedback-action-destructive-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-feedback-action-destructive-pressed);\n }\n }\n}\n\n[data-importance='subdued-destructive'] {\n color: var(--qds-theme-feedback-action-destructive-default);\n\n &.qds-button {\n border-block-end: var(--qds-control-border-width) solid transparent;\n padding-inline: 0;\n\n &:hover {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-feedback-action-destructive-hover);\n color: var(--qds-theme-feedback-action-destructive-hover);\n }\n\n &:active {\n border-block-end: var(--qds-control-border-width) solid\n var(--qds-theme-feedback-action-destructive-pressed);\n color: var(--qds-theme-feedback-action-destructive-pressed);\n }\n\n &:not(.qds-icon-only) {\n border-radius: 0;\n }\n\n &.qds-icon-only {\n border: none;\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n }\n }\n}\n\n:is([data-action='dropdown'], [data-action='dropdown-close']) {\n .qds-action {\n margin-inline-start: auto;\n transition-duration: 0.3s;\n transition-property: transform;\n }\n\n &[data-importance='standard'] {\n background-color: var(--qds-theme-control-input-background);\n }\n\n &:not([data-importance='subdued'], [data-importance='subdued-destructive']) {\n padding-inline: var(--qds-control-input-padding-horizontal);\n }\n}\n\n[data-action='dropdown-close'] .qds-action {\n transform: rotate(-180deg);\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 Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n isOverflowing,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, Size } from '../shared'\n\nexport type Action = 'dropdown-close' | 'dropdown' | 'next'\nexport type ButtonImportance =\n | Importance\n | 'destructive'\n | 'subdued-destructive'\nexport type ButtonSize = Size | 'hero'\nexport type ButtonTarget = '_blank' | '_parent' | '_self' | '_top'\nexport type ButtonType = 'button' | 'reset' | 'submit'\nexport type FormMethod = 'dialog' | 'get' | 'post'\nexport type PopupType = 'dialog' | 'grid' | 'menu' | 'tree' | 'true'\n\nconst isCounter = (value: unknown): value is number =>\n typeof value === 'string'\n ? !Number.isNaN(Number.parseFloat(value))\n : typeof value === 'number'\n\nconst isIndicator = (value: unknown): value is '' | true =>\n value === '' || value === true\n\n/**\n * The `<qds-button>` element is an interactive element activated by a user\n * with a mouse, keyboard, finger, voice command, or other assistive technology.\n * Once activated, it then performs a programmable action, such as submitting a\n * [form](https://developer.mozilla.org/docs/Learn/Forms)\n * or opening a dialog.\n *\n * @see https://quartz.se.com/build/components/button\n */\n@Component({\n tag: 'qds-button',\n shadow: { delegatesFocus: true },\n styleUrl: 'button.css',\n})\nexport class Button implements ComponentInterface {\n /**\n * The name of the action icon to render.\n */\n @Prop() public readonly action?: Action\n\n /**\n * Displays an indicator if `true` or the empty string. Otherwise, displays a\n * counter badge if a number or string representing a number is used.\n *\n * @webnative\n */\n @Prop() public readonly badge?: number | string | true\n\n /**\n * The indicator or counter badge's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly badgeDescription?: string\n\n /**\n * The indicator's status.\n */\n @Prop()\n public readonly badgeIndicatorStatus?: HTMLQdsBadgeIndicatorElement['status'] =\n 'neutral'\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The button's importance.\n */\n @Prop() public readonly importance?: ButtonImportance = 'standard'\n\n /**\n * Indicates the type of interactive popup element that can be triggered by\n * the `qds-button`.\n */\n @Prop() public readonly popupType?: PopupType\n\n /**\n * The button's size.\n */\n @Prop() public readonly size?: Size | 'hero' = 'standard'\n\n /**\n * The button's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * Prevents the button from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop()\n public readonly disabled?: boolean\n\n /**\n * Tells the browser to download the linked file as this filename. Only used\n * when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly download?: string\n\n /**\n * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)\n * element to associate the button 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 `<button>` is associated with\n * its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<button>` 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 * @webnative\n */\n @Prop() public readonly form?: string\n\n /**\n * The URL that processes the information submitted by the button. Overrides\n * the [`action`](https://developer.mozilla.org/docs/Web/HTML/Element/button#attr-formaction)\n * attribute of the button's form owner. Does nothing if there is no form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formaction' }) public readonly formAction?: string\n\n /**\n * If the button is a submit button (it's inside/associated with a `<form>`\n * and doesn't have `type=\"button\"`), this attribute specifies the\n * [HTTP method][] used to submit the form, or `dialog` which won't submit\n * the form. Possible values:\n *\n * - `get`: The form data are appended to the form's action URL, with a ? as\n * a separator, and the resulting URL is sent to the server. Use this method\n * when the form has no side effects, like search forms.\n * - `post`: The data from the form are included in the body of the HTTP\n * request when sent to the server. Use when the form contains information\n * that shouldn't be public, like login credentials.\n * - `dialog`: Close the dialog box in which the button finds itself, if any,\n * and do not submit the button's form owner.\n *\n * If specified, this attribute overrides the `method` attribute of the\n * button's form owner.\n *\n * [HTTP method]: https://developer.mozilla.org/docs/Web/HTTP/Methods\n *\n * @webnative\n */\n @Prop({ attribute: 'formmethod' }) public readonly formMethod?: FormMethod\n\n /**\n * If the button is a submit button, this attribute specifies that the form\n * is not to be\n * [validated](https://developer.mozilla.org/docs/Learn/Forms/Form_validation)\n * when it is submitted. If this attribute is specified, it overrides the\n * [`novalidate`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-novalidate)\n * attribute of the button's form owner.\n *\n * @webnative\n */\n @Prop({ attribute: 'formnovalidate' })\n public readonly formNoValidate: boolean = false\n\n /**\n * If the button is a submit button, this attribute is an author-defined name\n * or standardized, underscore-prefixed keyword indicating where to display\n * the response from submitting the form. This is the `name` of, or keyword\n * for, a browsing context (a tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe)).\n * If this attribute is specified, it overrides the\n * [`target`](https://developer.mozilla.org/docs/Web/HTML/Element/form#attr-target)\n * attribute of the button's form owner. The following keywords have special\n * meanings:\n *\n * - `_blank`: Load the response into a new unnamed browsing context — usually\n * a new tab or window, depending on the user's browser settings.\n * - `_parent`: Load the response into the parent browsing context of the\n * current one. If there is no parent, this option behaves the same way as\n * `_self`.\n * - `_self`: Load the response into the same browsing context as the current\n * one.\n * - `_top`: Load the response into the top-level browsing context (that is,\n * the browsing context that is an ancestor of the current one, and has no\n * parent). If there is no parent, this option behaves the same way as\n * `_self`.\n *\n * @webnative\n */\n @Prop({ attribute: 'formtarget' })\n public readonly formTarget: LiteralUnion<ButtonTarget, string> = '_self'\n\n /**\n * When set, the underlying button will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * When href is define and the button act as a link (`<a>`), the `rel` will be added to the element.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string = 'noopener'\n\n /**\n * The name of the button, submitted as a pair with the button's `value` as\n * part of the form data, when that button is used to submit the form.\n * Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target?: LiteralUnion<ButtonTarget, string>\n\n /**\n * The type of button.\n *\n * `button`: The button has no default behavior, and does nothing when\n * pressed by default. It can have client-side scripts listen to the\n * element's events, which are triggered when the events occur.\n *\n * `submit`: The button submits the form data to the server. This is the\n * default if the attribute is not specified for buttons associated with a\n * `<form>`, or if the attribute is an empty or invalid value.\n *\n * `reset`: The button resets all the controls to their initial values.\n *\n * @webnative\n */\n @Prop() public readonly type?: ButtonType\n\n /**\n * Defines the value associated with the button's `name` when it's submitted\n * with the form data. This value is passed to the server in params when the\n * form is submitted using this button. Ignored when `href` is set.\n *\n * @webnative\n */\n @Prop() public readonly value?: string\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLQdsButtonElement\n\n @State() private tabIndex?: number\n\n @State() private tooltip = false\n\n #button?: HTMLAnchorElement | HTMLButtonElement\n\n #span?: HTMLSpanElement\n\n #ro?: ResizeObserver\n\n #inheritedAttributes: Attributes = {}\n\n get #ariaExpanded(): 'false' | 'true' | undefined {\n switch (this.#computedAction) {\n case 'dropdown': {\n return 'false'\n }\n case 'dropdown-close': {\n return 'true'\n }\n default: {\n return undefined\n }\n }\n }\n\n get #ariaHaspopup(): PopupType | undefined {\n switch (this.popupType) {\n case 'dialog':\n case 'grid':\n case 'menu':\n case 'tree':\n case 'true': {\n return this.popupType\n }\n default: {\n return undefined\n }\n }\n }\n\n get #formElement(): HTMLElement | null {\n return this.form !== undefined && this.form !== ''\n ? document.querySelector(`#${this.form}`)\n : this.host.closest('form')\n }\n\n get #buttonType(): ButtonType {\n if (this.type === undefined) return this.#formElement ? 'submit' : 'button'\n return this.type\n }\n\n get #iconOnly(): boolean {\n const hasIcon = this.iconName !== undefined && this.iconName !== ''\n const hasNoLabel = this.text === undefined || this.text === ''\n\n return hasIcon && hasNoLabel\n }\n\n get #computedAction(): Action | undefined {\n switch (this.action) {\n case 'dropdown':\n case 'dropdown-close':\n case 'next': {\n return this.action\n }\n default: {\n return undefined\n }\n }\n }\n\n get #computedActionIcon(): Exclude<Action, 'dropdown-close'> | undefined {\n switch (this.action) {\n case 'dropdown':\n case 'next': {\n return this.action\n }\n case 'dropdown-close': {\n return 'dropdown'\n }\n default: {\n return undefined\n }\n }\n }\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n get #computedImportance(): ButtonImportance {\n switch (this.importance) {\n case 'emphasized':\n case 'subdued':\n case 'destructive':\n case 'subdued-destructive': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedSize(): ButtonSize {\n switch (this.size) {\n case 'small':\n case 'large':\n case 'hero': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n if (this.#buttonType === 'button' || !this.#formElement) return\n event.preventDefault()\n\n const fakeButton = document.createElement('button')\n fakeButton.type = this.#buttonType\n if (this.name !== undefined) fakeButton.name = this.name\n if (this.value !== undefined) fakeButton.value = this.value\n if (this.formAction !== undefined) fakeButton.formAction = this.formAction\n if (this.formMethod !== undefined) fakeButton.formMethod = this.formMethod\n fakeButton.formNoValidate = this.formNoValidate\n fakeButton.formTarget = this.formTarget\n fakeButton.style.display = 'none'\n\n this.#formElement.append(fakeButton)\n fakeButton.click()\n fakeButton.remove()\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('text')\n protected textChanged(): void {\n if (this.#ro) this.#ro.disconnect()\n\n if (!this.#span) return\n\n this.tooltip = isOverflowing(this.#span)\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.tooltip = isOverflowing(spanEntry.target)\n })\n this.#ro.observe(this.#span)\n }\n\n public componentWillLoad(): void {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n this.textChanged()\n }\n\n public disconnectedCallback(): void {\n if (this.#ro) this.#ro.disconnect()\n }\n\n public render() {\n const Tag = this.href === undefined ? 'button' : 'a'\n const ariaDisabled = this.#computedDisabled ? 'true' : undefined\n const disabledTabIndex = Tag === 'a' ? -1 : undefined\n\n return (\n <div class=\"qds-container\">\n <Tag\n aria-disabled={Tag === 'a' ? ariaDisabled : undefined}\n class={{\n 'qds-button': true,\n 'qds-icon-only': this.#iconOnly,\n }}\n aria-expanded={this.#ariaExpanded}\n aria-haspopup={this.#ariaHaspopup}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n data-action={this.#computedAction}\n disabled={Tag === 'a' ? undefined : this.disabled}\n download={Tag === 'a' ? this.download : undefined}\n href={Tag === 'a' ? this.href : undefined}\n name={Tag === 'a' ? undefined : this.name}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n ref={this.#buttonRef}\n rel={Tag === 'a' ? this.rel : undefined}\n role={\n Tag === 'a' && this.download !== undefined ? 'button' : undefined\n }\n tabIndex={this.#computedDisabled ? disabledTabIndex : this.tabIndex}\n target={Tag === 'a' ? this.target : undefined}\n type={Tag === 'a' ? undefined : this.#buttonType}\n value={Tag === 'a' ? undefined : this.value}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\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 {this.text !== undefined && this.text !== '' && (\n <span\n class={{ 'qds-overflow': this.#computedSize !== 'hero' }}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n )}\n {isIndicator(this.badge) && (\n <qds-badge-indicator\n class=\"qds-indicator\"\n status={this.badgeIndicatorStatus}\n description={this.badgeDescription}\n size={this.#computedSize}\n strokeRing\n />\n )}\n {isCounter(this.badge) && (\n <qds-badge-counter\n class={{\n 'qds-indicator': this.#iconOnly,\n }}\n description={this.badgeDescription}\n importance={this.#computedImportance}\n size={this.#computedSize}\n strokeRing\n value={this.badge}\n />\n )}\n {this.#computedActionIcon !== undefined && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon qds-action\"\n data-size={this.#computedSize}\n library=\"core\"\n name={this.#computedActionIcon}\n />\n )}\n </Tag>\n <div\n class={{\n 'qds-focus-ring': true,\n 'qds-icon-only': this.#iconOnly,\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n />\n {this.tooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n )}\n </div>\n )\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 readonly #buttonRef = (\n button?: HTMLAnchorElement | HTMLButtonElement,\n ): void => {\n this.#button = button\n }\n\n readonly #spanRef = (span?: HTMLSpanElement): void => {\n this.#span = span\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip)\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.#button\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { p as proxyCustomElement, H, h } from './p-
|
|
6
|
+
import { p as proxyCustomElement, H, h } from './p-002e77af.js';
|
|
7
7
|
|
|
8
8
|
const badgeCounterCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-badge-counter{align-items:center;background-color:var(--qds-theme-feedback-message-neutral);border-radius:var(--qds-control-toggle-indicator-rounded-border-radius);color:var(--qds-theme-feedback-message-neutral-contrast);display:flex;font:var(--qds-badge-standard-text);height:var(--qds-badge-counter-standard-height);justify-content:center;margin:0;padding-inline:var(--qds-badge-standard-padding-horizontal);text-align:center}.qds-stroke-ring{border:var(--qds-badge-border-width) solid var(--qds-theme-feedback-message-neutral-contrast)}.qds-sr-only{clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}[data-importance=emphasized]{background-color:var(--qds-theme-signature-color-contrast);color:var(--qds-theme-signature-color-default)}.qds-stroke-ring[data-importance=emphasized]{border-color:var(--qds-theme-signature-color-default)}[data-importance=subdued]{background-color:var(--qds-theme-feedback-message-informational);color:var(--qds-theme-feedback-message-informational-contrast)}.qds-stroke-ring[data-importance=subdued]{border-color:var(--qds-theme-feedback-message-informational-contrast)}[data-importance=destructive]{background-color:var(--qds-theme-feedback-message-critical-contrast);color:var(--qds-theme-feedback-message-critical)}.qds-stroke-ring[data-importance=destructive]{border-color:var(--qds-theme-feedback-message-critical)}[data-importance=subdued-destructive]{background-color:var(--qds-theme-feedback-message-critical);color:var(--qds-theme-feedback-message-critical-contrast)}.qds-stroke-ring[data-importance=subdued-destructive]{border-color:var(--qds-theme-feedback-message-critical-contrast)}[data-size=small]{font:var(--qds-badge-small-text);height:var(--qds-badge-counter-small-height);padding-inline:var(--qds-badge-small-padding-horizontal)}[data-size=large]{font:var(--qds-badge-large-text);height:var(--qds-badge-counter-large-height);padding-inline:var(--qds-badge-large-padding-horizontal)}[data-size=hero]{font:var(--qds-badge-hero-text);height:var(--qds-badge-counter-hero-height);padding-inline:var(--qds-badge-hero-padding-horizontal)}";
|
|
9
9
|
const QdsBadgeCounterStyle0 = badgeCounterCss;
|
|
@@ -25,11 +25,18 @@ const BadgeCounter = /*@__PURE__*/ proxyCustomElement(class BadgeCounter extends
|
|
|
25
25
|
this.__registerHost();
|
|
26
26
|
this.__attachShadow();
|
|
27
27
|
_BadgeCounter_instances.add(this);
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* The badge counter's importance.
|
|
30
|
+
*/
|
|
29
31
|
this.importance = 'standard';
|
|
32
|
+
/**
|
|
33
|
+
* The badge counter's size.
|
|
34
|
+
*/
|
|
30
35
|
this.size = 'standard';
|
|
36
|
+
/**
|
|
37
|
+
* Shows a stroke ring around the component for better visibility
|
|
38
|
+
*/
|
|
31
39
|
this.strokeRing = false;
|
|
32
|
-
this.value = undefined;
|
|
33
40
|
}
|
|
34
41
|
render() {
|
|
35
42
|
return (h("span", { key: 'c10f61ebe0ba000dad466c46e9565a5422cf8207', class: {
|
|
@@ -93,4 +100,4 @@ function defineCustomElement() {
|
|
|
93
100
|
|
|
94
101
|
export { BadgeCounter as B, defineCustomElement as d };
|
|
95
102
|
|
|
96
|
-
//# sourceMappingURL=p-
|
|
103
|
+
//# sourceMappingURL=p-86a0fdf3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-86a0fdf3.js","mappings":";;;;;;;AAAA,MAAM,eAAe,GAAG,4qEAA4qE,CAAC;AACrsE,8BAAe,eAAe;;ACD9B;AACA;AACA;;;;;;;;;MAwBa,YAAY;IALzB;;;;;;;;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[],"sources":["src/components/badge-counter/badge-counter.css?tag=qds-badge-counter&encapsulation=shadow","src/components/badge-counter/badge-counter.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-badge-counter {\n align-items: center;\n background-color: var(--qds-theme-feedback-message-neutral);\n border-radius: var(--qds-control-toggle-indicator-rounded-border-radius);\n color: var(--qds-theme-feedback-message-neutral-contrast);\n display: flex;\n font: var(--qds-badge-standard-text);\n height: var(--qds-badge-counter-standard-height);\n justify-content: center;\n margin: 0;\n padding-inline: var(--qds-badge-standard-padding-horizontal);\n text-align: center;\n}\n\n.qds-stroke-ring {\n border: var(--qds-badge-border-width) solid\n var(--qds-theme-feedback-message-neutral-contrast);\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n}\n\n[data-importance='emphasized'] {\n background-color: var(--qds-theme-signature-color-contrast);\n color: var(--qds-theme-signature-color-default);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-signature-color-default);\n }\n}\n\n[data-importance='subdued'] {\n background-color: var(--qds-theme-feedback-message-informational);\n color: var(--qds-theme-feedback-message-informational-contrast);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-informational-contrast);\n }\n}\n\n[data-importance='destructive'] {\n background-color: var(--qds-theme-feedback-message-critical-contrast);\n color: var(--qds-theme-feedback-message-critical);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-critical);\n }\n}\n\n[data-importance='subdued-destructive'] {\n color: var(--qds-theme-feedback-message-critical-contrast);\n background-color: var(--qds-theme-feedback-message-critical);\n\n &.qds-stroke-ring {\n border-color: var(--qds-theme-feedback-message-critical-contrast);\n }\n}\n\n[data-size='small'] {\n font: var(--qds-badge-small-text);\n height: var(--qds-badge-counter-small-height);\n padding-inline: var(--qds-badge-small-padding-horizontal);\n}\n\n[data-size='large'] {\n font: var(--qds-badge-large-text);\n height: var(--qds-badge-counter-large-height);\n padding-inline: var(--qds-badge-large-padding-horizontal);\n}\n\n[data-size='hero'] {\n font: var(--qds-badge-hero-text);\n height: var(--qds-badge-counter-hero-height);\n padding-inline: var(--qds-badge-hero-padding-horizontal);\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 } from '@stencil/core'\n\nimport type { Importance, Size } from '../shared'\n\nexport type BadgeCounterImportance =\n | Importance\n | 'destructive'\n | 'subdued-destructive'\nexport type BadgeCounterSize = Size | 'hero'\n\n/**\n * The `<qds-badge-counter>` element is a small, rounded UI element used to\n * display numerical values or counts. It is designed to draw the user's eye to\n * important or dynamic content by providing a visual cue that a countable\n * event or item has occurred or is waiting to be addressed.\n */\n@Component({\n tag: 'qds-badge-counter',\n shadow: true,\n styleUrl: 'badge-counter.css',\n})\nexport class BadgeCounter implements ComponentInterface {\n /**\n * Adds accessible text to the qds-badge-counter that will be used by screen\n * readers.\n *\n * @example\n * <qds-badge-counter value={2} description=\"new notifications\"></qds-badge-counter>\n * // This qds-badge-counter will be read by screen readers as \"two new notifications\"\n */\n @Prop() public readonly description?: string\n\n /**\n * The badge counter's importance.\n */\n @Prop() public readonly importance?: BadgeCounterImportance = 'standard'\n\n /**\n * The badge counter's size.\n */\n @Prop() public readonly size?: BadgeCounterSize = 'standard'\n\n /**\n * Shows a stroke ring around the component for better visibility\n */\n @Prop() public readonly strokeRing: boolean = false\n\n /**\n * The badge-counter's value.\n */\n @Prop() public readonly value!: number | string\n\n get #computedValue(): string {\n const value =\n typeof this.value === 'string'\n ? Number.parseInt(this.value, 10)\n : // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n (this.value ?? Number.NaN)\n if (Number.isNaN(value) || value < 0) return ''\n\n return value < 100 ? value.toString() : '99+'\n }\n\n get #computedImportance(): BadgeCounterImportance {\n switch (this.importance) {\n case 'subdued':\n case 'destructive':\n case 'subdued-destructive':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedSize(): BadgeCounterSize {\n switch (this.size) {\n case 'hero':\n case 'large':\n case 'small': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-badge-counter': true,\n 'qds-stroke-ring': this.strokeRing,\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n >\n {this.#computedValue}\n <span class=\"qds-sr-only\">{this.description}</span>\n </span>\n )\n }\n}\n"],"version":3}
|