jcicl 1.0.76 → 1.0.78
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/.chunks/Button.js +7 -6
- package/.chunks/ButtonBase.js +2 -1
- package/.chunks/CircularProgress.js +9 -8
- package/.chunks/DefaultPropsProvider.js +322 -336
- package/.chunks/Paper.js +6 -5
- package/.chunks/Popper.js +1 -1
- package/.chunks/Portal.js +13 -13
- package/.chunks/SwitchBase.js +14 -13
- package/.chunks/TextField.js +2 -1
- package/.chunks/clsx.js +16 -0
- package/.chunks/createSvgIcon.js +14 -13
- package/.chunks/eye.js +45 -0
- package/.chunks/index.js +19 -18
- package/AppContainer/AppContainer.js +323 -319
- package/Button/Button.js +80 -82
- package/Divider/Divider.js +13 -12
- package/EditableDetailItemWithIcon/EditableDetailItemWithIcon.d.ts +3 -2
- package/EditableDetailItemWithIcon/EditableDetailItemWithIcon.js +39 -39
- package/EditableInfoCard/EditableInfoCard.d.ts +1 -1
- package/EditableInfoCard/EditableInfoCard.js +25 -25
- package/ErrorBoundary/ErrorBoundary.d.ts +5 -5
- package/ErrorBoundary/ErrorBoundary.js +21 -19
- package/FormComponents/FormComponents.d.ts +1 -2
- package/FormContext/createFormContext.js +70 -62
- package/FormFields/FormFields.d.ts +1 -1
- package/FormFields/FormFields.js +31 -31
- package/FormInput/FormInput.d.ts +5 -3
- package/FormInput/FormInput.js +10 -8
- package/Input/Input.d.ts +6 -1
- package/Input/Input.js +35 -100
- package/LabeledCheckbox/LabeledCheckbox.js +7 -6
- package/LabeledDropdown/LabeledDropdown.d.ts +3 -0
- package/LabeledDropdown/LabeledDropdown.js +720 -795
- package/LabeledFormattedInput/LabeledFormattedInput.d.ts +23 -0
- package/LabeledFormattedInput/LabeledFormattedInput.js +95 -0
- package/LabeledFormattedInput/index.d.ts +1 -0
- package/LabeledFormattedInput/index.js +4 -0
- package/LabeledInput/LabeledInput.js +39 -51
- package/LabeledRadio/LabeledRadio.js +7 -6
- package/Memo/Memo.js +6 -5
- package/Nav/Nav.d.ts +1 -1
- package/Pagination/Pagination.d.ts +1 -2
- package/Pagination/Pagination.js +25 -24
- package/README.md +11 -6
- package/Stepper/Stepper.js +4 -3
- package/Table/Table.d.ts +7 -5
- package/Table/Table.js +5575 -5633
- package/Timer/Timer.js +26 -26
- package/Toast/Toaster.js +9 -9
- package/Tooltip/Tooltip.js +5 -4
- package/WelcomeCard/WelcomeCard.d.ts +1 -5
- package/WelcomeCard/WelcomeCard.js +45 -101
- package/assets/style.css +1 -1
- package/assets/tailwind.css +2 -2
- package/cn.d.ts +2 -0
- package/cn.js +2990 -0
- package/constants.d.ts +6 -0
- package/constants.js +55 -0
- package/cursorPositioning.d.ts +7 -0
- package/cursorPositioning.js +13 -0
- package/formatters.d.ts +17 -0
- package/formatters.js +83 -0
- package/inputTypes.d.ts +1 -0
- package/inputTypes.js +1 -0
- package/logger.d.ts +13 -0
- package/logger.js +9 -0
- package/maskers.d.ts +6 -0
- package/maskers.js +15 -0
- package/package.json +2 -1
- package/theme.d.ts +1 -0
- package/theme.js +9 -8
- package/themeUtils.js +58 -79
- package/utils.d.ts +8 -18
- package/utils.js +39 -89
- package/validators.d.ts +5 -0
- package/validators.js +12 -0
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { n as
|
|
4
|
-
import { Flex as
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import h from "react";
|
|
3
|
+
import { n as p } from "../.chunks/emotion-styled.browser.esm.js";
|
|
4
|
+
import { Flex as l } from "../Flex/Flex.js";
|
|
5
|
+
import n from "../theme.js";
|
|
6
|
+
import { logger as u } from "../logger.js";
|
|
7
|
+
const x = p(l)`
|
|
7
8
|
width: 100%;
|
|
8
9
|
font-size: 24px;
|
|
9
|
-
color: ${
|
|
10
|
-
background-color: ${
|
|
10
|
+
color: ${n.colors.maroon};
|
|
11
|
+
background-color: ${n.colors.lightRed}aa;
|
|
11
12
|
padding: 16px;
|
|
12
13
|
border-radius: 8px;
|
|
13
|
-
box-shadow: 0 0 13px -3px ${
|
|
14
|
+
box-shadow: 0 0 13px -3px ${n.colors.maroon} inset;
|
|
14
15
|
flex-direction: column;
|
|
15
16
|
p {
|
|
16
17
|
margin: 0;
|
|
17
18
|
}
|
|
18
|
-
`,
|
|
19
|
+
`, f = p("p")`
|
|
19
20
|
font-size: 16px;
|
|
20
21
|
margin: 0 0 0 32px !important;
|
|
21
22
|
`;
|
|
22
|
-
class
|
|
23
|
+
class C extends h.Component {
|
|
23
24
|
constructor(r) {
|
|
24
25
|
super(r), this.state = { hasError: !1, error: null, errorInfo: null };
|
|
25
26
|
}
|
|
@@ -27,17 +28,18 @@ class D extends m.Component {
|
|
|
27
28
|
return { hasError: !0, error: r };
|
|
28
29
|
}
|
|
29
30
|
componentDidCatch(r, t) {
|
|
30
|
-
|
|
31
|
+
u.error("Error:", r), this.setState({ errorInfo: t });
|
|
31
32
|
}
|
|
32
33
|
render() {
|
|
33
|
-
|
|
34
|
+
var s;
|
|
35
|
+
const { title: r, children: t, showDetails: c = !0 } = this.props;
|
|
34
36
|
if (this.state.hasError) {
|
|
35
|
-
const { error:
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
+
const { error: d, errorInfo: o } = this.state;
|
|
38
|
+
return /* @__PURE__ */ i(l, { column: !0, width: "100%", alignItems: "center", gap: "32px", padding: "16px 64px", children: [
|
|
37
39
|
/* @__PURE__ */ e("h1", { children: r }),
|
|
38
|
-
|
|
39
|
-
/* @__PURE__ */ e("p", { children: `${
|
|
40
|
-
o == null ? void 0 : o.componentStack.split("at").map((
|
|
40
|
+
c && /* @__PURE__ */ i(x, { children: [
|
|
41
|
+
/* @__PURE__ */ e("p", { children: `${d}` }),
|
|
42
|
+
(s = o == null ? void 0 : o.componentStack) == null ? void 0 : s.split("at").map((m, a) => a > 0 && /* @__PURE__ */ e(f, { children: `at ${m}` }, a))
|
|
41
43
|
] })
|
|
42
44
|
] });
|
|
43
45
|
}
|
|
@@ -45,5 +47,5 @@ class D extends m.Component {
|
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
export {
|
|
48
|
-
|
|
50
|
+
C as default
|
|
49
51
|
};
|
|
@@ -4,8 +4,7 @@ import { PropsWithChildren, HTMLAttributes } from 'react';
|
|
|
4
4
|
interface WithCustomTheme {
|
|
5
5
|
customTheme: CustomThemeProps;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
type FormSectionProps = HTMLAttributes<HTMLDivElement>;
|
|
9
8
|
export declare const FormSection: React.FC<PropsWithChildren<FormSectionProps>>;
|
|
10
9
|
export declare const FormSectionStyles: import('@emotion/styled').StyledComponent<{
|
|
11
10
|
theme?: import('@emotion/react').Theme;
|
|
@@ -1,88 +1,96 @@
|
|
|
1
1
|
import { jsx as w } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as E, useState as P, useCallback as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { createContext as E, useState as P, useCallback as N, useEffect as $, useMemo as k } from "react";
|
|
3
|
+
import "../utils.js";
|
|
4
|
+
import { logger as x } from "../logger.js";
|
|
5
|
+
import { formatPhoneNumber as S, formatZipCode as D, formatSSN as A } from "../formatters.js";
|
|
6
|
+
function j(v) {
|
|
7
|
+
const { name: o, defaultValues: c = {}, onInputChangeExtensions: m = [], submit: l, debug: n = !1 } = v, d = E({
|
|
8
|
+
onFormInputChange: () => x.error(`Failed to update form input. ${o}FormContext not initialized`),
|
|
9
|
+
formData: c,
|
|
10
|
+
setFormData: () => x.error(`Failed to set form data. ${o}FormContext not initialized`),
|
|
11
|
+
resetForm: () => x.error(`Failed to reset form. ${o}FormContext not initialized`)
|
|
10
12
|
});
|
|
11
|
-
return { Context:
|
|
12
|
-
const [
|
|
13
|
-
(
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
else if (
|
|
19
|
-
const
|
|
20
|
-
Array.isArray(
|
|
21
|
-
} else if (
|
|
22
|
-
const [,
|
|
23
|
-
|
|
24
|
-
} else if (
|
|
25
|
-
const [,
|
|
26
|
-
|
|
13
|
+
return { Context: d, Provider: ({ children: C }) => {
|
|
14
|
+
const [r, u] = P(c), p = N(
|
|
15
|
+
(i, t, a) => {
|
|
16
|
+
u((f) => {
|
|
17
|
+
let e;
|
|
18
|
+
if (a === "checkbox")
|
|
19
|
+
e = t.target.checked;
|
|
20
|
+
else if (a === "multiDropdown") {
|
|
21
|
+
const s = t.target.value;
|
|
22
|
+
Array.isArray(s) ? e = s.map((z) => z.value) : e = [];
|
|
23
|
+
} else if (a === "phone") {
|
|
24
|
+
const [, s] = S(t.target.value);
|
|
25
|
+
e = s;
|
|
26
|
+
} else if (a === "zip") {
|
|
27
|
+
const [, s] = D(t.target.value);
|
|
28
|
+
e = s;
|
|
29
|
+
} else if (a === "ssn") {
|
|
30
|
+
const [, s] = A(t.target.value);
|
|
31
|
+
e = s;
|
|
27
32
|
} else
|
|
28
|
-
|
|
29
|
-
return
|
|
33
|
+
e = t.target.value;
|
|
34
|
+
return e === "undefined" && (e = void 0), { ...f, [i]: e };
|
|
30
35
|
});
|
|
31
36
|
let g;
|
|
32
|
-
if (
|
|
33
|
-
g =
|
|
34
|
-
else if (
|
|
35
|
-
const [,
|
|
36
|
-
g =
|
|
37
|
-
} else if (
|
|
38
|
-
const [,
|
|
39
|
-
g =
|
|
37
|
+
if (a === "checkbox")
|
|
38
|
+
g = t.target.checked;
|
|
39
|
+
else if (a === "phone") {
|
|
40
|
+
const [, f] = S(t.target.value);
|
|
41
|
+
g = f;
|
|
42
|
+
} else if (a === "zip") {
|
|
43
|
+
const [, f] = D(t.target.value);
|
|
44
|
+
g = f;
|
|
40
45
|
} else
|
|
41
|
-
g =
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
g = t.target.value === "undefined" ? void 0 : t.target.value;
|
|
47
|
+
m.forEach((f) => {
|
|
48
|
+
f(i, g, u);
|
|
44
49
|
});
|
|
45
50
|
},
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
// onInputChangeExtensions is captured from the factory closure (not React state/props);
|
|
52
|
+
// it can never change for the lifetime of this Provider, so it's not a valid dep.
|
|
53
|
+
[]
|
|
54
|
+
), h = N(() => u(c), []);
|
|
48
55
|
$(() => {
|
|
49
|
-
|
|
50
|
-
}, [
|
|
56
|
+
n && x.log(`[${o}Form] Updated form data:`, r);
|
|
57
|
+
}, [r]);
|
|
51
58
|
const b = k(
|
|
52
59
|
() => ({
|
|
53
60
|
onFormInputChange: p,
|
|
54
|
-
formData:
|
|
55
|
-
setFormData:
|
|
61
|
+
formData: r,
|
|
62
|
+
setFormData: u,
|
|
56
63
|
resetForm: h,
|
|
57
|
-
...
|
|
64
|
+
...l ? { submit: () => l(r) } : {}
|
|
58
65
|
}),
|
|
59
|
-
|
|
66
|
+
// submit is factory-closure-stable; only formData and the memoized callbacks can change.
|
|
67
|
+
[r, p, h]
|
|
60
68
|
);
|
|
61
|
-
return /* @__PURE__ */ w(
|
|
69
|
+
return /* @__PURE__ */ w(d.Provider, { value: b, children: C });
|
|
62
70
|
} };
|
|
63
71
|
}
|
|
64
|
-
function
|
|
65
|
-
return (
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
|
|
72
|
+
function B(v = "dateOfBirth", o = "age") {
|
|
73
|
+
return (c, m, l) => {
|
|
74
|
+
if (c === v && m && typeof m == "string") {
|
|
75
|
+
const n = m.split("-");
|
|
76
|
+
if (n.length !== 3) {
|
|
77
|
+
l((i) => ({ ...i, [o]: void 0 }));
|
|
70
78
|
return;
|
|
71
79
|
}
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
|
|
80
|
+
const d = Number(n[0]), F = Number(n[1]), C = Number(n[2]), r = /* @__PURE__ */ new Date(), u = r.getFullYear(), p = r.getMonth() + 1, h = r.getDate();
|
|
81
|
+
if (d > u || d < 1900) {
|
|
82
|
+
l((i) => ({ ...i, [o]: void 0 }));
|
|
75
83
|
return;
|
|
76
84
|
}
|
|
77
|
-
let b =
|
|
78
|
-
(
|
|
79
|
-
...
|
|
80
|
-
[
|
|
85
|
+
let b = u - d;
|
|
86
|
+
(F > p || F === p && C > h) && (b -= 1), l((i) => ({
|
|
87
|
+
...i,
|
|
88
|
+
[o]: String(b)
|
|
81
89
|
}));
|
|
82
|
-
} else
|
|
90
|
+
} else c === v && l((n) => ({ ...n, [o]: void 0 }));
|
|
83
91
|
};
|
|
84
92
|
}
|
|
85
93
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
B as createDobToAgeExtension,
|
|
95
|
+
j as createFormContext
|
|
88
96
|
};
|
|
@@ -18,7 +18,7 @@ export type FormFieldsProps = {
|
|
|
18
18
|
gap?: number;
|
|
19
19
|
noLabel?: boolean;
|
|
20
20
|
checkboxContainer?: boolean;
|
|
21
|
-
formDefaults: Record<string,
|
|
21
|
+
formDefaults: Record<string, unknown>;
|
|
22
22
|
onChange: (key: string, e: React.ChangeEvent<HTMLInputElement>, type?: string) => void;
|
|
23
23
|
compact?: boolean;
|
|
24
24
|
};
|
package/FormFields/FormFields.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as b, Fragment as
|
|
2
|
-
import { FormInput as
|
|
3
|
-
import { FormSectionTitle as
|
|
1
|
+
import { jsxs as b, Fragment as T, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { FormInput as s } from "../FormInput/FormInput.js";
|
|
3
|
+
import { FormSectionTitle as g, FormFieldGrid as j, FormTextLine as I, FormFieldCheckboxContainer as L } from "../FormComponents/FormComponents.js";
|
|
4
4
|
import "../AvatarWithImage/AvatarWithImage.js";
|
|
5
5
|
import "../Button/Button.js";
|
|
6
6
|
import "../Divider/Divider.js";
|
|
7
|
-
import { Flex as
|
|
7
|
+
import { Flex as V } from "../Flex/Flex.js";
|
|
8
8
|
import "../Grid/Grid.js";
|
|
9
9
|
import "../Icon/Icon.js";
|
|
10
10
|
import "../Input/Input.js";
|
|
@@ -13,7 +13,7 @@ import "../ListButton/ListButton.js";
|
|
|
13
13
|
import "../Loading/Loading.js";
|
|
14
14
|
import "../ScrollContainer/ScrollContainer.js";
|
|
15
15
|
import "react";
|
|
16
|
-
import {
|
|
16
|
+
import { useIsTablet as G } from "../utils.js";
|
|
17
17
|
import "../CustomAlert/CustomAlert.js";
|
|
18
18
|
import "react-dom";
|
|
19
19
|
import "../Accordion/Accordion.js";
|
|
@@ -30,68 +30,68 @@ import "../.chunks/AppHeader.js";
|
|
|
30
30
|
import "../EditableInfoCard/EditableInfoCard.js";
|
|
31
31
|
import "../Nav/Nav.js";
|
|
32
32
|
import "../AppContainer/AppContainer.js";
|
|
33
|
-
const
|
|
33
|
+
const eo = ({
|
|
34
34
|
title: a,
|
|
35
|
-
fields:
|
|
35
|
+
fields: h,
|
|
36
36
|
columns: f,
|
|
37
37
|
columnsOverride: w,
|
|
38
|
-
gap:
|
|
38
|
+
gap: C = 21,
|
|
39
39
|
noLabel: x = !1,
|
|
40
40
|
checkboxContainer: F = !1,
|
|
41
41
|
compact: v = !1,
|
|
42
42
|
formDefaults: n,
|
|
43
|
-
onChange:
|
|
43
|
+
onChange: d
|
|
44
44
|
}) => {
|
|
45
|
-
const
|
|
46
|
-
return /* @__PURE__ */ b(
|
|
47
|
-
a && /* @__PURE__ */ m(
|
|
48
|
-
!F && /* @__PURE__ */ m(j, { columns:
|
|
45
|
+
const D = G();
|
|
46
|
+
return /* @__PURE__ */ b(T, { children: [
|
|
47
|
+
a && /* @__PURE__ */ m(g, { children: a }),
|
|
48
|
+
!F && /* @__PURE__ */ m(j, { columns: f ?? (D ? 2 : 3), columnsOverride: w, gap: C, children: h.map(({ key: r, label: p, type: o, limit: c, options: e, defaultValue: t, ...u }) => {
|
|
49
49
|
const i = n[r] !== void 0 ? n[r] : t !== void 0 ? t : o === "multiDropdown" ? [] : o === "checkbox" ? !1 : "";
|
|
50
|
-
return v ? /* @__PURE__ */ b(
|
|
51
|
-
/* @__PURE__ */ m(
|
|
50
|
+
return v ? /* @__PURE__ */ b(V, { column: !0, gap: "21px", children: [
|
|
51
|
+
/* @__PURE__ */ m(I, { children: p }),
|
|
52
52
|
/* @__PURE__ */ m(
|
|
53
|
-
|
|
53
|
+
s,
|
|
54
54
|
{
|
|
55
|
-
onChange: (
|
|
55
|
+
onChange: (l) => d(r, l, o),
|
|
56
56
|
type: o,
|
|
57
57
|
limit: c,
|
|
58
58
|
...o === "checkbox" ? { checked: !!i } : { value: i },
|
|
59
59
|
noLabel: !0,
|
|
60
|
-
options:
|
|
60
|
+
options: e,
|
|
61
61
|
multiple: o === "multiDropdown",
|
|
62
|
-
...
|
|
62
|
+
...u
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
] }, r) : /* @__PURE__ */ m(
|
|
66
|
-
|
|
66
|
+
s,
|
|
67
67
|
{
|
|
68
|
-
onChange: (
|
|
69
|
-
label:
|
|
68
|
+
onChange: (l) => d(r, l, o),
|
|
69
|
+
label: p,
|
|
70
70
|
type: o,
|
|
71
71
|
limit: c,
|
|
72
72
|
...o === "checkbox" ? { checked: !!i } : { value: i },
|
|
73
73
|
noLabel: x || v,
|
|
74
|
-
options:
|
|
74
|
+
options: e,
|
|
75
75
|
multiple: o === "multiDropdown",
|
|
76
|
-
...
|
|
76
|
+
...u
|
|
77
77
|
},
|
|
78
78
|
r
|
|
79
79
|
);
|
|
80
80
|
}) }),
|
|
81
|
-
F && /* @__PURE__ */ m(
|
|
81
|
+
F && /* @__PURE__ */ m(L, { children: h.map(({ key: r, label: p, type: o, limit: c, options: e, defaultValue: t, ...u }) => {
|
|
82
82
|
const i = n[r] !== void 0 ? n[r] : t !== void 0 ? t : o === "multiDropdown" ? [] : o === "checkbox" ? !1 : "";
|
|
83
83
|
return /* @__PURE__ */ m(
|
|
84
|
-
|
|
84
|
+
s,
|
|
85
85
|
{
|
|
86
|
-
onChange: (
|
|
87
|
-
label:
|
|
86
|
+
onChange: (l) => d(r, l, o),
|
|
87
|
+
label: p,
|
|
88
88
|
type: o,
|
|
89
89
|
limit: c,
|
|
90
90
|
...o === "checkbox" ? { checked: !!i } : { defaultValue: i },
|
|
91
91
|
noLabel: x,
|
|
92
|
-
options:
|
|
92
|
+
options: e,
|
|
93
93
|
multiple: o === "multiDropdown",
|
|
94
|
-
...
|
|
94
|
+
...u
|
|
95
95
|
},
|
|
96
96
|
r
|
|
97
97
|
);
|
|
@@ -99,5 +99,5 @@ const co = ({
|
|
|
99
99
|
] });
|
|
100
100
|
};
|
|
101
101
|
export {
|
|
102
|
-
|
|
102
|
+
eo as default
|
|
103
103
|
};
|
package/FormInput/FormInput.d.ts
CHANGED
|
@@ -4,12 +4,14 @@ import { LabeledCheckboxProps } from '../LabeledCheckbox';
|
|
|
4
4
|
import { LabeledRadioProps } from '../LabeledRadio';
|
|
5
5
|
import { LabeledDropdownProps, DropdownOption } from '../LabeledDropdown';
|
|
6
6
|
import { LabeledTextAreaProps } from '../LabeledTextArea/LabeledTextArea';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { LabeledFormattedInputProps } from '../LabeledFormattedInput';
|
|
8
|
+
import { FormInputType } from '../inputTypes';
|
|
9
|
+
export type AllInputProps = LabeledInputProps & LabeledCheckboxProps & LabeledRadioProps & LabeledDropdownProps & LabeledCurrencyInputProps & LabeledTextAreaProps & LabeledFormattedInputProps;
|
|
10
|
+
export { type FormInputType } from '../inputTypes';
|
|
9
11
|
type ConflictingKeys = 'onChange' | 'options' | 'value' | 'checked' | 'defaultValue' | 'label';
|
|
10
12
|
export type FormInputProps = Partial<Omit<AllInputProps, ConflictingKeys | 'type'>> & {
|
|
11
13
|
type?: FormInputType;
|
|
12
|
-
onChange?: (event:
|
|
14
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>, ...args: unknown[]) => void;
|
|
13
15
|
options?: DropdownOption[];
|
|
14
16
|
value?: unknown;
|
|
15
17
|
checked?: boolean;
|
package/FormInput/FormInput.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { LabeledInput as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { LabeledInput as o } from "../LabeledInput/LabeledInput.js";
|
|
3
3
|
import { LabeledCurrencyInput as m } from "../LabeledCurrencyInput/LabeledCurrencyInput.js";
|
|
4
4
|
import { LabeledCheckbox as a } from "../LabeledCheckbox/LabeledCheckbox.js";
|
|
5
5
|
import { LabeledRadio as d } from "../LabeledRadio/LabeledRadio.js";
|
|
6
6
|
import { LabeledDropdown as f } from "../LabeledDropdown/LabeledDropdown.js";
|
|
7
|
-
import { LabeledTextArea as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { LabeledTextArea as i } from "../LabeledTextArea/LabeledTextArea.js";
|
|
8
|
+
import { LabeledFormattedInput as n } from "../LabeledFormattedInput/LabeledFormattedInput.js";
|
|
9
|
+
import { formattedOrMaskedTypes as b } from "../utils.js";
|
|
10
|
+
const k = (e) => {
|
|
11
|
+
const { type: r = "text" } = e;
|
|
12
|
+
return r === "dropdown" || r === "multiDropdown" ? /* @__PURE__ */ t(f, { ...e }) : r === "checkbox" ? /* @__PURE__ */ t(a, { ...e }) : r === "radio" ? /* @__PURE__ */ t(d, { ...e }) : r === "currency" ? /* @__PURE__ */ t(m, { ...e }) : r === "textarea" ? /* @__PURE__ */ t(i, { ...e }) : b.has(r) ? /* @__PURE__ */ t(n, { ...e, type: r }) : /* @__PURE__ */ t(o, { ...e, type: r });
|
|
11
13
|
};
|
|
12
14
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
k as FormInput,
|
|
16
|
+
k as default
|
|
15
17
|
};
|
package/Input/Input.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';
|
|
2
|
-
|
|
2
|
+
import { FormInputType } from '../FormInput';
|
|
3
|
+
export type InputValue = string | number | undefined;
|
|
4
|
+
export type InputProps = Omit<MuiTextFieldProps, 'variant' | 'type' | 'value'> & {
|
|
5
|
+
type?: FormInputType;
|
|
6
|
+
value?: InputValue;
|
|
3
7
|
borderFocusColor?: string;
|
|
8
|
+
className?: string;
|
|
4
9
|
};
|
|
5
10
|
export declare const Input: React.FC<InputProps>;
|
|
6
11
|
export default Input;
|
package/Input/Input.js
CHANGED
|
@@ -1,105 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
border-radius: 0;
|
|
15
|
-
height: 18px;
|
|
16
|
-
|
|
17
|
-
input {
|
|
18
|
-
transition: 313ms all ease-out;
|
|
19
|
-
height: 15px;
|
|
20
|
-
padding: 2px 0;
|
|
21
|
-
border-radius: 0;
|
|
22
|
-
border-bottom: 1px solid ${b.colors.gray};
|
|
23
|
-
width: 100%;
|
|
24
|
-
|
|
25
|
-
&:focus-visible {
|
|
26
|
-
${o !== "date" && !n && c`
|
|
27
|
-
box-shadow: 0 -5px 4px -4px ${t} inset;
|
|
28
|
-
`}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
::-webkit-calendar-picker-indicator {
|
|
32
|
-
cursor: pointer;
|
|
33
|
-
transition: 201ms all ease-out;
|
|
34
|
-
outline: none !important;
|
|
35
|
-
|
|
36
|
-
&:hover,
|
|
37
|
-
:focus-visible {
|
|
38
|
-
box-shadow:
|
|
39
|
-
0 -5px 4px -4px ${t} inset,
|
|
40
|
-
0 5px 4px -4px ${t} inset;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&:hover,
|
|
46
|
-
:focus-visible {
|
|
47
|
-
input {
|
|
48
|
-
${o !== "date" && !n && c`
|
|
49
|
-
box-shadow: 0 -5px 4px -4px ${t} inset;
|
|
50
|
-
`}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
fieldset {
|
|
55
|
-
border-radius: 0;
|
|
56
|
-
border: none;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&.Mui-focused {
|
|
60
|
-
fieldset {
|
|
61
|
-
border: none;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
`
|
|
65
|
-
})), q = ({
|
|
66
|
-
borderFocusColor: t,
|
|
1
|
+
import { jsx as n, Fragment as d } from "react/jsx-runtime";
|
|
2
|
+
import { cn as a } from "../cn.js";
|
|
3
|
+
import i from "../theme.js";
|
|
4
|
+
import { useThemeColors as l } from "../ThemeContext.js";
|
|
5
|
+
import { T as c } from "../.chunks/TextField.js";
|
|
6
|
+
const h = "bg-white !rounded-none !h-[18px] [&_fieldset]:!rounded-none [&_fieldset]:!border-none [&_.Mui-focused_fieldset]:!border-none", x = "[&:has(.MuiFormHelperText-root)]:!h-[40px] [&:has(.MuiFormHelperText-root)]:transition-all [&:has(.MuiFormHelperText-root)]:duration-[201ms] [&:has(.MuiFormHelperText-root)]:ease-out [&_.MuiFormHelperText-root]:!mt-px [&_.MuiFormHelperText-root]:!mr-0 [&_.MuiFormHelperText-root]:text-right", m = "[&_input]:h-[15px] [&_input]:w-full [&_input]:rounded-none [&_input]:px-0 [&_input]:py-[2px]", _ = "[&_.MuiInputBase-root]:rounded-none [&_.MuiInputBase-root]:border-b [&_.MuiInputBase-root]:border-b-[var(--border-color)] [&_.MuiInputBase-root]:!shadow-[var(--default-shadow)] [&_.MuiInputBase-root:hover]:!shadow-[var(--active-shadow)] [&_.MuiInputBase-root:has(input:focus-visible)]:!shadow-[var(--active-shadow)] [&_.MuiInputBase-root]:transition-all [&_.MuiInputBase-root]:duration-[313ms] [&_.MuiInputBase-root]:ease-out", w = "[&_input::-webkit-calendar-picker-indicator]:cursor-pointer [&_input::-webkit-calendar-picker-indicator]:transition-all [&_input::-webkit-calendar-picker-indicator]:duration-[201ms] [&_input::-webkit-calendar-picker-indicator]:ease-out [&_input::-webkit-calendar-picker-indicator]:!outline-none [&_input::-webkit-calendar-picker-indicator:hover]:shadow-[var(--indicator-shadow)] [&_input::-webkit-calendar-picker-indicator:focus-visible]:shadow-[var(--indicator-shadow)]", b = a(
|
|
7
|
+
h,
|
|
8
|
+
x,
|
|
9
|
+
m,
|
|
10
|
+
w,
|
|
11
|
+
_
|
|
12
|
+
), M = ["text", "password", "email", "date", "number"], B = ({
|
|
13
|
+
borderFocusColor: o,
|
|
67
14
|
// border primary
|
|
68
|
-
type:
|
|
69
|
-
|
|
15
|
+
type: t,
|
|
16
|
+
value: s,
|
|
17
|
+
className: u,
|
|
18
|
+
...e
|
|
70
19
|
}) => {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
u.current.setSelectionRange(r, r);
|
|
88
|
-
}, [m, f, s]), /* @__PURE__ */ x(
|
|
89
|
-
v,
|
|
90
|
-
{
|
|
91
|
-
...w,
|
|
92
|
-
type: o,
|
|
93
|
-
borderFocusColor: t || p.themeColor,
|
|
94
|
-
inputRef: u,
|
|
95
|
-
value: d(s ?? (m || f))[0],
|
|
96
|
-
onChange: S
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
return /* @__PURE__ */ x(v, { borderFocusColor: t || p.themeColor, type: o, ...n });
|
|
20
|
+
const r = l(), p = {
|
|
21
|
+
"--border-color": i.colors.gray,
|
|
22
|
+
"--default-shadow": e.error === !0 ? `inset 0 -5px 4px -4px ${i.colors.error}` : void 0,
|
|
23
|
+
"--active-shadow": t !== "date" && !e.disabled ? `inset 0 -5px 4px -4px ${e.error ? i.colors.error : o || r.themeColor}` : "none",
|
|
24
|
+
"--indicator-shadow": `inset 0 -5px 4px -4px ${o || r.themeColor}, inset 0 5px 4px -4px ${o || r.themeColor}`
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ n(d, { children: /* @__PURE__ */ n(
|
|
27
|
+
c,
|
|
28
|
+
{
|
|
29
|
+
...e,
|
|
30
|
+
type: t && M.includes(t) ? t : "text",
|
|
31
|
+
value: s,
|
|
32
|
+
className: a(b, u),
|
|
33
|
+
style: { ...e.style, ...p }
|
|
34
|
+
}
|
|
35
|
+
) });
|
|
101
36
|
};
|
|
102
37
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
38
|
+
B as Input,
|
|
39
|
+
B as default
|
|
105
40
|
};
|
|
@@ -3,7 +3,8 @@ import { n as B } from "../.chunks/emotion-styled.browser.esm.js";
|
|
|
3
3
|
import { c as g } from "../.chunks/emotion-react.browser.esm.js";
|
|
4
4
|
import { useThemeColors as P } from "../ThemeContext.js";
|
|
5
5
|
import * as f from "react";
|
|
6
|
-
import { a as R, g as T, s as M, r as N,
|
|
6
|
+
import { a as R, g as T, s as M, r as N, c as p, d as z, u as L, P as o, b as V } from "../.chunks/DefaultPropsProvider.js";
|
|
7
|
+
import { c as H } from "../.chunks/clsx.js";
|
|
7
8
|
import { S as E } from "../.chunks/SwitchBase.js";
|
|
8
9
|
import { c as b } from "../.chunks/createSvgIcon.js";
|
|
9
10
|
import { m as F } from "../.chunks/memoTheme.js";
|
|
@@ -27,7 +28,7 @@ const u = R("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "col
|
|
|
27
28
|
size: i
|
|
28
29
|
} = e, s = {
|
|
29
30
|
root: ["root", a && "indeterminate", `color${p(n)}`, `size${p(i)}`]
|
|
30
|
-
}, c =
|
|
31
|
+
}, c = V(s, W, t);
|
|
31
32
|
return {
|
|
32
33
|
...t,
|
|
33
34
|
// forward the disabled and checked classes to the SwitchBase
|
|
@@ -129,7 +130,7 @@ const u = R("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "col
|
|
|
129
130
|
}),
|
|
130
131
|
ownerState: v,
|
|
131
132
|
ref: a,
|
|
132
|
-
className:
|
|
133
|
+
className: H(y.root, j),
|
|
133
134
|
...$,
|
|
134
135
|
classes: y
|
|
135
136
|
});
|
|
@@ -269,7 +270,7 @@ const w = B("div", { shouldForwardProp: (e) => !["customTheme"].includes(e) })((
|
|
|
269
270
|
}
|
|
270
271
|
`}
|
|
271
272
|
`
|
|
272
|
-
})),
|
|
273
|
+
})), ie = ({
|
|
273
274
|
label: e,
|
|
274
275
|
colon: t = !0,
|
|
275
276
|
displayMode: a = !1,
|
|
@@ -290,6 +291,6 @@ const w = B("div", { shouldForwardProp: (e) => !["customTheme"].includes(e) })((
|
|
|
290
291
|
] });
|
|
291
292
|
};
|
|
292
293
|
export {
|
|
293
|
-
|
|
294
|
-
|
|
294
|
+
ie as LabeledCheckbox,
|
|
295
|
+
ie as default
|
|
295
296
|
};
|
|
@@ -12,6 +12,9 @@ export type LabeledDropdownProps = {
|
|
|
12
12
|
minWidth?: string;
|
|
13
13
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
14
|
multiple?: boolean;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
error?: boolean;
|
|
17
|
+
helperText?: string;
|
|
15
18
|
} & AutocompleteProps<DropdownOption, boolean, boolean, boolean>;
|
|
16
19
|
export declare const LabeledDropdown: React.FC<LabeledDropdownProps>;
|
|
17
20
|
export default LabeledDropdown;
|