@nycds/button 0.4.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/CHANGELOG.md +184 -0
- package/LICENSE +674 -0
- package/README.org +64 -0
- package/css.org +344 -0
- package/dist/button-aem.css +1074 -0
- package/dist/button-aem.min.css +1 -0
- package/dist/button.css +682 -0
- package/dist/button.min.css +1 -0
- package/package.json +16 -0
- package/postcss.config.js +1 -0
- package/src/css/aem/index.css +86 -0
- package/src/css/index.css +40 -0
- package/src/css/mixins.css +380 -0
- package/src/js/BackToTop.js +90 -0
- package/src/js/NYCBackToTop.js +90 -0
- package/src/js/aem/index.js +1 -0
- package/src/js/index.js +1 -0
- package/tests/back-to-top.spec.js +16 -0
- package/tests/index.html +20 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
test.describe('Back To Top', () => {
|
|
4
|
+
test.describe('NYCBackToTop component', () => {
|
|
5
|
+
let component;
|
|
6
|
+
test.beforeEach(async ({ page }) => {
|
|
7
|
+
await page.goto('/packages/components/button/tests/index.html')
|
|
8
|
+
component = page.locator('nyc-back-to-top')
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
test('Back to top enabled at scroll point', async ({page, browserName }) => {
|
|
12
|
+
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight / 2))
|
|
13
|
+
await expect(component).toContainClass('enabled')
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
})
|
package/tests/index.html
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<link href="../../../core/dist/nycds-core.css" rel="stylesheet" />
|
|
4
|
+
</head>
|
|
5
|
+
<body>
|
|
6
|
+
|
|
7
|
+
<div style="height: 500vh" class="backtotop-observe">
|
|
8
|
+
</div>
|
|
9
|
+
<nyc-back-to-top>
|
|
10
|
+
<button id="back-to-top" class="nyc-button" data-variant="back-to-top" aria-label="Back to top">
|
|
11
|
+
<span>Back to top</span>
|
|
12
|
+
</button>
|
|
13
|
+
</nyc-back-to-top>
|
|
14
|
+
|
|
15
|
+
<script type="module">
|
|
16
|
+
import { NYCBackToTop } from '../src/js/index.js'
|
|
17
|
+
NYCBackToTop.define()
|
|
18
|
+
</script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|