@warp-ds/elements 2.8.2-next.1 → 2.8.2-next.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.
Files changed (84) hide show
  1. package/dist/custom-elements.json +37 -60
  2. package/dist/index.d.ts +3 -25
  3. package/dist/packages/affix/affix.js +5 -5
  4. package/dist/packages/affix/affix.js.map +3 -3
  5. package/dist/packages/alert/alert.d.ts +1 -0
  6. package/dist/packages/alert/alert.js +7 -7
  7. package/dist/packages/alert/alert.js.map +3 -3
  8. package/dist/packages/alert/alert.test.js +21 -0
  9. package/dist/packages/attention/attention.js +9 -9
  10. package/dist/packages/attention/attention.js.map +3 -3
  11. package/dist/packages/badge/badge.js +2 -2
  12. package/dist/packages/badge/badge.js.map +3 -3
  13. package/dist/packages/badge/badge.test.js +14 -0
  14. package/dist/packages/breadcrumbs/breadcrumbs.d.ts +1 -1
  15. package/dist/packages/breadcrumbs/breadcrumbs.js +7 -7
  16. package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
  17. package/dist/packages/breadcrumbs/breadcrumbs.test.js +3 -1
  18. package/dist/packages/button/button.js +7 -7
  19. package/dist/packages/button/button.js.map +3 -3
  20. package/dist/packages/combobox/combobox.js +2 -2
  21. package/dist/packages/combobox/combobox.js.map +2 -2
  22. package/dist/packages/combobox/combobox.test.js +5 -2
  23. package/dist/packages/datepicker/datepicker.js +5 -5
  24. package/dist/packages/datepicker/datepicker.js.map +3 -3
  25. package/dist/packages/expandable/expandable.js +11 -11
  26. package/dist/packages/expandable/expandable.js.map +3 -3
  27. package/dist/packages/icon/icon.js +2 -2
  28. package/dist/packages/icon/icon.js.map +3 -3
  29. package/dist/packages/icon/icon.test.d.ts +1 -0
  30. package/dist/packages/icon/icon.test.js +51 -0
  31. package/dist/packages/link/link.js +4 -4
  32. package/dist/packages/link/link.js.map +3 -3
  33. package/dist/packages/link/link.test.js +14 -0
  34. package/dist/packages/modal-header/modal-header.js +1 -1
  35. package/dist/packages/modal-header/modal-header.js.map +3 -3
  36. package/dist/packages/page-indicator/page-indicator.js +7 -7
  37. package/dist/packages/page-indicator/page-indicator.js.map +3 -3
  38. package/dist/packages/page-indicator/page-indicator.test.js +23 -0
  39. package/dist/packages/pagination/pagination.d.ts +4 -0
  40. package/dist/packages/pagination/pagination.js +14 -14
  41. package/dist/packages/pagination/pagination.js.map +3 -3
  42. package/dist/packages/pagination/pagination.react.stories.d.ts +1 -1
  43. package/dist/packages/pagination/pagination.test.js +18 -0
  44. package/dist/packages/pill/pill.js +5 -5
  45. package/dist/packages/pill/pill.js.map +3 -3
  46. package/dist/packages/radio/radio.a11y.test.js +15 -6
  47. package/dist/packages/radio/radio.js +2 -2
  48. package/dist/packages/radio/radio.js.map +2 -2
  49. package/dist/packages/radio/radio.test.js +7 -7
  50. package/dist/packages/radio-group/radio-group.js +9 -9
  51. package/dist/packages/radio-group/radio-group.js.map +2 -2
  52. package/dist/packages/radio-group/radio-group.test.js +3 -2
  53. package/dist/packages/select/select.js +13 -13
  54. package/dist/packages/select/select.js.map +3 -3
  55. package/dist/packages/slider/slider.test.js +41 -0
  56. package/dist/packages/slider-thumb/slider-thumb.js +1 -1
  57. package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
  58. package/dist/packages/step/step.d.ts +1 -0
  59. package/dist/packages/step/step.js +4 -4
  60. package/dist/packages/step/step.js.map +3 -3
  61. package/dist/packages/step-indicator/step-indicator.a11y.test.js +3 -1
  62. package/dist/packages/switch/switch.a11y.test.js +10 -6
  63. package/dist/packages/switch/switch.js +2 -2
  64. package/dist/packages/switch/switch.js.map +3 -3
  65. package/dist/packages/switch/switch.test.js +0 -5
  66. package/dist/packages/tab/tab.d.ts +2 -0
  67. package/dist/packages/tab/tab.js +5 -5
  68. package/dist/packages/tab/tab.js.map +3 -3
  69. package/dist/packages/tab-panel/tab-panel.d.ts +2 -1
  70. package/dist/packages/tab-panel/tab-panel.js +7 -3
  71. package/dist/packages/tab-panel/tab-panel.js.map +3 -3
  72. package/dist/packages/tabs/tabs.a11y.test.js +16 -7
  73. package/dist/packages/tabs/tabs.js +1 -1
  74. package/dist/packages/tabs/tabs.js.map +2 -2
  75. package/dist/packages/tabs/tabs.test.js +45 -1
  76. package/dist/packages/textfield/textfield.js +2 -2
  77. package/dist/packages/textfield/textfield.js.map +2 -2
  78. package/dist/packages/textfield/textfield.test.js +26 -0
  79. package/dist/packages/toast/toast.js +3 -3
  80. package/dist/packages/toast/toast.js.map +3 -3
  81. package/dist/packages/toast/toast.test.d.ts +1 -0
  82. package/dist/packages/toast/toast.test.js +58 -0
  83. package/dist/web-types.json +18 -52
  84. package/package.json +4 -3
