@aurodesignsystem-dev/auro-accordion 0.0.0-pr214.0 → 0.0.0-pr214.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.
- package/README.md +99 -41
- package/custom-elements.json +27 -12
- package/demo/api.js +2 -0
- package/demo/api.md +781 -59
- package/demo/api.min.js +16 -3
- package/demo/auro-accordion.min.js +5 -11
- package/demo/index.md +76 -74
- package/dist/index.d.ts +247 -125
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -25,22 +25,6 @@ The following sections are editable by making changes to the following files:
|
|
|
25
25
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
26
26
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
27
27
|
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
28
|
-
|
|
29
|
-
## Transitioning from v1.x to v3.x
|
|
30
|
-
|
|
31
|
-
The new `@aurodesignsystem/auro-accordion` element includes breaking changes that are not backwards compatible with earlier releases. Earlier versions may be installed by running the following command.
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
$ npm i @aurodesignsystem/auro-accordion@1.6.6
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Or, by CDN.
|
|
38
|
-
|
|
39
|
-
```html
|
|
40
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@alaskaairux/design-tokens@3.11.0/dist/tokens/CSSCustomProperties.css" />
|
|
41
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@alaskaairux/webcorestylesheets@3.7.3/dist/bundled/essentials.css" />
|
|
42
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@1.6.6/dist/auro-accordion__bundled.js" type="module"></script>
|
|
43
|
-
```
|
|
44
28
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
45
29
|
|
|
46
30
|
## Use Cases
|
|
@@ -128,12 +112,78 @@ However, if you need to load multiple versions of the same component on a single
|
|
|
128
112
|
You can do this by importing only the component class and using the `register(name)` method with a unique name:
|
|
129
113
|
|
|
130
114
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
131
|
-
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
132
|
-
|
|
115
|
+
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
116
|
+
|
|
117
|
+
```js
|
|
118
|
+
// Import the class only
|
|
119
|
+
import { AuroAccordion, AuroAccordionGroup } from '@aurodesignsystem/auro-accordion/class';
|
|
120
|
+
|
|
121
|
+
// Register with a custom name if desired
|
|
122
|
+
AuroAccordion.register('custom-accordion');
|
|
123
|
+
AuroAccordionGroup.register('custom-accordion-group');
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
This will create a new custom element `<custom-accordion>` and `<custom-accordion-group>` that behaves exactly like `<auro-accordion>` and `<auro-accordion-group>`, allowing both sets of components to coexist on the same page without interfering with each other.
|
|
133
127
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
134
128
|
<div class="exampleWrapper exampleWrapper--flex">
|
|
135
129
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
136
130
|
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
131
|
+
<custom-accordion-group>
|
|
132
|
+
<custom-accordion>
|
|
133
|
+
<span slot="trigger">Trigger</span>
|
|
134
|
+
<p>
|
|
135
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
136
|
+
</p>
|
|
137
|
+
<p>
|
|
138
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
139
|
+
</p>
|
|
140
|
+
<p>
|
|
141
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
142
|
+
</p>
|
|
143
|
+
<p>
|
|
144
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
145
|
+
</p>
|
|
146
|
+
</custom-accordion>
|
|
147
|
+
<custom-accordion>
|
|
148
|
+
<span slot="trigger">Trigger</span>
|
|
149
|
+
<p>
|
|
150
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
151
|
+
</p>
|
|
152
|
+
<p>
|
|
153
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
154
|
+
</p>
|
|
155
|
+
<p>
|
|
156
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
157
|
+
</p>
|
|
158
|
+
<p>
|
|
159
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
160
|
+
</p>
|
|
161
|
+
</custom-accordion>
|
|
162
|
+
<custom-accordion>
|
|
163
|
+
<span slot="trigger">Trigger</span>
|
|
164
|
+
<p>
|
|
165
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
166
|
+
</p>
|
|
167
|
+
<p>
|
|
168
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
169
|
+
</p>
|
|
170
|
+
<p>
|
|
171
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
172
|
+
</p>
|
|
173
|
+
<p>
|
|
174
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
175
|
+
</p>
|
|
176
|
+
</custom-accordion>
|
|
177
|
+
</custom-accordion-group>
|
|
178
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
179
|
+
</div>
|
|
180
|
+
<auro-accordion alignRight>
|
|
181
|
+
<span slot="trigger">See code</span>
|
|
182
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
183
|
+
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
184
|
+
|
|
185
|
+
```html
|
|
186
|
+
<custom-accordion-group>
|
|
137
187
|
<custom-accordion>
|
|
138
188
|
<span slot="trigger">Trigger</span>
|
|
139
189
|
<p>
|
|
@@ -149,29 +199,37 @@ You can do this by importing only the component class and using the `register(na
|
|
|
149
199
|
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
150
200
|
</p>
|
|
151
201
|
</custom-accordion>
|
|
152
|
-
|
|
153
|
-
</
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
</
|
|
202
|
+
<custom-accordion>
|
|
203
|
+
<span slot="trigger">Trigger</span>
|
|
204
|
+
<p>
|
|
205
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
206
|
+
</p>
|
|
207
|
+
<p>
|
|
208
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
209
|
+
</p>
|
|
210
|
+
<p>
|
|
211
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
212
|
+
</p>
|
|
213
|
+
<p>
|
|
214
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
215
|
+
</p>
|
|
216
|
+
</custom-accordion>
|
|
217
|
+
<custom-accordion>
|
|
218
|
+
<span slot="trigger">Trigger</span>
|
|
219
|
+
<p>
|
|
220
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
221
|
+
</p>
|
|
222
|
+
<p>
|
|
223
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
224
|
+
</p>
|
|
225
|
+
<p>
|
|
226
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
227
|
+
</p>
|
|
228
|
+
<p>
|
|
229
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
230
|
+
</p>
|
|
231
|
+
</custom-accordion>
|
|
232
|
+
</custom-accordion-group>
|
|
175
233
|
```
|
|
176
234
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
177
235
|
</auro-accordion>
|
package/custom-elements.json
CHANGED
|
@@ -841,7 +841,7 @@
|
|
|
841
841
|
"declarations": [
|
|
842
842
|
{
|
|
843
843
|
"kind": "class",
|
|
844
|
-
"description": "
|
|
844
|
+
"description": "",
|
|
845
845
|
"name": "AuroAccordionGroup",
|
|
846
846
|
"members": [
|
|
847
847
|
{
|
|
@@ -874,7 +874,10 @@
|
|
|
874
874
|
},
|
|
875
875
|
{
|
|
876
876
|
"kind": "method",
|
|
877
|
-
"name": "handleSlotContentChange"
|
|
877
|
+
"name": "handleSlotContentChange",
|
|
878
|
+
"type": {
|
|
879
|
+
"text": "handleSlotContentChange() => void"
|
|
880
|
+
}
|
|
878
881
|
},
|
|
879
882
|
{
|
|
880
883
|
"kind": "method",
|
|
@@ -906,7 +909,10 @@
|
|
|
906
909
|
}
|
|
907
910
|
}
|
|
908
911
|
],
|
|
909
|
-
"description": "This will register this element with the browser."
|
|
912
|
+
"description": "This will register this element with the browser.",
|
|
913
|
+
"type": {
|
|
914
|
+
"text": "register(name?: string = \"auro-accordion-group\") => void"
|
|
915
|
+
}
|
|
910
916
|
},
|
|
911
917
|
{
|
|
912
918
|
"kind": "field",
|
|
@@ -917,7 +923,8 @@
|
|
|
917
923
|
{
|
|
918
924
|
"kind": "method",
|
|
919
925
|
"name": "updateDisabledState",
|
|
920
|
-
"description": "Updates the disabled state of all child
|
|
926
|
+
"description": "Updates the disabled state of all child `<auro-accordion>` elements\nto match the disabled state of the `<auro-accordion-group>` element.",
|
|
927
|
+
"privacy": "private"
|
|
921
928
|
},
|
|
922
929
|
{
|
|
923
930
|
"kind": "field",
|
|
@@ -962,7 +969,8 @@
|
|
|
962
969
|
"package": "lit"
|
|
963
970
|
},
|
|
964
971
|
"tagName": "auro-accordion-group",
|
|
965
|
-
"customElement": true
|
|
972
|
+
"customElement": true,
|
|
973
|
+
"modulePath": "src/auro-accordion-group.js"
|
|
966
974
|
}
|
|
967
975
|
],
|
|
968
976
|
"exports": [
|
|
@@ -982,7 +990,7 @@
|
|
|
982
990
|
"declarations": [
|
|
983
991
|
{
|
|
984
992
|
"kind": "class",
|
|
985
|
-
"description": "
|
|
993
|
+
"description": "",
|
|
986
994
|
"name": "AuroAccordion",
|
|
987
995
|
"cssParts": [
|
|
988
996
|
{
|
|
@@ -1063,7 +1071,7 @@
|
|
|
1063
1071
|
"type": {
|
|
1064
1072
|
"text": "boolean"
|
|
1065
1073
|
},
|
|
1066
|
-
"description": "If set, emphasis styles will be applied to the auro-
|
|
1074
|
+
"description": "If set, emphasis styles will be applied to the auro-accordion. This feature is best used on the auro-accordion-group component.",
|
|
1067
1075
|
"attribute": "emphasis",
|
|
1068
1076
|
"reflects": true
|
|
1069
1077
|
},
|
|
@@ -1138,14 +1146,17 @@
|
|
|
1138
1146
|
{
|
|
1139
1147
|
"name": "name",
|
|
1140
1148
|
"default": "\"auro-accordion\"",
|
|
1141
|
-
"description": "The name of element that you want to register
|
|
1149
|
+
"description": "The name of the element that you want to register.",
|
|
1142
1150
|
"optional": true,
|
|
1143
1151
|
"type": {
|
|
1144
1152
|
"text": "string"
|
|
1145
1153
|
}
|
|
1146
1154
|
}
|
|
1147
1155
|
],
|
|
1148
|
-
"description": "This will register this element with the browser."
|
|
1156
|
+
"description": "This will register this element with the browser.",
|
|
1157
|
+
"type": {
|
|
1158
|
+
"text": "register(name?: string = \"auro-accordion\") => void"
|
|
1159
|
+
}
|
|
1149
1160
|
},
|
|
1150
1161
|
{
|
|
1151
1162
|
"kind": "method",
|
|
@@ -1167,7 +1178,10 @@
|
|
|
1167
1178
|
{
|
|
1168
1179
|
"kind": "method",
|
|
1169
1180
|
"name": "toggle",
|
|
1170
|
-
"description": "Toggles the visibility of the accordion content."
|
|
1181
|
+
"description": "Toggles the visibility of the accordion content.",
|
|
1182
|
+
"type": {
|
|
1183
|
+
"text": "toggle() => void"
|
|
1184
|
+
}
|
|
1171
1185
|
},
|
|
1172
1186
|
{
|
|
1173
1187
|
"kind": "field",
|
|
@@ -1220,7 +1234,7 @@
|
|
|
1220
1234
|
"type": {
|
|
1221
1235
|
"text": "boolean"
|
|
1222
1236
|
},
|
|
1223
|
-
"description": "If set, emphasis styles will be applied to the auro-
|
|
1237
|
+
"description": "If set, emphasis styles will be applied to the auro-accordion. This feature is best used on the auro-accordion-group component.",
|
|
1224
1238
|
"fieldName": "emphasis"
|
|
1225
1239
|
},
|
|
1226
1240
|
{
|
|
@@ -1254,7 +1268,8 @@
|
|
|
1254
1268
|
"package": "lit"
|
|
1255
1269
|
},
|
|
1256
1270
|
"tagName": "auro-accordion",
|
|
1257
|
-
"customElement": true
|
|
1271
|
+
"customElement": true,
|
|
1272
|
+
"modulePath": "src/auro-accordion.js"
|
|
1258
1273
|
}
|
|
1259
1274
|
],
|
|
1260
1275
|
"exports": [
|
package/demo/api.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { expandedExample } from "../apiExamples/expanded";
|
|
2
|
+
import { toggleExample } from "../apiExamples/toggle";
|
|
2
3
|
import "../src/registered.js";
|
|
3
4
|
|
|
4
5
|
export function initExamples(initCount) {
|
|
@@ -7,6 +8,7 @@ export function initExamples(initCount) {
|
|
|
7
8
|
|
|
8
9
|
try {
|
|
9
10
|
expandedExample();
|
|
11
|
+
toggleExample();
|
|
10
12
|
} catch {
|
|
11
13
|
if (initCount <= 20) {
|
|
12
14
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|