@deepnoid/ui 0.0.89 → 0.0.91

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.
Files changed (117) hide show
  1. package/dist/chunk-75HLCORR.mjs +1 -0
  2. package/dist/chunk-D5GGG7IO.mjs +122 -0
  3. package/dist/{chunk-FPCP4OOL.mjs → chunk-EDEV4IK4.mjs} +3 -3
  4. package/dist/chunk-FWJ2ZKH6.mjs +87 -0
  5. package/dist/chunk-HHYPMVLY.mjs +359 -0
  6. package/dist/{chunk-HFVZFUC3.mjs → chunk-L7P6OBUX.mjs} +1 -1
  7. package/dist/chunk-P732YGHO.mjs +18 -0
  8. package/dist/{chunk-MOINJECK.mjs → chunk-S3O52LLG.mjs} +1 -2
  9. package/dist/chunk-WX32MAKV.mjs +219 -0
  10. package/dist/components/accordion/accordion.d.mts +2 -2
  11. package/dist/components/accordion/accordion.d.ts +2 -2
  12. package/dist/components/accordion/accordion.test.mjs +3 -3
  13. package/dist/components/accordion/accordionItem.d.mts +2 -2
  14. package/dist/components/accordion/accordionItem.d.ts +2 -2
  15. package/dist/components/button/button-group.d.mts +2 -2
  16. package/dist/components/button/button-group.d.ts +2 -2
  17. package/dist/components/button/button-group.test.mjs +3 -3
  18. package/dist/components/button/button.d.mts +2 -2
  19. package/dist/components/button/button.d.ts +2 -2
  20. package/dist/components/button/button.test.mjs +3 -3
  21. package/dist/components/card/card.d.mts +2 -2
  22. package/dist/components/card/card.d.ts +2 -2
  23. package/dist/components/checkbox/checkbox.d.mts +2 -2
  24. package/dist/components/checkbox/checkbox.d.ts +2 -2
  25. package/dist/components/checkbox/checkbox.test.mjs +3 -3
  26. package/dist/components/dateTimePicker/calendar.d.mts +118 -0
  27. package/dist/components/dateTimePicker/calendar.d.ts +118 -0
  28. package/dist/components/dateTimePicker/calendar.js +3854 -0
  29. package/dist/components/dateTimePicker/calendar.mjs +16 -0
  30. package/dist/components/dateTimePicker/dateTimePicker.d.mts +445 -0
  31. package/dist/components/dateTimePicker/dateTimePicker.d.ts +445 -0
  32. package/dist/components/dateTimePicker/dateTimePicker.js +4540 -0
  33. package/dist/components/dateTimePicker/dateTimePicker.mjs +22 -0
  34. package/dist/components/dateTimePicker/index.d.mts +5 -0
  35. package/dist/components/dateTimePicker/index.d.ts +5 -0
  36. package/dist/components/dateTimePicker/index.js +4541 -0
  37. package/dist/components/dateTimePicker/index.mjs +21 -0
  38. package/dist/components/dateTimePicker/timePicker.d.mts +11 -0
  39. package/dist/components/dateTimePicker/timePicker.d.ts +11 -0
  40. package/dist/components/dateTimePicker/timePicker.js +345 -0
  41. package/dist/components/dateTimePicker/timePicker.mjs +13 -0
  42. package/dist/components/dateTimePicker/useDateTimePicker.d.mts +34 -0
  43. package/dist/components/dateTimePicker/useDateTimePicker.d.ts +34 -0
  44. package/dist/components/dateTimePicker/useDateTimePicker.js +117 -0
  45. package/dist/components/dateTimePicker/useDateTimePicker.mjs +9 -0
  46. package/dist/components/dateTimePicker/util.d.mts +4 -0
  47. package/dist/components/dateTimePicker/util.d.ts +4 -0
  48. package/dist/components/dateTimePicker/util.js +42 -0
  49. package/dist/components/dateTimePicker/util.mjs +10 -0
  50. package/dist/components/input/input.d.mts +2 -2
  51. package/dist/components/input/input.d.ts +2 -2
  52. package/dist/components/input/input.test.mjs +1 -1
  53. package/dist/components/list/index.js +3 -3
  54. package/dist/components/list/index.mjs +1 -1
  55. package/dist/components/list/list.d.mts +2 -2
  56. package/dist/components/list/list.d.ts +2 -2
  57. package/dist/components/list/listItem.d.mts +3 -3
  58. package/dist/components/list/listItem.d.ts +3 -3
  59. package/dist/components/list/listItem.js +3 -3
  60. package/dist/components/list/listItem.mjs +1 -1
  61. package/dist/components/modal/index.js +1 -1
  62. package/dist/components/modal/index.mjs +1 -1
  63. package/dist/components/modal/modal.d.mts +2 -2
  64. package/dist/components/modal/modal.d.ts +2 -2
  65. package/dist/components/modal/modal.js +1 -1
  66. package/dist/components/modal/modal.mjs +1 -1
  67. package/dist/components/modal/modal.test.js +1 -1
  68. package/dist/components/modal/modal.test.mjs +2 -2
  69. package/dist/components/pagination/pagination.d.mts +2 -2
  70. package/dist/components/pagination/pagination.d.ts +2 -2
  71. package/dist/components/progress/progress.d.mts +2 -2
  72. package/dist/components/progress/progress.d.ts +2 -2
  73. package/dist/components/radio/radio.d.mts +2 -2
  74. package/dist/components/radio/radio.d.ts +2 -2
  75. package/dist/components/select/select.d.mts +2 -2
  76. package/dist/components/select/select.d.ts +2 -2
  77. package/dist/components/select/select.test.mjs +3 -3
  78. package/dist/components/select/useSelect.d.mts +3 -3
  79. package/dist/components/select/useSelect.d.ts +3 -3
  80. package/dist/components/slider/slider.d.mts +2 -2
  81. package/dist/components/slider/slider.d.ts +2 -2
  82. package/dist/components/switch/index.js +1 -2
  83. package/dist/components/switch/index.mjs +1 -1
  84. package/dist/components/switch/switch.d.mts +2 -2
  85. package/dist/components/switch/switch.d.ts +2 -2
  86. package/dist/components/switch/switch.js +1 -2
  87. package/dist/components/switch/switch.mjs +1 -1
  88. package/dist/components/switch/switch.test.js +1 -2
  89. package/dist/components/switch/switch.test.mjs +1 -1
  90. package/dist/components/table/table-body.d.mts +2 -2
  91. package/dist/components/table/table-body.d.ts +2 -2
  92. package/dist/components/table/table.d.mts +5 -5
  93. package/dist/components/table/table.d.ts +5 -5
  94. package/dist/components/tabs/tabs.d.mts +2 -2
  95. package/dist/components/tabs/tabs.d.ts +2 -2
  96. package/dist/components/tabs/tabs.test.mjs +3 -3
  97. package/dist/components/textarea/textarea.d.mts +2 -2
  98. package/dist/components/textarea/textarea.d.ts +2 -2
  99. package/dist/components/textarea/textarea.test.mjs +1 -1
  100. package/dist/components/toast/toast.d.mts +2 -2
  101. package/dist/components/toast/toast.d.ts +2 -2
  102. package/dist/components/tooltip/index.d.mts +1 -1
  103. package/dist/components/tooltip/index.d.ts +1 -1
  104. package/dist/components/tooltip/tooltip-utils.d.mts +1 -1
  105. package/dist/components/tooltip/tooltip-utils.d.ts +1 -1
  106. package/dist/components/tooltip/tooltip.d.mts +3 -3
  107. package/dist/components/tooltip/tooltip.d.ts +3 -3
  108. package/dist/components/tooltip/tooltip.test.mjs +3 -3
  109. package/dist/components/tooltip/useTooltip.d.mts +1 -1
  110. package/dist/components/tooltip/useTooltip.d.ts +1 -1
  111. package/dist/index.d.mts +2 -1
  112. package/dist/index.d.ts +2 -1
  113. package/dist/index.js +751 -6
  114. package/dist/index.mjs +62 -43
  115. package/dist/{tooltip-utils-DCKA5gnI.d.ts → tooltip-utils-CrCabndd.d.mts} +2 -2
  116. package/dist/{tooltip-utils-DCKA5gnI.d.mts → tooltip-utils-CrCabndd.d.ts} +2 -2
  117. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ "use client";
