@warp-ds/elements 2.10.0-next.17 → 2.10.0-next.19
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/custom-elements.json +285 -159
- package/dist/docs/affix/affix.md +117 -0
- package/dist/docs/affix/styling.md +107 -0
- package/dist/docs/breadcrumb-item/api.md +27 -0
- package/dist/docs/breadcrumb-item/breadcrumb-item.md +34 -0
- package/dist/docs/breadcrumbs/accessibility.md +8 -18
- package/dist/docs/breadcrumbs/breadcrumbs.md +120 -34
- package/dist/docs/breadcrumbs/examples.md +8 -8
- package/dist/docs/breadcrumbs/styling.md +96 -0
- package/dist/docs/breadcrumbs/usage.md +8 -8
- package/dist/docs/index.md +2 -1
- package/dist/docs/select/select.md +91 -0
- package/dist/docs/select/styling.md +91 -0
- package/dist/docs/textarea/styling.md +91 -0
- package/dist/docs/textarea/textarea.md +91 -0
- package/dist/docs/textfield/api.md +8 -0
- package/dist/docs/textfield/styling.md +95 -0
- package/dist/docs/textfield/textfield.md +103 -0
- package/dist/index.d.ts +175 -64
- package/dist/packages/affix/affix-styles.d.ts +8 -0
- package/dist/packages/affix/affix-styles.js +108 -0
- package/dist/packages/affix/affix.d.ts +11 -8
- package/dist/packages/affix/affix.js +118 -17
- package/dist/packages/affix/affix.js.map +4 -4
- package/dist/packages/affix/affix.react.stories.d.ts +1 -1
- package/dist/packages/affix/react.d.ts +1 -1
- package/dist/packages/alert/alert.js.map +1 -1
- package/dist/packages/attention/attention.js.map +1 -1
- package/dist/packages/breadcrumb-item/breadcrumb-item.d.ts +29 -0
- package/dist/packages/breadcrumb-item/breadcrumb-item.js +2529 -0
- package/dist/packages/breadcrumb-item/breadcrumb-item.js.map +7 -0
- package/dist/packages/breadcrumb-item/react.d.ts +2 -0
- package/dist/packages/breadcrumb-item/react.js +11 -0
- package/dist/packages/breadcrumb-item/styles.d.ts +4 -0
- package/dist/packages/breadcrumb-item/styles.js +81 -0
- package/dist/packages/breadcrumbs/breadcrumbs.d.ts +2 -0
- package/dist/packages/breadcrumbs/breadcrumbs.js +11 -13
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.js +11 -10
- package/dist/packages/breadcrumbs/breadcrumbs.stories.d.ts +4 -5
- package/dist/packages/breadcrumbs/breadcrumbs.stories.js +14 -11
- package/dist/packages/button/button.react.stories.d.ts +2 -2
- package/dist/packages/button/react.d.ts +1 -1
- package/dist/packages/checkbox-group/react.d.ts +1 -1
- package/dist/packages/combobox/combobox.react.stories.d.ts +2 -2
- package/dist/packages/combobox/react.d.ts +1 -1
- package/dist/packages/datepicker/datepicker.js.map +1 -1
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +2 -2
- package/dist/packages/datepicker/react.d.ts +1 -1
- package/dist/packages/expandable/expandable.js.map +1 -1
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +1 -1
- package/dist/packages/icon/icon.react.stories.d.ts +2 -1
- package/dist/packages/icon/icon.react.stories.js +1 -1
- package/dist/packages/modal-header/modal-header.js.map +1 -1
- package/dist/packages/pagination/pagination.js.map +1 -1
- package/dist/packages/pagination/pagination.react.stories.d.ts +2 -2
- package/dist/packages/pagination/react.d.ts +1 -1
- package/dist/packages/pill/pill.js.map +1 -1
- package/dist/packages/radio-group/react.d.ts +1 -1
- package/dist/packages/select/input-styles.d.ts +11 -0
- package/dist/packages/select/input-styles.js +88 -0
- package/dist/packages/select/react.d.ts +1 -1
- package/dist/packages/select/select.js +96 -19
- package/dist/packages/select/select.js.map +4 -4
- package/dist/packages/select/select.react.stories.d.ts +2 -2
- package/dist/packages/slider/react.d.ts +1 -1
- package/dist/packages/slider/slider.react.stories.d.ts +1 -1
- package/dist/packages/slider-thumb/react.d.ts +1 -1
- package/dist/packages/snackbar/snackbar.d.ts +2 -2
- package/dist/packages/snackbar/snackbar.js +1 -1
- package/dist/packages/snackbar/snackbar.js.map +2 -2
- package/dist/packages/step/step.js.map +1 -1
- package/dist/packages/textarea/input-styles.d.ts +11 -0
- package/dist/packages/textarea/input-styles.js +88 -0
- package/dist/packages/textarea/react.d.ts +1 -1
- package/dist/packages/textarea/textarea.js +99 -20
- package/dist/packages/textarea/textarea.js.map +4 -4
- package/dist/packages/textarea/textarea.react.stories.d.ts +2 -2
- package/dist/packages/textfield/input-styles.d.ts +11 -0
- package/dist/packages/textfield/input-styles.js +88 -0
- package/dist/packages/textfield/locales/da/messages.d.mts +1 -0
- package/dist/packages/textfield/locales/da/messages.mjs +1 -0
- package/dist/packages/textfield/locales/en/messages.d.mts +1 -0
- package/dist/packages/textfield/locales/en/messages.mjs +1 -0
- package/dist/packages/textfield/locales/fi/messages.d.mts +1 -0
- package/dist/packages/textfield/locales/fi/messages.mjs +1 -0
- package/dist/packages/textfield/locales/nb/messages.d.mts +1 -0
- package/dist/packages/textfield/locales/nb/messages.mjs +1 -0
- package/dist/packages/textfield/locales/sv/messages.d.mts +1 -0
- package/dist/packages/textfield/locales/sv/messages.mjs +1 -0
- package/dist/packages/textfield/react.d.ts +1 -1
- package/dist/packages/textfield/textfield.d.ts +11 -1
- package/dist/packages/textfield/textfield.js +111 -24
- package/dist/packages/textfield/textfield.js.map +4 -4
- package/dist/packages/textfield/textfield.react.stories.d.ts +2 -2
- package/dist/packages/toast/styles.js +1 -1
- package/dist/packages/toast/toast.js +7 -7
- package/dist/packages/toast/toast.js.map +2 -2
- package/dist/packages/toast-container/toast-container.js +8 -8
- package/dist/packages/toast-container/toast-container.js.map +3 -3
- package/dist/web-types.json +96 -50
- package/eik/index.js +20 -20
- package/package.json +8 -1
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { Textarea } from "./react";
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
|
-
render(args: Omit<Omit<Omit<React.HTMLAttributes<import("./textarea").WarpTextarea>, "value" | "form" | "label" | "name" | "disabled" | "invalid" | "helpText" | "placeholder" | "readOnly" | "readonly" | "required" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "onfocus" | "oninput" | "updated" | "firstUpdated" | "resetFormControl" | "_helptextstyles" | "_helpId" | "_id" | "_error" | "handler" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onFocus" | "onBlur" | "onChange" | "onInput" | "reportValidity" | "
|
|
6
|
+
render(args: Omit<Omit<Omit<React.HTMLAttributes<import("./textarea").WarpTextarea>, "value" | "form" | "label" | "name" | "disabled" | "invalid" | "helpText" | "optional" | "placeholder" | "readOnly" | "readonly" | "required" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "onfocus" | "oninput" | "updated" | "firstUpdated" | "resetFormControl" | "_helptextstyles" | "_helpId" | "_id" | "_error" | "handler" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onFocus" | "onBlur" | "onChange" | "onInput" | "reportValidity" | "minHeight" | "setCustomValidity" | "maxRows" | "minRows" | "maxHeight" | "_textareaStyles"> & {
|
|
7
7
|
onBlur?: ((e: Event) => void) | undefined;
|
|
8
8
|
onblur?: ((e: Event) => void) | undefined;
|
|
9
9
|
onChange?: ((e: Event) => void) | undefined;
|
|
@@ -18,7 +18,7 @@ declare const _default: {
|
|
|
18
18
|
minRows?: number;
|
|
19
19
|
readOnly?: boolean;
|
|
20
20
|
} & React.RefAttributes<import("./textarea").WarpTextarea>): React.JSX.Element;
|
|
21
|
-
component: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<import("./textarea").WarpTextarea>, "value" | "form" | "label" | "name" | "disabled" | "invalid" | "helpText" | "placeholder" | "readOnly" | "readonly" | "required" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "onfocus" | "oninput" | "updated" | "firstUpdated" | "resetFormControl" | "_helptextstyles" | "_helpId" | "_id" | "_error" | "handler" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onFocus" | "onBlur" | "onChange" | "onInput" | "reportValidity" | "
|
|
21
|
+
component: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<import("./textarea").WarpTextarea>, "value" | "form" | "label" | "name" | "disabled" | "invalid" | "helpText" | "optional" | "placeholder" | "readOnly" | "readonly" | "required" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "onfocus" | "oninput" | "updated" | "firstUpdated" | "resetFormControl" | "_helptextstyles" | "_helpId" | "_id" | "_error" | "handler" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onFocus" | "onBlur" | "onChange" | "onInput" | "reportValidity" | "minHeight" | "setCustomValidity" | "maxRows" | "minRows" | "maxHeight" | "_textareaStyles"> & {
|
|
22
22
|
onBlur?: ((e: Event) => void) | undefined;
|
|
23
23
|
onblur?: ((e: Event) => void) | undefined;
|
|
24
24
|
onChange?: ((e: Event) => void) | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared styles for input components (textfield, textarea, select)
|
|
3
|
+
* using the internal token pattern with a public styling API.
|
|
4
|
+
*
|
|
5
|
+
* Public API tokens (customizable):
|
|
6
|
+
* - Label: --w-c-input-label-*
|
|
7
|
+
* - Help text: --w-c-input-help-text-*
|
|
8
|
+
* - Optional indicator: --w-c-input-optional-*
|
|
9
|
+
*/
|
|
10
|
+
export declare const inputLabelStyles: import("lit").CSSResult;
|
|
11
|
+
export declare const inputHelpTextStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* Shared styles for input components (textfield, textarea, select)
|
|
4
|
+
* using the internal token pattern with a public styling API.
|
|
5
|
+
*
|
|
6
|
+
* Public API tokens (customizable):
|
|
7
|
+
* - Label: --w-c-input-label-*
|
|
8
|
+
* - Help text: --w-c-input-help-text-*
|
|
9
|
+
* - Optional indicator: --w-c-input-optional-*
|
|
10
|
+
*/
|
|
11
|
+
export const inputLabelStyles = css `
|
|
12
|
+
/* Label component tokens with semantic fallbacks */
|
|
13
|
+
label {
|
|
14
|
+
/* Internal tokens - not part of public API */
|
|
15
|
+
--_color: var(--w-c-input-label-color, var(--w-s-color-text));
|
|
16
|
+
--_font-size: var(--w-c-input-label-font-size, var(--w-font-size-s));
|
|
17
|
+
--_line-height: var(--w-c-input-label-line-height, var(--w-line-height-s));
|
|
18
|
+
--_font-weight: var(--w-c-input-label-font-weight, 700);
|
|
19
|
+
--_padding-bottom: var(--w-c-input-label-padding-bottom, 0.4rem);
|
|
20
|
+
--_cursor: var(--w-c-input-label-cursor, pointer);
|
|
21
|
+
--_display: var(--w-c-input-label-display, block);
|
|
22
|
+
|
|
23
|
+
/* Apply styles */
|
|
24
|
+
display: var(--_display);
|
|
25
|
+
position: relative;
|
|
26
|
+
font-size: var(--_font-size);
|
|
27
|
+
line-height: var(--_line-height);
|
|
28
|
+
font-weight: var(--_font-weight);
|
|
29
|
+
padding-bottom: var(--_padding-bottom);
|
|
30
|
+
cursor: var(--_cursor);
|
|
31
|
+
color: var(--_color);
|
|
32
|
+
-webkit-font-smoothing: antialiased;
|
|
33
|
+
-moz-osx-font-smoothing: grayscale;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Optional text styling */
|
|
37
|
+
label span {
|
|
38
|
+
--_padding-left: var(--w-c-input-optional-padding-left, 0.8rem);
|
|
39
|
+
--_font-weight: var(--w-c-input-optional-font-weight, 400);
|
|
40
|
+
--_font-size: var(--w-c-input-optional-font-size, var(--w-font-size-s));
|
|
41
|
+
--_line-height: var(
|
|
42
|
+
--w-c-input-optional-line-height,
|
|
43
|
+
var(--w-line-height-s)
|
|
44
|
+
);
|
|
45
|
+
--_color: var(--w-c-input-optional-color, var(--w-s-color-text-subtle));
|
|
46
|
+
|
|
47
|
+
padding-left: var(--_padding-left);
|
|
48
|
+
font-weight: var(--_font-weight);
|
|
49
|
+
font-size: var(--_font-size);
|
|
50
|
+
line-height: var(--_line-height);
|
|
51
|
+
color: var(--_color);
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
export const inputHelpTextStyles = css `
|
|
55
|
+
/* Help text component tokens with semantic fallbacks */
|
|
56
|
+
:host {
|
|
57
|
+
--_help-text-color: var(
|
|
58
|
+
--w-c-input-help-text-color,
|
|
59
|
+
var(--w-s-color-text-subtle)
|
|
60
|
+
);
|
|
61
|
+
--_help-text-font-size: var(
|
|
62
|
+
--w-c-input-help-text-font-size,
|
|
63
|
+
var(--w-font-size-xs)
|
|
64
|
+
);
|
|
65
|
+
--_help-text-line-height: var(
|
|
66
|
+
--w-c-input-help-text-line-height,
|
|
67
|
+
var(--w-line-height-xs)
|
|
68
|
+
);
|
|
69
|
+
--_help-text-margin-top: var(--w-c-input-help-text-margin-top, 0.4rem);
|
|
70
|
+
--_help-text-display: var(--w-c-input-help-text-display, block);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Invalid state overrides color */
|
|
74
|
+
:host([invalid]) {
|
|
75
|
+
--_help-text-color: var(
|
|
76
|
+
--w-c-input-help-text-color-invalid,
|
|
77
|
+
var(--w-s-color-text-negative)
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.help-text {
|
|
82
|
+
font-size: var(--_help-text-font-size);
|
|
83
|
+
line-height: var(--_help-text-line-height);
|
|
84
|
+
margin-top: var(--_help-text-margin-top);
|
|
85
|
+
display: var(--_help-text-display);
|
|
86
|
+
color: var(--_help-text-color);
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"textfield.label.optional\":[\"(valgfri)\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"textfield.label.optional\":[\"(optional)\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"textfield.label.optional\":[\"(valinnainen)\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"textfield.label.optional\":[\"(valgfritt)\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"textfield.label.optional\":[\"(valfritt)\"]}");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { WarpTextField } from "./textfield.js";
|
|
3
|
-
export declare const TextField: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<WarpTextField>, "value" | "form" | "label" | "mask" | "pattern" | "
|
|
3
|
+
export declare const TextField: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<WarpTextField>, "value" | "form" | "label" | "mask" | "pattern" | "autocomplete" | "name" | "type" | "disabled" | "invalid" | "helpText" | "optional" | "size" | "max" | "min" | "minLength" | "minlength" | "maxLength" | "maxlength" | "placeholder" | "readOnly" | "readonly" | "required" | "step" | "formatter" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "onfocus" | "oninput" | "_hasPrefix" | "_hasSuffix" | "updated" | "firstUpdated" | "resetFormControl" | "_inputstyles" | "_helptextstyles" | "_label" | "_helpId" | "_id" | "_error" | "handler" | "prefixSlotChange" | "suffixSlotChange" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onFocus" | "onBlur" | "onChange" | "onInput"> & {
|
|
4
4
|
onBlur?: ((e: Event) => void) | undefined;
|
|
5
5
|
onblur?: ((e: Event) => void) | undefined;
|
|
6
6
|
onChange?: ((e: Event) => void) | undefined;
|
|
@@ -5,6 +5,11 @@ declare const WarpTextField_base: import("@open-wc/form-control").Constructor<im
|
|
|
5
5
|
*
|
|
6
6
|
* @slot suffix - Use with `<w-affix>` to include a suffix, for example the unit for a number (e. g. km or sek).
|
|
7
7
|
* @slot prefix - Use with `<w-affix>` to include a prefix, for example a search icon.
|
|
8
|
+
*
|
|
9
|
+
* ## Accessibility Note for Affixes
|
|
10
|
+
* Due to shadow DOM boundaries, affix content cannot be connected to the input via ARIA references.
|
|
11
|
+
* For non-interactive affixes (text labels like currency symbols), consider including that information
|
|
12
|
+
* in the main label or placeholder text instead for better screen reader support.
|
|
8
13
|
*/
|
|
9
14
|
declare class WarpTextField extends WarpTextField_base {
|
|
10
15
|
#private;
|
|
@@ -17,6 +22,7 @@ declare class WarpTextField extends WarpTextField_base {
|
|
|
17
22
|
serializable?: boolean;
|
|
18
23
|
slotAssignment?: SlotAssignmentMode;
|
|
19
24
|
};
|
|
25
|
+
constructor();
|
|
20
26
|
/**
|
|
21
27
|
* Keep in mind that using disabled in its current form is an anti-pattern.
|
|
22
28
|
*
|
|
@@ -44,6 +50,10 @@ declare class WarpTextField extends WarpTextField_base {
|
|
|
44
50
|
* @summary Description shown below the input field
|
|
45
51
|
*/
|
|
46
52
|
helpText: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Whether to show the optional indicator after the label.
|
|
55
|
+
*/
|
|
56
|
+
optional: boolean;
|
|
47
57
|
/**
|
|
48
58
|
* Sets the [size](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#size) (width) of the input field to fit the expected length of inputs.
|
|
49
59
|
*/
|
|
@@ -138,9 +148,9 @@ declare class WarpTextField extends WarpTextField_base {
|
|
|
138
148
|
/** @internal */
|
|
139
149
|
_hasSuffix: boolean;
|
|
140
150
|
updated(changedProperties: PropertyValues<this>): void;
|
|
151
|
+
static styles: import("lit").CSSResult[];
|
|
141
152
|
firstUpdated(): void;
|
|
142
153
|
resetFormControl(): void;
|
|
143
|
-
static styles: import("lit").CSSResult[];
|
|
144
154
|
/** @internal */
|
|
145
155
|
get _inputstyles(): string;
|
|
146
156
|
/** @internal */
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
var
|
|
1
|
+
var je=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var ie=o=>{throw TypeError(o)};var p=(o,e,r,t)=>{for(var a=t>1?void 0:t?Ie(e,r):e,l=o.length-1,s;l>=0;l--)(s=o[l])&&(a=(t?s(e,r,a):s(a))||a);return t&&a&&je(e,r,a),a};var G=(o,e,r)=>e.has(o)||ie("Cannot "+r);var ne=(o,e,r)=>(G(o,e,"read from private field"),r?r.call(o):e.get(o)),J=(o,e,r)=>e.has(o)?ie("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r),se=(o,e,r,t)=>(G(o,e,"write to private field"),t?t.call(o,r):e.set(o,r),r),le=(o,e,r)=>(G(o,e,"access private method"),r);var K=function(){for(var o=[],e=arguments.length;e--;)o[e]=arguments[e];return o.reduce(function(r,t){return r.concat(typeof t=="string"?t:Array.isArray(t)?K.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var L=o=>typeof o=="string",Ye=o=>typeof o=="function",de=new Map,he="en";function re(o){return[...Array.isArray(o)?o:[o],he]}function te(o,e,r){let t=re(o);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return X(()=>Z("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(L(e)?new Date(e):e)}function De(o,e,r){let t;if(r||(r="default"),typeof r=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=r;return te(o,e,t)}function Q(o,e,r){let t=re(o);return X(()=>Z("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function ce(o,e,r,{offset:t=0,...a}){let l=re(o),s=e?X(()=>Z("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):X(()=>Z("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return a[r]??a[s.select(r-t)]??a.other}function X(o,e){let r=o(),t=de.get(r);return t||(t=e(),de.set(r,t)),t}function Z(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var pe=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ue=o=>o.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,t)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(t,16);return String.fromCharCode(a)}}),be="%__lingui_octothorpe__%",He=(o,e,r={})=>{let t=e||o,a=s=>typeof s=="object"?s:r[s],l=(s,n)=>{let b=Object.keys(r).length?a("number"):void 0,f=Q(t,s,b);return n.replace(new RegExp(be,"g"),f)};return{plural:(s,n)=>{let{offset:b=0}=n,f=ce(t,!1,s,n);return l(s-b,f)},selectordinal:(s,n)=>{let{offset:b=0}=n,f=ce(t,!0,s,n);return l(s-b,f)},select:Xe,number:(s,n)=>Q(t,s,a(n)||{style:n}),date:(s,n)=>te(t,s,a(n)||n),time:(s,n)=>De(t,s,a(n)||n)}},Xe=(o,e)=>e[o]??e.other;function Ze(o,e,r){return(t={},a)=>{let l=He(e,r,a),s=(b,f=!1)=>Array.isArray(b)?b.reduce((C,M)=>{if(M==="#"&&f)return C+be;if(L(M))return C+M;let[F,y,E]=M,S={};y==="plural"||y==="selectordinal"||y==="select"?Object.entries(E).forEach(([$,O])=>{S[$]=s(O,y==="plural"||y==="selectordinal")}):S=E;let w;if(y){let $=l[y];w=$(t[F],S)}else w=t[F];return w==null?C:C+w},""):b,n=s(o);return L(n)&&pe.test(n)?ue(n):L(n)?n:n?String(n):""}}var Re=Object.defineProperty,qe=(o,e,r)=>e in o?Re(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Ue=(o,e,r)=>(qe(o,typeof e!="symbol"?e+"":e,r),r),W=class{constructor(){Ue(this,"_events",{})}on(e,r){var t;return(t=this._events)[e]??(t[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(r);~a&&t.splice(a,1)}emit(e,...r){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},Te=Object.defineProperty,Be=(o,e,r)=>e in o?Te(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,V=(o,e,r)=>(Be(o,typeof e!="symbol"?e+"":e,r),r),ee=class extends W{constructor(e){super(),V(this,"_locale",""),V(this,"_locales"),V(this,"_localeData",{}),V(this,"_messages",{}),V(this,"_missing"),V(this,"_messageCompiler"),V(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??he,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,r){let t=this._localeData[e];t?Object.assign(t,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,r){let t=this._messages[e];t?Object.assign(t,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:t}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,t){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=t?.message;e||(e=""),L(e)||(r=e.values||r,a=e.message,e=e.id);let l=this.messages[e],s=l===void 0,n=this._missing;if(n&&s)return Ye(n)?n(this._locale,e):n;s&&this.emit("missing",{id:e,locale:this._locale});let b=l||a||e;return L(b)&&(this._messageCompiler?b=this._messageCompiler(b):console.warn(`Uncompiled message detected! Message:
|
|
2
|
+
|
|
3
|
+
> ${b}
|
|
4
|
+
|
|
5
|
+
That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
|
|
6
|
+
ICU features such as interpolation and plurals will not work properly for that message.
|
|
7
|
+
|
|
8
|
+
Please compile your catalog first.
|
|
9
|
+
`)),L(b)&&pe.test(b)?ue(b):L(b)?b:Ze(b,this._locale,this._locales)(r,t?.formats)}date(e,r){return te(this._locales||this._locale,e,r)}number(e,r){return Q(this._locales||this._locale,e,r)}};function Ge(o={}){return new ee(o)}var _=Ge();var h=function(o,e,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?o!==e||!t:!e.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(o):t?t.value:e.get(o)},v=function(o,e,r,t,a){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?o!==e||!a:!e.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(o,r):a?a.value=r:e.set(o,r),r};function ge(o){var e,r,t,a,l,s,n,b,f,C,M,F,y,E,S,w,$,O,U;class Ae extends o{constructor(...i){var c,g,m;super(...i),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),t.set(this,!1),a.set(this,!1),l.set(this,void 0),s.set(this,void 0),n.set(this,!0),f.set(this,""),C.set(this,()=>{v(this,a,!0,"f"),v(this,r,!0,"f"),h(this,e,"m",w).call(this)}),M.set(this,()=>{v(this,r,!1,"f"),h(this,e,"m",$).call(this,this.shouldFormValueUpdate()?h(this,f,"f"):""),!this.validity.valid&&h(this,a,"f")&&v(this,t,!0,"f");let z=h(this,e,"m",w).call(this);this.validationMessageCallback&&this.validationMessageCallback(z?this.internals.validationMessage:"")}),F.set(this,()=>{var z;h(this,n,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),v(this,n,!1,"f")),v(this,a,!0,"f"),v(this,t,!0,"f"),h(this,e,"m",w).call(this),(z=this===null||this===void 0?void 0:this.validationMessageCallback)===null||z===void 0||z.call(this,this.showError?this.internals.validationMessage:"")}),y.set(this,void 0),E.set(this,!1),S.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",h(this,C,"f")),(g=this.addEventListener)===null||g===void 0||g.call(this,"blur",h(this,M,"f")),(m=this.addEventListener)===null||m===void 0||m.call(this,"invalid",h(this,F,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let i=this.validators.map(m=>m.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...i])]}static getValidator(i){return this.validators.find(c=>c.attribute===i)||null}static getValidators(i){return this.validators.filter(c=>{var g;if(c.attribute===i||!((g=c.attribute)===null||g===void 0)&&g.includes(i))return!0})}get form(){return this.internals.form}get showError(){return h(this,e,"m",w).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(i,c,g){var m;(m=super.attributeChangedCallback)===null||m===void 0||m.call(this,i,c,g);let j=this.constructor.getValidators(i);j?.length&&this.validationTarget&&this.setValue(h(this,f,"f"))}setValue(i){var c;v(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),v(this,f,i,"f");let m=this.shouldFormValueUpdate()?i:null;this.internals.setFormValue(m),h(this,e,"m",$).call(this,m),this.valueChangedCallback&&this.valueChangedCallback(m),h(this,e,"m",w).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(i=>i(h(this,S,"f")))}formResetCallback(){var i,c;v(this,a,!1,"f"),v(this,t,!1,"f"),h(this,e,"m",w).call(this),(i=this.resetFormControl)===null||i===void 0||i.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,h(this,e,"m",w).call(this)?this.validationMessage:"")}}return r=new WeakMap,t=new WeakMap,a=new WeakMap,l=new WeakMap,s=new WeakMap,n=new WeakMap,f=new WeakMap,C=new WeakMap,M=new WeakMap,F=new WeakMap,y=new WeakMap,E=new WeakMap,S=new WeakMap,e=new WeakSet,b=function(){let i=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return i.querySelectorAll(c)},w=function(){if(this.hasAttribute("disabled"))return!1;let i=h(this,t,"f")||h(this,a,"f")&&!this.validity.valid&&!h(this,r,"f");return i&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),i},$=function(i){let c=this.constructor,g={},m=c.validators,z=[],j=m.some(k=>k.isValid instanceof Promise);h(this,E,"f")||(v(this,S,new Promise(k=>{v(this,y,k,"f")}),"f"),v(this,E,!0,"f")),h(this,l,"f")&&(h(this,l,"f").abort(),v(this,s,h(this,l,"f"),"f"));let I=new AbortController;v(this,l,I,"f");let Y,ae=!1;m.length&&(m.forEach(k=>{let T=k.key||"customError",N=k.isValid(this,i,I.signal);N instanceof Promise?(z.push(N),N.then(B=>{B!=null&&(g[T]=!B,Y=h(this,e,"m",U).call(this,k,i),h(this,e,"m",O).call(this,g,Y))})):(g[T]=!N,this.validity[T]!==!N&&(ae=!0),!N&&!Y&&(Y=h(this,e,"m",U).call(this,k,i)))}),Promise.allSettled(z).then(()=>{var k;I?.signal.aborted||(v(this,E,!1,"f"),(k=h(this,y,"f"))===null||k===void 0||k.call(this))}),(ae||!j)&&h(this,e,"m",O).call(this,g,Y))},O=function(i,c){if(this.validationTarget)this.internals.setValidity(i,c,this.validationTarget),v(this,n,!1,"f");else{if(this.internals.setValidity(i,c),this.internals.validity.valid)return;v(this,n,!0,"f")}},U=function(i,c){if(this.validityCallback){let g=this.validityCallback(i.key||"customError");if(g)return g}return i.message instanceof Function?i.message(this,c):i.message},Ae}import{html as D,LitElement as Fe,nothing as Ne}from"lit";import{property as u,query as ir}from"lit/decorators.js";import{classMap as nr}from"lit/directives/class-map.js";import{ifDefined as x}from"lit/directives/if-defined.js";var Je=["en","nb","fi","da","sv"],oe="en",R=o=>Je.find(e=>o===e||o.toLowerCase().includes(e))||oe;function fe(){if(typeof window>"u"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return R(o)}try{let o=me(document);if(o)return R(o);let e=er();if(e)return R(e);let r=me(ye());return r?R(r):oe}catch(o){return console.warn("could not detect locale, falling back to source locale",o),oe}}var we=(o,e,r,t,a)=>{_.load("en",o),_.load("nb",e),_.load("fi",r),_.load("da",t),_.load("sv",a);let l=fe();_.activate(l),xe(),Qe()},Ke="warp-i18n-change";function xe(){typeof window>"u"||window.dispatchEvent(new Event(Ke))}var ve=!1;function Qe(){if(ve||typeof window>"u"||!document?.documentElement)return;ve=!0;let o=()=>{let a=fe();_.locale!==a&&(_.activate(a),xe())},e=new MutationObserver(a=>{for(let l of a)if(l.type==="attributes"&&l.attributeName==="lang"){o();break}});e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let r=ye();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=We();t&&e.observe(t,{attributes:!0,attributeFilter:["lang"]})}function ye(){try{return window.parent?.document??null}catch{return null}}function me(o){try{return o?.documentElement?.lang??""}catch{return""}}function We(){try{return window.frameElement??null}catch{return null}}function er(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}import{css as rr}from"lit";import{unsafeCSS as tr}from"lit";var ke=rr`
|
|
2
10
|
*,
|
|
3
11
|
:before,
|
|
4
12
|
:after {
|
|
@@ -271,7 +279,7 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var D=a=>{th
|
|
|
271
279
|
svg {
|
|
272
280
|
pointer-events: none;
|
|
273
281
|
}
|
|
274
|
-
`,
|
|
282
|
+
`,mr=tr(`*, :before, :after {
|
|
275
283
|
--w-rotate: 0;
|
|
276
284
|
--w-rotate-x: 0;
|
|
277
285
|
--w-rotate-y: 0;
|
|
@@ -2437,7 +2445,7 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var D=a=>{th
|
|
|
2437
2445
|
display: none
|
|
2438
2446
|
}
|
|
2439
2447
|
}
|
|
2440
|
-
`);import{css as
|
|
2448
|
+
`);var _e=JSON.parse('{"textfield.label.optional":["(valgfri)"]}');var ze=JSON.parse('{"textfield.label.optional":["(optional)"]}');var Ce=JSON.parse('{"textfield.label.optional":["(valinnainen)"]}');var Me=JSON.parse('{"textfield.label.optional":["(valgfritt)"]}');var Ee=JSON.parse('{"textfield.label.optional":["(valfritt)"]}');import{css as or}from"lit";var Se=or`
|
|
2441
2449
|
.w-textfield {
|
|
2442
2450
|
--_input-padding-top: 12px;
|
|
2443
2451
|
--_input-padding-left: 8px;
|
|
@@ -2497,49 +2505,128 @@ var ie=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var D=a=>{th
|
|
|
2497
2505
|
text-overflow: ellipsis;
|
|
2498
2506
|
z-index: 1;
|
|
2499
2507
|
}
|
|
2500
|
-
`;import{unsafeCSS as
|
|
2501
|
-
|
|
2502
|
-
|
|
2508
|
+
`;import{unsafeCSS as ar}from"lit";var Le=ar("*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.focus\\:\\[--w-outline-offset\\:-2px\\]:focus{--w-outline-offset:-2px}.bg-transparent{background-color:#0000}.border-1{border-width:1px}.rounded-4{border-radius:4px}.caret-current{caret-color:currentColor}.block{display:block}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.outline-\\[--w-s-color-border-negative\\]\\!{outline-color:var(--w-s-color-border-negative)!important}.relative{position:relative}.static{position:static}.s-bg{background-color:var(--w-s-color-background)}.s-bg-disabled-subtle{background-color:var(--w-s-color-background-disabled-subtle)}.s-text{color:var(--w-s-color-text)}.s-text-disabled{color:var(--w-s-color-text-disabled)}.s-text-negative{color:var(--w-s-color-text-negative)}.s-text-subtle{color:var(--w-s-color-text-subtle)}.placeholder\\:s-text-placeholder::placeholder{color:var(--w-s-color-text-placeholder)}.s-border-disabled{border-color:var(--w-s-color-border-disabled)}.s-border-negative{border-color:var(--w-s-color-border-negative)}.s-border-strong{border-color:var(--w-s-color-border-strong)}.hover\\:s-border-negative-hover:hover{border-color:var(--w-s-color-border-negative-hover)}.hover\\:s-border-strong-hover:hover{border-color:var(--w-s-color-border-strong-hover)}.active\\:s-border-selected:active{border-color:var(--w-s-color-border-selected)}.w-full{width:100%}.min-h-\\[42\\]{min-height:4.2rem}.mb-0{margin-bottom:0}.mt-4{margin-top:.4rem}.px-8{padding-left:.8rem;padding-right:.8rem}.py-12{padding-top:1.2rem;padding-bottom:1.2rem}.pb-4{padding-bottom:.4rem}.pl-0{padding-left:0}.pl-8{padding-left:.8rem}.pr-40{padding-right:4rem}.pl-\\[var\\(--w-prefix-width\\,_40px\\)\\]{padding-left:var(--w-prefix-width,40px)}.visible{visibility:visible}.cursor-pointer{cursor:pointer}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:grayscale}.font-bold{font-weight:700}.font-normal{font-weight:400}.pointer-events-none{pointer-events:none}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.text-m{font-size:var(--w-font-size-m);line-height:var(--w-line-height-m)}.text-s{font-size:var(--w-font-size-s);line-height:var(--w-line-height-s)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}.leading-m{line-height:var(--w-line-height-m)}@media (min-width:480px){.sm\\:min-h-\\[45\\]{min-height:4.5rem}}");import{css as $e}from"lit";var Ve=$e`
|
|
2509
|
+
/* Label component tokens with semantic fallbacks */
|
|
2510
|
+
label {
|
|
2511
|
+
/* Internal tokens - not part of public API */
|
|
2512
|
+
--_color: var(--w-c-input-label-color, var(--w-s-color-text));
|
|
2513
|
+
--_font-size: var(--w-c-input-label-font-size, var(--w-font-size-s));
|
|
2514
|
+
--_line-height: var(--w-c-input-label-line-height, var(--w-line-height-s));
|
|
2515
|
+
--_font-weight: var(--w-c-input-label-font-weight, 700);
|
|
2516
|
+
--_padding-bottom: var(--w-c-input-label-padding-bottom, 0.4rem);
|
|
2517
|
+
--_cursor: var(--w-c-input-label-cursor, pointer);
|
|
2518
|
+
--_display: var(--w-c-input-label-display, block);
|
|
2519
|
+
|
|
2520
|
+
/* Apply styles */
|
|
2521
|
+
display: var(--_display);
|
|
2522
|
+
position: relative;
|
|
2523
|
+
font-size: var(--_font-size);
|
|
2524
|
+
line-height: var(--_line-height);
|
|
2525
|
+
font-weight: var(--_font-weight);
|
|
2526
|
+
padding-bottom: var(--_padding-bottom);
|
|
2527
|
+
cursor: var(--_cursor);
|
|
2528
|
+
color: var(--_color);
|
|
2529
|
+
-webkit-font-smoothing: antialiased;
|
|
2530
|
+
-moz-osx-font-smoothing: grayscale;
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
/* Optional text styling */
|
|
2534
|
+
label span {
|
|
2535
|
+
--_padding-left: var(--w-c-input-optional-padding-left, 0.8rem);
|
|
2536
|
+
--_font-weight: var(--w-c-input-optional-font-weight, 400);
|
|
2537
|
+
--_font-size: var(--w-c-input-optional-font-size, var(--w-font-size-s));
|
|
2538
|
+
--_line-height: var(
|
|
2539
|
+
--w-c-input-optional-line-height,
|
|
2540
|
+
var(--w-line-height-s)
|
|
2541
|
+
);
|
|
2542
|
+
--_color: var(--w-c-input-optional-color, var(--w-s-color-text-subtle));
|
|
2543
|
+
|
|
2544
|
+
padding-left: var(--_padding-left);
|
|
2545
|
+
font-weight: var(--_font-weight);
|
|
2546
|
+
font-size: var(--_font-size);
|
|
2547
|
+
line-height: var(--_line-height);
|
|
2548
|
+
color: var(--_color);
|
|
2549
|
+
}
|
|
2550
|
+
`,Pe=$e`
|
|
2551
|
+
/* Help text component tokens with semantic fallbacks */
|
|
2552
|
+
:host {
|
|
2553
|
+
--_help-text-color: var(
|
|
2554
|
+
--w-c-input-help-text-color,
|
|
2555
|
+
var(--w-s-color-text-subtle)
|
|
2556
|
+
);
|
|
2557
|
+
--_help-text-font-size: var(
|
|
2558
|
+
--w-c-input-help-text-font-size,
|
|
2559
|
+
var(--w-font-size-xs)
|
|
2560
|
+
);
|
|
2561
|
+
--_help-text-line-height: var(
|
|
2562
|
+
--w-c-input-help-text-line-height,
|
|
2563
|
+
var(--w-line-height-xs)
|
|
2564
|
+
);
|
|
2565
|
+
--_help-text-margin-top: var(--w-c-input-help-text-margin-top, 0.4rem);
|
|
2566
|
+
--_help-text-display: var(--w-c-input-help-text-display, block);
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
/* Invalid state overrides color */
|
|
2570
|
+
:host([invalid]) {
|
|
2571
|
+
--_help-text-color: var(
|
|
2572
|
+
--w-c-input-help-text-color-invalid,
|
|
2573
|
+
var(--w-s-color-text-negative)
|
|
2574
|
+
);
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
.help-text {
|
|
2578
|
+
font-size: var(--_help-text-font-size);
|
|
2579
|
+
line-height: var(--_help-text-line-height);
|
|
2580
|
+
margin-top: var(--_help-text-margin-top);
|
|
2581
|
+
display: var(--_help-text-display);
|
|
2582
|
+
color: var(--_help-text-color);
|
|
2583
|
+
}
|
|
2584
|
+
`;var P={base:"block text-m leading-m mb-0 px-8 py-12 rounded-4 w-full focusable focus:[--w-outline-offset:-2px] caret-current",default:"border-1 s-text s-bg s-border-strong hover:s-border-strong-hover active:s-border-selected",disabled:"border-1 s-text-disabled s-bg-disabled-subtle s-border-disabled pointer-events-none",invalid:"border-1 s-text-negative s-bg s-border-negative hover:s-border-negative-hover outline-[--w-s-color-border-negative]!",readOnly:"pl-0 bg-transparent pointer-events-none",placeholder:"placeholder:s-text-placeholder",suffix:"pr-40",prefix:"pl-[var(--w-prefix-width,_40px)]",textArea:"min-h-[42] sm:min-h-[45]"},q,Oe,H,d=class extends ge(Fe){constructor(){super();J(this,q);this.disabled=!1;this.invalid=!1;this.optional=!1;this.readOnly=!1;this.readonly=!1;this.required=!1;this._hasPrefix=!1;this._hasSuffix=!1;J(this,H);we(ze,Me,Ce,_e,Ee)}updated(r){r.has("value")&&typeof this.value<"u"&&(this.setValue(this.value),this.formatter&&this.mask&&(this.mask.innerText=this.formatter(this.value)))}firstUpdated(){se(this,H,this.value)}resetFormControl(){this.value=ne(this,H)}get _inputstyles(){return K([P.base,this._hasSuffix&&P.suffix,this._hasPrefix&&P.prefix,!this.invalid&&!this.disabled&&!(this.readonly||this.readOnly)&&P.default,this.invalid&&!this.disabled&&!(this.readonly||this.readOnly)&&P.invalid,!this.invalid&&this.disabled&&!(this.readonly||this.readOnly)&&P.disabled,!this.invalid&&!this.disabled&&(this.readonly||this.readOnly)&&P.readOnly])}get _helptextstyles(){return"help-text"}get _label(){if(this.label)return D`<label for="${this._id}"
|
|
2585
|
+
>${this.label}${this.optional?D` <span>
|
|
2586
|
+
${_._({id:"textfield.label.optional",message:"(optional)",comment:"Shown behind label when marked as optional"})}
|
|
2587
|
+
</span>`:Ne}</label
|
|
2588
|
+
>`}get _helpId(){if(this.helpText)return`${this._id}__hint`}get _id(){return"textfield"}get _error(){if(this.invalid&&this._helpId)return this._helpId}handler(r){let{name:t,value:a}=r.currentTarget;this.value=a;let l=new CustomEvent(r.type,{detail:{name:t,value:a,target:r.target}});this.dispatchEvent(l)}prefixSlotChange(){this.renderRoot.querySelector("slot[name=prefix]").assignedElements().length&&(this._hasPrefix=!0)}suffixSlotChange(){this.renderRoot.querySelector("slot[name=suffix]").assignedElements().length&&(this._hasSuffix=!0)}render(){return D`
|
|
2503
2589
|
${this._label}
|
|
2504
2590
|
<div
|
|
2505
|
-
class="${
|
|
2591
|
+
class="${nr({"w-textfield":!0,"w-textfield--has-prefix":this._hasPrefix,"w-textfield--has-suffix":this._hasSuffix})}"
|
|
2506
2592
|
>
|
|
2507
2593
|
<div class="w-textfield__input-wrapper">
|
|
2508
|
-
${this.formatter?
|
|
2594
|
+
${this.formatter?D`<div class="w-textfield__mask"></div>`:Ne}
|
|
2509
2595
|
<input
|
|
2596
|
+
part="input"
|
|
2510
2597
|
class="${this._inputstyles}"
|
|
2511
2598
|
type="${this.type||"text"}"
|
|
2512
|
-
min="${
|
|
2513
|
-
max="${
|
|
2514
|
-
size="${
|
|
2515
|
-
minlength="${
|
|
2516
|
-
maxlength="${
|
|
2517
|
-
name="${
|
|
2518
|
-
pattern="${
|
|
2519
|
-
placeholder="${
|
|
2599
|
+
min="${x(this.min)}"
|
|
2600
|
+
max="${x(this.max)}"
|
|
2601
|
+
size="${x(this.size)}"
|
|
2602
|
+
minlength="${x(this.minLength||this.minlength)}"
|
|
2603
|
+
maxlength="${x(this.maxLength||this.maxlength)}"
|
|
2604
|
+
name="${x(this.name)}"
|
|
2605
|
+
pattern="${x(this.pattern)}"
|
|
2606
|
+
placeholder="${x(this.placeholder)}"
|
|
2520
2607
|
.value="${this.value||""}"
|
|
2521
|
-
aria-describedby="${
|
|
2522
|
-
aria-errormessage="${
|
|
2523
|
-
aria-invalid="${
|
|
2608
|
+
aria-describedby="${x(this._helpId||(this.ariaDescription?"aria-description":void 0))}"
|
|
2609
|
+
aria-errormessage="${x(this._error)}"
|
|
2610
|
+
aria-invalid="${x(this.invalid)}"
|
|
2524
2611
|
id="${this._id}"
|
|
2525
2612
|
?disabled="${this.disabled}"
|
|
2526
2613
|
?readonly="${this.readonly||this.readOnly}"
|
|
2527
2614
|
?required="${this.required}"
|
|
2528
|
-
autocomplete="${
|
|
2529
|
-
step="${
|
|
2615
|
+
autocomplete="${x(this.autocomplete)}"
|
|
2616
|
+
step="${x(this.step)}"
|
|
2530
2617
|
@blur="${this.handler}"
|
|
2531
2618
|
@change="${this.handler}"
|
|
2532
2619
|
@input="${this.handler}"
|
|
2533
2620
|
@focus="${this.handler}"
|
|
2534
|
-
@keydown="${
|
|
2621
|
+
@keydown="${le(this,q,Oe)}"
|
|
2535
2622
|
/>
|
|
2536
2623
|
</div>
|
|
2537
2624
|
<slot @slotchange="${this.prefixSlotChange}" name="prefix"></slot>
|
|
2538
2625
|
<slot @slotchange="${this.suffixSlotChange}" name="suffix"></slot>
|
|
2539
2626
|
</div>
|
|
2540
2627
|
<span class="sr-only" id="aria-description">${this.ariaDescription}</span>
|
|
2541
|
-
${this.helpText&&
|
|
2628
|
+
${this.helpText&&D`<div class="${this._helptextstyles}" id="${this._helpId}">
|
|
2542
2629
|
${this.helpText}
|
|
2543
2630
|
</div>`}
|
|
2544
|
-
`}};
|
|
2631
|
+
`}};q=new WeakSet,Oe=function(r){r.key==="Enter"&&this.internals.form&&this.internals.form.requestSubmit()},H=new WeakMap,d.shadowRootOptions={...Fe.shadowRootOptions,delegatesFocus:!0},d.styles=[ke,Le,Se,Ve,Pe],p([u({type:Boolean,reflect:!0})],d.prototype,"disabled",2),p([u({type:Boolean,reflect:!0})],d.prototype,"invalid",2),p([u({type:String,reflect:!0})],d.prototype,"label",2),p([u({type:String,reflect:!0,attribute:"help-text"})],d.prototype,"helpText",2),p([u({type:Boolean,reflect:!0})],d.prototype,"optional",2),p([u({type:String,reflect:!0})],d.prototype,"size",2),p([u({type:Number,reflect:!0})],d.prototype,"max",2),p([u({type:Number,reflect:!0})],d.prototype,"min",2),p([u({type:Number,reflect:!0,attribute:"min-length"})],d.prototype,"minLength",2),p([u({type:Number,reflect:!0})],d.prototype,"minlength",2),p([u({type:Number,reflect:!0,attribute:"max-length"})],d.prototype,"maxLength",2),p([u({type:Number,reflect:!0})],d.prototype,"maxlength",2),p([u({type:String,reflect:!0})],d.prototype,"pattern",2),p([u({type:String,reflect:!0})],d.prototype,"placeholder",2),p([u({type:Boolean,reflect:!0,attribute:"read-only"})],d.prototype,"readOnly",2),p([u({type:Boolean,reflect:!0})],d.prototype,"readonly",2),p([u({type:Boolean,reflect:!0})],d.prototype,"required",2),p([u({type:String,reflect:!0})],d.prototype,"type",2),p([u({type:String,reflect:!0})],d.prototype,"value",2),p([u({type:String,reflect:!0})],d.prototype,"name",2),p([u({type:Number,reflect:!0})],d.prototype,"step",2),p([u({type:String,reflect:!0})],d.prototype,"autocomplete",2),p([u({attribute:!1})],d.prototype,"formatter",2),p([ir(".w-textfield__mask")],d.prototype,"mask",2),p([u({type:Boolean})],d.prototype,"_hasPrefix",2),p([u({type:Boolean})],d.prototype,"_hasSuffix",2);customElements.get("w-textfield")||customElements.define("w-textfield",d);export{d as WarpTextField};
|
|
2545
2632
|
//# sourceMappingURL=textfield.js.map
|