@itcase/forms 1.1.2 → 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
|
@@ -28,7 +28,6 @@ var Input = require('@itcase/ui/components/Input');
|
|
|
28
28
|
var Radio = require('@itcase/ui/components/Radio');
|
|
29
29
|
var Segmented = require('@itcase/ui/components/Segmented');
|
|
30
30
|
var Select = require('@itcase/ui/components/Select');
|
|
31
|
-
var icons = require('src/icons');
|
|
32
31
|
var Switch = require('@itcase/ui/components/Switch');
|
|
33
32
|
var Textarea = require('@itcase/ui/components/Textarea');
|
|
34
33
|
var reactImask = require('react-imask');
|
|
@@ -508,28 +507,25 @@ const defaultChoiceProps = {
|
|
|
508
507
|
labelTextColor: 'surfaceTextPrimary',
|
|
509
508
|
labelTextColorDisabled: 'surfaceTextDisabled',
|
|
510
509
|
labelTextSize: 'm',
|
|
511
|
-
// appearance depending on the type of error
|
|
512
|
-
// required
|
|
513
510
|
requiredBorderColor: 'warningBorderPrimary',
|
|
514
|
-
shape: 'rounded'
|
|
515
|
-
size: 'normal'
|
|
511
|
+
shape: 'rounded'
|
|
516
512
|
};
|
|
517
513
|
|
|
518
514
|
const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceField(props) {
|
|
519
515
|
const {
|
|
516
|
+
name,
|
|
517
|
+
initialValue,
|
|
518
|
+
label,
|
|
519
|
+
isDisabled,
|
|
520
520
|
classNameGroupItem,
|
|
521
521
|
fieldProps,
|
|
522
|
-
initialValue,
|
|
523
522
|
inputProps,
|
|
524
|
-
isDisabled,
|
|
525
|
-
isCheckbox,
|
|
526
|
-
isRequired,
|
|
527
|
-
label,
|
|
528
523
|
messageType,
|
|
529
|
-
name,
|
|
530
524
|
options,
|
|
531
525
|
placeholder,
|
|
532
526
|
showMessage,
|
|
527
|
+
isCheckbox,
|
|
528
|
+
isRequired,
|
|
533
529
|
onChange
|
|
534
530
|
} = props;
|
|
535
531
|
const {
|
|
@@ -581,30 +577,30 @@ const ChoiceField = /*#__PURE__*/React__default.default.memo(function ChoiceFiel
|
|
|
581
577
|
});
|
|
582
578
|
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
583
579
|
className: clsx__default.default('form-field_type_choice', 'form__item_type_choice', classNameGroupItem),
|
|
580
|
+
label: label,
|
|
584
581
|
errorKey: errorKey,
|
|
585
582
|
errorMessage: errorMessage,
|
|
583
|
+
isErrorState: isErrorState,
|
|
584
|
+
metaError: meta.error,
|
|
585
|
+
isDisabled: isDisabled,
|
|
586
586
|
fieldClassName: "form-choice",
|
|
587
587
|
inputName: input.name,
|
|
588
588
|
inputValue: input.value || [],
|
|
589
|
-
isDisabled: isDisabled,
|
|
590
|
-
isErrorState: isErrorState,
|
|
591
|
-
isRequired: isRequired,
|
|
592
|
-
isValidState: isValidState,
|
|
593
|
-
label: label,
|
|
594
589
|
messageType: messageType,
|
|
595
590
|
metaActive: meta.active,
|
|
596
|
-
|
|
597
|
-
|
|
591
|
+
showMessage: showMessage,
|
|
592
|
+
isRequired: isRequired,
|
|
593
|
+
isValidState: isValidState
|
|
598
594
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Choice.Choice, Object.assign({
|
|
599
|
-
active: activeOption,
|
|
600
595
|
className: clsx__default.default(meta.active && 'form-choice_state_focus', meta.error && meta.touched && `form-choice_state_${errorKey}`),
|
|
601
|
-
inputValue: input.value || [],
|
|
602
|
-
isCheckbox: isCheckbox,
|
|
603
|
-
isDisabled: isDisabled,
|
|
604
|
-
isRequired: isRequired,
|
|
605
596
|
name: input.name,
|
|
597
|
+
isDisabled: isDisabled,
|
|
598
|
+
active: activeOption,
|
|
599
|
+
inputValue: input.value || [],
|
|
606
600
|
options: options,
|
|
607
601
|
placeholder: placeholder,
|
|
602
|
+
isCheckbox: isCheckbox,
|
|
603
|
+
isRequired: isRequired,
|
|
608
604
|
setActiveSegment: setActiveSegment
|
|
609
605
|
}, updatedInputProps)));
|
|
610
606
|
});
|
|
@@ -782,7 +778,7 @@ function DatePickerField(props) {
|
|
|
782
778
|
showMessage,
|
|
783
779
|
onChange
|
|
784
780
|
} = props;
|
|
785
|
-
return /*#__PURE__*/
|
|
781
|
+
return /*#__PURE__*/React__default.default.createElement(reactFinalForm.Field, {
|
|
786
782
|
name: name
|
|
787
783
|
}, function Render({
|
|
788
784
|
input,
|
|
@@ -825,7 +821,7 @@ function DatePickerField(props) {
|
|
|
825
821
|
validationStateKey: isErrorState ? errorKey : 'success',
|
|
826
822
|
inputProps: inputProps
|
|
827
823
|
});
|
|
828
|
-
return /*#__PURE__*/
|
|
824
|
+
return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
|
|
829
825
|
className: clsx__default.default('form-field_type_datepicker', 'form__item_type_datepicker', classNameGroupItem),
|
|
830
826
|
errorKey: errorKey,
|
|
831
827
|
errorMessage: errorMessage,
|
|
@@ -839,7 +835,7 @@ function DatePickerField(props) {
|
|
|
839
835
|
metaActive: meta.active,
|
|
840
836
|
metaError: meta.error,
|
|
841
837
|
showMessage: showMessage
|
|
842
|
-
}, fieldProps), /*#__PURE__*/
|
|
838
|
+
}, fieldProps), /*#__PURE__*/React__default.default.createElement(DatePicker.DatePickerInput, {
|
|
843
839
|
datePickerProps: datePickerProps,
|
|
844
840
|
inputProps: updatedInputProps,
|
|
845
841
|
isDisabled: isDisabled,
|
|
@@ -1899,7 +1895,7 @@ const defaultSelectProps = {
|
|
|
1899
1895
|
badgeAppearance: 'accent',
|
|
1900
1896
|
badgeSize: 'm',
|
|
1901
1897
|
badgeTextSize: 'm',
|
|
1902
|
-
clearIcon:
|
|
1898
|
+
// clearIcon: icon24.Clear,
|
|
1903
1899
|
clearIconFill: 'surfaceItemPrimary',
|
|
1904
1900
|
closeMenuOnSelect: true,
|
|
1905
1901
|
// optionSelected: <Icon iconFill="surfaceItemAccent" SvgImage={icon24.Check} />,
|
|
@@ -1907,7 +1903,7 @@ const defaultSelectProps = {
|
|
|
1907
1903
|
dividerDirection: 'horizontal',
|
|
1908
1904
|
dividerFill: 'surfaceTertiary',
|
|
1909
1905
|
dividerSize: 'xxs',
|
|
1910
|
-
dropdownIcon:
|
|
1906
|
+
// dropdownIcon: icon24.ChevronDownSmall,
|
|
1911
1907
|
dropdownIconFill: 'surfaceItemPrimary',
|
|
1912
1908
|
// error
|
|
1913
1909
|
errorInputBorderColor: 'errorBorderPrimary',
|
|
@@ -1935,7 +1931,8 @@ const defaultSelectProps = {
|
|
|
1935
1931
|
}),
|
|
1936
1932
|
multipleItemFill: 'accentPrimary',
|
|
1937
1933
|
multipleItemFillHover: 'accentPrimaryHover',
|
|
1938
|
-
multipleItemIcon:
|
|
1934
|
+
// multipleItemIcon: icon14.Remove,
|
|
1935
|
+
|
|
1939
1936
|
multipleItemIconFill: 'accentItemPrimary',
|
|
1940
1937
|
multipleItemTextColor: 'accentTextPrimary',
|
|
1941
1938
|
multipleItemTextSize: 'm',
|
|
@@ -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
|
@@ -27,7 +27,6 @@ import { Input } from '@itcase/ui/components/Input';
|
|
|
27
27
|
import { Radio } from '@itcase/ui/components/Radio';
|
|
28
28
|
import { Segmented } from '@itcase/ui/components/Segmented';
|
|
29
29
|
import { Select } from '@itcase/ui/components/Select';
|
|
30
|
-
import { icon14, icon24 } from 'src/icons';
|
|
31
30
|
import { Switch } from '@itcase/ui/components/Switch';
|
|
32
31
|
import { Textarea } from '@itcase/ui/components/Textarea';
|
|
33
32
|
import { useIMask } from 'react-imask';
|
|
@@ -497,28 +496,25 @@ const defaultChoiceProps = {
|
|
|
497
496
|
labelTextColor: 'surfaceTextPrimary',
|
|
498
497
|
labelTextColorDisabled: 'surfaceTextDisabled',
|
|
499
498
|
labelTextSize: 'm',
|
|
500
|
-
// appearance depending on the type of error
|
|
501
|
-
// required
|
|
502
499
|
requiredBorderColor: 'warningBorderPrimary',
|
|
503
|
-
shape: 'rounded'
|
|
504
|
-
size: 'normal'
|
|
500
|
+
shape: 'rounded'
|
|
505
501
|
};
|
|
506
502
|
|
|
507
503
|
const ChoiceField = /*#__PURE__*/React$1.memo(function ChoiceField(props) {
|
|
508
504
|
const {
|
|
505
|
+
name,
|
|
506
|
+
initialValue,
|
|
507
|
+
label,
|
|
508
|
+
isDisabled,
|
|
509
509
|
classNameGroupItem,
|
|
510
510
|
fieldProps,
|
|
511
|
-
initialValue,
|
|
512
511
|
inputProps,
|
|
513
|
-
isDisabled,
|
|
514
|
-
isCheckbox,
|
|
515
|
-
isRequired,
|
|
516
|
-
label,
|
|
517
512
|
messageType,
|
|
518
|
-
name,
|
|
519
513
|
options,
|
|
520
514
|
placeholder,
|
|
521
515
|
showMessage,
|
|
516
|
+
isCheckbox,
|
|
517
|
+
isRequired,
|
|
522
518
|
onChange
|
|
523
519
|
} = props;
|
|
524
520
|
const {
|
|
@@ -570,30 +566,30 @@ const ChoiceField = /*#__PURE__*/React$1.memo(function ChoiceField(props) {
|
|
|
570
566
|
});
|
|
571
567
|
return /*#__PURE__*/React$1.createElement(FieldWrapper, Object.assign({
|
|
572
568
|
className: clsx('form-field_type_choice', 'form__item_type_choice', classNameGroupItem),
|
|
569
|
+
label: label,
|
|
573
570
|
errorKey: errorKey,
|
|
574
571
|
errorMessage: errorMessage,
|
|
572
|
+
isErrorState: isErrorState,
|
|
573
|
+
metaError: meta.error,
|
|
574
|
+
isDisabled: isDisabled,
|
|
575
575
|
fieldClassName: "form-choice",
|
|
576
576
|
inputName: input.name,
|
|
577
577
|
inputValue: input.value || [],
|
|
578
|
-
isDisabled: isDisabled,
|
|
579
|
-
isErrorState: isErrorState,
|
|
580
|
-
isRequired: isRequired,
|
|
581
|
-
isValidState: isValidState,
|
|
582
|
-
label: label,
|
|
583
578
|
messageType: messageType,
|
|
584
579
|
metaActive: meta.active,
|
|
585
|
-
|
|
586
|
-
|
|
580
|
+
showMessage: showMessage,
|
|
581
|
+
isRequired: isRequired,
|
|
582
|
+
isValidState: isValidState
|
|
587
583
|
}, fieldProps), /*#__PURE__*/React$1.createElement(Choice, Object.assign({
|
|
588
|
-
active: activeOption,
|
|
589
584
|
className: clsx(meta.active && 'form-choice_state_focus', meta.error && meta.touched && `form-choice_state_${errorKey}`),
|
|
590
|
-
inputValue: input.value || [],
|
|
591
|
-
isCheckbox: isCheckbox,
|
|
592
|
-
isDisabled: isDisabled,
|
|
593
|
-
isRequired: isRequired,
|
|
594
585
|
name: input.name,
|
|
586
|
+
isDisabled: isDisabled,
|
|
587
|
+
active: activeOption,
|
|
588
|
+
inputValue: input.value || [],
|
|
595
589
|
options: options,
|
|
596
590
|
placeholder: placeholder,
|
|
591
|
+
isCheckbox: isCheckbox,
|
|
592
|
+
isRequired: isRequired,
|
|
597
593
|
setActiveSegment: setActiveSegment
|
|
598
594
|
}, updatedInputProps)));
|
|
599
595
|
});
|
|
@@ -771,7 +767,7 @@ function DatePickerField(props) {
|
|
|
771
767
|
showMessage,
|
|
772
768
|
onChange
|
|
773
769
|
} = props;
|
|
774
|
-
return /*#__PURE__*/React.createElement(Field, {
|
|
770
|
+
return /*#__PURE__*/React$1.createElement(Field, {
|
|
775
771
|
name: name
|
|
776
772
|
}, function Render({
|
|
777
773
|
input,
|
|
@@ -814,7 +810,7 @@ function DatePickerField(props) {
|
|
|
814
810
|
validationStateKey: isErrorState ? errorKey : 'success',
|
|
815
811
|
inputProps: inputProps
|
|
816
812
|
});
|
|
817
|
-
return /*#__PURE__*/React.createElement(FieldWrapper, Object.assign({
|
|
813
|
+
return /*#__PURE__*/React$1.createElement(FieldWrapper, Object.assign({
|
|
818
814
|
className: clsx('form-field_type_datepicker', 'form__item_type_datepicker', classNameGroupItem),
|
|
819
815
|
errorKey: errorKey,
|
|
820
816
|
errorMessage: errorMessage,
|
|
@@ -828,7 +824,7 @@ function DatePickerField(props) {
|
|
|
828
824
|
metaActive: meta.active,
|
|
829
825
|
metaError: meta.error,
|
|
830
826
|
showMessage: showMessage
|
|
831
|
-
}, fieldProps), /*#__PURE__*/React.createElement(DatePickerInput, {
|
|
827
|
+
}, fieldProps), /*#__PURE__*/React$1.createElement(DatePickerInput, {
|
|
832
828
|
datePickerProps: datePickerProps,
|
|
833
829
|
inputProps: updatedInputProps,
|
|
834
830
|
isDisabled: isDisabled,
|
|
@@ -1888,7 +1884,7 @@ const defaultSelectProps = {
|
|
|
1888
1884
|
badgeAppearance: 'accent',
|
|
1889
1885
|
badgeSize: 'm',
|
|
1890
1886
|
badgeTextSize: 'm',
|
|
1891
|
-
clearIcon: icon24.Clear,
|
|
1887
|
+
// clearIcon: icon24.Clear,
|
|
1892
1888
|
clearIconFill: 'surfaceItemPrimary',
|
|
1893
1889
|
closeMenuOnSelect: true,
|
|
1894
1890
|
// optionSelected: <Icon iconFill="surfaceItemAccent" SvgImage={icon24.Check} />,
|
|
@@ -1896,7 +1892,7 @@ const defaultSelectProps = {
|
|
|
1896
1892
|
dividerDirection: 'horizontal',
|
|
1897
1893
|
dividerFill: 'surfaceTertiary',
|
|
1898
1894
|
dividerSize: 'xxs',
|
|
1899
|
-
dropdownIcon: icon24.ChevronDownSmall,
|
|
1895
|
+
// dropdownIcon: icon24.ChevronDownSmall,
|
|
1900
1896
|
dropdownIconFill: 'surfaceItemPrimary',
|
|
1901
1897
|
// error
|
|
1902
1898
|
errorInputBorderColor: 'errorBorderPrimary',
|
|
@@ -1924,7 +1920,8 @@ const defaultSelectProps = {
|
|
|
1924
1920
|
}),
|
|
1925
1921
|
multipleItemFill: 'accentPrimary',
|
|
1926
1922
|
multipleItemFillHover: 'accentPrimaryHover',
|
|
1927
|
-
multipleItemIcon: icon14.Remove,
|
|
1923
|
+
// multipleItemIcon: icon14.Remove,
|
|
1924
|
+
|
|
1928
1925
|
multipleItemIconFill: 'accentItemPrimary',
|
|
1929
1926
|
multipleItemTextColor: 'accentTextPrimary',
|
|
1930
1927
|
multipleItemTextSize: 'm',
|
|
@@ -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,
|