@warp-ds/elements 2.6.0-next.4 → 2.6.0

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.
Files changed (65) hide show
  1. package/dist/custom-elements.json +145 -143
  2. package/dist/index.d.ts +52 -52
  3. package/dist/packages/affix/affix.d.ts +1 -2
  4. package/dist/packages/affix/affix.js +35 -19
  5. package/dist/packages/affix/affix.js.map +4 -4
  6. package/dist/packages/alert/alert.d.ts +2 -5
  7. package/dist/packages/alert/alert.js +32 -16
  8. package/dist/packages/alert/alert.js.map +4 -4
  9. package/dist/packages/alert/alert.test.js +1 -3
  10. package/dist/packages/attention/attention.d.ts +2 -2
  11. package/dist/packages/attention/attention.js +53 -26
  12. package/dist/packages/attention/attention.js.map +4 -4
  13. package/dist/packages/button/button.react.stories.d.ts +1 -1
  14. package/dist/packages/button/button.stories.d.ts +1 -4
  15. package/dist/packages/button/button.stories.js +11 -16
  16. package/dist/packages/card/card.d.ts +1 -1
  17. package/dist/packages/combobox/combobox.react.stories.d.ts +1 -1
  18. package/dist/packages/datepicker/datepicker.d.ts +1 -3
  19. package/dist/packages/datepicker/datepicker.js +66 -41
  20. package/dist/packages/datepicker/datepicker.js.map +4 -4
  21. package/dist/packages/datepicker/datepicker.react.stories.d.ts +1 -1
  22. package/dist/packages/expandable/expandable.d.ts +1 -2
  23. package/dist/packages/expandable/expandable.js +39 -23
  24. package/dist/packages/expandable/expandable.js.map +4 -4
  25. package/dist/packages/icon/icon.js +2 -2
  26. package/dist/packages/icon/icon.js.map +4 -4
  27. package/dist/packages/icon/icon.react.stories.js +274 -2
  28. package/dist/packages/icon/icon.stories.js +273 -1
  29. package/dist/packages/link/link.react.stories.d.ts +1 -1
  30. package/dist/packages/modal-header/modal-header.d.ts +1 -2
  31. package/dist/packages/modal-header/modal-header.js +39 -14
  32. package/dist/packages/modal-header/modal-header.js.map +4 -4
  33. package/dist/packages/page-indicator/page-indicator.test.js +40 -20
  34. package/dist/packages/pagination/pagination.a11y.test.d.ts +1 -0
  35. package/dist/packages/pagination/pagination.a11y.test.js +36 -0
  36. package/dist/packages/pagination/pagination.d.ts +1 -3
  37. package/dist/packages/pagination/pagination.js +57 -34
  38. package/dist/packages/pagination/pagination.js.map +4 -4
  39. package/dist/packages/pill/pill.d.ts +1 -1
  40. package/dist/packages/pill/pill.js +38 -13
  41. package/dist/packages/pill/pill.js.map +4 -4
  42. package/dist/packages/pill/pill.test.js +1 -3
  43. package/dist/packages/select/select.d.ts +1 -1
  44. package/dist/packages/select/select.js +44 -19
  45. package/dist/packages/select/select.js.map +4 -4
  46. package/dist/packages/select/select.react.stories.d.ts +1 -1
  47. package/dist/packages/step/step.d.ts +1 -1
  48. package/dist/packages/step/step.js +38 -13
  49. package/dist/packages/step/step.js.map +4 -4
  50. package/dist/packages/step-indicator/step-indicator.a11y.test.d.ts +2 -0
  51. package/dist/packages/step-indicator/step-indicator.a11y.test.js +66 -0
  52. package/dist/packages/textarea/textarea.a11y.test.d.ts +1 -0
  53. package/dist/packages/textarea/textarea.a11y.test.js +115 -0
  54. package/dist/packages/textarea/textarea.js +6 -6
  55. package/dist/packages/textarea/textarea.js.map +4 -4
  56. package/dist/packages/textarea/textarea.react.stories.d.ts +1 -1
  57. package/dist/packages/textarea/textarea.test.js +3 -1
  58. package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
  59. package/dist/packages/toast/toast.d.ts +1 -4
  60. package/dist/packages/toast/toast.js +38 -13
  61. package/dist/packages/toast/toast.js.map +4 -4
  62. package/dist/setup-tests.d.ts +10 -0
  63. package/dist/setup-tests.js +61 -0
  64. package/dist/web-types.json +47 -47
  65. package/package.json +2 -2
@@ -2,6 +2,147 @@
2
2
  "schemaVersion": "1.0.0",
3
3
  "readme": "",
4
4
  "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "packages/icon/icon.ts",