@@ -28,7 +28,6 @@
28
28
  "type": {
29
29
  "text": "'small' | 'medium' | 'large' | string"
30
30
  },
31
- "default": "'medium'",
32
31
  "description": "Size: small, medium, large or pixel value (e.g. \"32px\")",
33
32
  "attribute": "size",
34
33
  "reflects": true
@@ -39,7 +38,6 @@
39
38
  "type": {
40
39
  "text": "string"
41
40
  },
42
- "default": "'en'",
43
41
  "description": "Locale used in CDN URL",
44
42
  "attribute": "locale",
45
43
  "reflects": true
@@ -100,7 +98,6 @@
100
98
  "type": {
101
99
  "text": "'small' | 'medium' | 'large' | string"
102
100
  },
103
- "default": "'medium'",
104
101
  "description": "Size: small, medium, large or pixel value (e.g. \"32px\")",
105
102
  "fieldName": "size"
106
103
  },
@@ -109,7 +106,6 @@
109
106
  "type": {
110
107
  "text": "string"
111
108
  },
112
- "default": "'en'",
113
109
  "description": "Locale used in CDN URL",
114
110
  "fieldName": "locale"
115
111
  }
@@ -261,13 +257,20 @@
261
257
  "description": "Alert is an inline component used for displaying different types of messages.\n\nFor accessibility reasons, alert should appear close to the element that triggered it.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/feedback-alert--docs)",
262
258
  "name": "WarpAlert",
263
259
  "members": [
260
+ {
261
+ "kind": "field",
262
+ "name": "_internals",
263
+ "type": {
264
+ "text": "ElementInternals"
265
+ },
266
+ "privacy": "private"
267
+ },
264
268
  {
265
269
  "kind": "field",
266
270
  "name": "variant",
267
271
  "type": {
268
272
  "text": "AlertVariants"
269
273
  },
270
- "default": "'info'",
271
274
  "attribute": "variant",
272
275
  "reflects": true,
273
276
  "parsedType": {
@@ -280,7 +283,6 @@
280
283
  "type": {
281
284
  "text": "boolean"
282
285
  },
283
- "default": "false",
284
286
  "attribute": "show",
285
287
  "reflects": true
286
288
  },
@@ -291,8 +293,7 @@
291
293
  "text": "string"
292
294
  },
293
295
  "default": "'alert'",
294
- "attribute": "role",
295
- "reflects": true
296
+ "attribute": "role"
296
297
  }
297
298
  ],
