@deepnoid/ui 0.1.223 → 1.0.0
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 +266 -251
- package/dist/{chunk-NTNF5T5I.mjs → chunk-23KGTXH2.mjs} +1 -1
- package/dist/{chunk-SX3JDFTH.mjs → chunk-2K3HZMC6.mjs} +9 -9
- package/dist/{chunk-ZFC5O2V3.mjs → chunk-3JKORA4G.mjs} +1 -1
- package/dist/{chunk-HFOHFBZH.mjs → chunk-3N442F6I.mjs} +2 -2
- package/dist/{chunk-WA7CSZQ3.mjs → chunk-3QZPVRM5.mjs} +1 -1
- package/dist/{chunk-BH3I4LIZ.mjs → chunk-4V5D237Z.mjs} +1 -1
- package/dist/chunk-63JRWMWN.mjs +215 -0
- package/dist/{chunk-GDHLN463.mjs → chunk-6CNPC722.mjs} +2 -2
- package/dist/{chunk-4IEHQI5B.mjs → chunk-7JCCPTBU.mjs} +3 -3
- package/dist/chunk-A6UUVHC6.mjs +38 -0
- package/dist/{chunk-P5L4YI54.mjs → chunk-AOU4QX7H.mjs} +106 -40
- package/dist/{chunk-U7SYKG2C.mjs → chunk-BBCJTXGU.mjs} +1 -1
- package/dist/{chunk-4S4AAZFC.mjs → chunk-CBFUVFGI.mjs} +4 -4
- package/dist/{chunk-AGE57VDD.mjs → chunk-CBIV6KFQ.mjs} +22 -25
- package/dist/{chunk-KWHCUAFU.mjs → chunk-CGJBY53Q.mjs} +3 -3
- package/dist/{chunk-XZYQFBCT.mjs → chunk-DI7QXTYZ.mjs} +1 -1
- package/dist/{chunk-U4DJHAM5.mjs → chunk-DPWUIAVC.mjs} +413 -149
- package/dist/chunk-E4VJDQD5.mjs +142 -0
- package/dist/{chunk-TE5JU3WA.mjs → chunk-EAWNUQDB.mjs} +90 -133
- package/dist/{chunk-OXJX5G3O.mjs → chunk-EIVSXVP5.mjs} +2 -2
- package/dist/{chunk-JGG3ZUNG.mjs → chunk-GSOTTSR4.mjs} +1 -1
- package/dist/{chunk-NGRGAY42.mjs → chunk-HKF5BNPX.mjs} +1 -1
- package/dist/{chunk-2URJGQFC.mjs → chunk-JUKILR6X.mjs} +2 -2
- package/dist/{chunk-DW3BX4M2.mjs → chunk-KPOXK7NN.mjs} +1 -1
- package/dist/{chunk-5KC3IFNR.mjs → chunk-LJSGQO4B.mjs} +1 -1
- package/dist/{chunk-LH6Z7SDZ.mjs → chunk-M7V5YMM2.mjs} +1 -1
- package/dist/{chunk-44FMPRHV.mjs → chunk-MAGZDGUW.mjs} +67 -38
- package/dist/chunk-MV2WCFK7.mjs +1 -0
- package/dist/{chunk-U52FBRJ3.mjs → chunk-NJWXYTBQ.mjs} +1 -1
- package/dist/{chunk-3DCUMRYP.mjs → chunk-NPQBJO6G.mjs} +11 -39
- package/dist/chunk-OK34FKBQ.mjs +224 -0
- package/dist/{chunk-OC5C42CB.mjs → chunk-OPGGL4CG.mjs} +3 -3
- package/dist/{chunk-R2XKPG4K.mjs → chunk-OPSMMRA2.mjs} +1 -1
- package/dist/{chunk-4X35QQTI.mjs → chunk-P4GNXDMO.mjs} +1 -1
- package/dist/{chunk-MTT24BLX.mjs → chunk-PCWANNZ4.mjs} +3 -3
- package/dist/{chunk-V2YH54JQ.mjs → chunk-PXUYPS6M.mjs} +12 -2
- package/dist/chunk-RFHWRBAB.mjs +105 -0
- package/dist/{chunk-EJ4GDC6K.mjs → chunk-S2T4GHJA.mjs} +27 -27
- package/dist/{chunk-5VTYO3RF.mjs → chunk-TBI5O3OL.mjs} +1 -1
- package/dist/{chunk-FZYZSMSS.mjs → chunk-TBRF36RK.mjs} +1 -1
- package/dist/{chunk-Q3KBMVJS.mjs → chunk-TEERNFIT.mjs} +77 -46
- package/dist/{chunk-RH3AHG52.mjs → chunk-V5XX3CGL.mjs} +1 -1
- package/dist/{chunk-6WD32ERF.mjs → chunk-VO2ZIGIK.mjs} +1 -1
- package/dist/{chunk-H6ZQDMYU.mjs → chunk-VOOEH6OJ.mjs} +24 -38
- package/dist/{chunk-ACZ3DQVT.mjs → chunk-VUO5J2OK.mjs} +16 -15
- package/dist/{chunk-RY5VVXQ4.mjs → chunk-WYTAGN2P.mjs} +1 -1
- package/dist/{chunk-NDNIAALB.mjs → chunk-YBDQSEPV.mjs} +17 -18
- package/dist/chunk-Z4NO7SMY.mjs +460 -0
- package/dist/components/accordion/accordion.js +366 -4
- package/dist/components/accordion/accordion.mjs +2 -2
- package/dist/components/accordion/accordionItem.js +366 -4
- package/dist/components/accordion/accordionItem.mjs +2 -2
- package/dist/components/accordion/index.js +366 -4
- package/dist/components/accordion/index.mjs +3 -3
- package/dist/components/avatar/avatar.js +472 -44
- package/dist/components/avatar/avatar.mjs +3 -3
- package/dist/components/avatar/index.js +472 -44
- package/dist/components/avatar/index.mjs +3 -3
- package/dist/components/backdrop/backdrop.js +366 -4
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.js +366 -4
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +951 -74
- package/dist/components/breadcrumb/breadcrumb.mjs +10 -9
- package/dist/components/breadcrumb/index.js +951 -74
- package/dist/components/breadcrumb/index.mjs +10 -9
- package/dist/components/button/button-group.js +366 -4
- package/dist/components/button/button-group.mjs +2 -2
- package/dist/components/button/button.d.mts +82 -119
- package/dist/components/button/button.d.ts +82 -119
- package/dist/components/button/button.js +966 -355
- package/dist/components/button/button.mjs +6 -5
- package/dist/components/button/button.style.d.mts +89 -0
- package/dist/components/button/button.style.d.ts +89 -0
- package/dist/components/button/button.style.js +1172 -0
- package/dist/components/button/button.style.mjs +9 -0
- package/dist/components/button/icon-button.d.mts +45 -46
- package/dist/components/button/icon-button.d.ts +45 -46
- package/dist/components/button/icon-button.js +1125 -527
- package/dist/components/button/icon-button.mjs +6 -5
- package/dist/components/button/index.js +1154 -830
- package/dist/components/button/index.mjs +9 -8
- package/dist/components/button/text-button.d.mts +59 -39
- package/dist/components/button/text-button.d.ts +59 -39
- package/dist/components/button/text-button.js +831 -21
- package/dist/components/button/text-button.mjs +3 -2
- package/dist/components/charts/areaChart.js +366 -4
- package/dist/components/charts/areaChart.mjs +2 -2
- package/dist/components/charts/barChart.js +366 -4
- package/dist/components/charts/barChart.mjs +2 -2
- package/dist/components/charts/circularProgress.js +366 -4
- package/dist/components/charts/circularProgress.mjs +2 -2
- package/dist/components/charts/index.js +366 -4
- package/dist/components/charts/index.mjs +6 -6
- package/dist/components/charts/radarChart.js +366 -4
- package/dist/components/charts/radarChart.mjs +2 -2
- package/dist/components/charts/simpleBarChart.js +366 -4
- package/dist/components/charts/simpleBarChart.mjs +2 -2
- package/dist/components/checkbox/checkbox.js +376 -42
- package/dist/components/checkbox/checkbox.mjs +2 -2
- package/dist/components/checkbox/index.js +376 -42
- package/dist/components/checkbox/index.mjs +2 -2
- package/dist/components/chip/chip.d.mts +32 -0
- package/dist/components/chip/chip.d.ts +32 -0
- package/dist/components/chip/chip.js +496 -57
- package/dist/components/chip/chip.mjs +4 -4
- package/dist/components/chip/index.js +496 -57
- package/dist/components/chip/index.mjs +4 -4
- package/dist/components/drawer/drawer.js +366 -4
- package/dist/components/drawer/drawer.mjs +2 -2
- package/dist/components/drawer/index.js +366 -4
- package/dist/components/drawer/index.mjs +2 -2
- package/dist/components/fileUpload/fileUpload.js +1014 -402
- package/dist/components/fileUpload/fileUpload.mjs +12 -11
- package/dist/components/fileUpload/index.js +1014 -402
- package/dist/components/fileUpload/index.mjs +12 -11
- package/dist/components/icon/Icon.d.mts +23 -10
- package/dist/components/icon/Icon.d.ts +23 -10
- package/dist/components/icon/Icon.js +120 -53
- package/dist/components/icon/Icon.mjs +2 -2
- package/dist/components/icon/index.js +120 -53
- package/dist/components/icon/index.mjs +2 -2
- package/dist/components/icon/template.d.mts +5 -2
- package/dist/components/icon/template.d.ts +5 -2
- package/dist/components/icon/template.js +106 -40
- package/dist/components/icon/template.mjs +1 -1
- package/dist/components/input/index.js +511 -82
- package/dist/components/input/index.mjs +4 -4
- package/dist/components/input/input.js +511 -82
- package/dist/components/input/input.mjs +4 -4
- package/dist/components/list/index.js +486 -57
- package/dist/components/list/index.mjs +6 -6
- package/dist/components/list/list.js +366 -4
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.js +486 -57
- package/dist/components/list/listItem.mjs +5 -5
- package/dist/components/modal/GlobalModalProvider.d.mts +2 -0
- package/dist/components/modal/GlobalModalProvider.d.ts +2 -0
- package/dist/components/modal/GlobalModalProvider.js +1028 -416
- package/dist/components/modal/GlobalModalProvider.mjs +12 -11
- package/dist/components/modal/index.d.mts +2 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +1028 -416
- package/dist/components/modal/index.mjs +13 -12
- package/dist/components/modal/modal.d.mts +101 -29
- package/dist/components/modal/modal.d.ts +101 -29
- package/dist/components/modal/modal.js +1028 -416
- package/dist/components/modal/modal.mjs +11 -10
- package/dist/components/modal/useGlobalModal.d.mts +2 -0
- package/dist/components/modal/useGlobalModal.d.ts +2 -0
- package/dist/components/modal/useGlobalModal.mjs +13 -12
- package/dist/components/pagination/index.js +598 -212
- package/dist/components/pagination/index.mjs +5 -5
- package/dist/components/pagination/pagination.js +598 -212
- package/dist/components/pagination/pagination.mjs +5 -5
- package/dist/components/picker/datePicker.js +1029 -705
- package/dist/components/picker/datePicker.mjs +12 -11
- package/dist/components/picker/day.js +366 -4
- package/dist/components/picker/day.mjs +2 -2
- package/dist/components/picker/index.js +1027 -703
- package/dist/components/picker/index.mjs +15 -14
- package/dist/components/picker/timePicker/Panel.js +831 -21
- package/dist/components/picker/timePicker/Panel.mjs +10 -9
- package/dist/components/picker/timePicker/index.js +976 -99
- package/dist/components/picker/timePicker/index.mjs +12 -11
- package/dist/components/progress/index.js +381 -18
- package/dist/components/progress/index.mjs +2 -2
- package/dist/components/progress/progress.d.mts +21 -18
- package/dist/components/progress/progress.d.ts +21 -18
- package/dist/components/progress/progress.js +381 -18
- package/dist/components/progress/progress.mjs +2 -2
- package/dist/components/radio/index.js +389 -41
- package/dist/components/radio/index.mjs +2 -2
- package/dist/components/radio/radio.d.mts +33 -48
- package/dist/components/radio/radio.d.ts +33 -48
- package/dist/components/radio/radio.js +389 -41
- package/dist/components/radio/radio.mjs +2 -2
- package/dist/components/ripple/index.mjs +3 -3
- package/dist/components/select/index.js +819 -221
- package/dist/components/select/index.mjs +10 -9
- package/dist/components/select/select.js +819 -221
- package/dist/components/select/select.mjs +10 -9
- package/dist/components/slider/index.d.mts +4 -0
- package/dist/components/slider/index.d.ts +4 -0
- package/dist/components/slider/index.js +955 -0
- package/dist/components/slider/index.mjs +11 -0
- package/dist/components/slider/slider.d.mts +158 -0
- package/dist/components/slider/slider.d.ts +158 -0
- package/dist/components/slider/slider.js +949 -0
- package/dist/components/slider/slider.mjs +10 -0
- package/dist/components/starRating/index.js +486 -57
- package/dist/components/starRating/index.mjs +4 -4
- package/dist/components/starRating/starRating.js +486 -57
- package/dist/components/starRating/starRating.mjs +4 -4
- package/dist/components/switch/index.js +22 -25
- package/dist/components/switch/index.mjs +1 -1
- package/dist/components/switch/switch.d.mts +0 -18
- package/dist/components/switch/switch.d.ts +0 -18
- package/dist/components/switch/switch.js +22 -25
- package/dist/components/switch/switch.mjs +1 -1
- package/dist/components/table/definition-table.js +366 -4
- package/dist/components/table/definition-table.mjs +2 -2
- package/dist/components/table/form-table.js +366 -4
- package/dist/components/table/form-table.mjs +1 -1
- package/dist/components/table/index.js +679 -291
- package/dist/components/table/index.mjs +10 -10
- package/dist/components/table/table-body.js +679 -291
- package/dist/components/table/table-body.mjs +7 -7
- package/dist/components/table/table-head.js +679 -291
- package/dist/components/table/table-head.mjs +7 -7
- package/dist/components/table/table.d.mts +8 -29
- package/dist/components/table/table.d.ts +8 -29
- package/dist/components/table/table.js +679 -291
- package/dist/components/table/table.mjs +7 -7
- package/dist/components/tabs/index.js +366 -4
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.js +366 -4
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/textarea/index.js +67 -38
- package/dist/components/textarea/index.mjs +1 -1
- package/dist/components/textarea/textarea.d.mts +21 -0
- package/dist/components/textarea/textarea.d.ts +21 -0
- package/dist/components/textarea/textarea.js +67 -38
- package/dist/components/textarea/textarea.mjs +1 -1
- package/dist/components/timePicker/calendar.js +486 -57
- package/dist/components/timePicker/calendar.mjs +3 -3
- package/dist/components/toast/index.js +486 -57
- package/dist/components/toast/index.mjs +5 -5
- package/dist/components/toast/toast.js +486 -57
- package/dist/components/toast/toast.mjs +4 -4
- package/dist/components/toast/use-toast.js +486 -57
- package/dist/components/toast/use-toast.mjs +5 -5
- package/dist/components/tooltip/index.js +366 -4
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.js +366 -4
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/components/tree/index.js +486 -57
- package/dist/components/tree/index.mjs +4 -4
- package/dist/components/tree/tree.js +486 -57
- package/dist/components/tree/tree.mjs +4 -4
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1705 -1281
- package/dist/index.mjs +76 -70
- package/dist/utils/tailwind-variants.js +366 -4
- package/dist/utils/tailwind-variants.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-6AID2NLT.mjs +0 -37
- package/dist/chunk-BBRO35V3.mjs +0 -385
- package/dist/chunk-EVJ46M3U.mjs +0 -141
- package/dist/chunk-SKX5QPUD.mjs +0 -482
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ripple_default
|
|
4
|
+
} from "./chunk-LXHUO6VM.mjs";
|
|
5
|
+
import {
|
|
6
|
+
useRipple
|
|
7
|
+
} from "./chunk-SZL743JC.mjs";
|
|
8
|
+
import {
|
|
9
|
+
Icon_default
|
|
10
|
+
} from "./chunk-A6UUVHC6.mjs";
|
|
11
|
+
import {
|
|
12
|
+
buttonBaseStyle
|
|
13
|
+
} from "./chunk-Z4NO7SMY.mjs";
|
|
14
|
+
import {
|
|
15
|
+
mapPropsVariants
|
|
16
|
+
} from "./chunk-E3G5QXSH.mjs";
|
|
17
|
+
import {
|
|
18
|
+
tv
|
|
19
|
+
} from "./chunk-DPWUIAVC.mjs";
|
|
20
|
+
|
|
21
|
+
// src/components/button/icon-button.tsx
|
|
22
|
+
import { forwardRef, useMemo, useCallback } from "react";
|
|
23
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
var IconButton = forwardRef((props, ref) => {
|
|
25
|
+
const [localProps, variantProps] = mapPropsVariants(props, iconButtonStyle.variantKeys);
|
|
26
|
+
const { classNames, name, disableRipple, disabled, isLoading, size, isInGroup, onMouseDown, ...buttonProps } = {
|
|
27
|
+
...localProps,
|
|
28
|
+
...variantProps
|
|
29
|
+
};
|
|
30
|
+
const slots = useMemo(() => iconButtonStyle({ ...variantProps }), [variantProps]);
|
|
31
|
+
const { onPress, onClear, ripples } = useRipple();
|
|
32
|
+
const handleRipple = useCallback(
|
|
33
|
+
(e) => {
|
|
34
|
+
if (!disableRipple && !disabled) {
|
|
35
|
+
onPress(e);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
[disableRipple, disabled, onPress]
|
|
39
|
+
);
|
|
40
|
+
const handleMouseDown = useCallback(
|
|
41
|
+
(e) => {
|
|
42
|
+
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
43
|
+
handleRipple(e);
|
|
44
|
+
},
|
|
45
|
+
[onMouseDown, handleRipple]
|
|
46
|
+
);
|
|
47
|
+
const rippleProps = useMemo(() => ({ ripples, onClear }), [ripples, onClear]);
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
...buttonProps,
|
|
52
|
+
onMouseDown: handleMouseDown,
|
|
53
|
+
ref,
|
|
54
|
+
disabled: disabled || isLoading,
|
|
55
|
+
"data-loading": isLoading,
|
|
56
|
+
className: slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
57
|
+
children: isLoading ? /* @__PURE__ */ jsx(Icon_default, { name: "loading", size, className: "animate-spin" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
+
/* @__PURE__ */ jsx(Icon_default, { name, size }),
|
|
59
|
+
!disableRipple && /* @__PURE__ */ jsx(ripple_default, { ...rippleProps })
|
|
60
|
+
] })
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
IconButton.displayName = "IconButton";
|
|
65
|
+
var icon_button_default = IconButton;
|
|
66
|
+
var iconButtonStyle = tv({
|
|
67
|
+
extend: buttonBaseStyle,
|
|
68
|
+
variants: {
|
|
69
|
+
size: {
|
|
70
|
+
sm: {
|
|
71
|
+
base: ["w-[24px]", "h-[24px]", "rounded-sm"]
|
|
72
|
+
},
|
|
73
|
+
md: {
|
|
74
|
+
base: ["w-[32px]", "h-[32px]", "rounded-md"]
|
|
75
|
+
},
|
|
76
|
+
lg: {
|
|
77
|
+
base: ["w-[40px]", "h-[40px]", "rounded-lg"]
|
|
78
|
+
},
|
|
79
|
+
xl: {
|
|
80
|
+
base: ["w-[50px]", "h-[50px]", "rounded-xl"]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
full: {
|
|
84
|
+
true: {
|
|
85
|
+
base: ["w-full", "h-full"]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
isLoading: {
|
|
89
|
+
true: {}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
defaultVariants: {
|
|
93
|
+
size: "md",
|
|
94
|
+
variant: "solid",
|
|
95
|
+
color: "primary",
|
|
96
|
+
full: false,
|
|
97
|
+
disabled: false,
|
|
98
|
+
isLoading: false,
|
|
99
|
+
isInGroup: false
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
icon_button_default
|
|
105
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Icon_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A6UUVHC6.mjs";
|
|
5
5
|
import {
|
|
6
6
|
clsx
|
|
7
7
|
} from "./chunk-27Y6K5NK.mjs";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-E3G5QXSH.mjs";
|
|
11
11
|
import {
|
|
12
12
|
tv
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DPWUIAVC.mjs";
|
|
14
14
|
|
|
15
15
|
// src/components/input/input.tsx
|
|
16
16
|
import {
|
|
@@ -158,10 +158,10 @@ var inputStyle = tv(
|
|
|
158
158
|
"placeholder:text-neutral-main",
|
|
159
159
|
"outline-none",
|
|
160
160
|
"focus:ring-0",
|
|
161
|
-
"group-
|
|
162
|
-
"group-
|
|
163
|
-
"
|
|
164
|
-
"
|
|
161
|
+
"group-hover/input:text-neutral-dark",
|
|
162
|
+
"group-hover/input:placeholder:text-neutral-dark",
|
|
163
|
+
"focus:text-neutral-dark",
|
|
164
|
+
"focus:placeholder:text-neutral-dark",
|
|
165
165
|
"read-only:!text-body-foreground",
|
|
166
166
|
"read-only:placeholder:!text-body-foreground"
|
|
167
167
|
],
|
|
@@ -170,10 +170,10 @@ var inputStyle = tv(
|
|
|
170
170
|
"items-center",
|
|
171
171
|
"select-none",
|
|
172
172
|
"text-neutral-main",
|
|
173
|
-
"
|
|
174
|
-
"
|
|
173
|
+
"transition-colors",
|
|
174
|
+
"group-hover/input:text-neutral-dark"
|
|
175
175
|
],
|
|
176
|
-
helperMessage: ["text-neutral-main", "group-
|
|
176
|
+
helperMessage: ["text-neutral-main", "group-hover/input:text-neutral-dark"],
|
|
177
177
|
errorMessage: ["text-danger-main"],
|
|
178
178
|
readonlyWrapper: [
|
|
179
179
|
"pointer-events-none",
|
|
@@ -212,46 +212,46 @@ var inputStyle = tv(
|
|
|
212
212
|
},
|
|
213
213
|
color: {
|
|
214
214
|
primary: {
|
|
215
|
-
content: ["group-
|
|
216
|
-
helperMessage: ["group-
|
|
217
|
-
readonly: ["text-primary-main"]
|
|
215
|
+
content: ["group-focus-within/input:!text-primary-main"],
|
|
216
|
+
helperMessage: ["group-focus-within/input:!text-primary-main"],
|
|
217
|
+
readonly: ["!text-primary-main"]
|
|
218
218
|
},
|
|
219
219
|
secondary: {
|
|
220
|
-
content: ["group-
|
|
221
|
-
helperMessage: ["group-
|
|
222
|
-
readonly: ["text-secondary-main"]
|
|
220
|
+
content: ["group-focus-within/input:!text-secondary-main"],
|
|
221
|
+
helperMessage: ["group-focus-within/input:!text-secondary-main"],
|
|
222
|
+
readonly: ["!text-secondary-main"]
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
225
|
size: {
|
|
226
226
|
sm: {
|
|
227
|
-
base: ["text-sm", "gap-
|
|
227
|
+
base: ["text-sm", "gap-sm"],
|
|
228
228
|
label: ["text-sm"],
|
|
229
|
-
innerWrapper: ["gap-
|
|
230
|
-
inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-
|
|
229
|
+
innerWrapper: ["gap-sm"],
|
|
230
|
+
inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-xs", "gap-sm"],
|
|
231
231
|
helperMessage: ["text-sm"],
|
|
232
232
|
errorMessage: ["text-sm"]
|
|
233
233
|
},
|
|
234
234
|
md: {
|
|
235
|
-
base: ["text-md", "gap-
|
|
235
|
+
base: ["text-md", "gap-md"],
|
|
236
236
|
label: ["text-md"],
|
|
237
|
-
innerWrapper: ["gap-
|
|
238
|
-
inputWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-
|
|
237
|
+
innerWrapper: ["gap-md"],
|
|
238
|
+
inputWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-sm", "gap-md"],
|
|
239
239
|
helperMessage: ["text-sm"],
|
|
240
240
|
errorMessage: ["text-sm"]
|
|
241
241
|
},
|
|
242
242
|
lg: {
|
|
243
|
-
base: ["text-lg", "gap-
|
|
243
|
+
base: ["text-lg", "gap-lg"],
|
|
244
244
|
label: ["text-lg"],
|
|
245
|
-
innerWrapper: ["gap-
|
|
246
|
-
inputWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-
|
|
245
|
+
innerWrapper: ["gap-lg"],
|
|
246
|
+
inputWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-md", "gap-lg"],
|
|
247
247
|
helperMessage: ["text-md"],
|
|
248
248
|
errorMessage: ["text-md"]
|
|
249
249
|
},
|
|
250
250
|
xl: {
|
|
251
|
-
base: ["text-xl", "gap-
|
|
251
|
+
base: ["text-xl", "gap-xl"],
|
|
252
252
|
label: ["text-xl"],
|
|
253
|
-
innerWrapper: ["gap-
|
|
254
|
-
inputWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-
|
|
253
|
+
innerWrapper: ["gap-xl"],
|
|
254
|
+
inputWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-lg", "gap-xl"],
|
|
255
255
|
helperMessage: ["text-md"],
|
|
256
256
|
errorMessage: ["text-md"]
|
|
257
257
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
pagination_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EAWNUQDB.mjs";
|
|
5
5
|
import {
|
|
6
6
|
checkbox_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NPQBJO6G.mjs";
|
|
8
8
|
import {
|
|
9
9
|
scrollArea_default
|
|
10
10
|
} from "./chunk-EWS3FESG.mjs";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-E3G5QXSH.mjs";
|
|
17
17
|
|
|
18
18
|
// src/components/table/table-head.tsx
|
|
19
|
-
import { useLayoutEffect as useLayoutEffect2, useRef as
|
|
19
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef3, useState as useState3 } from "react";
|
|
20
20
|
|
|
21
21
|
// src/components/table/table.tsx
|
|
22
22
|
import {
|
|
@@ -24,7 +24,8 @@ import {
|
|
|
24
24
|
useEffect,
|
|
25
25
|
useImperativeHandle,
|
|
26
26
|
useMemo,
|
|
27
|
-
useState as useState2
|
|
27
|
+
useState as useState2,
|
|
28
|
+
useRef as useRef2
|
|
28
29
|
} from "react";
|
|
29
30
|
import { tv } from "tailwind-variants";
|
|
30
31
|
|
|
@@ -66,7 +67,16 @@ function TableCell({
|
|
|
66
67
|
textOverflow: isTextContent ? "ellipsis" : void 0
|
|
67
68
|
},
|
|
68
69
|
title: showTitle && isTextContent ? String(content != null ? content : "") : void 0,
|
|
69
|
-
children: content
|
|
70
|
+
children: isTextContent ? content : /* @__PURE__ */ jsx(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: clsx(
|
|
74
|
+
"flex w-full items-center",
|
|
75
|
+
column.align === "right" ? "justify-end" : column.align === "left" ? "justify-start" : "justify-center"
|
|
76
|
+
),
|
|
77
|
+
children: content
|
|
78
|
+
}
|
|
79
|
+
)
|
|
70
80
|
},
|
|
71
81
|
`${row.id}-${column.field}-${colIdx}-${rowIndex}`
|
|
72
82
|
);
|
|
@@ -91,7 +101,7 @@ var TableBody = ({
|
|
|
91
101
|
{
|
|
92
102
|
className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), "text-center"),
|
|
93
103
|
style: { width: "40px", minWidth: "40px", textAlign: "center" },
|
|
94
|
-
children: /* @__PURE__ */ jsx("div", { "data-checkbox": true, children: /* @__PURE__ */ jsx(checkbox_default, { size, checked: checkedRows.has(rowId), onChange: (e) => onCheckRow(rowId, e.target.checked) }) })
|
|
104
|
+
children: /* @__PURE__ */ jsx("div", { "data-checkbox": true, className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ jsx(checkbox_default, { size, checked: checkedRows.has(rowId), onChange: (e) => onCheckRow(rowId, e.target.checked) }) })
|
|
95
105
|
},
|
|
96
106
|
`checkbox-${rowId}-${rowIndex}`
|
|
97
107
|
);
|
|
@@ -172,17 +182,26 @@ var Table = forwardRef((originalProps, ref) => {
|
|
|
172
182
|
const checkboxWidth = rowCheckbox ? 40 : 0;
|
|
173
183
|
return columnsWidth + checkboxWidth;
|
|
174
184
|
}, [columns, rowCheckbox]);
|
|
185
|
+
const prevCheckedRef = useRef2("");
|
|
175
186
|
useEffect(() => {
|
|
176
|
-
|
|
187
|
+
const currentCheckedStr = Array.from(checkedRowIds).sort().join(",");
|
|
188
|
+
if (prevCheckedRef.current !== currentCheckedStr) {
|
|
189
|
+
prevCheckedRef.current = currentCheckedStr;
|
|
190
|
+
onCheckedRowsChange == null ? void 0 : onCheckedRowsChange(getCheckedRowData(checkedRowIds));
|
|
191
|
+
}
|
|
177
192
|
}, [checkedRowIds]);
|
|
178
193
|
useEffect(() => {
|
|
179
194
|
const currentRowIds = new Set(rows.map((row) => row.id));
|
|
180
195
|
const ids = Array.from(checkedRowIds);
|
|
181
196
|
const hasValidCheckedRows = ids.every((id) => currentRowIds.has(id));
|
|
182
197
|
if (!hasValidCheckedRows) {
|
|
183
|
-
|
|
198
|
+
const newCheckedSet = new Set(checkedRows == null ? void 0 : checkedRows.map((row) => row.id));
|
|
199
|
+
const newCheckedStr = Array.from(newCheckedSet).sort().join(",");
|
|
200
|
+
if (prevCheckedRef.current !== newCheckedStr) {
|
|
201
|
+
setCheckedRowIds(newCheckedSet);
|
|
202
|
+
}
|
|
184
203
|
}
|
|
185
|
-
}, [rows
|
|
204
|
+
}, [rows]);
|
|
186
205
|
useImperativeHandle(
|
|
187
206
|
ref,
|
|
188
207
|
() => ({
|
|
@@ -276,7 +295,7 @@ var Table = forwardRef((originalProps, ref) => {
|
|
|
276
295
|
color,
|
|
277
296
|
size: "sm",
|
|
278
297
|
currentPage: page,
|
|
279
|
-
totalPage: Math.ceil(totalData / perPage),
|
|
298
|
+
totalPage: Math.ceil(totalData / (perPage || 1)),
|
|
280
299
|
groupSize: paginationGroupSize,
|
|
281
300
|
showFirstLastButtons,
|
|
282
301
|
showPageLabel,
|
|
@@ -290,11 +309,11 @@ Table.displayName = "Table";
|
|
|
290
309
|
var table_default = Table;
|
|
291
310
|
var tableStyle = tv({
|
|
292
311
|
slots: {
|
|
293
|
-
base: ["flex", "flex-col", "relative", "select-none", "gap-
|
|
312
|
+
base: ["flex", "flex-col", "relative", "select-none", "gap-20", "h-full", "min-h-0"],
|
|
294
313
|
scroll: [],
|
|
295
314
|
table: ["w-full", "h-auto"],
|
|
296
|
-
thead: ["w-full"],
|
|
297
|
-
tbody: ["w-full"],
|
|
315
|
+
thead: ["w-full", "px-lg"],
|
|
316
|
+
tbody: ["w-full", "[&>tr:hover]:bg-common-hover"],
|
|
298
317
|
tr: ["group/tr", "outline-none", "w-full", "h-full"],
|
|
299
318
|
th: [
|
|
300
319
|
"text-body-foreground",
|
|
@@ -302,9 +321,9 @@ var tableStyle = tv({
|
|
|
302
321
|
"whitespace-nowrap",
|
|
303
322
|
"outline-none",
|
|
304
323
|
"align-middle",
|
|
305
|
-
"px-[
|
|
324
|
+
"px-[5px]",
|
|
306
325
|
"[&>div]:flex",
|
|
307
|
-
"[&>div]:gap-
|
|
326
|
+
"[&>div]:gap-10"
|
|
308
327
|
],
|
|
309
328
|
td: [
|
|
310
329
|
"relative",
|
|
@@ -314,8 +333,8 @@ var tableStyle = tv({
|
|
|
314
333
|
"outline-none",
|
|
315
334
|
"[&>*]:z-1",
|
|
316
335
|
"[&>*]:relative",
|
|
317
|
-
"px-[
|
|
318
|
-
"gap-
|
|
336
|
+
"px-[5px]",
|
|
337
|
+
"gap-10",
|
|
319
338
|
"transition duration-200",
|
|
320
339
|
"align-middle"
|
|
321
340
|
],
|
|
@@ -333,17 +352,10 @@ var tableStyle = tv({
|
|
|
333
352
|
},
|
|
334
353
|
variants: {
|
|
335
354
|
variant: {
|
|
336
|
-
solid: {
|
|
337
|
-
|
|
338
|
-
},
|
|
339
|
-
outline: {
|
|
340
|
-
tbody: ["[&>td]:border"],
|
|
341
|
-
th: ["border"],
|
|
342
|
-
td: ["border"]
|
|
343
|
-
},
|
|
355
|
+
solid: {},
|
|
356
|
+
outline: {},
|
|
344
357
|
underline: {
|
|
345
|
-
|
|
346
|
-
th: ["border-t-[2px]", "border-b"]
|
|
358
|
+
th: ["bg-body-background", "border-t-[2px]", "border-b-[1px]"]
|
|
347
359
|
}
|
|
348
360
|
},
|
|
349
361
|
size: {
|
|
@@ -382,26 +394,32 @@ var tableStyle = tv({
|
|
|
382
394
|
}
|
|
383
395
|
},
|
|
384
396
|
compoundVariants: [
|
|
397
|
+
{ variant: "solid", size: "sm", class: { tbody: ["[&>tr]:border-b-sm"] } },
|
|
398
|
+
{ variant: "solid", size: "md", class: { tbody: ["[&>tr]:border-b-md"] } },
|
|
399
|
+
{ variant: "solid", size: "lg", class: { tbody: ["[&>tr]:border-b-lg"] } },
|
|
400
|
+
{ variant: "solid", size: "xl", class: { tbody: ["[&>tr]:border-b-xl"] } },
|
|
401
|
+
{ variant: "outline", size: "sm", class: { th: ["border-sm"], td: ["border-sm"] } },
|
|
402
|
+
{ variant: "outline", size: "md", class: { th: ["border-md"], td: ["border-md"] } },
|
|
403
|
+
{ variant: "outline", size: "lg", class: { th: ["border-lg"], td: ["border-lg"] } },
|
|
404
|
+
{ variant: "outline", size: "xl", class: { th: ["border-xl"], td: ["border-xl"] } },
|
|
405
|
+
{ variant: "underline", size: "sm", class: { tbody: ["[&>tr]:border-b-sm"], th: ["border-b-sm"] } },
|
|
406
|
+
{ variant: "underline", size: "md", class: { tbody: ["[&>tr]:border-b-md"], th: ["border-b-md"] } },
|
|
407
|
+
{ variant: "underline", size: "lg", class: { tbody: ["[&>tr]:border-b-lg"], th: ["border-b-lg"] } },
|
|
408
|
+
{ variant: "underline", size: "xl", class: { tbody: ["[&>tr]:border-b-xl"], th: ["border-b-xl"] } },
|
|
385
409
|
{
|
|
386
410
|
variant: "solid",
|
|
387
411
|
color: "primary",
|
|
388
|
-
class: {
|
|
389
|
-
th: ["bg-primary-soft"]
|
|
390
|
-
}
|
|
412
|
+
class: { th: ["bg-primary-soft"] }
|
|
391
413
|
},
|
|
392
414
|
{
|
|
393
415
|
variant: "solid",
|
|
394
416
|
color: "secondary",
|
|
395
|
-
class: {
|
|
396
|
-
th: ["bg-secondary-soft"]
|
|
397
|
-
}
|
|
417
|
+
class: { th: ["bg-secondary-soft"] }
|
|
398
418
|
},
|
|
399
419
|
{
|
|
400
420
|
variant: "solid",
|
|
401
421
|
color: "neutral",
|
|
402
|
-
class: {
|
|
403
|
-
th: ["bg-neutral-soft"]
|
|
404
|
-
}
|
|
422
|
+
class: { th: ["bg-neutral-soft"] }
|
|
405
423
|
},
|
|
406
424
|
{
|
|
407
425
|
variant: "outline",
|
|
@@ -431,21 +449,21 @@ var tableStyle = tv({
|
|
|
431
449
|
variant: "underline",
|
|
432
450
|
color: "primary",
|
|
433
451
|
class: {
|
|
434
|
-
th: ["
|
|
452
|
+
th: ["border-primary-light"]
|
|
435
453
|
}
|
|
436
454
|
},
|
|
437
455
|
{
|
|
438
456
|
variant: "underline",
|
|
439
457
|
color: "secondary",
|
|
440
458
|
class: {
|
|
441
|
-
th: ["
|
|
459
|
+
th: ["border-secondary-light"]
|
|
442
460
|
}
|
|
443
461
|
},
|
|
444
462
|
{
|
|
445
463
|
variant: "underline",
|
|
446
464
|
color: "neutral",
|
|
447
465
|
class: {
|
|
448
|
-
th: ["
|
|
466
|
+
th: ["border-neutral-light"]
|
|
449
467
|
}
|
|
450
468
|
},
|
|
451
469
|
{
|
|
@@ -537,7 +555,7 @@ function TableHeaderCell({
|
|
|
537
555
|
slots,
|
|
538
556
|
classNames
|
|
539
557
|
}) {
|
|
540
|
-
const thRef =
|
|
558
|
+
const thRef = useRef3(null);
|
|
541
559
|
const [showTitle, setShowTitle] = useState3(false);
|
|
542
560
|
useLayoutEffect2(() => {
|
|
543
561
|
if (!isCheckbox && thRef.current) {
|
|
@@ -545,12 +563,17 @@ function TableHeaderCell({
|
|
|
545
563
|
setShowTitle(el.scrollWidth > el.clientWidth);
|
|
546
564
|
}
|
|
547
565
|
}, [content, isCheckbox]);
|
|
548
|
-
const
|
|
566
|
+
const isTextContent = ["string", "number"].includes(typeof content) || content === null || content === void 0;
|
|
567
|
+
const titleText = !isCheckbox && showTitle && isTextContent ? String(content) : void 0;
|
|
549
568
|
return /* @__PURE__ */ jsx3(
|
|
550
569
|
"th",
|
|
551
570
|
{
|
|
552
571
|
ref: thRef,
|
|
553
|
-
className: clsx(
|
|
572
|
+
className: clsx(
|
|
573
|
+
slots.th({ class: classNames == null ? void 0 : classNames.th }),
|
|
574
|
+
column == null ? void 0 : column.className,
|
|
575
|
+
!isCheckbox && isTextContent && "truncate"
|
|
576
|
+
),
|
|
554
577
|
style: isCheckbox ? {
|
|
555
578
|
width: "40px",
|
|
556
579
|
minWidth: "40px",
|
|
@@ -559,11 +582,19 @@ function TableHeaderCell({
|
|
|
559
582
|
flexGrow: 0,
|
|
560
583
|
boxSizing: "border-box"
|
|
561
584
|
} : column ? {
|
|
562
|
-
...getCellStyle(column)
|
|
563
|
-
textAlign: "center"
|
|
585
|
+
...getCellStyle(column)
|
|
564
586
|
} : void 0,
|
|
565
587
|
title: titleText,
|
|
566
|
-
children: content
|
|
588
|
+
children: isTextContent ? content : /* @__PURE__ */ jsx3(
|
|
589
|
+
"div",
|
|
590
|
+
{
|
|
591
|
+
className: clsx(
|
|
592
|
+
"flex w-full items-center",
|
|
593
|
+
isCheckbox ? "justify-center" : (column == null ? void 0 : column.align) === "right" ? "justify-end" : (column == null ? void 0 : column.align) === "left" ? "justify-start" : "justify-center"
|
|
594
|
+
),
|
|
595
|
+
children: content
|
|
596
|
+
}
|
|
597
|
+
)
|
|
567
598
|
}
|
|
568
599
|
);
|
|
569
600
|
}
|
|
@@ -590,7 +621,7 @@ var TableHead = ({
|
|
|
590
621
|
rowCheckbox && /* @__PURE__ */ jsx3(
|
|
591
622
|
TableHeaderCell,
|
|
592
623
|
{
|
|
593
|
-
content: /* @__PURE__ */ jsx3("div", { "data-checkbox": true, children: /* @__PURE__ */ jsx3(
|
|
624
|
+
content: /* @__PURE__ */ jsx3("div", { "data-checkbox": true, className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ jsx3(
|
|
594
625
|
checkbox_default,
|
|
595
626
|
{
|
|
596
627
|
size,
|