@itcase/forms 1.1.31 → 1.1.32
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/dist/css/form/Field/Checkbox/FormFieldCheckbox.css +4 -6
- package/dist/css/form/Field/Code/FormFieldCode.css +11 -13
- package/dist/css/form/Field/Switch/FormFieldSwitch.css +8 -28
- package/dist/css/form/Form/Form.css +0 -1
- package/dist/css/form/Form/css/__item/form__item.css +0 -1
- package/dist/css/form/FormField/FormField.css +1 -0
- package/dist/itcase-forms.cjs.js +59 -33
- package/dist/itcase-forms.esm.js +58 -34
- package/package.json +2 -2
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
.form-code {
|
|
2
|
-
position: relative;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
.form-field {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
&-code {
|
|
3
|
+
^&__label {
|
|
4
|
+
text-align: center;
|
|
5
|
+
}
|
|
6
|
+
^&__message {
|
|
7
|
+
text-align: center;
|
|
8
|
+
}
|
|
9
|
+
&^&_size {
|
|
10
|
+
@each $size in xxl, xl, l, m, s, xs, xxs {
|
|
11
|
+
&_$(size) {
|
|
12
|
+
gap: var(--form-filed-code-size-$(size)-gap);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
|
|
19
18
|
.form-field_type_code {
|
|
20
19
|
@each $state in error, success, require, disabled, focus {
|
|
21
20
|
&.form__item_state_$(state) {
|
|
@@ -30,7 +29,6 @@
|
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
|
|
34
32
|
:root {
|
|
35
33
|
--form-filed-code-size-l-gap: 8px;
|
|
36
34
|
}
|
|
@@ -1,36 +1,16 @@
|
|
|
1
1
|
.form-field {
|
|
2
|
-
|
|
2
|
+
&-switch {
|
|
3
3
|
width: 100%;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
& .input {
|
|
11
|
-
border: solid 1px var(--form-switch-$(state)-border);
|
|
12
|
-
&:hover {
|
|
13
|
-
border: solid 1px var(--form-switch-$(state)-border-hover);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
.form-field_type_switch {
|
|
21
|
-
@each $state in error, success, require, disabled, focus {
|
|
22
|
-
&.form__item_state_$(state) {
|
|
23
|
-
& .form-field__label {
|
|
24
|
-
& .text {
|
|
25
|
-
color: var(--form-switch-$(state)-label-color);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
& .form-field__message-item_type-$(state) {
|
|
29
|
-
color: var(--form-switch-$(state)-helptext-color);
|
|
30
|
-
}
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
padding: 12px 0;
|
|
6
|
+
^&__label {
|
|
7
|
+
flex: 1;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
31
10
|
}
|
|
32
11
|
}
|
|
33
12
|
}
|
|
13
|
+
|
|
34
14
|
:root {
|
|
35
15
|
--form-switch-error-border: var(--color-error-border-primary);
|
|
36
16
|
--form-switch-error-border-hover: var(--color-error-border-primary);
|
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -246,6 +246,15 @@ const defaultFieldProps = {
|
|
|
246
246
|
requiredMessageTextColor: 'warningTextSecondary',
|
|
247
247
|
showMessage: true
|
|
248
248
|
};
|
|
249
|
+
const defaultFieldSizeS = {
|
|
250
|
+
size: 's',
|
|
251
|
+
labelTextSize: 's',
|
|
252
|
+
messageTextSize: 's',
|
|
253
|
+
errorMessageTextSize: 's',
|
|
254
|
+
helpTextSize: 's',
|
|
255
|
+
requiredMessageTextSize: 's',
|
|
256
|
+
...defaultFieldProps
|
|
257
|
+
};
|
|
249
258
|
const defaultFieldSizeM = {
|
|
250
259
|
size: 'm',
|
|
251
260
|
labelTextSize: 's',
|
|
@@ -255,6 +264,15 @@ const defaultFieldSizeM = {
|
|
|
255
264
|
requiredMessageTextSize: 's',
|
|
256
265
|
...defaultFieldProps
|
|
257
266
|
};
|
|
267
|
+
const defaultFieldSizeL = {
|
|
268
|
+
size: 'l',
|
|
269
|
+
labelTextSize: 's',
|
|
270
|
+
messageTextSize: 's',
|
|
271
|
+
errorMessageTextSize: 's',
|
|
272
|
+
helpTextSize: 's',
|
|
273
|
+
requiredMessageTextSize: 's',
|
|
274
|
+
...defaultFieldProps
|
|
275
|
+
};
|
|
258
276
|
const defaultFieldSizeXL = {
|
|
259
277
|
size: 'xl',
|
|
260
278
|
labelTextSize: 's',
|
|
@@ -942,29 +960,34 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
|
|
|
942
960
|
|
|
943
961
|
const defaultGroupProps = {
|
|
944
962
|
width: 'fill',
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
963
|
+
labelTextSize: 's',
|
|
964
|
+
messageTextColor: 'surfaceTextPrimary',
|
|
965
|
+
messageTextSize: 's',
|
|
966
|
+
errorMessageTextSize: 's',
|
|
967
|
+
errorMessageTextColor: 'errorTextSecondary',
|
|
968
|
+
helpTextSize: 's',
|
|
969
|
+
requiredMessageTextColor: 'warningTextSecondary',
|
|
970
|
+
requiredMessageTextSize: 's'
|
|
948
971
|
};
|
|
949
972
|
|
|
950
973
|
const FormBlockGroup = /*#__PURE__*/React__default.default.memo(function Group(props) {
|
|
951
974
|
const {
|
|
975
|
+
dataTour,
|
|
952
976
|
className,
|
|
953
977
|
name,
|
|
978
|
+
title,
|
|
979
|
+
titleTextColor,
|
|
980
|
+
titleTextSize,
|
|
981
|
+
titleTextWeight,
|
|
954
982
|
label,
|
|
955
983
|
labelTextColor,
|
|
956
984
|
labelTextSize,
|
|
957
985
|
labelTextWeight,
|
|
958
986
|
message,
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
title,
|
|
962
|
-
titleTextSize,
|
|
963
|
-
titleTextColor,
|
|
964
|
-
titleTextWeight,
|
|
965
|
-
messageTextColor = 'surfaceTextTertiary',
|
|
966
|
-
messageTextSize = 's',
|
|
987
|
+
messageTextColor,
|
|
988
|
+
messageTextSize,
|
|
967
989
|
messageTextWeight,
|
|
990
|
+
column,
|
|
968
991
|
showGroupMessage,
|
|
969
992
|
before,
|
|
970
993
|
after,
|
|
@@ -984,9 +1007,9 @@ const FormBlockGroup = /*#__PURE__*/React__default.default.memo(function Group(p
|
|
|
984
1007
|
* custom React Hook function.
|
|
985
1008
|
*/
|
|
986
1009
|
const {
|
|
987
|
-
isErrorState,
|
|
988
1010
|
errorKey,
|
|
989
|
-
errorMessage
|
|
1011
|
+
errorMessage,
|
|
1012
|
+
isErrorState
|
|
990
1013
|
} = useFieldValidationState({
|
|
991
1014
|
fieldProps: props,
|
|
992
1015
|
// or fieldProps?
|
|
@@ -1017,8 +1040,8 @@ const FormBlockGroup = /*#__PURE__*/React__default.default.memo(function Group(p
|
|
|
1017
1040
|
}, label)), /*#__PURE__*/React__default.default.createElement("div", {
|
|
1018
1041
|
className: "form__group-items"
|
|
1019
1042
|
}, children), after), showGroupMessage && /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, isErrorState && errorMessage && /*#__PURE__*/React__default.default.createElement(Text.Text, {
|
|
1020
|
-
className: `form__group-message form__group-message_type-${errorKey}`,
|
|
1021
1043
|
id: `${name}-error`,
|
|
1044
|
+
className: `form__group-message form__group-message_type-${errorKey}`,
|
|
1022
1045
|
size: updatedProps.messageTextSize,
|
|
1023
1046
|
textColor: updatedProps.messageTextColor,
|
|
1024
1047
|
textWeight: updatedProps.messageTextWeight
|
|
@@ -1035,13 +1058,13 @@ const FormBlockGroup = /*#__PURE__*/React__default.default.memo(function Group(p
|
|
|
1035
1058
|
});
|
|
1036
1059
|
|
|
1037
1060
|
const defaultCheckboxProps = {
|
|
1038
|
-
appearance: 'defaultPrimary
|
|
1061
|
+
appearance: 'defaultPrimary sizeL solid',
|
|
1039
1062
|
width: 'fill',
|
|
1040
1063
|
// useValidationAppearanceInputProps
|
|
1041
1064
|
// Error
|
|
1042
|
-
errorAppearance: 'errorPrimary
|
|
1065
|
+
errorAppearance: 'errorPrimary sizeL solid',
|
|
1043
1066
|
// Required
|
|
1044
|
-
requiredAppearance: 'requirePrimary
|
|
1067
|
+
requiredAppearance: 'requirePrimary sizeL solid'
|
|
1045
1068
|
};
|
|
1046
1069
|
|
|
1047
1070
|
const FormFieldCheckbox = /*#__PURE__*/React__default.default.memo(function FormFieldCheckbox(props) {
|
|
@@ -1092,7 +1115,7 @@ const FormFieldCheckbox = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
1092
1115
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1093
1116
|
});
|
|
1094
1117
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1095
|
-
className: clsx__default.default('form-
|
|
1118
|
+
className: clsx__default.default('form-field-checkbox', 'form__item_checkbox', classNameGroupItem),
|
|
1096
1119
|
errorKey: errorKey,
|
|
1097
1120
|
errorMessage: errorMessage,
|
|
1098
1121
|
isErrorState: isErrorState,
|
|
@@ -1112,6 +1135,7 @@ const FormFieldCheckbox = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
1112
1135
|
isDisabled: isDisabled,
|
|
1113
1136
|
autoComplete: "nope",
|
|
1114
1137
|
checked: input.checked,
|
|
1138
|
+
isActive: input.checked,
|
|
1115
1139
|
onBlur: input.onBlur,
|
|
1116
1140
|
onChange: onChangeField,
|
|
1117
1141
|
onFocus: input.onFocus
|
|
@@ -1193,7 +1217,7 @@ function FormFieldChips(props) {
|
|
|
1193
1217
|
return emptyOptionsList;
|
|
1194
1218
|
}, [input.value]);
|
|
1195
1219
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1196
|
-
className: clsx__default.default('form-
|
|
1220
|
+
className: clsx__default.default('form-field_chips', 'form__item_chips', classNameGroupItem),
|
|
1197
1221
|
errorKey: errorKey,
|
|
1198
1222
|
errorMessage: errorMessage,
|
|
1199
1223
|
isErrorState: isErrorState,
|
|
@@ -1300,8 +1324,9 @@ const FormFieldChoice = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
1300
1324
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1301
1325
|
});
|
|
1302
1326
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1303
|
-
className: clsx__default.default('form-
|
|
1327
|
+
className: clsx__default.default('form-field_choice', 'form__item_choice', classNameGroupItem),
|
|
1304
1328
|
label: label,
|
|
1329
|
+
messageType: messageType,
|
|
1305
1330
|
errorKey: errorKey,
|
|
1306
1331
|
errorMessage: errorMessage,
|
|
1307
1332
|
isErrorState: isErrorState,
|
|
@@ -1310,7 +1335,6 @@ const FormFieldChoice = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
1310
1335
|
fieldClassName: "form-choice",
|
|
1311
1336
|
inputName: input.name,
|
|
1312
1337
|
inputValue: input.value || [],
|
|
1313
|
-
messageType: messageType,
|
|
1314
1338
|
metaActive: meta.active,
|
|
1315
1339
|
showMessage: showMessage,
|
|
1316
1340
|
isRequired: isRequired,
|
|
@@ -1377,7 +1401,7 @@ const FormFieldCode = /*#__PURE__*/React__default.default.memo(function FormFiel
|
|
|
1377
1401
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1378
1402
|
});
|
|
1379
1403
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1380
|
-
className: clsx__default.default('form-
|
|
1404
|
+
className: clsx__default.default('form-field-code', 'form__item_code', classNameGroupItem),
|
|
1381
1405
|
fieldClassName: 'form-code',
|
|
1382
1406
|
inputName: input.name,
|
|
1383
1407
|
inputValue: input.value,
|
|
@@ -1444,7 +1468,7 @@ const FormFieldCustom = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
1444
1468
|
inputProps: props
|
|
1445
1469
|
});
|
|
1446
1470
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1447
|
-
className: clsx__default.default('form-
|
|
1471
|
+
className: clsx__default.default('form-field_custom', 'form__item_custom', classNameGroupItem),
|
|
1448
1472
|
errorKey: errorKey,
|
|
1449
1473
|
errorMessage: errorMessage,
|
|
1450
1474
|
fieldClassName: 'form-custom',
|
|
@@ -1543,7 +1567,7 @@ function FormFieldDatePicker(props) {
|
|
|
1543
1567
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1544
1568
|
});
|
|
1545
1569
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1546
|
-
className: clsx__default.default('form-
|
|
1570
|
+
className: clsx__default.default('form-field_datepicker', 'form__item_datepicker', classNameGroupItem),
|
|
1547
1571
|
errorKey: errorKey,
|
|
1548
1572
|
errorMessage: errorMessage,
|
|
1549
1573
|
isErrorState: isErrorState,
|
|
@@ -1638,7 +1662,7 @@ const FormFieldInput = /*#__PURE__*/React__default.default.memo(function FormFie
|
|
|
1638
1662
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1639
1663
|
});
|
|
1640
1664
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1641
|
-
className: clsx__default.default('form-
|
|
1665
|
+
className: clsx__default.default('form-field_input', 'form__item_input', classNameGroupItem),
|
|
1642
1666
|
errorKey: errorKey,
|
|
1643
1667
|
errorMessage: errorMessage,
|
|
1644
1668
|
isErrorState: isErrorState,
|
|
@@ -1743,7 +1767,7 @@ const FormFieldPassword = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
1743
1767
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1744
1768
|
});
|
|
1745
1769
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1746
|
-
className: clsx__default.default('form-
|
|
1770
|
+
className: clsx__default.default('form-field_input', 'form__item_input', classNameGroupItem),
|
|
1747
1771
|
errorKey: errorKey,
|
|
1748
1772
|
errorMessage: errorMessage,
|
|
1749
1773
|
isErrorState: isErrorState,
|
|
@@ -1842,7 +1866,7 @@ function FormFieldSegmented(props) {
|
|
|
1842
1866
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1843
1867
|
});
|
|
1844
1868
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1845
|
-
className: clsx__default.default('form-
|
|
1869
|
+
className: clsx__default.default('form-field_segmented', 'form__item_segmented'),
|
|
1846
1870
|
errorKey: errorKey,
|
|
1847
1871
|
errorMessage: errorMessage,
|
|
1848
1872
|
isErrorState: isErrorState,
|
|
@@ -1959,7 +1983,7 @@ const FormFieldSelect = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
1959
1983
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1960
1984
|
});
|
|
1961
1985
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
1962
|
-
className: clsx__default.default('form-
|
|
1986
|
+
className: clsx__default.default('form-field_select', 'form__item_select', classNameGroupItem),
|
|
1963
1987
|
errorKey: errorKey,
|
|
1964
1988
|
errorMessage: errorMessage,
|
|
1965
1989
|
isErrorState: isErrorState,
|
|
@@ -2040,7 +2064,7 @@ const FormFieldSwitch = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
2040
2064
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2041
2065
|
});
|
|
2042
2066
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
2043
|
-
className: clsx__default.default('form-
|
|
2067
|
+
className: clsx__default.default('form-field-switch', 'form__item_switch', classNameGroupItem),
|
|
2044
2068
|
errorKey: errorKey,
|
|
2045
2069
|
errorMessage: errorMessage,
|
|
2046
2070
|
isErrorState: isErrorState,
|
|
@@ -2059,7 +2083,7 @@ const FormFieldSwitch = /*#__PURE__*/React__default.default.memo(function FormFi
|
|
|
2059
2083
|
name: input.name,
|
|
2060
2084
|
isDisabled: isDisabled,
|
|
2061
2085
|
autoComplete: "nope",
|
|
2062
|
-
|
|
2086
|
+
isActive: input.checked,
|
|
2063
2087
|
onBlur: input.onBlur,
|
|
2064
2088
|
onChange: onChangeField,
|
|
2065
2089
|
onFocus: input.onFocus
|
|
@@ -2114,7 +2138,7 @@ const FormFieldTextarea = /*#__PURE__*/React__default.default.memo(function Form
|
|
|
2114
2138
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2115
2139
|
});
|
|
2116
2140
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
2117
|
-
className: clsx__default.default('form-
|
|
2141
|
+
className: clsx__default.default('form-field_textarea', 'form__item_textarea', classNameGroupItem),
|
|
2118
2142
|
errorKey: errorKey,
|
|
2119
2143
|
errorMessage: errorMessage,
|
|
2120
2144
|
isErrorState: isErrorState,
|
|
@@ -2206,7 +2230,7 @@ const FormFieldMaskedInput = /*#__PURE__*/React__default.default.memo(function F
|
|
|
2206
2230
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2207
2231
|
});
|
|
2208
2232
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
2209
|
-
className: clsx__default.default('form-
|
|
2233
|
+
className: clsx__default.default('form-field_maskedInput', 'form__item_maskedInput', classNameGroupItem),
|
|
2210
2234
|
errorKey: errorKey,
|
|
2211
2235
|
errorMessage: errorMessage,
|
|
2212
2236
|
isErrorState: isErrorState,
|
|
@@ -2391,7 +2415,7 @@ const RadioGroup = /*#__PURE__*/React__default.default.memo(function RadioGroup(
|
|
|
2391
2415
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2392
2416
|
});
|
|
2393
2417
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
2394
|
-
className: clsx__default.default('form-
|
|
2418
|
+
className: clsx__default.default('form-field_radio', 'form__item_radio"', classNameGroupItem),
|
|
2395
2419
|
errorKey: errorKey,
|
|
2396
2420
|
errorMessage: errorMessage,
|
|
2397
2421
|
isErrorState: isErrorState,
|
|
@@ -3146,7 +3170,9 @@ exports.defaultCodeProps = defaultCodeProps;
|
|
|
3146
3170
|
exports.defaultDatepickerProps = defaultDatepickerProps;
|
|
3147
3171
|
exports.defaultDropzoneProps = defaultDropzoneProps;
|
|
3148
3172
|
exports.defaultFieldProps = defaultFieldProps;
|
|
3173
|
+
exports.defaultFieldSizeL = defaultFieldSizeL;
|
|
3149
3174
|
exports.defaultFieldSizeM = defaultFieldSizeM;
|
|
3175
|
+
exports.defaultFieldSizeS = defaultFieldSizeS;
|
|
3150
3176
|
exports.defaultFieldSizeXL = defaultFieldSizeXL;
|
|
3151
3177
|
exports.defaultGroupProps = defaultGroupProps;
|
|
3152
3178
|
exports.defaultInputProps = defaultInputProps;
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -235,6 +235,15 @@ const defaultFieldProps = {
|
|
|
235
235
|
requiredMessageTextColor: 'warningTextSecondary',
|
|
236
236
|
showMessage: true
|
|
237
237
|
};
|
|
238
|
+
const defaultFieldSizeS = {
|
|
239
|
+
size: 's',
|
|
240
|
+
labelTextSize: 's',
|
|
241
|
+
messageTextSize: 's',
|
|
242
|
+
errorMessageTextSize: 's',
|
|
243
|
+
helpTextSize: 's',
|
|
244
|
+
requiredMessageTextSize: 's',
|
|
245
|
+
...defaultFieldProps
|
|
246
|
+
};
|
|
238
247
|
const defaultFieldSizeM = {
|
|
239
248
|
size: 'm',
|
|
240
249
|
labelTextSize: 's',
|
|
@@ -244,6 +253,15 @@ const defaultFieldSizeM = {
|
|
|
244
253
|
requiredMessageTextSize: 's',
|
|
245
254
|
...defaultFieldProps
|
|
246
255
|
};
|
|
256
|
+
const defaultFieldSizeL = {
|
|
257
|
+
size: 'l',
|
|
258
|
+
labelTextSize: 's',
|
|
259
|
+
messageTextSize: 's',
|
|
260
|
+
errorMessageTextSize: 's',
|
|
261
|
+
helpTextSize: 's',
|
|
262
|
+
requiredMessageTextSize: 's',
|
|
263
|
+
...defaultFieldProps
|
|
264
|
+
};
|
|
247
265
|
const defaultFieldSizeXL = {
|
|
248
266
|
size: 'xl',
|
|
249
267
|
labelTextSize: 's',
|
|
@@ -931,29 +949,34 @@ const FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
931
949
|
|
|
932
950
|
const defaultGroupProps = {
|
|
933
951
|
width: 'fill',
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
952
|
+
labelTextSize: 's',
|
|
953
|
+
messageTextColor: 'surfaceTextPrimary',
|
|
954
|
+
messageTextSize: 's',
|
|
955
|
+
errorMessageTextSize: 's',
|
|
956
|
+
errorMessageTextColor: 'errorTextSecondary',
|
|
957
|
+
helpTextSize: 's',
|
|
958
|
+
requiredMessageTextColor: 'warningTextSecondary',
|
|
959
|
+
requiredMessageTextSize: 's'
|
|
937
960
|
};
|
|
938
961
|
|
|
939
962
|
const FormBlockGroup = /*#__PURE__*/React.memo(function Group(props) {
|
|
940
963
|
const {
|
|
964
|
+
dataTour,
|
|
941
965
|
className,
|
|
942
966
|
name,
|
|
967
|
+
title,
|
|
968
|
+
titleTextColor,
|
|
969
|
+
titleTextSize,
|
|
970
|
+
titleTextWeight,
|
|
943
971
|
label,
|
|
944
972
|
labelTextColor,
|
|
945
973
|
labelTextSize,
|
|
946
974
|
labelTextWeight,
|
|
947
975
|
message,
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
title,
|
|
951
|
-
titleTextSize,
|
|
952
|
-
titleTextColor,
|
|
953
|
-
titleTextWeight,
|
|
954
|
-
messageTextColor = 'surfaceTextTertiary',
|
|
955
|
-
messageTextSize = 's',
|
|
976
|
+
messageTextColor,
|
|
977
|
+
messageTextSize,
|
|
956
978
|
messageTextWeight,
|
|
979
|
+
column,
|
|
957
980
|
showGroupMessage,
|
|
958
981
|
before,
|
|
959
982
|
after,
|
|
@@ -973,9 +996,9 @@ const FormBlockGroup = /*#__PURE__*/React.memo(function Group(props) {
|
|
|
973
996
|
* custom React Hook function.
|
|
974
997
|
*/
|
|
975
998
|
const {
|
|
976
|
-
isErrorState,
|
|
977
999
|
errorKey,
|
|
978
|
-
errorMessage
|
|
1000
|
+
errorMessage,
|
|
1001
|
+
isErrorState
|
|
979
1002
|
} = useFieldValidationState({
|
|
980
1003
|
fieldProps: props,
|
|
981
1004
|
// or fieldProps?
|
|
@@ -1006,8 +1029,8 @@ const FormBlockGroup = /*#__PURE__*/React.memo(function Group(props) {
|
|
|
1006
1029
|
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
1007
1030
|
className: "form__group-items"
|
|
1008
1031
|
}, children), after), showGroupMessage && /*#__PURE__*/React.createElement(React.Fragment, null, isErrorState && errorMessage && /*#__PURE__*/React.createElement(Text, {
|
|
1009
|
-
className: `form__group-message form__group-message_type-${errorKey}`,
|
|
1010
1032
|
id: `${name}-error`,
|
|
1033
|
+
className: `form__group-message form__group-message_type-${errorKey}`,
|
|
1011
1034
|
size: updatedProps.messageTextSize,
|
|
1012
1035
|
textColor: updatedProps.messageTextColor,
|
|
1013
1036
|
textWeight: updatedProps.messageTextWeight
|
|
@@ -1024,13 +1047,13 @@ const FormBlockGroup = /*#__PURE__*/React.memo(function Group(props) {
|
|
|
1024
1047
|
});
|
|
1025
1048
|
|
|
1026
1049
|
const defaultCheckboxProps = {
|
|
1027
|
-
appearance: 'defaultPrimary
|
|
1050
|
+
appearance: 'defaultPrimary sizeL solid',
|
|
1028
1051
|
width: 'fill',
|
|
1029
1052
|
// useValidationAppearanceInputProps
|
|
1030
1053
|
// Error
|
|
1031
|
-
errorAppearance: 'errorPrimary
|
|
1054
|
+
errorAppearance: 'errorPrimary sizeL solid',
|
|
1032
1055
|
// Required
|
|
1033
|
-
requiredAppearance: 'requirePrimary
|
|
1056
|
+
requiredAppearance: 'requirePrimary sizeL solid'
|
|
1034
1057
|
};
|
|
1035
1058
|
|
|
1036
1059
|
const FormFieldCheckbox = /*#__PURE__*/React.memo(function FormFieldCheckbox(props) {
|
|
@@ -1081,7 +1104,7 @@ const FormFieldCheckbox = /*#__PURE__*/React.memo(function FormFieldCheckbox(pro
|
|
|
1081
1104
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1082
1105
|
});
|
|
1083
1106
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1084
|
-
className: clsx('form-
|
|
1107
|
+
className: clsx('form-field-checkbox', 'form__item_checkbox', classNameGroupItem),
|
|
1085
1108
|
errorKey: errorKey,
|
|
1086
1109
|
errorMessage: errorMessage,
|
|
1087
1110
|
isErrorState: isErrorState,
|
|
@@ -1101,6 +1124,7 @@ const FormFieldCheckbox = /*#__PURE__*/React.memo(function FormFieldCheckbox(pro
|
|
|
1101
1124
|
isDisabled: isDisabled,
|
|
1102
1125
|
autoComplete: "nope",
|
|
1103
1126
|
checked: input.checked,
|
|
1127
|
+
isActive: input.checked,
|
|
1104
1128
|
onBlur: input.onBlur,
|
|
1105
1129
|
onChange: onChangeField,
|
|
1106
1130
|
onFocus: input.onFocus
|
|
@@ -1182,7 +1206,7 @@ function FormFieldChips(props) {
|
|
|
1182
1206
|
return emptyOptionsList;
|
|
1183
1207
|
}, [input.value]);
|
|
1184
1208
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1185
|
-
className: clsx('form-
|
|
1209
|
+
className: clsx('form-field_chips', 'form__item_chips', classNameGroupItem),
|
|
1186
1210
|
errorKey: errorKey,
|
|
1187
1211
|
errorMessage: errorMessage,
|
|
1188
1212
|
isErrorState: isErrorState,
|
|
@@ -1289,8 +1313,9 @@ const FormFieldChoice = /*#__PURE__*/React.memo(function FormFieldChoice(props)
|
|
|
1289
1313
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1290
1314
|
});
|
|
1291
1315
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1292
|
-
className: clsx('form-
|
|
1316
|
+
className: clsx('form-field_choice', 'form__item_choice', classNameGroupItem),
|
|
1293
1317
|
label: label,
|
|
1318
|
+
messageType: messageType,
|
|
1294
1319
|
errorKey: errorKey,
|
|
1295
1320
|
errorMessage: errorMessage,
|
|
1296
1321
|
isErrorState: isErrorState,
|
|
@@ -1299,7 +1324,6 @@ const FormFieldChoice = /*#__PURE__*/React.memo(function FormFieldChoice(props)
|
|
|
1299
1324
|
fieldClassName: "form-choice",
|
|
1300
1325
|
inputName: input.name,
|
|
1301
1326
|
inputValue: input.value || [],
|
|
1302
|
-
messageType: messageType,
|
|
1303
1327
|
metaActive: meta.active,
|
|
1304
1328
|
showMessage: showMessage,
|
|
1305
1329
|
isRequired: isRequired,
|
|
@@ -1366,7 +1390,7 @@ const FormFieldCode = /*#__PURE__*/React.memo(function FormFieldCode(props) {
|
|
|
1366
1390
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1367
1391
|
});
|
|
1368
1392
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1369
|
-
className: clsx('form-
|
|
1393
|
+
className: clsx('form-field-code', 'form__item_code', classNameGroupItem),
|
|
1370
1394
|
fieldClassName: 'form-code',
|
|
1371
1395
|
inputName: input.name,
|
|
1372
1396
|
inputValue: input.value,
|
|
@@ -1433,7 +1457,7 @@ const FormFieldCustom = /*#__PURE__*/React.memo(function FormFieldCustom(props)
|
|
|
1433
1457
|
inputProps: props
|
|
1434
1458
|
});
|
|
1435
1459
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1436
|
-
className: clsx('form-
|
|
1460
|
+
className: clsx('form-field_custom', 'form__item_custom', classNameGroupItem),
|
|
1437
1461
|
errorKey: errorKey,
|
|
1438
1462
|
errorMessage: errorMessage,
|
|
1439
1463
|
fieldClassName: 'form-custom',
|
|
@@ -1532,7 +1556,7 @@ function FormFieldDatePicker(props) {
|
|
|
1532
1556
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1533
1557
|
});
|
|
1534
1558
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1535
|
-
className: clsx('form-
|
|
1559
|
+
className: clsx('form-field_datepicker', 'form__item_datepicker', classNameGroupItem),
|
|
1536
1560
|
errorKey: errorKey,
|
|
1537
1561
|
errorMessage: errorMessage,
|
|
1538
1562
|
isErrorState: isErrorState,
|
|
@@ -1627,7 +1651,7 @@ const FormFieldInput = /*#__PURE__*/React.memo(function FormFieldInput(props) {
|
|
|
1627
1651
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1628
1652
|
});
|
|
1629
1653
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1630
|
-
className: clsx('form-
|
|
1654
|
+
className: clsx('form-field_input', 'form__item_input', classNameGroupItem),
|
|
1631
1655
|
errorKey: errorKey,
|
|
1632
1656
|
errorMessage: errorMessage,
|
|
1633
1657
|
isErrorState: isErrorState,
|
|
@@ -1732,7 +1756,7 @@ const FormFieldPassword = /*#__PURE__*/React.memo(function FormFieldPassword(pro
|
|
|
1732
1756
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1733
1757
|
});
|
|
1734
1758
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1735
|
-
className: clsx('form-
|
|
1759
|
+
className: clsx('form-field_input', 'form__item_input', classNameGroupItem),
|
|
1736
1760
|
errorKey: errorKey,
|
|
1737
1761
|
errorMessage: errorMessage,
|
|
1738
1762
|
isErrorState: isErrorState,
|
|
@@ -1831,7 +1855,7 @@ function FormFieldSegmented(props) {
|
|
|
1831
1855
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1832
1856
|
});
|
|
1833
1857
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1834
|
-
className: clsx('form-
|
|
1858
|
+
className: clsx('form-field_segmented', 'form__item_segmented'),
|
|
1835
1859
|
errorKey: errorKey,
|
|
1836
1860
|
errorMessage: errorMessage,
|
|
1837
1861
|
isErrorState: isErrorState,
|
|
@@ -1948,7 +1972,7 @@ const FormFieldSelect = /*#__PURE__*/React.memo(function FormFieldSelect(props)
|
|
|
1948
1972
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
1949
1973
|
});
|
|
1950
1974
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
1951
|
-
className: clsx('form-
|
|
1975
|
+
className: clsx('form-field_select', 'form__item_select', classNameGroupItem),
|
|
1952
1976
|
errorKey: errorKey,
|
|
1953
1977
|
errorMessage: errorMessage,
|
|
1954
1978
|
isErrorState: isErrorState,
|
|
@@ -2029,7 +2053,7 @@ const FormFieldSwitch = /*#__PURE__*/React.memo(function FormFieldSwitch(props)
|
|
|
2029
2053
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2030
2054
|
});
|
|
2031
2055
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2032
|
-
className: clsx('form-
|
|
2056
|
+
className: clsx('form-field-switch', 'form__item_switch', classNameGroupItem),
|
|
2033
2057
|
errorKey: errorKey,
|
|
2034
2058
|
errorMessage: errorMessage,
|
|
2035
2059
|
isErrorState: isErrorState,
|
|
@@ -2048,7 +2072,7 @@ const FormFieldSwitch = /*#__PURE__*/React.memo(function FormFieldSwitch(props)
|
|
|
2048
2072
|
name: input.name,
|
|
2049
2073
|
isDisabled: isDisabled,
|
|
2050
2074
|
autoComplete: "nope",
|
|
2051
|
-
|
|
2075
|
+
isActive: input.checked,
|
|
2052
2076
|
onBlur: input.onBlur,
|
|
2053
2077
|
onChange: onChangeField,
|
|
2054
2078
|
onFocus: input.onFocus
|
|
@@ -2103,7 +2127,7 @@ const FormFieldTextarea = /*#__PURE__*/React.memo(function FormFieldTextarea(pro
|
|
|
2103
2127
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2104
2128
|
});
|
|
2105
2129
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2106
|
-
className: clsx('form-
|
|
2130
|
+
className: clsx('form-field_textarea', 'form__item_textarea', classNameGroupItem),
|
|
2107
2131
|
errorKey: errorKey,
|
|
2108
2132
|
errorMessage: errorMessage,
|
|
2109
2133
|
isErrorState: isErrorState,
|
|
@@ -2195,7 +2219,7 @@ const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInp
|
|
|
2195
2219
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2196
2220
|
});
|
|
2197
2221
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2198
|
-
className: clsx('form-
|
|
2222
|
+
className: clsx('form-field_maskedInput', 'form__item_maskedInput', classNameGroupItem),
|
|
2199
2223
|
errorKey: errorKey,
|
|
2200
2224
|
errorMessage: errorMessage,
|
|
2201
2225
|
isErrorState: isErrorState,
|
|
@@ -2380,7 +2404,7 @@ const RadioGroup = /*#__PURE__*/React.memo(function RadioGroup(props) {
|
|
|
2380
2404
|
validationStateKey: isErrorState ? errorKey : 'success'
|
|
2381
2405
|
});
|
|
2382
2406
|
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
2383
|
-
className: clsx('form-
|
|
2407
|
+
className: clsx('form-field_radio', 'form__item_radio"', classNameGroupItem),
|
|
2384
2408
|
errorKey: errorKey,
|
|
2385
2409
|
errorMessage: errorMessage,
|
|
2386
2410
|
isErrorState: isErrorState,
|
|
@@ -3094,4 +3118,4 @@ const getErrorsForFinalForm = error => {
|
|
|
3094
3118
|
return formErrors;
|
|
3095
3119
|
};
|
|
3096
3120
|
|
|
3097
|
-
export { DEFAULT_MESSAGES_FIELDS, FieldWrapper, FieldWrapperBase, FileInput, FinalForm, FormBlockGroup, FormFieldCheckbox, FormFieldChips, FormFieldChoice, FormFieldCode, FormFieldCustom, FormFieldDatePicker, FormFieldInput, FormFieldMaskedInput, FormFieldPassword, FormFieldSegmented, FormFieldSelect, FormFieldSwitch, FormFieldTextarea, RadioGroup, addRequiredFieldsParamToSchema, dateValidation, defaultCheckboxProps, defaultChipsProps, defaultChoiceProps, defaultCodeProps, defaultDatepickerProps, defaultDropzoneProps, defaultFieldProps, defaultFieldSizeM, defaultFieldSizeXL, defaultGroupProps, defaultInputProps, defaultPasswordProps, defaultRadioProps, defaultSegmentedProps, defaultSelectProps, defaultSwitchProps, defaultTextareaProps, emailValidation, focusOnError, focusOnErrorDecorator, formTypes, generateField, getErrorsForFinalForm, parseNumericField, phoneValidation, sendFormDataToServer, setErrorsMutator, useYupValidationSchema };
|
|
3121
|
+
export { DEFAULT_MESSAGES_FIELDS, FieldWrapper, FieldWrapperBase, FileInput, FinalForm, FormBlockGroup, FormFieldCheckbox, FormFieldChips, FormFieldChoice, FormFieldCode, FormFieldCustom, FormFieldDatePicker, FormFieldInput, FormFieldMaskedInput, FormFieldPassword, FormFieldSegmented, FormFieldSelect, FormFieldSwitch, FormFieldTextarea, RadioGroup, addRequiredFieldsParamToSchema, dateValidation, defaultCheckboxProps, defaultChipsProps, defaultChoiceProps, defaultCodeProps, defaultDatepickerProps, defaultDropzoneProps, defaultFieldProps, defaultFieldSizeL, defaultFieldSizeM, defaultFieldSizeS, defaultFieldSizeXL, defaultGroupProps, defaultInputProps, defaultPasswordProps, defaultRadioProps, defaultSegmentedProps, defaultSelectProps, defaultSwitchProps, defaultTextareaProps, emailValidation, focusOnError, focusOnErrorDecorator, formTypes, generateField, getErrorsForFinalForm, parseNumericField, phoneValidation, sendFormDataToServer, setErrorsMutator, useYupValidationSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/forms",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.32",
|
|
4
4
|
"description": "Forms fields, inputs, etc.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@itcase/storybook-config": "^1.1.77",
|
|
39
39
|
"@itcase/tokens-am": "^1.1.19",
|
|
40
40
|
"@itcase/tokens-baikal": "^1.1.17",
|
|
41
|
-
"@itcase/ui": "^1.8.
|
|
41
|
+
"@itcase/ui": "^1.8.87",
|
|
42
42
|
"axios": "^1.11.0",
|
|
43
43
|
"clsx": "^2.1.1",
|
|
44
44
|
"final-form": "4.20.10",
|