298
299
  "attributes": [
@@ -301,7 +302,6 @@
301
302
  "type": {
302
303
  "text": "AlertVariants"
303
304
  },
304
- "default": "'info'",
305
305
  "fieldName": "variant",
306
306
  "parsedType": {
307
307
  "text": "'negative' | 'positive' | 'warning' | 'info'"
@@ -312,7 +312,6 @@
312
312
  "type": {
313
313
  "text": "boolean"
314
314
  },
315
- "default": "false",
316
315
  "fieldName": "show"
317
316
  },
318
317
  {
@@ -387,7 +386,6 @@
387
386
  "type": {
388
387
  "text": "ButtonVariant"
389
388
  },
390
- "default": "'secondary'",
391
389
  "attribute": "variant",
392
390
  "reflects": true,
393
391
  "parsedType": {
@@ -466,7 +464,6 @@
466
464
  "type": {
467
465
  "text": "ButtonVariant"
468
466
  },
469
- "default": "'secondary'",
470
467
  "fieldName": "variant",
471
468
  "parsedType": {
472
469
  "text": "'negative' | 'primary' | 'secondary' | 'negativeQuiet' | 'utility' | 'quiet' | 'utilityQuiet' | 'overlay' | 'overlayInverted' | 'overlayQuiet' | 'overlayInvertedQuiet'"
@@ -571,7 +568,6 @@
571
568
  "type": {
572
569
  "text": "ButtonType"
573
570
  },
574
- "default": "'button'",
575
571
  "attribute": "type",
576
572
  "reflects": true,
577
573
  "parsedType": {
@@ -727,7 +723,6 @@
727
723
  "type": {
728
724
  "text": "ButtonType"
729
725
  },
730
- "default": "'button'",
731
726
  "fieldName": "type",
732
727
  "parsedType": {
733
728
  "text": "'button' | 'submit' | 'reset'"
@@ -1215,7 +1210,6 @@
1215
1210
  "type": {
1216
1211
  "text": "'neutral' | 'info' | 'positive' | 'warning' | 'negative' | 'disabled' | 'price' | 'sponsored'"
1217
1212
  },
1218
- "default": "'neutral'",
1219
1213
  "attribute": "variant",
1220
1214
  "reflects": true
1221
1215
  },
@@ -1235,7 +1229,6 @@
1235
1229
  "type": {
1236
1230
  "text": "'neutral' | 'info' | 'positive' | 'warning' | 'negative' | 'disabled' | 'price' | 'sponsored'"
1237
1231
  },
1238
- "default": "'neutral'",
1239
1232
  "fieldName": "variant"
1240
1233
  },
1241
1234
  {
@@ -1415,20 +1408,15 @@
1415
1408
  "members": [
1416
1409
  {
1417
1410
  "kind": "field",
1418
- "name": "ariaLabel",
1411
+ "name": "_internals",
1419
1412
  "type": {
1420
- "text": "string"
1413
+ "text": "ElementInternals"
1421
1414
  },
1422
- "attribute": "aria-label"
1423
- }
1424
- ],
1425
- "attributes": [
1415
+ "privacy": "private"
1416
+ },
1426
1417
  {
1427
- "name": "aria-label",
1428
- "type": {
1429
- "text": "string"
1430
- },
1431
- "fieldName": "ariaLabel"
1418
+ "kind": "field",
1419
+ "name": "ariaLabel"
1432
1420
  }
1433
1421
  ],
1434
1422
  "superclass": {
@@ -2490,7 +2478,6 @@
2490
2478
  "type": {
2491
2479
  "text": "string | undefined"
2492
2480
  },
2493
- "default": "'off'",
2494
2481
  "description": "Autocomplete attribute for the input field",
2495
2482
  "attribute": "autocomplete",
2496
2483
  "reflects": true
@@ -2872,7 +2859,6 @@
2872
2859
  "type": {
2873
2860
  "text": "string | undefined"
2874
2861
  },
2875
- "default": "'off'",
2876
2862
  "description": "Autocomplete attribute for the input field",
2877
2863
  "fieldName": "autocomplete"
2878
2864
  }
@@ -3997,7 +3983,6 @@
3997
3983
  "type": {
3998
3984
  "text": "number"
3999
3985
  },
4000
- "default": "1",
4001
3986
  "description": "Currently selected page (1-based index, clamped to valid range)",
4002
3987
  "attribute": "selected-page",
4003
3988
  "reflects": true
@@ -4008,7 +3993,6 @@
4008
3993
  "type": {
4009
3994
  "text": "number"
4010
3995
  },
4011
- "default": "1",
4012
3996
  "description": "Total number of pages (minimum 1)",
4013
3997
  "attribute": "page-count",
4014
3998
  "reflects": true
@@ -4040,7 +4024,6 @@
4040
4024
  "type": {
4041
4025
  "text": "number"
4042
4026
  },
4043
- "default": "1",
4044
4027
  "description": "Currently selected page (1-based index, clamped to valid range)",
4045
4028
  "fieldName": "selectedPage"
4046
4029
  },
@@ -4049,7 +4032,6 @@
4049
4032
  "type": {
4050
4033
  "text": "number"
4051
4034
  },
4052
- "default": "1",
4053
4035
  "description": "Total number of pages (minimum 1)",
4054
4036
  "fieldName": "pageCount"
4055
4037
  }
@@ -4116,7 +4098,6 @@
4116
4098
  "type": {
4117
4099
  "text": "number"
4118
4100
  },
4119
- "default": "1",
4120
4101
  "attribute": "current-page",
4121
4102
  "reflects": true
4122
4103
  },
@@ -4126,7 +4107,6 @@
4126
4107
  "type": {
4127
4108
  "text": "number"
4128
4109
  },
4129
- "default": "7",
4130
4110
  "attribute": "visible-pages",
4131
4111
  "reflects": true
4132
4112
  },
