@aurodesignsystem-dev/auro-icon 0.0.0-pr224.1 → 0.0.0-pr228.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 +44 -51
- package/demo/alaska.html +1 -1
- package/demo/api.html +1 -1
- package/demo/api.md +225 -131
- package/demo/api.min.js +8 -4
- package/demo/auro-icon.min.js +41 -14
- package/demo/index.html +1 -1
- package/demo/index.md +23 -89
- package/dist/{auro-icon-Q-6YPBJ5.js → auro-icon-Sh0BP5x6.js} +8 -8
- package/dist/index.d.ts +250 -36
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +17 -11
package/README.md
CHANGED
|
@@ -23,24 +23,28 @@ The following sections are editable by making changes to the following files:
|
|
|
23
23
|
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
24
24
|
Icons can be used to represent concepts or provide context to options and/or actions within an experience.
|
|
25
25
|
|
|
26
|
-
The `<auro-icon>`
|
|
26
|
+
The `<auro-icon>` element comes pre-configured with all the available [Auro Icons](https://auro.alaskaair.com/icons) . Simply add the `category` and `name` of the icon for quick and easy results.
|
|
27
27
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
28
28
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
29
29
|
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
30
30
|
<!-- AURO-GENERATED-CONTENT This file is to be used for any additional content that should be included in the README.md which is specific to this component. -->
|
|
31
31
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## Use Cases
|
|
34
34
|
|
|
35
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
36
|
-
|
|
35
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
36
|
+
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
37
|
+
The `<auro-icon>` element should be used in situations where users may:
|
|
37
38
|
|
|
39
|
+
* Benefit from additional context provided by an icon alongside text
|
|
40
|
+
* Need to quickly identify actions or options represented by icons
|
|
41
|
+
* Require visual indicators to enhance usability and navigation within an interface
|
|
38
42
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
39
43
|
|
|
40
44
|
## Install
|
|
41
45
|
|
|
42
46
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
|
|
43
|
-
[](https://github.com/AlaskaAirlines/auro-icon/actions/workflows/release.yml)
|
|
44
48
|
[](https://www.npmjs.com/package/@aurodesignsystem/auro-icon)
|
|
45
49
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
46
50
|

|
|
@@ -51,17 +55,10 @@ $ npm i @aurodesignsystem/auro-icon
|
|
|
51
55
|
|
|
52
56
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
53
57
|
|
|
54
|
-
###
|
|
55
|
-
|
|
56
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/designTokens.md) -->
|
|
57
|
-
The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
|
|
58
|
-
|
|
59
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
60
|
-
|
|
61
|
-
### Define dependency in project component
|
|
58
|
+
### Define Dependency in Project
|
|
62
59
|
|
|
63
60
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
64
|
-
Defining the
|
|
61
|
+
Defining the dependency within each project that is using the `<auro-icon>` component.
|
|
65
62
|
|
|
66
63
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
67
64
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
@@ -71,16 +68,8 @@ import "@aurodesignsystem/auro-icon";
|
|
|
71
68
|
```
|
|
72
69
|
|
|
73
70
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
74
|
-
**Reference component in HTML**
|
|
75
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
76
|
-
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
77
71
|
|
|
78
|
-
|
|
79
|
-
<auro-icon category="interface" name="pin-trip"></auro-icon>
|
|
80
|
-
```
|
|
81
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
82
|
-
|
|
83
|
-
## Use CDN
|
|
72
|
+
### Use CDN
|
|
84
73
|
|
|
85
74
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
86
75
|
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.
|
|
@@ -91,15 +80,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
91
80
|
|
|
92
81
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
93
82
|
|
|
94
|
-
##
|
|
95
|
-
|
|
96
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
97
|
-
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
98
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
99
|
-
|
|
100
|
-
## API Code Examples
|
|
101
|
-
|
|
102
|
-
### Default auro-icon
|
|
83
|
+
## Basic Example
|
|
103
84
|
|
|
104
85
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
105
86
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
@@ -109,31 +90,43 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
109
90
|
```
|
|
110
91
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
111
92
|
|
|
112
|
-
##
|
|
93
|
+
## Custom Component Registration for Version Management
|
|
113
94
|
|
|
114
|
-
|
|
115
|
-
|
|
95
|
+
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.
|
|
96
|
+
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
116
97
|
|
|
117
|
-
|
|
98
|
+
When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
|
|
118
99
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
### Start development environment
|
|
100
|
+
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.
|
|
122
101
|
|
|
123
|
-
|
|
124
|
-
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**.
|
|
102
|
+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
|
|
125
103
|
|
|
126
|
-
|
|
127
|
-
|
|
104
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
105
|
+
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
// Import the class only
|
|
109
|
+
import { AuroIcon } from '@aurodesignsystem/auro-icon/class';
|
|
110
|
+
|
|
111
|
+
// Register with a custom name if desired
|
|
112
|
+
AuroIcon.register('custom-icon');
|
|
128
113
|
```
|
|
129
114
|
|
|
130
|
-
|
|
131
|
-
|
|
115
|
+
This will create a new custom element `<custom-icon>` that behaves exactly like `<auro-icon>`, allowing both to coexist on the same page without interfering with each other.
|
|
132
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
117
|
+
<div class="exampleWrapper exampleWrapper--flex">
|
|
118
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
119
|
+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
120
|
+
<custom-icon category="interface" name="pin-trip"></custom-icon>
|
|
121
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
122
|
+
</div>
|
|
123
|
+
<auro-accordion alignRight>
|
|
124
|
+
<span slot="trigger">See code</span>
|
|
125
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
126
|
+
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
133
127
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
128
|
+
```html
|
|
129
|
+
<custom-icon category="interface" name="pin-trip"></custom-icon>
|
|
130
|
+
```
|
|
131
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
132
|
+
</auro-accordion>
|
package/demo/alaska.html
CHANGED
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
<script type="module" data-demo-script="true" src="./alaska.min.js"></script>
|
|
52
52
|
|
|
53
53
|
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest
|
|
54
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
|
|
55
55
|
</body>
|
|
56
56
|
</html>
|
package/demo/api.html
CHANGED
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
<script type="module" data-demo-script="true" src="./api.min.js"></script>
|
|
52
52
|
|
|
53
53
|
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest
|
|
54
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
|
|
55
55
|
</body>
|
|
56
56
|
</html>
|