@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.
- package/dist/chunk-75HLCORR.mjs +1 -0
- package/dist/chunk-D5GGG7IO.mjs +122 -0
- package/dist/{chunk-FPCP4OOL.mjs → chunk-EDEV4IK4.mjs} +3 -3
- package/dist/chunk-FWJ2ZKH6.mjs +87 -0
- package/dist/chunk-HHYPMVLY.mjs +359 -0
- package/dist/{chunk-HFVZFUC3.mjs → chunk-L7P6OBUX.mjs} +1 -1
- package/dist/chunk-P732YGHO.mjs +18 -0
- package/dist/{chunk-MOINJECK.mjs → chunk-S3O52LLG.mjs} +1 -2
- package/dist/chunk-WX32MAKV.mjs +219 -0
- package/dist/components/accordion/accordion.d.mts +2 -2
- package/dist/components/accordion/accordion.d.ts +2 -2
- package/dist/components/accordion/accordion.test.mjs +3 -3
- package/dist/components/accordion/accordionItem.d.mts +2 -2
- package/dist/components/accordion/accordionItem.d.ts +2 -2
- 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.mjs +3 -3
- package/dist/components/button/button.d.mts +2 -2
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/button/button.test.mjs +3 -3
- package/dist/components/card/card.d.mts +2 -2
- package/dist/components/card/card.d.ts +2 -2
- package/dist/components/checkbox/checkbox.d.mts +2 -2
- package/dist/components/checkbox/checkbox.d.ts +2 -2
- package/dist/components/checkbox/checkbox.test.mjs +3 -3
- 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 +445 -0
- package/dist/components/dateTimePicker/dateTimePicker.d.ts +445 -0
- package/dist/components/dateTimePicker/dateTimePicker.js +4540 -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 +4541 -0
- package/dist/components/dateTimePicker/index.mjs +21 -0
- package/dist/components/dateTimePicker/timePicker.d.mts +11 -0
- package/dist/components/dateTimePicker/timePicker.d.ts +11 -0
- package/dist/components/dateTimePicker/timePicker.js +345 -0
- package/dist/components/dateTimePicker/timePicker.mjs +13 -0
- package/dist/components/dateTimePicker/useDateTimePicker.d.mts +34 -0
- package/dist/components/dateTimePicker/useDateTimePicker.d.ts +34 -0
- package/dist/components/dateTimePicker/useDateTimePicker.js +117 -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/input/input.d.mts +2 -2
- package/dist/components/input/input.d.ts +2 -2
- package/dist/components/input/input.test.mjs +1 -1
- package/dist/components/list/index.js +3 -3
- package/dist/components/list/index.mjs +1 -1
- package/dist/components/list/list.d.mts +2 -2
- package/dist/components/list/list.d.ts +2 -2
- package/dist/components/list/listItem.d.mts +3 -3
- package/dist/components/list/listItem.d.ts +3 -3
- package/dist/components/list/listItem.js +3 -3
- package/dist/components/list/listItem.mjs +1 -1
- package/dist/components/modal/index.js +1 -1
- package/dist/components/modal/index.mjs +1 -1
- package/dist/components/modal/modal.d.mts +2 -2
- package/dist/components/modal/modal.d.ts +2 -2
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/modal/modal.mjs +1 -1
- package/dist/components/modal/modal.test.js +1 -1
- package/dist/components/modal/modal.test.mjs +2 -2
- package/dist/components/pagination/pagination.d.mts +2 -2
- package/dist/components/pagination/pagination.d.ts +2 -2
- package/dist/components/progress/progress.d.mts +2 -2
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/radio/radio.d.mts +2 -2
- package/dist/components/radio/radio.d.ts +2 -2
- package/dist/components/select/select.d.mts +2 -2
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.test.mjs +3 -3
- package/dist/components/select/useSelect.d.mts +3 -3
- package/dist/components/select/useSelect.d.ts +3 -3
- package/dist/components/slider/slider.d.mts +2 -2
- package/dist/components/slider/slider.d.ts +2 -2
- package/dist/components/switch/index.js +1 -2
- package/dist/components/switch/index.mjs +1 -1
- package/dist/components/switch/switch.d.mts +2 -2
- package/dist/components/switch/switch.d.ts +2 -2
- package/dist/components/switch/switch.js +1 -2
- package/dist/components/switch/switch.mjs +1 -1
- package/dist/components/switch/switch.test.js +1 -2
- package/dist/components/switch/switch.test.mjs +1 -1
- 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.d.mts +5 -5
- package/dist/components/table/table.d.ts +5 -5
- package/dist/components/tabs/tabs.d.mts +2 -2
- package/dist/components/tabs/tabs.d.ts +2 -2
- package/dist/components/tabs/tabs.test.mjs +3 -3
- package/dist/components/textarea/textarea.d.mts +2 -2
- package/dist/components/textarea/textarea.d.ts +2 -2
- package/dist/components/textarea/textarea.test.mjs +1 -1
- package/dist/components/toast/toast.d.mts +2 -2
- package/dist/components/toast/toast.d.ts +2 -2
- 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.mjs +3 -3
- package/dist/components/tooltip/useTooltip.d.mts +1 -1
- package/dist/components/tooltip/useTooltip.d.ts +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +751 -6
- package/dist/index.mjs +62 -43
- 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/index.js
CHANGED
|
@@ -108,6 +108,7 @@ __export(src_exports, {
|
|
|
108
108
|
ButtonGroup: () => button_group_default,
|
|
109
109
|
Card: () => card_default,
|
|
110
110
|
CheckBox: () => checkbox_default,
|
|
111
|
+
DateTimePicker: () => dateTimePicker_default,
|
|
111
112
|
Icon: () => Icon_default,
|
|
112
113
|
Input: () => input_default,
|
|
113
114
|
List: () => list_default,
|
|
@@ -6317,8 +6318,7 @@ var toggle = (0, import_tailwind_variants12.tv)({
|
|
|
6317
6318
|
"bg-neutral-soft",
|
|
6318
6319
|
"overflow-hidden",
|
|
6319
6320
|
"rounded-full",
|
|
6320
|
-
"px-[2px]"
|
|
6321
|
-
"hover:bg-primary-main/20"
|
|
6321
|
+
"px-[2px]"
|
|
6322
6322
|
],
|
|
6323
6323
|
wrapper: [
|
|
6324
6324
|
"relative",
|
|
@@ -7276,7 +7276,7 @@ Modal.displayName = "Modal";
|
|
|
7276
7276
|
var modal_default = Modal;
|
|
7277
7277
|
var modal = tv({
|
|
7278
7278
|
slots: {
|
|
7279
|
-
backdrop: ["relative w-screen h-screen fixed inset-0 bg-black/60", "z-[
|
|
7279
|
+
backdrop: ["relative w-screen h-screen fixed inset-0 bg-black/60", "z-[900]"],
|
|
7280
7280
|
modalWrapper: ["group/modal", "absolute", "top-1/2", "-translate-y-1/2", "left-1/2", "-translate-x-1/2"],
|
|
7281
7281
|
icon: ["absolute", "top-[20px]", "left-1/2", "-translate-x-1/2", "z-10"],
|
|
7282
7282
|
closeIcon: [
|
|
@@ -7711,13 +7711,13 @@ var listItem = tv({
|
|
|
7711
7711
|
},
|
|
7712
7712
|
size: {
|
|
7713
7713
|
sm: {
|
|
7714
|
-
base: "h-[30px] text-sm"
|
|
7714
|
+
base: "min-h-[30px] text-sm"
|
|
7715
7715
|
},
|
|
7716
7716
|
md: {
|
|
7717
|
-
base: "h-[40px] text-md"
|
|
7717
|
+
base: "min-h-[40px] text-md"
|
|
7718
7718
|
},
|
|
7719
7719
|
lg: {
|
|
7720
|
-
base: "h-[50px] text-lg"
|
|
7720
|
+
base: "min-h-[50px] text-lg"
|
|
7721
7721
|
}
|
|
7722
7722
|
},
|
|
7723
7723
|
color: {
|
|
@@ -7974,6 +7974,740 @@ var ToastProvider = ({
|
|
|
7974
7974
|
] });
|
|
7975
7975
|
};
|
|
7976
7976
|
|
|
7977
|
+
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
7978
|
+
var import_react33 = __toESM(require("react"));
|
|
7979
|
+
var import_react_dom4 = require("react-dom");
|
|
7980
|
+
|
|
7981
|
+
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
7982
|
+
var import_react30 = require("react");
|
|
7983
|
+
|
|
7984
|
+
// src/components/dateTimePicker/util.ts
|
|
7985
|
+
var formatDateToString = (date) => {
|
|
7986
|
+
const year = date.getFullYear();
|
|
7987
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
7988
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
7989
|
+
return `${year}-${month}-${day}`;
|
|
7990
|
+
};
|
|
7991
|
+
var formatStringToDate = (date) => {
|
|
7992
|
+
const formattedDate = new Date(date);
|
|
7993
|
+
return formattedDate;
|
|
7994
|
+
};
|
|
7995
|
+
|
|
7996
|
+
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
7997
|
+
var useDatePicker = ({ initialDate, initialTime }) => {
|
|
7998
|
+
const [selectedDate, setSelectedDate] = (0, import_react30.useState)(
|
|
7999
|
+
initialDate ? formatDateToString(initialDate) : ""
|
|
8000
|
+
);
|
|
8001
|
+
const [selectedTime, setSelectedTime] = (0, import_react30.useState)(initialTime ? initialTime : "");
|
|
8002
|
+
const [targetRect, setTargetRect] = (0, import_react30.useState)(null);
|
|
8003
|
+
const [popupWidth, setPopupWidth] = (0, import_react30.useState)(0);
|
|
8004
|
+
const [popupHeight, setPopupHeight] = (0, import_react30.useState)(0);
|
|
8005
|
+
const [isFocusInput, setIsFocusInput] = (0, import_react30.useState)(false);
|
|
8006
|
+
const dateInputRef = (0, import_react30.useRef)(null);
|
|
8007
|
+
const datePickerWrapperRef = (0, import_react30.useRef)(null);
|
|
8008
|
+
const datePickerRef = (0, import_react30.useRef)(null);
|
|
8009
|
+
const DATE_PICKER_GAP = 4;
|
|
8010
|
+
const calculatePositionWithScroll = (targetRect2) => {
|
|
8011
|
+
if (targetRect2 && popupWidth && popupHeight) {
|
|
8012
|
+
const scrollTop = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
|
|
8013
|
+
const scrollLeft = window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
8014
|
+
const spaceBelow = window.innerHeight - (targetRect2.y + targetRect2.height + DATE_PICKER_GAP);
|
|
8015
|
+
const spaceAbove = targetRect2.y - DATE_PICKER_GAP;
|
|
8016
|
+
const top = spaceBelow < popupHeight && spaceAbove > popupHeight ? targetRect2.y - popupHeight - DATE_PICKER_GAP : targetRect2.y + targetRect2.height + DATE_PICKER_GAP;
|
|
8017
|
+
return {
|
|
8018
|
+
top: top + scrollTop,
|
|
8019
|
+
left: targetRect2.x + targetRect2.width - popupWidth + scrollLeft
|
|
8020
|
+
};
|
|
8021
|
+
}
|
|
8022
|
+
};
|
|
8023
|
+
const handleToggleDatePicker = () => {
|
|
8024
|
+
if (datePickerRef.current) {
|
|
8025
|
+
const rect = datePickerRef.current.getBoundingClientRect();
|
|
8026
|
+
setTargetRect((prevRect) => prevRect ? null : { x: rect.x, y: rect.y, width: rect.width, height: rect.height });
|
|
8027
|
+
}
|
|
8028
|
+
};
|
|
8029
|
+
const handleChangeDate = (date) => {
|
|
8030
|
+
setSelectedDate(date);
|
|
8031
|
+
};
|
|
8032
|
+
const handleChangeTime = (time) => {
|
|
8033
|
+
setSelectedTime(time);
|
|
8034
|
+
};
|
|
8035
|
+
const handleFocusInput = () => {
|
|
8036
|
+
setIsFocusInput(true);
|
|
8037
|
+
};
|
|
8038
|
+
const handleBlueInput = () => {
|
|
8039
|
+
setIsFocusInput(false);
|
|
8040
|
+
};
|
|
8041
|
+
(0, import_react30.useEffect)(() => {
|
|
8042
|
+
const onClickOutside = (e) => {
|
|
8043
|
+
if (datePickerRef.current && !datePickerRef.current.contains(e.target) && datePickerWrapperRef.current && !datePickerWrapperRef.current.contains(e.target)) {
|
|
8044
|
+
setTargetRect(null);
|
|
8045
|
+
}
|
|
8046
|
+
};
|
|
8047
|
+
window.addEventListener("mousedown", onClickOutside);
|
|
8048
|
+
return () => window.removeEventListener("mousedown", onClickOutside);
|
|
8049
|
+
}, []);
|
|
8050
|
+
(0, import_react30.useEffect)(() => {
|
|
8051
|
+
if (datePickerWrapperRef.current) {
|
|
8052
|
+
setPopupHeight(datePickerWrapperRef.current.getBoundingClientRect().height);
|
|
8053
|
+
setPopupWidth(datePickerWrapperRef.current.getBoundingClientRect().width);
|
|
8054
|
+
}
|
|
8055
|
+
}, [targetRect]);
|
|
8056
|
+
return {
|
|
8057
|
+
selectedDate,
|
|
8058
|
+
selectedTime,
|
|
8059
|
+
targetRect,
|
|
8060
|
+
popupHeight,
|
|
8061
|
+
isFocusInput,
|
|
8062
|
+
dateInputRef,
|
|
8063
|
+
datePickerWrapperRef,
|
|
8064
|
+
datePickerRef,
|
|
8065
|
+
handleToggleDatePicker,
|
|
8066
|
+
handleChangeDate,
|
|
8067
|
+
handleChangeTime,
|
|
8068
|
+
handleFocusInput,
|
|
8069
|
+
handleBlueInput,
|
|
8070
|
+
calculatePositionWithScroll
|
|
8071
|
+
};
|
|
8072
|
+
};
|
|
8073
|
+
|
|
8074
|
+
// src/components/dateTimePicker/calendar.tsx
|
|
8075
|
+
var import_react31 = __toESM(require("react"));
|
|
8076
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
8077
|
+
var Calendar = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
8078
|
+
const [props, variantProps] = mapPropsVariants(originalProps, calendarStyle.variantKeys);
|
|
8079
|
+
const { selectedDate, classNames, highlightWeekend = true, onChangeDate, ...inputProps } = props;
|
|
8080
|
+
const [currentDate, setCurrentDate] = (0, import_react31.useState)(selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date());
|
|
8081
|
+
const daysOfWeek = ["S", "M", "T", "W", "T", "F", "S"];
|
|
8082
|
+
(0, import_react31.useEffect)(() => {
|
|
8083
|
+
if (selectedDate) {
|
|
8084
|
+
setCurrentDate(new Date(selectedDate));
|
|
8085
|
+
}
|
|
8086
|
+
}, [selectedDate]);
|
|
8087
|
+
const getCalendarDates = (0, import_react31.useCallback)(() => {
|
|
8088
|
+
const year = currentDate.getFullYear();
|
|
8089
|
+
const month = currentDate.getMonth();
|
|
8090
|
+
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
8091
|
+
const lastDateOfMonth = new Date(year, month + 1, 0).getDate();
|
|
8092
|
+
const lastDateOfPrevMonth = new Date(year, month, 0).getDate();
|
|
8093
|
+
let dates = [];
|
|
8094
|
+
for (let i = firstDayOfMonth - 1; i >= 0; i--) {
|
|
8095
|
+
dates.push({
|
|
8096
|
+
date: lastDateOfPrevMonth - i,
|
|
8097
|
+
currentMonth: false
|
|
8098
|
+
});
|
|
8099
|
+
}
|
|
8100
|
+
for (let date = 1; date <= lastDateOfMonth; date++) {
|
|
8101
|
+
dates.push({
|
|
8102
|
+
date,
|
|
8103
|
+
currentMonth: true
|
|
8104
|
+
});
|
|
8105
|
+
}
|
|
8106
|
+
const remainingDays = 42 - dates.length;
|
|
8107
|
+
for (let i = 1; i <= remainingDays; i++) {
|
|
8108
|
+
dates.push({
|
|
8109
|
+
date: i,
|
|
8110
|
+
currentMonth: false
|
|
8111
|
+
});
|
|
8112
|
+
}
|
|
8113
|
+
const weeks = [];
|
|
8114
|
+
for (let i = 0; i < dates.length; i += 7) {
|
|
8115
|
+
weeks.push(dates.slice(i, i + 7));
|
|
8116
|
+
}
|
|
8117
|
+
return weeks;
|
|
8118
|
+
}, [currentDate]);
|
|
8119
|
+
const handlePrevMonth = () => {
|
|
8120
|
+
setCurrentDate(new Date(currentDate.getFullYear(), currentDate.getMonth() - 1));
|
|
8121
|
+
};
|
|
8122
|
+
const handleNextMonth = () => {
|
|
8123
|
+
setCurrentDate(new Date(currentDate.getFullYear(), currentDate.getMonth() + 1));
|
|
8124
|
+
};
|
|
8125
|
+
const handleDateSelect = (date, isCurrentMonth) => {
|
|
8126
|
+
if (!isCurrentMonth) return;
|
|
8127
|
+
if (onChangeDate) {
|
|
8128
|
+
const selected = new Date(currentDate.getFullYear(), currentDate.getMonth(), date);
|
|
8129
|
+
const formatted = formatDateToString(selected);
|
|
8130
|
+
onChangeDate(formatted);
|
|
8131
|
+
}
|
|
8132
|
+
};
|
|
8133
|
+
(0, import_react31.useImperativeHandle)(ref, () => ({
|
|
8134
|
+
getSelectedDate: () => selectedDate
|
|
8135
|
+
}));
|
|
8136
|
+
const slots = (0, import_react31.useMemo)(() => calendarStyle({ ...variantProps }), [variantProps]);
|
|
8137
|
+
const getBaseProps = (0, import_react31.useCallback)(
|
|
8138
|
+
() => ({
|
|
8139
|
+
className: `${slots.base({ class: classNames == null ? void 0 : classNames.base })}`
|
|
8140
|
+
}),
|
|
8141
|
+
[slots, classNames]
|
|
8142
|
+
);
|
|
8143
|
+
const getDateTitleProps = (0, import_react31.useCallback)(
|
|
8144
|
+
(index) => {
|
|
8145
|
+
return {
|
|
8146
|
+
className: `${slots.dateTitle({
|
|
8147
|
+
class: classNames == null ? void 0 : classNames.date
|
|
8148
|
+
})}`,
|
|
8149
|
+
"data-saturday": highlightWeekend && index === 6,
|
|
8150
|
+
"data-sunday": highlightWeekend && index === 0
|
|
8151
|
+
};
|
|
8152
|
+
},
|
|
8153
|
+
[slots, classNames, highlightWeekend]
|
|
8154
|
+
);
|
|
8155
|
+
const getDateProps = (0, import_react31.useCallback)(
|
|
8156
|
+
(dateObj) => {
|
|
8157
|
+
const today = /* @__PURE__ */ new Date();
|
|
8158
|
+
const isToday = today.getDate() === dateObj.date && today.getMonth() === currentDate.getMonth() && today.getFullYear() === currentDate.getFullYear();
|
|
8159
|
+
const formatted = selectedDate ? formatStringToDate(selectedDate) : "";
|
|
8160
|
+
const isSelected = formatted ? formatted.getDate() === dateObj.date && formatted.getMonth() === currentDate.getMonth() && formatted.getFullYear() === currentDate.getFullYear() : false;
|
|
8161
|
+
const dayOfWeek = new Date(currentDate.getFullYear(), currentDate.getMonth(), dateObj.date).getDay();
|
|
8162
|
+
return {
|
|
8163
|
+
className: `${slots.date({
|
|
8164
|
+
class: classNames == null ? void 0 : classNames.date
|
|
8165
|
+
})}`,
|
|
8166
|
+
"data-today": dateObj.currentMonth && isToday,
|
|
8167
|
+
"data-selected": dateObj.currentMonth && isSelected,
|
|
8168
|
+
"data-disabled": !dateObj.currentMonth,
|
|
8169
|
+
"data-saturday": highlightWeekend && dayOfWeek === 6,
|
|
8170
|
+
"data-sunday": highlightWeekend && dayOfWeek === 0,
|
|
8171
|
+
onClick: () => handleDateSelect(dateObj.date, dateObj.currentMonth)
|
|
8172
|
+
};
|
|
8173
|
+
},
|
|
8174
|
+
[slots, classNames, selectedDate, currentDate, highlightWeekend]
|
|
8175
|
+
);
|
|
8176
|
+
const calendarDates = getCalendarDates();
|
|
8177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { ...getBaseProps(), children: [
|
|
8178
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "calendar-header flex justify-between items-center mb-4", children: [
|
|
8179
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: "brace-left", size: "md", className: "cursor-pointer", onClick: handlePrevMonth }),
|
|
8180
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-h6 font-semibold", children: currentDate.toLocaleString("default", { year: "numeric", month: "2-digit" }) }),
|
|
8181
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: "brace-right", size: "md", className: "cursor-pointer", onClick: handleNextMonth })
|
|
8182
|
+
] }),
|
|
8183
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7 gap-2 text-center", children: daysOfWeek.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { ...getDateTitleProps(index), children: day }, `${day}-${index}`)) }),
|
|
8184
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-7 gap-[5px] text-center mt-2", children: calendarDates.map((week, weekIndex) => {
|
|
8185
|
+
const hasCurrentMonthDates = week.some((dateObj) => dateObj.currentMonth);
|
|
8186
|
+
if (!hasCurrentMonthDates) return null;
|
|
8187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react31.default.Fragment, { children: week.map((dateObj, index) => {
|
|
8188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { ...getDateProps(dateObj), children: dateObj.date }, index);
|
|
8189
|
+
}) }, weekIndex);
|
|
8190
|
+
}) })
|
|
8191
|
+
] }) });
|
|
8192
|
+
});
|
|
8193
|
+
Calendar.displayName = "Calendar";
|
|
8194
|
+
var calendar_default = Calendar;
|
|
8195
|
+
var calendarStyle = tv({
|
|
8196
|
+
slots: {
|
|
8197
|
+
base: [
|
|
8198
|
+
"flex",
|
|
8199
|
+
"flex-col",
|
|
8200
|
+
"w-[240px]",
|
|
8201
|
+
"border",
|
|
8202
|
+
"border-neutral-main",
|
|
8203
|
+
"bg-background",
|
|
8204
|
+
"rounded-md",
|
|
8205
|
+
"p-4",
|
|
8206
|
+
"shadow-lg",
|
|
8207
|
+
"select-none"
|
|
8208
|
+
],
|
|
8209
|
+
dateTitle: ["text-sm", "font-[500]", "data-[saturday=true]:text-[#1E7EEE]", "data-[sunday=true]:text-[#FF4684]"],
|
|
8210
|
+
date: [
|
|
8211
|
+
"flex",
|
|
8212
|
+
"justify-center",
|
|
8213
|
+
"items-center",
|
|
8214
|
+
"h-[25px]",
|
|
8215
|
+
"text-sm",
|
|
8216
|
+
"rounded-full",
|
|
8217
|
+
"cursor-pointer",
|
|
8218
|
+
"data-[today=true]:border",
|
|
8219
|
+
"data-[today=true]:border-foreground",
|
|
8220
|
+
"data-[saturday=true]:text-[#1E7EEE]",
|
|
8221
|
+
"data-[saturday=true]:!border-[#1E7EEE]",
|
|
8222
|
+
"data-[sunday=true]:text-[#FF4684]",
|
|
8223
|
+
"data-[sunday=true]:!border-[#FF4684]",
|
|
8224
|
+
"data-[selected=true]:!text-white",
|
|
8225
|
+
"data-[selected=true]:border-none",
|
|
8226
|
+
"data-[disabled=true]:!text-neutral-main",
|
|
8227
|
+
"data-[disabled=true]:cursor-default",
|
|
8228
|
+
"data-[disabled=true]:hover:bg-transparent"
|
|
8229
|
+
]
|
|
8230
|
+
},
|
|
8231
|
+
variants: {
|
|
8232
|
+
variant: {
|
|
8233
|
+
solid: {}
|
|
8234
|
+
},
|
|
8235
|
+
color: {
|
|
8236
|
+
primary: {
|
|
8237
|
+
date: [
|
|
8238
|
+
"hover:text-primary-main",
|
|
8239
|
+
"hover:bg-primary-soft",
|
|
8240
|
+
"data-[selected=true]:!border-primary-main",
|
|
8241
|
+
"data-[selected=true]:bg-primary-main"
|
|
8242
|
+
]
|
|
8243
|
+
},
|
|
8244
|
+
secondary: {
|
|
8245
|
+
date: [
|
|
8246
|
+
"hover:text-secondary-main",
|
|
8247
|
+
"hover:bg-secondary-soft",
|
|
8248
|
+
"data-[selected=true]:!border-secondary-main",
|
|
8249
|
+
"data-[selected=true]:bg-secondary-main"
|
|
8250
|
+
]
|
|
8251
|
+
}
|
|
8252
|
+
}
|
|
8253
|
+
},
|
|
8254
|
+
defaultVariants: {
|
|
8255
|
+
variant: "solid",
|
|
8256
|
+
color: "primary"
|
|
8257
|
+
},
|
|
8258
|
+
compoundVariants: [
|
|
8259
|
+
{
|
|
8260
|
+
isDisabled: true,
|
|
8261
|
+
isRequired: true,
|
|
8262
|
+
class: {}
|
|
8263
|
+
}
|
|
8264
|
+
]
|
|
8265
|
+
});
|
|
8266
|
+
|
|
8267
|
+
// src/components/dateTimePicker/timePicker.tsx
|
|
8268
|
+
var import_react32 = require("react");
|
|
8269
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
8270
|
+
var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime }) => {
|
|
8271
|
+
const TOTAL_HOURS = 12;
|
|
8272
|
+
const TOTAL_MINUTES = 60;
|
|
8273
|
+
const ITEM_HEIGHT = 30;
|
|
8274
|
+
const PERIODS = ["AM", "PM"];
|
|
8275
|
+
const [selectedHour, setSelectedHour] = (0, import_react32.useState)("01");
|
|
8276
|
+
const [selectedMinute, setSelectedMinute] = (0, import_react32.useState)("00");
|
|
8277
|
+
const [selectedPeriod, setSelectedPeriod] = (0, import_react32.useState)("AM");
|
|
8278
|
+
const hourRef = (0, import_react32.useRef)(null);
|
|
8279
|
+
const minuteRef = (0, import_react32.useRef)(null);
|
|
8280
|
+
const periodRef = (0, import_react32.useRef)(null);
|
|
8281
|
+
const hoursArray = [...Array(TOTAL_HOURS).keys()].map((i) => (i + 1).toString().padStart(2, "0"));
|
|
8282
|
+
const minutesArray = [...Array(TOTAL_MINUTES).keys()].map((i) => i.toString().padStart(2, "0"));
|
|
8283
|
+
(0, import_react32.useEffect)(() => {
|
|
8284
|
+
if (selectedTime) {
|
|
8285
|
+
const { formattedHour, minute, period } = parseAndFormatTime(selectedTime);
|
|
8286
|
+
setSelectedHour(formattedHour);
|
|
8287
|
+
setSelectedMinute(minute);
|
|
8288
|
+
setSelectedPeriod(period);
|
|
8289
|
+
}
|
|
8290
|
+
if (isFocusInput) {
|
|
8291
|
+
scrollToSelectedTime();
|
|
8292
|
+
}
|
|
8293
|
+
}, [selectedTime, isFocusInput]);
|
|
8294
|
+
(0, import_react32.useEffect)(() => {
|
|
8295
|
+
scrollToSelectedTime();
|
|
8296
|
+
}, []);
|
|
8297
|
+
const parseAndFormatTime = (time) => {
|
|
8298
|
+
const [hour, minute] = time.split(":").map((part) => part.padStart(2, "0"));
|
|
8299
|
+
const parsedHour = parseInt(hour, 10);
|
|
8300
|
+
const period = parsedHour >= 12 ? "PM" : "AM";
|
|
8301
|
+
const formattedHour = parsedHour % 12 === 0 ? "12" : (parsedHour % 12).toString().padStart(2, "0");
|
|
8302
|
+
return { formattedHour, minute, period };
|
|
8303
|
+
};
|
|
8304
|
+
const scrollToSelectedTime = () => {
|
|
8305
|
+
if (selectedTime) {
|
|
8306
|
+
const { formattedHour, minute, period } = parseAndFormatTime(selectedTime);
|
|
8307
|
+
if (hourRef.current) {
|
|
8308
|
+
hourRef.current.scrollTop = (parseInt(formattedHour) - 1) * ITEM_HEIGHT;
|
|
8309
|
+
}
|
|
8310
|
+
if (minuteRef.current) {
|
|
8311
|
+
minuteRef.current.scrollTop = parseInt(minute) * ITEM_HEIGHT;
|
|
8312
|
+
}
|
|
8313
|
+
if (periodRef.current) {
|
|
8314
|
+
periodRef.current.scrollTop = period === "AM" ? 0 : ITEM_HEIGHT;
|
|
8315
|
+
}
|
|
8316
|
+
}
|
|
8317
|
+
};
|
|
8318
|
+
const handleTimeChange = (hour, minute, period) => {
|
|
8319
|
+
const parsedHour = parseInt(hour);
|
|
8320
|
+
let hour24 = parsedHour;
|
|
8321
|
+
if (period === "PM" && parsedHour !== 12) {
|
|
8322
|
+
hour24 = parsedHour + 12;
|
|
8323
|
+
} else if (period === "AM" && parsedHour === 12) {
|
|
8324
|
+
hour24 = 0;
|
|
8325
|
+
}
|
|
8326
|
+
const formattedTime = `${hour24.toString().padStart(2, "0")}:${minute}`;
|
|
8327
|
+
if (onChangeTime) {
|
|
8328
|
+
onChangeTime(formattedTime);
|
|
8329
|
+
}
|
|
8330
|
+
};
|
|
8331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex h-[200px] p-[10px] gap-[5px] border border-neutral-main rounded-md bg-background shadow-lg", children: [
|
|
8332
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(list_default, { ref: periodRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: PERIODS.map((period, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
8333
|
+
listItem_default,
|
|
8334
|
+
{
|
|
8335
|
+
color,
|
|
8336
|
+
selected: period === selectedPeriod,
|
|
8337
|
+
title: period,
|
|
8338
|
+
size: "sm",
|
|
8339
|
+
classNames: { base: "w-[50px] min-h-[30px]", titleWrapper: "flex justify-center" },
|
|
8340
|
+
onClick: () => {
|
|
8341
|
+
handleTimeChange(selectedHour, selectedMinute, period);
|
|
8342
|
+
}
|
|
8343
|
+
},
|
|
8344
|
+
`${period}-${index}`
|
|
8345
|
+
)) }),
|
|
8346
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(list_default, { ref: hourRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: hoursArray.map((hour, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
8347
|
+
listItem_default,
|
|
8348
|
+
{
|
|
8349
|
+
color,
|
|
8350
|
+
selected: hour === selectedHour,
|
|
8351
|
+
title: hour,
|
|
8352
|
+
size: "sm",
|
|
8353
|
+
classNames: { base: "w-[50px] min-h-[30px]", titleWrapper: "flex justify-center" },
|
|
8354
|
+
onClick: () => {
|
|
8355
|
+
handleTimeChange(hour, selectedMinute, selectedPeriod);
|
|
8356
|
+
}
|
|
8357
|
+
},
|
|
8358
|
+
`${hour}-${index}`
|
|
8359
|
+
)) }),
|
|
8360
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(list_default, { ref: minuteRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: minutesArray.map((minute, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
8361
|
+
listItem_default,
|
|
8362
|
+
{
|
|
8363
|
+
color,
|
|
8364
|
+
selected: minute === selectedMinute,
|
|
8365
|
+
title: minute,
|
|
8366
|
+
size: "sm",
|
|
8367
|
+
classNames: { base: "w-[50px] min-h-[30px]", titleWrapper: "flex justify-center" },
|
|
8368
|
+
onClick: () => {
|
|
8369
|
+
handleTimeChange(selectedHour, minute, selectedPeriod);
|
|
8370
|
+
}
|
|
8371
|
+
},
|
|
8372
|
+
`${minute}-${index}`
|
|
8373
|
+
)) })
|
|
8374
|
+
] });
|
|
8375
|
+
};
|
|
8376
|
+
var timePicker_default = TimePicker;
|
|
8377
|
+
|
|
8378
|
+
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
8379
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
8380
|
+
var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
8381
|
+
const [props, variantProps] = mapPropsVariants(originalProps, dateTimePickerStyle.variantKeys);
|
|
8382
|
+
const {
|
|
8383
|
+
classNames,
|
|
8384
|
+
label,
|
|
8385
|
+
errorMessage,
|
|
8386
|
+
startContent,
|
|
8387
|
+
endContent,
|
|
8388
|
+
type = "date",
|
|
8389
|
+
value,
|
|
8390
|
+
onChangeDate,
|
|
8391
|
+
onChangeTime,
|
|
8392
|
+
...inputProps
|
|
8393
|
+
} = props;
|
|
8394
|
+
const slots = (0, import_react33.useMemo)(() => dateTimePickerStyle({ ...variantProps }), [variantProps]);
|
|
8395
|
+
const {
|
|
8396
|
+
selectedDate,
|
|
8397
|
+
selectedTime,
|
|
8398
|
+
targetRect,
|
|
8399
|
+
popupHeight,
|
|
8400
|
+
isFocusInput,
|
|
8401
|
+
datePickerRef,
|
|
8402
|
+
dateInputRef,
|
|
8403
|
+
datePickerWrapperRef,
|
|
8404
|
+
handleToggleDatePicker,
|
|
8405
|
+
handleChangeDate,
|
|
8406
|
+
handleChangeTime,
|
|
8407
|
+
handleFocusInput,
|
|
8408
|
+
handleBlueInput,
|
|
8409
|
+
calculatePositionWithScroll
|
|
8410
|
+
} = useDatePicker({
|
|
8411
|
+
initialDate: void 0
|
|
8412
|
+
});
|
|
8413
|
+
const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
|
|
8414
|
+
const getBaseProps = (0, import_react33.useCallback)(
|
|
8415
|
+
() => ({
|
|
8416
|
+
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
8417
|
+
}),
|
|
8418
|
+
[slots, classNames]
|
|
8419
|
+
);
|
|
8420
|
+
const getLabelProps = (0, import_react33.useCallback)(
|
|
8421
|
+
() => ({
|
|
8422
|
+
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
8423
|
+
}),
|
|
8424
|
+
[slots, classNames]
|
|
8425
|
+
);
|
|
8426
|
+
const getInnerWrapperProps = (0, import_react33.useCallback)(
|
|
8427
|
+
() => ({
|
|
8428
|
+
className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
|
|
8429
|
+
}),
|
|
8430
|
+
[slots, classNames]
|
|
8431
|
+
);
|
|
8432
|
+
const getInputWrapperProps = (0, import_react33.useCallback)(
|
|
8433
|
+
() => ({
|
|
8434
|
+
className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
8435
|
+
ref: datePickerRef
|
|
8436
|
+
}),
|
|
8437
|
+
[slots, classNames]
|
|
8438
|
+
);
|
|
8439
|
+
const getInputProps = (0, import_react33.useCallback)(
|
|
8440
|
+
() => ({
|
|
8441
|
+
...inputProps,
|
|
8442
|
+
ref: ref || dateInputRef,
|
|
8443
|
+
className: slots.input({ class: classNames == null ? void 0 : classNames.input }),
|
|
8444
|
+
size: 0,
|
|
8445
|
+
type,
|
|
8446
|
+
value: value !== void 0 ? value : type === "date" ? selectedDate || "" : type === "time" ? selectedTime || "" : "",
|
|
8447
|
+
onChange: (e) => {
|
|
8448
|
+
if (type === "date") {
|
|
8449
|
+
handleChangeDate(e.target.value);
|
|
8450
|
+
if (onChangeDate) {
|
|
8451
|
+
onChangeDate(e.target.value);
|
|
8452
|
+
}
|
|
8453
|
+
} else if (type === "time") {
|
|
8454
|
+
handleChangeTime(e.target.value);
|
|
8455
|
+
if (onChangeTime) {
|
|
8456
|
+
onChangeTime(e.target.value);
|
|
8457
|
+
}
|
|
8458
|
+
}
|
|
8459
|
+
},
|
|
8460
|
+
onFocus: (e) => {
|
|
8461
|
+
handleFocusInput();
|
|
8462
|
+
},
|
|
8463
|
+
onBlur: (e) => {
|
|
8464
|
+
handleBlueInput();
|
|
8465
|
+
},
|
|
8466
|
+
max: "9999-12-31"
|
|
8467
|
+
}),
|
|
8468
|
+
[inputProps, ref, dateInputRef, slots, classNames == null ? void 0 : classNames.input, selectedDate, selectedTime, type, value]
|
|
8469
|
+
);
|
|
8470
|
+
const getContentProps = (0, import_react33.useCallback)(
|
|
8471
|
+
() => ({
|
|
8472
|
+
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
8473
|
+
size: originalProps.size
|
|
8474
|
+
}),
|
|
8475
|
+
[slots, classNames, originalProps.size]
|
|
8476
|
+
);
|
|
8477
|
+
const getErrorMessageProps = (0, import_react33.useCallback)(
|
|
8478
|
+
() => ({
|
|
8479
|
+
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
8480
|
+
}),
|
|
8481
|
+
[slots, classNames]
|
|
8482
|
+
);
|
|
8483
|
+
const renderStartContent = () => {
|
|
8484
|
+
if (import_react33.default.isValidElement(startContent)) {
|
|
8485
|
+
const existingProps = startContent.props;
|
|
8486
|
+
const mergedProps = {
|
|
8487
|
+
...getContentProps(),
|
|
8488
|
+
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
8489
|
+
};
|
|
8490
|
+
return import_react33.default.cloneElement(startContent, mergedProps);
|
|
8491
|
+
} else {
|
|
8492
|
+
const contentProps = getContentProps();
|
|
8493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ...contentProps, children: startContent });
|
|
8494
|
+
}
|
|
8495
|
+
};
|
|
8496
|
+
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ...getContentProps(), onClick: handleToggleDatePicker, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
8497
|
+
Icon_default,
|
|
8498
|
+
{
|
|
8499
|
+
name: type === "time" ? "clock" : "calendar",
|
|
8500
|
+
size: originalProps.size,
|
|
8501
|
+
className: "cursor-pointer",
|
|
8502
|
+
fill: type === "date"
|
|
8503
|
+
}
|
|
8504
|
+
) });
|
|
8505
|
+
const renderContentWithIcon = () => {
|
|
8506
|
+
if (import_react33.default.isValidElement(endContent)) {
|
|
8507
|
+
const existingProps = endContent.props;
|
|
8508
|
+
const mergedProps = {
|
|
8509
|
+
...getContentProps(),
|
|
8510
|
+
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
8511
|
+
};
|
|
8512
|
+
return import_react33.default.cloneElement(endContent, mergedProps);
|
|
8513
|
+
} else if (errorMessage) {
|
|
8514
|
+
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
8515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ...iconProps, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|
|
8516
|
+
} else {
|
|
8517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, {});
|
|
8518
|
+
}
|
|
8519
|
+
};
|
|
8520
|
+
const renderEndContent = () => {
|
|
8521
|
+
switch (type) {
|
|
8522
|
+
case "date":
|
|
8523
|
+
case "datetime-local":
|
|
8524
|
+
case "month":
|
|
8525
|
+
case "week":
|
|
8526
|
+
case "time":
|
|
8527
|
+
return renderDateTimePickerIcon();
|
|
8528
|
+
default:
|
|
8529
|
+
return renderContentWithIcon();
|
|
8530
|
+
}
|
|
8531
|
+
};
|
|
8532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
8533
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { ...getBaseProps(), children: [
|
|
8534
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { ...getLabelProps(), children: label }),
|
|
8535
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { ...getInnerWrapperProps(), children: [
|
|
8536
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { ...getInputWrapperProps(), children: [
|
|
8537
|
+
startContent && renderStartContent(),
|
|
8538
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("input", { ...getInputProps() }),
|
|
8539
|
+
renderEndContent()
|
|
8540
|
+
] }),
|
|
8541
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { ...getErrorMessageProps(), children: errorMessage })
|
|
8542
|
+
] })
|
|
8543
|
+
] }),
|
|
8544
|
+
targetRect && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children: (0, import_react_dom4.createPortal)(
|
|
8545
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
8546
|
+
"div",
|
|
8547
|
+
{
|
|
8548
|
+
ref: datePickerWrapperRef,
|
|
8549
|
+
style: {
|
|
8550
|
+
position: "absolute",
|
|
8551
|
+
top: (position == null ? void 0 : position.top) || -99999,
|
|
8552
|
+
left: (position == null ? void 0 : position.left) || -99999,
|
|
8553
|
+
zIndex: 1e3
|
|
8554
|
+
},
|
|
8555
|
+
children: [
|
|
8556
|
+
type === "date" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
8557
|
+
calendar_default,
|
|
8558
|
+
{
|
|
8559
|
+
color: originalProps.color,
|
|
8560
|
+
selectedDate,
|
|
8561
|
+
highlightWeekend: originalProps.highlightWeekend,
|
|
8562
|
+
onChangeDate: (date) => {
|
|
8563
|
+
handleChangeDate(date);
|
|
8564
|
+
if (onChangeDate) onChangeDate(date);
|
|
8565
|
+
}
|
|
8566
|
+
}
|
|
8567
|
+
),
|
|
8568
|
+
type === "time" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
8569
|
+
timePicker_default,
|
|
8570
|
+
{
|
|
8571
|
+
color: originalProps.color,
|
|
8572
|
+
selectedTime,
|
|
8573
|
+
isFocusInput,
|
|
8574
|
+
onChangeTime: (time) => {
|
|
8575
|
+
handleChangeTime(time);
|
|
8576
|
+
if (onChangeTime) onChangeTime(time);
|
|
8577
|
+
}
|
|
8578
|
+
}
|
|
8579
|
+
)
|
|
8580
|
+
]
|
|
8581
|
+
}
|
|
8582
|
+
),
|
|
8583
|
+
document.body
|
|
8584
|
+
) })
|
|
8585
|
+
] });
|
|
8586
|
+
});
|
|
8587
|
+
DatePicker.displayName = "DatePicker";
|
|
8588
|
+
var dateTimePicker_default = DatePicker;
|
|
8589
|
+
var dateTimePickerStyle = tv({
|
|
8590
|
+
slots: {
|
|
8591
|
+
base: ["group/input", "flex", "flex-col", "inline-block"],
|
|
8592
|
+
label: ["flex", "items-center"],
|
|
8593
|
+
innerWrapper: ["flex", "flex-col"],
|
|
8594
|
+
inputWrapper: [
|
|
8595
|
+
"flex",
|
|
8596
|
+
"items-center",
|
|
8597
|
+
"transition",
|
|
8598
|
+
"duration-200",
|
|
8599
|
+
"group-has-[p]/input:border-danger-main",
|
|
8600
|
+
"group-has-[p]/input:bg-danger-soft"
|
|
8601
|
+
],
|
|
8602
|
+
input: ["w-full", "h-full", "bg-transparent", "placeholder:text-neutral-main", "focus-visible:outline-none"],
|
|
8603
|
+
content: ["flex", "items-center", "select-none", "group-has-[p]/input:text-danger-main"],
|
|
8604
|
+
errorMessage: ["text-danger-main"]
|
|
8605
|
+
},
|
|
8606
|
+
variants: {
|
|
8607
|
+
variant: {
|
|
8608
|
+
solid: {
|
|
8609
|
+
inputWrapper: ["bg-trans-soft", "hover:bg-trans-light", "has-[:focus]:bg-trans-light"]
|
|
8610
|
+
},
|
|
8611
|
+
normal: {
|
|
8612
|
+
inputWrapper: [
|
|
8613
|
+
"bg-transparent",
|
|
8614
|
+
"border",
|
|
8615
|
+
"border-neutral-main",
|
|
8616
|
+
"hover:bg-trans-soft",
|
|
8617
|
+
"has-[:focus]:bg-trans-soft"
|
|
8618
|
+
]
|
|
8619
|
+
},
|
|
8620
|
+
line: {
|
|
8621
|
+
inputWrapper: [
|
|
8622
|
+
"bg-transparent",
|
|
8623
|
+
"border-b",
|
|
8624
|
+
"border-neutral-main",
|
|
8625
|
+
"!rounded-none",
|
|
8626
|
+
"hover:bg-trans-soft",
|
|
8627
|
+
"has-[:focus]:bg-trans-soft"
|
|
8628
|
+
]
|
|
8629
|
+
}
|
|
8630
|
+
},
|
|
8631
|
+
color: {
|
|
8632
|
+
primary: {
|
|
8633
|
+
inputWrapper: ["has-[:focus]:border-primary-main"],
|
|
8634
|
+
content: ["text-primary-main"]
|
|
8635
|
+
},
|
|
8636
|
+
secondary: {
|
|
8637
|
+
inputWrapper: ["has-[:focus]:border-secondary-main"],
|
|
8638
|
+
content: ["text-secondary-main"]
|
|
8639
|
+
}
|
|
8640
|
+
},
|
|
8641
|
+
size: {
|
|
8642
|
+
sm: {
|
|
8643
|
+
base: ["text-sm", "gap-[6px]"],
|
|
8644
|
+
innerWrapper: ["group-has-[p]/input:gap-[6px]"],
|
|
8645
|
+
inputWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[6px]", "py-[4.5px]", "gap-[6px]"],
|
|
8646
|
+
errorMessage: ["text-sm"]
|
|
8647
|
+
},
|
|
8648
|
+
md: {
|
|
8649
|
+
base: ["text-md", "gap-[8px]"],
|
|
8650
|
+
innerWrapper: ["group-has-[p]/input:gap-[8px]"],
|
|
8651
|
+
inputWrapper: ["w-[240px]", "h-[30px]", "rounded-md", "px-[8px]", "py-[6.5px]", "gap-[8px]"],
|
|
8652
|
+
errorMessage: ["text-md"]
|
|
8653
|
+
},
|
|
8654
|
+
lg: {
|
|
8655
|
+
base: ["text-lg", "gap-[10px]"],
|
|
8656
|
+
innerWrapper: ["group-has-[p]/input:gap-[10px]"],
|
|
8657
|
+
inputWrapper: ["w-[240px]", "h-[36px]", "rounded-lg", "px-[10px]", "py-[8px]", "gap-[10px]"],
|
|
8658
|
+
errorMessage: ["text-lg"]
|
|
8659
|
+
}
|
|
8660
|
+
},
|
|
8661
|
+
radius: {
|
|
8662
|
+
default: "",
|
|
8663
|
+
none: {
|
|
8664
|
+
inputWrapper: ["rounded-none"]
|
|
8665
|
+
},
|
|
8666
|
+
full: {
|
|
8667
|
+
inputWrapper: ["rounded-full"]
|
|
8668
|
+
}
|
|
8669
|
+
},
|
|
8670
|
+
fullWidth: {
|
|
8671
|
+
true: {
|
|
8672
|
+
base: ["w-full"],
|
|
8673
|
+
innerWrapper: ["flex-1"],
|
|
8674
|
+
inputWrapper: ["w-full"]
|
|
8675
|
+
}
|
|
8676
|
+
},
|
|
8677
|
+
isDisabled: {
|
|
8678
|
+
true: {
|
|
8679
|
+
label: ["text-neutral-light"],
|
|
8680
|
+
inputWrapper: ["bg-neutral-soft", "border-neutral-light", "pointer-events-none"],
|
|
8681
|
+
input: ["text-neutral-light", "placeholder:text-neutral-light"],
|
|
8682
|
+
content: ["text-neutral-light"],
|
|
8683
|
+
errorMessage: ["text-danger-light"]
|
|
8684
|
+
}
|
|
8685
|
+
},
|
|
8686
|
+
isRequired: {
|
|
8687
|
+
true: {
|
|
8688
|
+
label: ["after:content-['*']", "after:text-danger-main", "after:ml-0.5"]
|
|
8689
|
+
}
|
|
8690
|
+
}
|
|
8691
|
+
},
|
|
8692
|
+
defaultVariants: {
|
|
8693
|
+
variant: "solid",
|
|
8694
|
+
color: "primary",
|
|
8695
|
+
size: "md",
|
|
8696
|
+
fullWidth: false,
|
|
8697
|
+
isDisabled: false,
|
|
8698
|
+
isRequired: false
|
|
8699
|
+
},
|
|
8700
|
+
compoundVariants: [
|
|
8701
|
+
{
|
|
8702
|
+
isDisabled: true,
|
|
8703
|
+
isRequired: true,
|
|
8704
|
+
class: {
|
|
8705
|
+
label: ["after:text-danger-light"]
|
|
8706
|
+
}
|
|
8707
|
+
}
|
|
8708
|
+
]
|
|
8709
|
+
});
|
|
8710
|
+
|
|
7977
8711
|
// ../tailwind-config/src/plugin.ts
|
|
7978
8712
|
var import_plugin = __toESM(require_plugin());
|
|
7979
8713
|
|
|
@@ -8537,6 +9271,16 @@ var resolveConfig = (themes = {}, defaultTheme, prefix = "deepnoidUi") => {
|
|
|
8537
9271
|
}
|
|
8538
9272
|
}
|
|
8539
9273
|
}
|
|
9274
|
+
resolved.utilities = {
|
|
9275
|
+
...resolved.utilities,
|
|
9276
|
+
".scrollbar-hide": {
|
|
9277
|
+
"-ms-overflow-style": "none",
|
|
9278
|
+
"scrollbar-width": "none",
|
|
9279
|
+
"&::-webkit-scrollbar": {
|
|
9280
|
+
display: "none"
|
|
9281
|
+
}
|
|
9282
|
+
}
|
|
9283
|
+
};
|
|
8540
9284
|
return resolved;
|
|
8541
9285
|
};
|
|
8542
9286
|
var deepnoidUi = (colorChip = {}, defaultTheme = "light") => {
|
|
@@ -8611,6 +9355,7 @@ var deepnoidUi = (colorChip = {}, defaultTheme = "light") => {
|
|
|
8611
9355
|
ButtonGroup,
|
|
8612
9356
|
Card,
|
|
8613
9357
|
CheckBox,
|
|
9358
|
+
DateTimePicker,
|
|
8614
9359
|
Icon,
|
|
8615
9360
|
Input,
|
|
8616
9361
|
List,
|