@marcoschwartz/lite-ui 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +466 -289
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +446 -270
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -715,6 +715,7 @@ var AppShell = ({
|
|
|
715
715
|
const [isMobileNavbarOpen, setIsMobileNavbarOpen] = useState4(defaultNavbarOpen);
|
|
716
716
|
const navbarWidth = navbar?.width || "md";
|
|
717
717
|
const navbarBreakpoint = navbar?.breakpoint || "md";
|
|
718
|
+
const navbarPosition = navbar?.position || "side";
|
|
718
719
|
const widthClass = widthClasses2[navbarWidth];
|
|
719
720
|
const breakpoint = breakpointClasses[navbarBreakpoint];
|
|
720
721
|
if (!responsive && navbar) {
|
|
@@ -732,6 +733,51 @@ var AppShell = ({
|
|
|
732
733
|
/* @__PURE__ */ jsx38("main", { className: "flex-1 overflow-y-auto", children })
|
|
733
734
|
] });
|
|
734
735
|
}
|
|
736
|
+
if (navbar && navbarPosition === "top") {
|
|
737
|
+
const mobileMenuClass = navbarBreakpoint === "sm" ? "sm:hidden" : navbarBreakpoint === "md" ? "md:hidden" : navbarBreakpoint === "lg" ? "lg:hidden" : "xl:hidden";
|
|
738
|
+
const desktopNavClass = navbarBreakpoint === "sm" ? "sm:flex" : navbarBreakpoint === "md" ? "md:flex" : navbarBreakpoint === "lg" ? "lg:flex" : "xl:flex";
|
|
739
|
+
return /* @__PURE__ */ jsxs7("div", { className: `min-h-screen flex flex-col bg-gray-50 dark:bg-gray-900 ${className}`, children: [
|
|
740
|
+
/* @__PURE__ */ jsx38("nav", { className: "sticky top-0 z-30 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsx38("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxs7("div", { className: "flex justify-between items-center h-16", children: [
|
|
741
|
+
/* @__PURE__ */ jsx38("div", { className: "flex items-center", children: navbarLogo ? /* @__PURE__ */ jsx38("div", { children: navbarLogo }) : navbarTitle ? /* @__PURE__ */ jsx38("span", { className: "text-xl font-bold text-gray-900 dark:text-gray-100", children: navbarTitle }) : null }),
|
|
742
|
+
/* @__PURE__ */ jsx38("div", { className: `hidden ${desktopNavClass} items-center gap-6`, children: navbar.content }),
|
|
743
|
+
/* @__PURE__ */ jsx38(
|
|
744
|
+
"button",
|
|
745
|
+
{
|
|
746
|
+
className: `${mobileMenuClass} p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors`,
|
|
747
|
+
onClick: () => setIsMobileNavbarOpen(!isMobileNavbarOpen),
|
|
748
|
+
"aria-label": "Toggle menu",
|
|
749
|
+
children: /* @__PURE__ */ jsx38(MenuIcon, { size: "md" })
|
|
750
|
+
}
|
|
751
|
+
)
|
|
752
|
+
] }) }) }),
|
|
753
|
+
header && /* @__PURE__ */ jsx38("div", { className: "w-full", children: header }),
|
|
754
|
+
isMobileNavbarOpen && /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
755
|
+
/* @__PURE__ */ jsx38(
|
|
756
|
+
"div",
|
|
757
|
+
{
|
|
758
|
+
className: `${mobileMenuClass} fixed inset-0 z-40 bg-black/60 backdrop-blur-sm animate-in fade-in duration-200`,
|
|
759
|
+
onClick: () => setIsMobileNavbarOpen(false)
|
|
760
|
+
}
|
|
761
|
+
),
|
|
762
|
+
/* @__PURE__ */ jsxs7("div", { className: `${mobileMenuClass} fixed left-0 top-0 bottom-0 z-50 w-64 bg-white dark:bg-gray-800 shadow-2xl animate-in slide-in-from-left duration-300`, children: [
|
|
763
|
+
/* @__PURE__ */ jsxs7("div", { className: "p-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between", children: [
|
|
764
|
+
navbarLogo ? /* @__PURE__ */ jsx38("div", { children: navbarLogo }) : navbarTitle ? /* @__PURE__ */ jsx38("span", { className: "text-xl font-bold text-gray-900 dark:text-gray-100", children: navbarTitle }) : null,
|
|
765
|
+
/* @__PURE__ */ jsx38(
|
|
766
|
+
"button",
|
|
767
|
+
{
|
|
768
|
+
className: "p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",
|
|
769
|
+
onClick: () => setIsMobileNavbarOpen(false),
|
|
770
|
+
"aria-label": "Close menu",
|
|
771
|
+
children: /* @__PURE__ */ jsx38("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx38("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
772
|
+
}
|
|
773
|
+
)
|
|
774
|
+
] }),
|
|
775
|
+
/* @__PURE__ */ jsx38("div", { className: "p-4 flex flex-col gap-4", children: navbar.content })
|
|
776
|
+
] })
|
|
777
|
+
] }),
|
|
778
|
+
/* @__PURE__ */ jsx38("main", { className: "flex-1 overflow-y-auto", children })
|
|
779
|
+
] });
|
|
780
|
+
}
|
|
735
781
|
if (navbar) {
|
|
736
782
|
const mobileHeaderClass = navbarBreakpoint === "sm" ? "sm:hidden" : navbarBreakpoint === "md" ? "md:hidden" : navbarBreakpoint === "lg" ? "lg:hidden" : "xl:hidden";
|
|
737
783
|
const desktopNavbarClass = navbarBreakpoint === "sm" ? "sm:block" : navbarBreakpoint === "md" ? "md:block" : navbarBreakpoint === "lg" ? "lg:block" : "xl:block";
|
|
@@ -934,21 +980,150 @@ var TextInput = forwardRef(
|
|
|
934
980
|
);
|
|
935
981
|
TextInput.displayName = "TextInput";
|
|
936
982
|
|
|
983
|
+
// src/components/NumberInput.tsx
|
|
984
|
+
import { useState as useState5, useRef as useRef2 } from "react";
|
|
985
|
+
import { jsx as jsx41, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
986
|
+
var sizeClasses5 = {
|
|
987
|
+
sm: "px-3 py-1.5 text-sm",
|
|
988
|
+
md: "px-4 py-2.5 text-base",
|
|
989
|
+
lg: "px-4 py-3 text-lg"
|
|
990
|
+
};
|
|
991
|
+
var NumberInput = ({
|
|
992
|
+
label,
|
|
993
|
+
error,
|
|
994
|
+
helperText,
|
|
995
|
+
value,
|
|
996
|
+
onChange,
|
|
997
|
+
min,
|
|
998
|
+
max,
|
|
999
|
+
step = 1,
|
|
1000
|
+
precision,
|
|
1001
|
+
disabled = false,
|
|
1002
|
+
hideControls = false,
|
|
1003
|
+
size = "md",
|
|
1004
|
+
fullWidth = false,
|
|
1005
|
+
placeholder,
|
|
1006
|
+
className = ""
|
|
1007
|
+
}) => {
|
|
1008
|
+
const { theme } = useTheme();
|
|
1009
|
+
const inputRef = useRef2(null);
|
|
1010
|
+
const [isFocused, setIsFocused] = useState5(false);
|
|
1011
|
+
const clampValue = (val) => {
|
|
1012
|
+
let clamped = val;
|
|
1013
|
+
if (min !== void 0 && clamped < min) clamped = min;
|
|
1014
|
+
if (max !== void 0 && clamped > max) clamped = max;
|
|
1015
|
+
if (precision !== void 0) {
|
|
1016
|
+
clamped = parseFloat(clamped.toFixed(precision));
|
|
1017
|
+
}
|
|
1018
|
+
return clamped;
|
|
1019
|
+
};
|
|
1020
|
+
const handleIncrement = () => {
|
|
1021
|
+
if (disabled) return;
|
|
1022
|
+
const currentValue = value ?? 0;
|
|
1023
|
+
const newValue = clampValue(currentValue + step);
|
|
1024
|
+
onChange?.(newValue);
|
|
1025
|
+
};
|
|
1026
|
+
const handleDecrement = () => {
|
|
1027
|
+
if (disabled) return;
|
|
1028
|
+
const currentValue = value ?? 0;
|
|
1029
|
+
const newValue = clampValue(currentValue - step);
|
|
1030
|
+
onChange?.(newValue);
|
|
1031
|
+
};
|
|
1032
|
+
const handleInputChange = (e) => {
|
|
1033
|
+
const inputValue = e.target.value;
|
|
1034
|
+
if (inputValue === "" || inputValue === "-") {
|
|
1035
|
+
onChange?.(void 0);
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
const numValue = parseFloat(inputValue);
|
|
1039
|
+
if (!isNaN(numValue)) {
|
|
1040
|
+
const clamped = clampValue(numValue);
|
|
1041
|
+
onChange?.(clamped);
|
|
1042
|
+
}
|
|
1043
|
+
};
|
|
1044
|
+
const handleKeyDown = (e) => {
|
|
1045
|
+
if (e.key === "ArrowUp") {
|
|
1046
|
+
e.preventDefault();
|
|
1047
|
+
handleIncrement();
|
|
1048
|
+
} else if (e.key === "ArrowDown") {
|
|
1049
|
+
e.preventDefault();
|
|
1050
|
+
handleDecrement();
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
const baseStyles = "w-full appearance-none rounded-lg border border-gray-300 bg-white text-gray-900 transition-all duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent shadow-sm hover:border-gray-400 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-100 dark:hover:border-gray-500";
|
|
1054
|
+
const sizeStyle = sizeClasses5[size];
|
|
1055
|
+
const errorStyles = error ? "border-red-500 focus:ring-red-500 dark:border-red-500" : "";
|
|
1056
|
+
const disabledStyles = disabled ? "opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-900" : "";
|
|
1057
|
+
const widthStyle = fullWidth ? "w-full" : "";
|
|
1058
|
+
const paddingWithControls = !hideControls ? "pr-8" : "";
|
|
1059
|
+
const displayValue = value !== void 0 ? value.toString() : "";
|
|
1060
|
+
return /* @__PURE__ */ jsxs10("div", { className: `${widthStyle} ${className}`, children: [
|
|
1061
|
+
label && /* @__PURE__ */ jsx41("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: label }),
|
|
1062
|
+
/* @__PURE__ */ jsxs10("div", { className: "relative", children: [
|
|
1063
|
+
/* @__PURE__ */ jsx41(
|
|
1064
|
+
"input",
|
|
1065
|
+
{
|
|
1066
|
+
ref: inputRef,
|
|
1067
|
+
type: "number",
|
|
1068
|
+
value: displayValue,
|
|
1069
|
+
onChange: handleInputChange,
|
|
1070
|
+
onKeyDown: handleKeyDown,
|
|
1071
|
+
onFocus: () => setIsFocused(true),
|
|
1072
|
+
onBlur: () => setIsFocused(false),
|
|
1073
|
+
disabled,
|
|
1074
|
+
placeholder,
|
|
1075
|
+
min,
|
|
1076
|
+
max,
|
|
1077
|
+
step,
|
|
1078
|
+
className: `${baseStyles} ${sizeStyle} ${errorStyles} ${disabledStyles} ${paddingWithControls} [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`.trim()
|
|
1079
|
+
}
|
|
1080
|
+
),
|
|
1081
|
+
!hideControls && /* @__PURE__ */ jsxs10("div", { className: "absolute right-1 top-1/2 -translate-y-1/2 flex flex-col", children: [
|
|
1082
|
+
/* @__PURE__ */ jsx41(
|
|
1083
|
+
"button",
|
|
1084
|
+
{
|
|
1085
|
+
type: "button",
|
|
1086
|
+
onClick: handleIncrement,
|
|
1087
|
+
disabled: disabled || max !== void 0 && value !== void 0 && value >= max,
|
|
1088
|
+
className: "px-2 py-0.5 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
1089
|
+
tabIndex: -1,
|
|
1090
|
+
children: /* @__PURE__ */ jsx41("svg", { className: "w-3 h-3 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx41("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 3, d: "M5 15l7-7 7 7" }) })
|
|
1091
|
+
}
|
|
1092
|
+
),
|
|
1093
|
+
/* @__PURE__ */ jsx41(
|
|
1094
|
+
"button",
|
|
1095
|
+
{
|
|
1096
|
+
type: "button",
|
|
1097
|
+
onClick: handleDecrement,
|
|
1098
|
+
disabled: disabled || min !== void 0 && value !== void 0 && value <= min,
|
|
1099
|
+
className: "px-2 py-0.5 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
1100
|
+
tabIndex: -1,
|
|
1101
|
+
children: /* @__PURE__ */ jsx41("svg", { className: "w-3 h-3 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx41("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 3, d: "M19 9l-7 7-7-7" }) })
|
|
1102
|
+
}
|
|
1103
|
+
)
|
|
1104
|
+
] })
|
|
1105
|
+
] }),
|
|
1106
|
+
error && /* @__PURE__ */ jsx41("p", { className: "mt-1 text-sm text-red-600 dark:text-red-400", children: error }),
|
|
1107
|
+
helperText && !error && /* @__PURE__ */ jsx41("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: helperText })
|
|
1108
|
+
] });
|
|
1109
|
+
};
|
|
1110
|
+
NumberInput.displayName = "NumberInput";
|
|
1111
|
+
|
|
937
1112
|
// src/components/ActionMenu.tsx
|
|
938
|
-
import { useState as
|
|
1113
|
+
import { useState as useState6, useRef as useRef3, useEffect as useEffect5 } from "react";
|
|
939
1114
|
import { createPortal } from "react-dom";
|
|
940
|
-
import { Fragment as Fragment6, jsx as
|
|
1115
|
+
import { Fragment as Fragment6, jsx as jsx42, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
941
1116
|
var ActionMenu = ({
|
|
942
1117
|
items,
|
|
943
1118
|
trigger,
|
|
944
1119
|
position = "right"
|
|
945
1120
|
}) => {
|
|
946
1121
|
const { themeName } = useTheme();
|
|
947
|
-
const [isOpen, setIsOpen] =
|
|
948
|
-
const [menuPosition, setMenuPosition] =
|
|
949
|
-
const [mounted, setMounted] =
|
|
950
|
-
const menuRef =
|
|
951
|
-
const triggerRef =
|
|
1122
|
+
const [isOpen, setIsOpen] = useState6(false);
|
|
1123
|
+
const [menuPosition, setMenuPosition] = useState6(null);
|
|
1124
|
+
const [mounted, setMounted] = useState6(false);
|
|
1125
|
+
const menuRef = useRef3(null);
|
|
1126
|
+
const triggerRef = useRef3(null);
|
|
952
1127
|
useEffect5(() => {
|
|
953
1128
|
setMounted(true);
|
|
954
1129
|
}, []);
|
|
@@ -982,17 +1157,17 @@ var ActionMenu = ({
|
|
|
982
1157
|
setIsOpen(false);
|
|
983
1158
|
}
|
|
984
1159
|
};
|
|
985
|
-
const defaultTrigger = /* @__PURE__ */
|
|
1160
|
+
const defaultTrigger = /* @__PURE__ */ jsx42(
|
|
986
1161
|
"button",
|
|
987
1162
|
{
|
|
988
1163
|
className: "p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",
|
|
989
1164
|
"aria-label": "Open menu",
|
|
990
|
-
children: /* @__PURE__ */
|
|
1165
|
+
children: /* @__PURE__ */ jsx42("svg", { className: "w-5 h-5 text-gray-600 dark:text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx42("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z" }) })
|
|
991
1166
|
}
|
|
992
1167
|
);
|
|
993
1168
|
const menuBaseStyles = themeName === "minimalistic" ? "bg-black border-2 border-white" : "bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 shadow-lg";
|
|
994
1169
|
const itemBaseStyles = themeName === "minimalistic" ? "text-white hover:bg-white hover:text-black transition-colors duration-200" : "text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors";
|
|
995
|
-
const menu = isOpen && mounted && menuPosition ? /* @__PURE__ */
|
|
1170
|
+
const menu = isOpen && mounted && menuPosition ? /* @__PURE__ */ jsx42(
|
|
996
1171
|
"div",
|
|
997
1172
|
{
|
|
998
1173
|
ref: menuRef,
|
|
@@ -1004,7 +1179,7 @@ var ActionMenu = ({
|
|
|
1004
1179
|
},
|
|
1005
1180
|
children: items.map((item, index) => {
|
|
1006
1181
|
if (item.type === "divider") {
|
|
1007
|
-
return /* @__PURE__ */
|
|
1182
|
+
return /* @__PURE__ */ jsx42(
|
|
1008
1183
|
"div",
|
|
1009
1184
|
{
|
|
1010
1185
|
className: "my-1 border-t border-gray-200 dark:border-gray-700"
|
|
@@ -1012,15 +1187,15 @@ var ActionMenu = ({
|
|
|
1012
1187
|
index
|
|
1013
1188
|
);
|
|
1014
1189
|
}
|
|
1015
|
-
return /* @__PURE__ */
|
|
1190
|
+
return /* @__PURE__ */ jsxs11(
|
|
1016
1191
|
"button",
|
|
1017
1192
|
{
|
|
1018
1193
|
onClick: () => handleItemClick(item),
|
|
1019
1194
|
disabled: item.disabled,
|
|
1020
1195
|
className: `w-full text-left px-4 py-3 flex items-center gap-3 ${itemBaseStyles} ${item.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} ${item.variant === "danger" ? "text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20" : ""}`,
|
|
1021
1196
|
children: [
|
|
1022
|
-
item.icon && /* @__PURE__ */
|
|
1023
|
-
/* @__PURE__ */
|
|
1197
|
+
item.icon && /* @__PURE__ */ jsx42("span", { className: "flex-shrink-0", children: item.icon }),
|
|
1198
|
+
/* @__PURE__ */ jsx42("span", { className: "flex-1", children: item.label })
|
|
1024
1199
|
]
|
|
1025
1200
|
},
|
|
1026
1201
|
index
|
|
@@ -1028,14 +1203,14 @@ var ActionMenu = ({
|
|
|
1028
1203
|
})
|
|
1029
1204
|
}
|
|
1030
1205
|
) : null;
|
|
1031
|
-
return /* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1206
|
+
return /* @__PURE__ */ jsxs11(Fragment6, { children: [
|
|
1207
|
+
/* @__PURE__ */ jsx42("div", { className: "relative inline-block", ref: triggerRef, children: /* @__PURE__ */ jsx42("div", { onClick: () => setIsOpen(!isOpen), children: trigger || defaultTrigger }) }),
|
|
1033
1208
|
mounted && createPortal(menu, document.body)
|
|
1034
1209
|
] });
|
|
1035
1210
|
};
|
|
1036
1211
|
|
|
1037
1212
|
// src/components/Card.tsx
|
|
1038
|
-
import { jsx as
|
|
1213
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
1039
1214
|
var paddingClasses = {
|
|
1040
1215
|
none: "",
|
|
1041
1216
|
sm: "p-4",
|
|
@@ -1050,8 +1225,8 @@ var Card = ({
|
|
|
1050
1225
|
}) => {
|
|
1051
1226
|
const { theme } = useTheme();
|
|
1052
1227
|
const paddingClass = paddingClasses[padding];
|
|
1053
|
-
const hoverClass = hover ? "hover:shadow-
|
|
1054
|
-
return /* @__PURE__ */
|
|
1228
|
+
const hoverClass = hover ? "hover:shadow-xl hover:scale-[1.02] hover:border-blue-400 dark:hover:border-blue-500 cursor-pointer transition-all duration-200 ease-in-out" : "";
|
|
1229
|
+
return /* @__PURE__ */ jsx43(
|
|
1055
1230
|
"div",
|
|
1056
1231
|
{
|
|
1057
1232
|
className: `bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 ${paddingClass} ${hoverClass} ${className}`,
|
|
@@ -1061,7 +1236,7 @@ var Card = ({
|
|
|
1061
1236
|
};
|
|
1062
1237
|
|
|
1063
1238
|
// src/components/Alert.tsx
|
|
1064
|
-
import { jsx as
|
|
1239
|
+
import { jsx as jsx44, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1065
1240
|
var variantStyles = {
|
|
1066
1241
|
info: "bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800 text-blue-900 dark:text-blue-100",
|
|
1067
1242
|
success: "bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800 text-green-900 dark:text-green-100",
|
|
@@ -1084,24 +1259,24 @@ var Alert = ({
|
|
|
1084
1259
|
const { theme } = useTheme();
|
|
1085
1260
|
const variantClass = variantStyles[variant];
|
|
1086
1261
|
const iconClass = iconStyles[variant];
|
|
1087
|
-
return /* @__PURE__ */
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
variant === "info" && /* @__PURE__ */
|
|
1090
|
-
variant === "success" && /* @__PURE__ */
|
|
1091
|
-
variant === "warning" && /* @__PURE__ */
|
|
1092
|
-
variant === "error" && /* @__PURE__ */
|
|
1262
|
+
return /* @__PURE__ */ jsx44("div", { className: `rounded-lg border p-4 ${variantClass} ${className}`, role: "alert", children: /* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-3", children: [
|
|
1263
|
+
/* @__PURE__ */ jsxs12("div", { className: `flex-shrink-0 ${iconClass}`, children: [
|
|
1264
|
+
variant === "info" && /* @__PURE__ */ jsx44("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx44("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
|
|
1265
|
+
variant === "success" && /* @__PURE__ */ jsx44("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx44("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
|
|
1266
|
+
variant === "warning" && /* @__PURE__ */ jsx44("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx44("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
1267
|
+
variant === "error" && /* @__PURE__ */ jsx44("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx44("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) })
|
|
1093
1268
|
] }),
|
|
1094
|
-
/* @__PURE__ */
|
|
1095
|
-
title && /* @__PURE__ */
|
|
1096
|
-
/* @__PURE__ */
|
|
1269
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex-1", children: [
|
|
1270
|
+
title && /* @__PURE__ */ jsx44("h3", { className: "font-semibold mb-1", children: title }),
|
|
1271
|
+
/* @__PURE__ */ jsx44("div", { className: "text-sm", children })
|
|
1097
1272
|
] }),
|
|
1098
|
-
onClose && /* @__PURE__ */
|
|
1273
|
+
onClose && /* @__PURE__ */ jsx44(
|
|
1099
1274
|
"button",
|
|
1100
1275
|
{
|
|
1101
1276
|
onClick: onClose,
|
|
1102
1277
|
className: `flex-shrink-0 ${iconClass} hover:opacity-70 transition-opacity`,
|
|
1103
1278
|
"aria-label": "Close alert",
|
|
1104
|
-
children: /* @__PURE__ */
|
|
1279
|
+
children: /* @__PURE__ */ jsx44("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx44("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
1105
1280
|
}
|
|
1106
1281
|
)
|
|
1107
1282
|
] }) });
|
|
@@ -1109,13 +1284,13 @@ var Alert = ({
|
|
|
1109
1284
|
|
|
1110
1285
|
// src/components/Checkbox.tsx
|
|
1111
1286
|
import { forwardRef as forwardRef2 } from "react";
|
|
1112
|
-
import { jsx as
|
|
1287
|
+
import { jsx as jsx45, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1113
1288
|
var Checkbox = forwardRef2(
|
|
1114
1289
|
({ label, error, className = "", disabled, ...props }, ref) => {
|
|
1115
1290
|
const { theme } = useTheme();
|
|
1116
|
-
return /* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */
|
|
1118
|
-
/* @__PURE__ */
|
|
1291
|
+
return /* @__PURE__ */ jsxs13("div", { className, children: [
|
|
1292
|
+
/* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2 cursor-pointer group", children: [
|
|
1293
|
+
/* @__PURE__ */ jsx45(
|
|
1119
1294
|
"input",
|
|
1120
1295
|
{
|
|
1121
1296
|
ref,
|
|
@@ -1125,9 +1300,9 @@ var Checkbox = forwardRef2(
|
|
|
1125
1300
|
...props
|
|
1126
1301
|
}
|
|
1127
1302
|
),
|
|
1128
|
-
label && /* @__PURE__ */
|
|
1303
|
+
label && /* @__PURE__ */ jsx45("span", { className: `text-sm text-gray-700 dark:text-gray-300 ${disabled ? "opacity-50 cursor-not-allowed" : "group-hover:text-gray-900 dark:group-hover:text-gray-100"}`, children: label })
|
|
1129
1304
|
] }),
|
|
1130
|
-
error && /* @__PURE__ */
|
|
1305
|
+
error && /* @__PURE__ */ jsx45("p", { className: "mt-1 text-sm text-red-600 dark:text-red-400", children: error })
|
|
1131
1306
|
] });
|
|
1132
1307
|
}
|
|
1133
1308
|
);
|
|
@@ -1135,7 +1310,7 @@ Checkbox.displayName = "Checkbox";
|
|
|
1135
1310
|
|
|
1136
1311
|
// src/components/Toggle.tsx
|
|
1137
1312
|
import { forwardRef as forwardRef3 } from "react";
|
|
1138
|
-
import { jsx as
|
|
1313
|
+
import { jsx as jsx46, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1139
1314
|
var Toggle = forwardRef3(
|
|
1140
1315
|
({ label, size = "md", className = "", disabled, checked, ...props }, ref) => {
|
|
1141
1316
|
const { theme } = useTheme();
|
|
@@ -1154,9 +1329,9 @@ var Toggle = forwardRef3(
|
|
|
1154
1329
|
}
|
|
1155
1330
|
};
|
|
1156
1331
|
const currentSize = toggleClasses[size];
|
|
1157
|
-
return /* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */
|
|
1332
|
+
return /* @__PURE__ */ jsxs14("label", { className: `inline-flex items-center gap-3 cursor-pointer ${disabled ? "opacity-50 cursor-not-allowed" : ""} ${className}`, children: [
|
|
1333
|
+
/* @__PURE__ */ jsxs14("div", { className: "relative", children: [
|
|
1334
|
+
/* @__PURE__ */ jsx46(
|
|
1160
1335
|
"input",
|
|
1161
1336
|
{
|
|
1162
1337
|
ref,
|
|
@@ -1167,27 +1342,27 @@ var Toggle = forwardRef3(
|
|
|
1167
1342
|
...props
|
|
1168
1343
|
}
|
|
1169
1344
|
),
|
|
1170
|
-
/* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ jsx46(
|
|
1171
1346
|
"div",
|
|
1172
1347
|
{
|
|
1173
1348
|
className: `${currentSize.switch} bg-gray-300 dark:bg-gray-700 peer-focus:ring-2 peer-focus:ring-blue-500 rounded-full peer peer-checked:bg-blue-600 dark:peer-checked:bg-blue-500 transition-colors`
|
|
1174
1349
|
}
|
|
1175
1350
|
),
|
|
1176
|
-
/* @__PURE__ */
|
|
1351
|
+
/* @__PURE__ */ jsx46(
|
|
1177
1352
|
"div",
|
|
1178
1353
|
{
|
|
1179
1354
|
className: `${currentSize.thumb} bg-white rounded-full shadow-md absolute top-0.5 left-0.5 transition-transform`
|
|
1180
1355
|
}
|
|
1181
1356
|
)
|
|
1182
1357
|
] }),
|
|
1183
|
-
label && /* @__PURE__ */
|
|
1358
|
+
label && /* @__PURE__ */ jsx46("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: label })
|
|
1184
1359
|
] });
|
|
1185
1360
|
}
|
|
1186
1361
|
);
|
|
1187
1362
|
Toggle.displayName = "Toggle";
|
|
1188
1363
|
|
|
1189
1364
|
// src/components/Badge.tsx
|
|
1190
|
-
import { jsx as
|
|
1365
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
1191
1366
|
var variantStyles2 = {
|
|
1192
1367
|
default: "bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200",
|
|
1193
1368
|
primary: "bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-200",
|
|
@@ -1210,12 +1385,12 @@ var Badge = ({
|
|
|
1210
1385
|
const { theme } = useTheme();
|
|
1211
1386
|
const variantClass = variantStyles2[variant];
|
|
1212
1387
|
const sizeClass = sizeStyles[size];
|
|
1213
|
-
return /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ jsx47("span", { className: `inline-flex items-center font-medium rounded-full ${variantClass} ${sizeClass} ${className}`, children });
|
|
1214
1389
|
};
|
|
1215
1390
|
|
|
1216
1391
|
// src/components/Spinner.tsx
|
|
1217
|
-
import { jsx as
|
|
1218
|
-
var
|
|
1392
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
1393
|
+
var sizeClasses6 = {
|
|
1219
1394
|
sm: "w-4 h-4 border-2",
|
|
1220
1395
|
md: "w-8 h-8 border-2",
|
|
1221
1396
|
lg: "w-12 h-12 border-3",
|
|
@@ -1232,22 +1407,22 @@ var Spinner = ({
|
|
|
1232
1407
|
className = ""
|
|
1233
1408
|
}) => {
|
|
1234
1409
|
const { theme } = useTheme();
|
|
1235
|
-
const sizeClass =
|
|
1410
|
+
const sizeClass = sizeClasses6[size];
|
|
1236
1411
|
const colorClass = colorClasses[color];
|
|
1237
|
-
return /* @__PURE__ */
|
|
1412
|
+
return /* @__PURE__ */ jsx48(
|
|
1238
1413
|
"div",
|
|
1239
1414
|
{
|
|
1240
1415
|
className: `inline-block rounded-full animate-spin ${sizeClass} ${colorClass} ${className}`,
|
|
1241
1416
|
role: "status",
|
|
1242
1417
|
"aria-label": "Loading",
|
|
1243
|
-
children: /* @__PURE__ */
|
|
1418
|
+
children: /* @__PURE__ */ jsx48("span", { className: "sr-only", children: "Loading..." })
|
|
1244
1419
|
}
|
|
1245
1420
|
);
|
|
1246
1421
|
};
|
|
1247
1422
|
|
|
1248
1423
|
// src/components/Tabs.tsx
|
|
1249
|
-
import { useState as
|
|
1250
|
-
import { jsx as
|
|
1424
|
+
import { useState as useState7 } from "react";
|
|
1425
|
+
import { jsx as jsx49, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1251
1426
|
var Tabs = ({
|
|
1252
1427
|
tabs,
|
|
1253
1428
|
defaultIndex = 0,
|
|
@@ -1255,14 +1430,14 @@ var Tabs = ({
|
|
|
1255
1430
|
className = ""
|
|
1256
1431
|
}) => {
|
|
1257
1432
|
const { theme } = useTheme();
|
|
1258
|
-
const [activeIndex, setActiveIndex] =
|
|
1433
|
+
const [activeIndex, setActiveIndex] = useState7(defaultIndex);
|
|
1259
1434
|
const handleTabClick = (index) => {
|
|
1260
1435
|
if (tabs[index].disabled) return;
|
|
1261
1436
|
setActiveIndex(index);
|
|
1262
1437
|
onChange?.(index);
|
|
1263
1438
|
};
|
|
1264
|
-
return /* @__PURE__ */
|
|
1265
|
-
/* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ jsxs15("div", { className, children: [
|
|
1440
|
+
/* @__PURE__ */ jsx49("div", { className: "border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsx49("nav", { className: "flex gap-8 px-6", "aria-label": "Tabs", children: tabs.map((tab, index) => /* @__PURE__ */ jsx49(
|
|
1266
1441
|
"button",
|
|
1267
1442
|
{
|
|
1268
1443
|
onClick: () => handleTabClick(index),
|
|
@@ -1273,12 +1448,12 @@ var Tabs = ({
|
|
|
1273
1448
|
},
|
|
1274
1449
|
index
|
|
1275
1450
|
)) }) }),
|
|
1276
|
-
/* @__PURE__ */
|
|
1451
|
+
/* @__PURE__ */ jsx49("div", { children: tabs[activeIndex]?.content })
|
|
1277
1452
|
] });
|
|
1278
1453
|
};
|
|
1279
1454
|
|
|
1280
1455
|
// src/components/Table.tsx
|
|
1281
|
-
import { jsx as
|
|
1456
|
+
import { jsx as jsx50, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1282
1457
|
function Table({
|
|
1283
1458
|
columns,
|
|
1284
1459
|
data,
|
|
@@ -1288,11 +1463,11 @@ function Table({
|
|
|
1288
1463
|
className = ""
|
|
1289
1464
|
}) {
|
|
1290
1465
|
const { theme } = useTheme();
|
|
1291
|
-
return /* @__PURE__ */
|
|
1292
|
-
/* @__PURE__ */
|
|
1293
|
-
/* @__PURE__ */
|
|
1466
|
+
return /* @__PURE__ */ jsxs16("div", { className: `overflow-x-auto ${className}`, children: [
|
|
1467
|
+
/* @__PURE__ */ jsxs16("table", { className: "w-full text-left", children: [
|
|
1468
|
+
/* @__PURE__ */ jsx50("thead", { className: "bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsx50("tr", { children: columns.map((column, colIndex) => {
|
|
1294
1469
|
const isLast = colIndex === columns.length - 1;
|
|
1295
|
-
return /* @__PURE__ */
|
|
1470
|
+
return /* @__PURE__ */ jsx50(
|
|
1296
1471
|
"th",
|
|
1297
1472
|
{
|
|
1298
1473
|
className: isLast ? "px-6 py-3 text-xs font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wider relative" : "px-6 py-3 text-xs font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wider",
|
|
@@ -1302,18 +1477,18 @@ function Table({
|
|
|
1302
1477
|
column.key
|
|
1303
1478
|
);
|
|
1304
1479
|
}) }) }),
|
|
1305
|
-
/* @__PURE__ */
|
|
1480
|
+
/* @__PURE__ */ jsx50("tbody", { className: "bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700", children: data.map((row, rowIndex) => {
|
|
1306
1481
|
const rowClasses = [
|
|
1307
1482
|
striped && rowIndex % 2 === 1 ? "bg-gray-50 dark:bg-gray-800/50" : "",
|
|
1308
1483
|
hoverable ? "hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors" : ""
|
|
1309
1484
|
].filter(Boolean).join(" ");
|
|
1310
|
-
return /* @__PURE__ */
|
|
1485
|
+
return /* @__PURE__ */ jsx50(
|
|
1311
1486
|
"tr",
|
|
1312
1487
|
{
|
|
1313
1488
|
className: rowClasses,
|
|
1314
1489
|
children: columns.map((column, colIndex) => {
|
|
1315
1490
|
const isLast = colIndex === columns.length - 1;
|
|
1316
|
-
return /* @__PURE__ */
|
|
1491
|
+
return /* @__PURE__ */ jsx50(
|
|
1317
1492
|
"td",
|
|
1318
1493
|
{
|
|
1319
1494
|
className: isLast ? "px-6 py-4 text-sm text-gray-900 dark:text-gray-100 overflow-visible" : "px-6 py-4 text-sm text-gray-900 dark:text-gray-100",
|
|
@@ -1327,12 +1502,12 @@ function Table({
|
|
|
1327
1502
|
);
|
|
1328
1503
|
}) })
|
|
1329
1504
|
] }),
|
|
1330
|
-
data.length === 0 && /* @__PURE__ */
|
|
1505
|
+
data.length === 0 && /* @__PURE__ */ jsx50("div", { className: "text-center py-8 text-gray-500 dark:text-gray-400", children: "No data available" })
|
|
1331
1506
|
] });
|
|
1332
1507
|
}
|
|
1333
1508
|
|
|
1334
1509
|
// src/components/Pagination.tsx
|
|
1335
|
-
import { jsx as
|
|
1510
|
+
import { jsx as jsx51, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1336
1511
|
var Pagination = ({
|
|
1337
1512
|
currentPage,
|
|
1338
1513
|
totalPages,
|
|
@@ -1373,8 +1548,8 @@ var Pagination = ({
|
|
|
1373
1548
|
return range(1, totalPages);
|
|
1374
1549
|
};
|
|
1375
1550
|
const pages = paginationRange();
|
|
1376
|
-
return /* @__PURE__ */
|
|
1377
|
-
/* @__PURE__ */
|
|
1551
|
+
return /* @__PURE__ */ jsxs17("nav", { className: `flex items-center gap-1 ${className}`, "aria-label": "Pagination", children: [
|
|
1552
|
+
/* @__PURE__ */ jsx51(
|
|
1378
1553
|
"button",
|
|
1379
1554
|
{
|
|
1380
1555
|
onClick: () => onPageChange(currentPage - 1),
|
|
@@ -1386,7 +1561,7 @@ var Pagination = ({
|
|
|
1386
1561
|
),
|
|
1387
1562
|
pages.map((page, index) => {
|
|
1388
1563
|
if (page === "...") {
|
|
1389
|
-
return /* @__PURE__ */
|
|
1564
|
+
return /* @__PURE__ */ jsx51(
|
|
1390
1565
|
"span",
|
|
1391
1566
|
{
|
|
1392
1567
|
className: "px-3 py-2 text-gray-700 dark:text-gray-300",
|
|
@@ -1395,7 +1570,7 @@ var Pagination = ({
|
|
|
1395
1570
|
`dots-${index}`
|
|
1396
1571
|
);
|
|
1397
1572
|
}
|
|
1398
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ jsx51(
|
|
1399
1574
|
"button",
|
|
1400
1575
|
{
|
|
1401
1576
|
onClick: () => onPageChange(page),
|
|
@@ -1407,7 +1582,7 @@ var Pagination = ({
|
|
|
1407
1582
|
page
|
|
1408
1583
|
);
|
|
1409
1584
|
}),
|
|
1410
|
-
/* @__PURE__ */
|
|
1585
|
+
/* @__PURE__ */ jsx51(
|
|
1411
1586
|
"button",
|
|
1412
1587
|
{
|
|
1413
1588
|
onClick: () => onPageChange(currentPage + 1),
|
|
@@ -1421,9 +1596,9 @@ var Pagination = ({
|
|
|
1421
1596
|
};
|
|
1422
1597
|
|
|
1423
1598
|
// src/components/DatePicker.tsx
|
|
1424
|
-
import { useState as
|
|
1599
|
+
import { useState as useState8, useRef as useRef4, useEffect as useEffect6 } from "react";
|
|
1425
1600
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1426
|
-
import { jsx as
|
|
1601
|
+
import { jsx as jsx52, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1427
1602
|
var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
1428
1603
|
var MONTHS = [
|
|
1429
1604
|
"January",
|
|
@@ -1452,12 +1627,12 @@ var DatePicker = ({
|
|
|
1452
1627
|
placeholder = "Select date..."
|
|
1453
1628
|
}) => {
|
|
1454
1629
|
const { theme } = useTheme();
|
|
1455
|
-
const [isOpen, setIsOpen] =
|
|
1456
|
-
const [viewDate, setViewDate] =
|
|
1457
|
-
const [mounted, setMounted] =
|
|
1458
|
-
const [calendarPosition, setCalendarPosition] =
|
|
1459
|
-
const inputRef =
|
|
1460
|
-
const calendarRef =
|
|
1630
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
1631
|
+
const [viewDate, setViewDate] = useState8(value || /* @__PURE__ */ new Date());
|
|
1632
|
+
const [mounted, setMounted] = useState8(false);
|
|
1633
|
+
const [calendarPosition, setCalendarPosition] = useState8(null);
|
|
1634
|
+
const inputRef = useRef4(null);
|
|
1635
|
+
const calendarRef = useRef4(null);
|
|
1461
1636
|
useEffect6(() => {
|
|
1462
1637
|
setMounted(true);
|
|
1463
1638
|
}, []);
|
|
@@ -1544,7 +1719,7 @@ var DatePicker = ({
|
|
|
1544
1719
|
const baseStyles = "w-full appearance-none rounded-lg border border-gray-300 bg-white text-gray-900 px-4 py-2.5 text-base transition-all duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent shadow-sm hover:border-gray-400 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-100 dark:hover:border-gray-500 cursor-pointer";
|
|
1545
1720
|
const errorStyles = error ? "border-red-500 focus:ring-red-500 dark:border-red-500" : "";
|
|
1546
1721
|
const disabledStyles = disabled ? "opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-900" : "";
|
|
1547
|
-
const calendar = isOpen && mounted && calendarPosition ? /* @__PURE__ */
|
|
1722
|
+
const calendar = isOpen && mounted && calendarPosition ? /* @__PURE__ */ jsxs18(
|
|
1548
1723
|
"div",
|
|
1549
1724
|
{
|
|
1550
1725
|
ref: calendarRef,
|
|
@@ -1555,23 +1730,23 @@ var DatePicker = ({
|
|
|
1555
1730
|
minWidth: "320px"
|
|
1556
1731
|
},
|
|
1557
1732
|
children: [
|
|
1558
|
-
/* @__PURE__ */
|
|
1559
|
-
/* @__PURE__ */
|
|
1733
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between mb-4", children: [
|
|
1734
|
+
/* @__PURE__ */ jsx52(
|
|
1560
1735
|
"button",
|
|
1561
1736
|
{
|
|
1562
1737
|
onClick: handlePrevMonth,
|
|
1563
1738
|
className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",
|
|
1564
1739
|
"aria-label": "Previous month",
|
|
1565
|
-
children: /* @__PURE__ */
|
|
1740
|
+
children: /* @__PURE__ */ jsx52("svg", { className: "w-5 h-5 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx52("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
|
|
1566
1741
|
}
|
|
1567
1742
|
),
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
/* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
1744
|
+
/* @__PURE__ */ jsxs18("h2", { className: "text-base font-semibold text-gray-900 dark:text-gray-100", children: [
|
|
1570
1745
|
MONTHS[month],
|
|
1571
1746
|
" ",
|
|
1572
1747
|
year
|
|
1573
1748
|
] }),
|
|
1574
|
-
/* @__PURE__ */
|
|
1749
|
+
/* @__PURE__ */ jsx52(
|
|
1575
1750
|
"button",
|
|
1576
1751
|
{
|
|
1577
1752
|
onClick: handleToday,
|
|
@@ -1580,23 +1755,23 @@ var DatePicker = ({
|
|
|
1580
1755
|
}
|
|
1581
1756
|
)
|
|
1582
1757
|
] }),
|
|
1583
|
-
/* @__PURE__ */
|
|
1758
|
+
/* @__PURE__ */ jsx52(
|
|
1584
1759
|
"button",
|
|
1585
1760
|
{
|
|
1586
1761
|
onClick: handleNextMonth,
|
|
1587
1762
|
className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",
|
|
1588
1763
|
"aria-label": "Next month",
|
|
1589
|
-
children: /* @__PURE__ */
|
|
1764
|
+
children: /* @__PURE__ */ jsx52("svg", { className: "w-5 h-5 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx52("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })
|
|
1590
1765
|
}
|
|
1591
1766
|
)
|
|
1592
1767
|
] }),
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1768
|
+
/* @__PURE__ */ jsx52("div", { className: "grid grid-cols-7 gap-1 mb-2", children: DAYS.map((day) => /* @__PURE__ */ jsx52("div", { className: "text-center text-xs font-semibold text-gray-600 dark:text-gray-400 py-1", children: day }, day)) }),
|
|
1769
|
+
/* @__PURE__ */ jsx52("div", { className: "grid grid-cols-7 gap-1", children: calendarDays.map((date, index) => {
|
|
1595
1770
|
const isCurrentMonthDay = isCurrentMonth(date);
|
|
1596
1771
|
const isTodayDay = isToday(date);
|
|
1597
1772
|
const isSelectedDay = isSelected(date);
|
|
1598
1773
|
const isDisabledDay = isDisabled(date);
|
|
1599
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ jsx52(
|
|
1600
1775
|
"button",
|
|
1601
1776
|
{
|
|
1602
1777
|
onClick: () => handleDateClick(date),
|
|
@@ -1617,22 +1792,22 @@ var DatePicker = ({
|
|
|
1617
1792
|
]
|
|
1618
1793
|
}
|
|
1619
1794
|
) : null;
|
|
1620
|
-
return /* @__PURE__ */
|
|
1621
|
-
label && /* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ jsxs18("div", { className, children: [
|
|
1796
|
+
label && /* @__PURE__ */ jsx52("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: label }),
|
|
1797
|
+
/* @__PURE__ */ jsxs18(
|
|
1623
1798
|
"div",
|
|
1624
1799
|
{
|
|
1625
1800
|
ref: inputRef,
|
|
1626
1801
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
1627
1802
|
className: `${baseStyles} ${errorStyles} ${disabledStyles} flex items-center justify-between`.trim(),
|
|
1628
1803
|
children: [
|
|
1629
|
-
/* @__PURE__ */
|
|
1630
|
-
/* @__PURE__ */
|
|
1804
|
+
/* @__PURE__ */ jsx52("span", { className: !value ? "text-gray-500 dark:text-gray-400" : "", children: value ? formatDate(value) : placeholder }),
|
|
1805
|
+
/* @__PURE__ */ jsx52("svg", { className: "w-5 h-5 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx52("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) })
|
|
1631
1806
|
]
|
|
1632
1807
|
}
|
|
1633
1808
|
),
|
|
1634
|
-
error && /* @__PURE__ */
|
|
1635
|
-
helperText && !error && /* @__PURE__ */
|
|
1809
|
+
error && /* @__PURE__ */ jsx52("p", { className: "mt-1 text-sm text-red-600 dark:text-red-400", children: error }),
|
|
1810
|
+
helperText && !error && /* @__PURE__ */ jsx52("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: helperText }),
|
|
1636
1811
|
mounted && createPortal2(calendar, document.body)
|
|
1637
1812
|
] });
|
|
1638
1813
|
};
|
|
@@ -1640,16 +1815,16 @@ DatePicker.displayName = "DatePicker";
|
|
|
1640
1815
|
|
|
1641
1816
|
// src/components/TimePicker.tsx
|
|
1642
1817
|
import { forwardRef as forwardRef4 } from "react";
|
|
1643
|
-
import { jsx as
|
|
1818
|
+
import { jsx as jsx53, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1644
1819
|
var TimePicker = forwardRef4(
|
|
1645
1820
|
({ label, error, helperText, className = "", disabled, ...props }, ref) => {
|
|
1646
1821
|
const { theme } = useTheme();
|
|
1647
1822
|
const baseStyles = "w-full appearance-none rounded-lg border border-gray-300 bg-white text-gray-900 px-4 py-2.5 text-base transition-all duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent shadow-sm hover:border-gray-400 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-100 dark:hover:border-gray-500";
|
|
1648
1823
|
const errorStyles = error ? "border-red-500 focus:ring-red-500 dark:border-red-500" : "";
|
|
1649
1824
|
const disabledStyles = disabled ? "opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-900" : "";
|
|
1650
|
-
return /* @__PURE__ */
|
|
1651
|
-
label && /* @__PURE__ */
|
|
1652
|
-
/* @__PURE__ */
|
|
1825
|
+
return /* @__PURE__ */ jsxs19("div", { className, children: [
|
|
1826
|
+
label && /* @__PURE__ */ jsx53("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: label }),
|
|
1827
|
+
/* @__PURE__ */ jsx53(
|
|
1653
1828
|
"input",
|
|
1654
1829
|
{
|
|
1655
1830
|
ref,
|
|
@@ -1659,17 +1834,17 @@ var TimePicker = forwardRef4(
|
|
|
1659
1834
|
...props
|
|
1660
1835
|
}
|
|
1661
1836
|
),
|
|
1662
|
-
error && /* @__PURE__ */
|
|
1663
|
-
helperText && !error && /* @__PURE__ */
|
|
1837
|
+
error && /* @__PURE__ */ jsx53("p", { className: "mt-1 text-sm text-red-600 dark:text-red-400", children: error }),
|
|
1838
|
+
helperText && !error && /* @__PURE__ */ jsx53("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: helperText })
|
|
1664
1839
|
] });
|
|
1665
1840
|
}
|
|
1666
1841
|
);
|
|
1667
1842
|
TimePicker.displayName = "TimePicker";
|
|
1668
1843
|
|
|
1669
1844
|
// src/components/DateTimePicker.tsx
|
|
1670
|
-
import { useState as
|
|
1845
|
+
import { useState as useState9, useRef as useRef5, useEffect as useEffect7 } from "react";
|
|
1671
1846
|
import { createPortal as createPortal3 } from "react-dom";
|
|
1672
|
-
import { jsx as
|
|
1847
|
+
import { jsx as jsx54, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1673
1848
|
var DAYS2 = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
1674
1849
|
var MONTHS2 = [
|
|
1675
1850
|
"January",
|
|
@@ -1698,15 +1873,15 @@ var DateTimePicker = ({
|
|
|
1698
1873
|
placeholder = "Select date and time..."
|
|
1699
1874
|
}) => {
|
|
1700
1875
|
const { theme } = useTheme();
|
|
1701
|
-
const [isOpen, setIsOpen] =
|
|
1702
|
-
const [viewDate, setViewDate] =
|
|
1703
|
-
const [selectedTime, setSelectedTime] =
|
|
1876
|
+
const [isOpen, setIsOpen] = useState9(false);
|
|
1877
|
+
const [viewDate, setViewDate] = useState9(value || /* @__PURE__ */ new Date());
|
|
1878
|
+
const [selectedTime, setSelectedTime] = useState9(
|
|
1704
1879
|
value ? { hours: value.getHours(), minutes: value.getMinutes() } : { hours: 12, minutes: 0 }
|
|
1705
1880
|
);
|
|
1706
|
-
const [mounted, setMounted] =
|
|
1707
|
-
const [pickerPosition, setPickerPosition] =
|
|
1708
|
-
const inputRef =
|
|
1709
|
-
const pickerRef =
|
|
1881
|
+
const [mounted, setMounted] = useState9(false);
|
|
1882
|
+
const [pickerPosition, setPickerPosition] = useState9(null);
|
|
1883
|
+
const inputRef = useRef5(null);
|
|
1884
|
+
const pickerRef = useRef5(null);
|
|
1710
1885
|
useEffect7(() => {
|
|
1711
1886
|
setMounted(true);
|
|
1712
1887
|
}, []);
|
|
@@ -1826,7 +2001,7 @@ var DateTimePicker = ({
|
|
|
1826
2001
|
const baseStyles = "w-full appearance-none rounded-lg border border-gray-300 bg-white text-gray-900 px-4 py-2.5 text-base transition-all duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent shadow-sm hover:border-gray-400 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-100 dark:hover:border-gray-500 cursor-pointer";
|
|
1827
2002
|
const errorStyles = error ? "border-red-500 focus:ring-red-500 dark:border-red-500" : "";
|
|
1828
2003
|
const disabledStyles = disabled ? "opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-900" : "";
|
|
1829
|
-
const picker = isOpen && mounted && pickerPosition ? /* @__PURE__ */
|
|
2004
|
+
const picker = isOpen && mounted && pickerPosition ? /* @__PURE__ */ jsxs20(
|
|
1830
2005
|
"div",
|
|
1831
2006
|
{
|
|
1832
2007
|
ref: pickerRef,
|
|
@@ -1837,23 +2012,23 @@ var DateTimePicker = ({
|
|
|
1837
2012
|
minWidth: "360px"
|
|
1838
2013
|
},
|
|
1839
2014
|
children: [
|
|
1840
|
-
/* @__PURE__ */
|
|
1841
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2016
|
+
/* @__PURE__ */ jsx54(
|
|
1842
2017
|
"button",
|
|
1843
2018
|
{
|
|
1844
2019
|
onClick: handlePrevMonth,
|
|
1845
2020
|
className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",
|
|
1846
2021
|
"aria-label": "Previous month",
|
|
1847
|
-
children: /* @__PURE__ */
|
|
2022
|
+
children: /* @__PURE__ */ jsx54("svg", { className: "w-5 h-5 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx54("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
|
|
1848
2023
|
}
|
|
1849
2024
|
),
|
|
1850
|
-
/* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
2025
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2", children: [
|
|
2026
|
+
/* @__PURE__ */ jsxs20("h2", { className: "text-base font-semibold text-gray-900 dark:text-gray-100", children: [
|
|
1852
2027
|
MONTHS2[month],
|
|
1853
2028
|
" ",
|
|
1854
2029
|
year
|
|
1855
2030
|
] }),
|
|
1856
|
-
/* @__PURE__ */
|
|
2031
|
+
/* @__PURE__ */ jsx54(
|
|
1857
2032
|
"button",
|
|
1858
2033
|
{
|
|
1859
2034
|
onClick: handleToday,
|
|
@@ -1862,23 +2037,23 @@ var DateTimePicker = ({
|
|
|
1862
2037
|
}
|
|
1863
2038
|
)
|
|
1864
2039
|
] }),
|
|
1865
|
-
/* @__PURE__ */
|
|
2040
|
+
/* @__PURE__ */ jsx54(
|
|
1866
2041
|
"button",
|
|
1867
2042
|
{
|
|
1868
2043
|
onClick: handleNextMonth,
|
|
1869
2044
|
className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",
|
|
1870
2045
|
"aria-label": "Next month",
|
|
1871
|
-
children: /* @__PURE__ */
|
|
2046
|
+
children: /* @__PURE__ */ jsx54("svg", { className: "w-5 h-5 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx54("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })
|
|
1872
2047
|
}
|
|
1873
2048
|
)
|
|
1874
2049
|
] }),
|
|
1875
|
-
/* @__PURE__ */
|
|
1876
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ jsx54("div", { className: "grid grid-cols-7 gap-1 mb-2", children: DAYS2.map((day) => /* @__PURE__ */ jsx54("div", { className: "text-center text-xs font-semibold text-gray-600 dark:text-gray-400 py-1", children: day }, day)) }),
|
|
2051
|
+
/* @__PURE__ */ jsx54("div", { className: "grid grid-cols-7 gap-1 mb-4", children: calendarDays.map((date, index) => {
|
|
1877
2052
|
const isCurrentMonthDay = isCurrentMonth(date);
|
|
1878
2053
|
const isTodayDay = isToday(date);
|
|
1879
2054
|
const isSelectedDay = isSelected(date);
|
|
1880
2055
|
const isDisabledDay = isDisabled(date);
|
|
1881
|
-
return /* @__PURE__ */
|
|
2056
|
+
return /* @__PURE__ */ jsx54(
|
|
1882
2057
|
"button",
|
|
1883
2058
|
{
|
|
1884
2059
|
onClick: () => handleDateClick(date),
|
|
@@ -1896,21 +2071,21 @@ var DateTimePicker = ({
|
|
|
1896
2071
|
index
|
|
1897
2072
|
);
|
|
1898
2073
|
}) }),
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
/* @__PURE__ */
|
|
1901
|
-
/* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */
|
|
1904
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ jsxs20("div", { className: "border-t border-gray-200 dark:border-gray-700 pt-4", children: [
|
|
2075
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-center gap-4 mb-4", children: [
|
|
2076
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex flex-col items-center", children: [
|
|
2077
|
+
/* @__PURE__ */ jsx54("label", { className: "text-xs font-semibold text-gray-600 dark:text-gray-400 mb-2", children: "Hour" }),
|
|
2078
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex flex-col items-center gap-1", children: [
|
|
2079
|
+
/* @__PURE__ */ jsx54(
|
|
1905
2080
|
"button",
|
|
1906
2081
|
{
|
|
1907
2082
|
type: "button",
|
|
1908
2083
|
onClick: () => handleTimeChange((selectedTime.hours + 1) % 24, selectedTime.minutes),
|
|
1909
2084
|
className: "p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors",
|
|
1910
|
-
children: /* @__PURE__ */
|
|
2085
|
+
children: /* @__PURE__ */ jsx54("svg", { className: "w-4 h-4 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx54("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 15l7-7 7 7" }) })
|
|
1911
2086
|
}
|
|
1912
2087
|
),
|
|
1913
|
-
/* @__PURE__ */
|
|
2088
|
+
/* @__PURE__ */ jsx54(
|
|
1914
2089
|
"input",
|
|
1915
2090
|
{
|
|
1916
2091
|
type: "number",
|
|
@@ -1926,31 +2101,31 @@ var DateTimePicker = ({
|
|
|
1926
2101
|
className: "w-16 px-2 py-2 text-center border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500 text-lg font-semibold [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
|
|
1927
2102
|
}
|
|
1928
2103
|
),
|
|
1929
|
-
/* @__PURE__ */
|
|
2104
|
+
/* @__PURE__ */ jsx54(
|
|
1930
2105
|
"button",
|
|
1931
2106
|
{
|
|
1932
2107
|
type: "button",
|
|
1933
2108
|
onClick: () => handleTimeChange((selectedTime.hours - 1 + 24) % 24, selectedTime.minutes),
|
|
1934
2109
|
className: "p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors",
|
|
1935
|
-
children: /* @__PURE__ */
|
|
2110
|
+
children: /* @__PURE__ */ jsx54("svg", { className: "w-4 h-4 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx54("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) })
|
|
1936
2111
|
}
|
|
1937
2112
|
)
|
|
1938
2113
|
] })
|
|
1939
2114
|
] }),
|
|
1940
|
-
/* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */
|
|
1944
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ jsx54("span", { className: "text-2xl font-bold text-gray-600 dark:text-gray-400 mt-8", children: ":" }),
|
|
2116
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex flex-col items-center", children: [
|
|
2117
|
+
/* @__PURE__ */ jsx54("label", { className: "text-xs font-semibold text-gray-600 dark:text-gray-400 mb-2", children: "Minute" }),
|
|
2118
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex flex-col items-center gap-1", children: [
|
|
2119
|
+
/* @__PURE__ */ jsx54(
|
|
1945
2120
|
"button",
|
|
1946
2121
|
{
|
|
1947
2122
|
type: "button",
|
|
1948
2123
|
onClick: () => handleTimeChange(selectedTime.hours, (selectedTime.minutes + 1) % 60),
|
|
1949
2124
|
className: "p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors",
|
|
1950
|
-
children: /* @__PURE__ */
|
|
2125
|
+
children: /* @__PURE__ */ jsx54("svg", { className: "w-4 h-4 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx54("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 15l7-7 7 7" }) })
|
|
1951
2126
|
}
|
|
1952
2127
|
),
|
|
1953
|
-
/* @__PURE__ */
|
|
2128
|
+
/* @__PURE__ */ jsx54(
|
|
1954
2129
|
"input",
|
|
1955
2130
|
{
|
|
1956
2131
|
type: "number",
|
|
@@ -1966,20 +2141,20 @@ var DateTimePicker = ({
|
|
|
1966
2141
|
className: "w-16 px-2 py-2 text-center border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500 text-lg font-semibold [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
|
|
1967
2142
|
}
|
|
1968
2143
|
),
|
|
1969
|
-
/* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ jsx54(
|
|
1970
2145
|
"button",
|
|
1971
2146
|
{
|
|
1972
2147
|
type: "button",
|
|
1973
2148
|
onClick: () => handleTimeChange(selectedTime.hours, (selectedTime.minutes - 1 + 60) % 60),
|
|
1974
2149
|
className: "p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors",
|
|
1975
|
-
children: /* @__PURE__ */
|
|
2150
|
+
children: /* @__PURE__ */ jsx54("svg", { className: "w-4 h-4 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx54("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) })
|
|
1976
2151
|
}
|
|
1977
2152
|
)
|
|
1978
2153
|
] })
|
|
1979
2154
|
] })
|
|
1980
2155
|
] }),
|
|
1981
|
-
/* @__PURE__ */
|
|
1982
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__PURE__ */ jsx54("div", { className: "text-center text-sm text-gray-600 dark:text-gray-400 mb-4", children: formatTime(selectedTime.hours, selectedTime.minutes) }),
|
|
2157
|
+
/* @__PURE__ */ jsx54(
|
|
1983
2158
|
"button",
|
|
1984
2159
|
{
|
|
1985
2160
|
onClick: handleDone,
|
|
@@ -1991,30 +2166,30 @@ var DateTimePicker = ({
|
|
|
1991
2166
|
]
|
|
1992
2167
|
}
|
|
1993
2168
|
) : null;
|
|
1994
|
-
return /* @__PURE__ */
|
|
1995
|
-
label && /* @__PURE__ */
|
|
1996
|
-
/* @__PURE__ */
|
|
2169
|
+
return /* @__PURE__ */ jsxs20("div", { className, children: [
|
|
2170
|
+
label && /* @__PURE__ */ jsx54("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: label }),
|
|
2171
|
+
/* @__PURE__ */ jsxs20(
|
|
1997
2172
|
"div",
|
|
1998
2173
|
{
|
|
1999
2174
|
ref: inputRef,
|
|
2000
2175
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
2001
2176
|
className: `${baseStyles} ${errorStyles} ${disabledStyles} flex items-center justify-between`.trim(),
|
|
2002
2177
|
children: [
|
|
2003
|
-
/* @__PURE__ */
|
|
2004
|
-
/* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ jsx54("span", { className: !value ? "text-gray-500 dark:text-gray-400" : "", children: value ? formatDateTime(value) : placeholder }),
|
|
2179
|
+
/* @__PURE__ */ jsx54("svg", { className: "w-5 h-5 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx54("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) })
|
|
2005
2180
|
]
|
|
2006
2181
|
}
|
|
2007
2182
|
),
|
|
2008
|
-
error && /* @__PURE__ */
|
|
2009
|
-
helperText && !error && /* @__PURE__ */
|
|
2183
|
+
error && /* @__PURE__ */ jsx54("p", { className: "mt-1 text-sm text-red-600 dark:text-red-400", children: error }),
|
|
2184
|
+
helperText && !error && /* @__PURE__ */ jsx54("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: helperText }),
|
|
2010
2185
|
mounted && createPortal3(picker, document.body)
|
|
2011
2186
|
] });
|
|
2012
2187
|
};
|
|
2013
2188
|
DateTimePicker.displayName = "DateTimePicker";
|
|
2014
2189
|
|
|
2015
2190
|
// src/components/Calendar.tsx
|
|
2016
|
-
import { useState as
|
|
2017
|
-
import { jsx as
|
|
2191
|
+
import { useState as useState10 } from "react";
|
|
2192
|
+
import { jsx as jsx55, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2018
2193
|
var DAYS3 = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
2019
2194
|
var MONTHS3 = [
|
|
2020
2195
|
"January",
|
|
@@ -2038,8 +2213,8 @@ var Calendar = ({
|
|
|
2038
2213
|
className = ""
|
|
2039
2214
|
}) => {
|
|
2040
2215
|
const { theme } = useTheme();
|
|
2041
|
-
const [currentDate, setCurrentDate] =
|
|
2042
|
-
const [viewDate, setViewDate] =
|
|
2216
|
+
const [currentDate, setCurrentDate] = useState10(value || /* @__PURE__ */ new Date());
|
|
2217
|
+
const [viewDate, setViewDate] = useState10(value || /* @__PURE__ */ new Date());
|
|
2043
2218
|
const year = viewDate.getFullYear();
|
|
2044
2219
|
const month = viewDate.getMonth();
|
|
2045
2220
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
@@ -2090,24 +2265,24 @@ var Calendar = ({
|
|
|
2090
2265
|
setCurrentDate(today);
|
|
2091
2266
|
onChange?.(today);
|
|
2092
2267
|
};
|
|
2093
|
-
return /* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
2095
|
-
/* @__PURE__ */
|
|
2268
|
+
return /* @__PURE__ */ jsxs21("div", { className: `bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4 ${className}`, children: [
|
|
2269
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2270
|
+
/* @__PURE__ */ jsx55(
|
|
2096
2271
|
"button",
|
|
2097
2272
|
{
|
|
2098
2273
|
onClick: handlePrevMonth,
|
|
2099
2274
|
className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",
|
|
2100
2275
|
"aria-label": "Previous month",
|
|
2101
|
-
children: /* @__PURE__ */
|
|
2276
|
+
children: /* @__PURE__ */ jsx55("svg", { className: "w-5 h-5 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx55("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
|
|
2102
2277
|
}
|
|
2103
2278
|
),
|
|
2104
|
-
/* @__PURE__ */
|
|
2105
|
-
/* @__PURE__ */
|
|
2279
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2", children: [
|
|
2280
|
+
/* @__PURE__ */ jsxs21("h2", { className: "text-lg font-semibold text-gray-900 dark:text-gray-100", children: [
|
|
2106
2281
|
MONTHS3[month],
|
|
2107
2282
|
" ",
|
|
2108
2283
|
year
|
|
2109
2284
|
] }),
|
|
2110
|
-
/* @__PURE__ */
|
|
2285
|
+
/* @__PURE__ */ jsx55(
|
|
2111
2286
|
"button",
|
|
2112
2287
|
{
|
|
2113
2288
|
onClick: handleToday,
|
|
@@ -2116,17 +2291,17 @@ var Calendar = ({
|
|
|
2116
2291
|
}
|
|
2117
2292
|
)
|
|
2118
2293
|
] }),
|
|
2119
|
-
/* @__PURE__ */
|
|
2294
|
+
/* @__PURE__ */ jsx55(
|
|
2120
2295
|
"button",
|
|
2121
2296
|
{
|
|
2122
2297
|
onClick: handleNextMonth,
|
|
2123
2298
|
className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",
|
|
2124
2299
|
"aria-label": "Next month",
|
|
2125
|
-
children: /* @__PURE__ */
|
|
2300
|
+
children: /* @__PURE__ */ jsx55("svg", { className: "w-5 h-5 text-gray-600 dark:text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx55("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })
|
|
2126
2301
|
}
|
|
2127
2302
|
)
|
|
2128
2303
|
] }),
|
|
2129
|
-
/* @__PURE__ */
|
|
2304
|
+
/* @__PURE__ */ jsx55("div", { className: "grid grid-cols-7 gap-1 mb-2", children: DAYS3.map((day) => /* @__PURE__ */ jsx55(
|
|
2130
2305
|
"div",
|
|
2131
2306
|
{
|
|
2132
2307
|
className: "text-center text-xs font-semibold text-gray-600 dark:text-gray-400 py-2",
|
|
@@ -2134,13 +2309,13 @@ var Calendar = ({
|
|
|
2134
2309
|
},
|
|
2135
2310
|
day
|
|
2136
2311
|
)) }),
|
|
2137
|
-
/* @__PURE__ */
|
|
2138
|
-
if (!date) return /* @__PURE__ */
|
|
2312
|
+
/* @__PURE__ */ jsx55("div", { className: "grid grid-cols-7 gap-1", children: calendarDays.map((date, index) => {
|
|
2313
|
+
if (!date) return /* @__PURE__ */ jsx55("div", {}, index);
|
|
2139
2314
|
const isCurrentMonthDay = isCurrentMonth(date);
|
|
2140
2315
|
const isTodayDay = isToday(date);
|
|
2141
2316
|
const isSelectedDay = isSelected(date);
|
|
2142
2317
|
const isDisabledDay = isDisabled(date);
|
|
2143
|
-
return /* @__PURE__ */
|
|
2318
|
+
return /* @__PURE__ */ jsx55(
|
|
2144
2319
|
"button",
|
|
2145
2320
|
{
|
|
2146
2321
|
onClick: () => handleDateClick(date),
|
|
@@ -2162,8 +2337,8 @@ var Calendar = ({
|
|
|
2162
2337
|
};
|
|
2163
2338
|
|
|
2164
2339
|
// src/components/Radio.tsx
|
|
2165
|
-
import
|
|
2166
|
-
import { jsx as
|
|
2340
|
+
import React17 from "react";
|
|
2341
|
+
import { jsx as jsx56, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2167
2342
|
var Radio = ({
|
|
2168
2343
|
name,
|
|
2169
2344
|
options,
|
|
@@ -2174,7 +2349,7 @@ var Radio = ({
|
|
|
2174
2349
|
orientation = "vertical",
|
|
2175
2350
|
className = ""
|
|
2176
2351
|
}) => {
|
|
2177
|
-
const [internalValue, setInternalValue] =
|
|
2352
|
+
const [internalValue, setInternalValue] = React17.useState(defaultValue || "");
|
|
2178
2353
|
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
2179
2354
|
const handleChange = (optionValue) => {
|
|
2180
2355
|
if (disabled) return;
|
|
@@ -2182,17 +2357,17 @@ var Radio = ({
|
|
|
2182
2357
|
onChange?.(optionValue);
|
|
2183
2358
|
};
|
|
2184
2359
|
const containerClass = orientation === "horizontal" ? "flex flex-wrap gap-4" : "flex flex-col gap-2";
|
|
2185
|
-
return /* @__PURE__ */
|
|
2360
|
+
return /* @__PURE__ */ jsx56("div", { className: `${containerClass} ${className}`, role: "radiogroup", children: options.map((option) => {
|
|
2186
2361
|
const isDisabled = disabled || option.disabled;
|
|
2187
2362
|
const isChecked = value === option.value;
|
|
2188
2363
|
const id = `${name}-${option.value}`;
|
|
2189
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ jsxs22(
|
|
2190
2365
|
"label",
|
|
2191
2366
|
{
|
|
2192
2367
|
htmlFor: id,
|
|
2193
2368
|
className: `flex items-center gap-2 cursor-pointer ${isDisabled ? "opacity-50 cursor-not-allowed" : ""}`,
|
|
2194
2369
|
children: [
|
|
2195
|
-
/* @__PURE__ */
|
|
2370
|
+
/* @__PURE__ */ jsx56(
|
|
2196
2371
|
"input",
|
|
2197
2372
|
{
|
|
2198
2373
|
type: "radio",
|
|
@@ -2205,7 +2380,7 @@ var Radio = ({
|
|
|
2205
2380
|
className: "w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600 cursor-pointer disabled:cursor-not-allowed"
|
|
2206
2381
|
}
|
|
2207
2382
|
),
|
|
2208
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ jsx56("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-300", children: option.label })
|
|
2209
2384
|
]
|
|
2210
2385
|
},
|
|
2211
2386
|
option.value
|
|
@@ -2214,7 +2389,7 @@ var Radio = ({
|
|
|
2214
2389
|
};
|
|
2215
2390
|
|
|
2216
2391
|
// src/components/ProgressBar.tsx
|
|
2217
|
-
import { jsx as
|
|
2392
|
+
import { jsx as jsx57, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2218
2393
|
var ProgressBar = ({
|
|
2219
2394
|
value,
|
|
2220
2395
|
max = 100,
|
|
@@ -2225,7 +2400,7 @@ var ProgressBar = ({
|
|
|
2225
2400
|
className = ""
|
|
2226
2401
|
}) => {
|
|
2227
2402
|
const percentage = Math.min(Math.max(value / max * 100, 0), 100);
|
|
2228
|
-
const
|
|
2403
|
+
const sizeClasses7 = {
|
|
2229
2404
|
sm: "h-1",
|
|
2230
2405
|
md: "h-2",
|
|
2231
2406
|
lg: "h-3"
|
|
@@ -2236,26 +2411,26 @@ var ProgressBar = ({
|
|
|
2236
2411
|
warning: "bg-yellow-500 dark:bg-yellow-400",
|
|
2237
2412
|
danger: "bg-red-600 dark:bg-red-500"
|
|
2238
2413
|
};
|
|
2239
|
-
return /* @__PURE__ */
|
|
2240
|
-
(showLabel || label) && /* @__PURE__ */
|
|
2241
|
-
label && /* @__PURE__ */
|
|
2242
|
-
showLabel && /* @__PURE__ */
|
|
2414
|
+
return /* @__PURE__ */ jsxs23("div", { className: `w-full ${className}`, children: [
|
|
2415
|
+
(showLabel || label) && /* @__PURE__ */ jsxs23("div", { className: "flex justify-between items-center mb-1", children: [
|
|
2416
|
+
label && /* @__PURE__ */ jsx57("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: label }),
|
|
2417
|
+
showLabel && /* @__PURE__ */ jsxs23("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
2243
2418
|
Math.round(percentage),
|
|
2244
2419
|
"%"
|
|
2245
2420
|
] })
|
|
2246
2421
|
] }),
|
|
2247
|
-
/* @__PURE__ */
|
|
2422
|
+
/* @__PURE__ */ jsx57(
|
|
2248
2423
|
"div",
|
|
2249
2424
|
{
|
|
2250
|
-
className: `w-full bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden ${
|
|
2425
|
+
className: `w-full bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden ${sizeClasses7[size]}`,
|
|
2251
2426
|
role: "progressbar",
|
|
2252
2427
|
"aria-valuenow": value,
|
|
2253
2428
|
"aria-valuemin": 0,
|
|
2254
2429
|
"aria-valuemax": max,
|
|
2255
|
-
children: /* @__PURE__ */
|
|
2430
|
+
children: /* @__PURE__ */ jsx57(
|
|
2256
2431
|
"div",
|
|
2257
2432
|
{
|
|
2258
|
-
className: `${
|
|
2433
|
+
className: `${sizeClasses7[size]} ${variantClasses[variant]} rounded-full transition-all duration-300 ease-out`,
|
|
2259
2434
|
style: { width: `${percentage}%` }
|
|
2260
2435
|
}
|
|
2261
2436
|
)
|
|
@@ -2265,8 +2440,8 @@ var ProgressBar = ({
|
|
|
2265
2440
|
};
|
|
2266
2441
|
|
|
2267
2442
|
// src/components/Slider.tsx
|
|
2268
|
-
import
|
|
2269
|
-
import { jsx as
|
|
2443
|
+
import React18 from "react";
|
|
2444
|
+
import { jsx as jsx58, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2270
2445
|
var Slider = ({
|
|
2271
2446
|
value: controlledValue,
|
|
2272
2447
|
defaultValue = 50,
|
|
@@ -2279,7 +2454,7 @@ var Slider = ({
|
|
|
2279
2454
|
label,
|
|
2280
2455
|
className = ""
|
|
2281
2456
|
}) => {
|
|
2282
|
-
const [internalValue, setInternalValue] =
|
|
2457
|
+
const [internalValue, setInternalValue] = React18.useState(defaultValue);
|
|
2283
2458
|
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
2284
2459
|
const handleChange = (e) => {
|
|
2285
2460
|
const newValue = Number(e.target.value);
|
|
@@ -2287,21 +2462,21 @@ var Slider = ({
|
|
|
2287
2462
|
onChange?.(newValue);
|
|
2288
2463
|
};
|
|
2289
2464
|
const percentage = (value - min) / (max - min) * 100;
|
|
2290
|
-
return /* @__PURE__ */
|
|
2291
|
-
(label || showValue) && /* @__PURE__ */
|
|
2292
|
-
label && /* @__PURE__ */
|
|
2293
|
-
showValue && /* @__PURE__ */
|
|
2465
|
+
return /* @__PURE__ */ jsxs24("div", { className: `w-full ${className}`, children: [
|
|
2466
|
+
(label || showValue) && /* @__PURE__ */ jsxs24("div", { className: "flex justify-between items-center mb-2", children: [
|
|
2467
|
+
label && /* @__PURE__ */ jsx58("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: label }),
|
|
2468
|
+
showValue && /* @__PURE__ */ jsx58("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: value })
|
|
2294
2469
|
] }),
|
|
2295
|
-
/* @__PURE__ */
|
|
2296
|
-
/* @__PURE__ */
|
|
2297
|
-
/* @__PURE__ */
|
|
2470
|
+
/* @__PURE__ */ jsxs24("div", { className: "relative", children: [
|
|
2471
|
+
/* @__PURE__ */ jsx58("div", { className: "absolute inset-0 h-2 bg-gray-200 dark:bg-gray-700 rounded-full top-1/2 -translate-y-1/2" }),
|
|
2472
|
+
/* @__PURE__ */ jsx58(
|
|
2298
2473
|
"div",
|
|
2299
2474
|
{
|
|
2300
2475
|
className: "absolute h-2 bg-blue-600 dark:bg-blue-500 rounded-full top-1/2 -translate-y-1/2 pointer-events-none",
|
|
2301
2476
|
style: { width: `${percentage}%` }
|
|
2302
2477
|
}
|
|
2303
2478
|
),
|
|
2304
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ jsx58(
|
|
2305
2480
|
"input",
|
|
2306
2481
|
{
|
|
2307
2482
|
type: "range",
|
|
@@ -2323,8 +2498,8 @@ var Slider = ({
|
|
|
2323
2498
|
};
|
|
2324
2499
|
|
|
2325
2500
|
// src/components/Avatar.tsx
|
|
2326
|
-
import
|
|
2327
|
-
import { jsx as
|
|
2501
|
+
import React19 from "react";
|
|
2502
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
2328
2503
|
var Avatar = ({
|
|
2329
2504
|
src,
|
|
2330
2505
|
alt,
|
|
@@ -2334,8 +2509,8 @@ var Avatar = ({
|
|
|
2334
2509
|
className = "",
|
|
2335
2510
|
fallbackColor = "bg-blue-600"
|
|
2336
2511
|
}) => {
|
|
2337
|
-
const [imageError, setImageError] =
|
|
2338
|
-
const
|
|
2512
|
+
const [imageError, setImageError] = React19.useState(false);
|
|
2513
|
+
const sizeClasses7 = {
|
|
2339
2514
|
xs: "w-6 h-6 text-xs",
|
|
2340
2515
|
sm: "w-8 h-8 text-sm",
|
|
2341
2516
|
md: "w-10 h-10 text-base",
|
|
@@ -2352,11 +2527,11 @@ var Avatar = ({
|
|
|
2352
2527
|
};
|
|
2353
2528
|
const showImage = src && !imageError;
|
|
2354
2529
|
const showInitials = !showImage && name;
|
|
2355
|
-
return /* @__PURE__ */
|
|
2530
|
+
return /* @__PURE__ */ jsx59(
|
|
2356
2531
|
"div",
|
|
2357
2532
|
{
|
|
2358
|
-
className: `${
|
|
2359
|
-
children: showImage ? /* @__PURE__ */
|
|
2533
|
+
className: `${sizeClasses7[size]} ${shapeClass} flex items-center justify-center overflow-hidden ${showImage ? "bg-gray-200 dark:bg-gray-700" : `${fallbackColor} text-white`} ${className}`,
|
|
2534
|
+
children: showImage ? /* @__PURE__ */ jsx59(
|
|
2360
2535
|
"img",
|
|
2361
2536
|
{
|
|
2362
2537
|
src,
|
|
@@ -2364,13 +2539,13 @@ var Avatar = ({
|
|
|
2364
2539
|
className: "w-full h-full object-cover",
|
|
2365
2540
|
onError: () => setImageError(true)
|
|
2366
2541
|
}
|
|
2367
|
-
) : showInitials ? /* @__PURE__ */
|
|
2542
|
+
) : showInitials ? /* @__PURE__ */ jsx59("span", { className: "font-semibold select-none", children: getInitials(name) }) : /* @__PURE__ */ jsx59(
|
|
2368
2543
|
"svg",
|
|
2369
2544
|
{
|
|
2370
2545
|
className: "w-full h-full text-gray-400 dark:text-gray-600",
|
|
2371
2546
|
fill: "currentColor",
|
|
2372
2547
|
viewBox: "0 0 24 24",
|
|
2373
|
-
children: /* @__PURE__ */
|
|
2548
|
+
children: /* @__PURE__ */ jsx59("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" })
|
|
2374
2549
|
}
|
|
2375
2550
|
)
|
|
2376
2551
|
}
|
|
@@ -2378,7 +2553,7 @@ var Avatar = ({
|
|
|
2378
2553
|
};
|
|
2379
2554
|
|
|
2380
2555
|
// src/components/Textarea.tsx
|
|
2381
|
-
import { jsx as
|
|
2556
|
+
import { jsx as jsx60, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2382
2557
|
var Textarea = ({
|
|
2383
2558
|
label,
|
|
2384
2559
|
error,
|
|
@@ -2389,7 +2564,7 @@ var Textarea = ({
|
|
|
2389
2564
|
disabled,
|
|
2390
2565
|
...props
|
|
2391
2566
|
}) => {
|
|
2392
|
-
const
|
|
2567
|
+
const sizeClasses7 = {
|
|
2393
2568
|
sm: "px-3 py-1.5 text-sm min-h-[80px]",
|
|
2394
2569
|
md: "px-4 py-2 text-base min-h-[100px]",
|
|
2395
2570
|
lg: "px-4 py-3 text-lg min-h-[120px]"
|
|
@@ -2405,24 +2580,24 @@ var Textarea = ({
|
|
|
2405
2580
|
bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100
|
|
2406
2581
|
placeholder:text-gray-500 dark:placeholder:text-gray-400
|
|
2407
2582
|
disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-50 dark:disabled:bg-gray-900`;
|
|
2408
|
-
return /* @__PURE__ */
|
|
2409
|
-
label && /* @__PURE__ */
|
|
2410
|
-
/* @__PURE__ */
|
|
2583
|
+
return /* @__PURE__ */ jsxs25("div", { className: `w-full ${className}`, children: [
|
|
2584
|
+
label && /* @__PURE__ */ jsx60("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: label }),
|
|
2585
|
+
/* @__PURE__ */ jsx60(
|
|
2411
2586
|
"textarea",
|
|
2412
2587
|
{
|
|
2413
|
-
className: `${baseClasses} ${
|
|
2588
|
+
className: `${baseClasses} ${sizeClasses7[size]} ${resizeClasses[resize]}`,
|
|
2414
2589
|
disabled,
|
|
2415
2590
|
...props
|
|
2416
2591
|
}
|
|
2417
2592
|
),
|
|
2418
|
-
error && /* @__PURE__ */
|
|
2419
|
-
helperText && !error && /* @__PURE__ */
|
|
2593
|
+
error && /* @__PURE__ */ jsx60("p", { className: "mt-1 text-sm text-red-600 dark:text-red-400", children: error }),
|
|
2594
|
+
helperText && !error && /* @__PURE__ */ jsx60("p", { className: "mt-1 text-sm text-gray-500 dark:text-gray-400", children: helperText })
|
|
2420
2595
|
] });
|
|
2421
2596
|
};
|
|
2422
2597
|
|
|
2423
2598
|
// src/components/Toast.tsx
|
|
2424
|
-
import { createContext as createContext3, useContext as useContext3, useState as
|
|
2425
|
-
import { jsx as
|
|
2599
|
+
import { createContext as createContext3, useContext as useContext3, useState as useState11, useCallback } from "react";
|
|
2600
|
+
import { jsx as jsx61, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2426
2601
|
var ToastContext = createContext3(void 0);
|
|
2427
2602
|
var useToast = () => {
|
|
2428
2603
|
const context = useContext3(ToastContext);
|
|
@@ -2432,7 +2607,7 @@ var useToast = () => {
|
|
|
2432
2607
|
return context;
|
|
2433
2608
|
};
|
|
2434
2609
|
var ToastProvider = ({ children, position = "top-right" }) => {
|
|
2435
|
-
const [toasts, setToasts] =
|
|
2610
|
+
const [toasts, setToasts] = useState11([]);
|
|
2436
2611
|
const addToast = useCallback((toast2) => {
|
|
2437
2612
|
const id = Math.random().toString(36).substring(7);
|
|
2438
2613
|
const newToast = { ...toast2, id };
|
|
@@ -2453,9 +2628,9 @@ var ToastProvider = ({ children, position = "top-right" }) => {
|
|
|
2453
2628
|
"top-center": "top-4 left-1/2 -translate-x-1/2",
|
|
2454
2629
|
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2"
|
|
2455
2630
|
};
|
|
2456
|
-
return /* @__PURE__ */
|
|
2631
|
+
return /* @__PURE__ */ jsxs26(ToastContext.Provider, { value: { toasts, addToast, removeToast }, children: [
|
|
2457
2632
|
children,
|
|
2458
|
-
/* @__PURE__ */
|
|
2633
|
+
/* @__PURE__ */ jsx61("div", { className: `fixed ${positionClasses2[position]} z-50 flex flex-col gap-2 max-w-md`, children: toasts.map((toast2) => /* @__PURE__ */ jsx61(ToastItem, { toast: toast2, onClose: () => removeToast(toast2.id) }, toast2.id)) })
|
|
2459
2634
|
] });
|
|
2460
2635
|
};
|
|
2461
2636
|
var ToastItem = ({ toast: toast2, onClose }) => {
|
|
@@ -2466,27 +2641,27 @@ var ToastItem = ({ toast: toast2, onClose }) => {
|
|
|
2466
2641
|
info: "bg-blue-50 dark:bg-blue-900/30 border-blue-500 text-blue-800 dark:text-blue-200"
|
|
2467
2642
|
};
|
|
2468
2643
|
const typeIcons = {
|
|
2469
|
-
success: /* @__PURE__ */
|
|
2470
|
-
error: /* @__PURE__ */
|
|
2471
|
-
warning: /* @__PURE__ */
|
|
2472
|
-
info: /* @__PURE__ */
|
|
2644
|
+
success: /* @__PURE__ */ jsx61(CheckIcon, { size: "sm", className: "text-green-600 dark:text-green-400" }),
|
|
2645
|
+
error: /* @__PURE__ */ jsx61(CloseIcon, { size: "sm", className: "text-red-600 dark:text-red-400" }),
|
|
2646
|
+
warning: /* @__PURE__ */ jsx61("svg", { className: "w-4 h-4 text-yellow-600 dark:text-yellow-400", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx61("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
2647
|
+
info: /* @__PURE__ */ jsx61("svg", { className: "w-4 h-4 text-blue-600 dark:text-blue-400", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx61("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) })
|
|
2473
2648
|
};
|
|
2474
2649
|
const type = toast2.type || "info";
|
|
2475
|
-
return /* @__PURE__ */
|
|
2650
|
+
return /* @__PURE__ */ jsxs26(
|
|
2476
2651
|
"div",
|
|
2477
2652
|
{
|
|
2478
2653
|
className: `flex items-start gap-3 p-4 rounded-lg border-l-4 shadow-lg backdrop-blur-sm ${typeStyles[type]} animate-slide-in`,
|
|
2479
2654
|
role: "alert",
|
|
2480
2655
|
children: [
|
|
2481
|
-
/* @__PURE__ */
|
|
2482
|
-
/* @__PURE__ */
|
|
2483
|
-
/* @__PURE__ */
|
|
2656
|
+
/* @__PURE__ */ jsx61("div", { className: "flex-shrink-0 mt-0.5", children: typeIcons[type] }),
|
|
2657
|
+
/* @__PURE__ */ jsx61("p", { className: "flex-1 text-sm font-medium", children: toast2.message }),
|
|
2658
|
+
/* @__PURE__ */ jsx61(
|
|
2484
2659
|
"button",
|
|
2485
2660
|
{
|
|
2486
2661
|
onClick: onClose,
|
|
2487
2662
|
className: "flex-shrink-0 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors",
|
|
2488
2663
|
"aria-label": "Close",
|
|
2489
|
-
children: /* @__PURE__ */
|
|
2664
|
+
children: /* @__PURE__ */ jsx61(CloseIcon, { size: "sm" })
|
|
2490
2665
|
}
|
|
2491
2666
|
)
|
|
2492
2667
|
]
|
|
@@ -2517,8 +2692,8 @@ var toast = {
|
|
|
2517
2692
|
};
|
|
2518
2693
|
|
|
2519
2694
|
// src/components/Stepper.tsx
|
|
2520
|
-
import
|
|
2521
|
-
import { jsx as
|
|
2695
|
+
import React21 from "react";
|
|
2696
|
+
import { jsx as jsx62, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2522
2697
|
var Stepper = ({
|
|
2523
2698
|
steps,
|
|
2524
2699
|
currentStep,
|
|
@@ -2526,18 +2701,18 @@ var Stepper = ({
|
|
|
2526
2701
|
className = ""
|
|
2527
2702
|
}) => {
|
|
2528
2703
|
const isHorizontal = orientation === "horizontal";
|
|
2529
|
-
return /* @__PURE__ */
|
|
2704
|
+
return /* @__PURE__ */ jsx62("div", { className: `${isHorizontal ? "flex items-center" : "flex flex-col"} ${className}`, children: steps.map((step, index) => {
|
|
2530
2705
|
const stepNumber = index + 1;
|
|
2531
2706
|
const isActive = stepNumber === currentStep;
|
|
2532
2707
|
const isCompleted = stepNumber < currentStep;
|
|
2533
2708
|
const isLast = index === steps.length - 1;
|
|
2534
|
-
return /* @__PURE__ */
|
|
2535
|
-
/* @__PURE__ */
|
|
2536
|
-
/* @__PURE__ */
|
|
2709
|
+
return /* @__PURE__ */ jsxs27(React21.Fragment, { children: [
|
|
2710
|
+
/* @__PURE__ */ jsxs27("div", { className: `flex ${isHorizontal ? "flex-col items-center" : "flex-row items-start"} ${isHorizontal ? "" : "flex-1"}`, children: [
|
|
2711
|
+
/* @__PURE__ */ jsx62("div", { className: "flex items-center", children: /* @__PURE__ */ jsx62(
|
|
2537
2712
|
"div",
|
|
2538
2713
|
{
|
|
2539
2714
|
className: `flex items-center justify-center w-10 h-10 rounded-full border-2 transition-all ${isCompleted ? "bg-blue-600 border-blue-600 dark:bg-blue-500 dark:border-blue-500" : isActive ? "border-blue-600 bg-white dark:border-blue-500 dark:bg-gray-800" : "border-gray-300 bg-white dark:border-gray-600 dark:bg-gray-800"}`,
|
|
2540
|
-
children: isCompleted ? /* @__PURE__ */
|
|
2715
|
+
children: isCompleted ? /* @__PURE__ */ jsx62(CheckIcon, { size: "sm", className: "text-white" }) : /* @__PURE__ */ jsx62(
|
|
2541
2716
|
"span",
|
|
2542
2717
|
{
|
|
2543
2718
|
className: `text-sm font-semibold ${isActive ? "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"}`,
|
|
@@ -2546,18 +2721,18 @@ var Stepper = ({
|
|
|
2546
2721
|
)
|
|
2547
2722
|
}
|
|
2548
2723
|
) }),
|
|
2549
|
-
/* @__PURE__ */
|
|
2550
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ jsxs27("div", { className: `${isHorizontal ? "mt-2 text-center" : "ml-4 pb-8"} ${isLast && !isHorizontal ? "pb-0" : ""}`, children: [
|
|
2725
|
+
/* @__PURE__ */ jsx62(
|
|
2551
2726
|
"p",
|
|
2552
2727
|
{
|
|
2553
2728
|
className: `text-sm font-medium ${isActive || isCompleted ? "text-gray-900 dark:text-gray-100" : "text-gray-500 dark:text-gray-400"}`,
|
|
2554
2729
|
children: step.label
|
|
2555
2730
|
}
|
|
2556
2731
|
),
|
|
2557
|
-
step.description && /* @__PURE__ */
|
|
2732
|
+
step.description && /* @__PURE__ */ jsx62("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1", children: step.description })
|
|
2558
2733
|
] })
|
|
2559
2734
|
] }),
|
|
2560
|
-
!isLast && /* @__PURE__ */
|
|
2735
|
+
!isLast && /* @__PURE__ */ jsx62(
|
|
2561
2736
|
"div",
|
|
2562
2737
|
{
|
|
2563
2738
|
className: `${isHorizontal ? "flex-1 h-0.5 mx-4" : "w-0.5 h-full ml-5 -mt-8"} ${isCompleted || isActive && stepNumber < currentStep ? "bg-blue-600 dark:bg-blue-500" : "bg-gray-300 dark:bg-gray-600"}`
|
|
@@ -2568,7 +2743,7 @@ var Stepper = ({
|
|
|
2568
2743
|
};
|
|
2569
2744
|
|
|
2570
2745
|
// src/components/Divider.tsx
|
|
2571
|
-
import { jsx as
|
|
2746
|
+
import { jsx as jsx63, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2572
2747
|
var Divider = ({
|
|
2573
2748
|
orientation = "horizontal",
|
|
2574
2749
|
variant = "solid",
|
|
@@ -2587,14 +2762,14 @@ var Divider = ({
|
|
|
2587
2762
|
center: "justify-center",
|
|
2588
2763
|
right: "justify-end"
|
|
2589
2764
|
};
|
|
2590
|
-
return /* @__PURE__ */
|
|
2591
|
-
labelPosition !== "left" && /* @__PURE__ */
|
|
2592
|
-
/* @__PURE__ */
|
|
2593
|
-
labelPosition !== "right" && /* @__PURE__ */
|
|
2765
|
+
return /* @__PURE__ */ jsxs28("div", { className: `flex items-center ${alignmentClasses[labelPosition]} ${className}`, role: "separator", children: [
|
|
2766
|
+
labelPosition !== "left" && /* @__PURE__ */ jsx63("div", { className: `flex-1 border-t ${variantClasses[variant]} border-gray-300 dark:border-gray-600` }),
|
|
2767
|
+
/* @__PURE__ */ jsx63("span", { className: "px-4 text-sm text-gray-500 dark:text-gray-400", children: label }),
|
|
2768
|
+
labelPosition !== "right" && /* @__PURE__ */ jsx63("div", { className: `flex-1 border-t ${variantClasses[variant]} border-gray-300 dark:border-gray-600` })
|
|
2594
2769
|
] });
|
|
2595
2770
|
}
|
|
2596
2771
|
if (orientation === "vertical") {
|
|
2597
|
-
return /* @__PURE__ */
|
|
2772
|
+
return /* @__PURE__ */ jsx63(
|
|
2598
2773
|
"div",
|
|
2599
2774
|
{
|
|
2600
2775
|
className: `inline-block h-full border-l ${variantClasses[variant]} border-gray-300 dark:border-gray-600 ${className}`,
|
|
@@ -2603,7 +2778,7 @@ var Divider = ({
|
|
|
2603
2778
|
}
|
|
2604
2779
|
);
|
|
2605
2780
|
}
|
|
2606
|
-
return /* @__PURE__ */
|
|
2781
|
+
return /* @__PURE__ */ jsx63(
|
|
2607
2782
|
"hr",
|
|
2608
2783
|
{
|
|
2609
2784
|
className: `border-t ${variantClasses[variant]} border-gray-300 dark:border-gray-600 ${className}`,
|
|
@@ -2613,8 +2788,8 @@ var Divider = ({
|
|
|
2613
2788
|
};
|
|
2614
2789
|
|
|
2615
2790
|
// src/components/FileUpload.tsx
|
|
2616
|
-
import { useRef as
|
|
2617
|
-
import { jsx as
|
|
2791
|
+
import { useRef as useRef6, useState as useState12 } from "react";
|
|
2792
|
+
import { jsx as jsx64, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2618
2793
|
var FileUpload = ({
|
|
2619
2794
|
accept,
|
|
2620
2795
|
multiple = false,
|
|
@@ -2627,9 +2802,9 @@ var FileUpload = ({
|
|
|
2627
2802
|
label,
|
|
2628
2803
|
helperText
|
|
2629
2804
|
}) => {
|
|
2630
|
-
const [files, setFiles] =
|
|
2631
|
-
const [isDragging, setIsDragging] =
|
|
2632
|
-
const fileInputRef =
|
|
2805
|
+
const [files, setFiles] = useState12([]);
|
|
2806
|
+
const [isDragging, setIsDragging] = useState12(false);
|
|
2807
|
+
const fileInputRef = useRef6(null);
|
|
2633
2808
|
const formatFileSize = (bytes) => {
|
|
2634
2809
|
if (bytes === 0) return "0 Bytes";
|
|
2635
2810
|
const k = 1024;
|
|
@@ -2687,9 +2862,9 @@ var FileUpload = ({
|
|
|
2687
2862
|
setFiles(newFiles);
|
|
2688
2863
|
onChange?.(newFiles);
|
|
2689
2864
|
};
|
|
2690
|
-
return /* @__PURE__ */
|
|
2691
|
-
label && /* @__PURE__ */
|
|
2692
|
-
/* @__PURE__ */
|
|
2865
|
+
return /* @__PURE__ */ jsxs29("div", { className: `w-full ${className}`, children: [
|
|
2866
|
+
label && /* @__PURE__ */ jsx64("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: label }),
|
|
2867
|
+
/* @__PURE__ */ jsxs29(
|
|
2693
2868
|
"div",
|
|
2694
2869
|
{
|
|
2695
2870
|
onDrop: handleDrop,
|
|
@@ -2698,7 +2873,7 @@ var FileUpload = ({
|
|
|
2698
2873
|
onClick: handleClick,
|
|
2699
2874
|
className: `relative border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-all ${isDragging ? "border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"} ${disabled ? "opacity-50 cursor-not-allowed" : ""}`,
|
|
2700
2875
|
children: [
|
|
2701
|
-
/* @__PURE__ */
|
|
2876
|
+
/* @__PURE__ */ jsx64(
|
|
2702
2877
|
"input",
|
|
2703
2878
|
{
|
|
2704
2879
|
ref: fileInputRef,
|
|
@@ -2710,14 +2885,14 @@ var FileUpload = ({
|
|
|
2710
2885
|
className: "hidden"
|
|
2711
2886
|
}
|
|
2712
2887
|
),
|
|
2713
|
-
/* @__PURE__ */
|
|
2714
|
-
/* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2888
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex flex-col items-center gap-2", children: [
|
|
2889
|
+
/* @__PURE__ */ jsx64("div", { className: "w-12 h-12 rounded-full bg-gray-100 dark:bg-gray-800 flex items-center justify-center", children: /* @__PURE__ */ jsx64(UploadIcon, { size: "lg", className: "text-gray-400 dark:text-gray-500" }) }),
|
|
2890
|
+
/* @__PURE__ */ jsxs29("div", { children: [
|
|
2891
|
+
/* @__PURE__ */ jsxs29("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
2892
|
+
/* @__PURE__ */ jsx64("span", { className: "text-blue-600 dark:text-blue-400", children: "Click to upload" }),
|
|
2718
2893
|
" or drag and drop"
|
|
2719
2894
|
] }),
|
|
2720
|
-
/* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ jsxs29("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1", children: [
|
|
2721
2896
|
accept ? `Accepted: ${accept}` : "Any file type",
|
|
2722
2897
|
maxSize && ` \u2022 Max size: ${formatFileSize(maxSize)}`
|
|
2723
2898
|
] })
|
|
@@ -2726,17 +2901,17 @@ var FileUpload = ({
|
|
|
2726
2901
|
]
|
|
2727
2902
|
}
|
|
2728
2903
|
),
|
|
2729
|
-
helperText && /* @__PURE__ */
|
|
2730
|
-
files.length > 0 && /* @__PURE__ */
|
|
2904
|
+
helperText && /* @__PURE__ */ jsx64("p", { className: "mt-2 text-sm text-gray-500 dark:text-gray-400", children: helperText }),
|
|
2905
|
+
files.length > 0 && /* @__PURE__ */ jsx64("div", { className: "mt-4 space-y-2", children: files.map((file, index) => /* @__PURE__ */ jsxs29(
|
|
2731
2906
|
"div",
|
|
2732
2907
|
{
|
|
2733
2908
|
className: "flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700",
|
|
2734
2909
|
children: [
|
|
2735
|
-
/* @__PURE__ */
|
|
2736
|
-
/* @__PURE__ */
|
|
2737
|
-
/* @__PURE__ */
|
|
2910
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex-1 min-w-0", children: [
|
|
2911
|
+
/* @__PURE__ */ jsx64("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100 truncate", children: file.name }),
|
|
2912
|
+
/* @__PURE__ */ jsx64("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: formatFileSize(file.size) })
|
|
2738
2913
|
] }),
|
|
2739
|
-
/* @__PURE__ */
|
|
2914
|
+
/* @__PURE__ */ jsx64(
|
|
2740
2915
|
"button",
|
|
2741
2916
|
{
|
|
2742
2917
|
onClick: (e) => {
|
|
@@ -2745,7 +2920,7 @@ var FileUpload = ({
|
|
|
2745
2920
|
},
|
|
2746
2921
|
className: "ml-4 text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors",
|
|
2747
2922
|
"aria-label": "Remove file",
|
|
2748
|
-
children: /* @__PURE__ */
|
|
2923
|
+
children: /* @__PURE__ */ jsx64(CloseIcon, { size: "sm" })
|
|
2749
2924
|
}
|
|
2750
2925
|
)
|
|
2751
2926
|
]
|
|
@@ -2823,6 +2998,7 @@ export {
|
|
|
2823
2998
|
MenuIcon,
|
|
2824
2999
|
Modal,
|
|
2825
3000
|
Navbar,
|
|
3001
|
+
NumberInput,
|
|
2826
3002
|
Pagination,
|
|
2827
3003
|
PlusIcon,
|
|
2828
3004
|
ProgressBar,
|