@@ -0,0 +1,122 @@
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, isFocusInput, 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
+ if (isFocusInput) {
33
+ scrollToSelectedTime();
34
+ }
35
+ }, [selectedTime, isFocusInput]);
36
+ useEffect(() => {
37
+ scrollToSelectedTime();
38
+ }, []);
39
+ const parseAndFormatTime = (time) => {
40
+ const [hour, minute] = time.split(":").map((part) => part.padStart(2, "0"));
41
+ const parsedHour = parseInt(hour, 10);
42
+ const period = parsedHour >= 12 ? "PM" : "AM";
43
+ const formattedHour = parsedHour % 12 === 0 ? "12" : (parsedHour % 12).toString().padStart(2, "0");
44
+ return { formattedHour, minute, period };
45
+ };
46
+ const scrollToSelectedTime = () => {
47
+ if (selectedTime) {
48
+ const { formattedHour, minute, period } = parseAndFormatTime(selectedTime);
49
+ if (hourRef.current) {
50
+ hourRef.current.scrollTop = (parseInt(formattedHour) - 1) * ITEM_HEIGHT;
51
+ }
52
+ if (minuteRef.current) {
53
+ minuteRef.current.scrollTop = parseInt(minute) * ITEM_HEIGHT;
54
+ }
55
+ if (periodRef.current) {
56
+ periodRef.current.scrollTop = period === "AM" ? 0 : ITEM_HEIGHT;
57
+ }
58
+ }
59
+ };
60
+ const handleTimeChange = (hour, minute, period) => {
61
+ const parsedHour = parseInt(hour);
62
+ let hour24 = parsedHour;
63
+ if (period === "PM" && parsedHour !== 12) {
64
+ hour24 = parsedHour + 12;
65
+ } else if (period === "AM" && parsedHour === 12) {
66
+ hour24 = 0;
67
+ }
68
+ const formattedTime = `${hour24.toString().padStart(2, "0")}:${minute}`;
69
+ if (onChangeTime) {
70
+ onChangeTime(formattedTime);
71
+ }
72
+ };
73
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-[200px] p-[10px] gap-[5px] border border-neutral-main rounded-md bg-background shadow-lg", children: [
74
+ /* @__PURE__ */ jsx(list_default, { ref: periodRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: PERIODS.map((period, index) => /* @__PURE__ */ jsx(
75
+ listItem_default,
76
+ {
77
+ color,
78
+ selected: period === selectedPeriod,
79
+ title: period,
80
+ size: "sm",
81
+ classNames: { base: "w-[50px] min-h-[30px]", titleWrapper: "flex justify-center" },
82
+ onClick: () => {
83
+ handleTimeChange(selectedHour, selectedMinute, period);
84
+ }
85
+ },
86
+ `${period}-${index}`
87
+ )) }),
88
+ /* @__PURE__ */ jsx(list_default, { ref: hourRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: hoursArray.map((hour, index) => /* @__PURE__ */ jsx(
89
+ listItem_default,
90
+ {
91
+ color,
92
+ selected: hour === selectedHour,
93
+ title: hour,
94
+ size: "sm",
95
+ classNames: { base: "w-[50px] min-h-[30px]", titleWrapper: "flex justify-center" },
96
+ onClick: () => {
97
+ handleTimeChange(hour, selectedMinute, selectedPeriod);
98
+ }
99
+ },
100
+ `${hour}-${index}`
101
+ )) }),
102
+ /* @__PURE__ */ jsx(list_default, { ref: minuteRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: minutesArray.map((minute, index) => /* @__PURE__ */ jsx(
103
+ listItem_default,
104
+ {
105
+ color,
106
+ selected: minute === selectedMinute,
107
+ title: minute,
108
+ size: "sm",
109
+ classNames: { base: "w-[50px] min-h-[30px]", titleWrapper: "flex justify-center" },
110
+ onClick: () => {
111
+ handleTimeChange(selectedHour, minute, selectedPeriod);
112
+ }
113
+ },
114
+ `${minute}-${index}`
115
+ )) })
116
+ ] });
117
+ };
118
+ var timePicker_default = TimePicker;
119
+
120
+ export {
121
+ timePicker_default
122
+ };
@@ -65,13 +65,13 @@ var listItem = tv({
65
65
  },
66
66
  size: {
67
67
  sm: {
68
- base: "h-[30px] text-sm"
68
+ base: "min-h-[30px] text-sm"
69
69
  },
70
70
  md: {
71
- base: "h-[40px] text-md"
71
+ base: "min-h-[40px] text-md"
72
72
  },
73
73
  lg: {
74
- base: "h-[50px] text-lg"
74
+ base: "min-h-[50px] text-lg"
75
75
  }
76
76
  },
77
77
  color: {
@@ -0,0 +1,87 @@
1
+ "use client";
2
+ import {
3
+ formatDateToString
4
+ } from "./chunk-P732YGHO.mjs";
5
+
6
+ // src/components/dateTimePicker/useDateTimePicker.tsx
7
+ import { useState, useEffect, useRef } from "react";
8
+ var useDatePicker = ({ initialDate, initialTime }) => {
9
+ const [selectedDate, setSelectedDate] = useState(
10
+ initialDate ? formatDateToString(initialDate) : ""
11
+ );
12
+ const [selectedTime, setSelectedTime] = useState(initialTime ? initialTime : "");
13
+ const [targetRect, setTargetRect] = useState(null);
14
+ const [popupWidth, setPopupWidth] = useState(0);
15
+ const [popupHeight, setPopupHeight] = useState(0);
16
+ const [isFocusInput, setIsFocusInput] = useState(false);
17
+ const dateInputRef = useRef(null);
18
+ const datePickerWrapperRef = useRef(null);
19
+ const datePickerRef = useRef(null);
20
+ const DATE_PICKER_GAP = 4;
21
+ const calculatePositionWithScroll = (targetRect2) => {
22
+ if (targetRect2 && popupWidth && popupHeight) {
23
+ const scrollTop = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
24
+ const scrollLeft = window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
25
+ const spaceBelow = window.innerHeight - (targetRect2.y + targetRect2.height + DATE_PICKER_GAP);
26
+ const spaceAbove = targetRect2.y - DATE_PICKER_GAP;
27
+ const top = spaceBelow < popupHeight && spaceAbove > popupHeight ? targetRect2.y - popupHeight - DATE_PICKER_GAP : targetRect2.y + targetRect2.height + DATE_PICKER_GAP;
28
+ return {
29
+ top: top + scrollTop,
30
+ left: targetRect2.x + targetRect2.width - popupWidth + scrollLeft
31
+ };
32
+ }
33
+ };
34
+ const handleToggleDatePicker = () => {
35
+ if (datePickerRef.current) {
36
+ const rect = datePickerRef.current.getBoundingClientRect();
37
+ setTargetRect((prevRect) => prevRect ? null : { x: rect.x, y: rect.y, width: rect.width, height: rect.height });
38
+ }
39
+ };
40
+ const handleChangeDate = (date) => {
41
+ setSelectedDate(date);
42
+ };
43
+ const handleChangeTime = (time) => {
44
+ setSelectedTime(time);
45
+ };
46
+ const handleFocusInput = () => {
47
+ setIsFocusInput(true);
48
+ };
49
+ const handleBlueInput = () => {
50
+ setIsFocusInput(false);
51
+ };
52
+ useEffect(() => {
53
+ const onClickOutside = (e) => {
54
+ if (datePickerRef.current && !datePickerRef.current.contains(e.target) && datePickerWrapperRef.current && !datePickerWrapperRef.current.contains(e.target)) {
55
+ setTargetRect(null);
56
+ }
57
+ };
58
+ window.addEventListener("mousedown", onClickOutside);
59
+ return () => window.removeEventListener("mousedown", onClickOutside);
60
+ }, []);
61
+ useEffect(() => {
62
+ if (datePickerWrapperRef.current) {
63
+ setPopupHeight(datePickerWrapperRef.current.getBoundingClientRect().height);
64
+ setPopupWidth(datePickerWrapperRef.current.getBoundingClientRect().width);
65
+ }
66
+ }, [targetRect]);
67
+ return {
68
+ selectedDate,
69
+ selectedTime,
70
+ targetRect,
71
+ popupHeight,
72
+ isFocusInput,
73
+ dateInputRef,
74
+ datePickerWrapperRef,
75
+ datePickerRef,
76
+ handleToggleDatePicker,
77
+ handleChangeDate,
78
+ handleChangeTime,
79
+ handleFocusInput,
80
+ handleBlueInput,
81
+ calculatePositionWithScroll
82
+ };
83
+ };
84
+
85
+ export {
86
+ useDatePicker
87
+ };
@@ -0,0 +1,359 @@
1
+ "use client";
2
+ import {
3
+ useDatePicker
4
+ } from "./chunk-FWJ2ZKH6.mjs";
5
+ import {
6
+ calendar_default
7
+ } from "./chunk-WX32MAKV.mjs";
8
+ import {
9
+ timePicker_default
10
+ } from "./chunk-D5GGG7IO.mjs";
11
+ import {
12
+ Icon_default
13
+ } from "./chunk-LCI6RPWE.mjs";
14
+ import {
15
+ mapPropsVariants
16
+ } from "./chunk-E3G5QXSH.mjs";
17
+ import {
18
+ tv
19
+ } from "./chunk-J725QONZ.mjs";
20
+
21
+ // src/components/dateTimePicker/dateTimePicker.tsx
22
+ import React, { forwardRef, useCallback, useMemo } from "react";
23
+ import { createPortal } from "react-dom";
24
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
25
+ var DatePicker = forwardRef((originalProps, ref) => {
26
+ const [props, variantProps] = mapPropsVariants(originalProps, dateTimePickerStyle.variantKeys);
27
+ const {
28
+ classNames,
29
+ label,
30
+ errorMessage,
31
+ startContent,
32
+ endContent,
33
+ type = "date",
34
+ value,
35
+ onChangeDate,
36
+ onChangeTime,
37
+ ...inputProps
38
+ } = props;
39
+ const slots = useMemo(() => dateTimePickerStyle({ ...variantProps }), [variantProps]);
40
+ const {
41
+ selectedDate,
42
+ selectedTime,
43
+ targetRect,
44
+ popupHeight,
45
+ isFocusInput,
46
+ datePickerRef,
47
+ dateInputRef,
48
+ datePickerWrapperRef,
49
+ handleToggleDatePicker,
50
+ handleChangeDate,
51
+ handleChangeTime,
52
+ handleFocusInput,
53
+ handleBlueInput,
54
+ calculatePositionWithScroll
55
+ } = useDatePicker({
56
+ initialDate: void 0
57
+ });
58
+ const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
59
+ const getBaseProps = useCallback(
60
+ () => ({
61
+ className: slots.base({ class: classNames == null ? void 0 : classNames.base })
62
+ }),
63
+ [slots, classNames]
64
+ );
65
+ const getLabelProps = useCallback(
66
+ () => ({
67
+ className: slots.label({ class: classNames == null ? void 0 : classNames.label })
68
+ }),
69
+ [slots, classNames]
70
+ );
71
+ const getInnerWrapperProps = useCallback(
72
+ () => ({
73
+ className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
74
+ }),
75
+ [slots, classNames]
76
+ );
77
+ const getInputWrapperProps = useCallback(
78
+ () => ({
79
+ className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
80
+ ref: datePickerRef
81
+ }),
82
+ [slots, classNames]
83
+ );
84
+ const getInputProps = useCallback(
85
+ () => ({
86
+ ...inputProps,
87
+ ref: ref || dateInputRef,
88
+ className: slots.input({ class: classNames == null ? void 0 : classNames.input }),
89
+ size: 0,
90
+ type,
91
+ value: value !== void 0 ? value : type === "date" ? selectedDate || "" : type === "time" ? selectedTime || "" : "",
92
+ onChange: (e) => {
93
+ if (type === "date") {
94
+ handleChangeDate(e.target.value);
95
+ if (onChangeDate) {
96
+ onChangeDate(e.target.value);
97
+ }
98
+ } else if (type === "time") {
99
+ handleChangeTime(e.target.value);
100
+ if (onChangeTime) {
101
+ onChangeTime(e.target.value);
102
+ }
103
+ }
104
+ },
105
+ onFocus: (e) => {
106
+ handleFocusInput();
107
+ },
108
+ onBlur: (e) => {
109
+ handleBlueInput();
110
+ },
111
+ max: "9999-12-31"
112
+ }),
113
+ [inputProps, ref, dateInputRef, slots, classNames == null ? void 0 : classNames.input, selectedDate, selectedTime, type, value]
114
+ );
115
+ const getContentProps = useCallback(
116
+ () => ({
117
+ className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
118
+ size: originalProps.size
119
+ }),
120
+ [slots, classNames, originalProps.size]
121
+ );
122
+ const getErrorMessageProps = useCallback(
123
+ () => ({
124
+ className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
125
+ }),
126
+ [slots, classNames]
127
+ );
128
+ const renderStartContent = () => {
129
+ if (React.isValidElement(startContent)) {
130
+ const existingProps = startContent.props;
131
+ const mergedProps = {
132
+ ...getContentProps(),
133
+ className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
134
+ };
135
+ return React.cloneElement(startContent, mergedProps);
136
+ } else {
137
+ const contentProps = getContentProps();
138
+ return /* @__PURE__ */ jsx("div", { ...contentProps, children: startContent });
139
+ }
140
+ };
141
+ const renderDateTimePickerIcon = () => /* @__PURE__ */ jsx("div", { ...getContentProps(), onClick: handleToggleDatePicker, children: /* @__PURE__ */ jsx(
142
+ Icon_default,
143
+ {
144
+ name: type === "time" ? "clock" : "calendar",
145
+ size: originalProps.size,
146
+ className: "cursor-pointer",
147
+ fill: type === "date"
148
+ }
149
+ ) });
150
+ const renderContentWithIcon = () => {
151
+ if (React.isValidElement(endContent)) {
152
+ const existingProps = endContent.props;
153
+ const mergedProps = {
154
+ ...getContentProps(),
155
+ className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
156
+ };
157
+ return React.cloneElement(endContent, mergedProps);
158
+ } else if (errorMessage) {
159
+ const iconProps = { ...getContentProps(), className: getContentProps().className };
160
+ return /* @__PURE__ */ jsx("div", { ...iconProps, children: /* @__PURE__ */ jsx(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
161
+ } else {
162
+ return /* @__PURE__ */ jsx(Fragment, {});
163
+ }
164
+ };
165
+ const renderEndContent = () => {
166
+ switch (type) {
167
+ case "date":
168
+ case "datetime-local":
169
+ case "month":
170
+ case "week":
171
+ case "time":
172
+ return renderDateTimePickerIcon();
173
+ default:
174
+ return renderContentWithIcon();
175
+ }
176
+ };
177
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
178
+ /* @__PURE__ */ jsxs("div", { ...getBaseProps(), children: [
179
+ label && /* @__PURE__ */ jsx("label", { ...getLabelProps(), children: label }),
180
+ /* @__PURE__ */ jsxs("div", { ...getInnerWrapperProps(), children: [
181
+ /* @__PURE__ */ jsxs("div", { ...getInputWrapperProps(), children: [
182
+ startContent && renderStartContent(),
183
+ /* @__PURE__ */ jsx("input", { ...getInputProps() }),
184
+ renderEndContent()
185
+ ] }),
186
+ errorMessage && /* @__PURE__ */ jsx("p", { ...getErrorMessageProps(), children: errorMessage })
187
+ ] })
188
+ ] }),
189
+ targetRect && /* @__PURE__ */ jsx(Fragment, { children: createPortal(
190
+ /* @__PURE__ */ jsxs(
191
+ "div",
192
+ {
193
+ ref: datePickerWrapperRef,
194
+ style: {
195
+ position: "absolute",
196
+ top: (position == null ? void 0 : position.top) || -99999,
197
+ left: (position == null ? void 0 : position.left) || -99999,
198
+ zIndex: 1e3
199
+ },
200
+ children: [
201
+ type === "date" && /* @__PURE__ */ jsx(
202
+ calendar_default,
203
+ {
204
+ color: originalProps.color,
205
+ selectedDate,
206
+ highlightWeekend: originalProps.highlightWeekend,
207
+ onChangeDate: (date) => {
208
+ handleChangeDate(date);
209
+ if (onChangeDate) onChangeDate(date);
210
+ }
211
+ }
212
+ ),
213
+ type === "time" && /* @__PURE__ */ jsx(
214
+ timePicker_default,
215
+ {
216
+ color: originalProps.color,
217
+ selectedTime,
218
+ isFocusInput,
219
+ onChangeTime: (time) => {
220
+ handleChangeTime(time);
221
+ if (onChangeTime) onChangeTime(time);
222
+ }
223
+ }
224
+ )
225
+ ]
226
+ }
227
+ ),
228
+ document.body
229
+ ) })
230
+ ] });
231
+ });
232
+ DatePicker.displayName = "DatePicker";
233
+ var dateTimePicker_default = DatePicker;
234
+ var dateTimePickerStyle = tv({
235
+ slots: {
236
+ base: ["group/input", "flex", "flex-col", "inline-block"],
237
+ label: ["flex", "items-center"],
238
+ innerWrapper: ["flex", "flex-col"],
239
+ inputWrapper: [
240
+ "flex",
241
+ "items-center",
242
+ "transition",
243
+ "duration-200",
244
+ "group-has-[p]/input:border-danger-main",
245
+ "group-has-[p]/input:bg-danger-soft"
246
+ ],
247
+ input: ["w-full", "h-full", "bg-transparent", "placeholder:text-neutral-main", "focus-visible:outline-none"],
248
+ content: ["flex", "items-center", "select-none", "group-has-[p]/input:text-danger-main"],
249
+ errorMessage: ["text-danger-main"]
250
+ },
251
+ variants: {
252
+ variant: {
253
+ solid: {
254
+ inputWrapper: ["bg-trans-soft", "hover:bg-trans-light", "has-[:focus]:bg-trans-light"]
255
+ },
256
+ normal: {
257
+ inputWrapper: [
258
+ "bg-transparent",
259
+ "border",
260
+ "border-neutral-main",
261
+ "hover:bg-trans-soft",
262
+ "has-[:focus]:bg-trans-soft"
263
+ ]
264
+ },
265
+ line: {
266
+ inputWrapper: [
267
+ "bg-transparent",
268
+ "border-b",
269
+ "border-neutral-main",
270
+ "!rounded-none",
271
+ "hover:bg-trans-soft",
272
+ "has-[:focus]:bg-trans-soft"
273
+ ]
274
+ }
275
+ },
276
+ color: {
277
+ primary: {
278
+ inputWrapper: ["has-[:focus]:border-primary-main"],
279
+ content: ["text-primary-main"]
280
+ },
281
+ secondary: {
282
+ inputWrapper: ["has-[:focus]:border-secondary-main"],
283
+ content: ["text-secondary-main"]
284
+ }
285
+ },
286
+ size: {
287
+ sm: {
288
+ base: ["text-sm", "gap-[6px]"],
289
+ innerWrapper: ["group-has-[p]/input:gap-[6px]"],
290
+ inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[6px]", "py-[4.5px]", "gap-[6px]"],
291
+ errorMessage: ["text-sm"]
292
+ },
293
+ md: {
294
+ base: ["text-md", "gap-[8px]"],
295
+ innerWrapper: ["group-has-[p]/input:gap-[8px]"],
296
+ inputWrapper: ["w-[240px]", "h-[30px]", "rounded-md", "px-[8px]", "py-[6.5px]", "gap-[8px]"],
297
+ errorMessage: ["text-md"]
298
+ },
299
+ lg: {
300
+ base: ["text-lg", "gap-[10px]"],
301
+ innerWrapper: ["group-has-[p]/input:gap-[10px]"],
302
+ inputWrapper: ["w-[240px]", "h-[36px]", "rounded-lg", "px-[10px]", "py-[8px]", "gap-[10px]"],
303
+ errorMessage: ["text-lg"]
304
+ }
305
+ },
306
+ radius: {
307
+ default: "",
308
+ none: {
309
+ inputWrapper: ["rounded-none"]
310
+ },
311
+ full: {
312
+ inputWrapper: ["rounded-full"]
313
+ }
314
+ },
315
+ fullWidth: {
316
+ true: {
317
+ base: ["w-full"],
318
+ innerWrapper: ["flex-1"],
319
+ inputWrapper: ["w-full"]
320
+ }
321
+ },
322
+ isDisabled: {
323
+ true: {
324
+ label: ["text-neutral-light"],
325
+ inputWrapper: ["bg-neutral-soft", "border-neutral-light", "pointer-events-none"],
326
+ input: ["text-neutral-light", "placeholder:text-neutral-light"],
327
+ content: ["text-neutral-light"],
328
+ errorMessage: ["text-danger-light"]
329
+ }
330
+ },
331
+ isRequired: {
332
+ true: {
333
+ label: ["after:content-['*']", "after:text-danger-main", "after:ml-0.5"]
334
+ }
335
+ }
336
+ },
337
+ defaultVariants: {
338
+ variant: "solid",
339
+ color: "primary",
340
+ size: "md",
341
+ fullWidth: false,
342
+ isDisabled: false,
343
+ isRequired: false
344
+ },
345
+ compoundVariants: [
346
+ {
347
+ isDisabled: true,
348
+ isRequired: true,
349
+ class: {
350
+ label: ["after:text-danger-light"]
351
+ }
352
+ }
353
+ ]
354
+ });
355
+
356
+ export {
357
+ dateTimePicker_default,
358
+ dateTimePickerStyle
359
+ };
@@ -149,7 +149,7 @@ Modal.displayName = "Modal";
149
149
  var modal_default = Modal;
150
150
  var modal = tv({
151
151
  slots: {
152
- backdrop: ["relative w-screen h-screen fixed inset-0 bg-black/60", "z-[9999]"],
152
+ backdrop: ["relative w-screen h-screen fixed inset-0 bg-black/60", "z-[900]"],
153
153
  modalWrapper: ["group/modal", "absolute", "top-1/2", "-translate-y-1/2", "left-1/2", "-translate-x-1/2"],
154
154
  icon: ["absolute", "top-[20px]", "left-1/2", "-translate-x-1/2", "z-10"],
155
155
  closeIcon: [
@@ -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
+ };
@@ -73,8 +73,7 @@ var toggle = tv({
73
73
  "bg-neutral-soft",
74
74
  "overflow-hidden",
75
75
  "rounded-full",
76
- "px-[2px]",
77
- "hover:bg-primary-main/20"
76
+ "px-[2px]"
78
77
  ],
79
78
  wrapper: [
80
79
  "relative",