8
+ "declarations": [
9
+ {
10
+ "kind": "class",
11
+ "description": "",
12
+ "name": "WIcon",
13
+ "members": [
14
+ {
15
+ "kind": "field",
16
+ "name": "name",
17
+ "type": {
18
+ "text": "string"
19
+ },
20
+ "default": "''",
21
+ "description": "Icon filename (without .svg)",
22
+ "attribute": "name",
23
+ "reflects": true
24
+ },
25
+ {
26
+ "kind": "field",
27
+ "name": "size",
28
+ "type": {
29
+ "text": "'small' | 'medium' | 'large' | string"
30
+ },
31
+ "default": "'medium'",
32
+ "description": "Size: small, medium, large or pixel value (e.g. \"32px\")",
33
+ "attribute": "size",
34
+ "reflects": true
35
+ },
36
+ {
37
+ "kind": "field",
38
+ "name": "locale",
39
+ "type": {
40
+ "text": "string"
41
+ },
42
+ "default": "'en'",
43
+ "description": "Locale used in CDN URL",
44
+ "attribute": "locale",
45
+ "reflects": true
46
+ },
47
+ {
48
+ "kind": "field",
49
+ "name": "svg",
50
+ "type": {
51
+ "text": "SVGElement | null"
52
+ },
53
+ "privacy": "private",
54
+ "default": "null",
55
+ "description": "Parsed SVG element (not reflected as attribute)"
56
+ },
57
+ {
58
+ "kind": "method",
59
+ "name": "fetchIcon",
60
+ "privacy": "private",
61
+ "return": {
62
+ "type": {
63
+ "text": ""
64
+ }
65
+ },
66
+ "parameters": [
67
+ {
68
+ "name": "iconName",
69
+ "type": {
70
+ "text": "string"
71
+ },
72
+ "description": "Name of the icon file"
73
+ }
74
+ ],
75
+ "description": "Fetch an icon SVG from the CDN, with caching"
76
+ },
77
+ {
78
+ "kind": "method",
79
+ "name": "loadIcon",
80
+ "privacy": "private",
81
+ "return": {
82
+ "type": {
83
+ "text": "Promise<void>"
84
+ }
85
+ }
86
+ }
87
+ ],
88
+ "attributes": [
89
+ {
90
+ "name": "name",
91
+ "type": {
92
+ "text": "string"
93
+ },
94
+ "default": "''",
95
+ "description": "Icon filename (without .svg)",
96
+ "fieldName": "name"
97
+ },
98
+ {
99
+ "name": "size",
100
+ "type": {
101
+ "text": "'small' | 'medium' | 'large' | string"
102
+ },
103
+ "default": "'medium'",
104
+ "description": "Size: small, medium, large or pixel value (e.g. \"32px\")",
105
+ "fieldName": "size"
106
+ },
107
+ {
108
+ "name": "locale",
109
+ "type": {
110
+ "text": "string"
111
+ },
112
+ "default": "'en'",
113
+ "description": "Locale used in CDN URL",
114
+ "fieldName": "locale"
115
+ }
116
+ ],
117
+ "superclass": {
118
+ "name": "LitElement",
119
+ "package": "lit"
120
+ },
121
+ "tagName": "w-icon",
122
+ "customElement": true,
123
+ "modulePath": "packages/icon/icon.ts",
124
+ "definitionPath": "packages/icon/icon.ts"
125
+ }
126
+ ],
127
+ "exports": [
128
+ {
129
+ "kind": "js",
130
+ "name": "WIcon",
131
+ "declaration": {
132
+ "name": "WIcon",
133
+ "module": "packages/icon/icon.ts"
134
+ }
135
+ },
136
+ {
137
+ "kind": "custom-element-definition",
138
+ "name": "w-icon",
139
+ "declaration": {
140
+ "name": "WIcon",
141
+ "module": "packages/icon/icon.ts"
142
+ }
143
+ }
144
+ ]
145
+ },
5
146
  {
6
147
  "kind": "javascript-module",
7
148
  "path": "packages/affix/affix.ts",
@@ -2628,147 +2769,6 @@
2628
2769
  }
2629
2770
  ]
2630
2771
  },
