@proximus/lavender-accordion 2.0.0-alpha.20 → 2.0.0-alpha.201
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/Accordion.d.ts +4 -4
- package/dist/custom-elements.json +217 -0
- package/dist/index.es.js +87 -116
- package/dist/vscode.css-custom-data.json +6 -0
- package/dist/vscode.html-custom-data.json +17 -0
- package/dist/web-types.json +40 -0
- package/package.json +2 -2
package/dist/Accordion.d.ts
CHANGED
|
@@ -15,10 +15,10 @@ export declare class Accordion extends PxElement<HTMLDivElement> {
|
|
|
15
15
|
updateAriaExpanded(): void;
|
|
16
16
|
get $summary(): HTMLElement;
|
|
17
17
|
get $details(): HTMLDetailsElement;
|
|
18
|
-
get variant(): string;
|
|
19
|
-
set variant(value: string);
|
|
20
|
-
get backgroundColor(): string;
|
|
21
|
-
set backgroundColor(value: string);
|
|
18
|
+
get variant(): string | null;
|
|
19
|
+
set variant(value: string | null);
|
|
20
|
+
get backgroundColor(): string | null;
|
|
21
|
+
set backgroundColor(value: string | null);
|
|
22
22
|
get inverted(): boolean;
|
|
23
23
|
set inverted(value: boolean);
|
|
24
24
|
get noContentPadding(): boolean;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/Accordion.ts",
|
|
8
|
+
"declarations": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "variable",
|
|
11
|
+
"name": "accordionVariantValues",
|
|
12
|
+
"type": {
|
|
13
|
+
"text": "[\n '',\n 'none',\n 'single',\n 'contained',\n]"
|
|
14
|
+
},
|
|
15
|
+
"default": "[ '', 'none', 'single', 'contained', ]"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"kind": "variable",
|
|
19
|
+
"name": "accordionBackgroundColorValues",
|
|
20
|
+
"type": {
|
|
21
|
+
"text": "array"
|
|
22
|
+
},
|
|
23
|
+
"default": "[ '', 'container-default', 'container-light', ]"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"kind": "class",
|
|
27
|
+
"description": "",
|
|
28
|
+
"name": "Accordion",
|
|
29
|
+
"members": [
|
|
30
|
+
{
|
|
31
|
+
"kind": "field",
|
|
32
|
+
"name": "nativeName",
|
|
33
|
+
"type": {
|
|
34
|
+
"text": "string"
|
|
35
|
+
},
|
|
36
|
+
"static": true,
|
|
37
|
+
"default": "'details'"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"kind": "field",
|
|
41
|
+
"name": "isSafari",
|
|
42
|
+
"privacy": "private"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"kind": "field",
|
|
46
|
+
"name": "template",
|
|
47
|
+
"privacy": "private"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"kind": "method",
|
|
51
|
+
"name": "updateAttribute",
|
|
52
|
+
"parameters": [
|
|
53
|
+
{
|
|
54
|
+
"name": "attrName",
|
|
55
|
+
"type": {
|
|
56
|
+
"text": "string"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "oldValue",
|
|
61
|
+
"type": {
|
|
62
|
+
"text": "string"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "newValue",
|
|
67
|
+
"type": {
|
|
68
|
+
"text": "string"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "attrValues",
|
|
73
|
+
"type": {
|
|
74
|
+
"text": "readonly string[]"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"kind": "method",
|
|
81
|
+
"name": "updateBackgroundColor",
|
|
82
|
+
"parameters": [
|
|
83
|
+
{
|
|
84
|
+
"name": "attrName",
|
|
85
|
+
"type": {
|
|
86
|
+
"text": "string"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "newValue",
|
|
91
|
+
"type": {
|
|
92
|
+
"text": "string"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "attrValue",
|
|
97
|
+
"type": {
|
|
98
|
+
"text": "string[]"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"kind": "method",
|
|
105
|
+
"name": "updateAriaExpanded"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"kind": "field",
|
|
109
|
+
"name": "$summary",
|
|
110
|
+
"readonly": true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"kind": "field",
|
|
114
|
+
"name": "$details",
|
|
115
|
+
"readonly": true
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"kind": "field",
|
|
119
|
+
"name": "variant"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"kind": "field",
|
|
123
|
+
"name": "backgroundColor"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"kind": "field",
|
|
127
|
+
"name": "inverted"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"kind": "field",
|
|
131
|
+
"name": "noContentPadding"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"kind": "field",
|
|
135
|
+
"name": "innerHTML"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"attributes": [
|
|
139
|
+
{
|
|
140
|
+
"name": "variant"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "background-color"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "inverted"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "no-content-padding"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"superclass": {
|
|
153
|
+
"name": "PxElement",
|
|
154
|
+
"package": "@proximus/lavender-common"
|
|
155
|
+
},
|
|
156
|
+
"tagName": "px-accordion",
|
|
157
|
+
"customElement": true
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"exports": [
|
|
161
|
+
{
|
|
162
|
+
"kind": "js",
|
|
163
|
+
"name": "accordionVariantValues",
|
|
164
|
+
"declaration": {
|
|
165
|
+
"name": "accordionVariantValues",
|
|
166
|
+
"module": "src/Accordion.ts"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"kind": "js",
|
|
171
|
+
"name": "accordionBackgroundColorValues",
|
|
172
|
+
"declaration": {
|
|
173
|
+
"name": "accordionBackgroundColorValues",
|
|
174
|
+
"module": "src/Accordion.ts"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"kind": "js",
|
|
179
|
+
"name": "Accordion",
|
|
180
|
+
"declaration": {
|
|
181
|
+
"name": "Accordion",
|
|
182
|
+
"module": "src/Accordion.ts"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"kind": "custom-element-definition",
|
|
187
|
+
"name": "px-accordion",
|
|
188
|
+
"declaration": {
|
|
189
|
+
"name": "Accordion",
|
|
190
|
+
"module": "src/Accordion.ts"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"kind": "javascript-module",
|
|
197
|
+
"path": "src/accordion.css",
|
|
198
|
+
"declarations": [],
|
|
199
|
+
"exports": []
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"kind": "javascript-module",
|
|
203
|
+
"path": "src/index.ts",
|
|
204
|
+
"declarations": [],
|
|
205
|
+
"exports": [
|
|
206
|
+
{
|
|
207
|
+
"kind": "js",
|
|
208
|
+
"name": "*",
|
|
209
|
+
"declaration": {
|
|
210
|
+
"name": "*",
|
|
211
|
+
"module": "src/Accordion"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
}
|
package/dist/index.es.js
CHANGED
|
@@ -1,118 +1,89 @@
|
|
|
1
1
|
import "@proximus/lavender-layout";
|
|
2
|
-
import { PxElement as
|
|
3
|
-
|
|
4
|
-
n.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
get variant() {
|
|
87
|
-
return this.getAttribute("variant");
|
|
88
|
-
}
|
|
89
|
-
set variant(e) {
|
|
90
|
-
this.setAttribute("variant", e);
|
|
91
|
-
}
|
|
92
|
-
get backgroundColor() {
|
|
93
|
-
return this.getAttribute("background-color");
|
|
94
|
-
}
|
|
95
|
-
set backgroundColor(e) {
|
|
96
|
-
this.setAttribute("background-color", e);
|
|
97
|
-
}
|
|
98
|
-
get inverted() {
|
|
99
|
-
return this.hasAttribute("inverted");
|
|
100
|
-
}
|
|
101
|
-
set inverted(e) {
|
|
102
|
-
e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
103
|
-
}
|
|
104
|
-
get noContentPadding() {
|
|
105
|
-
return this.hasAttribute("no-content-padding");
|
|
106
|
-
}
|
|
107
|
-
set noContentPadding(e) {
|
|
108
|
-
e ? this.setAttribute("no-content-padding", "") : this.removeAttribute("no-content-padding");
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
o.nativeName = "details";
|
|
112
|
-
let a = o;
|
|
113
|
-
customElements.get("px-accordion") || customElements.define("px-accordion", a);
|
|
114
|
-
export {
|
|
115
|
-
a as Accordion,
|
|
116
|
-
p as accordionBackgroundColorValues,
|
|
117
|
-
c as accordionVariantValues
|
|
2
|
+
import { PxElement as e, log as t } from "@proximus/lavender-common";
|
|
3
|
+
//#region src/accordion.css?inline
|
|
4
|
+
var n = "details{font-family:var(--px-font-family);flex-direction:column;display:flex}details summary{font-size:var(--px-text-size-label-m-mobile);align-self:flex-start;align-items:center;transition:all .2s ease-out,-webkit-backdrop-filter,backdrop-filter}details summary .arrow-icon{width:var(--px-size-icon-m);height:var(--px-size-icon-m);background-color:var(--px-color-background-container-secondary-default);border-radius:var(--px-radius-pill);flex-shrink:0;justify-content:center;align-items:center;transition:all .2s ease-out,-webkit-backdrop-filter,backdrop-filter;display:flex}details summary .arrow-icon:after{content:\"\";width:var(--px-size-icon-xs);height:var(--px-size-icon-xs);color:var(--px-color-icon-brand-default);background-color:currentColor;transition:all .2s ease-out,-webkit-backdrop-filter,backdrop-filter;-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cg id='CHEVRON DOWN'%3E%3Cpath id='Vector' fill-rule='evenodd' clip-rule='evenodd' d='M12.4714 6.19524C12.2111 5.93489 11.7889 5.93489 11.5286 6.19524L8 9.72384L4.4714 6.19524C4.21105 5.93489 3.78894 5.93489 3.52859 6.19524C3.26824 6.45559 3.26824 6.8777 3.52859 7.13805L7.52859 11.1381C7.78894 11.3984 8.21105 11.3984 8.4714 11.1381L12.4714 7.13805C12.7318 6.8777 12.7318 6.45559 12.4714 6.19524Z' fill='%235C2D91'/%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cg id='CHEVRON DOWN'%3E%3Cpath id='Vector' fill-rule='evenodd' clip-rule='evenodd' d='M12.4714 6.19524C12.2111 5.93489 11.7889 5.93489 11.5286 6.19524L8 9.72384L4.4714 6.19524C4.21105 5.93489 3.78894 5.93489 3.52859 6.19524C3.26824 6.45559 3.26824 6.8777 3.52859 7.13805L7.52859 11.1381C7.78894 11.3984 8.21105 11.3984 8.4714 11.1381L12.4714 7.13805C12.7318 6.8777 12.7318 6.45559 12.4714 6.19524Z' fill='%235C2D91'/%3E%3C/g%3E%3C/svg%3E\");-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:cover;mask-size:cover;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}details summary:hover{cursor:pointer}details summary:hover .arrow-icon{background-color:var(--px-color-background-state-hover-bordered-default);border-color:var(--px-color-border-state-hover-default);-webkit-backdrop-filter:blur(15px);backdrop-filter:blur(15px)}details:not(.single):not(.contained){border-bottom:var(--px-size-border-m) solid var(--px-color-border-main-default)}details:not(.single) ::slotted([slot=title]){flex-grow:1}details:not(.single) slot[name=content]{padding:var(--px-padding-m-mobile);display:block}details:not(.single) summary{padding:var(--px-padding-m-mobile);gap:var(--px-spacing-s-mobile);align-self:stretch;display:flex}details:not(.single) summary .arrow-icon{border:var(--px-size-border-m) solid transparent}details:not(.single) summary:hover{background-color:var(--px-color-background-state-hover-default)}details:not(.single) summary:hover .arrow-icon{border-color:var(--px-color-border-state-hover-default)}details:not(.single).contained{border-radius:var(--px-radius-main);border:var(--px-size-border-m) solid var(--px-color-border-none-default);background-color:var(--accordion-contained-background-color-default,var(--px-color-background-container-default-default))}details:not(.single).contained summary{padding:var(--px-padding-m-mobile);font-size:var(--px-text-size-label-l-mobile);font-weight:var(--px-font-weight-title);color:var(--px-color-text-brand-default)}details:not(.single).contained summary:hover{background-color:var(--px-color-background-none)}details:not(.single).contained:has(summary:hover){background-color:var(--px-color-background-state-hover-bordered-default);border-color:var(--px-color-border-state-hover-default)}details:not(.single).contained[no-content-padding] slot[name=content]{padding:0}details.single summary{padding-block:var(--px-padding-2xs-mobile);gap:var(--px-spacing-xs-mobile);color:var(--px-color-text-brand-default);font-weight:var(--px-font-weight-title);border:var(--px-size-border-m) solid transparent;border-radius:var(--px-radius-pill);justify-content:center;display:inline-flex}details.single summary:hover{gap:var(--px-spacing-2xs-mobile);padding:var(--px-padding-2xs-mobile) var(--px-padding-s-mobile);border-color:var(--px-color-border-state-hover-default)}details.single summary:hover .arrow-icon{margin-right:calc(var(--px-padding-xs-mobile) * -1);background-color:#0000;border-color:#0000}details.single slot[name=content]{padding-top:var(--px-spacing-s-mobile);display:block}details[open] summary slot[name=title]{color:var(--px-color-text-brand-default);font-weight:var(--px-font-weight-title)}details[open] summary .arrow-icon:after{transform:rotate(180deg)}summary::-webkit-details-marker{display:none}:host([inverted]) details{color:var(--px-color-text-neutral-inverted)}:host([inverted]) details summary .arrow-icon{background-color:var(--px-color-background-container-secondary-inverted)}:host([inverted]) details summary .arrow-icon:after{color:var(--px-color-icon-brand-inverted)}:host([inverted]) details summary:hover .arrow-icon{background-color:var(--px-color-background-state-hover-default);border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]) details:not(.single){border-bottom-color:var(--px-color-border-main-inverted)}:host([inverted]) details:not(.single) summary:hover{background-color:var(--px-color-background-state-hover-inverted)}:host([inverted]) details:not(.single).contained{background-color:var(--accordion-contained-background-color-inverted,var(--px-color-background-container-default-inverted));border-color:var(--px-color-border-none-inverted)}:host([inverted]) details:not(.single).contained summary{color:var(--px-color-text-neutral-inverted)}:host([inverted]) details:not(.single).contained summary:hover{background-color:var(--px-color-background-none)}:host([inverted]) details:not(.single).contained:has(summary:hover){background-color:var(--px-color-background-state-hover-bordered-inverted);border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]) details.single summary{color:var(--px-color-text-brand-inverted)}:host([inverted]) details.single summary:hover{border-color:var(--px-color-border-state-hover-inverted)}:host([inverted]) details.single summary:hover .arrow-icon{background-color:#0000;border-color:#0000}:host([inverted]) details[open] summary slot[name=title]{color:var(--px-color-text-brand-inverted)}@media screen and (width>=48rem){details summary{font-size:var(--px-text-size-label-m-tablet)}details:not(.single) slot[name=content]{padding:var(--px-padding-m-tablet)}details:not(.single) summary{padding:var(--px-padding-m-tablet);gap:var(--px-spacing-s-tablet)}details:not(.single).contained summary{padding:var(--px-padding-m-tablet);font-size:var(--px-text-size-label-l-tablet)}details.single summary{padding-block:var(--px-padding-2xs-tablet);gap:var(--px-spacing-xs-tablet)}details.single summary:hover{gap:var(--px-spacing-2xs-tablet);padding:var(--px-padding-2xs-tablet) var(--px-padding-s-tablet)}details.single summary:hover .arrow-icon{margin-right:calc(var(--px-padding-xs-tablet) * -1)}details.single slot[name=content]{padding-top:var(--px-spacing-s-tablet)}}@media screen and (width>=64.0625rem){details summary{font-size:var(--px-text-size-label-m-laptop)}details:not(.single) slot[name=content]{padding:var(--px-padding-m-laptop)}details:not(.single) summary{padding:var(--px-padding-m-laptop);gap:var(--px-spacing-s-laptop)}details:not(.single).contained summary{font-size:var(--px-text-size-label-l-laptop);padding:var(--px-padding-m-laptop)}details.single summary{padding-block:var(--px-padding-2xs-laptop);gap:var(--px-spacing-xs-laptop)}details.single summary:hover{gap:var(--px-spacing-2xs-laptop);padding:var(--px-padding-2xs-laptop) var(--px-padding-s-laptop)}details.single summary:hover .arrow-icon{margin-right:calc(var(--px-padding-xs-laptop) * -1)}details.single slot[name=content]{padding-top:var(--px-spacing-s-laptop)}}", r = new CSSStyleSheet();
|
|
5
|
+
r.replaceSync(n);
|
|
6
|
+
var i = [
|
|
7
|
+
"",
|
|
8
|
+
"none",
|
|
9
|
+
"single",
|
|
10
|
+
"contained"
|
|
11
|
+
], a = [
|
|
12
|
+
"",
|
|
13
|
+
"container-default",
|
|
14
|
+
"container-light"
|
|
15
|
+
], o = class extends e {
|
|
16
|
+
static {
|
|
17
|
+
this.nativeName = "details";
|
|
18
|
+
}
|
|
19
|
+
constructor() {
|
|
20
|
+
super(r), this.isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), this.template = () => "<details>\n <summary><slot name=\"icon\"></slot><slot name=\"title\"></slot><slot name=\"info\"></slot><span class=\"arrow-icon\"></span></summary>\n <slot name=\"content\"></slot>\n </details>", this.shadowRoot.innerHTML = this.template();
|
|
21
|
+
}
|
|
22
|
+
static get observedAttributes() {
|
|
23
|
+
return [
|
|
24
|
+
...super.observedAttributes,
|
|
25
|
+
"variant",
|
|
26
|
+
"background-color",
|
|
27
|
+
"inverted",
|
|
28
|
+
"no-content-padding"
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
connectedCallback() {
|
|
32
|
+
this.isSafari && this.$summary.setAttribute("role", "button"), this.$details && this.$summary && (this.updateAriaExpanded(), this.$details.addEventListener("toggle", () => {
|
|
33
|
+
this.updateAriaExpanded();
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
attributeChangedCallback(e, t, n) {
|
|
37
|
+
if (t !== n) switch (e) {
|
|
38
|
+
case "variant":
|
|
39
|
+
this.updateAttribute(e, t, n, i);
|
|
40
|
+
break;
|
|
41
|
+
case "background-color":
|
|
42
|
+
this.updateBackgroundColor(e, n, a);
|
|
43
|
+
break;
|
|
44
|
+
default: super.attributeChangedCallback(e, t, n);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
updateAttribute(e, n, r, i) {
|
|
48
|
+
n !== null && n !== "" && this.$el.classList.toggle(`${n}`), r !== null && r !== "" && this.$el.classList.toggle(`${r}`), this.checkName(i, r) || t(`"${r}" is not an allowed ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${i.join("\", \"")}".`);
|
|
49
|
+
}
|
|
50
|
+
updateBackgroundColor(e, n, r) {
|
|
51
|
+
this.checkName(r, n) ? (this.$el.style.setProperty(`--accordion-contained-${e}-default`, `var(--px-color-background-${n}-default)`), this.$el.style.setProperty(`--accordion-contained-${e}-inverted`, `var(--px-color-background-${n}-inverted)`)) : t(`"${n}" is not an allowed ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${r.join("\", \"")}".`);
|
|
52
|
+
}
|
|
53
|
+
updateAriaExpanded() {
|
|
54
|
+
this.$summary.setAttribute("aria-expanded", this.$details.hasAttribute("open") ? "true" : "false");
|
|
55
|
+
}
|
|
56
|
+
get $summary() {
|
|
57
|
+
return this.shadowRoot.querySelector("summary");
|
|
58
|
+
}
|
|
59
|
+
get $details() {
|
|
60
|
+
return this.shadowRoot.querySelector("details");
|
|
61
|
+
}
|
|
62
|
+
get variant() {
|
|
63
|
+
return this.getAttribute("variant");
|
|
64
|
+
}
|
|
65
|
+
set variant(e) {
|
|
66
|
+
this._updateAttribute("variant", e);
|
|
67
|
+
}
|
|
68
|
+
get backgroundColor() {
|
|
69
|
+
return this.getAttribute("background-color");
|
|
70
|
+
}
|
|
71
|
+
set backgroundColor(e) {
|
|
72
|
+
this._updateAttribute("background-color", e);
|
|
73
|
+
}
|
|
74
|
+
get inverted() {
|
|
75
|
+
return this.hasAttribute("inverted");
|
|
76
|
+
}
|
|
77
|
+
set inverted(e) {
|
|
78
|
+
this._updateBooleanAttribute("inverted", e);
|
|
79
|
+
}
|
|
80
|
+
get noContentPadding() {
|
|
81
|
+
return this.hasAttribute("no-content-padding");
|
|
82
|
+
}
|
|
83
|
+
set noContentPadding(e) {
|
|
84
|
+
this._updateBooleanAttribute("no-content-padding", e);
|
|
85
|
+
}
|
|
118
86
|
};
|
|
87
|
+
customElements.get("px-accordion") || customElements.define("px-accordion", o);
|
|
88
|
+
//#endregion
|
|
89
|
+
export { o as Accordion, a as accordionBackgroundColorValues, i as accordionVariantValues };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
3
|
+
"version": 1.1,
|
|
4
|
+
"tags": [
|
|
5
|
+
{
|
|
6
|
+
"name": "px-accordion",
|
|
7
|
+
"description": "\n---\n",
|
|
8
|
+
"attributes": [
|
|
9
|
+
{ "name": "variant", "values": [] },
|
|
10
|
+
{ "name": "background-color", "values": [] },
|
|
11
|
+
{ "name": "inverted", "values": [] },
|
|
12
|
+
{ "name": "no-content-padding", "values": [] }
|
|
13
|
+
],
|
|
14
|
+
"references": []
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
|
+
"name": "@proximus/lavender-accordion",
|
|
4
|
+
"version": "2.0.0-alpha.201",
|
|
5
|
+
"description-markup": "markdown",
|
|
6
|
+
"contributions": {
|
|
7
|
+
"html": {
|
|
8
|
+
"elements": [
|
|
9
|
+
{
|
|
10
|
+
"name": "px-accordion",
|
|
11
|
+
"description": "\n---\n",
|
|
12
|
+
"doc-url": "",
|
|
13
|
+
"attributes": [
|
|
14
|
+
{ "name": "variant", "value": { "type": "string" } },
|
|
15
|
+
{ "name": "background-color", "value": { "type": "string" } },
|
|
16
|
+
{ "name": "inverted", "value": { "type": "string" } },
|
|
17
|
+
{ "name": "no-content-padding", "value": { "type": "string" } }
|
|
18
|
+
],
|
|
19
|
+
"events": [],
|
|
20
|
+
"js": {
|
|
21
|
+
"properties": [
|
|
22
|
+
{ "name": "$summary" },
|
|
23
|
+
{ "name": "$details" },
|
|
24
|
+
{ "name": "variant" },
|
|
25
|
+
{ "name": "backgroundColor" },
|
|
26
|
+
{ "name": "inverted" },
|
|
27
|
+
{ "name": "noContentPadding" },
|
|
28
|
+
{ "name": "innerHTML" }
|
|
29
|
+
],
|
|
30
|
+
"events": []
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"css": {
|
|
36
|
+
"properties": [],
|
|
37
|
+
"pseudo-elements": []
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-accordion",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.201",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"clean": "rm -rf dist",
|
|
14
14
|
"build": "npm run clean && vite build && tsc && npm run transform-package-json && npm run wc-manifest",
|
|
15
15
|
"test": "vitest run --coverage",
|
|
16
|
-
"wc-manifest": "cem analyze --globs \"src/*\" --config
|
|
16
|
+
"wc-manifest": "cem analyze --globs \"src/*\" --config ../../custom-elements-manifest.config.js --outdir dist"
|
|
17
17
|
},
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public"
|