@deepnoid/ui 0.1.0 → 0.1.2
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/.turbo/turbo-build.log +173 -173
- package/dist/{chunk-VWMXZUR2.mjs → chunk-2TJDQIKB.mjs} +1 -1
- package/dist/{chunk-IE2BRM7Z.mjs → chunk-2ZT6V4QR.mjs} +0 -9
- package/dist/{chunk-PKVQXVCS.mjs → chunk-56VCX2QR.mjs} +1 -1
- package/dist/{chunk-UAMIPCUD.mjs → chunk-AMA53H3C.mjs} +2 -2
- package/dist/{chunk-XAA5KY6A.mjs → chunk-CF6O6TCF.mjs} +1 -1
- package/dist/{chunk-3AMZ55Y6.mjs → chunk-DNFBQYVG.mjs} +3 -3
- package/dist/{chunk-QNA2GDTN.mjs → chunk-GLBASISV.mjs} +1 -1
- package/dist/{chunk-QJHZJRSQ.mjs → chunk-HKXUNG3H.mjs} +1 -1
- package/dist/{chunk-XTGRSVYO.mjs → chunk-J5WJD6XZ.mjs} +1 -1
- package/dist/{chunk-MW6Y3FSE.mjs → chunk-KWWYMTJP.mjs} +4 -4
- package/dist/chunk-M2IRRTFM.mjs +79 -0
- package/dist/{chunk-Q5WACGVP.mjs → chunk-N4F3R6HG.mjs} +1 -1
- package/dist/chunk-OELLMF2V.mjs +283 -0
- package/dist/{chunk-WQBOPCH6.mjs → chunk-ON5SGXHZ.mjs} +1 -1
- package/dist/chunk-OQS4LGZK.mjs +27 -0
- package/dist/chunk-OYNGJ33M.mjs +285 -0
- package/dist/{chunk-KCYJYS66.mjs → chunk-RCU5MLBU.mjs} +1 -1
- package/dist/{chunk-X2MQCISM.mjs → chunk-S65S7QZ5.mjs} +1 -1
- package/dist/chunk-TMSBICKB.mjs +314 -0
- package/dist/{chunk-RRL6KBU4.mjs → chunk-U2YKMXVG.mjs} +1 -1
- package/dist/{chunk-CATOSBI7.mjs → chunk-VP3NVHFU.mjs} +2 -2
- package/dist/{chunk-VBFXKJTI.mjs → chunk-VRGHUYRU.mjs} +2 -2
- package/dist/{chunk-5S4XGPBB.mjs → chunk-VVOOYDJS.mjs} +1 -1
- package/dist/{chunk-FYJZ7Q5L.mjs → chunk-XIHAABHB.mjs} +1 -1
- package/dist/{chunk-2HSK6XGZ.mjs → chunk-YZNQ2QGK.mjs} +1 -1
- package/dist/{chunk-P5WT7WJO.mjs → chunk-ZEZ6ZA3N.mjs} +1 -1
- package/dist/components/avatar/avatar.js +0 -9
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +0 -9
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/backdrop/backdrop.js +0 -9
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.js +0 -9
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +0 -9
- package/dist/components/breadcrumb/breadcrumb.mjs +2 -2
- package/dist/components/breadcrumb/index.js +0 -9
- package/dist/components/breadcrumb/index.mjs +2 -2
- package/dist/components/button/button-group.js +0 -9
- package/dist/components/button/button-group.mjs +2 -2
- package/dist/components/button/button.js +0 -9
- package/dist/components/button/button.mjs +2 -2
- package/dist/components/button/index.js +0 -9
- package/dist/components/button/index.mjs +3 -3
- package/dist/components/checkbox/checkbox.js +0 -9
- package/dist/components/checkbox/checkbox.mjs +2 -2
- package/dist/components/checkbox/index.js +0 -9
- package/dist/components/checkbox/index.mjs +2 -2
- package/dist/components/chip/chip.js +0 -9
- package/dist/components/chip/chip.mjs +2 -2
- package/dist/components/chip/index.js +0 -9
- package/dist/components/chip/index.mjs +2 -2
- package/dist/components/dateTimePicker/calendar.js +0 -9
- package/dist/components/dateTimePicker/calendar.mjs +2 -2
- package/dist/components/dateTimePicker/dateTimePicker.js +0 -9
- package/dist/components/dateTimePicker/dateTimePicker.mjs +7 -7
- package/dist/components/dateTimePicker/index.js +0 -9
- package/dist/components/dateTimePicker/index.mjs +7 -7
- package/dist/components/dateTimePicker/timePicker.js +0 -9
- package/dist/components/dateTimePicker/timePicker.mjs +5 -5
- package/dist/components/input/index.d.mts +1 -1
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/input/index.js +429 -379
- package/dist/components/input/index.mjs +3 -2
- package/dist/components/input/input.d.mts +96 -81
- package/dist/components/input/input.d.ts +96 -81
- package/dist/components/input/input.js +429 -379
- package/dist/components/input/input.mjs +3 -2
- package/dist/components/list/index.js +0 -9
- package/dist/components/list/index.mjs +4 -4
- package/dist/components/list/list.js +0 -9
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.js +0 -9
- package/dist/components/list/listItem.mjs +3 -3
- package/dist/components/modal/index.js +0 -9
- package/dist/components/modal/index.mjs +4 -4
- package/dist/components/modal/modal.js +0 -9
- package/dist/components/modal/modal.mjs +4 -4
- package/dist/components/pagination/index.d.mts +1 -1
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/pagination/index.js +320 -292
- package/dist/components/pagination/index.mjs +4 -3
- package/dist/components/pagination/pagination.d.mts +39 -95
- package/dist/components/pagination/pagination.d.ts +39 -95
- package/dist/components/pagination/pagination.js +322 -296
- package/dist/components/pagination/pagination.mjs +6 -7
- package/dist/components/radio/index.js +0 -9
- package/dist/components/radio/index.mjs +2 -2
- package/dist/components/radio/radio.js +0 -9
- package/dist/components/radio/radio.mjs +2 -2
- package/dist/components/select/index.js +0 -9
- package/dist/components/select/index.mjs +3 -3
- package/dist/components/select/option.js +0 -9
- package/dist/components/select/option.mjs +2 -2
- package/dist/components/select/select.js +0 -9
- package/dist/components/select/select.mjs +3 -3
- package/dist/components/table/index.js +1193 -775
- package/dist/components/table/index.mjs +10 -5
- package/dist/components/table/table-body.d.mts +10 -16
- package/dist/components/table/table-body.d.ts +10 -16
- package/dist/components/table/table-body.js +54 -3792
- package/dist/components/table/table-body.mjs +3 -6
- package/dist/components/table/table-head.d.mts +4 -6
- package/dist/components/table/table-head.d.ts +4 -6
- package/dist/components/table/table-head.js +6 -44
- package/dist/components/table/table-head.mjs +3 -3
- package/dist/components/table/table.d.mts +91 -231
- package/dist/components/table/table.d.ts +91 -231
- package/dist/components/table/table.js +1193 -775
- package/dist/components/table/table.mjs +10 -5
- package/dist/components/tabs/index.js +0 -9
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.js +0 -9
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/toast/index.js +0 -9
- package/dist/components/toast/index.mjs +3 -3
- package/dist/components/toast/toast.js +0 -9
- package/dist/components/toast/toast.mjs +2 -2
- package/dist/components/toast/use-toast.js +0 -9
- package/dist/components/toast/use-toast.mjs +3 -3
- package/dist/components/tooltip/index.js +0 -9
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.js +0 -9
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/index.js +822 -958
- package/dist/index.mjs +56 -56
- package/dist/utils/tailwind-variants.js +0 -9
- package/dist/utils/tailwind-variants.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-5IQKKLZY.mjs +0 -139
- package/dist/chunk-PFYYYUJW.mjs +0 -56
- package/dist/chunk-RQ76IOYC.mjs +0 -300
- package/dist/chunk-SK2A72R2.mjs +0 -263
- package/dist/chunk-YGOEKSNZ.mjs +0 -345
package/dist/index.js
CHANGED
|
@@ -3929,35 +3929,30 @@ var fontSize = {
|
|
|
3929
3929
|
h1: [
|
|
3930
3930
|
"40px",
|
|
3931
3931
|
{
|
|
3932
|
-
letterSpacing: "-2%",
|
|
3933
3932
|
fontWeight: "700"
|
|
3934
3933
|
}
|
|
3935
3934
|
],
|
|
3936
3935
|
h2: [
|
|
3937
3936
|
"34px",
|
|
3938
3937
|
{
|
|
3939
|
-
letterSpacing: "-2%",
|
|
3940
3938
|
fontWeight: "700"
|
|
3941
3939
|
}
|
|
3942
3940
|
],
|
|
3943
3941
|
h3: [
|
|
3944
3942
|
"28px",
|
|
3945
3943
|
{
|
|
3946
|
-
letterSpacing: "-2%",
|
|
3947
3944
|
fontWeight: "700"
|
|
3948
3945
|
}
|
|
3949
3946
|
],
|
|
3950
3947
|
h4: [
|
|
3951
3948
|
"24px",
|
|
3952
3949
|
{
|
|
3953
|
-
letterSpacing: "-2%",
|
|
3954
3950
|
fontWeight: "700"
|
|
3955
3951
|
}
|
|
3956
3952
|
],
|
|
3957
3953
|
h5: [
|
|
3958
3954
|
"20px",
|
|
3959
3955
|
{
|
|
3960
|
-
letterSpacing: "-2%",
|
|
3961
3956
|
fontWeight: "600"
|
|
3962
3957
|
}
|
|
3963
3958
|
],
|
|
@@ -3965,7 +3960,6 @@ var fontSize = {
|
|
|
3965
3960
|
"12px",
|
|
3966
3961
|
{
|
|
3967
3962
|
lineHeight: "18px",
|
|
3968
|
-
letterSpacing: "-2%",
|
|
3969
3963
|
fontWeight: "400"
|
|
3970
3964
|
}
|
|
3971
3965
|
],
|
|
@@ -3973,7 +3967,6 @@ var fontSize = {
|
|
|
3973
3967
|
"14px",
|
|
3974
3968
|
{
|
|
3975
3969
|
lineHeight: "21px",
|
|
3976
|
-
letterSpacing: "-2%",
|
|
3977
3970
|
fontWeight: "400"
|
|
3978
3971
|
}
|
|
3979
3972
|
],
|
|
@@ -3981,7 +3974,6 @@ var fontSize = {
|
|
|
3981
3974
|
"16px",
|
|
3982
3975
|
{
|
|
3983
3976
|
lineHeight: "24px",
|
|
3984
|
-
letterSpacing: "-2%",
|
|
3985
3977
|
fontWeight: "400"
|
|
3986
3978
|
}
|
|
3987
3979
|
],
|
|
@@ -3989,7 +3981,6 @@ var fontSize = {
|
|
|
3989
3981
|
"18px",
|
|
3990
3982
|
{
|
|
3991
3983
|
lineHeight: "27px",
|
|
3992
|
-
letterSpacing: "-2%",
|
|
3993
3984
|
fontWeight: "400"
|
|
3994
3985
|
}
|
|
3995
3986
|
]
|
|
@@ -4977,45 +4968,54 @@ var buttonGroup = tv({
|
|
|
4977
4968
|
|
|
4978
4969
|
// src/components/input/input.tsx
|
|
4979
4970
|
var import_react7 = __toESM(require("react"));
|
|
4971
|
+
|
|
4972
|
+
// src/utils/clsx.ts
|
|
4973
|
+
function clsx(...args) {
|
|
4974
|
+
var i = 0, tmp, x, str = "";
|
|
4975
|
+
while (i < args.length) {
|
|
4976
|
+
if (tmp = args[i++]) {
|
|
4977
|
+
if (x = toVal(tmp)) {
|
|
4978
|
+
str && (str += " ");
|
|
4979
|
+
str += x;
|
|
4980
|
+
}
|
|
4981
|
+
}
|
|
4982
|
+
}
|
|
4983
|
+
return str;
|
|
4984
|
+
}
|
|
4985
|
+
function toVal(mix) {
|
|
4986
|
+
var k, y, str = "";
|
|
4987
|
+
if (typeof mix === "string" || typeof mix === "number") {
|
|
4988
|
+
str += mix;
|
|
4989
|
+
} else if (typeof mix === "object") {
|
|
4990
|
+
if (Array.isArray(mix)) {
|
|
4991
|
+
var len = mix.length;
|
|
4992
|
+
for (k = 0; k < len; k++) {
|
|
4993
|
+
if (mix[k]) {
|
|
4994
|
+
if (y = toVal(mix[k])) {
|
|
4995
|
+
str && (str += " ");
|
|
4996
|
+
str += y;
|
|
4997
|
+
}
|
|
4998
|
+
}
|
|
4999
|
+
}
|
|
5000
|
+
} else {
|
|
5001
|
+
for (y in mix) {
|
|
5002
|
+
if (mix[y]) {
|
|
5003
|
+
str && (str += " ");
|
|
5004
|
+
str += y;
|
|
5005
|
+
}
|
|
5006
|
+
}
|
|
5007
|
+
}
|
|
5008
|
+
}
|
|
5009
|
+
return str;
|
|
5010
|
+
}
|
|
5011
|
+
|
|
5012
|
+
// src/components/input/input.tsx
|
|
4980
5013
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
4981
5014
|
var Input = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
4982
5015
|
const [props, variantProps] = mapPropsVariants(originalProps, inputStyle.variantKeys);
|
|
4983
|
-
const { classNames, label,
|
|
5016
|
+
const { classNames, label, helperText, errorText, startContent, endContent, ...inputProps } = props;
|
|
4984
5017
|
const inputRef = (0, import_react7.useRef)(null);
|
|
4985
5018
|
const slots = (0, import_react7.useMemo)(() => inputStyle({ ...variantProps }), [variantProps]);
|
|
4986
|
-
const getBaseProps = (0, import_react7.useCallback)(
|
|
4987
|
-
() => ({
|
|
4988
|
-
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
4989
|
-
}),
|
|
4990
|
-
[slots, classNames]
|
|
4991
|
-
);
|
|
4992
|
-
const getLabelProps = (0, import_react7.useCallback)(
|
|
4993
|
-
() => ({
|
|
4994
|
-
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
4995
|
-
}),
|
|
4996
|
-
[slots, classNames]
|
|
4997
|
-
);
|
|
4998
|
-
const getInnerWrapperProps = (0, import_react7.useCallback)(
|
|
4999
|
-
() => ({
|
|
5000
|
-
className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
|
|
5001
|
-
}),
|
|
5002
|
-
[slots, classNames]
|
|
5003
|
-
);
|
|
5004
|
-
const getInputWrapperProps = (0, import_react7.useCallback)(
|
|
5005
|
-
() => ({
|
|
5006
|
-
className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper })
|
|
5007
|
-
}),
|
|
5008
|
-
[slots, classNames]
|
|
5009
|
-
);
|
|
5010
|
-
const getInputProps = (0, import_react7.useCallback)(
|
|
5011
|
-
() => ({
|
|
5012
|
-
...inputProps,
|
|
5013
|
-
ref: ref || inputRef,
|
|
5014
|
-
className: slots.input({ class: classNames == null ? void 0 : classNames.input }),
|
|
5015
|
-
size: 0
|
|
5016
|
-
}),
|
|
5017
|
-
[slots, classNames, inputProps, ref]
|
|
5018
|
-
);
|
|
5019
5019
|
const getContentProps = (0, import_react7.useCallback)(
|
|
5020
5020
|
() => ({
|
|
5021
5021
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
@@ -5023,12 +5023,6 @@ var Input = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
5023
5023
|
}),
|
|
5024
5024
|
[slots, classNames, originalProps.size]
|
|
5025
5025
|
);
|
|
5026
|
-
const getErrorMessageProps = (0, import_react7.useCallback)(
|
|
5027
|
-
() => ({
|
|
5028
|
-
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
5029
|
-
}),
|
|
5030
|
-
[slots, classNames]
|
|
5031
|
-
);
|
|
5032
5026
|
const renderStartContent = () => {
|
|
5033
5027
|
if (import_react7.default.isValidElement(startContent)) {
|
|
5034
5028
|
const existingProps = startContent.props;
|
|
@@ -5062,7 +5056,7 @@ var Input = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
5062
5056
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
5063
5057
|
};
|
|
5064
5058
|
return import_react7.default.cloneElement(endContent, mergedProps);
|
|
5065
|
-
} else if (
|
|
5059
|
+
} else if (errorText) {
|
|
5066
5060
|
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
5067
5061
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ...iconProps, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|
|
5068
5062
|
} else {
|
|
@@ -5081,146 +5075,204 @@ var Input = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
|
5081
5075
|
return renderContentWithIcon();
|
|
5082
5076
|
}
|
|
5083
5077
|
};
|
|
5084
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
5079
|
+
"div",
|
|
5080
|
+
{
|
|
5081
|
+
className: clsx(
|
|
5082
|
+
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
5083
|
+
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
5084
|
+
),
|
|
5085
|
+
children: [
|
|
5086
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
5087
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper }), children: [
|
|
5088
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
5089
|
+
"div",
|
|
5090
|
+
{
|
|
5091
|
+
className: clsx(
|
|
5092
|
+
slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
5093
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
5094
|
+
),
|
|
5095
|
+
children: [
|
|
5096
|
+
startContent && renderStartContent(),
|
|
5097
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { ...inputProps, ref: ref || inputRef, className: slots.input({ class: classNames == null ? void 0 : classNames.input }), size: 0 }),
|
|
5098
|
+
renderEndContent()
|
|
5099
|
+
]
|
|
5100
|
+
}
|
|
5101
|
+
),
|
|
5102
|
+
helperText && !errorText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
|
|
5103
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
|
|
5104
|
+
] })
|
|
5105
|
+
]
|
|
5106
|
+
}
|
|
5107
|
+
);
|
|
5095
5108
|
});
|
|
5096
5109
|
Input.displayName = "Input";
|
|
5097
5110
|
var input_default = Input;
|
|
5098
5111
|
var inputStyle = tv({
|
|
5099
5112
|
slots: {
|
|
5100
|
-
base: ["group/input", "flex"
|
|
5101
|
-
|
|
5113
|
+
base: ["group/input", "flex"],
|
|
5114
|
+
vertical: ["flex-col"],
|
|
5115
|
+
horizon: ["flex-row", "gap-0"],
|
|
5116
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
5102
5117
|
innerWrapper: ["flex", "flex-col"],
|
|
5103
|
-
inputWrapper: [
|
|
5118
|
+
inputWrapper: ["flex", "items-center", "transition", "duration-200", "group-has-[p.error]/input:bg-danger-soft"],
|
|
5119
|
+
input: [
|
|
5120
|
+
"w-full",
|
|
5121
|
+
"h-full",
|
|
5122
|
+
"bg-transparent",
|
|
5123
|
+
"text-neutral-main",
|
|
5124
|
+
"placeholder:text-neutral-main",
|
|
5125
|
+
"focus:outline-none",
|
|
5126
|
+
"focus:ring-0",
|
|
5127
|
+
"group-has-[:hover]/input:text-neutral-dark",
|
|
5128
|
+
"group-has-[:hover]/input:placeholder:text-neutral-dark",
|
|
5129
|
+
"group-has-[:focus]/input:text-neutral-dark",
|
|
5130
|
+
"group-has-[:focus]/input:placeholder:text-neutral-dark",
|
|
5131
|
+
"group-has-[p.error]/input:text-danger-main",
|
|
5132
|
+
"group-has-[p.error]/input:placeholder:text-danger-main"
|
|
5133
|
+
],
|
|
5134
|
+
content: [
|
|
5104
5135
|
"flex",
|
|
5105
5136
|
"items-center",
|
|
5106
|
-
"
|
|
5107
|
-
"
|
|
5108
|
-
"group-has-[
|
|
5109
|
-
"group-has-[p]/input:
|
|
5137
|
+
"select-none",
|
|
5138
|
+
"text-neutral-main",
|
|
5139
|
+
"group-has-[:hover]/input:text-neutral-dark",
|
|
5140
|
+
"group-has-[p.error]/input:text-danger-main"
|
|
5110
5141
|
],
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5142
|
+
helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
|
|
5143
|
+
errorText: ["text-danger-main"],
|
|
5144
|
+
readonly: ["pointer-events-none"]
|
|
5114
5145
|
},
|
|
5115
5146
|
variants: {
|
|
5116
5147
|
variant: {
|
|
5117
5148
|
solid: {
|
|
5118
|
-
inputWrapper: ["
|
|
5149
|
+
inputWrapper: ["!border-transparent", "bg-trans-soft", "group-has-[:focus]/input:text-body-foreground"],
|
|
5150
|
+
readonly: ["!bg-trans-light"]
|
|
5119
5151
|
},
|
|
5120
|
-
|
|
5152
|
+
outline: {
|
|
5121
5153
|
inputWrapper: [
|
|
5122
|
-
"
|
|
5123
|
-
"
|
|
5124
|
-
"
|
|
5125
|
-
"
|
|
5126
|
-
|
|
5127
|
-
]
|
|
5154
|
+
"border-neutral-light",
|
|
5155
|
+
"group-has-[:hover]/input:bg-trans-soft",
|
|
5156
|
+
"group-has-[:focus]/input:bg-body-background",
|
|
5157
|
+
"group-has-[p.error]/input:border-danger-main"
|
|
5158
|
+
],
|
|
5159
|
+
readonly: ["!bg-trans-soft"]
|
|
5128
5160
|
},
|
|
5129
|
-
|
|
5161
|
+
underline: {
|
|
5130
5162
|
inputWrapper: [
|
|
5131
5163
|
"bg-transparent",
|
|
5132
|
-
"border-b",
|
|
5133
|
-
"border-neutral-main",
|
|
5134
5164
|
"!rounded-none",
|
|
5135
|
-
"
|
|
5136
|
-
"
|
|
5137
|
-
|
|
5165
|
+
"!border-t-transparent",
|
|
5166
|
+
"!border-l-transparent",
|
|
5167
|
+
"!border-r-transparent",
|
|
5168
|
+
"group-has-[:hover]/input:bg-trans-soft",
|
|
5169
|
+
"group-has-[:focus]/input:bg-body-background",
|
|
5170
|
+
"group-has-[p.error]/input:border-danger-main"
|
|
5171
|
+
],
|
|
5172
|
+
readonly: ["!bg-trans-soft"]
|
|
5138
5173
|
}
|
|
5139
5174
|
},
|
|
5140
5175
|
color: {
|
|
5141
5176
|
primary: {
|
|
5142
|
-
|
|
5143
|
-
|
|
5177
|
+
content: [
|
|
5178
|
+
"group-has-[:focus]/input:text-primary-main",
|
|
5179
|
+
"!group-has-[p.error]:not(input:focus):hover/input:text-primary-main"
|
|
5180
|
+
],
|
|
5181
|
+
helperText: [
|
|
5182
|
+
"group-has-[:focus]/input:text-primary-main",
|
|
5183
|
+
"group-has-[:focus:hover]/input:text-primary-main",
|
|
5184
|
+
"group-has-[:focus]/input:hover:text-primary-main"
|
|
5185
|
+
]
|
|
5144
5186
|
},
|
|
5145
5187
|
secondary: {
|
|
5146
|
-
|
|
5147
|
-
|
|
5188
|
+
content: [
|
|
5189
|
+
"group-has-[:focus]/input:text-secondary-main",
|
|
5190
|
+
"!group-has-[p.error]:not(input:focus):hover/input:text-secondary-main"
|
|
5191
|
+
],
|
|
5192
|
+
helperText: [
|
|
5193
|
+
"group-has-[:focus]/input:text-secondary-main",
|
|
5194
|
+
"group-has-[:focus:hover]/input:text-secondary-main",
|
|
5195
|
+
"group-has-[:focus]/input:hover:text-secondary-main"
|
|
5196
|
+
]
|
|
5148
5197
|
}
|
|
5149
5198
|
},
|
|
5150
5199
|
size: {
|
|
5151
5200
|
sm: {
|
|
5152
|
-
base: ["text-sm", "gap-[
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5201
|
+
base: ["text-sm", "gap-[4px]"],
|
|
5202
|
+
label: ["text-sm"],
|
|
5203
|
+
innerWrapper: ["gap-[4px]"],
|
|
5204
|
+
inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]", "border-sm"],
|
|
5205
|
+
helperText: ["text-sm"],
|
|
5206
|
+
errorText: ["text-sm"]
|
|
5156
5207
|
},
|
|
5157
5208
|
md: {
|
|
5158
|
-
base: ["text-md", "gap-[
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5209
|
+
base: ["text-md", "gap-[6px]"],
|
|
5210
|
+
label: ["text-md"],
|
|
5211
|
+
innerWrapper: ["gap-[6px]"],
|
|
5212
|
+
inputWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]", "border-md"],
|
|
5213
|
+
helperText: ["text-sm"],
|
|
5214
|
+
errorText: ["text-sm"]
|
|
5162
5215
|
},
|
|
5163
5216
|
lg: {
|
|
5164
|
-
base: ["text-lg", "gap-[
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5217
|
+
base: ["text-lg", "gap-[8px]"],
|
|
5218
|
+
label: ["text-lg"],
|
|
5219
|
+
innerWrapper: ["gap-[8px]"],
|
|
5220
|
+
inputWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]", "border-lg"],
|
|
5221
|
+
helperText: ["text-md"],
|
|
5222
|
+
errorText: ["text-md"]
|
|
5168
5223
|
},
|
|
5169
5224
|
xl: {
|
|
5170
5225
|
base: ["text-xl", "gap-[10px]"],
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5226
|
+
label: ["text-xl"],
|
|
5227
|
+
innerWrapper: ["gap-[10px]"],
|
|
5228
|
+
inputWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]", "border-xl"],
|
|
5229
|
+
helperText: ["text-md"],
|
|
5230
|
+
errorText: ["text-md"]
|
|
5174
5231
|
}
|
|
5175
5232
|
},
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
inputWrapper: ["rounded-none"]
|
|
5180
|
-
},
|
|
5181
|
-
full: {
|
|
5182
|
-
inputWrapper: ["rounded-full"]
|
|
5183
|
-
}
|
|
5233
|
+
direction: {
|
|
5234
|
+
vertical: "",
|
|
5235
|
+
horizon: ""
|
|
5184
5236
|
},
|
|
5185
|
-
|
|
5237
|
+
full: {
|
|
5186
5238
|
true: {
|
|
5187
5239
|
base: ["w-full"],
|
|
5188
5240
|
innerWrapper: ["flex-1"],
|
|
5189
5241
|
inputWrapper: ["w-full"]
|
|
5190
5242
|
}
|
|
5191
5243
|
},
|
|
5192
|
-
|
|
5193
|
-
true: {
|
|
5194
|
-
label: ["text-neutral-light"],
|
|
5195
|
-
inputWrapper: ["bg-neutral-soft", "border-neutral-light", "pointer-events-none"],
|
|
5196
|
-
input: ["text-neutral-light", "placeholder:text-neutral-light"],
|
|
5197
|
-
content: ["text-neutral-light", "group-has-[p]/input:text-danger-light"],
|
|
5198
|
-
errorMessage: ["text-danger-light"]
|
|
5199
|
-
}
|
|
5200
|
-
},
|
|
5201
|
-
isRequired: {
|
|
5244
|
+
disabled: {
|
|
5202
5245
|
true: {
|
|
5203
|
-
|
|
5246
|
+
inputWrapper: ["!bg-neutral-soft", "pointer-events-none", "!group-has-[p.error]/input:text-danger-light"],
|
|
5247
|
+
input: [
|
|
5248
|
+
"text-neutral-light",
|
|
5249
|
+
"placeholder:text-neutral-light",
|
|
5250
|
+
"group-has-[p.error]/input:text-danger-light",
|
|
5251
|
+
"group-has-[p.error]/input:placeholder:text-danger-light"
|
|
5252
|
+
],
|
|
5253
|
+
content: ["text-neutral-light", "group-has-[p.error]/input:text-danger-light"],
|
|
5254
|
+
helperText: ["!text-neutral-light"],
|
|
5255
|
+
errorText: ["!text-danger-light"]
|
|
5204
5256
|
}
|
|
5205
5257
|
}
|
|
5206
5258
|
},
|
|
5207
|
-
defaultVariants: {
|
|
5208
|
-
variant: "solid",
|
|
5209
|
-
color: "primary",
|
|
5210
|
-
size: "md",
|
|
5211
|
-
fullWidth: false,
|
|
5212
|
-
isDisabled: false,
|
|
5213
|
-
isRequired: false
|
|
5214
|
-
},
|
|
5215
5259
|
compoundVariants: [
|
|
5216
5260
|
{
|
|
5217
|
-
|
|
5218
|
-
|
|
5261
|
+
disabled: true,
|
|
5262
|
+
variant: ["outline", "underline"],
|
|
5219
5263
|
class: {
|
|
5220
|
-
|
|
5264
|
+
inputWrapper: ["!bg-body-background", "group-has-[p.error]/input:border-danger-light"]
|
|
5221
5265
|
}
|
|
5222
5266
|
}
|
|
5223
|
-
]
|
|
5267
|
+
],
|
|
5268
|
+
defaultVariants: {
|
|
5269
|
+
variant: "solid",
|
|
5270
|
+
color: "primary",
|
|
5271
|
+
size: "md",
|
|
5272
|
+
direction: "vertical",
|
|
5273
|
+
disabled: false,
|
|
5274
|
+
readonly: false
|
|
5275
|
+
}
|
|
5224
5276
|
});
|
|
5225
5277
|
|
|
5226
5278
|
// src/components/tabs/tabs.tsx
|
|
@@ -5634,49 +5686,7 @@ var textareaStyle = (0, import_tailwind_variants9.tv)({
|
|
|
5634
5686
|
|
|
5635
5687
|
// src/components/table/table.tsx
|
|
5636
5688
|
var import_react15 = require("react");
|
|
5637
|
-
|
|
5638
|
-
// src/utils/clsx.ts
|
|
5639
|
-
function clsx(...args) {
|
|
5640
|
-
var i = 0, tmp, x, str = "";
|
|
5641
|
-
while (i < args.length) {
|
|
5642
|
-
if (tmp = args[i++]) {
|
|
5643
|
-
if (x = toVal(tmp)) {
|
|
5644
|
-
str && (str += " ");
|
|
5645
|
-
str += x;
|
|
5646
|
-
}
|
|
5647
|
-
}
|
|
5648
|
-
}
|
|
5649
|
-
return str;
|
|
5650
|
-
}
|
|
5651
|
-
function toVal(mix) {
|
|
5652
|
-
var k, y, str = "";
|
|
5653
|
-
if (typeof mix === "string" || typeof mix === "number") {
|
|
5654
|
-
str += mix;
|
|
5655
|
-
} else if (typeof mix === "object") {
|
|
5656
|
-
if (Array.isArray(mix)) {
|
|
5657
|
-
var len = mix.length;
|
|
5658
|
-
for (k = 0; k < len; k++) {
|
|
5659
|
-
if (mix[k]) {
|
|
5660
|
-
if (y = toVal(mix[k])) {
|
|
5661
|
-
str && (str += " ");
|
|
5662
|
-
str += y;
|
|
5663
|
-
}
|
|
5664
|
-
}
|
|
5665
|
-
}
|
|
5666
|
-
} else {
|
|
5667
|
-
for (y in mix) {
|
|
5668
|
-
if (mix[y]) {
|
|
5669
|
-
str && (str += " ");
|
|
5670
|
-
str += y;
|
|
5671
|
-
}
|
|
5672
|
-
}
|
|
5673
|
-
}
|
|
5674
|
-
}
|
|
5675
|
-
return str;
|
|
5676
|
-
}
|
|
5677
|
-
|
|
5678
|
-
// src/components/table/table-head.tsx
|
|
5679
|
-
var import_react11 = require("react");
|
|
5689
|
+
var import_tailwind_variants12 = require("tailwind-variants");
|
|
5680
5690
|
|
|
5681
5691
|
// src/components/checkbox/checkbox.tsx
|
|
5682
5692
|
var import_react10 = require("react");
|
|
@@ -5887,180 +5897,395 @@ var checkboxStyle = tv({
|
|
|
5887
5897
|
|
|
5888
5898
|
// src/components/table/table-head.tsx
|
|
5889
5899
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
5890
|
-
var
|
|
5891
|
-
var TableHead = ({
|
|
5892
|
-
columns,
|
|
5893
|
-
slots,
|
|
5894
|
-
size,
|
|
5895
|
-
color,
|
|
5896
|
-
isExpanded,
|
|
5897
|
-
isChecked,
|
|
5898
|
-
isCheckedAll,
|
|
5899
|
-
classNames,
|
|
5900
|
-
onCheckAll
|
|
5901
|
-
}) => {
|
|
5902
|
-
const getTheadProps = (0, import_react11.useCallback)(
|
|
5903
|
-
() => ({
|
|
5904
|
-
className: slots.thead({ class: clsx(classNames == null ? void 0 : classNames.thead) })
|
|
5905
|
-
}),
|
|
5906
|
-
[classNames == null ? void 0 : classNames.thead, slots]
|
|
5907
|
-
);
|
|
5908
|
-
const getTrProps = (0, import_react11.useCallback)(
|
|
5909
|
-
() => ({
|
|
5910
|
-
className: slots.tr({ class: clsx(classNames == null ? void 0 : classNames.tr) })
|
|
5911
|
-
}),
|
|
5912
|
-
[classNames == null ? void 0 : classNames.tr, slots]
|
|
5913
|
-
);
|
|
5914
|
-
const getThProps = (0, import_react11.useCallback)(
|
|
5915
|
-
({ className }) => ({
|
|
5916
|
-
className: slots.th({ class: clsx(classNames == null ? void 0 : classNames.th, className) })
|
|
5917
|
-
}),
|
|
5918
|
-
[classNames == null ? void 0 : classNames.th, slots]
|
|
5919
|
-
);
|
|
5900
|
+
var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, classNames, onCheckAll }) => {
|
|
5920
5901
|
const handleClickCheckAll = (e) => {
|
|
5921
5902
|
e.preventDefault();
|
|
5922
5903
|
onCheckAll(!isCheckedAll);
|
|
5923
5904
|
};
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5905
|
+
const renderColumnHeaders = () => columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("th", { className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th }), column), children: column.headerName }, `${column.field}${index}thead`));
|
|
5906
|
+
const renderSelectAllCheckbox = () => selectableRows && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("th", { className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th })), onClick: handleClickCheckAll, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(checkbox_default, { size, checked: isCheckedAll }) }) });
|
|
5907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("thead", { className: clsx(slots.thead({ class: classNames == null ? void 0 : classNames.thead })), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr })), children: [
|
|
5908
|
+
renderColumnHeaders(),
|
|
5909
|
+
renderSelectAllCheckbox()
|
|
5928
5910
|
] }) });
|
|
5929
5911
|
};
|
|
5930
5912
|
var table_head_default = TableHead;
|
|
5931
5913
|
|
|
5932
5914
|
// src/components/table/table-body.tsx
|
|
5933
|
-
var
|
|
5915
|
+
var import_react11 = require("react");
|
|
5934
5916
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
5935
|
-
var
|
|
5917
|
+
var import_react12 = require("react");
|
|
5936
5918
|
var TableBody = ({
|
|
5937
|
-
classNames,
|
|
5938
|
-
size,
|
|
5939
|
-
color,
|
|
5940
5919
|
slots,
|
|
5941
|
-
rows,
|
|
5942
5920
|
columns,
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
isCheckedRow,
|
|
5921
|
+
rows,
|
|
5922
|
+
size,
|
|
5923
|
+
selectableRows,
|
|
5947
5924
|
checkedRows,
|
|
5925
|
+
onCheckRow,
|
|
5948
5926
|
emptyContent,
|
|
5949
|
-
|
|
5950
|
-
onRowAction
|
|
5927
|
+
classNames
|
|
5951
5928
|
}) => {
|
|
5952
|
-
const
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
"data-odd": index % 2 !== 0,
|
|
5969
|
-
"data-expanded": expandedRows.has(index),
|
|
5970
|
-
"data-selected": isSelectedRow
|
|
5971
|
-
}),
|
|
5972
|
-
[classNames == null ? void 0 : classNames.tr, expandedRows, isCheckedRow, isExpanded, isSelected, slots]
|
|
5973
|
-
);
|
|
5974
|
-
const getExpandedContentProps = (0, import_react13.useCallback)(
|
|
5975
|
-
() => ({
|
|
5976
|
-
className: slots.expandedTr({ class: clsx(classNames == null ? void 0 : classNames.expandedTr) })
|
|
5977
|
-
}),
|
|
5978
|
-
[classNames == null ? void 0 : classNames.expandedTr, slots]
|
|
5979
|
-
);
|
|
5980
|
-
const getTdProps = (0, import_react13.useCallback)(
|
|
5981
|
-
(column, row, keys) => {
|
|
5982
|
-
const { field, className, valueFormatter, renderCell } = column;
|
|
5983
|
-
const key = keys.find((value2) => value2 === field);
|
|
5984
|
-
const value = key && row[key];
|
|
5985
|
-
const children = renderCell ? renderCell({
|
|
5986
|
-
field,
|
|
5987
|
-
id: field,
|
|
5988
|
-
row,
|
|
5929
|
+
const generateColumnStyles = (0, import_react11.useCallback)((column) => {
|
|
5930
|
+
const alignClass = column.align ? `text-${column.align}` : "text-left";
|
|
5931
|
+
return clsx(alignClass, column.className);
|
|
5932
|
+
}, []);
|
|
5933
|
+
const getCellProps = (0, import_react11.useCallback)(
|
|
5934
|
+
(column, row) => {
|
|
5935
|
+
if (!column || !row) {
|
|
5936
|
+
return {
|
|
5937
|
+
className: slots.td({ class: classNames == null ? void 0 : classNames.td })
|
|
5938
|
+
};
|
|
5939
|
+
}
|
|
5940
|
+
const value = row[column.field];
|
|
5941
|
+
const formattedValue = column.valueFormatter ? column.valueFormatter({ id: column.field, field: column.field, value }) : value;
|
|
5942
|
+
const children = column.renderCell ? column.renderCell({
|
|
5943
|
+
id: column.field,
|
|
5944
|
+
field: column.field,
|
|
5989
5945
|
value,
|
|
5990
|
-
formattedValue
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
})
|
|
5995
|
-
}) : valueFormatter ? valueFormatter({
|
|
5996
|
-
id: field,
|
|
5997
|
-
field,
|
|
5998
|
-
value
|
|
5999
|
-
}) : value;
|
|
5946
|
+
formattedValue,
|
|
5947
|
+
row
|
|
5948
|
+
}) : formattedValue;
|
|
5949
|
+
const columnStyles = generateColumnStyles(column);
|
|
6000
5950
|
return {
|
|
6001
5951
|
children,
|
|
6002
|
-
className: slots.td({ class:
|
|
5952
|
+
className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), columnStyles),
|
|
5953
|
+
style: {
|
|
5954
|
+
width: column.width ? `${column.width}px` : void 0,
|
|
5955
|
+
minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
|
|
5956
|
+
maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
|
|
5957
|
+
height: column.height ? `${column.height}px` : void 0
|
|
5958
|
+
}
|
|
6003
5959
|
};
|
|
6004
5960
|
},
|
|
6005
|
-
[classNames == null ? void 0 : classNames.td,
|
|
5961
|
+
[classNames == null ? void 0 : classNames.td, generateColumnStyles, slots]
|
|
6006
5962
|
);
|
|
6007
|
-
const
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
5963
|
+
const hasRows = rows.length > 0;
|
|
5964
|
+
const colSpan = (columns.length || 1) + (selectableRows ? 1 : 0);
|
|
5965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { className: slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }), children: hasRows ? rows.map((row, rowIndex) => {
|
|
5966
|
+
const isRowChecked = checkedRows.has(rowIndex);
|
|
5967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "aria-checked": isRowChecked, children: [
|
|
5968
|
+
columns.map((column) => /* @__PURE__ */ (0, import_react12.createElement)("td", { ...getCellProps(column, row), key: column.field })),
|
|
5969
|
+
selectableRows && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5970
|
+
checkbox_default,
|
|
5971
|
+
{
|
|
5972
|
+
size,
|
|
5973
|
+
checked: isRowChecked,
|
|
5974
|
+
onChange: (e) => onCheckRow(rowIndex, e.target.checked)
|
|
5975
|
+
}
|
|
5976
|
+
) }) })
|
|
5977
|
+
] }, rowIndex);
|
|
5978
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { colSpan, className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: emptyContent || /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "text-neutral-dark py-4 text-center", children: "No data available" }) }) }) });
|
|
5979
|
+
};
|
|
5980
|
+
var table_body_default = TableBody;
|
|
5981
|
+
|
|
5982
|
+
// src/components/pagination/pagination.tsx
|
|
5983
|
+
var import_react14 = require("react");
|
|
5984
|
+
|
|
5985
|
+
// src/components/pagination/usePagination.ts
|
|
5986
|
+
var import_react13 = require("react");
|
|
5987
|
+
var usePagination = ({ currentPage, totalPage, groupSize, handleChangePage }) => {
|
|
5988
|
+
const startPage = (0, import_react13.useMemo)(() => Math.floor((currentPage - 1) / groupSize) * groupSize + 1, [currentPage, groupSize]);
|
|
5989
|
+
const endPage = (0, import_react13.useMemo)(() => Math.min(startPage + groupSize - 1, totalPage), [startPage, groupSize, totalPage]);
|
|
5990
|
+
const pageList = (0, import_react13.useMemo)(
|
|
5991
|
+
() => Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i),
|
|
5992
|
+
[startPage, endPage]
|
|
5993
|
+
);
|
|
5994
|
+
const handleClickMovePage = (0, import_react13.useCallback)(
|
|
5995
|
+
(page) => (event) => {
|
|
5996
|
+
event.preventDefault();
|
|
5997
|
+
handleChangePage == null ? void 0 : handleChangePage(page);
|
|
5998
|
+
},
|
|
5999
|
+
[handleChangePage]
|
|
6000
|
+
);
|
|
6001
|
+
return {
|
|
6002
|
+
startPage,
|
|
6003
|
+
endPage,
|
|
6004
|
+
pageList,
|
|
6005
|
+
handleClickMovePage
|
|
6017
6006
|
};
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6007
|
+
};
|
|
6008
|
+
var usePagination_default = usePagination;
|
|
6009
|
+
|
|
6010
|
+
// src/components/pagination/pagination.tsx
|
|
6011
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
6012
|
+
var Pagination = (0, import_react14.forwardRef)((originalProps, ref) => {
|
|
6013
|
+
const [props, variantProps] = mapPropsVariants(originalProps, paginationStyle.variantKeys);
|
|
6014
|
+
const {
|
|
6015
|
+
classNames,
|
|
6016
|
+
currentPage,
|
|
6017
|
+
groupSize,
|
|
6018
|
+
totalPage,
|
|
6019
|
+
showPageNumber = true,
|
|
6020
|
+
showPageLabel,
|
|
6021
|
+
showFirstLastButtons,
|
|
6022
|
+
handleChangePage,
|
|
6023
|
+
variant,
|
|
6024
|
+
size
|
|
6025
|
+
} = { ...props, ...variantProps };
|
|
6026
|
+
const [inputPage, setInputPage] = (0, import_react14.useState)(currentPage);
|
|
6027
|
+
const slots = (0, import_react14.useMemo)(() => paginationStyle(variantProps), [variantProps]);
|
|
6028
|
+
const { pageList, handleClickMovePage } = usePagination_default({
|
|
6029
|
+
currentPage,
|
|
6030
|
+
totalPage,
|
|
6031
|
+
groupSize,
|
|
6032
|
+
handleChangePage
|
|
6033
|
+
});
|
|
6034
|
+
const handleKeyDown = (e) => {
|
|
6035
|
+
if (e.key === "Enter") {
|
|
6036
|
+
const parsed = Number(inputPage);
|
|
6037
|
+
if (!isNaN(parsed) && parsed >= 1 && parsed <= totalPage) {
|
|
6038
|
+
handleChangePage == null ? void 0 : handleChangePage(parsed);
|
|
6039
|
+
}
|
|
6027
6040
|
}
|
|
6028
6041
|
};
|
|
6029
|
-
return /* @__PURE__ */ (0,
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
"tr",
|
|
6042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), ref, children: [
|
|
6043
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
6044
|
+
showFirstLastButtons && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6045
|
+
"div",
|
|
6034
6046
|
{
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
Icon_default,
|
|
6041
|
-
{
|
|
6042
|
-
name: expandedRows.has(rowIndex) ? "brace-down" : "brace-right",
|
|
6043
|
-
className: `ml-2 transition-transform`,
|
|
6044
|
-
size
|
|
6045
|
-
}
|
|
6046
|
-
) }),
|
|
6047
|
-
columns.map((column, colIndex) => /* @__PURE__ */ (0, import_react14.createElement)("td", { ...getTdProps(column, row, keys), key: colIndex }))
|
|
6048
|
-
]
|
|
6047
|
+
"aria-label": "firstPage",
|
|
6048
|
+
"data-is-active": currentPage > 1,
|
|
6049
|
+
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6050
|
+
onClick: currentPage > 1 ? handleClickMovePage(1) : void 0,
|
|
6051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon_default, { name: "left-double-chevron" })
|
|
6049
6052
|
}
|
|
6050
6053
|
),
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6054
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6055
|
+
"div",
|
|
6056
|
+
{
|
|
6057
|
+
"aria-label": "prevPage",
|
|
6058
|
+
"data-is-active": currentPage > 1,
|
|
6059
|
+
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6060
|
+
onClick: currentPage > 1 ? handleClickMovePage(currentPage - 1) : void 0,
|
|
6061
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon_default, { name: "left-chevron" })
|
|
6062
|
+
}
|
|
6063
|
+
),
|
|
6064
|
+
showPageNumber && pageList.map((page, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6065
|
+
"div",
|
|
6066
|
+
{
|
|
6067
|
+
className: slots.button({ class: classNames == null ? void 0 : classNames.button }),
|
|
6068
|
+
"data-selected": currentPage === page,
|
|
6069
|
+
onClick: handleClickMovePage(page),
|
|
6070
|
+
children: page
|
|
6071
|
+
},
|
|
6072
|
+
index
|
|
6073
|
+
)),
|
|
6074
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6075
|
+
"div",
|
|
6076
|
+
{
|
|
6077
|
+
"aria-label": "nextPage",
|
|
6078
|
+
"data-is-active": currentPage < totalPage,
|
|
6079
|
+
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6080
|
+
onClick: currentPage < totalPage ? handleClickMovePage(currentPage + 1) : void 0,
|
|
6081
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon_default, { name: "right-chevron" })
|
|
6082
|
+
}
|
|
6083
|
+
),
|
|
6084
|
+
showFirstLastButtons && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6085
|
+
"div",
|
|
6086
|
+
{
|
|
6087
|
+
"aria-label": "lastPage",
|
|
6088
|
+
"data-is-active": currentPage < totalPage,
|
|
6089
|
+
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6090
|
+
onClick: currentPage < totalPage ? handleClickMovePage(totalPage) : void 0,
|
|
6091
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon_default, { name: "right-double-chevron" })
|
|
6092
|
+
}
|
|
6093
|
+
)
|
|
6094
|
+
] }),
|
|
6095
|
+
showPageLabel && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: [
|
|
6096
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6097
|
+
input_default,
|
|
6098
|
+
{
|
|
6099
|
+
value: inputPage || 1,
|
|
6100
|
+
onChange: (e) => setInputPage(Number(e.target.value)),
|
|
6101
|
+
onKeyDown: handleKeyDown,
|
|
6102
|
+
width: 50,
|
|
6103
|
+
height: 24,
|
|
6104
|
+
size: "sm",
|
|
6105
|
+
classNames: {
|
|
6106
|
+
inputWrapper: clsx(
|
|
6107
|
+
"w-[50px] h-[24px] rounded-sm",
|
|
6108
|
+
variant === "solid" ? "" : "bg-body-background border border-neutral-light"
|
|
6109
|
+
)
|
|
6110
|
+
}
|
|
6111
|
+
}
|
|
6112
|
+
),
|
|
6113
|
+
` of ${totalPage.toLocaleString("ko-kr")}`
|
|
6114
|
+
] })
|
|
6115
|
+
] });
|
|
6116
|
+
});
|
|
6117
|
+
Pagination.displayName = "Pagination";
|
|
6118
|
+
var pagination_default = Pagination;
|
|
6119
|
+
var paginationStyle = tv(
|
|
6120
|
+
{
|
|
6121
|
+
slots: {
|
|
6122
|
+
base: ["flex", "items-center", "select-none", "gap-[20px]"],
|
|
6123
|
+
wrapper: ["flex", "items-center", "overflow-hidden", "gap-[5px]"],
|
|
6124
|
+
icon: [
|
|
6125
|
+
"flex",
|
|
6126
|
+
"items-center",
|
|
6127
|
+
"justify-center",
|
|
6128
|
+
"cursor-pointer",
|
|
6129
|
+
"stroke-neutral-main",
|
|
6130
|
+
"data-[is-active=false]:stroke-neutral-light",
|
|
6131
|
+
"data-[is-active=false]:cursor-default"
|
|
6132
|
+
],
|
|
6133
|
+
button: [
|
|
6134
|
+
"flex",
|
|
6135
|
+
"items-center",
|
|
6136
|
+
"justify-center",
|
|
6137
|
+
"cursor-pointer",
|
|
6138
|
+
"transition",
|
|
6139
|
+
"duration-200",
|
|
6140
|
+
"px-[6px]",
|
|
6141
|
+
"py-[4px]",
|
|
6142
|
+
"text-neutral-main",
|
|
6143
|
+
"data-[selected=true]:font-bold"
|
|
6144
|
+
],
|
|
6145
|
+
label: ["whitespace-nowrap", "text-neutral-main", "flex", "items-center", "gap-[5px]", "text-sm"]
|
|
6146
|
+
},
|
|
6147
|
+
variants: {
|
|
6148
|
+
variant: {
|
|
6149
|
+
solid: {
|
|
6150
|
+
button: ["rounded-[5px]", "border-transparent"]
|
|
6151
|
+
},
|
|
6152
|
+
underline: {
|
|
6153
|
+
button: ["rounded-0", "border-transparent"]
|
|
6154
|
+
}
|
|
6155
|
+
},
|
|
6156
|
+
size: {
|
|
6157
|
+
sm: {
|
|
6158
|
+
button: ["text-sm", "data-[selected=true]:border-sm"]
|
|
6159
|
+
},
|
|
6160
|
+
md: {
|
|
6161
|
+
button: ["text-md", "data-[selected=true]:border-md"]
|
|
6162
|
+
},
|
|
6163
|
+
lg: {
|
|
6164
|
+
button: ["text-lg", "data-[selected=true]:border-lg"]
|
|
6165
|
+
},
|
|
6166
|
+
xl: {
|
|
6167
|
+
button: ["text-xl", "data-[selected=true]:border-xl"]
|
|
6168
|
+
}
|
|
6169
|
+
},
|
|
6170
|
+
color: {
|
|
6171
|
+
primary: {},
|
|
6172
|
+
secondary: {},
|
|
6173
|
+
neutral: {}
|
|
6174
|
+
},
|
|
6175
|
+
isDisabled: {
|
|
6176
|
+
true: {
|
|
6177
|
+
icon: ["!text-neutral-light", "!cursor-default"],
|
|
6178
|
+
button: ["!text-neutral-light", "!cursor-default"]
|
|
6179
|
+
}
|
|
6180
|
+
}
|
|
6181
|
+
},
|
|
6182
|
+
compoundVariants: [
|
|
6183
|
+
{
|
|
6184
|
+
variant: "solid",
|
|
6185
|
+
color: "primary",
|
|
6186
|
+
class: {
|
|
6187
|
+
button: [
|
|
6188
|
+
"hover:text-primary-main",
|
|
6189
|
+
"data-[selected=true]:text-primary-main",
|
|
6190
|
+
"data-[selected=true]:bg-primary-soft"
|
|
6191
|
+
],
|
|
6192
|
+
icon: ["hover:stroke-primary-main"]
|
|
6193
|
+
}
|
|
6194
|
+
},
|
|
6195
|
+
{
|
|
6196
|
+
variant: "solid",
|
|
6197
|
+
color: "secondary",
|
|
6198
|
+
class: {
|
|
6199
|
+
button: [
|
|
6200
|
+
"hover:text-secondary-main",
|
|
6201
|
+
"data-[selected=true]:text-secondary-main",
|
|
6202
|
+
"data-[selected=true]:bg-secondary-soft"
|
|
6203
|
+
],
|
|
6204
|
+
icon: ["hover:stroke-secondary-main"]
|
|
6205
|
+
}
|
|
6206
|
+
},
|
|
6207
|
+
{
|
|
6208
|
+
variant: "solid",
|
|
6209
|
+
color: "neutral",
|
|
6210
|
+
class: {
|
|
6211
|
+
button: [
|
|
6212
|
+
"hover:text-neutral-dark",
|
|
6213
|
+
"data-[selected=true]:text-neutral-dark",
|
|
6214
|
+
"data-[selected=true]:bg-neutral-soft"
|
|
6215
|
+
],
|
|
6216
|
+
icon: ["hover:stroke-neutral-main"]
|
|
6217
|
+
}
|
|
6218
|
+
},
|
|
6219
|
+
{
|
|
6220
|
+
variant: "underline",
|
|
6221
|
+
color: "primary",
|
|
6222
|
+
class: {
|
|
6223
|
+
button: [
|
|
6224
|
+
"hover:text-primary-main",
|
|
6225
|
+
"data-[selected=true]:text-primary-main",
|
|
6226
|
+
"data-[selected=true]:border-b-primary-main"
|
|
6227
|
+
],
|
|
6228
|
+
icon: ["hover:stroke-primary-main"]
|
|
6229
|
+
}
|
|
6230
|
+
},
|
|
6231
|
+
{
|
|
6232
|
+
variant: "underline",
|
|
6233
|
+
color: "secondary",
|
|
6234
|
+
class: {
|
|
6235
|
+
button: [
|
|
6236
|
+
"hover:text-secondary-main",
|
|
6237
|
+
"data-[selected=true]:text-secondary-main",
|
|
6238
|
+
"data-[selected=true]:border-b-secondary-main"
|
|
6239
|
+
],
|
|
6240
|
+
icon: ["hover:stroke-secondary-main"]
|
|
6241
|
+
}
|
|
6242
|
+
},
|
|
6243
|
+
{
|
|
6244
|
+
variant: "underline",
|
|
6245
|
+
color: "neutral",
|
|
6246
|
+
class: {
|
|
6247
|
+
button: [
|
|
6248
|
+
"hover:text-neutral-dark",
|
|
6249
|
+
"data-[selected=true]:text-neutral-dark",
|
|
6250
|
+
"data-[selected=true]:border-b-neutral-main"
|
|
6251
|
+
],
|
|
6252
|
+
icon: ["hover:stroke-neutral-main"]
|
|
6253
|
+
}
|
|
6254
|
+
}
|
|
6255
|
+
],
|
|
6256
|
+
defaultVariants: {
|
|
6257
|
+
variant: "solid",
|
|
6258
|
+
color: "primary",
|
|
6259
|
+
size: "md",
|
|
6260
|
+
isDisabled: false
|
|
6261
|
+
}
|
|
6262
|
+
},
|
|
6263
|
+
{
|
|
6264
|
+
twMerge: false
|
|
6265
|
+
}
|
|
6266
|
+
);
|
|
6056
6267
|
|
|
6057
6268
|
// src/components/table/table.tsx
|
|
6058
|
-
var
|
|
6059
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
6269
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
6060
6270
|
var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
6061
|
-
const [props, variantProps] = mapPropsVariants(originalProps,
|
|
6062
|
-
const {
|
|
6271
|
+
const [props, variantProps] = mapPropsVariants(originalProps, tableStyle.variantKeys);
|
|
6272
|
+
const {
|
|
6273
|
+
classNames,
|
|
6274
|
+
rows,
|
|
6275
|
+
columns,
|
|
6276
|
+
size,
|
|
6277
|
+
selectableRows,
|
|
6278
|
+
totalData,
|
|
6279
|
+
pagination,
|
|
6280
|
+
onPageChange,
|
|
6281
|
+
emptyContent,
|
|
6282
|
+
className,
|
|
6283
|
+
color
|
|
6284
|
+
} = { ...props, ...variantProps };
|
|
6063
6285
|
const [checkedRows, setCheckedRows] = (0, import_react15.useState)(/* @__PURE__ */ new Set());
|
|
6286
|
+
const divRef = (0, import_react15.useRef)(null);
|
|
6287
|
+
const { page, perPage } = pagination || { page: 1, perPage: 10 };
|
|
6288
|
+
const showPagination = pagination && typeof totalData === "number";
|
|
6064
6289
|
(0, import_react15.useImperativeHandle)(ref, () => ({
|
|
6065
6290
|
checkedRows,
|
|
6066
6291
|
setCheckedRows
|
|
@@ -6068,317 +6293,264 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6068
6293
|
(0, import_react15.useEffect)(() => {
|
|
6069
6294
|
setCheckedRows(/* @__PURE__ */ new Set());
|
|
6070
6295
|
}, [rows]);
|
|
6071
|
-
const slots = (0, import_react15.useMemo)(() => table({ ...variantProps }), [...Object.values(variantProps)]);
|
|
6072
|
-
const getBaseProps = (0, import_react15.useCallback)(
|
|
6073
|
-
(props2) => ({
|
|
6074
|
-
...props2,
|
|
6075
|
-
className: slots.base({ class: clsx(classNames == null ? void 0 : classNames.base) })
|
|
6076
|
-
}),
|
|
6077
|
-
[classNames == null ? void 0 : classNames.base, slots]
|
|
6078
|
-
);
|
|
6079
|
-
const getTableProps = (0, import_react15.useCallback)(
|
|
6080
|
-
(props2) => ({
|
|
6081
|
-
...props2,
|
|
6082
|
-
className: slots.table({ class: clsx(classNames == null ? void 0 : classNames.table) })
|
|
6083
|
-
}),
|
|
6084
|
-
[classNames == null ? void 0 : classNames.table, slots]
|
|
6085
|
-
);
|
|
6086
|
-
const getLoadingWrapperProps = (0, import_react15.useCallback)(
|
|
6087
|
-
(props2) => ({
|
|
6088
|
-
...props2,
|
|
6089
|
-
className: slots.loadingWrapper({ class: clsx(classNames == null ? void 0 : classNames.loadingWrapper) })
|
|
6090
|
-
}),
|
|
6091
|
-
[classNames == null ? void 0 : classNames.loadingWrapper, slots]
|
|
6092
|
-
);
|
|
6093
6296
|
const handleCheckAll = (isChecked) => {
|
|
6094
6297
|
const newCheckedRows = isChecked ? new Set(rows.map((_, index) => index)) : /* @__PURE__ */ new Set();
|
|
6095
6298
|
setCheckedRows(newCheckedRows);
|
|
6096
6299
|
};
|
|
6097
|
-
const
|
|
6098
|
-
const
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
} else {
|
|
6102
|
-
newCheckedRows.add(index);
|
|
6103
|
-
}
|
|
6104
|
-
setCheckedRows(newCheckedRows);
|
|
6300
|
+
const handleCheck = (rowIndex, isChecked) => {
|
|
6301
|
+
const newChecked = new Set(checkedRows);
|
|
6302
|
+
isChecked ? newChecked.add(rowIndex) : newChecked.delete(rowIndex);
|
|
6303
|
+
setCheckedRows(newChecked);
|
|
6105
6304
|
};
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6305
|
+
const slots = (0, import_react15.useMemo)(() => tableStyle(variantProps), [variantProps]);
|
|
6306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { ref: divRef, "data-table": "base", className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
6307
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("table", { className: slots.table({ class: classNames == null ? void 0 : classNames.table }), children: [
|
|
6308
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6109
6309
|
table_head_default,
|
|
6110
6310
|
{
|
|
6111
|
-
classNames,
|
|
6112
|
-
slots,
|
|
6113
6311
|
columns,
|
|
6114
|
-
size
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
isExpanded: originalProps.isExpanded,
|
|
6312
|
+
size,
|
|
6313
|
+
selectableRows,
|
|
6314
|
+
isCheckedAll: checkedRows.size === rows.length && rows.length > 0,
|
|
6118
6315
|
onCheckAll: handleCheckAll,
|
|
6119
|
-
|
|
6316
|
+
classNames,
|
|
6317
|
+
slots
|
|
6120
6318
|
}
|
|
6121
6319
|
),
|
|
6122
|
-
/* @__PURE__ */ (0,
|
|
6320
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6123
6321
|
table_body_default,
|
|
6124
6322
|
{
|
|
6323
|
+
slots,
|
|
6125
6324
|
rows,
|
|
6126
6325
|
columns,
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
color: originalProps.color === "neutral" ? "primary" : originalProps.color,
|
|
6130
|
-
isSelected: originalProps.isSelected,
|
|
6131
|
-
isChecked: originalProps.isChecked,
|
|
6132
|
-
isCheckedRow: originalProps.isCheckedRow,
|
|
6133
|
-
isExpanded: originalProps.isExpanded,
|
|
6134
|
-
classNames,
|
|
6135
|
-
emptyContent,
|
|
6326
|
+
size,
|
|
6327
|
+
selectableRows,
|
|
6136
6328
|
checkedRows,
|
|
6137
|
-
|
|
6138
|
-
|
|
6329
|
+
onCheckRow: handleCheck,
|
|
6330
|
+
emptyContent,
|
|
6331
|
+
classNames
|
|
6139
6332
|
}
|
|
6140
6333
|
)
|
|
6141
6334
|
] }),
|
|
6142
|
-
|
|
6335
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6336
|
+
pagination_default,
|
|
6337
|
+
{
|
|
6338
|
+
color,
|
|
6339
|
+
currentPage: page,
|
|
6340
|
+
totalPage: Math.ceil(totalData / perPage),
|
|
6341
|
+
groupSize: 10,
|
|
6342
|
+
handleChangePage: (currentPage) => onPageChange({ page: currentPage, perPage })
|
|
6343
|
+
}
|
|
6344
|
+
) })
|
|
6143
6345
|
] });
|
|
6144
6346
|
});
|
|
6145
6347
|
Table.displayName = "Table";
|
|
6146
6348
|
var table_default = Table;
|
|
6147
|
-
var
|
|
6349
|
+
var tableStyle = (0, import_tailwind_variants12.tv)({
|
|
6148
6350
|
slots: {
|
|
6149
|
-
base: "flex flex-col relative
|
|
6150
|
-
table: "w-full h-auto",
|
|
6151
|
-
thead: "
|
|
6152
|
-
tbody: "",
|
|
6153
|
-
tr: ["group", "outline-none", "w-full"],
|
|
6351
|
+
base: ["flex", "flex-col", "relative", "select-none"],
|
|
6352
|
+
table: ["w-full", "h-auto"],
|
|
6353
|
+
thead: ["w-full"],
|
|
6354
|
+
tbody: ["w-full"],
|
|
6355
|
+
tr: ["group", "outline-none", "w-full", "h-full"],
|
|
6154
6356
|
th: [
|
|
6155
|
-
"text-foreground",
|
|
6156
|
-
"
|
|
6157
|
-
"align-middle",
|
|
6357
|
+
"text-body-foreground",
|
|
6358
|
+
"font-bold",
|
|
6158
6359
|
"whitespace-nowrap",
|
|
6159
|
-
"font-normal",
|
|
6160
6360
|
"outline-none",
|
|
6161
|
-
"
|
|
6162
|
-
"
|
|
6163
|
-
"
|
|
6361
|
+
"align-middle",
|
|
6362
|
+
"px-[10px]",
|
|
6363
|
+
"[&>div]:flex",
|
|
6364
|
+
"[&>div]:gap-[10px]"
|
|
6164
6365
|
],
|
|
6165
6366
|
td: [
|
|
6166
6367
|
"relative",
|
|
6167
6368
|
"text-foreground",
|
|
6168
|
-
"align-middle",
|
|
6169
6369
|
"whitespace-normal",
|
|
6170
6370
|
"outline-none",
|
|
6171
|
-
"text-center",
|
|
6172
6371
|
"[&>*]:z-1",
|
|
6173
6372
|
"[&>*]:relative",
|
|
6373
|
+
"px-[10px]",
|
|
6374
|
+
"gap-[10px]",
|
|
6174
6375
|
"transition duration-200",
|
|
6175
|
-
"
|
|
6176
|
-
],
|
|
6177
|
-
tfoot: "",
|
|
6178
|
-
expandedTr: "border-b",
|
|
6179
|
-
sortIcon: [
|
|
6180
|
-
"ml-2",
|
|
6181
|
-
"mb-px",
|
|
6182
|
-
"opacity-0",
|
|
6183
|
-
"text-inherit",
|
|
6184
|
-
"inline-block",
|
|
6185
|
-
"transition-transform-opacity",
|
|
6186
|
-
"data-[visible=true]:opacity-100",
|
|
6187
|
-
"group-data-[hover=true]:opacity-100",
|
|
6188
|
-
"data-[direction=ascending]:rotate-180"
|
|
6189
|
-
],
|
|
6190
|
-
emptyWrapper: "text-neutral-light align-middle text-center h-40",
|
|
6191
|
-
loadingWrapper: [
|
|
6192
|
-
"absolute",
|
|
6193
|
-
"inset-0",
|
|
6194
|
-
"flex",
|
|
6195
|
-
"items-center",
|
|
6196
|
-
"justify-center",
|
|
6197
|
-
"bg-black/40",
|
|
6198
|
-
"text-white",
|
|
6199
|
-
"transition-opacity",
|
|
6200
|
-
"duration-200",
|
|
6201
|
-
"ease-in-out",
|
|
6202
|
-
"cursor-default"
|
|
6376
|
+
"align-middle"
|
|
6203
6377
|
]
|
|
6204
6378
|
},
|
|
6205
6379
|
variants: {
|
|
6206
6380
|
variant: {
|
|
6207
6381
|
solid: {
|
|
6208
|
-
tbody: "[&>tr]:border-b"
|
|
6382
|
+
tbody: ["[&>tr]:border-b"]
|
|
6209
6383
|
},
|
|
6210
|
-
|
|
6211
|
-
|
|
6384
|
+
outline: {
|
|
6385
|
+
tbody: ["[&>td]:border"],
|
|
6386
|
+
th: ["border"],
|
|
6387
|
+
td: ["border"]
|
|
6212
6388
|
},
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6389
|
+
underline: {
|
|
6390
|
+
tbody: ["[&>tr]:border-b"],
|
|
6391
|
+
th: ["border-t-[2px]", "border-b"]
|
|
6216
6392
|
}
|
|
6217
6393
|
},
|
|
6218
6394
|
size: {
|
|
6219
6395
|
sm: {
|
|
6220
|
-
tr: "
|
|
6396
|
+
tr: ["text-sm"]
|
|
6221
6397
|
},
|
|
6222
6398
|
md: {
|
|
6223
|
-
tr: "
|
|
6399
|
+
tr: ["text-md"]
|
|
6224
6400
|
},
|
|
6225
6401
|
lg: {
|
|
6226
|
-
tr: "
|
|
6402
|
+
tr: ["text-lg"]
|
|
6227
6403
|
},
|
|
6228
6404
|
xl: {
|
|
6229
|
-
tr: "
|
|
6405
|
+
tr: ["text-xl"]
|
|
6230
6406
|
}
|
|
6231
6407
|
},
|
|
6232
6408
|
color: {
|
|
6233
6409
|
primary: {
|
|
6234
|
-
|
|
6235
|
-
tr: "border-primary-light",
|
|
6236
|
-
td: "group-hover:bg-primary-soft",
|
|
6237
|
-
expandedTr: "border-primary-light"
|
|
6410
|
+
tbody: ["[&>tr]:border-primary-light"]
|
|
6238
6411
|
},
|
|
6239
6412
|
secondary: {
|
|
6240
|
-
|
|
6241
|
-
tr: "border-secondary-light",
|
|
6242
|
-
td: "group-hover:bg-secondary-soft",
|
|
6243
|
-
expandedTr: "border-secondary-light"
|
|
6413
|
+
tbody: ["[&>tr]:border-secondary-light"]
|
|
6244
6414
|
},
|
|
6245
6415
|
neutral: {
|
|
6246
|
-
|
|
6247
|
-
tr: "border-trans-light",
|
|
6248
|
-
td: "group-hover:bg-trans-soft",
|
|
6249
|
-
expandedTr: "border-trans-light"
|
|
6416
|
+
tbody: ["[&>tr]:border-neutral-light"]
|
|
6250
6417
|
}
|
|
6251
6418
|
},
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6419
|
+
height: {
|
|
6420
|
+
narrow: {},
|
|
6421
|
+
wide: {}
|
|
6422
|
+
}
|
|
6423
|
+
},
|
|
6424
|
+
compoundVariants: [
|
|
6425
|
+
{
|
|
6426
|
+
variant: "solid",
|
|
6427
|
+
color: "primary",
|
|
6428
|
+
class: {
|
|
6429
|
+
th: ["bg-primary-soft"]
|
|
6258
6430
|
}
|
|
6259
6431
|
},
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
},
|
|
6266
|
-
isChecked: {
|
|
6267
|
-
true: {}
|
|
6268
|
-
},
|
|
6269
|
-
isCheckedRow: {
|
|
6270
|
-
true: {
|
|
6271
|
-
tr: "cursor-pointer"
|
|
6432
|
+
{
|
|
6433
|
+
variant: "solid",
|
|
6434
|
+
color: "secondary",
|
|
6435
|
+
class: {
|
|
6436
|
+
th: ["bg-secondary-soft"]
|
|
6272
6437
|
}
|
|
6273
6438
|
},
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6439
|
+
{
|
|
6440
|
+
variant: "solid",
|
|
6441
|
+
color: "neutral",
|
|
6442
|
+
class: {
|
|
6443
|
+
th: ["bg-neutral-soft"]
|
|
6277
6444
|
}
|
|
6278
6445
|
},
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6446
|
+
{
|
|
6447
|
+
variant: "outline",
|
|
6448
|
+
color: "primary",
|
|
6449
|
+
class: {
|
|
6450
|
+
th: ["bg-primary-soft", "border-primary-light"],
|
|
6451
|
+
td: ["border-primary-light"]
|
|
6452
|
+
}
|
|
6284
6453
|
},
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6454
|
+
{
|
|
6455
|
+
variant: "outline",
|
|
6456
|
+
color: "secondary",
|
|
6457
|
+
class: {
|
|
6458
|
+
th: ["bg-secondary-soft", "border-secondary-light"],
|
|
6459
|
+
td: ["border-secondary-light"]
|
|
6288
6460
|
}
|
|
6289
6461
|
},
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6462
|
+
{
|
|
6463
|
+
variant: "outline",
|
|
6464
|
+
color: "neutral",
|
|
6465
|
+
class: {
|
|
6466
|
+
th: ["bg-neutral-soft", "border-neutral-light"],
|
|
6467
|
+
td: ["border-neutral-light"]
|
|
6293
6468
|
}
|
|
6294
|
-
}
|
|
6295
|
-
},
|
|
6296
|
-
defaultVariants: {
|
|
6297
|
-
layout: "auto",
|
|
6298
|
-
color: "primary",
|
|
6299
|
-
variant: "solid",
|
|
6300
|
-
size: "md",
|
|
6301
|
-
isChecked: false,
|
|
6302
|
-
isExpanded: false,
|
|
6303
|
-
isCompact: false,
|
|
6304
|
-
hideHeader: false,
|
|
6305
|
-
isStriped: false,
|
|
6306
|
-
fullWidth: false
|
|
6307
|
-
},
|
|
6308
|
-
compoundVariants: [
|
|
6469
|
+
},
|
|
6309
6470
|
{
|
|
6310
|
-
variant: "
|
|
6471
|
+
variant: "underline",
|
|
6311
6472
|
color: "primary",
|
|
6312
6473
|
class: {
|
|
6313
|
-
|
|
6314
|
-
tr: ["data-[expanded=true]:bg-primary-soft", "data-[selected=true]:bg-primary-soft"]
|
|
6474
|
+
th: ["bg-body-background", "border-t-[2px]", "border-b", "border-primary-main"]
|
|
6315
6475
|
}
|
|
6316
6476
|
},
|
|
6317
6477
|
{
|
|
6318
|
-
variant: "
|
|
6478
|
+
variant: "underline",
|
|
6319
6479
|
color: "secondary",
|
|
6320
6480
|
class: {
|
|
6321
|
-
|
|
6322
|
-
tr: ["data-[expanded=true]:bg-secondary-soft", "data-[selected=true]:bg-secondary-soft"]
|
|
6481
|
+
th: ["bg-body-background", "border-t-[2px]", "border-b", "border-secondary-main"]
|
|
6323
6482
|
}
|
|
6324
6483
|
},
|
|
6325
6484
|
{
|
|
6326
|
-
variant: "
|
|
6485
|
+
variant: "underline",
|
|
6327
6486
|
color: "neutral",
|
|
6328
6487
|
class: {
|
|
6329
|
-
|
|
6330
|
-
tr: ["data-[expanded=true]:bg-neutral-soft", "data-[selected=true]:bg-neutral-soft"]
|
|
6488
|
+
th: ["bg-body-background", "border-t-[2px]", "border-b", "border-neutral-main"]
|
|
6331
6489
|
}
|
|
6332
6490
|
},
|
|
6333
6491
|
{
|
|
6334
|
-
|
|
6335
|
-
|
|
6492
|
+
height: "narrow",
|
|
6493
|
+
size: "sm",
|
|
6336
6494
|
class: {
|
|
6337
|
-
|
|
6338
|
-
tr: ["data-[expanded=true]:bg-primary-soft", "data-[selected=true]:bg-primary-soft"]
|
|
6495
|
+
tr: ["h-[30px]"]
|
|
6339
6496
|
}
|
|
6340
6497
|
},
|
|
6341
6498
|
{
|
|
6342
|
-
|
|
6343
|
-
|
|
6499
|
+
height: "narrow",
|
|
6500
|
+
size: "md",
|
|
6344
6501
|
class: {
|
|
6345
|
-
|
|
6346
|
-
tr: ["data-[expanded=true]:bg-secondary-soft", "data-[selected=true]:bg-secondary-soft"]
|
|
6502
|
+
tr: ["h-[40px]"]
|
|
6347
6503
|
}
|
|
6348
6504
|
},
|
|
6349
6505
|
{
|
|
6350
|
-
|
|
6351
|
-
|
|
6506
|
+
height: "narrow",
|
|
6507
|
+
size: "lg",
|
|
6352
6508
|
class: {
|
|
6353
|
-
|
|
6354
|
-
tr: ["data-[expanded=true]:bg-neutral-soft", "data-[selected=true]:bg-neutral-soft"]
|
|
6509
|
+
tr: ["h-[50px]"]
|
|
6355
6510
|
}
|
|
6356
6511
|
},
|
|
6357
6512
|
{
|
|
6358
|
-
|
|
6359
|
-
|
|
6513
|
+
height: "narrow",
|
|
6514
|
+
size: "xl",
|
|
6360
6515
|
class: {
|
|
6361
|
-
tr: "
|
|
6362
|
-
td: "group-hover:bg-primary-light"
|
|
6516
|
+
tr: ["h-[60px]"]
|
|
6363
6517
|
}
|
|
6364
6518
|
},
|
|
6365
6519
|
{
|
|
6366
|
-
|
|
6367
|
-
|
|
6520
|
+
height: "wide",
|
|
6521
|
+
size: "sm",
|
|
6368
6522
|
class: {
|
|
6369
|
-
tr: "
|
|
6370
|
-
td: "group-hover:bg-secondary-light"
|
|
6523
|
+
tr: ["h-[40px]"]
|
|
6371
6524
|
}
|
|
6372
6525
|
},
|
|
6373
6526
|
{
|
|
6374
|
-
|
|
6375
|
-
|
|
6527
|
+
height: "wide",
|
|
6528
|
+
size: "md",
|
|
6529
|
+
class: {
|
|
6530
|
+
tr: ["h-[50px]"]
|
|
6531
|
+
}
|
|
6532
|
+
},
|
|
6533
|
+
{
|
|
6534
|
+
height: "wide",
|
|
6535
|
+
size: "lg",
|
|
6536
|
+
class: {
|
|
6537
|
+
tr: ["h-[60px]"]
|
|
6538
|
+
}
|
|
6539
|
+
},
|
|
6540
|
+
{
|
|
6541
|
+
height: "wide",
|
|
6542
|
+
size: "xl",
|
|
6376
6543
|
class: {
|
|
6377
|
-
tr: "
|
|
6378
|
-
td: "group-hover:bg-neutral-light"
|
|
6544
|
+
tr: ["h-[70px]"]
|
|
6379
6545
|
}
|
|
6380
6546
|
}
|
|
6381
|
-
]
|
|
6547
|
+
],
|
|
6548
|
+
defaultVariants: {
|
|
6549
|
+
variant: "solid",
|
|
6550
|
+
size: "md",
|
|
6551
|
+
color: "primary",
|
|
6552
|
+
height: "narrow"
|
|
6553
|
+
}
|
|
6382
6554
|
});
|
|
6383
6555
|
|
|
6384
6556
|
// src/components/select/select.tsx
|
|
@@ -6442,10 +6614,10 @@ var useSelect = ({ options, defaultOption, onChange }) => {
|
|
|
6442
6614
|
};
|
|
6443
6615
|
|
|
6444
6616
|
// src/components/select/option.tsx
|
|
6445
|
-
var
|
|
6617
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
6446
6618
|
var Option = (props) => {
|
|
6447
6619
|
const { base, option, icon } = optionStyle(props);
|
|
6448
|
-
return /* @__PURE__ */ (0,
|
|
6620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
6449
6621
|
"div",
|
|
6450
6622
|
{
|
|
6451
6623
|
title: props.option.value,
|
|
@@ -6455,8 +6627,8 @@ var Option = (props) => {
|
|
|
6455
6627
|
props.isSelected && (node == null ? void 0 : node.scrollIntoView());
|
|
6456
6628
|
},
|
|
6457
6629
|
children: [
|
|
6458
|
-
/* @__PURE__ */ (0,
|
|
6459
|
-
props.isSelected && /* @__PURE__ */ (0,
|
|
6630
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: option(), children: props.children }),
|
|
6631
|
+
props.isSelected && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: icon(), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: "check", size: props.size }) })
|
|
6460
6632
|
]
|
|
6461
6633
|
}
|
|
6462
6634
|
);
|
|
@@ -6507,7 +6679,7 @@ var optionStyle = tv({
|
|
|
6507
6679
|
});
|
|
6508
6680
|
|
|
6509
6681
|
// src/components/select/select.tsx
|
|
6510
|
-
var
|
|
6682
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
6511
6683
|
var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
6512
6684
|
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
6513
6685
|
const { classNames, options, defaultOption, onChange, ...inputProps } = props;
|
|
@@ -6571,17 +6743,17 @@ var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
6571
6743
|
}),
|
|
6572
6744
|
[slots, classNames]
|
|
6573
6745
|
);
|
|
6574
|
-
return /* @__PURE__ */ (0,
|
|
6575
|
-
/* @__PURE__ */ (0,
|
|
6576
|
-
props.label && /* @__PURE__ */ (0,
|
|
6577
|
-
/* @__PURE__ */ (0,
|
|
6578
|
-
/* @__PURE__ */ (0,
|
|
6579
|
-
/* @__PURE__ */ (0,
|
|
6746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
6747
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ...getBaseProps(), children: [
|
|
6748
|
+
props.label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { ...getLabelProps(), children: props.label }),
|
|
6749
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "data-expanded": !!targetRect, ...getSelectWrapperProps(), children: [
|
|
6750
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { ...getSelectProps() }),
|
|
6751
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon_default, { name: !!targetRect ? "arrow-triangle-up" : "arrow-triangle-down", size: originalProps.size, fill: true })
|
|
6580
6752
|
] }),
|
|
6581
|
-
props.errorMessage && /* @__PURE__ */ (0,
|
|
6753
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { ...getErrorMessageProps(), children: props.errorMessage })
|
|
6582
6754
|
] }),
|
|
6583
|
-
targetRect && /* @__PURE__ */ (0,
|
|
6584
|
-
/* @__PURE__ */ (0,
|
|
6755
|
+
targetRect && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: (0, import_react_dom.createPortal)(
|
|
6756
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6585
6757
|
"div",
|
|
6586
6758
|
{
|
|
6587
6759
|
...getOptionsWrapperProps(),
|
|
@@ -6591,7 +6763,7 @@ var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
6591
6763
|
left: position == null ? void 0 : position.left,
|
|
6592
6764
|
width: targetRect.width
|
|
6593
6765
|
},
|
|
6594
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
6766
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6595
6767
|
option_default,
|
|
6596
6768
|
{
|
|
6597
6769
|
variant: originalProps.variant,
|
|
@@ -6741,15 +6913,15 @@ var select = tv({
|
|
|
6741
6913
|
|
|
6742
6914
|
// src/components/chip/chip.tsx
|
|
6743
6915
|
var import_react18 = require("react");
|
|
6744
|
-
var
|
|
6916
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
6745
6917
|
var Chip = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
6746
6918
|
var _a;
|
|
6747
6919
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, chipStyle.variantKeys);
|
|
6748
6920
|
const props = { ...rawProps, ...variantProps };
|
|
6749
6921
|
const Component = props.onClick ? "button" : "div";
|
|
6750
6922
|
const slots = (0, import_react18.useMemo)(() => chipStyle({ ...variantProps }), [variantProps]);
|
|
6751
|
-
const renderIcon = (name) => name ? /* @__PURE__ */ (0,
|
|
6752
|
-
return /* @__PURE__ */ (0,
|
|
6923
|
+
const renderIcon = (name) => name ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon_default, { name, fill: true, size: props.size, className: slots.icon() }) : null;
|
|
6924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
6753
6925
|
Component,
|
|
6754
6926
|
{
|
|
6755
6927
|
ref,
|
|
@@ -6925,12 +7097,12 @@ var chipStyle = tv({
|
|
|
6925
7097
|
|
|
6926
7098
|
// src/components/radio/radio.tsx
|
|
6927
7099
|
var import_react19 = require("react");
|
|
6928
|
-
var
|
|
7100
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
6929
7101
|
var Radio = (0, import_react19.forwardRef)((originalProps, ref) => {
|
|
6930
7102
|
const [props, variantProps] = mapPropsVariants(originalProps, radioStyle.variantKeys);
|
|
6931
7103
|
const { children, classNames, labelPosition = "end", ...inputProps } = props;
|
|
6932
7104
|
const slots = (0, import_react19.useMemo)(() => radioStyle({ ...variantProps }), [variantProps]);
|
|
6933
|
-
return /* @__PURE__ */ (0,
|
|
7105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
6934
7106
|
"label",
|
|
6935
7107
|
{
|
|
6936
7108
|
className: clsx(
|
|
@@ -6938,9 +7110,9 @@ var Radio = (0, import_react19.forwardRef)((originalProps, ref) => {
|
|
|
6938
7110
|
labelPosition === "start" && slots.labelReverse({ class: classNames == null ? void 0 : classNames.labelReverse })
|
|
6939
7111
|
),
|
|
6940
7112
|
children: [
|
|
6941
|
-
/* @__PURE__ */ (0,
|
|
6942
|
-
/* @__PURE__ */ (0,
|
|
6943
|
-
/* @__PURE__ */ (0,
|
|
7113
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { ...inputProps, type: "radio", ref }) }),
|
|
7114
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: slots.outerDot({ class: classNames == null ? void 0 : classNames.outerDot }), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: slots.innerDot({ class: classNames == null ? void 0 : classNames.innerDot }) }) }),
|
|
7115
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: slots.labelWrapper({ class: classNames == null ? void 0 : classNames.labelWrapper }), children: children && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children }) })
|
|
6944
7116
|
]
|
|
6945
7117
|
}
|
|
6946
7118
|
);
|
|
@@ -7081,20 +7253,20 @@ var radioStyle = tv({
|
|
|
7081
7253
|
|
|
7082
7254
|
// src/components/switch/switch.tsx
|
|
7083
7255
|
var import_react20 = require("react");
|
|
7084
|
-
var
|
|
7085
|
-
var
|
|
7256
|
+
var import_tailwind_variants17 = require("tailwind-variants");
|
|
7257
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
7086
7258
|
var Switch = (0, import_react20.forwardRef)((originalProps, ref) => {
|
|
7087
7259
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, switchStyle.variantKeys);
|
|
7088
7260
|
const { size, color, isDisabled, disableAnimation, id, classNames, ...inputProps } = { ...rawProps, ...variantProps };
|
|
7089
7261
|
const slots = (0, import_react20.useMemo)(() => switchStyle({ ...variantProps }), [variantProps]);
|
|
7090
|
-
return /* @__PURE__ */ (0,
|
|
7091
|
-
/* @__PURE__ */ (0,
|
|
7092
|
-
/* @__PURE__ */ (0,
|
|
7262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
7263
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { ...inputProps, id, ref, type: "checkbox", disabled: isDisabled, className: "hidden" }),
|
|
7264
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: slots.outerWrapper({ class: classNames == null ? void 0 : classNames.outerWrapper }), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: slots.thumb({ class: classNames == null ? void 0 : classNames.thumb }) }) }) })
|
|
7093
7265
|
] });
|
|
7094
7266
|
});
|
|
7095
7267
|
Switch.displayName = "Switch";
|
|
7096
7268
|
var switch_default = Switch;
|
|
7097
|
-
var switchStyle = (0,
|
|
7269
|
+
var switchStyle = (0, import_tailwind_variants17.tv)({
|
|
7098
7270
|
slots: {
|
|
7099
7271
|
base: ["group/switch", "relative", "max-w-fit", "inline-flex", "items-center", "justify-start", "cursor-pointer"],
|
|
7100
7272
|
outerWrapper: [
|
|
@@ -7198,316 +7370,8 @@ var switchStyle = (0, import_tailwind_variants16.tv)({
|
|
|
7198
7370
|
}
|
|
7199
7371
|
});
|
|
7200
7372
|
|
|
7201
|
-
// src/components/pagination/pagination.tsx
|
|
7202
|
-
var import_react22 = require("react");
|
|
7203
|
-
|
|
7204
|
-
// src/components/pagination/usePagination.ts
|
|
7205
|
-
var import_react21 = require("react");
|
|
7206
|
-
var usePagination = ({ currentPage, totalPage, groupSize, handleChangePage }) => {
|
|
7207
|
-
const startPage = (0, import_react21.useMemo)(() => Math.floor((currentPage - 1) / groupSize) * groupSize + 1, [currentPage, groupSize]);
|
|
7208
|
-
const endPage = (0, import_react21.useMemo)(() => Math.min(startPage + groupSize - 1, totalPage), [startPage, groupSize, totalPage]);
|
|
7209
|
-
const pageList = (0, import_react21.useMemo)(
|
|
7210
|
-
() => Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i),
|
|
7211
|
-
[startPage, endPage]
|
|
7212
|
-
);
|
|
7213
|
-
const handleClickMovePage = (0, import_react21.useCallback)(
|
|
7214
|
-
(page) => (event) => {
|
|
7215
|
-
event.preventDefault();
|
|
7216
|
-
handleChangePage == null ? void 0 : handleChangePage(page);
|
|
7217
|
-
},
|
|
7218
|
-
[handleChangePage]
|
|
7219
|
-
);
|
|
7220
|
-
return {
|
|
7221
|
-
startPage,
|
|
7222
|
-
endPage,
|
|
7223
|
-
pageList,
|
|
7224
|
-
handleClickMovePage
|
|
7225
|
-
};
|
|
7226
|
-
};
|
|
7227
|
-
var usePagination_default = usePagination;
|
|
7228
|
-
|
|
7229
|
-
// src/components/pagination/pagination.tsx
|
|
7230
|
-
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
7231
|
-
var Pagination = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
7232
|
-
const [props, variantProps] = mapPropsVariants(originalProps, pagination.variantKeys);
|
|
7233
|
-
const {
|
|
7234
|
-
classNames,
|
|
7235
|
-
currentPage,
|
|
7236
|
-
groupSize,
|
|
7237
|
-
totalPage,
|
|
7238
|
-
showPageNumber = true,
|
|
7239
|
-
showPageLabel,
|
|
7240
|
-
showPageInput,
|
|
7241
|
-
showFirstLastButtons,
|
|
7242
|
-
handleChangePage
|
|
7243
|
-
} = props;
|
|
7244
|
-
const { startPage, endPage, pageList, handleClickMovePage } = usePagination_default({
|
|
7245
|
-
currentPage,
|
|
7246
|
-
totalPage,
|
|
7247
|
-
groupSize,
|
|
7248
|
-
handleChangePage
|
|
7249
|
-
});
|
|
7250
|
-
const slots = (0, import_react22.useMemo)(() => pagination({ ...variantProps }), [variantProps]);
|
|
7251
|
-
const getBaseProps = (0, import_react22.useCallback)(() => ({ className: slots.base({ class: classNames == null ? void 0 : classNames.base }) }), [slots, classNames]);
|
|
7252
|
-
const getLabelProps = (0, import_react22.useCallback)(
|
|
7253
|
-
() => ({ className: `${slots.label({ class: classNames == null ? void 0 : classNames.label })} + ${showPageInput && " !min-w-[55px]"}` }),
|
|
7254
|
-
[slots, classNames, showPageInput]
|
|
7255
|
-
);
|
|
7256
|
-
const getWrapperProps = (0, import_react22.useCallback)(
|
|
7257
|
-
() => ({ className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }) }),
|
|
7258
|
-
[slots, classNames]
|
|
7259
|
-
);
|
|
7260
|
-
const getIconProps = (0, import_react22.useCallback)(() => ({ className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }) }), [slots, classNames]);
|
|
7261
|
-
const getButtonProps = (0, import_react22.useCallback)(
|
|
7262
|
-
() => ({ className: slots.button({ class: classNames == null ? void 0 : classNames.button }) }),
|
|
7263
|
-
[slots, classNames]
|
|
7264
|
-
);
|
|
7265
|
-
const getLabelWrapperProps = (0, import_react22.useCallback)(
|
|
7266
|
-
() => ({
|
|
7267
|
-
className: "flex shrink-0",
|
|
7268
|
-
onSubmit: (e) => {
|
|
7269
|
-
e.preventDefault();
|
|
7270
|
-
if (showPageInput && handleChangePage) {
|
|
7271
|
-
const formData = new FormData(e.target);
|
|
7272
|
-
const page = formData.get("pagination-input");
|
|
7273
|
-
if (page) handleChangePage(+page);
|
|
7274
|
-
}
|
|
7275
|
-
}
|
|
7276
|
-
}),
|
|
7277
|
-
[handleChangePage, showPageInput]
|
|
7278
|
-
);
|
|
7279
|
-
const getInputProps = (0, import_react22.useCallback)(
|
|
7280
|
-
() => ({
|
|
7281
|
-
defaultValue: currentPage,
|
|
7282
|
-
size: "sm",
|
|
7283
|
-
name: "pagination-input",
|
|
7284
|
-
type: "number",
|
|
7285
|
-
max: totalPage,
|
|
7286
|
-
min: 1,
|
|
7287
|
-
classNames: { inputWrapper: "!w-[48px] h-[20px] px-[6px]", input: "input-arrow-hide" }
|
|
7288
|
-
}),
|
|
7289
|
-
[currentPage, totalPage]
|
|
7290
|
-
);
|
|
7291
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ...getBaseProps(), children: [
|
|
7292
|
-
showPageLabel && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { ...getLabelProps(), children: `${currentPage} of ${totalPage}` }),
|
|
7293
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", { ...getLabelWrapperProps(), children: [
|
|
7294
|
-
showPageInput && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(input_default, { ...getInputProps() }, `${currentPage}+pagination-input`),
|
|
7295
|
-
showPageLabel && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { ...getLabelProps(), children: [
|
|
7296
|
-
!showPageInput && currentPage,
|
|
7297
|
-
` of ${totalPage}`
|
|
7298
|
-
] })
|
|
7299
|
-
] }),
|
|
7300
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ...getWrapperProps(), children: [
|
|
7301
|
-
showFirstLastButtons && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7302
|
-
"div",
|
|
7303
|
-
{
|
|
7304
|
-
"aria-label": "firstPage",
|
|
7305
|
-
"data-is-active": currentPage > 1,
|
|
7306
|
-
...getIconProps(),
|
|
7307
|
-
onClick: currentPage > 1 ? handleClickMovePage(1) : void 0,
|
|
7308
|
-
children: "<<"
|
|
7309
|
-
}
|
|
7310
|
-
),
|
|
7311
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7312
|
-
"div",
|
|
7313
|
-
{
|
|
7314
|
-
"aria-label": "prevPage",
|
|
7315
|
-
"data-is-active": currentPage > 1,
|
|
7316
|
-
...getIconProps(),
|
|
7317
|
-
onClick: currentPage > 1 ? handleClickMovePage(currentPage - 1) : void 0,
|
|
7318
|
-
children: "<"
|
|
7319
|
-
}
|
|
7320
|
-
),
|
|
7321
|
-
showPageNumber && pageList.map((page, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7322
|
-
"div",
|
|
7323
|
-
{
|
|
7324
|
-
...getButtonProps(),
|
|
7325
|
-
"data-selected": currentPage === page,
|
|
7326
|
-
onClick: handleClickMovePage(page),
|
|
7327
|
-
children: page
|
|
7328
|
-
},
|
|
7329
|
-
index
|
|
7330
|
-
)),
|
|
7331
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7332
|
-
"div",
|
|
7333
|
-
{
|
|
7334
|
-
"aria-label": "nextPage",
|
|
7335
|
-
"data-is-active": currentPage < totalPage,
|
|
7336
|
-
...getIconProps(),
|
|
7337
|
-
onClick: currentPage < totalPage ? handleClickMovePage(currentPage + 1) : void 0,
|
|
7338
|
-
children: ">"
|
|
7339
|
-
}
|
|
7340
|
-
),
|
|
7341
|
-
showFirstLastButtons && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7342
|
-
"div",
|
|
7343
|
-
{
|
|
7344
|
-
"aria-label": "lastPage",
|
|
7345
|
-
"data-is-active": currentPage < totalPage,
|
|
7346
|
-
...getIconProps(),
|
|
7347
|
-
onClick: currentPage < totalPage ? handleClickMovePage(totalPage) : void 0,
|
|
7348
|
-
children: ">>"
|
|
7349
|
-
}
|
|
7350
|
-
),
|
|
7351
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", { ...getLabelWrapperProps(), children: [
|
|
7352
|
-
showPageInput && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(input_default, { ...getInputProps() }, `${currentPage}+pagination-input`),
|
|
7353
|
-
showPageLabel && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { ...getLabelProps(), children: [
|
|
7354
|
-
!showPageInput && currentPage,
|
|
7355
|
-
` of ${totalPage}`
|
|
7356
|
-
] })
|
|
7357
|
-
] })
|
|
7358
|
-
] })
|
|
7359
|
-
] });
|
|
7360
|
-
});
|
|
7361
|
-
Pagination.displayName = "Pagination";
|
|
7362
|
-
var pagination_default = Pagination;
|
|
7363
|
-
var pagination = tv(
|
|
7364
|
-
{
|
|
7365
|
-
slots: {
|
|
7366
|
-
base: "flex items-center select-none",
|
|
7367
|
-
label: "text-primary-main text-right whitespace-nowrap",
|
|
7368
|
-
wrapper: "flex overflow-hidden flex items-center",
|
|
7369
|
-
icon: "flex items-center justify-center cursor-pointer",
|
|
7370
|
-
button: "flex items-center justify-center cursor-pointer data-[selected=true]:font-[600] transition duration-200"
|
|
7371
|
-
},
|
|
7372
|
-
variants: {
|
|
7373
|
-
variant: {
|
|
7374
|
-
solid: {
|
|
7375
|
-
button: ["text-neutral-dark"],
|
|
7376
|
-
icon: "text-neutral-dark data-[is-active=false]:text-neutral-light data-[is-active=false]:cursor-default"
|
|
7377
|
-
},
|
|
7378
|
-
line: {
|
|
7379
|
-
wrapper: "!gap-0",
|
|
7380
|
-
button: ["text-foreground"],
|
|
7381
|
-
icon: "text-foreground data-[is-active=false]:text-neutral-light data-[is-active=false]:cursor-default first-of-type:border-l-0"
|
|
7382
|
-
}
|
|
7383
|
-
},
|
|
7384
|
-
size: {
|
|
7385
|
-
sm: {
|
|
7386
|
-
wrapper: "gap-[6px]",
|
|
7387
|
-
label: "min-w-[85px] text-sm mr-[10px]",
|
|
7388
|
-
icon: ["h-[15px] text-sm"],
|
|
7389
|
-
button: ["min-w-[28px] h-[15px] text-sm"]
|
|
7390
|
-
},
|
|
7391
|
-
md: {
|
|
7392
|
-
wrapper: "gap-[8px]",
|
|
7393
|
-
label: "min-w-[95px] text-md mr-[12px]",
|
|
7394
|
-
icon: ["h-[17px] text-md"],
|
|
7395
|
-
button: ["min-w-[32px] h-[17px] text-md"]
|
|
7396
|
-
},
|
|
7397
|
-
lg: {
|
|
7398
|
-
wrapper: "gap-[10px]",
|
|
7399
|
-
label: "min-w-[105px] text-lg mr-[14px]",
|
|
7400
|
-
icon: ["h-[20px] text-lg"],
|
|
7401
|
-
button: ["min-w-[37px] h-[20px] text-lg"]
|
|
7402
|
-
},
|
|
7403
|
-
xl: {
|
|
7404
|
-
wrapper: "gap-[10px]",
|
|
7405
|
-
label: "min-w-[105px] text-lg mr-[14px]",
|
|
7406
|
-
icon: ["h-[20px] text-lg"],
|
|
7407
|
-
button: ["min-w-[37px] h-[20px] text-lg"]
|
|
7408
|
-
}
|
|
7409
|
-
},
|
|
7410
|
-
color: {
|
|
7411
|
-
primary: {
|
|
7412
|
-
label: "text-primary-main"
|
|
7413
|
-
},
|
|
7414
|
-
secondary: {
|
|
7415
|
-
label: "text-secondary-main"
|
|
7416
|
-
}
|
|
7417
|
-
},
|
|
7418
|
-
isDisabled: {
|
|
7419
|
-
true: {
|
|
7420
|
-
icon: "!text-neutral-light !cursor-default",
|
|
7421
|
-
button: "!text-neutral-light !cursor-default"
|
|
7422
|
-
}
|
|
7423
|
-
}
|
|
7424
|
-
},
|
|
7425
|
-
defaultVariants: {
|
|
7426
|
-
variant: "solid",
|
|
7427
|
-
color: "primary",
|
|
7428
|
-
size: "md",
|
|
7429
|
-
isDisabled: false
|
|
7430
|
-
},
|
|
7431
|
-
compoundVariants: [
|
|
7432
|
-
{
|
|
7433
|
-
variant: "solid",
|
|
7434
|
-
color: "primary",
|
|
7435
|
-
class: {
|
|
7436
|
-
button: "hover:text-primary-main data-[selected=true]:text-primary-main data-[selected=true]:border-primary-main",
|
|
7437
|
-
icon: "hover:text-primary-main"
|
|
7438
|
-
}
|
|
7439
|
-
},
|
|
7440
|
-
{
|
|
7441
|
-
variant: "solid",
|
|
7442
|
-
color: "secondary",
|
|
7443
|
-
class: {
|
|
7444
|
-
button: "hover:text-secondary-main data-[selected=true]:text-secondary-main data-[selected=true]:border-secondary-main",
|
|
7445
|
-
icon: "hover:text-secondary-main"
|
|
7446
|
-
}
|
|
7447
|
-
},
|
|
7448
|
-
{
|
|
7449
|
-
variant: "line",
|
|
7450
|
-
size: "sm",
|
|
7451
|
-
class: {
|
|
7452
|
-
wrapper: "border rounded-sm gap-0",
|
|
7453
|
-
button: "!min-w-[40px] h-[20px] border-l",
|
|
7454
|
-
icon: "min-w-[40px] h-[20px] border-l"
|
|
7455
|
-
}
|
|
7456
|
-
},
|
|
7457
|
-
{
|
|
7458
|
-
variant: "line",
|
|
7459
|
-
size: "md",
|
|
7460
|
-
class: {
|
|
7461
|
-
wrapper: "border rounded-md gap-0",
|
|
7462
|
-
button: "!min-w-[45px] h-[22px] border-l",
|
|
7463
|
-
icon: "min-w-[45px] h-[22px] border-l"
|
|
7464
|
-
}
|
|
7465
|
-
},
|
|
7466
|
-
{
|
|
7467
|
-
variant: "line",
|
|
7468
|
-
size: "lg",
|
|
7469
|
-
class: {
|
|
7470
|
-
wrapper: "border rounded-lg gap-0",
|
|
7471
|
-
button: "!min-w-[50px] h-[24px] border-l",
|
|
7472
|
-
icon: "min-w-[50px] h-[24px] border-l"
|
|
7473
|
-
}
|
|
7474
|
-
},
|
|
7475
|
-
{
|
|
7476
|
-
variant: "line",
|
|
7477
|
-
size: "xl",
|
|
7478
|
-
class: {
|
|
7479
|
-
wrapper: "border rounded-lg gap-0",
|
|
7480
|
-
button: "!min-w-[50px] h-[24px] border-l",
|
|
7481
|
-
icon: "min-w-[50px] h-[24px] border-l"
|
|
7482
|
-
}
|
|
7483
|
-
},
|
|
7484
|
-
{
|
|
7485
|
-
variant: "line",
|
|
7486
|
-
color: "primary",
|
|
7487
|
-
class: {
|
|
7488
|
-
wrapper: "border-primary-main",
|
|
7489
|
-
button: "border-primary-main hover:bg-primary-soft hover:text-primary-main data-[selected=true]:bg-primary-soft data-[selected=true]:text-primary-main",
|
|
7490
|
-
icon: "border-primary-main data-[selected=true]:bg-primary-soft data-[selected=true]:text-primary-main data-[is-active=true]:hover:text-primary-main data-[is-active=true]:hover:bg-primary-soft"
|
|
7491
|
-
}
|
|
7492
|
-
},
|
|
7493
|
-
{
|
|
7494
|
-
variant: "line",
|
|
7495
|
-
color: "secondary",
|
|
7496
|
-
class: {
|
|
7497
|
-
wrapper: "border-secondary-main",
|
|
7498
|
-
button: "border-secondary-main hover:bg-secondary-soft hover:text-secondary-main data-[selected=true]:bg-secondary-soft data-[selected=true]:text-secondary-main",
|
|
7499
|
-
icon: "border-secondary-main data-[selected=true]:bg-secondary-soft data-[selected=true]:text-secondary-main data-[is-active=true]:hover:text-secondary-main data-[is-active=true]:hover:bg-secondary-soft"
|
|
7500
|
-
}
|
|
7501
|
-
}
|
|
7502
|
-
]
|
|
7503
|
-
},
|
|
7504
|
-
{
|
|
7505
|
-
twMerge: false
|
|
7506
|
-
}
|
|
7507
|
-
);
|
|
7508
|
-
|
|
7509
7373
|
// src/components/tooltip/tooltip.tsx
|
|
7510
|
-
var
|
|
7374
|
+
var import_react22 = require("react");
|
|
7511
7375
|
var import_react_dom2 = require("react-dom");
|
|
7512
7376
|
|
|
7513
7377
|
// src/components/tooltip/tooltip-utils.ts
|
|
@@ -7630,11 +7494,11 @@ var getTailStyles = (placement) => {
|
|
|
7630
7494
|
};
|
|
7631
7495
|
|
|
7632
7496
|
// src/components/tooltip/useTooltip.ts
|
|
7633
|
-
var
|
|
7497
|
+
var import_react21 = require("react");
|
|
7634
7498
|
var useTooltip = ({ placement, offset, targetRect }) => {
|
|
7635
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
7636
|
-
const tooltipRef = (0,
|
|
7637
|
-
(0,
|
|
7499
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react21.useState)({ x: 0, y: 0 });
|
|
7500
|
+
const tooltipRef = (0, import_react21.useRef)(null);
|
|
7501
|
+
(0, import_react21.useEffect)(() => {
|
|
7638
7502
|
if (targetRect && tooltipRef.current) {
|
|
7639
7503
|
const { width, height } = tooltipRef.current.getBoundingClientRect();
|
|
7640
7504
|
const scrollX = window.scrollX;
|
|
@@ -7665,28 +7529,28 @@ var useTooltip = ({ placement, offset, targetRect }) => {
|
|
|
7665
7529
|
|
|
7666
7530
|
// src/components/tooltip/tooltip.tsx
|
|
7667
7531
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
7668
|
-
var Tooltip = (0,
|
|
7532
|
+
var Tooltip = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
7669
7533
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltipStyle.variantKeys);
|
|
7670
7534
|
const { placement = "top", offset = 5, delay = 100, persistent = false, classNames } = props;
|
|
7671
|
-
const slots = (0,
|
|
7672
|
-
const [targetRect, setTargetRect] = (0,
|
|
7535
|
+
const slots = (0, import_react22.useMemo)(() => tooltipStyle({ ...variantProps }), [variantProps]);
|
|
7536
|
+
const [targetRect, setTargetRect] = (0, import_react22.useState)(null);
|
|
7673
7537
|
const { tooltipPosition, tooltipRef } = useTooltip({
|
|
7674
7538
|
placement,
|
|
7675
7539
|
offset,
|
|
7676
7540
|
delay,
|
|
7677
7541
|
targetRect
|
|
7678
7542
|
});
|
|
7679
|
-
const childrenRef = (0,
|
|
7680
|
-
const delayTimeoutRef = (0,
|
|
7681
|
-
const getProps = (0,
|
|
7543
|
+
const childrenRef = (0, import_react22.useRef)(null);
|
|
7544
|
+
const delayTimeoutRef = (0, import_react22.useRef)(null);
|
|
7545
|
+
const getProps = (0, import_react22.useCallback)(
|
|
7682
7546
|
(slotKey, classNameKey) => ({
|
|
7683
7547
|
className: slots[slotKey]({ class: classNames == null ? void 0 : classNames[classNameKey] })
|
|
7684
7548
|
}),
|
|
7685
7549
|
[slots, classNames]
|
|
7686
7550
|
);
|
|
7687
|
-
const getBaseProps = (0,
|
|
7688
|
-
const getContentProps = (0,
|
|
7689
|
-
const showTooltip = (0,
|
|
7551
|
+
const getBaseProps = (0, import_react22.useCallback)(() => getProps("base", "base"), [getProps]);
|
|
7552
|
+
const getContentProps = (0, import_react22.useCallback)(() => getProps("content", "content"), [getProps]);
|
|
7553
|
+
const showTooltip = (0, import_react22.useCallback)(() => {
|
|
7690
7554
|
if (childrenRef.current) {
|
|
7691
7555
|
const rect = childrenRef.current.getBoundingClientRect();
|
|
7692
7556
|
setTargetRect({
|
|
@@ -7699,12 +7563,12 @@ var Tooltip = (0, import_react24.forwardRef)((originalProps, ref) => {
|
|
|
7699
7563
|
});
|
|
7700
7564
|
}
|
|
7701
7565
|
}, []);
|
|
7702
|
-
const hideTooltip = (0,
|
|
7566
|
+
const hideTooltip = (0, import_react22.useCallback)(() => {
|
|
7703
7567
|
if (!persistent) {
|
|
7704
7568
|
delayTimeoutRef.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
7705
7569
|
}
|
|
7706
7570
|
}, [persistent, delay]);
|
|
7707
|
-
(0,
|
|
7571
|
+
(0, import_react22.useEffect)(() => {
|
|
7708
7572
|
if (persistent) showTooltip();
|
|
7709
7573
|
}, [persistent, showTooltip]);
|
|
7710
7574
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
@@ -7789,10 +7653,10 @@ var tooltipStyle = tv({
|
|
|
7789
7653
|
});
|
|
7790
7654
|
|
|
7791
7655
|
// src/components/modal/modal.tsx
|
|
7792
|
-
var
|
|
7656
|
+
var import_react23 = require("react");
|
|
7793
7657
|
var import_react_dom3 = require("react-dom");
|
|
7794
7658
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
7795
|
-
var Modal = (0,
|
|
7659
|
+
var Modal = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
7796
7660
|
const [props, variantProps] = mapPropsVariants(originalProps, modal.variantKeys);
|
|
7797
7661
|
const {
|
|
7798
7662
|
classNames,
|
|
@@ -7809,8 +7673,8 @@ var Modal = (0, import_react25.forwardRef)((originalProps, ref) => {
|
|
|
7809
7673
|
onConfirm,
|
|
7810
7674
|
onCancel
|
|
7811
7675
|
} = props;
|
|
7812
|
-
const slots = (0,
|
|
7813
|
-
const getBackdropProps = (0,
|
|
7676
|
+
const slots = (0, import_react23.useMemo)(() => modal({ ...variantProps }), [...Object.values(variantProps)]);
|
|
7677
|
+
const getBackdropProps = (0, import_react23.useCallback)(
|
|
7814
7678
|
() => ({
|
|
7815
7679
|
className: slots.backdrop({ class: classNames == null ? void 0 : classNames.backdrop }),
|
|
7816
7680
|
onClick: (e) => {
|
|
@@ -7821,68 +7685,68 @@ var Modal = (0, import_react25.forwardRef)((originalProps, ref) => {
|
|
|
7821
7685
|
}),
|
|
7822
7686
|
[slots, classNames == null ? void 0 : classNames.backdrop, isDismissable, onCancel]
|
|
7823
7687
|
);
|
|
7824
|
-
const getModalWrapperProps = (0,
|
|
7688
|
+
const getModalWrapperProps = (0, import_react23.useCallback)(
|
|
7825
7689
|
() => ({
|
|
7826
7690
|
className: slots.modalWrapper({ class: classNames == null ? void 0 : classNames.modalWrapper }),
|
|
7827
7691
|
"data-icon-visibility": typeof icon !== "undefined"
|
|
7828
7692
|
}),
|
|
7829
7693
|
[slots, classNames == null ? void 0 : classNames.modalWrapper, icon]
|
|
7830
7694
|
);
|
|
7831
|
-
const getIconProps = (0,
|
|
7695
|
+
const getIconProps = (0, import_react23.useCallback)(
|
|
7832
7696
|
() => ({
|
|
7833
7697
|
className: slots.icon({ class: [classNames == null ? void 0 : classNames.icon] })
|
|
7834
7698
|
}),
|
|
7835
7699
|
[slots, classNames == null ? void 0 : classNames.icon]
|
|
7836
7700
|
);
|
|
7837
|
-
const getCloseIconProps = (0,
|
|
7701
|
+
const getCloseIconProps = (0, import_react23.useCallback)(
|
|
7838
7702
|
() => ({
|
|
7839
7703
|
className: slots.closeIcon({ class: [classNames == null ? void 0 : classNames.closeIcon, showCloseButton ? "" : "hidden"] })
|
|
7840
7704
|
}),
|
|
7841
7705
|
[slots, classNames == null ? void 0 : classNames.closeIcon, showCloseButton]
|
|
7842
7706
|
);
|
|
7843
|
-
const getBodyWrapperProps = (0,
|
|
7707
|
+
const getBodyWrapperProps = (0, import_react23.useCallback)(
|
|
7844
7708
|
() => ({
|
|
7845
7709
|
className: slots.bodyWrapper({ class: classNames == null ? void 0 : classNames.bodyWrapper })
|
|
7846
7710
|
}),
|
|
7847
7711
|
[slots, classNames == null ? void 0 : classNames.bodyWrapper]
|
|
7848
7712
|
);
|
|
7849
|
-
const getTitleWrapperProps = (0,
|
|
7713
|
+
const getTitleWrapperProps = (0, import_react23.useCallback)(
|
|
7850
7714
|
() => ({
|
|
7851
7715
|
className: slots.titleWrapper({ class: classNames == null ? void 0 : classNames.titleWrapper })
|
|
7852
7716
|
}),
|
|
7853
7717
|
[slots, classNames == null ? void 0 : classNames.titleWrapper]
|
|
7854
7718
|
);
|
|
7855
|
-
const getTitleProps = (0,
|
|
7719
|
+
const getTitleProps = (0, import_react23.useCallback)(
|
|
7856
7720
|
() => ({
|
|
7857
7721
|
className: slots.title({ class: classNames == null ? void 0 : classNames.title })
|
|
7858
7722
|
}),
|
|
7859
7723
|
[slots, classNames == null ? void 0 : classNames.title]
|
|
7860
7724
|
);
|
|
7861
|
-
const getSubTitleProps = (0,
|
|
7725
|
+
const getSubTitleProps = (0, import_react23.useCallback)(
|
|
7862
7726
|
() => ({
|
|
7863
7727
|
className: slots.subTitle({ class: classNames == null ? void 0 : classNames.subTitle })
|
|
7864
7728
|
}),
|
|
7865
7729
|
[slots, classNames == null ? void 0 : classNames.subTitle]
|
|
7866
7730
|
);
|
|
7867
|
-
const getBodyProps = (0,
|
|
7731
|
+
const getBodyProps = (0, import_react23.useCallback)(
|
|
7868
7732
|
() => ({
|
|
7869
7733
|
className: slots.body({ class: classNames == null ? void 0 : classNames.body })
|
|
7870
7734
|
}),
|
|
7871
7735
|
[slots, classNames == null ? void 0 : classNames.body]
|
|
7872
7736
|
);
|
|
7873
|
-
const getContentProps = (0,
|
|
7737
|
+
const getContentProps = (0, import_react23.useCallback)(
|
|
7874
7738
|
() => ({
|
|
7875
7739
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content })
|
|
7876
7740
|
}),
|
|
7877
7741
|
[slots, classNames == null ? void 0 : classNames.content]
|
|
7878
7742
|
);
|
|
7879
|
-
const getFooterWrapperProps = (0,
|
|
7743
|
+
const getFooterWrapperProps = (0, import_react23.useCallback)(
|
|
7880
7744
|
() => ({
|
|
7881
7745
|
className: slots.footerWrapper({ class: classNames == null ? void 0 : classNames.footerWrapper })
|
|
7882
7746
|
}),
|
|
7883
7747
|
[slots, classNames == null ? void 0 : classNames.footerWrapper]
|
|
7884
7748
|
);
|
|
7885
|
-
(0,
|
|
7749
|
+
(0, import_react23.useEffect)(() => {
|
|
7886
7750
|
if (isOpen) {
|
|
7887
7751
|
document.body.classList.add("overflow-hidden");
|
|
7888
7752
|
} else {
|
|
@@ -7984,15 +7848,15 @@ var modal = tv({
|
|
|
7984
7848
|
});
|
|
7985
7849
|
|
|
7986
7850
|
// src/components/list/list.tsx
|
|
7987
|
-
var
|
|
7851
|
+
var import_react24 = require("react");
|
|
7988
7852
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
7989
|
-
var List = (0,
|
|
7853
|
+
var List = (0, import_react24.forwardRef)((originalProps, ref) => {
|
|
7990
7854
|
const [props, variantProps] = mapPropsVariants(originalProps, listStyle.variantKeys);
|
|
7991
7855
|
const { children, classNames } = props;
|
|
7992
|
-
const slots = (0,
|
|
7993
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children:
|
|
7994
|
-
if (!(0,
|
|
7995
|
-
return (0,
|
|
7856
|
+
const slots = (0, import_react24.useMemo)(() => listStyle(variantProps), [variantProps]);
|
|
7857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: import_react24.Children.map(children, (child) => {
|
|
7858
|
+
if (!(0, import_react24.isValidElement)(child)) return child;
|
|
7859
|
+
return (0, import_react24.cloneElement)(child, {
|
|
7996
7860
|
...variantProps,
|
|
7997
7861
|
...child.props
|
|
7998
7862
|
});
|
|
@@ -8029,9 +7893,9 @@ var listStyle = tv({
|
|
|
8029
7893
|
});
|
|
8030
7894
|
|
|
8031
7895
|
// src/components/list/listItem.tsx
|
|
8032
|
-
var
|
|
7896
|
+
var import_react25 = require("react");
|
|
8033
7897
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
8034
|
-
var ListItem = (0,
|
|
7898
|
+
var ListItem = (0, import_react25.forwardRef)((props, ref) => {
|
|
8035
7899
|
const [rawProps, variantProps] = mapPropsVariants(props, listItemStyle.variantKeys);
|
|
8036
7900
|
const {
|
|
8037
7901
|
title,
|
|
@@ -8043,7 +7907,7 @@ var ListItem = (0, import_react27.forwardRef)((props, ref) => {
|
|
|
8043
7907
|
classNames,
|
|
8044
7908
|
onClick
|
|
8045
7909
|
} = { ...rawProps, ...variantProps };
|
|
8046
|
-
const slots = (0,
|
|
7910
|
+
const slots = (0, import_react25.useMemo)(() => listItemStyle(variantProps), [variantProps]);
|
|
8047
7911
|
const iconSize = ["lg", "xl"].includes(size) ? "lg" : "md";
|
|
8048
7912
|
const avatarSize = iconSize;
|
|
8049
7913
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), "data-selected": selected, onClick, children: [
|
|
@@ -8223,14 +8087,14 @@ var listItemStyle = tv({
|
|
|
8223
8087
|
});
|
|
8224
8088
|
|
|
8225
8089
|
// src/components/toast/toast.tsx
|
|
8226
|
-
var
|
|
8090
|
+
var import_react26 = require("react");
|
|
8227
8091
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
8228
|
-
var Toast = (0,
|
|
8092
|
+
var Toast = (0, import_react26.forwardRef)((originalProps, ref) => {
|
|
8229
8093
|
const [props, variantProps] = mapPropsVariants(originalProps, toast.variantKeys);
|
|
8230
8094
|
const { width = 300, placement, classNames, showIcon = true, showCloseButton = true, onClose, ...toastProps } = props;
|
|
8231
|
-
const slots = (0,
|
|
8232
|
-
const toastRef = (0,
|
|
8233
|
-
(0,
|
|
8095
|
+
const slots = (0, import_react26.useMemo)(() => toast({ ...variantProps }), [variantProps]);
|
|
8096
|
+
const toastRef = (0, import_react26.useRef)(null);
|
|
8097
|
+
(0, import_react26.useImperativeHandle)(
|
|
8234
8098
|
ref,
|
|
8235
8099
|
() => ({
|
|
8236
8100
|
getWidth: () => {
|
|
@@ -8241,7 +8105,7 @@ var Toast = (0, import_react28.forwardRef)((originalProps, ref) => {
|
|
|
8241
8105
|
}),
|
|
8242
8106
|
[]
|
|
8243
8107
|
);
|
|
8244
|
-
const getBaseProps = (0,
|
|
8108
|
+
const getBaseProps = (0, import_react26.useCallback)(
|
|
8245
8109
|
() => ({
|
|
8246
8110
|
className: slots.base({
|
|
8247
8111
|
class: [
|
|
@@ -8326,7 +8190,7 @@ var toast = tv({
|
|
|
8326
8190
|
});
|
|
8327
8191
|
|
|
8328
8192
|
// src/components/toast/use-toast.tsx
|
|
8329
|
-
var
|
|
8193
|
+
var import_react27 = require("react");
|
|
8330
8194
|
|
|
8331
8195
|
// src/components/toast/toast-utils.ts
|
|
8332
8196
|
var getToastPosition = (placement, width, offset) => {
|
|
@@ -8366,9 +8230,9 @@ var getToastPosition = (placement, width, offset) => {
|
|
|
8366
8230
|
|
|
8367
8231
|
// src/components/toast/use-toast.tsx
|
|
8368
8232
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
8369
|
-
var ToastContext = (0,
|
|
8233
|
+
var ToastContext = (0, import_react27.createContext)(null);
|
|
8370
8234
|
var useToast = () => {
|
|
8371
|
-
const context = (0,
|
|
8235
|
+
const context = (0, import_react27.useContext)(ToastContext);
|
|
8372
8236
|
if (!context) {
|
|
8373
8237
|
throw new Error("useToast must be used within a ToastProvider");
|
|
8374
8238
|
}
|
|
@@ -8378,10 +8242,10 @@ var ToastProvider = ({
|
|
|
8378
8242
|
globalOptions,
|
|
8379
8243
|
children
|
|
8380
8244
|
}) => {
|
|
8381
|
-
const [toasts, setToasts] = (0,
|
|
8382
|
-
const [containerStyle, setContainerStyle] = (0,
|
|
8383
|
-
const toastRef = (0,
|
|
8384
|
-
const addToast = (0,
|
|
8245
|
+
const [toasts, setToasts] = (0, import_react27.useState)([]);
|
|
8246
|
+
const [containerStyle, setContainerStyle] = (0, import_react27.useState)({});
|
|
8247
|
+
const toastRef = (0, import_react27.useRef)(null);
|
|
8248
|
+
const addToast = (0, import_react27.useCallback)((content, options) => {
|
|
8385
8249
|
const id = Date.now() + Math.floor(Math.random() * 1e5);
|
|
8386
8250
|
const newToast = {
|
|
8387
8251
|
id,
|
|
@@ -8393,7 +8257,7 @@ var ToastProvider = ({
|
|
|
8393
8257
|
setToasts((prevToasts) => prevToasts.filter((toast2) => toast2.id !== id));
|
|
8394
8258
|
}, options.duration || 3e3);
|
|
8395
8259
|
}, []);
|
|
8396
|
-
const removeToast = (0,
|
|
8260
|
+
const removeToast = (0, import_react27.useCallback)((id) => {
|
|
8397
8261
|
setToasts((prevToasts) => prevToasts.filter((toast2) => toast2.id !== id));
|
|
8398
8262
|
}, []);
|
|
8399
8263
|
const value = {
|
|
@@ -8409,7 +8273,7 @@ var ToastProvider = ({
|
|
|
8409
8273
|
}),
|
|
8410
8274
|
error: (content, options) => addToast(content, { type: "error", icon: "exclamation-circle", color: "danger", ...globalOptions, ...options })
|
|
8411
8275
|
};
|
|
8412
|
-
(0,
|
|
8276
|
+
(0, import_react27.useEffect)(() => {
|
|
8413
8277
|
var _a;
|
|
8414
8278
|
const width = (globalOptions == null ? void 0 : globalOptions.width) ? globalOptions == null ? void 0 : globalOptions.width : typeof ((_a = toastRef.current) == null ? void 0 : _a.getWidth) === "function" ? toastRef.current.getWidth() : 300;
|
|
8415
8279
|
const offset = 20;
|
|
@@ -8435,11 +8299,11 @@ var ToastProvider = ({
|
|
|
8435
8299
|
};
|
|
8436
8300
|
|
|
8437
8301
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
8438
|
-
var
|
|
8302
|
+
var import_react31 = __toESM(require("react"));
|
|
8439
8303
|
var import_react_dom4 = require("react-dom");
|
|
8440
8304
|
|
|
8441
8305
|
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
8442
|
-
var
|
|
8306
|
+
var import_react28 = require("react");
|
|
8443
8307
|
|
|
8444
8308
|
// src/components/dateTimePicker/util.ts
|
|
8445
8309
|
var formatDateToString = (date) => {
|
|
@@ -8455,17 +8319,17 @@ var formatStringToDate = (date) => {
|
|
|
8455
8319
|
|
|
8456
8320
|
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
8457
8321
|
var useDatePicker = ({ initialDate, initialTime }) => {
|
|
8458
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
8322
|
+
const [selectedDate, setSelectedDate] = (0, import_react28.useState)(
|
|
8459
8323
|
initialDate ? formatDateToString(initialDate) : ""
|
|
8460
8324
|
);
|
|
8461
|
-
const [selectedTime, setSelectedTime] = (0,
|
|
8462
|
-
const [targetRect, setTargetRect] = (0,
|
|
8463
|
-
const [popupWidth, setPopupWidth] = (0,
|
|
8464
|
-
const [popupHeight, setPopupHeight] = (0,
|
|
8465
|
-
const [isFocusInput, setIsFocusInput] = (0,
|
|
8466
|
-
const dateInputRef = (0,
|
|
8467
|
-
const datePickerWrapperRef = (0,
|
|
8468
|
-
const datePickerRef = (0,
|
|
8325
|
+
const [selectedTime, setSelectedTime] = (0, import_react28.useState)(initialTime ? initialTime : "");
|
|
8326
|
+
const [targetRect, setTargetRect] = (0, import_react28.useState)(null);
|
|
8327
|
+
const [popupWidth, setPopupWidth] = (0, import_react28.useState)(0);
|
|
8328
|
+
const [popupHeight, setPopupHeight] = (0, import_react28.useState)(0);
|
|
8329
|
+
const [isFocusInput, setIsFocusInput] = (0, import_react28.useState)(false);
|
|
8330
|
+
const dateInputRef = (0, import_react28.useRef)(null);
|
|
8331
|
+
const datePickerWrapperRef = (0, import_react28.useRef)(null);
|
|
8332
|
+
const datePickerRef = (0, import_react28.useRef)(null);
|
|
8469
8333
|
const DATE_PICKER_GAP = 4;
|
|
8470
8334
|
const calculatePositionWithScroll = (targetRect2) => {
|
|
8471
8335
|
if (targetRect2 && popupWidth && popupHeight) {
|
|
@@ -8498,7 +8362,7 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8498
8362
|
const handleBlueInput = () => {
|
|
8499
8363
|
setIsFocusInput(false);
|
|
8500
8364
|
};
|
|
8501
|
-
(0,
|
|
8365
|
+
(0, import_react28.useEffect)(() => {
|
|
8502
8366
|
const onClickOutside = (e) => {
|
|
8503
8367
|
if (datePickerRef.current && !datePickerRef.current.contains(e.target) && datePickerWrapperRef.current && !datePickerWrapperRef.current.contains(e.target)) {
|
|
8504
8368
|
setTargetRect(null);
|
|
@@ -8507,7 +8371,7 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8507
8371
|
window.addEventListener("mousedown", onClickOutside);
|
|
8508
8372
|
return () => window.removeEventListener("mousedown", onClickOutside);
|
|
8509
8373
|
}, []);
|
|
8510
|
-
(0,
|
|
8374
|
+
(0, import_react28.useEffect)(() => {
|
|
8511
8375
|
if (datePickerWrapperRef.current) {
|
|
8512
8376
|
setPopupHeight(datePickerWrapperRef.current.getBoundingClientRect().height);
|
|
8513
8377
|
setPopupWidth(datePickerWrapperRef.current.getBoundingClientRect().width);
|
|
@@ -8532,19 +8396,19 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8532
8396
|
};
|
|
8533
8397
|
|
|
8534
8398
|
// src/components/dateTimePicker/calendar.tsx
|
|
8535
|
-
var
|
|
8399
|
+
var import_react29 = __toESM(require("react"));
|
|
8536
8400
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
8537
|
-
var Calendar = (0,
|
|
8401
|
+
var Calendar = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
8538
8402
|
const [props, variantProps] = mapPropsVariants(originalProps, calendarStyle.variantKeys);
|
|
8539
8403
|
const { selectedDate, classNames, highlightWeekend = true, onChangeDate, ...inputProps } = props;
|
|
8540
|
-
const [currentDate, setCurrentDate] = (0,
|
|
8404
|
+
const [currentDate, setCurrentDate] = (0, import_react29.useState)(selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date());
|
|
8541
8405
|
const daysOfWeek = ["S", "M", "T", "W", "T", "F", "S"];
|
|
8542
|
-
(0,
|
|
8406
|
+
(0, import_react29.useEffect)(() => {
|
|
8543
8407
|
if (selectedDate) {
|
|
8544
8408
|
setCurrentDate(new Date(selectedDate));
|
|
8545
8409
|
}
|
|
8546
8410
|
}, [selectedDate]);
|
|
8547
|
-
const getCalendarDates = (0,
|
|
8411
|
+
const getCalendarDates = (0, import_react29.useCallback)(() => {
|
|
8548
8412
|
const year = currentDate.getFullYear();
|
|
8549
8413
|
const month = currentDate.getMonth();
|
|
8550
8414
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
@@ -8590,17 +8454,17 @@ var Calendar = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
8590
8454
|
onChangeDate(formatted);
|
|
8591
8455
|
}
|
|
8592
8456
|
};
|
|
8593
|
-
(0,
|
|
8457
|
+
(0, import_react29.useImperativeHandle)(ref, () => ({
|
|
8594
8458
|
getSelectedDate: () => selectedDate
|
|
8595
8459
|
}));
|
|
8596
|
-
const slots = (0,
|
|
8597
|
-
const getBaseProps = (0,
|
|
8460
|
+
const slots = (0, import_react29.useMemo)(() => calendarStyle({ ...variantProps }), [variantProps]);
|
|
8461
|
+
const getBaseProps = (0, import_react29.useCallback)(
|
|
8598
8462
|
() => ({
|
|
8599
8463
|
className: `${slots.base({ class: classNames == null ? void 0 : classNames.base })}`
|
|
8600
8464
|
}),
|
|
8601
8465
|
[slots, classNames]
|
|
8602
8466
|
);
|
|
8603
|
-
const getDateTitleProps = (0,
|
|
8467
|
+
const getDateTitleProps = (0, import_react29.useCallback)(
|
|
8604
8468
|
(index) => {
|
|
8605
8469
|
return {
|
|
8606
8470
|
className: `${slots.dateTitle({
|
|
@@ -8612,7 +8476,7 @@ var Calendar = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
8612
8476
|
},
|
|
8613
8477
|
[slots, classNames, highlightWeekend]
|
|
8614
8478
|
);
|
|
8615
|
-
const getDateProps = (0,
|
|
8479
|
+
const getDateProps = (0, import_react29.useCallback)(
|
|
8616
8480
|
(dateObj) => {
|
|
8617
8481
|
const today = /* @__PURE__ */ new Date();
|
|
8618
8482
|
const isToday = today.getDate() === dateObj.date && today.getMonth() === currentDate.getMonth() && today.getFullYear() === currentDate.getFullYear();
|
|
@@ -8644,7 +8508,7 @@ var Calendar = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
8644
8508
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7 gap-[5px] text-center mt-2", children: calendarDates.map((week, weekIndex) => {
|
|
8645
8509
|
const hasCurrentMonthDates = week.some((dateObj) => dateObj.currentMonth);
|
|
8646
8510
|
if (!hasCurrentMonthDates) return null;
|
|
8647
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
8511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react29.default.Fragment, { children: week.map((dateObj, index) => {
|
|
8648
8512
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { ...getDateProps(dateObj), children: dateObj.date }, index);
|
|
8649
8513
|
}) }, weekIndex);
|
|
8650
8514
|
}) })
|
|
@@ -8716,22 +8580,22 @@ var calendarStyle = tv({
|
|
|
8716
8580
|
});
|
|
8717
8581
|
|
|
8718
8582
|
// src/components/dateTimePicker/timePicker.tsx
|
|
8719
|
-
var
|
|
8583
|
+
var import_react30 = require("react");
|
|
8720
8584
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
8721
8585
|
var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime }) => {
|
|
8722
8586
|
const TOTAL_HOURS = 12;
|
|
8723
8587
|
const TOTAL_MINUTES = 60;
|
|
8724
8588
|
const ITEM_HEIGHT = 30;
|
|
8725
8589
|
const PERIODS = ["AM", "PM"];
|
|
8726
|
-
const [selectedHour, setSelectedHour] = (0,
|
|
8727
|
-
const [selectedMinute, setSelectedMinute] = (0,
|
|
8728
|
-
const [selectedPeriod, setSelectedPeriod] = (0,
|
|
8729
|
-
const hourRef = (0,
|
|
8730
|
-
const minuteRef = (0,
|
|
8731
|
-
const periodRef = (0,
|
|
8590
|
+
const [selectedHour, setSelectedHour] = (0, import_react30.useState)("01");
|
|
8591
|
+
const [selectedMinute, setSelectedMinute] = (0, import_react30.useState)("00");
|
|
8592
|
+
const [selectedPeriod, setSelectedPeriod] = (0, import_react30.useState)("AM");
|
|
8593
|
+
const hourRef = (0, import_react30.useRef)(null);
|
|
8594
|
+
const minuteRef = (0, import_react30.useRef)(null);
|
|
8595
|
+
const periodRef = (0, import_react30.useRef)(null);
|
|
8732
8596
|
const hoursArray = [...Array(TOTAL_HOURS).keys()].map((i) => (i + 1).toString().padStart(2, "0"));
|
|
8733
8597
|
const minutesArray = [...Array(TOTAL_MINUTES).keys()].map((i) => i.toString().padStart(2, "0"));
|
|
8734
|
-
(0,
|
|
8598
|
+
(0, import_react30.useEffect)(() => {
|
|
8735
8599
|
if (selectedTime) {
|
|
8736
8600
|
const { formattedHour, minute, period } = parseAndFormatTime(selectedTime);
|
|
8737
8601
|
setSelectedHour(formattedHour);
|
|
@@ -8742,7 +8606,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8742
8606
|
scrollToSelectedTime();
|
|
8743
8607
|
}
|
|
8744
8608
|
}, [selectedTime, isFocusInput]);
|
|
8745
|
-
(0,
|
|
8609
|
+
(0, import_react30.useEffect)(() => {
|
|
8746
8610
|
scrollToSelectedTime();
|
|
8747
8611
|
}, []);
|
|
8748
8612
|
const parseAndFormatTime = (time) => {
|
|
@@ -8828,7 +8692,7 @@ var timePicker_default = TimePicker;
|
|
|
8828
8692
|
|
|
8829
8693
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
8830
8694
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
8831
|
-
var DatePicker = (0,
|
|
8695
|
+
var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
8832
8696
|
const [props, variantProps] = mapPropsVariants(originalProps, dateTimePickerStyle.variantKeys);
|
|
8833
8697
|
const {
|
|
8834
8698
|
classNames,
|
|
@@ -8842,7 +8706,7 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
8842
8706
|
onChangeTime,
|
|
8843
8707
|
...inputProps
|
|
8844
8708
|
} = props;
|
|
8845
|
-
const slots = (0,
|
|
8709
|
+
const slots = (0, import_react31.useMemo)(() => dateTimePickerStyle({ ...variantProps }), [variantProps]);
|
|
8846
8710
|
const {
|
|
8847
8711
|
selectedDate,
|
|
8848
8712
|
selectedTime,
|
|
@@ -8863,32 +8727,32 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
8863
8727
|
initialTime: typeof value === "string" ? value : void 0
|
|
8864
8728
|
});
|
|
8865
8729
|
const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
|
|
8866
|
-
const getBaseProps = (0,
|
|
8730
|
+
const getBaseProps = (0, import_react31.useCallback)(
|
|
8867
8731
|
() => ({
|
|
8868
8732
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
8869
8733
|
}),
|
|
8870
8734
|
[slots, classNames]
|
|
8871
8735
|
);
|
|
8872
|
-
const getLabelProps = (0,
|
|
8736
|
+
const getLabelProps = (0, import_react31.useCallback)(
|
|
8873
8737
|
() => ({
|
|
8874
8738
|
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
8875
8739
|
}),
|
|
8876
8740
|
[slots, classNames]
|
|
8877
8741
|
);
|
|
8878
|
-
const getInnerWrapperProps = (0,
|
|
8742
|
+
const getInnerWrapperProps = (0, import_react31.useCallback)(
|
|
8879
8743
|
() => ({
|
|
8880
8744
|
className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
|
|
8881
8745
|
}),
|
|
8882
8746
|
[slots, classNames]
|
|
8883
8747
|
);
|
|
8884
|
-
const getInputWrapperProps = (0,
|
|
8748
|
+
const getInputWrapperProps = (0, import_react31.useCallback)(
|
|
8885
8749
|
() => ({
|
|
8886
8750
|
className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
8887
8751
|
ref: datePickerRef
|
|
8888
8752
|
}),
|
|
8889
8753
|
[slots, classNames]
|
|
8890
8754
|
);
|
|
8891
|
-
const getInputProps = (0,
|
|
8755
|
+
const getInputProps = (0, import_react31.useCallback)(
|
|
8892
8756
|
() => ({
|
|
8893
8757
|
...inputProps,
|
|
8894
8758
|
ref: ref || dateInputRef,
|
|
@@ -8919,27 +8783,27 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
8919
8783
|
}),
|
|
8920
8784
|
[inputProps, ref, dateInputRef, slots, classNames == null ? void 0 : classNames.input, selectedDate, selectedTime, type, value]
|
|
8921
8785
|
);
|
|
8922
|
-
const getContentProps = (0,
|
|
8786
|
+
const getContentProps = (0, import_react31.useCallback)(
|
|
8923
8787
|
() => ({
|
|
8924
8788
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
8925
8789
|
size: originalProps.size
|
|
8926
8790
|
}),
|
|
8927
8791
|
[slots, classNames, originalProps.size]
|
|
8928
8792
|
);
|
|
8929
|
-
const getErrorMessageProps = (0,
|
|
8793
|
+
const getErrorMessageProps = (0, import_react31.useCallback)(
|
|
8930
8794
|
() => ({
|
|
8931
8795
|
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
8932
8796
|
}),
|
|
8933
8797
|
[slots, classNames]
|
|
8934
8798
|
);
|
|
8935
8799
|
const renderStartContent = () => {
|
|
8936
|
-
if (
|
|
8800
|
+
if (import_react31.default.isValidElement(startContent)) {
|
|
8937
8801
|
const existingProps = startContent.props;
|
|
8938
8802
|
const mergedProps = {
|
|
8939
8803
|
...getContentProps(),
|
|
8940
8804
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
8941
8805
|
};
|
|
8942
|
-
return
|
|
8806
|
+
return import_react31.default.cloneElement(startContent, mergedProps);
|
|
8943
8807
|
} else {
|
|
8944
8808
|
const contentProps = getContentProps();
|
|
8945
8809
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ...contentProps, children: startContent });
|
|
@@ -8955,13 +8819,13 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
8955
8819
|
}
|
|
8956
8820
|
) });
|
|
8957
8821
|
const renderContentWithIcon = () => {
|
|
8958
|
-
if (
|
|
8822
|
+
if (import_react31.default.isValidElement(endContent)) {
|
|
8959
8823
|
const existingProps = endContent.props;
|
|
8960
8824
|
const mergedProps = {
|
|
8961
8825
|
...getContentProps(),
|
|
8962
8826
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
8963
8827
|
};
|
|
8964
|
-
return
|
|
8828
|
+
return import_react31.default.cloneElement(endContent, mergedProps);
|
|
8965
8829
|
} else if (errorMessage) {
|
|
8966
8830
|
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
8967
8831
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ...iconProps, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|