@esportsplus/ui 0.8.1 → 0.8.3
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/.editorconfig +9 -9
- package/.gitattributes +2 -2
- package/build/components/clipboard/index.d.ts +1 -0
- package/build/components/clipboard/index.js +1 -0
- package/build/components/counter/index.js +16 -16
- package/build/components/ellipsis/index.js +6 -6
- package/build/components/footer/index.js +46 -46
- package/build/components/form/layout.js +10 -10
- package/build/components/index.d.ts +19 -0
- package/build/components/index.js +19 -0
- package/build/components/link/hover.js +8 -8
- package/build/components/loader/index.js +15 -15
- package/build/components/loading/index.js +2 -2
- package/build/components/magnet/index.js +7 -7
- package/build/components/scrollbar/index.js +9 -9
- package/build/components/site/index.js +5 -5
- package/components/styles.css +1 -2
- package/components/variables.css +0 -2
- package/lib.scss +1 -1
- package/package.json +5 -1
- package/src/components/accordion/index.ts +34 -34
- package/src/components/accordion/scss/index.scss +16 -16
- package/src/components/accordion/scss/variables.scss +9 -9
- package/src/components/anchor/scss/index.scss +41 -41
- package/src/components/anchor/scss/variables.scss +4 -4
- package/src/components/banner/scss/index.scss +40 -40
- package/src/components/banner/scss/variables.scss +9 -9
- package/src/components/button/scss/index.scss +114 -114
- package/src/components/button/scss/variables.scss +66 -66
- package/src/components/card/scss/index.scss +35 -35
- package/src/components/card/scss/variables.scss +41 -41
- package/src/components/clipboard/index.ts +4 -3
- package/src/components/clipboard/scss/index.scss +3 -0
- package/src/components/clipboard/write.ts +8 -8
- package/src/components/container/scss/index.scss +8 -8
- package/src/components/container/scss/variables.scss +5 -5
- package/src/components/counter/index.ts +93 -93
- package/src/components/counter/scss/index.scss +61 -61
- package/src/components/counter/scss/variables.scss +26 -26
- package/src/components/ellipsis/index.ts +9 -9
- package/src/components/ellipsis/scss/index.scss +27 -27
- package/src/components/ellipsis/scss/variables.scss +4 -4
- package/src/components/footer/index.ts +78 -78
- package/src/components/footer/scss/index.scss +25 -25
- package/src/components/form/action.ts +80 -80
- package/src/components/form/index.ts +5 -5
- package/src/components/form/input.ts +14 -14
- package/src/components/form/layout.ts +25 -25
- package/src/components/form/types.ts +15 -15
- package/src/components/frame/scss/index.scss +11 -11
- package/src/components/grid/scss/index.scss +9 -9
- package/src/components/grid/scss/variables.scss +5 -5
- package/src/components/group/scss/index.scss +36 -36
- package/src/components/group/scss/variables.scss +17 -17
- package/src/components/highlight/index.ts +47 -47
- package/src/components/highlight/scss/index.scss +4 -4
- package/src/components/highlight/scss/variables.scss +3 -3
- package/src/components/icon/scss/index.scss +16 -16
- package/src/components/icon/scss/variables.scss +7 -7
- package/src/components/index.ts +19 -0
- package/src/components/json/download.ts +14 -14
- package/src/components/json/index.ts +3 -3
- package/src/components/link/hover.ts +18 -18
- package/src/components/link/index.ts +3 -3
- package/src/components/link/scss/index.scss +65 -65
- package/src/components/link/scss/variables.scss +46 -46
- package/src/components/loader/index.ts +34 -34
- package/src/components/loader/scss/index.scss +68 -68
- package/src/components/loader/scss/variables.scss +5 -5
- package/src/components/loading/index.ts +7 -7
- package/src/components/loading/scss/index.scss +16 -16
- package/src/components/loading/scss/variables.scss +5 -5
- package/src/components/magnet/index.ts +54 -54
- package/src/components/magnet/scss/index.scss +16 -16
- package/src/components/magnet/scss/variables.scss +4 -4
- package/src/components/modal/scss/index.scss +34 -34
- package/src/components/modal/scss/variables.scss +6 -6
- package/src/components/number/index.ts +23 -23
- package/src/components/page/index.ts +14 -14
- package/src/components/page/scss/index.scss +31 -31
- package/src/components/page/scss/variables.scss +15 -15
- package/src/components/root/index.ts +4 -4
- package/src/components/root/onclick.ts +20 -20
- package/src/components/root/scss/index.scss +94 -94
- package/src/components/root/scss/variables.scss +100 -100
- package/src/components/row/scss/index.scss +7 -7
- package/src/components/scrollbar/index.ts +43 -43
- package/src/components/scrollbar/scss/index.scss +70 -70
- package/src/components/scrollbar/scss/variables.scss +6 -6
- package/src/components/sidebar/scss/index.scss +49 -49
- package/src/components/sidebar/scss/variables.scss +20 -20
- package/src/components/site/index.ts +26 -26
- package/src/components/site/scss/index.scss +3 -3
- package/src/components/text/scss/index.scss +9 -9
- package/src/components/text/scss/variables.scss +8 -8
- package/src/components/thumbnail/scss/index.scss +7 -7
- package/src/components/thumbnail/scss/variables.scss +7 -7
- package/src/components/tooltip/index.ts +84 -84
- package/src/components/tooltip/scss/_center.scss +13 -13
- package/src/components/tooltip/scss/_east.scss +34 -34
- package/src/components/tooltip/scss/_north.scss +34 -34
- package/src/components/tooltip/scss/_south.scss +35 -35
- package/src/components/tooltip/scss/_west.scss +34 -34
- package/src/components/tooltip/scss/index.scss +93 -93
- package/src/components/tooltip/scss/variables.scss +24 -24
- package/src/components/truncate/index.ts +13 -13
- package/src/components/typewriter/index.ts +53 -53
- package/src/components/typewriter/scss/index.scss +14 -14
- package/src/css-utilities/[margin,padding]/scss/index.scss +41 -41
- package/src/css-utilities/[margin,padding]/scss/variables.scss +54 -54
- package/src/css-utilities/absolute/scss/index.scss +36 -36
- package/src/css-utilities/background/scss/variables.scss +27 -27
- package/src/css-utilities/border/scss/index.scss +21 -21
- package/src/css-utilities/border/scss/variables.scss +66 -66
- package/src/css-utilities/color/scss/variables.scss +31 -31
- package/src/css-utilities/disabled/scss/index.scss +4 -4
- package/src/css-utilities/flex/scss/index.scss +65 -65
- package/src/css-utilities/glass/scss/index.scss +2 -2
- package/src/css-utilities/glass/scss/variables.scss +2 -2
- package/src/css-utilities/hidden/scss/index.scss +28 -28
- package/src/css-utilities/index.scss +14 -14
- package/src/css-utilities/inline/scss/index.scss +7 -7
- package/src/css-utilities/line-height/scss/variables.scss +10 -10
- package/src/css-utilities/not-allowed/scss/index.scss +7 -7
- package/src/css-utilities/overflow/scss/index.scss +4 -4
- package/src/css-utilities/pointer/scss/index.scss +5 -5
- package/src/css-utilities/size/scss/variables.scss +12 -12
- package/src/css-utilities/squircle/scss/index.scss +4 -4
- package/src/css-utilities/text/scss/index.scss +89 -89
- package/src/css-utilities/text/scss/variables.scss +31 -31
- package/src/css-utilities/viewport/scss/index.scss +4 -4
- package/src/css-utilities/width/scss/index.scss +3 -3
- package/src/css-utilities/width/scss/variables.scss +9 -9
- package/src/index.ts +18 -18
- package/src/lib/index.scss +7 -7
- package/src/lib/scss/breakpoint.scss +41 -41
- package/src/lib/scss/color.scss +1 -1
- package/src/lib/scss/css-variables.scss +16 -16
- package/src/lib/scss/list.scss +77 -77
- package/src/lib/scss/map.scss +1 -1
- package/src/lib/scss/position.scss +55 -55
- package/src/lib/scss/string.scss +34 -34
- package/src/tokens/index.scss +11 -11
- package/src/tokens/scss/border-radius.scss +12 -12
- package/src/tokens/scss/border-width.scss +6 -6
- package/src/tokens/scss/box-shadow.scss +39 -39
- package/src/tokens/scss/color.scss +64 -64
- package/src/tokens/scss/font-size.scss +16 -16
- package/src/tokens/scss/font-weight.scss +6 -6
- package/src/tokens/scss/line-height.scss +6 -6
- package/src/tokens/scss/size.scss +13 -13
- package/src/tokens/scss/spacer.scss +10 -10
- package/src/tokens/scss/state.scss +87 -87
- package/src/tokens/scss/transition-duration.scss +1 -1
- package/storage/fonts/montserrat/index.css +79 -79
- package/tokens.scss +1 -1
- package/tsconfig.json +2 -2
- package/utilities/styles.css +1 -1
- package/utilities/variables.css +1 -1
- package/webpack.config.ts +25 -25
- package/.github/dependabot.yml +0 -23
- package/.github/workflows/bump.yml +0 -7
- package/.github/workflows/publish.yml +0 -14
- package/src/components/border/scss/index.scss +0 -10
- package/src/components/border/scss/variables.scss +0 -6
- package/src/components/bubble/scss/index.scss +0 -30
- package/src/components/bubble/scss/variables.scss +0 -19
package/.editorconfig
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
root = true
|
|
2
|
-
|
|
3
|
-
[*]
|
|
4
|
-
indent_style = space
|
|
5
|
-
indent_size = 4
|
|
6
|
-
charset = utf-8
|
|
7
|
-
trim_trailing_whitespace = true
|
|
8
|
-
insert_final_newline = true
|
|
9
|
-
end_of_line = lf
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
indent_style = space
|
|
5
|
+
indent_size = 4
|
|
6
|
+
charset = utf-8
|
|
7
|
+
trim_trailing_whitespace = true
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
end_of_line = lf
|
package/.gitattributes
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
# Auto detect text files and perform LF normalization
|
|
2
|
-
* text=auto
|
|
1
|
+
# Auto detect text files and perform LF normalization
|
|
2
|
+
* text=auto
|
|
@@ -39,8 +39,8 @@ export default ({ currency, delay, max, suffix, value }) => {
|
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
return {
|
|
42
|
-
html: html `
|
|
43
|
-
<div class='counter'>
|
|
42
|
+
html: html `
|
|
43
|
+
<div class='counter'>
|
|
44
44
|
${() => {
|
|
45
45
|
let n = state.length;
|
|
46
46
|
if (n === 0) {
|
|
@@ -48,24 +48,24 @@ export default ({ currency, delay, max, suffix, value }) => {
|
|
|
48
48
|
}
|
|
49
49
|
return html.reactive(state.render, function (value, i) {
|
|
50
50
|
if (isNaN(parseInt(value, 10))) {
|
|
51
|
-
return html `
|
|
52
|
-
<span class='counter-character counter-character--symbol'>
|
|
53
|
-
${value}
|
|
54
|
-
</span>
|
|
51
|
+
return html `
|
|
52
|
+
<span class='counter-character counter-character--symbol'>
|
|
53
|
+
${value}
|
|
54
|
+
</span>
|
|
55
55
|
`;
|
|
56
56
|
}
|
|
57
|
-
return html `
|
|
58
|
-
<div class='counter-character ${i > n - 3 ? 'counter-character--fraction' : ''}'>
|
|
59
|
-
<div class='counter-character-track' style='${() => `--value: ${this[i]}`}'>
|
|
60
|
-
<span>9</span>
|
|
61
|
-
${[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((value) => html `<span>${value}</span>`)}
|
|
62
|
-
<span>0</span>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
57
|
+
return html `
|
|
58
|
+
<div class='counter-character ${i > n - 3 ? 'counter-character--fraction' : ''}'>
|
|
59
|
+
<div class='counter-character-track' style='${() => `--value: ${this[i]}`}'>
|
|
60
|
+
<span>9</span>
|
|
61
|
+
${[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((value) => html `<span>${value}</span>`)}
|
|
62
|
+
<span>0</span>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
65
|
`;
|
|
66
66
|
});
|
|
67
|
-
}}
|
|
68
|
-
</div>
|
|
67
|
+
}}
|
|
68
|
+
</div>
|
|
69
69
|
`,
|
|
70
70
|
state: api
|
|
71
71
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { html } from '@esportsplus/template';
|
|
2
|
-
export default (attributes) => html `
|
|
3
|
-
<div class="ellipsis" ${attributes}>
|
|
4
|
-
<span></span>
|
|
5
|
-
<span></span>
|
|
6
|
-
<span></span>
|
|
7
|
-
</div>
|
|
2
|
+
export default (attributes) => html `
|
|
3
|
+
<div class="ellipsis" ${attributes}>
|
|
4
|
+
<span></span>
|
|
5
|
+
<span></span>
|
|
6
|
+
<span></span>
|
|
7
|
+
</div>
|
|
8
8
|
`;
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
import { html, svg } from '@esportsplus/template';
|
|
2
2
|
function copy({ attributes, brand }) {
|
|
3
|
-
return html `
|
|
4
|
-
<div class='footer-copyright group-item --flex-center'>
|
|
5
|
-
<div class='text --padding-vertical --padding-300 --text-300' style='--color-default: var(--color-grey-500);' ${attributes}>
|
|
6
|
-
© ${`${new Date().getFullYear()} ${brand}, All rights reserved`}
|
|
7
|
-
</div>
|
|
8
|
-
</div>
|
|
3
|
+
return html `
|
|
4
|
+
<div class='footer-copyright group-item --flex-center'>
|
|
5
|
+
<div class='text --padding-vertical --padding-300 --text-300' style='--color-default: var(--color-grey-500);' ${attributes}>
|
|
6
|
+
© ${`${new Date().getFullYear()} ${brand}, All rights reserved`}
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
9
|
`;
|
|
10
10
|
}
|
|
11
11
|
export default ({ copyright, footer, nav, social }) => {
|
|
12
|
-
return html `
|
|
13
|
-
<footer class='footer' ${footer?.attributes}>
|
|
14
|
-
<div class='container'>
|
|
15
|
-
<div class='group group--offset-top --flex-center --margin-400'>
|
|
16
|
-
|
|
12
|
+
return html `
|
|
13
|
+
<footer class='footer' ${footer?.attributes}>
|
|
14
|
+
<div class='container'>
|
|
15
|
+
<div class='group group--offset-top --flex-center --margin-400'>
|
|
16
|
+
|
|
17
17
|
${nav
|
|
18
|
-
? nav.links.map(({ text, url }) => html `
|
|
19
|
-
<div class='group-item'>
|
|
20
|
-
<a
|
|
21
|
-
class='link --color-white --padding-vertical-300 --text-300'
|
|
22
|
-
href='${url}'
|
|
23
|
-
style='--color-default: var(--color-grey-500);'
|
|
24
|
-
${nav.attributes}
|
|
25
|
-
>
|
|
26
|
-
${text}
|
|
27
|
-
</a>
|
|
28
|
-
</div>
|
|
18
|
+
? nav.links.map(({ text, url }) => html `
|
|
19
|
+
<div class='group-item'>
|
|
20
|
+
<a
|
|
21
|
+
class='link --color-white --padding-vertical-300 --text-300'
|
|
22
|
+
href='${url}'
|
|
23
|
+
style='--color-default: var(--color-grey-500);'
|
|
24
|
+
${nav.attributes}
|
|
25
|
+
>
|
|
26
|
+
${text}
|
|
27
|
+
</a>
|
|
28
|
+
</div>
|
|
29
29
|
`)
|
|
30
|
-
: copy(copyright)}
|
|
31
|
-
|
|
32
|
-
<div class='footer-break'></div>
|
|
33
|
-
|
|
34
|
-
${social?.links && social.links.map(({ icon, url }) => html `
|
|
35
|
-
<div class='group-item'>
|
|
36
|
-
<a
|
|
37
|
-
class='link --color-white --padding-0px'
|
|
38
|
-
href='${url}'
|
|
39
|
-
style='--color-default: var(--color-grey-500);'
|
|
40
|
-
${social.attributes}
|
|
41
|
-
>
|
|
42
|
-
<div class='icon --size-500'>
|
|
43
|
-
${svg.sprite(icon)}
|
|
44
|
-
</div>
|
|
45
|
-
</a>
|
|
46
|
-
</div>
|
|
47
|
-
`)}
|
|
48
|
-
|
|
49
|
-
${nav && copy(copyright)}
|
|
50
|
-
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
</footer>
|
|
30
|
+
: copy(copyright)}
|
|
31
|
+
|
|
32
|
+
<div class='footer-break'></div>
|
|
33
|
+
|
|
34
|
+
${social?.links && social.links.map(({ icon, url }) => html `
|
|
35
|
+
<div class='group-item'>
|
|
36
|
+
<a
|
|
37
|
+
class='link --color-white --padding-0px'
|
|
38
|
+
href='${url}'
|
|
39
|
+
style='--color-default: var(--color-grey-500);'
|
|
40
|
+
${social.attributes}
|
|
41
|
+
>
|
|
42
|
+
<div class='icon --size-500'>
|
|
43
|
+
${svg.sprite(icon)}
|
|
44
|
+
</div>
|
|
45
|
+
</a>
|
|
46
|
+
</div>
|
|
47
|
+
`)}
|
|
48
|
+
|
|
49
|
+
${nav && copy(copyright)}
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</footer>
|
|
54
54
|
`;
|
|
55
55
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { html } from '@esportsplus/template';
|
|
2
|
-
export default (data) => html `
|
|
3
|
-
<form class='${data?.class}' ${data?.action || ''}>
|
|
4
|
-
${data?.content || ''}
|
|
5
|
-
|
|
6
|
-
${data?.button?.content ? html `
|
|
7
|
-
<button class="button ${data?.button?.class || ''}" style='${data?.button?.style || ''}'>
|
|
8
|
-
${data?.button?.content || ''}
|
|
9
|
-
</button>
|
|
10
|
-
` : ''}
|
|
11
|
-
</form>
|
|
2
|
+
export default (data) => html `
|
|
3
|
+
<form class='${data?.class}' ${data?.action || ''}>
|
|
4
|
+
${data?.content || ''}
|
|
5
|
+
|
|
6
|
+
${data?.button?.content ? html `
|
|
7
|
+
<button class="button ${data?.button?.class || ''}" style='${data?.button?.style || ''}'>
|
|
8
|
+
${data?.button?.content || ''}
|
|
9
|
+
</button>
|
|
10
|
+
` : ''}
|
|
11
|
+
</form>
|
|
12
12
|
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as accordion } from './accordion/index.js';
|
|
2
|
+
export { default as clipboard } from './clipboard/index.js';
|
|
3
|
+
export { default as counter } from './counter/index.js';
|
|
4
|
+
export { default as ellipsis } from './ellipsis/index.js';
|
|
5
|
+
export { default as footer } from './footer/index.js';
|
|
6
|
+
export { default as form } from './form/index.js';
|
|
7
|
+
export { default as json } from './json/index.js';
|
|
8
|
+
export { default as link } from './link/index.js';
|
|
9
|
+
export { default as loader } from './loader/index.js';
|
|
10
|
+
export { default as loading } from './loading/index.js';
|
|
11
|
+
export { default as magnet } from './magnet/index.js';
|
|
12
|
+
export { default as number } from './number/index.js';
|
|
13
|
+
export { default as page } from './page/index.js';
|
|
14
|
+
export { default as root } from './root/index.js';
|
|
15
|
+
export { default as scrollbar } from './scrollbar/index.js';
|
|
16
|
+
export { default as site } from './site/index.js';
|
|
17
|
+
export { default as tooltip } from './tooltip/index.js';
|
|
18
|
+
export { default as truncate } from './truncate/index.js';
|
|
19
|
+
export { default as typewriter } from './typewriter/index.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as accordion } from './accordion/index.js';
|
|
2
|
+
export { default as clipboard } from './clipboard/index.js';
|
|
3
|
+
export { default as counter } from './counter/index.js';
|
|
4
|
+
export { default as ellipsis } from './ellipsis/index.js';
|
|
5
|
+
export { default as footer } from './footer/index.js';
|
|
6
|
+
export { default as form } from './form/index.js';
|
|
7
|
+
export { default as json } from './json/index.js';
|
|
8
|
+
export { default as link } from './link/index.js';
|
|
9
|
+
export { default as loader } from './loader/index.js';
|
|
10
|
+
export { default as loading } from './loading/index.js';
|
|
11
|
+
export { default as magnet } from './magnet/index.js';
|
|
12
|
+
export { default as number } from './number/index.js';
|
|
13
|
+
export { default as page } from './page/index.js';
|
|
14
|
+
export { default as root } from './root/index.js';
|
|
15
|
+
export { default as scrollbar } from './scrollbar/index.js';
|
|
16
|
+
export { default as site } from './site/index.js';
|
|
17
|
+
export { default as tooltip } from './tooltip/index.js';
|
|
18
|
+
export { default as truncate } from './truncate/index.js';
|
|
19
|
+
export { default as typewriter } from './typewriter/index.js';
|
|
@@ -4,14 +4,14 @@ export default ({ attributes, content }) => {
|
|
|
4
4
|
attributes: {
|
|
5
5
|
class: 'link--hover'
|
|
6
6
|
},
|
|
7
|
-
content: html `
|
|
8
|
-
<span class='link-hover link-hover--one' ${attributes}>
|
|
9
|
-
${content}
|
|
10
|
-
</span>
|
|
11
|
-
|
|
12
|
-
<span class='link-hover link-hover--two' ${attributes}>
|
|
13
|
-
${content}
|
|
14
|
-
</span>
|
|
7
|
+
content: html `
|
|
8
|
+
<span class='link-hover link-hover--one' ${attributes}>
|
|
9
|
+
${content}
|
|
10
|
+
</span>
|
|
11
|
+
|
|
12
|
+
<span class='link-hover link-hover--two' ${attributes}>
|
|
13
|
+
${content}
|
|
14
|
+
</span>
|
|
15
15
|
`
|
|
16
16
|
};
|
|
17
17
|
};
|
|
@@ -8,24 +8,24 @@ export default ({ attributes, content }) => {
|
|
|
8
8
|
setTimeout(() => {
|
|
9
9
|
state.scale = true;
|
|
10
10
|
}, 300);
|
|
11
|
-
return html `
|
|
12
|
-
<div class="loader ${() => state.load && 'loader--load'}">
|
|
13
|
-
<div class="loader ${() => state.load && 'loader--load'}">
|
|
14
|
-
<div class="loader-content">
|
|
15
|
-
<div
|
|
16
|
-
class="loader-logo ${() => state.scale && 'loader-logo--scale'} text --flex-center --text-uppercase --text-600"
|
|
17
|
-
style='color: var(--color-grey-500);'
|
|
11
|
+
return html `
|
|
12
|
+
<div class="loader ${() => state.load && 'loader--load'}">
|
|
13
|
+
<div class="loader ${() => state.load && 'loader--load'}">
|
|
14
|
+
<div class="loader-content">
|
|
15
|
+
<div
|
|
16
|
+
class="loader-logo ${() => state.scale && 'loader-logo--scale'} text --flex-center --text-uppercase --text-600"
|
|
17
|
+
style='color: var(--color-grey-500);'
|
|
18
18
|
onanimationend='${({ animationName: name }) => {
|
|
19
19
|
if (name === 'scale') {
|
|
20
20
|
state.load = true;
|
|
21
21
|
}
|
|
22
|
-
}}'
|
|
23
|
-
${attributes}
|
|
24
|
-
>
|
|
25
|
-
${content}
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
22
|
+
}}'
|
|
23
|
+
${attributes}
|
|
24
|
+
>
|
|
25
|
+
${content}
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
30
|
`;
|
|
31
31
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { html } from '@esportsplus/template';
|
|
2
2
|
export default (properties) => {
|
|
3
|
-
return html `
|
|
4
|
-
<div class="loading --border-width-700 --size-800" style='--border-color: var(--color-border-500);' ${properties}></div>
|
|
3
|
+
return html `
|
|
4
|
+
<div class="loading --border-width-700 --size-800" style='--border-color: var(--color-border-500);' ${properties}></div>
|
|
5
5
|
`;
|
|
6
6
|
};
|
|
@@ -31,13 +31,13 @@ export default ({ attributes, hide }) => {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
return {
|
|
34
|
-
html: html `
|
|
35
|
-
<div class='magnet' style='${() => `
|
|
36
|
-
height: ${state.height ? `${state.height}px` : '100%'};
|
|
37
|
-
opacity: ${state.opacity};
|
|
38
|
-
transform: translate(${state.left}px, ${state.top}px);
|
|
39
|
-
width: ${state.width}px;
|
|
40
|
-
`}' ${attributes}></div>
|
|
34
|
+
html: html `
|
|
35
|
+
<div class='magnet' style='${() => `
|
|
36
|
+
height: ${state.height ? `${state.height}px` : '100%'};
|
|
37
|
+
opacity: ${state.opacity};
|
|
38
|
+
transform: translate(${state.left}px, ${state.top}px);
|
|
39
|
+
width: ${state.width}px;
|
|
40
|
+
`}' ${attributes}></div>
|
|
41
41
|
`,
|
|
42
42
|
sibling: {
|
|
43
43
|
attributes: events
|
|
@@ -7,15 +7,15 @@ export default ({ attributes, fixed } = {}) => {
|
|
|
7
7
|
translate: 0
|
|
8
8
|
});
|
|
9
9
|
return {
|
|
10
|
-
html: html `
|
|
11
|
-
<div
|
|
12
|
-
class='scrollbar ${fixed ? 'scrollbar--fixed' : ''} ${() => state.height >= 100 ? 'scrollbar--hidden' : ''}'
|
|
13
|
-
style='${() => `
|
|
14
|
-
--translate: translate3d(0, ${state.translate}%, 0);
|
|
15
|
-
--height: ${state.height}%;
|
|
16
|
-
`}'
|
|
17
|
-
${attributes}
|
|
18
|
-
></div>
|
|
10
|
+
html: html `
|
|
11
|
+
<div
|
|
12
|
+
class='scrollbar ${fixed ? 'scrollbar--fixed' : ''} ${() => state.height >= 100 ? 'scrollbar--hidden' : ''}'
|
|
13
|
+
style='${() => `
|
|
14
|
+
--translate: translate3d(0, ${state.translate}%, 0);
|
|
15
|
+
--height: ${state.height}%;
|
|
16
|
+
`}'
|
|
17
|
+
${attributes}
|
|
18
|
+
></div>
|
|
19
19
|
`,
|
|
20
20
|
parent: {
|
|
21
21
|
attributes: {
|
|
@@ -7,10 +7,10 @@ export default ({ attributes, content, scrollbar: sb }) => {
|
|
|
7
7
|
sb.attributes.style ??= '--background-default: var(--color-black-400);';
|
|
8
8
|
sb.fixed ??= true;
|
|
9
9
|
let { html: h, parent } = scrollbar(sb);
|
|
10
|
-
return html `
|
|
11
|
-
<section class='site' ${attributes} ${{ onclick }} ${parent.attributes}>
|
|
12
|
-
${content || ''}
|
|
13
|
-
${h}
|
|
14
|
-
</section>
|
|
10
|
+
return html `
|
|
11
|
+
<section class='site' ${attributes} ${{ onclick }} ${parent.attributes}>
|
|
12
|
+
${content || ''}
|
|
13
|
+
${h}
|
|
14
|
+
</section>
|
|
15
15
|
`;
|
|
16
16
|
};
|
package/components/styles.css
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
.accordion{max-height:var(--max-height);opacity:0;pointer-events:none;transition:max-height var(--transition-duration) ease-in-out,opacity var(--transition-duration) ease-in-out}.accordion.--active{opacity:1;pointer-events:auto}
|
|
2
2
|
.anchor{max-height:calc(var(--max-height, 100%) - var(--margin-vertical)*2);max-width:calc(var(--max-width, 100%) - var(--margin-horizontal)*2);position:absolute;transition:opacity var(--transition-duration) ease-in-out,transform var(--transition-duration) ease-in-out;z-index:9}.anchor:not(.--active){opacity:0}.anchor:not(.--active),.anchor:not(.--active) *{pointer-events:none}.anchor--ne,.anchor--nw{top:var(--margin-vertical)}.anchor--se,.anchor--sw{bottom:var(--margin-vertical)}.anchor--ne,.anchor--se{right:var(--margin-horizontal)}.anchor--nw,.anchor--sw{left:var(--margin-horizontal)}
|
|
3
3
|
.banner{position:absolute;inset:0 0 0 0;background-position:center;background-size:cover;z-index:-1}.banner--backdrop{background-position:bottom;height:80svh}.banner--blur{filter:blur(var(--blur));left:-2svh;right:-2svh;top:-2svh}.banner--blur.banner--backdrop{height:90svh}.banner--fixed{position:fixed}.banner--gradient::before{position:absolute;inset:0 0 0 0;background:radial-gradient(circle at top, transparent 64%, var(--to) 88%),linear-gradient(to bottom, var(--from) 0%, var(--to) 100%);content:"";z-index:0}
|
|
4
|
-
.border{border-top:var(--border-width) var(--border-style) var(--border-color);position:relative;width:100%}.border+.border{display:none}
|
|
5
|
-
.bubble{background:var(--background);border-radius:var(--border-radius);height:var(--height);width:var(--width)}.bubble--bottom-left,.bubble--bottom-right,.bubble--top-left,.bubble--top-right{position:absolute}.bubble--bottom-left,.bubble--top-left{left:var(--position-horizontal)}.bubble--bottom-right,.bubble--top-right{right:var(--position-horizontal)}.bubble--bottom-left,.bubble--bottom-right{bottom:var(--position-vertical)}.bubble--top-left,.bubble--top-right{top:var(--position-vertical)}
|
|
6
4
|
.button{align-content:center;align-items:center;background:var(--background);border-radius:var(--border-radius);color:var(--color);cursor:pointer;display:flex;flex-wrap:wrap;font-size:var(--font-size);font-weight:var(--font-weight);justify-content:center;line-height:var(--line-height);padding:calc(var(--padding-vertical) - var(--border-width)) calc(var(--padding-horizontal) - var(--border-width));position:relative;transition:all var(--transition-duration) ease-in-out;width:var(--width)}.button::after{position:absolute;inset:0 0 0 0;border-radius:inherit;box-shadow:var(--box-shadow);content:"";pointer-events:none;transition:box-shadow var(--transition-duration) ease-in-out,opacity var(--transition-duration) ease-in-out;z-index:0}.button--flat::after{display:none}.button--processing{color:rgba(0,0,0,0);pointer-events:none}.button--processing::before{position:absolute;bottom:50%;right:50%;transform:translate(50%, 50%);animation:ButtonProcessing var(--animation-duration) infinite linear;border:var(--border-width) solid color-mix(in srgb, var(--border-color), transparent 90%);border-left-color:var(--border-color);border-radius:100%;border-right-color:rgba(0,0,0,0);border-top-color:rgba(0,0,0,0);content:"";height:var(--size);width:var(--size)}.button--processing *{opacity:0}@keyframes ButtonProcessing{0%{transform:translate(50%, 50%) rotate(0deg)}100%{transform:translate(50%, 50%) rotate(359deg)}}.button--skeleton{animation:var(--animation-duration) ease-in-out infinite ButtonSkeleton;background-image:linear-gradient(270deg, var(--background-pressed), var(--background-default), var(--background-default), var(--background-pressed));background-size:400% 100%;color:rgba(0,0,0,0);pointer-events:none}.button--skeleton *{opacity:0}@keyframes ButtonSkeleton{0%{background-position:200% 0}100%{background-position:-200% 0}}.button--top-left,.button--top-right{position:absolute;top:calc((var(--padding-vertical) + var(--line-height)/2)*-1)}.button--top-left{left:calc((var(--padding-horizontal) + var(--line-height)/2)*-1)}.button--top-right{right:calc((var(--padding-horizontal) + var(--line-height)/2)*-1)}.button--underline.--active,.button--underline:not(.--active):hover{text-decoration:underline}
|
|
7
5
|
.card{background:var(--background);border-radius:var(--border-radius);padding:var(--padding-vertical) var(--padding-horizontal);position:relative;transition:background var(--transition-duration) ease-in-out,border-color var(--transition-duration) ease-in-out,box-shadow var(--transition-duration) ease-in-out,max-height var(--transition-duration) ease-in-out;width:var(--width)}.card::after{position:absolute;inset:0 0 0 0;border-radius:inherit;box-shadow:var(--box-shadow);content:"";pointer-events:none;transition:box-shadow var(--transition-duration) ease-in-out,opacity var(--transition-duration) ease-in-out;z-index:0}.card--flat::after{display:none}
|
|
6
|
+
.body{background:red !important}
|
|
8
7
|
.container{display:flex;flex-wrap:wrap;justify-content:flex-start;margin:var(--margin-vertical) auto;position:relative;width:min(var(--max-width),100% - var(--margin-horizontal)*2)}
|
|
9
8
|
.counter{display:flex;gap:2px;place-items:center;transition:transform .5s 2s;transform-style:flat}.counter-character,.counter-character-track span{background:linear-gradient(hsl(0, 0%, 98%) 50%, hsl(0, 0%, 45%));background-attachment:fixed;-webkit-background-clip:text;background-clip:text;color:rgba(0,0,0,0);transform-style:flat}.counter-character{display:grid;font-size:var(--font-size);font-variant:tabular-nums;font-weight:var(--font-weight);height:1lh;line-height:var(--line-height);-webkit-mask:linear-gradient(transparent, white calc(1lh * var(--mask-size)) calc(100% - 1lh * var(--mask-size)), transparent);mask:linear-gradient(transparent, white calc(1lh * var(--mask-size)) calc(100% - 1lh * var(--mask-size)), transparent);overflow:hidden;transform-style:flat}.counter-character--fraction{font-size:calc(var(--font-size)*var(--scale));font-weight:var(--font-weight-300);opacity:var(--opacity);overflow:visible;height:var(--line-height)}.counter-character--fraction .counter-character-track span{display:flex;flex-direction:column;align-items:end;padding:calc((var(--line-height) - var(--font-size))*.2) 0}.counter-character--symbol{font-size:calc(var(--font-size)*var(--scale));margin-right:.1ch;opacity:var(--opacity)}.counter-character-track{display:grid;translate:0 calc((var(--value) + 1)*var(--line-height)*-1);transition:translate var(--transition-duration) var(--timing-function)}.counter-character-track span{height:1lh;transform-style:flat}
|
|
10
9
|
.ellipsis span{animation:Ellipsis var(--animation-duration) infinite linear;background-color:var(--color);border-radius:100%;display:inline-block;height:var(--size);margin:0 var(--margin-horizontal);width:var(--size)}.ellipsis span :nth-child(2){animation-delay:.24s}.ellipsis span :nth-child(3){animation-delay:.48s}@keyframes Ellipsis{0%,100%{opacity:.16}20%{opacity:1}}
|
package/components/variables.css
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
.accordion{--max-height: 0}.accordion:not(.--active){--max-height: 0}
|
|
2
2
|
.anchor{--margin-horizontal: var(--size-400);--margin-vertical: var(--size-400)}
|
|
3
3
|
.banner--blur{--blur: 24px}.banner--gradient{--from: rgba(3,0,19, 0.32);--to: var(--color-black-500)}
|
|
4
|
-
.border{--border-color: var(--border-color-default);--border-color-default: var(--color-border-400);--border-style: solid;--border-width: var(--border-width-400)}
|
|
5
|
-
.bubble{--background: var(--background-default);--background-default: var(--color-border-400);--border-radius: var(--border-radius-circle);--height: var(--size);--margin-horizontal: var(--size-100);--width: var(--size);--size: 6px}.bubble--bottom-left,.bubble--bottom-right,.bubble--top-left,.bubble--top-right{--position-horizontal: calc(var(--size) / -2);--position-vertical: calc(var(--size) / -2)}
|
|
6
4
|
.button{--background: var(--background-default);--background-active: var(--background-default);--background-default: transparent;--background-hover: var(--background-default);--background-pressed: var(--background-default);--border-color: var(--border-color-default);--border-color-active: var(--border-color-default);--border-color-default: var(--background);--border-color-hover: var(--border-color-default);--border-color-pressed: var(--border-color-default);--border-radius: var(--border-radius-400);--border-width: 0px;--box-shadow: var(--box-shadow-default);--box-shadow-active: var(--box-shadow-300);--box-shadow-default: none;--box-shadow-hover: var(--box-shadow-400);--box-shadow-pressed: none;--color: var(--color-default);--color-active: var(--color-default);--color-default: var(--color-text-400);--color-hover: var(--color-default);--color-pressed: var(--color-default);--font-size: var(--font-size-400);--font-weight: var(--font-weight-400);--line-height: var(--line-height-400);--padding-horizontal: var(--size-400);--padding-vertical: var(--size-400);--width: auto}.button.--active{--background: var(--background-active);--border-color: var(--border-color-active);--box-shadow: var(--box-shadow-active);--color: var(--color-active)}.button:not(.--active):hover{--background: var(--background-hover);--border-color: var(--border-color-hover);--box-shadow: var(--box-shadow-hover);--color: var(--color-hover)}.button:not(.--active):active{--background: var(--background-pressed);--border-color: var(--border-color-pressed);--box-shadow: var(--box-shadow-pressed);--color: var(--color-pressed)}.button--processing{--animation-duration: 0.64s;--border-color: var(--color);--border-width: var(--border-width-400);--size: var(--size-400)}.button--skeleton{--animation-duration: 6.4s}
|
|
7
5
|
.card{--background: var(--background-default);--background-active: var(--background-default);--background-default: transparent;--background-hover: var(--background-default);--background-pressed: var(--background-default);--border-color: var(--border-color-default);--border-color-active: var(--border-color-default);--border-color-default: var(--background);--border-color-hover: var(--border-color-default);--border-color-pressed: var(--border-color-default);--border-radius: var(--border-radius-400);--box-shadow: var(--box-shadow-default);--box-shadow-active: var(--box-shadow-300);--box-shadow-default: none;--box-shadow-hover: var(--box-shadow-300);--box-shadow-pressed: none;--padding-horizontal: 0px;--padding-vertical: 0px;--width: auto}.card.--active{--background: var(--background-active);--border-color: var(--border-color-active);--box-shadow: var(--box-shadow-active)}.card:not(.--active):hover{--background: var(--background-hover);--border-color: var(--border-color-hover);--box-shadow: var(--box-shadow-hover)}.card:not(.--active):active{--background: var(--background-pressed);--border-color: var(--border-color-pressed);--box-shadow: var(--box-shadow-pressed)}
|
|
8
6
|
.container{--margin-horizontal: var(--size-600);--margin-vertical: 0px;--max-width: 1400px}
|
package/lib.scss
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Dart sass doesn't support changing root directory for the package to 'src'
|
|
1
|
+
// Dart sass doesn't support changing root directory for the package to 'src'
|
|
2
2
|
@forward './src/lib';
|
package/package.json
CHANGED
|
@@ -18,13 +18,17 @@
|
|
|
18
18
|
"typescript": "^5.8.3",
|
|
19
19
|
"webpack": "^5.100.1"
|
|
20
20
|
},
|
|
21
|
+
"exports": {
|
|
22
|
+
"./components/*": "./src/components/*",
|
|
23
|
+
".": "./src/index.ts"
|
|
24
|
+
},
|
|
21
25
|
"main": "build/index.js",
|
|
22
26
|
"name": "@esportsplus/ui",
|
|
23
27
|
"private": false,
|
|
24
28
|
"sideEffects": false,
|
|
25
29
|
"type": "module",
|
|
26
30
|
"types": "build/index.d.ts",
|
|
27
|
-
"version": "0.8.
|
|
31
|
+
"version": "0.8.3",
|
|
28
32
|
"scripts": {
|
|
29
33
|
"build": "pnpm build:ts && pnpm build:assets",
|
|
30
34
|
"build:ts": "tsc && tsc-alias",
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type Accordion = HTMLElement & { [key: symbol]: { active: boolean | number } };
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let key = Symbol();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export default () => {
|
|
11
|
-
let state = reactive({
|
|
12
|
-
active: 0 as boolean | number
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
attributes: {
|
|
17
|
-
class: () => {
|
|
18
|
-
return state.active && '--active';
|
|
19
|
-
},
|
|
20
|
-
onrender: (element: Accordion) => {
|
|
21
|
-
element[key] = state;
|
|
22
|
-
},
|
|
23
|
-
style: (element: Accordion) => {
|
|
24
|
-
let parent = element.closest('accordion') as Accordion | null;
|
|
25
|
-
|
|
26
|
-
if (parent && key in parent) {
|
|
27
|
-
parent[key].active = (+parent[key].active) + 1;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return state.active && `--max-height: ${element.scrollHeight}`;
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
state: state as ReturnType<typeof reactive<{ active: boolean }>>
|
|
34
|
-
};
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
type Accordion = HTMLElement & { [key: symbol]: { active: boolean | number } };
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
let key = Symbol();
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export default () => {
|
|
11
|
+
let state = reactive({
|
|
12
|
+
active: 0 as boolean | number
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
attributes: {
|
|
17
|
+
class: () => {
|
|
18
|
+
return state.active && '--active';
|
|
19
|
+
},
|
|
20
|
+
onrender: (element: Accordion) => {
|
|
21
|
+
element[key] = state;
|
|
22
|
+
},
|
|
23
|
+
style: (element: Accordion) => {
|
|
24
|
+
let parent = element.closest('accordion') as Accordion | null;
|
|
25
|
+
|
|
26
|
+
if (parent && key in parent) {
|
|
27
|
+
parent[key].active = (+parent[key].active) + 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return state.active && `--max-height: ${element.scrollHeight}`;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
state: state as ReturnType<typeof reactive<{ active: boolean }>>
|
|
34
|
+
};
|
|
35
35
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
@use '/tokens';
|
|
2
|
-
|
|
3
|
-
.accordion {
|
|
4
|
-
max-height: var(--max-height);
|
|
5
|
-
opacity: 0;
|
|
6
|
-
pointer-events: none;
|
|
7
|
-
transition:
|
|
8
|
-
max-height var(--transition-duration) ease-in-out,
|
|
9
|
-
opacity var(--transition-duration) ease-in-out;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@include tokens.state(active) {
|
|
13
|
-
opacity: 1;
|
|
14
|
-
pointer-events: auto;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
@use '/tokens';
|
|
2
|
+
|
|
3
|
+
.accordion {
|
|
4
|
+
max-height: var(--max-height);
|
|
5
|
+
opacity: 0;
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
transition:
|
|
8
|
+
max-height var(--transition-duration) ease-in-out,
|
|
9
|
+
opacity var(--transition-duration) ease-in-out;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@include tokens.state(active) {
|
|
13
|
+
opacity: 1;
|
|
14
|
+
pointer-events: auto;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@use '/tokens';
|
|
2
|
-
|
|
3
|
-
.accordion {
|
|
4
|
-
--max-height: 0;
|
|
5
|
-
|
|
6
|
-
@include tokens.state(inactive) {
|
|
7
|
-
--max-height: 0;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
@use '/tokens';
|
|
2
|
+
|
|
3
|
+
.accordion {
|
|
4
|
+
--max-height: 0;
|
|
5
|
+
|
|
6
|
+
@include tokens.state(inactive) {
|
|
7
|
+
--max-height: 0;
|
|
8
|
+
}
|
|
9
|
+
}
|