@eunomia/elements 1.0.0-beta.4 → 1.0.0-beta.5
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/dist/cdn/components/chunks/{chunk-SIHZFOTK.js → chunk-2XASWWKR.js} +1 -1
- package/dist/cdn/components/chunks/chunk-32DTNR52.js +1 -0
- package/dist/cdn/components/chunks/chunk-3MTUVMM5.js +1 -0
- package/dist/cdn/components/chunks/chunk-5GKM5DIB.js +1 -0
- package/dist/cdn/components/chunks/{chunk-GSJEJLFA.js → chunk-6ETDXUH2.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-EJIX2D4Z.js → chunk-AIS3UICU.js} +7 -7
- package/dist/cdn/components/chunks/{chunk-BMQOI7HX.js → chunk-DKOPI7QA.js} +99 -55
- package/dist/cdn/components/chunks/{chunk-NHFWATVN.js → chunk-EAKYD33D.js} +3 -3
- package/dist/cdn/components/chunks/{chunk-EOWBYZV7.js → chunk-IDKZKLJR.js} +5 -5
- package/dist/cdn/components/chunks/chunk-JRGM3W7I.js +53 -0
- package/dist/cdn/components/chunks/{chunk-UAGCQF23.js → chunk-L65WUTXM.js} +5 -5
- package/dist/cdn/components/chunks/chunk-LFCXUVDO.js +1 -0
- package/dist/cdn/components/chunks/{chunk-YGUJJ25C.js → chunk-MPQP4R54.js} +2 -2
- package/dist/cdn/components/chunks/{chunk-RJCJXB7Y.js → chunk-NBIENHLV.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-4MXL6PZC.js → chunk-OW7XKDCH.js} +13 -13
- package/dist/cdn/components/chunks/{chunk-IJ5WFMK4.js → chunk-SD2WHGPF.js} +7 -6
- package/dist/cdn/components/chunks/chunk-SJWRE6PW.js +1 -0
- package/dist/cdn/components/eun-animate.js +5 -3
- package/dist/cdn/components/eun-badge.js +7 -7
- package/dist/cdn/components/eun-breadcrumb-item.js +1 -1
- package/dist/cdn/components/eun-breadcrumb.js +1 -1
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-calendar.js +13 -13
- package/dist/cdn/components/eun-card.js +42 -3
- package/dist/cdn/components/eun-carousel.js +2 -2
- package/dist/cdn/components/eun-check-card.js +1 -1
- package/dist/cdn/components/eun-checkbox-list.js +1 -1
- package/dist/cdn/components/eun-checkbox.js +1 -1
- package/dist/cdn/components/eun-chip.js +1 -1
- package/dist/cdn/components/eun-collapse.js +39 -20
- package/dist/cdn/components/eun-color-picker.js +3 -3
- package/dist/cdn/components/eun-counter.js +8 -8
- package/dist/cdn/components/eun-date-picker.js +19 -19
- package/dist/cdn/components/eun-drawer.js +9 -9
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-fab.js +6 -6
- package/dist/cdn/components/eun-icon.js +1 -1
- package/dist/cdn/components/eun-image-card.js +1 -1
- package/dist/cdn/components/eun-image-carousel.js +3 -3
- package/dist/cdn/components/eun-input-file.js +1 -1
- package/dist/cdn/components/eun-input-phone.js +18 -18
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +116 -18
- package/dist/cdn/components/eun-modal.js +15 -15
- package/dist/cdn/components/eun-radio-card.js +1 -1
- package/dist/cdn/components/eun-radio-list.js +1 -1
- package/dist/cdn/components/eun-radio.js +1 -1
- package/dist/cdn/components/eun-scheduler-event-editor.js +7 -7
- package/dist/cdn/components/eun-scheduler-event.js +1 -1
- package/dist/cdn/components/eun-scheduler.js +18 -18
- package/dist/cdn/components/eun-search.js +15 -15
- package/dist/cdn/components/eun-select.js +2 -2
- package/dist/cdn/components/eun-slider.js +1 -1
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-switch.js +1 -1
- package/dist/cdn/components/eun-tab-group.js +1 -1
- package/dist/cdn/components/eun-tab.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +1 -1
- package/dist/cdn/components/eun-textarea.js +2 -2
- package/dist/cdn/components/eun-time-picker.js +11 -11
- package/dist/cdn/components/eun-toggle-group.js +30 -22
- package/dist/cdn/components/eun-toggle-item.js +10 -8
- package/dist/cdn/components/eun-toggle.js +1 -1
- package/dist/cdn/components/eun-toolbar.js +1 -1
- package/dist/components/action/button/button.d.ts +44 -17
- package/dist/components/action/button/button.js +100 -22
- package/dist/components/action/button/button.styles.js +77 -39
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +8 -8
- package/dist/components/action/dropdown-button/dropdown-button.js +7 -7
- package/dist/components/action/fab/fab.d.ts +7 -6
- package/dist/components/action/fab/fab.js +11 -8
- package/dist/components/action/fab/fab.styles.js +4 -4
- package/dist/components/action/link/link.d.ts +65 -6
- package/dist/components/action/link/link.js +176 -20
- package/dist/components/action/link/link.styles.js +86 -1
- package/dist/components/action/shared-styles/button-palette.styles.d.ts +3 -3
- package/dist/components/action/shared-styles/button-palette.styles.js +14 -14
- package/dist/components/action/toggle/toggle-group.d.ts +15 -5
- package/dist/components/action/toggle/toggle-group.js +42 -17
- package/dist/components/action/toggle/toggle-group.styles.d.ts +2 -1
- package/dist/components/action/toggle/toggle-group.styles.js +15 -7
- package/dist/components/action/toggle/toggle-item.d.ts +4 -4
- package/dist/components/action/toggle/toggle-item.js +2 -2
- package/dist/components/action/toggle/toggle-item.styles.js +8 -6
- package/dist/components/alert/drawer/drawer.js +1 -1
- package/dist/components/alert/modal/modal.d.ts +8 -8
- package/dist/components/alert/modal/modal.js +11 -11
- package/dist/components/content/badge/badge.d.ts +6 -6
- package/dist/components/content/badge/badge.js +4 -4
- package/dist/components/content/badge/badge.styles.js +4 -4
- package/dist/components/content/card/card.d.ts +32 -4
- package/dist/components/content/card/card.js +64 -4
- package/dist/components/content/card/card.styles.js +33 -1
- package/dist/components/content/card/image-card.d.ts +2 -1
- package/dist/components/content/card/image-card.js +1 -0
- package/dist/components/content/card/sliding-card.d.ts +2 -1
- package/dist/components/content/card/sliding-card.js +1 -0
- package/dist/components/content/collapse/collapse.d.ts +29 -11
- package/dist/components/content/collapse/collapse.js +53 -23
- package/dist/components/content/collapse/collapse.styles.js +13 -0
- package/dist/components/content/icon/icon.d.ts +12 -2
- package/dist/components/content/icon/icon.js +52 -22
- package/dist/components/content/icon/icon.style.d.ts +2 -0
- package/dist/components/content/icon/icon.style.js +4 -1
- package/dist/components/content/shared-styles/card-link.styles.js +1 -0
- package/dist/components/form/color-picker/color-picker.d.ts +3 -3
- package/dist/components/form/color-picker/color-picker.js +4 -4
- package/dist/components/form/counter/counter.d.ts +3 -3
- package/dist/components/form/counter/counter.js +3 -3
- package/dist/components/form/counter/counter.styles.js +5 -5
- package/dist/components/form/date-picker/date-picker.d.ts +3 -3
- package/dist/components/form/date-picker/date-picker.js +3 -3
- package/dist/components/form/date-picker/date-picker.styles.js +5 -5
- package/dist/components/form/input/input.d.ts +3 -3
- package/dist/components/form/input/input.js +4 -4
- package/dist/components/form/input-phone/input-phone.d.ts +3 -3
- package/dist/components/form/input-phone/input-phone.js +3 -3
- package/dist/components/form/input-phone/input-phone.styles.js +12 -12
- package/dist/components/form/search/search.styles.js +3 -3
- package/dist/components/form/select/select.d.ts +3 -3
- package/dist/components/form/select/select.js +3 -3
- package/dist/components/form/shared-styles/field.styles.js +5 -5
- package/dist/components/form/textarea/textarea.d.ts +3 -3
- package/dist/components/form/textarea/textarea.js +4 -4
- package/dist/components/form/time-picker/time-picker.d.ts +3 -3
- package/dist/components/form/time-picker/time-picker.js +3 -3
- package/dist/components/form/time-picker/time-picker.styles.js +5 -5
- package/dist/components/layout/animate/animate.d.ts +8 -0
- package/dist/components/layout/animate/animate.js +20 -8
- package/dist/features/scheduler/calendar/calendar.d.ts +6 -6
- package/dist/features/scheduler/calendar/calendar.js +9 -9
- package/dist/features/scheduler/scheduler/scheduler.d.ts +6 -6
- package/dist/features/scheduler/scheduler/scheduler.js +13 -13
- package/dist/features/scheduler/scheduler-event/scheduler-event.d.ts +10 -8
- package/dist/features/scheduler/scheduler-event/scheduler-event.js +7 -7
- package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +6 -6
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +5 -5
- package/dist/features/scheduler/shared/scheduler-event-popover.js +2 -2
- package/dist/features/scheduler/shared/scheduler-hour-grid.d.ts +2 -2
- package/dist/features/scheduler/shared/scheduler-hour-grid.js +3 -3
- package/dist/features/scheduler/shared/scheduler-month-view.d.ts +3 -3
- package/dist/features/scheduler/shared/scheduler-month-view.js +2 -2
- package/dist/features/table/table/table.types.d.ts +7 -3
- package/dist/features/table/table-action-bar/table-action-bar.js +3 -3
- package/dist/features/table/table-managed/table-managed.js +2 -2
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.js +3 -0
- package/dist/i18n/fr.js +3 -0
- package/dist/index.d.ts +3 -3
- package/dist/jsx.d.ts +1 -1
- package/dist/mixins/button.mixin.d.ts +10 -9
- package/dist/mixins/button.mixin.js +14 -6
- package/dist/mixins/card-link.mixin.d.ts +3 -2
- package/dist/mixins/card-link.mixin.js +12 -5
- package/dist/mixins/disabled.mixin.d.ts +3 -3
- package/dist/mixins/disabled.mixin.js +10 -5
- package/dist/mixins/field-appearance.mixin.d.ts +19 -0
- package/dist/mixins/{field-variant.mixin.js → field-appearance.mixin.js} +11 -11
- package/dist/ssr/animate-ssr.css +26 -72
- package/dist/ssr/links-ssr.css +35 -0
- package/dist/ssr/overlay-ssr.css +0 -41
- package/dist/ssr/rich-text.css +38 -0
- package/dist/ssr/sidebar-ssr.css +0 -38
- package/dist/ssr/toolbar-ssr.css +73 -39
- package/dist/types/variant.type.d.ts +26 -10
- package/dist/utils/navigation.utils.d.ts +14 -0
- package/dist/utils/navigation.utils.js +33 -0
- package/dist/utils/new-tab-anchor.controller.d.ts +44 -0
- package/dist/utils/new-tab-anchor.controller.js +102 -0
- package/dist/utils/severity-icon.utils.d.ts +1 -1
- package/dist/utils/severity-icon.utils.js +1 -1
- package/dist/utils/theme-generator.utils.d.ts +3 -1
- package/dist/utils/theme-generator.utils.js +3 -1
- package/package.json +8 -2
- package/dist/cdn/components/chunks/chunk-2JLDJFYD.js +0 -48
- package/dist/cdn/components/chunks/chunk-ATH2OAMU.js +0 -1
- package/dist/cdn/components/chunks/chunk-BKHD4S57.js +0 -1
- package/dist/cdn/components/chunks/chunk-T7WABJEJ.js +0 -1
- package/dist/cdn/components/chunks/chunk-XSMCT4DF.js +0 -1
- package/dist/mixins/field-variant.mixin.d.ts +0 -22
|
@@ -31,6 +31,7 @@ export declare function setIconBaseUrl(url: string): void;
|
|
|
31
31
|
* @cssprop [--icon-background] - Sets a background color behind the icon, for example for a hover highlight. Transparent by default
|
|
32
32
|
* @cssprop [--icon-padding] - Sets the space between the icon and its background box. Zero by default
|
|
33
33
|
* @cssprop [--icon-border-radius] - Sets the corner radius of the background box
|
|
34
|
+
* @cssprop [--icon-transition] - Sets the transition applied to the icon's color, background, and size changes. 0.2s by default
|
|
34
35
|
* @element eun-icon
|
|
35
36
|
*/
|
|
36
37
|
export declare class EunomiaIcon extends LitElement {
|
|
@@ -60,9 +61,18 @@ export declare class EunomiaIcon extends LitElement {
|
|
|
60
61
|
/**
|
|
61
62
|
* Sets the size of the icon. Accepts any valid CSS size unit.
|
|
62
63
|
* - If size ends with `%`, it will be converted to `rem`.
|
|
63
|
-
* - If no size is provided,
|
|
64
|
+
* - If no size is provided, falls back to `--icon-size`, then `1rem`.
|
|
65
|
+
*
|
|
66
|
+
* Applied on the internal wrapper (see {@link cssSize}) rather than as an
|
|
67
|
+
* inline style on the host, which an SSR framework would report as a
|
|
68
|
+
* hydration mismatch.
|
|
64
69
|
*/
|
|
65
70
|
set size(size: string | undefined);
|
|
71
|
+
/**
|
|
72
|
+
* The CSS length {@link size} resolves to, or `undefined` when unset.
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
private get cssSize();
|
|
66
76
|
/**
|
|
67
77
|
* Gets the current size value set for the icon.
|
|
68
78
|
*/
|
|
@@ -149,7 +159,7 @@ export declare class EunomiaIcon extends LitElement {
|
|
|
149
159
|
* Renders the icon component. If no `name` is set, renders nothing.
|
|
150
160
|
* If SVG markup is available, it is rendered using `unsafeSVG`.
|
|
151
161
|
*/
|
|
152
|
-
render(): import("lit-html").TemplateResult<1
|
|
162
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
153
163
|
}
|
|
154
164
|
declare global {
|
|
155
165
|
interface HTMLElementTagNameMap {
|
|
@@ -4,21 +4,22 @@ 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
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
7
12
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8
13
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9
14
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10
15
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11
16
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
17
|
};
|
|
13
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
15
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
16
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
17
|
-
};
|
|
18
18
|
var _EunomiaIcon_size;
|
|
19
19
|
import { html, LitElement, nothing } from "lit";
|
|
20
20
|
import { property, state, customElement } from "lit/decorators.js";
|
|
21
21
|
import { unsafeSVG } from "lit/directives/unsafe-svg.js";
|
|
22
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
22
23
|
import { iconStyles } from "./icon.style.js";
|
|
23
24
|
/**
|
|
24
25
|
* Tag name of the icon component.
|
|
@@ -48,6 +49,14 @@ let iconBaseUrl;
|
|
|
48
49
|
* that already tried to load before the base URL was set.
|
|
49
50
|
*/
|
|
50
51
|
const connectedIcons = new Set();
|
|
52
|
+
/**
|
|
53
|
+
* SVG markup already requested, keyed by URL, so every icon sharing a name
|
|
54
|
+
* (the same glyph repeated down a list, or rendered again after a
|
|
55
|
+
* re-mount) shares one request and renders from memory afterwards instead
|
|
56
|
+
* of waiting on its own round trip. A failed request is dropped, so a
|
|
57
|
+
* later attempt (after `setIconBaseUrl`, say) retries it.
|
|
58
|
+
*/
|
|
59
|
+
const svgCache = new Map();
|
|
51
60
|
/**
|
|
52
61
|
* Sets the URL the icon SVGs are served from, laid out as
|
|
53
62
|
* `<baseUrl>/<shape>/<name>.svg` (the `icons` folder shipped next to this
|
|
@@ -78,6 +87,7 @@ export function setIconBaseUrl(url) {
|
|
|
78
87
|
* @cssprop [--icon-background] - Sets a background color behind the icon, for example for a hover highlight. Transparent by default
|
|
79
88
|
* @cssprop [--icon-padding] - Sets the space between the icon and its background box. Zero by default
|
|
80
89
|
* @cssprop [--icon-border-radius] - Sets the corner radius of the background box
|
|
90
|
+
* @cssprop [--icon-transition] - Sets the transition applied to the icon's color, background, and size changes. 0.2s by default
|
|
81
91
|
* @element eun-icon
|
|
82
92
|
*/
|
|
83
93
|
let EunomiaIcon = class EunomiaIcon extends LitElement {
|
|
@@ -92,24 +102,33 @@ let EunomiaIcon = class EunomiaIcon extends LitElement {
|
|
|
92
102
|
/**
|
|
93
103
|
* Sets the size of the icon. Accepts any valid CSS size unit.
|
|
94
104
|
* - If size ends with `%`, it will be converted to `rem`.
|
|
95
|
-
* - If no size is provided,
|
|
105
|
+
* - If no size is provided, falls back to `--icon-size`, then `1rem`.
|
|
106
|
+
*
|
|
107
|
+
* Applied on the internal wrapper (see {@link cssSize}) rather than as an
|
|
108
|
+
* inline style on the host, which an SSR framework would report as a
|
|
109
|
+
* hydration mismatch.
|
|
96
110
|
*/
|
|
97
111
|
set size(size) {
|
|
112
|
+
const previous = __classPrivateFieldGet(this, _EunomiaIcon_size, "f");
|
|
98
113
|
__classPrivateFieldSet(this, _EunomiaIcon_size, size, "f");
|
|
99
|
-
|
|
114
|
+
this.requestUpdate("size", previous);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The CSS length {@link size} resolves to, or `undefined` when unset.
|
|
118
|
+
* @private
|
|
119
|
+
*/
|
|
120
|
+
get cssSize() {
|
|
121
|
+
const size = __classPrivateFieldGet(this, _EunomiaIcon_size, "f");
|
|
100
122
|
if (!size) {
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
else if (/%$/.test(size)) {
|
|
104
|
-
cssSize = `${parseFloat(size) / 100}rem`;
|
|
123
|
+
return undefined;
|
|
105
124
|
}
|
|
106
|
-
|
|
107
|
-
|
|
125
|
+
if (/%$/.test(size)) {
|
|
126
|
+
return `${parseFloat(size) / 100}rem`;
|
|
108
127
|
}
|
|
109
|
-
|
|
110
|
-
|
|
128
|
+
if (/^\d+(\.\d+)?$/.test(size)) {
|
|
129
|
+
return `${size}px`;
|
|
111
130
|
}
|
|
112
|
-
|
|
131
|
+
return size;
|
|
113
132
|
}
|
|
114
133
|
/**
|
|
115
134
|
* Gets the current size value set for the icon.
|
|
@@ -215,11 +234,18 @@ let EunomiaIcon = class EunomiaIcon extends LitElement {
|
|
|
215
234
|
moduleUrl.pathname = `${moduleDir}/icons/${shape}/${name}.svg`;
|
|
216
235
|
url = moduleUrl.href;
|
|
217
236
|
}
|
|
218
|
-
|
|
219
|
-
if (!
|
|
220
|
-
|
|
237
|
+
let svg = svgCache.get(url);
|
|
238
|
+
if (!svg) {
|
|
239
|
+
svg = fetch(url).then((response) => {
|
|
240
|
+
if (!response.ok) {
|
|
241
|
+
throw new Error(`Icon not found: ${url}`);
|
|
242
|
+
}
|
|
243
|
+
return response.text();
|
|
244
|
+
});
|
|
245
|
+
svgCache.set(url, svg);
|
|
246
|
+
svg.catch(() => svgCache.delete(url));
|
|
221
247
|
}
|
|
222
|
-
return
|
|
248
|
+
return svg;
|
|
223
249
|
}
|
|
224
250
|
/**
|
|
225
251
|
* Determines the shape to render : the explicit `shape` property always
|
|
@@ -273,7 +299,11 @@ let EunomiaIcon = class EunomiaIcon extends LitElement {
|
|
|
273
299
|
if (!this.name) {
|
|
274
300
|
return nothing;
|
|
275
301
|
}
|
|
276
|
-
return html `<span
|
|
302
|
+
return html `<span
|
|
303
|
+
part="wrapper"
|
|
304
|
+
aria-hidden="true"
|
|
305
|
+
style=${styleMap({ "--_size": this.cssSize })}
|
|
306
|
+
>
|
|
277
307
|
${this.svgMarkup ? unsafeSVG(this.svgMarkup) : nothing}
|
|
278
308
|
</span>`;
|
|
279
309
|
}
|
|
@@ -296,7 +326,7 @@ __decorate([
|
|
|
296
326
|
state()
|
|
297
327
|
], EunomiaIcon.prototype, "svgMarkup", void 0);
|
|
298
328
|
__decorate([
|
|
299
|
-
property({
|
|
329
|
+
property({ attribute: "size" })
|
|
300
330
|
], EunomiaIcon.prototype, "size", null);
|
|
301
331
|
EunomiaIcon = __decorate([
|
|
302
332
|
customElement(EunomiaIconTagName)
|
|
@@ -8,5 +8,7 @@
|
|
|
8
8
|
* --icon-padding : space between the icon and its background box. Zero by
|
|
9
9
|
* default, so the background hugs the icon exactly unless widened.
|
|
10
10
|
* --icon-border-radius : corner radius of the background box.
|
|
11
|
+
* --icon-transition : transition applied to the icon's color, background,
|
|
12
|
+
* and size changes. 0.2s by default.
|
|
11
13
|
*/
|
|
12
14
|
export declare const iconStyles: import("lit").CSSResult;
|
|
@@ -9,6 +9,8 @@ import { css } from "lit";
|
|
|
9
9
|
* --icon-padding : space between the icon and its background box. Zero by
|
|
10
10
|
* default, so the background hugs the icon exactly unless widened.
|
|
11
11
|
* --icon-border-radius : corner radius of the background box.
|
|
12
|
+
* --icon-transition : transition applied to the icon's color, background,
|
|
13
|
+
* and size changes. 0.2s by default.
|
|
12
14
|
*/
|
|
13
15
|
export const iconStyles = css `
|
|
14
16
|
:host {
|
|
@@ -27,9 +29,10 @@ export const iconStyles = css `
|
|
|
27
29
|
background-color: var(--_background);
|
|
28
30
|
border-radius: var(--icon-border-radius, var(--eun-border-radius-m, 8px));
|
|
29
31
|
text-decoration: none;
|
|
32
|
+
white-space: normal;
|
|
30
33
|
display: inline-block;
|
|
31
34
|
user-select: none;
|
|
32
|
-
transition: 0.2s;
|
|
35
|
+
transition: var(--icon-transition, 0.2s);
|
|
33
36
|
}
|
|
34
37
|
svg {
|
|
35
38
|
width: 100%;
|
|
@@ -5,7 +5,7 @@ import { ValidatorsMixinInterface } from "../../../mixins/validators.mixin.js";
|
|
|
5
5
|
import { FormMixinInterface } from "../../../mixins/form.mixin.js";
|
|
6
6
|
import { FormLabelMixinInterface } from "../../../mixins/form-label.mixin.js";
|
|
7
7
|
import { EditableMixinInterface } from "../../../mixins/editable.mixin.js";
|
|
8
|
-
import {
|
|
8
|
+
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
9
9
|
import { AnchorPositionMixinInterface } from "../../../mixins/anchor-position.mixin.js";
|
|
10
10
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
11
11
|
/**
|
|
@@ -17,7 +17,7 @@ export declare const EunomiaColorPickerTagName = "eun-color-picker";
|
|
|
17
17
|
* interface elements.
|
|
18
18
|
* @internal
|
|
19
19
|
*/
|
|
20
|
-
type EunomiaColorPickerBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & EditableMixinInterface & FormLabelMixinInterface &
|
|
20
|
+
type EunomiaColorPickerBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface;
|
|
21
21
|
declare const EunomiaColorPickerMixinBase: Constructor<EunomiaColorPickerBase>;
|
|
22
22
|
/**
|
|
23
23
|
* A field for picking a color, as a `#rrggbb` hex string. Declare preset
|
|
@@ -54,7 +54,7 @@ declare const EunomiaColorPickerMixinBase: Constructor<EunomiaColorPickerBase>;
|
|
|
54
54
|
* @prop {string} value - The current color, as a `#rrggbb` hex string
|
|
55
55
|
* @prop {string} defaultValue - The default value applied when the field connects, and restored on form reset
|
|
56
56
|
* @attr {string} [default-value] - The default value
|
|
57
|
-
* @prop {'outline' | '
|
|
57
|
+
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
58
58
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
59
59
|
* @prop {string} instructions - Instructions displayed below the label
|
|
60
60
|
* @prop {string} name - The field name
|
|
@@ -15,7 +15,7 @@ import { ValidatorsMixin, } from "../../../mixins/validators.mixin.js";
|
|
|
15
15
|
import { FormMixin } from "../../../mixins/form.mixin.js";
|
|
16
16
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
17
17
|
import { EditableMixin, } from "../../../mixins/editable.mixin.js";
|
|
18
|
-
import {
|
|
18
|
+
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
19
19
|
import { AnchorPositionMixin, } from "../../../mixins/anchor-position.mixin.js";
|
|
20
20
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
21
21
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
@@ -32,7 +32,7 @@ export const EunomiaColorPickerTagName = "eun-color-picker";
|
|
|
32
32
|
* @internal
|
|
33
33
|
*/
|
|
34
34
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
35
|
-
const EunomiaColorPickerMixinBase = AnchorPositionMixin(
|
|
35
|
+
const EunomiaColorPickerMixinBase = AnchorPositionMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(EditableMixin(FormMixin(Base))))));
|
|
36
36
|
/**
|
|
37
37
|
* A field for picking a color, as a `#rrggbb` hex string. Declare preset
|
|
38
38
|
* swatches as light DOM `option` children, exactly like `eun-select` does
|
|
@@ -68,7 +68,7 @@ const EunomiaColorPickerMixinBase = AnchorPositionMixin(FieldVariantMixin(FormLa
|
|
|
68
68
|
* @prop {string} value - The current color, as a `#rrggbb` hex string
|
|
69
69
|
* @prop {string} defaultValue - The default value applied when the field connects, and restored on form reset
|
|
70
70
|
* @attr {string} [default-value] - The default value
|
|
71
|
-
* @prop {'outline' | '
|
|
71
|
+
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
72
72
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
73
73
|
* @prop {string} instructions - Instructions displayed below the label
|
|
74
74
|
* @prop {string} name - The field name
|
|
@@ -649,7 +649,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
649
649
|
<eun-button
|
|
650
650
|
class="confirm"
|
|
651
651
|
size="s"
|
|
652
|
-
|
|
652
|
+
color="primary"
|
|
653
653
|
appearance="default"
|
|
654
654
|
rounded
|
|
655
655
|
type="button"
|
|
@@ -4,7 +4,7 @@ import { ReadonlyMixinInterface } from "../../../mixins/readonly.mixin.js";
|
|
|
4
4
|
import { ValidatorsMixinInterface, Validity } from "../../../mixins/validators.mixin.js";
|
|
5
5
|
import { FormMixinInterface } from "../../../mixins/form.mixin.js";
|
|
6
6
|
import { FormLabelMixinInterface } from "../../../mixins/form-label.mixin.js";
|
|
7
|
-
import {
|
|
7
|
+
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
8
8
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
9
9
|
/**
|
|
10
10
|
* Tag name of the counter component.
|
|
@@ -14,13 +14,13 @@ export declare const EunomiaCounterTagName = "eun-counter";
|
|
|
14
14
|
* Type of the counter base used to declare every necessary Mixin interface elements.
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
|
-
type EunomiaCounterBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<number> & FormMixinInterface<number> & FormLabelMixinInterface &
|
|
17
|
+
type EunomiaCounterBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<number> & FormMixinInterface<number> & FormLabelMixinInterface & FieldAppearanceMixinInterface;
|
|
18
18
|
declare const EunomiaCounterMixinBase: Constructor<EunomiaCounterBase>;
|
|
19
19
|
/**
|
|
20
20
|
* A numeric field with increment and decrement buttons, built on a native
|
|
21
21
|
* number input.
|
|
22
22
|
*
|
|
23
|
-
* @prop {'outline' | '
|
|
23
|
+
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
24
24
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
25
25
|
* @prop {string} instructions - Instructions displayed below the label
|
|
26
26
|
* @prop {string} name - The field name
|
|
@@ -12,7 +12,7 @@ import { ReadonlyMixin, } from "../../../mixins/readonly.mixin.js";
|
|
|
12
12
|
import { ValidatorsMixin, } from "../../../mixins/validators.mixin.js";
|
|
13
13
|
import { FormMixin } from "../../../mixins/form.mixin.js";
|
|
14
14
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
15
|
-
import {
|
|
15
|
+
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
16
16
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
17
17
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
18
18
|
import { counterStyles } from "./counter.styles.js";
|
|
@@ -26,12 +26,12 @@ export const EunomiaCounterTagName = "eun-counter";
|
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
28
28
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
29
|
-
const EunomiaCounterMixinBase =
|
|
29
|
+
const EunomiaCounterMixinBase = FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))));
|
|
30
30
|
/**
|
|
31
31
|
* A numeric field with increment and decrement buttons, built on a native
|
|
32
32
|
* number input.
|
|
33
33
|
*
|
|
34
|
-
* @prop {'outline' | '
|
|
34
|
+
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
35
35
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
36
36
|
* @prop {string} instructions - Instructions displayed below the label
|
|
37
37
|
* @prop {string} name - The field name
|
|
@@ -180,22 +180,22 @@ const base = css `
|
|
|
180
180
|
cursor: default;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
:host([
|
|
183
|
+
:host([appearance="flat"]) {
|
|
184
184
|
--_background: var(--counter-background, var(--eun-content-hover, #edeff0));
|
|
185
185
|
}
|
|
186
|
-
:host([
|
|
186
|
+
:host([appearance="flat"]) #field-wrapper:not(:focus-within) {
|
|
187
187
|
border-color: transparent;
|
|
188
188
|
}
|
|
189
|
-
:host([
|
|
189
|
+
:host([appearance="flat"]) #field-wrapper:has(#field[aria-invalid="true"]) {
|
|
190
190
|
box-shadow: inset 0 0 0 var(--eun-border-width-m, 1.5px) var(--_errorColor);
|
|
191
191
|
}
|
|
192
|
-
:host([
|
|
192
|
+
:host([appearance="underline"]) #field-wrapper {
|
|
193
193
|
border: none;
|
|
194
194
|
outline: none;
|
|
195
195
|
border-radius: 0;
|
|
196
196
|
border-bottom: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
|
|
197
197
|
}
|
|
198
|
-
:host([
|
|
198
|
+
:host([appearance="underline"]) #field-wrapper:focus-within {
|
|
199
199
|
outline: none;
|
|
200
200
|
}
|
|
201
201
|
`;
|
|
@@ -4,7 +4,7 @@ import { ReadonlyMixinInterface } from "../../../mixins/readonly.mixin.js";
|
|
|
4
4
|
import { ValidatorsMixinInterface, Validity } from "../../../mixins/validators.mixin.js";
|
|
5
5
|
import { FormMixinInterface } from "../../../mixins/form.mixin.js";
|
|
6
6
|
import { FormLabelMixinInterface } from "../../../mixins/form-label.mixin.js";
|
|
7
|
-
import {
|
|
7
|
+
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
8
8
|
import { AnchorPositionMixinInterface } from "../../../mixins/anchor-position.mixin.js";
|
|
9
9
|
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
10
10
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
@@ -21,7 +21,7 @@ export declare const EunomiaDatePickerTagName = "eun-date-picker";
|
|
|
21
21
|
* interface element.
|
|
22
22
|
* @internal
|
|
23
23
|
*/
|
|
24
|
-
type EunomiaDatePickerBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<Date | null> & FormMixinInterface<Date | null> & FormLabelMixinInterface &
|
|
24
|
+
type EunomiaDatePickerBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<Date | null> & FormMixinInterface<Date | null> & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
25
25
|
declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
26
26
|
/**
|
|
27
27
|
* A date field entered across segmented numeric day, month, and year
|
|
@@ -44,7 +44,7 @@ declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
|
44
44
|
* normalized to January first of the selected year. The range mode
|
|
45
45
|
* composes with all three.
|
|
46
46
|
*
|
|
47
|
-
* @prop {'outline' | '
|
|
47
|
+
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
48
48
|
* @prop {'single' | 'range'} [mode='single'] - Whether a single value or a start and end range is picked
|
|
49
49
|
* @prop {'day' | 'month' | 'year'} [granularity='day'] - How precise the picked value is. Controls both the number of segments rendered and which calendar surface opens
|
|
50
50
|
* @prop {Date | null} value - The picked value, in single mode. Normalized to the first of the month or January first of the year outside day granularity
|
|
@@ -13,7 +13,7 @@ import { ReadonlyMixin, } from "../../../mixins/readonly.mixin.js";
|
|
|
13
13
|
import { ValidatorsMixin, } from "../../../mixins/validators.mixin.js";
|
|
14
14
|
import { FormMixin } from "../../../mixins/form.mixin.js";
|
|
15
15
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
16
|
-
import {
|
|
16
|
+
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
17
17
|
import { AnchorPositionMixin, } from "../../../mixins/anchor-position.mixin.js";
|
|
18
18
|
import { LocalizableMixin, } from "../../../mixins/localizable.mixin.js";
|
|
19
19
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
@@ -55,7 +55,7 @@ const SEGMENT_SPIN_BOUNDS = {
|
|
|
55
55
|
* @internal
|
|
56
56
|
*/
|
|
57
57
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
58
|
-
const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(
|
|
58
|
+
const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))))));
|
|
59
59
|
/**
|
|
60
60
|
* A date field entered across segmented numeric day, month, and year
|
|
61
61
|
* inputs, following the same accessible pattern used by several
|
|
@@ -77,7 +77,7 @@ const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldVar
|
|
|
77
77
|
* normalized to January first of the selected year. The range mode
|
|
78
78
|
* composes with all three.
|
|
79
79
|
*
|
|
80
|
-
* @prop {'outline' | '
|
|
80
|
+
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
81
81
|
* @prop {'single' | 'range'} [mode='single'] - Whether a single value or a start and end range is picked
|
|
82
82
|
* @prop {'day' | 'month' | 'year'} [granularity='day'] - How precise the picked value is. Controls both the number of segments rendered and which calendar surface opens
|
|
83
83
|
* @prop {Date | null} value - The picked value, in single mode. Normalized to the first of the month or January first of the year outside day granularity
|
|
@@ -68,22 +68,22 @@ const datePicker = css `
|
|
|
68
68
|
:host([aria-invalid="true"]) #field-wrapper:focus-within {
|
|
69
69
|
outline-color: var(--_errorColor);
|
|
70
70
|
}
|
|
71
|
-
:host([
|
|
71
|
+
:host([appearance="flat"]) {
|
|
72
72
|
--_background: var(--field-background, var(--eun-content-hover, #edeff0));
|
|
73
73
|
}
|
|
74
|
-
:host([
|
|
74
|
+
:host([appearance="flat"]) #field-wrapper {
|
|
75
75
|
border-color: transparent;
|
|
76
76
|
}
|
|
77
|
-
:host([
|
|
77
|
+
:host([appearance="flat"][aria-invalid="true"]) #field-wrapper {
|
|
78
78
|
box-shadow: inset 0 0 0 var(--eun-border-width-m, 1.5px) var(--_errorColor);
|
|
79
79
|
}
|
|
80
|
-
:host([
|
|
80
|
+
:host([appearance="underline"]) #field-wrapper {
|
|
81
81
|
border: none;
|
|
82
82
|
outline: none;
|
|
83
83
|
border-bottom: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
|
|
84
84
|
border-radius: 0;
|
|
85
85
|
}
|
|
86
|
-
:host([
|
|
86
|
+
:host([appearance="underline"]) #field-wrapper:focus-within {
|
|
87
87
|
outline: none;
|
|
88
88
|
}
|
|
89
89
|
.segment-group {
|
|
@@ -5,7 +5,7 @@ import { ValidatorsMixinInterface, Validity } from "../../../mixins/validators.m
|
|
|
5
5
|
import { FormMixinInterface } from "../../../mixins/form.mixin.js";
|
|
6
6
|
import { FormLabelMixinInterface } from "../../../mixins/form-label.mixin.js";
|
|
7
7
|
import { EditableMixinInterface } from "../../../mixins/editable.mixin.js";
|
|
8
|
-
import {
|
|
8
|
+
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
9
9
|
import { EunomiaIconName } from "../../content/icon/icon.type.js";
|
|
10
10
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
11
11
|
/**
|
|
@@ -20,14 +20,14 @@ export type EunomiaInputType = "text" | "email" | "number" | "tel" | "url" | "se
|
|
|
20
20
|
* Type of the input base used to declare every necessary Mixin interface elements.
|
|
21
21
|
* @internal
|
|
22
22
|
*/
|
|
23
|
-
type EunomiaInputBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & EditableMixinInterface & FormLabelMixinInterface &
|
|
23
|
+
type EunomiaInputBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface;
|
|
24
24
|
declare const EunomiaInputMixinBase: Constructor<EunomiaInputBase>;
|
|
25
25
|
/**
|
|
26
26
|
* A single-line text field, supporting several native input types.
|
|
27
27
|
*
|
|
28
28
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty
|
|
29
29
|
* @prop {'text' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'password'} [type='text'] - The native input type to apply
|
|
30
|
-
* @prop {'outline' | '
|
|
30
|
+
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
31
31
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
32
32
|
* @prop {string} instructions - Instructions displayed below the label
|
|
33
33
|
* @prop {string} placeholder - The placeholder shown when the field is empty
|
|
@@ -15,7 +15,7 @@ import { ValidatorsMixin, } from "../../../mixins/validators.mixin.js";
|
|
|
15
15
|
import { FormMixin } from "../../../mixins/form.mixin.js";
|
|
16
16
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
17
17
|
import { EditableMixin, } from "../../../mixins/editable.mixin.js";
|
|
18
|
-
import {
|
|
18
|
+
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
19
19
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
20
20
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
21
21
|
import { inputStyles } from "./input.styles.js";
|
|
@@ -29,13 +29,13 @@ export const EunomiaInputTagName = "eun-input";
|
|
|
29
29
|
* @internal
|
|
30
30
|
*/
|
|
31
31
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
32
|
-
const EunomiaInputMixinBase =
|
|
32
|
+
const EunomiaInputMixinBase = FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(EditableMixin(FormMixin(Base)))));
|
|
33
33
|
/**
|
|
34
34
|
* A single-line text field, supporting several native input types.
|
|
35
35
|
*
|
|
36
36
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty
|
|
37
37
|
* @prop {'text' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'password'} [type='text'] - The native input type to apply
|
|
38
|
-
* @prop {'outline' | '
|
|
38
|
+
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
39
39
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
40
40
|
* @prop {string} instructions - Instructions displayed below the label
|
|
41
41
|
* @prop {string} placeholder - The placeholder shown when the field is empty
|
|
@@ -421,7 +421,7 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
421
421
|
<eun-button
|
|
422
422
|
class="confirm"
|
|
423
423
|
size="s"
|
|
424
|
-
|
|
424
|
+
color="primary"
|
|
425
425
|
appearance="default"
|
|
426
426
|
rounded
|
|
427
427
|
type="button"
|
|
@@ -4,7 +4,7 @@ import { ReadonlyMixinInterface } from "../../../mixins/readonly.mixin.js";
|
|
|
4
4
|
import { ValidatorsMixinInterface } from "../../../mixins/validators.mixin.js";
|
|
5
5
|
import { FormMixinInterface } from "../../../mixins/form.mixin.js";
|
|
6
6
|
import { FormLabelMixinInterface } from "../../../mixins/form-label.mixin.js";
|
|
7
|
-
import {
|
|
7
|
+
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
8
8
|
import { AnchorPositionMixinInterface } from "../../../mixins/anchor-position.mixin.js";
|
|
9
9
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
10
10
|
/**
|
|
@@ -16,7 +16,7 @@ export declare const EunomiaInputPhoneTagName = "eun-input-phone";
|
|
|
16
16
|
* interface element.
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
|
-
type EunomiaInputPhoneBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & FormLabelMixinInterface &
|
|
19
|
+
type EunomiaInputPhoneBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface;
|
|
20
20
|
declare const EunomiaInputPhoneMixinBase: Constructor<EunomiaInputPhoneBase>;
|
|
21
21
|
/**
|
|
22
22
|
* A phone number field rendered in two adjacent parts: a compact country
|
|
@@ -38,7 +38,7 @@ declare const EunomiaInputPhoneMixinBase: Constructor<EunomiaInputPhoneBase>;
|
|
|
38
38
|
* digits only.
|
|
39
39
|
*
|
|
40
40
|
* @slot [default] - An optional list of option elements restricting which countries appear in the dropdown, such as an option with value FR for France. When omitted, every built-in country is available
|
|
41
|
-
* @prop {'outline' | '
|
|
41
|
+
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
42
42
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
43
43
|
* @prop {string} instructions - Instructions displayed below the label
|
|
44
44
|
* @prop {string} name - The field name
|
|
@@ -13,7 +13,7 @@ import { ReadonlyMixin, } from "../../../mixins/readonly.mixin.js";
|
|
|
13
13
|
import { ValidatorsMixin, } from "../../../mixins/validators.mixin.js";
|
|
14
14
|
import { FormMixin } from "../../../mixins/form.mixin.js";
|
|
15
15
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
16
|
-
import {
|
|
16
|
+
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
17
17
|
import { AnchorPositionMixin, } from "../../../mixins/anchor-position.mixin.js";
|
|
18
18
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
19
19
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
@@ -62,7 +62,7 @@ const TRIGGER_POINTER_DOWN_WINDOW_MS = 100;
|
|
|
62
62
|
* @internal
|
|
63
63
|
*/
|
|
64
64
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
65
|
-
const EunomiaInputPhoneMixinBase = AnchorPositionMixin(
|
|
65
|
+
const EunomiaInputPhoneMixinBase = AnchorPositionMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base)))));
|
|
66
66
|
/**
|
|
67
67
|
* A phone number field rendered in two adjacent parts: a compact country
|
|
68
68
|
* selector, showing only the flag, on the leading side, and the phone
|
|
@@ -83,7 +83,7 @@ const EunomiaInputPhoneMixinBase = AnchorPositionMixin(FieldVariantMixin(FormLab
|
|
|
83
83
|
* digits only.
|
|
84
84
|
*
|
|
85
85
|
* @slot [default] - An optional list of option elements restricting which countries appear in the dropdown, such as an option with value FR for France. When omitted, every built-in country is available
|
|
86
|
-
* @prop {'outline' | '
|
|
86
|
+
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
87
87
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
88
88
|
* @prop {string} instructions - Instructions displayed below the label
|
|
89
89
|
* @prop {string} name - The field name
|
|
@@ -128,41 +128,41 @@ const inputPhone = css `
|
|
|
128
128
|
#field-wrapper:focus-within {
|
|
129
129
|
outline-color: var(--_errorColor);
|
|
130
130
|
}
|
|
131
|
-
:host([
|
|
131
|
+
:host([appearance="flat"]) {
|
|
132
132
|
--_background: var(--field-background, var(--eun-content-hover, #edeff0));
|
|
133
133
|
}
|
|
134
|
-
:host([
|
|
135
|
-
:host([
|
|
134
|
+
:host([appearance="flat"]:not(:hover)) #country-trigger:not(:focus-visible),
|
|
135
|
+
:host([appearance="flat"]:not(:hover)) #field-wrapper:not(:focus-within) {
|
|
136
136
|
border-color: transparent;
|
|
137
137
|
}
|
|
138
|
-
:host([
|
|
138
|
+
:host([appearance="flat"]) #country-trigger {
|
|
139
139
|
border-inline-end: var(--eun-border-width-s, 1px) solid
|
|
140
140
|
var(--eun-border-color, #dee0e7);
|
|
141
141
|
}
|
|
142
|
-
:host([
|
|
142
|
+
:host([appearance="flat"])
|
|
143
143
|
#phone-group:has(#phone-field[aria-invalid="true"])
|
|
144
144
|
#country-trigger,
|
|
145
|
-
:host([
|
|
145
|
+
:host([appearance="flat"])
|
|
146
146
|
#phone-group:has(#phone-field[aria-invalid="true"])
|
|
147
147
|
#field-wrapper {
|
|
148
148
|
border-color: var(--_errorColor);
|
|
149
149
|
}
|
|
150
|
-
:host([
|
|
151
|
-
:host([
|
|
150
|
+
:host([appearance="underline"]) #country-trigger,
|
|
151
|
+
:host([appearance="underline"]) #field-wrapper {
|
|
152
152
|
border: none;
|
|
153
153
|
outline: none;
|
|
154
154
|
border-bottom: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
|
|
155
155
|
border-radius: 0;
|
|
156
156
|
}
|
|
157
|
-
:host([
|
|
157
|
+
:host([appearance="underline"]) #country-trigger {
|
|
158
158
|
border-inline-end: var(--eun-border-width-s, 1px) solid
|
|
159
159
|
var(--eun-border-color, #dee0e7);
|
|
160
160
|
}
|
|
161
|
-
:host([
|
|
161
|
+
:host([appearance="underline"]) #field-wrapper {
|
|
162
162
|
margin-inline-start: 0;
|
|
163
163
|
}
|
|
164
|
-
:host([
|
|
165
|
-
:host([
|
|
164
|
+
:host([appearance="underline"]) #country-trigger:focus-visible,
|
|
165
|
+
:host([appearance="underline"]) #field-wrapper:focus-within {
|
|
166
166
|
outline: none;
|
|
167
167
|
}
|
|
168
168
|
.dial-code-prefix {
|