@eunomia/elements 1.0.0-beta.7 → 1.0.0-beta.8
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-3PNGQEG4.js → chunk-32L2QYWQ.js} +2 -2
- package/dist/cdn/components/chunks/{chunk-Z3OFIE7S.js → chunk-3UUZM7X2.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-BVASCT2V.js → chunk-55PUDL7D.js} +13 -13
- package/dist/cdn/components/chunks/chunk-5LA5DQMP.js +1 -0
- package/dist/cdn/components/chunks/chunk-5LXGJVJR.js +1 -0
- package/dist/cdn/components/chunks/chunk-6TIEBY34.js +1 -0
- package/dist/cdn/components/chunks/{chunk-LVKMAHMU.js → chunk-AH2SKZ7T.js} +4 -1
- package/dist/cdn/components/chunks/chunk-JAGZL7JH.js +1 -0
- package/dist/cdn/components/chunks/{chunk-DGI7TKCU.js → chunk-LD35BFNK.js} +5 -9
- package/dist/cdn/components/chunks/chunk-P6LGU3FT.js +1 -0
- package/dist/cdn/components/chunks/{chunk-UYZR4JXZ.js → chunk-QSZO4GIH.js} +45 -9
- package/dist/cdn/components/chunks/{chunk-PXF554MD.js → chunk-QYB6Z6FG.js} +5 -5
- package/dist/cdn/components/chunks/{chunk-RIFF2D2F.js → chunk-RGC3I6MK.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-N6ZW5CDN.js → chunk-TCSB2MLU.js} +1 -1
- package/dist/cdn/components/chunks/chunk-WIUERJII.js +1 -0
- package/dist/cdn/components/eun-animate.js +4 -4
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-carousel.js +10 -9
- package/dist/cdn/components/eun-chip.js +17 -11
- package/dist/cdn/components/eun-collapse.js +1 -1
- package/dist/cdn/components/eun-color-picker.js +18 -5
- package/dist/cdn/components/eun-counter.js +10 -8
- package/dist/cdn/components/eun-date-picker.js +46 -43
- package/dist/cdn/components/eun-drawer.js +19 -20
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-dropdown-item.js +3 -3
- package/dist/cdn/components/eun-fab.js +1 -1
- package/dist/cdn/components/eun-image-carousel.js +4 -4
- package/dist/cdn/components/eun-input-phone.js +11 -8
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +59 -13
- package/dist/cdn/components/eun-modal.js +23 -13
- package/dist/cdn/components/eun-scheduler-event-editor.js +1 -1
- package/dist/cdn/components/eun-search.js +34 -28
- package/dist/cdn/components/eun-select.js +3 -3
- package/dist/cdn/components/eun-sidebar.js +66 -21
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-stepper.js +16 -16
- package/dist/cdn/components/eun-tab-panel.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +2 -2
- package/dist/cdn/components/eun-textarea.js +16 -13
- package/dist/cdn/components/eun-time-picker.js +25 -23
- package/dist/cdn/components/eun-toast.js +8 -8
- package/dist/cdn/components/eun-toggle-group.js +71 -35
- package/dist/cdn/components/eun-toggle-item.js +8 -8
- package/dist/cdn/components/eun-toolbar.js +20 -20
- package/dist/cdn/components/eun-tooltip.js +6 -6
- package/dist/cdn/styles/eunomia-themes.css +1 -1
- package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
- package/dist/components/action/button/button.d.ts +2 -2
- package/dist/components/action/button/button.js +3 -7
- package/dist/components/action/button/button.styles.js +3 -3
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -6
- package/dist/components/action/dropdown-button/dropdown-button.js +6 -8
- package/dist/components/action/dropdown-button/dropdown-item.d.ts +10 -2
- package/dist/components/action/dropdown-button/dropdown-item.js +24 -9
- package/dist/components/action/link/link.d.ts +10 -1
- package/dist/components/action/link/link.js +13 -1
- package/dist/components/action/link/link.styles.js +50 -3
- package/dist/components/action/toggle/toggle-group.d.ts +12 -2
- package/dist/components/action/toggle/toggle-group.js +17 -2
- package/dist/components/action/toggle/toggle-group.styles.js +54 -18
- package/dist/components/action/toggle/toggle-item.js +1 -3
- package/dist/components/action/toggle/toggle-item.styles.js +7 -7
- package/dist/components/alert/drawer/drawer.d.ts +25 -0
- package/dist/components/alert/drawer/drawer.js +42 -3
- package/dist/components/alert/drawer/drawer.styles.js +6 -6
- package/dist/components/alert/modal/modal.d.ts +25 -0
- package/dist/components/alert/modal/modal.js +42 -3
- package/dist/components/alert/modal/modal.styles.js +17 -6
- package/dist/components/alert/toast/toast.js +3 -2
- package/dist/components/alert/toast/toast.styles.js +3 -3
- package/dist/components/content/chip/chip.js +3 -2
- package/dist/components/content/chip/chip.styles.js +9 -3
- package/dist/components/content/image-carousel/image-carousel.js +5 -4
- package/dist/components/content/tooltip/tooltip.d.ts +16 -9
- package/dist/components/content/tooltip/tooltip.js +28 -12
- package/dist/components/content/tooltip/tooltip.styles.js +1 -1
- package/dist/components/form/color-picker/color-picker.d.ts +7 -1
- package/dist/components/form/color-picker/color-picker.js +8 -2
- package/dist/components/form/color-picker/color-picker.styles.js +13 -0
- package/dist/components/form/counter/counter.d.ts +3 -1
- package/dist/components/form/counter/counter.js +3 -1
- package/dist/components/form/counter/counter.styles.js +6 -4
- package/dist/components/form/date-picker/date-picker.d.ts +6 -1
- package/dist/components/form/date-picker/date-picker.js +7 -2
- package/dist/components/form/date-picker/date-picker.styles.js +9 -6
- package/dist/components/form/input/input.d.ts +6 -1
- package/dist/components/form/input/input.js +7 -2
- package/dist/components/form/input-phone/input-phone.d.ts +7 -1
- package/dist/components/form/input-phone/input-phone.js +7 -1
- package/dist/components/form/input-phone/input-phone.styles.js +6 -3
- package/dist/components/form/search/search.d.ts +64 -10
- package/dist/components/form/search/search.js +112 -31
- package/dist/components/form/search/search.styles.js +2 -0
- package/dist/components/form/select/select.d.ts +7 -1
- package/dist/components/form/select/select.js +7 -1
- package/dist/components/form/shared-styles/field.styles.js +45 -8
- package/dist/components/form/shared-styles/listbox.styles.js +5 -1
- package/dist/components/form/textarea/textarea.d.ts +1 -0
- package/dist/components/form/textarea/textarea.js +2 -1
- package/dist/components/form/textarea/textarea.styles.js +3 -0
- package/dist/components/form/time-picker/time-picker.d.ts +6 -1
- package/dist/components/form/time-picker/time-picker.js +7 -2
- package/dist/components/form/time-picker/time-picker.styles.js +7 -5
- package/dist/components/layout/animate/animate.js +2 -1
- package/dist/components/navigation/carousel/carousel.d.ts +1 -2
- package/dist/components/navigation/carousel/carousel.js +14 -6
- package/dist/components/navigation/carousel/carousel.styles.js +5 -4
- package/dist/components/navigation/sidebar/sidebar.d.ts +98 -52
- package/dist/components/navigation/sidebar/sidebar.js +140 -85
- package/dist/components/navigation/sidebar/sidebar.styles.d.ts +1 -1
- package/dist/components/navigation/sidebar/sidebar.styles.js +69 -21
- package/dist/components/navigation/stepper/stepper.d.ts +1 -3
- package/dist/components/navigation/stepper/stepper.js +3 -21
- package/dist/components/navigation/toolbar/toolbar.d.ts +10 -0
- package/dist/components/navigation/toolbar/toolbar.js +8 -1
- package/dist/components/navigation/toolbar/toolbar.styles.js +18 -17
- package/dist/events/select.event.d.ts +3 -2
- package/dist/events/select.event.js +2 -1
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +1 -1
- package/dist/features/table/table/table.js +1 -1
- package/dist/features/table/table-action-bar/table-action-bar.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/mixins/button.mixin.d.ts +1 -1
- package/dist/mixins/button.mixin.js +6 -4
- package/dist/mixins/dialog-surface.mixin.d.ts +8 -0
- package/dist/mixins/field-size.mixin.d.ts +19 -0
- package/dist/mixins/field-size.mixin.js +33 -0
- package/dist/mixins/rounded.mixin.d.ts +18 -0
- package/dist/mixins/rounded.mixin.js +32 -0
- package/dist/ssr/button-ssr.css +5 -5
- package/dist/ssr/carousel-ssr.css +9 -0
- package/dist/ssr/chip-ssr.css +8 -0
- package/dist/ssr/collapse-ssr.css +29 -0
- package/dist/ssr/field-ssr.css +43 -4
- package/dist/ssr/image-carousel-ssr.css +10 -0
- package/dist/ssr/links-ssr.css +38 -1
- package/dist/ssr/sidebar-ssr.css +95 -4
- package/dist/ssr/toggle-group-ssr.css +64 -13
- package/dist/ssr/toolbar-ssr.css +50 -0
- package/dist/types/variant.type.d.ts +4 -1
- package/dist/utils/boolean.utils.d.ts +14 -0
- package/dist/utils/boolean.utils.js +20 -0
- package/dist/utils/dropdown-menu.utils.d.ts +1 -1
- package/dist/utils/focusable-elements.utils.d.ts +12 -0
- package/dist/utils/focusable-elements.utils.js +26 -0
- package/dist/utils/input-modality.utils.d.ts +13 -0
- package/dist/utils/input-modality.utils.js +34 -0
- package/dist/utils/theme-generator.utils.d.ts +8 -2
- package/dist/utils/theme-generator.utils.js +30 -9
- package/package.json +1 -1
- package/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/components/chunks/chunk-6VK6SHCG.js +0 -1
- package/dist/cdn/components/chunks/chunk-UDOZRIJZ.js +0 -1
|
@@ -12,6 +12,7 @@ import { classMap } from "lit/directives/class-map.js";
|
|
|
12
12
|
import { AnchorPositionMixin, } from "../../../mixins/anchor-position.mixin.js";
|
|
13
13
|
import { clampToViewport } from "../../../utils/dropdown-menu.utils.js";
|
|
14
14
|
import { isWebKit } from "../../../utils/browser.utils.js";
|
|
15
|
+
import { resolveFocusTarget } from "../../../utils/focusable-elements.utils.js";
|
|
15
16
|
import { formatRichText } from "../../../utils/rich-text.utils.js";
|
|
16
17
|
import { tooltipHostStyles, tooltipPanelStyles, tooltipAnchorPositioningStyles, } from "./tooltip.styles.js";
|
|
17
18
|
import { resolveDurationMs, resolveEasing, } from "../../../utils/motion.utils.js";
|
|
@@ -874,28 +875,43 @@ let EunomiaTooltip = EunomiaTooltip_1 = class EunomiaTooltip extends EunomiaTool
|
|
|
874
875
|
return this.readPixelVar("--tooltip-gap", 8);
|
|
875
876
|
}
|
|
876
877
|
/**
|
|
877
|
-
* Links the
|
|
878
|
-
*
|
|
879
|
-
* Idempotent — only ever applied once per anchor.
|
|
878
|
+
* Links the anchor's focusable element to the panel, so a screen reader
|
|
879
|
+
* announces the tooltip's content as a description of whatever actually
|
|
880
|
+
* holds focus. Idempotent — only ever applied once per anchor.
|
|
880
881
|
*
|
|
881
|
-
*
|
|
882
|
-
*
|
|
883
|
-
*
|
|
884
|
-
*
|
|
885
|
-
*
|
|
886
|
-
*
|
|
882
|
+
* The described element is resolved by `resolveFocusTarget` rather than
|
|
883
|
+
* being the slotted anchor itself : when the anchor is a component
|
|
884
|
+
* (`<eun-link slot="anchor"><a href>…</a></eun-link>`, an `eun-button`
|
|
885
|
+
* with `href`), focus lands on the slotted `<a>` or on a control inside
|
|
886
|
+
* the component's shadow root, and a description set on the host is
|
|
887
|
+
* never announced.
|
|
888
|
+
*
|
|
889
|
+
* When that element shares the panel's tree scope (the anchor itself, or
|
|
890
|
+
* its light DOM descendants, since the panel is portaled into the
|
|
891
|
+
* anchor's own scope, see {@link ensurePortal}), a plain `id`-string
|
|
892
|
+
* `aria-describedby` is enough. A control inside the anchor's shadow root
|
|
893
|
+
* can't reference an id outside it, so it gets an element reference
|
|
894
|
+
* through `ariaDescribedByElements` instead.
|
|
887
895
|
* @private
|
|
888
896
|
*/
|
|
889
897
|
applyAriaDescribedBy() {
|
|
890
|
-
if (this.ariaDescribedByApplied || !this.anchorEl) {
|
|
898
|
+
if (this.ariaDescribedByApplied || !this.anchorEl || !this.panelEl) {
|
|
891
899
|
return;
|
|
892
900
|
}
|
|
893
901
|
this.ariaDescribedByApplied = true;
|
|
894
|
-
const
|
|
902
|
+
const target = resolveFocusTarget(this.anchorEl);
|
|
903
|
+
if (target.getRootNode() !== this.portalRoot) {
|
|
904
|
+
const existing = target.ariaDescribedByElements ?? [];
|
|
905
|
+
if (!existing.includes(this.panelEl)) {
|
|
906
|
+
target.ariaDescribedByElements = [...existing, this.panelEl];
|
|
907
|
+
}
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
const existing = target.getAttribute("aria-describedby");
|
|
895
911
|
const ids = existing ? existing.split(/\s+/) : [];
|
|
896
912
|
if (!ids.includes(this.panelId)) {
|
|
897
913
|
ids.push(this.panelId);
|
|
898
|
-
|
|
914
|
+
target.setAttribute("aria-describedby", ids.join(" "));
|
|
899
915
|
}
|
|
900
916
|
}
|
|
901
917
|
/**
|
|
@@ -172,7 +172,7 @@ const panel = css `
|
|
|
172
172
|
display: grid;
|
|
173
173
|
row-gap: var(--tooltip-row-gap, var(--eun-space-xs, 4px));
|
|
174
174
|
width: max-content;
|
|
175
|
-
min-width: var(--tooltip-min-width,
|
|
175
|
+
min-width: var(--tooltip-min-width, 0px);
|
|
176
176
|
max-width: var(--tooltip-max-width, 280px);
|
|
177
177
|
padding: var(
|
|
178
178
|
--tooltip-padding,
|
|
@@ -6,6 +6,8 @@ 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
8
|
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
9
|
+
import { RoundedMixinInterface } from "../../../mixins/rounded.mixin.js";
|
|
10
|
+
import { FieldSizeMixinInterface } from "../../../mixins/field-size.mixin.js";
|
|
9
11
|
import { AnchorPositionMixinInterface } from "../../../mixins/anchor-position.mixin.js";
|
|
10
12
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
11
13
|
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
@@ -18,7 +20,7 @@ export declare const EunomiaColorPickerTagName = "eun-color-picker";
|
|
|
18
20
|
* interface elements.
|
|
19
21
|
* @internal
|
|
20
22
|
*/
|
|
21
|
-
type EunomiaColorPickerBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
23
|
+
type EunomiaColorPickerBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface & RoundedMixinInterface & FieldSizeMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
22
24
|
declare const EunomiaColorPickerMixinBase: Constructor<EunomiaColorPickerBase>;
|
|
23
25
|
/**
|
|
24
26
|
* A field for picking a color, as a `#rrggbb` hex string. Declare preset
|
|
@@ -56,6 +58,8 @@ declare const EunomiaColorPickerMixinBase: Constructor<EunomiaColorPickerBase>;
|
|
|
56
58
|
* @prop {string} defaultValue - The default value applied when the field connects, and restored on form reset
|
|
57
59
|
* @attr {string} [default-value] - The default value
|
|
58
60
|
* @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
|
|
61
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
62
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
59
63
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
60
64
|
* @prop {string} instructions - Instructions displayed below the label
|
|
61
65
|
* @prop {string} name - The field name
|
|
@@ -109,11 +113,13 @@ declare const EunomiaColorPickerMixinBase: Constructor<EunomiaColorPickerBase>;
|
|
|
109
113
|
* @cssprop [--field-edit-confirm-color] - Sets the color of the confirm button in readonly-available edit mode
|
|
110
114
|
* @cssprop [--field-edit-cancel-color] - Sets the color of the cancel button in readonly-available edit mode
|
|
111
115
|
* @cssprop [--field-listbox-max-height=260px] - Sets the maximum height of the dropdown panel, past which it scrolls
|
|
116
|
+
* @cssprop [--field-listbox-border-radius] - Sets the corner radius of the dropdown panel, independent of the field's own radius
|
|
112
117
|
* @cssprop [--field-listbox-transition-duration=200ms] - Sets the duration of the dropdown panel's open and close animation
|
|
113
118
|
* @cssprop [--color-picker-swatch-size=20px] - Sets the diameter of every swatch
|
|
114
119
|
* @cssprop [--eun-viewport-inset-top] - Reserves space, such as a page's sticky header height, that the dropdown panel keeps clear of at the top of the viewport
|
|
115
120
|
* @cssprop [--eun-viewport-inset-bottom] - The same as eun-viewport-inset-top, reserved at the bottom of the viewport
|
|
116
121
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
122
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
117
123
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
118
124
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
119
125
|
* @element eun-color-picker
|
|
@@ -16,6 +16,8 @@ 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
18
|
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
19
|
+
import { RoundedMixin, } from "../../../mixins/rounded.mixin.js";
|
|
20
|
+
import { FieldSizeMixin, } from "../../../mixins/field-size.mixin.js";
|
|
19
21
|
import { AnchorPositionMixin, } from "../../../mixins/anchor-position.mixin.js";
|
|
20
22
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
21
23
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
@@ -34,7 +36,7 @@ export const EunomiaColorPickerTagName = "eun-color-picker";
|
|
|
34
36
|
* @internal
|
|
35
37
|
*/
|
|
36
38
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
37
|
-
const EunomiaColorPickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(EditableMixin(FormMixin(Base)))))));
|
|
39
|
+
const EunomiaColorPickerMixinBase = LocalizableMixin(AnchorPositionMixin(RoundedMixin(FieldSizeMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(EditableMixin(FormMixin(Base)))))))));
|
|
38
40
|
/**
|
|
39
41
|
* A field for picking a color, as a `#rrggbb` hex string. Declare preset
|
|
40
42
|
* swatches as light DOM `option` children, exactly like `eun-select` does
|
|
@@ -71,6 +73,8 @@ const EunomiaColorPickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldAp
|
|
|
71
73
|
* @prop {string} defaultValue - The default value applied when the field connects, and restored on form reset
|
|
72
74
|
* @attr {string} [default-value] - The default value
|
|
73
75
|
* @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
|
|
76
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
77
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
74
78
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
75
79
|
* @prop {string} instructions - Instructions displayed below the label
|
|
76
80
|
* @prop {string} name - The field name
|
|
@@ -124,11 +128,13 @@ const EunomiaColorPickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldAp
|
|
|
124
128
|
* @cssprop [--field-edit-confirm-color] - Sets the color of the confirm button in readonly-available edit mode
|
|
125
129
|
* @cssprop [--field-edit-cancel-color] - Sets the color of the cancel button in readonly-available edit mode
|
|
126
130
|
* @cssprop [--field-listbox-max-height=260px] - Sets the maximum height of the dropdown panel, past which it scrolls
|
|
131
|
+
* @cssprop [--field-listbox-border-radius] - Sets the corner radius of the dropdown panel, independent of the field's own radius
|
|
127
132
|
* @cssprop [--field-listbox-transition-duration=200ms] - Sets the duration of the dropdown panel's open and close animation
|
|
128
133
|
* @cssprop [--color-picker-swatch-size=20px] - Sets the diameter of every swatch
|
|
129
134
|
* @cssprop [--eun-viewport-inset-top] - Reserves space, such as a page's sticky header height, that the dropdown panel keeps clear of at the top of the viewport
|
|
130
135
|
* @cssprop [--eun-viewport-inset-bottom] - The same as eun-viewport-inset-top, reserved at the bottom of the viewport
|
|
131
136
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
137
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
132
138
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
133
139
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
134
140
|
* @element eun-color-picker
|
|
@@ -651,7 +657,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
651
657
|
class="confirm"
|
|
652
658
|
size="s"
|
|
653
659
|
color="primary"
|
|
654
|
-
appearance="
|
|
660
|
+
appearance="soft"
|
|
655
661
|
rounded
|
|
656
662
|
type="button"
|
|
657
663
|
@click=${this.handleConfirmClick}
|
|
@@ -126,6 +126,19 @@ const colorPicker = css `
|
|
|
126
126
|
#native-swatch .swatch {
|
|
127
127
|
pointer-events: none;
|
|
128
128
|
}
|
|
129
|
+
|
|
130
|
+
button#field #trigger-swatch,
|
|
131
|
+
#field-wrapper > #custom-row .swatch {
|
|
132
|
+
--_fieldSwatchSize: min(
|
|
133
|
+
var(--color-picker-swatch-size, 20px),
|
|
134
|
+
calc(var(--_lineHeight) + 2 * var(--_paddingBlock))
|
|
135
|
+
);
|
|
136
|
+
width: var(--_fieldSwatchSize);
|
|
137
|
+
height: var(--_fieldSwatchSize);
|
|
138
|
+
}
|
|
139
|
+
#field-wrapper > #custom-row #native-swatch {
|
|
140
|
+
display: flex;
|
|
141
|
+
}
|
|
129
142
|
#native-input {
|
|
130
143
|
position: absolute;
|
|
131
144
|
inset: 0;
|
|
@@ -5,6 +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 { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
8
|
+
import { RoundedMixinInterface } from "../../../mixins/rounded.mixin.js";
|
|
8
9
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
9
10
|
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
10
11
|
/**
|
|
@@ -15,13 +16,14 @@ export declare const EunomiaCounterTagName = "eun-counter";
|
|
|
15
16
|
* Type of the counter base used to declare every necessary Mixin interface elements.
|
|
16
17
|
* @internal
|
|
17
18
|
*/
|
|
18
|
-
type EunomiaCounterBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<number> & FormMixinInterface<number> & FormLabelMixinInterface & FieldAppearanceMixinInterface & LocalizableMixinInterface;
|
|
19
|
+
type EunomiaCounterBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<number> & FormMixinInterface<number> & FormLabelMixinInterface & FieldAppearanceMixinInterface & RoundedMixinInterface & LocalizableMixinInterface;
|
|
19
20
|
declare const EunomiaCounterMixinBase: Constructor<EunomiaCounterBase>;
|
|
20
21
|
/**
|
|
21
22
|
* A numeric field with increment and decrement buttons, built on a native
|
|
22
23
|
* number input.
|
|
23
24
|
*
|
|
24
25
|
* @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
|
|
26
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
25
27
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
26
28
|
* @prop {string} instructions - Instructions displayed below the label
|
|
27
29
|
* @prop {string} name - The field name
|
|
@@ -13,6 +13,7 @@ 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
15
|
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
16
|
+
import { RoundedMixin, } from "../../../mixins/rounded.mixin.js";
|
|
16
17
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
17
18
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
18
19
|
import { counterStyles } from "./counter.styles.js";
|
|
@@ -28,12 +29,13 @@ export const EunomiaCounterTagName = "eun-counter";
|
|
|
28
29
|
* @internal
|
|
29
30
|
*/
|
|
30
31
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
31
|
-
const EunomiaCounterMixinBase = LocalizableMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base)))));
|
|
32
|
+
const EunomiaCounterMixinBase = LocalizableMixin(RoundedMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))))));
|
|
32
33
|
/**
|
|
33
34
|
* A numeric field with increment and decrement buttons, built on a native
|
|
34
35
|
* number input.
|
|
35
36
|
*
|
|
36
37
|
* @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
|
|
38
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
37
39
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
38
40
|
* @prop {string} instructions - Instructions displayed below the label
|
|
39
41
|
* @prop {string} name - The field name
|
|
@@ -37,10 +37,8 @@ const base = css `
|
|
|
37
37
|
--counter-focus-outline-color,
|
|
38
38
|
var(--eun-color-primary-500, #3d6fff)
|
|
39
39
|
);
|
|
40
|
-
--
|
|
41
|
-
|
|
42
|
-
var(--eun-border-radius-m, 8px)
|
|
43
|
-
);
|
|
40
|
+
--_defaultBorderRadius: var(--eun-border-radius-m, 8px);
|
|
41
|
+
--_borderRadius: var(--counter-border-radius, var(--_defaultBorderRadius));
|
|
44
42
|
--_fieldWidth: var(--counter-field-width, 3.5rem);
|
|
45
43
|
font-family: var(--eun-font-family, "Mulish", sans-serif);
|
|
46
44
|
font-size: var(--eun-font-size-s, 14px);
|
|
@@ -50,6 +48,10 @@ const base = css `
|
|
|
50
48
|
outline: none;
|
|
51
49
|
}
|
|
52
50
|
|
|
51
|
+
:host([rounded]) {
|
|
52
|
+
--_defaultBorderRadius: var(--eun-border-radius-xl, 999px);
|
|
53
|
+
}
|
|
54
|
+
|
|
53
55
|
#wrapper {
|
|
54
56
|
display: flex;
|
|
55
57
|
flex-direction: column;
|
|
@@ -5,6 +5,8 @@ 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 { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
8
|
+
import { RoundedMixinInterface } from "../../../mixins/rounded.mixin.js";
|
|
9
|
+
import { FieldSizeMixinInterface } from "../../../mixins/field-size.mixin.js";
|
|
8
10
|
import { AnchorPositionMixinInterface } from "../../../mixins/anchor-position.mixin.js";
|
|
9
11
|
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
10
12
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
@@ -21,7 +23,7 @@ export declare const EunomiaDatePickerTagName = "eun-date-picker";
|
|
|
21
23
|
* interface element.
|
|
22
24
|
* @internal
|
|
23
25
|
*/
|
|
24
|
-
type EunomiaDatePickerBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<Date | null> & FormMixinInterface<Date | null> & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
26
|
+
type EunomiaDatePickerBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<Date | null> & FormMixinInterface<Date | null> & FormLabelMixinInterface & FieldAppearanceMixinInterface & RoundedMixinInterface & FieldSizeMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
25
27
|
declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
26
28
|
/**
|
|
27
29
|
* A date field entered across segmented numeric day, month, and year
|
|
@@ -45,6 +47,8 @@ declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
|
45
47
|
* composes with all three.
|
|
46
48
|
*
|
|
47
49
|
* @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
|
|
50
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
51
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
48
52
|
* @prop {'single' | 'range'} [mode='single'] - Whether a single value or a start and end range is picked
|
|
49
53
|
* @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
54
|
* @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
|
|
@@ -109,6 +113,7 @@ declare const EunomiaDatePickerMixinBase: Constructor<EunomiaDatePickerBase>;
|
|
|
109
113
|
* @cssprop [--date-picker-panel-background] - Sets the background color of the popover panel
|
|
110
114
|
* @cssprop [--date-picker-panel-transition-duration=200ms] - Sets the duration of the popover panel's open and close transition, disabled entirely by the no-animation attribute or reduced motion settings
|
|
111
115
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
116
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
112
117
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
113
118
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
114
119
|
* @element eun-date-picker
|
|
@@ -14,6 +14,8 @@ import { ValidatorsMixin, } from "../../../mixins/validators.mixin.js";
|
|
|
14
14
|
import { FormMixin, hasErrorDisplayChange, } from "../../../mixins/form.mixin.js";
|
|
15
15
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
16
16
|
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
17
|
+
import { RoundedMixin, } from "../../../mixins/rounded.mixin.js";
|
|
18
|
+
import { FieldSizeMixin, } from "../../../mixins/field-size.mixin.js";
|
|
17
19
|
import { AnchorPositionMixin, } from "../../../mixins/anchor-position.mixin.js";
|
|
18
20
|
import { LocalizableMixin, } from "../../../mixins/localizable.mixin.js";
|
|
19
21
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
@@ -58,7 +60,7 @@ const SEGMENT_SPIN_BOUNDS = {
|
|
|
58
60
|
* @internal
|
|
59
61
|
*/
|
|
60
62
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
61
|
-
const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))))));
|
|
63
|
+
const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(RoundedMixin(FieldSizeMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))))))));
|
|
62
64
|
/**
|
|
63
65
|
* A date field entered across segmented numeric day, month, and year
|
|
64
66
|
* inputs, following the same accessible pattern used by several
|
|
@@ -81,6 +83,8 @@ const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldApp
|
|
|
81
83
|
* composes with all three.
|
|
82
84
|
*
|
|
83
85
|
* @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
|
|
86
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
87
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
84
88
|
* @prop {'single' | 'range'} [mode='single'] - Whether a single value or a start and end range is picked
|
|
85
89
|
* @prop {'day' | 'month' | 'year'} [granularity='day'] - How precise the picked value is. Controls both the number of segments rendered and which calendar surface opens
|
|
86
90
|
* @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
|
|
@@ -145,6 +149,7 @@ const EunomiaDatePickerMixinBase = LocalizableMixin(AnchorPositionMixin(FieldApp
|
|
|
145
149
|
* @cssprop [--date-picker-panel-background] - Sets the background color of the popover panel
|
|
146
150
|
* @cssprop [--date-picker-panel-transition-duration=200ms] - Sets the duration of the popover panel's open and close transition, disabled entirely by the no-animation attribute or reduced motion settings
|
|
147
151
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
152
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
148
153
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
149
154
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
150
155
|
* @element eun-date-picker
|
|
@@ -2273,7 +2278,7 @@ let EunomiaDatePicker = EunomiaDatePicker_1 = class EunomiaDatePicker extends Eu
|
|
|
2273
2278
|
?disabled=${this.disabled}
|
|
2274
2279
|
@click=${this.handleTriggerClick}
|
|
2275
2280
|
>
|
|
2276
|
-
<eun-icon name="calendar_today"
|
|
2281
|
+
<eun-icon name="calendar_today"></eun-icon>
|
|
2277
2282
|
</button>
|
|
2278
2283
|
</div>
|
|
2279
2284
|
`;
|
|
@@ -31,15 +31,15 @@ const datePicker = css `
|
|
|
31
31
|
display: flex;
|
|
32
32
|
align-items: center;
|
|
33
33
|
gap: var(--eun-space-xs, 4px);
|
|
34
|
-
width: 100%;
|
|
35
34
|
color: var(--_textColor);
|
|
36
35
|
background-color: var(--_background);
|
|
37
36
|
border: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
|
|
38
37
|
border-radius: var(--_borderRadius);
|
|
39
|
-
padding: var(--
|
|
40
|
-
var(--
|
|
38
|
+
padding: var(--_paddingBlock) calc(var(--_defaultPaddingInline) / 2)
|
|
39
|
+
var(--_paddingBlock) var(--_defaultPaddingInline);
|
|
41
40
|
outline: 1px solid transparent;
|
|
42
|
-
box-sizing:
|
|
41
|
+
box-sizing: content-box;
|
|
42
|
+
height: var(--_lineHeight);
|
|
43
43
|
transition:
|
|
44
44
|
border-color var(--eun-duration-s, 150ms) var(--eun-easing-default, ease),
|
|
45
45
|
outline-color var(--eun-duration-s, 150ms) var(--eun-easing-default, ease);
|
|
@@ -94,9 +94,10 @@ const datePicker = css `
|
|
|
94
94
|
box-sizing: content-box;
|
|
95
95
|
border: none;
|
|
96
96
|
background: none;
|
|
97
|
-
padding:
|
|
97
|
+
padding: 0 1px;
|
|
98
98
|
color: inherit;
|
|
99
99
|
font: inherit;
|
|
100
|
+
line-height: var(--_lineHeight);
|
|
100
101
|
text-align: center;
|
|
101
102
|
outline: none;
|
|
102
103
|
overflow: visible;
|
|
@@ -124,10 +125,11 @@ const datePicker = css `
|
|
|
124
125
|
box-sizing: content-box;
|
|
125
126
|
border: none;
|
|
126
127
|
background: none;
|
|
127
|
-
padding:
|
|
128
|
+
padding: 0 1px;
|
|
128
129
|
width: 2.5ch;
|
|
129
130
|
color: inherit;
|
|
130
131
|
font: inherit;
|
|
132
|
+
line-height: var(--_lineHeight);
|
|
131
133
|
text-align: center;
|
|
132
134
|
outline: none;
|
|
133
135
|
cursor: pointer;
|
|
@@ -143,6 +145,7 @@ const datePicker = css `
|
|
|
143
145
|
padding-inline: 2px;
|
|
144
146
|
}
|
|
145
147
|
#calendar-trigger {
|
|
148
|
+
--icon-size: min(16px, var(--_lineHeight));
|
|
146
149
|
display: flex;
|
|
147
150
|
align-items: center;
|
|
148
151
|
justify-content: center;
|
|
@@ -6,6 +6,8 @@ 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
8
|
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
9
|
+
import { RoundedMixinInterface } from "../../../mixins/rounded.mixin.js";
|
|
10
|
+
import { FieldSizeMixinInterface } from "../../../mixins/field-size.mixin.js";
|
|
9
11
|
import { EunomiaIconName } from "../../content/icon/icon.type.js";
|
|
10
12
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
11
13
|
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
@@ -21,7 +23,7 @@ export type EunomiaInputType = "text" | "email" | "number" | "tel" | "url" | "se
|
|
|
21
23
|
* Type of the input base used to declare every necessary Mixin interface elements.
|
|
22
24
|
* @internal
|
|
23
25
|
*/
|
|
24
|
-
type EunomiaInputBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface & LocalizableMixinInterface;
|
|
26
|
+
type EunomiaInputBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface & RoundedMixinInterface & FieldSizeMixinInterface & LocalizableMixinInterface;
|
|
25
27
|
declare const EunomiaInputMixinBase: Constructor<EunomiaInputBase>;
|
|
26
28
|
/**
|
|
27
29
|
* A single-line text field, supporting several native input types.
|
|
@@ -29,6 +31,8 @@ declare const EunomiaInputMixinBase: Constructor<EunomiaInputBase>;
|
|
|
29
31
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty
|
|
30
32
|
* @prop {'text' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'password'} [type='text'] - The native input type to apply
|
|
31
33
|
* @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
|
|
34
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
35
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
32
36
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
33
37
|
* @prop {string} instructions - Instructions displayed below the label
|
|
34
38
|
* @prop {string} placeholder - The placeholder shown when the field is empty
|
|
@@ -78,6 +82,7 @@ declare const EunomiaInputMixinBase: Constructor<EunomiaInputBase>;
|
|
|
78
82
|
* @cssprop [--field-edit-confirm-color] - Sets the color of the confirm button in readonly-available edit mode
|
|
79
83
|
* @cssprop [--field-edit-cancel-color] - Sets the color of the cancel button in readonly-available edit mode
|
|
80
84
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
85
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
81
86
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
82
87
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
83
88
|
* @element eun-input
|
|
@@ -16,6 +16,8 @@ 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
18
|
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
19
|
+
import { RoundedMixin, } from "../../../mixins/rounded.mixin.js";
|
|
20
|
+
import { FieldSizeMixin, } from "../../../mixins/field-size.mixin.js";
|
|
19
21
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
20
22
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
21
23
|
import { inputStyles } from "./input.styles.js";
|
|
@@ -31,13 +33,15 @@ export const EunomiaInputTagName = "eun-input";
|
|
|
31
33
|
* @internal
|
|
32
34
|
*/
|
|
33
35
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
34
|
-
const EunomiaInputMixinBase = LocalizableMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(EditableMixin(FormMixin(Base))))));
|
|
36
|
+
const EunomiaInputMixinBase = LocalizableMixin(RoundedMixin(FieldSizeMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(EditableMixin(FormMixin(Base))))))));
|
|
35
37
|
/**
|
|
36
38
|
* A single-line text field, supporting several native input types.
|
|
37
39
|
*
|
|
38
40
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty
|
|
39
41
|
* @prop {'text' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'password'} [type='text'] - The native input type to apply
|
|
40
42
|
* @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
|
|
43
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
44
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
41
45
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
42
46
|
* @prop {string} instructions - Instructions displayed below the label
|
|
43
47
|
* @prop {string} placeholder - The placeholder shown when the field is empty
|
|
@@ -87,6 +91,7 @@ const EunomiaInputMixinBase = LocalizableMixin(FieldAppearanceMixin(FormLabelMix
|
|
|
87
91
|
* @cssprop [--field-edit-confirm-color] - Sets the color of the confirm button in readonly-available edit mode
|
|
88
92
|
* @cssprop [--field-edit-cancel-color] - Sets the color of the cancel button in readonly-available edit mode
|
|
89
93
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
94
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
90
95
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
91
96
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
92
97
|
* @element eun-input
|
|
@@ -404,7 +409,7 @@ let EunomiaInput = class EunomiaInput extends EunomiaInputMixinBase {
|
|
|
404
409
|
class="confirm"
|
|
405
410
|
size="s"
|
|
406
411
|
color="primary"
|
|
407
|
-
appearance="
|
|
412
|
+
appearance="soft"
|
|
408
413
|
rounded
|
|
409
414
|
type="button"
|
|
410
415
|
@click=${this.confirmEdit}
|
|
@@ -5,6 +5,8 @@ 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 { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
8
|
+
import { RoundedMixinInterface } from "../../../mixins/rounded.mixin.js";
|
|
9
|
+
import { FieldSizeMixinInterface } from "../../../mixins/field-size.mixin.js";
|
|
8
10
|
import { AnchorPositionMixinInterface } from "../../../mixins/anchor-position.mixin.js";
|
|
9
11
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
10
12
|
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
@@ -17,7 +19,7 @@ export declare const EunomiaInputPhoneTagName = "eun-input-phone";
|
|
|
17
19
|
* interface element.
|
|
18
20
|
* @internal
|
|
19
21
|
*/
|
|
20
|
-
type EunomiaInputPhoneBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
22
|
+
type EunomiaInputPhoneBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<string> & FormMixinInterface<string> & FormLabelMixinInterface & FieldAppearanceMixinInterface & RoundedMixinInterface & FieldSizeMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
21
23
|
declare const EunomiaInputPhoneMixinBase: Constructor<EunomiaInputPhoneBase>;
|
|
22
24
|
/**
|
|
23
25
|
* A phone number field rendered in two adjacent parts: a compact country
|
|
@@ -40,6 +42,8 @@ declare const EunomiaInputPhoneMixinBase: Constructor<EunomiaInputPhoneBase>;
|
|
|
40
42
|
*
|
|
41
43
|
* @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
|
|
42
44
|
* @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
|
|
45
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
46
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
43
47
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
44
48
|
* @prop {string} instructions - Instructions displayed below the label
|
|
45
49
|
* @prop {string} name - The field name
|
|
@@ -82,10 +86,12 @@ declare const EunomiaInputPhoneMixinBase: Constructor<EunomiaInputPhoneBase>;
|
|
|
82
86
|
* @cssprop [--field-hint-color] - Sets the color of the hint message
|
|
83
87
|
* @cssprop [--field-focus-outline-color] - Sets the color of the focus outline
|
|
84
88
|
* @cssprop [--field-listbox-max-height=260px] - Sets the maximum height of the country dropdown panel, past which it scrolls
|
|
89
|
+
* @cssprop [--field-listbox-border-radius] - Sets the corner radius of the country dropdown panel, independent of the field's own radius
|
|
85
90
|
* @cssprop [--field-listbox-transition-duration=200ms] - Sets the duration of the dropdown panel's open and close height transition, disabled entirely under reduced motion settings
|
|
86
91
|
* @cssprop [--eun-viewport-inset-top] - Reserves space, such as a page's sticky header height, that the dropdown panel keeps clear of at the top of the viewport. Set on the root or an ancestor rather than on the field itself
|
|
87
92
|
* @cssprop [--eun-viewport-inset-bottom] - The same as eun-viewport-inset-top, reserved at the bottom of the viewport, such as for a sticky footer
|
|
88
93
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
94
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
89
95
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
90
96
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
91
97
|
* @element eun-input-phone
|
|
@@ -15,6 +15,8 @@ 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 { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
18
|
+
import { RoundedMixin, } from "../../../mixins/rounded.mixin.js";
|
|
19
|
+
import { FieldSizeMixin, } from "../../../mixins/field-size.mixin.js";
|
|
18
20
|
import { AnchorPositionMixin, } from "../../../mixins/anchor-position.mixin.js";
|
|
19
21
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
20
22
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
@@ -66,7 +68,7 @@ const TRIGGER_POINTER_DOWN_WINDOW_MS = 100;
|
|
|
66
68
|
* @internal
|
|
67
69
|
*/
|
|
68
70
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
69
|
-
const EunomiaInputPhoneMixinBase = LocalizableMixin(AnchorPositionMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))))));
|
|
71
|
+
const EunomiaInputPhoneMixinBase = LocalizableMixin(AnchorPositionMixin(RoundedMixin(FieldSizeMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(FormMixin(Base))))))));
|
|
70
72
|
/**
|
|
71
73
|
* A phone number field rendered in two adjacent parts: a compact country
|
|
72
74
|
* selector, showing only the flag, on the leading side, and the phone
|
|
@@ -88,6 +90,8 @@ const EunomiaInputPhoneMixinBase = LocalizableMixin(AnchorPositionMixin(FieldApp
|
|
|
88
90
|
*
|
|
89
91
|
* @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
|
|
90
92
|
* @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
|
|
93
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
94
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
91
95
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
92
96
|
* @prop {string} instructions - Instructions displayed below the label
|
|
93
97
|
* @prop {string} name - The field name
|
|
@@ -130,10 +134,12 @@ const EunomiaInputPhoneMixinBase = LocalizableMixin(AnchorPositionMixin(FieldApp
|
|
|
130
134
|
* @cssprop [--field-hint-color] - Sets the color of the hint message
|
|
131
135
|
* @cssprop [--field-focus-outline-color] - Sets the color of the focus outline
|
|
132
136
|
* @cssprop [--field-listbox-max-height=260px] - Sets the maximum height of the country dropdown panel, past which it scrolls
|
|
137
|
+
* @cssprop [--field-listbox-border-radius] - Sets the corner radius of the country dropdown panel, independent of the field's own radius
|
|
133
138
|
* @cssprop [--field-listbox-transition-duration=200ms] - Sets the duration of the dropdown panel's open and close height transition, disabled entirely under reduced motion settings
|
|
134
139
|
* @cssprop [--eun-viewport-inset-top] - Reserves space, such as a page's sticky header height, that the dropdown panel keeps clear of at the top of the viewport. Set on the root or an ancestor rather than on the field itself
|
|
135
140
|
* @cssprop [--eun-viewport-inset-bottom] - The same as eun-viewport-inset-top, reserved at the bottom of the viewport, such as for a sticky footer
|
|
136
141
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
142
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
137
143
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
138
144
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
139
145
|
* @element eun-input-phone
|
|
@@ -41,7 +41,7 @@ const inputPhone = css `
|
|
|
41
41
|
align-items: center;
|
|
42
42
|
justify-content: center;
|
|
43
43
|
flex-shrink: 0;
|
|
44
|
-
padding:
|
|
44
|
+
padding: 0 var(--_defaultPaddingInline);
|
|
45
45
|
background-color: var(--_background);
|
|
46
46
|
border: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
|
|
47
47
|
border-inline-end: none;
|
|
@@ -64,7 +64,7 @@ const inputPhone = css `
|
|
|
64
64
|
outline-offset: 0;
|
|
65
65
|
}
|
|
66
66
|
.flag {
|
|
67
|
-
font-size: var(--eun-font-size-m, 16px);
|
|
67
|
+
font-size: min(var(--eun-font-size-m, 16px), var(--_lineHeight));
|
|
68
68
|
line-height: 1;
|
|
69
69
|
}
|
|
70
70
|
#field-wrapper {
|
|
@@ -178,7 +178,10 @@ const inputPhone = css `
|
|
|
178
178
|
background: none;
|
|
179
179
|
border: none;
|
|
180
180
|
outline: none;
|
|
181
|
-
|
|
181
|
+
box-sizing: content-box;
|
|
182
|
+
height: var(--_lineHeight);
|
|
183
|
+
line-height: var(--_lineHeight);
|
|
184
|
+
padding: var(--_paddingBlock) var(--_defaultPaddingInline);
|
|
182
185
|
}
|
|
183
186
|
#phone-field::placeholder {
|
|
184
187
|
color: var(--_placeholderColor);
|