@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
@@ -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;;AAIvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,eAAgB,SAAQ,oBAAqC;IACtE,4DAA4D;IAE5D,IAAI,SAAM;IAEV,2CAA2C;IAElC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAiB;IAElD,2CAA2C;IAE3C,OAAO,UAAS;IAEhB,sBAAsB;IAEtB,QAAQ,UAAS;IAEjB,OAAO,KAAK,SAAS,GAGpB;IAED,OAAO,KAAK,YAAY,GAGvB;IAED,OAAgB,MAAM,0BAoEpB;cAEiB,MAAM;CAiB5B;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,oBAAoB,EAAE,eAAe,CAAC;KACzC;CACJ"}
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 { ColorMixin } from '../shared/color-mixin.js';
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 button that renders a single icon from the EDS sprite sheet.
16
- * Supports size/color variants, rounded shape, and disabled state.
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="star" size="m" color="neutral"></eds-wc-icon-button>
21
- * <eds-wc-icon-button icon="x:core" rounded size="s" disabled></eds-wc-icon-button>
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 content (e.g. badge)
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
- * @csspart button - The internal `<button>` element
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 SizeMixin(ColorMixin(EdsBaseElement)) {
35
+ let EdsWcIconButton = class EdsWcIconButton extends EdsBaseElement {
32
36
  constructor() {
33
37
  super(...arguments);
34
- /** Icon name, optionally with set: `'iconName:setName'`. */
38
+ /**
39
+ * The name of the icon to display from the eUI icon library.
40
+ * @default ''
41
+ */
35
42
  this.icon = '';
36
- /** Accessible label for screen readers. */
37
- this.ariaLabel = 'Icon button';
38
- /** Applies fully rounded border-radius. */
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
- /** Disabled state. */
63
+ /**
64
+ * Disables the button (non-interactive, disabled styling, removed from tab order).
65
+ * @default false
66
+ */
41
67
  this.disabled = false;
42
- }
43
- get _iconName() {
44
- const raw = this.icon;
45
- return raw.indexOf(':') > -1 ? raw.split(':')[0] : raw;
46
- }
47
- get _resolvedSet() {
48
- const raw = this.icon;
49
- return raw.indexOf(':') > -1 ? (raw.split(':')[1] || 'regular') : 'regular';
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: transparent;
63
- padding: var(--_padding, var(--eds-sp-3xs));
105
+ background-color: inherit;
106
+ padding: var(--_eds-icon-button-padding);
64
107
  position: relative;
65
- color: var(--_color, var(--eds-c-foreground-subtle));
66
- border-radius: 0;
67
- line-height: 0;
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(--_surface-hover, var(--eds-c-surface-neutral-subtle));
76
- color: var(--_on-surface-hover, var(--eds-c-on-surface-neutral-subtle));
115
+ background-color: var(--_eds-icon-button-surface-hover);
116
+ color: var(--_eds-icon-button-on-surface-hover);
77
117
  }
78
118
 
79
- button:focus-visible {
80
- outline: 2px solid var(--eds-c-border-focus);
81
- outline-offset: 2px;
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
- button:disabled {
85
- cursor: default;
86
- color: var(--eds-c-foreground-disabled);
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
- button:disabled:hover {
89
- background-color: transparent;
90
- color: var(--eds-c-foreground-disabled);
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
- /* Rounded */
94
- :host([rounded]) button {
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
- /* Color variants */
99
- :host([color="brand"]) { --_color: var(--eds-c-on-surface-brand); --_surface-hover: var(--eds-c-surface-brand--hover); --_on-surface-hover: var(--eds-c-on-surface-brand--hover); }
100
- :host([color="neutral"]) { --_surface-hover: var(--eds-c-surface-neutral-subtle--hover); --_on-surface-hover: var(--eds-c-on-surface-neutral-subtle--hover); }
101
- :host([color="info"]) { --_surface-hover: var(--eds-c-surface-info-subtler--hover); --_on-surface-hover: var(--eds-c-on-surface-info-subtler--hover); }
102
- :host([color="success"]) { --_surface-hover: var(--eds-c-surface-success-subtler--hover); --_on-surface-hover: var(--eds-c-on-surface-success-subtler--hover); }
103
- :host([color="warning"]) { --_surface-hover: var(--eds-c-surface-warning-subtler--hover); --_on-surface-hover: var(--eds-c-on-surface-warning-subtler--hover); }
104
- :host([color="critical"]) { --_surface-hover: var(--eds-c-surface-critical-subtler--hover); --_on-surface-hover: var(--eds-c-on-surface-critical-subtler--hover); }
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
- /* Size variants */
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
- .icon-svg {
114
- width: var(--_icon-size, var(--eds-is-m));
115
- height: var(--_icon-size, var(--eds-is-m));
116
- fill: currentColor;
117
- color: currentColor;
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
- aria-label="${this.ariaLabel || 'Icon button'}">
129
- <svg class="icon-svg" part="svg" aria-hidden="true">
130
- <use href="${spriteHref}"></use>
131
- </svg>
132
- <slot></slot>
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, attribute: 'aria-label' })
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":";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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,2 +1,3 @@
1
- export { EdsWcIconButton } from './eds-wc-icon-button.js';
1
+ export { EdsWcIconButton } from './eds-wc-icon-button';
2
+ export type { EdsWcIconButtonColor, EdsWcIconButtonSize } from './eds-wc-icon-button';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -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,yBAAyB,CAAC"}
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"}
@@ -1,2 +1,2 @@
1
- export { EdsWcIconButton } from './eds-wc-icon-button.js';
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,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-icon-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,30 +1,50 @@
1
1
  import { EdsBaseElement } from '../shared/eds-base.js';
2
- declare const EdsWcTag_base: (new (...args: any[]) => import("../shared/size-mixin.js").SizeMixinInterface) & (new (...args: any[]) => import("../shared/color-mixin.js").ColorMixinInterface) & typeof EdsBaseElement;
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 small labeling element for categorization, filtering, or status display.
7
- * Supports color and size variants, outline mode, and custom color palettes.
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" size="m">Active</eds-wc-tag>
12
- * <eds-wc-tag color="critical" outline>Rejected</eds-wc-tag>
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, icon + text, etc.)
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 EdsWcTag_base {
21
- /** Whether to use outline styling (transparent background, stronger border). */
22
- outline: boolean;
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
- * Extra color palette class name for custom (non-semantic) colors.
25
- * When set, adds `eds-tag--${colorPalette}` to the host.
44
+ * ARIA label for accessibility.
45
+ * @default 'status-badge'
26
46
  */
27
- colorPalette: string;
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;;AAIvD;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,QAAS,SAAQ,aAAqC;IAC/D,gFAAgF;IAEhF,OAAO,UAAS;IAEhB;;;OAGG;IAEH,YAAY,SAAM;IAElB,OAAgB,MAAM,0BAwEpB;cAEiB,MAAM;cAIN,OAAO,IAAI,IAAI;CAGrC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,YAAY,EAAE,QAAQ,CAAC;KAC1B;CACJ"}
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"}
@@ -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 small labeling element for categorization, filtering, or status display.
16
- * Supports color and size variants, outline mode, and custom color palettes.
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" size="m">Active</eds-wc-tag>
21
- * <eds-wc-tag color="critical" outline>Rejected</eds-wc-tag>
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, icon + text, etc.)
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 SizeMixin(ColorMixin(EdsBaseElement)) {
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
- * Extra color palette class name for custom (non-semantic) colors.
36
- * When set, adds `eds-tag--${colorPalette}` to the host.
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.colorPalette = '';
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
- --_surface: var(--eds-c-surface-elevation-sunken);
43
- --_on-surface: var(--eds-c-foreground-subtle);
44
- --_border-color: var(--eds-c-border-neutral-subtle);
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
- border: var(--eds-bw-xs) solid var(--_border-color);
50
- padding: var(--_tag-padding);
51
- font: var(--_font);
52
- background-color: var(--_surface);
53
- color: var(--_on-surface);
54
- gap: var(--eds-sp-3xs);
55
- height: var(--_height);
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
- /* Size variants */
59
- :host([size="m"]) {
60
- --_font: var(--eds-f-paragraph-s);
61
- --_tag-padding: var(--eds-sp-4xs) var(--eds-sp-3xs);
62
- --_icon-size: var(--eds-is-s);
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
- --_surface: var(--eds-c-surface-elevation-sunken);
75
- --_on-surface: var(--eds-c-foreground-subtle);
76
- --_border-color: var(--eds-c-border-neutral-subtle);
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
- --_surface: var(--eds-c-surface-success-subtler);
85
- --_on-surface: var(--eds-c-on-surface-success-subtler);
86
- --_border-color: var(--eds-c-border-success-subtle);
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
- --_surface: var(--eds-c-surface-warning-subtler);
90
- --_on-surface: var(--eds-c-on-surface-warning-subtler);
91
- --_border-color: var(--eds-c-border-warning-subtle);
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
- --_surface: var(--eds-c-surface-critical-subtler);
95
- --_on-surface: var(--eds-c-on-surface-critical-subtler);
96
- --_border-color: var(--eds-c-border-critical-subtle);
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
- /* Color variants — outline */
100
- :host([outline]) {
101
- --_surface: transparent;
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
- ::slotted(eds-wc-icon) {
110
- --_icon-size: inherit;
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: Boolean, reflect: true })
122
- ], EdsWcTag.prototype, "outline", void 0);
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: 'color-palette' })
125
- ], EdsWcTag.prototype, "colorPalette", void 0);
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);