@warp-ds/elements 2.5.1-next.5 → 2.5.2
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/.storybook/utilities.d.ts +0 -1
- package/dist/.storybook/utilities.js +14 -22
- package/dist/custom-elements.json +31 -572
- package/dist/index.d.ts +0 -269
- package/dist/packages/combobox/combobox.d.ts +0 -5
- package/dist/packages/combobox/combobox.js +12 -12
- package/dist/packages/combobox/combobox.js.map +3 -3
- package/dist/packages/combobox/combobox.stories.js +7 -7
- package/dist/packages/combobox/combobox.test.js +0 -90
- package/dist/packages/toast/toast.d.ts +1 -0
- package/dist/packages/toast/toast.js +11 -11
- package/dist/packages/toast/toast.js.map +4 -4
- package/dist/web-types.json +1 -91
- package/package.json +1 -9
- package/dist/packages/pagination/locales/da/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/da/messages.mjs +0 -1
- package/dist/packages/pagination/locales/en/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/en/messages.mjs +0 -1
- package/dist/packages/pagination/locales/fi/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/fi/messages.mjs +0 -1
- package/dist/packages/pagination/locales/nb/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/nb/messages.mjs +0 -1
- package/dist/packages/pagination/locales/sv/messages.d.mts +0 -1
- package/dist/packages/pagination/locales/sv/messages.mjs +0 -1
- package/dist/packages/pagination/pagination.d.ts +0 -32
- package/dist/packages/pagination/pagination.js +0 -2503
- package/dist/packages/pagination/pagination.js.map +0 -7
- package/dist/packages/pagination/pagination.react.stories.d.ts +0 -21
- package/dist/packages/pagination/pagination.react.stories.js +0 -45
- package/dist/packages/pagination/pagination.stories.d.ts +0 -14
- package/dist/packages/pagination/pagination.stories.js +0 -56
- package/dist/packages/pagination/pagination.test.d.ts +0 -1
- package/dist/packages/pagination/pagination.test.js +0 -76
- package/dist/packages/pagination/react.d.ts +0 -5
- package/dist/packages/pagination/react.js +0 -15
- package/dist/packages/pagination/styles.d.ts +0 -1
- package/dist/packages/pagination/styles.js +0 -2
- package/dist/packages/textarea/locales/da/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/da/messages.mjs +0 -1
- package/dist/packages/textarea/locales/en/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/en/messages.mjs +0 -1
- package/dist/packages/textarea/locales/fi/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/fi/messages.mjs +0 -1
- package/dist/packages/textarea/locales/nb/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/nb/messages.mjs +0 -1
- package/dist/packages/textarea/locales/sv/messages.d.mts +0 -1
- package/dist/packages/textarea/locales/sv/messages.mjs +0 -1
- package/dist/packages/textarea/react.d.ts +0 -11
- package/dist/packages/textarea/react.js +0 -21
- package/dist/packages/textarea/styles.d.ts +0 -1
- package/dist/packages/textarea/styles.js +0 -2
- package/dist/packages/textarea/textarea.d.ts +0 -62
- package/dist/packages/textarea/textarea.js +0 -2476
- package/dist/packages/textarea/textarea.js.map +0 -7
- package/dist/packages/textarea/textarea.react.stories.d.ts +0 -33
- package/dist/packages/textarea/textarea.react.stories.js +0 -41
- package/dist/packages/textarea/textarea.stories.d.ts +0 -20
- package/dist/packages/textarea/textarea.stories.js +0 -113
- package/dist/packages/textarea/textarea.test.d.ts +0 -1
- package/dist/packages/textarea/textarea.test.js +0 -172
- package/dist/packages/utils.d.ts +0 -1
- package/dist/packages/utils.js +0 -4
|
@@ -26,13 +26,13 @@ const meta = {
|
|
|
26
26
|
};
|
|
27
27
|
export default meta;
|
|
28
28
|
const sampleOptions = [
|
|
29
|
-
{ value: '
|
|
30
|
-
{ value: '
|
|
31
|
-
{ value: '
|
|
32
|
-
{ value: '
|
|
33
|
-
{ value: '
|
|
34
|
-
{ value: '
|
|
35
|
-
{ value: '
|
|
29
|
+
{ value: 'Apple', label: 'Apple' },
|
|
30
|
+
{ value: 'Banana', label: 'Banana' },
|
|
31
|
+
{ value: 'Orange', label: 'Orange' },
|
|
32
|
+
{ value: 'Grape', label: 'Grape' },
|
|
33
|
+
{ value: 'Strawberry', label: 'Strawberry' },
|
|
34
|
+
{ value: 'Pineapple', label: 'Pineapple' },
|
|
35
|
+
{ value: 'Mango', label: 'Mango' },
|
|
36
36
|
];
|
|
37
37
|
export const Default = {
|
|
38
38
|
args: {},
|
|
@@ -19,93 +19,3 @@ test('renders with autocomplete attribute when provided', async () => {
|
|
|
19
19
|
const el = (await locator.element());
|
|
20
20
|
expect(el.getAttribute('autocomplete')).toBe('on');
|
|
21
21
|
});
|
|
22
|
-
test('displays initial value correctly when value prop is set', async () => {
|
|
23
|
-
const options = [
|
|
24
|
-
{ value: 'apple', label: 'Apple' },
|
|
25
|
-
{ value: 'banana', label: 'Banana' },
|
|
26
|
-
];
|
|
27
|
-
const component = html `<w-combobox
|
|
28
|
-
data-testid="combobox"
|
|
29
|
-
value="apple"
|
|
30
|
-
.options="${options}"
|
|
31
|
-
></w-combobox>`;
|
|
32
|
-
const page = render(component);
|
|
33
|
-
const locator = page.getByTestId('combobox');
|
|
34
|
-
await expect.element(locator).toBeVisible();
|
|
35
|
-
const el = (await locator.element());
|
|
36
|
-
// Get the textfield's input element
|
|
37
|
-
const textfield = el.shadowRoot?.querySelector('w-textfield');
|
|
38
|
-
const input = textfield?.shadowRoot?.querySelector('input');
|
|
39
|
-
// Verify the displayed text shows the label "Apple", not the value "apple"
|
|
40
|
-
expect(input?.value).toBe('Apple');
|
|
41
|
-
// Verify the combobox value is "apple"
|
|
42
|
-
expect(el.value).toBe('apple');
|
|
43
|
-
});
|
|
44
|
-
test('filters options by label, not value', async () => {
|
|
45
|
-
const options = [
|
|
46
|
-
{ value: 'us', label: 'United States' },
|
|
47
|
-
{ value: 'uk', label: 'United Kingdom' },
|
|
48
|
-
{ value: 'no', label: 'Norway' },
|
|
49
|
-
];
|
|
50
|
-
const component = html `<w-combobox
|
|
51
|
-
data-testid="combobox"
|
|
52
|
-
open-on-focus
|
|
53
|
-
.options="${options}"
|
|
54
|
-
></w-combobox>`;
|
|
55
|
-
const page = render(component);
|
|
56
|
-
const locator = page.getByTestId('combobox');
|
|
57
|
-
await expect.element(locator).toBeVisible();
|
|
58
|
-
const el = (await locator.element());
|
|
59
|
-
// Get the textfield's input element
|
|
60
|
-
const textfield = el.shadowRoot?.querySelector('w-textfield');
|
|
61
|
-
const input = textfield?.shadowRoot?.querySelector('input');
|
|
62
|
-
// Type "United" which should match labels "United States" and "United Kingdom"
|
|
63
|
-
// but NOT match any values (us, uk, no)
|
|
64
|
-
input?.focus();
|
|
65
|
-
input.value = 'United';
|
|
66
|
-
input.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
|
|
67
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
68
|
-
// Check that the dropdown shows the matching options
|
|
69
|
-
const listbox = el.shadowRoot?.querySelector('[role="listbox"]');
|
|
70
|
-
const visibleOptions = listbox?.querySelectorAll('[role="option"]');
|
|
71
|
-
// Should show 2 options: "United States" and "United Kingdom"
|
|
72
|
-
expect(visibleOptions?.length).toBe(2);
|
|
73
|
-
const optionTexts = Array.from(visibleOptions || []).map((opt) => opt.textContent?.trim());
|
|
74
|
-
expect(optionTexts).toContain('United States');
|
|
75
|
-
expect(optionTexts).toContain('United Kingdom');
|
|
76
|
-
expect(optionTexts).not.toContain('Norway');
|
|
77
|
-
});
|
|
78
|
-
test('displays option label in textfield but stores option value', async () => {
|
|
79
|
-
const optionsWithDifferentLabelAndValue = [
|
|
80
|
-
{ value: 'us', label: 'United States' },
|
|
81
|
-
{ value: 'uk', label: 'United Kingdom' },
|
|
82
|
-
{ value: 'no', label: 'Norway' },
|
|
83
|
-
];
|
|
84
|
-
const component = html `<w-combobox
|
|
85
|
-
data-testid="combobox"
|
|
86
|
-
open-on-focus
|
|
87
|
-
.options="${optionsWithDifferentLabelAndValue}"
|
|
88
|
-
></w-combobox>`;
|
|
89
|
-
const page = render(component);
|
|
90
|
-
const locator = page.getByTestId('combobox');
|
|
91
|
-
await expect.element(locator).toBeVisible();
|
|
92
|
-
const el = (await locator.element());
|
|
93
|
-
// Get the textfield's input element
|
|
94
|
-
const textfield = el.shadowRoot?.querySelector('w-textfield');
|
|
95
|
-
const input = textfield?.shadowRoot?.querySelector('input');
|
|
96
|
-
// Focus to open the dropdown
|
|
97
|
-
input?.focus();
|
|
98
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
99
|
-
// Find and click the "Norway" option (which has value "no")
|
|
100
|
-
const listbox = el.shadowRoot?.querySelector('[role="listbox"]');
|
|
101
|
-
const options = listbox?.querySelectorAll('[role="option"]');
|
|
102
|
-
const norwayOption = Array.from(options || []).find((opt) => opt.textContent?.trim() === 'Norway');
|
|
103
|
-
expect(norwayOption).toBeDefined();
|
|
104
|
-
// Simulate mousedown on the option
|
|
105
|
-
norwayOption?.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
|
|
106
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
107
|
-
// Verify the displayed text is the label "Norway", not the value "no"
|
|
108
|
-
expect(input?.value).toBe('Norway');
|
|
109
|
-
// Verify the combobox value is "no", not "Norway"
|
|
110
|
-
expect(el.value).toBe('no');
|
|
111
|
-
});
|
|
@@ -4,6 +4,7 @@ import '@warp-ds/icons/elements/error-16';
|
|
|
4
4
|
import '@warp-ds/icons/elements/success-16';
|
|
5
5
|
import '@warp-ds/icons/elements/close-16';
|
|
6
6
|
import type { ToastType } from './types';
|
|
7
|
+
export { removeToast, toast, updateToast } from './api.js';
|
|
7
8
|
/**
|
|
8
9
|
* You should probably not include this component in HTML markup.
|
|
9
10
|
*
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function
|
|
1
|
+
var Be=Object.create;var D=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var K=r=>{throw TypeError(r)};var G=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Re=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of $e(e))!Xe.call(r,a)&&a!==o&&D(r,a,{get:()=>e[a],enumerable:!(t=V(e,a))||t.enumerable});return r};var Ze=(r,e,o)=>(o=r!=null?Be(Je(r)):{},Re(e||!r||!r.__esModule?D(o,"default",{value:r,enumerable:!0}):o,r));var x=(r,e,o,t)=>{for(var a=t>1?void 0:t?V(e,o):e,n=r.length-1,i;n>=0;n--)(i=r[n])&&(a=(t?i(e,o,a):i(a))||a);return t&&a&&D(e,o,a),a};var He=(r,e,o)=>e.has(r)||K("Cannot "+o);var A=(r,e,o)=>(He(r,e,"read from private field"),o?o.call(r):e.get(r)),W=(r,e,o)=>e.has(r)?K("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,o);var Q=G(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.errorMessages=f.ErrorType=void 0;var k;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(k=f.ErrorType||(f.ErrorType={}));f.errorMessages=new Map([[k.MalformedUnicode,"malformed Unicode character escape sequence"],[k.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[k.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[k.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[k.EndOfString,"malformed escape sequence at end of string"]])});var oe=G(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.unraw=g.errorMessages=g.ErrorType=void 0;var d=Q();Object.defineProperty(g,"ErrorType",{enumerable:!0,get:function(){return d.ErrorType}});Object.defineProperty(g,"errorMessages",{enumerable:!0,get:function(){return d.errorMessages}});function Ue(r){return!r.match(/[^a-f0-9]/i)?parseInt(r,16):NaN}function L(r,e,o){let t=Ue(r);if(Number.isNaN(t)||o!==void 0&&o!==r.length)throw new SyntaxError(d.errorMessages.get(e));return t}function qe(r){let e=L(r,d.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function ee(r,e){let o=L(r,d.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=L(e,d.ErrorType.MalformedUnicode,4);return String.fromCharCode(o,t)}return String.fromCharCode(o)}function Ve(r){return r.charAt(0)==="{"&&r.charAt(r.length-1)==="}"}function Ke(r){if(!Ve(r))throw new SyntaxError(d.errorMessages.get(d.ErrorType.MalformedUnicode));let e=r.slice(1,-1),o=L(e,d.ErrorType.MalformedUnicode);try{return String.fromCodePoint(o)}catch(t){throw t instanceof RangeError?new SyntaxError(d.errorMessages.get(d.ErrorType.CodePointLimit)):t}}function Ge(r,e=!1){if(e)throw new SyntaxError(d.errorMessages.get(d.ErrorType.OctalDeprecation));let o=parseInt(r,8);return String.fromCharCode(o)}var We=new Map([["b","\b"],["f","\f"],["n",`
|
|
2
|
+
`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function Qe(r){return We.get(r)||r}var er=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function re(r,e=!1){return r.replace(er,function(o,t,a,n,i,s,l,u,v){if(t!==void 0)return"\\";if(a!==void 0)return qe(a);if(n!==void 0)return Ke(n);if(i!==void 0)return ee(i,s);if(l!==void 0)return ee(l);if(u==="0")return"\0";if(u!==void 0)return Ge(u,!e);if(v!==void 0)return Qe(v);throw new SyntaxError(d.errorMessages.get(d.ErrorType.EndOfString))})}g.unraw=re;g.default=re});var C=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return r.reduce(function(o,t){return o.concat(typeof t=="string"?t:Array.isArray(t)?C.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};var ne=Ze(oe(),1);var m=r=>typeof r=="string",rr=r=>typeof r=="function",te=new Map,ie="en";function P(r){return[...Array.isArray(r)?r:[r],ie]}function B(r,e,o){let t=P(r);o||(o="default");let a;if(typeof o=="string")switch(a={day:"numeric",month:"short",year:"numeric"},o){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=o;return M(()=>O("date",t,o),()=>new Intl.DateTimeFormat(t,a)).format(m(e)?new Date(e):e)}function or(r,e,o){let t;if(o||(o="default"),typeof o=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},o){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=o;return B(r,e,t)}function I(r,e,o){let t=P(r);return M(()=>O("number",t,o),()=>new Intl.NumberFormat(t,o)).format(e)}function ae(r,e,o,{offset:t=0,...a}){var s,l;let n=P(r),i=e?M(()=>O("plural-ordinal",n),()=>new Intl.PluralRules(n,{type:"ordinal"})):M(()=>O("plural-cardinal",n),()=>new Intl.PluralRules(n,{type:"cardinal"}));return(l=(s=a[o])!=null?s:a[i.select(o-t)])!=null?l:a.other}function M(r,e){let o=r(),t=te.get(o);return t||(t=e(),te.set(o,t)),t}function O(r,e,o){let t=e.join("-");return`${r}-${t}-${JSON.stringify(o)}`}var se=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,ce="%__lingui_octothorpe__%",tr=(r,e,o={})=>{let t=e||r,a=i=>typeof i=="object"?i:o[i],n=(i,s)=>{let l=Object.keys(o).length?a("number"):void 0,u=I(t,i,l);return s.replace(new RegExp(ce,"g"),u)};return{plural:(i,s)=>{let{offset:l=0}=s,u=ae(t,!1,i,s);return n(i-l,u)},selectordinal:(i,s)=>{let{offset:l=0}=s,u=ae(t,!0,i,s);return n(i-l,u)},select:ar,number:(i,s)=>I(t,i,a(s)||{style:s}),date:(i,s)=>B(t,i,a(s)||s),time:(i,s)=>or(t,i,a(s)||s)}},ar=(r,e)=>{var o;return(o=e[r])!=null?o:e.other};function nr(r,e,o){return(t={},a)=>{let n=tr(e,o,a),i=(l,u=!1)=>Array.isArray(l)?l.reduce((v,z)=>{if(z==="#"&&u)return v+ce;if(m(z))return v+z;let[U,h,q]=z,T={};h==="plural"||h==="selectordinal"||h==="select"?Object.entries(q).forEach(([j,Pe])=>{T[j]=i(Pe,h==="plural"||h==="selectordinal")}):T=q;let E;if(h){let j=n[h];E=j(t[U],T)}else E=t[U];return E==null?v:v+E},""):l,s=i(r);return m(s)&&se.test(s)?(0,ne.unraw)(s):m(s)?s:s?String(s):""}}var ir=Object.defineProperty,sr=(r,e,o)=>e in r?ir(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,cr=(r,e,o)=>(sr(r,typeof e!="symbol"?e+"":e,o),o),Y=class{constructor(){cr(this,"_events",{})}on(e,o){var a;var t;return(a=(t=this._events)[e])!=null||(t[e]=[]),this._events[e].push(o),()=>this.removeListener(e,o)}removeListener(e,o){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(o);~a&&t.splice(a,1)}emit(e,...o){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,o))}_getListeners(e){let o=this._events[e];return Array.isArray(o)?o:!1}},lr=Object.defineProperty,dr=(r,e,o)=>e in r?lr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,w=(r,e,o)=>(dr(r,typeof e!="symbol"?e+"":e,o),o),F=class extends Y{constructor(e){var o;super(),w(this,"_locale",""),w(this,"_locales"),w(this,"_localeData",{}),w(this,"_messages",{}),w(this,"_missing"),w(this,"_messageCompiler"),w(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((o=e.locale)!=null?o:ie,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,o){let t=this._localeData[e];t?Object.assign(t,o):this._localeData[e]=o}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,o){typeof e=="string"?this._loadLocaleData(e,o):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,o){let t=this._messages[e];t?Object.assign(t,o):this._messages[e]=o}load(e,o){typeof e=="string"&&typeof o=="object"?this._load(e,o):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:o,messages:t}){this._locale=e,this._locales=o||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,o){this._locale=e,this._locales=o,this.emit("change")}_(e,o,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==null?void 0:t.message;e||(e=""),m(e)||(o=e.values||o,a=e.message,e=e.id);let n=this.messages[e],i=n===void 0,s=this._missing;if(s&&i)return rr(s)?s(this._locale,e):s;i&&this.emit("missing",{id:e,locale:this._locale});let l=n||a||e;return m(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
|
|
3
3
|
|
|
4
|
-
> ${
|
|
4
|
+
> ${l}
|
|
5
5
|
|
|
6
6
|
That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
|
|
7
7
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
8
8
|
|
|
9
9
|
Please compile your catalog first.
|
|
10
|
-
`)),m(c)&&ne.test(c)?JSON.parse(`"${c}"`):m(c)?c:tr(c,this._locale,this._locales)(o,t==null?void 0:t.formats)}date(e,o){return B(this._locales||this._locale,e,o)}number(e,o){return T(this._locales||this._locale,e,o)}};function cr(r={}){return new Y(r)}var l=cr();var P=typeof window!="undefined",se=!0;if(P){let r=window.matchMedia("(prefers-reduced-motion: reduce)"),e=({matches:o})=>se=!o;r.addEventListener&&r.addEventListener("change",e),e(r)}var le=r=>{r.style.transition=null,r.style.backfaceVisibility=null,r.style.overflow=null},ce=r=>{let e=se?"var(--f-expansion-duration, 0.3s)":"0.01s";r.style.transition=`height ${e}`,r.style.backfaceVisibility="hidden",r.style.overflow="hidden"},dr=(r,e)=>()=>{r.style.height="auto",r.style.overflow=null,e&&e()},ur=r=>()=>{r&&r()},de=(r,e)=>{let o=(()=>{if(!e)return new Promise(n=>{e=n})})(),t=dr(r,e);le(r),r.style.height="auto";let a=r.scrollHeight;if(P&&requestAnimationFrame(()=>{r.addEventListener("transitionend",t,{once:!0}),r.style.height="0px",r.style.transitionTimingFunction="ease-out",ce(r),requestAnimationFrame(()=>r.style.height=a+"px")}),o)return o},ue=(r,e)=>{let o=(()=>{if(!e)return new Promise(n=>{e=n})})(),t=ur(e);le(r);let a=r.scrollHeight;if(P&&requestAnimationFrame(()=>{r.addEventListener("transitionend",t,{once:!0}),r.style.height=a+"px",r.style.transitionTimingFunction="ease-in",ce(r),requestAnimationFrame(()=>r.style.height="0px")}),o)return o};import{css as bo,html as y,LitElement as mo}from"lit";import{property as S,state as vo}from"lit/decorators.js";import{when as ho}from"lit/directives/when.js";import{LitElement as pr}from"lit";import{unsafeStatic as gr,html as br}from"lit/static-html.js";var mr=JSON.parse('{"icon.title.warning":["Varseltrekant med utropstegn"]}'),vr=JSON.parse('{"icon.title.warning":["Warning triangle with exclamation point"]}'),hr=JSON.parse('{"icon.title.warning":["Varoituskolmio, jonka sis\xE4ll\xE4 on huutomerkki"]}'),fr=JSON.parse('{"icon.title.warning":["Advarselstrekant med et udr\xE5bstegn"]}'),wr=JSON.parse('{"icon.title.warning":["Varningstriangel med utropstecken"]}'),pe=["en","nb","fi","da","sv"],ge="en",xr=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},be=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":ge},$=r=>pe.find(e=>r===e||r.toLowerCase().includes(e))||be();function kr(){var r;if(typeof window=="undefined"){let e=xr();return $(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=be();return pe.includes(e)?$(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),$(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),ge}}var yr=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,_r=(r,e,o,t,a)=>{let n=kr(),i=yr(n,r,e,o,t,a);l.load(n,i),l.activate(n)};_r(vr,mr,hr,fr,wr);var zr=class extends pr{render(){let r=l.t({message:"Warning triangle with exclamation point",id:"icon.title.warning",comment:"Title for warning icon"});return br`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-warning-16-part">${gr(`<title>${r}</title>`)}<path stroke="currentColor" d="m.712 14.07 6.25-12.994a1 1 0 0 1 1.792-.022l6.635 12.995a1 1 0 0 1-.89 1.455H1.613a1 1 0 0 1-.902-1.434Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8 6v4.992M8 13v.333"></path></svg>`}};customElements.get("w-icon-warning-16")||customElements.define("w-icon-warning-16",zr);import{LitElement as Er}from"lit";import{unsafeStatic as Lr,html as Cr}from"lit/static-html.js";var Mr=JSON.parse('{"icon.title.error":["\xC5ttekant med utropstegn"]}'),Or=JSON.parse('{"icon.title.error":["Octagon with exclamation point"]}'),Sr=JSON.parse('{"icon.title.error":["Kahdeksankulmio, jonka sis\xE4ll\xE4 on huutomerkki"]}'),Nr=JSON.parse('{"icon.title.error":["Ottekant med et udr\xE5bstegn"]}'),jr=JSON.parse('{"icon.title.error":["Oktagon med utropstecken"]}'),me=["en","nb","fi","da","sv"],ve="en",Ar=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},he=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":ve},J=r=>me.find(e=>r===e||r.toLowerCase().includes(e))||he();function Dr(){var r;if(typeof window=="undefined"){let e=Ar();return J(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=he();return me.includes(e)?J(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),J(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),ve}}var Tr=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,Ir=(r,e,o,t,a)=>{let n=Dr(),i=Tr(n,r,e,o,t,a);l.load(n,i),l.activate(n)};Ir(Or,Mr,Sr,Nr,jr);var Yr=class extends Er{render(){let r=l.t({message:"Octagon with exclamation point",id:"icon.title.error",comment:"Title for error icon"});return Cr`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-error-16-part">${Lr(`<title>${r}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M.5 11.107 4.748 15.5h6.503l4.248-4.393V4.893L11.252.5H4.748L.5 4.893z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8 11.398a.25.25 0 1 1 0-.5m0 .5a.25.25 0 1 0 0-.5"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M8 8.5V3"></path></svg>`}};customElements.get("w-icon-error-16")||customElements.define("w-icon-error-16",Yr);import{LitElement as Fr}from"lit";import{unsafeStatic as Br,html as Pr}from"lit/static-html.js";var $r=JSON.parse('{"icon.title.success":["Sirkel med sjekkmerke"]}'),Jr=JSON.parse('{"icon.title.success":["Circle with checkmark"]}'),Xr=JSON.parse('{"icon.title.success":["Ympyr\xE4, jonka sis\xE4ll\xE4 on valintamerkki"]}'),Rr=JSON.parse('{"icon.title.success":["Cirkel med et flueben"]}'),Zr=JSON.parse('{"icon.title.success":["Cirkel med bock"]}'),fe=["en","nb","fi","da","sv"],we="en",Hr=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},xe=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":we},X=r=>fe.find(e=>r===e||r.toLowerCase().includes(e))||xe();function Ur(){var r;if(typeof window=="undefined"){let e=Hr();return X(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=xe();return fe.includes(e)?X(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),X(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),we}}var qr=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,Vr=(r,e,o,t,a)=>{let n=Ur(),i=qr(n,r,e,o,t,a);l.load(n,i),l.activate(n)};Vr(Jr,$r,Xr,Rr,Zr);var Kr=class extends Fr{render(){let r=l.t({message:"Circle with checkmark",id:"icon.title.success",comment:"Title for success icon"});return Pr`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-success-16-part">${Br(`<title>${r}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="m4 8.815 1.633 2.318a.7.7 0 0 0 1.138.034l5.228-6.615"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M.5 7.999a7.5 7.5 0 1 0 15 0 7.5 7.5 0 0 0-15 0"></path></svg>`}};customElements.get("w-icon-success-16")||customElements.define("w-icon-success-16",Kr);import{LitElement as Gr}from"lit";import{unsafeStatic as Qr,html as Wr}from"lit/static-html.js";var eo=JSON.parse('{"icon.title.close":["Kryss"]}'),ro=JSON.parse('{"icon.title.close":["Cross"]}'),oo=JSON.parse('{"icon.title.close":["Rasti"]}'),to=JSON.parse('{"icon.title.close":["Kryds"]}'),ao=JSON.parse('{"icon.title.close":["Kryss"]}'),ke=["en","nb","fi","da","sv"],ye="en",no=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},_e=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":ye},R=r=>ke.find(e=>r===e||r.toLowerCase().includes(e))||_e();function io(){var r;if(typeof window=="undefined"){let e=no();return R(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=_e();return ke.includes(e)?R(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),R(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),ye}}var so=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,lo=(r,e,o,t,a)=>{let n=io(),i=so(n,r,e,o,t,a);l.load(n,i),l.activate(n)};lo(ro,eo,oo,to,ao);var co=class extends Gr{render(){let r=l.t({message:"Cross",id:"icon.title.close",comment:"Title for close icon"});return Wr`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-close-16-part">${Qr(`<title>${r}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12.5 3.5-9 9m0-9 9 9"></path></svg>`}};customElements.get("w-icon-close-16")||customElements.define("w-icon-close-16",co);var uo=["en","nb","fi","da","sv"],Ee="en",ze=r=>uo.find(e=>r===e||r.toLowerCase().includes(e))||Ee;function po(){if(typeof window=="undefined"){let r=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return ze(r)}try{let r=document.documentElement.lang;return ze(r)}catch(r){return console.warn("could not detect locale, falling back to source locale",r),Ee}}var Le=(r,e,o,t,a)=>{l.load("en",r),l.load("nb",e),l.load("fi",o),l.load("da",t),l.load("sv",a);let n=po();l.activate(n)};import{css as Ce}from"lit";var Me=Ce`
|
|
10
|
+
`)),m(l)&&se.test(l)?JSON.parse(`"${l}"`):m(l)?l:nr(l,this._locale,this._locales)(o,t==null?void 0:t.formats)}date(e,o){return B(this._locales||this._locale,e,o)}number(e,o){return I(this._locales||this._locale,e,o)}};function ur(r={}){return new F(r)}var c=ur();var $=typeof window!="undefined",le=!0;if($){let r=window.matchMedia("(prefers-reduced-motion: reduce)"),e=({matches:o})=>le=!o;r.addEventListener&&r.addEventListener("change",e),e(r)}var de=r=>{r.style.transition=null,r.style.backfaceVisibility=null,r.style.overflow=null},ue=r=>{let e=le?"var(--f-expansion-duration, 0.3s)":"0.01s";r.style.transition=`height ${e}`,r.style.backfaceVisibility="hidden",r.style.overflow="hidden"},pr=(r,e)=>()=>{r.style.height="auto",r.style.overflow=null,e&&e()},gr=r=>()=>{r&&r()},pe=(r,e)=>{let o=(()=>{if(!e)return new Promise(n=>{e=n})})(),t=pr(r,e);de(r),r.style.height="auto";let a=r.scrollHeight;if($&&requestAnimationFrame(()=>{r.addEventListener("transitionend",t,{once:!0}),r.style.height="0px",r.style.transitionTimingFunction="ease-out",ue(r),requestAnimationFrame(()=>r.style.height=a+"px")}),o)return o},ge=(r,e)=>{let o=(()=>{if(!e)return new Promise(n=>{e=n})})(),t=gr(e);de(r);let a=r.scrollHeight;if($&&requestAnimationFrame(()=>{r.addEventListener("transitionend",t,{once:!0}),r.style.height=a+"px",r.style.transitionTimingFunction="ease-in",ue(r),requestAnimationFrame(()=>r.style.height="0px")}),o)return o};import{css as wo,html as y,LitElement as xo}from"lit";import{property as N,state as ko}from"lit/decorators.js";import{when as yo}from"lit/directives/when.js";import{LitElement as br}from"lit";import{unsafeStatic as mr,html as vr}from"lit/static-html.js";var hr=JSON.parse('{"icon.title.warning":["Varseltrekant med utropstegn"]}'),fr=JSON.parse('{"icon.title.warning":["Warning triangle with exclamation point"]}'),wr=JSON.parse('{"icon.title.warning":["Varoituskolmio, jonka sis\xE4ll\xE4 on huutomerkki"]}'),xr=JSON.parse('{"icon.title.warning":["Advarselstrekant med et udr\xE5bstegn"]}'),kr=JSON.parse('{"icon.title.warning":["Varningstriangel med utropstecken"]}'),be=["en","nb","fi","da","sv"],me="en",yr=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},ve=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":me},J=r=>be.find(e=>r===e||r.toLowerCase().includes(e))||ve();function _r(){var r;if(typeof window=="undefined"){let e=yr();return J(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=ve();return be.includes(e)?J(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),J(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),me}}var zr=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,Er=(r,e,o,t,a)=>{let n=_r(),i=zr(n,r,e,o,t,a);c.load(n,i),c.activate(n)};Er(fr,hr,wr,xr,kr);var Cr=class extends br{render(){let r=c.t({message:"Warning triangle with exclamation point",id:"icon.title.warning",comment:"Title for warning icon"});return vr`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-warning-16-part">${mr(`<title>${r}</title>`)}<path stroke="currentColor" d="m.712 14.07 6.25-12.994a1 1 0 0 1 1.792-.022l6.635 12.995a1 1 0 0 1-.89 1.455H1.613a1 1 0 0 1-.902-1.434Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8 6v4.992M8 13v.333"></path></svg>`}};customElements.get("w-icon-warning-16")||customElements.define("w-icon-warning-16",Cr);import{LitElement as Lr}from"lit";import{unsafeStatic as Mr,html as Or}from"lit/static-html.js";var Sr=JSON.parse('{"icon.title.error":["\xC5ttekant med utropstegn"]}'),Nr=JSON.parse('{"icon.title.error":["Octagon with exclamation point"]}'),Tr=JSON.parse('{"icon.title.error":["Kahdeksankulmio, jonka sis\xE4ll\xE4 on huutomerkki"]}'),jr=JSON.parse('{"icon.title.error":["Ottekant med et udr\xE5bstegn"]}'),Dr=JSON.parse('{"icon.title.error":["Oktagon med utropstecken"]}'),he=["en","nb","fi","da","sv"],fe="en",Ar=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},we=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":fe},X=r=>he.find(e=>r===e||r.toLowerCase().includes(e))||we();function Ir(){var r;if(typeof window=="undefined"){let e=Ar();return X(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=we();return he.includes(e)?X(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),X(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),fe}}var Yr=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,Fr=(r,e,o,t,a)=>{let n=Ir(),i=Yr(n,r,e,o,t,a);c.load(n,i),c.activate(n)};Fr(Nr,Sr,Tr,jr,Dr);var Pr=class extends Lr{render(){let r=c.t({message:"Octagon with exclamation point",id:"icon.title.error",comment:"Title for error icon"});return Or`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-error-16-part">${Mr(`<title>${r}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M.5 11.107 4.748 15.5h6.503l4.248-4.393V4.893L11.252.5H4.748L.5 4.893z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8 11.398a.25.25 0 1 1 0-.5m0 .5a.25.25 0 1 0 0-.5"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M8 8.5V3"></path></svg>`}};customElements.get("w-icon-error-16")||customElements.define("w-icon-error-16",Pr);import{LitElement as Br}from"lit";import{unsafeStatic as $r,html as Jr}from"lit/static-html.js";var Xr=JSON.parse('{"icon.title.success":["Sirkel med sjekkmerke"]}'),Rr=JSON.parse('{"icon.title.success":["Circle with checkmark"]}'),Zr=JSON.parse('{"icon.title.success":["Ympyr\xE4, jonka sis\xE4ll\xE4 on valintamerkki"]}'),Hr=JSON.parse('{"icon.title.success":["Cirkel med et flueben"]}'),Ur=JSON.parse('{"icon.title.success":["Cirkel med bock"]}'),xe=["en","nb","fi","da","sv"],ke="en",qr=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},ye=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":ke},R=r=>xe.find(e=>r===e||r.toLowerCase().includes(e))||ye();function Vr(){var r;if(typeof window=="undefined"){let e=qr();return R(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=ye();return xe.includes(e)?R(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),R(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),ke}}var Kr=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,Gr=(r,e,o,t,a)=>{let n=Vr(),i=Kr(n,r,e,o,t,a);c.load(n,i),c.activate(n)};Gr(Rr,Xr,Zr,Hr,Ur);var Wr=class extends Br{render(){let r=c.t({message:"Circle with checkmark",id:"icon.title.success",comment:"Title for success icon"});return Jr`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-success-16-part">${$r(`<title>${r}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="m4 8.815 1.633 2.318a.7.7 0 0 0 1.138.034l5.228-6.615"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M.5 7.999a7.5 7.5 0 1 0 15 0 7.5 7.5 0 0 0-15 0"></path></svg>`}};customElements.get("w-icon-success-16")||customElements.define("w-icon-success-16",Wr);import{LitElement as Qr}from"lit";import{unsafeStatic as eo,html as ro}from"lit/static-html.js";var oo=JSON.parse('{"icon.title.close":["Kryss"]}'),to=JSON.parse('{"icon.title.close":["Cross"]}'),ao=JSON.parse('{"icon.title.close":["Rasti"]}'),no=JSON.parse('{"icon.title.close":["Kryds"]}'),io=JSON.parse('{"icon.title.close":["Kryss"]}'),_e=["en","nb","fi","da","sv"],ze="en",so=()=>{var r;let e;switch((r=process==null?void 0:process.env)==null?void 0:r.NMP_BRAND){case"FINN":e="nb";break;case"TORI":e="fi";break;case"BLOCKET":e="sv";break;case"DBA":e="da";break;default:e="en"}return e},Ee=()=>{var r;let e=(r=document==null?void 0:document.location)==null?void 0:r.hostname;return e!=null&&e.includes("finn")?"nb":e.includes("tori")?"fi":e.includes("blocket")?"sv":e.includes("dba")?"da":ze},Z=r=>_e.find(e=>r===e||r.toLowerCase().includes(e))||Ee();function co(){var r;if(typeof window=="undefined"){let e=so();return Z(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=Ee();return _e.includes(e)?Z(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),Z(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),ze}}var lo=(r,e,o,t,a,n)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?n:e,uo=(r,e,o,t,a)=>{let n=co(),i=lo(n,r,e,o,t,a);c.load(n,i),c.activate(n)};uo(to,oo,ao,no,io);var po=class extends Qr{render(){let r=c.t({message:"Cross",id:"icon.title.close",comment:"Title for close icon"});return ro`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-close-16-part">${eo(`<title>${r}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12.5 3.5-9 9m0-9 9 9"></path></svg>`}};customElements.get("w-icon-close-16")||customElements.define("w-icon-close-16",po);var go=["en","nb","fi","da","sv"],Le="en",Ce=r=>go.find(e=>r===e||r.toLowerCase().includes(e))||Le;function bo(){if(typeof window=="undefined"){let r=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return Ce(r)}try{let r=document.documentElement.lang;return Ce(r)}catch(r){return console.warn("could not detect locale, falling back to source locale",r),Le}}var Me=(r,e,o,t,a)=>{c.load("en",r),c.load("nb",e),c.load("fi",o),c.load("da",t),c.load("sv",a);let n=bo();c.activate(n)};import{css as Oe}from"lit";var Se=Oe`
|
|
11
11
|
*,
|
|
12
12
|
:before,
|
|
13
13
|
:after {
|
|
@@ -280,7 +280,7 @@ Please compile your catalog first.
|
|
|
280
280
|
svg {
|
|
281
281
|
pointer-events: none;
|
|
282
282
|
}
|
|
283
|
-
`,
|
|
283
|
+
`,tt=Oe`*, :before, :after {
|
|
284
284
|
--w-rotate: 0;
|
|
285
285
|
--w-rotate-x: 0;
|
|
286
286
|
--w-rotate-y: 0;
|
|
@@ -2446,21 +2446,21 @@ Please compile your catalog first.
|
|
|
2446
2446
|
display: none
|
|
2447
2447
|
}
|
|
2448
2448
|
}
|
|
2449
|
-
`;var
|
|
2450
|
-
<div class="${
|
|
2451
|
-
<div class="${
|
|
2449
|
+
`;var Ne=JSON.parse('{"toast.aria.error":["Fejl"],"toast.aria.successful":["Fuldf\xF8rt"],"toast.aria.warning":["Advarsel"]}');var Te=JSON.parse('{"toast.aria.error":["Error"],"toast.aria.successful":["Successful"],"toast.aria.warning":["Warning"]}');var je=JSON.parse('{"toast.aria.error":["Virhe"],"toast.aria.successful":["Onnistui"],"toast.aria.warning":["Varoitus"]}');var De=JSON.parse('{"toast.aria.error":["Feil"],"toast.aria.successful":["Vellykket"],"toast.aria.warning":["Advarsel"]}');var Ae=JSON.parse('{"toast.aria.error":["Fel"],"toast.aria.successful":["Genomf\xF6rt"],"toast.aria.warning":["Varning"]}');import{css as mo}from"lit";var Ie=mo`*,: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}.bg-transparent{background-color:#0000}.border-2{border-width:2px}.rounded-8{border-radius:8px}.rounded-full{border-radius:9999px}.block{display:block}.flex{display:flex}.grid{display:grid}.shrink-0{flex-shrink:0}.auto-rows-auto{grid-auto-rows:auto}.overflow-hidden{overflow:hidden}.self-center{align-self:center}.bottom-16{bottom:1.6rem}.left-0{left:0}.right-0{right:0}.justify-center{justify-content:center}.justify-items-center{justify-items:center}.fixed{position:fixed}.relative{position:relative}.static{position:static}.z-50{z-index:50}.s-bg-negative-subtle{background-color:var(--w-s-color-background-negative-subtle)}.s-bg-positive-subtle{background-color:var(--w-s-color-background-positive-subtle)}.s-bg-warning-subtle{background-color:var(--w-s-color-background-warning-subtle)}.s-text{color:var(--w-s-color-text)}.s-icon{color:var(--w-s-color-icon)}.s-icon-negative{color:var(--w-s-color-icon-negative)}.s-icon-positive{color:var(--w-s-color-icon-positive)}.s-icon-warning{color:var(--w-s-color-icon-warning)}.hover\\:s-icon-hover:hover{color:var(--w-s-color-icon-hover)}.active\\:s-icon-active:active{color:var(--w-s-color-icon-active)}.s-border-negative-subtle{border-color:var(--w-s-color-border-negative-subtle)}.s-border-positive-subtle{border-color:var(--w-s-color-border-positive-subtle)}.s-border-warning-subtle{border-color:var(--w-s-color-border-warning-subtle)}.w-full{width:100%}.h-\\[16px\\]{height:16px}.w-\\[16px\\]{width:16px}.mx-8{margin-left:.8rem;margin-right:.8rem}.mx-auto{margin-left:auto;margin-right:auto}.last-child\\:mb-0>:last-child{margin-bottom:0}.ml-auto{margin-left:auto}.mr-8{margin-right:.8rem}.mt-16{margin-top:1.6rem}.m-\\[8px\\]{margin:8px}.p-8{padding:.8rem}.py-4{padding-top:.4rem;padding-bottom:.4rem}.p-\\[8px\\]{padding:8px}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.translate-z-0{--w-translate-z:0rem;transform:translateX(var(--w-translate-x))translateY(var(--w-translate-y))translateZ(var(--w-translate-z))rotate(var(--w-rotate))rotateX(var(--w-rotate-x))rotateY(var(--w-rotate-y))rotateZ(var(--w-rotate-z))skewX(var(--w-skew-x))skewY(var(--w-skew-y))scaleX(var(--w-scale-x))scaleY(var(--w-scale-y))scaleZ(var(--w-scale-z))}.transform{transform:translateX(var(--w-translate-x))translateY(var(--w-translate-y))translateZ(var(--w-translate-z))rotate(var(--w-rotate))rotateX(var(--w-rotate-x))rotateY(var(--w-rotate-y))rotateZ(var(--w-rotate-z))skewX(var(--w-skew-x))skewY(var(--w-skew-y))scaleX(var(--w-scale-x))scaleY(var(--w-scale-y))scaleZ(var(--w-scale-z))}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width:480px){.sm\\:mx-16{margin-left:1.6rem;margin-right:1.6rem}}`;var S=typeof window!="undefined";function H(){return customElements.get("w-toast-container")}function vo(r,e){if(!S)return;let o=H().init(),t={id:Date.now().toString(36)+Math.random().toString(36).slice(2,5),text:r,duration:5e3,type:"success",...e};return o.set(t),t}function ho(r){return S?H().init().del(r):void 0}function fo(r,e){if(!S)return;let o=H().init();return o.set({...o.get(r),...e}),o.get(r)}var p={wrapper:"relative overflow-hidden w-full",base:"flex group p-8 mt-16 rounded-8 border-2 pointer-events-auto transition-all",positive:"s-bg-positive-subtle s-border-positive-subtle s-text",warning:"s-bg-warning-subtle s-border-warning-subtle s-text",negative:"s-bg-negative-subtle s-border-negative-subtle s-text",iconBase:"shrink-0 rounded-full w-[16px] h-[16px] m-[8px]",iconPositive:"s-icon-positive",iconWarning:"s-icon-warning",iconNegative:"s-icon-negative",iconLoading:"animate-bounce",content:"self-center mr-8 py-4 last-child:mb-0",close:"bg-transparent ml-auto p-[8px] s-icon hover:s-icon-hover active:s-icon-active"},_,Ye,Fe,b=class extends xo{constructor(){super();W(this,_);this.id=Date.now().toString(36)+Math.random().toString(36).slice(2,5);this.type="success";this.text="";this.canclose=!1;this._expanded=!1;Me(Te,De,je,Ne,Ae)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}updated(){!this._expanded&&this._wrapper&&pe(this._wrapper,()=>this._expanded=!0)}get _wrapper(){var o,t;return(t=(o=this.renderRoot)==null?void 0:o.querySelector("section"))!=null?t:null}get _warning(){return this.type==="warning"}get _error(){return this.type==="error"}get _role(){return this._error||this._warning?"alert":"status"}get _typeLabel(){return this._warning?c._({id:"toast.aria.warning",message:"Warning",comment:"Default screenreader message for warning in toast component"}):this._error?c._({id:"toast.aria.error",message:"Error",comment:"Default screenreader message for error in toast component"}):c._({id:"toast.aria.successful",message:"Successful",comment:"Default screenreader message for successful in toast component"})}get _iconMarkup(){return this._warning?y`<w-icon-warning-16></w-icon-warning-16>`:this._error?y`<w-icon-error-16></w-icon-error-16>`:y`<w-icon-success-16></w-icon-success-16>`}async collapse(){return new Promise(o=>{this._expanded&&this._wrapper?ge(this._wrapper,o):o()})}close(){let o=new CustomEvent("close",{detail:{id:this.id},bubbles:!0,composed:!0});this.updateComplete.then(()=>this.dispatchEvent(o))}render(){return this.text?y` <section class="${p.wrapper}" aria-label="${this._typeLabel}">
|
|
2450
|
+
<div class="${A(this,_,Ye)}">
|
|
2451
|
+
<div class="${A(this,_,Fe)}">${this._iconMarkup}</div>
|
|
2452
2452
|
<div role="${this._role}" class="${p.content}">
|
|
2453
2453
|
<p>${this.text}</p>
|
|
2454
2454
|
</div>
|
|
2455
|
-
${
|
|
2455
|
+
${yo(this.canclose===!0,()=>y`
|
|
2456
2456
|
<w-button variant="pill" small="" @click="${this.close}">
|
|
2457
2457
|
<w-icon-close-16 style="display: flex"></w-icon-close-16>
|
|
2458
2458
|
</w-button>
|
|
2459
2459
|
`)}
|
|
2460
2460
|
</div>
|
|
2461
|
-
</section>`:y``}};_=new WeakSet,
|
|
2461
|
+
</section>`:y``}};_=new WeakSet,Ye=function(){return C([p.base,this.type==="success"&&p.positive,this.type==="warning"&&p.warning,this.type==="error"&&p.negative])},Fe=function(){return C([p.iconBase,this.type==="success"&&p.iconPositive,this.type==="warning"&&p.iconWarning,this.type==="error"&&p.iconNegative])},b.styles=[Se,Ie,wo`
|
|
2462
2462
|
:host {
|
|
2463
2463
|
display: block;
|
|
2464
2464
|
}
|
|
2465
|
-
`],x([
|
|
2465
|
+
`],x([N({type:String,attribute:!0,reflect:!0})],b.prototype,"id",2),x([N({type:String,attribute:!0,reflect:!0})],b.prototype,"type",2),x([N({type:String,attribute:!0,reflect:!0})],b.prototype,"text",2),x([N({type:Boolean,attribute:!0,reflect:!0})],b.prototype,"canclose",2),x([ko()],b.prototype,"_expanded",2);customElements.get("w-toast")||customElements.define("w-toast",b);export{b as WarpToast,ho as removeToast,vo as toast,fo as updateToast};
|
|
2466
2466
|
//# sourceMappingURL=toast.js.map
|