period-ui 0.1.11 → 0.1.13
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/billo-icon/billo-icon-types.js +6 -9
- package/dist/components/atoms/billo-icon/billo-icon-types.js.map +1 -1
- package/dist/components/atoms/billo-icon/billo-icon.js +5 -8
- package/dist/components/atoms/billo-icon/billo-icon.js.map +1 -1
- package/dist/components/atoms/billo-icon/index.js +2 -18
- package/dist/components/atoms/billo-icon/index.js.map +1 -1
- package/dist/components/atoms/button/button-types.js +2 -5
- package/dist/components/atoms/button/button-types.js.map +1 -1
- package/dist/components/atoms/button/button.d.ts +1 -1
- package/dist/components/atoms/button/button.d.ts.map +1 -1
- package/dist/components/atoms/button/button.js +8 -11
- package/dist/components/atoms/button/button.js.map +1 -1
- package/dist/components/atoms/button/index.js +2 -18
- package/dist/components/atoms/button/index.js.map +1 -1
- package/dist/components/atoms/check-box/check-box-types.js +3 -6
- package/dist/components/atoms/check-box/check-box-types.js.map +1 -1
- package/dist/components/atoms/check-box/check-box.js +13 -16
- package/dist/components/atoms/check-box/check-box.js.map +1 -1
- package/dist/components/atoms/check-box/index.js +2 -18
- package/dist/components/atoms/check-box/index.js.map +1 -1
- package/dist/components/atoms/chip/chip/chip.js +8 -11
- package/dist/components/atoms/chip/chip/chip.js.map +1 -1
- package/dist/components/atoms/chip/chip/components/clear-button.js +5 -8
- package/dist/components/atoms/chip/chip/components/clear-button.js.map +1 -1
- package/dist/components/atoms/chip/chip/index.js +1 -17
- package/dist/components/atoms/chip/chip/index.js.map +1 -1
- package/dist/components/atoms/chip/chips-list/chips-list.js +5 -8
- package/dist/components/atoms/chip/chips-list/chips-list.js.map +1 -1
- package/dist/components/atoms/chip/chips-list/index.js +1 -17
- package/dist/components/atoms/chip/chips-list/index.js.map +1 -1
- package/dist/components/atoms/drop-down-menu/components/index.js +2 -18
- package/dist/components/atoms/drop-down-menu/components/index.js.map +1 -1
- package/dist/components/atoms/drop-down-menu/components/menu-item-types.js +2 -5
- package/dist/components/atoms/drop-down-menu/components/menu-item-types.js.map +1 -1
- package/dist/components/atoms/drop-down-menu/components/menu-item.js +15 -18
- package/dist/components/atoms/drop-down-menu/components/menu-item.js.map +1 -1
- package/dist/components/atoms/drop-down-menu/drop-down-menu.js +7 -10
- package/dist/components/atoms/drop-down-menu/drop-down-menu.js.map +1 -1
- package/dist/components/atoms/drop-down-menu/index.js +1 -17
- package/dist/components/atoms/drop-down-menu/index.js.map +1 -1
- package/dist/components/atoms/icon-button/icon-button.js +5 -8
- package/dist/components/atoms/icon-button/icon-button.js.map +1 -1
- package/dist/components/atoms/icon-button/index.js +1 -17
- package/dist/components/atoms/icon-button/index.js.map +1 -1
- package/dist/components/atoms/search-bar/components/clear-button.js +5 -8
- package/dist/components/atoms/search-bar/components/clear-button.js.map +1 -1
- package/dist/components/atoms/search-bar/index.js +1 -17
- package/dist/components/atoms/search-bar/index.js.map +1 -1
- package/dist/components/atoms/search-bar/search-bar.js +9 -12
- package/dist/components/atoms/search-bar/search-bar.js.map +1 -1
- package/dist/components/atoms/text/index.js +2 -18
- package/dist/components/atoms/text/index.js.map +1 -1
- package/dist/components/atoms/text/text-types.js +5 -8
- package/dist/components/atoms/text/text-types.js.map +1 -1
- package/dist/components/atoms/text/text.d.ts +1 -1
- package/dist/components/atoms/text/text.d.ts.map +1 -1
- package/dist/components/atoms/text/text.js +12 -15
- package/dist/components/atoms/text/text.js.map +1 -1
- package/dist/components/atoms/text-button/index.js +2 -18
- package/dist/components/atoms/text-button/index.js.map +1 -1
- package/dist/components/atoms/text-button/text-button-types.js +3 -6
- package/dist/components/atoms/text-button/text-button-types.js.map +1 -1
- package/dist/components/atoms/text-button/text-button.js +9 -12
- package/dist/components/atoms/text-button/text-button.js.map +1 -1
- package/dist/components/index.js +15 -31
- package/dist/components/index.js.map +1 -1
- package/dist/components/molecules/form/form-select/form-select.js +5 -8
- package/dist/components/molecules/form/form-select/form-select.js.map +1 -1
- package/dist/components/molecules/form/form-select/index.js +1 -17
- package/dist/components/molecules/form/form-select/index.js.map +1 -1
- package/dist/components/molecules/form/form-story-stubs.js +1 -4
- package/dist/components/molecules/form/form-story-stubs.js.map +1 -1
- package/dist/components/molecules/form/form-test-stubs.js +1 -4
- package/dist/components/molecules/form/form-test-stubs.js.map +1 -1
- package/dist/components/molecules/form/form-text-field/form-text-field.js +5 -8
- package/dist/components/molecules/form/form-text-field/form-text-field.js.map +1 -1
- package/dist/components/molecules/form/form-text-field/index.js +1 -17
- package/dist/components/molecules/form/form-text-field/index.js.map +1 -1
- package/dist/components/molecules/form/form-types.js +1 -2
- package/dist/components/molecules/form/form.js +8 -34
- package/dist/components/molecules/form/form.js.map +1 -1
- package/dist/components/molecules/form/index.js +2 -18
- package/dist/components/molecules/form/index.js.map +1 -1
- package/dist/components/molecules/select/components/select-input.js +6 -9
- package/dist/components/molecules/select/components/select-input.js.map +1 -1
- package/dist/components/molecules/select/index.js +2 -18
- package/dist/components/molecules/select/index.js.map +1 -1
- package/dist/components/molecules/select/select.js +10 -13
- package/dist/components/molecules/select/select.js.map +1 -1
- package/dist/components/molecules/select/use-select.js +16 -19
- package/dist/components/molecules/select/use-select.js.map +1 -1
- package/dist/components/molecules/text-field/index.js +1 -17
- package/dist/components/molecules/text-field/index.js.map +1 -1
- package/dist/components/molecules/text-field/text-field.js +5 -8
- package/dist/components/molecules/text-field/text-field.js.map +1 -1
- package/dist/containers/form-control/components/form-error.js +5 -8
- package/dist/containers/form-control/components/form-error.js.map +1 -1
- package/dist/containers/form-control/components/form-helper.js +5 -8
- package/dist/containers/form-control/components/form-helper.js.map +1 -1
- package/dist/containers/form-control/components/form-label.js +5 -8
- package/dist/containers/form-control/components/form-label.js.map +1 -1
- package/dist/containers/form-control/form-control-types.js +3 -6
- package/dist/containers/form-control/form-control-types.js.map +1 -1
- package/dist/containers/form-control/form-control.js +10 -13
- package/dist/containers/form-control/form-control.js.map +1 -1
- package/dist/containers/form-control/index.js +2 -18
- package/dist/containers/form-control/index.js.map +1 -1
- package/dist/containers/index.js +1 -17
- package/dist/containers/index.js.map +1 -1
- package/dist/index.js +2 -28
- package/dist/index.js.map +1 -1
- package/dist/utils/string-utils/string-utils.js +1 -4
- package/dist/utils/string-utils/string-utils.js.map +1 -1
- package/dist/utils/tailwind-utils.js +4 -10
- package/dist/utils/tailwind-utils.js.map +1 -1
- package/dist/utils/window-dimensions-utils.js +5 -8
- package/dist/utils/window-dimensions-utils.js.map +1 -1
- package/dist/vitest.setup.js +1 -2
- package/package.json +8 -4
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-test-stubs.js","sourceRoot":"","sources":["../../../../src/components/molecules/form/form-test-stubs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-test-stubs.js","sourceRoot":"","sources":["../../../../src/components/molecules/form/form-test-stubs.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,aAAa,GAAoC;IAE5D,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACpB,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;IACX,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,IAAI;IACb,YAAY,EAAE,KAAK;IACnB,oBAAoB,EAAE,KAAK;IAC3B,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,CAAC;IACd,KAAK,EAAE,KAAK;IACZ,aAAa,EAAE,EAAE;IACjB,cAAc,EAAE,EAAE;IAClB,aAAa,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IAC3B,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE;IACtB,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE;IAGxB,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE;IAClB,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE;IACtB,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE;IACxB,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE;IACtB,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE;IAClB,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE;IACtB,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE;IACnB,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE;IAClB,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE;IAClB,YAAY,EAAE,EAAE,CAAC,EAAE,EAAE;IACrB,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE;IACtB,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE;IACnB,cAAc,EAAE,EAAE,CAAC,EAAE,EAAE;IACvB,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE;IACtB,YAAY,EAAE,EAAE,CAAC,EAAE,EAAE;IACrB,eAAe,EAAE,EAAE,CAAC,EAAE,EAAE;IAGxB,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE;IACnB,YAAY,EAAE,EAAE,CAAC,EAAE,EAAE;IACrB,WAAW,EAAE,EAAE,CAAC,EAAE,EAAE;IACpB,YAAY,EAAE,EAAE,CAAC,EAAE,EAAE;CACtB,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const components_1 = require("../../../../components");
|
|
7
|
-
function FormTextField({ formControlClassName, ...props }) {
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)(containers_1.FormControl, { ...props, errorText: props.errorText || props.formProps.errors[props.formName], className: formControlClassName, children: () => (0, jsx_runtime_1.jsx)(components_1.TextField, { ...props }) }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl } from '../../../../containers';
|
|
3
|
+
import { TextField } from '../../../../components';
|
|
4
|
+
export function FormTextField({ formControlClassName, ...props }) {
|
|
5
|
+
return (_jsx(FormControl, { ...props, errorText: props.errorText || props.formProps.errors[props.formName], className: formControlClassName, children: () => _jsx(TextField, { ...props }) }));
|
|
9
6
|
}
|
|
10
7
|
//# sourceMappingURL=form-text-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-text-field.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-text-field/form-text-field.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-text-field.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-text-field/form-text-field.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAkB,MAAM,wBAAwB,CAAC;AAOnE,MAAM,UAAU,aAAa,CAAC,EAAE,oBAAoB,EAAE,GAAG,KAAK,EAAsB;IAClF,OAAO,CACL,KAAC,WAAW,OACN,KAAK,EACT,SAAS,EAAE,KAAK,CAAC,SAAS,IAAK,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,QAAS,CAAwB,EAC7F,SAAS,EAAE,oBAAoB,YAE9B,GAAG,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,GAAI,GACnB,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./form-text-field"), exports);
|
|
1
|
+
export * from './form-text-field';
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-text-field/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-text-field/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,41 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Form = Form;
|
|
27
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
-
const yup = __importStar(require("yup"));
|
|
29
|
-
const formik_1 = require("formik");
|
|
30
|
-
const tailwind_utils_1 = require("../../../utils/tailwind-utils");
|
|
31
|
-
function Form({ id, config, className, children, }) {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
import { Formik } from 'formik';
|
|
4
|
+
import { tailwind } from '../../../utils/tailwind-utils';
|
|
5
|
+
export function Form({ id, config, className, children, }) {
|
|
32
6
|
const { names, initialValues, validationSchema, onSubmit } = config;
|
|
33
|
-
return ((
|
|
7
|
+
return (_jsx(Formik, { initialValues: initialValues, validationSchema: validationSchema && yup.object(validationSchema), onSubmit: onSubmit, children: (formikProps) => {
|
|
34
8
|
const submitButtonDisabled = !formikProps.dirty || !formikProps.isValid || formikProps.isSubmitting;
|
|
35
|
-
return ((
|
|
9
|
+
return (_jsx("form", { id: id, role: "form", onSubmit: (event) => {
|
|
36
10
|
event.preventDefault();
|
|
37
11
|
formikProps.handleSubmit();
|
|
38
|
-
}, className:
|
|
12
|
+
}, className: tailwind(className), children: children({
|
|
39
13
|
...formikProps,
|
|
40
14
|
submitButtonDisabled,
|
|
41
15
|
}, names) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../../src/components/molecules/form/form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../../src/components/molecules/form/form.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,MAAM,EAA6B,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AA2BzD,MAAM,UAAU,IAAI,CAAsC,EACxD,EAAE,EACF,MAAM,EACN,SAAS,EACT,QAAQ,GACkB;IAC1B,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAEpE,OAAO,CACL,KAAC,MAAM,IACL,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,IAAI,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAClE,QAAQ,EAAE,QAAQ,YAEjB,CAAC,WAAwC,EAAsB,EAAE;YAChE,MAAM,oBAAoB,GACxB,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,WAAW,CAAC,YAAY,CAAC;YAEzE,OAAO,CACL,eACE,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAClB,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,WAAW,CAAC,YAAY,EAAE,CAAC;gBAC7B,CAAC,EACD,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,YAE7B,QAAQ,CACP;oBACE,GAAG,WAAW;oBACd,oBAAoB;iBACrB,EACD,KAAK,CACN,GACI,CACR,CAAC;QACJ,CAAC,GACM,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./form"), exports);
|
|
18
|
-
__exportStar(require("./form-types"), exports);
|
|
1
|
+
export * from './form';
|
|
2
|
+
export * from './form-types';
|
|
19
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/molecules/form/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/molecules/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
exports.SelectInput = (0, react_1.forwardRef)(function SelectInput({ className, inputValue, isDisabled = false, handleInputChange }, ref) {
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)("input", { ref: ref, type: "text", disabled: isDisabled, value: inputValue, onChange: (e) => handleInputChange(e.target.value), className: (0, tailwind_utils_1.tailwind)('w-full bg-transparent outline-none cursor-pointer', 'text-gray-01', 'disabled:text-gray-03 disabled:cursor-not-allowed', `${components_1.TextStyle[components_1.TextVariant.BODY]}`, className) }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TextStyle, TextVariant } from '../../../../components';
|
|
3
|
+
import { tailwind } from '../../../../utils/tailwind-utils';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
export const SelectInput = forwardRef(function SelectInput({ className, inputValue, isDisabled = false, handleInputChange }, ref) {
|
|
6
|
+
return (_jsx("input", { ref: ref, type: "text", disabled: isDisabled, value: inputValue, onChange: (e) => handleInputChange(e.target.value), className: tailwind('w-full bg-transparent outline-none cursor-pointer', 'text-gray-01', 'disabled:text-gray-03 disabled:cursor-not-allowed', `${TextStyle[TextVariant.BODY]}`, className) }));
|
|
10
7
|
});
|
|
11
8
|
//# sourceMappingURL=select-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-input.js","sourceRoot":"","sources":["../../../../../src/components/molecules/select/components/select-input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select-input.js","sourceRoot":"","sources":["../../../../../src/components/molecules/select/components/select-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAC;AASjD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,SAAS,WAAW,CACxD,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,GAAG,KAAK,EAAE,iBAAiB,EAAoB,EAClF,GAAmC;IAEnC,OAAO,CACL,gBACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAClD,SAAS,EAAE,QAAQ,CACjB,mDAAmD,EACnD,cAAc,EACd,mDAAmD,EACnD,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAChC,SAAS,CACV,GACD,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./select"), exports);
|
|
18
|
-
__exportStar(require("./use-select"), exports);
|
|
1
|
+
export * from './select';
|
|
2
|
+
export * from './use-select';
|
|
19
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const use_select_1 = require("./use-select");
|
|
9
|
-
function Select({ isDisabled = false, isMultiSelect = false, removeOnSelect = false, isErrorVisible, className, emptyLabel, initialInputValue, initialValues, options, onChangeText, onOptionChange, }) {
|
|
10
|
-
const { openDropdownMenu, inputValue, selectedValues: selectedIDs, chipsData, searchedOptions, inputRef, containerRef, handleInputChange, handleDropdownMenu, } = (0, use_select_1.useSelect)({
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BilloIcon, ChipList, DropDownMenu, IconColor, IconSize, IconSymbol, Text, TextVariant, } from '../../../components';
|
|
3
|
+
import { tailwind } from '../../../utils/tailwind-utils';
|
|
4
|
+
import { SelectInput } from './components/select-input';
|
|
5
|
+
import { useSelect } from './use-select';
|
|
6
|
+
export function Select({ isDisabled = false, isMultiSelect = false, removeOnSelect = false, isErrorVisible, className, emptyLabel, initialInputValue, initialValues, options, onChangeText, onOptionChange, }) {
|
|
7
|
+
const { openDropdownMenu, inputValue, selectedValues: selectedIDs, chipsData, searchedOptions, inputRef, containerRef, handleInputChange, handleDropdownMenu, } = useSelect({
|
|
11
8
|
options,
|
|
12
9
|
initialValues,
|
|
13
10
|
isMultiSelect,
|
|
@@ -16,15 +13,15 @@ function Select({ isDisabled = false, isMultiSelect = false, removeOnSelect = fa
|
|
|
16
13
|
onChangeText,
|
|
17
14
|
onOptionChange,
|
|
18
15
|
});
|
|
19
|
-
return ((
|
|
16
|
+
return (_jsxs("div", { ref: containerRef, className: "relative w-full", children: [_jsxs("div", { role: "button", "data-testid": "select-trigger", tabIndex: 0, onClick: (e) => {
|
|
20
17
|
const target = e.target;
|
|
21
18
|
const isClickInsideChip = target.closest('[data-chip]');
|
|
22
19
|
if (isClickInsideChip || isDisabled) {
|
|
23
20
|
return;
|
|
24
21
|
}
|
|
25
22
|
handleDropdownMenu();
|
|
26
|
-
}, className:
|
|
23
|
+
}, className: 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
|
|
27
24
|
? 'outline-none'
|
|
28
|
-
: 'focus-visible:border-none focus-visible:outline-2 focus-visible:outline-blue-01', { 'cursor-not-allowed bg-gray-05 border-gray-04 hover:border-gray-04': isDisabled }, { 'border-red-01': isErrorVisible }, { 'p-0 pr-4 pl-2 py-2': isMultiSelect }, className), children: [isMultiSelect ? ((
|
|
25
|
+
: 'focus-visible:border-none focus-visible:outline-2 focus-visible:outline-blue-01', { 'cursor-not-allowed bg-gray-05 border-gray-04 hover:border-gray-04': isDisabled }, { 'border-red-01': isErrorVisible }, { 'p-0 pr-4 pl-2 py-2': isMultiSelect }, className), children: [isMultiSelect ? (_jsx(ChipList, { data: chipsData, className: "mr-1 w-full max-h-[138px]", lasItemComponent: _jsx("div", { className: "flex-grow min-w-[20px] basis-[150px]", children: _jsx(SelectInput, { ref: inputRef, isDisabled: isDisabled, inputValue: inputValue, className: "h-fit md:h-10 w-full", handleInputChange: handleInputChange }) }) })) : (_jsx(SelectInput, { ref: inputRef, isDisabled: isDisabled, className: tailwind('h-fit md:h-6 w-full'), inputValue: inputValue, handleInputChange: handleInputChange })), _jsx(BilloIcon, { icon: openDropdownMenu ? IconSymbol.CARET_UP : IconSymbol.CARET_DOWN, size: IconSize.SM, color: isDisabled ? IconColor.BLUE_03 : IconColor.BLUE_01, className: tailwind('ml-2') })] }), _jsx(DropDownMenu, { selectedIDs: selectedIDs, options: searchedOptions, emptyElement: _jsx(Text, { variant: TextVariant.BODY, className: tailwind('flex whitespace-normal bg-white py-2 px-4'), children: emptyLabel }), className: tailwind('max-h-[313px] w-full', { hidden: !openDropdownMenu }) })] }));
|
|
29
26
|
}
|
|
30
27
|
//# sourceMappingURL=select.js.map
|
|
@@ -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":";AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,YAAY,EAEZ,SAAS,EACT,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgBzC,MAAM,UAAU,MAAM,CAAC,EACrB,UAAU,GAAG,KAAK,EAClB,aAAa,GAAG,KAAK,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,GAAG,EAAE,QAAQ,EACb,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAC,sBAAsB,EAChC,iBAAiB,EAAE,iBAAiB,GACpC,GACE,GAER,CACH,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,IACV,GAAG,EAAE,QAAQ,EACb,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,QAAQ,CAAC,qBAAqB,CAAC,EAC1C,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,GACpC,CACH,EAED,KAAC,SAAS,IACR,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,EACpE,IAAI,EAAE,QAAQ,CAAC,EAAE,EACjB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,EACzD,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,GAC3B,IACE,EACN,KAAC,YAAY,IACX,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,eAAe,EACxB,YAAY,EACV,KAAC,IAAI,IACH,OAAO,EAAE,WAAW,CAAC,IAAI,EACzB,SAAS,EAAE,QAAQ,CAAC,2CAA2C,CAAC,YAE/D,UAAU,GACN,EAET,SAAS,EAAE,QAAQ,CAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC,GAC1E,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const [
|
|
9
|
-
const [openDropdownMenu, setOpenDropdownMenu] = (0, react_1.useState)(false);
|
|
10
|
-
const [searchedOptions, setSearchedOptions] = (0, react_1.useState)([]);
|
|
11
|
-
const [selectedValues, setSelectedValues] = (0, react_1.useState)(() => {
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { useStringUtils } from '../../../utils/string-utils/string-utils';
|
|
3
|
+
export function useSelect({ isMultiSelect, removeOnSelect, initialInputValue, options, initialValues, onChangeText = () => { }, onOptionChange = () => { }, }) {
|
|
4
|
+
const { normalize } = useStringUtils();
|
|
5
|
+
const [chipsData, setChipsData] = useState([]);
|
|
6
|
+
const [openDropdownMenu, setOpenDropdownMenu] = useState(false);
|
|
7
|
+
const [searchedOptions, setSearchedOptions] = useState([]);
|
|
8
|
+
const [selectedValues, setSelectedValues] = useState(() => {
|
|
12
9
|
const values = Array.isArray(initialValues) ? initialValues : [initialValues];
|
|
13
10
|
return options.filter((option) => values.includes(option.value)).map((option) => option.value);
|
|
14
11
|
});
|
|
15
|
-
const [inputValue, setInputValue] =
|
|
12
|
+
const [inputValue, setInputValue] = useState(() => {
|
|
16
13
|
const values = Array.isArray(initialValues) ? initialValues : [initialValues];
|
|
17
14
|
const [value] = options
|
|
18
15
|
.filter((option) => values.includes(option.value))
|
|
19
16
|
.map((option) => option.value);
|
|
20
17
|
return value;
|
|
21
18
|
});
|
|
22
|
-
const inputRef =
|
|
23
|
-
const containerRef =
|
|
24
|
-
const memoOptions =
|
|
19
|
+
const inputRef = useRef(null);
|
|
20
|
+
const containerRef = useRef(null);
|
|
21
|
+
const memoOptions = useMemo(() => options || [], [options]);
|
|
25
22
|
function handleDropdownMenu() {
|
|
26
23
|
setOpenDropdownMenu((current) => !current);
|
|
27
24
|
}
|
|
@@ -90,14 +87,14 @@ function useSelect({ isMultiSelect, removeOnSelect, initialInputValue, options,
|
|
|
90
87
|
});
|
|
91
88
|
setSearchedOptions(filteredOptions);
|
|
92
89
|
}
|
|
93
|
-
|
|
90
|
+
useEffect(() => {
|
|
94
91
|
const dropDownMenuOption = handleMapOptions();
|
|
95
92
|
const removedOptions = removeOnSelect
|
|
96
93
|
? dropDownMenuOption.filter((option) => !selectedValues.includes(option.value))
|
|
97
94
|
: dropDownMenuOption;
|
|
98
95
|
setSearchedOptions(removedOptions);
|
|
99
96
|
}, [memoOptions, selectedValues]);
|
|
100
|
-
|
|
97
|
+
useEffect(() => {
|
|
101
98
|
if (!inputRef.current) {
|
|
102
99
|
return;
|
|
103
100
|
}
|
|
@@ -110,7 +107,7 @@ function useSelect({ isMultiSelect, removeOnSelect, initialInputValue, options,
|
|
|
110
107
|
}
|
|
111
108
|
inputRef.current.blur();
|
|
112
109
|
}, [openDropdownMenu]);
|
|
113
|
-
|
|
110
|
+
useEffect(() => {
|
|
114
111
|
function handleClickOutside(event) {
|
|
115
112
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
116
113
|
setOpenDropdownMenu(false);
|
|
@@ -121,7 +118,7 @@ function useSelect({ isMultiSelect, removeOnSelect, initialInputValue, options,
|
|
|
121
118
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
122
119
|
};
|
|
123
120
|
}, []);
|
|
124
|
-
|
|
121
|
+
useEffect(() => {
|
|
125
122
|
if (!initialInputValue || isMultiSelect) {
|
|
126
123
|
return;
|
|
127
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-select.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/use-select.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-select.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/use-select.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAwB1E,MAAM,UAAU,SAAS,CAAC,EACxB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,OAAO,EACP,aAAa,EACb,YAAY,GAAG,GAAG,EAAE,GAAE,CAAC,EACvB,cAAc,GAAG,GAAG,EAAE,GAAE,CAAC,GACV;IAEf,MAAM,EAAE,S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C,CAAC;QACrC,aAAa,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,OAAO;QACL,gBAAgB;QAChB,UAAU;QACV,cAAc;QACd,SAAS;QACT,eAAe;QACf,QAAQ;QACR,YAAY;QACZ,kBAAkB;QAClB,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./text-field"), exports);
|
|
1
|
+
export * from './text-field';
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/molecules/text-field/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/molecules/text-field/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const components_1 = require("../../../components");
|
|
7
|
-
function TextField({ isRequired, isDisabled, type = 'text', name, value, placeholder, onBlur, onChange, className, }) {
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center w-full", children: (0, jsx_runtime_1.jsx)("input", { type: type, required: isRequired, disabled: isDisabled, name: name, value: value, placeholder: placeholder, onBlur: onBlur, onChange: onChange, className: (0, tailwind_utils_1.tailwind)('p-4', 'border border-gray-04', 'rounded-lg bg-white', 'hover:border-blue-02 focus-within:border-blue-01 focus-within:hover:border-blue-01', `${components_1.TextVariant.BODY}`, className) }) }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { tailwind } from '../../../utils/tailwind-utils';
|
|
3
|
+
import { TextVariant } from '../../../components';
|
|
4
|
+
export function TextField({ isRequired, isDisabled, type = 'text', name, value, placeholder, onBlur, onChange, className, }) {
|
|
5
|
+
return (_jsx("div", { className: "flex items-center w-full", children: _jsx("input", { type: type, required: isRequired, disabled: isDisabled, name: name, value: value, placeholder: placeholder, onBlur: onBlur, onChange: onChange, className: tailwind('p-4', 'border border-gray-04', 'rounded-lg bg-white', 'hover:border-blue-02 focus-within:border-blue-01 focus-within:hover:border-blue-01', `${TextVariant.BODY}`, className) }) }));
|
|
9
6
|
}
|
|
10
7
|
//# 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":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAmBlD,MAAM,UAAU,SAAS,CAAC,EACxB,UAAU,EACV,UAAU,EACV,IAAI,GAAG,MAAM,EACb,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,QAAQ,EACR,SAAS,GACM;IACf,OAAO,CACL,cAAK,SAAS,EAAC,0BAA0B,YACvC,gBACE,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,QAAQ,CACjB,KAAK,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oFAAoF,EACpF,GAAG,WAAW,CAAC,IAAI,EAAE,EACrB,SAAS,CACV,GACD,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 mt-2', 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 })] }));
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BilloIcon, IconColor, IconSize, IconSymbol, Text, TextColors, TextVariant, } from '../../../components';
|
|
3
|
+
import { tailwind } from '../../../utils/tailwind-utils';
|
|
4
|
+
export function FormError({ errorText, className }) {
|
|
5
|
+
return (_jsxs("div", { className: tailwind('flex flex-row justify-start items-start mt-2', className), children: [_jsx(BilloIcon, { icon: IconSymbol.ALERT_FILLED, size: IconSize.SM, color: IconColor.RED_01, className: tailwind('mr-1 pt-[2px] md:pt-[5px]') }), _jsx(Text, { variant: TextVariant.BODY, color: TextColors.RED, className: "whitespace-normal", children: errorText })] }));
|
|
9
6
|
}
|
|
10
7
|
//# 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":";AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,UAAU,EACV,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAOzD,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,EAAkB;IAChE,OAAO,CACL,eAAK,SAAS,EAAE,QAAQ,CAAC,8CAA8C,EAAE,SAAS,CAAC,aACjF,KAAC,SAAS,IACR,IAAI,EAAE,UAAU,CAAC,YAAY,EAC7B,IAAI,EAAE,QAAQ,CAAC,EAAE,EACjB,KAAK,EAAE,SAAS,CAAC,MAAM,EACvB,SAAS,EAAE,QAAQ,CAAC,2BAA2B,CAAC,GAChD,EACF,KAAC,IAAI,IAAC,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,GAAG,EAAE,SAAS,EAAC,mBAAmB,YAClF,SAAS,GACL,IACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text, TextColors, TextVariant } from '../../../components';
|
|
3
|
+
import { tailwind } from '../../../utils/tailwind-utils';
|
|
4
|
+
export function FormHelper({ helperText, className, color = TextColors.BLACK_02 }) {
|
|
5
|
+
return (_jsx(Text, { variant: TextVariant.HELPER, color: color, className: tailwind('whitespace-normal', className), children: helperText }));
|
|
9
6
|
}
|
|
10
7
|
//# 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":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAQzD,MAAM,UAAU,UAAU,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,UAAU,CAAC,QAAQ,EAAS;IACtF,OAAO,CACL,KAAC,IAAI,IACH,OAAO,EAAE,WAAW,CAAC,MAAM,EAC3B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,QAAQ,CAAC,mBAAmB,EAAE,SAAS,CAAC,YAElD,UAAU,GACN,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const tailwind_utils_1 = require("../../../utils/tailwind-utils");
|
|
7
|
-
function FormLabel({ isRequired = true, hideRequiredMark = false, label, className, optionalLabel, }) {
|
|
8
|
-
return ((0, jsx_runtime_1.jsxs)(components_1.Text, { className: (0, tailwind_utils_1.tailwind)(className), children: [!hideRequiredMark && isRequired && ((0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.BODY, color: components_1.TextColors.PURPLE, className: "inline", children: '* ' })), (0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.BODY, className: "inline", children: label }), !hideRequiredMark && !isRequired && ((0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.BODY, color: components_1.TextColors.BLACK_02, className: "ml-1 inline", children: optionalLabel }))] }));
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, TextColors, TextVariant } from '../../../components';
|
|
3
|
+
import { tailwind } from '../../../utils/tailwind-utils';
|
|
4
|
+
export function FormLabel({ isRequired = true, hideRequiredMark = false, label, className, optionalLabel, }) {
|
|
5
|
+
return (_jsxs(Text, { className: tailwind(className), children: [!hideRequiredMark && isRequired && (_jsx(Text, { variant: TextVariant.BODY, color: TextColors.PURPLE, className: "inline", children: '* ' })), _jsx(Text, { variant: TextVariant.BODY, className: "inline", children: label }), !hideRequiredMark && !isRequired && (_jsx(Text, { variant: TextVariant.BODY, color: TextColors.BLACK_02, className: "ml-1 inline", children: optionalLabel }))] }));
|
|
9
6
|
}
|
|
10
7
|
//# 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":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAUzD,MAAM,UAAU,SAAS,CAAC,EACxB,UAAU,GAAG,IAAI,EACjB,gBAAgB,GAAG,KAAK,EACxB,KAAK,EACL,SAAS,EACT,aAAa,GACP;IACN,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,aAEjC,CAAC,gBAAgB,IAAI,UAAU,IAAI,CAClC,KAAC,IAAI,IAAC,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,SAAS,EAAC,QAAQ,YAC1E,IAAI,GACA,CACR,EAGD,KAAC,IAAI,IAAC,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,SAAS,EAAC,QAAQ,YAChD,KAAK,GACD,EAGN,CAAC,gBAAgB,IAAI,CAAC,UAAU,IAAI,CACnC,KAAC,IAAI,IAAC,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAC,aAAa,YACjF,aAAa,GACT,CACR,IACI,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormInputWidthClassNames = exports.FormInputWidth = void 0;
|
|
4
|
-
var FormInputWidth;
|
|
1
|
+
export var FormInputWidth;
|
|
5
2
|
(function (FormInputWidth) {
|
|
6
3
|
FormInputWidth["ONE_COLUMN"] = "ONE_COLUMN";
|
|
7
4
|
FormInputWidth["TWO_COLUMN"] = "TWO_COLUMN";
|
|
8
5
|
FormInputWidth["THREE_COLUMN"] = "THREE_COLUMN";
|
|
9
6
|
FormInputWidth["FOUR_COLUMN"] = "FOUR_COLUMN";
|
|
10
7
|
FormInputWidth["FIVE_COLUMN"] = "FIVE_COLUMN";
|
|
11
|
-
})(FormInputWidth || (
|
|
12
|
-
|
|
8
|
+
})(FormInputWidth || (FormInputWidth = {}));
|
|
9
|
+
export const FormInputWidthClassNames = {
|
|
13
10
|
[FormInputWidth.ONE_COLUMN]: 'w-24 max-w-24 md:max-w-24',
|
|
14
11
|
[FormInputWidth.TWO_COLUMN]: 'w-[204px] max-w-[204px] md:max-w-[204px]',
|
|
15
12
|
[FormInputWidth.THREE_COLUMN]: 'w-[272px] md:w-[320px] max-w-[272px] md:max-w-[320px]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control-types.js","sourceRoot":"","sources":["../../../src/containers/form-control/form-control-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-control-types.js","sourceRoot":"","sources":["../../../src/containers/form-control/form-control-types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,2CAAyB,CAAA;IACzB,2CAAyB,CAAA;IACzB,+CAA6B,CAAA;IAC7B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;AAC7B,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,MAAM,CAAC,MAAM,wBAAwB,GAEjC;IACF,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,2BAA2B;IACxD,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,0CAA0C;IACvE,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,uDAAuD;IACtF,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,uDAAuD;IACrF,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,uDAAuD;CACtF,CAAC"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const form_control_types_1 = require("./form-control-types");
|
|
11
|
-
function FormControl({ isDisabled, isRequired, formName, label, formProps, className, errorText, helperText, optionalLabel, inputWidth = form_control_types_1.FormInputWidth.FOUR_COLUMN, children, }) {
|
|
12
|
-
const widthClassName = form_control_types_1.FormInputWidthClassNames[inputWidth];
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TextColors } from '../../components';
|
|
3
|
+
import { tailwind } from '../../utils/tailwind-utils';
|
|
4
|
+
import { FormError } from './components/form-error';
|
|
5
|
+
import { FormHelper } from './components/form-helper';
|
|
6
|
+
import { FormLabel } from './components/form-label';
|
|
7
|
+
import { FormInputWidth, FormInputWidthClassNames } from './form-control-types';
|
|
8
|
+
export function FormControl({ isDisabled, isRequired, formName, label, formProps, className, errorText, helperText, optionalLabel, inputWidth = FormInputWidth.FOUR_COLUMN, children, }) {
|
|
9
|
+
const widthClassName = FormInputWidthClassNames[inputWidth];
|
|
13
10
|
const isTouched = formName && formProps && formProps.touched[formName];
|
|
14
11
|
const isErrorVisible = errorText && isTouched;
|
|
15
12
|
const isHelperVisible = !isErrorVisible && helperText;
|
|
16
|
-
return ((
|
|
13
|
+
return (_jsxs("div", { className: tailwind('flex flex-col space-y-2', widthClassName, className), children: [label && _jsx(FormLabel, { isRequired: isRequired, label: label, optionalLabel: optionalLabel }), _jsx("div", { className: tailwind(widthClassName), children: children ? children({ isErrorVisible: !!isErrorVisible }) : null }), isHelperVisible && (_jsx(FormHelper, { helperText: helperText, color: isDisabled ? TextColors.BLACK_03 : TextColors.BLACK_02 })), isErrorVisible && _jsx(FormError, { errorText: errorText, className: "mt-2 w-fit" })] }));
|
|
17
14
|
}
|
|
18
15
|
//# sourceMappingURL=form-control.js.map
|