@aurodesignsystem-dev/auro-backtotop 0.0.0-pr83.0 → 0.0.0-pr88.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
@@ -23,24 +23,26 @@ 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
  `<auro-backtotop>` is a [HTML custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) for the purpose of providing a quick and accessible means to jump back to the top of a long content page.
25
25
 
26
- The component will be hidden while the page Y scroll position is at the top. When scroll down begins the button will display in the bottom right corner of the page. While scrolling down the button will display only an arrow up icon. When scroll up occurs, the button will additionally display any slotted text content.
26
+ The component will be hidden while the page Y scroll position is at the top. When scroll down begins the button will display in the bottom right corner of the page. While scrolling down the button will display only an arrow up icon.
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
- ## UI development browser support
33
+ ## Use Cases
34
34
 
35
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/browserSupport.md) -->
36
- For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
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-backtotop>` element should be used in situations where users may:
37
38
 
39
+ * Pages with large amounts of content where a shortcut to jump to the top of the page is appropriate.
38
40
  <!-- AURO-GENERATED-CONTENT:END -->
39
41
 
40
42
  ## Install
41
43
 
42
44
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
43
- [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-backtotop/testPublish.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-backtotop/actions/workflows/testPublish.yml)
45
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-backtotop/release.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-backtotop/actions/workflows/release.yml)
44
46
  [![See it on NPM!](https://img.shields.io/npm/v/@aurodesignsystem/auro-backtotop?style=for-the-badge&color=orange)](https://www.npmjs.com/package/@aurodesignsystem/auro-backtotop)
45
47
  [![License](https://img.shields.io/npm/l/@aurodesignsystem/auro-backtotop?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
46
48
  ![ESM supported](https://img.shields.io/badge/ESM-compatible-FFE900?style=for-the-badge)
@@ -51,17 +53,10 @@ $ npm i @aurodesignsystem/auro-backtotop
51
53
 
52
54
  <!-- AURO-GENERATED-CONTENT:END -->
53
55
 
54
- ### Design Token CSS Custom Property dependency
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
56
+ ### Define Dependency in Project
62
57
 
63
58
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
64
- Defining the component dependency within each component that is using the `<auro-backtotop>` component.
59
+ Defining the dependency within each project that is using the `<auro-backtotop>` component.
65
60
 
66
61
  <!-- AURO-GENERATED-CONTENT:END -->
67
62
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
@@ -70,17 +65,9 @@ Defining the component dependency within each component that is using the `<auro
70
65
  import "@aurodesignsystem/auro-backtotop";
71
66
  ```
72
67
 
73
- <!-- 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
-
78
- ```html
79
- <auro-backtotop>Back to top</auro-backtotop>
80
- ```
81
68
  <!-- AURO-GENERATED-CONTENT:END -->
82
69
 
83
- ## Use CDN
70
+ ### Use CDN
84
71
 
85
72
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
86
73
  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,18 +78,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
91
78
 
92
79
  <!-- AURO-GENERATED-CONTENT:END -->
93
80
 
94
- ## auro-backtotop use cases
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
- The `<auro-backtotop>` element should be used in situations where users may:
99
-
100
- * Pages with large amounts of content where a shortcut to jump to the top of the page is appropriate.
101
- <!-- AURO-GENERATED-CONTENT:END -->
102
-
103
- ## API Code Examples
104
-
105
- ### Default auro-backtotop
81
+ ## Basic Example
106
82
 
107
83
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
108
84
  <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
@@ -112,31 +88,43 @@ The `<auro-backtotop>` element should be used in situations where users may:
112
88
  ```
113
89
  <!-- AURO-GENERATED-CONTENT:END -->
114
90
 
115
- ## Development
91
+ ## Custom Component Registration for Version Management
116
92
 
117
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/developmentDescription.md) -->
118
- 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.
93
+ 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.
94
+ The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
119
95
 
120
- 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.
96
+ When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
121
97
 
122
- <!-- AURO-GENERATED-CONTENT:END -->
123
-
124
- ### Start development environment
98
+ 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.
125
99
 
126
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/localhost.md) -->
127
- 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**.
100
+ You can do this by importing only the component class and using the `register(name)` method with a unique name:
128
101
 
