@aurodesignsystem-dev/auro-card 0.0.0-pr136.0 → 0.0.0-pr139.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 CHANGED
@@ -28,17 +28,25 @@ The following sections are editable by making changes to the following files:
28
28
  <!-- 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. -->
29
29
  <!-- AURO-GENERATED-CONTENT:END -->
30
30
 
31
- ## UI development browser support
31
+ ## Use Cases
32
32
 
33
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/browserSupport.md) -->
34
- For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
33
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
34
+ <!-- The below content is automatically added from ./docs/partials/useCases.md -->
35
+ The `<auro-card>` element can be use in a variety of ways, including:
35
36
 
37
+ - Navigation: Cards can be used for navigation purposes.
38
+ - Featured information: Cards can be used to display featured information or related content.
39
+ - Content containers: Cards can be used to organize information consistently within a page.
40
+ - Grouping information: Cards can be used to group information.
41
+ - Providing a visual hierarchy: Cards can provide a clear visual hierarchy, organizing information into brief, self-contained units.
42
+ - Providing an overview: Cards can serve as an overview and an entry point for more detailed information.
43
+ - Providing a summary: Cards can present a summary and link to additional details.
36
44
  <!-- AURO-GENERATED-CONTENT:END -->
37
45
 
38
46
  ## Install
39
47
 
