@aurodesignsystem-dev/auro-sidenav 0.0.0-pr84.1 → 0.0.0-pr87.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 +66 -63
- package/custom-elements.json +505 -1841
- package/demo/api.md +300 -97
- package/demo/auro-sidenavsection.min.js +203 -85
- package/demo/index.md +20 -258
- package/dist/{auro-sidenavsection-C7L7K2Ru.js → auro-sidenavsection-BlshtGvd.js} +133 -17
- package/dist/index.d.ts +329 -262
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +14 -8
package/README.md
CHANGED
|
@@ -34,17 +34,20 @@ The `auro-sidenavitem` is an extension of the `auro-hyperlink` and used to creat
|
|
|
34
34
|
Please refer to the below example to see how to use these components.
|
|
35
35
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Use Cases
|
|
38
38
|
|
|
39
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
40
|
-
|
|
39
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
40
|
+
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
41
|
+
The `<auro-sidenav>` element should be used in situations where users may:
|
|
41
42
|
|
|
43
|
+
* create in-page navigation for long content-heavy pages
|
|
44
|
+
* provide navigation to related pages on a page
|
|
42
45
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
43
46
|
|
|
44
47
|
## Install
|
|
45
48
|
|
|
46
49
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
|
|
47
|
-
[](https://github.com/AlaskaAirlines/auro-sidenav/actions/workflows/release.yml)
|
|
48
51
|
[](https://www.npmjs.com/package/@aurodesignsystem/auro-sidenav)
|
|
49
52
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
50
53
|

|
|
@@ -55,17 +58,10 @@ $ npm i @aurodesignsystem/auro-sidenav
|
|
|
55
58
|
|
|
56
59
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
57
60
|
|
|
58
|
-
###
|
|
59
|
-
|
|
60
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/designTokens.md) -->
|
|
61
|
-
The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
|
|
62
|
-
|
|
63
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
64
|
-
|
|
65
|
-
### Define dependency in project component
|
|
61
|
+
### Define Dependency in Project
|
|
66
62
|
|
|
67
63
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
68
|
-
Defining the
|
|
64
|
+
Defining the dependency within each project that is using the `<auro-sidenav>` component.
|
|
69
65
|
|
|
70
66
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
71
67
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
@@ -75,21 +71,8 @@ import "@aurodesignsystem/auro-sidenav";
|
|
|
75
71
|
```
|
|
76
72
|
|
|
77
73
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
78
|
-
**Reference component in HTML**
|
|
79
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
80
|
-
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
81
74
|
|
|
82
|
-
|
|
83
|
-
<auro-sidenav static>
|
|
84
|
-
<span slot="heading">Alaska Airlines History</span>
|
|
85
|
-
<auro-sidenavitem href="/content/about-us/history">Historical overview</auro-sidenavitem>
|
|
86
|
-
<auro-sidenavitem href="/content/about-us/history/history-by-decade">History by decade</auro-sidenavitem>
|
|
87
|
-
<auro-sidenavitem href="/content/about-us/history/pioneers">Alaska Airlines pioneers</auro-sidenavitem>
|
|
88
|
-
</auro-sidenav>
|
|
89
|
-
```
|
|
90
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
91
|
-
|
|
92
|
-
## Use CDN
|
|
75
|
+
### Use CDN
|
|
93
76
|
|
|
94
77
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
95
78
|
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.
|
|
@@ -100,58 +83,78 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
100
83
|
|
|
101
84
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
102
85
|
|
|
103
|
-
##
|
|
104
|
-
|
|
105
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
106
|
-
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
107
|
-
The `<auro-sidenav>` element should be used in situations where users may:
|
|
108
|
-
|
|
109
|
-
* create in-page navigation for long content-heavy pages
|
|
110
|
-
* provide navigation to related pages on a page
|
|
111
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
112
|
-
|
|
113
|
-
## API Code Examples
|
|
114
|
-
|
|
115
|
-
### Default auro-sidenav
|
|
86
|
+
## Basic Example
|
|
116
87
|
|
|
117
88
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
118
89
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
119
90
|
|
|
120
91
|
```html
|
|
121
92
|
<auro-sidenav static>
|
|
122
|
-
<span slot="heading">
|
|
123
|
-
<auro-sidenavitem href="/content/
|
|
124
|
-
<auro-sidenavitem href="/content/
|
|
125
|
-
<auro-sidenavitem href="/content/
|
|
93
|
+
<span slot="heading">Pet travel policies</span>
|
|
94
|
+
<auro-sidenavitem href="/content/travel-info/pets">Pet travel overview</auro-sidenavitem>
|
|
95
|
+
<auro-sidenavitem href="/content/travel-info/policies/pets-traveling-with-pets/pets-in-cabin">Pets in cabin</auro-sidenavitem>
|
|
96
|
+
<auro-sidenavitem href="/content/travel-info/policies/pets-traveling-with-pets/pets-in-baggage-compartment">Pets in baggage compartment</auro-sidenavitem>
|
|
97
|
+
<auro-sidenavitem href="/content/travel-info/policies/pets-traveling-hawaii">Traveling to Hawaii</auro-sidenavitem>
|
|
98
|
+
<auro-sidenavitem href="/content/travel-info/policies/pets-traveling-international" target="_blank">International travel with pets</auro-sidenavitem>
|
|
99
|
+
<auro-sidenavsection>
|
|
100
|
+
<span slot="trigger">FAQ</span>
|
|
101
|
+
<auro-sidenavitem href="/content/travel-info/policies/pets-traveling-with-pets/banfield-qa#safe-to-fly">Is it safe to fly with my pet?</auro-sidenavitem>
|
|
102
|
+
<auro-sidenavitem href="/content/travel-info/policies/pets-traveling-with-pets/banfield-qa#certain-breeds-prohibited">Why are certain breeds prohibited from flying in the cargo compartment?</auro-sidenavitem>
|
|
103
|
+
<auro-sidenavitem href="/content/travel-info/policies/pets-traveling-with-pets/banfield-qa#dog-info" target="_blank">Dogs</auro-sidenavitem>
|
|
104
|
+
<auro-sidenavitem href="/content/travel-info/policies/pets-traveling-with-pets/banfield-qa#cat-info" target="_blank">Cats</auro-sidenavitem>
|
|
105
|
+
</auro-sidenavsection>
|
|
126
106
|
</auro-sidenav>
|
|
127
107
|
```
|
|
128
108
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
129
109
|
|
|
130
|
-
##
|
|
110
|
+
## Custom Component Registration for Version Management
|
|
131
111
|
|
|
132
|
-
|
|
133
|
-
|
|
112
|
+
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.
|
|
113
|
+
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
134
114
|
|
|
135
|
-
|
|
115
|
+
When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
|
|
136
116
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
### Start development environment
|
|
117
|
+
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.
|
|
140
118
|
|
|
141
|
-
|
|
142
|
-
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**.
|
|
119
|
+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
|
|
143
120
|
|
|
144
|
-
|
|
145
|
-
|
|
121
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
122
|
+
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
123
|
+
|
|
124
|
+
```js
|
|
125
|
+
// Import the class only
|
|
126
|
+
import { AuroSideNav, AuroSideNavItem } from '@aurodesignsystem/auro-sidenav/class';
|
|
127
|
+
|
|
128
|
+
// Register with a custom name if desired
|
|
129
|
+
AuroSideNav.register('custom-sidenav');
|
|
130
|
+
AuroSideNavItem.register('custom-sidenavitem');
|
|
146
131
|
```
|
|
147
132
|
|
|
148
|
-
|
|
149
|
-
|
|
133
|
+
This will create a new custom element `<custom-sidenav>` and `<custom-sidenavitem>` that behaves exactly like `<auro-sidenav>` and `<auro-sidenavitem>`, allowing both to coexist on the same page without interfering with each other.
|
|
150
134
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
135
|
+
<div class="exampleWrapper exampleWrapper--flex">
|
|
136
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
137
|
+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
138
|
+
<custom-sidenav static>
|
|
139
|
+
<span slot="heading">Alaska Airlines History</span>
|
|
140
|
+
<custom-sidenavitem href="/content/about-us/history">Historical overview</custom-sidenavitem>
|
|
141
|
+
<custom-sidenavitem href="/content/about-us/history/history-by-decade">History by decade</custom-sidenavitem>
|
|
142
|
+
<custom-sidenavitem href="/content/about-us/history/pioneers">Alaska Airlines pioneers</custom-sidenavitem>
|
|
143
|
+
</custom-sidenav>
|
|
144
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
145
|
+
</div>
|
|
146
|
+
<auro-accordion alignRight>
|
|
147
|
+
<span slot="trigger">See code</span>
|
|
148
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
149
|
+
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
151
150
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
151
|
+
```html
|
|
152
|
+
<custom-sidenav static>
|
|
153
|
+
<span slot="heading">Alaska Airlines History</span>
|
|
154
|
+
<custom-sidenavitem href="/content/about-us/history">Historical overview</custom-sidenavitem>
|
|
155
|
+
<custom-sidenavitem href="/content/about-us/history/history-by-decade">History by decade</custom-sidenavitem>
|
|
156
|
+
<custom-sidenavitem href="/content/about-us/history/pioneers">Alaska Airlines pioneers</custom-sidenavitem>
|
|
157
|
+
</custom-sidenav>
|
|
158
|
+
```
|
|
159
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
160
|
+
</auro-accordion>
|