@steroidsjs/bootstrap 3.0.0-beta.3 → 3.0.0-beta.31
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/README.md +1 -2
- package/content/Accordion/AccordionItemView.d.ts +2 -0
- package/content/Accordion/AccordionItemView.js +96 -0
- package/content/Accordion/AccordionItemView.scss +209 -0
- package/content/Accordion/AccordionView.d.ts +2 -0
- package/content/{Collapse/CollapseView.js → Accordion/AccordionView.js} +3 -3
- package/content/{Collapse/CollapseView.scss → Accordion/AccordionView.scss} +3 -4
- package/content/Alert/AlertView.scss +19 -4
- package/content/Avatar/AvatarView.js +2 -3
- package/content/Avatar/AvatarView.scss +29 -36
- package/content/Badge/BadgeView.d.ts +3 -0
- package/content/Badge/BadgeView.js +25 -0
- package/content/Badge/BadgeView.scss +135 -0
- package/content/Calendar/CaptionElement.scss +5 -4
- package/content/Card/CardView.js +34 -14
- package/content/Card/CardView.scss +126 -110
- package/content/Detail/DetailView.scss +75 -52
- package/content/DropDown/DropDownView.js +6 -3
- package/content/DropDown/DropDownView.scss +196 -27
- package/content/Icon/IconView.js +2 -2
- package/form/Button/ButtonView.js +12 -8
- package/form/Button/ButtonView.scss +157 -71
- package/form/CheckboxField/CheckboxFieldView.js +6 -3
- package/form/CheckboxField/CheckboxFieldView.scss +185 -36
- package/form/DropDownField/DropDownFieldView.js +46 -47
- package/form/DropDownField/DropDownFieldView.scss +391 -181
- package/form/DropDownField/views/DropDownItem/DropDownItemView.d.ts +3 -0
- package/form/DropDownField/views/DropDownItem/DropDownItemView.js +80 -0
- package/form/DropDownField/views/DropDownItem/DropDownItemView.scss +217 -0
- package/form/DropDownField/views/DropDownItem/index.d.ts +2 -0
- package/form/DropDownField/views/DropDownItem/index.js +7 -0
- package/form/FieldLayout/FieldLayoutView.js +12 -4
- package/form/FieldLayout/FieldLayoutView.scss +128 -24
- package/form/Form/FormView.js +3 -3
- package/form/Form/FormView.scss +10 -14
- package/form/InputField/InputFieldView.js +32 -13
- package/form/InputField/InputFieldView.scss +245 -99
- package/form/NumberField/NumberFieldView.js +19 -13
- package/form/NumberField/NumberFieldView.scss +195 -89
- package/form/PasswordField/PasswordFieldView.js +11 -9
- package/form/PasswordField/PasswordFieldView.scss +231 -63
- package/form/RadioListField/RadioListFieldView.js +10 -3
- package/form/RadioListField/RadioListFieldView.scss +229 -1
- package/form/TextField/TextFieldView.js +10 -2
- package/form/TextField/TextFieldView.scss +143 -2
- package/icons/index.d.ts +2 -0
- package/{icon/fontawesome.js → icons/index.js} +37 -11
- package/icons/svgs/accordion-chevron.svg +4 -0
- package/icons/svgs/arrow.svg +3 -0
- package/icons/svgs/badge-close.svg +3 -0
- package/icons/svgs/close.svg +4 -0
- package/icons/svgs/crossed-out-eye.svg +5 -0
- package/icons/svgs/default.svg +11 -0
- package/icons/svgs/dots.svg +5 -0
- package/icons/svgs/error.svg +12 -0
- package/icons/svgs/field-close.svg +4 -0
- package/icons/svgs/info.svg +12 -0
- package/icons/svgs/loader.svg +3 -0
- package/icons/svgs/search.svg +4 -0
- package/icons/svgs/success.svg +4 -0
- package/icons/svgs/user.svg +4 -0
- package/icons/svgs/visible-eye.svg +4 -0
- package/icons/svgs/warning.svg +12 -0
- package/index.d.ts +11 -2
- package/index.js +13 -4
- package/index.scss +6 -3
- package/layout/Header/HeaderView.scss +3 -3
- package/layout/Tooltip/TooltipView.js +6 -6
- package/layout/Tooltip/TooltipView.scss +45 -37
- package/list/Grid/GridView.scss +28 -30
- package/nav/Tree/TreeView.scss +14 -11
- package/package.json +56 -56
- package/scss/fonts.scss +6 -0
- package/scss/mixins/button.scss +51 -25
- package/scss/mixins/index.scss +2 -1
- package/scss/mixins/scroll.scss +31 -0
- package/scss/mixins/typography.scss +26 -0
- package/scss/variables/common/colors.scss +87 -67
- package/scss/variables/common/media.scss +2 -0
- package/scss/variables/common/typography.scss +96 -28
- package/scss/variables/components/input.scss +7 -6
- package/scss/variables/index.scss +2 -2
- package/scss/variables/normalize.scss +21 -0
- package/typography/Text/TextView.d.ts +3 -0
- package/typography/Text/TextView.js +46 -0
- package/typography/Text/TextView.scss +16 -0
- package/typography/Title/TitleView.d.ts +3 -0
- package/typography/Title/TitleView.js +50 -0
- package/typography/Title/TitleView.scss +16 -0
- package/content/Collapse/CollapseItemView.d.ts +0 -2
- package/content/Collapse/CollapseItemView.js +0 -65
- package/content/Collapse/CollapseItemView.scss +0 -88
- package/content/Collapse/CollapseView.d.ts +0 -2
- package/content/Icon/IconView.scss +0 -25
- package/icon/fontawesome.d.ts +0 -2
- package/scss/mixins/card.scss +0 -26
- package/scss/variables/components/card.scss +0 -20
|
@@ -1,134 +1,280 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--lead-icon-default-color: #e5e9eb;
|
|
3
|
+
--lead-icon-focus-color: #323232;
|
|
4
|
+
--lead-icon-disabled-color: rgba(0, 0, 0, 0.1);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
html[data-theme="dark"] {
|
|
8
|
+
--lead-icon-default-color: #5b5c6b;
|
|
9
|
+
--lead-icon-focus-color: #ffffff;
|
|
10
|
+
--lead-icon-disabled-color: rgba(255, 255, 255, 0.1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
$lead-icon-default-color: var(--lead-icon-default-color);
|
|
14
|
+
$lead-icon-focus-color: var(--lead-icon-focus-color);
|
|
15
|
+
$lead-icon-disabled-color: var(--lead-icon-disabled-color);
|
|
16
|
+
|
|
1
17
|
.InputFieldView {
|
|
2
|
-
|
|
18
|
+
$root: &;
|
|
3
19
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
border: $input-border;
|
|
9
|
-
border-radius: $input-border-radius;
|
|
20
|
+
position: relative;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-flow: row nowrap;
|
|
23
|
+
align-items: center;
|
|
10
24
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
&
|
|
19
|
-
|
|
25
|
+
height: 34px;
|
|
26
|
+
|
|
27
|
+
color: $text-color;
|
|
28
|
+
font-family: $font-family-nunito;
|
|
29
|
+
font-weight: $font-weight-sm;
|
|
30
|
+
line-height: 24px;
|
|
31
|
+
|
|
32
|
+
&__input-wrapper {
|
|
33
|
+
position: relative;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
20
36
|
}
|
|
21
|
-
}
|
|
22
37
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
box-shadow: 0 0 0 3px $border-typing, 0 0 0 3px $border-typing;
|
|
27
|
-
}
|
|
38
|
+
&__input {
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
28
41
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
box-shadow: 0 0 0 3px $border-typing, 0 0 0 3px $border-typing;
|
|
32
|
-
}
|
|
42
|
+
padding: 0 8px;
|
|
43
|
+
outline: none;
|
|
33
44
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
cursor: not-allowed;
|
|
45
|
+
background-color: $element-background-color;
|
|
46
|
+
border: 1px solid $border-color;
|
|
47
|
+
border-radius: inherit;
|
|
38
48
|
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
&::placeholder {
|
|
50
|
+
color: $placeholder-color;
|
|
51
|
+
font-size: inherit;
|
|
52
|
+
}
|
|
41
53
|
}
|
|
42
54
|
|
|
43
|
-
|
|
44
|
-
|
|
55
|
+
|
|
56
|
+
//Statements
|
|
57
|
+
&::before {
|
|
58
|
+
content: '';
|
|
59
|
+
position: absolute;
|
|
60
|
+
z-index: 2;
|
|
61
|
+
top: 0;
|
|
62
|
+
left: 0;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
opacity: 0;
|
|
68
|
+
transition: opacity 150ms ease-in-out;
|
|
45
69
|
}
|
|
46
|
-
}
|
|
47
70
|
|
|
48
|
-
|
|
71
|
+
&:not(#{$root}_disabled):focus-within::before {
|
|
72
|
+
border: 4px solid $primary-light;
|
|
73
|
+
transform: translateX(-4px) translateY(-4px);
|
|
74
|
+
border-radius: 16px;
|
|
75
|
+
opacity: 1;
|
|
76
|
+
}
|
|
49
77
|
|
|
50
|
-
|
|
78
|
+
&:not(#{$root}_disabled):active {
|
|
79
|
+
#{$root}__input {
|
|
80
|
+
border-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&::before {
|
|
84
|
+
transform: none;
|
|
85
|
+
border: 1px solid $primary;
|
|
86
|
+
opacity: 1;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
51
89
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
90
|
+
&_disabled {
|
|
91
|
+
#{$root}__input {
|
|
92
|
+
background-color: $background-disabled-color;
|
|
93
|
+
border-color: transparent;
|
|
94
|
+
}
|
|
57
95
|
}
|
|
58
|
-
}
|
|
59
96
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
97
|
+
&_hasError {
|
|
98
|
+
#{$root}__input {
|
|
99
|
+
border-color: transparent;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
&::before {
|
|
104
|
+
border: 1px solid $danger;
|
|
105
|
+
border-radius: 16px;
|
|
106
|
+
transform: translateX(-1px) translateY(-1px);
|
|
107
|
+
opacity: 1;
|
|
108
|
+
}
|
|
65
109
|
}
|
|
66
|
-
}
|
|
67
110
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
111
|
+
//Sizes
|
|
112
|
+
&_size {
|
|
113
|
+
&_lg {
|
|
114
|
+
height: $input-height-lg;
|
|
115
|
+
border-radius: $radius-large;
|
|
116
|
+
|
|
117
|
+
#{$root}__input {
|
|
118
|
+
font-size: $font-size-lg;
|
|
119
|
+
border-radius: $radius-large;
|
|
120
|
+
}
|
|
77
121
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
122
|
+
#{$root}__addon-before,
|
|
123
|
+
#{$root}__addon-after {
|
|
124
|
+
padding: 16px;
|
|
125
|
+
}
|
|
126
|
+
#{$root}__text-before,
|
|
127
|
+
#{$root}__text-after {
|
|
128
|
+
padding: 16px 3px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&::before {
|
|
132
|
+
border-radius: $radius-large;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&_md {
|
|
137
|
+
height: $input-height-md;
|
|
138
|
+
border-radius: $radius-large;
|
|
139
|
+
|
|
140
|
+
#{$root}__input {
|
|
141
|
+
border-radius: $radius-large;
|
|
142
|
+
font-size: $font-size-base;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
#{$root}__addon-before,
|
|
146
|
+
#{$root}__addon-after,
|
|
147
|
+
#{$root}__text-before,
|
|
148
|
+
#{$root}__text-after {
|
|
149
|
+
padding: 11px 12px;
|
|
150
|
+
}
|
|
82
151
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
152
|
+
#{$root}__text-before,
|
|
153
|
+
#{$root}__text-after {
|
|
154
|
+
padding: 11px 3px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&::before {
|
|
158
|
+
border-radius: $radius-large;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&_sm {
|
|
163
|
+
height: $input-height-sm;
|
|
164
|
+
border-radius: $radius-small;
|
|
165
|
+
|
|
166
|
+
#{$root}__input {
|
|
167
|
+
font-size: $font-size-sm;
|
|
168
|
+
border-radius: $radius-small;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
#{$root}__addon-before,
|
|
172
|
+
#{$root}__addon-after {
|
|
173
|
+
padding: 5px 8px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
#{$root}__text-before,
|
|
177
|
+
#{$root}__text-after {
|
|
178
|
+
padding: 5px 3px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&::before {
|
|
182
|
+
border-radius: $radius-small;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
86
185
|
}
|
|
87
186
|
|
|
88
|
-
|
|
89
|
-
|
|
187
|
+
//LEAD ICON
|
|
188
|
+
&_hasLeadIcon {
|
|
189
|
+
#{$root}__input {
|
|
190
|
+
padding-left: 40px;
|
|
191
|
+
}
|
|
90
192
|
}
|
|
91
193
|
|
|
92
|
-
|
|
93
|
-
|
|
194
|
+
&__lead-icon {
|
|
195
|
+
width: 24px;
|
|
196
|
+
height: 24px;
|
|
197
|
+
position: absolute;
|
|
198
|
+
top: 50%;
|
|
199
|
+
left: 8px;
|
|
200
|
+
transform: translateY(-50%);
|
|
201
|
+
pointer-events: none;
|
|
202
|
+
outline: none;
|
|
203
|
+
|
|
204
|
+
svg circle,
|
|
205
|
+
path {
|
|
206
|
+
transition: stroke 150ms ease-in-out;
|
|
207
|
+
stroke: $lead-icon-default-color;
|
|
208
|
+
}
|
|
94
209
|
}
|
|
95
|
-
|
|
96
|
-
|
|
210
|
+
|
|
211
|
+
//CLEAR ICON
|
|
212
|
+
&_hasClearIcon {
|
|
213
|
+
#{$root}__input {
|
|
214
|
+
padding-right: 40px;
|
|
215
|
+
}
|
|
97
216
|
}
|
|
98
|
-
}
|
|
99
217
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
218
|
+
&__icon-clear {
|
|
219
|
+
width: 24px;
|
|
220
|
+
height: 24px;
|
|
221
|
+
position: absolute;
|
|
222
|
+
top: 50%;
|
|
223
|
+
right: 8px;
|
|
224
|
+
transform: translateY(-50%);
|
|
225
|
+
|
|
226
|
+
opacity: 0;
|
|
227
|
+
transition: opacity 150ms ease-in-out;
|
|
228
|
+
pointer-events: none;
|
|
104
229
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
230
|
+
&:focus {
|
|
231
|
+
opacity: 1;
|
|
232
|
+
pointer-events: all;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
109
235
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
236
|
+
&_filled {
|
|
237
|
+
#{$root}__icon-clear {
|
|
238
|
+
opacity: 1;
|
|
239
|
+
pointer-events: all;
|
|
240
|
+
cursor: pointer;
|
|
241
|
+
}
|
|
114
242
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
243
|
+
#{$root}__lead-icon {
|
|
244
|
+
svg circle,
|
|
245
|
+
path {
|
|
246
|
+
stroke: $lead-icon-focus-color;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
119
250
|
|
|
251
|
+
&_hasAddonBefore {
|
|
252
|
+
#{$root}__input {
|
|
253
|
+
border-top-left-radius: 0;
|
|
254
|
+
border-bottom-left-radius: 0;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
120
257
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
258
|
+
&_hasAddonAfter {
|
|
259
|
+
#{$root}__input {
|
|
260
|
+
border-top-right-radius: 0;
|
|
261
|
+
border-bottom-right-radius: 0;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
125
264
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
265
|
+
&__addon-before,
|
|
266
|
+
&__addon-after {
|
|
267
|
+
padding: 11px 12px;
|
|
268
|
+
background-color: $background-disabled-color;
|
|
269
|
+
}
|
|
129
270
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
271
|
+
&__addon-before {
|
|
272
|
+
border-top-left-radius: inherit;
|
|
273
|
+
border-bottom-left-radius: inherit;
|
|
274
|
+
}
|
|
133
275
|
|
|
134
|
-
|
|
276
|
+
&__addon-after {
|
|
277
|
+
border-top-right-radius: inherit;
|
|
278
|
+
border-bottom-right-radius: inherit;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
@@ -33,38 +33,44 @@ 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 react_1 = require("react");
|
|
42
|
+
var isNumber_1 = __importDefault(require("lodash-es/isNumber"));
|
|
39
43
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
44
|
+
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/content/Icon"));
|
|
40
45
|
function NumberFieldView(props) {
|
|
46
|
+
var _a;
|
|
41
47
|
// Input ref
|
|
42
48
|
var inputRef = (0, react_1.useRef)(null);
|
|
43
49
|
var onStepUp = (0, react_1.useCallback)(function () {
|
|
44
50
|
inputRef.current.stepUp();
|
|
45
51
|
props.inputProps.onChange(inputRef.current.value);
|
|
46
|
-
}, [
|
|
52
|
+
}, [props.inputProps]);
|
|
47
53
|
var onStepDown = (0, react_1.useCallback)(function () {
|
|
48
54
|
inputRef.current.stepDown();
|
|
49
55
|
props.inputProps.onChange(inputRef.current.value);
|
|
50
|
-
}, [
|
|
56
|
+
}, [props.inputProps]);
|
|
51
57
|
var bem = (0, hooks_1.useBem)('NumberFieldView');
|
|
52
58
|
return (React.createElement("div", { className: bem(bem.block({
|
|
53
|
-
disabled: props.inputProps.disabled
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
disabled: props.inputProps.disabled,
|
|
60
|
+
size: props.size,
|
|
61
|
+
hasErrors: !!props.errors,
|
|
62
|
+
filled: !!((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value)
|
|
63
|
+
}), props.className) },
|
|
64
|
+
React.createElement("input", __assign({ ref: inputRef, className: bem(bem.element('input')) }, props.inputProps, { onChange: function (e) { return props.input.onChange(e.target.value); }, id: props.id })),
|
|
58
65
|
!props.disabled && !props.errors && (React.createElement("div", { className: bem.element('arrows-container') },
|
|
59
66
|
React.createElement("button", { className: bem.element('arrow', {
|
|
60
|
-
disabled: props.inputProps.max && props.inputProps.value >= props.inputProps.max
|
|
67
|
+
disabled: (0, isNumber_1["default"])(props.inputProps.max) && props.inputProps.value >= props.inputProps.max
|
|
61
68
|
}), type: 'button', onClick: onStepUp },
|
|
62
|
-
React.createElement("
|
|
63
|
-
React.createElement("path", { d: 'M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140\n 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1\n 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z' }))),
|
|
69
|
+
React.createElement(Icon_1["default"], { name: 'arrow', tabIndex: -1 })),
|
|
64
70
|
React.createElement("button", { className: bem.element('arrow', {
|
|
65
|
-
disabled: props.inputProps.min && props.inputProps.value <= props.inputProps.min
|
|
71
|
+
disabled: (0, isNumber_1["default"])(props.inputProps.min) && props.inputProps.value <= props.inputProps.min
|
|
66
72
|
}), type: 'button', onClick: onStepDown },
|
|
67
|
-
React.createElement("
|
|
68
|
-
|
|
73
|
+
React.createElement(Icon_1["default"], { name: 'arrow', tabIndex: -1 })))),
|
|
74
|
+
React.createElement("span", { className: bem.element('input-effects') })));
|
|
69
75
|
}
|
|
70
76
|
exports["default"] = NumberFieldView;
|