@itcase/forms 1.1.3 → 1.1.4
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.
|
@@ -17,16 +17,9 @@
|
|
|
17
17
|
&_state_error {
|
|
18
18
|
& .select__control {
|
|
19
19
|
border: solid 1px var(--select-error-border);
|
|
20
|
+
&:hover {
|
|
21
|
+
border: solid 1px var(--select-error-border-hover);
|
|
22
|
+
}
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
|
-
|
|
24
|
-
:root {
|
|
25
|
-
--select-background: var(--color-surface-primary);
|
|
26
|
-
--select-background-hover: var(--color-surface-primary-hover);
|
|
27
|
-
--select-success-border: var(--color-success-border-primary);
|
|
28
|
-
--select-success-border-hover: var(--color-surface-border-quaternary);
|
|
29
|
-
--select-error-border: var(--color-error-border-primary);
|
|
30
|
-
--select-focus-background: var(--color-surface-primary);
|
|
31
|
-
--select-focus-border: var(--color-surface-border-quaternary);
|
|
32
|
-
}
|
|
@@ -147,6 +147,24 @@
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
+
.form {
|
|
151
|
+
&_button-position {
|
|
152
|
+
&_bottom {
|
|
153
|
+
flex: 1;
|
|
154
|
+
justify-content: space-between;
|
|
155
|
+
}
|
|
156
|
+
&_sticky {
|
|
157
|
+
position: relative;
|
|
158
|
+
&^^&__button {
|
|
159
|
+
width: 100%;
|
|
160
|
+
position: fixed;
|
|
161
|
+
left: 0;
|
|
162
|
+
bottom: 0;
|
|
163
|
+
z-index: 100;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
150
168
|
.form {
|
|
151
169
|
width: 100%;
|
|
152
170
|
&__wrapper {
|
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -507,28 +507,25 @@ const defaultChoiceProps = {
|
|
|
507
507
|
labelTextColor: 'surfaceTextPrimary',
|
|
508
508
|
labelTextColorDisabled: 'surfaceTextDisabled',
|
|
509
509
|
labelTextSize: 'm',
|
|
510
|
-
// appearance depending on the type of error
|
|
511
|
-
// required
|
|
512
510
|
requiredBorderColor: 'warningBorderPrimary',
|
|
513
|
-
shape: 'rounded'
|
|
514
|
-
size: 'normal'
|
|
511
|
+
shape: 'rounded'
|
|
515
512
|
};
|
|
516
513
|
|
|
517
514
|
const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceField(props) {
|
|
518
515
|
const {
|
|
516
|
+
name,
|
|
517
|
+
initialValue,
|
|
518
|
+
label,
|
|
519
|
+
isDisabled,
|
|
519
520
|
classNameGroupItem,
|
|
520
521
|
fieldProps,
|
|
521
|
-
initialValue,
|
|
522
522
|
inputProps,
|
|
523
|
-
isDisabled,
|
|
524
|
-
isCheckbox,
|
|
525
|
-
isRequired,
|
|
526
|
-
label,
|
|
527
523
|
messageType,
|
|
528
|
-
name,
|
|
529
524
|
options,
|
|
530
525
|
placeholder,
|
|
531
526
|
showMessage,
|
|
527
|
+
isCheckbox,
|
|
528
|
+
isRequired,
|
|
532
529
|
onChange
|
|
533
530
|
} = props;
|
|
534
531
|
const {
|
|
@@ -580,30 +577,30 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
580
577
|
});
|
|
581
578
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
582
579
|
className: clsx__default.default('form-field_type_choice', 'form__item_type_choice', classNameGroupItem),
|
|
580
|
+
label: label,
|
|
583
581
|
errorKey: errorKey,
|
|
584
582
|
errorMessage: errorMessage,
|
|
583
|
+
isErrorState: isErrorState,
|
|
584
|
+
metaError: meta.error,
|
|
585
|
+
isDisabled: isDisabled,
|
|
585
586
|
fieldClassName: "form-choice",
|
|
586
587
|
inputName: input.name,
|
|
587
588
|
inputValue: input.value || [],
|
|
588
|
-
isDisabled: isDisabled,
|
|
589
|
-
isErrorState: isErrorState,
|
|
590
|
-
isRequired: isRequired,
|
|
591
|
-
isValidState: isValidState,
|
|
592
|
-
label: label,
|
|
593
589
|
messageType: messageType,
|
|
594
590
|
metaActive: meta.active,
|
|
595
|
-
|
|
596
|
-
|
|
591
|
+
showMessage: showMessage,
|
|
592
|
+
isRequired: isRequired,
|
|
593
|
+
isValidState: isValidState
|
|
597
594
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Choice.Choice, Object.assign({
|
|
598
|
-
active: activeOption,
|
|
599
595
|
className: clsx__default.default(meta.active && 'form-choice_state_focus', meta.error && meta.touched && `form-choice_state_${errorKey}`),
|
|
600
|
-
inputValue: input.value || [],
|
|
601
|
-
isCheckbox: isCheckbox,
|
|
602
|
-
isDisabled: isDisabled,
|
|
603
|
-
isRequired: isRequired,
|
|
604
596
|
name: input.name,
|
|
597
|
+
isDisabled: isDisabled,
|
|
598
|
+
active: activeOption,
|
|
599
|
+
inputValue: input.value || [],
|
|
605
600
|
options: options,
|
|
606
601
|
placeholder: placeholder,
|
|
602
|
+
isCheckbox: isCheckbox,
|
|
603
|
+
isRequired: isRequired,
|
|
607
604
|
setActiveSegment: setActiveSegment
|
|
608
605
|
}, updatedInputProps)));
|
|
609
606
|
});
|
|
@@ -1945,7 +1942,7 @@ const defaultSelectProps = {
|
|
|
1945
1942
|
noOptionsTextSize: 'm',
|
|
1946
1943
|
optionBorder: 'none',
|
|
1947
1944
|
optionFill: 'surfacePrimary',
|
|
1948
|
-
optionFillHover: '
|
|
1945
|
+
optionFillHover: 'surfaceHover',
|
|
1949
1946
|
optionShape: 'rounded',
|
|
1950
1947
|
optionTextColor: 'surfaceTextPrimary',
|
|
1951
1948
|
optionTextSize: 'm',
|
|
@@ -2332,7 +2329,7 @@ const defaultChipsProps = {
|
|
|
2332
2329
|
fillActive: 'accentPrimary',
|
|
2333
2330
|
fillActiveDisabled: 'surfaceTertiary',
|
|
2334
2331
|
fillActiveHover: 'errorPrimary',
|
|
2335
|
-
fillHover: '
|
|
2332
|
+
fillHover: 'surfaceHover',
|
|
2336
2333
|
iconItemFill: 'surfaceItemPrimary',
|
|
2337
2334
|
iconSize: 14,
|
|
2338
2335
|
indicatorFill: 'accentPrimary',
|
|
@@ -2717,6 +2714,7 @@ const FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalF
|
|
|
2717
2714
|
buttonDirection = 'vertical',
|
|
2718
2715
|
buttonFill,
|
|
2719
2716
|
buttonGap,
|
|
2717
|
+
buttonPosition,
|
|
2720
2718
|
buttonJustifyContent,
|
|
2721
2719
|
buttonPadding,
|
|
2722
2720
|
dataTestId,
|
|
@@ -2783,7 +2781,7 @@ const FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalF
|
|
|
2783
2781
|
modifiedSinceLastSubmit
|
|
2784
2782
|
}) => {
|
|
2785
2783
|
return /*#__PURE__*/React__default.default.createElement("form", {
|
|
2786
|
-
className: clsx__default.default(className, 'form', set && `form_set_${set}`, type && `form_type_${type}`, directionClass, fillClass, shapeClass, elevationClass),
|
|
2784
|
+
className: clsx__default.default(className, 'form', set && `form_set_${set}`, type && `form_type_${type}`, buttonPosition && `form_button-position_${buttonPosition}`, directionClass, fillClass, shapeClass, elevationClass),
|
|
2787
2785
|
name: formName,
|
|
2788
2786
|
autoCapitalize: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2789
2787
|
autoComplete: disableFieldsAutoComplete ? 'off' : undefined,
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -496,28 +496,25 @@ const defaultChoiceProps = {
|
|
|
496
496
|
labelTextColor: 'surfaceTextPrimary',
|
|
497
497
|
labelTextColorDisabled: 'surfaceTextDisabled',
|
|
498
498
|
labelTextSize: 'm',
|
|
499
|
-
// appearance depending on the type of error
|
|
500
|
-
// required
|
|
501
499
|
requiredBorderColor: 'warningBorderPrimary',
|
|
502
|
-
shape: 'rounded'
|
|
503
|
-
size: 'normal'
|
|
500
|
+
shape: 'rounded'
|
|
504
501
|
};
|
|
505
502
|
|
|
506
503
|
const ChoiceField = /*#__PURE__*/React$1.memo(function ChoiceField(props) {
|
|
507
504
|
const {
|
|
505
|
+
name,
|
|
506
|
+
initialValue,
|
|
507
|
+
label,
|
|
508
|
+
isDisabled,
|
|
508
509
|
classNameGroupItem,
|
|
509
510
|
fieldProps,
|
|
510
|
-
initialValue,
|
|
511
511
|
inputProps,
|
|
512
|
-
isDisabled,
|
|
513
|
-
isCheckbox,
|
|
514
|
-
isRequired,
|
|
515
|
-
label,
|
|
516
512
|
messageType,
|
|
517
|
-
name,
|
|
518
513
|
options,
|
|
519
514
|
placeholder,
|
|
520
515
|
showMessage,
|
|
516
|
+
isCheckbox,
|
|
517
|
+
isRequired,
|
|
521
518
|
onChange
|
|
522
519
|
} = props;
|
|
523
520
|
const {
|
|
@@ -569,30 +566,30 @@ const ChoiceField = /*#__PURE__*/React$1.memo(function ChoiceField(props) {
|
|
|
569
566
|
});
|
|
570
567
|
return /*#__PURE__*/React$1.createElement(FieldWrapper, Object.assign({
|
|
571
568
|
className: clsx('form-field_type_choice', 'form__item_type_choice', classNameGroupItem),
|
|
569
|
+
label: label,
|
|
572
570
|
errorKey: errorKey,
|
|
573
571
|
errorMessage: errorMessage,
|
|
572
|
+
isErrorState: isErrorState,
|
|
573
|
+
metaError: meta.error,
|
|
574
|
+
isDisabled: isDisabled,
|
|
574
575
|
fieldClassName: "form-choice",
|
|
575
576
|
inputName: input.name,
|
|
576
577
|
inputValue: input.value || [],
|
|
577
|
-
isDisabled: isDisabled,
|
|
578
|
-
isErrorState: isErrorState,
|
|
579
|
-
isRequired: isRequired,
|
|
580
|
-
isValidState: isValidState,
|
|
581
|
-
label: label,
|
|
582
578
|
messageType: messageType,
|
|
583
579
|
metaActive: meta.active,
|
|
584
|
-
|
|
585
|
-
|
|
580
|
+
showMessage: showMessage,
|
|
581
|
+
isRequired: isRequired,
|
|
582
|
+
isValidState: isValidState
|
|
586
583
|
}, fieldProps), /*#__PURE__*/React$1.createElement(Choice, Object.assign({
|
|
587
|
-
active: activeOption,
|
|
588
584
|
className: clsx(meta.active && 'form-choice_state_focus', meta.error && meta.touched && `form-choice_state_${errorKey}`),
|
|
589
|
-
inputValue: input.value || [],
|
|
590
|
-
isCheckbox: isCheckbox,
|
|
591
|
-
isDisabled: isDisabled,
|
|
592
|
-
isRequired: isRequired,
|
|
593
585
|
name: input.name,
|
|
586
|
+
isDisabled: isDisabled,
|
|
587
|
+
active: activeOption,
|
|
588
|
+
inputValue: input.value || [],
|
|
594
589
|
options: options,
|
|
595
590
|
placeholder: placeholder,
|
|
591
|
+
isCheckbox: isCheckbox,
|
|
592
|
+
isRequired: isRequired,
|
|
596
593
|
setActiveSegment: setActiveSegment
|
|
597
594
|
}, updatedInputProps)));
|
|
598
595
|
});
|
|
@@ -1934,7 +1931,7 @@ const defaultSelectProps = {
|
|
|
1934
1931
|
noOptionsTextSize: 'm',
|
|
1935
1932
|
optionBorder: 'none',
|
|
1936
1933
|
optionFill: 'surfacePrimary',
|
|
1937
|
-
optionFillHover: '
|
|
1934
|
+
optionFillHover: 'surfaceHover',
|
|
1938
1935
|
optionShape: 'rounded',
|
|
1939
1936
|
optionTextColor: 'surfaceTextPrimary',
|
|
1940
1937
|
optionTextSize: 'm',
|
|
@@ -2321,7 +2318,7 @@ const defaultChipsProps = {
|
|
|
2321
2318
|
fillActive: 'accentPrimary',
|
|
2322
2319
|
fillActiveDisabled: 'surfaceTertiary',
|
|
2323
2320
|
fillActiveHover: 'errorPrimary',
|
|
2324
|
-
fillHover: '
|
|
2321
|
+
fillHover: 'surfaceHover',
|
|
2325
2322
|
iconItemFill: 'surfaceItemPrimary',
|
|
2326
2323
|
iconSize: 14,
|
|
2327
2324
|
indicatorFill: 'accentPrimary',
|
|
@@ -2706,6 +2703,7 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2706
2703
|
buttonDirection = 'vertical',
|
|
2707
2704
|
buttonFill,
|
|
2708
2705
|
buttonGap,
|
|
2706
|
+
buttonPosition,
|
|
2709
2707
|
buttonJustifyContent,
|
|
2710
2708
|
buttonPadding,
|
|
2711
2709
|
dataTestId,
|
|
@@ -2772,7 +2770,7 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
|
|
|
2772
2770
|
modifiedSinceLastSubmit
|
|
2773
2771
|
}) => {
|
|
2774
2772
|
return /*#__PURE__*/React$1.createElement("form", {
|
|
2775
|
-
className: clsx(className, 'form', set && `form_set_${set}`, type && `form_type_${type}`, directionClass, fillClass, shapeClass, elevationClass),
|
|
2773
|
+
className: clsx(className, 'form', set && `form_set_${set}`, type && `form_type_${type}`, buttonPosition && `form_button-position_${buttonPosition}`, directionClass, fillClass, shapeClass, elevationClass),
|
|
2776
2774
|
name: formName,
|
|
2777
2775
|
autoCapitalize: disableFieldsAutoComplete ? 'off' : undefined,
|
|
2778
2776
|
autoComplete: disableFieldsAutoComplete ? 'off' : undefined,
|