You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: modernize component example documentation #78
example code updated to reflect latest Auro element APIs
example documentation layout improved
custom registration updated and moved to install page
core element descriptions updated
doc build system now uses the latest version of auro-cli
package json configuration updated to support latest auro-cli
<!-- The below content is automatically added from ./docs/partials/description.md -->
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.
23
+
<!-- AURO-GENERATED-CONTENT:END -->
25
24
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.
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
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. -->
[](https://www.npmjs.com/package/@aurodesignsystem/auro-backtotop)
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.
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
98
-
The `<auro-backtotop>` element should be used in situations where users may:
56
+
## Custom Component Registration for Version Management
99
57
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
58
+
There are two key parts to every Auro component: the <ahref="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
59
+
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
109
-
110
-
```html
111
-
<auro-backtotop>Back to top</auro-backtotop>
112
-
```
113
-
<!-- AURO-GENERATED-CONTENT:END -->
114
-
115
-
## Development
61
+
When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
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.
63
+
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.
119
64
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.
65
+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
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**.
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.
| disabled | disabled || boolean|`false`| Render the trigger inline, will always be visible. |
10
+
| variant | variant ||`primary`\|`secondary`|`primary`| The variant attribute allows for rendering the button using the primary (default) or secondary styles. |
0 commit comments