@warp-ds/elements 2.10.0-next.13 → 2.10.0-next.15
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 +384 -0
- package/dist/docs/attention/api.md +48 -0
- package/dist/docs/attention/attention.md +48 -0
- package/dist/docs/button/api.md +8 -0
- package/dist/docs/button/button.md +8 -0
- package/dist/docs/card/api.md +8 -0
- package/dist/docs/card/card.md +8 -0
- package/dist/docs/checkbox/api.md +48 -0
- package/dist/docs/checkbox/checkbox.md +48 -0
- package/dist/docs/checkbox-group/api.md +24 -0
- package/dist/docs/checkbox-group/checkbox-group.md +24 -0
- package/dist/docs/combobox/api.md +8 -0
- package/dist/docs/combobox/combobox.md +8 -0
- package/dist/docs/datepicker/api.md +8 -0
- package/dist/docs/datepicker/datepicker.md +8 -0
- package/dist/docs/index.md +2 -0
- package/dist/docs/modal/api.md +16 -0
- package/dist/docs/modal/modal.md +16 -0
- package/dist/docs/slider-thumb/api.md +16 -0
- package/dist/docs/slider-thumb/slider-thumb.md +16 -0
- package/dist/docs/snackbar/accessibility.md +20 -0
- package/dist/docs/snackbar/api.md +30 -0
- package/dist/docs/snackbar/examples.md +191 -0
- package/dist/docs/snackbar/snackbar.md +385 -0
- package/dist/docs/snackbar/styling.md +72 -0
- package/dist/docs/snackbar/usage.md +60 -0
- package/dist/docs/snackbar-item/api.md +41 -0
- package/dist/docs/snackbar-item/snackbar-item.md +49 -0
- package/dist/docs/step/api.md +16 -0
- package/dist/docs/step/step.md +16 -0
- package/dist/docs/switch/api.md +8 -0
- package/dist/docs/switch/switch.md +8 -0
- package/dist/docs/textarea/api.md +40 -0
- package/dist/docs/textarea/textarea.md +40 -0
- package/dist/docs/textfield/api.md +32 -0
- package/dist/docs/textfield/textfield.md +32 -0
- package/dist/index.d.ts +292 -1
- package/dist/packages/affix/affix.js +4 -4
- package/dist/packages/affix/affix.js.map +2 -2
- package/dist/packages/alert/alert.js +2 -2
- package/dist/packages/alert/alert.js.map +2 -2
- package/dist/packages/attention/attention.d.ts +5 -0
- package/dist/packages/attention/attention.js +14 -14
- package/dist/packages/attention/attention.js.map +2 -2
- package/dist/packages/button/button.d.ts +5 -0
- package/dist/packages/button/button.js +3 -3
- package/dist/packages/button/button.js.map +2 -2
- package/dist/packages/button/button.react.stories.d.ts +2 -2
- package/dist/packages/button/button.test.js +0 -1
- package/dist/packages/button/react.d.ts +1 -1
- package/dist/packages/datepicker/DatePicker.test.js +5 -3
- package/dist/packages/datepicker/datepicker.js +49 -48
- package/dist/packages/datepicker/datepicker.js.map +3 -3
- package/dist/packages/datepicker/datepicker.test.js +1 -1
- package/dist/packages/datepicker/utils.d.ts +3 -0
- package/dist/packages/datepicker/utils.js +33 -0
- package/dist/packages/datepicker/utils.test.d.ts +1 -0
- package/dist/packages/datepicker/utils.test.js +29 -0
- package/dist/packages/expandable/expandable.js +9 -9
- package/dist/packages/expandable/expandable.js.map +4 -4
- package/dist/packages/global.d.ts +1 -0
- package/dist/packages/global.js +5 -0
- package/dist/packages/icon/icon.d.ts +5 -0
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +2 -2
- package/dist/packages/interaction-type-detection.d.ts +22 -0
- package/dist/packages/interaction-type-detection.js +38 -0
- package/dist/packages/modal/modal.js +1 -1
- package/dist/packages/modal/modal.js.map +2 -2
- package/dist/packages/modal-header/modal-header.js +3 -3
- package/dist/packages/modal-header/modal-header.js.map +2 -2
- package/dist/packages/pagination/pagination.js +1 -1
- package/dist/packages/pagination/pagination.js.map +2 -2
- package/dist/packages/pill/pill.js +4 -4
- package/dist/packages/pill/pill.js.map +2 -2
- package/dist/packages/select/select.js +3 -3
- package/dist/packages/select/select.js.map +2 -2
- package/dist/packages/snackbar/locales/da/messages.d.mts +1 -0
- package/dist/packages/snackbar/locales/da/messages.mjs +1 -0
- package/dist/packages/snackbar/locales/en/messages.d.mts +1 -0
- package/dist/packages/snackbar/locales/en/messages.mjs +1 -0
- package/dist/packages/snackbar/locales/fi/messages.d.mts +1 -0
- package/dist/packages/snackbar/locales/fi/messages.mjs +1 -0
- package/dist/packages/snackbar/locales/nb/messages.d.mts +1 -0
- package/dist/packages/snackbar/locales/nb/messages.mjs +1 -0
- package/dist/packages/snackbar/locales/sv/messages.d.mts +1 -0
- package/dist/packages/snackbar/locales/sv/messages.mjs +1 -0
- package/dist/packages/snackbar/react.d.ts +2 -0
- package/dist/packages/snackbar/react.js +11 -0
- package/dist/packages/snackbar/snackbar.d.ts +132 -0
- package/dist/packages/snackbar/snackbar.hydration.test.d.ts +1 -0
- package/dist/packages/snackbar/snackbar.hydration.test.js +13 -0
- package/dist/packages/snackbar/snackbar.js +2646 -0
- package/dist/packages/snackbar/snackbar.js.map +7 -0
- package/dist/packages/snackbar/snackbar.react.stories.d.ts +12 -0
- package/dist/packages/snackbar/snackbar.react.stories.js +160 -0
- package/dist/packages/snackbar/snackbar.stories.d.ts +20 -0
- package/dist/packages/snackbar/snackbar.stories.js +291 -0
- package/dist/packages/snackbar/snackbar.test.d.ts +4 -0
- package/dist/packages/snackbar/snackbar.test.js +17 -0
- package/dist/packages/snackbar/styles.d.ts +1 -0
- package/dist/packages/snackbar/styles.js +35 -0
- package/dist/packages/snackbar-item/react.d.ts +5 -0
- package/dist/packages/snackbar-item/react.js +15 -0
- package/dist/packages/snackbar-item/snackbar-item.d.ts +69 -0
- package/dist/packages/snackbar-item/snackbar-item.js +2601 -0
- package/dist/packages/snackbar-item/snackbar-item.js.map +7 -0
- package/dist/packages/snackbar-item/snackbar-item.react.test.d.ts +1 -0
- package/dist/packages/snackbar-item/snackbar-item.react.test.js +5 -0
- package/dist/packages/snackbar-item/styles.d.ts +1 -0
- package/dist/packages/snackbar-item/styles.js +111 -0
- package/dist/packages/step/step.js +9 -9
- package/dist/packages/step/step.js.map +2 -2
- package/dist/packages/tabs/tabs.react.stories.d.ts +4 -4
- package/dist/packages/tabs/tabs.react.stories.js +1 -1
- package/dist/packages/tabs/tabs.stories.d.ts +1 -1
- package/dist/packages/tabs/tabs.stories.js +1 -1
- package/dist/packages/toast/toast.js +6 -6
- package/dist/packages/toast/toast.js.map +4 -4
- package/dist/packages/utils/element-collapse.d.ts +12 -0
- package/dist/packages/utils/element-collapse.js +92 -0
- package/dist/packages/utils/expand-transition.js +1 -1
- package/dist/web-types.json +88 -3
- package/eik/index.js +12 -12
- package/package.json +1 -3
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ import type {
|
|
|
37
37
|
import type { WarpSelect } from "./packages/select/select.ts";
|
|
38
38
|
import type { WarpSliderThumb } from "./packages/slider-thumb/slider-thumb.ts";
|
|
39
39
|
import type { WarpSlider } from "./packages/slider/slider.ts";
|
|
40
|
+
import type { WarpSnackbarItem } from "./packages/snackbar-item/snackbar-item.ts";
|
|
41
|
+
import type { WarpSnackbar } from "./packages/snackbar/snackbar.ts";
|
|
40
42
|
import type { WarpStep } from "./packages/step/step.ts";
|
|
41
43
|
import type { WarpStepIndicator } from "./packages/step-indicator/step-indicator.ts";
|
|
42
44
|
import type { WarpSwitch } from "./packages/switch/switch.ts";
|
|
@@ -2000,6 +2002,38 @@ Use in open-ended sliders to show for example "300+ hk" instead of "Max" in the
|
|
|
2000
2002
|
textContent?: string | number;
|
|
2001
2003
|
};
|
|
2002
2004
|
|
|
2005
|
+
export type WarpSnackbarItemProps = {
|
|
2006
|
+
/** The placement of the action and close buttons. */
|
|
2007
|
+
"action-placement"?: WarpSnackbarItem["actionPlacement"];
|
|
2008
|
+
/** The placement of the action and close buttons. */
|
|
2009
|
+
actionPlacement?: WarpSnackbarItem["actionPlacement"];
|
|
2010
|
+
/** How long the message should stay in the document before removing itself. */
|
|
2011
|
+
duration?: WarpSnackbarItem["duration"];
|
|
2012
|
+
};
|
|
2013
|
+
|
|
2014
|
+
export type WarpSnackbarItemSolidJsProps = {
|
|
2015
|
+
/** The placement of the action and close buttons. */
|
|
2016
|
+
"attr:action-placement"?: WarpSnackbarItem["actionPlacement"];
|
|
2017
|
+
/** The placement of the action and close buttons. */
|
|
2018
|
+
"prop:actionPlacement"?: WarpSnackbarItem["actionPlacement"];
|
|
2019
|
+
/** How long the message should stay in the document before removing itself. */
|
|
2020
|
+
"prop:duration"?: WarpSnackbarItem["duration"];
|
|
2021
|
+
|
|
2022
|
+
/** Set the innerHTML of the element */
|
|
2023
|
+
innerHTML?: string;
|
|
2024
|
+
/** Set the textContent of the element */
|
|
2025
|
+
textContent?: string | number;
|
|
2026
|
+
};
|
|
2027
|
+
|
|
2028
|
+
export type WarpSnackbarProps = {};
|
|
2029
|
+
|
|
2030
|
+
export type WarpSnackbarSolidJsProps = {
|
|
2031
|
+
/** Set the innerHTML of the element */
|
|
2032
|
+
innerHTML?: string;
|
|
2033
|
+
/** Set the textContent of the element */
|
|
2034
|
+
textContent?: string | number;
|
|
2035
|
+
};
|
|
2036
|
+
|
|
2003
2037
|
export type WarpStepProps = {
|
|
2004
2038
|
/** Whether this step is active.
|
|
2005
2039
|
|
|
@@ -3114,6 +3148,112 @@ export type CustomElements = {
|
|
|
3114
3148
|
*/
|
|
3115
3149
|
"w-slider": Partial<WarpSliderProps & BaseProps<WarpSlider> & BaseEvents>;
|
|
3116
3150
|
|
|
3151
|
+
/**
|
|
3152
|
+
* An item to show in a `w-snackbar`.
|
|
3153
|
+
*
|
|
3154
|
+
* See the `create` function on `w-snackbar` for a convenience API which helps you make snackbar items.
|
|
3155
|
+
*
|
|
3156
|
+
* ## Attributes & Properties
|
|
3157
|
+
*
|
|
3158
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
3159
|
+
*
|
|
3160
|
+
* - `action-placement`/`actionPlacement`: The placement of the action and close buttons.
|
|
3161
|
+
* - `duration`: How long the message should stay in the document before removing itself.
|
|
3162
|
+
*
|
|
3163
|
+
* ## Slots
|
|
3164
|
+
*
|
|
3165
|
+
* Areas where markup can be added to the component.
|
|
3166
|
+
*
|
|
3167
|
+
* - `default`: the snackbar message.
|
|
3168
|
+
* - `icon`: icon preceeding the message.
|
|
3169
|
+
* - `action`: action following the message.
|
|
3170
|
+
*
|
|
3171
|
+
* ## Methods
|
|
3172
|
+
*
|
|
3173
|
+
* Methods that can be called to access component functionality.
|
|
3174
|
+
*
|
|
3175
|
+
* - `close() => void`: Remove the snackbar item from the document.
|
|
3176
|
+
*
|
|
3177
|
+
* Moves focus to the last focused element outside of the snackbar item, if available.
|
|
3178
|
+
*
|
|
3179
|
+
* ## CSS Custom Properties
|
|
3180
|
+
*
|
|
3181
|
+
* CSS variables available for styling the component.
|
|
3182
|
+
*
|
|
3183
|
+
* - `--w-c-snackbar-item-radius`: undefined (default: `undefined`)
|
|
3184
|
+
* - `--w-c-snackbar-item-max-width`: undefined (default: `undefined`)
|
|
3185
|
+
* - `--w-c-snackbar-item-min-width`: undefined (default: `undefined`)
|
|
3186
|
+
* - `--w-c-snackbar-item-padding`: undefined (default: `undefined`)
|
|
3187
|
+
* - `--w-c-snackbar-item-bg`: undefined (default: `undefined`)
|
|
3188
|
+
* - `--w-c-snackbar-item-action-bg-active`: undefined (default: `undefined`)
|
|
3189
|
+
* - `--w-c-snackbar-item-action-bg-hover`: undefined (default: `undefined`)
|
|
3190
|
+
* - `--w-c-snackbar-item-color`: undefined (default: `undefined`)
|
|
3191
|
+
* - `--w-c-snackbar-item-action-color-active`: undefined (default: `undefined`)
|
|
3192
|
+
* - `--w-c-snackbar-item-action-color-hover`: undefined (default: `undefined`)
|
|
3193
|
+
* - `--w-c-snackbar-item-box-shadow`: undefined (default: `undefined`)
|
|
3194
|
+
*
|
|
3195
|
+
* ## CSS Parts
|
|
3196
|
+
*
|
|
3197
|
+
* Custom selectors for styling elements within the component.
|
|
3198
|
+
*
|
|
3199
|
+
* - `item`: the container wrapping the message, icon and actions.
|
|
3200
|
+
* - `icon`: the icon for the variant.
|
|
3201
|
+
* - `message`: the default slot, body of the snackbar item.
|
|
3202
|
+
* - `action`: close and action button.
|
|
3203
|
+
*/
|
|
3204
|
+
"w-snackbar-item": Partial<
|
|
3205
|
+
WarpSnackbarItemProps & BaseProps<WarpSnackbarItem> & BaseEvents
|
|
3206
|
+
>;
|
|
3207
|
+
|
|
3208
|
+
/**
|
|
3209
|
+
* A Snackbar shows brief user feedback messages that overlay content, with an optional action such as Undo.
|
|
3210
|
+
*
|
|
3211
|
+
* Include one `<w-snackbar></w-snackbar>` in the document `<body>`. Use the `create` function to create messages.
|
|
3212
|
+
*
|
|
3213
|
+
* ## Slots
|
|
3214
|
+
*
|
|
3215
|
+
* Areas where markup can be added to the component.
|
|
3216
|
+
*
|
|
3217
|
+
* - `default`: `w-snackbar-item` gets placed inside the default slot by the `create` function.
|
|
3218
|
+
*
|
|
3219
|
+
* ## Methods
|
|
3220
|
+
*
|
|
3221
|
+
* Methods that can be called to access component functionality.
|
|
3222
|
+
*
|
|
3223
|
+
* - `create(message: string, options: CreateSnackbarOptions = {}) => void`: Creates a snackbar item and immediately adds it to the snackbar.
|
|
3224
|
+
*
|
|
3225
|
+
* By default the snackbar item automatically closes after 4 seconds (`SnackbarDuration.Short`).
|
|
3226
|
+
*
|
|
3227
|
+
* If you include an `action` in the options the default `duration` is
|
|
3228
|
+
* set to 10 seconds (`SnackbarDuration.Long`) and can not be made shorter.
|
|
3229
|
+
*
|
|
3230
|
+
* A `duration` of 10 seconds or longer forces the close button to be visible.
|
|
3231
|
+
*
|
|
3232
|
+
* The default `variant` is `neutral` which does not have an icon.
|
|
3233
|
+
*
|
|
3234
|
+
* Set `duration` to `SnackbarDuration.Infinite` if you want a persistent message.
|
|
3235
|
+
*
|
|
3236
|
+
* ## CSS Custom Properties
|
|
3237
|
+
*
|
|
3238
|
+
* CSS variables available for styling the component.
|
|
3239
|
+
*
|
|
3240
|
+
* - `--w-c-snackbar-container-gap`: undefined (default: `undefined`)
|
|
3241
|
+
* - `--w-c-snackbar-position-bottom`: undefined (default: `undefined`)
|
|
3242
|
+
* - `--w-c-snackbar-position-left`: undefined (default: `undefined`)
|
|
3243
|
+
* - `--w-c-snackbar-position-right`: undefined (default: `undefined`)
|
|
3244
|
+
* - `--w-c-snackbar-position-top`: undefined (default: `undefined`)
|
|
3245
|
+
* - `--w-c-snackbar-z-index`: undefined (default: `undefined`)
|
|
3246
|
+
*
|
|
3247
|
+
* ## CSS Parts
|
|
3248
|
+
*
|
|
3249
|
+
* Custom selectors for styling elements within the component.
|
|
3250
|
+
*
|
|
3251
|
+
* - `container`: the live region that positions messages on the screen.
|
|
3252
|
+
*/
|
|
3253
|
+
"w-snackbar": Partial<
|
|
3254
|
+
WarpSnackbarProps & BaseProps<WarpSnackbar> & BaseEvents
|
|
3255
|
+
>;
|
|
3256
|
+
|
|
3117
3257
|
/**
|
|
3118
3258
|
* Individual step component that shows a single step in a process
|
|
3119
3259
|
*
|
|
@@ -3323,6 +3463,8 @@ type CustomElementInstances = {
|
|
|
3323
3463
|
"w-select": WarpSelect;
|
|
3324
3464
|
"w-slider-thumb": WarpSliderThumb;
|
|
3325
3465
|
"w-slider": WarpSlider;
|
|
3466
|
+
"w-snackbar-item": WarpSnackbarItem;
|
|
3467
|
+
"w-snackbar": WarpSnackbar;
|
|
3326
3468
|
"w-step": WarpStep;
|
|
3327
3469
|
"w-step-indicator": WarpStepIndicator;
|
|
3328
3470
|
"w-switch": WarpSwitch;
|
|
@@ -3360,6 +3502,8 @@ type CustomElementComponentProps = {
|
|
|
3360
3502
|
"w-select": WarpSelectProps;
|
|
3361
3503
|
"w-slider-thumb": WarpSliderThumbProps;
|
|
3362
3504
|
"w-slider": WarpSliderProps;
|
|
3505
|
+
"w-snackbar-item": WarpSnackbarItemProps;
|
|
3506
|
+
"w-snackbar": WarpSnackbarProps;
|
|
3363
3507
|
"w-step": WarpStepProps;
|
|
3364
3508
|
"w-step-indicator": WarpStepIndicatorProps;
|
|
3365
3509
|
"w-switch": WarpSwitchProps;
|
|
@@ -4319,6 +4463,118 @@ export type CustomElementsSolidJs = {
|
|
|
4319
4463
|
BaseEvents
|
|
4320
4464
|
>;
|
|
4321
4465
|
|
|
4466
|
+
/**
|
|
4467
|
+
* An item to show in a `w-snackbar`.
|
|
4468
|
+
*
|
|
4469
|
+
* See the `create` function on `w-snackbar` for a convenience API which helps you make snackbar items.
|
|
4470
|
+
*
|
|
4471
|
+
* ## Attributes & Properties
|
|
4472
|
+
*
|
|
4473
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
4474
|
+
*
|
|
4475
|
+
* - `action-placement`/`actionPlacement`: The placement of the action and close buttons.
|
|
4476
|
+
* - `duration`: How long the message should stay in the document before removing itself.
|
|
4477
|
+
*
|
|
4478
|
+
* ## Slots
|
|
4479
|
+
*
|
|
4480
|
+
* Areas where markup can be added to the component.
|
|
4481
|
+
*
|
|
4482
|
+
* - `default`: the snackbar message.
|
|
4483
|
+
* - `icon`: icon preceeding the message.
|
|
4484
|
+
* - `action`: action following the message.
|
|
4485
|
+
*
|
|
4486
|
+
* ## Methods
|
|
4487
|
+
*
|
|
4488
|
+
* Methods that can be called to access component functionality.
|
|
4489
|
+
*
|
|
4490
|
+
* - `close() => void`: Remove the snackbar item from the document.
|
|
4491
|
+
*
|
|
4492
|
+
* Moves focus to the last focused element outside of the snackbar item, if available.
|
|
4493
|
+
*
|
|
4494
|
+
* ## CSS Custom Properties
|
|
4495
|
+
*
|
|
4496
|
+
* CSS variables available for styling the component.
|
|
4497
|
+
*
|
|
4498
|
+
* - `--w-c-snackbar-item-radius`: undefined (default: `undefined`)
|
|
4499
|
+
* - `--w-c-snackbar-item-max-width`: undefined (default: `undefined`)
|
|
4500
|
+
* - `--w-c-snackbar-item-min-width`: undefined (default: `undefined`)
|
|
4501
|
+
* - `--w-c-snackbar-item-padding`: undefined (default: `undefined`)
|
|
4502
|
+
* - `--w-c-snackbar-item-bg`: undefined (default: `undefined`)
|
|
4503
|
+
* - `--w-c-snackbar-item-action-bg-active`: undefined (default: `undefined`)
|
|
4504
|
+
* - `--w-c-snackbar-item-action-bg-hover`: undefined (default: `undefined`)
|
|
4505
|
+
* - `--w-c-snackbar-item-color`: undefined (default: `undefined`)
|
|
4506
|
+
* - `--w-c-snackbar-item-action-color-active`: undefined (default: `undefined`)
|
|
4507
|
+
* - `--w-c-snackbar-item-action-color-hover`: undefined (default: `undefined`)
|
|
4508
|
+
* - `--w-c-snackbar-item-box-shadow`: undefined (default: `undefined`)
|
|
4509
|
+
*
|
|
4510
|
+
* ## CSS Parts
|
|
4511
|
+
*
|
|
4512
|
+
* Custom selectors for styling elements within the component.
|
|
4513
|
+
*
|
|
4514
|
+
* - `item`: the container wrapping the message, icon and actions.
|
|
4515
|
+
* - `icon`: the icon for the variant.
|
|
4516
|
+
* - `message`: the default slot, body of the snackbar item.
|
|
4517
|
+
* - `action`: close and action button.
|
|
4518
|
+
*/
|
|
4519
|
+
"w-snackbar-item": Partial<
|
|
4520
|
+
WarpSnackbarItemProps &
|
|
4521
|
+
WarpSnackbarItemSolidJsProps &
|
|
4522
|
+
BaseProps<WarpSnackbarItem> &
|
|
4523
|
+
BaseEvents
|
|
4524
|
+
>;
|
|
4525
|
+
|
|
4526
|
+
/**
|
|
4527
|
+
* A Snackbar shows brief user feedback messages that overlay content, with an optional action such as Undo.
|
|
4528
|
+
*
|
|
4529
|
+
* Include one `<w-snackbar></w-snackbar>` in the document `<body>`. Use the `create` function to create messages.
|
|
4530
|
+
*
|
|
4531
|
+
* ## Slots
|
|
4532
|
+
*
|
|
4533
|
+
* Areas where markup can be added to the component.
|
|
4534
|
+
*
|
|
4535
|
+
* - `default`: `w-snackbar-item` gets placed inside the default slot by the `create` function.
|
|
4536
|
+
*
|
|
4537
|
+
* ## Methods
|
|
4538
|
+
*
|
|
4539
|
+
* Methods that can be called to access component functionality.
|
|
4540
|
+
*
|
|
4541
|
+
* - `create(message: string, options: CreateSnackbarOptions = {}) => void`: Creates a snackbar item and immediately adds it to the snackbar.
|
|
4542
|
+
*
|
|
4543
|
+
* By default the snackbar item automatically closes after 4 seconds (`SnackbarDuration.Short`).
|
|
4544
|
+
*
|
|
4545
|
+
* If you include an `action` in the options the default `duration` is
|
|
4546
|
+
* set to 10 seconds (`SnackbarDuration.Long`) and can not be made shorter.
|
|
4547
|
+
*
|
|
4548
|
+
* A `duration` of 10 seconds or longer forces the close button to be visible.
|
|
4549
|
+
*
|
|
4550
|
+
* The default `variant` is `neutral` which does not have an icon.
|
|
4551
|
+
*
|
|
4552
|
+
* Set `duration` to `SnackbarDuration.Infinite` if you want a persistent message.
|
|
4553
|
+
*
|
|
4554
|
+
* ## CSS Custom Properties
|
|
4555
|
+
*
|
|
4556
|
+
* CSS variables available for styling the component.
|
|
4557
|
+
*
|
|
4558
|
+
* - `--w-c-snackbar-container-gap`: undefined (default: `undefined`)
|
|
4559
|
+
* - `--w-c-snackbar-position-bottom`: undefined (default: `undefined`)
|
|
4560
|
+
* - `--w-c-snackbar-position-left`: undefined (default: `undefined`)
|
|
4561
|
+
* - `--w-c-snackbar-position-right`: undefined (default: `undefined`)
|
|
4562
|
+
* - `--w-c-snackbar-position-top`: undefined (default: `undefined`)
|
|
4563
|
+
* - `--w-c-snackbar-z-index`: undefined (default: `undefined`)
|
|
4564
|
+
*
|
|
4565
|
+
* ## CSS Parts
|
|
4566
|
+
*
|
|
4567
|
+
* Custom selectors for styling elements within the component.
|
|
4568
|
+
*
|
|
4569
|
+
* - `container`: the live region that positions messages on the screen.
|
|
4570
|
+
*/
|
|
4571
|
+
"w-snackbar": Partial<
|
|
4572
|
+
WarpSnackbarProps &
|
|
4573
|
+
WarpSnackbarSolidJsProps &
|
|
4574
|
+
BaseProps<WarpSnackbar> &
|
|
4575
|
+
BaseEvents
|
|
4576
|
+
>;
|
|
4577
|
+
|
|
4322
4578
|
/**
|
|
4323
4579
|
* Individual step component that shows a single step in a process
|
|
4324
4580
|
*
|
|
@@ -4500,7 +4756,42 @@ export type CustomElementsSolidJs = {
|
|
|
4500
4756
|
>;
|
|
4501
4757
|
};
|
|
4502
4758
|
|
|
4503
|
-
export type CustomCssProperties = {
|
|
4759
|
+
export type CustomCssProperties = {
|
|
4760
|
+
/** */
|
|
4761
|
+
"--w-c-snackbar-item-radius"?: string;
|
|
4762
|
+
/** */
|
|
4763
|
+
"--w-c-snackbar-item-max-width"?: string;
|
|
4764
|
+
/** */
|
|
4765
|
+
"--w-c-snackbar-item-min-width"?: string;
|
|
4766
|
+
/** */
|
|
4767
|
+
"--w-c-snackbar-item-padding"?: string;
|
|
4768
|
+
/** */
|
|
4769
|
+
"--w-c-snackbar-item-bg"?: string;
|
|
4770
|
+
/** */
|
|
4771
|
+
"--w-c-snackbar-item-action-bg-active"?: string;
|
|
4772
|
+
/** */
|
|
4773
|
+
"--w-c-snackbar-item-action-bg-hover"?: string;
|
|
4774
|
+
/** */
|
|
4775
|
+
"--w-c-snackbar-item-color"?: string;
|
|
4776
|
+
/** */
|
|
4777
|
+
"--w-c-snackbar-item-action-color-active"?: string;
|
|
4778
|
+
/** */
|
|
4779
|
+
"--w-c-snackbar-item-action-color-hover"?: string;
|
|
4780
|
+
/** */
|
|
4781
|
+
"--w-c-snackbar-item-box-shadow"?: string;
|
|
4782
|
+
/** */
|
|
4783
|
+
"--w-c-snackbar-container-gap"?: string;
|
|
4784
|
+
/** */
|
|
4785
|
+
"--w-c-snackbar-position-bottom"?: string;
|
|
4786
|
+
/** */
|
|
4787
|
+
"--w-c-snackbar-position-left"?: string;
|
|
4788
|
+
/** */
|
|
4789
|
+
"--w-c-snackbar-position-right"?: string;
|
|
4790
|
+
/** */
|
|
4791
|
+
"--w-c-snackbar-position-top"?: string;
|
|
4792
|
+
/** */
|
|
4793
|
+
"--w-c-snackbar-z-index"?: string;
|
|
4794
|
+
};
|
|
4504
4795
|
|
|
4505
4796
|
declare module "react" {
|
|
4506
4797
|
namespace JSX {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var me=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var w=(t,e,r,o)=>{for(var a=o>1?void 0:o?ve(e,r):e,d=t.length-1,s;d>=0;d--)(s=t[d])&&(a=(o?s(e,r,a):s(a))||a);return o&&a&&me(e,r,a),a};var B=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?B.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var F=t=>typeof t=="string",fe=t=>typeof t=="function",te=new Map,ie="en";function
|
|
1
|
+
var me=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var w=(t,e,r,o)=>{for(var a=o>1?void 0:o?ve(e,r):e,d=t.length-1,s;d>=0;d--)(s=t[d])&&(a=(o?s(e,r,a):s(a))||a);return o&&a&&me(e,r,a),a};var B=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return t.reduce(function(r,o){return r.concat(typeof o=="string"?o:Array.isArray(o)?B.apply(void 0,o):typeof o=="object"&&o?Object.keys(o).map(function(a){return o[a]?a:""}):"")},[]).join(" ")};var F=t=>typeof t=="string",fe=t=>typeof t=="function",te=new Map,ie="en";function q(t){return[...Array.isArray(t)?t:[t],ie]}function K(t,e,r){let o=q(t);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 N(()=>O("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(F(e)?new Date(e):e)}function we(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return K(t,e,o)}function G(t,e,r){let o=q(t);return N(()=>O("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function ae(t,e,r,{offset:o=0,...a}){let d=q(t),s=e?N(()=>O("plural-ordinal",d),()=>new Intl.PluralRules(d,{type:"ordinal"})):N(()=>O("plural-cardinal",d),()=>new Intl.PluralRules(d,{type:"cardinal"}));return a[r]??a[s.select(r-o)]??a.other}function N(t,e){let r=t(),o=te.get(r);return o||(o=e(),te.set(r,o)),o}function O(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var ne=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,se=t=>t.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,o)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(o,16);return String.fromCharCode(a)}}),le="%__lingui_octothorpe__%",xe=(t,e,r={})=>{let o=e||t,a=s=>typeof s=="object"?s:r[s],d=(s,n)=>{let b=Object.keys(r).length?a("number"):void 0,g=G(o,s,b);return n.replace(new RegExp(le,"g"),g)};return{plural:(s,n)=>{let{offset:b=0}=n,g=ae(o,!1,s,n);return d(s-b,g)},selectordinal:(s,n)=>{let{offset:b=0}=n,g=ae(o,!0,s,n);return d(s-b,g)},select:ke,number:(s,n)=>G(o,s,a(n)||{style:n}),date:(s,n)=>K(o,s,a(n)||n),time:(s,n)=>we(o,s,a(n)||n)}},ke=(t,e)=>e[t]??e.other;function ye(t,e,r){return(o={},a)=>{let d=xe(e,r,a),s=(b,g=!1)=>Array.isArray(b)?b.reduce((y,_)=>{if(_==="#"&&g)return y+le;if(F(_))return y+_;let[P,v,z]=_,C={};v==="plural"||v==="selectordinal"||v==="select"?Object.entries(z).forEach(([M,T])=>{C[M]=s(T,v==="plural"||v==="selectordinal")}):C=z;let m;if(v){let M=d[v];m=M(o[P],C)}else m=o[P];return m==null?y:y+m},""):b,n=s(t);return F(n)&&ne.test(n)?se(n):F(n)?n:n?String(n):""}}var _e=Object.defineProperty,ze=(t,e,r)=>e in t?_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ce=(t,e,r)=>(ze(t,typeof e!="symbol"?e+"":e,r),r),U=class{constructor(){Ce(this,"_events",{})}on(e,r){var o;return(o=this._events)[e]??(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},Fe=Object.defineProperty,Ee=(t,e,r)=>e in t?Fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e,r)=>(Ee(t,typeof e!="symbol"?e+"":e,r),r),H=class extends U{constructor(e){super(),L(this,"_locale",""),L(this,"_locales"),L(this,"_localeData",{}),L(this,"_messages",{}),L(this,"_missing"),L(this,"_messageCompiler"),L(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??ie,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 o=this._localeData[e];o?Object.assign(o,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(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){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=o?.message;e||(e=""),F(e)||(r=e.values||r,a=e.message,e=e.id);let d=this.messages[e],s=d===void 0,n=this._missing;if(n&&s)return fe(n)?n(this._locale,e):n;s&&this.emit("missing",{id:e,locale:this._locale});let b=d||a||e;return F(b)&&(this._messageCompiler?b=this._messageCompiler(b):console.warn(`Uncompiled message detected! Message:
|
|
2
2
|
|
|
3
3
|
> ${b}
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
6
6
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
7
7
|
|
|
8
8
|
Please compile your catalog first.
|
|
9
|
-
`)),F(b)&&ne.test(b)?se(b):F(b)?b:ye(b,this._locale,this._locales)(r,o?.formats)}date(e,r){return K(this._locales||this._locale,e,r)}number(e,r){return G(this._locales||this._locale,e,r)}};function Me(t={}){return new
|
|
9
|
+
`)),F(b)&&ne.test(b)?se(b):F(b)?b:ye(b,this._locale,this._locales)(r,o?.formats)}date(e,r){return K(this._locales||this._locale,e,r)}number(e,r){return G(this._locales||this._locale,e,r)}};function Me(t={}){return new H(t)}var J=Me();import{html as Y,LitElement as Re}from"lit";import{property as A}from"lit/decorators.js";var c=function(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)},h=function(t,e,r,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r};function ce(t){var e,r,o,a,d,s,n,b,g,y,_,P,v,z,C,m,M,T,W;class ge extends t{constructor(...i){var l,u,p;super(...i),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),o.set(this,!1),a.set(this,!1),d.set(this,void 0),s.set(this,void 0),n.set(this,!0),g.set(this,""),y.set(this,()=>{h(this,a,!0,"f"),h(this,r,!0,"f"),c(this,e,"m",m).call(this)}),_.set(this,()=>{h(this,r,!1,"f"),c(this,e,"m",M).call(this,this.shouldFormValueUpdate()?c(this,g,"f"):""),!this.validity.valid&&c(this,a,"f")&&h(this,o,!0,"f");let x=c(this,e,"m",m).call(this);this.validationMessageCallback&&this.validationMessageCallback(x?this.internals.validationMessage:"")}),P.set(this,()=>{var x;c(this,n,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),h(this,n,!1,"f")),h(this,a,!0,"f"),h(this,o,!0,"f"),c(this,e,"m",m).call(this),(x=this===null||this===void 0?void 0:this.validationMessageCallback)===null||x===void 0||x.call(this,this.showError?this.internals.validationMessage:"")}),v.set(this,void 0),z.set(this,!1),C.set(this,Promise.resolve()),(l=this.addEventListener)===null||l===void 0||l.call(this,"focus",c(this,y,"f")),(u=this.addEventListener)===null||u===void 0||u.call(this,"blur",c(this,_,"f")),(p=this.addEventListener)===null||p===void 0||p.call(this,"invalid",c(this,P,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let i=this.validators.map(p=>p.attribute).flat(),l=super.observedAttributes||[];return[...new Set([...l,...i])]}static getValidator(i){return this.validators.find(l=>l.attribute===i)||null}static getValidators(i){return this.validators.filter(l=>{var u;if(l.attribute===i||!((u=l.attribute)===null||u===void 0)&&u.includes(i))return!0})}get form(){return this.internals.form}get showError(){return c(this,e,"m",m).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(i,l,u){var p;(p=super.attributeChangedCallback)===null||p===void 0||p.call(this,i,l,u);let $=this.constructor.getValidators(i);$?.length&&this.validationTarget&&this.setValue(c(this,g,"f"))}setValue(i){var l;h(this,o,!1,"f"),(l=this.validationMessageCallback)===null||l===void 0||l.call(this,""),h(this,g,i,"f");let p=this.shouldFormValueUpdate()?i:null;this.internals.setFormValue(p),c(this,e,"m",M).call(this,p),this.valueChangedCallback&&this.valueChangedCallback(p),c(this,e,"m",m).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(i=>i(c(this,C,"f")))}formResetCallback(){var i,l;h(this,a,!1,"f"),h(this,o,!1,"f"),c(this,e,"m",m).call(this),(i=this.resetFormControl)===null||i===void 0||i.call(this),(l=this.validationMessageCallback)===null||l===void 0||l.call(this,c(this,e,"m",m).call(this)?this.validationMessage:"")}}return r=new WeakMap,o=new WeakMap,a=new WeakMap,d=new WeakMap,s=new WeakMap,n=new WeakMap,g=new WeakMap,y=new WeakMap,_=new WeakMap,P=new WeakMap,v=new WeakMap,z=new WeakMap,C=new WeakMap,e=new WeakSet,b=function(){let i=this.getRootNode(),l=`${this.localName}[name="${this.getAttribute("name")}"]`;return i.querySelectorAll(l)},m=function(){if(this.hasAttribute("disabled"))return!1;let i=c(this,o,"f")||c(this,a,"f")&&!this.validity.valid&&!c(this,r,"f");return i&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),i},M=function(i){let l=this.constructor,u={},p=l.validators,x=[],$=p.some(f=>f.isValid instanceof Promise);c(this,z,"f")||(h(this,C,new Promise(f=>{h(this,v,f,"f")}),"f"),h(this,z,!0,"f")),c(this,d,"f")&&(c(this,d,"f").abort(),h(this,s,c(this,d,"f"),"f"));let j=new AbortController;h(this,d,j,"f");let D,oe=!1;p.length&&(p.forEach(f=>{let X=f.key||"customError",S=f.isValid(this,i,j.signal);S instanceof Promise?(x.push(S),S.then(Z=>{Z!=null&&(u[X]=!Z,D=c(this,e,"m",W).call(this,f,i),c(this,e,"m",T).call(this,u,D))})):(u[X]=!S,this.validity[X]!==!S&&(oe=!0),!S&&!D&&(D=c(this,e,"m",W).call(this,f,i)))}),Promise.allSettled(x).then(()=>{var f;j?.signal.aborted||(h(this,z,!1,"f"),(f=c(this,v,"f"))===null||f===void 0||f.call(this))}),(oe||!$)&&c(this,e,"m",T).call(this,u,D))},T=function(i,l){if(this.validationTarget)this.internals.setValidity(i,l,this.validationTarget),h(this,n,!1,"f");else{if(this.internals.setValidity(i,l),this.internals.validity.valid)return;h(this,n,!0,"f")}},W=function(i,l){if(this.validityCallback){let u=this.validityCallback(i.key||"customError");if(u)return u}return i.message instanceof Function?i.message(this,l):i.message},ge}import{css as Le}from"lit";import{unsafeCSS as Pe}from"lit";var de=Le`
|
|
10
10
|
*,
|
|
11
11
|
:before,
|
|
12
12
|
:after {
|
|
@@ -2445,7 +2445,7 @@ Please compile your catalog first.
|
|
|
2445
2445
|
display: none
|
|
2446
2446
|
}
|
|
2447
2447
|
}
|
|
2448
|
-
`);import{unsafeCSS as Se}from"lit";var be=Se("*,: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}.rounded-4{border-radius:4px}.block{display:block}.flex{display:flex}.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}.items-center{align-items:center}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.justify-center{justify-content:center}.absolute{position:absolute}.relative{position:relative}.static{position:static}.s-text{color:var(--w-s-color-text)}.w-40{width:4rem}.w-max{width:max-content}.pb-0{padding-bottom:0}.pl-12{padding-left:1.2rem}.pr-12{padding-right:1.2rem}.cursor-default{cursor:default}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:grayscale}.font-bold{font-weight:700}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}");import{html as
|
|
2448
|
+
`);import{unsafeCSS as Se}from"lit";var be=Se("*,: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}.rounded-4{border-radius:4px}.block{display:block}.flex{display:flex}.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}.items-center{align-items:center}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.justify-center{justify-content:center}.absolute{position:absolute}.relative{position:relative}.static{position:static}.s-text{color:var(--w-s-color-text)}.w-40{width:4rem}.w-max{width:max-content}.pb-0{padding-bottom:0}.pl-12{padding-left:1.2rem}.pr-12{padding-right:1.2rem}.cursor-default{cursor:default}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-smoothing:grayscale}.font-bold{font-weight:700}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}");import{html as Ve,LitElement as $e}from"lit";import{property as Q,state as je}from"lit/decorators.js";import{classMap as De}from"lit/directives/class-map.js";import{css as Te}from"lit";var ue=Te`
|
|
2449
2449
|
:host {
|
|
2450
2450
|
display: inline-block;
|
|
2451
2451
|
}
|
|
@@ -2470,7 +2470,7 @@ Please compile your catalog first.
|
|
|
2470
2470
|
--w-icon-size: 32px;
|
|
2471
2471
|
}
|
|
2472
2472
|
|
|
2473
|
-
`;var ee=new Map,Ye='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function Ae(t,e={}){let r=e.responseParser??(o=>o.text());return ee.has(t)||ee.set(t,fetch(t).then(r)),ee.get(t)}var E=class extends $e{constructor(){super(...arguments);this.locale=document.documentElement.lang||"en";this.svg=null}async fetchIcon(r){let o=`https://assets.finn.no/pkg/eikons
|
|
2473
|
+
`;var ee=new Map,Ye='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function Ae(t,e={}){let r=e.responseParser??(o=>o.text());return ee.has(t)||ee.set(t,fetch(t).then(r)),ee.get(t)}var E=class extends $e{constructor(){super(...arguments);this.locale=document.documentElement.lang||"en";this.svg=null}async fetchIcon(r){let o=`https://assets.finn.no/pkg/eikons/~1/${this.locale}/${r}.svg`;try{let a=await Ae(o);return new DOMParser().parseFromString(a,"text/html").body.querySelector("svg")}catch{return null}}firstUpdated(){this.loadIcon()}updated(r){(r.has("name")||r.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let r=await this.fetchIcon(this.name);r||(r=new DOMParser().parseFromString(Ye,"text/html").body.firstElementChild),this.svg=r}render(){let r=this.size||"medium",o=this.name||"",a={"w-icon":!0,"w-icon--s":r==="small","w-icon--m":r==="medium","w-icon--l":r==="large"},d=typeof r=="string"&&r.endsWith("px")?`--w-icon-size: ${r};`:"";return Ve`<div class="${De(a)}" style="${d}" part="w-${o.toLowerCase()}">${this.svg}</div>`}};E.styles=[ue],w([Q({type:String,reflect:!0})],E.prototype,"name",2),w([Q({type:String,reflect:!0})],E.prototype,"size",2),w([Q({type:String,reflect:!0,useDefault:!0})],E.prototype,"locale",2),w([je()],E.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",E);var Ne=["en","nb","fi","da","sv"],re="en",I=t=>Ne.find(e=>t===e||t.toLowerCase().includes(e))||re;function R(){if(typeof window>"u"){let t=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return I(t)}try{let t=he(document);if(t)return I(t);let e=Ie();if(e)return I(e);let r=he(Oe());return r?I(r):re}catch(t){return console.warn("could not detect locale, falling back to source locale",t),re}}function Oe(){try{return window.parent?.document??null}catch{return null}}function he(t){try{return t?.documentElement?.lang??""}catch{return""}}function Ie(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}var pe="absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ",We={wrapper:pe+"right-0",wrapperWithLabel:"w-max pr-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs s-text"},Xe={wrapper:pe+"left-0",wrapperWithLabel:"w-max pl-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs s-text"},k=class extends ce(Re){constructor(){super(...arguments);this.ariaLabel=null;this.clear=!1;this.search=!1;this.label="";this.icon=null}get _classBase(){return this.slot==="suffix"?We:Xe}get _classes(){return B([this._classBase.wrapper,this.label?this._classBase.wrapperWithLabel:this._classBase.wrapperWithIcon])}resetContainingTextField(r){let o=this.closest("w-textfield");o&&o.resetFormControl(),r.stopPropagation()}submitContainingForm(r){let o=this.internals.form;o&&o.submit(),r.stopPropagation()}get _searchButton(){let r=this.ariaLabel||J._({id:"affix.aria.search",message:"Search",comment:"Aria label for the search button in affix"});return Y`
|
|
2474
2474
|
<button aria-label="${r}" class="${this._classes}" type="submit" @click="${this.submitContainingForm.bind(this)}">
|
|
2475
2475
|
<w-icon name="Search" size="small" locale="${R()}" class="flex"></w-icon>
|
|
2476
2476
|
</button>
|