@steroidsjs/bootstrap 3.0.0-beta.26 → 3.0.0-beta.27
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/content/Accordion/AccordionItemView.js +1 -1
- package/content/Accordion/AccordionItemView.scss +11 -2
- package/content/Accordion/AccordionView.scss +2 -2
- package/content/Alert/AlertView.scss +13 -4
- package/content/Avatar/AvatarView.scss +0 -1
- package/content/Badge/BadgeView.scss +19 -1
- package/content/Calendar/CaptionElement.scss +4 -5
- package/content/Detail/DetailView.scss +74 -52
- package/content/Icon/IconView.js +2 -2
- package/form/Button/ButtonView.js +5 -2
- package/form/Button/ButtonView.scss +41 -3
- package/form/CheckboxField/CheckboxFieldView.scss +10 -11
- package/form/FieldLayout/FieldLayoutView.js +11 -3
- package/form/FieldLayout/FieldLayoutView.scss +128 -24
- package/form/InputField/InputFieldView.js +32 -13
- package/form/InputField/InputFieldView.scss +270 -98
- package/form/NumberField/NumberFieldView.js +19 -13
- package/form/NumberField/NumberFieldView.scss +213 -88
- package/form/RadioListField/RadioListFieldView.js +7 -3
- package/form/RadioListField/RadioListFieldView.scss +133 -1
- package/form/TextField/TextFieldView.js +10 -2
- package/form/TextField/TextFieldView.scss +145 -2
- package/icons/index.js +3 -0
- package/icons/svgs/arrow.svg +3 -0
- package/icons/svgs/field-close.svg +4 -0
- package/icons/svgs/user.svg +4 -0
- package/package.json +4 -3
- package/scss/mixins/button.scss +8 -8
- package/scss/variables/common/colors.scss +41 -38
- package/scss/variables/components/input.scss +1 -1
- package/scss/variables/index.scss +1 -0
- package/scss/variables/normalize.scss +21 -0
|
@@ -1,101 +1,226 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--number-field-arrow-color: #414141;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
html[data-theme="dark"] {
|
|
6
|
+
--number-field-arrow-color: #ffffff;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
$number-field-arrow-color: var(--number-field-arrow-color);
|
|
10
|
+
|
|
1
11
|
.NumberFieldView {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
color: rgba(0, 0, 0, .25);
|
|
18
|
-
background-color: $back-disabled;
|
|
19
|
-
border: unset;
|
|
20
|
-
cursor: not-allowed;
|
|
21
|
-
|
|
22
|
-
&:active, &:hover {
|
|
23
|
-
border: unset;
|
|
24
|
-
box-shadow: unset;
|
|
12
|
+
$root: &;
|
|
13
|
+
display: flex;
|
|
14
|
+
position: relative;
|
|
15
|
+
padding: 0;
|
|
16
|
+
|
|
17
|
+
width: 120px;
|
|
18
|
+
|
|
19
|
+
font-family: $font-family-nunito;
|
|
20
|
+
|
|
21
|
+
// Hide default arrows
|
|
22
|
+
/* Chrome, Safari, Edge, Opera */
|
|
23
|
+
input::-webkit-outer-spin-button,
|
|
24
|
+
input::-webkit-inner-spin-button {
|
|
25
|
+
-webkit-appearance: none;
|
|
26
|
+
margin: 0;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
/* Firefox */
|
|
30
|
+
input[type="number"] {
|
|
31
|
+
-moz-appearance: textfield;
|
|
29
32
|
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Hide default arrows
|
|
33
|
-
/* Chrome, Safari, Edge, Opera */
|
|
34
|
-
input::-webkit-outer-spin-button,
|
|
35
|
-
input::-webkit-inner-spin-button {
|
|
36
|
-
-webkit-appearance: none;
|
|
37
|
-
margin: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* Firefox */
|
|
41
|
-
input[type=number] {
|
|
42
|
-
-moz-appearance: textfield;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&__input {
|
|
46
|
-
flex-grow: 1;
|
|
47
|
-
border: none;
|
|
48
|
-
outline: none;
|
|
49
|
-
background-color: transparent;
|
|
50
|
-
color: $heading;
|
|
51
|
-
|
|
52
|
-
width: inherit;
|
|
53
|
-
padding: $input-padding-y $input-padding-x;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&__arrows-container{
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-flow: column;
|
|
59
|
-
grid-gap: 2px;
|
|
60
|
-
font-size: .6em;
|
|
61
|
-
|
|
62
|
-
opacity: 0;
|
|
63
|
-
pointer-events: none;
|
|
64
|
-
transition: opacity .15s;
|
|
65
|
-
}
|
|
66
|
-
&:hover &__arrows-container{
|
|
67
|
-
opacity: 1;
|
|
68
|
-
pointer-events: all;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&__arrow{
|
|
72
|
-
padding: $input-padding-y $input-padding-x;
|
|
73
|
-
cursor: pointer;
|
|
74
|
-
height: 50%;
|
|
75
33
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
34
|
+
&__arrows-container {
|
|
35
|
+
position: absolute;
|
|
36
|
+
z-index: 2;
|
|
37
|
+
right: 0;
|
|
38
|
+
top: 0;
|
|
39
|
+
height: 100%;
|
|
40
|
+
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
align-items: center;
|
|
45
|
+
|
|
46
|
+
transition: opacity 150ms ease-in-out;
|
|
47
|
+
opacity: 0;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&__arrow {
|
|
52
|
+
width: 30px;
|
|
53
|
+
height: 16px;
|
|
54
|
+
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
align-items: center;
|
|
58
|
+
outline: none;
|
|
59
|
+
border: none;
|
|
60
|
+
background: transparent;
|
|
61
|
+
|
|
62
|
+
span > svg > path {
|
|
63
|
+
stroke: $number-field-arrow-color;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&_disabled {
|
|
67
|
+
span {
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
}
|
|
70
|
+
span > svg > path {
|
|
71
|
+
stroke: $background-disabled-color;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:last-child{
|
|
76
|
+
transform: rotate(180deg);
|
|
87
77
|
}
|
|
88
|
-
}
|
|
89
78
|
}
|
|
90
79
|
|
|
91
|
-
&
|
|
92
|
-
|
|
80
|
+
&_size {
|
|
81
|
+
&_lg {
|
|
82
|
+
#{$root} {
|
|
83
|
+
&__input {
|
|
84
|
+
height: 56px;
|
|
85
|
+
border-radius: $radius-large;
|
|
86
|
+
font-size: $font-size-lg;
|
|
87
|
+
|
|
88
|
+
&-effects {
|
|
89
|
+
border-radius:$radius-large;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&::placeholder {
|
|
93
|
+
font-size: $font-size-sm;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&__arrow {
|
|
99
|
+
transform: translateX(-3px) translateY(5px);
|
|
100
|
+
|
|
101
|
+
&:last-child{
|
|
102
|
+
transform: translateX(-3px) translateY(-6px) rotate(180deg);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&_md {
|
|
109
|
+
#{$root} {
|
|
110
|
+
&__input {
|
|
111
|
+
height: 46px;
|
|
112
|
+
border-radius: $radius-large;
|
|
113
|
+
font-size: $font-size-base;
|
|
114
|
+
|
|
115
|
+
&-effects {
|
|
116
|
+
border-radius: $radius-large;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&::placeholder {
|
|
120
|
+
font-size: $font-size-sm;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&__arrow {
|
|
125
|
+
transform: translateX(-3px) translateY(4px) scale(0.8);
|
|
126
|
+
|
|
127
|
+
&:last-child{
|
|
128
|
+
transform: translateX(-3px) translateY(-2px) rotate(180deg) scale(0.8);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&_sm {
|
|
135
|
+
#{$root} {
|
|
136
|
+
&__input {
|
|
137
|
+
height: 34px;
|
|
138
|
+
font-size: $font-size-sm;
|
|
139
|
+
|
|
140
|
+
&::placeholder {
|
|
141
|
+
font-size: $font-size-sm;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&-effects {
|
|
145
|
+
border-radius: $radius-small;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__arrow {
|
|
150
|
+
transform: translateX(1px) translateY(-2px) scale(0.8);
|
|
151
|
+
|
|
152
|
+
&:last-child{
|
|
153
|
+
transform: translateX(1px) translateY(0px) rotate(180deg) scale(0.8);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&__input {
|
|
161
|
+
width: 120px;
|
|
162
|
+
outline: none;
|
|
163
|
+
border: 1px solid $border-color;
|
|
164
|
+
border-radius: $radius-small;
|
|
165
|
+
padding: 5px 22px 5px 8px;
|
|
166
|
+
line-height: 24px;
|
|
167
|
+
z-index: 1;
|
|
168
|
+
font-weight: $font-weight-sm;
|
|
169
|
+
color: $text-color;
|
|
170
|
+
|
|
171
|
+
background-color: $element-background-color;
|
|
172
|
+
|
|
173
|
+
&::placeholder {
|
|
174
|
+
color: $placeholder-color;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&:disabled {
|
|
178
|
+
background-color: $background-disabled-color;
|
|
179
|
+
color: $placeholder-disabled-color;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&:hover:not(:disabled):not(:focus) {
|
|
183
|
+
border-color: $border-color-hover;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&:active:not(:disabled) {
|
|
187
|
+
border: 1px solid $primary;
|
|
188
|
+
}
|
|
93
189
|
}
|
|
94
190
|
|
|
95
|
-
|
|
96
|
-
|
|
191
|
+
&:focus-within #{$root}__arrows-container {
|
|
192
|
+
opacity: 1;
|
|
193
|
+
pointer-events: all;
|
|
97
194
|
}
|
|
98
195
|
|
|
99
|
-
|
|
100
|
-
|
|
196
|
+
&__input-effects {
|
|
197
|
+
position: absolute;
|
|
198
|
+
display: block;
|
|
199
|
+
z-index: 5;
|
|
200
|
+
top: 0;
|
|
201
|
+
left: 0;
|
|
202
|
+
|
|
203
|
+
width: 103.3333333333%;
|
|
204
|
+
height: 111.7647058824%;
|
|
205
|
+
|
|
206
|
+
transform: translate(-1.6666666667%, -5.8823529412%);
|
|
207
|
+
background-color: transparent;
|
|
208
|
+
|
|
209
|
+
border: 4px solid $primary-light;
|
|
210
|
+
opacity: 0;
|
|
211
|
+
pointer-events: none;
|
|
212
|
+
}
|
|
101
213
|
|
|
214
|
+
&__input:focus ~ &__input-effects {
|
|
215
|
+
opacity: 1;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&__input:active ~ &__input-effects {
|
|
219
|
+
opacity: 0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&_filled #{$root}__arrows-container {
|
|
223
|
+
opacity: 1;
|
|
224
|
+
pointer-events: all;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
@@ -43,10 +43,14 @@ var useUniqueId_1 = __importDefault(require("@steroidsjs/core/hooks/useUniqueId"
|
|
|
43
43
|
function RadioListFieldView(props) {
|
|
44
44
|
var bem = (0, hooks_1.useBem)('RadioListFieldView');
|
|
45
45
|
var prefix = (0, useUniqueId_1["default"])('radio');
|
|
46
|
-
return (React.createElement("div", { className: bem.block() }, props.items.map(function (item) { return (React.createElement("div", { key: typeof item.id !== 'boolean' ? item.id : (item.id ? 'true' : 'false'), className: '
|
|
47
|
-
|
|
46
|
+
return (React.createElement("div", { className: bem.block() }, props.items.map(function (item, index) { return (React.createElement("div", { key: typeof item.id !== 'boolean' ? item.id : (item.id ? 'true' : 'false'), className: bem(bem.element('item', {
|
|
47
|
+
hasError: !!props.errors
|
|
48
|
+
}), props.className) },
|
|
49
|
+
React.createElement("input", __assign({}, props.inputProps, { id: "".concat(prefix, "_").concat(item.id), tabIndex: index, className: bem(bem.element('input', {
|
|
50
|
+
checked: props.selectedIds.includes(item.id)
|
|
51
|
+
})), checked: props.selectedIds.includes(item.id), disabled: props.disabled || item.disabled, onChange: function () {
|
|
48
52
|
props.onItemSelect(item.id);
|
|
49
53
|
} })),
|
|
50
|
-
React.createElement("label", {
|
|
54
|
+
React.createElement("label", { htmlFor: "".concat(prefix, "_").concat(item.id), className: bem.element('label') }, item.label))); })));
|
|
51
55
|
}
|
|
52
56
|
exports["default"] = RadioListFieldView;
|
|
@@ -1,3 +1,135 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--radio-svg-default: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 13 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.210938' y='0.915161' width='12' height='12' rx='6' fill='%23651FFF'/%3E%3C/svg%3E%0A");
|
|
3
|
+
--radio-checked-hover-svg: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 13 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.210938' y='0.915161' width='12' height='12' rx='6' fill='%23651FFF'/%3E%3C/svg%3E%0A");
|
|
4
|
+
--radio-checked-active-svg: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 13 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.210938' y='0.915161' width='12' height='12' rx='6' fill='%23DBCBFF'/%3E%3C/svg%3E%0A");
|
|
5
|
+
--radio-checked-disabled-svg: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 13 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.710938' y='0.915161' width='12' height='12' rx='6' fill='%23EEF1F2'/%3E%3C/svg%3E%0A");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
html[data-theme="dark"] {
|
|
9
|
+
--radio-svg-default: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 13 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.210938' y='0.915161' width='12' height='12' rx='6' fill='%238B57FF'/%3E%3C/svg%3E%0A");
|
|
10
|
+
--radio-checked-hover-svg: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 13 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.210938' y='0.915161' width='12' height='12' rx='6' fill='%236648A7'/%3E%3C/svg%3E%0A");
|
|
11
|
+
--radio-checked-active-svg: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 13 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.210938' y='0.915161' width='12' height='12' rx='6' fill='%23BA9BFF'/%3E%3C/svg%3E%0A");
|
|
12
|
+
--radio-checked-disabled-svg: url("data:image/svg+xml,%3Csvg width='13' height='13' viewBox='0 0 13 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.710938' y='0.915161' width='12' height='12' rx='6' fill='%235B5C6B'/%3E%3C/svg%3E%0A");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$radio-svg-default: var(--radio-svg-default);
|
|
16
|
+
$radio-checked-hover-svg: var(--radio-checked-hover-svg);
|
|
17
|
+
$radio-checked-active-svg: var(--radio-checked-active-svg);
|
|
18
|
+
$radio-checked-disabled-svg: var(--radio-checked-disabled-svg);
|
|
19
|
+
|
|
1
20
|
.RadioListFieldView {
|
|
21
|
+
$root: &;
|
|
22
|
+
|
|
23
|
+
font-family: $font-family-nunito;
|
|
24
|
+
color: $text-color;
|
|
25
|
+
line-height: 24px;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
font-size: $font-size-sm;
|
|
28
|
+
|
|
29
|
+
&__item {
|
|
30
|
+
width: fit-content;
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&__input {
|
|
35
|
+
position: absolute;
|
|
36
|
+
z-index: -1;
|
|
37
|
+
opacity: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&__input + &__label {
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
user-select: none;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//Custom Radio
|
|
48
|
+
&__input + label::before {
|
|
49
|
+
content: "";
|
|
50
|
+
display: inline-block;
|
|
51
|
+
width: 24px;
|
|
52
|
+
height: 24px;
|
|
53
|
+
border-radius: $radius-circle;
|
|
54
|
+
border: 1px solid $border-color;
|
|
55
|
+
margin-right: 8px;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
|
|
58
|
+
background-repeat: no-repeat;
|
|
59
|
+
background-position: center center;
|
|
60
|
+
background-size: 50% 50%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__input + &__label::after {
|
|
64
|
+
content: "";
|
|
65
|
+
width: 26px;
|
|
66
|
+
height: 26px;
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 0;
|
|
69
|
+
left: 0;
|
|
70
|
+
border: 4px solid $primary-light;
|
|
71
|
+
border-radius: $radius-circle;
|
|
72
|
+
pointer-events: none;
|
|
73
|
+
opacity: 0;
|
|
74
|
+
|
|
75
|
+
transform: translate(-11%, -11%);
|
|
76
|
+
|
|
77
|
+
transition: opacity 150ms ease-in-out;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__input:not(:disabled):not(:checked):hover + &__label::before {
|
|
81
|
+
border-color: $border-color-hover;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&__input:not(:disabled):not(:checked):active + &__label::before {
|
|
85
|
+
border-color: $primary;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&__input:not(:disabled):focus + &__label::after {
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&__input:checked + &__label::before {
|
|
93
|
+
background-image: $radio-svg-default;
|
|
94
|
+
border: 1px solid $primary;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&__input:not(:disabled):checked:hover + &__label::before {
|
|
98
|
+
border-color: $primary-dark;
|
|
99
|
+
background-image: $radio-checked-hover-svg;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__input:not(:disabled):checked:active + &__label::before {
|
|
103
|
+
background-image: $radio-checked-active-svg;
|
|
104
|
+
border-color: $primary-light;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&__input:disabled + &__label {
|
|
108
|
+
cursor: not-allowed;
|
|
109
|
+
color: $placeholder-color;
|
|
110
|
+
|
|
111
|
+
&::before {
|
|
112
|
+
cursor: not-allowed;
|
|
113
|
+
background-color: $background-disabled-color;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&__input:disabled:checked + &__label::before {
|
|
118
|
+
cursor: not-allowed;
|
|
119
|
+
|
|
120
|
+
background-color: transparent;
|
|
121
|
+
border-color: $background-disabled-color;
|
|
122
|
+
|
|
123
|
+
background-image: $radio-checked-disabled-svg;
|
|
124
|
+
}
|
|
2
125
|
|
|
3
|
-
|
|
126
|
+
&__item_hasError {
|
|
127
|
+
#{$root}__input:not(:disabled):not(:checked) + #{$root}__label {
|
|
128
|
+
color: $danger;
|
|
129
|
+
|
|
130
|
+
&::before {
|
|
131
|
+
border-color: $danger;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -33,13 +33,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
33
33
|
__setModuleDefault(result, mod);
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
36
39
|
exports.__esModule = true;
|
|
37
40
|
var React = __importStar(require("react"));
|
|
38
41
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
42
|
+
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/content/Icon"));
|
|
39
43
|
function TextFieldView(props) {
|
|
40
44
|
var bem = (0, hooks_1.useBem)('TextFieldView');
|
|
41
|
-
return (React.createElement("
|
|
45
|
+
return (React.createElement("div", { className: bem(bem.block({
|
|
46
|
+
hasErrors: !!props.errors,
|
|
47
|
+
filled: !!props.inputProps.value,
|
|
42
48
|
size: props.size
|
|
43
|
-
}),
|
|
49
|
+
}), props.className) },
|
|
50
|
+
React.createElement("textarea", __assign({ className: bem.element('textarea') }, props.inputProps)),
|
|
51
|
+
props.showClear && (React.createElement(Icon_1["default"], { className: bem.element('clear'), name: "field-close", onClick: props.onClear }))));
|
|
44
52
|
}
|
|
45
53
|
exports["default"] = TextFieldView;
|
|
@@ -1,4 +1,147 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--text-field-disabled-clear-color: #e5e9eb;
|
|
3
|
+
--text-field-active-clear-color: #323232;
|
|
4
|
+
--text-field-background-color: #ffffff;
|
|
5
|
+
--text-field-border-color:
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
html[data-theme="dark"] {
|
|
9
|
+
--text-field-background-color: #414141;
|
|
10
|
+
--text-field-disabled-clear-color: #4e4f57;
|
|
11
|
+
--text-field-active-clear-color: #ffffff;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
$text-field-background-color: var(--text-field-background-color);
|
|
15
|
+
$text-field-disabled-clear-color: var(--text-field-disabled-clear-color);
|
|
16
|
+
$text-field-active-clear-color: var(--text-field-active-clear-color);
|
|
17
|
+
|
|
1
18
|
.TextFieldView {
|
|
2
|
-
|
|
3
|
-
|
|
19
|
+
$root: &;
|
|
20
|
+
|
|
21
|
+
position: relative;
|
|
22
|
+
font-family: $font-family-nunito;
|
|
23
|
+
width: fit-content;
|
|
24
|
+
|
|
25
|
+
&_hasErrors {
|
|
26
|
+
#{$root}__textarea {
|
|
27
|
+
border-color: $danger;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&__clear {
|
|
32
|
+
position: absolute;
|
|
33
|
+
width: 24px;
|
|
34
|
+
height: 24px;
|
|
35
|
+
z-index: 3;
|
|
36
|
+
top: 3%;
|
|
37
|
+
right: 16px;
|
|
38
|
+
|
|
39
|
+
transition: opacity 150ms ease-in-out;
|
|
40
|
+
opacity: 0;
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
|
|
43
|
+
svg {
|
|
44
|
+
path {
|
|
45
|
+
stroke: $background-disabled-color;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:focus {
|
|
50
|
+
outline: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__textarea {
|
|
55
|
+
width: 100%;
|
|
56
|
+
min-width: 240px;
|
|
57
|
+
min-height: 80px;
|
|
58
|
+
height: 80px;
|
|
59
|
+
|
|
60
|
+
border-radius: $radius-small;
|
|
61
|
+
background-color: $text-field-background-color;
|
|
62
|
+
|
|
63
|
+
padding: 5px 40px 8px 8px;
|
|
64
|
+
|
|
65
|
+
font-size: $font-size-sm;
|
|
66
|
+
font-weight: 400;
|
|
67
|
+
line-height: 24px;
|
|
68
|
+
z-index: 2;
|
|
69
|
+
outline: none;
|
|
70
|
+
color: $text-color;
|
|
71
|
+
border-color: $border-color;
|
|
72
|
+
|
|
73
|
+
&::placeholder {
|
|
74
|
+
color: $placeholder-color;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:hover {
|
|
78
|
+
border-color: $border-color-hover;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:focus {
|
|
82
|
+
border: 4px solid $primary-light;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:active {
|
|
86
|
+
border: 1px solid $primary;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&:disabled {
|
|
90
|
+
background-color: $background-disabled-color;
|
|
91
|
+
border: none;
|
|
92
|
+
resize: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:disabled::placeholder {
|
|
96
|
+
color: $placeholder-disabled-color;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&:disabled + #{$root}__clear {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:not(:disabled):focus + #{$root}__clear {
|
|
104
|
+
svg {
|
|
105
|
+
path {
|
|
106
|
+
stroke: $text-field-active-clear-color;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&_size {
|
|
113
|
+
width: 240px;
|
|
114
|
+
&_lg {
|
|
115
|
+
#{$root}__textarea {
|
|
116
|
+
height: 130px;
|
|
117
|
+
min-height: 130px;
|
|
118
|
+
border-radius: $radius-large;
|
|
119
|
+
font-size: $font-size-lg;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&_md {
|
|
124
|
+
#{$root}__textarea {
|
|
125
|
+
height: 100px;
|
|
126
|
+
min-height: 100px;
|
|
127
|
+
border-radius: $radius-large;
|
|
128
|
+
font-size: $font-size-base;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&_sm {
|
|
133
|
+
#{$root}__textarea {
|
|
134
|
+
height: 80px;
|
|
135
|
+
border-radius: $radius-small;
|
|
136
|
+
font-size: $font-size-sm;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&_filled {
|
|
142
|
+
#{$root}__clear {
|
|
143
|
+
opacity: 1;
|
|
144
|
+
pointer-events: all;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
4
147
|
}
|
package/icons/index.js
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M16 8.69275L8 16.6927" stroke="#323232" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M8 8.69275L16 16.6927" stroke="#323232" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="12" cy="8" r="3.25" stroke="#323232" stroke-width="1.5" stroke-linecap="round"/>
|
|
3
|
+
<path d="M6.24684 15.9465C7.45154 14.1154 9.25931 13.5 11.4511 13.5H12.4823C14.6828 13.5 16.5143 14.1468 17.7295 15.9814V15.9814C18.8016 17.6 17.9261 19.5 15.9847 19.5H8.00741C6.07032 19.5 5.18216 17.5648 6.24684 15.9465V15.9465Z" stroke="#323232" stroke-width="1.5" stroke-linecap="round"/>
|
|
4
|
+
</svg>
|