@aurodesignsystem-dev/auro-accordion 0.0.0-pr213.0 → 0.0.0-pr214.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/README.md +59 -66
- package/custom-elements.json +1000 -642
- package/demo/api.md +112 -760
- package/demo/auro-accordion.min.js +11 -6
- package/demo/index.md +84 -81
- package/dist/{auro-accordion-Dlfg1ee3.js → auro-accordion-B5LyAZiI.js} +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -43,17 +43,20 @@ Or, by CDN.
|
|
|
43
43
|
```
|
|
44
44
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## Use Cases
|
|
47
47
|
|
|
48
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
49
|
-
|
|
48
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
49
|
+
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
50
|
+
The `<auro-accordion>` element should be used in situations where users may:
|
|
50
51
|
|
|
52
|
+
- Hide/show long sub-content based on headline trigger
|
|
53
|
+
- Use is for in-page content only when excessive content length is distracting to the specific experience
|
|
51
54
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
52
55
|
|
|
53
56
|
## Install
|
|
54
57
|
|
|
55
58
|
<!-- 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
60
|
[](https://www.npmjs.com/package/@aurodesignsystem/auro-accordion)
|
|
58
61
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
59
62
|

|
|
@@ -64,17 +67,10 @@ $ npm i @aurodesignsystem/auro-accordion
|
|
|
64
67
|
|
|
65
68
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
66
69
|
|
|
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
|
|
70
|
+
### Define Dependency in Project
|
|
75
71
|
|
|
76
72
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
77
|
-
Defining the
|
|
73
|
+
Defining the dependency within each project that is using the `<auro-accordion>` component.
|
|
78
74
|
|
|
79
75
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
80
76
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
@@ -84,7 +80,20 @@ import "@aurodesignsystem/auro-accordion";
|
|
|
84
80
|
```
|
|
85
81
|
|
|
86
82
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
87
|
-
|
|
83
|
+
|
|
84
|
+
### Use CDN
|
|
85
|
+
|
|
86
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
87
|
+
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.
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm"></script>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
94
|
+
|
|
95
|
+
## Basic Example
|
|
96
|
+
|
|
88
97
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
89
98
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
90
99
|
|
|
@@ -107,36 +116,48 @@ import "@aurodesignsystem/auro-accordion";
|
|
|
107
116
|
```
|
|
108
117
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
109
118
|
|
|
110
|
-
##
|
|
119
|
+
## Custom Component Registration for Version Management
|
|
111
120
|
|
|
112
|
-
|
|
113
|
-
|
|
121
|
+
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.
|
|
122
|
+
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
114
123
|
|
|
115
|
-
|
|
116
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm"></script>
|
|
117
|
-
```
|
|
124
|
+
When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
|
|
118
125
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
## auro-accordion use cases
|
|
126
|
+
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.
|
|
122
127
|
|
|
123
|
-
|
|
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:
|
|
128
|
+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
|
|
126
129
|
|
|
127
|
-
-
|
|
128
|
-
|
|
130
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
131
|
+
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
132
|
+
<!-- add custom registration content here -->
|
|
129
133
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
<div class="exampleWrapper exampleWrapper--flex">
|
|
135
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
136
|
+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
137
|
+
<custom-accordion>
|
|
138
|
+
<span slot="trigger">Trigger</span>
|
|
139
|
+
<p>
|
|
140
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
141
|
+
</p>
|
|
142
|
+
<p>
|
|
143
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
144
|
+
</p>
|
|
145
|
+
<p>
|
|
146
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
147
|
+
</p>
|
|
148
|
+
<p>
|
|
149
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
150
|
+
</p>
|
|
151
|
+
</custom-accordion>
|
|
152
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
153
|
+
</div>
|
|
154
|
+
<auro-accordion alignRight>
|
|
155
|
+
<span slot="trigger">See code</span>
|
|
156
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
157
|
+
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
137
158
|
|
|
138
159
|
```html
|
|
139
|
-
<
|
|
160
|
+
<custom-accordion>
|
|
140
161
|
<span slot="trigger">Trigger</span>
|
|
141
162
|
<p>
|
|
142
163
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
@@ -150,35 +171,7 @@ The `<auro-accordion>` element should be used in situations where users may:
|
|
|
150
171
|
<p>
|
|
151
172
|
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
152
173
|
</p>
|
|
153
|
-
</
|
|
174
|
+
</custom-accordion>
|
|
154
175
|
```
|
|
155
176
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
156
|
-
|
|
157
|
-
## Development
|
|
158
|
-
|
|
159
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/developmentDescription.md) -->
|
|
160
|
-
In order to develop against this project, if you are not part of the core team, you will be required to fork the project prior to submitting a pull request.
|
|
161
|
-
|
|
162
|
-
Please be sure to review the [contribution guidelines](https://auro.alaskaair.com/contributing) for this project. Please make sure to **pay special attention** to the **conventional commits** section of the document.
|
|
163
|
-
|
|
164
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
165
|
-
|
|
166
|
-
### Start development environment
|
|
167
|
-
|
|
168
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/localhost.md) -->
|
|
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**.
|
|
170
|
-
|
|
171
|
-
```shell
|
|
172
|
-
$ npm run dev
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
Open [localhost:8000](http://localhost:8000/)
|
|
176
|
-
|
|
177
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
178
|
-
|
|
179
|
-
### Testing
|
|
180
|
-
|
|
181
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/testing.md) -->
|
|
182
|
-
Automated tests are required for every Auro component. See `.\test\auro-accordion.test.js` for the tests for this component. Run `npm run test` to run the tests and check code coverage. Tests must pass and meet a certain coverage threshold to commit. See [the testing documentation](https://auro.alaskaair.com/support/tests) for more details.
|
|
183
|
-
|
|
184
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
177
|
+
</auro-accordion>
|