2631
- {
2632
- "kind": "javascript-module",
2633
- "path": "packages/icon/icon.ts",
2634
- "declarations": [
2635
- {
2636
- "kind": "class",
2637
- "description": "",
2638
- "name": "WIcon",
2639
- "members": [
2640
- {
2641
- "kind": "field",
2642
- "name": "name",
2643
- "type": {
2644
- "text": "string"
2645
- },
2646
- "default": "''",
2647
- "description": "Icon filename (without .svg)",
2648
- "attribute": "name",
2649
- "reflects": true
2650
- },
2651
- {
2652
- "kind": "field",
2653
- "name": "size",
2654
- "type": {
2655
- "text": "'small' | 'medium' | 'large' | string"
2656
- },
2657
- "default": "'medium'",
2658
- "description": "Size: small, medium, large or pixel value (e.g. \"32px\")",
2659
- "attribute": "size",
2660
- "reflects": true
2661
- },
2662
- {
2663
- "kind": "field",
2664
- "name": "locale",
2665
- "type": {
2666
- "text": "string"
2667
- },
2668
- "default": "'en'",
2669
- "description": "Locale used in CDN URL",
2670
- "attribute": "locale",
2671
- "reflects": true
2672
- },
2673
- {
2674
- "kind": "field",
2675
- "name": "svg",
2676
- "type": {
2677
- "text": "SVGElement | null"
2678
- },
2679
- "privacy": "private",
2680
- "default": "null",
2681
- "description": "Parsed SVG element (not reflected as attribute)"
2682
- },
2683
- {
2684
- "kind": "method",
2685
- "name": "fetchIcon",
2686
- "privacy": "private",
2687
- "return": {
2688
- "type": {
2689
- "text": ""
2690
- }
2691
- },
2692
- "parameters": [
2693
- {
2694
- "name": "iconName",
2695
- "type": {
2696
- "text": "string"
2697
- },
2698
- "description": "Name of the icon file"
2699
- }
2700
- ],
2701
- "description": "Fetch an icon SVG from the CDN, with caching"
2702
- },
2703
- {
2704
- "kind": "method",
2705
- "name": "loadIcon",
2706
- "privacy": "private",
2707
- "return": {
2708
- "type": {
2709
- "text": "Promise<void>"
2710
- }
2711
- }
2712
- }
2713
- ],
2714
- "attributes": [
2715
- {
2716
- "name": "name",
2717
- "type": {
2718
- "text": "string"
2719
- },
2720
- "default": "''",
2721
- "description": "Icon filename (without .svg)",
2722
- "fieldName": "name"
2723
- },
2724
- {
2725
- "name": "size",
2726
- "type": {
2727
- "text": "'small' | 'medium' | 'large' | string"
2728
- },
2729
- "default": "'medium'",
2730
- "description": "Size: small, medium, large or pixel value (e.g. \"32px\")",
2731
- "fieldName": "size"
2732
- },
2733
- {
2734
- "name": "locale",
2735
- "type": {
2736
- "text": "string"
2737
- },
2738
- "default": "'en'",
2739
- "description": "Locale used in CDN URL",
2740
- "fieldName": "locale"
2741
- }
2742
- ],
2743
- "superclass": {
2744
- "name": "LitElement",
2745
- "package": "lit"
2746
- },
2747
- "tagName": "w-icon",
2748
- "customElement": true,
2749
- "modulePath": "packages/icon/icon.ts",
2750
- "definitionPath": "packages/icon/icon.ts"
2751
- }
2752
- ],
2753
- "exports": [
2754
- {
2755
- "kind": "js",
2756
- "name": "WIcon",
2757
- "declaration": {
2758
- "name": "WIcon",
2759
- "module": "packages/icon/icon.ts"
2760
- }
2761
- },
2762
- {
2763
- "kind": "custom-element-definition",
2764
- "name": "w-icon",
2765
- "declaration": {
2766
- "name": "WIcon",
2767
- "module": "packages/icon/icon.ts"
2768
- }
2769
- }
2770
- ]
2771
- },
2772
2772
  {
2773
2773
  "kind": "javascript-module",
2774
2774
  "path": "packages/modal/modal.ts",
@@ -4691,7 +4691,8 @@
4691
4691
  "type": {
4692
4692
  "text": "string"
4693
4693
  },
4694
- "attribute": "name"
4694
+ "attribute": "name",
4695
+ "reflects": true
4695
4696
  },
4696
4697
  {
4697
4698
  "kind": "field",
@@ -4699,7 +4700,8 @@
4699
4700
  "type": {
4700
4701
  "text": "string"
4701
4702
  },
4702
- "attribute": "placeholder"
4703
+ "attribute": "placeholder",
4704
+ "reflects": true
4703
4705
  },
