@aurodesignsystem-dev/auro-button 0.0.0-pr375.1 → 0.0.0-pr377.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 CHANGED
@@ -21,7 +21,7 @@ The following sections are editable by making changes to the following files:
21
21
 
22
22
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
23
23
  <!-- The below content is automatically added from ./docs/partials/description.md -->
24
- `<auro-button>` is a [HTML custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) for the purpose being a clickable element to trigger a specific action.
24
+ The `<auro-button>` element creates interactive buttons for triggering actions in your application.
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 -->
@@ -40,17 +40,22 @@ If the desired appearance of the `<auro-button>` is to be placed in the reverse
40
40
  When the UI requires the use of multiple buttons within the same space, with the use of the [Auro Web Core Style Sheets](https://alaskaairlines.github.io/WebCoreStyleSheets/#utility-auro-css-#{$scope}.auro_containedButtons), and the `auro_containedButtons`.
41
41
  <!-- AURO-GENERATED-CONTENT:END -->
42
42
 
43
- ## UI development browser support
43
+ ## Use Cases
44
44
 
45
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/browserSupport.md) -->
46
- For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
45
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
46
+ <!-- The below content is automatically added from ./docs/partials/useCases.md -->
47
+ The auro-button element should be used in situations where users may:
47
48
 
49
+ * submit a form
50
+ * begin a new task
51
+ * trigger a new UI element to appear to the page
52
+ * specify a new or next step in a process
48
53
  <!-- AURO-GENERATED-CONTENT:END -->
49
54
 
50
55
  ## Install
51
56
 
52
57
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
53
- [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-button/testPublish.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-button/actions/workflows/testPublish.yml)
58
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-button/release.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-button/actions/workflows/release.yml)
54
59
  [![See it on NPM!](https://img.shields.io/npm/v/@aurodesignsystem/auro-button?style=for-the-badge&color=orange)](https://www.npmjs.com/package/@aurodesignsystem/auro-button)
55
60
  [![License](https://img.shields.io/npm/l/@aurodesignsystem/auro-button?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
56
61
  ![ESM supported](https://img.shields.io/badge/ESM-compatible-FFE900?style=for-the-badge)
@@ -61,17 +66,10 @@ $ npm i @aurodesignsystem/auro-button
61
66
 
62
67
  <!-- AURO-GENERATED-CONTENT:END -->
63
68
 
64
- ### Design Token CSS Custom Property dependency
65
-
66
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/designTokens.md) -->
67
- The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
68
-
69
- <!-- AURO-GENERATED-CONTENT:END -->
70
-
71
- ### Define dependency in project component
69
+ ### Define Dependency in Project
72
70
 
73
71
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
74
- Defining the component dependency within each component that is using the `<auro-button>` component.
72
+ Defining the dependency within each project that is using the `<auro-button>` component.
75
73
 
76
74
  <!-- AURO-GENERATED-CONTENT:END -->
77
75
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
@@ -81,19 +79,8 @@ import "@aurodesignsystem/auro-button";
81
79
  ```
82
80
 
83
81
  <!-- AURO-GENERATED-CONTENT:END -->
84
- **Reference component in HTML**
85
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
86
- <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
87
82
 
88
- ```html
89
- <auro-button>Primary</auro-button>
90
- <auro-button variant="secondary">Secondary</auro-button>
91
- <auro-button variant="tertiary">Tertiary</auro-button>
92
- <auro-button variant="ghost">Ghost</auro-button>
93
- ```
94
- <!-- AURO-GENERATED-CONTENT:END -->
95
-
96
- ## Use CDN
83
+ ### Use CDN
97
84
 
98
85
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
99
86
  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.
@@ -104,21 +91,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
104
91
 
105
92
  <!-- AURO-GENERATED-CONTENT:END -->
106
93
 
107
- ## auro-button use cases
108
-
109
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
110
- <!-- The below content is automatically added from ./docs/partials/useCases.md -->
111
- The auro-button element should be used in situations where users may:
112
-
113
- * submit a form
114
- * begin a new task
115
- * trigger a new UI element to appear to the page
116
- * specify a new or next step in a process
117
- <!-- AURO-GENERATED-CONTENT:END -->
118
-
119
- ## API Code Examples
120
-
121
- ### Default auro-button
94
+ ## Basic Example
122
95
 
123
96
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
124
97
  <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
@@ -131,31 +104,47 @@ The auro-button element should be used in situations where users may:
131
104
  ```
132
105
  <!-- AURO-GENERATED-CONTENT:END -->
133
106
 
134
- ## Development
107
+ ## Custom Component Registration for Version Management
135
108
 
136
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/developmentDescription.md) -->
137
- 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.
109
+ 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.
110
+ The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
138
111
 
139
- 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.
112
+ When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
140
113
 
141
- <!-- AURO-GENERATED-CONTENT:END -->
142
-
143
- ### Start development environment
114
+ 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.
144
115
 
145
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/localhost.md) -->
146
- 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**.
116
+ You can do this by importing only the component class and using the `register(name)` method with a unique name:
147
117
 
148
- ```shell
149
- $ npm run dev
118
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
119
+ <!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
120
+
121
+ ```js
122
+ // Import the class only
123
+ import { AuroButton } from '@aurodesignsystem/auro-button/class';
124
+
125
+ // Register with a custom name if desired
126
+ AuroButton.register('custom-button');
150
127
  ```
151
128
 
152
- Open [localhost:8000](http://localhost:8000/)
153
-
129
+ This will create a new custom element `<custom-button>` that behaves exactly like `<auro-button>`, allowing both to coexist on the same page without interfering with each other.
154
130
  <!-- AURO-GENERATED-CONTENT:END -->
131
+ <div class="exampleWrapper exampleWrapper--flex">
132
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
133
+ <!-- The below content is automatically added from ./apiExamples/custom.html -->
134
+ <custom-button>Primary</custom-button>
135
+ <custom-button variant="secondary">Secondary</custom-button>
136
+ <custom-button variant="tertiary">Tertiary</custom-button>
137
+ <!-- AURO-GENERATED-CONTENT:END -->
138
+ </div>
139
+ <auro-accordion alignRight>
140
+ <span slot="trigger">See code</span>
141
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
142
+ <!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
155
143
 
156
- ### Testing
157
-
158
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/testing.md) -->
159
- Automated tests are required for every Auro component. See `.\test\auro-button.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.
160
-
161
- <!-- AURO-GENERATED-CONTENT:END -->
144
+ ```html
145
+ <custom-button>Primary</custom-button>
146
+ <custom-button variant="secondary">Secondary</custom-button>
147
+ <custom-button variant="tertiary">Tertiary</custom-button>
148
+ ```
149
+ <!-- AURO-GENERATED-CONTENT:END -->
150
+ </auro-accordion>