@sio-group/form-react 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -4
- package/dist/index.cjs +268 -18
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +258 -17
- package/package.json +4 -3
- package/src/assets/scss/components/button.scss +164 -0
- package/src/assets/scss/components/checkbox.scss +90 -0
- package/src/assets/scss/components/color.scss +29 -0
- package/src/assets/scss/components/form-field.scss +34 -0
- package/src/assets/scss/components/form-states.scss +80 -0
- package/src/assets/scss/components/grid.scss +134 -0
- package/src/assets/scss/components/input.scss +112 -0
- package/src/assets/scss/components/link.scss +66 -0
- package/src/assets/scss/components/radio.scss +104 -0
- package/src/assets/scss/components/range.scss +52 -0
- package/src/assets/scss/components/select.scss +35 -0
- package/src/assets/scss/components/upload.scss +52 -0
- package/src/assets/scss/index.scss +19 -0
- package/src/assets/scss/tokens/_colors.scss +49 -0
- package/src/assets/scss/tokens/_form.scss +6 -0
- package/src/assets/scss/utilities/_mixins.scss +6 -0
- package/src/components/Button/index.tsx +106 -0
- package/src/components/Fields/Checkbox/index.tsx +59 -0
- package/src/components/Fields/Input/DateInput/index.tsx +95 -0
- package/src/components/Fields/Input/FileInput/index.tsx +169 -0
- package/src/components/Fields/Input/Input.tsx +45 -0
- package/src/components/Fields/Input/NumberInput/index.tsx +169 -0
- package/src/components/Fields/Input/RangeInput/index.tsx +77 -0
- package/src/components/Fields/Input/TextInput/index.tsx +65 -0
- package/src/components/Fields/InputWrapper/index.tsx +78 -0
- package/src/components/Fields/Radio/index.tsx +82 -0
- package/src/components/Fields/Select/index.tsx +103 -0
- package/src/components/Fields/Textarea/index.tsx +70 -0
- package/src/components/Fields/index.tsx +11 -0
- package/src/components/Form.tsx +163 -0
- package/src/components/Icon/index.tsx +16 -0
- package/src/components/Link/index.tsx +106 -0
- package/src/hooks/useConnectionStatus.ts +20 -0
- package/src/hooks/useForm.ts +230 -0
- package/src/index.ts +15 -0
- package/src/types/field-props.d.ts +94 -0
- package/src/types/field-setters.d.ts +6 -0
- package/src/types/field-state.d.ts +21 -0
- package/src/types/form-config.d.ts +30 -0
- package/src/types/form-layout.d.ts +6 -0
- package/src/types/index.ts +18 -0
- package/src/types/ui-props.d.ts +33 -0
- package/src/types/use-form-options.d.ts +3 -0
- package/src/utils/create-field-props.ts +115 -0
- package/src/utils/create-field-state.ts +99 -0
- package/src/utils/custom-icons.tsx +145 -0
- package/src/utils/file-type-icon.ts +63 -0
- package/src/utils/get-accept-string.ts +24 -0
- package/src/utils/get-column-classes.ts +21 -0
- package/src/utils/get-file-size.ts +9 -0
- package/src/utils/parse-date.ts +36 -0
- package/src/utils/slugify.ts +9 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@use "sass:color";
|
|
2
|
+
|
|
3
|
+
:where(.form-field--has-value .form-field__control) {
|
|
4
|
+
color: var(--sio-color-black);
|
|
5
|
+
border-color: var(--sio-color-primary);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:where(.form-field--has-value .form-field__icon) {
|
|
9
|
+
color: var(--sio-color-primary);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:where(.form-field--focused .form-field__control) {
|
|
13
|
+
color: var(--sio-color-black);
|
|
14
|
+
border-color: var(--sio-color-primary);
|
|
15
|
+
box-shadow: inset 2px 0 10px 0 rgba(var(--sio-color-primary-rgb), 0.3);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:where(.form-field--focused .form-field__icon) {
|
|
19
|
+
color: var(--sio-color-primary);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:where(.form-field--disabled label) {
|
|
23
|
+
color: var(--sio-color-gray);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:where(.form-field--disabled .form-field__control) {
|
|
27
|
+
color: var(--sio-color-light-gray);
|
|
28
|
+
border-color: var(--sio-color-light-gray);
|
|
29
|
+
background-color: color-mix(in srgb, var(--sio-color-light-gray) 20%, white);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:where(.form-field--disabled input),
|
|
33
|
+
:where(.form-field--disabled textarea) {
|
|
34
|
+
color: var(--sio-color-light-gray);
|
|
35
|
+
cursor: not-allowed;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:where(.form-field--disabled .form-field__icon) {
|
|
39
|
+
color: var(--sio-color-light-gray);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:where(.form-field--has-errors label) {
|
|
43
|
+
color: var(--sio-color-error);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:where(.form-field--has-errors .form-field__control) {
|
|
47
|
+
background-color: color-mix(in srgb, var(--sio-color-error) 15%, white);
|
|
48
|
+
border-color: var(--sio-color-error);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:where(.form-field--has-errors.form-field--focused .form-field__control) {
|
|
52
|
+
box-shadow: inset 2px 0 10px 0 rgba(var(--sio-color-error-rgb), 0.3);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:where(.form-field--has-errors input[type="range"])::-webkit-slider-runnable-track {
|
|
56
|
+
background: var(--sio-color-error);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:where(.form-field--has-errors .form-field__icon) {
|
|
60
|
+
color: var(--sio-color-error) !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:where(.form-field--hidden-layout .form-field__control) {
|
|
64
|
+
display: block;
|
|
65
|
+
width: 100%;
|
|
66
|
+
background: transparent;
|
|
67
|
+
border: none;
|
|
68
|
+
padding: 0;
|
|
69
|
+
box-shadow: unset;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:where(.form-field--hidden-layout input),
|
|
73
|
+
:where(.form-field--hidden-layout textarea) {
|
|
74
|
+
color: unset;
|
|
75
|
+
width: unset;
|
|
76
|
+
padding: 0;
|
|
77
|
+
resize: unset;
|
|
78
|
+
display: unset;
|
|
79
|
+
border: unset;
|
|
80
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "sass:math";
|
|
3
|
+
|
|
4
|
+
$grid-columns: 12;
|
|
5
|
+
$grid-breakpoints: (
|
|
6
|
+
xs: 0,
|
|
7
|
+
sm: 576px,
|
|
8
|
+
md: 768px,
|
|
9
|
+
lg: 992px,
|
|
10
|
+
xl: 1200px,
|
|
11
|
+
) !default;
|
|
12
|
+
|
|
13
|
+
:root {
|
|
14
|
+
--sio-grid-gutter: 15px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@function breakpoint($name) {
|
|
18
|
+
@return map.get($grid-breakpoints, $name);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@mixin media-breakpoint($name) {
|
|
22
|
+
$min: breakpoint($name);
|
|
23
|
+
|
|
24
|
+
@if $min != 0 {
|
|
25
|
+
@media (min-width: $min) {
|
|
26
|
+
@content;
|
|
27
|
+
}
|
|
28
|
+
} @else {
|
|
29
|
+
@content;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
*,
|
|
37
|
+
*::after,
|
|
38
|
+
*::before {
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sio-row {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-wrap: wrap;
|
|
45
|
+
margin-left: calc(var(--sio-grid-gutter) * -1);
|
|
46
|
+
margin-right: calc(var(--sio-grid-gutter) * -1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.sio-row .no-gutters {
|
|
50
|
+
margin-right: 0;
|
|
51
|
+
margin-left: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.sio-row .no-gutters > .sio-col,
|
|
55
|
+
.sio-row .no-gutters > [class*='sio-col-'] {
|
|
56
|
+
padding-right: 0;
|
|
57
|
+
padding-left: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
%sio-grid-column {
|
|
61
|
+
position: relative;
|
|
62
|
+
width: 100%;
|
|
63
|
+
padding-left: var(--sio-grid-gutter);
|
|
64
|
+
padding-right: var(--sio-grid-gutter);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@each $breakpoint in map.keys($grid-breakpoints) {
|
|
68
|
+
$infix: if(sass(breakpoint($breakpoint) == null): ''; else: '-#{$breakpoint}');
|
|
69
|
+
|
|
70
|
+
@for $i from 1 through $grid-columns {
|
|
71
|
+
.sio-col#{$infix}-#{$i} {
|
|
72
|
+
@extend %sio-grid-column;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.sio-col#{$infix},
|
|
77
|
+
.sio-col#{$infix}-auto {
|
|
78
|
+
@extend %sio-grid-column;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@include media-breakpoint($breakpoint) {
|
|
82
|
+
.sio-col#{$infix} {
|
|
83
|
+
flex-basis: 0;
|
|
84
|
+
flex-grow: 1;
|
|
85
|
+
max-width: 100%;
|
|
86
|
+
}
|
|
87
|
+
.sio-col#{$infix}-auto {
|
|
88
|
+
flex: 0 0 auto;
|
|
89
|
+
width: auto;
|
|
90
|
+
max-width: 100%;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@for $i from 1 through $grid-columns {
|
|
94
|
+
.sio-col#{$infix}-#{$i} {
|
|
95
|
+
flex: 0 0 math.percentage(math.div($i, $grid-columns));
|
|
96
|
+
max-width: math.percentage(math.div($i, $grid-columns));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.sio-order#{$infix}-first {
|
|
101
|
+
order: -1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.sio-order#{$infix}-last {
|
|
105
|
+
order: $grid-columns + 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@for $i from 0 through $grid-columns {
|
|
109
|
+
.sio-order#{$infix}-#{$i} {
|
|
110
|
+
order: $i;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@for $i from 0 through ($grid-columns - 1) {
|
|
115
|
+
@if not($infix == '' and $i == 0) {
|
|
116
|
+
.sio-offset#{$infix}-#{$i} {
|
|
117
|
+
margin-left: if(sass(math.div($i, $grid-columns) == 0): 0; else: math.percentage(math.div($i, $grid-columns)));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@if not($infix == '') {
|
|
123
|
+
.sio-d#{$infix}-none {
|
|
124
|
+
display: none;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@if not($infix == '') {
|
|
129
|
+
.d#{$infix}-block {
|
|
130
|
+
display: block;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
@use "sass:color";
|
|
2
|
+
|
|
3
|
+
:where(.form-field__control) {
|
|
4
|
+
border: 1px solid var(--sio-form-border);
|
|
5
|
+
background: var(--sio-form-bg);
|
|
6
|
+
position: relative;
|
|
7
|
+
font-size: 1em;
|
|
8
|
+
padding: 0;
|
|
9
|
+
margin: 2px 0 0;
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
border-radius: var(--sio-form-border-radius);
|
|
13
|
+
transition: color 300ms ease;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:where(.form-field__control input),
|
|
17
|
+
:where(.form-field__control textarea) {
|
|
18
|
+
display: block;
|
|
19
|
+
color: var(--sio-color-gray);
|
|
20
|
+
width: 100%;
|
|
21
|
+
background: transparent;
|
|
22
|
+
border: none;
|
|
23
|
+
padding: var(--sio-form-padding-y) var(--sio-form-padding-x);
|
|
24
|
+
resize: vertical;
|
|
25
|
+
transition: color 300ms ease;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:where(.form-field__control input:focus),
|
|
29
|
+
:where(.form-field__control textarea:focus),
|
|
30
|
+
:where(.form-field__control select:focus) {
|
|
31
|
+
outline: none;
|
|
32
|
+
box-shadow: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:where(.form-field__control input::placeholder),
|
|
36
|
+
:where(.form-field__control textarea::placeholder) {
|
|
37
|
+
color: var(--sio-color-light-gray);
|
|
38
|
+
font-weight: 200;
|
|
39
|
+
font-size: 1em;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:where(.form-field__icon) {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
width: 25px;
|
|
47
|
+
color: var(--sio-color-light-gray);
|
|
48
|
+
font-size: 1em;
|
|
49
|
+
margin-top: -1px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:where(.form-field__action) {
|
|
53
|
+
color: var(--sio-color-white);
|
|
54
|
+
background-color: var(--sio-color-primary);
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
align-items: center;
|
|
58
|
+
border-radius: 0 3px 3px 0;
|
|
59
|
+
margin: -1px -1px -1px 0;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:where(.form-field__spinner) {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
color: var(--sio-color-light-gray);
|
|
69
|
+
gap: 1px;
|
|
70
|
+
margin-right: 1px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:where(.form-field__spinner .btn) {
|
|
74
|
+
padding: 0 5px;
|
|
75
|
+
min-height: unset;
|
|
76
|
+
font-size: .5em;
|
|
77
|
+
height: 11px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:where(.form-field__spinner-btn) {
|
|
81
|
+
padding: 0 .5rem;
|
|
82
|
+
font-size: 1.2em;
|
|
83
|
+
text-decoration: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:where(.form-field input)::-webkit-resizer,
|
|
87
|
+
:where(.form-field input)::-webkit-inner-spin-button,
|
|
88
|
+
:where(.form-field input)::-webkit-calendar-picker-indicator {
|
|
89
|
+
display: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:where(.form-field input[type="date" i]) {
|
|
93
|
+
font-family: Arial;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:where(.form-field input::-webkit-datetime-edit-text) {
|
|
97
|
+
color: var(--sio-color-primary);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:where(.form-field input)::-webkit-datetime-edit-day-field,
|
|
101
|
+
:where(.form-field input)::-webkit-datetime-edit-month-field,
|
|
102
|
+
:where(.form-field input)::-webkit-datetime-edit-year-field {
|
|
103
|
+
color: var(--sio-color-black);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:where(.form-field input)::-webkit-datetime-edit-day-field:focus,
|
|
107
|
+
:where(.form-field input)::-webkit-datetime-edit-month-field:focus,
|
|
108
|
+
:where(.form-field input)::-webkit-datetime-edit-year-field:focus {
|
|
109
|
+
background-color: color-mix(in srgb, rgb(var(--sio-color-primary)) 60%, white);
|
|
110
|
+
color: var(--sio-color-black);
|
|
111
|
+
border-radius: var(--sio-form-border-radius);
|
|
112
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@use "../utilities/mixins" as *;
|
|
2
|
+
@use "../tokens/colors" as *;
|
|
3
|
+
|
|
4
|
+
:where(.btn--link) {
|
|
5
|
+
--sio-btn-bg: var(--sio-btn-link-bg);
|
|
6
|
+
--sio-btn-border: var(--sio-btn-link-border);
|
|
7
|
+
--sio-btn-text: var(--sio-btn-link-text);
|
|
8
|
+
|
|
9
|
+
--sio-btn-bg-hover: var(--sio-btn-bg);
|
|
10
|
+
--sio-btn-border-hover: var(--sio-btn-border);
|
|
11
|
+
--sio-btn-text-hover: color-mix(in srgb, var(--sio-btn-text) 85%, black);
|
|
12
|
+
|
|
13
|
+
--sio-btn-bg-disabled: var(--sio-btn-bg);
|
|
14
|
+
--sio-btn-border-disabled: var(--sio-btn-border);
|
|
15
|
+
--sio-btn-text-disabled: color-mix(in srgb, var(--sio-btn-text) 40%, white);
|
|
16
|
+
}
|
|
17
|
+
:where(.link) {
|
|
18
|
+
display: inline;
|
|
19
|
+
user-select: none;
|
|
20
|
+
transition: all 0.3s ease-in;
|
|
21
|
+
text-decoration: underline;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where(.link:hover),
|
|
25
|
+
:where(.link:active),
|
|
26
|
+
:where(.link:focus),
|
|
27
|
+
:where(.link.link--active) {
|
|
28
|
+
background: var(--sio-btn-bg-hover, var(--sio-btn-bg));
|
|
29
|
+
border-color: var(--sio-btn-border-hover, var(--sio-btn-border));
|
|
30
|
+
color: var(--sio-btn-text-hover, var(--sio-btn-text));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:where(.link:disabled),
|
|
34
|
+
:where(.link.link--disabled) {
|
|
35
|
+
cursor: not-allowed;
|
|
36
|
+
|
|
37
|
+
background: var(--sio-btn-bg-disabled, var(--sio-btn-bg));
|
|
38
|
+
border-color: var(--sio-btn-border-disabled, var(--sio-btn-border));
|
|
39
|
+
color: var(--sio-btn-text-disabled, var(--sio-btn-text));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@each $name, $color in $colors {
|
|
43
|
+
:where(.link--#{$name}) {
|
|
44
|
+
--sio-btn-bg: transparent;
|
|
45
|
+
--sio-btn-border: transparent;
|
|
46
|
+
--sio-btn-text: var(--sio-color-#{$name});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:where(.link--block) {
|
|
51
|
+
display: block;
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:where(.link--lg) {
|
|
56
|
+
font-size: 1.1em;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:where(.link--sm) {
|
|
60
|
+
font-size: .7em;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:where(.link--loading) {
|
|
64
|
+
position: relative;
|
|
65
|
+
cursor: wait !important;
|
|
66
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
:where(.form-field__radio .form-field__control) {
|
|
2
|
+
display: flex !important;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
margin-top: 8px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:where(.form-field__radio .form-field__control label) {
|
|
9
|
+
position: relative;
|
|
10
|
+
padding-left: 32px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:where(.form-field__radio .form-field__control label > div) {
|
|
14
|
+
display: inline;
|
|
15
|
+
color: var(--sio-color-black);
|
|
16
|
+
font-weight: normal;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:where(.form-field__radio .form-field__control label):before {
|
|
20
|
+
content: '';
|
|
21
|
+
position: absolute;
|
|
22
|
+
border: 1px solid var(--sio-form-border);
|
|
23
|
+
background-color: var(--sio-form-bg);
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
width: 17px;
|
|
27
|
+
height: 17px;
|
|
28
|
+
top: -1px;
|
|
29
|
+
left: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:where(.form-field__radio .form-field__control label):after {
|
|
33
|
+
content: '';
|
|
34
|
+
background-color: var(--sio-color-primary);
|
|
35
|
+
position: absolute;
|
|
36
|
+
border-radius: 50%;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
width: 13px;
|
|
39
|
+
height: 13px;
|
|
40
|
+
top: 2px;
|
|
41
|
+
left: 3px;
|
|
42
|
+
transform: scale(0);
|
|
43
|
+
transition: all .4s;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
:where(.form-field__radio input[type='radio']) {
|
|
48
|
+
display: none !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:where(.form-field__radio label.form-field--has-value):before {
|
|
52
|
+
border-color: var(--sio-color-primary);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:where(.form-field__radio label.form-field--has-value):after {
|
|
56
|
+
transform: scale(1);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:where(.form-field__radio-inline .form-field__control) {
|
|
60
|
+
flex-direction: row;
|
|
61
|
+
justify-content: flex-start;
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
gap: 20px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:where(.form-field__radio.form-field--has-errors label):before {
|
|
67
|
+
border-color: var(--sio-color-error);
|
|
68
|
+
background: rgba(var(--sio-color-error-rgb), .06);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:where(.form-field__radio.form-field--has-errors label.form-field--has-value):after {
|
|
72
|
+
border-color: var(--sio-color-error);
|
|
73
|
+
background: var(--sio-color-error);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:where(.form-field__radio.form-field--disabled .form-field__control label) {
|
|
77
|
+
cursor: not-allowed;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:where(.form-field__radio.form-field--disabled .form-field__control label):before,
|
|
81
|
+
:where(.form-field__radio.form-field--disabled .form-field__control label):after {
|
|
82
|
+
cursor: not-allowed;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:where(.form-field__radio.form-field--disabled .form-field__control label):before {
|
|
86
|
+
border-color: var(--sio-color-light-gray);
|
|
87
|
+
background-color: color-mix(in srgb, var(--sio-color-light-gray) 75%, white);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:where(.form-field__radio.form-field--disabled .form-field__control label):after {
|
|
91
|
+
border-color: color-mix(in srgb, var(--sio-color-light-gray) 75%, black);
|
|
92
|
+
background-color: color-mix(in srgb, var(--sio-color-light-gray) 75%, black);
|
|
93
|
+
|
|
94
|
+
transform: scale(0);
|
|
95
|
+
transition: all .4s;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:where(.form-field__radio.form-field--disabled .form-field__control label.form-field--has-value):before {
|
|
99
|
+
border-color: var(--sio-color-light-gray);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:where(.form-field__radio.form-field--disabled .form-field__control label.form-field--has-value):after {
|
|
103
|
+
transform: scale(1);
|
|
104
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
:where(.form-field__range .form-field__control) {
|
|
2
|
+
background: transparent !important;
|
|
3
|
+
border: none;
|
|
4
|
+
padding: 0;
|
|
5
|
+
box-shadow: none !important;
|
|
6
|
+
gap: 15px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:where(.form-field__range-value) {
|
|
10
|
+
color: var(--sio-color-gray);
|
|
11
|
+
align-content: center;
|
|
12
|
+
min-width: 25px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:where(.form-field input[type="range"]) {
|
|
16
|
+
appearance: none;
|
|
17
|
+
width: 100%;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
outline: none;
|
|
20
|
+
padding: 12px 0 15px;
|
|
21
|
+
margin: 0;
|
|
22
|
+
height: 6px;
|
|
23
|
+
background: transparent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:where(.form-field input[type="range"])::-webkit-slider-runnable-track {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 5px;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
background: var(--sio-color-light-gray);
|
|
31
|
+
border-radius: 2px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:where(.form-field input[type="range"])::-webkit-slider-thumb {
|
|
35
|
+
appearance: none;
|
|
36
|
+
margin-top: -5.5px;
|
|
37
|
+
height: 14px;
|
|
38
|
+
width: 14px;
|
|
39
|
+
background-color: var(--sio-color-primary);
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
border: none;
|
|
42
|
+
transition: .2s ease-in-out;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:where(.form-field input[type="range"])::-webkit-slider-thumb:hover {
|
|
46
|
+
box-shadow: 0 0 0 10px rgba(var(--sio-color-primary-rgb), .1)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:where(.form-field input[type="range"]):active::-webkit-slider-thumb,
|
|
50
|
+
:where(.form-field input[type="range"]):focus::-webkit-slider-thumb {
|
|
51
|
+
box-shadow: 0 0 0 13px rgba(var(--sio-color-primary-rgb), .2)
|
|
52
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
:where(.form-field__select select) {
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
background: transparent;
|
|
5
|
+
border: none;
|
|
6
|
+
color: var(--var-color-gray);
|
|
7
|
+
font-size: 1em;
|
|
8
|
+
appearance: none;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:where(.form-field__select-single .form-field__control) {
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:where(.form-field__select-single .form-field__control):after {
|
|
17
|
+
content: "";
|
|
18
|
+
position: absolute;
|
|
19
|
+
right: 10px;
|
|
20
|
+
top: 11px;
|
|
21
|
+
width: 6px;
|
|
22
|
+
height: 6px;
|
|
23
|
+
border-right: 2px solid var(--sio-color-light-gray);
|
|
24
|
+
border-bottom: 2px solid var(--sio-color-light-gray);
|
|
25
|
+
transform: translateY(-50%) rotate(45deg);
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:where(.form-field__select-single select) {
|
|
30
|
+
padding: 5px 28px 5px 10px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:where(.form-field__select-multiple select) {
|
|
34
|
+
padding: 5px 10px;
|
|
35
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
:where(.form-field__upload-file) {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
margin: 10px 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:where(.form-field input[type="file" i]) {
|
|
8
|
+
color: transparent;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:where(.form-field input)::file-selector-button {
|
|
12
|
+
padding: 0;
|
|
13
|
+
margin: 0;
|
|
14
|
+
border: none;
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
color: var(--sio-color-light-gray);
|
|
17
|
+
font-weight: 200;
|
|
18
|
+
font-size: 1em;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:where(.form-field__upload-file-label) {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 5px;
|
|
25
|
+
color: var(--sio-color-black);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:where(.form-field__upload-file-section button) {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
border: none;
|
|
33
|
+
padding: 3px 5px;
|
|
34
|
+
border-radius: 3px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:where(.form-field__upload-file-remove-button) {
|
|
38
|
+
background: transparent;
|
|
39
|
+
color: var(--sio-color-error);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:where(.form-field__upload-buttons) {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: flex-end;
|
|
45
|
+
gap: 5px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:where(.form-field__upload-remove-all-button) {
|
|
49
|
+
gap: 5px;
|
|
50
|
+
background: transparent;
|
|
51
|
+
color: var(--sio-color-error);
|
|
52
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@forward "tokens/colors";
|
|
2
|
+
@forward "tokens/form";
|
|
3
|
+
@forward "utilities/mixins";
|
|
4
|
+
|
|
5
|
+
@use "components/grid";
|
|
6
|
+
|
|
7
|
+
@use "components/button";
|
|
8
|
+
@use "components/link";
|
|
9
|
+
|
|
10
|
+
@use "components/input";
|
|
11
|
+
@use "components/form-field";
|
|
12
|
+
@use "components/form-states";
|
|
13
|
+
|
|
14
|
+
@use "components/checkbox";
|
|
15
|
+
@use "components/radio";
|
|
16
|
+
@use "components/select";
|
|
17
|
+
@use "components/upload";
|
|
18
|
+
@use "components/range";
|
|
19
|
+
@use "components/color";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
$color-white: #ffffff;
|
|
2
|
+
$color-black: #000000;
|
|
3
|
+
$color-gray: #655f5d;
|
|
4
|
+
$color-light-gray: #c6c6c6;
|
|
5
|
+
|
|
6
|
+
$color-default: #3B82F6;
|
|
7
|
+
$color-success: #10B981;
|
|
8
|
+
$color-error: #EF4444;
|
|
9
|
+
$color-warning: #F59E0B;
|
|
10
|
+
$color-info: #06B6D4;
|
|
11
|
+
|
|
12
|
+
$colors: (
|
|
13
|
+
success: $color-success,
|
|
14
|
+
error: $color-error,
|
|
15
|
+
warning: $color-warning,
|
|
16
|
+
info: $color-info,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
:root {
|
|
20
|
+
--sio-color-white: #{$color-white};
|
|
21
|
+
--sio-color-black: #{$color-black};
|
|
22
|
+
--sio-color-gray: #{$color-gray};
|
|
23
|
+
--sio-color-light-gray: #{$color-light-gray};
|
|
24
|
+
|
|
25
|
+
--sio-color-primary: #{$color-default};
|
|
26
|
+
--sio-color-success: #{$color-success};
|
|
27
|
+
--sio-color-error: #{$color-error};
|
|
28
|
+
--sio-color-warning: #{$color-warning};
|
|
29
|
+
--sio-color-info: #{$color-info};
|
|
30
|
+
|
|
31
|
+
--sio-color-primary-rgb: 59, 130, 246;
|
|
32
|
+
--sio-color-error-rgb: 239, 68, 68;
|
|
33
|
+
|
|
34
|
+
--sio-form-label: var(--sio-color-primary);
|
|
35
|
+
--sio-form-border: var(--sio-color-light-gray);
|
|
36
|
+
--sio-form-bg: var(--sio-color-white);
|
|
37
|
+
|
|
38
|
+
--sio-btn-primary-bg: var(--sio-color-primary);
|
|
39
|
+
--sio-btn-primary-border: var(--sio-color-primary);
|
|
40
|
+
--sio-btn-primary-text: var(--sio-color-white);
|
|
41
|
+
|
|
42
|
+
--sio-btn-secondary-bg: transparent;
|
|
43
|
+
--sio-btn-secondary-border: var(--sio-color-primary);
|
|
44
|
+
--sio-btn-secondary-text: var(--sio-color-primary);
|
|
45
|
+
|
|
46
|
+
--sio-btn-link-bg: transparent;
|
|
47
|
+
--sio-btn-link-border: transparent;
|
|
48
|
+
--sio-btn-link-text: var(--sio-color-primary);
|
|
49
|
+
}
|