Skip to content

Commit a68598d

Browse files
feat: add new fare and transparent variants #172
1 parent 72896a5 commit a68598d

File tree

12 files changed

+212
-135
lines changed

12 files changed

+212
-135
lines changed

README.md

Lines changed: 35 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,20 @@ This will create a new custom element that you can use in your HTML that will fu
5252
</auro-accordion>
5353
<!-- AURO-GENERATED-CONTENT:END -->
5454

55-
## UI development browser support
55+
## Use Cases
5656

57-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/browserSupport.md) -->
58-
For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
57+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
58+
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
59+
The `auro-badge` use cases include:
5960

61+
* Additional information to draw attention to a specific area of the interface
62+
* Advising the user of a specific action or status
6063
<!-- AURO-GENERATED-CONTENT:END -->
6164

6265
## Install
6366

6467
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
65-
[![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-badge/testPublish.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-badge/actions/workflows/testPublish.yml)
68+
[![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-badge/release.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-badge/actions/workflows/release.yml)
6669
[![See it on NPM!](https://img.shields.io/npm/v/@aurodesignsystem/auro-badge?style=for-the-badge&color=orange)](https://www.npmjs.com/package/@aurodesignsystem/auro-badge)
6770
[![License](https://img.shields.io/npm/l/@aurodesignsystem/auro-badge?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
6871
![ESM supported](https://img.shields.io/badge/ESM-compatible-FFE900?style=for-the-badge)
@@ -73,17 +76,10 @@ $ npm i @aurodesignsystem/auro-badge
7376

7477
<!-- AURO-GENERATED-CONTENT:END -->
7578

76-
### Design Token CSS Custom Property dependency
77-
78-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/designTokens.md) -->
79-
The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
80-
81-
<!-- AURO-GENERATED-CONTENT:END -->
82-
83-
### Define dependency in project component
79+
### Define Dependency in Project
8480

8581
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
86-
Defining the component dependency within each component that is using the `<auro-badge>` component.
82+
Defining the dependency within each project that is using the `<auro-badge>` component.
8783

8884
<!-- AURO-GENERATED-CONTENT:END -->
8985
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
@@ -92,17 +88,9 @@ Defining the component dependency within each component that is using the `<auro
9288
import "@aurodesignsystem/auro-badge";
9389
```
9490

95-
<!-- AURO-GENERATED-CONTENT:END -->
96-
**Reference component in HTML**
97-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
98-
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
99-
100-
```html
101-
<auro-badge>Nonstop</auro-badge>
102-
```
10391
<!-- AURO-GENERATED-CONTENT:END -->
10492

105-
## Use CDN
93+
### Use CDN
10694

10795
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
10896
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.
@@ -113,19 +101,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
113101

114102
<!-- AURO-GENERATED-CONTENT:END -->
115103

116-
## auro-badge use cases
117-
118-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
119-
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
120-
The `auro-badge` use cases include:
121-
122-
* Additional information to draw attention to a specific area of the interface
123-
* Advising the user of a specific action or status
124-
<!-- AURO-GENERATED-CONTENT:END -->
125-
126-
## API Code Examples
127-
128-
### Default auro-badge
104+
## Basic Example
129105

130106
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
131107
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
@@ -135,31 +111,34 @@ The `auro-badge` use cases include:
135111
```
136112
<!-- AURO-GENERATED-CONTENT:END -->
137113

138-
## Development
114+
## Custom Component Registration for Version Management
139115

140-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/developmentDescription.md) -->
141-
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.
116+
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.
117+
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
142118

143-
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.
119+
When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
144120

145-
<!-- AURO-GENERATED-CONTENT:END -->
146-
147-
### Start development environment
121+
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.
148122

149-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/localhost.md) -->
150-
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**.
151-
152-
```shell
153-
$ npm run dev
154-
```
123+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
155124

156-
Open [localhost:8000](http://localhost:8000/)
157-
125+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
126+
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
127+
<!-- add custom registration content here -->
158128
<!-- AURO-GENERATED-CONTENT:END -->
129+
<div class="exampleWrapper exampleWrapper--flex">
130+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
131+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
132+
<custom-badge variant="warning">Salutations World!</custom-badge>
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 -->
159139

160-
### Testing
161-
162-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/testing.md) -->
163-
Automated tests are required for every Auro component. See `.\test\auro-badge.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.
164-
165-
<!-- AURO-GENERATED-CONTENT:END -->
140+
```html
141+
<custom-badge variant="warning">Salutations World!</custom-badge>
142+
```
143+
<!-- AURO-GENERATED-CONTENT:END -->
144+
</auro-accordion>

apiExamples/fares.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<auro-badge variant="fare-saver">saver</auro-badge>
2+
<auro-badge variant="fare-economy">economy</auro-badge>
3+
<auro-badge variant="fare-premium">premium</auro-badge>
4+
<auro-badge variant="fare-business">business</auro-badge>
5+
<auro-badge variant="fare-first">first</auro-badge>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<auro-badge variant="transparent-inverse">saver</auro-badge>

apiExamples/transparency.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<auro-badge variant="transparent">saver</auro-badge>

custom-elements.json

Lines changed: 14 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"text": "string"
2424
},
2525
"description": "Defines whether the component will be on lighter or darker backgrounds.\n Possible Values: `default`, `inverse`",
26-
"default": "'default'",
26+
"default": "\"default\"",
2727
"fieldName": "appearance",
2828
"inheritedFrom": {
2929
"name": "AuroBadge",
@@ -129,7 +129,7 @@
129129
"type": {
130130
"text": "String"
131131
},
132-
"description": "Sets the color UI of the badge Possible Values: - `accent1`, `accent2`, `accent3`, `accent4`, `bronze`, `cobalt`, `copper`, `gold`, `nickel`, `platinum`, `silver`, `titanium`, `transparent`, `info`, `error`, `success`, `warning`, `emerald`, `sapphire`, `ruby`, `lounge`, `loungeplus` Deprecated Values: - `mvp`, `mvpgold`, `mvpgold75k`",
132+
"description": "Sets the color UI of the badge Possible Values: `accent1`, `accent2`, `accent3`, `accent4`, `bronze`, `cobalt`, `copper`, `gold`, `nickel`, `platinum`, `silver`, `titanium`, `transparent`, `info`, `error`, `success`, `warning`, `emerald`, `sapphire`, `ruby`, `lounge`, `loungeplus`, `fare-saver`, `fare-economy`, `fare-premium`, `fare-business`, `fare-first` Deprecated Values: `mvp`, `mvpgold`, `mvpgold75k`",
133133
"name": "variant",
134134
"inheritedFrom": {
135135
"name": "AuroBadge",
@@ -146,7 +146,7 @@
146146
"text": "string"
147147
},
148148
"description": "Defines whether the component will be on lighter or darker backgrounds.\n Possible Values: `default`, `inverse`",
149-
"default": "'default'",
149+
"default": "\"default\"",
150150
"attribute": "appearance",
151151
"reflects": true,
152152
"inheritedFrom": {
@@ -272,6 +272,9 @@
272272
"inheritedFrom": {
273273
"name": "AuroBadge",
274274
"module": "src/auro-badge.js"
275+
},
276+
"type": {
277+
"text": "register(name?: string = \"auro-badge\") => void"
275278
}
276279
},
277280
{
@@ -313,7 +316,9 @@
313316
"module": "src/auro-badge.js"
314317
}
315318
}
316-
]
319+
],
320+
"modulePath": "scripts/wca/auro-badge.js",
321+
"definitionPath": "scripts/wca/auro-badge.js"
317322
}
318323
],
319324
"exports": [
@@ -344,7 +349,7 @@
344349
"text": "string"
345350
},
346351
"description": "Defines whether the component will be on lighter or darker backgrounds.\n Possible Values: `default`, `inverse`",
347-
"default": "'default'",
352+
"default": "\"default\"",
348353
"attribute": "appearance",
349354
"reflects": true
350355
},
@@ -471,7 +476,7 @@
471476
"text": "string"
472477
},
473478
"description": "Defines whether the component will be on lighter or darker backgrounds.\n Possible Values: `default`, `inverse`",
474-
"default": "'default'",
479+
"default": "\"default\"",
475480
"fieldName": "appearance"
476481
},
477482
{
@@ -541,15 +546,16 @@
541546
"type": {
542547
"text": "String"
543548
},
544-
"description": "Sets the color UI of the badge Possible Values: - `accent1`, `accent2`, `accent3`, `accent4`, `bronze`, `cobalt`, `copper`, `gold`, `nickel`, `platinum`, `silver`, `titanium`, `transparent`, `info`, `error`, `success`, `warning`, `emerald`, `sapphire`, `ruby`, `lounge`, `loungeplus` Deprecated Values: - `mvp`, `mvpgold`, `mvpgold75k`",
549+
"description": "Sets the color UI of the badge Possible Values: `accent1`, `accent2`, `accent3`, `accent4`, `bronze`, `cobalt`, `copper`, `gold`, `nickel`, `platinum`, `silver`, `titanium`, `transparent`, `info`, `error`, `success`, `warning`, `emerald`, `sapphire`, `ruby`, `lounge`, `loungeplus`, `fare-saver`, `fare-economy`, `fare-premium`, `fare-business`, `fare-first` Deprecated Values: `mvp`, `mvpgold`, `mvpgold75k`",
545550
"name": "variant"
546551
}
547552
],
548553
"superclass": {
549554
"name": "LitElement",
550555
"package": "lit"
551556
},
552-
"customElement": true
557+
"customElement": true,
558+
"modulePath": "src/auro-badge.js"
553559
}
554560
],
555561
"exports": [
@@ -578,20 +584,6 @@
578584
}
579585
]
580586
},
581-
{
582-
"kind": "javascript-module",
583-
"path": "src/color-css.js",
584-
"declarations": [],
585-
"exports": [
586-
{
587-
"kind": "js",
588-
"name": "default",
589-
"declaration": {
590-
"module": "src/color-css.js"
591-
}
592-
}
593-
]
594-
},
595587
{
596588
"kind": "javascript-module",
597589
"path": "src/iconVersion.js",
@@ -627,34 +619,6 @@
627619
"path": "src/registered.js",
628620
"declarations": [],
629621
"exports": []
630-
},
631-
{
632-
"kind": "javascript-module",
633-
"path": "src/style-css.js",
634-
"declarations": [],
635-
"exports": [
636-
{
637-
"kind": "js",
638-
"name": "default",
639-
"declaration": {
640-
"module": "src/style-css.js"
641-
}
642-
}
643-
]
644-
},
645-
{
646-
"kind": "javascript-module",
647-
"path": "src/tokens-css.js",
648-
"declarations": [],
649-
"exports": [
650-
{
651-
"kind": "js",
652-
"name": "default",
653-
"declaration": {
654-
"module": "src/tokens-css.js"
655-
}
656-
}
657-
]
658622
}
659623
]
660624
}

0 commit comments

Comments
 (0)