@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 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
- ## UI development browser support
37
+ ## Use Cases
38
38
 
39
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/browserSupport.md) -->
40
- For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
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
- [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-sidenav/testPublish.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-sidenav/actions/workflows/testPublish.yml)
50
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-sidenav/release.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-sidenav/actions/workflows/release.yml)
48
51
  [![See it on NPM!](https://img.shields.io/npm/v/@aurodesignsystem/auro-sidenav?style=for-the-badge&color=orange)](https://www.npmjs.com/package/@aurodesignsystem/auro-sidenav)
49
52
  [![License](https://img.shields.io/npm/l/@aurodesignsystem/auro-sidenav?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
50
53
  ![ESM supported](https://img.shields.io/badge/ESM-compatible-FFE900?style=for-the-badge)
@@ -55,17 +58,10 @@ $ npm i @aurodesignsystem/auro-sidenav
55
58
 
56
59
  <!-- AURO-GENERATED-CONTENT:END -->
57
60
 
58
- ### Design Token CSS Custom Property dependency
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 component dependency within each component that is using the `<auro-sidenav>` component.
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
- ```html
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
- ## auro-sidenav use cases
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">Alaska Airlines History</span>
123
- <auro-sidenavitem href="/content/about-us/history">Historical overview</auro-sidenavitem>
124
- <auro-sidenavitem href="/content/about-us/history/history-by-decade">History by decade</auro-sidenavitem>
125
- <auro-sidenavitem href="/content/about-us/history/pioneers">Alaska Airlines pioneers</auro-sidenavitem>
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
- ## Development
110
+ ## Custom Component Registration for Version Management
131
111
 
132
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/developmentDescription.md) -->
133
- 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.
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
- 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.
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
- <!-- AURO-GENERATED-CONTENT:END -->
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
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/localhost.md) -->
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
- ```shell
145
- $ npm run dev
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
- Open [localhost:8000](http://localhost:8000/)
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
- ### Testing
153
-
154
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/testing.md) -->
155
- Automated tests are required for every Auro component. See `.\test\auro-sidenav.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.
156
-
157
- <!-- AURO-GENERATED-CONTENT:END -->
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>