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
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InputProps } from '../Input';
|
|
2
|
+
import { FormatterFunction, MaskerFunction } from '../utils';
|
|
3
|
+
import { FormInputType } from '../inputTypes';
|
|
4
|
+
export type FormattedInputValue = string | undefined;
|
|
5
|
+
export interface StyleProps {
|
|
6
|
+
grid?: boolean;
|
|
7
|
+
displayMode?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type LabeledFormattedInputProps = InputProps & StyleProps & {
|
|
10
|
+
label?: string;
|
|
11
|
+
noLabel?: boolean;
|
|
12
|
+
limit?: number;
|
|
13
|
+
type?: FormInputType;
|
|
14
|
+
value?: FormattedInputValue;
|
|
15
|
+
defaultValue?: FormattedInputValue;
|
|
16
|
+
masked?: boolean;
|
|
17
|
+
/** Pass a custom formatter, or rely on default formattersByType */
|
|
18
|
+
formatFunction?: FormatterFunction;
|
|
19
|
+
/** Pass a custom masker, or rely on default maskersByType and masked=true */
|
|
20
|
+
maskFunction?: MaskerFunction;
|
|
21
|
+
};
|
|
22
|
+
export declare const LabeledFormattedInput: React.FC<LabeledFormattedInputProps>;
|
|
23
|
+
export default LabeledFormattedInput;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsxs as M, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as R, useState as g, useLayoutEffect as G } from "react";
|
|
3
|
+
import { cn as v } from "../cn.js";
|
|
4
|
+
import { Input as H } from "../Input/Input.js";
|
|
5
|
+
import J from "../theme.js";
|
|
6
|
+
import "../utils.js";
|
|
7
|
+
import { findCursorFromDigitIndex as K } from "../cursorPositioning.js";
|
|
8
|
+
import { Button as Q } from "../Button/Button.js";
|
|
9
|
+
import { formattersByType as W } from "../formatters.js";
|
|
10
|
+
import { maskersByType as X, defaultMasker as Y } from "../maskers.js";
|
|
11
|
+
import { E as Z, a as $ } from "../.chunks/eye.js";
|
|
12
|
+
const ee = "flex flex-nowrap gap-[9px] font-['Roboto',sans-serif]", te = "[&_span]:whitespace-nowrap [&_span]:font-bold", se = "[&_.required]:mx-[2px] [&_.required]:text-[var(--required-color)]", oe = "[&_.MuiTextField-root]:flex-grow", re = "[&_.MuiInputBase-root]:width-[var(--input-base-width)]", ae = "[&_.Mui-disabled]:!cursor-default [&_.Mui-disabled]:!color-inherit [&_.Mui-disabled]:!-webkit-text-fill-color-inherit [&_.Mui-disabled]:!background-transparent [&_.Mui-disabled]:!opacity-100", le = v(
|
|
13
|
+
ee,
|
|
14
|
+
te,
|
|
15
|
+
se,
|
|
16
|
+
oe,
|
|
17
|
+
re
|
|
18
|
+
), ge = ({
|
|
19
|
+
label: q,
|
|
20
|
+
grid: B = !0,
|
|
21
|
+
displayMode: S = !1,
|
|
22
|
+
noLabel: k = !1,
|
|
23
|
+
limit: V,
|
|
24
|
+
type: t,
|
|
25
|
+
value: n,
|
|
26
|
+
defaultValue: C,
|
|
27
|
+
masked: i,
|
|
28
|
+
formatFunction: E,
|
|
29
|
+
maskFunction: _,
|
|
30
|
+
...w
|
|
31
|
+
}) => {
|
|
32
|
+
const N = {
|
|
33
|
+
"--required-color": J.colors.gray,
|
|
34
|
+
"--input-base-width": B ? "100%" : "auto"
|
|
35
|
+
}, o = E ?? (t ? W[t] : void 0);
|
|
36
|
+
let s;
|
|
37
|
+
_ ? s = _ : i && (s = t && X[t] || Y);
|
|
38
|
+
const u = !!(i && s), { onChange: c, onFocus: d, onBlur: p, ...m } = w, f = R(null), h = R(null), [x, y] = g(null), [T, F] = g(!1), [j, D] = g(!1), r = !u || T || j, b = x ?? n ?? C, a = o ? o(b)[0] : String(b ?? ""), L = s ? s(b) : a, P = r ? a : L, z = (e) => {
|
|
39
|
+
const A = e.target.selectionStart ?? 0;
|
|
40
|
+
h.current = e.target.value.slice(0, A).replace(/\D/g, "").length, y(e.target.value), c == null || c(e);
|
|
41
|
+
}, O = (e) => {
|
|
42
|
+
F(!0), d == null || d(e);
|
|
43
|
+
}, U = (e) => {
|
|
44
|
+
F(!1), n !== void 0 && y(null), p == null || p(e);
|
|
45
|
+
};
|
|
46
|
+
G(() => {
|
|
47
|
+
if (!f.current || h.current == null || !r || !o)
|
|
48
|
+
return;
|
|
49
|
+
const e = K(a, h.current);
|
|
50
|
+
f.current.setSelectionRange(e, e);
|
|
51
|
+
}, [C, a, o, r, x, n]);
|
|
52
|
+
const I = u ? r ? Z : $ : null;
|
|
53
|
+
return /* @__PURE__ */ M(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: v("jcLabeledFormattedInput", le, S && ae),
|
|
57
|
+
style: N,
|
|
58
|
+
children: [
|
|
59
|
+
!k && /* @__PURE__ */ M("span", { children: [
|
|
60
|
+
q,
|
|
61
|
+
w.required && /* @__PURE__ */ l("span", { className: "required", children: "*" }),
|
|
62
|
+
":"
|
|
63
|
+
] }),
|
|
64
|
+
/* @__PURE__ */ l(
|
|
65
|
+
H,
|
|
66
|
+
{
|
|
67
|
+
...m,
|
|
68
|
+
type: t,
|
|
69
|
+
inputRef: f,
|
|
70
|
+
value: P,
|
|
71
|
+
onChange: z,
|
|
72
|
+
onFocus: O,
|
|
73
|
+
onBlur: U,
|
|
74
|
+
autoComplete: i ? "off" : void 0,
|
|
75
|
+
className: v(m.className, u && "[&_input]:pr-[20px]"),
|
|
76
|
+
slotProps: { htmlInput: { limit: V }, ...m.slotProps }
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
I && /* @__PURE__ */ l(
|
|
80
|
+
Q,
|
|
81
|
+
{
|
|
82
|
+
variant: "unstyled",
|
|
83
|
+
onClick: () => D((e) => !e),
|
|
84
|
+
className: "!min-w-0 !max-h-[18px] !p-0 opacity-70 !ml-[-27px]",
|
|
85
|
+
children: /* @__PURE__ */ l(I, { size: 18 })
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
export {
|
|
93
|
+
ge as LabeledFormattedInput,
|
|
94
|
+
ge as default
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type LabeledFormattedInputProps } from './LabeledFormattedInput';
|
|
@@ -1,54 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
const c = ["
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
font-family: 'Roboto', sans-serif;
|
|
13
|
-
|
|
14
|
-
span {
|
|
15
|
-
white-space: nowrap;
|
|
16
|
-
font-weight: bold;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.MuiTextField-root {
|
|
20
|
-
flex-grow: 1;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.MuiInputBase-root {
|
|
24
|
-
width: ${o && "100%"};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
${t && e`
|
|
28
|
-
.Mui-disabled {
|
|
29
|
-
color: inherit !important;
|
|
30
|
-
-webkit-text-fill-color: inherit !important;
|
|
31
|
-
background-color: transparent !important;
|
|
32
|
-
opacity: 1 !important;
|
|
33
|
-
cursor: default !important;
|
|
34
|
-
}
|
|
35
|
-
`}
|
|
36
|
-
`
|
|
37
|
-
})), b = ({
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as r } from "../cn.js";
|
|
3
|
+
import { Input as u } from "../Input/Input.js";
|
|
4
|
+
import p from "../theme.js";
|
|
5
|
+
const c = "flex flex-nowrap gap-[9px] font-['Roboto',sans-serif]", b = "[&_span]:whitespace-nowrap [&_span]:font-bold", m = "[&_.required]:mx-[2px] [&_.required]:text-[var(--required-color)]", f = "[&_.MuiTextField-root]:flex-grow", x = "[&_.MuiInputBase-root]:width-[var(--input-base-width)]", h = "[&_.Mui-disabled]:!cursor-default [&_.Mui-disabled]:!color-inherit [&_.Mui-disabled]:!-webkit-text-fill-color-inherit [&_.Mui-disabled]:!background-transparent [&_.Mui-disabled]:!opacity-100", _ = r(
|
|
6
|
+
c,
|
|
7
|
+
b,
|
|
8
|
+
m,
|
|
9
|
+
f,
|
|
10
|
+
x
|
|
11
|
+
), M = ({
|
|
38
12
|
label: o,
|
|
39
|
-
grid:
|
|
40
|
-
displayMode:
|
|
41
|
-
noLabel:
|
|
42
|
-
limit:
|
|
43
|
-
...
|
|
44
|
-
}) =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
":"
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */ s(
|
|
50
|
-
|
|
13
|
+
grid: a = !0,
|
|
14
|
+
displayMode: i = !1,
|
|
15
|
+
noLabel: l = !1,
|
|
16
|
+
limit: n,
|
|
17
|
+
...e
|
|
18
|
+
}) => {
|
|
19
|
+
const d = {
|
|
20
|
+
"--required-color": p.colors.gray,
|
|
21
|
+
"--input-base-width": a ? "100%" : "auto"
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ s(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: r("jcLabeledInput", _, i && h),
|
|
27
|
+
style: d,
|
|
28
|
+
children: [
|
|
29
|
+
!l && /* @__PURE__ */ s("span", { children: [
|
|
30
|
+
o,
|
|
31
|
+
e.required && /* @__PURE__ */ t("span", { className: "required", children: "*" }),
|
|
32
|
+
":"
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ t(u, { ...e, slotProps: { htmlInput: { limit: n } } })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
};
|
|
51
39
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
M as LabeledInput,
|
|
41
|
+
M as default
|
|
54
42
|
};
|
|
@@ -3,7 +3,8 @@ import { n as G } from "../.chunks/emotion-styled.browser.esm.js";
|
|
|
3
3
|
import { c as S } from "../.chunks/emotion-react.browser.esm.js";
|
|
4
4
|
import { useThemeColors as _ } from "../ThemeContext.js";
|
|
5
5
|
import * as l from "react";
|
|
6
|
-
import { s as m, r as I, P as e, a as q, g as A,
|
|
6
|
+
import { s as m, r as I, P as e, a as q, g as A, c as f, d as w, u as W, b as Z } from "../.chunks/DefaultPropsProvider.js";
|
|
7
|
+
import { c as H } from "../.chunks/clsx.js";
|
|
7
8
|
import { S as J } from "../.chunks/SwitchBase.js";
|
|
8
9
|
import { c as B } from "../.chunks/createSvgIcon.js";
|
|
9
10
|
import { m as P } from "../.chunks/memoTheme.js";
|
|
@@ -102,7 +103,7 @@ const x = q("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSe
|
|
|
102
103
|
};
|
|
103
104
|
return {
|
|
104
105
|
...a,
|
|
105
|
-
...
|
|
106
|
+
...Z(r, no, a)
|
|
106
107
|
};
|
|
107
108
|
}, io = m(J, {
|
|
108
109
|
shouldForwardProp: (o) => I(o) || o === "classes",
|
|
@@ -217,7 +218,7 @@ const O = /* @__PURE__ */ n(R, {
|
|
|
217
218
|
checked: h,
|
|
218
219
|
onChange: V,
|
|
219
220
|
ref: t,
|
|
220
|
-
className:
|
|
221
|
+
className: H(k.root, M),
|
|
221
222
|
...L
|
|
222
223
|
});
|
|
223
224
|
});
|
|
@@ -342,7 +343,7 @@ const j = G("div", { shouldForwardProp: (o) => !["customTheme"].includes(o) })((
|
|
|
342
343
|
}
|
|
343
344
|
`}
|
|
344
345
|
`
|
|
345
|
-
})),
|
|
346
|
+
})), So = ({
|
|
346
347
|
label: o,
|
|
347
348
|
colon: a = !0,
|
|
348
349
|
displayMode: t = !1,
|
|
@@ -363,6 +364,6 @@ const j = G("div", { shouldForwardProp: (o) => !["customTheme"].includes(o) })((
|
|
|
363
364
|
] });
|
|
364
365
|
};
|
|
365
366
|
export {
|
|
366
|
-
|
|
367
|
-
|
|
367
|
+
So as LabeledRadio,
|
|
368
|
+
So as default
|
|
368
369
|
};
|
package/Memo/Memo.js
CHANGED
|
@@ -2,8 +2,9 @@ import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { n as e } from "../.chunks/emotion-styled.browser.esm.js";
|
|
3
3
|
import { c as o } from "../.chunks/emotion-react.browser.esm.js";
|
|
4
4
|
import i from "../theme.js";
|
|
5
|
-
import { DetailItemContainer as
|
|
6
|
-
import
|
|
5
|
+
import { DetailItemContainer as p } from "../DetailPageComponents/DetailPageComponents.js";
|
|
6
|
+
import "../utils.js";
|
|
7
|
+
import { formatTimestamp as a } from "../formatters.js";
|
|
7
8
|
const c = e("div")(() => ({
|
|
8
9
|
...o`
|
|
9
10
|
display: flex;
|
|
@@ -33,13 +34,13 @@ const c = e("div")(() => ({
|
|
|
33
34
|
font-size: 18px;
|
|
34
35
|
margin: 0px;
|
|
35
36
|
`
|
|
36
|
-
})),
|
|
37
|
+
})), w = ({ username: n, createDateTime: m, note: s }) => /* @__PURE__ */ r(p, { children: [
|
|
37
38
|
/* @__PURE__ */ r(c, { children: [
|
|
38
39
|
/* @__PURE__ */ t(l, { children: n }),
|
|
39
|
-
/* @__PURE__ */ t(f, { children:
|
|
40
|
+
/* @__PURE__ */ t(f, { children: a(m) })
|
|
40
41
|
] }),
|
|
41
42
|
/* @__PURE__ */ t(d, { children: s })
|
|
42
43
|
] });
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
w as default
|
|
45
46
|
};
|
package/Nav/Nav.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PaginationProps as MuiPaginationProps } from '@mui/material/Pagination';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
-
export
|
|
4
|
-
}
|
|
3
|
+
export type PaginationProps = MuiPaginationProps;
|
|
5
4
|
declare const Pagination: React.FC<PaginationProps>;
|
|
6
5
|
export default Pagination;
|
package/Pagination/Pagination.js
CHANGED
|
@@ -2,7 +2,8 @@ import { jsx as d, jsxs as Z } from "react/jsx-runtime";
|
|
|
2
2
|
import { n as tt } from "../.chunks/emotion-styled.browser.esm.js";
|
|
3
3
|
import { c as at } from "../.chunks/emotion-react.browser.esm.js";
|
|
4
4
|
import * as G from "react";
|
|
5
|
-
import { a as _, g as H, s as B,
|
|
5
|
+
import { a as _, g as H, s as B, d as N, u as q, P as a, c as I, b as J } from "../.chunks/DefaultPropsProvider.js";
|
|
6
|
+
import { c as U } from "../.chunks/clsx.js";
|
|
6
7
|
import { u as et } from "../.chunks/useControlled.js";
|
|
7
8
|
import { i as w } from "../.chunks/integerPropType.js";
|
|
8
9
|
import { u as ot } from "../.chunks/index.js";
|
|
@@ -25,18 +26,18 @@ function it(t = {}) {
|
|
|
25
26
|
hideNextButton: x = !1,
|
|
26
27
|
hidePrevButton: u = !1,
|
|
27
28
|
onChange: g,
|
|
28
|
-
page:
|
|
29
|
+
page: m,
|
|
29
30
|
showFirstButton: T = !1,
|
|
30
31
|
showLastButton: R = !1,
|
|
31
|
-
siblingCount:
|
|
32
|
+
siblingCount: P = 1,
|
|
32
33
|
...O
|
|
33
34
|
} = t, [l, p] = et({
|
|
34
|
-
controlled:
|
|
35
|
+
controlled: m,
|
|
35
36
|
default: y,
|
|
36
37
|
name: o,
|
|
37
38
|
state: "page"
|
|
38
39
|
}), C = (s, i) => {
|
|
39
|
-
|
|
40
|
+
m || p(i), g && g(s, i);
|
|
40
41
|
}, $ = (s, i) => {
|
|
41
42
|
const M = i - s + 1;
|
|
42
43
|
return Array.from({
|
|
@@ -45,18 +46,18 @@ function it(t = {}) {
|
|
|
45
46
|
}, c = $(1, Math.min(e, n)), k = $(Math.max(n - e + 1, e + 1), n), v = Math.max(
|
|
46
47
|
Math.min(
|
|
47
48
|
// Natural start
|
|
48
|
-
l -
|
|
49
|
+
l - P,
|
|
49
50
|
// Lower boundary when page is high
|
|
50
|
-
n - e -
|
|
51
|
+
n - e - P * 2 - 1
|
|
51
52
|
),
|
|
52
53
|
// Greater than startPages
|
|
53
54
|
e + 2
|
|
54
55
|
), f = Math.min(
|
|
55
56
|
Math.max(
|
|
56
57
|
// Natural end
|
|
57
|
-
l +
|
|
58
|
+
l + P,
|
|
58
59
|
// Upper boundary when page is low
|
|
59
|
-
e +
|
|
60
|
+
e + P * 2 + 2
|
|
60
61
|
),
|
|
61
62
|
// Less than endPages
|
|
62
63
|
n - e - 1
|
|
@@ -137,7 +138,7 @@ const r = _("MuiPaginationItem", ["root", "page", "sizeSmall", "sizeLarge", "tex
|
|
|
137
138
|
shape: x,
|
|
138
139
|
type: u,
|
|
139
140
|
variant: g
|
|
140
|
-
} = t,
|
|
141
|
+
} = t, m = {
|
|
141
142
|
root: ["root", `size${I(b)}`, g, x, o !== "standard" && `color${I(o)}`, o !== "standard" && `${g}${I(o)}`, n && "disabled", y && "selected", {
|
|
142
143
|
page: "page",
|
|
143
144
|
first: "firstLast",
|
|
@@ -149,7 +150,7 @@ const r = _("MuiPaginationItem", ["root", "page", "sizeSmall", "sizeLarge", "tex
|
|
|
149
150
|
}[u]],
|
|
150
151
|
icon: ["icon"]
|
|
151
152
|
};
|
|
152
|
-
return J(
|
|
153
|
+
return J(m, rt, e);
|
|
153
154
|
}, gt = B("div", {
|
|
154
155
|
name: "MuiPaginationItem",
|
|
155
156
|
slot: "Root",
|
|
@@ -374,10 +375,10 @@ const r = _("MuiPaginationItem", ["root", "page", "sizeSmall", "sizeLarge", "tex
|
|
|
374
375
|
component: x,
|
|
375
376
|
components: u = {},
|
|
376
377
|
disabled: g = !1,
|
|
377
|
-
page:
|
|
378
|
+
page: m,
|
|
378
379
|
selected: T = !1,
|
|
379
380
|
shape: R = "circular",
|
|
380
|
-
size:
|
|
381
|
+
size: P = "medium",
|
|
381
382
|
slots: O = {},
|
|
382
383
|
slotProps: l = {},
|
|
383
384
|
type: p = "page",
|
|
@@ -389,7 +390,7 @@ const r = _("MuiPaginationItem", ["root", "page", "sizeSmall", "sizeLarge", "tex
|
|
|
389
390
|
disabled: g,
|
|
390
391
|
selected: T,
|
|
391
392
|
shape: R,
|
|
392
|
-
size:
|
|
393
|
+
size: P,
|
|
393
394
|
type: p,
|
|
394
395
|
variant: C
|
|
395
396
|
}, k = ot(), v = ut(c), f = {
|
|
@@ -444,7 +445,7 @@ const r = _("MuiPaginationItem", ["root", "page", "sizeSmall", "sizeLarge", "tex
|
|
|
444
445
|
disabled: g,
|
|
445
446
|
className: U(v.root, y),
|
|
446
447
|
...$,
|
|
447
|
-
children: [p === "page" &&
|
|
448
|
+
children: [p === "page" && m, E ? /* @__PURE__ */ d(vt, {
|
|
448
449
|
...Y,
|
|
449
450
|
className: v.icon,
|
|
450
451
|
as: E
|
|
@@ -584,7 +585,7 @@ const yt = (t) => {
|
|
|
584
585
|
margin: 0,
|
|
585
586
|
listStyle: "none"
|
|
586
587
|
});
|
|
587
|
-
function
|
|
588
|
+
function mt(t, e, o) {
|
|
588
589
|
return t === "page" ? `${o ? "" : "Go to "}page ${e}` : `Go to ${t} page`;
|
|
589
590
|
}
|
|
590
591
|
const X = /* @__PURE__ */ G.forwardRef(function(e, o) {
|
|
@@ -597,10 +598,10 @@ const X = /* @__PURE__ */ G.forwardRef(function(e, o) {
|
|
|
597
598
|
color: x = "standard",
|
|
598
599
|
count: u = 1,
|
|
599
600
|
defaultPage: g = 1,
|
|
600
|
-
disabled:
|
|
601
|
-
getItemAriaLabel: T =
|
|
601
|
+
disabled: m = !1,
|
|
602
|
+
getItemAriaLabel: T = mt,
|
|
602
603
|
hideNextButton: R = !1,
|
|
603
|
-
hidePrevButton:
|
|
604
|
+
hidePrevButton: P = !1,
|
|
604
605
|
onChange: O,
|
|
605
606
|
page: l,
|
|
606
607
|
renderItem: p = (i) => /* @__PURE__ */ d(Q, {
|
|
@@ -624,10 +625,10 @@ const X = /* @__PURE__ */ G.forwardRef(function(e, o) {
|
|
|
624
625
|
color: x,
|
|
625
626
|
count: u,
|
|
626
627
|
defaultPage: g,
|
|
627
|
-
disabled:
|
|
628
|
+
disabled: m,
|
|
628
629
|
getItemAriaLabel: T,
|
|
629
630
|
hideNextButton: R,
|
|
630
|
-
hidePrevButton:
|
|
631
|
+
hidePrevButton: P,
|
|
631
632
|
renderItem: p,
|
|
632
633
|
shape: C,
|
|
633
634
|
showFirstButton: $,
|
|
@@ -772,9 +773,9 @@ process.env.NODE_ENV !== "production" && (X.propTypes = {
|
|
|
772
773
|
*/
|
|
773
774
|
variant: a.oneOfType([a.oneOf(["outlined", "text"]), a.string])
|
|
774
775
|
});
|
|
775
|
-
const
|
|
776
|
+
const Pt = tt(X)(() => ({
|
|
776
777
|
...at``
|
|
777
|
-
})),
|
|
778
|
+
})), Bt = (t) => /* @__PURE__ */ d(Pt, { ...t });
|
|
778
779
|
export {
|
|
779
|
-
|
|
780
|
+
Bt as default
|
|
780
781
|
};
|
package/README.md
CHANGED
|
@@ -169,9 +169,9 @@ if (variant === 2) return <ButtonBase className={button2Classes} {...props}>{chi
|
|
|
169
169
|
**Why this pattern:**
|
|
170
170
|
- **Readable** — each variant's full visual definition is in one place, not scattered across JSX
|
|
171
171
|
- **Scannable** — you can compare two variants by looking at two adjacent constants
|
|
172
|
-
- **Composable** — use `
|
|
172
|
+
- **Composable** — use `cn()` (from `utils/cn`) to merge base classes with conditional classes:
|
|
173
173
|
```tsx
|
|
174
|
-
className={
|
|
174
|
+
className={cn(baseClasses, active ? activeClasses : inactiveClasses)}
|
|
175
175
|
```
|
|
176
176
|
- **Static** — Tailwind's build can scan these constants for class names (unlike template literals with dynamic interpolation)
|
|
177
177
|
|
|
@@ -210,18 +210,20 @@ const cardClasses = 'rounded-lg p-4 bg-white shadow-md';
|
|
|
210
210
|
|
|
211
211
|
The `display: contents` wrapper is invisible to layout but provides a CSS scope for the custom properties. This avoids Emotion entirely for dynamic values.
|
|
212
212
|
|
|
213
|
-
**Conditional classes** — use `
|
|
213
|
+
**Conditional classes** — use `cn` from `utils/cn`:
|
|
214
214
|
|
|
215
215
|
```tsx
|
|
216
|
-
import
|
|
216
|
+
import { cn } from 'utils/cn';
|
|
217
217
|
|
|
218
|
-
<button className={
|
|
218
|
+
<button className={cn(
|
|
219
219
|
baseClasses,
|
|
220
220
|
active ? '!bg-black !text-white' : '!bg-white !text-black',
|
|
221
221
|
)}>
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
`cn` wraps `clsx` with [`tailwind-merge`](https://github.com/dcastil/tailwind-merge), which deduplicates conflicting Tailwind utilities — the later class in the composition wins. This is what makes consumer `className` overrides reliable: when an app passes `<Button className="h-[3rem]">`, twMerge strips any earlier `h-*` class from the lib's internal composition. **Always use `cn` for className composition in lib components. Don't import `clsx` directly — it lives inside `cn.ts` as an internal dep.**
|
|
225
|
+
|
|
226
|
+
**MUI overrides** — use `!important` prefix (`!bg-*`, `!text-*`) **only** when a Tailwind class needs to defeat MUI's emitted stylesheet during the transition period. The `!` prefix is *not* needed for lib-vs-consumer arbitration — that layer is handled by `cn`/`tailwind-merge` (later classes in the composition win regardless of `!`). Once a component is fully off MUI, the `!` prefixes can be removed.
|
|
225
227
|
|
|
226
228
|
### Tailwind CSS output
|
|
227
229
|
|
|
@@ -246,6 +248,8 @@ With Tailwind, consuming apps can extend or override a library component's style
|
|
|
246
248
|
|
|
247
249
|
This works because Tailwind classes are just CSS classes. The consuming app's Tailwind build scans its own source files, generates the utilities, and they merge naturally with the library's classes. The consumer has full control without the library needing to expose a `style` or `className` forwarding prop for every visual property.
|
|
248
250
|
|
|
251
|
+
**How conflicts resolve:** Lib components compose their internal classes via `cn` (which wraps `clsx` with `tailwind-merge`). The convention is `cn(internalClasses, consumerClassName)` — consumer last, so it wins on Tailwind conflicts via twMerge and drops any conflicting lib class, even `!important`-prefixed ones. `<Button className="h-[3rem]">` reliably overrides the lib's internal height with no specificity-juggling required from the consumer. Individual components may invert this order intentionally when an internal class is structurally required to win — for example, `LabeledFormattedInput` places its masked-input right-padding *after* the caller's className so the reveal-eye icon always has room. Treat the consumer-last order as the convention, not a guarantee — check the component's source if you need to know for certain.
|
|
252
|
+
|
|
249
253
|
**Why this replaces the `style` prop pattern:**
|
|
250
254
|
|
|
251
255
|
The common pattern across our apps has been passing inline `style={{}}` objects to customize component appearance:
|
|
@@ -370,6 +374,7 @@ The library also auto-publishes on merges to master via the CI pipeline.
|
|
|
370
374
|
1. Create the component folder: `src/components/base/MyComponent/`
|
|
371
375
|
2. Create the component: `MyComponent.tsx`
|
|
372
376
|
3. Create stories: `MyComponent.stories.tsx`
|
|
377
|
+
- For Tailwind-migrated components that accept caller `className` and/or `style`, expose both as Storybook arg controls so consumers can preview override behavior (e.g., `className="h-[13rem]"`, `style={{ outline: '2px solid red' }}`). `WelcomeCard.stories.tsx` is a known follow-up: its Playground does not yet expose these controls.
|
|
373
378
|
4. Create barrel export: `index.ts` — `export { default, type MyComponentProps } from './MyComponent';`
|
|
374
379
|
5. Add to the main barrel: `src/components/index.ts` — `export { default as MyComponent } from './base/MyComponent';`
|
|
375
380
|
6. Build and test locally (see above)
|
package/Stepper/Stepper.js
CHANGED
|
@@ -7,7 +7,8 @@ import { k as A, c as P } from "../.chunks/emotion-react.browser.esm.js";
|
|
|
7
7
|
import { Button as q } from "../Button/Button.js";
|
|
8
8
|
import { SlideOut as J, SlideIn as Q, SlideInReverse as z, SlideOutReverse as W } from "../animation/Slide/Slide.js";
|
|
9
9
|
import { useThemeColors as Z } from "../ThemeContext.js";
|
|
10
|
-
import { g as V, a as _, s as g,
|
|
10
|
+
import { g as V, a as _, s as g, c as f, u as F, P as o, b as K, l as rr, f as er, h as tr } from "../.chunks/DefaultPropsProvider.js";
|
|
11
|
+
import { c as O } from "../.chunks/clsx.js";
|
|
11
12
|
import { m as w } from "../.chunks/memoTheme.js";
|
|
12
13
|
import { P as or } from "../.chunks/Paper.js";
|
|
13
14
|
import { u as ar } from "../.chunks/index.js";
|
|
@@ -672,7 +673,7 @@ const Cr = R("div", {
|
|
|
672
673
|
width: 100%;
|
|
673
674
|
height: 100%;
|
|
674
675
|
`
|
|
675
|
-
})),
|
|
676
|
+
})), Tr = ({
|
|
676
677
|
onNext: e,
|
|
677
678
|
onBack: r,
|
|
678
679
|
onFinish: t,
|
|
@@ -730,5 +731,5 @@ const Cr = R("div", {
|
|
|
730
731
|
] });
|
|
731
732
|
};
|
|
732
733
|
export {
|
|
733
|
-
|
|
734
|
+
Tr as default
|
|
734
735
|
};
|
package/Table/Table.d.ts
CHANGED
|
@@ -28,12 +28,14 @@ export interface SortableCell {
|
|
|
28
28
|
/** The numeric value used for sorting when the column header is clicked. Lower numbers sort first in ascending order. */
|
|
29
29
|
sortPriority: number;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/** Shape that a Table row must satisfy: a string-keyed record of arbitrary cell values. */
|
|
32
|
+
export type TableRow = Record<string, unknown>;
|
|
33
|
+
export interface TableProps<T extends TableRow = TableRow> {
|
|
34
|
+
data: T[];
|
|
33
35
|
columnTitles?: Record<string, string>;
|
|
34
36
|
rowsPerPage?: number;
|
|
35
37
|
title?: string;
|
|
36
|
-
onRowClick?: (row:
|
|
38
|
+
onRowClick?: (row: T) => void;
|
|
37
39
|
hiddenColumns?: string[];
|
|
38
40
|
defaultSort?: {
|
|
39
41
|
key: string;
|
|
@@ -52,7 +54,7 @@ export interface TableProps {
|
|
|
52
54
|
persistKey?: string;
|
|
53
55
|
/** Custom renderers for specific columns. Only applied to visible rows — not used for sorting, filtering, or export.
|
|
54
56
|
* Use this for React components (like live Timers) that should only mount on the current page. */
|
|
55
|
-
cellRenderers?: Record<string, (value:
|
|
57
|
+
cellRenderers?: Record<string, (value: unknown, row: T) => React.ReactNode>;
|
|
56
58
|
}
|
|
57
|
-
declare
|
|
59
|
+
declare function DataTable<T extends TableRow = TableRow>({ data, columnTitles, rowsPerPage, title, onRowClick, hiddenColumns, defaultSort, extraActions, notSearchableColumns, notSortableColumns, notExportableColumns, scrollable, scrollableMinWidth, stickyColumns, columnOrder, persistKey, cellRenderers, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
58
60
|
export default DataTable;
|