40
48
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
41
- [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-card/testPublish.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-card/actions/workflows/testPublish.yml)
49
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-card/release.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-card/actions/workflows/release.yml)
42
50
  [![See it on NPM!](https://img.shields.io/npm/v/@aurodesignsystem/auro-card?style=for-the-badge&color=orange)](https://www.npmjs.com/package/@aurodesignsystem/auro-card)
43
51
  [![License](https://img.shields.io/npm/l/@aurodesignsystem/auro-card?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
44
52
  ![ESM supported](https://img.shields.io/badge/ESM-compatible-FFE900?style=for-the-badge)
@@ -49,17 +57,10 @@ $ npm i @aurodesignsystem/auro-card
49
57
 
50
58
  <!-- AURO-GENERATED-CONTENT:END -->
51
59
 
52
- ### Design Token CSS Custom Property dependency
53
-
54
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/designTokens.md) -->
55
- The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
56
-
57
- <!-- AURO-GENERATED-CONTENT:END -->
58
-
59
- ### Define dependency in project component
60
+ ### Define Dependency in Project
60
61
 
61
62
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
62
- Defining the component dependency within each component that is using the `<auro-card>` component.
63
+ Defining the dependency within each project that is using the `<auro-card>` component.
63
64
 
64
65
  <!-- AURO-GENERATED-CONTENT:END -->
65
66
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
@@ -68,31 +69,9 @@ Defining the component dependency within each component that is using the `<auro
68
69
  import "@aurodesignsystem/auro-card";
69
70
  ```
70
71
 
71
- <!-- AURO-GENERATED-CONTENT:END -->
72
- **Reference component in HTML**
73
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
74
- <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
75
-
76
- ```html
77
- <auro-card>
78
- <img
79
- slot="image"
80
- src="https://picsum.photos/300/300?random=0"
81
- alt="Random insert"/>
82
- <h3 slot="header">Card Title</h3>
83
- <p slot="description">
84
- Context goes here.
85
- </p>
86
- <div slot="cta">
87
- <auro-hyperlink href="/" nav target="_blank">
88
- More info
89
- </auro-hyperlink>
90
- </div>
91
- </auro-card>
92
- ```
93
72
  <!-- AURO-GENERATED-CONTENT:END -->
94
73
 
95
- ## Use CDN
74
+ ### Use CDN
96
75
 
97
76
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
98
77
  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.
@@ -103,30 +82,113 @@ In cases where the project is not able to process JS assets, there are pre-proce
103
82
 
104
83
  <!-- AURO-GENERATED-CONTENT:END -->
105
84
 
106
- ## auro-card use cases
85
+ ## Basic Example
107
86
 
108
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
109
- <!-- The below content is automatically added from ./docs/partials/useCases.md -->
110
- The `<auro-card>` element can be use in a variety of ways, including:
111
-
112
- - Navigation: Cards can be used for navigation purposes.
113
- - Featured information: Cards can be used to display featured information or related content.
114
- - Content containers: Cards can be used to organize information consistently within a page.
115
- - Grouping information: Cards can be used to group information.
116
- - Providing a visual hierarchy: Cards can provide a clear visual hierarchy, organizing information into brief, self-contained units.
117
- - Providing an overview: Cards can serve as an overview and an entry point for more detailed information.
118
- - Providing a summary: Cards can present a summary and link to additional details.
87
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
88
+ <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
89
+
90
+ ```html
91
+ <div style="display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 4rem;">
92
+ <auro-card>
93
+ <img
94
+ slot="image"
95
+ src="https://picsum.photos/300/300?random=0"
96
+ alt="Random insert"/>
97
+ <auro-header slot="header" level="2" display="500">Display card title here</auro-header>
98
+ <p slot="description">
99
+ Context goes here.
100
+ </p>
101
+ <div slot="cta">
102
+ <auro-hyperlink href="/" type="nav" target="_blank">
103
+ More info
104
+ </auro-hyperlink>
105
+ </div>
106
+ </auro-card>
107
+ <auro-card style="max-width: 300px">
108
+ <img
109
+ slot="image"
110
+ src="https://picsum.photos/300/200?random=1"
111
+ alt="Random insert"/>
112
+ <auro-header slot="header" level="2" display="500">Display card title here</auro-header>
113
+ <p slot="description">
114
+ Context goes here. Use this area to communicate more information to your users.
115
+ </p>
116
+ <div slot="cta">
117
+ <auro-hyperlink href="/" nav target="_blank" type="cta">
118
+ More info
119
+ </auro-hyperlink>
120
+ </div>
121
+ </auro-card>
122
+ <auro-card style="max-width: 150px">
123
+ <img
124
+ slot="image"
125
+ src="https://picsum.photos/150/250?random=1"
126
+ alt="Random insert"/>
127
+ <auro-header slot="header" level="2" display="500">Display title</auro-header>
128
+ <p slot="description">
129
+ Context goes here.
130
+ </p>
131
+ <div slot="cta">
132
+ <auro-hyperlink href="/" type="nav" target="_blank">
133
+ More info
134
+ </auro-hyperlink>
135
+ </div>
136
+ </auro-card>
137
+ </div>
138
+ ```
119
139
  <!-- AURO-GENERATED-CONTENT:END -->
120
140
 
121
- ## API Code Examples
141
+ ## Custom Component Registration for Version Management
142
+
143
+ 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.
144
+ The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
145
+
146
+ When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
147
+
148
+ 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.
149
+
150
+ You can do this by importing only the component class and using the `register(name)` method with a unique name:
151
+
152
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
153
+ <!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
122
154
 
123
- ### Default auro-card
155
+ ```js
156
+ // Import the class only
157
+ import { AuroCard } from '@aurodesignsystem/auro-card/class';
124
158
 
125
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
126
- <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
159
+ // Register with a custom name if desired
160
+ AuroCard.register('custom-card');
161
+ ```
162
+
163
+ This will create a new custom element `<custom-card>` that behaves exactly like `<auro-card>`, allowing both to coexist on the same page without interfering with each other.
164
+ <!-- AURO-GENERATED-CONTENT:END -->
165
+ <div class="exampleWrapper exampleWrapper--flex">
166
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
167
+ <!-- The below content is automatically added from ./apiExamples/custom.html -->
168
+ <custom-card>
169
+ <img
170
+ slot="image"
171
+ src="https://picsum.photos/300/300?random=0"
172
+ alt="Random insert"/>
173
+ <h3 slot="header">Card Title</h3>
174
+ <p slot="description">
175
+ Context goes here.
176
+ </p>
177
+ <div slot="cta">
178
+ <auro-hyperlink href="/" type="nav" target="_blank">
179
+ More info
180
+ </auro-hyperlink>
181
+ </div>
182
+ </custom-card>
183
+ <!-- AURO-GENERATED-CONTENT:END -->
184
+ </div>
185
+ <auro-accordion alignRight>
186
+ <span slot="trigger">See code</span>
187
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
188
+ <!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
127
189
 
128
190
  ```html
129
- <auro-card>
191
+ <custom-card>
130
192
  <img
131
193
  slot="image"
132
194
  src="https://picsum.photos/300/300?random=0"
@@ -136,39 +198,11 @@ The `<auro-card>` element can be use in a variety of ways, including:
136
198
  Context goes here.
137
199
  </p>
138
200
  <div slot="cta">
139
- <auro-hyperlink href="/" nav target="_blank">
201
+ <auro-hyperlink href="/" type="nav" target="_blank">
140
202
  More info
141
203
  </auro-hyperlink>
142
204
  </div>
143
- </auro-card>
205
+ </custom-card>
144
206
  ```
145
207
  <!-- AURO-GENERATED-CONTENT:END -->
146
-
147
- ## Development
148
-
149
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/developmentDescription.md) -->
150
- 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.
151
-
152
- 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.
153
-
154
- <!-- AURO-GENERATED-CONTENT:END -->
155
-
156
- ### Start development environment
157
-
158
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/localhost.md) -->
159
- 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**.
160
-
161
- ```shell
162
- $ npm run dev
163
- ```
164
-
165
- Open [localhost:8000](http://localhost:8000/)
166
-
167
- <!-- AURO-GENERATED-CONTENT:END -->
168
-
169
- ### Testing
170
-
171
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/testing.md) -->
172
- Automated tests are required for every Auro component. See `.\test\auro-card.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.
173
-
174
- <!-- AURO-GENERATED-CONTENT:END -->
208
+ </auro-accordion>