@esportsplus/ui 0.2.3 → 0.2.9
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/build/components/accordion/index.d.ts +15 -0
- package/build/components/accordion/index.js +27 -0
- package/build/components/aurora/index.d.ts +8 -0
- package/build/components/aurora/index.js +12 -0
- package/build/components/clipboard/index.d.ts +4 -0
- package/build/components/clipboard/index.js +2 -0
- package/build/components/clipboard/write.d.ts +2 -0
- package/build/components/clipboard/write.js +9 -0
- package/build/components/ellipsis/index.d.ts +2 -0
- package/build/components/ellipsis/index.js +8 -0
- package/build/components/field/description.d.ts +1 -1
- package/build/components/field/error.d.ts +1 -1
- package/build/components/field/index.d.ts +65 -180
- package/build/components/field/optional.d.ts +7 -87
- package/build/components/field/select.js +4 -2
- package/build/components/field/title.d.ts +1 -1
- package/build/components/form/action.js +1 -2
- package/build/components/form/index.d.ts +5 -5
- package/build/components/form/input.d.ts +1 -1
- package/build/components/form/types.d.ts +0 -1
- package/build/components/json/index.d.ts +4 -0
- package/build/components/json/index.js +2 -0
- package/build/components/scrollbar/index.d.ts +3 -3
- package/build/components/scrollbar/index.js +3 -5
- package/build/components/site/index.d.ts +2 -3
- package/build/components/site/index.js +6 -5
- package/build/components/tooltip/index.d.ts +2 -27
- package/build/components/tooltip/index.js +2 -13
- package/build/index.d.ts +5 -2
- package/build/index.js +5 -2
- package/components/styles.css +14 -14
- package/components/variables.css +18 -19
- package/package.json +5 -5
- package/src/components/accordion/index.ts +34 -0
- package/src/components/accordion/scss/variables.scss +6 -1
- package/src/components/anchor/scss/variables.scss +0 -1
- package/src/components/aurora/index.ts +22 -0
- package/src/components/aurora/scss/index.scss +60 -0
- package/src/components/banner/scss/index.scss +1 -1
- package/src/components/banner/scss/variables.scss +4 -0
- package/src/components/button/scss/index.scss +25 -3
- package/src/components/button/scss/variables.scss +3 -6
- package/src/components/card/scss/variables.scss +0 -1
- package/src/components/clipboard/index.ts +4 -0
- package/src/components/clipboard/write.ts +9 -0
- package/src/components/container/scss/index.scss +2 -4
- package/src/components/container/scss/variables.scss +2 -2
- package/src/components/ellipsis/index.ts +10 -0
- package/src/components/ellipsis/scss/index.scss +19 -63
- package/src/components/ellipsis/scss/variables.scss +3 -1
- package/src/components/field/scss/index.scss +2 -2
- package/src/components/field/scss/variables.scss +0 -1
- package/src/components/field/select.ts +4 -2
- package/src/components/form/action.ts +3 -2
- package/src/components/form/types.ts +1 -1
- package/src/components/grid/scss/index.scss +6 -0
- package/src/components/grid/scss/variables.scss +6 -0
- package/src/components/group/scss/index.scss +4 -4
- package/src/components/icon/scss/index.scss +0 -1
- package/src/components/json/index.ts +4 -0
- package/src/components/link/scss/variables.scss +0 -1
- package/src/components/loading/scss/index.scss +9 -16
- package/src/components/loading/scss/variables.scss +3 -28
- package/src/components/modal/scss/index.scss +7 -4
- package/src/components/modal/scss/variables.scss +3 -7
- package/src/components/page/scss/variables.scss +0 -12
- package/src/components/root/onclick.ts +1 -1
- package/src/components/root/scss/variables.scss +2 -5
- package/src/components/scrollbar/index.ts +3 -5
- package/src/components/scrollbar/scss/index.scss +2 -1
- package/src/components/scrollbar/scss/variables.scss +1 -1
- package/src/components/sidebar/scss/index.scss +5 -6
- package/src/components/sidebar/scss/variables.scss +4 -5
- package/src/components/site/index.ts +9 -8
- package/src/components/text/scss/variables.scss +0 -1
- package/src/components/tooltip/index.ts +4 -17
- package/src/components/tooltip/scss/variables.scss +0 -1
- package/src/css-utilities/absolute/scss/index.scss +11 -34
- package/src/css-utilities/hidden/scss/index.scss +1 -1
- package/src/css-utilities/squircle/scss/index.scss +5 -0
- package/src/css-utilities/text/scss/index.scss +2 -6
- package/src/css-utilities/text/scss/variables.scss +7 -7
- package/src/index.ts +5 -2
- package/src/lib/scss/breakpoint.scss +3 -3
- package/src/lib/scss/position.scss +25 -49
- package/src/tokens/scss/box-shadow.scss +17 -12
- package/src/tokens/scss/transition-duration.scss +1 -5
- package/tsconfig.json +1 -9
- package/utilities/styles.css +4 -4
- package/utilities/variables.css +1 -3
- package/build/components/alert/index.d.ts +0 -10
- package/build/components/alert/index.js +0 -122
- package/build/components/export/clipboard.d.ts +0 -2
- package/build/components/export/clipboard.js +0 -8
- package/build/components/export/index.d.ts +0 -5
- package/build/components/export/index.js +0 -3
- package/build/components/tooltip/menu.d.ts +0 -25
- package/build/components/tooltip/menu.js +0 -44
- package/src/components/alert/index.ts +0 -157
- package/src/components/alert/scss/index.scss +0 -55
- package/src/components/alert/scss/variables.scss +0 -8
- package/src/components/export/clipboard.ts +0 -12
- package/src/components/export/index.ts +0 -5
- package/src/components/processing/scss/index.scss +0 -47
- package/src/components/processing/scss/variables.scss +0 -11
- package/src/components/tooltip/menu.ts +0 -71
- package/src/css-utilities/slide/scss/index.scss +0 -21
- package/src/css-utilities/slide/scss/variables.scss +0 -10
- package/src/css-utilities/transition/scss/variables.scss +0 -14
- /package/build/components/{export/json.d.ts → json/download.d.ts} +0 -0
- /package/build/components/{export/json.js → json/download.js} +0 -0
- /package/src/components/{export/json.ts → json/download.ts} +0 -0
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
--line-height: var(--line-height-400);
|
|
30
30
|
--padding-horizontal: var(--size-400);
|
|
31
31
|
--padding-vertical: var(--size-400);
|
|
32
|
-
--transition-duration: var(--transition-duration-400);
|
|
33
32
|
--width: auto;
|
|
34
33
|
|
|
35
34
|
@include tokens.state(active) {
|
|
@@ -59,11 +58,9 @@
|
|
|
59
58
|
--border-color: var(--color);
|
|
60
59
|
--border-width: var(--border-width-400);
|
|
61
60
|
--size: var(--size-400);
|
|
61
|
+
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
--border-width: var(--border-width-#{$key});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
63
|
+
&--skeleton {
|
|
64
|
+
--animation-duration: 6.4s;
|
|
68
65
|
}
|
|
69
66
|
}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
justify-content: flex-start;
|
|
5
|
-
margin:
|
|
6
|
-
max-width: var(--max-width);
|
|
7
|
-
padding: var(--padding-vertical) var(--padding-horizontal);
|
|
5
|
+
margin: var(--margin-vertical) auto;
|
|
8
6
|
position: relative;
|
|
9
|
-
width: 100
|
|
7
|
+
width: min(var(--max-width), calc(100% - var(--margin-horizontal) * 2));
|
|
10
8
|
}
|
|
@@ -1,72 +1,28 @@
|
|
|
1
1
|
.ellipsis {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
span {
|
|
3
|
+
animation: Ellipsis var(--animation-duration) infinite linear;
|
|
4
|
+
background-color: var(--color);
|
|
5
|
+
border-radius: 100%;
|
|
6
|
+
display: inline-block;
|
|
7
|
+
height: var(--size);
|
|
8
|
+
margin: 0 var(--margin-horizontal);
|
|
9
|
+
width: var(--size);
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
animation:
|
|
11
|
+
:nth-child(2) {
|
|
12
|
+
animation-delay: 0.24s;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
animation:
|
|
15
|
+
:nth-child(3) {
|
|
16
|
+
animation-delay: 0.48s;
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@keyframes ellipsis-dot-one {
|
|
18
|
-
0% {
|
|
19
|
-
opacity: 1;
|
|
20
|
-
}
|
|
21
|
-
65% {
|
|
22
|
-
opacity: 1;
|
|
23
|
-
}
|
|
24
|
-
66% {
|
|
25
|
-
opacity: 0;
|
|
26
|
-
}
|
|
27
|
-
100% {
|
|
28
|
-
opacity: 0;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@keyframes ellipsis-dot-two {
|
|
33
|
-
0% {
|
|
34
|
-
opacity: 0;
|
|
35
|
-
}
|
|
36
|
-
21% {
|
|
37
|
-
opacity: 0;
|
|
38
|
-
}
|
|
39
|
-
22% {
|
|
40
|
-
opacity: 1;
|
|
41
|
-
}
|
|
42
|
-
65% {
|
|
43
|
-
opacity: 1;
|
|
44
|
-
}
|
|
45
|
-
66% {
|
|
46
|
-
opacity: 0;
|
|
47
|
-
}
|
|
48
|
-
100% {
|
|
49
|
-
opacity: 0;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
19
|
|
|
53
|
-
@keyframes
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
44% {
|
|
61
|
-
opacity: 1;
|
|
62
|
-
}
|
|
63
|
-
65% {
|
|
64
|
-
opacity: 1;
|
|
65
|
-
}
|
|
66
|
-
66% {
|
|
67
|
-
opacity: 0;
|
|
68
|
-
}
|
|
69
|
-
100% {
|
|
70
|
-
opacity: 0;
|
|
20
|
+
@keyframes Ellipsis {
|
|
21
|
+
0%, 100% {
|
|
22
|
+
opacity: 0.16;
|
|
23
|
+
}
|
|
24
|
+
20% {
|
|
25
|
+
opacity: 1;
|
|
26
|
+
}
|
|
71
27
|
}
|
|
72
28
|
}
|
|
@@ -55,8 +55,10 @@ function parse(keys: (number | string)[], selected: number | string) {
|
|
|
55
55
|
|
|
56
56
|
function template(data: Data, state: { active: boolean, options: Record<number | string, boolean>, selected: number | string }) {
|
|
57
57
|
let { attributes: a, html: h } = scrollbar({
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
attributes: {
|
|
59
|
+
style: data?.scrollbar?.style || '--background-default: var(--color-black-400);'
|
|
60
|
+
},
|
|
61
|
+
fixed: true
|
|
60
62
|
});
|
|
61
63
|
|
|
62
64
|
return html`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import response from '@esportsplus/action';
|
|
2
2
|
import { Action } from './types';
|
|
3
|
-
import alert from '~/components/alert';
|
|
3
|
+
// import alert from '~/components/alert';
|
|
4
4
|
import input from './input';
|
|
5
5
|
|
|
6
6
|
|
|
@@ -45,7 +45,8 @@ export default function(action: Action) {
|
|
|
45
45
|
event?.submitter?.classList.add('button--processing');
|
|
46
46
|
|
|
47
47
|
let { errors } = await action({
|
|
48
|
-
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
alert: null,
|
|
49
50
|
input: parse( Object.fromEntries( new FormData( this )?.entries() ) ),
|
|
50
51
|
response
|
|
51
52
|
});
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
justify-content: flex-start;
|
|
5
|
-
margin: 0 calc(var(--margin-horizontal)
|
|
5
|
+
margin: 0 calc(var(--margin-horizontal) * -1);
|
|
6
6
|
position: relative;
|
|
7
|
-
width: calc(100% + var(--margin-horizontal));
|
|
7
|
+
width: calc(100% + var(--margin-horizontal) * 2);
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
&--offset {
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
|
|
26
26
|
&-item {
|
|
27
27
|
display: flex;
|
|
28
|
-
margin: var(--margin-vertical)
|
|
28
|
+
margin: var(--margin-vertical) var(--margin-horizontal) 0;
|
|
29
29
|
position: relative;
|
|
30
30
|
width: var(--width);
|
|
31
31
|
|
|
32
32
|
&[class*='--width'] {
|
|
33
|
-
width: calc(var(--width) - var(--margin-horizontal));
|
|
33
|
+
width: calc(var(--width) - var(--margin-horizontal) * 2);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
.loading {
|
|
2
|
-
animation:
|
|
3
|
-
|
|
4
|
-
border
|
|
2
|
+
animation: Loading var(--animation-duration) linear infinite;
|
|
3
|
+
border: var(--border-width) solid color-mix(in srgb, var(--border-color), transparent 90%);
|
|
4
|
+
border-left-color: var(--border-color);
|
|
5
5
|
border-radius: 100%;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
box-shadow: var(--box-shadow);
|
|
9
|
-
height: var(--height);
|
|
10
|
-
pointer-events: none;
|
|
11
|
-
position: relative;
|
|
12
|
-
transition: border-color var(--transition-duration) ease-in-out;
|
|
13
|
-
width: var(--width);
|
|
14
|
-
z-index: 0;
|
|
6
|
+
height: var(--size);
|
|
7
|
+
width: var(--size);
|
|
15
8
|
}
|
|
16
9
|
|
|
17
|
-
@keyframes
|
|
10
|
+
@keyframes Loading {
|
|
18
11
|
0% {
|
|
19
|
-
transform: rotate(0deg)
|
|
12
|
+
transform: rotate(0deg)
|
|
20
13
|
}
|
|
21
14
|
100% {
|
|
22
|
-
transform: rotate(360deg)
|
|
15
|
+
transform: rotate(360deg)
|
|
23
16
|
}
|
|
24
|
-
}
|
|
17
|
+
}
|
|
@@ -1,31 +1,6 @@
|
|
|
1
1
|
.loading {
|
|
2
|
-
--animation-
|
|
3
|
-
--
|
|
4
|
-
--border-color: inherit;
|
|
5
|
-
--border-style: solid;
|
|
2
|
+
--animation-duration: 0.64s;
|
|
3
|
+
--border-color: var(--color);
|
|
6
4
|
--border-width: var(--border-width-400);
|
|
7
|
-
--box-shadow: none;
|
|
8
|
-
--height: calc(var(--size) * var(--multiplier));
|
|
9
|
-
--i: 0;
|
|
10
|
-
--multiplier: calc(1 - (.2 * var(--i)));
|
|
11
5
|
--size: var(--size-400);
|
|
12
|
-
|
|
13
|
-
--width: calc(var(--size) * var(--multiplier));
|
|
14
|
-
|
|
15
|
-
.loading {
|
|
16
|
-
--i: 1;
|
|
17
|
-
--size: inherit;
|
|
18
|
-
|
|
19
|
-
.loading {
|
|
20
|
-
--i: 2;
|
|
21
|
-
|
|
22
|
-
.loading {
|
|
23
|
-
--i: 3;
|
|
24
|
-
|
|
25
|
-
.loading {
|
|
26
|
-
--i: 4;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
6
|
+
}
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
.modal {
|
|
5
5
|
@include lib.position(fixed, center);
|
|
6
6
|
max-height: var(--max-height);
|
|
7
|
-
max-width: var(--max-width);
|
|
8
7
|
overflow: hidden;
|
|
9
|
-
transition:
|
|
8
|
+
transition:
|
|
9
|
+
opacity var(--transition-duration) ease-in-out,
|
|
10
|
+
transform var(--transition-duration) ease-in-out;
|
|
10
11
|
transform-origin: center;
|
|
11
|
-
width: var(--width);
|
|
12
|
+
width: min(var(--max-width), calc(100svw - (var(--margin-horizontal) * 2)));
|
|
12
13
|
z-index: 2;
|
|
13
14
|
|
|
14
15
|
@include tokens.state(inactive) {
|
|
@@ -22,7 +23,9 @@
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
&-frame {
|
|
25
|
-
transition:
|
|
26
|
+
transition:
|
|
27
|
+
opacity var(--transition-duration) ease-in-out,
|
|
28
|
+
transform var(--transition-duration) ease-in-out;
|
|
26
29
|
transform-origin: center;
|
|
27
30
|
|
|
28
31
|
@include tokens.state(inactive) {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
.modal {
|
|
2
|
-
--
|
|
2
|
+
--margin-horizontal: 0px;
|
|
3
|
+
--margin-vertical: 0px;
|
|
4
|
+
--max-height: calc(100svh - (var(--margin-vertical) * 2));
|
|
3
5
|
--max-width: 320px;
|
|
4
|
-
--width: calc(100svw - (var(--margin) * 2));
|
|
5
|
-
|
|
6
|
-
&,
|
|
7
|
-
&-frame {
|
|
8
|
-
--transition-duration: var(--transition-duration-300);
|
|
9
|
-
}
|
|
10
6
|
}
|
|
@@ -7,21 +7,9 @@
|
|
|
7
7
|
--line-height: var(--line-height-400);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
&-suptitle + &-title {
|
|
11
|
-
&::before {
|
|
12
|
-
--line-height: 1;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
10
|
&-title {
|
|
17
11
|
--color: var(--color-default);
|
|
18
12
|
--color-default: var(--color-text-500);
|
|
19
13
|
--line-height: var(--line-height-400);
|
|
20
14
|
}
|
|
21
|
-
|
|
22
|
-
&-title:has(+ .page-subtitle) {
|
|
23
|
-
&::after {
|
|
24
|
-
--line-height: 1;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
15
|
}
|
|
@@ -3,15 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
body {
|
|
5
5
|
@include lib.css-variables(border-radius, tokens.$border-radius);
|
|
6
|
-
@include lib.css-variables(box-shadow, tokens.$box-shadow);
|
|
7
6
|
@include lib.css-variables(border-width, tokens.$border-width);
|
|
7
|
+
@include lib.css-variables(box-shadow, tokens.$box-shadow);
|
|
8
8
|
@include lib.css-variables(color, tokens.$color);
|
|
9
9
|
@include lib.css-variables(font-size, tokens.$font-size);
|
|
10
10
|
@include lib.css-variables(font-weight, tokens.$font-weight);
|
|
11
11
|
@include lib.css-variables(line-height, tokens.$line-height);
|
|
12
12
|
@include lib.css-variables(size, tokens.$size);
|
|
13
13
|
@include lib.css-variables(spacer, tokens.$spacer);
|
|
14
|
-
@include lib.css-variables(transition-duration, tokens.$transition-duration);
|
|
15
14
|
|
|
16
15
|
--background: var(--color-grey-400);
|
|
17
16
|
--color: var(--color-text-400);
|
|
@@ -20,10 +19,8 @@ body {
|
|
|
20
19
|
--font-weight: var(--font-weight-400);
|
|
21
20
|
--line-height: var(--line-height-400);
|
|
22
21
|
--min-width: 320px;
|
|
23
|
-
|
|
24
|
-
// Used by components requiring scrollbar width
|
|
25
|
-
// - Should be updated using JS on load
|
|
26
22
|
--scrollbar-width: 17px;
|
|
23
|
+
--transition-duration: tokens.$transition-duration;
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
section {
|
|
@@ -6,7 +6,7 @@ let root = document.body,
|
|
|
6
6
|
width: number | undefined;
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
export default ({
|
|
9
|
+
export default ({ attributes, fixed }: { attributes?: Record<string, unknown>, fixed?: boolean } = {}) => {
|
|
10
10
|
let state = reactive({
|
|
11
11
|
height: 100,
|
|
12
12
|
translate: 0
|
|
@@ -14,9 +14,7 @@ export default ({ fixed, style }: { fixed?: boolean, style?: string } = {}) => {
|
|
|
14
14
|
|
|
15
15
|
return {
|
|
16
16
|
attributes: {
|
|
17
|
-
class:
|
|
18
|
-
return '--scrollbar-content';
|
|
19
|
-
},
|
|
17
|
+
class: '--scrollbar-content',
|
|
20
18
|
onscroll: function(this: HTMLElement) {
|
|
21
19
|
if (width === undefined) {
|
|
22
20
|
width = this.offsetWidth - this.clientWidth;
|
|
@@ -34,10 +32,10 @@ export default ({ fixed, style }: { fixed?: boolean, style?: string } = {}) => {
|
|
|
34
32
|
<div
|
|
35
33
|
class='scrollbar ${fixed ? 'scrollbar--fixed' : ''} ${() => state.height >= 100 ? 'scrollbar--hidden' : ''}'
|
|
36
34
|
style='${() => `
|
|
37
|
-
${style || ''}
|
|
38
35
|
--translate: translate3d(0, ${state.translate}%, 0);
|
|
39
36
|
--height: ${state.height}%;
|
|
40
37
|
`}'
|
|
38
|
+
${attributes}
|
|
41
39
|
></div>
|
|
42
40
|
`
|
|
43
41
|
};
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
margin-right: calc(var(--scrollbar-width) * -1);
|
|
21
21
|
overflow-x: hidden;
|
|
22
22
|
overflow-y: scroll;
|
|
23
|
+
scrollbar-gutter: stable;
|
|
23
24
|
scroll-behavior: smooth;
|
|
24
25
|
width: calc(100% + var(--scrollbar-width));
|
|
25
26
|
}
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
right: 0;
|
|
37
38
|
top: 0;
|
|
38
39
|
transition: opacity var(--transition-duration) ease-in-out;
|
|
39
|
-
width:
|
|
40
|
+
width: var(--width);
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
&::before {
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
@use '/tokens';
|
|
3
3
|
|
|
4
4
|
.sidebar {
|
|
5
|
-
@include lib.position(absolute, var(--
|
|
5
|
+
@include lib.position(absolute, var(--margin-vertical) null var(--margin-vertical) null);
|
|
6
6
|
cursor: default;
|
|
7
|
-
height: calc(100% - (var(--
|
|
8
|
-
max-width: var(--width);
|
|
7
|
+
height: calc(100% - (var(--margin-vertical) * 2));
|
|
9
8
|
overflow: hidden;
|
|
10
9
|
transition:
|
|
11
10
|
max-width var(--transition-duration) ease-in-out,
|
|
12
11
|
opacity var(--transition-duration) ease-in-out,
|
|
13
12
|
transform var(--transition-duration) ease-in-out;
|
|
14
|
-
width: calc(100% - (var(--
|
|
13
|
+
width: min(var(--width), calc(100% - (var(--margin-horizontal) * 2)));
|
|
15
14
|
z-index: 1;
|
|
16
15
|
|
|
17
16
|
|
|
@@ -23,7 +22,7 @@
|
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
&--e {
|
|
26
|
-
right: var(--
|
|
25
|
+
right: var(--margin-horizontal);
|
|
27
26
|
|
|
28
27
|
&.sidebar--offscreen {
|
|
29
28
|
@include tokens.state(inactive) {
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
&--w {
|
|
36
|
-
left: var(--
|
|
35
|
+
left: var(--margin-horizontal);
|
|
37
36
|
|
|
38
37
|
&.sidebar--offscreen {
|
|
39
38
|
@include tokens.state(inactive) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
@use '/tokens';
|
|
2
2
|
|
|
3
3
|
.sidebar {
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--transition-duration: var(--transition-duration-400);
|
|
4
|
+
--margin-horizontal: 0px;
|
|
5
|
+
--margin-vertical: 0px;
|
|
7
6
|
--width: var(--width-default);
|
|
8
7
|
--width-closed: var(--width-default);
|
|
9
8
|
--width-default: 320px;
|
|
@@ -15,7 +14,7 @@
|
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
&--floating {
|
|
18
|
-
--
|
|
19
|
-
--
|
|
17
|
+
--margin-horizontal: var(--size-100);
|
|
18
|
+
--margin-vertical: var(--size-100);
|
|
20
19
|
}
|
|
21
20
|
}
|
|
@@ -6,20 +6,21 @@ import scrollbar from '~/components/scrollbar';
|
|
|
6
6
|
type Data = {
|
|
7
7
|
class?: string;
|
|
8
8
|
content?: any;
|
|
9
|
-
scrollbar?:
|
|
10
|
-
style?: string;
|
|
11
|
-
};
|
|
9
|
+
scrollbar?: Parameters<typeof scrollbar>[0];
|
|
12
10
|
};
|
|
13
11
|
|
|
14
12
|
|
|
15
13
|
export default (data: Data) => {
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
let sb = data.scrollbar ??= {};
|
|
15
|
+
|
|
16
|
+
sb.attributes ??= {};
|
|
17
|
+
sb.attributes.style ??= '--background-default: var(--color-black-400);';
|
|
18
|
+
sb.fixed ??= true;
|
|
19
|
+
|
|
20
|
+
let { attributes: a, html: h } = scrollbar(sb);
|
|
20
21
|
|
|
21
22
|
return html`
|
|
22
|
-
<section class='site ${data?.class || ''}'
|
|
23
|
+
<section class='site ${data?.class || ''}' ${{ onclick }} ${a}>
|
|
23
24
|
${data?.content || ''}
|
|
24
25
|
${h}
|
|
25
26
|
</section>
|