@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.
- package/dist/custom-elements.json +145 -143
- package/dist/index.d.ts +52 -52
- package/dist/packages/affix/affix.d.ts +1 -2
- package/dist/packages/affix/affix.js +35 -19
- package/dist/packages/affix/affix.js.map +4 -4
- package/dist/packages/alert/alert.d.ts +2 -5
- package/dist/packages/alert/alert.js +32 -16
- package/dist/packages/alert/alert.js.map +4 -4
- package/dist/packages/alert/alert.test.js +1 -3
- package/dist/packages/attention/attention.d.ts +2 -2
- package/dist/packages/attention/attention.js +53 -26
- package/dist/packages/attention/attention.js.map +4 -4
- package/dist/packages/button/button.react.stories.d.ts +1 -1
- package/dist/packages/button/button.stories.d.ts +1 -4
- package/dist/packages/button/button.stories.js +11 -16
- package/dist/packages/card/card.d.ts +1 -1
- package/dist/packages/combobox/combobox.react.stories.d.ts +1 -1
- package/dist/packages/datepicker/datepicker.d.ts +1 -3
- package/dist/packages/datepicker/datepicker.js +66 -41
- package/dist/packages/datepicker/datepicker.js.map +4 -4
- package/dist/packages/datepicker/datepicker.react.stories.d.ts +1 -1
- package/dist/packages/expandable/expandable.d.ts +1 -2
- package/dist/packages/expandable/expandable.js +39 -23
- package/dist/packages/expandable/expandable.js.map +4 -4
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +4 -4
- package/dist/packages/icon/icon.react.stories.js +274 -2
- package/dist/packages/icon/icon.stories.js +273 -1
- package/dist/packages/link/link.react.stories.d.ts +1 -1
- package/dist/packages/modal-header/modal-header.d.ts +1 -2
- package/dist/packages/modal-header/modal-header.js +39 -14
- package/dist/packages/modal-header/modal-header.js.map +4 -4
- package/dist/packages/page-indicator/page-indicator.test.js +40 -20
- package/dist/packages/pagination/pagination.a11y.test.d.ts +1 -0
- package/dist/packages/pagination/pagination.a11y.test.js +36 -0
- package/dist/packages/pagination/pagination.d.ts +1 -3
- package/dist/packages/pagination/pagination.js +57 -34
- package/dist/packages/pagination/pagination.js.map +4 -4
- package/dist/packages/pill/pill.d.ts +1 -1
- package/dist/packages/pill/pill.js +38 -13
- package/dist/packages/pill/pill.js.map +4 -4
- package/dist/packages/pill/pill.test.js +1 -3
- package/dist/packages/select/select.d.ts +1 -1
- package/dist/packages/select/select.js +44 -19
- package/dist/packages/select/select.js.map +4 -4
- package/dist/packages/select/select.react.stories.d.ts +1 -1
- package/dist/packages/step/step.d.ts +1 -1
- package/dist/packages/step/step.js +38 -13
- package/dist/packages/step/step.js.map +4 -4
- package/dist/packages/step-indicator/step-indicator.a11y.test.d.ts +2 -0
- package/dist/packages/step-indicator/step-indicator.a11y.test.js +66 -0
- package/dist/packages/textarea/textarea.a11y.test.d.ts +1 -0
- package/dist/packages/textarea/textarea.a11y.test.js +115 -0
- package/dist/packages/textarea/textarea.js +6 -6
- package/dist/packages/textarea/textarea.js.map +4 -4
- package/dist/packages/textarea/textarea.react.stories.d.ts +1 -1
- package/dist/packages/textarea/textarea.test.js +3 -1
- package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
- package/dist/packages/toast/toast.d.ts +1 -4
- package/dist/packages/toast/toast.js +38 -13
- package/dist/packages/toast/toast.js.map +4 -4
- package/dist/setup-tests.d.ts +10 -0
- package/dist/setup-tests.js +61 -0
- package/dist/web-types.json +47 -47
- 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 '
|
|
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
|
|
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
|
-
`,
|
|
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
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
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
|
|
2454
|
-
<button aria-label="${
|
|
2455
|
-
<w-icon
|
|
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
|
|
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
|
|
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
|