@eui/eds-wc 22.0.0-alpha.5 → 22.0.0-alpha.7
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/eds-alert/eds-wc-alert.d.ts +44 -21
- package/eds-alert/eds-wc-alert.d.ts.map +1 -1
- package/eds-alert/eds-wc-alert.js +137 -83
- package/eds-alert/eds-wc-alert.js.map +1 -1
- package/eds-alert/index.d.ts +1 -0
- package/eds-alert/index.d.ts.map +1 -1
- package/eds-badge/eds-wc-badge.d.ts +63 -23
- package/eds-badge/eds-wc-badge.d.ts.map +1 -1
- package/eds-badge/eds-wc-badge.js +205 -103
- package/eds-badge/eds-wc-badge.js.map +1 -1
- package/eds-badge/index.d.ts +1 -0
- package/eds-badge/index.d.ts.map +1 -1
- package/eds-chip/eds-wc-chip.d.ts +107 -18
- package/eds-chip/eds-wc-chip.d.ts.map +1 -1
- package/eds-chip/eds-wc-chip.js +332 -113
- package/eds-chip/eds-wc-chip.js.map +1 -1
- package/eds-chip/index.d.ts +2 -1
- package/eds-chip/index.d.ts.map +1 -1
- package/eds-chip/index.js +1 -1
- package/eds-chip/index.js.map +1 -1
- package/eds-icon/eds-wc-icon-image.d.ts +43 -0
- package/eds-icon/eds-wc-icon-image.d.ts.map +1 -0
- package/eds-icon/eds-wc-icon-image.js +107 -0
- package/eds-icon/eds-wc-icon-image.js.map +1 -0
- package/eds-icon/eds-wc-icon.d.ts +44 -28
- package/eds-icon/eds-wc-icon.d.ts.map +1 -1
- package/eds-icon/eds-wc-icon.js +97 -85
- package/eds-icon/eds-wc-icon.js.map +1 -1
- package/eds-icon/index.d.ts +3 -1
- package/eds-icon/index.d.ts.map +1 -1
- package/eds-icon/index.js +2 -1
- package/eds-icon/index.js.map +1 -1
- package/eds-icon-button/eds-wc-icon-button.d.ts +53 -18
- package/eds-icon-button/eds-wc-icon-button.d.ts.map +1 -1
- package/eds-icon-button/eds-wc-icon-button.js +165 -74
- package/eds-icon-button/eds-wc-icon-button.js.map +1 -1
- package/eds-icon-button/index.d.ts +2 -1
- package/eds-icon-button/index.d.ts.map +1 -1
- package/eds-icon-button/index.js +1 -1
- package/eds-icon-button/index.js.map +1 -1
- package/eds-tag/eds-wc-tag.d.ts +35 -16
- package/eds-tag/eds-wc-tag.d.ts.map +1 -1
- package/eds-tag/eds-wc-tag.js +86 -72
- package/eds-tag/eds-wc-tag.js.map +1 -1
- package/eds-tag/index.d.ts +2 -1
- package/eds-tag/index.d.ts.map +1 -1
- package/eds-tag/index.js +1 -1
- package/eds-tag/index.js.map +1 -1
- package/index.d.ts +9 -3
- package/index.d.ts.map +1 -1
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eds-wc-icon-button.d.ts","sourceRoot":"","sources":["../../src/eds-icon-button/eds-wc-icon-button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC
|
|
1
|
+
{"version":3,"file":"eds-wc-icon-button.d.ts","sourceRoot":"","sources":["../../src/eds-icon-button/eds-wc-icon-button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC1B,OAAO,GACP,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,UAAU,CAAC;AAEjB;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,eAAgB,SAAQ,cAAc;IAC/C;;;OAGG;IAEH,IAAI,SAAM;IAEV;;;OAGG;IAEH,KAAK,EAAE,oBAAoB,CAAa;IAExC;;;OAGG;IAEH,IAAI,EAAE,mBAAmB,CAAO;IAEhC;;;OAGG;IAEM,SAAS,EAAE,MAAM,GAAG,IAAI,CAAqB;IAEtD;;;OAGG;IAEH,OAAO,UAAS;IAEhB;;;OAGG;IAEH,QAAQ,UAAS;IAEjB,OAAgB,MAAM,0BA2HpB;cAEiB,MAAM;IAmBzB,OAAO,CAAC,QAAQ,CASd;CACL;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,oBAAoB,EAAE,eAAe,CAAC;KACzC;CACJ"}
|
|
@@ -7,129 +7,214 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { html, css } from 'lit';
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js';
|
|
9
9
|
import { EdsBaseElement } from '../shared/eds-base.js';
|
|
10
|
-
import
|
|
11
|
-
import { SizeMixin } from '../shared/size-mixin.js';
|
|
10
|
+
import '../eds-icon/eds-wc-icon.js';
|
|
12
11
|
/**
|
|
13
12
|
* `<eds-wc-icon-button>` — EDS Icon Button Web Component.
|
|
14
13
|
*
|
|
15
|
-
* A
|
|
16
|
-
* Supports
|
|
14
|
+
* A compact, icon-only button. Renders an internal native `<button>` (for keyboard/focus/click
|
|
15
|
+
* semantics) containing an `<eds-wc-icon>`. Supports semantic color and size via reflected string
|
|
16
|
+
* attributes, an optional rounded shape, and a disabled state. 1:1 projection of the Angular
|
|
17
|
+
* `button[edsIconButton]` directive.
|
|
18
|
+
*
|
|
19
|
+
* Unlike the Angular directive which decorates a consumer-provided native `<button>`, this web
|
|
20
|
+
* component renders its own internal `<button>` element and mirrors the same reflected attribute
|
|
21
|
+
* API on the host.
|
|
17
22
|
*
|
|
18
23
|
* @example
|
|
19
24
|
* ```html
|
|
20
|
-
* <eds-wc-icon-button icon="
|
|
21
|
-
* <eds-wc-icon-button icon="
|
|
25
|
+
* <eds-wc-icon-button icon="gear" aria-label="Settings"></eds-wc-icon-button>
|
|
26
|
+
* <eds-wc-icon-button icon="trash" color="critical" size="s" aria-label="Delete"></eds-wc-icon-button>
|
|
27
|
+
* <eds-wc-icon-button icon="star" color="brand" rounded aria-label="Favorite"></eds-wc-icon-button>
|
|
28
|
+
* <eds-wc-icon-button icon="bell" disabled aria-label="Notifications"></eds-wc-icon-button>
|
|
22
29
|
* ```
|
|
23
30
|
*
|
|
24
|
-
* @slot - Default slot for overlay
|
|
25
|
-
*
|
|
26
|
-
* @fires click - Native click event (blocked when disabled)
|
|
31
|
+
* @slot - Default slot for a projected overlay such as an `<eds-wc-badge>`.
|
|
27
32
|
*
|
|
28
|
-
* @
|
|
29
|
-
* @csspart svg - The icon SVG element
|
|
33
|
+
* @fires button-click - Dispatched when the button is clicked. `detail: { originalEvent: Event }`
|
|
30
34
|
*/
|
|
31
|
-
let EdsWcIconButton = class EdsWcIconButton extends
|
|
35
|
+
let EdsWcIconButton = class EdsWcIconButton extends EdsBaseElement {
|
|
32
36
|
constructor() {
|
|
33
37
|
super(...arguments);
|
|
34
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* The name of the icon to display from the eUI icon library.
|
|
40
|
+
* @default ''
|
|
41
|
+
*/
|
|
35
42
|
this.icon = '';
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Semantic color of the icon button.
|
|
45
|
+
* @default 'neutral'
|
|
46
|
+
*/
|
|
47
|
+
this.color = 'neutral';
|
|
48
|
+
/**
|
|
49
|
+
* Size of the icon button.
|
|
50
|
+
* @default 'm'
|
|
51
|
+
*/
|
|
52
|
+
this.size = 'm';
|
|
53
|
+
/**
|
|
54
|
+
* Accessible label for screen readers describing the button's purpose.
|
|
55
|
+
* @default 'EDS Icon button'
|
|
56
|
+
*/
|
|
57
|
+
this.ariaLabel = 'EDS Icon button';
|
|
58
|
+
/**
|
|
59
|
+
* Applies rounded corners to the button shape instead of default square corners.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
39
62
|
this.rounded = false;
|
|
40
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Disables the button (non-interactive, disabled styling, removed from tab order).
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
41
67
|
this.disabled = false;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
68
|
+
this._onClick = (event) => {
|
|
69
|
+
if (this.disabled) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.dispatchEvent(new CustomEvent('button-click', {
|
|
73
|
+
bubbles: true,
|
|
74
|
+
composed: true,
|
|
75
|
+
detail: { originalEvent: event },
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
50
78
|
}
|
|
51
79
|
static { this.styles = css `
|
|
80
|
+
:host, *, *::before, *::after {
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* parent overrides :
|
|
85
|
+
--_button-padding, --_button-surface-hover, --_button-on-surface-hover, --_button-color */
|
|
86
|
+
|
|
52
87
|
:host {
|
|
88
|
+
--_eds-icon-button-surface-hover: var(--_button-surface-hover, var(--eds-c-surface-neutral-subtle));
|
|
89
|
+
--_eds-icon-button-on-surface-hover: var(--_button-on-surface-hover, var(--eds-c-on-surface-neutral-subtle));
|
|
90
|
+
--_eds-icon-button-padding: var(--_button-padding, var(--eds-sp-3xs));
|
|
91
|
+
--_eds-icon-button-color: var(--eds-c-foreground-subtle);
|
|
92
|
+
|
|
53
93
|
display: inline-flex;
|
|
54
94
|
}
|
|
55
95
|
|
|
56
96
|
button {
|
|
97
|
+
/* Reset */
|
|
98
|
+
font-family: inherit;
|
|
99
|
+
-webkit-appearance: none;
|
|
100
|
+
appearance: none;
|
|
101
|
+
|
|
57
102
|
display: inline-flex;
|
|
58
|
-
align-items: center;
|
|
59
|
-
justify-content: center;
|
|
60
103
|
border: none;
|
|
61
104
|
cursor: pointer;
|
|
62
|
-
background-color:
|
|
63
|
-
padding: var(--
|
|
105
|
+
background-color: inherit;
|
|
106
|
+
padding: var(--_eds-icon-button-padding);
|
|
64
107
|
position: relative;
|
|
65
|
-
color: var(--
|
|
66
|
-
border-radius:
|
|
67
|
-
|
|
68
|
-
-webkit-appearance: none;
|
|
69
|
-
appearance: none;
|
|
70
|
-
font-family: inherit;
|
|
108
|
+
color: var(--_eds-icon-button-color);
|
|
109
|
+
border-radius: inherit;
|
|
110
|
+
outline: none;
|
|
71
111
|
}
|
|
72
112
|
|
|
73
113
|
button:hover,
|
|
74
114
|
button:active {
|
|
75
|
-
background-color: var(--
|
|
76
|
-
color: var(--
|
|
115
|
+
background-color: var(--_eds-icon-button-surface-hover);
|
|
116
|
+
color: var(--_eds-icon-button-on-surface-hover);
|
|
77
117
|
}
|
|
78
118
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
119
|
+
/* COLOR VARIANTS */
|
|
120
|
+
|
|
121
|
+
:host([color="brand"]) {
|
|
122
|
+
--_eds-icon-button-surface-hover: var(--_button-surface-hover, var(--eds-c-surface-brand--hover));
|
|
123
|
+
--_eds-icon-button-on-surface-hover: var(--_button-on-surface-hover, var(--eds-c-on-surface-brand--hover));
|
|
124
|
+
--_eds-icon-button-color: var(--_button-color, var(--eds-c-on-surface-brand));
|
|
82
125
|
}
|
|
83
126
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
127
|
+
:host([color="neutral"]) {
|
|
128
|
+
--_eds-icon-button-surface-hover: var(--_button-surface-hover, var(--eds-c-surface-neutral-subtle--hover));
|
|
129
|
+
--_eds-icon-button-on-surface-hover: var(--_button-on-surface-hover, var(--eds-c-on-surface-neutral-subtle--hover));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:host([color="info"]) {
|
|
133
|
+
--_eds-icon-button-surface-hover: var(--_button-surface-hover, var(--eds-c-surface-info-subtler--hover));
|
|
134
|
+
--_eds-icon-button-on-surface-hover: var(--_button-on-surface-hover, var(--eds-c-on-surface-info-subtler--hover));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:host([color="success"]) {
|
|
138
|
+
--_eds-icon-button-surface-hover: var(--_button-surface-hover, var(--eds-c-surface-success-subtler--hover));
|
|
139
|
+
--_eds-icon-button-on-surface-hover: var(--_button-on-surface-hover, var(--eds-c-on-surface-success-subtler--hover));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:host([color="warning"]) {
|
|
143
|
+
--_eds-icon-button-surface-hover: var(--_button-surface-hover, var(--eds-c-surface-warning-subtler--hover));
|
|
144
|
+
--_eds-icon-button-on-surface-hover: var(--_button-on-surface-hover, var(--eds-c-on-surface-warning-subtler--hover));
|
|
87
145
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
146
|
+
|
|
147
|
+
:host([color="critical"]) {
|
|
148
|
+
--_eds-icon-button-surface-hover: var(--_button-surface-hover, var(--eds-c-surface-critical-subtler--hover));
|
|
149
|
+
--_eds-icon-button-on-surface-hover: var(--_button-on-surface-hover, var(--eds-c-on-surface-critical-subtler--hover));
|
|
91
150
|
}
|
|
92
151
|
|
|
93
|
-
/*
|
|
94
|
-
|
|
152
|
+
/* SIZE VARIANTS */
|
|
153
|
+
|
|
154
|
+
:host([size="2xs"]) { --_eds-icon-button-padding: var(--_button-padding, var(--eds-sp-2xs)); }
|
|
155
|
+
:host([size="xs"]) { --_eds-icon-button-padding: var(--_button-padding, var(--eds-sp-2xs)); }
|
|
156
|
+
:host([size="s"]) { --_eds-icon-button-padding: var(--_button-padding, var(--eds-sp-2xs)); }
|
|
157
|
+
:host([size="m"]) { --_eds-icon-button-padding: var(--_button-padding, var(--eds-sp-xs)); }
|
|
158
|
+
:host([size="l"]) { --_eds-icon-button-padding: var(--_button-padding, var(--eds-sp-s)); }
|
|
159
|
+
|
|
160
|
+
/* STATE */
|
|
161
|
+
|
|
162
|
+
:host([rounded]) {
|
|
95
163
|
border-radius: var(--eds-br-full);
|
|
96
164
|
}
|
|
97
165
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
:host([
|
|
104
|
-
|
|
166
|
+
:host([disabled]) {
|
|
167
|
+
--_eds-icon-button-color: var(--_button-color, var(--eds-c-foreground-disabled));
|
|
168
|
+
--_eds-icon-button-surface-hover: transparent;
|
|
169
|
+
--_eds-icon-button-on-surface-hover: var(--_eds-icon-button-color);
|
|
170
|
+
}
|
|
171
|
+
:host([disabled]) button {
|
|
172
|
+
cursor: default;
|
|
173
|
+
}
|
|
105
174
|
|
|
106
|
-
/*
|
|
107
|
-
:host([size="2xs"]) { --_padding: var(--eds-sp-2xs); }
|
|
108
|
-
:host([size="xs"]) { --_padding: var(--eds-sp-2xs); }
|
|
109
|
-
:host([size="s"]) { --_padding: var(--eds-sp-2xs); }
|
|
110
|
-
:host([size="m"]) { --_padding: var(--eds-sp-xs); }
|
|
111
|
-
:host([size="l"]) { --_padding: var(--eds-sp-s); }
|
|
175
|
+
/* FOCUS RING */
|
|
112
176
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
177
|
+
button:focus-visible {
|
|
178
|
+
outline: 2px solid var(--eds-c-border-focus);
|
|
179
|
+
outline-offset: 2px;
|
|
180
|
+
}
|
|
181
|
+
:host([rounded]) button:focus-visible {
|
|
182
|
+
border-radius: var(--eds-br-full);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* BADGE OVERLAY — a projected eds-wc-badge is absolutely positioned over the
|
|
186
|
+
top-right of the icon, mirroring the Angular badge's
|
|
187
|
+
:host-context(.eds-icon-button[size="…"]) offsets. The internal <eds-wc-icon>
|
|
188
|
+
is position:relative, so the slotted badge anchors to it. */
|
|
189
|
+
eds-wc-icon {
|
|
190
|
+
position: relative;
|
|
118
191
|
}
|
|
192
|
+
|
|
193
|
+
::slotted(eds-wc-badge) {
|
|
194
|
+
position: absolute !important;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
:host([size="2xs"]) ::slotted(eds-wc-badge) { left: 50%; top: -30%; }
|
|
198
|
+
:host([size="xs"]) ::slotted(eds-wc-badge) { left: 50%; top: -40%; }
|
|
199
|
+
:host([size="s"]) ::slotted(eds-wc-badge) { left: 50%; top: -50%; }
|
|
200
|
+
:host([size="m"]) ::slotted(eds-wc-badge) { left: 50%; top: -40%; }
|
|
201
|
+
:host([size="l"]) ::slotted(eds-wc-badge) { left: 50%; top: -25%; }
|
|
119
202
|
`; }
|
|
120
203
|
render() {
|
|
121
|
-
const baseUrl = EdsBaseElement.assetsBaseUrl;
|
|
122
|
-
const spriteHref = `${baseUrl}/eds/icons/sprites/${this._resolvedSet}.svg#${this._iconName}`;
|
|
123
204
|
return html `
|
|
124
205
|
<button
|
|
125
206
|
part="button"
|
|
126
207
|
type="button"
|
|
127
208
|
?disabled="${this.disabled}"
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
209
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
210
|
+
aria-label="${this.ariaLabel ?? ''}"
|
|
211
|
+
@click="${this._onClick}">
|
|
212
|
+
<eds-wc-icon
|
|
213
|
+
.icon="${this.icon}"
|
|
214
|
+
.color="${this.color}"
|
|
215
|
+
.size="${this.size}">
|
|
216
|
+
<slot></slot>
|
|
217
|
+
</eds-wc-icon>
|
|
133
218
|
</button>
|
|
134
219
|
`;
|
|
135
220
|
}
|
|
@@ -138,7 +223,13 @@ __decorate([
|
|
|
138
223
|
property({ type: String })
|
|
139
224
|
], EdsWcIconButton.prototype, "icon", void 0);
|
|
140
225
|
__decorate([
|
|
141
|
-
property({ type: String,
|
|
226
|
+
property({ type: String, reflect: true })
|
|
227
|
+
], EdsWcIconButton.prototype, "color", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
property({ type: String, reflect: true })
|
|
230
|
+
], EdsWcIconButton.prototype, "size", void 0);
|
|
231
|
+
__decorate([
|
|
232
|
+
property({ type: String, attribute: 'aria-label', reflect: true })
|
|
142
233
|
], EdsWcIconButton.prototype, "ariaLabel", void 0);
|
|
143
234
|
__decorate([
|
|
144
235
|
property({ type: Boolean, reflect: true })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eds-wc-icon-button.js","sourceRoot":"","sources":["../../src/eds-icon-button/eds-wc-icon-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"eds-wc-icon-button.js","sourceRoot":"","sources":["../../src/eds-icon-button/eds-wc-icon-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,4BAA4B,CAAC;AAoBpC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,cAAc;IAA5C;;QACH;;;WAGG;QAEH,SAAI,GAAG,EAAE,CAAC;QAEV;;;WAGG;QAEH,UAAK,GAAyB,SAAS,CAAC;QAExC;;;WAGG;QAEH,SAAI,GAAwB,GAAG,CAAC;QAEhC;;;WAGG;QAEM,cAAS,GAAkB,iBAAiB,CAAC;QAEtD;;;WAGG;QAEH,YAAO,GAAG,KAAK,CAAC;QAEhB;;;WAGG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAkJT,aAAQ,GAAG,CAAC,KAAY,EAAQ,EAAE;YACtC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChB,OAAO;YACX,CAAC;YACD,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,cAAc,EAAE;gBAC/C,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;aACnC,CAAC,CAAC,CAAC;QACR,CAAC,CAAC;IACN,CAAC;aA1JmB,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2H3B,AA3HqB,CA2HpB;IAEiB,MAAM;QACrB,OAAO,IAAI,CAAA;;;;6BAIU,IAAI,CAAC,QAAQ;4BACd,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;8BACpB,IAAI,CAAC,SAAS,IAAI,EAAE;0BACxB,IAAI,CAAC,QAAQ;;6BAEV,IAAI,CAAC,IAAI;8BACR,IAAI,CAAC,KAAK;6BACX,IAAI,CAAC,IAAI;;;;SAI7B,CAAC;IACN,CAAC;;AAnLD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACjB;AAOV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CACF;AAOxC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACV;AAOvB;IADR,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACb;AAOtD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAC3B;AAOhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAC1B;AAzCR,eAAe;IAD3B,aAAa,CAAC,oBAAoB,CAAC;GACvB,eAAe,CAqM3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-icon-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-icon-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/eds-icon-button/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { EdsWcIconButton } from './eds-wc-icon-button
|
|
1
|
+
export { EdsWcIconButton } from './eds-wc-icon-button';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-icon-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-icon-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
package/eds-tag/eds-wc-tag.d.ts
CHANGED
|
@@ -1,30 +1,50 @@
|
|
|
1
1
|
import { EdsBaseElement } from '../shared/eds-base.js';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Local narrowed color union — the tag's color contract. Copied verbatim from the
|
|
4
|
+
* Angular `eds-tag` exported `EdsTagColor` union. No shared-token import.
|
|
5
|
+
*/
|
|
6
|
+
export type EdsWcTagColor = 'primary' | 'neutral' | 'success' | 'info' | 'warning' | 'critical';
|
|
7
|
+
/**
|
|
8
|
+
* Local narrowed size union — the tag's size contract. Copied verbatim from the
|
|
9
|
+
* Angular `eds-tag` exported `EdsTagSize` union.
|
|
10
|
+
*/
|
|
11
|
+
export type EdsWcTagSize = 's' | 'm';
|
|
3
12
|
/**
|
|
4
13
|
* `<eds-wc-tag>` — EDS Tag Web Component.
|
|
5
14
|
*
|
|
6
|
-
* A
|
|
7
|
-
*
|
|
15
|
+
* A presentational, non-interactive status tag. Displays projected content with a
|
|
16
|
+
* semantic color and size, exposed to assistive technology via `role="status"`.
|
|
17
|
+
* 1:1 projection of the Angular `eds-tag`.
|
|
8
18
|
*
|
|
9
19
|
* @example
|
|
10
20
|
* ```html
|
|
11
|
-
* <eds-wc-tag color="success"
|
|
12
|
-
* <eds-wc-tag color="
|
|
13
|
-
* <eds-wc-tag size="l" color-palette="custom-blue">Custom</eds-wc-tag>
|
|
21
|
+
* <eds-wc-tag color="success">Active</eds-wc-tag>
|
|
22
|
+
* <eds-wc-tag color="warning" size="s">Pending</eds-wc-tag>
|
|
14
23
|
* ```
|
|
15
24
|
*
|
|
16
|
-
* @slot - Tag content (text
|
|
17
|
-
*
|
|
18
|
-
* @fires remove - Dispatched when the tag is removed (if removable behavior is added by consumer)
|
|
25
|
+
* @slot - Tag content (text).
|
|
19
26
|
*/
|
|
20
|
-
export declare class EdsWcTag extends
|
|
21
|
-
/**
|
|
22
|
-
|
|
27
|
+
export declare class EdsWcTag extends EdsBaseElement {
|
|
28
|
+
/**
|
|
29
|
+
* Semantic color of the tag.
|
|
30
|
+
* @default 'info'
|
|
31
|
+
*/
|
|
32
|
+
color: EdsWcTagColor;
|
|
33
|
+
/**
|
|
34
|
+
* Size of the tag.
|
|
35
|
+
* @default 'm'
|
|
36
|
+
*/
|
|
37
|
+
size: EdsWcTagSize;
|
|
38
|
+
/**
|
|
39
|
+
* Data attribute for e2e testing.
|
|
40
|
+
* @default 'eds-tag'
|
|
41
|
+
*/
|
|
42
|
+
e2eAttr: string;
|
|
23
43
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
44
|
+
* ARIA label for accessibility.
|
|
45
|
+
* @default 'status-badge'
|
|
26
46
|
*/
|
|
27
|
-
|
|
47
|
+
ariaLabel: string | null;
|
|
28
48
|
static styles: import("lit").CSSResult;
|
|
29
49
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
30
50
|
protected updated(): void;
|
|
@@ -34,5 +54,4 @@ declare global {
|
|
|
34
54
|
'eds-wc-tag': EdsWcTag;
|
|
35
55
|
}
|
|
36
56
|
}
|
|
37
|
-
export {};
|
|
38
57
|
//# sourceMappingURL=eds-wc-tag.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eds-wc-tag.d.ts","sourceRoot":"","sources":["../../src/eds-tag/eds-wc-tag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC
|
|
1
|
+
{"version":3,"file":"eds-wc-tag.d.ts","sourceRoot":"","sources":["../../src/eds-tag/eds-wc-tag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAEhG;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,GAAG,GAAG,CAAC;AAErC;;;;;;;;;;;;;;GAcG;AACH,qBACa,QAAS,SAAQ,cAAc;IACxC;;;OAGG;IAEH,KAAK,EAAE,aAAa,CAAU;IAE9B;;;OAGG;IAEH,IAAI,EAAE,YAAY,CAAO;IAEzB;;;OAGG;IAEH,OAAO,SAAa;IAEpB;;;OAGG;IAEH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAkB;IAE1C,OAAgB,MAAM,0BAuEpB;cAEiB,MAAM;cAIN,OAAO,IAAI,IAAI;CAGrC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,YAAY,EAAE,QAAQ,CAAC;KAC1B;CACJ"}
|
package/eds-tag/eds-wc-tag.js
CHANGED
|
@@ -7,107 +7,115 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { html, css } from 'lit';
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js';
|
|
9
9
|
import { EdsBaseElement } from '../shared/eds-base.js';
|
|
10
|
-
import { ColorMixin } from '../shared/color-mixin.js';
|
|
11
|
-
import { SizeMixin } from '../shared/size-mixin.js';
|
|
12
10
|
/**
|
|
13
11
|
* `<eds-wc-tag>` — EDS Tag Web Component.
|
|
14
12
|
*
|
|
15
|
-
* A
|
|
16
|
-
*
|
|
13
|
+
* A presentational, non-interactive status tag. Displays projected content with a
|
|
14
|
+
* semantic color and size, exposed to assistive technology via `role="status"`.
|
|
15
|
+
* 1:1 projection of the Angular `eds-tag`.
|
|
17
16
|
*
|
|
18
17
|
* @example
|
|
19
18
|
* ```html
|
|
20
|
-
* <eds-wc-tag color="success"
|
|
21
|
-
* <eds-wc-tag color="
|
|
22
|
-
* <eds-wc-tag size="l" color-palette="custom-blue">Custom</eds-wc-tag>
|
|
19
|
+
* <eds-wc-tag color="success">Active</eds-wc-tag>
|
|
20
|
+
* <eds-wc-tag color="warning" size="s">Pending</eds-wc-tag>
|
|
23
21
|
* ```
|
|
24
22
|
*
|
|
25
|
-
* @slot - Tag content (text
|
|
26
|
-
*
|
|
27
|
-
* @fires remove - Dispatched when the tag is removed (if removable behavior is added by consumer)
|
|
23
|
+
* @slot - Tag content (text).
|
|
28
24
|
*/
|
|
29
|
-
let EdsWcTag = class EdsWcTag extends
|
|
25
|
+
let EdsWcTag = class EdsWcTag extends EdsBaseElement {
|
|
30
26
|
constructor() {
|
|
31
27
|
super(...arguments);
|
|
32
|
-
/** Whether to use outline styling (transparent background, stronger border). */
|
|
33
|
-
this.outline = false;
|
|
34
28
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
29
|
+
* Semantic color of the tag.
|
|
30
|
+
* @default 'info'
|
|
31
|
+
*/
|
|
32
|
+
this.color = 'info';
|
|
33
|
+
/**
|
|
34
|
+
* Size of the tag.
|
|
35
|
+
* @default 'm'
|
|
36
|
+
*/
|
|
37
|
+
this.size = 'm';
|
|
38
|
+
/**
|
|
39
|
+
* Data attribute for e2e testing.
|
|
40
|
+
* @default 'eds-tag'
|
|
41
|
+
*/
|
|
42
|
+
this.e2eAttr = 'eds-tag';
|
|
43
|
+
/**
|
|
44
|
+
* ARIA label for accessibility.
|
|
45
|
+
* @default 'status-badge'
|
|
37
46
|
*/
|
|
38
|
-
this.
|
|
47
|
+
this.ariaLabel = 'status-badge';
|
|
39
48
|
}
|
|
40
49
|
static { this.styles = css `
|
|
50
|
+
:host, *, *::before, *::after {
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
}
|
|
53
|
+
|
|
41
54
|
:host {
|
|
42
|
-
--
|
|
43
|
-
--
|
|
44
|
-
--
|
|
55
|
+
--_eds-tag-padding: var(--eds-sp-3xs) var(--eds-sp-s);
|
|
56
|
+
--_eds-tag-border-radius: var(--eds-br-s);
|
|
57
|
+
--_eds-tag-content-font: var(--eds-f-paragraph-s);
|
|
58
|
+
--_eds-tag-border-width: var(--eds-bw-xs);
|
|
59
|
+
|
|
60
|
+
/* default color = info */
|
|
61
|
+
--_eds-tag-bg-color: var(--eds-c-surface-info-subtler);
|
|
62
|
+
--_eds-tag-color-on-bg: var(--eds-c-on-surface-info-subtler);
|
|
63
|
+
--_eds-tag-border-color: var(--eds-c-border-info-subtle);
|
|
45
64
|
|
|
46
|
-
align-items: center;
|
|
47
|
-
border-radius: var(--eds-br-m);
|
|
48
65
|
display: inline-flex;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
background-color: var(--
|
|
53
|
-
color: var(--
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
gap: var(--eds-sp-xs);
|
|
67
|
+
border: var(--_eds-tag-border-width) solid var(--_eds-tag-border-color);
|
|
68
|
+
border-radius: var(--_eds-tag-border-radius);
|
|
69
|
+
background-color: var(--_eds-tag-bg-color);
|
|
70
|
+
color: var(--_eds-tag-color-on-bg);
|
|
71
|
+
padding: var(--_eds-tag-padding);
|
|
72
|
+
font: var(--_eds-tag-content-font);
|
|
56
73
|
}
|
|
57
74
|
|
|
58
|
-
/*
|
|
59
|
-
:host([
|
|
60
|
-
--
|
|
61
|
-
--
|
|
62
|
-
--
|
|
63
|
-
--_height: var(--eds-sp-xl);
|
|
64
|
-
}
|
|
65
|
-
:host([size="l"]) {
|
|
66
|
-
--_font: var(--eds-f-paragraph-s);
|
|
67
|
-
--_tag-padding: var(--eds-sp-3xs) var(--eds-sp-2xs);
|
|
68
|
-
--_icon-size: var(--eds-is-m);
|
|
69
|
-
--_height: var(--eds-sp-2xl);
|
|
75
|
+
/* COLOR VARIANTS */
|
|
76
|
+
:host([color="primary"]) {
|
|
77
|
+
--_eds-tag-bg-color: var(--eds-c-surface-primary-subtler);
|
|
78
|
+
--_eds-tag-color-on-bg: var(--eds-c-on-surface-primary-subtler);
|
|
79
|
+
--_eds-tag-border-color: var(--eds-c-border-primary-subtle);
|
|
70
80
|
}
|
|
71
81
|
|
|
72
|
-
/* Color variants — filled */
|
|
73
82
|
:host([color="neutral"]) {
|
|
74
|
-
--
|
|
75
|
-
--
|
|
76
|
-
--
|
|
77
|
-
}
|
|
78
|
-
:host([color="info"]) {
|
|
79
|
-
--_surface: var(--eds-c-surface-info-subtler);
|
|
80
|
-
--_on-surface: var(--eds-c-on-surface-info-subtler);
|
|
81
|
-
--_border-color: var(--eds-c-border-info-subtle);
|
|
83
|
+
--_eds-tag-bg-color: var(--eds-c-surface-neutral-subtler);
|
|
84
|
+
--_eds-tag-color-on-bg: var(--eds-c-on-surface-neutral-subtler);
|
|
85
|
+
--_eds-tag-border-color: var(--eds-c-border-neutral-subtle);
|
|
82
86
|
}
|
|
87
|
+
|
|
83
88
|
:host([color="success"]) {
|
|
84
|
-
--
|
|
85
|
-
--
|
|
86
|
-
--
|
|
89
|
+
--_eds-tag-bg-color: var(--eds-c-surface-success-subtler);
|
|
90
|
+
--_eds-tag-color-on-bg: var(--eds-c-on-surface-success-subtler);
|
|
91
|
+
--_eds-tag-border-color: var(--eds-c-border-success-subtle);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([color="info"]) {
|
|
95
|
+
--_eds-tag-bg-color: var(--eds-c-surface-info-subtler);
|
|
96
|
+
--_eds-tag-color-on-bg: var(--eds-c-on-surface-info-subtler);
|
|
97
|
+
--_eds-tag-border-color: var(--eds-c-border-info-subtle);
|
|
87
98
|
}
|
|
99
|
+
|
|
88
100
|
:host([color="warning"]) {
|
|
89
|
-
--
|
|
90
|
-
--
|
|
91
|
-
--
|
|
101
|
+
--_eds-tag-bg-color: var(--eds-c-surface-warning-subtler);
|
|
102
|
+
--_eds-tag-color-on-bg: var(--eds-c-on-surface-warning-subtler);
|
|
103
|
+
--_eds-tag-border-color: var(--eds-c-border-warning-subtle);
|
|
92
104
|
}
|
|
105
|
+
|
|
93
106
|
:host([color="critical"]) {
|
|
94
|
-
--
|
|
95
|
-
--
|
|
96
|
-
--
|
|
107
|
+
--_eds-tag-bg-color: var(--eds-c-surface-critical-subtler);
|
|
108
|
+
--_eds-tag-color-on-bg: var(--eds-c-on-surface-critical-subtler);
|
|
109
|
+
--_eds-tag-border-color: var(--eds-c-border-critical-subtle);
|
|
97
110
|
}
|
|
98
111
|
|
|
99
|
-
/*
|
|
100
|
-
:host([
|
|
101
|
-
--
|
|
112
|
+
/* SIZE VARIANTS */
|
|
113
|
+
:host([size="s"]) {
|
|
114
|
+
--_eds-tag-padding: var(--eds-sp-4xs) var(--eds-sp-xs);
|
|
102
115
|
}
|
|
103
|
-
:host([outline][color="neutral"]) { --_border-color: var(--eds-c-border-neutral); }
|
|
104
|
-
:host([outline][color="info"]) { --_border-color: var(--eds-c-border-info); }
|
|
105
|
-
:host([outline][color="success"]) { --_border-color: var(--eds-c-border-success); }
|
|
106
|
-
:host([outline][color="warning"]) { --_border-color: var(--eds-c-border-warning); }
|
|
107
|
-
:host([outline][color="critical"]) { --_border-color: var(--eds-c-border-critical); }
|
|
108
116
|
|
|
109
|
-
|
|
110
|
-
--
|
|
117
|
+
:host([size="m"]) {
|
|
118
|
+
--_eds-tag-padding: var(--eds-sp-3xs) var(--eds-sp-xs);
|
|
111
119
|
}
|
|
112
120
|
`; }
|
|
113
121
|
render() {
|
|
@@ -118,11 +126,17 @@ let EdsWcTag = class EdsWcTag extends SizeMixin(ColorMixin(EdsBaseElement)) {
|
|
|
118
126
|
}
|
|
119
127
|
};
|
|
120
128
|
__decorate([
|
|
121
|
-
property({ type:
|
|
122
|
-
], EdsWcTag.prototype, "
|
|
129
|
+
property({ type: String, reflect: true })
|
|
130
|
+
], EdsWcTag.prototype, "color", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
property({ type: String, reflect: true })
|
|
133
|
+
], EdsWcTag.prototype, "size", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
property({ type: String, reflect: true, attribute: 'data-e2e' })
|
|
136
|
+
], EdsWcTag.prototype, "e2eAttr", void 0);
|
|
123
137
|
__decorate([
|
|
124
|
-
property({ type: String, attribute: '
|
|
125
|
-
], EdsWcTag.prototype, "
|
|
138
|
+
property({ type: String, reflect: true, attribute: 'aria-label' })
|
|
139
|
+
], EdsWcTag.prototype, "ariaLabel", void 0);
|
|
126
140
|
EdsWcTag = __decorate([
|
|
127
141
|
customElement('eds-wc-tag')
|
|
128
142
|
], EdsWcTag);
|