@@ -4173,7 +4153,6 @@
4173
4153
  "type": {
4174
4154
  "text": "number"
4175
4155
  },
4176
- "default": "1",
4177
4156
  "fieldName": "currentPageNumber"
4178
4157
  },
4179
4158
  {
@@ -4181,7 +4160,6 @@
4181
4160
  "type": {
4182
4161
  "text": "number"
4183
4162
  },
4184
- "default": "7",
4185
4163
  "fieldName": "visiblePages"
4186
4164
  }
4187
4165
  ],
@@ -5924,7 +5902,6 @@
5924
5902
  "type": {
5925
5903
  "text": "string"
5926
5904
  },
5927
- "default": "'text'",
5928
5905
  "attribute": "type",
5929
5906
  "reflects": true
5930
5907
  },
@@ -6140,7 +6117,6 @@
6140
6117
  "type": {
6141
6118
  "text": "string"
6142
6119
  },
6143
- "default": "'text'",
6144
6120
  "fieldName": "type"
6145
6121
  },
6146
6122
  {
@@ -6231,8 +6207,7 @@
6231
6207
  "type": {
6232
6208
  "text": "string"
6233
6209
  },
6234
- "attribute": "aria-label",
6235
- "reflects": true
6210
+ "attribute": "aria-label"
6236
6211
  },
6237
6212
  {
6238
6213
  "kind": "field",
@@ -6240,8 +6215,7 @@
6240
6215
  "type": {
6241
6216
  "text": "string"
6242
6217
  },
6243
- "attribute": "aria-description",
6244
- "reflects": true
6218
+ "attribute": "aria-description"
6245
6219
  },
6246
6220
  {
6247
6221
  "kind": "field",
@@ -7053,6 +7027,14 @@
7053
7027
  "privacy": "private",
7054
7028
  "default": "{ horizontal: false, right: false, isLast: false, isFirst: false }"
7055
7029
  },
