@aurodesignsystem-dev/auro-backtotop 0.0.0-pr77.0 → 0.0.0-pr79.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 +37 -97
- package/custom-elements.json +23 -267
- package/demo/api.md +29 -79
- package/demo/auro-backtotop.min.js +13 -12
- package/demo/index.md +16 -43
- package/dist/{auro-backtotop-BcarFpWB.js → auro-backtotop-CV2gu8Qz.js} +4 -4
- package/dist/index.d.ts +198 -104
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +8 -4
package/demo/api.md
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
|
|
4
4
|
# auro-backtotop
|
|
5
5
|
|
|
6
|
-
The auro-backtotop element provides users a way to quickly return to page top.
|
|
6
|
+
The `auro-backtotop` element provides users a way to quickly return to page top.
|
|
7
7
|
|
|
8
8
|
### Properties & Attributes
|
|
9
9
|
|
|
10
|
-
| Properties | Attributes | Type
|
|
11
|
-
| ---------- | ---------- |
|
|
12
|
-
| disabled | disabled | boolean |
|
|
13
|
-
| variant | variant |
|
|
10
|
+
| Properties | Attributes | Modifiers | Type | Default | Description |
|
|
11
|
+
| ---------- | ---------- | --------- | ------------------------ | --------- | ------------------------------------------------------------------------------------------------------ |
|
|
12
|
+
| disabled | disabled | | boolean | `false` | Render the trigger inline, will always be visible. |
|
|
13
|
+
| variant | variant | | `primary` \| `secondary` | `primary` | The variant attribute allows for rendering the button using the primary (default) or secondary styles. |
|
|
14
14
|
|
|
15
15
|
### Methods
|
|
16
16
|
|
|
17
|
-
| Name | Parameters
|
|
18
|
-
| -------- |
|
|
19
|
-
| register | `name` (string) - The name of element that you want to register
|
|
17
|
+
| Name | Parameters | Return | Description |
|
|
18
|
+
| -------- | -------------------------------------------------------------------- | ------ | ------------------------------------------------- |
|
|
19
|
+
| register | `name` (string) - The name of the element that you want to register. | | This will register this element with the browser. |
|
|
20
20
|
|
|
21
21
|
### Slots
|
|
22
22
|
|
|
@@ -33,17 +33,15 @@ The auro-backtotop element provides users a way to quickly return to page top.
|
|
|
33
33
|
| icon | Apply CSS to arrow up icon. |
|
|
34
34
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
35
35
|
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
### Basic
|
|
36
|
+
## Basic
|
|
39
37
|
|
|
40
38
|
<div class="exampleWrapper">
|
|
41
39
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
42
40
|
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
43
41
|
<auro-backtotop>Back to top</auro-backtotop>
|
|
44
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
45
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
46
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
42
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
43
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic_button-only.html) -->
|
|
44
|
+
<!-- The below content is automatically added from ./../apiExamples/basic_button-only.html -->
|
|
47
45
|
<auro-button
|
|
48
46
|
aria-label="arrow-up"
|
|
49
47
|
shape="pill"
|
|
@@ -52,7 +50,7 @@ The auro-backtotop element provides users a way to quickly return to page top.
|
|
|
52
50
|
<auro-icon customcolor category="interface" name="arrow-up" slot="icon" part="icon"></auro-icon>
|
|
53
51
|
</auro-button>
|
|
54
52
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
55
|
-
</div>
|
|
53
|
+
</div>
|
|
56
54
|
<auro-accordion alignRight>
|
|
57
55
|
<span slot="trigger">See code</span>
|
|
58
56
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
@@ -64,15 +62,15 @@ The auro-backtotop element provides users a way to quickly return to page top.
|
|
|
64
62
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
65
63
|
</auro-accordion>
|
|
66
64
|
|
|
67
|
-
|
|
65
|
+
## Property & Attribute Examples
|
|
68
66
|
|
|
69
|
-
|
|
67
|
+
### Disabled
|
|
70
68
|
|
|
71
69
|
This example demonstrates auro-backtotop in its disabled state.
|
|
72
70
|
|
|
73
71
|
<div class="exampleWrapper">
|
|
74
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
75
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
72
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled_button-only.html) -->
|
|
73
|
+
<!-- The below content is automatically added from ./../apiExamples/disabled_button-only.html -->
|
|
76
74
|
<auro-button
|
|
77
75
|
aria-label="arrow-up"
|
|
78
76
|
disabled
|
|
@@ -94,13 +92,13 @@ This example demonstrates auro-backtotop in its disabled state.
|
|
|
94
92
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
95
93
|
</auro-accordion>
|
|
96
94
|
|
|
97
|
-
|
|
95
|
+
### Variant
|
|
98
96
|
|
|
99
97
|
The `variant` attribute allows for rendering the button using the `primary` (default) or `secondary` styles.
|
|
100
98
|
|
|
101
99
|
<div class="exampleWrapper">
|
|
102
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
103
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
100
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/variant_button-only.html) -->
|
|
101
|
+
<!-- The below content is automatically added from ./../apiExamples/variant_button-only.html -->
|
|
104
102
|
<auro-button
|
|
105
103
|
variant="secondary"
|
|
106
104
|
shape="pill"
|
|
@@ -112,8 +110,8 @@ The `variant` attribute allows for rendering the button using the `primary` (def
|
|
|
112
110
|
</div>
|
|
113
111
|
<auro-accordion alignRight>
|
|
114
112
|
<span slot="trigger">See code</span>
|
|
115
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
116
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
113
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/variant.html) -->
|
|
114
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/variant.html -->
|
|
117
115
|
|
|
118
116
|
```html
|
|
119
117
|
<auro-backtotop variant="secondary">Back to top</auro-backtotop>
|
|
@@ -121,42 +119,15 @@ The `variant` attribute allows for rendering the button using the `primary` (def
|
|
|
121
119
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
122
120
|
</auro-accordion>
|
|
123
121
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
#### default
|
|
127
|
-
|
|
128
|
-
The default slot defines the content of the button.
|
|
129
|
-
|
|
130
|
-
<div class="exampleWrapper">
|
|
131
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basicButtonOnly.html) -->
|
|
132
|
-
<!-- The below content is automatically added from ./../apiExamples/basicButtonOnly.html -->
|
|
133
|
-
<auro-button
|
|
134
|
-
aria-label="arrow-up"
|
|
135
|
-
shape="pill"
|
|
136
|
-
size="lg">
|
|
137
|
-
Back to top
|
|
138
|
-
<auro-icon customcolor category="interface" name="arrow-up" slot="icon" part="icon"></auro-icon>
|
|
139
|
-
</auro-button>
|
|
140
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
141
|
-
</div>
|
|
142
|
-
<auro-accordion alignRight>
|
|
143
|
-
<span slot="trigger">See code</span>
|
|
144
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
145
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
146
|
-
|
|
147
|
-
```html
|
|
148
|
-
<auro-backtotop>Back to top</auro-backtotop>
|
|
149
|
-
```
|
|
150
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
151
|
-
</auro-accordion>
|
|
122
|
+
## Slot Examples
|
|
152
123
|
|
|
153
|
-
|
|
124
|
+
### Aria Label
|
|
154
125
|
|
|
155
126
|
The `ariaLabel` slot allows you to pass an aria-label to the HTML5 button. The default value is `"arrow-up"`.
|
|
156
127
|
|
|
157
128
|
<div class="exampleWrapper">
|
|
158
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
159
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
129
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/aria-label_button-only.html) -->
|
|
130
|
+
<!-- The below content is automatically added from ./../apiExamples/aria-label_button-only.html -->
|
|
160
131
|
<auro-button
|
|
161
132
|
aria-label="Custom aria-label goes here!"
|
|
162
133
|
shape="pill"
|
|
@@ -168,8 +139,8 @@ The `ariaLabel` slot allows you to pass an aria-label to the HTML5 button. The d
|
|
|
168
139
|
</div>
|
|
169
140
|
<auro-accordion alignRight>
|
|
170
141
|
<span slot="trigger">See code</span>
|
|
171
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
172
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
142
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/aria-label.html) -->
|
|
143
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/aria-label.html -->
|
|
173
144
|
|
|
174
145
|
```html
|
|
175
146
|
<auro-backtotop>
|
|
@@ -177,25 +148,4 @@ The `ariaLabel` slot allows you to pass an aria-label to the HTML5 button. The d
|
|
|
177
148
|
</auro-backtotop>
|
|
178
149
|
```
|
|
179
150
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
180
|
-
</auro-accordion>
|
|
181
|
-
|
|
182
|
-
## Page Content For Demo
|
|
183
|
-
|
|
184
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/pageContent.html) -->
|
|
185
|
-
<!-- The below content is automatically added from ./../apiExamples/pageContent.html -->
|
|
186
|
-
<p>
|
|
187
|
-
This component requires page content that is taller than the window. Below is `lorem ipsum` content to force a large document. A `back to top` button will appear when you begin to scroll down the page.
|
|
188
|
-
</p>
|
|
189
|
-
<i>
|
|
190
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
191
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
192
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
193
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
194
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
195
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
196
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
197
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
198
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
199
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
200
|
-
</i>
|
|
201
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
151
|
+
</auro-accordion>
|
|
@@ -267,7 +267,8 @@ var styleCss = i$3`:host{position:fixed;right:var(--ds-size-300, 1.5rem);bottom:
|
|
|
267
267
|
|
|
268
268
|
// See https://git.io/JJ6SJ for "How to document your components using JSDoc"
|
|
269
269
|
/**
|
|
270
|
-
* The auro-backtotop element provides users a way to quickly return to page top.
|
|
270
|
+
* The `auro-backtotop` element provides users a way to quickly return to page top.
|
|
271
|
+
* @customElement auro-backtotop
|
|
271
272
|
*
|
|
272
273
|
* @slot - Default slot for the text of the button.
|
|
273
274
|
* @slot ariaLabel - Use this slot to pass an aria-label to the HTML5 button.
|
|
@@ -279,11 +280,10 @@ class AuroBackToTop extends i$1 {
|
|
|
279
280
|
constructor() {
|
|
280
281
|
super();
|
|
281
282
|
|
|
282
|
-
this.
|
|
283
|
+
this._initializeDefaults();
|
|
283
284
|
}
|
|
284
285
|
|
|
285
|
-
|
|
286
|
-
|
|
286
|
+
_initializeDefaults() {
|
|
287
287
|
const versioning = new AuroDependencyVersioning();
|
|
288
288
|
|
|
289
289
|
this.disabled = false;
|
|
@@ -349,30 +349,31 @@ class AuroBackToTop extends i$1 {
|
|
|
349
349
|
|
|
350
350
|
/**
|
|
351
351
|
* Render the trigger inline, will always be visible.
|
|
352
|
+
* @default false
|
|
352
353
|
*/
|
|
353
354
|
disabled: {
|
|
354
355
|
type: Boolean,
|
|
355
356
|
reflect: true,
|
|
356
357
|
},
|
|
357
358
|
hidden: {
|
|
358
|
-
type: Boolean
|
|
359
|
-
reflect: true,
|
|
359
|
+
type: Boolean
|
|
360
360
|
},
|
|
361
361
|
interactionActive: {
|
|
362
|
-
type: Boolean
|
|
362
|
+
type: Boolean
|
|
363
363
|
},
|
|
364
364
|
lastScrollDirectionUp: {
|
|
365
|
-
type: Boolean
|
|
365
|
+
type: Boolean
|
|
366
366
|
},
|
|
367
367
|
|
|
368
368
|
/**
|
|
369
369
|
* The variant attribute allows for rendering the button using the primary (default) or secondary styles.
|
|
370
|
-
* @
|
|
370
|
+
* @type {'primary' | 'secondary'}
|
|
371
|
+
* @default 'primary'
|
|
371
372
|
*/
|
|
372
373
|
variant: {
|
|
373
374
|
type: String,
|
|
374
|
-
reflect: true
|
|
375
|
-
}
|
|
375
|
+
reflect: true
|
|
376
|
+
}
|
|
376
377
|
};
|
|
377
378
|
}
|
|
378
379
|
|
|
@@ -383,7 +384,7 @@ class AuroBackToTop extends i$1 {
|
|
|
383
384
|
|
|
384
385
|
/**
|
|
385
386
|
* This will register this element with the browser.
|
|
386
|
-
* @param {string} [name="auro-backtotop"] - The name of element that you want to register
|
|
387
|
+
* @param {string} [name="auro-backtotop"] - The name of the element that you want to register.
|
|
387
388
|
*
|
|
388
389
|
* @example
|
|
389
390
|
* AuroBackToTop.register("custom-backtotop") // this will register this element to <custom-backtotop/>
|
package/demo/index.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
THIS PAGE'S CONTENT SHOULD BE KEPT MINIMAL.
|
|
3
|
+
ONLY ADD EXAMPLES THAT ARE TRULY NECESSARY FOR THE INDEX PAGE — THE BASIC EXAMPLE IS USUALLY ENOUGH.
|
|
4
|
+
ALL OTHER EXAMPLES SHOULD GO IN THE API DOCUMENTATION.
|
|
5
5
|
-->
|
|
6
6
|
|
|
7
|
-
# Backtotop
|
|
8
|
-
|
|
7
|
+
# Backtotop
|
|
8
|
+
|
|
9
9
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/description.md) -->
|
|
10
10
|
<!-- The below content is automatically added from ./../docs/partials/description.md -->
|
|
11
11
|
`<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.
|
|
12
12
|
|
|
13
|
-
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.
|
|
13
|
+
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.
|
|
14
14
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
|
|
16
|
+
## Use Cases
|
|
17
|
+
|
|
18
18
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/useCases.md) -->
|
|
19
19
|
<!-- The below content is automatically added from ./../docs/partials/useCases.md -->
|
|
20
20
|
The `<auro-backtotop>` element should be used in situations where users may:
|
|
@@ -24,9 +24,11 @@ The `<auro-backtotop>` element should be used in situations where users may:
|
|
|
24
24
|
|
|
25
25
|
## Example(s)
|
|
26
26
|
|
|
27
|
+
### Basic
|
|
28
|
+
|
|
27
29
|
<div class="exampleWrapper">
|
|
28
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
29
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
30
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic_button-only.html) -->
|
|
31
|
+
<!-- The below content is automatically added from ./../apiExamples/basic_button-only.html -->
|
|
30
32
|
<auro-button
|
|
31
33
|
aria-label="arrow-up"
|
|
32
34
|
shape="pill"
|
|
@@ -35,10 +37,6 @@ The `<auro-backtotop>` element should be used in situations where users may:
|
|
|
35
37
|
<auro-icon customcolor category="interface" name="arrow-up" slot="icon" part="icon"></auro-icon>
|
|
36
38
|
</auro-button>
|
|
37
39
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
38
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
39
|
-
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
40
|
-
<auro-backtotop>Back to top</auro-backtotop>
|
|
41
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
42
40
|
</div>
|
|
43
41
|
<auro-accordion alignRight>
|
|
44
42
|
<span slot="trigger">See code</span>
|
|
@@ -51,10 +49,10 @@ The `<auro-backtotop>` element should be used in situations where users may:
|
|
|
51
49
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
52
50
|
</auro-accordion>
|
|
53
51
|
|
|
54
|
-
|
|
52
|
+
### Page Content For Demo
|
|
55
53
|
|
|
56
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
57
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
54
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/page-content.html) -->
|
|
55
|
+
<!-- The below content is automatically added from ./../apiExamples/page-content.html -->
|
|
58
56
|
<p>
|
|
59
57
|
This component requires page content that is taller than the window. Below is `lorem ipsum` content to force a large document. A `back to top` button will appear when you begin to scroll down the page.
|
|
60
58
|
</p>
|
|
@@ -70,29 +68,4 @@ The `<auro-backtotop>` element should be used in situations where users may:
|
|
|
70
68
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
71
69
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
|
72
70
|
</i>
|
|
73
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
74
|
-
|
|
75
|
-
## Recommended Use and Version Control
|
|
76
|
-
|
|
77
|
-
There are two important parts of every Auro component. The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element. The class is exported and then used as part of defining the Web Component. When importing this component as described in the <a href="#install">install</a> section, the class is imported and the `auro-backtotop` custom element is defined automatically.
|
|
78
|
-
|
|
79
|
-
To protect from versioning conflicts with other instances of the component being loaded, it is recommended to use our `AuroBackToTop.register(name)` method and pass in a unique name.
|
|
80
|
-
|
|
81
|
-
```js
|
|
82
|
-
import { AuroBackToTop } from '@aurodesignsystem/auro-backtotop/class';
|
|
83
|
-
|
|
84
|
-
AuroBackToTop.register('custom-backtotop');
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
This will create a new custom element that you can use in your HTML that will function identically to the `auro-backtotop` element.
|
|
88
|
-
|
|
89
|
-
<!-- <div class="exampleWrapper">
|
|
90
|
-
<auro-backtotop>Custom back to top</auro-backtotop>
|
|
91
|
-
</div>
|
|
92
|
-
<auro-accordion alignRight>
|
|
93
|
-
<span slot="trigger">See code</span>
|
|
94
|
-
```html
|
|
95
|
-
<auro-backtotop>Custom back to top</auro-backtotop>
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
</auro-accordion> -->
|
|
71
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
@@ -53,11 +53,11 @@ import{literal as t,html as e,unsafeStatic as o}from"lit/static-html.js";import{
|
|
|
53
53
|
</span>
|
|
54
54
|
</span>
|
|
55
55
|
</${this._renderTag}>
|
|
56
|
-
`}renderLayout(){return this.renderLayoutDefault()}}class N{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{})}closestElement(t,e=this,o=(e,s=e&&e.closest(t))=>e&&e!==document&&e!==window?s||o(e.getRootNode().host):null){return o(e)}handleComponentTagRename(t,e){const o=e.toLowerCase();t.tagName.toLowerCase()!==o&&t.setAttribute(o,!0)}elementMatch(t,e){const o=e.toLowerCase();return t.tagName.toLowerCase()===o||t.hasAttribute(o)}}class $ extends a{static get properties(){return{hidden:{type:Boolean,reflect:!0},hiddenVisually:{type:Boolean,reflect:!0},hiddenAudible:{type:Boolean,reflect:!0}}}hideAudible(t){return t?"true":"false"}}const
|
|
57
|
-
`;class I extends ${constructor(){super(),this.onDark=!1,this.appearance="default"}static get properties(){return{...$.properties,onDark:{type:Boolean,reflect:!0},appearance:{type:String,reflect:!0},svg:{attribute:!1,reflect:!0}}}static get styles(){return
|
|
56
|
+
`}renderLayout(){return this.renderLayoutDefault()}}class N{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{})}closestElement(t,e=this,o=(e,s=e&&e.closest(t))=>e&&e!==document&&e!==window?s||o(e.getRootNode().host):null){return o(e)}handleComponentTagRename(t,e){const o=e.toLowerCase();t.tagName.toLowerCase()!==o&&t.setAttribute(o,!0)}elementMatch(t,e){const o=e.toLowerCase();return t.tagName.toLowerCase()===o||t.hasAttribute(o)}}class $ extends a{static get properties(){return{hidden:{type:Boolean,reflect:!0},hiddenVisually:{type:Boolean,reflect:!0},hiddenAudible:{type:Boolean,reflect:!0}}}hideAudible(t){return t?"true":"false"}}const _=new Map,L=(t,e={})=>{const o=e.responseParser||(t=>t.text());return _.has(t)||_.set(t,fetch(t).then(o)),_.get(t)};var E=s`:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.ico_squareLarge{fill:currentColor;height:var(--auro-size-lg, var(--ds-size-300, 1.5rem))}.ico_squareSmall{fill:currentColor;height:.6rem}.ico_squareMed{fill:currentColor;height:var(--auro-size-md, var(--ds-size-200, 1rem))}.ico_squareSml{fill:currentColor;height:var(--auro-size-sm, var(--ds-size-150, .75rem))}:host{color:currentColor;vertical-align:middle;display:inline-block}svg{min-width:var(--ds-auro-icon-size, 1.5rem)!important;width:var(--ds-auro-icon-size, 1.5rem)!important;height:var(--ds-auro-icon-size, 1.5rem)!important}.componentWrapper{display:flex;line-height:var(--ds-auro-icon-size)}.svgWrapper{height:var(--ds-auro-icon-size);width:var(--ds-auro-icon-size)}.svgWrapper [part=svg]{display:flex}.labelWrapper{margin-left:var(--ds-size-50, .25rem)}.labelWrapper ::slotted(*){line-height:inherit!important}
|
|
57
|
+
`;class I extends ${constructor(){super(),this.onDark=!1,this.appearance="default"}static get properties(){return{...$.properties,onDark:{type:Boolean,reflect:!0},appearance:{type:String,reflect:!0},svg:{attribute:!1,reflect:!0}}}static get styles(){return E}async fetchIcon(t,e){let o="";return o="logos"===t?await L(`${this.uri}/${t}/${e}.svg`):await L(`${this.uri}/icons/${t}/${e}.svg`),(new DOMParser).parseFromString(o,"text/html").body.querySelector("svg")}async firstUpdated(){try{if(!this.customSvg){const t=await this.fetchIcon(this.category,this.name);if(t)this.svg=t;else if(!t){const t=(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-labelledby="error__desc" class="ico_squareLarge" data-deprecated="true" role="img" style="min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor" viewBox="0 0 24 24" part="svg"><title/><desc id="error__desc">Error alert indicator.</desc><path d="m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583"/></svg>',"text/html");this.svg=t.body.firstChild}}}catch(t){this.svg=void 0}}}s`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock,:host{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host([hidden]:not(:focus):not(:active)){display:none}.util_displayHiddenVisually,:host([hiddenVisually]:not(:focus):not(:active)){position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}:host{display:inline-block;--ds-auro-icon-size: 100%;width:100%;height:100%}:host .logo{color:var(--ds-auro-alaska-color)}:host([onDark]),:host([appearance=inverse]){--ds-auro-alaska-color: #FFF}
|
|
58
58
|
`;var F=s`:host{--ds-auro-icon-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-alaska-color: #02426D;--ds-auro-icon-size: var(--ds-size-300, 1.5rem)}
|
|
59
59
|
`,D=s`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]),:host(:not([appearance=inverse])[variant=accent1]){--ds-auro-icon-color: var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]),:host(:not([appearance=inverse])[variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]),:host(:not([appearance=inverse])[variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]),:host(:not([appearance=inverse])[variant=statusDefault]){--ds-auro-icon-color: var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]),:host(:not([appearance=inverse])[variant=statusInfo]){--ds-auro-icon-color: var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]),:host(:not([appearance=inverse])[variant=statusSuccess]){--ds-auro-icon-color: var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]),:host(:not([appearance=inverse])[variant=statusWarning]){--ds-auro-icon-color: var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]),:host(:not([appearance=inverse])[variant=statusError]){--ds-auro-icon-color: var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]),:host(:not([appearance=inverse])[variant=statusInfoSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]),:host(:not([appearance=inverse])[variant=statusSuccessSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]),:host(:not([appearance=inverse])[variant=statusWarningSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]),:host(:not([appearance=inverse])[variant=statusErrorSubtle]){--ds-auro-icon-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]),:host(:not([appearance=inverse])[variant=fareBasicEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]),:host(:not([appearance=inverse])[variant=fareBusiness]){--ds-auro-icon-color: var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]),:host(:not([appearance=inverse])[variant=fareEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]),:host(:not([appearance=inverse])[variant=fareFirst]){--ds-auro-icon-color: var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]),:host(:not([appearance=inverse])[variant=farePremiumEconomy]){--ds-auro-icon-color: var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]),:host(:not([appearance=inverse])[variant=tierOneWorldEmerald]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]),:host(:not([appearance=inverse])[variant=tierOneWorldSapphire]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]),:host(:not([appearance=inverse])[variant=tierOneWorldRuby]){--ds-auro-icon-color: var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]),:host([appearance=inverse]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]),:host([appearance=inverse][variant=disabled]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]),:host([appearance=inverse][variant=muted]){--ds-auro-icon-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]),:host([appearance=inverse][variant=statusError]){--ds-auro-icon-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}
|
|
60
|
-
`;class O extends I{constructor(){super(),this.variant=void 0,this.privateDefaults()}privateDefaults(){this.uri="https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist",this.runtimeUtils=new N}static get properties(){return{...I.properties,ariaHidden:{type:String,reflect:!0},category:{type:String,reflect:!0},customColor:{type:Boolean,reflect:!0},customSvg:{type:Boolean},label:{type:Boolean,reflect:!0},name:{type:String,reflect:!0},variant:{type:String,reflect:!0}}}static get styles(){return[I.styles,F,
|
|
60
|
+
`;class O extends I{constructor(){super(),this.variant=void 0,this.privateDefaults()}privateDefaults(){this.uri="https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist",this.runtimeUtils=new N}static get properties(){return{...I.properties,ariaHidden:{type:String,reflect:!0},category:{type:String,reflect:!0},customColor:{type:Boolean,reflect:!0},customSvg:{type:Boolean},label:{type:Boolean,reflect:!0},name:{type:String,reflect:!0},variant:{type:String,reflect:!0}}}static get styles(){return[I.styles,F,E,D]}static register(t="auro-icon"){N.prototype.registerComponent(t,O)}connectedCallback(){super.connectedCallback(),this.runtimeUtils.handleComponentTagRename(this,"auro-icon")}exposeCssParts(){this.setAttribute("exportparts","svg:iconSvg")}async firstUpdated(){if(await super.firstUpdated(),this.hasAttribute("ariaHidden")&&this.svg){const t=this.svg.querySelector("desc");t&&(t.remove(),this.svg.removeAttribute("aria-labelledby"))}}render(){const t={labelWrapper:!0,util_displayHiddenVisually:!this.label};return r`
|
|
61
61
|
<div class="componentWrapper">
|
|
62
62
|
<div
|
|
63
63
|
class="${i({svgWrapper:!0})}"
|
|
@@ -76,7 +76,7 @@ import{literal as t,html as e,unsafeStatic as o}from"lit/static-html.js";import{
|
|
|
76
76
|
</div>
|
|
77
77
|
</div>
|
|
78
78
|
`}}class W{generateElementName(t,e){let o=t;return o+="-",o+=e.replace(/[.]/g,"_"),o}generateTag(e,s,a){const r=this.generateElementName(e,s),i=t`${o(r)}`;return customElements.get(r)||customElements.define(r,class extends a{}),i}}class P{registerComponent(t,e){customElements.get(t)||customElements.define(t,class extends e{})}closestElement(t,e=this,o=(e,s=e&&e.closest(t))=>e&&e!==document&&e!==window?s||o(e.getRootNode().host):null){return o(e)}handleComponentTagRename(t,e){const o=e.toLowerCase();t.tagName.toLowerCase()!==o&&t.setAttribute(o,!0)}elementMatch(t,e){const o=e.toLowerCase();return t.tagName.toLowerCase()===o||t.hasAttribute(o)}getSlotText(t,e){const o=t.shadowRoot?.querySelector(`slot[name="${e}"]`);return(o?.assignedNodes({flatten:!0})||[]).map(t=>t.textContent?.trim()).join(" ").trim()||null}}var X=s`:host{position:fixed;right:var(--ds-size-300, 1.5rem);bottom:var(--ds-size-300, 1.5rem)}:host [auro-button]:not(:hover) .text{display:none;overflow:hidden}
|
|
79
|
-
`;class j extends a{constructor(){super(),this.
|
|
79
|
+
`;class j extends a{constructor(){super(),this._initializeDefaults()}_initializeDefaults(){const t=new W;this.disabled=!1,this.variant="primary",this.iconTag=t.generateTag("auro-icon","9.1.1",O),this.buttonTag=t.generateTag("auro-backtotop-button","12.3.0",R),this.shape="circle",this.size="lg",this.hidden=!0,this.lastKnownScrollPosition=0,this.lastScrollDirectionUp=!1,this.interactionActive=!1,this.yPosShowButton=400,this.runtimeUtils=new P}static get properties(){return{disabled:{type:Boolean,reflect:!0},hidden:{type:Boolean},interactionActive:{type:Boolean},lastScrollDirectionUp:{type:Boolean},variant:{type:String,reflect:!0}}}static get styles(){return[X]}static register(t="auro-backtotop"){P.prototype.registerComponent(t,j)}scrollTop(){document.documentElement.scrollTop=0}onTriggerClick(){this.scrollTop(),this.interactionActive=!1}firstUpdated(){this.runtimeUtils.handleComponentTagRename(this,"auro-backtotop"),document.addEventListener("scroll",()=>{window.scrollY<this.lastKnownScrollPosition?this.lastScrollDirectionUp=!0:this.lastScrollDirectionUp=!1,this.lastKnownScrollPosition=window.scrollY,this.lastKnownScrollPosition<this.yPosShowButton?this.hidden=!0:this.hidden=!1}),this.addEventListener("mouseover",()=>{this.shape="pill",this.interactionActive=!0}),this.addEventListener("mouseout",()=>{this.shape="circle",this.interactionActive=!1}),this.addEventListener("focusin",()=>{this.interactionActive=!0}),this.addEventListener("focusout",()=>{this.interactionActive=!1}),this.addEventListener("touchend",()=>{this.onTriggerClick()})}render(){return e`
|
|
80
80
|
<!-- Hidden slot for aria-label -->
|
|
81
81
|
<slot name="ariaLabel" hidden></slot>
|
|
82
82
|
|