@warp-ds/elements 2.10.0-next.11 → 2.10.0-next.13
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 +211 -189
- package/dist/docs/badge/api.md +4 -4
- package/dist/docs/badge/badge.md +4 -4
- package/dist/docs/button/api.md +24 -24
- package/dist/docs/button/button.md +24 -24
- package/dist/docs/checkbox/api.md +2 -2
- package/dist/docs/checkbox/checkbox.md +2 -2
- package/dist/docs/checkbox-group/api.md +6 -6
- package/dist/docs/checkbox-group/checkbox-group.md +6 -6
- package/dist/docs/datepicker/api.md +8 -8
- package/dist/docs/datepicker/datepicker.md +8 -8
- package/dist/docs/expandable/api.md +6 -6
- package/dist/docs/expandable/expandable.md +6 -6
- package/dist/docs/icon/api.md +4 -4
- package/dist/docs/icon/icon.md +4 -4
- package/dist/docs/link/api.md +10 -10
- package/dist/docs/link/link.md +10 -10
- package/dist/docs/modal/api.md +2 -2
- package/dist/docs/modal/modal.md +2 -2
- package/dist/docs/pagination/api.md +4 -4
- package/dist/docs/pagination/pagination.md +4 -4
- package/dist/docs/pill/api.md +8 -8
- package/dist/docs/pill/pill.md +8 -8
- package/dist/docs/select/api.md +10 -10
- package/dist/docs/select/select.md +10 -10
- package/dist/docs/slider/api.md +22 -22
- package/dist/docs/slider/slider.md +22 -22
- package/dist/docs/slider-thumb/api.md +12 -12
- package/dist/docs/slider-thumb/slider-thumb.md +12 -12
- package/dist/docs/tabs/api.md +2 -2
- package/dist/docs/tabs/tabs.md +2 -2
- package/dist/docs/textarea/api.md +14 -14
- package/dist/docs/textarea/textarea.md +14 -14
- package/dist/docs/textfield/api.md +34 -34
- package/dist/docs/textfield/textfield.md +34 -34
- package/dist/packages/affix/affix.d.ts +1 -1
- package/dist/packages/affix/affix.js +8 -8
- package/dist/packages/affix/affix.js.map +4 -4
- package/dist/packages/affix/styles.js +2 -2
- package/dist/packages/alert/alert.js +7 -7
- package/dist/packages/alert/alert.js.map +3 -3
- package/dist/packages/alert/styles.js +2 -2
- package/dist/packages/attention/attention.js +42 -21
- package/dist/packages/attention/attention.js.map +4 -4
- package/dist/packages/attention/attention.stories.js +1 -1
- package/dist/packages/attention/styles.js +2 -2
- package/dist/packages/badge/badge.d.ts +2 -2
- package/dist/packages/badge/badge.js +6 -6
- package/dist/packages/badge/badge.js.map +3 -3
- package/dist/packages/badge/styles.js +2 -2
- package/dist/packages/box/box.js +6 -6
- package/dist/packages/box/box.js.map +3 -3
- package/dist/packages/box/styles.js +2 -2
- package/dist/packages/breadcrumbs/breadcrumbs.d.ts +1 -2
- package/dist/packages/breadcrumbs/breadcrumbs.js +7 -7
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +4 -4
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.d.ts +1 -1
- package/dist/packages/breadcrumbs/styles.js +2 -2
- package/dist/packages/button/button.d.ts +11 -11
- package/dist/packages/button/button.js +37 -16
- package/dist/packages/button/button.js.map +4 -4
- package/dist/packages/button/button.react.stories.d.ts +2 -2
- package/dist/packages/button/react.d.ts +1 -1
- package/dist/packages/button/styles.js +18 -2
- package/dist/packages/card/card.js +8 -8
- package/dist/packages/card/card.js.map +4 -4
- package/dist/packages/card/styles.js +2 -2
- package/dist/packages/checkbox/checkbox.d.ts +2 -2
- package/dist/packages/checkbox/checkbox.js +9 -9
- package/dist/packages/checkbox/checkbox.js.map +3 -3
- package/dist/packages/checkbox-group/checkbox-group.d.ts +4 -4
- package/dist/packages/checkbox-group/checkbox-group.js.map +2 -2
- package/dist/packages/combobox/combobox.js +14 -15
- package/dist/packages/combobox/combobox.js.map +4 -4
- package/dist/packages/combobox/combobox.react.stories.d.ts +26 -10
- package/dist/packages/combobox/react.d.ts +13 -5
- package/dist/packages/combobox/styles.js +2 -3
- package/dist/packages/datepicker/datepicker.d.ts +5 -5
- package/dist/packages/datepicker/datepicker.js +29 -29
- package/dist/packages/datepicker/datepicker.js.map +4 -4
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +12 -12
- package/dist/packages/datepicker/react.d.ts +6 -6
- package/dist/packages/expandable/expandable.d.ts +3 -3
- package/dist/packages/expandable/expandable.js +10 -10
- package/dist/packages/expandable/expandable.js.map +3 -3
- package/dist/packages/expandable/styles.js +2 -2
- package/dist/packages/icon/icon.d.ts +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 +1 -1
- package/dist/packages/icon/icon.react.stories.js +2 -0
- package/dist/packages/icon/icon.stories.d.ts +7 -30
- package/dist/packages/icon/icon.stories.js +11 -2
- package/dist/packages/link/link.d.ts +5 -5
- package/dist/packages/link/link.js +40 -19
- package/dist/packages/link/link.js.map +3 -3
- package/dist/packages/link/styles.js +5 -0
- package/dist/packages/modal/modal.d.ts +1 -1
- package/dist/packages/modal/modal.js +7 -7
- package/dist/packages/modal/modal.js.map +3 -3
- package/dist/packages/modal/modal.react.stories.d.ts +4 -4
- package/dist/packages/modal/react.d.ts +4 -4
- package/dist/packages/modal/util.js +3 -1
- package/dist/packages/modal-footer/modal-footer.js +7 -7
- package/dist/packages/modal-footer/modal-footer.js.map +3 -3
- package/dist/packages/modal-header/modal-header.js +11 -11
- package/dist/packages/modal-header/modal-header.js.map +4 -4
- package/dist/packages/modal-header/react.d.ts +2 -2
- package/dist/packages/page-indicator/page-indicator.d.ts +0 -4
- package/dist/packages/page-indicator/page-indicator.js +6 -6
- package/dist/packages/page-indicator/page-indicator.js.map +4 -4
- package/dist/packages/page-indicator/page-indicator.stories.d.ts +8 -26
- package/dist/packages/page-indicator/page-indicator.stories.js +9 -7
- package/dist/packages/pagination/pagination.d.ts +8 -9
- package/dist/packages/pagination/pagination.js +15 -15
- package/dist/packages/pagination/pagination.js.map +4 -4
- package/dist/packages/pagination/pagination.react.stories.d.ts +6 -6
- package/dist/packages/pagination/pagination.test.js +4 -7
- package/dist/packages/pagination/react.d.ts +3 -3
- package/dist/packages/pagination/styles.js +2 -2
- package/dist/packages/pill/pill.d.ts +4 -4
- package/dist/packages/pill/pill.js +9 -9
- package/dist/packages/pill/pill.js.map +4 -4
- package/dist/packages/pill/pill.react.stories.d.ts +8 -8
- package/dist/packages/pill/react.d.ts +4 -4
- package/dist/packages/pill/styles.js +2 -2
- package/dist/packages/radio/form-associated-element.d.ts +1 -1
- package/dist/packages/radio/radio.d.ts +1 -1
- package/dist/packages/radio/radio.js +8 -8
- package/dist/packages/radio/radio.js.map +3 -3
- package/dist/packages/radio-group/radio-group.d.ts +2 -2
- package/dist/packages/radio-group/radio-group.js +11 -11
- package/dist/packages/radio-group/radio-group.js.map +4 -4
- package/dist/packages/radio-group/react.d.ts +4 -4
- package/dist/packages/select/react.d.ts +3 -3
- package/dist/packages/select/select.d.ts +6 -7
- package/dist/packages/select/select.js +13 -13
- package/dist/packages/select/select.js.map +4 -4
- package/dist/packages/select/select.react.stories.d.ts +7 -7
- package/dist/packages/select/select.react.stories.js +15 -10
- package/dist/packages/select/styles.js +2 -2
- package/dist/packages/slider/slider.d.ts +14 -14
- package/dist/packages/slider/slider.js +12 -12
- package/dist/packages/slider/slider.js.map +4 -4
- package/dist/packages/slider/slider.stories.js +1 -0
- package/dist/packages/slider/styles.js +2 -2
- package/dist/packages/slider-thumb/react.d.ts +2 -2
- package/dist/packages/slider-thumb/slider-thumb.d.ts +14 -14
- package/dist/packages/slider-thumb/slider-thumb.js +11 -11
- package/dist/packages/slider-thumb/slider-thumb.js.map +4 -4
- package/dist/packages/slider-thumb/styles.d.ts +1 -0
- package/dist/packages/slider-thumb/styles.js +2 -0
- package/dist/packages/step/step.js +10 -10
- package/dist/packages/step/step.js.map +4 -4
- package/dist/packages/step-indicator/step-indicator.js +6 -6
- package/dist/packages/step-indicator/step-indicator.js.map +3 -3
- package/dist/packages/step-indicator/styles.js +2 -2
- package/dist/packages/styles.js +4 -2
- package/dist/packages/switch/styles.js +2 -2
- package/dist/packages/switch/switch.d.ts +3 -3
- package/dist/packages/switch/switch.js +6 -6
- package/dist/packages/switch/switch.js.map +3 -3
- package/dist/packages/tab/react.d.ts +4 -4
- package/dist/packages/tab/tab.d.ts +1 -1
- package/dist/packages/tab/tab.js +6 -6
- package/dist/packages/tab/tab.js.map +3 -3
- package/dist/packages/tab-panel/tab-panel.js +5 -5
- package/dist/packages/tab-panel/tab-panel.js.map +3 -3
- package/dist/packages/tabs/styles.js +2 -2
- package/dist/packages/tabs/tabs.d.ts +4 -3
- package/dist/packages/tabs/tabs.js +6 -6
- package/dist/packages/tabs/tabs.js.map +3 -3
- package/dist/packages/textarea/react.d.ts +9 -9
- package/dist/packages/textarea/styles.js +2 -2
- package/dist/packages/textarea/textarea.a11y.test.js +1 -1
- package/dist/packages/textarea/textarea.d.ts +10 -10
- package/dist/packages/textarea/textarea.js +10 -10
- package/dist/packages/textarea/textarea.js.map +4 -4
- package/dist/packages/textarea/textarea.react.stories.d.ts +18 -18
- package/dist/packages/textfield/react.d.ts +9 -9
- package/dist/packages/textfield/styles.js +2 -2
- package/dist/packages/textfield/textfield.d.ts +22 -22
- package/dist/packages/textfield/textfield.js +10 -10
- package/dist/packages/textfield/textfield.js.map +3 -3
- package/dist/packages/textfield/textfield.react.stories.d.ts +18 -18
- package/dist/packages/toast/api.d.ts +1 -1
- package/dist/packages/toast/styles.js +2 -2
- package/dist/packages/toast/toast.d.ts +1 -1
- package/dist/packages/toast/toast.js +12 -12
- package/dist/packages/toast/toast.js.map +4 -4
- package/dist/packages/toast-container/styles.d.ts +1 -0
- package/dist/packages/toast-container/styles.js +2 -0
- 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 +170 -159
- package/eik/index.js +19 -2459
- package/package.json +3 -3
|
@@ -19,7 +19,7 @@ declare class WarpButton extends WarpButton_base {
|
|
|
19
19
|
static shadowRootOptions: {
|
|
20
20
|
delegatesFocus: boolean;
|
|
21
21
|
clonable?: boolean;
|
|
22
|
-
customElementRegistry?: CustomElementRegistry;
|
|
22
|
+
customElementRegistry?: CustomElementRegistry | null;
|
|
23
23
|
mode: ShadowRootMode;
|
|
24
24
|
serializable?: boolean;
|
|
25
25
|
slotAssignment?: SlotAssignmentMode;
|
|
@@ -28,7 +28,7 @@ declare class WarpButton extends WarpButton_base {
|
|
|
28
28
|
* Native button type.
|
|
29
29
|
* Controls whether the internal button behaves as a regular button, submits a form, or resets a form. Defaults to `button`.
|
|
30
30
|
*/
|
|
31
|
-
type: ButtonType;
|
|
31
|
+
type: ButtonType | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* Focuses the button when it is first rendered.
|
|
34
34
|
* Applies only when the component renders a native button. Link buttons with `href` do not autofocus through this component.
|
|
@@ -38,7 +38,7 @@ declare class WarpButton extends WarpButton_base {
|
|
|
38
38
|
* Visual style of the button.
|
|
39
39
|
* Defaults to `secondary`. Use the variant that matches the action priority, risk, and placement.
|
|
40
40
|
*/
|
|
41
|
-
variant: ButtonVariant;
|
|
41
|
+
variant: ButtonVariant | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* Deprecated quiet visual treatment flag
|
|
44
44
|
* Use `variant="quiet"` instead.
|
|
@@ -65,12 +65,12 @@ declare class WarpButton extends WarpButton_base {
|
|
|
65
65
|
* URL for rendering the button as a link.
|
|
66
66
|
* When set, the component renders `w-link` instead of a native `button`.
|
|
67
67
|
*/
|
|
68
|
-
href: string;
|
|
68
|
+
href: string | undefined;
|
|
69
69
|
/**
|
|
70
70
|
* Link browsing context.
|
|
71
71
|
* Passed to the rendered link when `href` is set.
|
|
72
72
|
*/
|
|
73
|
-
target: string;
|
|
73
|
+
target: string | undefined;
|
|
74
74
|
/**
|
|
75
75
|
* Visually disables the button.
|
|
76
76
|
* Disabled buttons are discouraged because they can hide the reason an action is unavailable.
|
|
@@ -80,7 +80,7 @@ declare class WarpButton extends WarpButton_base {
|
|
|
80
80
|
* Link relationship.
|
|
81
81
|
* Passed to the rendered link when `href` is set. If `target="_blank"` is set and `rel` is omitted, `noopener` is used.
|
|
82
82
|
*/
|
|
83
|
-
rel: string;
|
|
83
|
+
rel: string | undefined;
|
|
84
84
|
/**
|
|
85
85
|
* Makes the button fill its parent width.
|
|
86
86
|
* Useful in narrow layouts where the button should span the available inline space.
|
|
@@ -92,25 +92,25 @@ declare class WarpButton extends WarpButton_base {
|
|
|
92
92
|
*
|
|
93
93
|
* @deprecated This class is applied inside the shadow DOM and is unlikely to have the desired effect. Use attributes or CSS variables to customize the appearance of the button.
|
|
94
94
|
*/
|
|
95
|
-
buttonClass: string;
|
|
95
|
+
buttonClass: string | undefined;
|
|
96
96
|
/**
|
|
97
97
|
* Form control name.
|
|
98
98
|
* Used when the button participates in form handling.
|
|
99
99
|
*/
|
|
100
|
-
name: string;
|
|
100
|
+
name: string | undefined;
|
|
101
101
|
/**
|
|
102
102
|
* Form control value.
|
|
103
103
|
* Used with `name` when the button participates in form handling. Resets to its initial value when the form is reset.
|
|
104
104
|
*/
|
|
105
|
-
value: string;
|
|
105
|
+
value: string | undefined;
|
|
106
106
|
/**
|
|
107
107
|
* The [commandfor HTML attribute](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API#html_attributes) for Invoker Commands.
|
|
108
108
|
*/
|
|
109
|
-
commandfor: string;
|
|
109
|
+
commandfor: string | undefined;
|
|
110
110
|
/**
|
|
111
111
|
* The [command HTML attribute](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API#html_attributes) for Invoker Commands.
|
|
112
112
|
*/
|
|
113
|
-
command: string;
|
|
113
|
+
command: string | undefined;
|
|
114
114
|
private buttonEl;
|
|
115
115
|
private ariaValueTextLoading;
|
|
116
116
|
updated(changedProperties: PropertyValues<this>): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ne=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var le=o=>{throw TypeError(o)};var b=(o,e,r,t)=>{for(var a=t>1?void 0:t?je(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&&Ne(e,r,a),a};var ce=(o,e,r)=>e.has(o)||le("Cannot "+r);var de=(o,e,r)=>(ce(o,e,"read from private field"),r?r.call(o):e.get(o)),be=(o,e,r)=>e.has(o)?le("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r),ue=(o,e,r,t)=>(ce(o,e,"write to private field"),t?t.call(o,r):e.set(o,r),r);var S=o=>typeof o=="string",Ye=o=>typeof o=="function",he=new Map,ge="en";function W(o){return[...Array.isArray(o)?o:[o],ge]}function ee(o,e,r){let t=W(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 q(()=>R("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(S(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 ee(o,e,t)}function G(o,e,r){let t=W(o);return q(()=>R("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function ve(o,e,r,{offset:t=0,...a}){let l=W(o),s=e?q(()=>R("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):q(()=>R("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return a[r]??a[s.select(r-t)]??a.other}function q(o,e){let r=o(),t=he.get(r);return t||(t=e(),he.set(r,t)),t}function R(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}/,we=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)}}),me="%__lingui_octothorpe__%",qe=(o,e,r={})=>{let t=e||o,a=s=>typeof s=="object"?s:r[s],l=(s,n)=>{let h=Object.keys(r).length?a("number"):void 0,m=G(t,s,h);return n.replace(new RegExp(me,"g"),m)};return{plural:(s,n)=>{let{offset:h=0}=n,m=ve(t,!1,s,n);return l(s-h,m)},selectordinal:(s,n)=>{let{offset:h=0}=n,m=ve(t,!0,s,n);return l(s-h,m)},select:Re,number:(s,n)=>G(t,s,a(n)||{style:n}),date:(s,n)=>ee(t,s,a(n)||n),time:(s,n)=>De(t,s,a(n)||n)}},Re=(o,e)=>e[o]??e.other;function Qe(o,e,r){return(t={},a)=>{let l=qe(e,r,a),s=(h,m=!1)=>Array.isArray(h)?h.reduce((C,E)=>{if(E==="#"&&m)return C+me;if(S(E))return C+E;let[T,k,M]=E,F={};k==="plural"||k==="selectordinal"||k==="select"?Object.entries(M).forEach(([V,P])=>{F[V]=s(P,k==="plural"||k==="selectordinal")}):F=M;let f;if(k){let V=l[k];f=V(t[T],F)}else f=t[T];return f==null?C:C+f},""):h,n=s(o);return S(n)&&pe.test(n)?we(n):S(n)?n:n?String(n):""}}var Xe=Object.defineProperty,Ze=(o,e,r)=>e in o?Xe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,Ue=(o,e,r)=>(Ze(o,typeof e!="symbol"?e+"":e,r),r),J=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}},Be=Object.defineProperty,He=(o,e,r)=>e in o?Be(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,$=(o,e,r)=>(He(o,typeof e!="symbol"?e+"":e,r),r),K=class extends J{constructor(e){super(),$(this,"_locale",""),$(this,"_locales"),$(this,"_localeData",{}),$(this,"_messages",{}),$(this,"_missing"),$(this,"_messageCompiler"),$(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??ge,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=""),S(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 h=l||a||e;return S(h)&&(this._messageCompiler?h=this._messageCompiler(h):console.warn(`Uncompiled message detected! Message:
|
|
2
2
|
|
|
3
3
|
> ${h}
|
|
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
|
-
`)),S(h)&&pe.test(h)?we(h):S(h)?h:
|
|
9
|
+
`)),S(h)&&pe.test(h)?we(h):S(h)?h:Qe(h,this._locale,this._locales)(r,t?.formats)}date(e,r){return ee(this._locales||this._locale,e,r)}number(e,r){return G(this._locales||this._locale,e,r)}};function Ge(o={}){return new K(o)}var _=Ge();var d=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)},g=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 fe(o){var e,r,t,a,l,s,n,h,m,C,E,T,k,M,F,f,V,P,U;class Oe extends o{constructor(...i){var c,v,p;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),m.set(this,""),C.set(this,()=>{g(this,a,!0,"f"),g(this,r,!0,"f"),d(this,e,"m",f).call(this)}),E.set(this,()=>{g(this,r,!1,"f"),d(this,e,"m",V).call(this,this.shouldFormValueUpdate()?d(this,m,"f"):""),!this.validity.valid&&d(this,a,"f")&&g(this,t,!0,"f");let z=d(this,e,"m",f).call(this);this.validationMessageCallback&&this.validationMessageCallback(z?this.internals.validationMessage:"")}),T.set(this,()=>{var z;d(this,n,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),g(this,n,!1,"f")),g(this,a,!0,"f"),g(this,t,!0,"f"),d(this,e,"m",f).call(this),(z=this===null||this===void 0?void 0:this.validationMessageCallback)===null||z===void 0||z.call(this,this.showError?this.internals.validationMessage:"")}),k.set(this,void 0),M.set(this,!1),F.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",d(this,C,"f")),(v=this.addEventListener)===null||v===void 0||v.call(this,"blur",d(this,E,"f")),(p=this.addEventListener)===null||p===void 0||p.call(this,"invalid",d(this,T,"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(),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 v;if(c.attribute===i||!((v=c.attribute)===null||v===void 0)&&v.includes(i))return!0})}get form(){return this.internals.form}get showError(){return d(this,e,"m",f).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(i,c,v){var p;(p=super.attributeChangedCallback)===null||p===void 0||p.call(this,i,c,v);let O=this.constructor.getValidators(i);O?.length&&this.validationTarget&&this.setValue(d(this,m,"f"))}setValue(i){var c;g(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),g(this,m,i,"f");let p=this.shouldFormValueUpdate()?i:null;this.internals.setFormValue(p),d(this,e,"m",V).call(this,p),this.valueChangedCallback&&this.valueChangedCallback(p),d(this,e,"m",f).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(i=>i(d(this,F,"f")))}formResetCallback(){var i,c;g(this,a,!1,"f"),g(this,t,!1,"f"),d(this,e,"m",f).call(this),(i=this.resetFormControl)===null||i===void 0||i.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,d(this,e,"m",f).call(this)?this.validationMessage:"")}}return r=new WeakMap,t=new WeakMap,a=new WeakMap,l=new WeakMap,s=new WeakMap,n=new WeakMap,m=new WeakMap,C=new WeakMap,E=new WeakMap,T=new WeakMap,k=new WeakMap,M=new WeakMap,F=new WeakMap,e=new WeakSet,h=function(){let i=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return i.querySelectorAll(c)},f=function(){if(this.hasAttribute("disabled"))return!1;let i=d(this,t,"f")||d(this,a,"f")&&!this.validity.valid&&!d(this,r,"f");return i&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),i},V=function(i){let c=this.constructor,v={},p=c.validators,z=[],O=p.some(y=>y.isValid instanceof Promise);d(this,M,"f")||(g(this,F,new Promise(y=>{g(this,k,y,"f")}),"f"),g(this,M,!0,"f")),d(this,l,"f")&&(d(this,l,"f").abort(),g(this,s,d(this,l,"f"),"f"));let N=new AbortController;g(this,l,N,"f");let j,se=!1;p.length&&(p.forEach(y=>{let B=y.key||"customError",I=y.isValid(this,i,N.signal);I instanceof Promise?(z.push(I),I.then(H=>{H!=null&&(v[B]=!H,j=d(this,e,"m",U).call(this,y,i),d(this,e,"m",P).call(this,v,j))})):(v[B]=!I,this.validity[B]!==!I&&(se=!0),!I&&!j&&(j=d(this,e,"m",U).call(this,y,i)))}),Promise.allSettled(z).then(()=>{var y;N?.signal.aborted||(g(this,M,!1,"f"),(y=d(this,k,"f"))===null||y===void 0||y.call(this))}),(se||!O)&&d(this,e,"m",P).call(this,v,j))},P=function(i,c){if(this.validationTarget)this.internals.setValidity(i,c,this.validationTarget),g(this,n,!1,"f");else{if(this.internals.setValidity(i,c),this.internals.validity.valid)return;g(this,n,!0,"f")}},U=function(i,c){if(this.validityCallback){let v=this.validityCallback(i.key||"customError");if(v)return v}return i.message instanceof Function?i.message(this,c):i.message},Oe}import{html as Z,LitElement as Pe,nothing as sr}from"lit";import{property as w,query as lr}from"lit/decorators.js";var Je=["en","nb","fi","da","sv"],re="en",Q=o=>Je.find(e=>o===e||o.toLowerCase().includes(e))||re;function ye(){if(typeof window>"u"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return Q(o)}try{let o=ke(document);if(o)return Q(o);let e=rr();if(e)return Q(e);let r=ke(Ce());return r?Q(r):re}catch(o){return console.warn("could not detect locale, falling back to source locale",o),re}}var _e=(o,e,r,t,a)=>{_.load("en",o),_.load("nb",e),_.load("fi",r),_.load("da",t),_.load("sv",a);let l=ye();_.activate(l),ze(),We()},Ke="warp-i18n-change";function ze(){typeof window>"u"||window.dispatchEvent(new Event(Ke))}var xe=!1;function We(){if(xe||typeof window>"u"||!document?.documentElement)return;xe=!0;let o=()=>{let a=ye();_.locale!==a&&(_.activate(a),ze())},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=Ce();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=er();t&&e.observe(t,{attributes:!0,attributeFilter:["lang"]})}function Ce(){try{return window.parent?.document??null}catch{return null}}function ke(o){try{return o?.documentElement?.lang??""}catch{return""}}function er(){try{return window.frameElement??null}catch{return null}}function rr(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}import{html as ir,LitElement as Fe,nothing as nr}from"lit";import{property as L}from"lit/decorators.js";import{css as tr}from"lit";import{unsafeCSS as or}from"lit";var X=tr`
|
|
10
10
|
*,
|
|
11
11
|
:before,
|
|
12
12
|
:after {
|
|
@@ -279,7 +279,7 @@ Please compile your catalog first.
|
|
|
279
279
|
svg {
|
|
280
280
|
pointer-events: none;
|
|
281
281
|
}
|
|
282
|
-
`,
|
|
282
|
+
`,mr=or(`*, :before, :after {
|
|
283
283
|
--w-rotate: 0;
|
|
284
284
|
--w-rotate-x: 0;
|
|
285
285
|
--w-rotate-y: 0;
|
|
@@ -2144,8 +2144,8 @@ Please compile your catalog first.
|
|
|
2144
2144
|
overflow-wrap: break-word
|
|
2145
2145
|
}
|
|
2146
2146
|
|
|
2147
|
-
.before\\:content-\\[\\"
|
|
2148
|
-
content: "
|
|
2147
|
+
.before\\:content-\\[\\"\xE2\u20AC\u201C\\"\\]:before {
|
|
2148
|
+
content: "\xE2\u20AC\u201C"
|
|
2149
2149
|
}
|
|
2150
2150
|
|
|
2151
2151
|
.before\\:content-\\[\\"\\"\\]:before {
|
|
@@ -2445,7 +2445,7 @@ Please compile your catalog first.
|
|
|
2445
2445
|
display: none
|
|
2446
2446
|
}
|
|
2447
2447
|
}
|
|
2448
|
-
|
|
2448
|
+
`);import{css as ar}from"lit";import{css as Y}from"lit";var te=Y`
|
|
2449
2449
|
:host {
|
|
2450
2450
|
display: inline-block;
|
|
2451
2451
|
|
|
@@ -2463,7 +2463,7 @@ Please compile your catalog first.
|
|
|
2463
2463
|
--_border-color-hover: var(--w-c-button-border-color-hover, var(--w-s-color-border-hover));
|
|
2464
2464
|
--_border-color-active: var(--w-c-button-border-color-active, var(--w-s-color-border-active));
|
|
2465
2465
|
|
|
2466
|
-
--_radius: var(--w-c-button-radius, 8px);
|
|
2466
|
+
--_radius: var(--w-c-button-radius, var(--w-button-radius-default, 8px));
|
|
2467
2467
|
|
|
2468
2468
|
--_font-size: var(--w-c-button-font-size, var(--w-font-size-m));
|
|
2469
2469
|
--_line-height: var(--w-c-button-line-height, var(--w-line-height-m));
|
|
@@ -2518,7 +2518,7 @@ Please compile your catalog first.
|
|
|
2518
2518
|
:host([variant='utility']) {
|
|
2519
2519
|
--w-c-button-bg: var(--w-s-color-background);
|
|
2520
2520
|
--w-c-button-color: var(--w-s-color-text);
|
|
2521
|
-
--w-c-button-radius: 4px;
|
|
2521
|
+
--w-c-button-radius: var(--w-button-radius-utility, 4px);
|
|
2522
2522
|
--w-c-button-border-width: 1px;
|
|
2523
2523
|
}
|
|
2524
2524
|
|
|
@@ -2593,6 +2593,7 @@ Please compile your catalog first.
|
|
|
2593
2593
|
`,ie=Y`
|
|
2594
2594
|
:host([disabled]) {
|
|
2595
2595
|
pointer-events: none;
|
|
2596
|
+
cursor: default;
|
|
2596
2597
|
|
|
2597
2598
|
--w-c-button-bg: var(--w-s-color-background-disabled);
|
|
2598
2599
|
--w-c-button-bg-hover: var(--w-s-color-background-disabled);
|
|
@@ -2601,7 +2602,7 @@ Please compile your catalog first.
|
|
|
2601
2602
|
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
2602
2603
|
--w-c-button-border-width: 0px;
|
|
2603
2604
|
}
|
|
2604
|
-
`,
|
|
2605
|
+
`,Ee=Y`
|
|
2605
2606
|
${te}
|
|
2606
2607
|
|
|
2607
2608
|
/* ============================================================
|
|
@@ -2697,6 +2698,16 @@ Please compile your catalog first.
|
|
|
2697
2698
|
--w-c-button-color: var(--w-c-button-icon-color, var(--w-s-color-icon));
|
|
2698
2699
|
}
|
|
2699
2700
|
|
|
2701
|
+
:host([variant='pill']) button[part='base'] {
|
|
2702
|
+
min-height: 44px;
|
|
2703
|
+
min-width: 44px;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
:host([small][variant='pill']) button[part='base'] {
|
|
2707
|
+
min-height: 32px;
|
|
2708
|
+
min-width: 32px;
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2700
2711
|
/* Button-specific: link variant element styles */
|
|
2701
2712
|
:host([variant='link']) button[part='base'] {
|
|
2702
2713
|
display: inline;
|
|
@@ -2720,6 +2731,11 @@ Please compile your catalog first.
|
|
|
2720
2731
|
|
|
2721
2732
|
/* ===== Layout ===== */
|
|
2722
2733
|
|
|
2734
|
+
:host([full-width]) {
|
|
2735
|
+
display: block;
|
|
2736
|
+
width: 100%;
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2723
2739
|
:host([full-width]) button[part='base'],
|
|
2724
2740
|
:host([full-width]) > w-link[part='base'] {
|
|
2725
2741
|
width: 100%;
|
|
@@ -2812,7 +2828,7 @@ Please compile your catalog first.
|
|
|
2812
2828
|
background-position: 60px 0;
|
|
2813
2829
|
}
|
|
2814
2830
|
}
|
|
2815
|
-
`;var
|
|
2831
|
+
`;var Me=ar`
|
|
2816
2832
|
${te}
|
|
2817
2833
|
|
|
2818
2834
|
/* ============================================================
|
|
@@ -2879,25 +2895,30 @@ Please compile your catalog first.
|
|
|
2879
2895
|
${ae}
|
|
2880
2896
|
|
|
2881
2897
|
/* ===== Layout ===== */
|
|
2898
|
+
:host([full-width]) {
|
|
2899
|
+
display: block;
|
|
2900
|
+
width: 100%;
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2882
2903
|
:host([full-width]) a[part='base'] {
|
|
2883
2904
|
width: 100%;
|
|
2884
2905
|
}
|
|
2885
2906
|
|
|
2886
2907
|
/* ===== Disabled (shared from button) ===== */
|
|
2887
2908
|
${ie}
|
|
2888
|
-
`;var
|
|
2889
|
-
${
|
|
2909
|
+
`;var Se=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","quiet","link","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],x=class extends Fe{constructor(){super(...arguments);this.autofocus=!1;this.small=!1;this.disabled=!1;this.fullWidth=!1}connectedCallback(){if(super.connectedCallback(),this.variant&&!Se.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
2910
|
+
${Se.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){return ir`
|
|
2890
2911
|
<a
|
|
2891
2912
|
href="${this.href}"
|
|
2892
2913
|
part="base"
|
|
2893
2914
|
target="${this.target}"
|
|
2894
|
-
rel="${this.target==="_blank"?this.rel||"noopener":
|
|
2915
|
+
rel="${this.target==="_blank"?this.rel||"noopener":nr}"
|
|
2895
2916
|
tabindex="0"
|
|
2896
2917
|
>
|
|
2897
2918
|
<slot></slot>
|
|
2898
2919
|
</a>
|
|
2899
|
-
`}};x.shadowRootOptions={...
|
|
2900
|
-
${
|
|
2920
|
+
`}};x.shadowRootOptions={...Fe.shadowRootOptions,delegatesFocus:!0},x.styles=[X,Me],b([L({type:Boolean,reflect:!0})],x.prototype,"autofocus",2),b([L({reflect:!0})],x.prototype,"variant",2),b([L({type:Boolean,reflect:!0})],x.prototype,"small",2),b([L({reflect:!0})],x.prototype,"href",2),b([L({type:Boolean,reflect:!0})],x.prototype,"disabled",2),b([L({reflect:!0})],x.prototype,"target",2),b([L({reflect:!0})],x.prototype,"rel",2),b([L({attribute:"full-width",type:Boolean,reflect:!0})],x.prototype,"fullWidth",2);customElements.get("w-link")||customElements.define("w-link",x);import{ifDefined as ne}from"lit/directives/if-defined.js";var Le=JSON.parse('{"button.aria.loading":["Indl\xE6ser..."]}');var Ve=JSON.parse('{"button.aria.loading":["Loading..."]}');var $e=JSON.parse('{"button.aria.loading":["Ladataan..."]}');var Te=JSON.parse('{"button.aria.loading":["Laster..."]}');var Ie=JSON.parse('{"button.aria.loading":["Laddar ..."]}');var Ae=["primary","secondary","negative","negativeQuiet","utility","pill","link","quiet","utilityQuiet","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],D,u=class extends fe(Pe){constructor(){super();this.autofocus=!1;this.quiet=!1;this.iconOnly=!1;this.small=!1;this.loading=!1;this.disabled=!1;this.fullWidth=!1;be(this,D);_e(Ve,Te,$e,Le,Ie),this.ariaValueTextLoading=_.t({id:"button.aria.loading",message:"Loading...",comment:"Screen reader message for buttons that are loading"})}updated(r){r.has("value")&&this.setValue(this.value)}connectedCallback(){super.connectedCallback();let r=this.variant||"secondary";if(!Ae.includes(r))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
2921
|
+
${Ae.join(", ")}.`);ue(this,D,this.value)}closestWithId(r){let t=this.shadowRoot,a=null;try{for(;t;){if(a=t.getElementById(r),a)return a;t=t.getRootNode().host?.getRootNode()}}catch{}return document.getElementById(r)}firstUpdated(){this.autofocus&&!this.href&&setTimeout(()=>this.focus(),0),this.buttonEl&&this.commandfor&&(this.buttonEl.commandForElement=this.closestWithId(this.commandfor))}_handleButtonClick(){this.type==="submit"?this.internals.form.requestSubmit():this.type==="reset"&&this.internals.form.reset()}resetFormControl(){this.value=de(this,D)}render(){let r=this.variant||"secondary";return Z` ${this.href?Z`
|
|
2901
2922
|
<w-link
|
|
2902
2923
|
href=${this.href}
|
|
2903
2924
|
target=${this.target}
|
|
@@ -2928,5 +2949,5 @@ ${Oe.join(", ")}.`);ue(this,D,this.value)}closestWithId(r){let t=this.shadowRoot
|
|
|
2928
2949
|
role="progressbar"
|
|
2929
2950
|
aria-valuenow="{0}"
|
|
2930
2951
|
aria-valuetext=${this.ariaValueTextLoading}
|
|
2931
|
-
></span>`:
|
|
2952
|
+
></span>`:sr}`}};D=new WeakMap,u.styles=[X,Ee],u.shadowRootOptions={...Pe.shadowRootOptions,delegatesFocus:!0},b([w({reflect:!0})],u.prototype,"type",2),b([w({type:Boolean,reflect:!0})],u.prototype,"autofocus",2),b([w({reflect:!0})],u.prototype,"variant",2),b([w({type:Boolean,reflect:!0})],u.prototype,"quiet",2),b([w({type:Boolean,reflect:!0,attribute:"icon-only"})],u.prototype,"iconOnly",2),b([w({type:Boolean,reflect:!0})],u.prototype,"small",2),b([w({type:Boolean,reflect:!0})],u.prototype,"loading",2),b([w({reflect:!0})],u.prototype,"href",2),b([w({reflect:!0})],u.prototype,"target",2),b([w({type:Boolean,reflect:!0})],u.prototype,"disabled",2),b([w({reflect:!0})],u.prototype,"rel",2),b([w({attribute:"full-width",type:Boolean,reflect:!0})],u.prototype,"fullWidth",2),b([w({attribute:"button-class",reflect:!0})],u.prototype,"buttonClass",2),b([w({reflect:!0})],u.prototype,"name",2),b([w({reflect:!0})],u.prototype,"value",2),b([w()],u.prototype,"commandfor",2),b([w()],u.prototype,"command",2),b([lr("button")],u.prototype,"buttonEl",2);customElements.get("w-button")||customElements.define("w-button",u);export{u as WarpButton};
|
|
2932
2953
|
//# sourceMappingURL=button.js.map
|