@quartzds/core 1.0.0-beta.129 → 1.0.0-beta.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/components/{p-CQ-Ilm5d.js → p-B9xuNEzc.js} +55 -10
- package/components/p-B9xuNEzc.js.map +1 -0
- package/components/{p-CrzaI1TQ.js → p-BHBodFuD.js} +5 -5
- package/components/{p-CrzaI1TQ.js.map → p-BHBodFuD.js.map} +1 -1
- package/components/{p-Cevyg51v.js → p-BLA62eFO.js} +35 -18
- package/components/p-BLA62eFO.js.map +1 -0
- package/components/{p-DEa0r_EV.js → p-C-pZcrGt.js} +5 -5
- package/components/{p-DEa0r_EV.js.map → p-C-pZcrGt.js.map} +1 -1
- package/components/{p-CnWdHgve.js → p-Cb4tcewD.js} +10 -8
- package/components/p-Cb4tcewD.js.map +1 -0
- package/components/{p-BJEvSqqL.js → p-Cb5Tgh-o.js} +3 -3
- package/components/{p-BJEvSqqL.js.map → p-Cb5Tgh-o.js.map} +1 -1
- package/components/{p-DjZ2J7fQ.js → p-D2BuSQre.js} +3 -3
- package/components/{p-DjZ2J7fQ.js.map → p-D2BuSQre.js.map} +1 -1
- package/components/{p-cw45QxUT.js → p-DL21f4D7.js} +3 -3
- package/components/{p-cw45QxUT.js.map → p-DL21f4D7.js.map} +1 -1
- package/components/{p-BoqB4ddF.js → p-eUDNu0SE.js} +3 -3
- package/components/{p-BoqB4ddF.js.map → p-eUDNu0SE.js.map} +1 -1
- package/components/qds-action-item.js +38 -17
- package/components/qds-action-item.js.map +1 -1
- package/components/qds-avatar.js +1 -1
- package/components/qds-avatar.js.map +1 -1
- package/components/qds-breadcrumb-item.js +2 -2
- package/components/qds-button.js +10 -8
- package/components/qds-button.js.map +1 -1
- package/components/qds-checkbox.js +1 -1
- package/components/qds-chip.js +3 -3
- package/components/qds-dialog.js +3 -3
- package/components/qds-dropdown.js +1 -1
- package/components/qds-icon-button.js +1 -1
- package/components/qds-icon-tab.js +3 -3
- package/components/qds-inline-link.js +5 -3
- package/components/qds-inline-link.js.map +1 -1
- package/components/qds-input.js +3 -3
- package/components/qds-input.js.map +1 -1
- package/components/qds-label.js +2 -2
- package/components/qds-list-item.js +66 -30
- package/components/qds-list-item.js.map +1 -1
- package/components/qds-menu-item.js +7 -7
- package/components/qds-menu-item.js.map +1 -1
- package/components/qds-mini-button.js +1 -1
- package/components/qds-radio.js +1 -1
- package/components/qds-select.js +2 -2
- package/components/qds-standalone-link.js +5 -3
- package/components/qds-standalone-link.js.map +1 -1
- package/components/qds-switch.js +1 -1
- package/components/qds-tab.js +3 -3
- package/components/qds-tabbar.js +3 -3
- package/components/qds-tag.js +1 -1
- package/components/qds-textarea.js +1 -1
- package/components/qds-title.js +1 -1
- package/components/qds-tooltip.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qds-action-item.cjs.entry.js +32 -12
- package/dist/cjs/qds-action-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-avatar.cjs.entry.js +1 -1
- package/dist/cjs/qds-avatar.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-button.cjs.entry.js +8 -6
- package/dist/cjs/qds-button.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/qds-divider.qds-icon-button.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-divider_2.cjs.entry.js +6 -4
- package/dist/cjs/qds-dropdown.cjs.entry.js +32 -15
- package/dist/cjs/qds-dropdown.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-inline-link.cjs.entry.js +4 -2
- package/dist/cjs/qds-inline-link.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-input.cjs.entry.js +1 -1
- package/dist/cjs/qds-input.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-list-item.cjs.entry.js +55 -22
- package/dist/cjs/qds-list-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-menu-item.cjs.entry.js +3 -3
- package/dist/cjs/qds-menu-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-select.cjs.entry.js +1 -1
- package/dist/cjs/qds-standalone-link.cjs.entry.js +4 -2
- package/dist/cjs/qds-standalone-link.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-title.cjs.entry.js +1 -1
- package/dist/cjs/qds-tooltip.cjs.entry.js +52 -7
- package/dist/cjs/qds-tooltip.entry.cjs.js.map +1 -1
- package/dist/cjs/qds.cjs.js +1 -1
- package/dist/custom-elements.json +132 -10
- package/dist/docs.json +13 -4
- package/dist/esm/{helpers-_a9kqEyo.js → helpers-BIo9VDPx.js} +3 -3
- package/dist/esm/{helpers-_a9kqEyo.js.map → helpers-BIo9VDPx.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qds-action-item.entry.js +34 -14
- package/dist/esm/qds-action-item.entry.js.map +1 -1
- package/dist/esm/qds-avatar.entry.js +1 -1
- package/dist/esm/qds-avatar.entry.js.map +1 -1
- package/dist/esm/qds-breadcrumb-item.entry.js +1 -1
- package/dist/esm/qds-button.entry.js +9 -7
- package/dist/esm/qds-button.entry.js.map +1 -1
- package/dist/esm/qds-checkbox_2.entry.js +3 -3
- package/dist/esm/qds-chip.entry.js +1 -1
- package/dist/esm/qds-dialog.entry.js +1 -1
- package/dist/esm/qds-divider.qds-icon-button.entry.js.map +1 -1
- package/dist/esm/qds-divider_2.entry.js +7 -5
- package/dist/esm/qds-dropdown.entry.js +33 -16
- package/dist/esm/qds-dropdown.entry.js.map +1 -1
- package/dist/esm/qds-icon-tab.entry.js +1 -1
- package/dist/esm/qds-inline-link.entry.js +5 -3
- package/dist/esm/qds-inline-link.entry.js.map +1 -1
- package/dist/esm/qds-input.entry.js +2 -2
- package/dist/esm/qds-input.entry.js.map +1 -1
- package/dist/esm/qds-label.entry.js +1 -1
- package/dist/esm/qds-list-item.entry.js +56 -23
- package/dist/esm/qds-list-item.entry.js.map +1 -1
- package/dist/esm/qds-menu-item.entry.js +4 -4
- package/dist/esm/qds-menu-item.entry.js.map +1 -1
- package/dist/esm/qds-mini-button.entry.js +1 -1
- package/dist/esm/qds-select.entry.js +2 -2
- package/dist/esm/qds-standalone-link.entry.js +5 -3
- package/dist/esm/qds-standalone-link.entry.js.map +1 -1
- package/dist/esm/qds-switch.entry.js +1 -1
- package/dist/esm/qds-tab.entry.js +1 -1
- package/dist/esm/qds-tabbar.entry.js +1 -1
- package/dist/esm/qds-tag.entry.js +1 -1
- package/dist/esm/qds-textarea.entry.js +1 -1
- package/dist/esm/qds-title.entry.js +1 -1
- package/dist/esm/qds-tooltip.entry.js +53 -8
- package/dist/esm/qds-tooltip.entry.js.map +1 -1
- package/dist/esm/qds.js +1 -1
- package/dist/types/components/action-item/action-item.d.ts +3 -0
- package/dist/types/components/list-item/list-item.d.ts +1 -0
- package/hydrate/index.js +209 -86
- package/hydrate/index.mjs +209 -86
- package/package.json +1 -1
- package/styles/core.css +7 -19
- package/components/p-CQ-Ilm5d.js.map +0 -1
- package/components/p-Cevyg51v.js.map +0 -1
- package/components/p-CnWdHgve.js.map +0 -1
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, c as createEvent, d as readTask, h } from './p-D2489VzR.js';
|
|
7
|
-
import { p as pickFocusEventAttributes,
|
|
7
|
+
import { i as ignorePromise, p as pickFocusEventAttributes, a as invariant, b as isEllipsisActive } from './p-eUDNu0SE.js';
|
|
8
8
|
import { d as defineCustomElement$3 } from './p-fKK7EmM2.js';
|
|
9
|
-
import { d as defineCustomElement$2 } from './p-
|
|
9
|
+
import { d as defineCustomElement$2 } from './p-B9xuNEzc.js';
|
|
10
10
|
|
|
11
11
|
const actionItemCss = ":host([hidden]){display:none!important}:host{display:block}:host(:focus-visible){border-radius:var(--qds-control-border-radius);box-shadow:0 0 0 var(--qds-focus-heavy-border-width) var(--qds-theme-focus-border);outline:var(--qds-theme-focus-border-contrast) solid var(--qds-focus-light-border-width);outline-offset:0}.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-icon{flex-shrink:0}.qds-text{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[aria-disabled=true]{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-action-item{align-items:center;border:none;border-radius:var(--qds-control-border-radius);box-sizing:border-box;cursor:pointer;display:flex}.qds-action-item:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-action-item:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-action-item[data-size=small]{gap:var(--qds-list-item-small-gap-internal);min-height:var(--qds-list-item-small-height);padding-block:var(--qds-list-item-small-padding-vertical);padding-inline:var(--qds-list-item-small-padding-horizontal)}[data-size=small] .qds-icon{height:var(--qds-control-small-icon-size);width:var(--qds-control-small-icon-size)}[data-size=small] .qds-text{font:var(--qds-list-item-small-title)}.qds-action-item[data-size=standard]{gap:var(--qds-list-item-standard-gap-internal);min-height:var(--qds-list-item-standard-height);padding-block:var(--qds-list-item-standard-padding-vertical);padding-inline:var(--qds-list-item-standard-padding-horizontal)}[data-size=standard] .qds-icon{height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}[data-size=standard] .qds-text{font:var(--qds-list-item-standard-title)}.qds-action-item[data-size=large]{gap:var(--qds-list-item-large-gap-internal);min-height:var(--qds-list-item-large-height);padding-block:var(--qds-list-item-large-padding-vertical);padding-inline:var(--qds-list-item-large-padding-horizontal)}[data-size=large] .qds-icon{height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}[data-size=large] .qds-text{font:var(--qds-list-item-large-title)}[data-importance=standard] .qds-text{color:var(--qds-theme-text-standard)}[data-importance=standard] .qds-icon{color:var(--qds-theme-control-text-standard)}.qds-action-item[data-importance=emphasized] .qds-icon,.qds-action-item[data-importance=emphasized] .qds-text{color:var(--qds-theme-signature-color-default)}.qds-action-item[data-importance=emphasized]:hover .qds-icon,.qds-action-item[data-importance=emphasized]:hover .qds-text{color:var(--qds-theme-signature-color-hover)}.qds-action-item[data-importance=emphasized]:active .qds-icon,.qds-action-item[data-importance=emphasized]:active .qds-text{color:var(--qds-theme-signature-color-pressed)}.qds-action-item[data-importance=subdued] .qds-icon,.qds-action-item[data-importance=subdued] .qds-text{color:var(--qds-theme-link-standard-default)}.qds-action-item[data-importance=subdued]:hover .qds-icon,.qds-action-item[data-importance=subdued]:hover .qds-text{color:var(--qds-theme-link-standard-hover)}.qds-action-item[data-importance=subdued]:active .qds-icon,.qds-action-item[data-importance=subdued]:active .qds-text{color:var(--qds-theme-link-standard-pressed)}.qds-action-item[data-importance=destructive] .qds-icon,.qds-action-item[data-importance=destructive] .qds-text{color:var(--qds-theme-feedback-action-destructive-default)}.qds-action-item[data-importance=destructive]:hover .qds-icon,.qds-action-item[data-importance=destructive]:hover .qds-text{color:var(--qds-theme-feedback-action-destructive-hover)}.qds-action-item[data-importance=destructive]:active .qds-icon,.qds-action-item[data-importance=destructive]:active .qds-text{color:var(--qds-theme-feedback-action-destructive-pressed)}";
|
|
12
12
|
|
|
@@ -29,7 +29,7 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
|
|
|
29
29
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
30
30
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
31
31
|
};
|
|
32
|
-
var _ActionItem_instances, _ActionItem_ro,
|
|
32
|
+
var _ActionItem_instances, _ActionItem_ro, _ActionItem_span, _ActionItem_tooltipElement, _ActionItem_computedSize_get, _ActionItem_computedImportance_get, _ActionItem_computedDisabled_get, _ActionItem_spanRef, _ActionItem_tooltipRef;
|
|
33
33
|
const ActionItem = /*@__PURE__*/ proxyCustomElement(class ActionItem extends H {
|
|
34
34
|
constructor(registerHost) {
|
|
35
35
|
super();
|
|
@@ -60,23 +60,30 @@ const ActionItem = /*@__PURE__*/ proxyCustomElement(class ActionItem extends H {
|
|
|
60
60
|
this.size = 'standard';
|
|
61
61
|
this.tooltip = false;
|
|
62
62
|
_ActionItem_ro.set(this, void 0);
|
|
63
|
-
_ActionItem_actionItem.set(this, void 0);
|
|
64
63
|
_ActionItem_span.set(this, void 0);
|
|
65
|
-
|
|
66
|
-
__classPrivateFieldSet(this, _ActionItem_actionItem, actionItem, "f");
|
|
67
|
-
});
|
|
64
|
+
_ActionItem_tooltipElement.set(this, void 0);
|
|
68
65
|
_ActionItem_spanRef.set(this, (span) => {
|
|
69
66
|
__classPrivateFieldSet(this, _ActionItem_span, span, "f");
|
|
70
67
|
});
|
|
71
68
|
_ActionItem_tooltipRef.set(this, (tooltip) => {
|
|
72
|
-
|
|
73
|
-
// eslint-disable-next-line no-param-reassign
|
|
74
|
-
tooltip.target = __classPrivateFieldGet(this, _ActionItem_actionItem, "f");
|
|
69
|
+
__classPrivateFieldSet(this, _ActionItem_tooltipElement, tooltip, "f");
|
|
75
70
|
});
|
|
76
71
|
}
|
|
77
72
|
disabledChanged() {
|
|
78
73
|
this.internals.ariaDisabled = this.disabled.toString();
|
|
79
74
|
}
|
|
75
|
+
tooltipChanged(truncated) {
|
|
76
|
+
if (!__classPrivateFieldGet(this, _ActionItem_tooltipElement, "f"))
|
|
77
|
+
return;
|
|
78
|
+
__classPrivateFieldGet(this, _ActionItem_tooltipElement, "f").target = truncated ? this.host : undefined;
|
|
79
|
+
if (!truncated) {
|
|
80
|
+
ignorePromise(__classPrivateFieldGet(this, _ActionItem_tooltipElement, "f").close());
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (document.activeElement === this.host &&
|
|
84
|
+
this.host.matches(':focus-visible'))
|
|
85
|
+
ignorePromise(__classPrivateFieldGet(this, _ActionItem_tooltipElement, "f").show());
|
|
86
|
+
}
|
|
80
87
|
onBlur(event) {
|
|
81
88
|
this.blurEmitter.emit(pickFocusEventAttributes(event));
|
|
82
89
|
}
|
|
@@ -87,6 +94,17 @@ const ActionItem = /*@__PURE__*/ proxyCustomElement(class ActionItem extends H {
|
|
|
87
94
|
if (__classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedDisabled_get))
|
|
88
95
|
event.stopImmediatePropagation();
|
|
89
96
|
}
|
|
97
|
+
onPointerleave() {
|
|
98
|
+
if (!__classPrivateFieldGet(this, _ActionItem_tooltipElement, "f"))
|
|
99
|
+
return;
|
|
100
|
+
if (this.host.matches(':focus-visible'))
|
|
101
|
+
return;
|
|
102
|
+
/**
|
|
103
|
+
* Close the tooltip when pointer hover ends unless the item has keyboard-visible focus.
|
|
104
|
+
* This avoids sticky hover tooltips on auto-focused first dropdown items.
|
|
105
|
+
* */
|
|
106
|
+
ignorePromise(__classPrivateFieldGet(this, _ActionItem_tooltipElement, "f").close());
|
|
107
|
+
}
|
|
90
108
|
componentWillLoad() {
|
|
91
109
|
this.internals.role = 'menuitem';
|
|
92
110
|
this.disabledChanged();
|
|
@@ -103,18 +121,20 @@ const ActionItem = /*@__PURE__*/ proxyCustomElement(class ActionItem extends H {
|
|
|
103
121
|
__classPrivateFieldGet(this, _ActionItem_ro, "f").observe(__classPrivateFieldGet(this, _ActionItem_span, "f"));
|
|
104
122
|
}
|
|
105
123
|
render() {
|
|
106
|
-
return (h("div", { key: '
|
|
124
|
+
return (h("div", { key: '1299e2b225c006c503772ffe991845dd3146e771', class: {
|
|
107
125
|
'qds-action-item': true,
|
|
108
126
|
'qds-disabled': this.disabled,
|
|
109
|
-
},
|
|
127
|
+
}, "data-size": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedSize_get), "data-importance": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedImportance_get) }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: 'd842b78eb7ae8c7b0c1d5f39a77187dd34a03750', class: "qds-icon", "data-size": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedSize_get), library: this.iconLibrary, name: this.iconName })), h("span", { key: '9caa7922530dcc476fd28ff792b289c4f592f355', class: "qds-text", "data-size": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedSize_get), ref: __classPrivateFieldGet(this, _ActionItem_spanRef, "f") }, this.text), this.action !== undefined && (h("qds-icon", { key: 'ea40683d2db0ed4cdfde76a3ee5e651a38ea5e95', class: "qds-icon", "data-size": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedSize_get), name: this.action, library: "core", "aria-label": this.actionDescription, role: "img" })), h("qds-tooltip", { key: '922793a63f11063dcc56c242d2f8bf04995c0a5a', "aria-hidden": "true", ref: __classPrivateFieldGet(this, _ActionItem_tooltipRef, "f") }, this.text)));
|
|
110
128
|
}
|
|
129
|
+
get host() { return this; }
|
|
111
130
|
static get watchers() { return {
|
|
112
|
-
"disabled": ["disabledChanged"]
|
|
131
|
+
"disabled": ["disabledChanged"],
|
|
132
|
+
"tooltip": ["tooltipChanged"]
|
|
113
133
|
}; }
|
|
114
134
|
static get style() { return actionItemCss; }
|
|
115
135
|
}, [257, "qds-action-item", {
|
|
116
136
|
"importance": [1],
|
|
117
|
-
"disabled": [
|
|
137
|
+
"disabled": [516],
|
|
118
138
|
"iconName": [1, "icon-name"],
|
|
119
139
|
"iconLibrary": [1, "icon-library"],
|
|
120
140
|
"action": [1],
|
|
@@ -122,10 +142,11 @@ const ActionItem = /*@__PURE__*/ proxyCustomElement(class ActionItem extends H {
|
|
|
122
142
|
"size": [1],
|
|
123
143
|
"text": [1],
|
|
124
144
|
"tooltip": [32]
|
|
125
|
-
}, [[0, "blur", "onBlur"], [0, "focus", "onFocus"], [0, "click", "onClick"]], {
|
|
126
|
-
"disabled": ["disabledChanged"]
|
|
145
|
+
}, [[0, "blur", "onBlur"], [0, "focus", "onFocus"], [0, "click", "onClick"], [1, "pointerleave", "onPointerleave"]], {
|
|
146
|
+
"disabled": ["disabledChanged"],
|
|
147
|
+
"tooltip": ["tooltipChanged"]
|
|
127
148
|
}]);
|
|
128
|
-
_ActionItem_ro = new WeakMap(),
|
|
149
|
+
_ActionItem_ro = new WeakMap(), _ActionItem_span = new WeakMap(), _ActionItem_tooltipElement = new WeakMap(), _ActionItem_spanRef = new WeakMap(), _ActionItem_tooltipRef = new WeakMap(), _ActionItem_instances = new WeakSet(), _ActionItem_computedSize_get = function _ActionItem_computedSize_get() {
|
|
129
150
|
switch (this.size) {
|
|
130
151
|
case 'standard':
|
|
131
152
|
case 'small':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"qds-action-item.js","mappings":";;;;;;;;;;AAAA,MAAM,aAAa,GAAG,wvHAAwvH;;ACA9wH;AACA;AACA;;;;;;;;;;;;;;;;;;MAmCa,UAAU,iBAAAA,kBAAA,CAAA,MAAA,UAAA,SAAAC,CAAA,CAAA;AALvB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;AAME;;AAEG;AACqB,QAAA,IAAU,CAAA,UAAA,GAA0B,UAAU;AAEtE;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AASjD;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAevD;;AAEG;AACqB,QAAA,IAAI,CAAA,IAAA,GAAU,UAAU;AAO/B,QAAA,IAAO,CAAA,OAAA,GAAG,KAAK;QAgBhC,cAAoB,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QAEpB,sBAA4B,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QAE5B,gBAAuB,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QAoHd,wBAAgB,CAAA,GAAA,CAAA,IAAA,EAAA,CAAC,UAA2B,KAAU;YAC7D,sBAAA,CAAA,IAAI,EAAA,sBAAA,EAAe,UAAU,EAAA,GAAA,CAAA;AAC/B,SAAC,CAAA;QAEQ,mBAAW,CAAA,GAAA,CAAA,IAAA,EAAA,CAAC,IAAsB,KAAU;YACnD,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAS,IAAI,EAAA,GAAA,CA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AI,2DAAc,EAC7B,IAAI,EAAE,IAAI,CAAC,MAAM,EACjB,OAAO,EAAC,MAAM,EAAA,YAAA,EACF,IAAI,CAAC,iBAAiB,EAClC,IAAI,EAAC,KAAK,GACV,CACH,EACA,IAAI,CAAC,OAAO,KACX,mFAAyB,MAAM,EAAC,GAAG,EAAE,sBAAA,CAAA,IAAI,EAAY,sBAAA,EAAA,GAAA,CAAA,EAAA,EAClD,IAAI,CAAC,IAAI,CACE,CACf,CACG;;;;;;;;;;;;;;;;;;;;AA7GR,IAAA,QAAQ,IAAI,CAAC,IAAI;AACf,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,OAAO;QACZ,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,kCAAA,GAAA,SAAA,kCAAA,GAAA;AAGC,IAAA,QAAQ,IAAI,CAAC,UAAU;AACrB,QAAA,KAAK,YAAY;AACjB,QAAA,KAAK,SAAS;QACd,KAAK,aAAa,EAAE;YAClB,OAAO,IAAI,CAAC,UAAU;;QAExB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,gCAAA,GAAA,SAAA,gCAAA,GAAA;IAGC,OAAO,IAAI,CAAC,QAAQ;AACtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/action-item/action-item.css?tag=qds-action-item&encapsulation=shadow","src/components/action-item/action-item.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2025 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: block;\n}\n\n:host(:focus-visible) {\n /* inner ring */\n outline: var(--qds-theme-focus-border-contrast) solid\n var(--qds-focus-light-border-width);\n outline-offset: 0;\n\n /* outer ring */\n box-shadow: 0 0 0 var(--qds-focus-heavy-border-width)\n var(--qds-theme-focus-border);\n border-radius: var(--qds-control-border-radius);\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex-grow: 1;\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-action-item {\n align-items: center;\n box-sizing: border-box;\n display: flex;\n border: none;\n cursor: pointer;\n border-radius: var(--qds-control-border-radius);\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[data-size='small'] {\n &.qds-action-item {\n gap: var(--qds-list-item-small-gap-internal);\n min-height: var(--qds-list-item-small-height);\n padding-block: var(--qds-list-item-small-padding-vertical);\n padding-inline: var(--qds-list-item-small-padding-horizontal);\n }\n\n .qds-icon {\n height: var(--qds-control-small-icon-size);\n width: var(--qds-control-small-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-small-title);\n }\n}\n\n[data-size='standard'] {\n &.qds-action-item {\n gap: var(--qds-list-item-standard-gap-internal);\n min-height: var(--qds-list-item-standard-height);\n padding-block: var(--qds-list-item-standard-padding-vertical);\n padding-inline: var(--qds-list-item-standard-padding-horizontal);\n }\n\n .qds-icon {\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-standard-title);\n }\n}\n\n[data-size='large'] {\n &.qds-action-item {\n gap: var(--qds-list-item-large-gap-internal);\n min-height: var(--qds-list-item-large-height);\n padding-block: var(--qds-list-item-large-padding-vertical);\n padding-inline: var(--qds-list-item-large-padding-horizontal);\n }\n\n .qds-icon {\n height: var(--qds-control-large-icon-size);\n width: var(--qds-control-large-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-large-title);\n }\n}\n\n[data-importance='standard'] {\n .qds-text {\n color: var(--qds-theme-text-standard);\n }\n\n .qds-icon {\n color: var(--qds-theme-control-text-standard);\n }\n}\n\n[data-importance='emphasized'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-pressed);\n }\n }\n }\n}\n\n[data-importance='subdued'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-pressed);\n }\n }\n }\n}\n\n[data-importance='destructive'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-pressed);\n }\n }\n }\n}\n","// SPDX-FileCopyrightText: © 2025 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Event,\n h,\n Listen,\n Prop,\n readTask,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport {\n invariant,\n isEllipsisActive,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, Size } from '../shared'\n\nexport type ActionItemImportance = Importance | 'destructive'\n\n/**\n *\n *\n * @see https://quartz.se.com/build/components/action-item\n */\n@Component({\n tag: 'qds-action-item',\n shadow: true,\n styleUrl: 'action-item.css',\n})\nexport class ActionItem implements ComponentInterface {\n /**\n * The action item's importance.\n */\n @Prop() public readonly importance?: ActionItemImportance = 'standard'\n\n /**\n * Prevents the action item from being interacted with: it cannot be clicked\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\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 name of the action icon to render.\n *\n * Available names exist on the core icon library.\n */\n @Prop() public readonly action?: string\n\n /**\n * The action icon's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly actionDescription?: string\n\n /**\n * The action items's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The action item's text.\n */\n @Prop() public readonly text!: string\n\n @State() private tooltip = false\n\n /**\n * Emitted when the action item loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the action item gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #ro?: ResizeObserver\n\n #actionItem?: HTMLDivElement\n\n #span?: HTMLSpanElement\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 #computedImportance(): ActionItemImportance {\n switch (this.importance) {\n case 'emphasized':\n case 'subdued':\n case 'destructive': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedDisabled(): boolean {\n return this.disabled\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.disabled.toString()\n }\n\n @Listen('blur')\n protected onBlur(event: FocusEvent): void {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('focus')\n protected onFocus(event: FocusEvent): void {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) event.stopImmediatePropagation()\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'menuitem'\n this.disabledChanged()\n }\n\n public componentDidLoad(): void {\n invariant(this.#span)\n\n const span = this.#span\n readTask(() => {\n this.tooltip = isEllipsisActive(span)\n })\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.tooltip = isEllipsisActive(spanEntry.target as HTMLSpanElement)\n })\n this.#ro.observe(this.#span)\n }\n\n public render() {\n return (\n <div\n class={{\n 'qds-action-item': true,\n 'qds-disabled': this.disabled,\n }}\n ref={this.#actionDivRef}\n data-size={this.#computedSize}\n data-importance={this.#computedImportance}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <span\n class=\"qds-text\"\n data-size={this.#computedSize}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n\n {this.action !== undefined && (\n <qds-icon\n class=\"qds-icon\"\n data-size={this.#computedSize}\n name={this.action}\n library=\"core\"\n aria-label={this.actionDescription}\n role=\"img\"\n />\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 #actionDivRef = (actionItem?: HTMLDivElement): void => {\n this.#actionItem = actionItem\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.#actionItem\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"qds-action-item.js","mappings":";;;;;;;;;;AAAA,MAAM,aAAa,GAAG,wvHAAwvH;;ACA9wH;AACA;AACA;;;;;;;;;;;;;;;;;;MAqCa,UAAU,iBAAAA,kBAAA,CAAA,MAAA,UAAA,SAAAC,CAAA,CAAA;AALvB,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IAAI,CACL,EAEN,IAAI,CAAC,MAAM,KAAK,SAAS,KACxB,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAC,UAAU,EAAA,WAAA,EACL,sBAAA,CAAA,IAAI,2DAAc,EAC7B,IAAI,EAAE,IAAI,CAAC,MAAM,EACjB,OAAO,EAAC,MAAM,EAAA,YAAA,EACF,IAAI,CAAC,iBAAiB,EAClC,IAAI,EAAC,KAAK,GACV,CACH,EACD,CAAA,CAAA,aAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,aAAA,EAAyB,MAAM,EAAC,GAAG,EAAE,uBAAA,IAAI,EAAA,sBAAA,EAAA,GAAA,CAAY,EAClD,EAAA,IAAI,CAAC,IAAI,CACE,CACV;;;;;;;;;;;;;;;;;;;;;;;AArIR,IAAA,QAAQ,IAAI,CAAC,IAAI;AACf,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,OAAO;QACZ,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,kCAAA,GAAA,SAAA,kCAAA,GAAA;AAGC,IAAA,QAAQ,IAAI,CAAC,UAAU;AACrB,QAAA,KAAK,YAAY;AACjB,QAAA,KAAK,SAAS;QACd,KAAK,aAAa,EAAE;YAClB,OAAO,IAAI,CAAC,UAAU;;QAExB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,gCAAA,GAAA,SAAA,gCAAA,GAAA;IAGC,OAAO,IAAI,CAAC,QAAQ;AACtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/action-item/action-item.css?tag=qds-action-item&encapsulation=shadow","src/components/action-item/action-item.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2025 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: block;\n}\n\n:host(:focus-visible) {\n /* inner ring */\n outline: var(--qds-theme-focus-border-contrast) solid\n var(--qds-focus-light-border-width);\n outline-offset: 0;\n\n /* outer ring */\n box-shadow: 0 0 0 var(--qds-focus-heavy-border-width)\n var(--qds-theme-focus-border);\n border-radius: var(--qds-control-border-radius);\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex-grow: 1;\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-action-item {\n align-items: center;\n box-sizing: border-box;\n display: flex;\n border: none;\n cursor: pointer;\n border-radius: var(--qds-control-border-radius);\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[data-size='small'] {\n &.qds-action-item {\n gap: var(--qds-list-item-small-gap-internal);\n min-height: var(--qds-list-item-small-height);\n padding-block: var(--qds-list-item-small-padding-vertical);\n padding-inline: var(--qds-list-item-small-padding-horizontal);\n }\n\n .qds-icon {\n height: var(--qds-control-small-icon-size);\n width: var(--qds-control-small-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-small-title);\n }\n}\n\n[data-size='standard'] {\n &.qds-action-item {\n gap: var(--qds-list-item-standard-gap-internal);\n min-height: var(--qds-list-item-standard-height);\n padding-block: var(--qds-list-item-standard-padding-vertical);\n padding-inline: var(--qds-list-item-standard-padding-horizontal);\n }\n\n .qds-icon {\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-standard-title);\n }\n}\n\n[data-size='large'] {\n &.qds-action-item {\n gap: var(--qds-list-item-large-gap-internal);\n min-height: var(--qds-list-item-large-height);\n padding-block: var(--qds-list-item-large-padding-vertical);\n padding-inline: var(--qds-list-item-large-padding-horizontal);\n }\n\n .qds-icon {\n height: var(--qds-control-large-icon-size);\n width: var(--qds-control-large-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-large-title);\n }\n}\n\n[data-importance='standard'] {\n .qds-text {\n color: var(--qds-theme-text-standard);\n }\n\n .qds-icon {\n color: var(--qds-theme-control-text-standard);\n }\n}\n\n[data-importance='emphasized'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-pressed);\n }\n }\n }\n}\n\n[data-importance='subdued'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-pressed);\n }\n }\n }\n}\n\n[data-importance='destructive'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-pressed);\n }\n }\n }\n}\n","// SPDX-FileCopyrightText: © 2025 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n readTask,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport {\n ignorePromise,\n invariant,\n isEllipsisActive,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, Size } from '../shared'\n\nexport type ActionItemImportance = Importance | 'destructive'\n\n/**\n *\n *\n * @see https://quartz.se.com/build/components/action-item\n */\n@Component({\n tag: 'qds-action-item',\n shadow: true,\n styleUrl: 'action-item.css',\n})\nexport class ActionItem implements ComponentInterface {\n /**\n * The action item's importance.\n */\n @Prop() public readonly importance?: ActionItemImportance = 'standard'\n\n /**\n * Prevents the action item from being interacted with: it cannot be clicked\n * or focused.\n */\n @Prop({ reflect: true }) public readonly disabled: boolean = false\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 name of the action icon to render.\n *\n * Available names exist on the core icon library.\n */\n @Prop() public readonly action?: string\n\n /**\n * The action icon's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly actionDescription?: string\n\n /**\n * The action items's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The action item's text.\n */\n @Prop() public readonly text!: string\n\n @State() private tooltip = false\n\n /**\n * Emitted when the action item loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the action item gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #ro?: ResizeObserver\n\n #span?: HTMLSpanElement\n\n #tooltipElement?: HTMLQdsTooltipElement\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 #computedImportance(): ActionItemImportance {\n switch (this.importance) {\n case 'emphasized':\n case 'subdued':\n case 'destructive': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedDisabled(): boolean {\n return this.disabled\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.disabled.toString()\n }\n\n @Watch('tooltip')\n protected tooltipChanged(truncated: boolean): void {\n if (!this.#tooltipElement) return\n this.#tooltipElement.target = truncated ? this.host : undefined\n if (!truncated) {\n ignorePromise(this.#tooltipElement.close())\n return\n }\n\n if (\n document.activeElement === this.host &&\n this.host.matches(':focus-visible')\n )\n ignorePromise(this.#tooltipElement.show())\n }\n\n @Listen('blur')\n protected onBlur(event: FocusEvent): void {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('focus')\n protected onFocus(event: FocusEvent): void {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) event.stopImmediatePropagation()\n }\n\n @Listen('pointerleave')\n protected onPointerleave(): void {\n if (!this.#tooltipElement) return\n if (this.host.matches(':focus-visible')) return\n /**\n * Close the tooltip when pointer hover ends unless the item has keyboard-visible focus.\n * This avoids sticky hover tooltips on auto-focused first dropdown items.\n * */\n ignorePromise(this.#tooltipElement.close())\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'menuitem'\n this.disabledChanged()\n }\n\n public componentDidLoad(): void {\n invariant(this.#span)\n\n const span = this.#span\n readTask(() => {\n this.tooltip = isEllipsisActive(span)\n })\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.tooltip = isEllipsisActive(spanEntry.target as HTMLSpanElement)\n })\n this.#ro.observe(this.#span)\n }\n\n public render() {\n return (\n <div\n class={{\n 'qds-action-item': true,\n 'qds-disabled': this.disabled,\n }}\n data-size={this.#computedSize}\n data-importance={this.#computedImportance}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <span\n class=\"qds-text\"\n data-size={this.#computedSize}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n\n {this.action !== undefined && (\n <qds-icon\n class=\"qds-icon\"\n data-size={this.#computedSize}\n name={this.action}\n library=\"core\"\n aria-label={this.actionDescription}\n role=\"img\"\n />\n )}\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n </div>\n )\n }\n\n readonly #spanRef = (span?: HTMLSpanElement): void => {\n this.#span = span\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n this.#tooltipElement = tooltip\n }\n}\n"],"version":3}
|
package/components/qds-avatar.js
CHANGED
|
@@ -8,7 +8,7 @@ import { d as defineCustomElement$4 } from './p-Do46q_Gd.js';
|
|
|
8
8
|
import { d as defineCustomElement$3 } from './p-DOqfdgQA.js';
|
|
9
9
|
import { d as defineCustomElement$2 } from './p-fKK7EmM2.js';
|
|
10
10
|
|
|
11
|
-
const avatarCss = ":host([hidden]){display:none!important}:host{display:block}.qds-avatar,.qds-label-container{display:inline-flex;justify-content:center;position:relative}.qds-avatar-vertical,.qds-label-container{flex-direction:column}.qds-avatar-vertical
|
|
11
|
+
const avatarCss = ":host([hidden]){display:none!important}:host{display:block}.qds-avatar,.qds-label-container{display:inline-flex;justify-content:center;position:relative}.qds-avatar-vertical,.qds-label-container{flex-direction:column}.qds-avatar-vertical{align-items:center}.qds-avatar-vertical .qds-label-container{text-align:center}.qds-avatar-media-wrapper{flex-shrink:0;position:relative}.qds-label{color:var(--qds-theme-title)}.qds-kicker{color:var(--qds-theme-kicker)}.qds-indicator{inset-block-start:0;inset-inline-end:0;position:absolute;transform:translate(50%,-50%)}.qds-avatar[data-size=large]{gap:var(--qds-list-item-large-gap-internal)}[data-size=large] .qds-avatar-media{height:var(--qds-display-avatar-large-size);width:var(--qds-display-avatar-large-size)}[data-size=large] .qds-label-container{gap:var(--qds-list-item-large-titles-gap)}[data-size=large] .qds-label{font:var(--qds-list-item-large-title)}[data-size=large] .qds-kicker{font:var(--qds-list-item-large-kicker)}.qds-avatar[data-size=standard]{gap:var(--qds-list-item-standard-gap-internal)}[data-size=standard] .qds-avatar-media{height:var(--qds-display-avatar-standard-size);width:var(--qds-display-avatar-standard-size)}[data-size=standard] .qds-label-container{gap:var(--qds-list-item-standard-titles-gap)}[data-size=standard] .qds-label{font:var(--qds-list-item-standard-title)}[data-size=standard] .qds-kicker{font:var(--qds-list-item-standard-kicker)}.qds-avatar[data-size=small]{gap:var(--qds-list-item-small-gap-internal)}[data-size=small] .qds-avatar-media{height:var(--qds-display-avatar-small-size);width:var(--qds-display-avatar-small-size)}[data-size=small] .qds-label-container{gap:var(--qds-list-item-small-titles-gap)}[data-size=small] .qds-label{font:var(--qds-list-item-small-title)}[data-size=small] .qds-kicker{font:var(--qds-list-item-small-kicker)}";
|
|
12
12
|
|
|
13
13
|
// SPDX-FileCopyrightText: © 2026 Schneider Electric
|
|
14
14
|
//
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"qds-avatar.js","mappings":";;;;;;;;;;AAAA,MAAM,SAAS,GAAG,
|
|
1
|
+
{"file":"qds-avatar.js","mappings":";;;;;;;;;;AAAA,MAAM,SAAS,GAAG,yyDAAyyD;;ACA3zD;AACA;AACA;;;;;;;;;MAmBa,MAAM,iBAAAA,kBAAA,CAAA,MAAA,MAAA,SAAAC,CAAA,CAAA;AALnB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;AAuBE;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAY,SAAS;AAYxD;;AAEG;AACqB,QAAA,IAAI,CAAA,IAAA,GAAU,UAAU;AAEhD;;AAEG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAEjD;;AAEG;AACqB,QAAA,IAAK,CAAA,KAAA,GAAa,KAAK;AAQ/C;;AAEG;AAEa,QAAA,IAAoB,CAAA,oBAAA,GAClC,SAAS;AAwDZ;IAzCQ,MAAM,GAAA;AACX,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,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AA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,qBAAqB,EAAA,EAC7B,QAAQ,IAAI,+DAAQ,KAAK,EAAC,WAAW,EAAE,EAAA,IAAI,CAAC,KAAK,CAAU,EAC3D,SAAS,IAAI,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,YAAY,EAAE,EAAA,IAAI,CAAC,MAAM,CAAO,CACrD,CACP,CACG;;;;;;;;;;;;;;;;;AAlDR,IAAA,QAAQ,IAAI,CAAC,IAAI;AACf,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,OAAO;QACZ,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/avatar/avatar.css?tag=qds-avatar&encapsulation=shadow","src/components/avatar/avatar.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2026 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: block;\n}\n\n.qds-label-container,\n.qds-avatar {\n display: inline-flex;\n position: relative;\n justify-content: center;\n}\n\n.qds-label-container {\n flex-direction: column;\n}\n\n.qds-avatar-vertical {\n flex-direction: column;\n align-items: center;\n}\n\n.qds-avatar-vertical .qds-label-container {\n text-align: center;\n}\n\n.qds-avatar-media-wrapper {\n position: relative;\n flex-shrink: 0;\n}\n\n.qds-label {\n color: var(--qds-theme-title);\n}\n\n.qds-kicker {\n color: var(--qds-theme-kicker);\n}\n\n.qds-indicator {\n position: absolute;\n transform: translate(50%, -50%);\n inset-block-start: 0;\n inset-inline-end: 0;\n}\n\n[data-size='large'] {\n &.qds-avatar {\n gap: var(--qds-list-item-large-gap-internal);\n }\n\n .qds-avatar-media {\n width: var(--qds-display-avatar-large-size);\n height: var(--qds-display-avatar-large-size);\n }\n\n .qds-label-container {\n gap: var(--qds-list-item-large-titles-gap);\n }\n\n .qds-label {\n font: var(--qds-list-item-large-title);\n }\n\n .qds-kicker {\n font: var(--qds-list-item-large-kicker);\n }\n}\n\n[data-size='standard'] {\n &.qds-avatar {\n gap: var(--qds-list-item-standard-gap-internal);\n }\n\n .qds-avatar-media {\n width: var(--qds-display-avatar-standard-size);\n height: var(--qds-display-avatar-standard-size);\n }\n\n .qds-label-container {\n gap: var(--qds-list-item-standard-titles-gap);\n }\n\n .qds-label {\n font: var(--qds-list-item-standard-title);\n }\n\n .qds-kicker {\n font: var(--qds-list-item-standard-kicker);\n }\n}\n\n[data-size='small'] {\n &.qds-avatar {\n gap: var(--qds-list-item-small-gap-internal);\n }\n\n .qds-avatar-media {\n width: var(--qds-display-avatar-small-size);\n height: var(--qds-display-avatar-small-size);\n }\n\n .qds-label-container {\n gap: var(--qds-list-item-small-titles-gap);\n }\n\n .qds-label {\n font: var(--qds-list-item-small-title);\n }\n\n .qds-kicker {\n font: var(--qds-list-item-small-kicker);\n }\n}\n","// SPDX-FileCopyrightText: © 2026 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, h, Prop, Watch } from '@stencil/core'\n\nimport type { Size } from '../shared'\n\n/**\n * The avatar component is a visual representation of a user or entity, typically through a profile picture, icon, or initials.\n * It is used to provide a consistent way to identify users across different parts of an interface,\n * such as messages, comments, or user profiles.\n *\n * @see https://quartz.se.com/build/components/avatar\n */\n@Component({\n tag: 'qds-avatar',\n shadow: true,\n styleUrl: 'avatar.css',\n})\nexport class Avatar implements ComponentInterface {\n /**\n * The URL of the avatar image to display.\n */\n @Prop() public readonly avatarSrc?: string\n\n /**\n * The alt text for the avatar's image.\n */\n @Prop() public readonly avatarAlt?: string\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary?: string = 'default'\n\n /**\n * Text to display for the kicker.\n */\n @Prop() public readonly kicker?: string\n\n /**\n * Text to display for the label.\n */\n @Prop() public readonly label?: string\n\n /**\n * The avatar's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Display the avatar in a vertical direction.\n */\n @Prop() public readonly vertical: boolean = false\n\n /**\n * Displays an indicator if `true`.\n */\n @Prop() public readonly badge?: boolean = false\n\n /**\n * The indicator badge's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly badgeDescription?: string\n\n /**\n * The indicator's status.\n */\n @Prop()\n public readonly badgeIndicatorStatus?: HTMLQdsBadgeIndicatorElement['status'] =\n 'success'\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 render() {\n const hasLabel = this.label !== undefined && this.label !== ''\n const hasAlt = this.avatarAlt !== undefined && this.avatarAlt !== ''\n const hasKicker = this.kicker !== undefined && this.kicker !== ''\n\n return (\n <div\n class={{ 'qds-avatar': true, 'qds-avatar-vertical': this.vertical }}\n data-size={this.#computedSize}\n >\n <div class=\"qds-avatar-media-wrapper\">\n <qds-avatar-media\n class=\"qds-avatar-media\"\n aria-hidden={hasAlt ? undefined : 'true'}\n src={this.avatarSrc}\n alt={this.avatarAlt}\n iconName={this.iconName}\n iconLibrary={this.iconLibrary}\n text={this.label}\n />\n\n {(this.badge ?? false) && (\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 </div>\n\n {(hasLabel || hasKicker) && (\n <div class=\"qds-label-container\">\n {hasLabel && <strong class=\"qds-label\">{this.label}</strong>}\n {hasKicker && <div class=\"qds-kicker\">{this.kicker}</div>}\n </div>\n )}\n </div>\n )\n }\n}\n"],"version":3}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, d as readTask, h, F as Fragment } from './p-D2489VzR.js';
|
|
7
|
-
import {
|
|
7
|
+
import { b as isEllipsisActive, c as isCurrentPage } from './p-eUDNu0SE.js';
|
|
8
8
|
import { d as defineCustomElement$3 } from './p-fKK7EmM2.js';
|
|
9
|
-
import { d as defineCustomElement$2 } from './p-
|
|
9
|
+
import { d as defineCustomElement$2 } from './p-B9xuNEzc.js';
|
|
10
10
|
|
|
11
11
|
const breadcrumbItemCss = ":host([hidden]){display:none!important}:host{display:inline-block}:host(:focus-visible){outline:none}.qds-breadcrumb-item{align-items:center;display:inline-flex;font:var(--qds-control-standard-text);min-height:var(--qds-control-standard-height);width:inherit}.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-icon{flex-shrink:0;height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}.qds-divider{margin-inline:var(--qds-control-standard-gap-siblings-related)}.qds-overflow{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-anchor{font:var(--qds-control-standard-link)}.qds-anchor,.qds-breadcrumb-item{color:var(--qds-theme-control-text-standard)}.qds-anchor:focus-visible,:host(:focus-visible) .qds-anchor{border-radius:var(--qds-control-border-radius);box-shadow:0 0 0 var(--qds-focus-heavy-border-width) var(--qds-theme-focus-border);outline:var(--qds-theme-focus-border-contrast) solid var(--qds-focus-light-border-width);outline-offset:0}";
|
|
12
12
|
|
package/components/qds-button.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, c as createEvent, d as readTask, h } from './p-D2489VzR.js';
|
|
7
|
-
import { p as pickFocusEventAttributes,
|
|
7
|
+
import { p as pickFocusEventAttributes, b as isEllipsisActive, d as isIndicator, e as isCounter, f as computeBadgeValue } from './p-eUDNu0SE.js';
|
|
8
8
|
import { V as VALID_STATE, C as CUSTOM_ERROR_FLAGS, N as NO_ERROR_FLAGS } from './p-CZRW1LV_.js';
|
|
9
9
|
import { d as defineCustomElement$5 } from './p-XP2CY_fo.js';
|
|
10
10
|
import { d as defineCustomElement$4 } from './p-DOqfdgQA.js';
|
|
11
11
|
import { d as defineCustomElement$3 } from './p-fKK7EmM2.js';
|
|
12
|
-
import { d as defineCustomElement$2 } from './p-
|
|
12
|
+
import { d as defineCustomElement$2 } from './p-B9xuNEzc.js';
|
|
13
13
|
|
|
14
14
|
const buttonCss = ":host([hidden]){display:none!important}:host{display:inline-block;outline:none}.qds-button:disabled,.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-overflow{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-overflow[data-size=hero]{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal}.qds-action{transform:scaleX(var(--qds-direction-factor,1))}.qds-container{display:grid;grid-template-areas:\"c\"}.qds-focus-ring{border-radius:max(1px,var(\n --qds-form-input-border-radius-top-left,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-form-input-border-radius-top-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-form-input-border-radius-bottom-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-form-input-border-radius-bottom-left,var(--qds-control-border-radius)\n ));box-shadow:0 0 0 var(--qds-focus-heavy-border-width) var(--qds-theme-focus-border);grid-area:c;height:calc(100% + var(--qds-control-border-width) - var(--qds-control-border-width));isolation:isolate;outline:var(--qds-theme-focus-border-contrast) solid var(--qds-focus-light-border-width);outline-offset:0;pointer-events:none;visibility:hidden;width:calc(100% + var(--qds-control-border-width) - var(\n --qds-form-input-border-width-inline-end,\n var(--qds-control-border-width)\n ))}:host(:focus-visible) .qds-focus-ring{visibility:visible}.qds-button{align-items:center;-webkit-appearance:none;appearance:none;background-color:initial;border:none;border-radius:var(\n --qds-form-input-border-radius-top-left,var(--qds-control-border-radius)\n ) var(\n --qds-form-input-border-radius-top-right,var(--qds-control-border-radius)\n ) var(\n --qds-form-input-border-radius-bottom-right,var(--qds-control-border-radius)\n ) var(\n --qds-form-input-border-radius-bottom-left,var(--qds-control-border-radius)\n );box-sizing:border-box;cursor:pointer;display:inline-flex;grid-area:c;justify-content:center;letter-spacing:inherit;min-width:0;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;word-spacing:inherit}.qds-button:any-link{-webkit-text-decoration:none;text-decoration:none}.qds-icon{flex-shrink:0}.qds-indicator{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);min-height:var(--qds-control-small-height);padding-inline:var(--qds-control-button-small-padding-horizontal)}.qds-icon-only[data-size=small]{width:var(--qds-control-small-height)}.qds-icon[data-size=small]{height:var(--qds-control-small-icon-size);width:var(--qds-control-small-icon-size)}[data-size=small] .qds-indicator{inset-block-start:var(--qds-control-button-small-badge-padding-top);inset-inline-end:var(--qds-control-button-small-badge-padding-end)}[data-size=standard]{font:var(--qds-control-standard-text)}.qds-button[data-size=standard]{gap:var(--qds-control-standard-gap-internal);min-height:var(--qds-control-standard-height);padding-inline:var(--qds-control-button-standard-padding-horizontal)}.qds-icon-only[data-size=standard]{width:var(--qds-control-standard-height)}.qds-icon[data-size=standard]{height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}[data-size=standard] .qds-indicator{inset-block-start:var(--qds-control-button-standard-badge-padding-top);inset-inline-end:var(--qds-control-button-standard-badge-padding-end)}[data-size=large]{font:var(--qds-control-large-text)}.qds-button[data-size=large]{gap:var(--qds-control-large-gap-internal);min-height:var(--qds-control-large-height);padding-inline:var(--qds-control-button-large-padding-horizontal)}.qds-icon-only[data-size=large]{width:var(--qds-control-large-height)}.qds-icon[data-size=large]{height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}[data-size=large] .qds-indicator{inset-block-start:var(--qds-control-button-large-badge-padding-top);inset-inline-end:var(--qds-control-button-large-badge-padding-end)}[data-size=large],[data-size=small],[data-size=standard]{line-height:normal}.qds-button.qds-icon-only[data-size=large],.qds-button.qds-icon-only[data-size=small],.qds-button.qds-icon-only[data-size=standard]{padding-inline:0}[data-size=hero]{font:var(--qds-control-hero-text)}.qds-button[data-size=hero]{border-radius:var(\n --qds-form-input-border-radius-top-left,var(--qds-control-hero-border-radius)\n ) var(\n --qds-form-input-border-radius-top-right,var(--qds-control-hero-border-radius)\n ) var(\n --qds-form-input-border-radius-bottom-right,var(--qds-control-hero-border-radius)\n ) var(\n --qds-form-input-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]{min-height:var(--qds-control-hero-height);padding-inline:0;width:var(--qds-control-hero-height)}.qds-button[data-size=hero] .qds-indicator{inset-block-start:var(--qds-control-button-hero-badge-padding-top);inset-inline-end:var(--qds-control-button-hero-badge-padding-end)}.qds-focus-ring[data-size=hero]{border-radius:max(1px,var(\n --qds-form-input-border-radius-top-left,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-form-input-border-radius-top-right,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-form-input-border-radius-bottom-right,var(--qds-control-hero-border-radius)\n )) max(1px,var(\n --qds-form-input-border-radius-bottom-left,var(--qds-control-hero-border-radius)\n ))}.qds-icon[data-size=hero]{height:var(--qds-control-hero-icon-size);width:var(--qds-control-hero-icon-size)}[data-importance=subdued]{border-radius:0;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-default);border-style:solid;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]{border-radius:0;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)}[data-action=dropdown-close] .qds-action{transform:rotate(-180deg)}:is([data-action=dropdown],[data-action=dropdown-close]) .qds-action{transition-duration:.3s;transition-property:transform}:is([data-action=dropdown],[data-action=dropdown-close]):not(:has(qds-badge-counter)) .qds-action{margin-inline-start:auto}:is([data-action=dropdown],[data-action=dropdown-close]) qds-badge-counter{margin-inline-start:auto}";
|
|
15
15
|
|
|
@@ -208,6 +208,8 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends H {
|
|
|
208
208
|
event.stopImmediatePropagation();
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
|
+
if (__classPrivateFieldGet(this, _Button_button, "f") instanceof HTMLAnchorElement)
|
|
212
|
+
__classPrivateFieldGet(this, _Button_button, "f").click();
|
|
211
213
|
if (__classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get) === 'button' || !this.internals.form)
|
|
212
214
|
return;
|
|
213
215
|
if (__classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get) === 'reset') {
|
|
@@ -230,7 +232,7 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends H {
|
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
234
|
onKeyup(event) {
|
|
233
|
-
if (event.key === ' ')
|
|
235
|
+
if (event.key === ' ' && !(__classPrivateFieldGet(this, _Button_button, "f") instanceof HTMLAnchorElement))
|
|
234
236
|
this.host.click();
|
|
235
237
|
}
|
|
236
238
|
actionChanged() {
|
|
@@ -312,21 +314,21 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends H {
|
|
|
312
314
|
}
|
|
313
315
|
render() {
|
|
314
316
|
const Tag = this.href === undefined ? 'button' : 'a';
|
|
315
|
-
return (h("div", { key: '
|
|
317
|
+
return (h("div", { key: '9d6105e917cd6f56940e57bbc1a887012236b412', class: "qds-container", onClick: __classPrivateFieldGet(this, _Button_onClick, "f"), onKeyDown: preventDefault, onKeyUp: preventDefault, onKeyPress: preventDefault, "aria-hidden": "true" }, h(Tag, { key: 'c75229b0603aa562ee9c54c74701ac7c8fa1679f', class: {
|
|
316
318
|
'qds-button': true,
|
|
317
319
|
'qds-disabled': Tag === 'a' ? __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedDisabled_get) : false,
|
|
318
320
|
/* DEPRECATED: will be removed by september 2026 */
|
|
319
321
|
'qds-icon-only': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
|
|
320
|
-
}, "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, formAction: this.formAction, formMethod: this.formMethod, formNoValidate: this.formNoValidate, formTarget: this.formTarget, href: Tag === 'a' ? this.href : undefined, name: Tag === 'a' ? undefined : this.name, ref: __classPrivateFieldGet(this, _Button_buttonRef, "f"), rel: Tag === 'a' ? this.rel : undefined, tabIndex: -1, target: Tag === 'a' ? this.target : undefined, type: Tag === 'a' ? undefined : __classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get), value: Tag === 'a' ? undefined : this.value }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '
|
|
322
|
+
}, "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, formAction: this.formAction, formMethod: this.formMethod, formNoValidate: this.formNoValidate, formTarget: this.formTarget, href: Tag === 'a' ? this.href : undefined, name: Tag === 'a' ? undefined : this.name, ref: __classPrivateFieldGet(this, _Button_buttonRef, "f"), rel: Tag === 'a' ? this.rel : undefined, tabIndex: -1, target: Tag === 'a' ? this.target : undefined, type: Tag === 'a' ? undefined : __classPrivateFieldGet(this, _Button_instances, "a", _Button_buttonType_get), value: Tag === 'a' ? undefined : this.value }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '95bc587c136ea8ec2cd17aab3294677cb018d5f1', class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), library: this.iconLibrary, name: this.iconName })), !__classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get) && (
|
|
321
323
|
/* DEPRECATED: will be removed by september 2026 */
|
|
322
|
-
h("span", { key: '
|
|
324
|
+
h("span", { key: '715cd57557a2f651f6779dc40d1dd30f84646707', class: "qds-overflow", "data-size": __classPrivateFieldGet(this, _Button_instances, "a", _Button_computedSize_get), ref: __classPrivateFieldGet(this, _Button_spanRef, "f") }, this.text)), isIndicator(this.badge) && (h("qds-badge-indicator", { key: 'c798711734b520aef7898e05bf812367e6ac9fc6', 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: '3535e3a5ab8278e5f314fb38f7d376eef6294d2e', class: {
|
|
323
325
|
/* DEPRECATED: will be removed by september 2026 */
|
|
324
326
|
'qds-indicator': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
|
|
325
|
-
}, 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: '
|
|
327
|
+
}, 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: 'ff6a13827be83fb15a8d401784534e2c09efc2e4', 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: 'a67b763f688efbe98dd13ec7cffc5a4a1c0efcd2', class: {
|
|
326
328
|
'qds-focus-ring': true,
|
|
327
329
|
/* DEPRECATED: will be removed by september 2026 */
|
|
328
330
|
'qds-icon-only': __classPrivateFieldGet(this, _Button_instances, "a", _Button_iconOnly_get),
|
|
329
|
-
}, "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: '
|
|
331
|
+
}, "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: 'cbff06c60fca024f700dfd30f191cb974462e063', ref: __classPrivateFieldGet(this, _Button_tooltipRef, "f"), placement: this.tooltipPlacement }, this.text))));
|
|
330
332
|
}
|
|
331
333
|
static get formAssociated() { return true; }
|
|
332
334
|
get host() { return this; }
|