@deepnoid/ui 0.0.88 → 0.0.90
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/dist/{chunk-4VIEZ5FT.mjs → chunk-2BCJZILI.mjs} +10 -9
- package/dist/chunk-2ZFHB4JM.mjs +76 -0
- package/dist/{chunk-4DLTBZUQ.mjs → chunk-3DRIHQOM.mjs} +7 -5
- package/dist/{chunk-IXFP2WQ4.mjs → chunk-6YE26GOI.mjs} +10 -8
- package/dist/chunk-75HLCORR.mjs +1 -0
- package/dist/{chunk-K6HPMTN4.mjs → chunk-7HHFRKJU.mjs} +1 -1
- package/dist/{chunk-H2HUJ4N2.mjs → chunk-A3RWT3JJ.mjs} +9 -4
- package/dist/{chunk-BE2OG6M4.mjs → chunk-ANYPMQH4.mjs} +28 -21
- package/dist/{chunk-5HSZ5AYM.mjs → chunk-B4KZBOGT.mjs} +16 -16
- package/dist/{chunk-KHWFCTPX.mjs → chunk-DWROPKZW.mjs} +6 -6
- package/dist/{chunk-FPCP4OOL.mjs → chunk-EDEV4IK4.mjs} +3 -3
- package/dist/{chunk-IOV7MEPG.mjs → chunk-IOCRFIQF.mjs} +30 -0
- package/dist/{chunk-SFNR4F3J.mjs → chunk-L6BQA6GI.mjs} +2 -2
- package/dist/{chunk-YGTJU3GD.mjs → chunk-L7P6OBUX.mjs} +10 -17
- package/dist/{chunk-PRUAIZTU.mjs → chunk-LCI6RPWE.mjs} +1 -1
- package/dist/{chunk-QVGXHUYW.mjs → chunk-N2JULHST.mjs} +9 -9
- package/dist/chunk-N6IEGD4K.mjs +119 -0
- package/dist/chunk-OJ2OEI5B.mjs +202 -0
- package/dist/chunk-P732YGHO.mjs +18 -0
- package/dist/{chunk-QRHT7MSO.mjs → chunk-PXUBPWKU.mjs} +1 -1
- package/dist/{chunk-PCIONGEJ.mjs → chunk-QWFOYO3D.mjs} +37 -19
- package/dist/{chunk-LY6LJRUX.mjs → chunk-RZZWHI6O.mjs} +1 -1
- package/dist/chunk-S2VUKVCH.mjs +319 -0
- package/dist/{chunk-IZOMH2SL.mjs → chunk-S3O52LLG.mjs} +14 -14
- package/dist/chunk-UR64ZUAU.mjs +671 -0
- package/dist/{chunk-PUFNT5LS.mjs → chunk-VG4644BG.mjs} +1 -1
- package/dist/chunk-WX32MAKV.mjs +219 -0
- package/dist/components/accordion/accordion.d.mts +3 -3
- package/dist/components/accordion/accordion.d.ts +3 -3
- package/dist/components/accordion/accordion.test.mjs +3 -3
- package/dist/components/accordion/accordionItem.d.mts +3 -3
- package/dist/components/accordion/accordionItem.d.ts +3 -3
- package/dist/components/accordion/accordionItem.js +31 -1
- package/dist/components/accordion/accordionItem.mjs +3 -3
- package/dist/components/accordion/index.js +31 -1
- package/dist/components/accordion/index.mjs +3 -3
- package/dist/components/button/button-group.d.mts +2 -2
- package/dist/components/button/button-group.d.ts +2 -2
- package/dist/components/button/button-group.test.js +4103 -167
- package/dist/components/button/button-group.test.mjs +7 -3
- package/dist/components/button/button.d.mts +360 -12
- package/dist/components/button/button.d.ts +360 -12
- package/dist/components/button/button.js +4054 -110
- package/dist/components/button/button.mjs +5 -1
- package/dist/components/button/button.test.js +4059 -125
- package/dist/components/button/button.test.mjs +7 -3
- package/dist/components/button/index.d.mts +3 -0
- package/dist/components/button/index.d.ts +3 -0
- package/dist/components/button/index.js +4046 -112
- package/dist/components/button/index.mjs +5 -1
- package/dist/components/card/card.d.mts +3 -3
- package/dist/components/card/card.d.ts +3 -3
- package/dist/components/checkbox/checkbox.d.mts +71 -71
- package/dist/components/checkbox/checkbox.d.ts +71 -71
- package/dist/components/checkbox/checkbox.js +28 -21
- package/dist/components/checkbox/checkbox.mjs +1 -1
- package/dist/components/checkbox/checkbox.test.js +28 -21
- package/dist/components/checkbox/checkbox.test.mjs +4 -4
- package/dist/components/checkbox/index.js +28 -21
- package/dist/components/checkbox/index.mjs +1 -1
- package/dist/components/dateTimePicker/calendar.d.mts +118 -0
- package/dist/components/dateTimePicker/calendar.d.ts +118 -0
- package/dist/components/dateTimePicker/calendar.js +3854 -0
- package/dist/components/dateTimePicker/calendar.mjs +16 -0
- package/dist/components/dateTimePicker/dateTimePicker.d.mts +443 -0
- package/dist/components/dateTimePicker/dateTimePicker.d.ts +443 -0
- package/dist/components/dateTimePicker/dateTimePicker.js +4486 -0
- package/dist/components/dateTimePicker/dateTimePicker.mjs +22 -0
- package/dist/components/dateTimePicker/index.d.mts +5 -0
- package/dist/components/dateTimePicker/index.d.ts +5 -0
- package/dist/components/dateTimePicker/index.js +4487 -0
- package/dist/components/dateTimePicker/index.mjs +21 -0
- package/dist/components/dateTimePicker/timePicker.d.mts +10 -0
- package/dist/components/dateTimePicker/timePicker.d.ts +10 -0
- package/dist/components/dateTimePicker/timePicker.js +342 -0
- package/dist/components/dateTimePicker/timePicker.mjs +13 -0
- package/dist/components/dateTimePicker/useDateTimePicker.d.mts +31 -0
- package/dist/components/dateTimePicker/useDateTimePicker.d.ts +31 -0
- package/dist/components/dateTimePicker/useDateTimePicker.js +106 -0
- package/dist/components/dateTimePicker/useDateTimePicker.mjs +9 -0
- package/dist/components/dateTimePicker/util.d.mts +4 -0
- package/dist/components/dateTimePicker/util.d.ts +4 -0
- package/dist/components/dateTimePicker/util.js +42 -0
- package/dist/components/dateTimePicker/util.mjs +10 -0
- package/dist/components/icon/Icon.d.mts +4 -0
- package/dist/components/icon/Icon.d.ts +4 -0
- package/dist/components/icon/Icon.js +30 -0
- package/dist/components/icon/Icon.mjs +2 -2
- package/dist/components/icon/index.js +30 -0
- package/dist/components/icon/index.mjs +2 -2
- package/dist/components/icon/template.d.mts +1 -0
- package/dist/components/icon/template.d.ts +1 -0
- package/dist/components/icon/template.js +30 -0
- package/dist/components/icon/template.mjs +1 -1
- package/dist/components/input/index.js +36 -4
- package/dist/components/input/index.mjs +3 -3
- package/dist/components/input/input.d.mts +9 -4
- package/dist/components/input/input.d.ts +9 -4
- package/dist/components/input/input.js +36 -4
- package/dist/components/input/input.mjs +3 -3
- package/dist/components/input/input.test.js +36 -4
- package/dist/components/input/input.test.mjs +6 -6
- package/dist/components/list/index.js +3 -3
- package/dist/components/list/index.mjs +1 -1
- package/dist/components/list/list.d.mts +3 -3
- package/dist/components/list/list.d.ts +3 -3
- package/dist/components/list/list.test.mjs +1 -1
- package/dist/components/list/listItem.d.mts +4 -4
- package/dist/components/list/listItem.d.ts +4 -4
- package/dist/components/list/listItem.js +3 -3
- package/dist/components/list/listItem.mjs +1 -1
- package/dist/components/modal/index.js +506 -128
- package/dist/components/modal/index.mjs +6 -5
- package/dist/components/modal/modal.d.mts +2 -2
- package/dist/components/modal/modal.d.ts +2 -2
- package/dist/components/modal/modal.js +506 -128
- package/dist/components/modal/modal.mjs +6 -5
- package/dist/components/modal/modal.test.js +498 -130
- package/dist/components/modal/modal.test.mjs +6 -5
- package/dist/components/pagination/index.js +16 -16
- package/dist/components/pagination/index.mjs +1 -1
- package/dist/components/pagination/pagination.d.mts +2 -2
- package/dist/components/pagination/pagination.d.ts +2 -2
- package/dist/components/pagination/pagination.js +16 -16
- package/dist/components/pagination/pagination.mjs +1 -1
- package/dist/components/pagination/pagination.test.js +16 -16
- package/dist/components/pagination/pagination.test.mjs +2 -2
- package/dist/components/progress/index.js +9 -9
- package/dist/components/progress/index.mjs +1 -1
- package/dist/components/progress/progress.d.mts +35 -35
- package/dist/components/progress/progress.d.ts +35 -35
- package/dist/components/progress/progress.js +9 -9
- package/dist/components/progress/progress.mjs +1 -1
- package/dist/components/progress/progress.test.js +9 -9
- package/dist/components/progress/progress.test.mjs +1 -1
- package/dist/components/radio/index.js +37 -19
- package/dist/components/radio/index.mjs +1 -1
- package/dist/components/radio/radio.d.mts +35 -35
- package/dist/components/radio/radio.d.ts +35 -35
- package/dist/components/radio/radio.js +37 -19
- package/dist/components/radio/radio.mjs +1 -1
- package/dist/components/radio/radio.test.js +37 -19
- package/dist/components/radio/radio.test.mjs +2 -2
- package/dist/components/select/index.js +36 -5
- package/dist/components/select/index.mjs +4 -4
- package/dist/components/select/option.js +30 -0
- package/dist/components/select/option.mjs +3 -3
- package/dist/components/select/select.d.mts +4 -4
- package/dist/components/select/select.d.ts +4 -4
- package/dist/components/select/select.js +36 -5
- package/dist/components/select/select.mjs +4 -4
- package/dist/components/select/select.test.js +36 -5
- package/dist/components/select/select.test.mjs +9 -9
- package/dist/components/select/useSelect.d.mts +3 -3
- package/dist/components/select/useSelect.d.ts +3 -3
- package/dist/components/slider/index.js +9 -4
- package/dist/components/slider/index.mjs +1 -1
- package/dist/components/slider/slider.d.mts +28 -2
- package/dist/components/slider/slider.d.ts +28 -2
- package/dist/components/slider/slider.js +9 -4
- package/dist/components/slider/slider.mjs +1 -1
- package/dist/components/slider/slider.test.js +9 -4
- package/dist/components/slider/slider.test.mjs +1 -1
- package/dist/components/switch/index.js +14 -14
- package/dist/components/switch/index.mjs +1 -1
- package/dist/components/switch/switch.d.mts +50 -50
- package/dist/components/switch/switch.d.ts +50 -50
- package/dist/components/switch/switch.js +14 -14
- package/dist/components/switch/switch.mjs +1 -1
- package/dist/components/switch/switch.test.js +14 -14
- package/dist/components/switch/switch.test.mjs +2 -2
- package/dist/components/table/index.js +66 -27
- package/dist/components/table/index.mjs +7 -7
- package/dist/components/table/table-body.d.mts +2 -2
- package/dist/components/table/table-body.d.ts +2 -2
- package/dist/components/table/table-body.js +60 -23
- package/dist/components/table/table-body.mjs +5 -5
- package/dist/components/table/table-head.js +28 -21
- package/dist/components/table/table-head.mjs +2 -2
- package/dist/components/table/table.d.mts +26 -12
- package/dist/components/table/table.d.ts +26 -12
- package/dist/components/table/table.js +66 -27
- package/dist/components/table/table.mjs +7 -7
- package/dist/components/table/table.test.js +66 -27
- package/dist/components/table/table.test.mjs +8 -8
- package/dist/components/tabs/tabs.d.mts +3 -3
- package/dist/components/tabs/tabs.d.ts +3 -3
- package/dist/components/tabs/tabs.test.mjs +4 -4
- package/dist/components/textarea/index.d.mts +3 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/textarea/index.js +89 -30
- package/dist/components/textarea/index.mjs +2 -1
- package/dist/components/textarea/textarea.d.mts +512 -11
- package/dist/components/textarea/textarea.d.ts +512 -11
- package/dist/components/textarea/textarea.js +89 -30
- package/dist/components/textarea/textarea.mjs +2 -1
- package/dist/components/textarea/textarea.test.js +89 -30
- package/dist/components/textarea/textarea.test.mjs +3 -2
- package/dist/components/toast/index.js +30 -0
- package/dist/components/toast/index.mjs +4 -4
- package/dist/components/toast/toast.d.mts +2 -2
- package/dist/components/toast/toast.d.ts +2 -2
- package/dist/components/toast/toast.js +30 -0
- package/dist/components/toast/toast.mjs +3 -3
- package/dist/components/toast/toast.test.js +30 -0
- package/dist/components/toast/toast.test.mjs +5 -5
- package/dist/components/toast/use-toast.js +30 -0
- package/dist/components/toast/use-toast.mjs +4 -4
- package/dist/components/tooltip/index.d.mts +1 -1
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/components/tooltip/tooltip-utils.d.mts +1 -1
- package/dist/components/tooltip/tooltip-utils.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.mts +3 -3
- package/dist/components/tooltip/tooltip.d.ts +3 -3
- package/dist/components/tooltip/tooltip.test.js +4034 -118
- package/dist/components/tooltip/tooltip.test.mjs +7 -4
- package/dist/components/tooltip/useTooltip.d.mts +1 -1
- package/dist/components/tooltip/useTooltip.d.ts +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3741 -2611
- package/dist/index.mjs +71 -52
- package/dist/{tooltip-utils-DCKA5gnI.d.ts → tooltip-utils-CrCabndd.d.mts} +2 -2
- package/dist/{tooltip-utils-DCKA5gnI.d.mts → tooltip-utils-CrCabndd.d.ts} +2 -2
- package/package.json +1 -1
- package/dist/chunk-66WCZEEU.mjs +0 -320
- package/dist/chunk-WOX3SLJB.mjs +0 -162
|
@@ -80,12 +80,12 @@ Progress.displayName = "Progress";
|
|
|
80
80
|
var progress_default = Progress;
|
|
81
81
|
var progress = tv({
|
|
82
82
|
slots: {
|
|
83
|
-
base: "flex flex-col gap-2 w-[200px]",
|
|
84
|
-
labelWrapper: "flex justify-between",
|
|
85
|
-
label: "font-[500]",
|
|
86
|
-
output: "font-[500]",
|
|
87
|
-
track: "relative bg-neutral-soft rounded-full overflow-hidden",
|
|
88
|
-
indicator: "absolute h-full rounded-full"
|
|
83
|
+
base: ["flex", "flex-col", "gap-2", "w-[200px]"],
|
|
84
|
+
labelWrapper: ["flex", "justify-between"],
|
|
85
|
+
label: ["font-[500]"],
|
|
86
|
+
output: ["font-[500]"],
|
|
87
|
+
track: ["relative", "bg-neutral-soft", "rounded-full", "overflow-hidden"],
|
|
88
|
+
indicator: ["absolute", "h-full", "rounded-full"]
|
|
89
89
|
},
|
|
90
90
|
variants: {
|
|
91
91
|
color: {
|
|
@@ -115,7 +115,7 @@ var progress = tv({
|
|
|
115
115
|
},
|
|
116
116
|
gradient: {
|
|
117
117
|
true: {
|
|
118
|
-
indicator: "bg-gradient-to-r from-primary-main to-secondary-main"
|
|
118
|
+
indicator: ["bg-gradient-to-r", "from-primary-main", "to-secondary-main"]
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
fullWidth: {
|
|
@@ -125,8 +125,8 @@ var progress = tv({
|
|
|
125
125
|
},
|
|
126
126
|
isDisabled: {
|
|
127
127
|
true: {
|
|
128
|
-
base: "opacity-disabled cursor-not-allowed",
|
|
129
|
-
indicator: "bg-neutral-light"
|
|
128
|
+
base: ["opacity-disabled", "cursor-not-allowed"],
|
|
129
|
+
indicator: ["bg-neutral-light", "from-none", "to-none"]
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
},
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
list_default
|
|
4
|
+
} from "./chunk-EYY4CRRR.mjs";
|
|
5
|
+
import {
|
|
6
|
+
listItem_default
|
|
7
|
+
} from "./chunk-EDEV4IK4.mjs";
|
|
8
|
+
|
|
9
|
+
// src/components/dateTimePicker/timePicker.tsx
|
|
10
|
+
import { useState, useRef, useEffect } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var TimePicker = ({ color = "primary", selectedTime, onChangeTime }) => {
|
|
13
|
+
const TOTAL_HOURS = 12;
|
|
14
|
+
const TOTAL_MINUTES = 60;
|
|
15
|
+
const ITEM_HEIGHT = 30;
|
|
16
|
+
const PERIODS = ["AM", "PM"];
|
|
17
|
+
const [selectedHour, setSelectedHour] = useState("01");
|
|
18
|
+
const [selectedMinute, setSelectedMinute] = useState("00");
|
|
19
|
+
const [selectedPeriod, setSelectedPeriod] = useState("AM");
|
|
20
|
+
const hourRef = useRef(null);
|
|
21
|
+
const minuteRef = useRef(null);
|
|
22
|
+
const periodRef = useRef(null);
|
|
23
|
+
const hoursArray = [...Array(TOTAL_HOURS).keys()].map((i) => (i + 1).toString().padStart(2, "0"));
|
|
24
|
+
const minutesArray = [...Array(TOTAL_MINUTES).keys()].map((i) => i.toString().padStart(2, "0"));
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (selectedTime) {
|
|
27
|
+
const { formattedHour, minute, period } = parseAndFormatTime(selectedTime);
|
|
28
|
+
setSelectedHour(formattedHour);
|
|
29
|
+
setSelectedMinute(minute);
|
|
30
|
+
setSelectedPeriod(period);
|
|
31
|
+
}
|
|
32
|
+
}, [selectedTime]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
scrollToSelectedTime();
|
|
35
|
+
}, []);
|
|
36
|
+
const parseAndFormatTime = (time) => {
|
|
37
|
+
const [hour, minute] = time.split(":").map((part) => part.padStart(2, "0"));
|
|
38
|
+
const parsedHour = parseInt(hour, 10);
|
|
39
|
+
const period = parsedHour >= 12 ? "PM" : "AM";
|
|
40
|
+
const formattedHour = parsedHour % 12 === 0 ? "12" : (parsedHour % 12).toString().padStart(2, "0");
|
|
41
|
+
return { formattedHour, minute, period };
|
|
42
|
+
};
|
|
43
|
+
const scrollToSelectedTime = () => {
|
|
44
|
+
if (selectedTime) {
|
|
45
|
+
const { formattedHour, minute, period } = parseAndFormatTime(selectedTime);
|
|
46
|
+
if (hourRef.current) {
|
|
47
|
+
hourRef.current.scrollTop = (parseInt(formattedHour) - 1) * ITEM_HEIGHT;
|
|
48
|
+
}
|
|
49
|
+
if (minuteRef.current) {
|
|
50
|
+
minuteRef.current.scrollTop = parseInt(minute) * ITEM_HEIGHT;
|
|
51
|
+
}
|
|
52
|
+
if (periodRef.current) {
|
|
53
|
+
periodRef.current.scrollTop = period === "AM" ? 0 : ITEM_HEIGHT;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const handleTimeChange = (hour, minute, period) => {
|
|
58
|
+
const parsedHour = parseInt(hour);
|
|
59
|
+
let hour24 = parsedHour;
|
|
60
|
+
if (period === "PM" && parsedHour !== 12) {
|
|
61
|
+
hour24 = parsedHour + 12;
|
|
62
|
+
} else if (period === "AM" && parsedHour === 12) {
|
|
63
|
+
hour24 = 0;
|
|
64
|
+
}
|
|
65
|
+
const formattedTime = `${hour24.toString().padStart(2, "0")}:${minute}`;
|
|
66
|
+
if (onChangeTime) {
|
|
67
|
+
onChangeTime(formattedTime);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex h-[200px] p-[10px] gap-[5px] border border-neutral-main rounded-md bg-background shadow-lg", children: [
|
|
71
|
+
/* @__PURE__ */ jsx(list_default, { ref: periodRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: PERIODS.map((period, index) => /* @__PURE__ */ jsx(
|
|
72
|
+
listItem_default,
|
|
73
|
+
{
|
|
74
|
+
color,
|
|
75
|
+
selected: period === selectedPeriod,
|
|
76
|
+
title: period,
|
|
77
|
+
size: "sm",
|
|
78
|
+
classNames: { base: "w-[50px] min-h-[30px]", titleWrapper: "flex justify-center" },
|
|
79
|
+
onClick: () => {
|
|
80
|
+
handleTimeChange(selectedHour, selectedMinute, period);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
`${period}-${index}`
|
|
84
|
+
)) }),
|
|
85
|
+
/* @__PURE__ */ jsx(list_default, { ref: hourRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: hoursArray.map((hour, index) => /* @__PURE__ */ jsx(
|
|
86
|
+
listItem_default,
|
|
87
|
+
{
|
|
88
|
+
color,
|
|
89
|
+
selected: hour === selectedHour,
|
|
90
|
+
title: hour,
|
|
91
|
+
size: "sm",
|
|
92
|
+
classNames: { base: "w-[50px] min-h-[30px]", titleWrapper: "flex justify-center" },
|
|
93
|
+
onClick: () => {
|
|
94
|
+
handleTimeChange(hour, selectedMinute, selectedPeriod);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
`${hour}-${index}`
|
|
98
|
+
)) }),
|
|
99
|
+
/* @__PURE__ */ jsx(list_default, { ref: minuteRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: minutesArray.map((minute, index) => /* @__PURE__ */ jsx(
|
|
100
|
+
listItem_default,
|
|
101
|
+
{
|
|
102
|
+
color,
|
|
103
|
+
selected: minute === selectedMinute,
|
|
104
|
+
title: minute,
|
|
105
|
+
size: "sm",
|
|
106
|
+
classNames: { base: "w-[50px] min-h-[30px]", titleWrapper: "flex justify-center" },
|
|
107
|
+
onClick: () => {
|
|
108
|
+
handleTimeChange(selectedHour, minute, selectedPeriod);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
`${minute}-${index}`
|
|
112
|
+
)) })
|
|
113
|
+
] });
|
|
114
|
+
};
|
|
115
|
+
var timePicker_default = TimePicker;
|
|
116
|
+
|
|
117
|
+
export {
|
|
118
|
+
timePicker_default
|
|
119
|
+
};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
mapPropsVariants
|
|
4
|
+
} from "./chunk-E3G5QXSH.mjs";
|
|
5
|
+
|
|
6
|
+
// src/components/textarea/textarea.tsx
|
|
7
|
+
import { forwardRef, useCallback, useMemo } from "react";
|
|
8
|
+
import { tv } from "tailwind-variants";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var Textarea = forwardRef((originalProps, ref) => {
|
|
11
|
+
const [props, variantProps] = mapPropsVariants(originalProps, textareaStyle.variantKeys);
|
|
12
|
+
const { classNames, label, errorMessage, ...textareaProps } = props;
|
|
13
|
+
const slots = useMemo(() => textareaStyle({ ...variantProps }), [variantProps]);
|
|
14
|
+
const getBaseProps = useCallback(
|
|
15
|
+
() => ({
|
|
16
|
+
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
17
|
+
}),
|
|
18
|
+
[slots, classNames]
|
|
19
|
+
);
|
|
20
|
+
const getLabelProps = useCallback(
|
|
21
|
+
() => ({
|
|
22
|
+
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
23
|
+
}),
|
|
24
|
+
[slots, classNames]
|
|
25
|
+
);
|
|
26
|
+
const getInnerWrapperProps = useCallback(
|
|
27
|
+
() => ({
|
|
28
|
+
className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
|
|
29
|
+
}),
|
|
30
|
+
[slots, classNames]
|
|
31
|
+
);
|
|
32
|
+
const getTextareaWrapperProps = useCallback(
|
|
33
|
+
() => ({
|
|
34
|
+
className: slots.textareaWrapper({ class: classNames == null ? void 0 : classNames.textareaWrapper })
|
|
35
|
+
}),
|
|
36
|
+
[slots, classNames]
|
|
37
|
+
);
|
|
38
|
+
const getTextareaProps = useCallback(
|
|
39
|
+
() => ({
|
|
40
|
+
...textareaProps,
|
|
41
|
+
ref,
|
|
42
|
+
className: slots.textarea({ class: classNames == null ? void 0 : classNames.textarea }),
|
|
43
|
+
disabled: originalProps.isDisabled,
|
|
44
|
+
required: originalProps.isRequired,
|
|
45
|
+
size: 0
|
|
46
|
+
}),
|
|
47
|
+
[textareaProps, ref, slots, classNames == null ? void 0 : classNames.textarea, originalProps.isDisabled, originalProps.isRequired]
|
|
48
|
+
);
|
|
49
|
+
const getErrorMessageProps = useCallback(
|
|
50
|
+
() => ({
|
|
51
|
+
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
52
|
+
}),
|
|
53
|
+
[slots, classNames]
|
|
54
|
+
);
|
|
55
|
+
return /* @__PURE__ */ jsxs("div", { ...getBaseProps(), children: [
|
|
56
|
+
props.label && /* @__PURE__ */ jsx("label", { ...getLabelProps(), children: props.label }),
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { ...getInnerWrapperProps(), children: [
|
|
58
|
+
/* @__PURE__ */ jsx("div", { ...getTextareaWrapperProps(), children: /* @__PURE__ */ jsx("textarea", { ...getTextareaProps() }) }),
|
|
59
|
+
props.errorMessage && /* @__PURE__ */ jsx("p", { ...getErrorMessageProps(), children: props.errorMessage })
|
|
60
|
+
] })
|
|
61
|
+
] });
|
|
62
|
+
});
|
|
63
|
+
Textarea.displayName = "Textarea";
|
|
64
|
+
var textarea_default = Textarea;
|
|
65
|
+
var textareaStyle = tv({
|
|
66
|
+
slots: {
|
|
67
|
+
base: ["group/textarea", "flex", "flex-col", "gap-[10px]", "select-none"],
|
|
68
|
+
label: ["flex", "items-center"],
|
|
69
|
+
innerWrapper: ["flex", "flex-col", "gap-[6px]"],
|
|
70
|
+
textareaWrapper: [
|
|
71
|
+
"flex",
|
|
72
|
+
"bg-transparent",
|
|
73
|
+
"border-neutral-main",
|
|
74
|
+
"group-has-[p]/textarea:border-danger-main",
|
|
75
|
+
"group-has-[p]/textarea:bg-danger-soft",
|
|
76
|
+
"transition duration-200"
|
|
77
|
+
],
|
|
78
|
+
textarea: [
|
|
79
|
+
"w-full",
|
|
80
|
+
"bg-transparent",
|
|
81
|
+
"placeholder:text-neutral-main",
|
|
82
|
+
"focus-visible:outline-none",
|
|
83
|
+
"resize-none"
|
|
84
|
+
],
|
|
85
|
+
errorMessage: ["text-danger-main"]
|
|
86
|
+
},
|
|
87
|
+
variants: {
|
|
88
|
+
variant: {
|
|
89
|
+
solid: {
|
|
90
|
+
textareaWrapper: ["bg-trans-soft", "hover:bg-trans-light", "has-[:focus]:bg-trans-light"]
|
|
91
|
+
},
|
|
92
|
+
line: {
|
|
93
|
+
textareaWrapper: ["border", "hover:bg-trans-soft", "has-[:focus]:bg-trans-soft"]
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
color: {
|
|
97
|
+
primary: {},
|
|
98
|
+
secondary: {}
|
|
99
|
+
},
|
|
100
|
+
size: {
|
|
101
|
+
sm: {
|
|
102
|
+
base: "gap-[6px]",
|
|
103
|
+
textareaWrapper: "w-[240px] rounded-sm p-[6px]",
|
|
104
|
+
textarea: "text-sm rounded-sm",
|
|
105
|
+
label: "text-sm",
|
|
106
|
+
errorMessage: "text-sm"
|
|
107
|
+
},
|
|
108
|
+
md: {
|
|
109
|
+
base: "gap-[8px]",
|
|
110
|
+
textareaWrapper: "w-[240px] rounded-md p-[8px]",
|
|
111
|
+
textarea: "text-md rounded-md",
|
|
112
|
+
label: "text-md",
|
|
113
|
+
errorMessage: "text-md"
|
|
114
|
+
},
|
|
115
|
+
lg: {
|
|
116
|
+
base: "gap-[10px]",
|
|
117
|
+
textareaWrapper: "w-[240px] rounded-lg p-[10px]",
|
|
118
|
+
textarea: "text-lg rounded-lg",
|
|
119
|
+
label: "text-lg",
|
|
120
|
+
errorMessage: "text-lg"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
radius: {
|
|
124
|
+
default: {},
|
|
125
|
+
none: {
|
|
126
|
+
textareaWrapper: "rounded-none",
|
|
127
|
+
textarea: "rounded-none"
|
|
128
|
+
},
|
|
129
|
+
full: {
|
|
130
|
+
textareaWrapper: "rounded-full",
|
|
131
|
+
textarea: "rounded-full"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
fullWidth: {
|
|
135
|
+
true: {
|
|
136
|
+
base: "w-full",
|
|
137
|
+
textareaWrapper: "w-full",
|
|
138
|
+
textarea: "w-full"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
isDisabled: {
|
|
142
|
+
true: {
|
|
143
|
+
base: ["opacity-disabled", "pointer-events-none"],
|
|
144
|
+
textareaWrapper: ["bg-neutral-soft", "border-neutral-light", "pointer-events-none"],
|
|
145
|
+
textarea: ["text-neutral-light placeholder:text-neutral-light", "border-neutral-light"],
|
|
146
|
+
label: ["text-neutral-light", "pointer-events-none"],
|
|
147
|
+
errorMessage: "text-danger-light"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
isRequired: {
|
|
151
|
+
true: {
|
|
152
|
+
label: ["after:content-['*']", "after:text-danger-main", "after:ml-0.5"]
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
defaultVariants: {
|
|
157
|
+
variant: "solid",
|
|
158
|
+
color: "primary",
|
|
159
|
+
size: "md",
|
|
160
|
+
fullWidth: false,
|
|
161
|
+
isDisabled: false,
|
|
162
|
+
isRequired: false
|
|
163
|
+
},
|
|
164
|
+
compoundVariants: [
|
|
165
|
+
// variants & color
|
|
166
|
+
{
|
|
167
|
+
variant: "line",
|
|
168
|
+
color: "primary",
|
|
169
|
+
class: {
|
|
170
|
+
textareaWrapper: "has-[:focus]:border-primary-main"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
variant: "line",
|
|
175
|
+
color: "secondary",
|
|
176
|
+
class: {
|
|
177
|
+
textareaWrapper: "has-[:focus]:border-secondary-main",
|
|
178
|
+
textarea: "focus:bg-secondary-main"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
// Variants & isDisabled
|
|
182
|
+
{
|
|
183
|
+
variant: "line",
|
|
184
|
+
isDisabled: true,
|
|
185
|
+
class: {
|
|
186
|
+
textareaWrapper: "bg-neutral-soft"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
// isRequired & isDisabled
|
|
190
|
+
{
|
|
191
|
+
isRequired: true,
|
|
192
|
+
isDisabled: true,
|
|
193
|
+
class: {
|
|
194
|
+
label: "after:text-danger-light"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
export {
|
|
201
|
+
textarea_default
|
|
202
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/dateTimePicker/util.ts
|
|
4
|
+
var formatDateToString = (date) => {
|
|
5
|
+
const year = date.getFullYear();
|
|
6
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
7
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
8
|
+
return `${year}-${month}-${day}`;
|
|
9
|
+
};
|
|
10
|
+
var formatStringToDate = (date) => {
|
|
11
|
+
const formattedDate = new Date(date);
|
|
12
|
+
return formattedDate;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
formatDateToString,
|
|
17
|
+
formatStringToDate
|
|
18
|
+
};
|
|
@@ -52,7 +52,16 @@ Radio.displayName = "Radio";
|
|
|
52
52
|
var radio_default = Radio;
|
|
53
53
|
var radio = tv({
|
|
54
54
|
slots: {
|
|
55
|
-
base:
|
|
55
|
+
base: [
|
|
56
|
+
"group/radio",
|
|
57
|
+
"relative",
|
|
58
|
+
"max-w-fit",
|
|
59
|
+
"inline-flex",
|
|
60
|
+
"items-center",
|
|
61
|
+
"justify-start",
|
|
62
|
+
"cursor-pointer",
|
|
63
|
+
"tap-highlight-transparent"
|
|
64
|
+
],
|
|
56
65
|
icon: [
|
|
57
66
|
"relative",
|
|
58
67
|
"inline-flex",
|
|
@@ -81,18 +90,18 @@ var radio = tv({
|
|
|
81
90
|
"after:left-1/2",
|
|
82
91
|
"after:-translate-x-1/2",
|
|
83
92
|
"after:-translate-y-1/2",
|
|
84
|
-
"group-has-[:checked]:after:opacity-100",
|
|
85
|
-
"group-has-[:checked]:after:scale-100",
|
|
93
|
+
"group-has-[:checked]/radio:after:opacity-100",
|
|
94
|
+
"group-has-[:checked]/radio:after:scale-100",
|
|
86
95
|
// hover
|
|
87
|
-
"group-hover:before:bg-neutral-soft",
|
|
96
|
+
"group-hover/radio:before:bg-neutral-soft",
|
|
88
97
|
"before:transition duration-200",
|
|
89
98
|
// focus ring
|
|
90
99
|
"outline-none",
|
|
91
|
-
"group-focus:z-10",
|
|
92
|
-
"group-focus:ring-2",
|
|
93
|
-
"group-focus:ring-focus",
|
|
94
|
-
"group-focus:ring-offset-2",
|
|
95
|
-
"group-focus:ring-offset-background"
|
|
100
|
+
"group-focus/radio:z-10",
|
|
101
|
+
"group-focus/radio:ring-2",
|
|
102
|
+
"group-focus/radio:ring-focus",
|
|
103
|
+
"group-focus/radio:ring-offset-2",
|
|
104
|
+
"group-focus/radio:ring-offset-background"
|
|
96
105
|
],
|
|
97
106
|
labelWrapper: "flex flex-col",
|
|
98
107
|
label: "text-foreground select-none"
|
|
@@ -100,44 +109,53 @@ var radio = tv({
|
|
|
100
109
|
variants: {
|
|
101
110
|
color: {
|
|
102
111
|
primary: {
|
|
103
|
-
icon: "group-has-[:checked]:before:border-primary-main after:bg-primary-main"
|
|
112
|
+
icon: ["group-has-[:checked]/radio:before:border-primary-main", "after:bg-primary-main"]
|
|
104
113
|
},
|
|
105
114
|
secondary: {
|
|
106
|
-
icon: "group-has-[:checked]:before:border-secondary-main after:bg-secondary-main"
|
|
115
|
+
icon: ["group-has-[:checked]/radio:before:border-secondary-main", "after:bg-secondary-main"]
|
|
107
116
|
}
|
|
108
117
|
},
|
|
109
118
|
size: {
|
|
110
119
|
sm: {
|
|
111
|
-
icon: ["w-[15px] h-[15px] mr-[
|
|
120
|
+
icon: ["w-[15px]", "h-[15px]", "mr-[6px]", "after:w-[9px]", "after:h-[9px]"],
|
|
112
121
|
label: "text-sm"
|
|
113
122
|
},
|
|
114
123
|
md: {
|
|
115
|
-
icon: ["w-[17px] h-[17px] mr-[
|
|
124
|
+
icon: ["w-[17px]", "h-[17px]", "mr-[8px]", "after:w-[11px]", "after:h-[11px]"],
|
|
116
125
|
label: "text-md"
|
|
117
126
|
},
|
|
118
127
|
lg: {
|
|
119
|
-
icon: ["w-[20px] h-[20px] mr-[10px] after:w-[
|
|
128
|
+
icon: ["w-[20px]", "h-[20px]", "mr-[10px]", "after:w-[14px]", "after:h-[14px]"],
|
|
120
129
|
label: "text-lg"
|
|
121
130
|
}
|
|
122
131
|
},
|
|
123
132
|
isInvalid: {
|
|
124
133
|
true: {
|
|
125
|
-
icon:
|
|
134
|
+
icon: [
|
|
135
|
+
"after:bg-danger-main",
|
|
136
|
+
"before:border-danger-main",
|
|
137
|
+
"group-has-[:checked]/radio:before:border-danger-main"
|
|
138
|
+
],
|
|
126
139
|
label: "text-danger-main"
|
|
127
140
|
}
|
|
128
141
|
},
|
|
129
142
|
isDisabled: {
|
|
130
143
|
true: {
|
|
131
|
-
base: "opacity-disabled pointer-events-none",
|
|
132
|
-
icon:
|
|
144
|
+
base: ["opacity-disabled", "pointer-events-none"],
|
|
145
|
+
icon: [
|
|
146
|
+
"before:border-neutral-light",
|
|
147
|
+
"before:bg-neutral-soft",
|
|
148
|
+
"after:bg-neutral-light",
|
|
149
|
+
"group-has-[:checked]/radio:before:border-neutral-light"
|
|
150
|
+
],
|
|
133
151
|
label: "text-neutral-light"
|
|
134
152
|
}
|
|
135
153
|
},
|
|
136
154
|
disableAnimation: {
|
|
137
155
|
true: {},
|
|
138
156
|
false: {
|
|
139
|
-
icon: ["group-active:scale-95", "transition-transform-colors", "motion-reduce:transition-none"],
|
|
140
|
-
label: "transition-colors motion-reduce:transition-none"
|
|
157
|
+
icon: ["group-active/radio:scale-95", "transition-transform-colors", "motion-reduce:transition-none"],
|
|
158
|
+
label: ["transition-colors", "motion-reduce:transition-none"]
|
|
141
159
|
}
|
|
142
160
|
}
|
|
143
161
|
},
|