129
- ```shell
130
- $ npm run dev
102
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
103
+ <!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
104
+
105
+ ```js
106
+ // Import the class only
107
+ import { AuroBackToTop } from '@aurodesignsystem/auro-backtotop/class';
108
+
109
+ // Register with a custom name if desired
110
+ AuroBackToTop.register('custom-backtotop');
131
111
  ```
132
112
 
133
- Open [localhost:8000](http://localhost:8000/)
134
-
113
+ This will create a new custom element `<custom-backtotop>` that behaves exactly like `<auro-backtotop>`, allowing both to coexist on the same page without interfering with each other.
135
114
  <!-- AURO-GENERATED-CONTENT:END -->
115
+ <div class="exampleWrapper exampleWrapper--flex">
116
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
117
+ <!-- The below content is automatically added from ./apiExamples/custom.html -->
118
+ <custom-backtotop>Custom back to top</custom-backtotop>
119
+ <!-- AURO-GENERATED-CONTENT:END -->
120
+ </div>
121
+ <auro-accordion alignRight>
122
+ <span slot="trigger">See code</span>
123
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
124
+ <!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
136
125
 
137
- ### Testing
138
-
139
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/testing.md) -->
140
- Automated tests are required for every Auro component. See `.\test\auro-backtotop.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.
141
-
142
- <!-- AURO-GENERATED-CONTENT:END -->
126
+ ```html
127
+ <custom-backtotop>Custom back to top</custom-backtotop>
128
+ ```
129
+ <!-- AURO-GENERATED-CONTENT:END -->
130
+ </auro-accordion>
@@ -2,266 +2,13 @@
2
2
  "schemaVersion": "1.0.0",
3
3
  "readme": "",
