@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
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, css } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { EdsBaseElement } from '../shared/eds-base.js';
|
|
10
|
+
/**
|
|
11
|
+
* `<eds-wc-icon-image>` — EDS Icon Image Web Component.
|
|
12
|
+
*
|
|
13
|
+
* Displays a raster/vector image as an icon from a direct URL, bypassing sprite-set
|
|
14
|
+
* resolution. Sized via the `size` string attribute. 1:1 projection of the Angular
|
|
15
|
+
* `eds-icon-image`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```html
|
|
19
|
+
* <eds-wc-icon-image icon-url="/assets/custom-icon.svg" size="l" aria-label="Custom icon"></eds-wc-icon-image>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
let EdsWcIconImage = class EdsWcIconImage extends EdsBaseElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
/**
|
|
26
|
+
* Direct URL to an SVG/image icon file, bypassing icon-set resolution. Useful for
|
|
27
|
+
* loading custom or external icons not in configured icon sets.
|
|
28
|
+
* @default ''
|
|
29
|
+
*/
|
|
30
|
+
this.iconUrl = '';
|
|
31
|
+
/**
|
|
32
|
+
* Size of the icon.
|
|
33
|
+
* @default 'm'
|
|
34
|
+
*/
|
|
35
|
+
this.size = 'm';
|
|
36
|
+
/**
|
|
37
|
+
* Accessible label for screen readers describing the icon's purpose.
|
|
38
|
+
* When set, the icon gets `role="img"` and this label; when empty it is hidden from
|
|
39
|
+
* assistive technologies.
|
|
40
|
+
* @default ''
|
|
41
|
+
*/
|
|
42
|
+
this.ariaLabel = '';
|
|
43
|
+
}
|
|
44
|
+
static { this.styles = css `
|
|
45
|
+
:host, *, *::before, *::after {
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host {
|
|
50
|
+
/* inherited from parent */
|
|
51
|
+
--_eds-icon-image-size: var(--_icon-size, var(--eds-is-m));
|
|
52
|
+
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
position: relative;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.eds-icon-svg-image {
|
|
58
|
+
height: var(--_eds-icon-image-size);
|
|
59
|
+
width: var(--_eds-icon-image-size);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* SIZE VARIANTS */
|
|
63
|
+
:host([size="2xs"]) { --_eds-icon-image-size: var(--eds-is-2xs); }
|
|
64
|
+
:host([size="xs"]) { --_eds-icon-image-size: var(--eds-is-xs); }
|
|
65
|
+
:host([size="s"]) { --_eds-icon-image-size: var(--eds-is-s); }
|
|
66
|
+
:host([size="m"]) { --_eds-icon-image-size: var(--eds-is-m); }
|
|
67
|
+
:host([size="l"]) { --_eds-icon-image-size: var(--eds-is-l); }
|
|
68
|
+
:host([size="xl"]) { --_eds-icon-image-size: var(--eds-is-xl); }
|
|
69
|
+
:host([size="2xl"]) { --_eds-icon-image-size: var(--eds-is-2xl); }
|
|
70
|
+
:host([size="3xl"]) { --_eds-icon-image-size: var(--eds-is-3xl); }
|
|
71
|
+
:host([size="4xl"]) { --_eds-icon-image-size: var(--eds-is-4xl); }
|
|
72
|
+
`; }
|
|
73
|
+
render() {
|
|
74
|
+
return html `
|
|
75
|
+
<svg class="eds-icon-svg-image" aria-hidden="true" role="img">
|
|
76
|
+
<image href="${this.iconUrl}" class="eds-icon-svg-image"></image>
|
|
77
|
+
</svg>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
updated() {
|
|
81
|
+
// Mirror the Angular host bindings: a label promotes the host to role="img";
|
|
82
|
+
// otherwise the icon is decorative and hidden from assistive technologies.
|
|
83
|
+
const hasLabel = !!this.ariaLabel && this.ariaLabel.length > 0;
|
|
84
|
+
if (hasLabel) {
|
|
85
|
+
this.setAttribute('role', 'img');
|
|
86
|
+
this.removeAttribute('aria-hidden');
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this.removeAttribute('role');
|
|
90
|
+
this.setAttribute('aria-hidden', 'true');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
__decorate([
|
|
95
|
+
property({ type: String, attribute: 'icon-url' })
|
|
96
|
+
], EdsWcIconImage.prototype, "iconUrl", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
property({ type: String, reflect: true })
|
|
99
|
+
], EdsWcIconImage.prototype, "size", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
property({ type: String, attribute: 'aria-label', reflect: true })
|
|
102
|
+
], EdsWcIconImage.prototype, "ariaLabel", void 0);
|
|
103
|
+
EdsWcIconImage = __decorate([
|
|
104
|
+
customElement('eds-wc-icon-image')
|
|
105
|
+
], EdsWcIconImage);
|
|
106
|
+
export { EdsWcIconImage };
|
|
107
|
+
//# sourceMappingURL=eds-wc-icon-image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eds-wc-icon-image.js","sourceRoot":"","sources":["../../src/eds-icon/eds-wc-icon-image.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;AAGvD;;;;;;;;;;;GAWG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,cAAc;IAA3C;;QACH;;;;WAIG;QAEH,YAAO,GAAG,EAAE,CAAC;QAEb;;;WAGG;QAEH,SAAI,GAAkB,GAAG,CAAC;QAE1B;;;;;WAKG;QAEM,cAAS,GAAkB,EAAE,CAAC;IAoD3C,CAAC;aAlDmB,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4B3B,AA5BqB,CA4BpB;IAEiB,MAAM;QACrB,OAAO,IAAI,CAAA;;+BAEY,IAAI,CAAC,OAAO;;SAElC,CAAC;IACN,CAAC;IAEkB,OAAO;QACtB,6EAA6E;QAC7E,2EAA2E;QAC3E,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/D,IAAI,QAAQ,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YACjC,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAC7B,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAC7C,CAAC;IACL,CAAC;;AAnED;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;+CACrC;AAOb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAChB;AASjB;IADR,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAC5B;AAvB9B,cAAc;IAD1B,aAAa,CAAC,mBAAmB,CAAC;GACtB,cAAc,CA2E1B"}
|
|
@@ -1,59 +1,76 @@
|
|
|
1
1
|
import { EdsBaseElement } from '../shared/eds-base.js';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Local narrowed color union — the icon's color contract. Copied verbatim from the
|
|
4
|
+
* Angular `eds-icon` exported `EdsIconColor` union. No shared-token import.
|
|
5
|
+
*/
|
|
6
|
+
export type EdsWcIconColor = 'neutral' | 'neutral-subtle' | 'neutral-subtler' | 'primary' | 'highlight' | 'info' | 'success' | 'warning' | 'critical' | 'brand' | 'disabled';
|
|
7
|
+
/**
|
|
8
|
+
* Local narrowed size union — the icon's size contract. Copied verbatim from the
|
|
9
|
+
* Angular `eds-icon` exported `EdsIconSize` union.
|
|
10
|
+
*/
|
|
11
|
+
export type EdsWcIconSize = '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl';
|
|
3
12
|
/**
|
|
4
13
|
* `<eds-wc-icon>` — EDS Icon Web Component.
|
|
5
14
|
*
|
|
6
|
-
* Displays
|
|
7
|
-
*
|
|
15
|
+
* Displays a scalable vector icon from a sprite set. Supports semantic color and size via
|
|
16
|
+
* string attributes, an optional circular clip, and a loading spinner. Icons resolve from
|
|
17
|
+
* the configured assets path using the `iconName:setName` convention. 1:1 projection of the
|
|
18
|
+
* Angular `eds-icon`.
|
|
8
19
|
*
|
|
9
20
|
* @example
|
|
10
21
|
* ```html
|
|
11
|
-
* <eds-wc-icon icon="
|
|
12
|
-
* <eds-wc-icon icon="
|
|
13
|
-
* <eds-wc-icon icon="
|
|
22
|
+
* <eds-wc-icon icon="check" color="success" size="m"></eds-wc-icon>
|
|
23
|
+
* <eds-wc-icon icon="warning" color="warning" size="l" aria-label="Warning"></eds-wc-icon>
|
|
24
|
+
* <eds-wc-icon icon="check:core"></eds-wc-icon>
|
|
25
|
+
* <eds-wc-icon icon="flag-be:flags-4x3" rounded></eds-wc-icon>
|
|
26
|
+
* <eds-wc-icon loading></eds-wc-icon>
|
|
14
27
|
* ```
|
|
15
28
|
*
|
|
16
|
-
* @slot - Default slot for projected content (e.g. badge overlay)
|
|
17
|
-
*
|
|
18
|
-
* @csspart svg - The SVG element rendering the icon
|
|
19
|
-
* @csspart spinner - The loading spinner element
|
|
29
|
+
* @slot - Default slot for projected content (e.g. a badge overlay).
|
|
20
30
|
*/
|
|
21
|
-
export declare class EdsWcIcon extends
|
|
31
|
+
export declare class EdsWcIcon extends EdsBaseElement {
|
|
22
32
|
/**
|
|
23
|
-
*
|
|
24
|
-
* When
|
|
33
|
+
* Name of the icon to display, optionally including the icon set using `iconName:setName`
|
|
34
|
+
* format. When the value contains a colon, it splits into icon name and set.
|
|
35
|
+
* @default ''
|
|
25
36
|
*/
|
|
26
37
|
icon: string;
|
|
27
38
|
/**
|
|
28
|
-
* Icon set
|
|
29
|
-
* Only used when `icon` doesn't contain a colon separator.
|
|
39
|
+
* Icon set library to load the icon from. Used only when `icon` has no colon separator.
|
|
30
40
|
* @default 'regular'
|
|
31
41
|
*/
|
|
32
42
|
set: string;
|
|
33
43
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* When empty, the icon is hidden from assistive technologies.
|
|
44
|
+
* Semantic color of the icon.
|
|
45
|
+
* @default 'neutral'
|
|
37
46
|
*/
|
|
38
|
-
|
|
47
|
+
color: EdsWcIconColor;
|
|
48
|
+
/**
|
|
49
|
+
* Size of the icon.
|
|
50
|
+
* @default 'm'
|
|
51
|
+
*/
|
|
52
|
+
size: EdsWcIconSize;
|
|
39
53
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
54
|
+
* Accessible label for screen readers describing the icon's purpose.
|
|
55
|
+
* When set, the icon gets `role="img"` and this label; when empty it is hidden from
|
|
56
|
+
* assistive technologies.
|
|
57
|
+
* @default ''
|
|
42
58
|
*/
|
|
43
|
-
|
|
59
|
+
ariaLabel: string | null;
|
|
44
60
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
61
|
+
* Applies a circular clip (border-radius: 50%) to the icon, useful for flag icons.
|
|
62
|
+
* @default false
|
|
47
63
|
*/
|
|
48
64
|
rounded: boolean;
|
|
49
65
|
/**
|
|
50
|
-
*
|
|
66
|
+
* When true, replaces the icon with a spinning loading indicator.
|
|
51
67
|
* The spinner inherits the icon's size and color.
|
|
68
|
+
* @default false
|
|
52
69
|
*/
|
|
53
70
|
loading: boolean;
|
|
54
|
-
/** Resolved icon name (part before colon, or full string). */
|
|
71
|
+
/** Resolved icon name (part before the colon, or the full string). */
|
|
55
72
|
private get iconName();
|
|
56
|
-
/** Resolved icon set (part after colon, or `set` property). */
|
|
73
|
+
/** Resolved icon set (part after the colon, or the `set` property; defaults to `regular`). */
|
|
57
74
|
private get resolvedSet();
|
|
58
75
|
static styles: import("lit").CSSResult;
|
|
59
76
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
@@ -64,5 +81,4 @@ declare global {
|
|
|
64
81
|
'eds-wc-icon': EdsWcIcon;
|
|
65
82
|
}
|
|
66
83
|
}
|
|
67
|
-
export {};
|
|
68
84
|
//# sourceMappingURL=eds-wc-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eds-wc-icon.d.ts","sourceRoot":"","sources":["../../src/eds-icon/eds-wc-icon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC
|
|
1
|
+
{"version":3,"file":"eds-wc-icon.d.ts","sourceRoot":"","sources":["../../src/eds-icon/eds-wc-icon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,cAAc,GACpB,SAAS,GACT,gBAAgB,GAChB,iBAAiB,GACjB,SAAS,GACT,WAAW,GACX,MAAM,GACN,SAAS,GACT,SAAS,GACT,UAAU,GACV,OAAO,GACP,UAAU,CAAC;AAEjB;;;GAGG;AACH,MAAM,MAAM,aAAa,GACnB,KAAK,GACL,IAAI,GACJ,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAEZ;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,SAAU,SAAQ,cAAc;IACzC;;;;OAIG;IAEH,IAAI,SAAM;IAEV;;;OAGG;IAEH,GAAG,SAAa;IAEhB;;;OAGG;IAEH,KAAK,EAAE,cAAc,CAAa;IAElC;;;OAGG;IAEH,IAAI,EAAE,aAAa,CAAO;IAE1B;;;;;OAKG;IAEM,SAAS,EAAE,MAAM,GAAG,IAAI,CAAM;IAEvC;;;OAGG;IAEH,OAAO,UAAS;IAEhB;;;;OAIG;IAEH,OAAO,UAAS;IAEhB,sEAAsE;IACtE,OAAO,KAAK,QAAQ,GAMnB;IAED,8FAA8F;IAC9F,OAAO,KAAK,WAAW,GAMtB;IAED,OAAgB,MAAM,0BA0EpB;cAEiB,MAAM;cAkBN,OAAO,IAAI,IAAI;CAYrC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,aAAa,EAAE,SAAS,CAAC;KAC5B;CACJ"}
|
package/eds-icon/eds-wc-icon.js
CHANGED
|
@@ -7,63 +7,69 @@ 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-icon>` — EDS Icon Web Component.
|
|
14
12
|
*
|
|
15
|
-
* Displays
|
|
16
|
-
*
|
|
13
|
+
* Displays a scalable vector icon from a sprite set. Supports semantic color and size via
|
|
14
|
+
* string attributes, an optional circular clip, and a loading spinner. Icons resolve from
|
|
15
|
+
* the configured assets path using the `iconName:setName` convention. 1:1 projection of the
|
|
16
|
+
* Angular `eds-icon`.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```html
|
|
20
|
-
* <eds-wc-icon icon="
|
|
21
|
-
* <eds-wc-icon icon="
|
|
22
|
-
* <eds-wc-icon icon="
|
|
20
|
+
* <eds-wc-icon icon="check" color="success" size="m"></eds-wc-icon>
|
|
21
|
+
* <eds-wc-icon icon="warning" color="warning" size="l" aria-label="Warning"></eds-wc-icon>
|
|
22
|
+
* <eds-wc-icon icon="check:core"></eds-wc-icon>
|
|
23
|
+
* <eds-wc-icon icon="flag-be:flags-4x3" rounded></eds-wc-icon>
|
|
24
|
+
* <eds-wc-icon loading></eds-wc-icon>
|
|
23
25
|
* ```
|
|
24
26
|
*
|
|
25
|
-
* @slot - Default slot for projected content (e.g. badge overlay)
|
|
26
|
-
*
|
|
27
|
-
* @csspart svg - The SVG element rendering the icon
|
|
28
|
-
* @csspart spinner - The loading spinner element
|
|
27
|
+
* @slot - Default slot for projected content (e.g. a badge overlay).
|
|
29
28
|
*/
|
|
30
|
-
let EdsWcIcon = class EdsWcIcon extends
|
|
29
|
+
let EdsWcIcon = class EdsWcIcon extends EdsBaseElement {
|
|
31
30
|
constructor() {
|
|
32
31
|
super(...arguments);
|
|
33
32
|
/**
|
|
34
|
-
*
|
|
35
|
-
* When
|
|
33
|
+
* Name of the icon to display, optionally including the icon set using `iconName:setName`
|
|
34
|
+
* format. When the value contains a colon, it splits into icon name and set.
|
|
35
|
+
* @default ''
|
|
36
36
|
*/
|
|
37
37
|
this.icon = '';
|
|
38
38
|
/**
|
|
39
|
-
* Icon set
|
|
40
|
-
* Only used when `icon` doesn't contain a colon separator.
|
|
39
|
+
* Icon set library to load the icon from. Used only when `icon` has no colon separator.
|
|
41
40
|
* @default 'regular'
|
|
42
41
|
*/
|
|
43
42
|
this.set = 'regular';
|
|
44
43
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* When empty, the icon is hidden from assistive technologies.
|
|
44
|
+
* Semantic color of the icon.
|
|
45
|
+
* @default 'neutral'
|
|
48
46
|
*/
|
|
49
|
-
this.
|
|
47
|
+
this.color = 'neutral';
|
|
50
48
|
/**
|
|
51
|
-
*
|
|
52
|
-
* @default
|
|
49
|
+
* Size of the icon.
|
|
50
|
+
* @default 'm'
|
|
53
51
|
*/
|
|
54
|
-
this.
|
|
52
|
+
this.size = 'm';
|
|
55
53
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
54
|
+
* Accessible label for screen readers describing the icon's purpose.
|
|
55
|
+
* When set, the icon gets `role="img"` and this label; when empty it is hidden from
|
|
56
|
+
* assistive technologies.
|
|
57
|
+
* @default ''
|
|
58
|
+
*/
|
|
59
|
+
this.ariaLabel = '';
|
|
60
|
+
/**
|
|
61
|
+
* Applies a circular clip (border-radius: 50%) to the icon, useful for flag icons.
|
|
62
|
+
* @default false
|
|
58
63
|
*/
|
|
59
64
|
this.rounded = false;
|
|
60
65
|
/**
|
|
61
|
-
*
|
|
66
|
+
* When true, replaces the icon with a spinning loading indicator.
|
|
62
67
|
* The spinner inherits the icon's size and color.
|
|
68
|
+
* @default false
|
|
63
69
|
*/
|
|
64
70
|
this.loading = false;
|
|
65
71
|
}
|
|
66
|
-
/** Resolved icon name (part before colon, or full string). */
|
|
72
|
+
/** Resolved icon name (part before the colon, or the full string). */
|
|
67
73
|
get iconName() {
|
|
68
74
|
const raw = this.icon;
|
|
69
75
|
if (raw && raw.indexOf(':') > -1) {
|
|
@@ -71,7 +77,7 @@ let EdsWcIcon = class EdsWcIcon extends SizeMixin(ColorMixin(EdsBaseElement)) {
|
|
|
71
77
|
}
|
|
72
78
|
return raw;
|
|
73
79
|
}
|
|
74
|
-
/** Resolved icon set (part after colon, or `set` property). */
|
|
80
|
+
/** Resolved icon set (part after the colon, or the `set` property; defaults to `regular`). */
|
|
75
81
|
get resolvedSet() {
|
|
76
82
|
const raw = this.icon;
|
|
77
83
|
if (raw && raw.indexOf(':') > -1) {
|
|
@@ -80,67 +86,72 @@ let EdsWcIcon = class EdsWcIcon extends SizeMixin(ColorMixin(EdsBaseElement)) {
|
|
|
80
86
|
return this.set || 'regular';
|
|
81
87
|
}
|
|
82
88
|
static { this.styles = css `
|
|
89
|
+
:host, *, *::before, *::after {
|
|
90
|
+
box-sizing: border-box;
|
|
91
|
+
}
|
|
92
|
+
|
|
83
93
|
:host {
|
|
94
|
+
/* inherited from parent; each color variant supplies its own token below */
|
|
95
|
+
--_eds-icon-size: var(--_icon-size, var(--eds-is-m));
|
|
96
|
+
--_eds-icon-color: var(--_eds-icon-on-surface, var(--_on-surface, var(--eds-c-foreground)));
|
|
97
|
+
|
|
84
98
|
display: inline-flex;
|
|
85
99
|
position: relative;
|
|
86
|
-
|
|
87
|
-
--_size: var(--_icon-size, var(--eds-is-m));
|
|
88
|
-
--_color: var(--_on-surface, var(--eds-c-foreground));
|
|
89
100
|
}
|
|
90
101
|
|
|
91
|
-
/*
|
|
92
|
-
:host([size="2xs"]) { --
|
|
93
|
-
:host([size="xs"])
|
|
94
|
-
:host([size="s"])
|
|
95
|
-
:host([size="m"])
|
|
96
|
-
:host([size="l"])
|
|
97
|
-
:host([size="xl"])
|
|
98
|
-
:host([size="2xl"]) { --
|
|
99
|
-
:host([size="3xl"]) { --
|
|
100
|
-
:host([size="4xl"]) { --
|
|
102
|
+
/* SIZE VARIANTS */
|
|
103
|
+
:host([size="2xs"]) { --_eds-icon-size: var(--eds-is-2xs); }
|
|
104
|
+
:host([size="xs"]) { --_eds-icon-size: var(--eds-is-xs); }
|
|
105
|
+
:host([size="s"]) { --_eds-icon-size: var(--eds-is-s); }
|
|
106
|
+
:host([size="m"]) { --_eds-icon-size: var(--eds-is-m); }
|
|
107
|
+
:host([size="l"]) { --_eds-icon-size: var(--eds-is-l); }
|
|
108
|
+
:host([size="xl"]) { --_eds-icon-size: var(--eds-is-xl); }
|
|
109
|
+
:host([size="2xl"]) { --_eds-icon-size: var(--eds-is-2xl); }
|
|
110
|
+
:host([size="3xl"]) { --_eds-icon-size: var(--eds-is-3xl); }
|
|
111
|
+
:host([size="4xl"]) { --_eds-icon-size: var(--eds-is-4xl); }
|
|
101
112
|
|
|
102
|
-
/*
|
|
103
|
-
:host([color="neutral"])
|
|
104
|
-
:host([color="neutral-subtle"])
|
|
105
|
-
:host([color="neutral-subtler"]) { --
|
|
106
|
-
:host([color="primary"])
|
|
107
|
-
:host([color="highlight"])
|
|
108
|
-
:host([color="info"])
|
|
109
|
-
:host([color="success"])
|
|
110
|
-
:host([color="warning"])
|
|
111
|
-
:host([color="critical"])
|
|
112
|
-
:host([color="brand"])
|
|
113
|
-
:host([color="disabled"])
|
|
114
|
-
|
|
115
|
-
/* Rounded variant */
|
|
116
|
-
:host([rounded]) {
|
|
117
|
-
border-radius: 50%;
|
|
118
|
-
overflow: hidden;
|
|
119
|
-
}
|
|
120
|
-
:host([rounded]) .eds-icon-svg {
|
|
121
|
-
border-radius: 50%;
|
|
122
|
-
}
|
|
113
|
+
/* COLOR VARIANTS */
|
|
114
|
+
:host([color="neutral"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-foreground)); }
|
|
115
|
+
:host([color="neutral-subtle"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-foreground-subtle)); }
|
|
116
|
+
:host([color="neutral-subtler"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-foreground-subtler)); }
|
|
117
|
+
:host([color="primary"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-foreground-primary)); }
|
|
118
|
+
:host([color="highlight"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-foreground-highlight)); }
|
|
119
|
+
:host([color="info"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-foreground-info)); }
|
|
120
|
+
:host([color="success"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-foreground-success)); }
|
|
121
|
+
:host([color="warning"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-foreground-warning)); }
|
|
122
|
+
:host([color="critical"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-foreground-critical)); }
|
|
123
|
+
:host([color="brand"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-on-surface-brand)); }
|
|
124
|
+
:host([color="disabled"]) { --_eds-icon-color: var(--_eds-icon-on-surface, var(--eds-c-foreground-disabled)); }
|
|
123
125
|
|
|
124
126
|
.eds-icon-svg {
|
|
125
|
-
height: var(--
|
|
126
|
-
width: var(--
|
|
127
|
-
fill: var(--
|
|
128
|
-
color: var(--
|
|
127
|
+
height: var(--_eds-icon-size);
|
|
128
|
+
width: var(--_eds-icon-size);
|
|
129
|
+
fill: var(--_eds-icon-color);
|
|
130
|
+
color: var(--_eds-icon-color);
|
|
129
131
|
}
|
|
130
132
|
|
|
131
|
-
/* Multi-color sprites (flags) — disable fill inheritance */
|
|
133
|
+
/* Multi-color sprites (flags) — disable fill inheritance so path fill attributes render */
|
|
132
134
|
.eds-icon-svg.eds-icon-set-flags-1x1,
|
|
133
135
|
.eds-icon-svg.eds-icon-set-flags-4x3 {
|
|
134
136
|
fill: none;
|
|
135
137
|
}
|
|
136
138
|
|
|
137
|
-
/*
|
|
138
|
-
|
|
139
|
+
/* ROUNDED */
|
|
140
|
+
:host([rounded]) {
|
|
141
|
+
border-radius: 50%;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
}
|
|
144
|
+
:host([rounded]) .eds-icon-svg {
|
|
145
|
+
border-radius: 50%;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* LOADING SPINNER — inherits icon size and color */
|
|
149
|
+
:host([loading]) .eds-icon-spinner {
|
|
139
150
|
display: inline-block;
|
|
140
|
-
width: var(--
|
|
141
|
-
height: var(--
|
|
151
|
+
width: var(--_eds-icon-size);
|
|
152
|
+
height: var(--_eds-icon-size);
|
|
142
153
|
border: 3px solid var(--eds-c-border-neutral-subtle);
|
|
143
|
-
border-top-color: var(--
|
|
154
|
+
border-top-color: var(--_eds-icon-color);
|
|
144
155
|
border-radius: 50%;
|
|
145
156
|
animation: eds-icon-spin 0.6s linear infinite;
|
|
146
157
|
}
|
|
@@ -156,21 +167,19 @@ let EdsWcIcon = class EdsWcIcon extends SizeMixin(ColorMixin(EdsBaseElement)) {
|
|
|
156
167
|
const spriteHref = `${baseUrl}/eds/icons/sprites/${setName}.svg#${iconName}`;
|
|
157
168
|
return html `
|
|
158
169
|
${this.loading
|
|
159
|
-
? html `<span class="eds-icon-spinner"
|
|
160
|
-
: html
|
|
161
|
-
|
|
162
|
-
class="eds-icon-svg eds-icon-set-${setName}"
|
|
163
|
-
part="svg"
|
|
170
|
+
? html `<span class="eds-icon-spinner" aria-hidden="true"></span>`
|
|
171
|
+
: html `<svg
|
|
172
|
+
class="eds-icon-svg eds-sprite-${iconName} eds-icon-set-${setName}"
|
|
164
173
|
aria-hidden="true">
|
|
165
174
|
<use href="${spriteHref}"></use>
|
|
166
|
-
</svg
|
|
167
|
-
`}
|
|
175
|
+
</svg>`}
|
|
168
176
|
<slot></slot>
|
|
169
177
|
`;
|
|
170
178
|
}
|
|
171
179
|
updated() {
|
|
172
|
-
//
|
|
173
|
-
|
|
180
|
+
// Mirror the Angular host bindings: an accessible label promotes the icon to
|
|
181
|
+
// role="img"; otherwise it is decorative and hidden from assistive technologies.
|
|
182
|
+
const hasLabel = !!this.ariaLabel && this.ariaLabel.length > 0;
|
|
174
183
|
if (hasLabel) {
|
|
175
184
|
this.setAttribute('role', 'img');
|
|
176
185
|
this.removeAttribute('aria-hidden');
|
|
@@ -188,11 +197,14 @@ __decorate([
|
|
|
188
197
|
property({ type: String })
|
|
189
198
|
], EdsWcIcon.prototype, "set", void 0);
|
|
190
199
|
__decorate([
|
|
191
|
-
property({ type: String,
|
|
192
|
-
], EdsWcIcon.prototype, "
|
|
200
|
+
property({ type: String, reflect: true })
|
|
201
|
+
], EdsWcIcon.prototype, "color", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
property({ type: String, reflect: true })
|
|
204
|
+
], EdsWcIcon.prototype, "size", void 0);
|
|
193
205
|
__decorate([
|
|
194
|
-
property({ type:
|
|
195
|
-
], EdsWcIcon.prototype, "
|
|
206
|
+
property({ type: String, attribute: 'aria-label', reflect: true })
|
|
207
|
+
], EdsWcIcon.prototype, "ariaLabel", void 0);
|
|
196
208
|
__decorate([
|
|
197
209
|
property({ type: Boolean, reflect: true })
|
|
198
210
|
], EdsWcIcon.prototype, "rounded", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eds-wc-icon.js","sourceRoot":"","sources":["../../src/eds-icon/eds-wc-icon.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;
|
|
1
|
+
{"version":3,"file":"eds-wc-icon.js","sourceRoot":"","sources":["../../src/eds-icon/eds-wc-icon.ts"],"names":[],"mappings":"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"}
|
package/eds-icon/index.d.ts
CHANGED
package/eds-icon/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/eds-icon/index.js
CHANGED
package/eds-icon/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,42 +1,77 @@
|
|
|
1
1
|
import { EdsBaseElement } from '../shared/eds-base.js';
|
|
2
|
-
|
|
2
|
+
import '../eds-icon/eds-wc-icon.js';
|
|
3
|
+
/**
|
|
4
|
+
* Local narrowed color union — the icon button's color contract. Copied verbatim from the
|
|
5
|
+
* Angular `eds-icon-button` exported `EdsIconButtonColor` union. No shared-token import.
|
|
6
|
+
*/
|
|
7
|
+
export type EdsWcIconButtonColor = 'brand' | 'neutral' | 'info' | 'success' | 'warning' | 'critical';
|
|
8
|
+
/**
|
|
9
|
+
* Local narrowed size union — the icon button's size contract. Copied verbatim from the
|
|
10
|
+
* Angular `eds-icon-button` exported `EdsIconButtonSize` union.
|
|
11
|
+
*/
|
|
12
|
+
export type EdsWcIconButtonSize = '2xs' | 'xs' | 's' | 'm' | 'l';
|
|
3
13
|
/**
|
|
4
14
|
* `<eds-wc-icon-button>` — EDS Icon Button Web Component.
|
|
5
15
|
*
|
|
6
|
-
* A
|
|
7
|
-
* Supports
|
|
16
|
+
* A compact, icon-only button. Renders an internal native `<button>` (for keyboard/focus/click
|
|
17
|
+
* semantics) containing an `<eds-wc-icon>`. Supports semantic color and size via reflected string
|
|
18
|
+
* attributes, an optional rounded shape, and a disabled state. 1:1 projection of the Angular
|
|
19
|
+
* `button[edsIconButton]` directive.
|
|
20
|
+
*
|
|
21
|
+
* Unlike the Angular directive which decorates a consumer-provided native `<button>`, this web
|
|
22
|
+
* component renders its own internal `<button>` element and mirrors the same reflected attribute
|
|
23
|
+
* API on the host.
|
|
8
24
|
*
|
|
9
25
|
* @example
|
|
10
26
|
* ```html
|
|
11
|
-
* <eds-wc-icon-button icon="
|
|
12
|
-
* <eds-wc-icon-button icon="
|
|
27
|
+
* <eds-wc-icon-button icon="gear" aria-label="Settings"></eds-wc-icon-button>
|
|
28
|
+
* <eds-wc-icon-button icon="trash" color="critical" size="s" aria-label="Delete"></eds-wc-icon-button>
|
|
29
|
+
* <eds-wc-icon-button icon="star" color="brand" rounded aria-label="Favorite"></eds-wc-icon-button>
|
|
30
|
+
* <eds-wc-icon-button icon="bell" disabled aria-label="Notifications"></eds-wc-icon-button>
|
|
13
31
|
* ```
|
|
14
32
|
*
|
|
15
|
-
* @slot - Default slot for overlay
|
|
16
|
-
*
|
|
17
|
-
* @fires click - Native click event (blocked when disabled)
|
|
33
|
+
* @slot - Default slot for a projected overlay such as an `<eds-wc-badge>`.
|
|
18
34
|
*
|
|
19
|
-
* @
|
|
20
|
-
* @csspart svg - The icon SVG element
|
|
35
|
+
* @fires button-click - Dispatched when the button is clicked. `detail: { originalEvent: Event }`
|
|
21
36
|
*/
|
|
22
|
-
export declare class EdsWcIconButton extends
|
|
23
|
-
/**
|
|
37
|
+
export declare class EdsWcIconButton extends EdsBaseElement {
|
|
38
|
+
/**
|
|
39
|
+
* The name of the icon to display from the eUI icon library.
|
|
40
|
+
* @default ''
|
|
41
|
+
*/
|
|
24
42
|
icon: string;
|
|
25
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Semantic color of the icon button.
|
|
45
|
+
* @default 'neutral'
|
|
46
|
+
*/
|
|
47
|
+
color: EdsWcIconButtonColor;
|
|
48
|
+
/**
|
|
49
|
+
* Size of the icon button.
|
|
50
|
+
* @default 'm'
|
|
51
|
+
*/
|
|
52
|
+
size: EdsWcIconButtonSize;
|
|
53
|
+
/**
|
|
54
|
+
* Accessible label for screen readers describing the button's purpose.
|
|
55
|
+
* @default 'EDS Icon button'
|
|
56
|
+
*/
|
|
26
57
|
ariaLabel: string | null;
|
|
27
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Applies rounded corners to the button shape instead of default square corners.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
28
62
|
rounded: boolean;
|
|
29
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Disables the button (non-interactive, disabled styling, removed from tab order).
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
30
67
|
disabled: boolean;
|
|
31
|
-
private get _iconName();
|
|
32
|
-
private get _resolvedSet();
|
|
33
68
|
static styles: import("lit").CSSResult;
|
|
34
69
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
70
|
+
private _onClick;
|
|
35
71
|
}
|
|
36
72
|
declare global {
|
|
37
73
|
interface HTMLElementTagNameMap {
|
|
38
74
|
'eds-wc-icon-button': EdsWcIconButton;
|
|
39
75
|
}
|
|
40
76
|
}
|
|
41
|
-
export {};
|
|
42
77
|
//# sourceMappingURL=eds-wc-icon-button.d.ts.map
|