@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 +50 -65
- package/custom-elements.json +597 -988
- package/demo/api.html +1 -0
- package/demo/api.js +2 -2
- package/demo/api.md +539 -254
- package/demo/auro-button.min.js +24 -26
- package/demo/button-sheet.html +1 -0
- package/demo/form.html +1 -0
- package/demo/icon-sheet.html +1 -0
- package/demo/index.html +1 -0
- package/demo/index.md +11 -380
- package/dist/{auro-button-CvWxpTkj.js → auro-button-waZOsuy7.js} +6 -6
- package/dist/index.d.ts +338 -63
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +7 -7
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 -->
|
|
@@ -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
|
-
##
|
|
39
|
+
## Use Cases
|
|
44
40
|
|
|
45
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
46
|
-
|
|
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
|
-
[](https://github.com/AlaskaAirlines/auro-button/actions/workflows/release.yml)
|
|
54
55
|
[](https://www.npmjs.com/package/@aurodesignsystem/auro-button)
|
|
55
56
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
56
57
|

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