@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.
Files changed (53) hide show
  1. package/eds-alert/eds-wc-alert.d.ts +44 -21
  2. package/eds-alert/eds-wc-alert.d.ts.map +1 -1
  3. package/eds-alert/eds-wc-alert.js +137 -83
  4. package/eds-alert/eds-wc-alert.js.map +1 -1
  5. package/eds-alert/index.d.ts +1 -0
  6. package/eds-alert/index.d.ts.map +1 -1
  7. package/eds-badge/eds-wc-badge.d.ts +63 -23
  8. package/eds-badge/eds-wc-badge.d.ts.map +1 -1
  9. package/eds-badge/eds-wc-badge.js +205 -103
  10. package/eds-badge/eds-wc-badge.js.map +1 -1
  11. package/eds-badge/index.d.ts +1 -0
  12. package/eds-badge/index.d.ts.map +1 -1
  13. package/eds-chip/eds-wc-chip.d.ts +107 -18
  14. package/eds-chip/eds-wc-chip.d.ts.map +1 -1
  15. package/eds-chip/eds-wc-chip.js +332 -113
  16. package/eds-chip/eds-wc-chip.js.map +1 -1
  17. package/eds-chip/index.d.ts +2 -1
  18. package/eds-chip/index.d.ts.map +1 -1
  19. package/eds-chip/index.js +1 -1
  20. package/eds-chip/index.js.map +1 -1
  21. package/eds-icon/eds-wc-icon-image.d.ts +43 -0
  22. package/eds-icon/eds-wc-icon-image.d.ts.map +1 -0
  23. package/eds-icon/eds-wc-icon-image.js +107 -0
  24. package/eds-icon/eds-wc-icon-image.js.map +1 -0
  25. package/eds-icon/eds-wc-icon.d.ts +44 -28
  26. package/eds-icon/eds-wc-icon.d.ts.map +1 -1
  27. package/eds-icon/eds-wc-icon.js +97 -85
  28. package/eds-icon/eds-wc-icon.js.map +1 -1
  29. package/eds-icon/index.d.ts +3 -1
  30. package/eds-icon/index.d.ts.map +1 -1
  31. package/eds-icon/index.js +2 -1
  32. package/eds-icon/index.js.map +1 -1
  33. package/eds-icon-button/eds-wc-icon-button.d.ts +53 -18
  34. package/eds-icon-button/eds-wc-icon-button.d.ts.map +1 -1
  35. package/eds-icon-button/eds-wc-icon-button.js +165 -74
  36. package/eds-icon-button/eds-wc-icon-button.js.map +1 -1
  37. package/eds-icon-button/index.d.ts +2 -1
  38. package/eds-icon-button/index.d.ts.map +1 -1
  39. package/eds-icon-button/index.js +1 -1
  40. package/eds-icon-button/index.js.map +1 -1
  41. package/eds-tag/eds-wc-tag.d.ts +35 -16
  42. package/eds-tag/eds-wc-tag.d.ts.map +1 -1
  43. package/eds-tag/eds-wc-tag.js +86 -72
  44. package/eds-tag/eds-wc-tag.js.map +1 -1
  45. package/eds-tag/index.d.ts +2 -1
  46. package/eds-tag/index.d.ts.map +1 -1
  47. package/eds-tag/index.js +1 -1
  48. package/eds-tag/index.js.map +1 -1
  49. package/index.d.ts +9 -3
  50. package/index.d.ts.map +1 -1
  51. package/index.js +3 -3
  52. package/index.js.map +1 -1
  53. package/package.json +1 -1