7030
+ {
7031
+ "kind": "field",
7032
+ "name": "_internals",
7033
+ "type": {
7034
+ "text": "ElementInternals"
7035
+ },
7036
+ "privacy": "private"
7037
+ },
7056
7038
  {
7057
7039
  "kind": "method",
7058
7040
  "name": "setContext",
@@ -7364,6 +7346,14 @@
7364
7346
  "description": "Individual tab component used within w-tabs container.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/tabs--docs)",
7365
7347
  "name": "WarpTab",
7366
7348
  "members": [
7349
+ {
7350
+ "kind": "field",
7351
+ "name": "_internals",
7352
+ "type": {
7353
+ "text": "ElementInternals"
7354
+ },
7355
+ "privacy": "private"
7356
+ },
7367
7357
  {
7368
7358
  "kind": "field",
7369
7359
  "name": "_handleClick",
@@ -7395,8 +7385,7 @@
7395
7385
  "type": {
7396
7386
  "text": "'true' | 'false'"
7397
7387
  },
7398
- "attribute": "aria-selected",
7399
- "reflects": true
7388
+ "attribute": "aria-selected"
7400
7389
  },
7401
7390
  {
7402
7391
  "kind": "field",
@@ -7530,23 +7519,11 @@
7530
7519
  "members": [
7531
7520
  {
7532
7521
  "kind": "field",
7533
- "name": "hidden",
7534
- "type": {
7535
- "text": "boolean"
7536
- },
7537
- "default": "true",
7538
- "attribute": "hidden",
7539
- "reflects": true
7540
- }
7541
- ],
7542
- "attributes": [
7543
- {
7544
- "name": "hidden",
7522
+ "name": "_internals",
7545
7523
  "type": {
7546
- "text": "boolean"
7524
+ "text": "ElementInternals"
7547
7525
  },
7548
- "default": "true",
7549
- "fieldName": "hidden"
7526
+ "privacy": "private"
7550
7527
  }
7551
7528
  ],
7552
7529
  "superclass": {
package/dist/index.d.ts CHANGED
@@ -451,15 +451,11 @@ export type WarpBoxSolidJsProps = {
451
451
  };
452
452
 
453
453
  export type WarpBreadcrumbsProps = {
454
- /** */
455
- "aria-label"?: WarpBreadcrumbs["ariaLabel"];
456
454
  /** */
457
455
  ariaLabel?: WarpBreadcrumbs["ariaLabel"];
458
456
  };
459
457
 
460
458
  export type WarpBreadcrumbsSolidJsProps = {
461
- /** */
462
- "attr:aria-label"?: WarpBreadcrumbs["ariaLabel"];
463
459
  /** */
464
460
  "prop:ariaLabel"?: WarpBreadcrumbs["ariaLabel"];
465
461
 
@@ -1673,15 +1669,9 @@ export type WarpTabSolidJsProps = {
1673
1669
  textContent?: string | number;
1674
1670
  };
1675
1671
 
1676
- export type WarpTabPanelProps = {
1677
- /** */
1678
- hidden?: WarpTabPanel["hidden"];
1679
- };
1672
+ export type WarpTabPanelProps = {};
1680
1673
 
1681
1674
  export type WarpTabPanelSolidJsProps = {
1682
- /** */
1683
- "prop:hidden"?: WarpTabPanel["hidden"];
1684
-
1685
1675
  /** Set the innerHTML of the element */
1686
1676
  innerHTML?: string;
1687
1677
  /** Set the textContent of the element */
@@ -1986,7 +1976,7 @@ export type CustomElements = {
1986
1976
  *
1987
1977
  * Component attributes and properties that can be applied to the element or by using JavaScript.
1988
1978
  *
1989
- * - `aria-label`/`ariaLabel`: undefined
1979
+ * - `ariaLabel`: undefined (property only)
1990
1980
  */
1991
1981
  "w-breadcrumbs": Partial<
1992
1982
  WarpBreadcrumbsProps & BaseProps<WarpBreadcrumbs> & BaseEvents
@@ -2687,12 +2677,6 @@ export type CustomElements = {
2687
2677
  * Each tab panel should have a name that matches a corresponding tab.
2688
2678
  *
2689
2679
  * [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/tabs--docs)
2690
- *
2691
- * ## Attributes & Properties
2692
- *
2693
- * Component attributes and properties that can be applied to the element or by using JavaScript.
2694
- *
2695
- * - `hidden`: undefined
2696
2680
  */
2697
2681
  "w-tab-panel": Partial<
2698
2682
  WarpTabPanelProps & BaseProps<WarpTabPanel> & BaseEvents
@@ -2979,7 +2963,7 @@ export type CustomElementsSolidJs = {
2979
2963
  *
2980
2964
  * Component attributes and properties that can be applied to the element or by using JavaScript.
2981
2965
  *
2982
- * - `aria-label`/`ariaLabel`: undefined
2966
+ * - `ariaLabel`: undefined (property only)
2983
2967
  */
2984
2968
  "w-breadcrumbs": Partial<
2985
2969
  WarpBreadcrumbsProps &
@@ -3748,12 +3732,6 @@ export type CustomElementsSolidJs = {
3748
3732
  * Each tab panel should have a name that matches a corresponding tab.
3749
3733
  *
3750
3734
  * [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/tabs--docs)
3751
- *
3752
- * ## Attributes & Properties
3753
- *
3754
- * Component attributes and properties that can be applied to the element or by using JavaScript.
3755
- *
3756
- * - `hidden`: undefined
3757
3735
  */
3758
3736
  "w-tab-panel": Partial<
3759
3737
  WarpTabPanelProps &
@@ -1,4 +1,4 @@
1
- var L=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var i=(e,o,r,t)=>{for(var a=t>1?void 0:t?E(o,r):o,l=e.length-1,p;l>=0;l--)(p=e[l])&&(a=(t?p(o,r,a):p(a))||a);return t&&a&&L(o,r,a),a};var g=function(){for(var e=[],o=arguments.length;o--;)e[o]=arguments[o];return e.reduce(function(r,t){return r.concat(typeof t=="string"?t:Array.isArray(t)?g.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};import{html as d,LitElement as F}from"lit";import{property as b}from"lit/decorators.js";import{ifDefined as z}from"lit/directives/if-defined.js";import{css as w}from"lit";var f=w`
1
+ var L=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var i=(e,o,r,t)=>{for(var a=t>1?void 0:t?E(o,r):o,l=e.length-1,c;l>=0;l--)(c=e[l])&&(a=(t?c(o,r,a):c(a))||a);return t&&a&&L(o,r,a),a};var g=function(){for(var e=[],o=arguments.length;o--;)e[o]=arguments[o];return e.reduce(function(r,t){return r.concat(typeof t=="string"?t:Array.isArray(t)?g.apply(void 0,t):typeof t=="object"&&t?Object.keys(t).map(function(a){return t[a]?a:""}):"")},[]).join(" ")};import{html as b,LitElement as F}from"lit";import{property as p}from"lit/decorators.js";import{ifDefined as z}from"lit/directives/if-defined.js";import{css as w}from"lit";var f=w`
2
2
  *,
3
3
  :before,
4
4
  :after {
@@ -2462,17 +2462,17 @@ var L=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var i=(e,o,r,t
2462
2462
  --w-icon-size: 32px;
2463
2463
  }
2464
2464
 
2465
- `;var v=new Map,T='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function X(e,o={}){var t;let r=(t=o.responseParser)!=null?t:(a=>a.text());return v.has(e)||v.set(e,fetch(e).then(r)),v.get(e)}var n=class extends S{constructor(){super(...arguments);this.name="";this.size="medium";this.locale="en";this.svg=null}async fetchIcon(r){let t=`https://assets.finn.no/pkg/eikons/v1/${this.locale}/${r}.svg`;try{let a=await X(t);return new DOMParser().parseFromString(a,"text/html").body.querySelector("svg")}catch(a){return null}}firstUpdated(){this.loadIcon()}updated(r){(r.has("name")||r.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let r=await this.fetchIcon(this.name);r||(r=new DOMParser().parseFromString(T,"text/html").body.firstElementChild),this.svg=r}render(){let r={"w-icon":!0,"w-icon--s":this.size==="small","w-icon--m":this.size==="medium","w-icon--l":this.size==="large"},t=typeof this.size=="string"&&this.size.endsWith("px")?`--w-icon-size: ${this.size};`:"";return j`<div class="${P(r)}" style="${t}" part="w-${this.name.toLowerCase()}">${this.svg}</div>`}};n.styles=[k],i([u({type:String,reflect:!0})],n.prototype,"name",2),i([u({type:String,reflect:!0})],n.prototype,"size",2),i([u({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"],h="en",c=e=>Z.find(o=>e===o||e.toLowerCase().includes(o))||h;function m(){if(typeof window=="undefined"){let e=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return c(e)}try{let e=y(document);if(e)return c(e);let o=C();if(o)return c(o);let r=y(B());return r?c(r):h}catch(e){return console.warn("could not detect locale, falling back to source locale",e),h}}function B(){var e,o;try{return(o=(e=window.parent)==null?void 0:e.document)!=null?o:null}catch(r){return null}}function y(e){var o,r;try{return(r=(o=e==null?void 0:e.documentElement)==null?void 0:o.lang)!=null?r:""}catch(t){return""}}function C(){var e,o,r;try{return(r=(o=(e=window.frameElement)==null?void 0:e.getAttribute)==null?void 0:o.call(e,"lang"))!=null?r:""}catch(t){return""}}var _="absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ",O={wrapper:_+"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:_+"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 F{constructor(){super(...arguments);this.clear=!1;this.search=!1}get _classBase(){return this.slot==="suffix"?O:R}get _classes(){return g([this._classBase.wrapper,this.label?this._classBase.wrapperWithLabel:this._classBase.wrapperWithIcon])}get _searchButton(){return d`
2465
+ `;var v=new Map,T='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function X(e,o={}){var t;let r=(t=o.responseParser)!=null?t:(a=>a.text());return v.has(e)||v.set(e,fetch(e).then(r)),v.get(e)}var n=class extends S{constructor(){super(...arguments);this.name="";this.svg=null}async fetchIcon(r){let a=`https://assets.finn.no/pkg/eikons/v1/${this.locale||"en"}/${r}.svg`;try{let l=await X(a);return new DOMParser().parseFromString(l,"text/html").body.querySelector("svg")}catch(l){return null}}firstUpdated(){this.loadIcon()}updated(r){(r.has("name")||r.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let r=await this.fetchIcon(this.name);r||(r=new DOMParser().parseFromString(T,"text/html").body.firstElementChild),this.svg=r}render(){let r=this.size||"medium",t={"w-icon":!0,"w-icon--s":r==="small","w-icon--m":r==="medium","w-icon--l":r==="large"},a=typeof r=="string"&&r.endsWith("px")?`--w-icon-size: ${r};`:"";return j`<div class="${P(t)}" style="${a}" part="w-${this.name.toLowerCase()}">${this.svg}</div>`}};n.styles=[k],i([u({type:String,reflect:!0})],n.prototype,"name",2),i([u({type:String,reflect:!0})],n.prototype,"size",2),i([u({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"],h="en",d=e=>Z.find(o=>e===o||e.toLowerCase().includes(o))||h;function m(){if(typeof window=="undefined"){let e=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return d(e)}try{let e=y(document);if(e)return d(e);let o=C();if(o)return d(o);let r=y(B());return r?d(r):h}catch(e){return console.warn("could not detect locale, falling back to source locale",e),h}}function B(){var e,o;try{return(o=(e=window.parent)==null?void 0:e.document)!=null?o:null}catch(r){return null}}function y(e){var o,r;try{return(r=(o=e==null?void 0:e.documentElement)==null?void 0:o.lang)!=null?r:""}catch(t){return""}}function C(){var e,o,r;try{return(r=(o=(e=window.frameElement)==null?void 0:e.getAttribute)==null?void 0:o.call(e,"lang"))!=null?r:""}catch(t){return""}}var _="absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ",O={wrapper:_+"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:_+"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 F{constructor(){super(...arguments);this.clear=!1;this.search=!1}get _classBase(){return this.slot==="suffix"?O:R}get _classes(){return g([this._classBase.wrapper,this.label?this._classBase.wrapperWithLabel:this._classBase.wrapperWithIcon])}get _searchButton(){return b`
2466
2466
  <button aria-label="${z(this.ariaLabel)}" class="${this._classes}" type="submit">
2467
2467
  <w-icon name="Search" size="small" locale="${m()}" class="flex"></w-icon>
2468
2468
  </button>
2469
- `}get _clearButton(){return d`
2469
+ `}get _clearButton(){return b`
2470
2470
  <button aria-label="${z(this.ariaLabel)}" class="${this._classes}" type="reset">
2471
2471
  <w-icon name="Close" size="small" locale="${m()}" class="flex"></w-icon>
2472
2472
  </button>
2473
- `}get _text(){return d`
2473
+ `}get _text(){return b`
2474
2474
  <div class="${this._classes}">
2475
2475
  <span class="${this._classBase.label}">${this.label}</span>
2476
2476
  </div>
2477
- `}get _markup(){if(this.label)return this._text;if(this.search)return this._searchButton;if(this.clear)return this._clearButton}render(){return d`${this._markup}`}};s.styles=[f,x],i([b({attribute:"aria-label"})],s.prototype,"ariaLabel",2),i([b({type:Boolean})],s.prototype,"clear",2),i([b({type:Boolean})],s.prototype,"search",2),i([b()],s.prototype,"label",2);customElements.get("w-affix")||customElements.define("w-affix",s);export{s 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 b`${this._markup}`}};s.styles=[f,x],i([p({attribute:"aria-label"})],s.prototype,"ariaLabel",2),i([p({type:Boolean})],s.prototype,"clear",2),i([p({type:Boolean})],s.prototype,"search",2),i([p()],s.prototype,"label",2);customElements.get("w-affix")||customElements.define("w-affix",s);export{s as WarpAffix};
2478
2478
  //# sourceMappingURL=affix.js.map