4
4
  "modules": [
5
- {
6
- "kind": "javascript-module",
7
- "path": "scripts/wca/auro-backtotop.js",
8
- "declarations": [
9
- {
10
- "kind": "class",
11
- "description": "The auro-backtotop element provides users a way to quickly return to page top.",
12
- "name": "AuroBackToTopWCA",
13
- "superclass": {
14
- "name": "AuroBackToTop",
15
- "module": "/src/auro-backtotop.js"
16
- },
17
- "tagName": "auro-backtotop",
18
- "customElement": true,
19
- "slots": [
20
- {
21
- "description": "Default slot for the text of the button.",
22
- "name": "",
23
- "inheritedFrom": {
24
- "name": "AuroBackToTop",
25
- "module": "src/auro-backtotop.js"
26
- }
27
- },
28
- {
29
- "description": "Use this slot to pass an aria-label to the HTML5 button.",
30
- "name": "ariaLabel",
31
- "inheritedFrom": {
32
- "name": "AuroBackToTop",
33
- "module": "src/auro-backtotop.js"
34
- }
35
- }
36
- ],
37
- "cssParts": [
38
- {
39
- "description": "Apply CSS to HTML5 button.",
40
- "name": "button",
41
- "inheritedFrom": {
42
- "name": "AuroBackToTop",
43
- "module": "src/auro-backtotop.js"
44
- }
45
- },
46
- {
47
- "description": "Apply CSS to arrow up icon.",
48
- "name": "icon",
49
- "inheritedFrom": {
50
- "name": "AuroBackToTop",
51
- "module": "src/auro-backtotop.js"
52
- }
53
- }
54
- ],
55
- "attributes": [
56
- {
57
- "name": "disabled",
58
- "type": {
59
- "text": "boolean"
60
- },
61
- "description": "Render the trigger inline, will always be visible.",
62
- "fieldName": "disabled",
63
- "inheritedFrom": {
64
- "name": "AuroBackToTop",
65
- "module": "src/auro-backtotop.js"
66
- }
67
- },
68
- {
69
- "name": "hidden",
70
- "type": {
71
- "text": "boolean"
72
- },
73
- "fieldName": "hidden",
74
- "inheritedFrom": {
75
- "name": "AuroBackToTop",
76
- "module": "src/auro-backtotop.js"
77
- }
78
- },
79
- {
80
- "name": "interactionActive",
81
- "type": {
82
- "text": "boolean"
83
- },
84
- "fieldName": "interactionActive",
85
- "inheritedFrom": {
86
- "name": "AuroBackToTop",
87
- "module": "src/auro-backtotop.js"
88
- }
89
- },
90
- {
91
- "name": "lastScrollDirectionUp",
92
- "type": {
93
- "text": "boolean"
94
- },
95
- "fieldName": "lastScrollDirectionUp",
96
- "inheritedFrom": {
97
- "name": "AuroBackToTop",
98
- "module": "src/auro-backtotop.js"
99
- }
100
- },
101
- {
102
- "name": "variant",
103
- "type": {
104
- "text": "string"
105
- },
106
- "description": "The variant attribute allows for rendering the button using the primary (default) or secondary styles.",
107
- "default": "\"primary\"",
108
- "fieldName": "variant",
109
- "inheritedFrom": {
110
- "name": "AuroBackToTop",
111
- "module": "src/auro-backtotop.js"
112
- }
113
- }
114
- ],
115
- "members": [
116
- {
117
- "kind": "field",
118
- "name": "disabled",
119
- "privacy": "public",
120
- "type": {
121
- "text": "boolean"
122
- },
123
- "description": "Render the trigger inline, will always be visible.",
124
- "attribute": "disabled",
125
- "reflects": true,
126
- "inheritedFrom": {
127
- "name": "AuroBackToTop",
128
- "module": "src/auro-backtotop.js"
129
- }
130
- },
131
- {
132
- "kind": "field",
133
- "name": "hidden",
134
- "privacy": "public",
135
- "type": {
136
- "text": "boolean"
137
- },
138
- "attribute": "hidden",
139
- "reflects": true,
140
- "inheritedFrom": {
141
- "name": "AuroBackToTop",
142
- "module": "src/auro-backtotop.js"
143
- }
144
- },
145
- {
146
- "kind": "method",
147
- "name": "initializeProperties",
148
- "inheritedFrom": {
149
- "name": "AuroBackToTop",
150
- "module": "src/auro-backtotop.js"
151
- }
152
- },
153
- {
154
- "kind": "field",
155
- "name": "interactionActive",
156
- "privacy": "public",
157
- "type": {
158
- "text": "boolean"
159
- },
160
- "attribute": "interactionActive",
161
- "inheritedFrom": {
162
- "name": "AuroBackToTop",
163
- "module": "src/auro-backtotop.js"
164
- }
165
- },
166
- {
167
- "kind": "field",
168
- "name": "lastScrollDirectionUp",
169
- "privacy": "public",
170
- "type": {
171
- "text": "boolean"
172
- },
173
- "attribute": "lastScrollDirectionUp",
174
- "inheritedFrom": {
175
- "name": "AuroBackToTop",
176
- "module": "src/auro-backtotop.js"
177
- }
178
- },
179
- {
180
- "kind": "method",
181
- "name": "onTriggerClick",
182
- "privacy": "private",
183
- "return": {
184
- "type": {
185
- "text": "void"
186
- }
187
- },
188
- "inheritedFrom": {
189
- "name": "AuroBackToTop",
190
- "module": "src/auro-backtotop.js"
191
- }
192
- },
193
- {
194
- "kind": "method",
195
- "name": "register",
196
- "static": true,
197
- "parameters": [
198
- {
199
- "name": "name",
200
- "default": "\"auro-backtotop\"",
201
- "description": "The name of element that you want to register to.",
202
- "optional": true,
203
- "type": {
204
- "text": "string"
205
- }
206
- }
207
- ],
208
- "description": "This will register this element with the browser.",
209
- "inheritedFrom": {
210
- "name": "AuroBackToTop",
211
- "module": "src/auro-backtotop.js"
212
- }
213
- },
214
- {
215
- "kind": "method",
216
- "name": "scrollTop",
217
- "privacy": "private",
218
- "return": {
219
- "type": {
220
- "text": "void"
221
- }
222
- },
223
- "inheritedFrom": {
224
- "name": "AuroBackToTop",
225
- "module": "src/auro-backtotop.js"
226
- }
227
- },
228
- {
229
- "kind": "field",
230
- "name": "variant",
231
- "privacy": "public",
232
- "type": {
233
- "text": "string"
234
- },
235
- "description": "The variant attribute allows for rendering the button using the primary (default) or secondary styles.",
236
- "default": "\"primary\"",
237
- "attribute": "variant",
238
- "reflects": true,
239
- "inheritedFrom": {
240
- "name": "AuroBackToTop",
241
- "module": "src/auro-backtotop.js"
242
- }
243
- }
244
- ]
245
- }
246
- ],
247
- "exports": [
248
- {
249
- "kind": "custom-element-definition",
250
- "name": "auro-backtotop",
251
- "declaration": {
252
- "name": "AuroBackToTopWCA",
253
- "module": "scripts/wca/auro-backtotop.js"
254
- }
255
- }
256
- ]
257
- },
258
5
  {
259
6
  "kind": "javascript-module",
260
7
  "path": "src/auro-backtotop.js",
261
8
  "declarations": [
262
9
  {
263
10
  "kind": "class",
264
- "description": "The auro-backtotop element provides users a way to quickly return to page top.",
11
+ "description": "The `auro-backtotop` element provides users a way to quickly return to page top.",
265
12
  "name": "AuroBackToTop",
266
13
  "cssParts": [
267
14
  {
@@ -284,6 +31,13 @@
284
31
  }
285
32
  ],
286
33
  "members": [
34
+ {
35
+ "kind": "method",
36
+ "name": "_initializeDefaults",
37
+ "type": {
38
+ "text": "_initializeDefaults() => void"
39
+ }
40
+ },
287
41
  {
288
42
  "kind": "field",
289
43
  "name": "disabled",
@@ -292,6 +46,7 @@
292
46
  "text": "boolean"
293
47
  },
294
48
  "description": "Render the trigger inline, will always be visible.",
49
+ "default": "false",
295
50
  "attribute": "disabled",
296
51
  "reflects": true
297
52
  },
@@ -302,12 +57,7 @@
302
57
  "type": {
303
58
  "text": "boolean"
304
59
  },
305
- "attribute": "hidden",
306
- "reflects": true
307
- },
308
- {
309
- "kind": "method",
310
- "name": "initializeProperties"
60
+ "attribute": "hidden"
311
61
  },
312
62
  {
313
63
  "kind": "field",
@@ -345,14 +95,17 @@
345
95
  {
346
96
  "name": "name",
347
97
  "default": "\"auro-backtotop\"",
348
- "description": "The name of element that you want to register to.",
98
+ "description": "The name of the element that you want to register.",
349
99
  "optional": true,
350
100
  "type": {
351
101
  "text": "string"
352
102
  }
353
103
  }
354
104
  ],
355
- "description": "This will register this element with the browser."
105
+ "description": "This will register this element with the browser.",
106
+ "type": {
107
+ "text": "register(name?: string = \"auro-backtotop\") => void"
108
+ }
356
109
  },
357
110
  {
358
111
  "kind": "method",
@@ -369,10 +122,10 @@
369
122
  "name": "variant",
370
123
  "privacy": "public",
371
124
  "type": {
372
- "text": "string"
125
+ "text": "'primary' | 'secondary'"
373
126
  },
374
127
  "description": "The variant attribute allows for rendering the button using the primary (default) or secondary styles.",
375
- "default": "\"primary\"",
128
+ "default": "'primary'",
376
129
  "attribute": "variant",
377
130
  "reflects": true
378
131
  }
@@ -384,6 +137,7 @@
384
137
  "text": "boolean"
385
138
  },
386
139
  "description": "Render the trigger inline, will always be visible.",
140
+ "default": "false",
387
141
  "fieldName": "disabled"
388
142
  },
389
143
  {
@@ -410,10 +164,10 @@
410
164
  {
411
165
  "name": "variant",
412
166
  "type": {
413
- "text": "string"
167
+ "text": "'primary' | 'secondary'"
414
168
  },
415
169
  "description": "The variant attribute allows for rendering the button using the primary (default) or secondary styles.",
416
- "default": "\"primary\"",
170
+ "default": "'primary'",
417
171
  "fieldName": "variant"
418
172
  }
419
173
  ],
@@ -421,7 +175,9 @@
421
175
  "name": "LitElement",
422
176
  "package": "lit"
423
177
  },
424
- "customElement": true
178
+ "tagName": "auro-backtotop",
179
+ "customElement": true,
180
+ "modulePath": "src/auro-backtotop.js"
425
181
  }
426
182
  ],
427
183
  "exports": [