@aurodesignsystem-dev/auro-accordion 0.0.0-pr213.0 → 0.0.0-pr214.1
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 +135 -84
- package/custom-elements.json +1014 -641
- package/demo/api.js +2 -0
- package/demo/api.md +309 -235
- package/demo/api.min.js +16 -3
- package/demo/auro-accordion.min.js +15 -16
- package/demo/index.md +16 -11
- package/dist/{auro-accordion-Dlfg1ee3.js → auro-accordion-B5LyAZiI.js} +2 -2
- package/dist/index.d.ts +247 -125
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -25,35 +25,22 @@ 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
|
|
47
31
|
|
|
48
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
49
|
-
|
|
32
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
33
|
+
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
34
|
+
The `<auro-accordion>` element should be used in situations where users may:
|
|
50
35
|
|
|
36
|
+
- Hide/show long sub-content based on headline trigger
|
|
37
|
+
- Use is for in-page content only when excessive content length is distracting to the specific experience
|
|
51
38
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
52
39
|
|
|
53
40
|
## Install
|
|
54
41
|
|
|
55
42
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
|
|
56
|
-
[](https://github.com/AlaskaAirlines/auro-accordion/actions/workflows/release.yml)
|
|
57
44
|
[](https://www.npmjs.com/package/@aurodesignsystem/auro-accordion)
|
|
58
45
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
59
46
|

|
|
@@ -64,17 +51,10 @@ $ npm i @aurodesignsystem/auro-accordion
|
|
|
64
51
|
|
|
65
52
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
66
53
|
|
|
67
|
-
###
|
|
68
|
-
|
|
69
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/designTokens.md) -->
|
|
70
|
-
The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
|
|
71
|
-
|
|
72
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
73
|
-
|
|
74
|
-
### Define dependency in project component
|
|
54
|
+
### Define Dependency in Project
|
|
75
55
|
|
|
76
56
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
77
|
-
Defining the
|
|
57
|
+
Defining the dependency within each project that is using the `<auro-accordion>` component.
|
|
78
58
|
|
|
79
59
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
80
60
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
@@ -83,31 +63,9 @@ Defining the component dependency within each component that is using the `<auro
|
|
|
83
63
|
import "@aurodesignsystem/auro-accordion";
|
|
84
64
|
```
|
|
85
65
|
|
|
86
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
87
|
-
**Reference component in HTML**
|
|
88
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
89
|
-
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
90
|
-
|
|
91
|
-
```html
|
|
92
|
-
<auro-accordion>
|
|
93
|
-
<span slot="trigger">Trigger</span>
|
|
94
|
-
<p>
|
|
95
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
96
|
-
</p>
|
|
97
|
-
<p>
|
|
98
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
99
|
-
</p>
|
|
100
|
-
<p>
|
|
101
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
102
|
-
</p>
|
|
103
|
-
<p>
|
|
104
|
-
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
105
|
-
</p>
|
|
106
|
-
</auro-accordion>
|
|
107
|
-
```
|
|
108
66
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
109
67
|
|
|
110
|
-
|
|
68
|
+
### Use CDN
|
|
111
69
|
|
|
112
70
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
113
71
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
@@ -118,19 +76,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
118
76
|
|
|
119
77
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
120
78
|
|
|
121
|
-
##
|
|
122
|
-
|
|
123
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
124
|
-
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
125
|
-
The `<auro-accordion>` element should be used in situations where users may:
|
|
126
|
-
|
|
127
|
-
- Hide/show long sub-content based on headline trigger
|
|
128
|
-
- Use is for in-page content only when excessive content length is distracting to the specific experience
|
|
129
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
130
|
-
|
|
131
|
-
## API Code Examples
|
|
132
|
-
|
|
133
|
-
### Default auro-accordion
|
|
79
|
+
## Basic Example
|
|
134
80
|
|
|
135
81
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
136
82
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
@@ -154,31 +100,136 @@ The `<auro-accordion>` element should be used in situations where users may:
|
|
|
154
100
|
```
|
|
155
101
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
156
102
|
|
|
157
|
-
##
|
|
103
|
+
## Custom Component Registration for Version Management
|
|
158
104
|
|
|
159
|
-
|
|
160
|
-
|
|
105
|
+
There are two key parts to every Auro component: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
|
|
106
|
+
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
161
107
|
|
|
162
|
-
|
|
108
|
+
When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
|
|
163
109
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
### Start development environment
|
|
110
|
+
However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions), you can manually register the class under a custom element name to avoid conflicts.
|
|
167
111
|
|
|
168
|
-
|
|
169
|
-
Once the project has been cloned to your local resource and you have installed all the dependencies you will need to open a shell session to run the **dev server**.
|
|
112
|
+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
|
|
170
113
|
|
|
171
|
-
|
|
172
|
-
|
|
114
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
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');
|
|
173
124
|
```
|
|
174
125
|
|
|
175
|
-
|
|
176
|
-
|
|
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.
|
|
177
127
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
128
|
+
<div class="exampleWrapper exampleWrapper--flex">
|
|
129
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
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 -->
|
|
178
184
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
+
```html
|
|
186
|
+
<custom-accordion-group>
|
|
187
|
+
<custom-accordion>
|
|
188
|
+
<span slot="trigger">Trigger</span>
|
|
189
|
+
<p>
|
|
190
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
191
|
+
</p>
|
|
192
|
+
<p>
|
|
193
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
194
|
+
</p>
|
|
195
|
+
<p>
|
|
196
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
197
|
+
</p>
|
|
198
|
+
<p>
|
|
199
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
200
|
+
</p>
|
|
201
|
+
</custom-accordion>
|
|
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>
|
|
233
|
+
```
|
|
234
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
235
|
+
</auro-accordion>
|