@deepnoid/ui 0.1.19 → 0.1.21
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 +202 -183
- package/dist/assets/images/cogwheel.d.mts +2 -0
- package/dist/assets/images/cogwheel.d.ts +2 -0
- package/dist/assets/images/cogwheel.js +4 -0
- package/dist/assets/images/cogwheel.mjs +8 -0
- package/dist/assets/images/folder.d.mts +2 -0
- package/dist/assets/images/folder.d.ts +2 -0
- package/dist/assets/images/folder.js +4 -0
- package/dist/assets/images/folder.mjs +8 -0
- package/dist/chunk-2DLKV6TT.mjs +168 -0
- package/dist/{chunk-7TXQPX4O.mjs → chunk-2Y7IBUAZ.mjs} +19 -8
- package/dist/chunk-3BKCODIL.mjs +49 -0
- package/dist/{chunk-A7OXEUCC.mjs → chunk-3IU2RPSM.mjs} +75 -9
- package/dist/{chunk-3TJAGKKY.mjs → chunk-7CFOD7G4.mjs} +11 -9
- package/dist/chunk-7KUFDVGL.mjs +71 -0
- package/dist/chunk-7USF56CT.mjs +8 -0
- package/dist/{chunk-5ANQDLRS.mjs → chunk-DUPQBPI2.mjs} +4 -4
- package/dist/{chunk-K7Z6PVXE.mjs → chunk-EWZAHXN7.mjs} +7 -7
- package/dist/{chunk-BFM3LPBK.mjs → chunk-FBAR75U4.mjs} +4 -4
- package/dist/{chunk-RPDPB4JP.mjs → chunk-HQLSHEK6.mjs} +4 -4
- package/dist/{chunk-DADMVOYI.mjs → chunk-HWL7TPUN.mjs} +1 -1
- package/dist/chunk-IZM66FHP.mjs +8 -0
- package/dist/{chunk-QIDZXCYP.mjs → chunk-JHDYQCEE.mjs} +6 -6
- package/dist/chunk-MBLZYQCN.mjs +1 -0
- package/dist/{chunk-7A5M7DRD.mjs → chunk-MQI5SZWO.mjs} +7 -7
- package/dist/{chunk-3DPVPTHL.mjs → chunk-MV7RSV4D.mjs} +3 -3
- package/dist/chunk-MW7CSRIE.mjs +348 -0
- package/dist/chunk-OV7CZNXU.mjs +135 -0
- package/dist/{chunk-AG7AWQKH.mjs → chunk-Q6BZ76DI.mjs} +4 -4
- package/dist/{chunk-63WXGSTV.mjs → chunk-QHWFHOW2.mjs} +24 -14
- package/dist/{chunk-FONJYZKH.mjs → chunk-SDHQUYFI.mjs} +7 -7
- package/dist/{chunk-UHFJ7ZFM.mjs → chunk-UTC2D6GV.mjs} +6 -6
- package/dist/chunk-XGYQ6D3S.mjs +82 -0
- package/dist/{chunk-UYPVP36M.mjs → chunk-XQGD4ZIX.mjs} +1 -1
- package/dist/cogwheel-U2B3CWEL.png +0 -0
- package/dist/components/avatar/avatar.js +75 -9
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +75 -9
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +75 -9
- package/dist/components/breadcrumb/breadcrumb.mjs +9 -9
- package/dist/components/breadcrumb/index.js +75 -9
- package/dist/components/breadcrumb/index.mjs +9 -9
- package/dist/components/button/button.js +75 -9
- package/dist/components/button/button.mjs +5 -5
- package/dist/components/button/icon-button.js +75 -9
- package/dist/components/button/icon-button.mjs +5 -5
- package/dist/components/button/index.js +75 -9
- package/dist/components/button/index.mjs +9 -9
- package/dist/components/button/text-button.mjs +3 -3
- package/dist/components/checkbox/checkbox.mjs +3 -3
- package/dist/components/checkbox/index.mjs +3 -3
- package/dist/components/chip/chip.js +75 -9
- package/dist/components/chip/chip.mjs +4 -4
- package/dist/components/chip/index.js +75 -9
- package/dist/components/chip/index.mjs +4 -4
- package/dist/components/dateTimePicker/calendar.js +75 -9
- package/dist/components/dateTimePicker/calendar.mjs +4 -4
- package/dist/components/dateTimePicker/dateTimePicker.js +75 -9
- package/dist/components/dateTimePicker/dateTimePicker.mjs +9 -9
- package/dist/components/dateTimePicker/index.js +75 -9
- package/dist/components/dateTimePicker/index.mjs +9 -9
- package/dist/components/dateTimePicker/timePicker.js +75 -9
- package/dist/components/dateTimePicker/timePicker.mjs +7 -7
- package/dist/components/icon/Icon.d.mts +6 -2
- package/dist/components/icon/Icon.d.ts +6 -2
- package/dist/components/icon/Icon.js +75 -9
- package/dist/components/icon/Icon.mjs +2 -2
- package/dist/components/icon/index.js +75 -9
- package/dist/components/icon/index.mjs +2 -2
- package/dist/components/icon/template.d.mts +2 -1
- package/dist/components/icon/template.d.ts +2 -1
- package/dist/components/icon/template.js +75 -9
- package/dist/components/icon/template.mjs +1 -1
- package/dist/components/input/index.js +89 -12
- package/dist/components/input/index.mjs +5 -5
- package/dist/components/input/input.js +89 -12
- package/dist/components/input/input.mjs +5 -5
- package/dist/components/list/index.js +75 -9
- package/dist/components/list/index.mjs +8 -8
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.js +75 -9
- package/dist/components/list/listItem.mjs +5 -5
- package/dist/components/modal/index.d.mts +0 -3
- package/dist/components/modal/index.d.ts +0 -3
- package/dist/components/modal/index.js +205 -158
- package/dist/components/modal/index.mjs +11 -9
- package/dist/components/modal/modal.d.mts +43 -105
- package/dist/components/modal/modal.d.ts +43 -105
- package/dist/components/modal/modal.js +206 -164
- package/dist/components/modal/modal.mjs +12 -12
- package/dist/components/pagination/index.js +89 -12
- package/dist/components/pagination/index.mjs +6 -6
- package/dist/components/pagination/pagination.js +89 -12
- package/dist/components/pagination/pagination.mjs +6 -6
- package/dist/components/radio/index.mjs +3 -3
- package/dist/components/radio/radio.mjs +3 -3
- package/dist/components/ripple/index.mjs +3 -3
- package/dist/components/select/index.d.mts +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.js +376 -295
- package/dist/components/select/index.mjs +5 -6
- package/dist/components/select/select.d.mts +190 -177
- package/dist/components/select/select.d.ts +190 -177
- package/dist/components/select/select.js +376 -295
- package/dist/components/select/select.mjs +5 -6
- package/dist/components/table/form-table.d.mts +52 -0
- package/dist/components/table/form-table.d.ts +52 -0
- package/dist/components/table/form-table.js +365 -0
- package/dist/components/table/form-table.mjs +9 -0
- package/dist/components/table/index.d.mts +2 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.js +162 -30
- package/dist/components/table/index.mjs +15 -11
- package/dist/components/table/table-body.d.mts +3 -2
- package/dist/components/table/table-body.d.ts +3 -2
- package/dist/components/table/table-body.js +23 -13
- package/dist/components/table/table-body.mjs +4 -4
- package/dist/components/table/table-head.d.mts +2 -2
- package/dist/components/table/table-head.d.ts +2 -2
- package/dist/components/table/table-head.js +2 -2
- package/dist/components/table/table-head.mjs +4 -4
- package/dist/components/table/table.d.mts +2 -1
- package/dist/components/table/table.d.ts +2 -1
- package/dist/components/table/table.js +119 -30
- package/dist/components/table/table.mjs +10 -10
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/toast/index.js +239 -97
- package/dist/components/toast/index.mjs +6 -5
- package/dist/components/toast/toast.d.mts +40 -81
- package/dist/components/toast/toast.d.ts +40 -81
- package/dist/components/toast/toast.js +210 -56
- package/dist/components/toast/toast.mjs +5 -4
- package/dist/components/toast/use-toast.d.mts +6 -10
- package/dist/components/toast/use-toast.d.ts +6 -10
- package/dist/components/toast/use-toast.js +239 -97
- package/dist/components/toast/use-toast.mjs +6 -5
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/components/tree/index.d.mts +2 -0
- package/dist/components/tree/index.d.ts +2 -0
- package/dist/components/tree/index.js +4371 -0
- package/dist/components/tree/index.mjs +15 -0
- package/dist/components/tree/tree.d.mts +20 -0
- package/dist/components/tree/tree.d.ts +20 -0
- package/dist/components/{select/option.js → tree/tree.js} +146 -74
- package/dist/components/tree/tree.mjs +14 -0
- package/dist/folder-RO3QTLGS.svg +9 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +681 -545
- package/dist/index.mjs +71 -62
- package/package.json +1 -1
- package/types/images.d.ts +14 -0
- package/dist/chunk-5OBP42D6.mjs +0 -117
- package/dist/chunk-HDNQOLUJ.mjs +0 -83
- package/dist/chunk-MJT6ZW4C.mjs +0 -255
- package/dist/chunk-P6NVCCBZ.mjs +0 -76
- package/dist/chunk-RXIFDECK.mjs +0 -213
- package/dist/chunk-S3QS5B7F.mjs +0 -61
- package/dist/components/select/option.d.mts +0 -17
- package/dist/components/select/option.d.ts +0 -17
- package/dist/components/select/option.mjs +0 -12
- package/dist/components/select/useSelect.d.mts +0 -31
- package/dist/components/select/useSelect.d.ts +0 -31
- package/dist/components/select/useSelect.js +0 -84
- package/dist/components/select/useSelect.mjs +0 -8
- package/dist/{chunk-D6QI3DJG.mjs → chunk-7H5XPHY6.mjs} +4 -4
- package/dist/{chunk-2UUH2MBF.mjs → chunk-DX3KXNP6.mjs} +0 -0
- package/dist/{chunk-Z2537DF6.mjs → chunk-IL5ENWCR.mjs} +3 -3
- package/dist/{chunk-WFMFC7R6.mjs → chunk-KCOHU7X7.mjs} +4 -4
- package/dist/{chunk-LL6F3WDX.mjs → chunk-P5QCU457.mjs} +3 -3
- package/dist/{chunk-2YMAKIZ6.mjs → chunk-SSMMWMQC.mjs} +3 -3
- package/dist/{chunk-HIVPDIEP.mjs → chunk-UFVQPPPW.mjs} +3 -3
- package/dist/{chunk-QIRL6HY6.mjs → chunk-YIIFWADW.mjs} +4 -4
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
calendar_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DUPQBPI2.mjs";
|
|
5
5
|
import {
|
|
6
6
|
timePicker_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Q6BZ76DI.mjs";
|
|
8
8
|
import {
|
|
9
9
|
useDatePicker
|
|
10
10
|
} from "./chunk-FWJ2ZKH6.mjs";
|
|
11
11
|
import {
|
|
12
12
|
Icon_default
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
tv
|
|
16
|
-
} from "./chunk-4ZJFD3L3.mjs";
|
|
13
|
+
} from "./chunk-HWL7TPUN.mjs";
|
|
17
14
|
import {
|
|
18
15
|
mapPropsVariants
|
|
19
16
|
} from "./chunk-E3G5QXSH.mjs";
|
|
17
|
+
import {
|
|
18
|
+
tv
|
|
19
|
+
} from "./chunk-4ZJFD3L3.mjs";
|
|
20
20
|
|
|
21
21
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
22
22
|
import React, { forwardRef, useCallback, useMemo } from "react";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useRipple
|
|
4
|
-
} from "./chunk-6PNKRBUT.mjs";
|
|
5
2
|
import {
|
|
6
3
|
ripple_default
|
|
7
4
|
} from "./chunk-LXHUO6VM.mjs";
|
|
8
5
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
6
|
+
useRipple
|
|
7
|
+
} from "./chunk-6PNKRBUT.mjs";
|
|
11
8
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
9
|
+
Icon_default
|
|
10
|
+
} from "./chunk-HWL7TPUN.mjs";
|
|
14
11
|
import {
|
|
15
12
|
mapPropsVariants
|
|
16
13
|
} from "./chunk-E3G5QXSH.mjs";
|
|
14
|
+
import {
|
|
15
|
+
tv
|
|
16
|
+
} from "./chunk-4ZJFD3L3.mjs";
|
|
17
17
|
|
|
18
18
|
// src/components/button/button.tsx
|
|
19
19
|
import React, { forwardRef, useMemo, useCallback } from "react";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
checkbox_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7H5XPHY6.mjs";
|
|
5
5
|
import {
|
|
6
6
|
clsx
|
|
7
7
|
} from "./chunk-27Y6K5NK.mjs";
|
|
8
8
|
|
|
9
9
|
// src/components/table/table-head.tsx
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
var TableHead = ({ columns, slots, size,
|
|
11
|
+
var TableHead = ({ columns, slots, size, rowCheckbox, isCheckedAll, classNames, onCheckAll }) => {
|
|
12
12
|
const handleClickCheckAll = (e) => {
|
|
13
13
|
e.preventDefault();
|
|
14
14
|
onCheckAll(!isCheckedAll);
|
|
@@ -27,7 +27,7 @@ var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, className
|
|
|
27
27
|
},
|
|
28
28
|
`${column.field}${index}thead`
|
|
29
29
|
));
|
|
30
|
-
const renderSelectAllCheckbox = () =>
|
|
30
|
+
const renderSelectAllCheckbox = () => rowCheckbox && /* @__PURE__ */ jsx("th", { className: slots.th({ class: classNames == null ? void 0 : classNames.th }), onClick: handleClickCheckAll, children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(checkbox_default, { size, checked: isCheckedAll }) }) });
|
|
31
31
|
return /* @__PURE__ */ jsx("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ jsxs("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
32
32
|
renderColumnHeaders(),
|
|
33
33
|
renderSelectAllCheckbox()
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Icon_default
|
|
4
|
+
} from "./chunk-HWL7TPUN.mjs";
|
|
5
|
+
import {
|
|
6
|
+
mapPropsVariants
|
|
7
|
+
} from "./chunk-E3G5QXSH.mjs";
|
|
8
|
+
import {
|
|
9
|
+
clsx
|
|
10
|
+
} from "./chunk-27Y6K5NK.mjs";
|
|
11
|
+
import {
|
|
12
|
+
tv
|
|
13
|
+
} from "./chunk-4ZJFD3L3.mjs";
|
|
14
|
+
|
|
15
|
+
// src/components/select/select.tsx
|
|
16
|
+
import { forwardRef, useMemo, useState, useRef, useEffect } from "react";
|
|
17
|
+
import { createPortal } from "react-dom";
|
|
18
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
var Select = forwardRef((originalProps, ref) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
22
|
+
const {
|
|
23
|
+
label,
|
|
24
|
+
options,
|
|
25
|
+
helperText,
|
|
26
|
+
errorText,
|
|
27
|
+
classNames,
|
|
28
|
+
defaultSelectedOptions = [],
|
|
29
|
+
onChange,
|
|
30
|
+
multiple,
|
|
31
|
+
...inputProps
|
|
32
|
+
} = props;
|
|
33
|
+
const slots = useMemo(() => select({ ...variantProps }), [variantProps]);
|
|
34
|
+
const [selectedOptions, setSelectedOptions] = useState(defaultSelectedOptions);
|
|
35
|
+
const [targetRect, setTargetRect] = useState(null);
|
|
36
|
+
const [optionWrapperHeight, setOptionWrapperHeight] = useState(0);
|
|
37
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
38
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
39
|
+
const selectWrapperRef = useRef(null);
|
|
40
|
+
const optionWrapperRef = useRef(null);
|
|
41
|
+
const handleToggleSelect = () => {
|
|
42
|
+
if (isOpen) {
|
|
43
|
+
setIsOpen(false);
|
|
44
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
45
|
+
} else {
|
|
46
|
+
if (selectWrapperRef.current) {
|
|
47
|
+
const rect = selectWrapperRef.current.getBoundingClientRect();
|
|
48
|
+
setTargetRect(rect);
|
|
49
|
+
setIsVisible(true);
|
|
50
|
+
requestAnimationFrame(() => setIsOpen(true));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const calculatePositionWithScroll = (rect, height) => {
|
|
55
|
+
const scrollTop = window.scrollY;
|
|
56
|
+
const scrollLeft = window.scrollX;
|
|
57
|
+
const spaceBelow = window.innerHeight - (rect.y + rect.height + 4);
|
|
58
|
+
const spaceAbove = rect.y - 4;
|
|
59
|
+
const top = spaceBelow < height && spaceAbove > height ? rect.y - height - 4 : rect.y + rect.height + 4;
|
|
60
|
+
return {
|
|
61
|
+
top: top + scrollTop,
|
|
62
|
+
left: rect.x + scrollLeft
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const handleChangeOption = (option) => {
|
|
66
|
+
let nextOptions;
|
|
67
|
+
if (multiple) {
|
|
68
|
+
const exists = selectedOptions.some((o) => o.key === option.key);
|
|
69
|
+
nextOptions = exists ? selectedOptions.filter((o) => o.key !== option.key) : [...selectedOptions, option];
|
|
70
|
+
} else {
|
|
71
|
+
nextOptions = [option];
|
|
72
|
+
setIsOpen(false);
|
|
73
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
74
|
+
}
|
|
75
|
+
setSelectedOptions(nextOptions);
|
|
76
|
+
onChange == null ? void 0 : onChange(nextOptions);
|
|
77
|
+
};
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
const handleClickOutside = (e) => {
|
|
80
|
+
var _a2;
|
|
81
|
+
if (optionWrapperRef.current && !optionWrapperRef.current.contains(e.target) && !((_a2 = selectWrapperRef.current) == null ? void 0 : _a2.contains(e.target))) {
|
|
82
|
+
setIsOpen(false);
|
|
83
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
window.addEventListener("mousedown", handleClickOutside);
|
|
87
|
+
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
88
|
+
}, []);
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (optionWrapperRef.current) {
|
|
91
|
+
setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
|
|
92
|
+
}
|
|
93
|
+
}, [targetRect]);
|
|
94
|
+
const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
|
|
95
|
+
const displayValue = multiple ? selectedOptions.map((opt) => opt.value).join(", ") : ((_a = selectedOptions[0]) == null ? void 0 : _a.value) || "";
|
|
96
|
+
const Option = ({
|
|
97
|
+
option,
|
|
98
|
+
isSelected,
|
|
99
|
+
onClick
|
|
100
|
+
}) => {
|
|
101
|
+
const slot = select({ ...variantProps, isSelected });
|
|
102
|
+
return /* @__PURE__ */ jsxs("div", { title: option.value, onClick, className: clsx(slot.option({ class: classNames == null ? void 0 : classNames.option })), children: [
|
|
103
|
+
option.value,
|
|
104
|
+
isSelected && /* @__PURE__ */ jsx(Icon_default, { name: "check", size: originalProps.size })
|
|
105
|
+
] });
|
|
106
|
+
};
|
|
107
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
108
|
+
/* @__PURE__ */ jsxs(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
className: clsx(
|
|
112
|
+
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
113
|
+
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
114
|
+
),
|
|
115
|
+
children: [
|
|
116
|
+
label && /* @__PURE__ */ jsx("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
117
|
+
/* @__PURE__ */ jsxs("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
118
|
+
/* @__PURE__ */ jsxs(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
"data-expanded": isOpen,
|
|
122
|
+
className: clsx(
|
|
123
|
+
slots.selectWrapper({ class: classNames == null ? void 0 : classNames.selectWrapper }),
|
|
124
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
125
|
+
),
|
|
126
|
+
ref: selectWrapperRef,
|
|
127
|
+
onClick: handleToggleSelect,
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
"input",
|
|
131
|
+
{
|
|
132
|
+
...inputProps,
|
|
133
|
+
ref,
|
|
134
|
+
className: clsx(
|
|
135
|
+
slots.select({ class: classNames == null ? void 0 : classNames.select }),
|
|
136
|
+
inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
|
|
137
|
+
),
|
|
138
|
+
value: displayValue,
|
|
139
|
+
readOnly: true,
|
|
140
|
+
size: 0
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
Icon_default,
|
|
145
|
+
{
|
|
146
|
+
name: "brace-up",
|
|
147
|
+
size: originalProps.size,
|
|
148
|
+
className: `transition-transform duration-200 ${isOpen ? "rotate-0" : "rotate-180"}`
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
helperText && !errorText && /* @__PURE__ */ jsx("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
|
|
155
|
+
errorText && /* @__PURE__ */ jsx("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
|
|
156
|
+
] })
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
isVisible && createPortal(
|
|
161
|
+
/* @__PURE__ */ jsx(
|
|
162
|
+
"div",
|
|
163
|
+
{
|
|
164
|
+
ref: optionWrapperRef,
|
|
165
|
+
className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
|
|
166
|
+
style: {
|
|
167
|
+
position: "absolute",
|
|
168
|
+
top: position == null ? void 0 : position.top,
|
|
169
|
+
left: position == null ? void 0 : position.left,
|
|
170
|
+
width: targetRect == null ? void 0 : targetRect.width,
|
|
171
|
+
zIndex: 1e3,
|
|
172
|
+
opacity: isOpen ? 1 : 0,
|
|
173
|
+
transform: isOpen ? "translateY(0)" : "translateY(-0.25rem)",
|
|
174
|
+
transition: "opacity 150ms ease-out, transform 150ms ease-out"
|
|
175
|
+
},
|
|
176
|
+
children: options.map((option) => {
|
|
177
|
+
const isSelected = selectedOptions.some((o) => o.key === option.key);
|
|
178
|
+
return /* @__PURE__ */ jsx(
|
|
179
|
+
Option,
|
|
180
|
+
{
|
|
181
|
+
option,
|
|
182
|
+
isSelected,
|
|
183
|
+
onClick: () => handleChangeOption(option)
|
|
184
|
+
},
|
|
185
|
+
option.key
|
|
186
|
+
);
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
document.body
|
|
191
|
+
)
|
|
192
|
+
] });
|
|
193
|
+
});
|
|
194
|
+
Select.displayName = "Select";
|
|
195
|
+
var select_default = Select;
|
|
196
|
+
var select = tv({
|
|
197
|
+
slots: {
|
|
198
|
+
base: ["group/select", "flex"],
|
|
199
|
+
vertical: ["flex-col"],
|
|
200
|
+
horizon: ["flex-row", "gap-0"],
|
|
201
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
202
|
+
wrapper: ["flex", "flex-col"],
|
|
203
|
+
selectWrapper: [
|
|
204
|
+
"flex",
|
|
205
|
+
"items-center",
|
|
206
|
+
"justify-between",
|
|
207
|
+
"border",
|
|
208
|
+
"cursor-pointer",
|
|
209
|
+
"text-neutral-main",
|
|
210
|
+
"hover:bg-trans-soft",
|
|
211
|
+
"group-has-[p.error]/select:border-danger-main",
|
|
212
|
+
"group-has-[p.error]/select:bg-danger-soft",
|
|
213
|
+
"group-has-[p.error]/select:text-danger-main",
|
|
214
|
+
"group-has-[p.error]/select:hover:bg-danger-soft"
|
|
215
|
+
],
|
|
216
|
+
select: [
|
|
217
|
+
"bg-transparent",
|
|
218
|
+
"w-full",
|
|
219
|
+
"outline-none",
|
|
220
|
+
"placeholder:text-neutral-main",
|
|
221
|
+
"text-neutral-dark",
|
|
222
|
+
"group-has-[p.error]/select:text-danger-main",
|
|
223
|
+
"group-has-[p.error]/select:placeholder:text-danger-main"
|
|
224
|
+
],
|
|
225
|
+
optionsWrapper: ["border", "rounded", "bg-white", "shadow", "overflow-auto"],
|
|
226
|
+
option: ["flex", "justify-between", "items-center", "cursor-pointer"],
|
|
227
|
+
helperText: ["text-neutral-main"],
|
|
228
|
+
errorText: ["text-danger-main"],
|
|
229
|
+
readonly: ["pointer-events-none", "!bg-trans-soft"]
|
|
230
|
+
},
|
|
231
|
+
variants: {
|
|
232
|
+
color: {
|
|
233
|
+
primary: {
|
|
234
|
+
selectWrapper: ["hover:text-primary-main"],
|
|
235
|
+
option: ["hover:bg-primary-soft", "hover:text-primary-main"]
|
|
236
|
+
},
|
|
237
|
+
secondary: {
|
|
238
|
+
selectWrapper: ["hover:text-secondary-main"],
|
|
239
|
+
select: ["text-secondary-main"],
|
|
240
|
+
option: ["hover:bg-secondary-soft", "hover:text-secondary-main"]
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
size: {
|
|
244
|
+
sm: {
|
|
245
|
+
base: ["text-sm", "gap-[4px]"],
|
|
246
|
+
label: ["text-sm"],
|
|
247
|
+
wrapper: ["gap-[4px]"],
|
|
248
|
+
selectWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]"],
|
|
249
|
+
select: ["text-sm"],
|
|
250
|
+
option: ["px-[4px]", "py-[3px]", "text-sm"],
|
|
251
|
+
helperText: ["text-sm"],
|
|
252
|
+
errorText: ["text-sm"]
|
|
253
|
+
},
|
|
254
|
+
md: {
|
|
255
|
+
base: ["text-md", "gap-[6px]", "rounded-md"],
|
|
256
|
+
label: ["text-md"],
|
|
257
|
+
wrapper: ["gap-[6px]"],
|
|
258
|
+
selectWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]"],
|
|
259
|
+
select: ["text-md"],
|
|
260
|
+
option: ["px-[6px]", "py-[5.5px]", "text-md"],
|
|
261
|
+
helperText: ["text-sm"],
|
|
262
|
+
errorText: ["text-sm"]
|
|
263
|
+
},
|
|
264
|
+
lg: {
|
|
265
|
+
base: ["text-lg", "gap-[8px]"],
|
|
266
|
+
label: ["text-lg"],
|
|
267
|
+
wrapper: ["gap-[8px]"],
|
|
268
|
+
selectWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]"],
|
|
269
|
+
select: ["text-lg"],
|
|
270
|
+
option: ["px-[8px]", "py-[8px]", "text-lg"],
|
|
271
|
+
helperText: ["text-md"],
|
|
272
|
+
errorText: ["text-md"]
|
|
273
|
+
},
|
|
274
|
+
xl: {
|
|
275
|
+
base: ["text-xl", "gap-[10px]"],
|
|
276
|
+
label: ["text-xl"],
|
|
277
|
+
wrapper: ["gap-[10px]"],
|
|
278
|
+
selectWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]"],
|
|
279
|
+
select: ["text-xl"],
|
|
280
|
+
option: ["px-[10px]", "py-[11.5px]"],
|
|
281
|
+
helperText: ["text-md"],
|
|
282
|
+
errorText: ["text-md"]
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
direction: {
|
|
286
|
+
vertical: "",
|
|
287
|
+
horizon: ""
|
|
288
|
+
},
|
|
289
|
+
full: {
|
|
290
|
+
true: {
|
|
291
|
+
base: ["w-full"],
|
|
292
|
+
wrapper: ["w-full"],
|
|
293
|
+
selectWrapper: ["w-full"]
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
disabled: {
|
|
297
|
+
true: {
|
|
298
|
+
base: ["pointer-events-none"],
|
|
299
|
+
selectWrapper: [
|
|
300
|
+
"bg-neutral-soft",
|
|
301
|
+
"border-neutral-light",
|
|
302
|
+
"group-has-[p.error]/select:text-danger-light",
|
|
303
|
+
"group-has-[p.error]/select:bg-danger-soft",
|
|
304
|
+
"group-has-[p.error]/select:border-danger-light"
|
|
305
|
+
],
|
|
306
|
+
select: [
|
|
307
|
+
"text-neutral-light",
|
|
308
|
+
"placeholder:text-neutral-light",
|
|
309
|
+
"group-has-[p.error]/select:text-danger-light",
|
|
310
|
+
"group-has-[p.error]/select:placeholder:text-danger-light"
|
|
311
|
+
],
|
|
312
|
+
helperText: ["!text-neutral-light"],
|
|
313
|
+
errorText: ["!text-danger-light"]
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
isSelected: {
|
|
317
|
+
true: "",
|
|
318
|
+
false: ""
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
compoundVariants: [
|
|
322
|
+
{
|
|
323
|
+
color: "primary",
|
|
324
|
+
isSelected: true,
|
|
325
|
+
class: {
|
|
326
|
+
option: "bg-primary-soft text-primary-main"
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
color: "secondary",
|
|
331
|
+
isSelected: true,
|
|
332
|
+
class: {
|
|
333
|
+
option: "bg-secondary-soft text-secondary-main"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
],
|
|
337
|
+
defaultVariants: {
|
|
338
|
+
color: "primary",
|
|
339
|
+
size: "md",
|
|
340
|
+
direction: "vertical",
|
|
341
|
+
disabled: false,
|
|
342
|
+
readonly: false
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
export {
|
|
347
|
+
select_default
|
|
348
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
button_default
|
|
4
|
+
} from "./chunk-MQI5SZWO.mjs";
|
|
5
|
+
import {
|
|
6
|
+
Icon_default
|
|
7
|
+
} from "./chunk-HWL7TPUN.mjs";
|
|
8
|
+
import {
|
|
9
|
+
mapPropsVariants
|
|
10
|
+
} from "./chunk-E3G5QXSH.mjs";
|
|
11
|
+
import {
|
|
12
|
+
backdrop_default
|
|
13
|
+
} from "./chunk-P5QCU457.mjs";
|
|
14
|
+
import {
|
|
15
|
+
tv
|
|
16
|
+
} from "./chunk-4ZJFD3L3.mjs";
|
|
17
|
+
|
|
18
|
+
// src/components/modal/modal.tsx
|
|
19
|
+
import { forwardRef, useMemo, useEffect } from "react";
|
|
20
|
+
import { createPortal } from "react-dom";
|
|
21
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
var Modal = forwardRef((props, ref) => {
|
|
23
|
+
const [localProps, variantProps] = mapPropsVariants(props, modal.variantKeys);
|
|
24
|
+
const {
|
|
25
|
+
classNames,
|
|
26
|
+
isOpen,
|
|
27
|
+
title,
|
|
28
|
+
content,
|
|
29
|
+
confirmButtonText,
|
|
30
|
+
cancelButtonText,
|
|
31
|
+
showCloseButton = true,
|
|
32
|
+
isKeyboardDismissDisabled = false,
|
|
33
|
+
onConfirm,
|
|
34
|
+
onCancel
|
|
35
|
+
} = localProps;
|
|
36
|
+
const slots = useMemo(() => modal(variantProps), [variantProps]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
document.body.classList.toggle("overflow-hidden", !!isOpen);
|
|
39
|
+
if (!isOpen || isKeyboardDismissDisabled) return;
|
|
40
|
+
const handleKeyDown = (e) => {
|
|
41
|
+
if (e.key === "Escape") onCancel == null ? void 0 : onCancel();
|
|
42
|
+
};
|
|
43
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
44
|
+
return () => {
|
|
45
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
46
|
+
document.body.classList.remove("overflow-hidden");
|
|
47
|
+
};
|
|
48
|
+
}, [isOpen, isKeyboardDismissDisabled, onCancel]);
|
|
49
|
+
if (!isOpen) return null;
|
|
50
|
+
return createPortal(
|
|
51
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
|
+
/* @__PURE__ */ jsx(backdrop_default, { open: true }),
|
|
53
|
+
/* @__PURE__ */ jsx("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: /* @__PURE__ */ jsxs("div", { className: slots.modalWrapper({ class: classNames == null ? void 0 : classNames.modalWrapper }), children: [
|
|
54
|
+
showCloseButton && /* @__PURE__ */ jsx(
|
|
55
|
+
Icon_default,
|
|
56
|
+
{
|
|
57
|
+
size: "xl",
|
|
58
|
+
name: "close",
|
|
59
|
+
className: slots.closeIcon({ class: classNames == null ? void 0 : classNames.closeIcon }),
|
|
60
|
+
onClick: onCancel
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ jsxs("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
64
|
+
title && /* @__PURE__ */ jsx("div", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
65
|
+
typeof content === "string" ? /* @__PURE__ */ jsx("div", { className: slots.content({ class: classNames == null ? void 0 : classNames.content }), children: content }) : content,
|
|
66
|
+
(cancelButtonText || confirmButtonText) && /* @__PURE__ */ jsxs("div", { className: slots.footer({ class: classNames == null ? void 0 : classNames.footer }), children: [
|
|
67
|
+
cancelButtonText && /* @__PURE__ */ jsx(button_default, { variant: "soft", color: "neutral", fullWidth: true, onClick: onCancel, children: cancelButtonText }),
|
|
68
|
+
confirmButtonText && /* @__PURE__ */ jsx(button_default, { color: props.color, fullWidth: true, onClick: onConfirm, children: confirmButtonText })
|
|
69
|
+
] })
|
|
70
|
+
] })
|
|
71
|
+
] }) })
|
|
72
|
+
] }),
|
|
73
|
+
document.body
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
Modal.displayName = "Modal";
|
|
77
|
+
var modal_default = Modal;
|
|
78
|
+
var modal = tv({
|
|
79
|
+
slots: {
|
|
80
|
+
base: [
|
|
81
|
+
"group/modal",
|
|
82
|
+
"absolute",
|
|
83
|
+
"top-1/2",
|
|
84
|
+
"-translate-y-1/2",
|
|
85
|
+
"left-1/2",
|
|
86
|
+
"-translate-x-1/2",
|
|
87
|
+
"z-[50]",
|
|
88
|
+
"bg-body-background"
|
|
89
|
+
],
|
|
90
|
+
modalWrapper: [
|
|
91
|
+
"min-w-[450px]",
|
|
92
|
+
"flex",
|
|
93
|
+
"flex-col",
|
|
94
|
+
"justify-center",
|
|
95
|
+
"p-[30px]",
|
|
96
|
+
"bg-background",
|
|
97
|
+
"shadow-drop",
|
|
98
|
+
"shadow-foreground/20",
|
|
99
|
+
"rounded-xlg",
|
|
100
|
+
"overflow-hidden",
|
|
101
|
+
"group-data-[icon-visibility=true]/modal:mt-[0]",
|
|
102
|
+
"group-data-[icon-visibility=true]/modal:pt-[60px]"
|
|
103
|
+
],
|
|
104
|
+
wrapper: ["flex", "flex-col", "gap-[30px]"],
|
|
105
|
+
title: ["text-xl", "font-extrabold", "text-foreground"],
|
|
106
|
+
content: ["text-md", "font-bold", "text-center", "break-words", "bg-neutral-soft", "rounded-[5px]", "p-[10px]"],
|
|
107
|
+
footer: ["flex", "gap-[10px]"],
|
|
108
|
+
closeIcon: [
|
|
109
|
+
"absolute",
|
|
110
|
+
"top-[30px]",
|
|
111
|
+
"right-[30px]",
|
|
112
|
+
"cursor-pointer",
|
|
113
|
+
"z-60",
|
|
114
|
+
"group-data-[icon-visibility=true]/modal:top-[80px]"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
variants: {
|
|
118
|
+
color: {
|
|
119
|
+
primary: {},
|
|
120
|
+
secondary: {},
|
|
121
|
+
neutral: {},
|
|
122
|
+
success: {},
|
|
123
|
+
info: {},
|
|
124
|
+
warning: {},
|
|
125
|
+
danger: {}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
defaultVariants: {
|
|
129
|
+
color: "primary"
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
export {
|
|
134
|
+
modal_default
|
|
135
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
list_default
|
|
4
|
-
} from "./chunk-HIVPDIEP.mjs";
|
|
5
2
|
import {
|
|
6
3
|
listItem_default
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SDHQUYFI.mjs";
|
|
5
|
+
import {
|
|
6
|
+
list_default
|
|
7
|
+
} from "./chunk-UFVQPPPW.mjs";
|
|
8
8
|
|
|
9
9
|
// src/components/dateTimePicker/timePicker.tsx
|
|
10
10
|
import { useState, useRef, useEffect } from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
checkbox_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7H5XPHY6.mjs";
|
|
5
5
|
import {
|
|
6
6
|
clsx
|
|
7
7
|
} from "./chunk-27Y6K5NK.mjs";
|
|
@@ -15,9 +15,10 @@ var TableBody = ({
|
|
|
15
15
|
columns,
|
|
16
16
|
rows,
|
|
17
17
|
size,
|
|
18
|
-
|
|
18
|
+
rowCheckbox,
|
|
19
19
|
checkedRows,
|
|
20
20
|
onCheckRow,
|
|
21
|
+
onRowClick,
|
|
21
22
|
emptyContent,
|
|
22
23
|
isLoading,
|
|
23
24
|
classNames,
|
|
@@ -58,21 +59,30 @@ var TableBody = ({
|
|
|
58
59
|
[classNames == null ? void 0 : classNames.td, generateColumnStyles, slots]
|
|
59
60
|
);
|
|
60
61
|
const hasRows = rows.length > 0;
|
|
61
|
-
const colSpan = (columns.length || 1) + (
|
|
62
|
+
const colSpan = (columns.length || 1) + (rowCheckbox ? 1 : 0);
|
|
62
63
|
return /* @__PURE__ */ jsxs("tbody", { className: clsx(slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }), className), children: [
|
|
63
64
|
!isLoading && hasRows && rows.map((row, rowIndex) => {
|
|
64
65
|
const isRowChecked = checkedRows.has(rowIndex);
|
|
65
|
-
return /* @__PURE__ */ jsxs(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
return /* @__PURE__ */ jsxs(
|
|
67
|
+
"tr",
|
|
68
|
+
{
|
|
69
|
+
className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }),
|
|
70
|
+
"aria-checked": isRowChecked,
|
|
71
|
+
onClick: () => onRowClick ? onRowClick(row) : void 0,
|
|
72
|
+
children: [
|
|
73
|
+
columns.map((column) => /* @__PURE__ */ createElement("td", { ...getCellProps(column, row), key: column.field })),
|
|
74
|
+
rowCheckbox && /* @__PURE__ */ jsx("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
75
|
+
checkbox_default,
|
|
76
|
+
{
|
|
77
|
+
size,
|
|
78
|
+
checked: isRowChecked,
|
|
79
|
+
onChange: (e) => onCheckRow(rowIndex, e.target.checked)
|
|
80
|
+
}
|
|
81
|
+
) }) })
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
rowIndex
|
|
85
|
+
);
|
|
76
86
|
}),
|
|
77
87
|
!isLoading && !hasRows && emptyContent && /* @__PURE__ */ jsx("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "border-none"), children: /* @__PURE__ */ jsx("td", { colSpan, className: slots.empty({ class: classNames == null ? void 0 : classNames.empty }), children: emptyContent }) })
|
|
78
88
|
] });
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
avatar_default
|
|
4
|
-
} from "./chunk-UYPVP36M.mjs";
|
|
5
2
|
import {
|
|
6
3
|
Icon_default
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
tv
|
|
10
|
-
} from "./chunk-4ZJFD3L3.mjs";
|
|
4
|
+
} from "./chunk-HWL7TPUN.mjs";
|
|
11
5
|
import {
|
|
12
6
|
mapPropsVariants
|
|
13
7
|
} from "./chunk-E3G5QXSH.mjs";
|
|
8
|
+
import {
|
|
9
|
+
avatar_default
|
|
10
|
+
} from "./chunk-XQGD4ZIX.mjs";
|
|
11
|
+
import {
|
|
12
|
+
tv
|
|
13
|
+
} from "./chunk-4ZJFD3L3.mjs";
|
|
14
14
|
|
|
15
15
|
// src/components/list/listItem.tsx
|
|
16
16
|
import { forwardRef, useMemo } from "react";
|