@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 +49 -60
- package/custom-elements.json +597 -988
- package/demo/api.js +2 -2
- package/demo/api.md +539 -254
- package/demo/auro-button.min.js +14 -20
- package/demo/index.md +11 -380
- package/dist/{auro-button-CvWxpTkj.js → auro-button-KNlgDWfi.js} +3 -3
- package/dist/index.d.ts +248 -63
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +5 -5
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>`
|
|
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
|
-
##
|
|
43
|
+
## Use Cases
|
|
44
44
|
|
|
45
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
46
|
-
|
|
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
|
-
[](https://github.com/AlaskaAirlines/auro-button/actions/workflows/release.yml)
|
|
54
59
|
[](https://www.npmjs.com/package/@aurodesignsystem/auro-button)
|
|
55
60
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
56
61
|

|
|
@@ -61,17 +66,10 @@ $ npm i @aurodesignsystem/auro-button
|
|
|
61
66
|
|
|
62
67
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
63
68
|
|
|
64
|
-
###
|
|
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
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
##
|
|
107
|
+
## Custom Component Registration for Version Management
|
|
135
108
|
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
149
|
-
|
|
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
|
-
|
|
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
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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>
|