period-ui 0.2.0 → 0.2.1
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/molecules/text-field/text-field.d.ts +4 -2
- package/dist/components/molecules/text-field/text-field.d.ts.map +1 -1
- package/dist/components/molecules/text-field/text-field.js +2 -2
- package/dist/components/molecules/text-field/text-field.js.map +1 -1
- package/dist/containers/form-control/form-control.d.ts.map +1 -1
- package/dist/containers/form-control/form-control.js +1 -1
- package/dist/containers/form-control/form-control.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
1
|
+
import { RefObject, ReactNode } from 'react';
|
|
2
2
|
type InputFieldProps = {
|
|
3
3
|
isRequired?: boolean;
|
|
4
4
|
isDisabled?: boolean;
|
|
5
5
|
value?: any;
|
|
6
|
+
leadingElement?: ReactNode;
|
|
7
|
+
trailingElement?: ReactNode;
|
|
6
8
|
onBlur?: (event?: any) => void;
|
|
7
9
|
onChange?: (event?: any) => void;
|
|
8
10
|
onFocus?: (event?: any) => void;
|
|
@@ -13,6 +15,6 @@ export type TextFieldProps = IntrinsicInputFieldProps & {
|
|
|
13
15
|
ref?: RefObject<any>;
|
|
14
16
|
inputForwardedRef?: RefObject<any>;
|
|
15
17
|
};
|
|
16
|
-
export declare function TextField({ isRequired, isDisabled, type, name, value, placeholder, width, onBlur, onChange, className, }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function TextField({ isRequired, isDisabled, type, name, value, placeholder, width, onBlur, onChange, className, leadingElement, trailingElement, }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export {};
|
|
18
20
|
//# 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":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/text-field/text-field.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI7C,KAAK,eAAe,GAAG;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,wBAAwB,GAAG,eAAe,GAAG,GAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAEjF,MAAM,MAAM,cAAc,GAAG,wBAAwB,GAAG;IACtD,GAAG,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IACrB,iBAAiB,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;CACpC,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,UAAU,EACV,UAAU,EACV,IAAa,EACb,IAAI,EACJ,KAAK,EACL,WAAW,EACX,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,cAAc,EACd,eAAe,GAChB,EAAE,cAAc,2CAkChB"}
|
|
@@ -4,7 +4,7 @@ exports.TextField = TextField;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const tailwind_utils_1 = require("../../../utils/tailwind-utils");
|
|
6
6
|
const components_1 = require("../../../components");
|
|
7
|
-
function TextField({ isRequired, isDisabled, type = 'text', name, value, placeholder, width, onBlur, onChange, className, }) {
|
|
8
|
-
return ((0, jsx_runtime_1.
|
|
7
|
+
function TextField({ isRequired, isDisabled, type = 'text', name, value, placeholder, width, onBlur, onChange, className, leadingElement, trailingElement, }) {
|
|
8
|
+
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', className), children: [leadingElement && (0, jsx_runtime_1.jsx)("div", { className: "flex-shrink-0 pl-4", children: leadingElement }), (0, jsx_runtime_1.jsx)("input", { required: isRequired, disabled: isDisabled, type: type, name: name, value: value, placeholder: placeholder, width: width, onBlur: onBlur, onChange: onChange, className: (0, tailwind_utils_1.tailwind)('flex-grow py-4 bg-transparent text-gray-01', 'focus:outline-none', leadingElement ? 'px-2' : 'px-4', components_1.TextStyle[components_1.TextVariant.BODY]) }), trailingElement && (0, jsx_runtime_1.jsx)("div", { className: "flex-shrink-0 pr-4", children: trailingElement })] }));
|
|
9
9
|
}
|
|
10
10
|
//# 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":";;
|
|
1
|
+
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["../../../../src/components/molecules/text-field/text-field.tsx"],"names":[],"mappings":";;AAwBA,8BA+CC;;AArED,kEAAyD;AACzD,oDAA6D;AAqB7D,SAAgB,SAAS,CAAC,EACxB,UAAU,EACV,UAAU,EACV,IAAI,GAAG,MAAM,EACb,IAAI,EACJ,KAAK,EACL,WAAW,EACX,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,cAAc,EACd,eAAe,GACA;IACf,OAAO,CACL,iCACE,SAAS,EAAE,IAAA,yBAAQ,EACjB,0BAA0B,EAC1B,2CAA2C,EAC3C,oFAAoF,EACpF,+CAA+C,EAC/C,SAAS,CACV,aAEA,cAAc,IAAI,gCAAK,SAAS,EAAC,oBAAoB,YAAE,cAAc,GAAO,EAE7E,kCACE,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,IAAA,yBAAQ,EACjB,4CAA4C,EAC5C,oBAAoB,EACpB,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAChC,sBAAS,CAAC,wBAAW,CAAC,IAAI,CAAC,CAC5B,GACD,EAED,eAAe,IAAI,gCAAK,SAAS,EAAC,oBAAoB,YAAE,eAAe,GAAO,IAC3E,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control.d.ts","sourceRoot":"","sources":["../../../src/containers/form-control/form-control.tsx"],"names":[],"mappings":"
|
|
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;CACzB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,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,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,mBAAmB,KAAK,KAAK,CAAC,YAAY,CAAC;CACrE,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,UAAU,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,UAAuC,EACvC,QAAQ,GACT,EAAE,KAAK,2CAuCP;AAED,YAAY,EAAE,KAAK,IAAI,gBAAgB,EAAE,CAAC"}
|
|
@@ -13,6 +13,6 @@ function FormControl({ isDisabled, isRequired, formName, label, formProps, class
|
|
|
13
13
|
const isTouched = (!formName && !formProps) || formProps?.touched[formName ?? ''];
|
|
14
14
|
const isErrorVisible = errorText && isTouched;
|
|
15
15
|
const isHelperVisible = !isErrorVisible && helperText;
|
|
16
|
-
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, {
|
|
16
|
+
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, { isRequired: isRequired, hideRequiredMark: hideRequiredMark, label: label, optionalLabel: optionalLabel, toolTipProps: toolTipProps })), (0, jsx_runtime_1.jsx)("div", { className: (0, tailwind_utils_1.tailwind)(widthClassName), children: children ? children({ isErrorVisible: !!isErrorVisible }) : 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, { helperText: helperText, color: isDisabled ? __1.TextColors.BLACK_03 : __1.TextColors.BLACK_02 })), isErrorVisible && (0, jsx_runtime_1.jsx)(form_error_1.FormError, { className: "w-full", errorText: errorText })] })] }));
|
|
17
17
|
}
|
|
18
18
|
//# 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":";;AA8BA,kCAsDC;;AAlFD,8BAAmE;AACnE,+DAAsD;AACtD,wDAAoD;AACpD,0DAAsD;AACtD,wDAAoD;AACpD,6DAAgF;AAuBhF,SAAgB,WAAW,CAAC,EAC1B,UAAU,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,GAAG,mCAAc,CAAC,WAAW,EACvC,QAAQ,GACF;IACN,MAAM,cAAc,GAAG,6CAAwB,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,SAAS,GA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