@esportsplus/ui 0.8.3 → 0.9.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/.editorconfig +9 -9
- package/.gitattributes +2 -2
- package/.github/dependabot.yml +23 -0
- package/.github/workflows/bump.yml +7 -0
- package/.github/workflows/publish.yml +14 -0
- package/package.json +9 -22
- package/src/components/accordion/index.ts +35 -34
- package/src/components/accordion/scss/index.scss +17 -16
- package/src/components/accordion/scss/variables.scss +9 -9
- package/src/components/anchor/index.ts +1 -0
- package/src/components/anchor/scss/index.scss +42 -41
- package/src/components/anchor/scss/variables.scss +4 -4
- package/src/components/banner/index.ts +1 -0
- package/src/components/banner/scss/index.scss +41 -40
- package/src/components/banner/scss/variables.scss +9 -9
- package/src/components/border/index.ts +1 -0
- package/src/components/border/scss/index.scss +12 -0
- package/src/components/border/scss/variables.scss +6 -0
- package/src/components/bubble/index.ts +1 -0
- package/src/components/bubble/scss/index.scss +32 -0
- package/src/components/bubble/scss/variables.scss +19 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button/scss/index.scss +115 -114
- package/src/components/button/scss/variables.scss +66 -66
- package/src/components/card/index.ts +1 -0
- package/src/components/card/scss/index.scss +36 -35
- package/src/components/card/scss/variables.scss +41 -41
- package/src/components/clipboard/index.ts +3 -4
- package/src/components/clipboard/write.ts +8 -8
- package/src/components/container/index.ts +1 -0
- package/src/components/container/scss/index.scss +10 -8
- package/src/components/container/scss/variables.scss +5 -5
- package/src/components/counter/index.ts +99 -93
- package/src/components/counter/scss/index.scss +63 -61
- package/src/components/counter/scss/variables.scss +26 -26
- package/src/components/ellipsis/index.ts +10 -9
- package/src/components/ellipsis/scss/index.scss +29 -27
- package/src/components/ellipsis/scss/variables.scss +4 -4
- package/src/components/field/checkbox.ts +71 -0
- package/src/components/field/description.ts +14 -0
- package/src/components/field/error.ts +16 -0
- package/src/components/field/file.ts +77 -0
- package/src/components/field/index.ts +11 -0
- package/src/components/field/optional.ts +23 -0
- package/src/components/field/scss/_check.scss +225 -0
- package/src/components/field/scss/_normalize.scss +36 -0
- package/src/components/field/scss/_text.scss +106 -0
- package/src/components/field/scss/index.scss +161 -0
- package/src/components/field/scss/variables.scss +139 -0
- package/src/components/field/select.ts +182 -0
- package/src/components/field/switch.ts +9 -0
- package/src/components/field/text.ts +92 -0
- package/src/components/field/textarea.ts +8 -0
- package/src/components/field/title.ts +24 -0
- package/src/components/footer/index.ts +83 -78
- package/src/components/footer/scss/index.scss +25 -25
- package/src/components/form/action.ts +79 -80
- package/src/components/form/index.ts +5 -6
- package/src/components/form/input.ts +17 -15
- package/src/components/form/types.ts +13 -15
- package/src/components/frame/index.ts +1 -0
- package/src/components/frame/scss/index.scss +11 -11
- package/src/components/grid/index.ts +1 -0
- package/src/components/grid/scss/index.scss +11 -9
- package/src/components/grid/scss/variables.scss +5 -5
- package/src/components/group/index.ts +1 -0
- package/src/components/group/scss/index.scss +38 -36
- package/src/components/group/scss/variables.scss +17 -17
- package/src/components/highlight/index.ts +51 -47
- package/src/components/highlight/scss/index.scss +6 -4
- package/src/components/highlight/scss/variables.scss +3 -3
- package/src/components/icon/index.ts +1 -0
- package/src/components/icon/scss/index.scss +18 -16
- package/src/components/icon/scss/variables.scss +7 -7
- package/src/components/index.ts +38 -19
- 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 +4 -3
- package/src/components/link/scss/index.scss +66 -65
- package/src/components/link/scss/variables.scss +46 -46
- package/src/components/loader/index.ts +42 -34
- package/src/components/loader/scss/index.scss +70 -68
- package/src/components/loader/scss/variables.scss +5 -5
- package/src/components/loading/index.ts +13 -7
- package/src/components/loading/scss/index.scss +18 -16
- package/src/components/loading/scss/variables.scss +5 -5
- package/src/components/magnet/index.ts +55 -54
- package/src/components/magnet/scss/index.scss +17 -16
- package/src/components/magnet/scss/variables.scss +4 -4
- package/src/components/modal/index.ts +1 -0
- package/src/components/modal/scss/index.scss +35 -34
- package/src/components/modal/scss/variables.scss +6 -6
- package/src/components/normalize/index.ts +1 -0
- package/src/components/number/index.ts +4 -24
- package/src/components/page/index.ts +17 -15
- package/src/components/page/scss/index.scss +33 -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/index.ts +1 -0
- package/src/components/row/scss/index.scss +7 -7
- package/src/components/scrollbar/index.ts +49 -43
- package/src/components/scrollbar/scss/index.scss +72 -70
- package/src/components/scrollbar/scss/variables.scss +6 -6
- package/src/components/sidebar/index.ts +1 -0
- package/src/components/sidebar/scss/index.scss +50 -49
- package/src/components/sidebar/scss/variables.scss +20 -20
- package/src/components/site/index.ts +27 -26
- package/src/components/site/scss/index.scss +3 -3
- package/src/components/text/index.ts +1 -0
- package/src/components/text/scss/index.scss +11 -9
- package/src/components/text/scss/variables.scss +8 -8
- package/src/components/thumbnail/index.ts +1 -0
- package/src/components/thumbnail/scss/index.scss +9 -7
- package/src/components/thumbnail/scss/variables.scss +7 -7
- package/src/components/tooltip/index.ts +85 -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 +94 -93
- package/src/components/tooltip/scss/variables.scss +24 -24
- package/src/components/truncate/index.ts +4 -14
- package/src/components/typewriter/index.ts +54 -53
- package/src/components/typewriter/scss/index.scss +14 -14
- package/src/css-utilities/[margin,padding]/scss/index.scss +43 -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/index.scss +1 -0
- package/src/css-utilities/background/scss/variables.scss +26 -27
- package/src/css-utilities/border/scss/index.scss +23 -21
- package/src/css-utilities/border/scss/variables.scss +64 -66
- package/src/css-utilities/color/scss/index.scss +1 -0
- package/src/css-utilities/color/scss/variables.scss +29 -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 +4 -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.ts +18 -0
- package/src/css-utilities/inline/scss/index.scss +7 -7
- package/src/css-utilities/line-height/scss/index.scss +1 -0
- 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/pointer/scss/index.scss +5 -5
- package/src/css-utilities/size/scss/index.scss +1 -0
- 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 +90 -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 +5 -3
- package/src/css-utilities/width/scss/variables.scss +9 -9
- 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 +68 -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 +85 -87
- package/src/tokens/scss/transition-duration.scss +1 -1
- package/tsconfig.json +5 -2
- package/assets/0af89c10df9bc2f8d646.woff2 +0 -0
- package/assets/109e3207d9afea8524be.woff2 +0 -0
- package/assets/16663c3f6ab1da2d6c86.woff +0 -0
- package/assets/16e8721ef5837bc6375e.woff +0 -0
- package/assets/2a3e005f58bfca9c117e.woff +0 -0
- package/assets/58a8d7ebc386843b62c5.woff2 +0 -0
- package/assets/593de7c561e5ffe80c3e.woff2 +0 -0
- package/assets/68b7982c2b30b51bf932.woff2 +0 -0
- package/assets/a04b5e24af93da353f0e.woff +0 -0
- package/assets/bf331673b91821715c08.woff +0 -0
- package/assets/c54b0f4340f2914802d1.woff +0 -0
- package/assets/dd8646a41e4397b77fc4.woff2 +0 -0
- package/assets/e06c107cc50506570954.woff2 +0 -0
- package/assets/ecdfe4c05425592708aa.woff2 +0 -0
- package/assets/f0032576ac7462ccbd0c.woff +0 -0
- package/assets/f872e621917a45943fbc.woff +0 -0
- package/build/components/accordion/index.d.ts +0 -17
- package/build/components/accordion/index.js +0 -25
- package/build/components/clipboard/index.d.ts +0 -5
- package/build/components/clipboard/index.js +0 -3
- package/build/components/clipboard/write.d.ts +0 -2
- package/build/components/clipboard/write.js +0 -9
- package/build/components/counter/index.d.ts +0 -13
- package/build/components/counter/index.js +0 -72
- package/build/components/ellipsis/index.d.ts +0 -2
- package/build/components/ellipsis/index.js +0 -8
- package/build/components/footer/index.d.ts +0 -25
- package/build/components/footer/index.js +0 -55
- package/build/components/form/action.d.ts +0 -5
- package/build/components/form/action.js +0 -54
- package/build/components/form/index.d.ts +0 -23
- package/build/components/form/index.js +0 -4
- package/build/components/form/input.d.ts +0 -9
- package/build/components/form/input.js +0 -10
- package/build/components/form/layout.d.ts +0 -12
- package/build/components/form/layout.js +0 -12
- package/build/components/form/types.d.ts +0 -11
- package/build/components/form/types.js +0 -1
- package/build/components/highlight/index.d.ts +0 -8
- package/build/components/highlight/index.js +0 -36
- package/build/components/index.d.ts +0 -19
- package/build/components/index.js +0 -19
- package/build/components/json/download.d.ts +0 -2
- package/build/components/json/download.js +0 -8
- package/build/components/json/index.d.ts +0 -4
- package/build/components/json/index.js +0 -2
- package/build/components/link/hover.d.ts +0 -10
- package/build/components/link/hover.js +0 -17
- package/build/components/link/index.d.ts +0 -12
- package/build/components/link/index.js +0 -2
- package/build/components/loader/index.d.ts +0 -5
- package/build/components/loader/index.js +0 -31
- package/build/components/loading/index.d.ts +0 -2
- package/build/components/loading/index.js +0 -6
- package/build/components/magnet/index.d.ts +0 -10
- package/build/components/magnet/index.js +0 -46
- package/build/components/number/index.d.ts +0 -8
- package/build/components/number/index.js +0 -16
- package/build/components/page/index.d.ts +0 -22
- package/build/components/page/index.js +0 -11
- package/build/components/root/index.d.ts +0 -9
- package/build/components/root/index.js +0 -3
- package/build/components/root/onclick.d.ts +0 -5
- package/build/components/root/onclick.js +0 -14
- package/build/components/scrollbar/index.d.ts +0 -13
- package/build/components/scrollbar/index.js +0 -36
- package/build/components/site/index.d.ts +0 -8
- package/build/components/site/index.js +0 -16
- package/build/components/tooltip/index.d.ts +0 -23
- package/build/components/tooltip/index.js +0 -63
- package/build/components/truncate/index.d.ts +0 -9
- package/build/components/truncate/index.js +0 -10
- package/build/components/typewriter/index.d.ts +0 -8
- package/build/components/typewriter/index.js +0 -41
- package/build/index.d.ts +0 -19
- package/build/index.js +0 -19
- package/components/styles.css +0 -30
- package/components/variables.css +0 -24
- package/fonts/montserrat.css +0 -1
- package/lib.scss +0 -2
- package/normalize.css +0 -1
- package/src/components/clipboard/scss/index.scss +0 -3
- package/src/components/form/layout.ts +0 -26
- package/src/css-utilities/index.scss +0 -14
- package/src/css-utilities/overflow/scss/index.scss +0 -5
- package/src/index.ts +0 -19
- package/storage/fonts/montserrat/Montserrat-Bold.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-Bold.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-BoldItalic.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-BoldItalic.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-Italic.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-Italic.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-Medium.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-Medium.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-MediumItalic.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-MediumItalic.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-Regular.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-Regular.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-SemiBold.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-SemiBold.woff2 +0 -0
- package/storage/fonts/montserrat/Montserrat-SemiBoldItalic.woff +0 -0
- package/storage/fonts/montserrat/Montserrat-SemiBoldItalic.woff2 +0 -0
- package/storage/fonts/montserrat/index.css +0 -79
- package/tokens.scss +0 -2
- package/utilities/styles.css +0 -16
- package/utilities/variables.css +0 -9
- package/webpack.config.ts +0 -26
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import s from './select';
|
|
2
|
+
import sw from './switch';
|
|
3
|
+
import t from './text';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const select = (data: Parameters<typeof sw>[0] & { field: Parameters<typeof s>[0] }) => {
|
|
7
|
+
data.field ??= {} as typeof data.field;
|
|
8
|
+
data.field.class = `field--optional ${data.field?.class || ''}`;
|
|
9
|
+
data.field.content = s(data.field);
|
|
10
|
+
|
|
11
|
+
return sw(data);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const text = (data: Parameters<typeof sw>[0] & { field: Parameters<typeof t>[0] }) => {
|
|
15
|
+
data.field ??= {} as typeof data.field;
|
|
16
|
+
data.field.class = `field--optional ${data.field?.class || ''}`;
|
|
17
|
+
data.field.content = t(data.field);
|
|
18
|
+
|
|
19
|
+
return sw(data);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export default { select, text };
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
@use '/lib';
|
|
2
|
+
@use '/tokens';
|
|
3
|
+
|
|
4
|
+
@mixin css() {
|
|
5
|
+
&-mask {
|
|
6
|
+
&--checkbox,
|
|
7
|
+
&--radio,
|
|
8
|
+
&--switch {
|
|
9
|
+
background: var(--background);
|
|
10
|
+
border-color: var(--border-color);
|
|
11
|
+
border-radius: var(--border-radius);
|
|
12
|
+
border-style: var(--border-style);
|
|
13
|
+
border-width: var(--border-width);
|
|
14
|
+
flex: 0 0 var(--width);
|
|
15
|
+
height: var(--height);
|
|
16
|
+
position: relative;
|
|
17
|
+
transition:
|
|
18
|
+
background var(--transition-duration) ease-in-out,
|
|
19
|
+
border-color var(--transition-duration) ease-in-out,
|
|
20
|
+
box-shadow var(--transition-duration) ease-in-out,
|
|
21
|
+
opacity var(--transition-duration) ease-in-out,
|
|
22
|
+
transform var(--transition-duration) ease-in-out;
|
|
23
|
+
width: var(--width);
|
|
24
|
+
|
|
25
|
+
&:invalid,
|
|
26
|
+
&:required {
|
|
27
|
+
box-shadow: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&::before {
|
|
31
|
+
box-shadow: var(--box-shadow);
|
|
32
|
+
content: '';
|
|
33
|
+
height: var(--height);
|
|
34
|
+
opacity: var(--opacity);
|
|
35
|
+
transform: translate(var(--translateX), var(--translateY)) rotate(var(--rotate)) scale(var(--scale));
|
|
36
|
+
width: var(--width);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Hide HTML Field Element
|
|
40
|
+
.field-tag {
|
|
41
|
+
@include lib.position(absolute, 0 null null 0);
|
|
42
|
+
height: 0px;
|
|
43
|
+
opacity: 0;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
width: 0px;
|
|
46
|
+
z-index: 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--checkbox,
|
|
51
|
+
&--radio {
|
|
52
|
+
&::before {
|
|
53
|
+
position: absolute;
|
|
54
|
+
bottom: 50%;
|
|
55
|
+
right: 50%;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--radio,
|
|
60
|
+
&--switch {
|
|
61
|
+
&::before {
|
|
62
|
+
background: var(--accent);
|
|
63
|
+
border-radius: inherit;
|
|
64
|
+
transform-origin: center;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&--checkbox {
|
|
69
|
+
&::before {
|
|
70
|
+
border-bottom: var(--border-width) solid var(--accent);
|
|
71
|
+
border-right: var(--border-width) solid var(--accent);
|
|
72
|
+
transform-origin: center left;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--switch {
|
|
77
|
+
&::before {
|
|
78
|
+
@include lib.position(absolute, var(--padding-vertical) null null var(--padding-horizontal));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@mixin variables() {
|
|
85
|
+
label#{&},
|
|
86
|
+
#{tokens.state(inactive, '.field:not(label)')} &-mask {
|
|
87
|
+
@include tokens.state(hover) {
|
|
88
|
+
--background: var(--background-hover);
|
|
89
|
+
--border-color: var(--border-color-hover);
|
|
90
|
+
--box-shadow: var(--box-shadow-hover);
|
|
91
|
+
--color: var(--color-hover);
|
|
92
|
+
--outline-opacity: var(--outline-opacity-hover);
|
|
93
|
+
--outline-width: var(--outline-width-hover);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@include tokens.state(pressed) {
|
|
97
|
+
--background: var(--background-pressed);
|
|
98
|
+
--border-color: var(--border-color-pressed);
|
|
99
|
+
--box-shadow: var(--box-shadow-pressed);
|
|
100
|
+
--color: var(--color-pressed);
|
|
101
|
+
--outline-opacity: var(--outline-opacity-pressed);
|
|
102
|
+
--outline-width: var(--outline-width-pressed);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&-mask {
|
|
107
|
+
&--checkbox,
|
|
108
|
+
&--radio,
|
|
109
|
+
&--switch {
|
|
110
|
+
--accent: var(--accent-default);
|
|
111
|
+
--accent-active: var(--accent-default);
|
|
112
|
+
--accent-default: var(--color-white-400);
|
|
113
|
+
--accent-hover: var(--accent-default);
|
|
114
|
+
--accent-pressed: var(--accent-default);
|
|
115
|
+
--height: var(--size);
|
|
116
|
+
--opacity: var(--opacity-default);
|
|
117
|
+
--opacity-active: var(--opacity-default);
|
|
118
|
+
--opacity-default: 1;
|
|
119
|
+
--opacity-hover: var(--opacity-default);
|
|
120
|
+
--opacity-pressed: var(--opacity-default);
|
|
121
|
+
--rotate: 0deg;
|
|
122
|
+
--scale: var(--scale-default);
|
|
123
|
+
--scale-active: var(--scale-default);
|
|
124
|
+
--scale-default: 1;
|
|
125
|
+
--scale-hover: var(--scale-default);
|
|
126
|
+
--scale-pressed: var(--scale-default);
|
|
127
|
+
--size: var(--size-600);
|
|
128
|
+
--width-switch: 40px;
|
|
129
|
+
|
|
130
|
+
&::before {
|
|
131
|
+
--translateX: 0px;
|
|
132
|
+
--translateY: 0px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
#{tokens.state(inactive, 'label.field')},
|
|
136
|
+
#{tokens.state(inactive, '.field:not(label)')} & {
|
|
137
|
+
@include tokens.state(hover) {
|
|
138
|
+
--accent: var(--accent-hover);
|
|
139
|
+
--opacity: var(--opacity-hover);
|
|
140
|
+
--scale: var(--scale-hover);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@include tokens.state(pressed) {
|
|
144
|
+
--accent: var(--accent-pressed);
|
|
145
|
+
--opacity: var(--opacity-pressed);
|
|
146
|
+
--scale: var(--scale-pressed);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
#{tokens.state(active, '.field')} & {
|
|
151
|
+
--accent: var(--accent-active);
|
|
152
|
+
--opacity: var(--opacity-active);
|
|
153
|
+
--scale: var(--scale-active);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&--checkbox,
|
|
158
|
+
&--radio {
|
|
159
|
+
--margin-horizontal: calc(var(--width-switch) - var(--width));
|
|
160
|
+
--width: var(--height);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&--radio,
|
|
164
|
+
&--switch {
|
|
165
|
+
&::before {
|
|
166
|
+
--box-shadow: 0 1px 0 rgba(0,0,0, 0.16);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&--checkbox {
|
|
171
|
+
--border-radius: var(--border-radius-300);
|
|
172
|
+
--rotate: 45deg;
|
|
173
|
+
--scale-active: 1;
|
|
174
|
+
--scale-default: 0;
|
|
175
|
+
--scale-hover: 1.08;
|
|
176
|
+
--scale-pressed: 0.98;
|
|
177
|
+
|
|
178
|
+
&::before {
|
|
179
|
+
--box-shadow: 1px 1px 0 rgba(0,0,0, 0.16);
|
|
180
|
+
--border-width: 5px;
|
|
181
|
+
--height: 110%;
|
|
182
|
+
--translateX: 108%;
|
|
183
|
+
--translateY: 8%;
|
|
184
|
+
--width: 50%;
|
|
185
|
+
|
|
186
|
+
#{tokens.state(default, '.field')} & {
|
|
187
|
+
--translateY: 100%;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&--radio {
|
|
193
|
+
--border-radius: var(--border-radius-circle);
|
|
194
|
+
--opacity-active: 1;
|
|
195
|
+
--opacity-default: 0.4;
|
|
196
|
+
--scale-active: 0.9;
|
|
197
|
+
--scale-default: 0;
|
|
198
|
+
--scale-hover: 0.8;
|
|
199
|
+
--scale-pressed: 0.7;
|
|
200
|
+
|
|
201
|
+
&::before {
|
|
202
|
+
--height: calc((var(--size) / 2) - (var(--border-width) * 2));
|
|
203
|
+
--translateX: 50%;
|
|
204
|
+
--translateY: 50%;
|
|
205
|
+
--width: var(--height);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&--switch {
|
|
210
|
+
--border-radius: var(--border-radius-curved);
|
|
211
|
+
--padding-horizontal: var(--border-width-400);
|
|
212
|
+
--padding-vertical: var(--border-width-400);
|
|
213
|
+
--width: var(--width-switch);
|
|
214
|
+
|
|
215
|
+
&::before {
|
|
216
|
+
--height: calc(var(--size) - (var(--border-width) * 2) - (var(--padding-vertical) * 2));
|
|
217
|
+
--width: var(--height);
|
|
218
|
+
|
|
219
|
+
#{tokens.state(active, '.field')} & {
|
|
220
|
+
--translateX: calc(var(--width-switch) - (var(--border-width) * 2) - var(--height) - (var(--padding-horizontal) * 2));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@mixin normalize() {
|
|
2
|
+
button,
|
|
3
|
+
input,
|
|
4
|
+
select,
|
|
5
|
+
textarea {
|
|
6
|
+
background: transparent;
|
|
7
|
+
border-radius: 0;
|
|
8
|
+
border: 0;
|
|
9
|
+
font-family: inherit;
|
|
10
|
+
font-size: inherit;
|
|
11
|
+
line-height: inherit;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
|
|
15
|
+
&,
|
|
16
|
+
&:active,
|
|
17
|
+
&:focus,
|
|
18
|
+
&:hover {
|
|
19
|
+
outline: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:invalid {
|
|
23
|
+
box-shadow: none;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
form {
|
|
28
|
+
margin: 0;
|
|
29
|
+
padding: 0;
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
label {
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@use '/lib';
|
|
2
|
+
|
|
3
|
+
@mixin css() {
|
|
4
|
+
&-mask {
|
|
5
|
+
&--input,
|
|
6
|
+
&--select {
|
|
7
|
+
align-items: center;
|
|
8
|
+
background: var(--background);
|
|
9
|
+
border: var(--border-width) var(--border-style) var(--border-color);
|
|
10
|
+
border-radius: var(--border-radius);
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
font-size: var(--font-size);
|
|
14
|
+
line-height: var(--line-height);
|
|
15
|
+
position: relative;
|
|
16
|
+
width: 100%;
|
|
17
|
+
|
|
18
|
+
&:invalid,
|
|
19
|
+
&:required {
|
|
20
|
+
box-shadow: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&,
|
|
24
|
+
.field-tag {
|
|
25
|
+
color: var(--color);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Truncate Overflowing Text
|
|
30
|
+
&--input .field-tag,
|
|
31
|
+
&--select .field-text {
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&--input {
|
|
38
|
+
cursor: text;
|
|
39
|
+
// Necessary To Maintain Height Of Hidden Password Fields In Floating Modals
|
|
40
|
+
// - Password Managers Cause Problems When Fields Are Not Using 'display:hidden' On Password Fields
|
|
41
|
+
min-height: calc((var(--padding-vertical) * 2) + var(--size));
|
|
42
|
+
|
|
43
|
+
.field-tag {
|
|
44
|
+
flex: 1 1 auto;
|
|
45
|
+
padding: var(--padding-vertical) var(--padding-horizontal);
|
|
46
|
+
min-width: 0;
|
|
47
|
+
|
|
48
|
+
&[type='number'] {
|
|
49
|
+
appearance: textfield;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
textarea.field-tag {
|
|
54
|
+
white-space: normal;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&--select {
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
padding: var(--padding-vertical) calc((var(--padding-horizontal) / 1.5) + var(--arrow-size)) var(--padding-vertical) var(--padding-horizontal);
|
|
61
|
+
|
|
62
|
+
&.--padding {
|
|
63
|
+
padding-right: calc((var(--padding-horizontal) * 1.5) + var(--arrow-size));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Down Arrow
|
|
68
|
+
&-arrow {
|
|
69
|
+
@include lib.position(absolute, null calc(var(--padding-horizontal) + var(--arrow-spacer)) calc(50% + var(--arrow-spacer)) null);
|
|
70
|
+
border-color: var(--border-color);
|
|
71
|
+
border-style: var(--border-style);
|
|
72
|
+
border-width: 0 var(--border-width) var(--border-width) 0;
|
|
73
|
+
content: '';
|
|
74
|
+
height: var(--arrow-size);
|
|
75
|
+
transform: translateY(50%) rotate(45deg);
|
|
76
|
+
width: var(--arrow-size);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&-text {
|
|
81
|
+
padding-right: var(--padding-horizontal);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@mixin variables() {
|
|
86
|
+
&-mask {
|
|
87
|
+
&--input,
|
|
88
|
+
&--select {
|
|
89
|
+
--font-size: var(--font-size-400);
|
|
90
|
+
--line-height: var(--line-height-400);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&--input {
|
|
94
|
+
--size: var(--size-400);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--select {
|
|
98
|
+
--arrow-spacer: 1px;
|
|
99
|
+
--arrow-size: 6px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&-arrow {
|
|
103
|
+
--border-width: var(--border-width-500);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
@use '/lib';
|
|
2
|
+
@use '/tokens';
|
|
3
|
+
@use 'check' as check;
|
|
4
|
+
@use 'normalize' as *;
|
|
5
|
+
@use 'text' as text;
|
|
6
|
+
@use './variables.scss';
|
|
7
|
+
|
|
8
|
+
@include normalize();
|
|
9
|
+
|
|
10
|
+
.field {
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: var(--margin-vertical) var(--margin-horizontal);
|
|
13
|
+
position: relative;
|
|
14
|
+
transition:
|
|
15
|
+
background var(--transition-duration) ease-in-out,
|
|
16
|
+
border-color var(--transition-duration) ease-in-out,
|
|
17
|
+
box-shadow var(--transition-duration) ease-in-out,
|
|
18
|
+
color var(--transition-duration) ease-in-out,
|
|
19
|
+
opacity var(--transition-duration) ease-in-out;
|
|
20
|
+
width: var(--width);
|
|
21
|
+
z-index: 1;
|
|
22
|
+
|
|
23
|
+
@include tokens.state(hover) {
|
|
24
|
+
z-index: 8;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@include tokens.state(active) {
|
|
28
|
+
z-index: 9;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
&--optional {
|
|
33
|
+
max-height: var(--max-height);
|
|
34
|
+
opacity: 0;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
transition:
|
|
37
|
+
background var(--transition-duration) ease-in-out,
|
|
38
|
+
border-color var(--transition-duration) ease-in-out,
|
|
39
|
+
box-shadow var(--transition-duration) ease-in-out,
|
|
40
|
+
color var(--transition-duration) ease-in-out,
|
|
41
|
+
max-height var(--transition-duration) ease-in-out,
|
|
42
|
+
opacity var(--transition-duration) ease-in-out;
|
|
43
|
+
|
|
44
|
+
#{tokens.state(active, '.field')} & {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
pointer-events: auto;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
&-description,
|
|
52
|
+
&-error,
|
|
53
|
+
&-title {
|
|
54
|
+
color: var(--color);
|
|
55
|
+
font-size: var(--font-size);
|
|
56
|
+
position: relative;
|
|
57
|
+
width: 100%;
|
|
58
|
+
word-wrap: break-word;
|
|
59
|
+
|
|
60
|
+
&:empty {
|
|
61
|
+
height: 0px;
|
|
62
|
+
margin: 0;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&-error {
|
|
67
|
+
animation: fieldError 0.32s 1 linear;
|
|
68
|
+
|
|
69
|
+
@keyframes fieldError {
|
|
70
|
+
0% {
|
|
71
|
+
transform: translate(8px);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
20% {
|
|
75
|
+
transform: translate(-8px);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
40% {
|
|
79
|
+
transform: translate(4px);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
60% {
|
|
83
|
+
transform: translate(-4px);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
80% {
|
|
87
|
+
transform: translate(2px);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
100% {
|
|
91
|
+
transform: translate(0px);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&-mask {
|
|
97
|
+
|
|
98
|
+
// Pseudo Element Box Shadow
|
|
99
|
+
&::after {
|
|
100
|
+
@include lib.position(absolute, full);
|
|
101
|
+
border-radius: inherit;
|
|
102
|
+
box-shadow: var(--box-shadow);
|
|
103
|
+
content: '';
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
transition:
|
|
106
|
+
box-shadow var(--transition-duration) ease-in-out,
|
|
107
|
+
opacity var(--transition-duration) ease-in-out,
|
|
108
|
+
transform var(--transition-duration) ease-in-out;
|
|
109
|
+
z-index: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&--flat {
|
|
113
|
+
&::after {
|
|
114
|
+
display: none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&--outline {
|
|
119
|
+
&::before {
|
|
120
|
+
@include lib.position(absolute, full);
|
|
121
|
+
box-shadow: 0 0 0 var(--outline-width) var(--border-color);
|
|
122
|
+
border-radius: var(--border-radius);
|
|
123
|
+
content: '';
|
|
124
|
+
opacity: var(--outline-opacity);
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
transition:
|
|
127
|
+
box-shadow var(--transition-duration) ease-in-out,
|
|
128
|
+
opacity var(--transition-duration) ease-in-out;
|
|
129
|
+
z-index: 0;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&-required {
|
|
135
|
+
background: var(--background);
|
|
136
|
+
border-radius: var(--border-radius);
|
|
137
|
+
height: var(--size);
|
|
138
|
+
width: var(--size);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&-tag {
|
|
142
|
+
&--hidden {
|
|
143
|
+
@include lib.position(absolute, 0 null null 0);
|
|
144
|
+
appearance: none;
|
|
145
|
+
height: 0px;
|
|
146
|
+
opacity: 0;
|
|
147
|
+
pointer-events: none;
|
|
148
|
+
width: 0px;
|
|
149
|
+
z-index: -1;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&-title {
|
|
154
|
+
font-weight: var(--font-weight);
|
|
155
|
+
z-index: 1;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
@include check.css();
|
|
160
|
+
@include text.css();
|
|
161
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
@use '/tokens';
|
|
2
|
+
@use 'check' as check;
|
|
3
|
+
@use 'text' as text;
|
|
4
|
+
|
|
5
|
+
.field {
|
|
6
|
+
--margin-horizontal: 0px;
|
|
7
|
+
--margin-vertical: var(--size-300);
|
|
8
|
+
--width: 100%;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
&--optional {
|
|
12
|
+
--max-height: 0;
|
|
13
|
+
--max-height-active: 0;
|
|
14
|
+
|
|
15
|
+
#{tokens.state(active, '.field')} & {
|
|
16
|
+
--max-height: var(--max-height-active);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
&-description,
|
|
22
|
+
&-error {
|
|
23
|
+
--font-size: var(--font-size-300);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-error {
|
|
27
|
+
--color: var(--color-red-400);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-mask {
|
|
31
|
+
--background: var(--background-default);
|
|
32
|
+
--background-active: var(--background-default);
|
|
33
|
+
--background-default: transparent;
|
|
34
|
+
--background-hover: var(--background-default);
|
|
35
|
+
--background-pressed: var(--background-default);
|
|
36
|
+
--border-color: var(--border-color-default);
|
|
37
|
+
--border-color-default: var(--background);
|
|
38
|
+
--border-radius: var(--border-radius-400);
|
|
39
|
+
--border-style: solid;
|
|
40
|
+
--border-width: 0px;
|
|
41
|
+
--box-shadow: var(--box-shadow-default);
|
|
42
|
+
--box-shadow-active: var(--box-shadow-400);
|
|
43
|
+
--box-shadow-default: var(--box-shadow-300);
|
|
44
|
+
--box-shadow-hover: var(--box-shadow-400);
|
|
45
|
+
--box-shadow-pressed: none;
|
|
46
|
+
--color: var(--color-default);
|
|
47
|
+
--color-active: var(--color-default);
|
|
48
|
+
--color-default: var(--color-text-400);
|
|
49
|
+
--color-hover: var(--color-default);
|
|
50
|
+
--color-pressed: var(--color-default);
|
|
51
|
+
--outline-opacity: var(--outline-opacity-default);
|
|
52
|
+
--outline-opacity-active: 0.32;
|
|
53
|
+
--outline-opacity-default: 0;
|
|
54
|
+
--outline-opacity-hover: 0;
|
|
55
|
+
--outline-opacity-pressed: 0;
|
|
56
|
+
--outline-spacing: 0px;
|
|
57
|
+
--outline-width: var(--outline-width-default);
|
|
58
|
+
--outline-width-active: 4px;
|
|
59
|
+
--outline-width-default: 0px;
|
|
60
|
+
--outline-width-hover: 0px;
|
|
61
|
+
--outline-width-pressed: 0px;
|
|
62
|
+
--padding-horizontal: 0px;
|
|
63
|
+
--padding-vertical: var(--size-400);
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
#{tokens.state(active, '.field')} > &,
|
|
67
|
+
#{tokens.state(active, '.field')} *:not(.field) & {
|
|
68
|
+
--background: var(--background-active);
|
|
69
|
+
--border-color: var(--border-color-active);
|
|
70
|
+
--box-shadow: var(--box-shadow-active);
|
|
71
|
+
--color: var(--color-active);
|
|
72
|
+
--outline-opacity: var(--outline-opacity-active);
|
|
73
|
+
--outline-width: var(--outline-width-active);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
$inactive: tokens.state(inactive, '.field');
|
|
77
|
+
|
|
78
|
+
#{tokens.state(hover, 'label#{$inactive}')} > &,
|
|
79
|
+
#{tokens.state(hover, '#{$inactive}:not(label) &')} {
|
|
80
|
+
--background: var(--background-hover);
|
|
81
|
+
--border-color: var(--border-color-hover);
|
|
82
|
+
--box-shadow: var(--box-shadow-hover);
|
|
83
|
+
--color: var(--color-hover);
|
|
84
|
+
--outline-opacity: var(--outline-opacity-hover);
|
|
85
|
+
--outline-width: var(--outline-width-hover);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
#{tokens.state(pressed, 'label#{$inactive}')} > &,
|
|
89
|
+
#{tokens.state(pressed, '#{$inactive}:not(label) &')} {
|
|
90
|
+
--background: var(--background-pressed);
|
|
91
|
+
--border-color: var(--border-color-pressed);
|
|
92
|
+
--box-shadow: var(--box-shadow-pressed);
|
|
93
|
+
--color: var(--color-pressed);
|
|
94
|
+
--outline-opacity: var(--outline-opacity-pressed);
|
|
95
|
+
--outline-width: var(--outline-width-pressed);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&--outline {
|
|
99
|
+
@include tokens.state(pressed) {
|
|
100
|
+
--border-color: var(--border-color-default);
|
|
101
|
+
|
|
102
|
+
&::before {
|
|
103
|
+
--outline-width: 0px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&-required {
|
|
110
|
+
--border-radius: var(--border-radius-circle);
|
|
111
|
+
--size: 6px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&-title {
|
|
115
|
+
--color: var(--color-default);
|
|
116
|
+
--color-active: var(--color-default);
|
|
117
|
+
--color-default: var(--color-text-400);
|
|
118
|
+
--color-hover: var(--color-default);
|
|
119
|
+
--color-pressed: var(--color-default);
|
|
120
|
+
--font-size: var(--font-size-400);
|
|
121
|
+
--font-weight: var(--font-weight-500);
|
|
122
|
+
|
|
123
|
+
#{tokens.state(active, '.field')} & {
|
|
124
|
+
--color: var(--color-active);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
#{tokens.state(hover, '.field')} & {
|
|
128
|
+
--color: var(--color-hover);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
#{tokens.state(pressed, '.field')} & {
|
|
132
|
+
--color: var(--color-pressed);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
@include check.variables();
|
|
138
|
+
@include text.variables();
|
|
139
|
+
}
|