4704
4706
  {
4705
4707
  "kind": "field",
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { WIcon } from "./packages/icon/icon.ts";
1
2
  import type { WarpAffix } from "./packages/affix/affix.ts";
2
3
  import type { WarpAlert } from "./packages/alert/alert.ts";
3
4
  import type { WarpLink } from "./packages/link/link.ts";
@@ -10,7 +11,6 @@ import type { WarpCard } from "./packages/card/card.ts";
10
11
  import type { WarpCombobox } from "./packages/combobox/combobox.ts";
11
12
  import type { WarpDatepicker } from "./packages/datepicker/datepicker.ts";
12
13
  import type { WarpExpandable } from "./packages/expandable/expandable.ts";
13
- import type { WIcon } from "./packages/icon/icon.ts";
14
14
  import type { ModalMain } from "./packages/modal/modal.ts";
15
15
  import type { ModalFooter } from "./packages/modal-footer/modal-footer.ts";
16
16
  import type { ModalHeader } from "./packages/modal-header/modal-header.ts";
@@ -100,6 +100,29 @@ type BaseProps<T extends HTMLElement> = {
100
100
 
101
101
  type BaseEvents = {};
102
102
 
103
+ export type WIconProps = {
104
+ /** Icon filename (without .svg) */
105
+ name?: WIcon["name"];
106
+ /** Size: small, medium, large or pixel value (e.g. "32px") */
107
+ size?: WIcon["size"];
108
+ /** Locale used in CDN URL */
109
+ locale?: WIcon["locale"];
110
+ };
111
+
112
+ export type WIconSolidJsProps = {
113
+ /** Icon filename (without .svg) */
114
+ "prop:name"?: WIcon["name"];
115
+ /** Size: small, medium, large or pixel value (e.g. "32px") */
116
+ "prop:size"?: WIcon["size"];
117
+ /** Locale used in CDN URL */
118
+ "prop:locale"?: WIcon["locale"];
119
+
120
+ /** Set the innerHTML of the element */
121
+ innerHTML?: string;
122
+ /** Set the textContent of the element */
123
+ textContent?: string | number;
124
+ };
125
+
103
126
  export type WarpAffixProps = {
104
127
  /** */
105
128
  "aria-label"?: WarpAffix["ariaLabel"];
@@ -756,29 +779,6 @@ export type WarpExpandableSolidJsProps = {
756
779
  textContent?: string | number;
757
780
  };
758
781
 
759
- export type WIconProps = {
760
- /** Icon filename (without .svg) */
761
- name?: WIcon["name"];
762
- /** Size: small, medium, large or pixel value (e.g. "32px") */
763
- size?: WIcon["size"];
764
- /** Locale used in CDN URL */
765
- locale?: WIcon["locale"];
766
- };
767
-
768
- export type WIconSolidJsProps = {
769
- /** Icon filename (without .svg) */
770
- "prop:name"?: WIcon["name"];
771
- /** Size: small, medium, large or pixel value (e.g. "32px") */
772
- "prop:size"?: WIcon["size"];
773
- /** Locale used in CDN URL */
774
- "prop:locale"?: WIcon["locale"];
775
-
776
- /** Set the innerHTML of the element */
777
- innerHTML?: string;
778
- /** Set the textContent of the element */
779
- textContent?: string | number;
780
- };
781
-
782
782
  export type ModalMainProps = {
783
783
  /** */
784
784
  show?: ModalMain["show"];
@@ -1442,6 +1442,19 @@ export type WarpToastContainerSolidJsProps = {
1442
1442
  };
1443
1443
 
1444
1444
  export type CustomElements = {
1445
+ /**
1446
+ *
1447
+ *
1448
+ * ## Attributes & Properties
1449
+ *
1450
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
1451
+ *
1452
+ * - `name`: Icon filename (without .svg)
1453
+ * - `size`: Size: small, medium, large or pixel value (e.g. "32px")
1454
+ * - `locale`: Locale used in CDN URL
1455
+ */
1456
+ "w-icon": Partial<WIconProps & BaseProps<WIcon> & BaseEvents>;
1457
+
1445
1458
  /**
1446
1459
  * This component is usually used in other components like form elements to show a prefix or suffix. See for example `w-textfield`.
1447
1460
  *
@@ -1758,19 +1771,6 @@ export type CustomElements = {
1758
1771
  WarpExpandableProps & BaseProps<WarpExpandable> & BaseEvents
1759
1772
  >;
1760
1773
 
1761
- /**
1762
- *
1763
- *
1764
- * ## Attributes & Properties
1765
- *
1766
- * Component attributes and properties that can be applied to the element or by using JavaScript.
1767
- *
1768
- * - `name`: Icon filename (without .svg)
1769
- * - `size`: Size: small, medium, large or pixel value (e.g. "32px")
1770
- * - `locale`: Locale used in CDN URL
1771
- */
1772
- "w-icon": Partial<WIconProps & BaseProps<WIcon> & BaseEvents>;
1773
-
1774
1774
  /**
1775
1775
  * Modals (or dialogs) display important information that users need to acknowledge.
1776
1776
  *
@@ -2192,6 +2192,21 @@ export type CustomElements = {
2192
2192
  };
2193
2193
 
2194
2194
  export type CustomElementsSolidJs = {
2195
+ /**
2196
+ *
2197
+ *
2198
+ * ## Attributes & Properties
2199
+ *
2200
+ * Component attributes and properties that can be applied to the element or by using JavaScript.
2201
+ *
2202
+ * - `name`: Icon filename (without .svg)
2203
+ * - `size`: Size: small, medium, large or pixel value (e.g. "32px")
2204
+ * - `locale`: Locale used in CDN URL
2205
+ */
2206
+ "w-icon": Partial<
2207
+ WIconProps & WIconSolidJsProps & BaseProps<WIcon> & BaseEvents
2208
+ >;
2209
+
2195
2210
  /**
2196
2211
  * This component is usually used in other components like form elements to show a prefix or suffix. See for example `w-textfield`.
2197
2212
  *
@@ -2540,21 +2555,6 @@ export type CustomElementsSolidJs = {
2540
2555
  BaseEvents
2541
2556
  >;
2542
2557
 
2543
- /**
2544
- *
2545
- *
2546
- * ## Attributes & Properties
2547
- *
2548
- * Component attributes and properties that can be applied to the element or by using JavaScript.
2549
- *
2550
- * - `name`: Icon filename (without .svg)
2551
- * - `size`: Size: small, medium, large or pixel value (e.g. "32px")
2552
- * - `locale`: Locale used in CDN URL
2553
- */
2554
- "w-icon": Partial<
2555
- WIconProps & WIconSolidJsProps & BaseProps<WIcon> & BaseEvents
2556
- >;
2557
-
2558
2558
  /**
2559
2559
  * Modals (or dialogs) display important information that users need to acknowledge.
2560
2560
  *
@@ -1,6 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
- import '@warp-ds/icons/elements/search-16';
3
- import '@warp-ds/icons/elements/close-16';
2
+ import '../icon/icon.js';
4
3
  /**
5
4
  * This component is usually used in other components like form elements to show a prefix or suffix. See for example `w-textfield`.
6
5
  *
@@ -1,5 +1,4 @@
1
- var be=Object.create;var S=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ue=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var he=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of pe(e))!ge.call(r,a)&&a!==o&&S(r,a,{get:()=>e[a],enumerable:!(t=A(e,a))||t.enumerable});return r};var me=(r,e,o)=>(o=r!=null?be(ue(r)):{},he(e||!r||!r.__esModule?S(o,"default",{value:r,enumerable:!0}):o,r));var x=(r,e,o,t)=>{for(var a=t>1?void 0:t?A(e,o):e,s=r.length-1,i;s>=0;s--)(i=r[s])&&(a=(t?i(e,o,a):i(a))||a);return t&&a&&S(e,o,a),a};var H=R(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.errorMessages=v.ErrorType=void 0;var w;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(w=v.ErrorType||(v.ErrorType={}));v.errorMessages=new Map([[w.MalformedUnicode,"malformed Unicode character escape sequence"],[w.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[w.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[w.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[w.EndOfString,"malformed escape sequence at end of string"]])});var K=R(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});p.unraw=p.errorMessages=p.ErrorType=void 0;var c=H();Object.defineProperty(p,"ErrorType",{enumerable:!0,get:function(){return c.ErrorType}});Object.defineProperty(p,"errorMessages",{enumerable:!0,get:function(){return c.errorMessages}});function fe(r){return!r.match(/[^a-f0-9]/i)?parseInt(r,16):NaN}function _(r,e,o){let t=fe(r);if(Number.isNaN(t)||o!==void 0&&o!==r.length)throw new SyntaxError(c.errorMessages.get(e));return t}function we(r){let e=_(r,c.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function J(r,e){let o=_(r,c.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=_(e,c.ErrorType.MalformedUnicode,4);return String.fromCharCode(o,t)}return String.fromCharCode(o)}function xe(r){return r.charAt(0)==="{"&&r.charAt(r.length-1)==="}"}function ke(r){if(!xe(r))throw new SyntaxError(c.errorMessages.get(c.ErrorType.MalformedUnicode));let e=r.slice(1,-1),o=_(e,c.ErrorType.MalformedUnicode);try{return String.fromCodePoint(o)}catch(t){throw t instanceof RangeError?new SyntaxError(c.errorMessages.get(c.ErrorType.CodePointLimit)):t}}function ye(r,e=!1){if(e)throw new SyntaxError(c.errorMessages.get(c.ErrorType.OctalDeprecation));let o=parseInt(r,8);return String.fromCharCode(o)}var _e=new Map([["b","\b"],["f","\f"],["n",`
2
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function ze(r){return _e.get(r)||r}var Ee=/\\(?:(\\)|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 q(r,e=!1){return r.replace(Ee,function(o,t,a,s,i,n,l,d,h){if(t!==void 0)return"\\";if(a!==void 0)return we(a);if(s!==void 0)return ke(s);if(i!==void 0)return J(i,n);if(l!==void 0)return J(l);if(d==="0")return"\0";if(d!==void 0)return ye(d,!e);if(h!==void 0)return ze(h);throw new SyntaxError(c.errorMessages.get(c.ErrorType.EndOfString))})}p.unraw=q;p.default=q});var N=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)?N.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};import{html as L,LitElement as cr}from"lit";import{property as C}from"lit/decorators.js";import{ifDefined as le}from"lit/directives/if-defined.js";import{css as U}from"lit";var X=U`
1
+ var _=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var i=(e,t,o,r)=>{for(var a=r>1?void 0:r?Y(t,o):t,l=e.length-1,b;l>=0;l--)(b=e[l])&&(a=(r?b(t,o,a):b(a))||a);return r&&a&&_(t,o,a),a};var p=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.reduce(function(o,r){return o.concat(typeof r=="string"?r:Array.isArray(r)?p.apply(void 0,r):typeof r=="object"&&r?Object.keys(r).map(function(a){return r[a]?a:""}):"")},[]).join(" ")};import{html as c,LitElement as B}from"lit";import{property as d}from"lit/decorators.js";import{ifDefined as y}from"lit/directives/if-defined.js";import{css as u}from"lit";var m=u`
3
2
  *,
4
3
  :before,
5
4
  :after {
@@ -272,7 +271,7 @@ var be=Object.create;var S=Object.defineProperty;var A=Object.getOwnPropertyDesc
272
271
  svg {
273
272
  pointer-events: none;
274
273
  }
275
- `,hr=U`*, :before, :after {
274
+ `,G=u`*, :before, :after {
276
275
  --w-rotate: 0;
277
276
  --w-rotate-x: 0;
278
277
  --w-rotate-y: 0;
@@ -2438,25 +2437,42 @@ var be=Object.create;var S=Object.defineProperty;var A=Object.getOwnPropertyDesc
2438
2437
  display: none
2439
2438
  }
2440
2439
  }
2441
- `;import{css as ve}from"lit";var Z=ve`*,: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{LitElement as Be}from"lit";import{unsafeStatic as Ye,html as Pe}from"lit/static-html.js";var Q=me(K(),1);var u=r=>typeof r=="string",Le=r=>typeof r=="function",G=new Map,W="en";function I(r){return[...Array.isArray(r)?r:[r],W]}function T(r,e,o){let t=I(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 z(()=>E("date",t,o),()=>new Intl.DateTimeFormat(t,a)).format(u(e)?new Date(e):e)}function Ce(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 T(r,e,t)}function j(r,e,o){let t=I(r);return z(()=>E("number",t,o),()=>new Intl.NumberFormat(t,o)).format(e)}function V(r,e,o,{offset:t=0,...a}){var n,l;let s=I(r),i=e?z(()=>E("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):z(()=>E("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return(l=(n=a[o])!=null?n:a[i.select(o-t)])!=null?l:a.other}function z(r,e){let o=r(),t=G.get(o);return t||(t=e(),G.set(o,t)),t}function E(r,e,o){let t=e.join("-");return`${r}-${t}-${JSON.stringify(o)}`}var ee=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,re="%__lingui_octothorpe__%",Me=(r,e,o={})=>{let t=e||r,a=i=>typeof i=="object"?i:o[i],s=(i,n)=>{let l=Object.keys(o).length?a("number"):void 0,d=j(t,i,l);return n.replace(new RegExp(re,"g"),d)};return{plural:(i,n)=>{let{offset:l=0}=n,d=V(t,!1,i,n);return s(i-l,d)},selectordinal:(i,n)=>{let{offset:l=0}=n,d=V(t,!0,i,n);return s(i-l,d)},select:Oe,number:(i,n)=>j(t,i,a(n)||{style:n}),date:(i,n)=>T(t,i,a(n)||n),time:(i,n)=>Ce(t,i,a(n)||n)}},Oe=(r,e)=>{var o;return(o=e[r])!=null?o:e.other};function Se(r,e,o){return(t={},a)=>{let s=Me(e,o,a),i=(l,d=!1)=>Array.isArray(l)?l.reduce((h,k)=>{if(k==="#"&&d)return h+re;if(u(k))return h+k;let[P,m,$]=k,M={};m==="plural"||m==="selectordinal"||m==="select"?Object.entries($).forEach(([O,de])=>{M[O]=i(de,m==="plural"||m==="selectordinal")}):M=$;let y;if(m){let O=s[m];y=O(t[P],M)}else y=t[P];return y==null?h:h+y},""):l,n=i(r);return u(n)&&ee.test(n)?(0,Q.unraw)(n):u(n)?n:n?String(n):""}}var Ne=Object.defineProperty,je=(r,e,o)=>e in r?Ne(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,De=(r,e,o)=>(je(r,typeof e!="symbol"?e+"":e,o),o),D=class{constructor(){De(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}},Fe=Object.defineProperty,Ie=(r,e,o)=>e in r?Fe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,f=(r,e,o)=>(Ie(r,typeof e!="symbol"?e+"":e,o),o),F=class extends D{constructor(e){var o;super(),f(this,"_locale",""),f(this,"_locales"),f(this,"_localeData",{}),f(this,"_messages",{}),f(this,"_missing"),f(this,"_messageCompiler"),f(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:W,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=""),u(e)||(o=e.values||o,a=e.message,e=e.id);let s=this.messages[e],i=s===void 0,n=this._missing;if(n&&i)return Le(n)?n(this._locale,e):n;i&&this.emit("missing",{id:e,locale:this._locale});let l=s||a||e;return u(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
2442
-
2443
- > ${l}
2444
-
2445
- That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
2446
- ICU features such as interpolation and plurals will not work properly for that message.
2447
-
2448
- Please compile your catalog first.
2449
- `)),u(l)&&ee.test(l)?JSON.parse(`"${l}"`):u(l)?l:Se(l,this._locale,this._locales)(o,t==null?void 0:t.formats)}date(e,o){return T(this._locales||this._locale,e,o)}number(e,o){return j(this._locales||this._locale,e,o)}};function Te(r={}){return new F(r)}var b=Te();var $e=JSON.parse('{"icon.title.search":["Forst\xF8rrelsesglass"]}'),Ae=JSON.parse('{"icon.title.search":["Magnifying glass"]}'),Re=JSON.parse('{"icon.title.search":["Suurennuslasi"]}'),Ue=JSON.parse('{"icon.title.search":["Forst\xF8rrelsesglas"]}'),Xe=JSON.parse('{"icon.title.search":["F\xF6rstoringsglas"]}'),oe=["en","nb","fi","da","sv"],te="en",Ze=()=>{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},ae=()=>{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":te},B=r=>oe.find(e=>r===e||r.toLowerCase().includes(e))||ae();function He(){var r;if(typeof window=="undefined"){let e=Ze();return B(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=ae();return oe.includes(e)?B(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),B(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),te}}var Je=(r,e,o,t,a,s)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?s:e,qe=(r,e,o,t,a)=>{let s=He(),i=Je(s,r,e,o,t,a);b.load(s,i),b.activate(s)};qe(Ae,$e,Re,Ue,Xe);var Ke=class extends Be{render(){let r=b.t({message:"Magnifying glass",id:"icon.title.search",comment:"Title for search icon"});return Pe`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-search-16-part">${Ye(`<title>${r}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8.905 12.102A6.042 6.042 0 1 0 4.18.981a6.042 6.042 0 0 0 4.726 11.121Zm1.909-1.289L15.5 15.5"></path></svg>`}};customElements.get("w-icon-search-16")||customElements.define("w-icon-search-16",Ke);import{LitElement as Ge}from"lit";import{unsafeStatic as Ve,html as Qe}from"lit/static-html.js";var We=JSON.parse('{"icon.title.close":["Kryss"]}'),er=JSON.parse('{"icon.title.close":["Cross"]}'),rr=JSON.parse('{"icon.title.close":["Rasti"]}'),or=JSON.parse('{"icon.title.close":["Kryds"]}'),tr=JSON.parse('{"icon.title.close":["Kryss"]}'),ie=["en","nb","fi","da","sv"],ne="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},se=()=>{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":ne},Y=r=>ie.find(e=>r===e||r.toLowerCase().includes(e))||se();function ir(){var r;if(typeof window=="undefined"){let e=ar();return Y(e)}try{let e=(r=document==null?void 0:document.documentElement)==null?void 0:r.lang,o=se();return ie.includes(e)?Y(e!=null?e:o):(console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname"),Y(o))}catch(e){return console.warn("could not detect locale, falling back to source locale",e),ne}}var nr=(r,e,o,t,a,s)=>r==="nb"?o:r==="fi"?t:r==="da"?a:r==="sv"?s:e,sr=(r,e,o,t,a)=>{let s=ir(),i=nr(s,r,e,o,t,a);b.load(s,i),b.activate(s)};sr(er,We,rr,or,tr);var lr=class extends Ge{render(){let r=b.t({message:"Cross",id:"icon.title.close",comment:"Title for close icon"});return Qe`<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">${Ve(`<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",lr);var ce="absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ",dr={wrapper:ce+"right-0",wrapperWithLabel:"w-max pr-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs s-text"},br={wrapper:ce+"left-0",wrapperWithLabel:"w-max pl-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs s-text"},g=class extends cr{constructor(){super(...arguments);this.clear=!1;this.search=!1}get _classBase(){return this.slot==="suffix"?dr:br}get _classes(){return N([this._classBase.wrapper,this.label?this._classBase.wrapperWithLabel:this._classBase.wrapperWithIcon])}get _searchButton(){return L`
2450
- <button aria-label="${le(this.ariaLabel)}" class="${this._classes}" type="submit">
2451
- <w-icon-search-16></w-icon-search-16>
2440
+ `;import{css as M}from"lit";var w=M`*,: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 L,LitElement as S}from"lit";import{property as g,state as $}from"lit/decorators.js";import{classMap as E}from"lit/directives/class-map.js";import{css as j}from"lit";var f=j`
2441
+ :host {
2442
+ display: inline-block;
2443
+ }
2444
+ .w-icon {
2445
+ --_w-icon-size: var(--w-icon-size, 24px);
2446
+ height: var(--_w-icon-size);
2447
+ width: var(--_w-icon-size);
2448
+ display: flex;
2449
+ }
2450
+ .w-icon svg {
2451
+ pointer-events: none;
2452
+ height: var(--_w-icon-size);
2453
+ width: var(--_w-icon-size);
2454
+ }
2455
+ .w-icon--s {
2456
+ --w-icon-size: 16px;
2457
+ }
2458
+ .w-icon--m {
2459
+ --w-icon-size: 24px;
2460
+ }
2461
+ .w-icon--l {
2462
+ --w-icon-size: 32px;
2463
+ }
2464
+
2465
+ `;var v=new Map,P='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function X(e,t={}){var r;let o=(r=t.responseParser)!=null?r:(a=>a.text());return v.has(e)||v.set(e,fetch(e).then(o)),v.get(e)}var n=class extends S{constructor(){super(...arguments);this.name="";this.size="medium";this.locale="en";this.svg=null}async fetchIcon(o){let r=`https://assets.finn.no/pkg/eikons/v1/${this.locale}/${o}.svg`;try{let a=await X(r);return new DOMParser().parseFromString(a,"text/html").body.querySelector("svg")}catch(a){return null}}firstUpdated(){this.loadIcon()}updated(o){(o.has("name")||o.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let o=await this.fetchIcon(this.name);o||(o=new DOMParser().parseFromString(P,"text/html").body.firstElementChild),this.svg=o}render(){let o={"w-icon":!0,"w-icon--s":this.size==="small","w-icon--m":this.size==="medium","w-icon--l":this.size==="large"},r=typeof this.size=="string"&&this.size.endsWith("px")?`--w-icon-size: ${this.size};`:"";return L`<div class="${E(o)}" style="${r}" part="w-${this.name.toLowerCase()}">${this.svg}</div>`}};n.styles=[f],i([g({type:String,reflect:!0})],n.prototype,"name",2),i([g({type:String,reflect:!0})],n.prototype,"size",2),i([g({type:String,reflect:!0})],n.prototype,"locale",2),i([$()],n.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",n);var Z=["en","nb","fi","da","sv"],k="en",x=e=>Z.find(t=>e===t||e.toLowerCase().includes(t))||k;function h(){if(typeof window=="undefined"){let e=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return x(e)}try{let e=document.documentElement.lang;return x(e)}catch(e){return console.warn("could not detect locale, falling back to source locale",e),k}}var z="absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ",T={wrapper:z+"right-0",wrapperWithLabel:"w-max pr-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs s-text"},R={wrapper:z+"left-0",wrapperWithLabel:"w-max pl-12",wrapperWithIcon:"w-40",label:"antialiased block relative cursor-default pb-0 font-bold text-xs s-text"},s=class extends B{constructor(){super(...arguments);this.clear=!1;this.search=!1}get _classBase(){return this.slot==="suffix"?T:R}get _classes(){return p([this._classBase.wrapper,this.label?this._classBase.wrapperWithLabel:this._classBase.wrapperWithIcon])}get _searchButton(){return c`
2466
+ <button aria-label="${y(this.ariaLabel)}" class="${this._classes}" type="submit">
2467
+ <w-icon name="Search" size="small" locale="${h()}" class="flex"></w-icon>
2452
2468
  </button>
2453
- `}get _clearButton(){return L`
2454
- <button aria-label="${le(this.ariaLabel)}" class="${this._classes}" type="reset">
2455
- <w-icon-close-16></w-icon-close-16>
2469
+ `}get _clearButton(){return c`
2470
+ <button aria-label="${y(this.ariaLabel)}" class="${this._classes}" type="reset">
2471
+ <w-icon name="Close" size="small" locale="${h()}" class="flex"></w-icon>
2456
2472
  </button>
2457
- `}get _text(){return L`
2473
+ `}get _text(){return c`
2458
2474
  <div class="${this._classes}">
2459
2475
  <span class="${this._classBase.label}">${this.label}</span>
2460
2476
  </div>
2461
- `}get _markup(){if(this.label)return this._text;if(this.search)return this._searchButton;if(this.clear)return this._clearButton}render(){return L`${this._markup}`}};g.styles=[X,Z],x([C({attribute:"aria-label"})],g.prototype,"ariaLabel",2),x([C({type:Boolean})],g.prototype,"clear",2),x([C({type:Boolean})],g.prototype,"search",2),x([C()],g.prototype,"label",2);customElements.get("w-affix")||customElements.define("w-affix",g);export{g as WarpAffix};
2477
+ `}get _markup(){if(this.label)return this._text;if(this.search)return this._searchButton;if(this.clear)return this._clearButton}render(){return c`${this._markup}`}};s.styles=[m,w],i([d({attribute:"aria-label"})],s.prototype,"ariaLabel",2),i([d({type:Boolean})],s.prototype,"clear",2),i([d({type:Boolean})],s.prototype,"search",2),i([d()],s.prototype,"label",2);customElements.get("w-affix")||customElements.define("w-affix",s);export{s as WarpAffix};
2462
2478
  //# sourceMappingURL=affix.js.map