@esportsplus/ui 0.0.121 → 0.1.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 -0
- package/.gitattributes +2 -0
- package/build/assets/0af89c10df9bc2f8d646.woff2 +0 -0
- package/build/assets/109e3207d9afea8524be.woff2 +0 -0
- package/build/assets/16663c3f6ab1da2d6c86.woff +0 -0
- package/build/assets/16e8721ef5837bc6375e.woff +0 -0
- package/build/assets/2a3e005f58bfca9c117e.woff +0 -0
- package/build/assets/58a8d7ebc386843b62c5.woff2 +0 -0
- package/build/assets/593de7c561e5ffe80c3e.woff2 +0 -0
- package/build/assets/68b7982c2b30b51bf932.woff2 +0 -0
- package/build/assets/a04b5e24af93da353f0e.woff +0 -0
- package/build/assets/bf331673b91821715c08.woff +0 -0
- package/build/assets/c54b0f4340f2914802d1.woff +0 -0
- package/build/assets/dd8646a41e4397b77fc4.woff2 +0 -0
- package/build/assets/e06c107cc50506570954.woff2 +0 -0
- package/build/assets/ecdfe4c05425592708aa.woff2 +0 -0
- package/build/assets/f0032576ac7462ccbd0c.woff +0 -0
- package/build/assets/f872e621917a45943fbc.woff +0 -0
- package/build/components/alert/index.d.ts +10 -0
- package/build/components/alert/index.js +124 -0
- package/build/components/export/clipboard.d.ts +2 -0
- package/build/components/export/clipboard.js +10 -0
- package/build/components/export/index.d.ts +5 -0
- package/build/components/export/index.js +8 -0
- package/build/components/export/json.d.ts +2 -0
- package/build/components/export/json.js +10 -0
- package/build/components/field/checkbox.d.ts +17 -0
- package/build/components/field/checkbox.js +46 -0
- package/build/components/field/description.d.ts +4 -0
- package/build/components/field/description.js +11 -0
- package/build/components/field/error.d.ts +4 -0
- package/build/components/field/error.js +13 -0
- package/build/components/field/file.d.ts +18 -0
- package/build/components/field/file.js +50 -0
- package/build/components/field/index.d.ts +222 -0
- package/build/components/field/index.js +13 -0
- package/build/components/field/optional.d.ts +92 -0
- package/build/components/field/optional.js +21 -0
- package/build/components/field/select.d.ts +32 -0
- package/build/components/field/select.js +110 -0
- package/build/components/field/switch.d.ts +3 -0
- package/build/components/field/switch.js +11 -0
- package/build/components/field/text.d.ts +21 -0
- package/build/components/field/text.js +51 -0
- package/build/components/field/textarea.d.ts +3 -0
- package/build/components/field/textarea.js +10 -0
- package/build/components/field/title.d.ts +5 -0
- package/build/components/field/title.js +24 -0
- package/build/components/form/action.d.ts +5 -0
- package/build/components/form/action.js +51 -0
- package/build/components/form/index.d.ts +23 -0
- package/build/components/form/index.js +9 -0
- package/build/components/form/input.d.ts +9 -0
- package/build/components/form/input.js +12 -0
- package/build/components/form/layout.d.ts +12 -0
- package/build/components/form/layout.js +14 -0
- package/build/components/form/types.d.ts +12 -0
- package/build/components/form/types.js +2 -0
- package/build/components/number/index.d.ts +8 -0
- package/build/components/number/index.js +20 -0
- package/build/components/page/index.d.ts +22 -0
- package/build/components/page/index.js +16 -0
- package/build/components/root/index.d.ts +9 -0
- package/build/components/root/index.js +9 -0
- package/build/components/root/onclick.d.ts +5 -0
- package/build/components/root/onclick.js +16 -0
- package/build/components/scrollbar/index.d.ts +11 -0
- package/build/components/scrollbar/index.js +38 -0
- package/build/components/site/index.d.ts +9 -0
- package/build/components/site/index.js +20 -0
- package/build/components/styles.css +1 -0
- package/build/components/tooltip/index.d.ts +58 -0
- package/build/components/tooltip/index.js +75 -0
- package/build/components/tooltip/menu.d.ts +25 -0
- package/build/components/tooltip/menu.js +46 -0
- package/build/components/variables.css +1 -0
- package/build/fonts/montserrat.css +1 -0
- package/build/index.d.ts +9 -0
- package/build/index.js +24 -0
- package/build/normalizer.css +1 -0
- package/build/utilities/styles.css +1 -0
- package/build/utilities/variables.css +1 -0
- package/package.json +1 -5
- package/src/components/accordion/scss/index.scss +16 -0
- package/src/components/accordion/scss/variables.scss +4 -0
- package/src/components/alert/index.ts +157 -0
- package/src/components/alert/scss/index.scss +55 -0
- package/src/components/alert/scss/variables.scss +8 -0
- package/src/components/anchor/scss/index.scss +41 -0
- package/src/components/anchor/scss/variables.scss +5 -0
- package/src/components/banner/scss/index.scss +40 -0
- package/src/components/banner/scss/variables.scss +6 -0
- package/src/components/border/scss/index.scss +10 -0
- package/src/components/border/scss/variables.scss +6 -0
- package/src/components/bubble/scss/index.scss +30 -0
- package/src/components/bubble/scss/variables.scss +19 -0
- package/src/components/button/scss/index.scss +92 -0
- package/src/components/button/scss/variables.scss +69 -0
- package/src/components/card/scss/index.scss +35 -0
- package/src/components/card/scss/variables.scss +42 -0
- package/src/components/container/scss/index.scss +10 -0
- package/src/components/container/scss/variables.scss +5 -0
- package/src/components/ellipsis/scss/index.scss +72 -0
- package/src/components/ellipsis/scss/variables.scss +3 -0
- package/src/components/export/clipboard.ts +12 -0
- package/src/components/export/index.ts +5 -0
- package/src/components/export/json.ts +15 -0
- package/src/components/field/checkbox.ts +61 -0
- package/src/components/field/description.ts +12 -0
- package/src/components/field/error.ts +14 -0
- package/src/components/field/file.ts +64 -0
- package/src/components/field/index.ts +10 -0
- package/src/components/field/optional.ts +27 -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 +159 -0
- package/src/components/field/scss/variables.scss +138 -0
- package/src/components/field/select.ts +151 -0
- package/src/components/field/switch.ts +9 -0
- package/src/components/field/text.ts +68 -0
- package/src/components/field/textarea.ts +8 -0
- package/src/components/field/title.ts +23 -0
- package/src/components/form/action.ts +68 -0
- package/src/components/form/index.ts +6 -0
- package/src/components/form/input.ts +15 -0
- package/src/components/form/layout.ts +26 -0
- package/src/components/form/types.ts +16 -0
- package/src/components/group/scss/index.scss +36 -0
- package/src/components/group/scss/variables.scss +17 -0
- package/src/components/icon/scss/index.scss +17 -0
- package/src/components/icon/scss/variables.scss +7 -0
- package/src/components/link/scss/index.scss +28 -0
- package/src/components/link/scss/variables.scss +47 -0
- package/src/components/loading/scss/index.scss +24 -0
- package/src/components/loading/scss/variables.scss +31 -0
- package/src/components/modal/scss/index.scss +32 -0
- package/src/components/modal/scss/variables.scss +10 -0
- package/src/components/number/index.ts +24 -0
- package/src/components/page/index.ts +15 -0
- package/src/components/page/scss/index.scss +27 -0
- package/src/components/page/scss/variables.scss +27 -0
- package/src/components/processing/scss/index.scss +47 -0
- package/src/components/processing/scss/variables.scss +11 -0
- package/src/components/root/index.ts +5 -0
- package/src/components/root/onclick.ts +21 -0
- package/src/components/root/scss/index.scss +93 -0
- package/src/components/root/scss/variables.scss +55 -0
- package/src/components/row/scss/index.scss +7 -0
- package/src/components/scrollbar/index.ts +44 -0
- package/src/components/scrollbar/scss/index.scss +59 -0
- package/src/components/scrollbar/scss/variables.scss +6 -0
- package/src/components/sidebar/scss/index.scss +50 -0
- package/src/components/sidebar/scss/variables.scss +21 -0
- package/src/components/site/index.ts +27 -0
- package/src/components/site/scss/index.scss +3 -0
- package/src/components/text/scss/index.scss +12 -0
- package/src/components/text/scss/variables.scss +9 -0
- package/src/components/thumbnail/scss/index.scss +7 -0
- package/src/components/thumbnail/scss/variables.scss +7 -0
- package/src/components/tooltip/index.ts +94 -0
- package/src/components/tooltip/menu.ts +71 -0
- package/src/components/tooltip/scss/_center.scss +13 -0
- package/src/components/tooltip/scss/_east.scss +34 -0
- package/src/components/tooltip/scss/_north.scss +34 -0
- package/src/components/tooltip/scss/_south.scss +35 -0
- package/src/components/tooltip/scss/_west.scss +34 -0
- package/src/components/tooltip/scss/index.scss +93 -0
- package/src/components/tooltip/scss/variables.scss +25 -0
- package/src/css-utilities/[margin,padding]/scss/index.scss +41 -0
- package/src/css-utilities/[margin,padding]/scss/variables.scss +54 -0
- package/src/css-utilities/absolute/scss/index.scss +59 -0
- package/src/css-utilities/background/scss/variables.scss +27 -0
- package/src/css-utilities/border/scss/index.scss +21 -0
- package/src/css-utilities/border/scss/variables.scss +66 -0
- package/src/css-utilities/color/scss/variables.scss +31 -0
- package/src/css-utilities/disabled/scss/index.scss +4 -0
- package/src/css-utilities/flex/scss/index.scss +65 -0
- package/src/css-utilities/glass/scss/index.scss +3 -0
- package/src/css-utilities/glass/scss/variables.scss +3 -0
- package/src/css-utilities/hidden/scss/index.scss +28 -0
- package/src/css-utilities/index.scss +14 -0
- package/src/css-utilities/inline/scss/index.scss +7 -0
- package/src/css-utilities/line-height/scss/variables.scss +10 -0
- package/src/css-utilities/not-allowed/scss/index.scss +7 -0
- package/src/css-utilities/overflow/scss/index.scss +5 -0
- package/src/css-utilities/pointer/scss/index.scss +5 -0
- package/src/css-utilities/size/scss/variables.scss +12 -0
- package/src/css-utilities/slide/scss/index.scss +20 -0
- package/src/css-utilities/slide/scss/variables.scss +6 -0
- package/src/css-utilities/text/scss/index.scss +93 -0
- package/src/css-utilities/text/scss/variables.scss +31 -0
- package/src/css-utilities/transition/scss/variables.scss +14 -0
- package/src/css-utilities/viewport/scss/index.scss +5 -0
- package/src/css-utilities/width/scss/index.scss +3 -0
- package/src/css-utilities/width/scss/variables.scss +9 -0
- package/src/index.ts +11 -0
- package/src/lib/index.scss +7 -0
- package/src/lib/scss/breakpoint.scss +41 -0
- package/src/lib/scss/color.scss +1 -0
- package/src/lib/scss/css-variables.scss +13 -0
- package/src/lib/scss/list.scss +76 -0
- package/src/lib/scss/map.scss +1 -0
- package/src/lib/scss/position.scss +77 -0
- package/src/lib/scss/string.scss +33 -0
- package/src/tokens/index.scss +11 -0
- package/src/tokens/scss/border-radius.scss +12 -0
- package/src/tokens/scss/border-width.scss +6 -0
- package/src/tokens/scss/box-shadow.scss +13 -0
- package/src/tokens/scss/color.scss +64 -0
- package/src/tokens/scss/font-size.scss +12 -0
- package/src/tokens/scss/font-weight.scss +6 -0
- package/src/tokens/scss/line-height.scss +6 -0
- package/src/tokens/scss/size.scss +13 -0
- package/src/tokens/scss/spacer.scss +8 -0
- package/src/tokens/scss/state.scss +86 -0
- package/src/tokens/scss/transition-duration.scss +5 -0
- 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 +79 -0
- package/storage/psd/Color Palette.psd +0 -0
- package/tsconfig.json +11 -0
- package/webpack.config.ts +23 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
.ellipsis {
|
|
2
|
+
&-dot {
|
|
3
|
+
&:nth-child(1) {
|
|
4
|
+
animation: ellipsis-dot-one var(--animation-duration) linear infinite;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
&:nth-child(2) {
|
|
8
|
+
animation: ellipsis-dot-two var(--animation-duration) linear infinite;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&:nth-child(3) {
|
|
12
|
+
animation: ellipsis-dot-three var(--animation-duration) linear infinite;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
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
|
+
|
|
53
|
+
@keyframes ellipsis-dot-three {
|
|
54
|
+
0% {
|
|
55
|
+
opacity: 0;
|
|
56
|
+
}
|
|
57
|
+
43% {
|
|
58
|
+
opacity: 0;
|
|
59
|
+
}
|
|
60
|
+
44% {
|
|
61
|
+
opacity: 1;
|
|
62
|
+
}
|
|
63
|
+
65% {
|
|
64
|
+
opacity: 1;
|
|
65
|
+
}
|
|
66
|
+
66% {
|
|
67
|
+
opacity: 0;
|
|
68
|
+
}
|
|
69
|
+
100% {
|
|
70
|
+
opacity: 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default (value: string) => {
|
|
2
|
+
let input = document.createElement('INPUT') as HTMLInputElement;
|
|
3
|
+
|
|
4
|
+
document.body.appendChild(input);
|
|
5
|
+
|
|
6
|
+
input.setAttribute('value', value);
|
|
7
|
+
input.select();
|
|
8
|
+
|
|
9
|
+
document.execCommand('copy');
|
|
10
|
+
|
|
11
|
+
document.body.removeChild(input);
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default (content: any[] | Record<string, any>, name: string) => {
|
|
2
|
+
let link = document.createElement('a');
|
|
3
|
+
|
|
4
|
+
link.download = name + '.json';
|
|
5
|
+
link.href = window.URL.createObjectURL(new Blob(
|
|
6
|
+
[ JSON.stringify(content) ],
|
|
7
|
+
{ type: 'application/json' }
|
|
8
|
+
));
|
|
9
|
+
|
|
10
|
+
document.body.appendChild(link);
|
|
11
|
+
|
|
12
|
+
link.click();
|
|
13
|
+
|
|
14
|
+
document.body.removeChild(link);
|
|
15
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import { html } from '@esportsplus/template';
|
|
3
|
+
import description from './description';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
type Data = {
|
|
7
|
+
class?: string;
|
|
8
|
+
field?: {
|
|
9
|
+
content?: any;
|
|
10
|
+
};
|
|
11
|
+
mask?: {
|
|
12
|
+
class?: string;
|
|
13
|
+
style?: string;
|
|
14
|
+
};
|
|
15
|
+
name?: string;
|
|
16
|
+
style?: string;
|
|
17
|
+
title: string;
|
|
18
|
+
value?: any;
|
|
19
|
+
} & Parameters<typeof description>[0];
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export default (data: Data) => {
|
|
23
|
+
let state = reactive({
|
|
24
|
+
active: false
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return html`
|
|
28
|
+
<div
|
|
29
|
+
class="field --flex-column ${data?.class || ''} ${() => state.active ? '--active' : ''}"
|
|
30
|
+
onchange='${(e: Event) => {
|
|
31
|
+
if ((e.target as HTMLInputElement).type !== 'checkbox') {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
state.active = (e.target as HTMLInputElement)?.checked;
|
|
36
|
+
}}'
|
|
37
|
+
style='${data?.style || ''}'
|
|
38
|
+
>
|
|
39
|
+
<div class="field-title --flex-horizontal-space-between --flex-vertical">
|
|
40
|
+
${data.title}
|
|
41
|
+
|
|
42
|
+
<label
|
|
43
|
+
class="field-mask ${(data?.mask?.class || '').indexOf('field-mask--switch') === -1 ? 'field-mask--checkbox' : ''} --margin-left --margin-400 ${data?.mask?.class || ''}"
|
|
44
|
+
style='${data?.mask?.style || ''}'
|
|
45
|
+
>
|
|
46
|
+
<input
|
|
47
|
+
class='field-tag field-tag--hidden'
|
|
48
|
+
${data.name ? `name='${data.name}'` : ''}
|
|
49
|
+
type='checkbox'
|
|
50
|
+
value='1'
|
|
51
|
+
${(data?.class || '').indexOf('--active') !== -1 || data?.value ? 'checked' : ''}
|
|
52
|
+
>
|
|
53
|
+
</label>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
${data?.field?.content || ''}
|
|
57
|
+
|
|
58
|
+
${description(data)}
|
|
59
|
+
</div>
|
|
60
|
+
`
|
|
61
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export default (data: { description?: string }) => {
|
|
5
|
+
if (!data?.description) {
|
|
6
|
+
return '';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return html`
|
|
10
|
+
<div class='field-description --margin-top --margin-300'>${data.description}</div>
|
|
11
|
+
`;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export default (data: { error: string }) => {
|
|
5
|
+
return () => {
|
|
6
|
+
if (!data.error) {
|
|
7
|
+
return '';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return html`
|
|
11
|
+
<div class='field-error --margin-top --margin-300 --text-bold'>${data.error}</div>
|
|
12
|
+
`;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import { html } from '@esportsplus/template';
|
|
3
|
+
import form from '~/components/form';
|
|
4
|
+
import description from './description';
|
|
5
|
+
import error from './error';
|
|
6
|
+
import title from './title';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
type Data = {
|
|
10
|
+
accept?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
mask?: {
|
|
13
|
+
class?: string;
|
|
14
|
+
content?: any;
|
|
15
|
+
style?: string;
|
|
16
|
+
};
|
|
17
|
+
name?: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
style?: string;
|
|
20
|
+
type?: string;
|
|
21
|
+
value?: unknown;
|
|
22
|
+
} & Parameters<typeof description>[0] & Parameters<typeof title>[0];
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export default (data: Data) => {
|
|
26
|
+
let state = reactive({
|
|
27
|
+
active: false,
|
|
28
|
+
error: ''
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return html`
|
|
32
|
+
<div
|
|
33
|
+
class="field ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column"
|
|
34
|
+
onfocusin='${() => {
|
|
35
|
+
state.active = true;
|
|
36
|
+
}}'
|
|
37
|
+
onfocusout='${() => {
|
|
38
|
+
state.active = false;
|
|
39
|
+
}}'
|
|
40
|
+
style='${data?.style || ''}'
|
|
41
|
+
>
|
|
42
|
+
${title(data)}
|
|
43
|
+
|
|
44
|
+
<label
|
|
45
|
+
class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) && '--margin-top'} --margin-300'
|
|
46
|
+
style='${data?.mask?.style || ''} cursor:pointer;'
|
|
47
|
+
>
|
|
48
|
+
<input
|
|
49
|
+
${data?.accept ? `accept='${data.accept}'` : ''}
|
|
50
|
+
class='field-tag field-tag--hidden'
|
|
51
|
+
name='${data.name}'
|
|
52
|
+
onrender='${form.input.attributes(state)}'
|
|
53
|
+
type='file'
|
|
54
|
+
${data?.value !== undefined ? `value='${data.value}'` : ''}
|
|
55
|
+
>
|
|
56
|
+
|
|
57
|
+
${data?.mask?.content || ''}
|
|
58
|
+
</label>
|
|
59
|
+
|
|
60
|
+
${description(data)}
|
|
61
|
+
${error(state)}
|
|
62
|
+
</div>
|
|
63
|
+
`;
|
|
64
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import checkbox from './checkbox';
|
|
2
|
+
import file from './file';
|
|
3
|
+
import optional from './optional';
|
|
4
|
+
import select from './select';
|
|
5
|
+
import s from './switch';
|
|
6
|
+
import textarea from './textarea';
|
|
7
|
+
import text from './text';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export default { checkbox, file, optional, select, switch: s, textarea, text };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import sel from './select';
|
|
2
|
+
import s from './switch';
|
|
3
|
+
import tex from './text';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const select = (data: Parameters<typeof s>[0] & { field: Parameters<typeof sel>[0] }) => {
|
|
7
|
+
data.field.content = sel(
|
|
8
|
+
Object.assign(data.field || {}, {
|
|
9
|
+
class: `field--optional ${data?.field?.class || ''}`
|
|
10
|
+
})
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
return s(data);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const text = (data: Parameters<typeof s>[0] & { field: Parameters<typeof tex>[0] }) => {
|
|
17
|
+
data.field.content = tex(
|
|
18
|
+
Object.assign(data.field || {}, {
|
|
19
|
+
class: `field--optional ${data?.field?.class || ''}`
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return s(data);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
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
|
+
}
|