@esportsplus/ui 0.5.4 → 0.5.6
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/.github/dependabot.yml +22 -22
- package/.github/workflows/bump.yml +6 -6
- package/.github/workflows/publish.yml +13 -13
- package/build/components/aurora/index.js +4 -4
- 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/magnet/index.js +7 -7
- package/build/components/scrollbar/index.js +9 -9
- package/build/components/site/index.js +5 -5
- package/lib.scss +1 -1
- package/package.json +25 -25
- 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/aurora/index.ts +21 -21
- package/src/components/aurora/scss/index.scss +59 -59
- package/src/components/banner/scss/index.scss +40 -40
- package/src/components/banner/scss/variables.scss +9 -9
- package/src/components/border/scss/index.scss +10 -10
- package/src/components/border/scss/variables.scss +6 -6
- package/src/components/bubble/scss/index.scss +30 -30
- package/src/components/bubble/scss/variables.scss +19 -19
- 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 +3 -3
- 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/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/json/download.ts +14 -14
- package/src/components/json/index.ts +3 -3
- package/src/components/link/scss/index.scss +28 -28
- package/src/components/link/scss/variables.scss +46 -46
- 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 +99 -99
- 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/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 +16 -16
- 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 +13 -13
- package/src/lib/scss/list.scss +76 -76
- package/src/lib/scss/map.scss +1 -1
- package/src/lib/scss/position.scss +53 -53
- package/src/lib/scss/string.scss +33 -33
- 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 +21 -21
- 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 +8 -8
- package/src/tokens/scss/state.scss +86 -86
- 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/.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
|
package/.github/dependabot.yml
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
-
# package ecosystems to update and where the package manifests are located.
|
|
3
|
-
# Please see the documentation for all configuration options:
|
|
4
|
-
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
-
|
|
6
|
-
version: 2
|
|
7
|
-
registries:
|
|
8
|
-
npm-npmjs:
|
|
9
|
-
token: ${{secrets.NPM_TOKEN}}
|
|
10
|
-
type: npm-registry
|
|
11
|
-
url: https://registry.npmjs.org
|
|
12
|
-
updates:
|
|
13
|
-
- package-ecosystem: "npm"
|
|
14
|
-
directory: "/"
|
|
15
|
-
groups:
|
|
16
|
-
production-dependencies:
|
|
17
|
-
dependency-type: "production"
|
|
18
|
-
development-dependencies:
|
|
19
|
-
dependency-type: "development"
|
|
20
|
-
registries:
|
|
21
|
-
- npm-npmjs
|
|
22
|
-
schedule:
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
registries:
|
|
8
|
+
npm-npmjs:
|
|
9
|
+
token: ${{secrets.NPM_TOKEN}}
|
|
10
|
+
type: npm-registry
|
|
11
|
+
url: https://registry.npmjs.org
|
|
12
|
+
updates:
|
|
13
|
+
- package-ecosystem: "npm"
|
|
14
|
+
directory: "/"
|
|
15
|
+
groups:
|
|
16
|
+
production-dependencies:
|
|
17
|
+
dependency-type: "production"
|
|
18
|
+
development-dependencies:
|
|
19
|
+
dependency-type: "development"
|
|
20
|
+
registries:
|
|
21
|
+
- npm-npmjs
|
|
22
|
+
schedule:
|
|
23
23
|
interval: "daily"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
name: bump
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: '**' # only trigger on branches, not on tags
|
|
5
|
-
jobs:
|
|
6
|
-
bump:
|
|
1
|
+
name: bump
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: '**' # only trigger on branches, not on tags
|
|
5
|
+
jobs:
|
|
6
|
+
bump:
|
|
7
7
|
uses: esportsplus/workflows/.github/workflows/bump.yml@main
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
name: publish to npm
|
|
2
|
-
on:
|
|
3
|
-
release:
|
|
4
|
-
types: [published]
|
|
5
|
-
workflow_dispatch:
|
|
6
|
-
workflow_run:
|
|
7
|
-
workflows: [bump]
|
|
8
|
-
types:
|
|
9
|
-
- completed
|
|
10
|
-
jobs:
|
|
11
|
-
publish:
|
|
12
|
-
secrets:
|
|
13
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISHING }}
|
|
1
|
+
name: publish to npm
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [published]
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
workflow_run:
|
|
7
|
+
workflows: [bump]
|
|
8
|
+
types:
|
|
9
|
+
- completed
|
|
10
|
+
jobs:
|
|
11
|
+
publish:
|
|
12
|
+
secrets:
|
|
13
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISHING }}
|
|
14
14
|
uses: esportsplus/workflows/.github/workflows/publish.yml@main
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { html } from '@esportsplus/template';
|
|
2
|
-
export default ({ backgrounds, blur, opacity, scale }) => html `
|
|
2
|
+
export default ({ backgrounds, blur, opacity, scale }) => html `
|
|
3
3
|
<div class="aurora" ${{
|
|
4
4
|
style: {
|
|
5
5
|
'--blur': blur || '50px',
|
|
6
6
|
'--opacity': opacity || 0.8,
|
|
7
7
|
'--scale': scale || 1
|
|
8
8
|
}
|
|
9
|
-
}}>
|
|
10
|
-
${backgrounds.map((bg) => html `<div style='${`--background-color: ${bg}`}'></div>`)}
|
|
11
|
-
</div>
|
|
9
|
+
}}>
|
|
10
|
+
${backgrounds.map((bg) => html `<div style='${`--background-color: ${bg}`}'></div>`)}
|
|
11
|
+
</div>
|
|
12
12
|
`;
|
|
@@ -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
|
`;
|
|
@@ -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/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
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"author": "ICJR",
|
|
3
|
-
"dependencies": {
|
|
4
|
-
"@esportsplus/action": "^0.0.50",
|
|
5
|
-
"@esportsplus/reactivity": "^0.2.7",
|
|
6
|
-
"@esportsplus/template": "^0.6.
|
|
7
|
-
},
|
|
8
|
-
"devDependencies": {
|
|
9
|
-
"@esportsplus/webpack": "^0.5.0",
|
|
10
|
-
"modern-normalize": "^3.0.1"
|
|
11
|
-
},
|
|
12
|
-
"main": "build/index.js",
|
|
13
|
-
"name": "@esportsplus/ui",
|
|
14
|
-
"private": false,
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "npm run build:ts && npm run build:assets",
|
|
17
|
-
"build:ts": "tsc && tsc-alias",
|
|
18
|
-
"build:assets": "webpack build --env=production=true",
|
|
19
|
-
"-": "-",
|
|
20
|
-
"prepublishOnly": "npm run build"
|
|
21
|
-
},
|
|
22
|
-
"sideEffects": false,
|
|
23
|
-
"types": "build/index.d.ts",
|
|
24
|
-
"version": "0.5.
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"author": "ICJR",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
"@esportsplus/action": "^0.0.50",
|
|
5
|
+
"@esportsplus/reactivity": "^0.2.7",
|
|
6
|
+
"@esportsplus/template": "^0.6.8"
|
|
7
|
+
},
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"@esportsplus/webpack": "^0.5.0",
|
|
10
|
+
"modern-normalize": "^3.0.1"
|
|
11
|
+
},
|
|
12
|
+
"main": "build/index.js",
|
|
13
|
+
"name": "@esportsplus/ui",
|
|
14
|
+
"private": false,
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "npm run build:ts && npm run build:assets",
|
|
17
|
+
"build:ts": "tsc && tsc-alias",
|
|
18
|
+
"build:assets": "webpack build --env=production=true",
|
|
19
|
+
"-": "-",
|
|
20
|
+
"prepublishOnly": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"types": "build/index.d.ts",
|
|
24
|
+
"version": "0.5.6"
|
|
25
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
@use '/tokens';
|
|
2
|
-
|
|
3
|
-
.anchor {
|
|
4
|
-
max-height: calc(var(--max-height, 100%) - (var(--margin-vertical) * 2));
|
|
5
|
-
max-width: calc(var(--max-width, 100%) - (var(--margin-horizontal) * 2));
|
|
6
|
-
position: absolute;
|
|
7
|
-
transition:
|
|
8
|
-
opacity var(--transition-duration) ease-in-out,
|
|
9
|
-
transform var(--transition-duration) ease-in-out;
|
|
10
|
-
z-index: 9;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@include tokens.state(inactive) {
|
|
14
|
-
opacity: 0;
|
|
15
|
-
|
|
16
|
-
&, * {
|
|
17
|
-
pointer-events: none;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
&--ne,
|
|
23
|
-
&--nw {
|
|
24
|
-
top: var(--margin-vertical);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&--se,
|
|
28
|
-
&--sw {
|
|
29
|
-
bottom: var(--margin-vertical);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&--ne,
|
|
33
|
-
&--se {
|
|
34
|
-
right: var(--margin-horizontal);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&--nw,
|
|
38
|
-
&--sw {
|
|
39
|
-
left: var(--margin-horizontal);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
@use '/tokens';
|
|
2
|
+
|
|
3
|
+
.anchor {
|
|
4
|
+
max-height: calc(var(--max-height, 100%) - (var(--margin-vertical) * 2));
|
|
5
|
+
max-width: calc(var(--max-width, 100%) - (var(--margin-horizontal) * 2));
|
|
6
|
+
position: absolute;
|
|
7
|
+
transition:
|
|
8
|
+
opacity var(--transition-duration) ease-in-out,
|
|
9
|
+
transform var(--transition-duration) ease-in-out;
|
|
10
|
+
z-index: 9;
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@include tokens.state(inactive) {
|
|
14
|
+
opacity: 0;
|
|
15
|
+
|
|
16
|
+
&, * {
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
&--ne,
|
|
23
|
+
&--nw {
|
|
24
|
+
top: var(--margin-vertical);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--se,
|
|
28
|
+
&--sw {
|
|
29
|
+
bottom: var(--margin-vertical);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&--ne,
|
|
33
|
+
&--se {
|
|
34
|
+
right: var(--margin-horizontal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&--nw,
|
|
38
|
+
&--sw {
|
|
39
|
+
left: var(--margin-horizontal);
|
|
40
|
+
}
|
|
41
|
+
}
|