@aurodesignsystem-dev/auro-button 0.0.0-pr378.0 → 0.0.0-pr378.2

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 -->
@@ -33,24 +33,25 @@ The following sections are editable by making changes to the following files:
33
33
 
34
34
  Beyond that breakpoint `<auro-button>` will assume the width of the content or a min-width of `8.75rem`, which ever is greater.
35
35
 
36
- If the desired appearance of the `<auro-button>` is to be placed in the reverse direction of natural content, then the attributes of `responsive` and `reverse` are needed on the `<auro-button>` element.
37
-
38
- ## Multi button support
39
-
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`.
36
+ If the desired appearance of the `<auro-button>` is to be placed in the reverse direction of natural content, then the attributes of `responsive` and `reverse` are needed on the `<auro-button>` element.
41
37
  <!-- AURO-GENERATED-CONTENT:END -->
42
38
 
43
- ## UI development browser support
39
+ ## Use Cases
44
40
 
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)
41
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
42
+ <!-- The below content is automatically added from ./docs/partials/useCases.md -->
43
+ The auro-button element should be used in situations where users may:
47
44
 
45
+ * submit a form
46
+ * begin a new task
47
+ * trigger a new UI element to appear to the page
48
+ * specify a new or next step in a process
48
49
  <!-- AURO-GENERATED-CONTENT:END -->
49
50
 
50
51
  ## Install
51
52
 
52
53
  <!-- 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)
54
+ [![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
55
  [![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
56
  [![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
57
  ![ESM supported](https://img.shields.io/badge/ESM-compatible-FFE900?style=for-the-badge)
@@ -61,17 +62,10 @@ $ npm i @aurodesignsystem/auro-button
61
62
 
62
63
  <!-- AURO-GENERATED-CONTENT:END -->
63
64
 
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
65
+ ### Define Dependency in Project
72
66
 
73
67
  <!-- 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.
68
+ Defining the dependency within each project that is using the `<auro-button>` component.
75
69
 
76
70
  <!-- AURO-GENERATED-CONTENT:END -->
77
71
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
@@ -80,20 +74,9 @@ Defining the component dependency within each component that is using the `<auro
80
74
  import "@aurodesignsystem/auro-button";
81
75
  ```
82
76
 
83
- <!-- 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
-
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
77
  <!-- AURO-GENERATED-CONTENT:END -->
95
78
 
96
- ## Use CDN
79
+ ### Use CDN
97
80
 
98
81
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
99
82
  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 +87,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
104
87
 
105
88
  <!-- AURO-GENERATED-CONTENT:END -->
106
89
 
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
90
+ ## Basic Example
122
91
 
123
92
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
124
93
  <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
@@ -131,31 +100,47 @@ The auro-button element should be used in situations where users may:
131
100
  ```
132
101
  <!-- AURO-GENERATED-CONTENT:END -->
133
102
 
134
- ## Development
103
+ ## Custom Component Registration for Version Management
135
104
 
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.
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.
138
107
 
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.
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.
140
109
 
141
- <!-- AURO-GENERATED-CONTENT:END -->
142
-
143
- ### 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.
144
111
 
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**.
112
+ You can do this by importing only the component class and using the `register(name)` method with a unique name:
147
113
 
148
- ```shell
149
- $ npm run dev
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 { AuroButton } from '@aurodesignsystem/auro-button/class';
120
+
121
+ // Register with a custom name if desired
122
+ AuroButton.register('custom-button');
150
123
  ```
151
124
 
152
- Open [localhost:8000](http://localhost:8000/)
153
-
125
+ 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
126
  <!-- AURO-GENERATED-CONTENT:END -->
127
+ <div class="exampleWrapper exampleWrapper--flex">
128
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
129
+ <!-- The below content is automatically added from ./apiExamples/custom.html -->
130
+ <custom-button>Primary</custom-button>
131
+ <custom-button variant="secondary">Secondary</custom-button>
132
+ <custom-button variant="tertiary">Tertiary</custom-button>
133
+ <!-- AURO-GENERATED-CONTENT:END -->
134
+ </div>
135
+ <auro-accordion alignRight>
136
+ <span slot="trigger">See code</span>
137
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
138
+ <!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
155
139
 
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 -->
140
+ ```html
141
+ <custom-button>Primary</custom-button>
142
+ <custom-button variant="secondary">Secondary</custom-button>
143
+ <custom-button variant="tertiary">Tertiary</custom-button>
144
+ ```
145
+ <!-- AURO-GENERATED-CONTENT:END -->
146
+ </auro-accordion>