@@ -4,186 +4,387 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { html, css, nothing } from 'lit';
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';
10
+ /** Maps a chip size to the size of its inner (remove) icon. */
11
+ const CHIP_ICON_SIZE = {
12
+ s: 'xs',
13
+ m: 's',
14
+ l: 'm',
15
+ };
12
16
  /**
13
17
  * `<eds-wc-chip>` — EDS Chip Web Component.
14
18
  *
15
- * An interactive pill element for selection, filtering, or tagging.
16
- * Supports removable mode (with X icon), active/pressed state,
17
- * color/size variants, and keyboard interaction.
19
+ * An interactive chip that displays projected content with a semantic color and size.
20
+ * The host element itself is the interactive control (`role="button"`, or `role="listitem"`
21
+ * when nested inside an `<eds-wc-chip-list>`): clicking or pressing Enter/Space either removes
22
+ * the chip (when `removable`) or emits a click; Delete/Backspace removes it (WAI-ARIA APG
23
+ * convention). When `removable`, an `x` icon is rendered as the remove affordance.
24
+ * 1:1 projection of the Angular `eds-chip`.
18
25
  *
19
26
  * @example
20
27
  * ```html
21
- * <eds-wc-chip color="neutral" size="m">Filter</eds-wc-chip>
22
- * <eds-wc-chip color="info" removable>Tag</eds-wc-chip>
23
- * <eds-wc-chip active color="primary">Selected</eds-wc-chip>
28
+ * <eds-wc-chip color="success">Active</eds-wc-chip>
29
+ * <eds-wc-chip color="info" size="s" removable>Filter</eds-wc-chip>
30
+ * <eds-wc-chip active>Selected</eds-wc-chip>
31
+ * <eds-wc-chip disabled>Disabled</eds-wc-chip>
24
32
  * ```
25
33
  *
26
- * @slot - Chip content (text, icon + text)
34
+ * @slot - Chip content (text).
27
35
  *
28
- * @fires chip-click - Dispatched when the chip is clicked (non-removable)
29
- * @fires chip-remove - Dispatched when the chip is removed (removable, click or Delete/Backspace key)
36
+ * @fires chip-remove - Fired when the chip is removed (click/Enter on a removable chip, or
37
+ * Delete/Backspace). `detail` is the `EdsWcChipData` payload.
38
+ * @fires chip-click - Fired when a non-removable chip is activated (click/Enter/Space).
39
+ * `detail` is the `EdsWcChipData` payload.
30
40
  */
