period-ui 0.3.7 → 0.4.0
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/components/atoms/check-box/checkbox-group/checkbox-group.d.ts +5 -1
- package/dist/components/atoms/check-box/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/dist/components/atoms/check-box/checkbox-group/checkbox-group.js +2 -2
- package/dist/components/atoms/check-box/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/atoms/date-picker/date-picker.d.ts +4 -1
- package/dist/components/atoms/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/atoms/date-picker/date-picker.js +2 -2
- package/dist/components/atoms/date-picker/date-picker.js.map +1 -1
- package/dist/components/atoms/radio-button/radio-button-group/radio-button-group.d.ts +5 -1
- package/dist/components/atoms/radio-button/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/dist/components/atoms/radio-button/radio-button-group/radio-button-group.js +2 -2
- package/dist/components/atoms/radio-button/radio-button-group/radio-button-group.js.map +1 -1
- package/dist/components/molecules/form/form-checkbox/form-checkbox.d.ts +1 -1
- package/dist/components/molecules/form/form-checkbox/form-checkbox.d.ts.map +1 -1
- package/dist/components/molecules/form/form-checkbox/form-checkbox.js +2 -3
- package/dist/components/molecules/form/form-checkbox/form-checkbox.js.map +1 -1
- package/dist/components/molecules/form/form-date-picker/form-date-picker.d.ts +1 -1
- package/dist/components/molecules/form/form-date-picker/form-date-picker.d.ts.map +1 -1
- package/dist/components/molecules/form/form-date-picker/form-date-picker.js +24 -20
- package/dist/components/molecules/form/form-date-picker/form-date-picker.js.map +1 -1
- package/dist/components/molecules/form/form-radio-button/form-radio-button.d.ts +1 -1
- package/dist/components/molecules/form/form-radio-button/form-radio-button.d.ts.map +1 -1
- package/dist/components/molecules/form/form-radio-button/form-radio-button.js +2 -3
- package/dist/components/molecules/form/form-radio-button/form-radio-button.js.map +1 -1
- package/dist/components/molecules/form/form-select/form-select.d.ts +1 -1
- package/dist/components/molecules/form/form-select/form-select.d.ts.map +1 -1
- package/dist/components/molecules/form/form-select/form-select.js +6 -10
- package/dist/components/molecules/form/form-select/form-select.js.map +1 -1
- package/dist/components/molecules/form/form-text-field/form-text-field.d.ts +7 -3
- package/dist/components/molecules/form/form-text-field/form-text-field.d.ts.map +1 -1
- package/dist/components/molecules/form/form-text-field/form-text-field.js +16 -12
- package/dist/components/molecules/form/form-text-field/form-text-field.js.map +1 -1
- package/dist/components/molecules/select/select.d.ts +4 -1
- package/dist/components/molecules/select/select.d.ts.map +1 -1
- package/dist/components/molecules/select/select.js +2 -2
- package/dist/components/molecules/select/select.js.map +1 -1
- package/dist/components/molecules/text-field/components/text-field-input.d.ts +3 -5
- package/dist/components/molecules/text-field/components/text-field-input.d.ts.map +1 -1
- package/dist/components/molecules/text-field/components/text-field-input.js +2 -2
- package/dist/components/molecules/text-field/components/text-field-input.js.map +1 -1
- package/dist/components/molecules/text-field/text-field.d.ts +3 -5
- package/dist/components/molecules/text-field/text-field.d.ts.map +1 -1
- package/dist/components/molecules/text-field/text-field.js +1 -1
- package/dist/components/molecules/text-field/text-field.js.map +1 -1
- package/dist/containers/form-control/components/form-error.d.ts +2 -1
- package/dist/containers/form-control/components/form-error.d.ts.map +1 -1
- package/dist/containers/form-control/components/form-error.js +2 -2
- package/dist/containers/form-control/components/form-error.js.map +1 -1
- package/dist/containers/form-control/components/form-helper.d.ts +2 -1
- package/dist/containers/form-control/components/form-helper.d.ts.map +1 -1
- package/dist/containers/form-control/components/form-helper.js +2 -2
- package/dist/containers/form-control/components/form-helper.js.map +1 -1
- package/dist/containers/form-control/components/form-label.d.ts +3 -1
- package/dist/containers/form-control/components/form-label.d.ts.map +1 -1
- package/dist/containers/form-control/components/form-label.js +2 -2
- package/dist/containers/form-control/components/form-label.js.map +1 -1
- package/dist/containers/form-control/form-control.d.ts +7 -1
- package/dist/containers/form-control/form-control.d.ts.map +1 -1
- package/dist/containers/form-control/form-control.js +15 -4
- package/dist/containers/form-control/form-control.js.map +1 -1
- package/dist/index.mjs +7692 -7480
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ const components_1 = require("../../../components");
|
|
|
6
6
|
const tailwind_utils_1 = require("../../../utils/tailwind-utils");
|
|
7
7
|
const select_input_1 = require("./components/select-input");
|
|
8
8
|
const use_select_1 = require("./use-select");
|
|
9
|
-
function Select({ mask, isFixed = true, isDisabled = false, isMultiSelect = false, isErrorVisible, className, emptyLabel, initialInputValue, initialValues, debounceDelay, options, onBlur, onChangeText, onOptionChange, onClick, }) {
|
|
9
|
+
function Select({ id, mask, isFixed = true, isDisabled = false, isMultiSelect = false, isErrorVisible, className, ariaLabelledBy, ariaDescribedBy, emptyLabel, initialInputValue, initialValues, debounceDelay, options, onBlur, onChangeText, onOptionChange, onClick, }) {
|
|
10
10
|
const { isOpen, inputValue, selectedValues, chipsData, filteredOptions, inputRef, handleSearchChange, setIsOpen, } = (0, use_select_1.useSelect)({
|
|
11
11
|
options,
|
|
12
12
|
isMultiSelect,
|
|
@@ -25,7 +25,7 @@ function Select({ mask, isFixed = true, isDisabled = false, isMultiSelect = fals
|
|
|
25
25
|
}
|
|
26
26
|
onClick?.();
|
|
27
27
|
}
|
|
28
|
-
const trigger = ((0, jsx_runtime_1.jsxs)("div", { role: "button", "data-testid": "select-trigger", tabIndex: isDisabled ? -1 : 0, onClick: handleTriggerClick, className: (0, tailwind_utils_1.tailwind)('flex flex-none w-full p-4 justify-start items-center rounded-lg', 'border border-gray-04 bg-white', 'overflow-hidden cursor-pointer', 'hover:border-blue-02', isDisabled
|
|
28
|
+
const trigger = ((0, jsx_runtime_1.jsxs)("div", { id: id, role: "button", "data-testid": "select-trigger", "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": isErrorVisible || undefined, "aria-disabled": isDisabled || undefined, tabIndex: isDisabled ? -1 : 0, onClick: handleTriggerClick, className: (0, tailwind_utils_1.tailwind)('flex flex-none w-full p-4 justify-start items-center rounded-lg', 'border border-gray-04 bg-white', 'overflow-hidden cursor-pointer', 'hover:border-blue-02', isDisabled
|
|
29
29
|
? 'outline-none cursor-not-allowed bg-gray-05 border-gray-04 hover:border-gray-04'
|
|
30
30
|
: 'focus-visible:border-none focus-visible:outline-2 focus-visible:outline-blue-01', isErrorVisible && 'border-red-01', isMultiSelect && 'p-0 pr-4 pl-2 py-2', className), children: [isMultiSelect ? ((0, jsx_runtime_1.jsx)(components_1.ChipList, { data: chipsData, className: "mr-1 w-full max-h-[138px] overflow-y-auto md:overflow-y-auto", lasItemComponent: (0, jsx_runtime_1.jsx)("div", { className: "flex-grow min-w-[20px] basis-[150px]", children: (0, jsx_runtime_1.jsx)(select_input_1.SelectInput, { mask: mask, ref: inputRef, onBlur: onBlur, isDisabled: isDisabled, inputValue: inputValue, className: "h-fit md:h-10 w-full", onInputChange: handleSearchChange }) }) })) : ((0, jsx_runtime_1.jsx)(select_input_1.SelectInput, { mask: mask, ref: inputRef, onBlur: onBlur, isDisabled: isDisabled, className: "h-fit md:h-6 w-full", inputValue: inputValue, onInputChange: handleSearchChange })), (0, jsx_runtime_1.jsx)(components_1.BilloIcon, { icon: isOpen ? components_1.IconSymbol.CARET_UP : components_1.IconSymbol.CARET_DOWN, size: components_1.IconSize.SM, color: isDisabled ? components_1.IconColor.BLUE_03 : components_1.IconColor.BLUE_01, className: "ml-2" })] }));
|
|
31
31
|
return ((0, jsx_runtime_1.jsx)(components_1.DropDownMenu, { isFixed: isFixed, isDisabled: isDisabled, onClose: setIsOpen, isOpen: isOpen, selectedIDs: selectedValues, options: filteredOptions, emptyElement: typeof emptyLabel === 'string' ? ((0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.BODY, className: "flex whitespace-normal bg-white py-2 px-4", children: emptyLabel })) : (emptyLabel), dropDownClassName: "left-0", className: "w-full", children: trigger }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/select.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/select.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { ComponentProps
|
|
2
|
-
export type TextFieldInputProps = Omit<ComponentProps<'input'>, 'disabled' | 'required' | 'ref'
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export type TextFieldInputProps = Omit<ComponentProps<'input'>, 'disabled' | 'required' | 'ref'> & {
|
|
3
3
|
mask?: string;
|
|
4
4
|
isRequired?: boolean;
|
|
5
5
|
isDisabled?: boolean;
|
|
6
|
-
onBlur?: (event?: FocusEvent<HTMLInputElement>) => void;
|
|
7
6
|
};
|
|
8
|
-
export declare const TextFieldInput: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "disabled" | "ref" | "
|
|
7
|
+
export declare const TextFieldInput: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "disabled" | "ref" | "required"> & {
|
|
9
8
|
mask?: string;
|
|
10
9
|
isRequired?: boolean;
|
|
11
10
|
isDisabled?: boolean;
|
|
12
|
-
onBlur?: (event?: FocusEvent<HTMLInputElement>) => void;
|
|
13
11
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
14
12
|
//# sourceMappingURL=text-field-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field-input.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/text-field/components/text-field-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"text-field-input.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/text-field/components/text-field-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA4B,MAAM,OAAO,CAAC;AAKjE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,cAAc,CAAC,OAAO,CAAC,EACvB,UAAU,GAAG,UAAU,GAAG,KAAK,CAChC,GAAG;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,cAAc;WALlB,MAAM;iBACA,OAAO;iBACP,OAAO;oDAsBpB,CAAC"}
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const components_1 = require("../../../../components");
|
|
7
7
|
const tailwind_utils_1 = require("../../../../utils/tailwind-utils");
|
|
8
8
|
const components_2 = require("../../../../components");
|
|
9
|
-
exports.TextFieldInput = (0, react_1.forwardRef)(function TextFieldInput({ mask, isRequired, isDisabled, className,
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(components_1.BaseInput, { ref: ref, mask: mask, required: isRequired, disabled: isDisabled, className: (0, tailwind_utils_1.tailwind)('flex-grow py-4 px-4 bg-transparent text-gray-01', 'focus:outline-none', components_2.TextStyle[components_2.TextVariant.BODY], className),
|
|
9
|
+
exports.TextFieldInput = (0, react_1.forwardRef)(function TextFieldInput({ mask, isRequired, isDisabled, className, ...rest }, ref) {
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(components_1.BaseInput, { ref: ref, mask: mask, required: isRequired, disabled: isDisabled, className: (0, tailwind_utils_1.tailwind)('flex-grow py-4 px-4 bg-transparent text-gray-01', 'focus:outline-none', components_2.TextStyle[components_2.TextVariant.BODY], className), ...rest }));
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=text-field-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field-input.js","sourceRoot":"","sources":["../../../../../src/components/molecules/text-field/components/text-field-input.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"text-field-input.js","sourceRoot":"","sources":["../../../../../src/components/molecules/text-field/components/text-field-input.tsx"],"names":[],"mappings":";;;;AAAA,iCAAiE;AACjE,uDAAmD;AACnD,qEAA4D;AAC5D,uDAAgE;AAWnD,QAAA,cAAc,GAAG,IAAA,kBAAU,EAAC,SAAS,cAAc,CAC9D,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,IAAI,EAAuB,EACzE,GAAmC;IAEnC,OAAO,CACL,uBAAC,sBAAS,IACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,IAAA,yBAAQ,EACjB,iDAAiD,EACjD,oBAAoB,EACpB,sBAAS,CAAC,wBAAW,CAAC,IAAI,CAAC,EAC3B,SAAS,CACV,KACG,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentProps,
|
|
2
|
-
type Props = Omit<ComponentProps<'input'>, 'disabled' | 'required' | 'ref' | 'className'
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
type Props = Omit<ComponentProps<'input'>, 'disabled' | 'required' | 'ref' | 'className'> & {
|
|
3
3
|
isRequired?: boolean;
|
|
4
4
|
isDisabled?: boolean;
|
|
5
5
|
isErrorVisible?: boolean;
|
|
@@ -8,9 +8,8 @@ type Props = Omit<ComponentProps<'input'>, 'disabled' | 'required' | 'ref' | 'cl
|
|
|
8
8
|
trailingElement?: ReactNode;
|
|
9
9
|
className?: string;
|
|
10
10
|
inputClassName?: string;
|
|
11
|
-
onBlur?: (event?: FocusEvent<HTMLInputElement>) => void;
|
|
12
11
|
};
|
|
13
|
-
export declare const TextField: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "disabled" | "ref" | "className" | "
|
|
12
|
+
export declare const TextField: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "disabled" | "ref" | "className" | "required"> & {
|
|
14
13
|
isRequired?: boolean;
|
|
15
14
|
isDisabled?: boolean;
|
|
16
15
|
isErrorVisible?: boolean;
|
|
@@ -19,7 +18,6 @@ export declare const TextField: import("react").ForwardRefExoticComponent<Omit<i
|
|
|
19
18
|
trailingElement?: ReactNode;
|
|
20
19
|
className?: string;
|
|
21
20
|
inputClassName?: string;
|
|
22
|
-
onBlur?: (event?: FocusEvent<HTMLInputElement>) => void;
|
|
23
21
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
24
22
|
export type { Props as TextFieldProps };
|
|
25
23
|
//# sourceMappingURL=text-field.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/text-field/text-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/text-field/text-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA4B,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5E,KAAK,KAAK,GAAG,IAAI,CACf,cAAc,CAAC,OAAO,CAAC,EACvB,UAAU,GAAG,UAAU,GAAG,KAAK,GAAG,WAAW,CAC9C,GAAG;IACF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,SAAS;iBAVP,OAAO;iBACP,OAAO;qBACH,OAAO;WACjB,MAAM;qBACI,SAAS;sBACR,SAAS;gBACf,MAAM;qBACD,MAAM;oDA2CvB,CAAC;AAEH,YAAY,EAAE,KAAK,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -6,6 +6,6 @@ const react_1 = require("react");
|
|
|
6
6
|
const tailwind_utils_1 = require("../../../utils/tailwind-utils");
|
|
7
7
|
const text_field_input_1 = require("./components/text-field-input");
|
|
8
8
|
exports.TextField = (0, react_1.forwardRef)(function TextField({ isRequired, isDisabled, isErrorVisible, mask, leadingElement, trailingElement, className, inputClassName, ...rest }, ref) {
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, tailwind_utils_1.tailwind)('flex items-center w-full', 'border border-gray-04 rounded-lg bg-white', 'hover:border-blue-02 focus-within:border-blue-01 focus-within:hover:border-blue-01', 'focus-within:ring-1 focus-within:ring-blue-01', isErrorVisible && 'border-red-01 focus-within:ring-red-01', className), children: [leadingElement && (0, jsx_runtime_1.jsx)("div", { className: "flex-shrink-0 pl-4 text-gray-01", children: leadingElement }), (0, jsx_runtime_1.jsx)(text_field_input_1.TextFieldInput, { ref: ref, mask: mask, isRequired: isRequired, isDisabled: isDisabled, className: (0, tailwind_utils_1.tailwind)(leadingElement ? 'px-2' : 'px-4', inputClassName), ...rest }), trailingElement && (0, jsx_runtime_1.jsx)("div", { className: "flex-shrink-0 pr-4 text-gray-01", children: trailingElement })] }));
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, tailwind_utils_1.tailwind)('flex items-center w-full', 'border border-gray-04 rounded-lg bg-white', 'hover:border-blue-02 focus-within:border-blue-01 focus-within:hover:border-blue-01', 'focus-within:ring-1 focus-within:ring-blue-01', isErrorVisible && 'border-red-01 focus-within:ring-red-01', className), children: [leadingElement && (0, jsx_runtime_1.jsx)("div", { className: "flex-shrink-0 pl-4 text-gray-01", children: leadingElement }), (0, jsx_runtime_1.jsx)(text_field_input_1.TextFieldInput, { ref: ref, mask: mask, isRequired: isRequired, isDisabled: isDisabled, "aria-invalid": isErrorVisible || undefined, className: (0, tailwind_utils_1.tailwind)(leadingElement ? 'px-2' : 'px-4', inputClassName), ...rest }), trailingElement && (0, jsx_runtime_1.jsx)("div", { className: "flex-shrink-0 pr-4 text-gray-01", children: trailingElement })] }));
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=text-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../../../src/components/molecules/text-field/text-field.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../../../src/components/molecules/text-field/text-field.tsx"],"names":[],"mappings":";;;;AAAA,iCAA4E;AAC5E,kEAAyD;AACzD,oEAA+D;AAgBlD,QAAA,SAAS,GAAG,IAAA,kBAAU,EAAC,SAAS,SAAS,CACpD,EACE,UAAU,EACV,UAAU,EACV,cAAc,EACd,IAAI,EACJ,cAAc,EACd,eAAe,EACf,SAAS,EACT,cAAc,EACd,GAAG,IAAI,EACD,EACR,GAAmC;IAEnC,OAAO,CACL,iCACE,SAAS,EAAE,IAAA,yBAAQ,EACjB,0BAA0B,EAC1B,2CAA2C,EAC3C,oFAAoF,EACpF,+CAA+C,EAC/C,cAAc,IAAI,wCAAwC,EAC1D,SAAS,CACV,aAEA,cAAc,IAAI,gCAAK,SAAS,EAAC,iCAAiC,YAAE,cAAc,GAAO,EAE1F,uBAAC,iCAAc,IACb,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,kBACR,cAAc,IAAI,SAAS,EACzC,SAAS,EAAE,IAAA,yBAAQ,EAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,KACjE,IAAI,GACR,EAED,eAAe,IAAI,gCAAK,SAAS,EAAC,iCAAiC,YAAE,eAAe,GAAO,IACxF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
type FormErrorProps = {
|
|
2
2
|
errorText: string;
|
|
3
3
|
className?: string;
|
|
4
|
+
id?: string;
|
|
4
5
|
};
|
|
5
|
-
export declare function FormError({ errorText, className }: FormErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function FormError({ errorText, className, id }: FormErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=form-error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-error.d.ts","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-error.tsx"],"names":[],"mappings":"AAWA,KAAK,cAAc,GAAG;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"form-error.d.ts","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-error.tsx"],"names":[],"mappings":"AAWA,KAAK,cAAc,GAAG;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,cAAc,2CAcrE"}
|
|
@@ -4,7 +4,7 @@ exports.FormError = FormError;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const components_1 = require("../../../components");
|
|
6
6
|
const tailwind_utils_1 = require("../../../utils/tailwind-utils");
|
|
7
|
-
function FormError({ errorText, className }) {
|
|
8
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, tailwind_utils_1.tailwind)('flex flex-row justify-start items-start', className), children: [(0, jsx_runtime_1.jsx)(components_1.BilloIcon, { icon: components_1.IconSymbol.ALERT_FILLED, size: components_1.IconSize.SM, color: components_1.IconColor.RED_01, className: (0, tailwind_utils_1.tailwind)('mr-1 pt-[2px] md:pt-[5px]') }), (0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.BODY, color: components_1.TextColors.RED, className: "whitespace-normal", children: errorText })] }));
|
|
7
|
+
function FormError({ errorText, className, id }) {
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)("div", { id: id, role: "alert", className: (0, tailwind_utils_1.tailwind)('flex flex-row justify-start items-start', className), children: [(0, jsx_runtime_1.jsx)(components_1.BilloIcon, { icon: components_1.IconSymbol.ALERT_FILLED, size: components_1.IconSize.SM, color: components_1.IconColor.RED_01, className: (0, tailwind_utils_1.tailwind)('mr-1 pt-[2px] md:pt-[5px]') }), (0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.BODY, color: components_1.TextColors.RED, className: "whitespace-normal", children: errorText })] }));
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=form-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-error.js","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-error.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"form-error.js","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-error.tsx"],"names":[],"mappings":";;AAiBA,8BAcC;;AA/BD,oDAQ6B;AAC7B,kEAAyD;AAQzD,SAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAkB;IACpE,OAAO,CACL,iCAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,IAAA,yBAAQ,EAAC,yCAAyC,EAAE,SAAS,CAAC,aACjG,uBAAC,sBAAS,IACR,IAAI,EAAE,uBAAU,CAAC,YAAY,EAC7B,IAAI,EAAE,qBAAQ,CAAC,EAAE,EACjB,KAAK,EAAE,sBAAS,CAAC,MAAM,EACvB,SAAS,EAAE,IAAA,yBAAQ,EAAC,2BAA2B,CAAC,GAChD,EACF,uBAAC,iBAAI,IAAC,OAAO,EAAE,wBAAW,CAAC,IAAI,EAAE,KAAK,EAAE,uBAAU,CAAC,GAAG,EAAE,SAAS,EAAC,mBAAmB,YAClF,SAAS,GACL,IACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -3,7 +3,8 @@ type Props = {
|
|
|
3
3
|
helperText: string;
|
|
4
4
|
color?: TextColors;
|
|
5
5
|
className?: string;
|
|
6
|
+
id?: string;
|
|
6
7
|
};
|
|
7
|
-
export declare function FormHelper({ helperText, className, color }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function FormHelper({ helperText, className, color, id }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=form-helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-helper.d.ts","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-helper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAe,MAAM,qBAAqB,CAAC;AAGpE,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"form-helper.d.ts","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-helper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAe,MAAM,qBAAqB,CAAC;AAGpE,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,KAA2B,EAAE,EAAE,EAAE,EAAE,KAAK,2CAW3F"}
|
|
@@ -4,7 +4,7 @@ exports.FormHelper = FormHelper;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const components_1 = require("../../../components");
|
|
6
6
|
const tailwind_utils_1 = require("../../../utils/tailwind-utils");
|
|
7
|
-
function FormHelper({ helperText, className, color = components_1.TextColors.BLACK_02 }) {
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.HELPER, color: color, className: (0, tailwind_utils_1.tailwind)('whitespace-normal', className), children: helperText }));
|
|
7
|
+
function FormHelper({ helperText, className, color = components_1.TextColors.BLACK_02, id }) {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Text, { id: id, variant: components_1.TextVariant.HELPER, color: color, className: (0, tailwind_utils_1.tailwind)('whitespace-normal', className), children: helperText }));
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=form-helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-helper.js","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-helper.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"form-helper.js","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-helper.tsx"],"names":[],"mappings":";;AAUA,gCAWC;;AArBD,oDAAoE;AACpE,kEAAyD;AASzD,SAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,uBAAU,CAAC,QAAQ,EAAE,EAAE,EAAS;IAC1F,OAAO,CACL,uBAAC,iBAAI,IACH,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,wBAAW,CAAC,MAAM,EAC3B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,IAAA,yBAAQ,EAAC,mBAAmB,EAAE,SAAS,CAAC,YAElD,UAAU,GACN,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -6,7 +6,9 @@ type Props = {
|
|
|
6
6
|
optionalLabel?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
toolTipProps?: ToolTipProps;
|
|
9
|
+
htmlFor?: string;
|
|
10
|
+
id?: string;
|
|
9
11
|
};
|
|
10
|
-
export declare function FormLabel({ isRequired, hideRequiredMark, label, className, optionalLabel, toolTipProps, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function FormLabel({ isRequired, hideRequiredMark, label, className, optionalLabel, toolTipProps, htmlFor, id, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
12
14
|
//# sourceMappingURL=form-label.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-label.d.ts","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-label.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,YAAY,EAEb,MAAM,qBAAqB,CAAC;AAG7B,KAAK,KAAK,GAAG;IACX,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"form-label.d.ts","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-label.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,YAAY,EAEb,MAAM,qBAAqB,CAAC;AAG7B,KAAK,KAAK,GAAG;IACX,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,UAAiB,EACjB,gBAAwB,EACxB,KAAK,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,OAAO,EACP,EAAE,GACH,EAAE,KAAK,2CA2CP"}
|
|
@@ -5,8 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const window_dimensions_utils_1 = require("../../../utils/window-dimensions-utils");
|
|
6
6
|
const components_1 = require("../../../components");
|
|
7
7
|
const tailwind_utils_1 = require("../../../utils/tailwind-utils");
|
|
8
|
-
function FormLabel({ isRequired = true, hideRequiredMark = false, label, className, optionalLabel, toolTipProps, }) {
|
|
8
|
+
function FormLabel({ isRequired = true, hideRequiredMark = false, label, className, optionalLabel, toolTipProps, htmlFor, id, }) {
|
|
9
9
|
const { isMobile } = (0, window_dimensions_utils_1.useWindowDimensions)();
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, tailwind_utils_1.tailwind)('flex flex-row items-center', className), children: [(0, jsx_runtime_1.jsxs)(components_1.Text, { as: "label", htmlFor: htmlFor, id: id, className: "inline", children: [!hideRequiredMark && isRequired && ((0, jsx_runtime_1.jsx)(components_1.Text, { as: "span", "aria-hidden": true, variant: components_1.TextVariant.BODY, color: components_1.TextColors.PURPLE, className: "mr-1 inline", children: '*' })), (0, jsx_runtime_1.jsx)(components_1.Text, { as: "span", variant: components_1.TextVariant.BODY, className: "inline", children: label }), !hideRequiredMark && !isRequired && ((0, jsx_runtime_1.jsx)(components_1.Text, { as: "span", variant: components_1.TextVariant.BODY, color: components_1.TextColors.BLACK_02, className: "ml-1 inline", children: optionalLabel }))] }), toolTipProps && ((0, jsx_runtime_1.jsx)("div", { className: "ml-2", children: (0, jsx_runtime_1.jsx)(components_1.Tooltip, { ...toolTipProps, position: toolTipProps.position ?? components_1.PopOverPosition.RIGHT, toolTipType: isMobile ? components_1.ToolTipType.MODAL : toolTipProps.toolTipType }) }))] }));
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=form-label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-label.js","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-label.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"form-label.js","sourceRoot":"","sources":["../../../../src/containers/form-control/components/form-label.tsx"],"names":[],"mappings":";;AAuBA,8BAoDC;;AA3ED,6EAAsE;AACtE,oDAQ6B;AAC7B,kEAAyD;AAazD,SAAgB,SAAS,CAAC,EACxB,UAAU,GAAG,IAAI,EACjB,gBAAgB,GAAG,KAAK,EACxB,KAAK,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,OAAO,EACP,EAAE,GACI;IACN,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC3C,OAAO,CACL,iCAAK,SAAS,EAAE,IAAA,yBAAQ,EAAC,4BAA4B,EAAE,SAAS,CAAC,aAC/D,wBAAC,iBAAI,IAAC,EAAE,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,QAAQ,aAE1D,CAAC,gBAAgB,IAAI,UAAU,IAAI,CAClC,uBAAC,iBAAI,IACH,EAAE,EAAC,MAAM,uBAET,OAAO,EAAE,wBAAW,CAAC,IAAI,EACzB,KAAK,EAAE,uBAAU,CAAC,MAAM,EACxB,SAAS,EAAC,aAAa,YAEtB,GAAG,GACC,CACR,EAGD,uBAAC,iBAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAE,wBAAW,CAAC,IAAI,EAAE,SAAS,EAAC,QAAQ,YAC1D,KAAK,GACD,EAGN,CAAC,gBAAgB,IAAI,CAAC,UAAU,IAAI,CACnC,uBAAC,iBAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAE,wBAAW,CAAC,IAAI,EAAE,KAAK,EAAE,uBAAU,CAAC,QAAQ,EAAE,SAAS,EAAC,aAAa,YAC3F,aAAa,GACT,CACR,IACI,EAGN,YAAY,IAAI,CACf,gCAAK,SAAS,EAAC,MAAM,YACnB,uBAAC,oBAAO,OACF,YAAY,EAChB,QAAQ,EAAE,YAAY,CAAC,QAAQ,IAAI,4BAAe,CAAC,KAAK,EACxD,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,wBAAW,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,GACpE,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -3,8 +3,13 @@ import { FormRenderProps, ToolTipProps } from '../../';
|
|
|
3
3
|
import { FormInputWidth } from './form-control-types';
|
|
4
4
|
type ChildrenRenderProps = {
|
|
5
5
|
isErrorVisible: boolean;
|
|
6
|
+
inputId: string;
|
|
7
|
+
labelId: string;
|
|
8
|
+
errorId: string;
|
|
9
|
+
describedBy?: string;
|
|
6
10
|
};
|
|
7
11
|
type Props = {
|
|
12
|
+
id?: string;
|
|
8
13
|
isDisabled?: boolean;
|
|
9
14
|
isRequired?: boolean;
|
|
10
15
|
formName?: string;
|
|
@@ -18,8 +23,9 @@ type Props = {
|
|
|
18
23
|
containerClassName?: string;
|
|
19
24
|
formProps?: FormRenderProps<any>;
|
|
20
25
|
toolTipProps?: ToolTipProps;
|
|
26
|
+
associateLabelWithInput?: boolean;
|
|
21
27
|
children?: (renderProps: ChildrenRenderProps) => React.ReactElement;
|
|
22
28
|
};
|
|
23
|
-
export declare function FormControl({ isDisabled, isRequired, formName, label, formProps, className, errorText, helperText, optionalLabel, toolTipProps, hideRequiredMark, containerClassName, inputWidth, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function FormControl({ id, isDisabled, isRequired, formName, label, formProps, className, errorText, helperText, optionalLabel, toolTipProps, hideRequiredMark, containerClassName, associateLabelWithInput, inputWidth, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
24
30
|
export type { Props as FormControlProps };
|
|
25
31
|
//# sourceMappingURL=form-control.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control.d.ts","sourceRoot":"","sources":["../../../src/containers/form-control/form-control.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAc,YAAY,EAAE,MAAM,QAAQ,CAAC;AAKnE,OAAO,EAAE,cAAc,EAA4B,MAAM,sBAAsB,CAAC;AAEhF,KAAK,mBAAmB,GAAG;IACzB,cAAc,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"form-control.d.ts","sourceRoot":"","sources":["../../../src/containers/form-control/form-control.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAc,YAAY,EAAE,MAAM,QAAQ,CAAC;AAKnE,OAAO,EAAE,cAAc,EAA4B,MAAM,sBAAsB,CAAC;AAEhF,KAAK,mBAAmB,GAAG;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,mBAAmB,KAAK,KAAK,CAAC,YAAY,CAAC;CACrE,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,EAAE,EACF,UAAU,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,uBAA8B,EAC9B,UAAuC,EACvC,QAAQ,GACT,EAAE,KAAK,2CAgDP;AAED,YAAY,EAAE,KAAK,IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.FormControl = FormControl;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
5
9
|
const __1 = require("../../");
|
|
6
10
|
const tailwind_utils_1 = require("../../utils/tailwind-utils");
|
|
7
11
|
const form_error_1 = require("./components/form-error");
|
|
8
12
|
const form_helper_1 = require("./components/form-helper");
|
|
9
13
|
const form_label_1 = require("./components/form-label");
|
|
10
14
|
const form_control_types_1 = require("./form-control-types");
|
|
11
|
-
function FormControl({ isDisabled, isRequired, formName, label, formProps, className, errorText, helperText, optionalLabel, toolTipProps, hideRequiredMark, containerClassName, inputWidth = form_control_types_1.FormInputWidth.FOUR_COLUMN, children, }) {
|
|
15
|
+
function FormControl({ id, isDisabled, isRequired, formName, label, formProps, className, errorText, helperText, optionalLabel, toolTipProps, hideRequiredMark, containerClassName, associateLabelWithInput = true, inputWidth = form_control_types_1.FormInputWidth.FOUR_COLUMN, children, }) {
|
|
16
|
+
const generatedId = react_1.default.useId();
|
|
17
|
+
const baseId = id ?? formName ?? generatedId;
|
|
18
|
+
const inputId = `${baseId}-input`;
|
|
19
|
+
const labelId = `${baseId}-label`;
|
|
20
|
+
const errorId = `${baseId}-error`;
|
|
21
|
+
const helperId = `${baseId}-helper`;
|
|
12
22
|
const widthClassName = form_control_types_1.FormInputWidthClassNames[inputWidth];
|
|
13
23
|
const isTouched = (!formName && !formProps) || formProps?.touched[formName ?? ''];
|
|
14
|
-
const isErrorVisible = errorText && isTouched;
|
|
15
|
-
const isHelperVisible = !isErrorVisible && helperText;
|
|
16
|
-
|
|
24
|
+
const isErrorVisible = !!(errorText && isTouched);
|
|
25
|
+
const isHelperVisible = !isErrorVisible && !!helperText;
|
|
26
|
+
const describedBy = isErrorVisible ? errorId : isHelperVisible ? helperId : undefined;
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, tailwind_utils_1.tailwind)('flex flex-col space-y-2 w-full', containerClassName), children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, tailwind_utils_1.tailwind)('flex flex-col space-y-2', widthClassName, className), children: [label && ((0, jsx_runtime_1.jsx)(form_label_1.FormLabel, { htmlFor: associateLabelWithInput ? inputId : undefined, id: labelId, isRequired: isRequired, hideRequiredMark: hideRequiredMark, label: label, optionalLabel: optionalLabel, toolTipProps: toolTipProps })), children ? children({ isErrorVisible, inputId, labelId, errorId, describedBy }) : null] }), (0, jsx_runtime_1.jsxs)("div", { className: (0, tailwind_utils_1.tailwind)({ hidden: !isHelperVisible && !isErrorVisible }), children: [isHelperVisible && ((0, jsx_runtime_1.jsx)(form_helper_1.FormHelper, { id: helperId, helperText: helperText, color: isDisabled ? __1.TextColors.BLACK_03 : __1.TextColors.BLACK_02 })), isErrorVisible && (0, jsx_runtime_1.jsx)(form_error_1.FormError, { id: errorId, className: "w-full", errorText: errorText })] })] }));
|
|
17
28
|
}
|
|
18
29
|
//# sourceMappingURL=form-control.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control.js","sourceRoot":"","sources":["../../../src/containers/form-control/form-control.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-control.js","sourceRoot":"","sources":["../../../src/containers/form-control/form-control.tsx"],"names":[],"mappings":";;;;;AAoCA,kCAiEC;;AApGD,kDAA0B;AAC1B,8BAAmE;AACnE,+DAAsD;AACtD,wDAAoD;AACpD,0DAAsD;AACtD,wDAAoD;AACpD,6DAAgF;AA6BhF,SAAgB,WAAW,CAAC,EAC1B,EAAE,EACF,UAAU,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,GAAG,IAAI,EAC9B,UAAU,GAAG,mCAAc,CAAC,WAAW,EACvC,QAAQ,GACF;IACN,MAAM,WAAW,GAAG,eAAK,CAAC,KAAK,EAAE,CAAC;IAClC,MAAM,MAAM,GAAG,EAAE,IAAI,QAAQ,IAAI,WAAW,CAAC;IAC7C,MAAM,OAAO,GAAG,GAAG,MAAM,QAAQ,CAAC;IAClC,MAAM,OAAO,GAAG,GAAG,MAAM,QAAQ,CAAC;IAClC,MAAM,OAAO,GAAG,GAAG,MAAM,QAAQ,CAAC;IAClC,MAAM,QAAQ,GAAG,GAAG,MAAM,SAAS,CAAC;IAEpC,MAAM,cAAc,GAAG,6CAAwB,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,SAAS,EAAE,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IAClF,MAAM,cAAc,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,CAAC;IAClD,MAAM,eAAe,GAAG,CAAC,cAAc,IAAI,CAAC,CAAC,UAAU,CAAC;IACxD,MAAM,WAAW,GAAG,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAEtF,OAAO,CACL,iCAAK,SAAS,EAAE,IAAA,yBAAQ,EAAC,gCAAgC,EAAE,kBAAkB,CAAC,aAC5E,iCAAK,SAAS,EAAE,IAAA,yBAAQ,EAAC,yBAAyB,EAAE,cAAc,EAAE,SAAS,CAAC,aAE3E,KAAK,IAAI,CACR,uBAAC,sBAAS,IACR,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACtD,EAAE,EAAE,OAAO,EACX,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY,GAC1B,CACH,EAEA,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IACnF,EAEN,iCAAK,SAAS,EAAE,IAAA,yBAAQ,EAAC,EAAE,MAAM,EAAE,CAAC,eAAe,IAAI,CAAC,cAAc,EAAE,CAAC,aAEtE,eAAe,IAAI,CAClB,uBAAC,wBAAU,IACT,EAAE,EAAE,QAAQ,EACZ,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,cAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAU,CAAC,QAAQ,GAC7D,CACH,EAGA,cAAc,IAAI,uBAAC,sBAAS,IAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,QAAQ,EAAC,SAAS,EAAE,SAAS,GAAI,IAClF,IACF,CACP,CAAC;AACJ,CAAC"}
|