31
- let EdsWcChip = class EdsWcChip extends SizeMixin(ColorMixin(EdsBaseElement)) {
41
+ let EdsWcChip = class EdsWcChip extends EdsBaseElement {
32
42
  constructor() {
33
43
  super(...arguments);
34
- /** Whether the chip shows a remove icon and emits `chip-remove` on click. */
44
+ /**
45
+ * Semantic color of the chip.
46
+ * @default 'neutral'
47
+ */
48
+ this.color = 'neutral';
49
+ /**
50
+ * Size of the chip.
51
+ * @default 'm'
52
+ */
53
+ this.size = 'm';
54
+ /**
55
+ * Whether the chip can be removed.
56
+ * @default false
57
+ */
35
58
  this.removable = false;
36
- /** Whether the chip is in active/pressed state. */
59
+ /**
60
+ * Whether the chip is in active/pressed state.
61
+ * @default false
62
+ */
37
63
  this.active = false;
38
- /** Disabled state. */
64
+ /**
65
+ * Controls the disabled state of the chip.
66
+ * When true, prevents interaction and applies disabled styling.
67
+ * @default false
68
+ */
39
69
  this.disabled = false;
40
- this._onClick = () => {
41
- if (this.disabled)
70
+ /**
71
+ * Sets the `aria-label` attribute for the host element.
72
+ * When not set, assistive technology will use the text content of the chip.
73
+ * @default null
74
+ */
75
+ this.ariaLabel = null;
76
+ /**
77
+ * Data attribute for e2e testing.
78
+ * @default 'eds-chip'
79
+ */
80
+ this.e2eAttr = 'eds-chip';
81
+ /**
82
+ * Internal id of the chip.
83
+ * @default ''
84
+ */
85
+ this.edsInternalId = '';
86
+ /**
87
+ * Label of the tooltip to display on hover.
88
+ * @default ''
89
+ */
90
+ this.tooltipMessage = '';
91
+ /**
92
+ * Id of the chip.
93
+ * @default ''
94
+ */
95
+ this.id = '';
96
+ /**
97
+ * Data payload of the chip (e.g. tooltip configuration). Emitted with chip events.
98
+ */
99
+ this.data = {
100
+ id: crypto.randomUUID(),
101
+ tooltip: {
102
+ color: 'edsTooltipPrimary',
103
+ contentAlignment: null,
104
+ position: 'above',
105
+ },
106
+ };
107
+ this._onHostClick = (event) => {
108
+ if (this.disabled) {
42
109
  return;
110
+ }
43
111
  if (this.removable) {
44
- this.dispatchEvent(new CustomEvent('chip-remove', { bubbles: true, composed: true }));
112
+ this._onRemove(event);
45
113
  }
46
114
  else {
47
- this.dispatchEvent(new CustomEvent('chip-click', { bubbles: true, composed: true }));
115
+ this._onClick();
48
116
  }
49
117
  };
50
- this._onKeydown = (e) => {
51
- if (this.disabled)
52
- return;
53
- if (e.key === 'Enter' || e.key === ' ') {
54
- e.preventDefault();
55
- this._onClick();
118
+ this._onKeyDown = (event) => {
119
+ const key = event.key;
120
+ if (key === 'Enter') {
121
+ this._onHostClick(event);
56
122
  }
57
- if ((e.key === 'Delete' || e.key === 'Backspace') && this.removable) {
58
- e.preventDefault();
59
- this.dispatchEvent(new CustomEvent('chip-remove', { bubbles: true, composed: true }));
123
+ else if (key === ' ' || key === 'Spacebar') {
124
+ event.preventDefault();
125
+ this._onHostClick(event);
126
+ }
127
+ else if (key === 'Delete' || key === 'Backspace') {
128
+ this._onKeyRemove(event);
60
129
  }
61
130
  };
62
131
  }
132
+ /** Resolved inner remove-icon size, derived from the chip size. */
133
+ get iconSize() {
134
+ return CHIP_ICON_SIZE[this.size];
135
+ }
136
+ /** Resolved role — 'listitem' when inside an eds-wc-chip-list, 'button' otherwise. */
137
+ get hostRole() {
138
+ return this.closest('eds-wc-chip-list') ? 'listitem' : 'button';
139
+ }
63
140
  static { this.styles = css `
141
+ :host, *, *::before, *::after {
142
+ box-sizing: border-box;
143
+ }
144
+
64
145
  :host {
65
- display: inline-flex;
66
- align-items: center;
146
+ /* default color = neutral */
147
+ --_eds-chip-surface: transparent;
148
+ --_eds-chip-on-surface: var(--eds-c-foreground-primary);
149
+ --_eds-chip-border-color: var(--eds-c-border-primary-subtle);
150
+ --_eds-chip-surface-hover: var(--eds-c-surface-primary-subtle);
151
+ --_eds-chip-on-surface-hover: var(--eds-c-on-surface-primary-subtle);
152
+ --_eds-chip-surface-active: var(--eds-c-surface-primary-subtle);
153
+ --_eds-chip-on-surface-active: var(--eds-c-on-surface-primary-subtle);
154
+
155
+ /* default size = m */
156
+ --_eds-chip-font: var(--eds-f-paragraph-s);
157
+ --_eds-chip-padding: var(--eds-sp-4xs) var(--eds-sp-2xs);
158
+ --_eds-chip-height: var(--eds-sp-xl);
159
+
160
+ /* a projected icon follows the chip foreground (on-surface) color */
161
+ --_eds-icon-on-surface: var(--_eds-chip-on-surface);
162
+ --_eds-chip-icon-size: var(--eds-is-s);
163
+
67
164
  border-radius: var(--eds-br-full);
68
- border: var(--eds-bw-xs) solid var(--_border-color, var(--eds-c-border-primary-subtle));
69
- padding: var(--_chip-padding, var(--eds-sp-4xs) var(--eds-sp-2xs));
70
- font: var(--_font, var(--eds-f-paragraph-s));
71
- background-color: var(--_surface, transparent);
72
- color: var(--_on-surface, var(--eds-c-foreground-primary));
73
- height: var(--_height, var(--eds-sp-xl));
165
+ display: inline-flex;
166
+ border: var(--eds-bw-xs) solid var(--_eds-chip-border-color);
167
+ padding: var(--_eds-chip-padding);
168
+ font: var(--_eds-chip-font);
169
+ background-color: var(--_eds-chip-surface);
170
+ color: var(--_eds-chip-on-surface);
171
+ height: var(--_eds-chip-height);
74
172
  cursor: pointer;
75
173
  gap: var(--eds-sp-2xs);
76
- outline: none;
77
- box-sizing: border-box;
174
+ align-items: center;
78
175
  }
79
176
 
80
- :host(:hover) {
81
- background-color: var(--_surface-hover, var(--eds-c-surface-primary-subtle));
82
- color: var(--_on-surface-hover, var(--eds-c-on-surface-primary-subtle));
83
- }
84
- :host(:active) {
85
- background-color: var(--_surface-active, var(--eds-c-surface-primary-subtle));
86
- color: var(--_on-surface-active, var(--eds-c-on-surface-primary-subtle));
177
+ :host(:not([disabled])):focus-visible {
178
+ outline: var(--eds-bw-s) solid var(--eds-c-border-focus);
179
+ outline-offset: var(--eds-bw-xs);
180
+ border-radius: var(--eds-br-full);
87
181
  }
88
182
 
89
- :host(:focus-visible) {
90
- outline: 2px solid var(--eds-c-border-focus);
91
- outline-offset: 2px;
183
+ :host(:hover) {
184
+ background-color: var(--_eds-chip-surface-hover);
185
+ color: var(--_eds-chip-on-surface-hover);
92
186
  }
93
187
 
94
- :host([disabled]) {
95
- cursor: default;
96
- --_surface: var(--eds-c-surface-disabled-subtle);
97
- --_on-surface: var(--eds-c-foreground-disabled);
98
- --_border-color: var(--eds-c-border-disabled);
99
- --_surface-hover: var(--eds-c-surface-disabled-subtle);
100
- --_on-surface-hover: var(--eds-c-foreground-disabled);
101
- }
102
-
103
- /* Sizes */
104
- :host([size="s"]) { --_font: var(--eds-f-paragraph-xs); --_chip-padding: var(--eds-sp-4xs) var(--eds-sp-3xs); --_icon-size: var(--eds-is-xs); --_height: var(--eds-sp-l); }
105
- :host([size="m"]) { --_font: var(--eds-f-paragraph-s); --_chip-padding: var(--eds-sp-4xs) var(--eds-sp-2xs); --_icon-size: var(--eds-is-s); --_height: var(--eds-sp-xl); }
106
- :host([size="l"]) { --_font: var(--eds-f-paragraph-s); --_chip-padding: var(--eds-sp-3xs) var(--eds-sp-2xs); --_icon-size: var(--eds-is-m); --_height: var(--eds-sp-2xl); }
107
-
108
- /* Colors */
109
- :host([color="neutral"]) { --_on-surface: var(--eds-c-foreground-primary); --_border-color: var(--eds-c-border-primary-subtle); --_surface-hover: var(--eds-c-surface-primary-subtle); --_on-surface-hover: var(--eds-c-on-surface-primary-subtle); }
110
- :host([color="info"]) { --_on-surface: var(--eds-c-foreground-info); --_border-color: var(--eds-c-border-info-subtle); --_surface-hover: var(--eds-c-surface-info-subtle); --_on-surface-hover: var(--eds-c-on-surface-info-subtle); }
111
- :host([color="success"]) { --_on-surface: var(--eds-c-foreground-success); --_border-color: var(--eds-c-border-success-subtle); --_surface-hover: var(--eds-c-surface-success-subtle); --_on-surface-hover: var(--eds-c-on-surface-success-subtle); }
112
- :host([color="warning"]) { --_on-surface: var(--eds-c-foreground-warning); --_border-color: var(--eds-c-border-warning-subtle); --_surface-hover: var(--eds-c-surface-warning-subtle); --_on-surface-hover: var(--eds-c-on-surface-warning-subtle); }
113
- :host([color="critical"]) { --_on-surface: var(--eds-c-foreground-critical); --_border-color: var(--eds-c-border-critical-subtle); --_surface-hover: var(--eds-c-surface-critical-subtle); --_on-surface-hover: var(--eds-c-on-surface-critical-subtle); }
114
-
115
- /* Active */
116
- :host([active]) {
117
- --_surface: var(--eds-c-surface-primary);
118
- --_on-surface: var(--eds-c-on-surface-primary);
119
- --_border-color: transparent;
120
- --_surface-hover: var(--eds-c-surface-primary--hover);
121
- --_on-surface-hover: var(--eds-c-on-surface-primary--hover);
122
- --_surface-active: var(--eds-c-surface-primary--pressed);
123
- --_on-surface-active: var(--eds-c-on-surface-primary--pressed);
188
+ :host(:active) {
189
+ background-color: var(--_eds-chip-surface-active);
190
+ color: var(--_eds-chip-on-surface-active);
124
191
  }
125
192
 
126
- .chip__content {
193
+ .eds-chip__content {
127
194
  display: inline-flex;
128
195
  align-items: center;
196
+ background: transparent;
129
197
  gap: var(--eds-sp-2xs);
130
198
  }
131
199
 
132
- .chip__remove {
133
- display: inline-flex;
134
- margin-left: var(--eds-sp-3xs);
135
- line-height: 0;
200
+ .eds-chip__close {
201
+ margin-left: var(--eds-sp-xs);
202
+ }
203
+
204
+ .eds-chip__icon {
205
+ height: var(--_eds-chip-icon-size);
206
+ width: var(--_eds-chip-icon-size);
207
+ fill: var(--_eds-chip-on-surface);
208
+ color: var(--_eds-chip-on-surface);
209
+ }
210
+
211
+ /* SIZE VARIANTS */
212
+ :host([size="s"]) {
213
+ --_eds-chip-font: var(--eds-f-paragraph-xs);
214
+ --_eds-chip-padding: var(--eds-sp-4xs) var(--eds-sp-3xs);
215
+ --_eds-chip-height: var(--eds-sp-l);
216
+ --_eds-chip-icon-size: var(--eds-is-xs);
217
+ }
218
+
219
+ :host([size="m"]) {
220
+ --_eds-chip-font: var(--eds-f-paragraph-s);
221
+ --_eds-chip-padding: var(--eds-sp-4xs) var(--eds-sp-2xs);
222
+ --_eds-chip-height: var(--eds-sp-xl);
223
+ --_eds-chip-icon-size: var(--eds-is-s);
224
+ }
225
+
226
+ :host([size="l"]) {
227
+ --_eds-chip-font: var(--eds-f-paragraph-s);
228
+ --_eds-chip-padding: var(--eds-sp-3xs) var(--eds-sp-2xs);
229
+ --_eds-chip-height: var(--eds-sp-2xl);
230
+ --_eds-chip-icon-size: var(--eds-is-m);
231
+ }
232
+
233
+ /* COLOR VARIANTS */
234
+ :host([color="neutral"]) {
235
+ --_eds-chip-surface: transparent;
236
+ --_eds-chip-on-surface: var(--eds-c-foreground-primary);
237
+ --_eds-chip-border-color: var(--eds-c-border-primary-subtle);
238
+ --_eds-chip-surface-hover: var(--eds-c-surface-primary-subtle);
239
+ --_eds-chip-on-surface-hover: var(--eds-c-on-surface-primary-subtle);
240
+ --_eds-chip-surface-active: var(--eds-c-surface-primary-subtle);
241
+ --_eds-chip-on-surface-active: var(--eds-c-on-surface-primary-subtle);
242
+ }
243
+
244
+ :host([color="info"]) {
245
+ --_eds-chip-surface: transparent;
246
+ --_eds-chip-on-surface: var(--eds-c-foreground-info);
247
+ --_eds-chip-border-color: var(--eds-c-border-info-subtle);
248
+ --_eds-chip-surface-hover: var(--eds-c-surface-info-subtle);
249
+ --_eds-chip-on-surface-hover: var(--eds-c-on-surface-info-subtle);
250
+ --_eds-chip-surface-active: var(--eds-c-surface-info-subtle);
251
+ --_eds-chip-on-surface-active: var(--eds-c-on-surface-info-subtle);
252
+ }
253
+
254
+ :host([color="success"]) {
255
+ --_eds-chip-surface: transparent;
256
+ --_eds-chip-on-surface: var(--eds-c-foreground-success);
257
+ --_eds-chip-border-color: var(--eds-c-border-success-subtle);
258
+ --_eds-chip-surface-hover: var(--eds-c-surface-success-subtle);
259
+ --_eds-chip-on-surface-hover: var(--eds-c-on-surface-success-subtle);
260
+ --_eds-chip-surface-active: var(--eds-c-surface-success-subtle);
261
+ --_eds-chip-on-surface-active: var(--eds-c-on-surface-success-subtle);
262
+ }
263
+
264
+ :host([color="warning"]) {
265
+ --_eds-chip-surface: transparent;
266
+ --_eds-chip-on-surface: var(--eds-c-foreground-warning);
267
+ --_eds-chip-border-color: var(--eds-c-border-warning-subtle);
268
+ --_eds-chip-surface-hover: var(--eds-c-surface-warning-subtle);
269
+ --_eds-chip-on-surface-hover: var(--eds-c-on-surface-warning-subtle);
270
+ --_eds-chip-surface-active: var(--eds-c-surface-warning-subtle);
271
+ --_eds-chip-on-surface-active: var(--eds-c-on-surface-warning-subtle);
136
272
  }
137
273
 
138
- .chip__remove svg {
139
- width: var(--eds-is-xs);
140
- height: var(--eds-is-xs);
141
- fill: currentColor;
274
+ :host([color="critical"]) {
275
+ --_eds-chip-surface: transparent;
276
+ --_eds-chip-on-surface: var(--eds-c-foreground-critical);
277
+ --_eds-chip-border-color: var(--eds-c-border-critical-subtle);
278
+ --_eds-chip-surface-hover: var(--eds-c-surface-critical-subtle);
279
+ --_eds-chip-on-surface-hover: var(--eds-c-on-surface-critical-subtle);
280
+ --_eds-chip-surface-active: var(--eds-c-surface-critical-subtle);
281
+ --_eds-chip-on-surface-active: var(--eds-c-on-surface-critical-subtle);
282
+ }
283
+
284
+ /* STATE OVERRIDES */
285
+ :host([active]) {
286
+ --_eds-chip-surface: var(--eds-c-surface-primary);
287
+ --_eds-chip-on-surface: var(--eds-c-on-surface-primary);
288
+ --_eds-chip-border-color: transparent;
289
+ --_eds-chip-surface-hover: var(--eds-c-surface-primary--hover);
290
+ --_eds-chip-on-surface-hover: var(--eds-c-on-surface-primary--hover);
291
+ --_eds-chip-surface-active: var(--eds-c-surface-primary--pressed);
292
+ --_eds-chip-on-surface-active: var(--eds-c-on-surface-primary--pressed);
293
+ }
294
+
295
+ :host([disabled]) {
296
+ --_eds-chip-surface: var(--eds-c-surface-disabled-subtle);
297
+ --_eds-chip-on-surface: var(--eds-c-foreground-disabled);
298
+ --_eds-chip-border-color: var(--eds-c-border-disabled);
299
+ --_eds-chip-surface-hover: var(--eds-c-surface-disabled-subtle);
300
+ --_eds-chip-on-surface-hover: var(--eds-c-foreground-disabled);
301
+ --_eds-chip-surface-active: var(--eds-c-surface-disabled-subtle);
302
+ --_eds-chip-on-surface-active: var(--eds-c-foreground-disabled);
303
+
304
+ cursor: default;
142
305
  }
143
306
  `; }
144
307
  connectedCallback() {
145
308
  super.connectedCallback();
146
- this.setAttribute('role', 'button');
147
- if (!this.hasAttribute('tabindex')) {
148
- this.setAttribute('tabindex', this.disabled ? '-1' : '0');
149
- }
150
- this.addEventListener('click', this._onClick);
151
- this.addEventListener('keydown', this._onKeydown);
309
+ this.addEventListener('click', this._onHostClick);
310
+ this.addEventListener('keydown', this._onKeyDown);
152
311
  }
153
312
  disconnectedCallback() {
313
+ this.removeEventListener('click', this._onHostClick);
314
+ this.removeEventListener('keydown', this._onKeyDown);
154
315
  super.disconnectedCallback();
155
- this.removeEventListener('click', this._onClick);
156
- this.removeEventListener('keydown', this._onKeydown);
157
316
  }
158
- updated() {
159
- this.setAttribute('tabindex', this.disabled ? '-1' : '0');
160
- if (this.active) {
161
- this.setAttribute('aria-pressed', 'true');
162
- }
163
- else {
164
- this.removeAttribute('aria-pressed');
317
+ _onKeyRemove(event) {
318
+ if (this.disabled || !this.removable) {
319
+ return;
165
320
  }
166
- if (this.disabled) {
167
- this.setAttribute('aria-disabled', 'true');
321
+ event.preventDefault();
322
+ this._emitRemove(this.data);
323
+ }
324
+ _onRemove(event) {
325
+ if (event instanceof KeyboardEvent && event.code === 'Backspace') {
326
+ this._emitRemove({ ...this.data, _event: event });
168
327
  }
169
328
  else {
170
- this.removeAttribute('aria-disabled');
329
+ this._emitRemove(this.data);
171
330
  }
172
331
  }
332
+ _onClick() {
333
+ this.dispatchEvent(new CustomEvent('chip-click', {
334
+ bubbles: true,
335
+ composed: true,
336
+ detail: this.data,
337
+ }));
338
+ }
339
+ _emitRemove(detail) {
340
+ this.dispatchEvent(new CustomEvent('chip-remove', {
341
+ bubbles: true,
342
+ composed: true,
343
+ detail,
344
+ }));
345
+ }
173
346
  render() {
174
347
  const baseUrl = EdsBaseElement.assetsBaseUrl;
348
+ const spriteHref = `${baseUrl}/eds/icons/sprites/core.svg#x`;
349
+ const chipLabel = this.textContent?.trim() ?? '';
175
350
  return html `
176
- <span class="chip__content"><slot></slot></span>
351
+ <div class="eds-chip__content">
352
+ <slot></slot>
353
+ </div>
177
354
  ${this.removable
178
- ? html `
179
- <span class="chip__remove" aria-hidden="true">
180
- <svg aria-hidden="true"><use href="${baseUrl}/eds/icons/sprites/core.svg#x"></use></svg>
181
- </span>
182
- `
183
- : nothing}
355
+ ? html `<svg
356
+ class="eds-chip__icon eds-chip__icon--${this.iconSize}"
357
+ role="img"
358
+ aria-label="Remove ${chipLabel} chip">
359
+ <use href="${spriteHref}"></use>
360
+ </svg>`
361
+ : ''}
184
362
  `;
185
363
  }
364
+ updated() {
365
+ // Mirror the Angular host bindings.
366
+ this.setAttribute('role', this.hostRole);
367
+ this.setAttribute('tabindex', this.disabled ? '-1' : '0');
368
+ if (this.disabled) {
369
+ this.setAttribute('aria-disabled', 'true');
370
+ }
371
+ else {
372
+ this.removeAttribute('aria-disabled');
373
+ }
374
+ if (this.active) {
375
+ this.setAttribute('aria-pressed', 'true');
376
+ }
377
+ else {
378
+ this.removeAttribute('aria-pressed');
379
+ }
380
+ }
186
381
  };
382
+ __decorate([
383
+ property({ type: String, reflect: true })
384
+ ], EdsWcChip.prototype, "color", void 0);
385
+ __decorate([
386
+ property({ type: String, reflect: true })
387
+ ], EdsWcChip.prototype, "size", void 0);
187
388
  __decorate([
188
389
  property({ type: Boolean, reflect: true })
189
390
  ], EdsWcChip.prototype, "removable", void 0);
@@ -193,6 +394,24 @@ __decorate([
193
394
  __decorate([
194
395
  property({ type: Boolean, reflect: true })
195
396
  ], EdsWcChip.prototype, "disabled", void 0);
397
+ __decorate([
398
+ property({ type: String, attribute: 'aria-label', reflect: true })
399
+ ], EdsWcChip.prototype, "ariaLabel", void 0);
400
+ __decorate([
401
+ property({ type: String, reflect: true, attribute: 'data-e2e' })
402
+ ], EdsWcChip.prototype, "e2eAttr", void 0);
403
+ __decorate([
404
+ property({ type: String })
405
+ ], EdsWcChip.prototype, "edsInternalId", void 0);
406
+ __decorate([
407
+ property({ type: String })
408
+ ], EdsWcChip.prototype, "tooltipMessage", void 0);
409
+ __decorate([
410
+ property({ type: String })
411
+ ], EdsWcChip.prototype, "id", void 0);
412
+ __decorate([
413
+ property({ type: Object })
414
+ ], EdsWcChip.prototype, "data", void 0);
196
415
  EdsWcChip = __decorate([
197
416
  customElement('eds-wc-chip')
198
417
  ], EdsWcChip);
@@ -1 +1 @@
1
- {"version":3,"file":"eds-wc-chip.js","sourceRoot":"","sources":["../../src/eds-chip/eds-wc-chip.ts"],"names":[],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AE,CAAC;4CACzB;AAOlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAC5B;AAQf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAC1B;AAQR;IADR,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAC1B;AAOzC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;0CAC5C;AAOrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACR;AAOnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDACP;AAOX;IADR,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACF;AAMzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAQzB;AApFO,SAAS;IADrB,aAAa,CAAC,aAAa,CAAC;GAChB,SAAS,CAgXrB"}
@@ -1,2 +1,3 @@
1
- export { EdsWcChip } from './eds-wc-chip.js';
1
+ export { EdsWcChip } from './eds-wc-chip';
2
+ export type { EdsWcChipColor, EdsWcChipSize, EdsWcChipData } from './eds-wc-chip';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
package/eds-chip/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { EdsWcChip } from './eds-wc-chip.js';
1
+ export { EdsWcChip } from './eds-wc-chip';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { EdsBaseElement } from '../shared/eds-base.js';
2
+ import type { EdsWcIconSize } from './eds-wc-icon.js';
3
+ /**
4
+ * `<eds-wc-icon-image>` — EDS Icon Image Web Component.
5
+ *
6
+ * Displays a raster/vector image as an icon from a direct URL, bypassing sprite-set
7
+ * resolution. Sized via the `size` string attribute. 1:1 projection of the Angular
8
+ * `eds-icon-image`.
9
+ *
10
+ * @example
11
+ * ```html
12
+ * <eds-wc-icon-image icon-url="/assets/custom-icon.svg" size="l" aria-label="Custom icon"></eds-wc-icon-image>
13
+ * ```
14
+ */
15
+ export declare class EdsWcIconImage extends EdsBaseElement {
16
+ /**
17
+ * Direct URL to an SVG/image icon file, bypassing icon-set resolution. Useful for
18
+ * loading custom or external icons not in configured icon sets.
19
+ * @default ''
20
+ */
21
+ iconUrl: string;
22
+ /**
23
+ * Size of the icon.
24
+ * @default 'm'
25
+ */
26
+ size: EdsWcIconSize;
27
+ /**
28
+ * Accessible label for screen readers describing the icon's purpose.
29
+ * When set, the icon gets `role="img"` and this label; when empty it is hidden from
30
+ * assistive technologies.
31
+ * @default ''
32
+ */
33
+ ariaLabel: string | null;
34
+ static styles: import("lit").CSSResult;
35
+ protected render(): import("lit-html").TemplateResult<1>;
36
+ protected updated(): void;
37
+ }
38
+ declare global {
39
+ interface HTMLElementTagNameMap {
40
+ 'eds-wc-icon-image': EdsWcIconImage;
41
+ }
42
+ }
43
+ //# sourceMappingURL=eds-wc-icon-image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eds-wc-icon-image.d.ts","sourceRoot":"","sources":["../../src/eds-icon/eds-wc-icon-image.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;;;;;;GAWG;AACH,qBACa,cAAe,SAAQ,cAAc;IAC9C;;;;OAIG;IAEH,OAAO,SAAM;IAEb;;;OAGG;IAEH,IAAI,EAAE,aAAa,CAAO;IAE1B;;;;;OAKG;IAEM,SAAS,EAAE,MAAM,GAAG,IAAI,CAAM;IAEvC,OAAgB,MAAM,0BA4BpB;cAEiB,MAAM;cAQN,OAAO,IAAI,IAAI;CAYrC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,mBAAmB,EAAE,cAAc,CAAC;KACvC;CACJ"}