@j3m-quantum/ui 1.3.0 → 1.4.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/README.md +74 -20
- package/cursor-rules-for-consumers.md +171 -28
- package/dist/index.cjs +435 -238
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -6
- package/dist/index.d.ts +46 -6
- package/dist/index.js +430 -236
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +383 -111
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React15 = require('react');
|
|
4
4
|
var reactSlot = require('@radix-ui/react-slot');
|
|
5
5
|
var classVarianceAuthority = require('class-variance-authority');
|
|
6
6
|
var clsx = require('clsx');
|
|
@@ -31,13 +31,13 @@ var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
|
31
31
|
var sonner = require('sonner');
|
|
32
32
|
var cmdk = require('cmdk');
|
|
33
33
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
34
|
+
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
|
34
35
|
var MenubarPrimitive = require('@radix-ui/react-menubar');
|
|
35
36
|
var NavigationMenuPrimitive = require('@radix-ui/react-navigation-menu');
|
|
36
37
|
var ContextMenuPrimitive = require('@radix-ui/react-context-menu');
|
|
37
38
|
var vaul = require('vaul');
|
|
38
39
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
39
40
|
var HoverCardPrimitive = require('@radix-ui/react-hover-card');
|
|
40
|
-
var ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
|
|
41
41
|
var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
|
|
42
42
|
var ResizablePrimitive = require('react-resizable-panels');
|
|
43
43
|
var dateFns = require('date-fns');
|
|
@@ -62,7 +62,7 @@ function _interopNamespace(e) {
|
|
|
62
62
|
return Object.freeze(n);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
var
|
|
65
|
+
var React15__namespace = /*#__PURE__*/_interopNamespace(React15);
|
|
66
66
|
var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
|
|
67
67
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
68
68
|
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
@@ -83,20 +83,20 @@ var AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(AlertDialog
|
|
|
83
83
|
var ProgressPrimitive__namespace = /*#__PURE__*/_interopNamespace(ProgressPrimitive);
|
|
84
84
|
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
|
|
85
85
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
86
|
+
var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
|
|
86
87
|
var MenubarPrimitive__namespace = /*#__PURE__*/_interopNamespace(MenubarPrimitive);
|
|
87
88
|
var NavigationMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(NavigationMenuPrimitive);
|
|
88
89
|
var ContextMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(ContextMenuPrimitive);
|
|
89
90
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
90
91
|
var HoverCardPrimitive__namespace = /*#__PURE__*/_interopNamespace(HoverCardPrimitive);
|
|
91
|
-
var ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive);
|
|
92
92
|
var CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespace(CollapsiblePrimitive);
|
|
93
93
|
var ResizablePrimitive__namespace = /*#__PURE__*/_interopNamespace(ResizablePrimitive);
|
|
94
94
|
|
|
95
95
|
// src/hooks/use-mobile.ts
|
|
96
96
|
var MOBILE_BREAKPOINT = 768;
|
|
97
97
|
function useIsMobile() {
|
|
98
|
-
const [isMobile, setIsMobile] =
|
|
99
|
-
|
|
98
|
+
const [isMobile, setIsMobile] = React15__namespace.useState(void 0);
|
|
99
|
+
React15__namespace.useEffect(() => {
|
|
100
100
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
101
101
|
const onChange = () => {
|
|
102
102
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
@@ -137,7 +137,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
);
|
|
140
|
-
var Button =
|
|
140
|
+
var Button = React15__namespace.forwardRef(
|
|
141
141
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
142
142
|
const Comp = asChild ? reactSlot.Slot : "button";
|
|
143
143
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -245,7 +245,7 @@ function Input({ className, type, ...props }) {
|
|
|
245
245
|
type,
|
|
246
246
|
"data-slot": "input",
|
|
247
247
|
className: cn(
|
|
248
|
-
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-
|
|
248
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-4 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
249
249
|
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
250
250
|
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
251
251
|
className
|
|
@@ -501,7 +501,7 @@ function Slider({
|
|
|
501
501
|
max = 100,
|
|
502
502
|
...props
|
|
503
503
|
}) {
|
|
504
|
-
const _values =
|
|
504
|
+
const _values = React15__namespace.useMemo(
|
|
505
505
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
506
506
|
[value, defaultValue, min, max]
|
|
507
507
|
);
|
|
@@ -787,7 +787,7 @@ function Toggle({
|
|
|
787
787
|
}
|
|
788
788
|
);
|
|
789
789
|
}
|
|
790
|
-
var ToggleGroupContext =
|
|
790
|
+
var ToggleGroupContext = React15__namespace.createContext({
|
|
791
791
|
size: "default",
|
|
792
792
|
variant: "default",
|
|
793
793
|
spacing: 0
|
|
@@ -824,7 +824,7 @@ function ToggleGroupItem({
|
|
|
824
824
|
size,
|
|
825
825
|
...props
|
|
826
826
|
}) {
|
|
827
|
-
const context =
|
|
827
|
+
const context = React15__namespace.useContext(ToggleGroupContext);
|
|
828
828
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
829
829
|
ToggleGroupPrimitive__namespace.Item,
|
|
830
830
|
{
|
|
@@ -846,6 +846,125 @@ function ToggleGroupItem({
|
|
|
846
846
|
}
|
|
847
847
|
);
|
|
848
848
|
}
|
|
849
|
+
function ThemeSwitch({
|
|
850
|
+
checked,
|
|
851
|
+
defaultChecked = false,
|
|
852
|
+
onCheckedChange,
|
|
853
|
+
disabled = false,
|
|
854
|
+
className,
|
|
855
|
+
size = "default"
|
|
856
|
+
}) {
|
|
857
|
+
const [isChecked, setIsChecked] = React15__namespace.useState(defaultChecked);
|
|
858
|
+
const isControlled = checked !== void 0;
|
|
859
|
+
const currentChecked = isControlled ? checked : isChecked;
|
|
860
|
+
const handleClick = () => {
|
|
861
|
+
if (disabled) return;
|
|
862
|
+
const newValue = !currentChecked;
|
|
863
|
+
if (!isControlled) {
|
|
864
|
+
setIsChecked(newValue);
|
|
865
|
+
}
|
|
866
|
+
onCheckedChange?.(newValue);
|
|
867
|
+
};
|
|
868
|
+
const sizeClasses = {
|
|
869
|
+
sm: {
|
|
870
|
+
track: "h-5 w-9",
|
|
871
|
+
thumb: "size-4",
|
|
872
|
+
icon: "h-2.5 w-2.5",
|
|
873
|
+
translate: "data-[state=checked]:translate-x-4"
|
|
874
|
+
},
|
|
875
|
+
default: {
|
|
876
|
+
track: "h-6 w-11",
|
|
877
|
+
thumb: "size-5",
|
|
878
|
+
icon: "h-3 w-3",
|
|
879
|
+
translate: "data-[state=checked]:translate-x-5"
|
|
880
|
+
},
|
|
881
|
+
lg: {
|
|
882
|
+
track: "h-7 w-14",
|
|
883
|
+
thumb: "size-6",
|
|
884
|
+
icon: "h-3.5 w-3.5",
|
|
885
|
+
translate: "data-[state=checked]:translate-x-7"
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
const sizes = sizeClasses[size];
|
|
889
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
890
|
+
"button",
|
|
891
|
+
{
|
|
892
|
+
type: "button",
|
|
893
|
+
role: "switch",
|
|
894
|
+
"aria-checked": currentChecked,
|
|
895
|
+
"aria-label": currentChecked ? "Switch to light mode" : "Switch to dark mode",
|
|
896
|
+
"data-slot": "theme-switch",
|
|
897
|
+
"data-state": currentChecked ? "checked" : "unchecked",
|
|
898
|
+
disabled,
|
|
899
|
+
onClick: handleClick,
|
|
900
|
+
className: cn(
|
|
901
|
+
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full",
|
|
902
|
+
"border border-transparent shadow-xs transition-all outline-none",
|
|
903
|
+
"focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
904
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
905
|
+
"bg-input data-[state=checked]:bg-primary",
|
|
906
|
+
sizes.track,
|
|
907
|
+
className
|
|
908
|
+
),
|
|
909
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
910
|
+
"span",
|
|
911
|
+
{
|
|
912
|
+
"data-state": currentChecked ? "checked" : "unchecked",
|
|
913
|
+
className: cn(
|
|
914
|
+
"pointer-events-none flex items-center justify-center rounded-full",
|
|
915
|
+
"bg-white shadow-lg ring-0 transition-transform",
|
|
916
|
+
"data-[state=unchecked]:translate-x-0.5",
|
|
917
|
+
sizes.thumb,
|
|
918
|
+
sizes.translate
|
|
919
|
+
),
|
|
920
|
+
children: currentChecked ? /* @__PURE__ */ jsxRuntime.jsx(MoonIcon, { className: cn(sizes.icon, "text-primary") }) : /* @__PURE__ */ jsxRuntime.jsx(SunIcon, { className: cn(sizes.icon, "text-muted-foreground") })
|
|
921
|
+
}
|
|
922
|
+
)
|
|
923
|
+
}
|
|
924
|
+
);
|
|
925
|
+
}
|
|
926
|
+
function SunIcon({ className }) {
|
|
927
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
928
|
+
"svg",
|
|
929
|
+
{
|
|
930
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
931
|
+
viewBox: "0 0 24 24",
|
|
932
|
+
fill: "none",
|
|
933
|
+
stroke: "currentColor",
|
|
934
|
+
strokeWidth: "2",
|
|
935
|
+
strokeLinecap: "round",
|
|
936
|
+
strokeLinejoin: "round",
|
|
937
|
+
className,
|
|
938
|
+
children: [
|
|
939
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "4" }),
|
|
940
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2v2" }),
|
|
941
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 20v2" }),
|
|
942
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m4.93 4.93 1.41 1.41" }),
|
|
943
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m17.66 17.66 1.41 1.41" }),
|
|
944
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 12h2" }),
|
|
945
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 12h2" }),
|
|
946
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6.34 17.66-1.41 1.41" }),
|
|
947
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m19.07 4.93-1.41 1.41" })
|
|
948
|
+
]
|
|
949
|
+
}
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
function MoonIcon({ className }) {
|
|
953
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
954
|
+
"svg",
|
|
955
|
+
{
|
|
956
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
957
|
+
viewBox: "0 0 24 24",
|
|
958
|
+
fill: "none",
|
|
959
|
+
stroke: "currentColor",
|
|
960
|
+
strokeWidth: "2",
|
|
961
|
+
strokeLinecap: "round",
|
|
962
|
+
strokeLinejoin: "round",
|
|
963
|
+
className,
|
|
964
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" })
|
|
965
|
+
}
|
|
966
|
+
);
|
|
967
|
+
}
|
|
849
968
|
function ToolBarCanvas({
|
|
850
969
|
className,
|
|
851
970
|
...props
|
|
@@ -1155,7 +1274,7 @@ function Label2({
|
|
|
1155
1274
|
);
|
|
1156
1275
|
}
|
|
1157
1276
|
var Form = reactHookForm.FormProvider;
|
|
1158
|
-
var FormFieldContext =
|
|
1277
|
+
var FormFieldContext = React15__namespace.createContext(
|
|
1159
1278
|
{}
|
|
1160
1279
|
);
|
|
1161
1280
|
var FormField = ({
|
|
@@ -1164,8 +1283,8 @@ var FormField = ({
|
|
|
1164
1283
|
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
|
|
1165
1284
|
};
|
|
1166
1285
|
var useFormField = () => {
|
|
1167
|
-
const fieldContext =
|
|
1168
|
-
const itemContext =
|
|
1286
|
+
const fieldContext = React15__namespace.useContext(FormFieldContext);
|
|
1287
|
+
const itemContext = React15__namespace.useContext(FormItemContext);
|
|
1169
1288
|
const { getFieldState } = reactHookForm.useFormContext();
|
|
1170
1289
|
const formState = reactHookForm.useFormState({ name: fieldContext.name });
|
|
1171
1290
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
@@ -1182,11 +1301,11 @@ var useFormField = () => {
|
|
|
1182
1301
|
...fieldState
|
|
1183
1302
|
};
|
|
1184
1303
|
};
|
|
1185
|
-
var FormItemContext =
|
|
1304
|
+
var FormItemContext = React15__namespace.createContext(
|
|
1186
1305
|
{}
|
|
1187
1306
|
);
|
|
1188
1307
|
function FormItem({ className, ...props }) {
|
|
1189
|
-
const id =
|
|
1308
|
+
const id = React15__namespace.useId();
|
|
1190
1309
|
return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1191
1310
|
"div",
|
|
1192
1311
|
{
|
|
@@ -1434,7 +1553,7 @@ function FieldError({
|
|
|
1434
1553
|
errors,
|
|
1435
1554
|
...props
|
|
1436
1555
|
}) {
|
|
1437
|
-
const content =
|
|
1556
|
+
const content = React15.useMemo(() => {
|
|
1438
1557
|
if (children) {
|
|
1439
1558
|
return children;
|
|
1440
1559
|
}
|
|
@@ -2103,7 +2222,7 @@ function TabsList({
|
|
|
2103
2222
|
{
|
|
2104
2223
|
"data-slot": "tabs-list",
|
|
2105
2224
|
className: cn(
|
|
2106
|
-
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]
|
|
2225
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
|
|
2107
2226
|
className
|
|
2108
2227
|
),
|
|
2109
2228
|
...props
|
|
@@ -2288,8 +2407,8 @@ function CalendarDayButton({
|
|
|
2288
2407
|
modifiers,
|
|
2289
2408
|
...props
|
|
2290
2409
|
}) {
|
|
2291
|
-
const ref =
|
|
2292
|
-
|
|
2410
|
+
const ref = React15__namespace.useRef(null);
|
|
2411
|
+
React15__namespace.useEffect(() => {
|
|
2293
2412
|
if (modifiers.focused) ref.current?.focus();
|
|
2294
2413
|
}, [modifiers.focused]);
|
|
2295
2414
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2310,9 +2429,9 @@ function CalendarDayButton({
|
|
|
2310
2429
|
}
|
|
2311
2430
|
);
|
|
2312
2431
|
}
|
|
2313
|
-
var CarouselContext =
|
|
2432
|
+
var CarouselContext = React15__namespace.createContext(null);
|
|
2314
2433
|
function useCarousel() {
|
|
2315
|
-
const context =
|
|
2434
|
+
const context = React15__namespace.useContext(CarouselContext);
|
|
2316
2435
|
if (!context) {
|
|
2317
2436
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
2318
2437
|
}
|
|
@@ -2334,20 +2453,20 @@ function Carousel({
|
|
|
2334
2453
|
},
|
|
2335
2454
|
plugins
|
|
2336
2455
|
);
|
|
2337
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
2338
|
-
const [canScrollNext, setCanScrollNext] =
|
|
2339
|
-
const onSelect =
|
|
2456
|
+
const [canScrollPrev, setCanScrollPrev] = React15__namespace.useState(false);
|
|
2457
|
+
const [canScrollNext, setCanScrollNext] = React15__namespace.useState(false);
|
|
2458
|
+
const onSelect = React15__namespace.useCallback((api2) => {
|
|
2340
2459
|
if (!api2) return;
|
|
2341
2460
|
setCanScrollPrev(api2.canScrollPrev());
|
|
2342
2461
|
setCanScrollNext(api2.canScrollNext());
|
|
2343
2462
|
}, []);
|
|
2344
|
-
const scrollPrev =
|
|
2463
|
+
const scrollPrev = React15__namespace.useCallback(() => {
|
|
2345
2464
|
api?.scrollPrev();
|
|
2346
2465
|
}, [api]);
|
|
2347
|
-
const scrollNext =
|
|
2466
|
+
const scrollNext = React15__namespace.useCallback(() => {
|
|
2348
2467
|
api?.scrollNext();
|
|
2349
2468
|
}, [api]);
|
|
2350
|
-
const handleKeyDown =
|
|
2469
|
+
const handleKeyDown = React15__namespace.useCallback(
|
|
2351
2470
|
(event) => {
|
|
2352
2471
|
if (event.key === "ArrowLeft") {
|
|
2353
2472
|
event.preventDefault();
|
|
@@ -2359,11 +2478,11 @@ function Carousel({
|
|
|
2359
2478
|
},
|
|
2360
2479
|
[scrollPrev, scrollNext]
|
|
2361
2480
|
);
|
|
2362
|
-
|
|
2481
|
+
React15__namespace.useEffect(() => {
|
|
2363
2482
|
if (!api || !setApi) return;
|
|
2364
2483
|
setApi(api);
|
|
2365
2484
|
}, [api, setApi]);
|
|
2366
|
-
|
|
2485
|
+
React15__namespace.useEffect(() => {
|
|
2367
2486
|
if (!api) return;
|
|
2368
2487
|
onSelect(api);
|
|
2369
2488
|
api.on("reInit", onSelect);
|
|
@@ -2496,9 +2615,9 @@ function CarouselNext({
|
|
|
2496
2615
|
);
|
|
2497
2616
|
}
|
|
2498
2617
|
var THEMES = { light: "", dark: ".dark" };
|
|
2499
|
-
var ChartContext =
|
|
2618
|
+
var ChartContext = React15__namespace.createContext(null);
|
|
2500
2619
|
function useChart() {
|
|
2501
|
-
const context =
|
|
2620
|
+
const context = React15__namespace.useContext(ChartContext);
|
|
2502
2621
|
if (!context) {
|
|
2503
2622
|
throw new Error("useChart must be used within a <ChartContainer />");
|
|
2504
2623
|
}
|
|
@@ -2511,7 +2630,7 @@ function ChartContainer({
|
|
|
2511
2630
|
config,
|
|
2512
2631
|
...props
|
|
2513
2632
|
}) {
|
|
2514
|
-
const uniqueId =
|
|
2633
|
+
const uniqueId = React15__namespace.useId();
|
|
2515
2634
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
2516
2635
|
return /* @__PURE__ */ jsxRuntime.jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2517
2636
|
"div",
|
|
@@ -2572,7 +2691,7 @@ function ChartTooltipContent({
|
|
|
2572
2691
|
labelKey
|
|
2573
2692
|
}) {
|
|
2574
2693
|
const { config } = useChart();
|
|
2575
|
-
const tooltipLabel =
|
|
2694
|
+
const tooltipLabel = React15__namespace.useMemo(() => {
|
|
2576
2695
|
if (hideLabel || !payload?.length) {
|
|
2577
2696
|
return null;
|
|
2578
2697
|
}
|
|
@@ -3275,8 +3394,8 @@ function TooltipContent({
|
|
|
3275
3394
|
) });
|
|
3276
3395
|
}
|
|
3277
3396
|
function useDetectTheme() {
|
|
3278
|
-
const [theme, setTheme] =
|
|
3279
|
-
|
|
3397
|
+
const [theme, setTheme] = React15__namespace.useState("light");
|
|
3398
|
+
React15__namespace.useEffect(() => {
|
|
3280
3399
|
const isDark = document.documentElement.classList.contains("dark");
|
|
3281
3400
|
setTheme(isDark ? "dark" : "light");
|
|
3282
3401
|
const observer = new MutationObserver((mutations) => {
|
|
@@ -3643,6 +3762,59 @@ function DialogDescription({
|
|
|
3643
3762
|
}
|
|
3644
3763
|
);
|
|
3645
3764
|
}
|
|
3765
|
+
function ScrollArea({
|
|
3766
|
+
className,
|
|
3767
|
+
children,
|
|
3768
|
+
...props
|
|
3769
|
+
}) {
|
|
3770
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3771
|
+
ScrollAreaPrimitive__namespace.Root,
|
|
3772
|
+
{
|
|
3773
|
+
"data-slot": "scroll-area",
|
|
3774
|
+
className: cn("relative", className),
|
|
3775
|
+
...props,
|
|
3776
|
+
children: [
|
|
3777
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3778
|
+
ScrollAreaPrimitive__namespace.Viewport,
|
|
3779
|
+
{
|
|
3780
|
+
"data-slot": "scroll-area-viewport",
|
|
3781
|
+
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
3782
|
+
children
|
|
3783
|
+
}
|
|
3784
|
+
),
|
|
3785
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollBar, {}),
|
|
3786
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
|
|
3787
|
+
]
|
|
3788
|
+
}
|
|
3789
|
+
);
|
|
3790
|
+
}
|
|
3791
|
+
function ScrollBar({
|
|
3792
|
+
className,
|
|
3793
|
+
orientation = "vertical",
|
|
3794
|
+
...props
|
|
3795
|
+
}) {
|
|
3796
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3797
|
+
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
3798
|
+
{
|
|
3799
|
+
"data-slot": "scroll-area-scrollbar",
|
|
3800
|
+
orientation,
|
|
3801
|
+
className: cn(
|
|
3802
|
+
"flex touch-none p-px transition-colors select-none",
|
|
3803
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
3804
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
3805
|
+
className
|
|
3806
|
+
),
|
|
3807
|
+
...props,
|
|
3808
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3809
|
+
ScrollAreaPrimitive__namespace.ScrollAreaThumb,
|
|
3810
|
+
{
|
|
3811
|
+
"data-slot": "scroll-area-thumb",
|
|
3812
|
+
className: "bg-border relative flex-1 rounded-full"
|
|
3813
|
+
}
|
|
3814
|
+
)
|
|
3815
|
+
}
|
|
3816
|
+
);
|
|
3817
|
+
}
|
|
3646
3818
|
function Command({
|
|
3647
3819
|
className,
|
|
3648
3820
|
...props
|
|
@@ -3712,17 +3884,17 @@ function CommandList({
|
|
|
3712
3884
|
className,
|
|
3713
3885
|
...props
|
|
3714
3886
|
}) {
|
|
3715
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3887
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "max-h-[300px]", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3716
3888
|
cmdk.Command.List,
|
|
3717
3889
|
{
|
|
3718
3890
|
"data-slot": "command-list",
|
|
3719
3891
|
className: cn(
|
|
3720
|
-
"
|
|
3892
|
+
"scroll-py-1",
|
|
3721
3893
|
className
|
|
3722
3894
|
),
|
|
3723
3895
|
...props
|
|
3724
3896
|
}
|
|
3725
|
-
);
|
|
3897
|
+
) });
|
|
3726
3898
|
}
|
|
3727
3899
|
function CommandEmpty({
|
|
3728
3900
|
...props
|
|
@@ -3797,7 +3969,7 @@ function CommandShortcut({
|
|
|
3797
3969
|
}
|
|
3798
3970
|
);
|
|
3799
3971
|
}
|
|
3800
|
-
var SearchTrigger =
|
|
3972
|
+
var SearchTrigger = React15__namespace.forwardRef(
|
|
3801
3973
|
({
|
|
3802
3974
|
className,
|
|
3803
3975
|
placeholder = "Search...",
|
|
@@ -3833,7 +4005,7 @@ var SearchTrigger = React14__namespace.forwardRef(
|
|
|
3833
4005
|
);
|
|
3834
4006
|
SearchTrigger.displayName = "SearchTrigger";
|
|
3835
4007
|
function useSearchShortcut(onOpen, key = "k") {
|
|
3836
|
-
|
|
4008
|
+
React15__namespace.useEffect(() => {
|
|
3837
4009
|
const down = (e) => {
|
|
3838
4010
|
if (e.key.toLowerCase() === key.toLowerCase() && (e.metaKey || e.ctrlKey)) {
|
|
3839
4011
|
e.preventDefault();
|
|
@@ -4729,59 +4901,6 @@ function HoverCardContent({
|
|
|
4729
4901
|
}
|
|
4730
4902
|
) });
|
|
4731
4903
|
}
|
|
4732
|
-
function ScrollArea({
|
|
4733
|
-
className,
|
|
4734
|
-
children,
|
|
4735
|
-
...props
|
|
4736
|
-
}) {
|
|
4737
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4738
|
-
ScrollAreaPrimitive__namespace.Root,
|
|
4739
|
-
{
|
|
4740
|
-
"data-slot": "scroll-area",
|
|
4741
|
-
className: cn("relative", className),
|
|
4742
|
-
...props,
|
|
4743
|
-
children: [
|
|
4744
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4745
|
-
ScrollAreaPrimitive__namespace.Viewport,
|
|
4746
|
-
{
|
|
4747
|
-
"data-slot": "scroll-area-viewport",
|
|
4748
|
-
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
4749
|
-
children
|
|
4750
|
-
}
|
|
4751
|
-
),
|
|
4752
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScrollBar, {}),
|
|
4753
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
|
|
4754
|
-
]
|
|
4755
|
-
}
|
|
4756
|
-
);
|
|
4757
|
-
}
|
|
4758
|
-
function ScrollBar({
|
|
4759
|
-
className,
|
|
4760
|
-
orientation = "vertical",
|
|
4761
|
-
...props
|
|
4762
|
-
}) {
|
|
4763
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4764
|
-
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
4765
|
-
{
|
|
4766
|
-
"data-slot": "scroll-area-scrollbar",
|
|
4767
|
-
orientation,
|
|
4768
|
-
className: cn(
|
|
4769
|
-
"flex touch-none p-px transition-colors select-none",
|
|
4770
|
-
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
4771
|
-
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
4772
|
-
className
|
|
4773
|
-
),
|
|
4774
|
-
...props,
|
|
4775
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4776
|
-
ScrollAreaPrimitive__namespace.ScrollAreaThumb,
|
|
4777
|
-
{
|
|
4778
|
-
"data-slot": "scroll-area-thumb",
|
|
4779
|
-
className: "bg-border relative flex-1 rounded-full"
|
|
4780
|
-
}
|
|
4781
|
-
)
|
|
4782
|
-
}
|
|
4783
|
-
);
|
|
4784
|
-
}
|
|
4785
4904
|
function Collapsible({
|
|
4786
4905
|
...props
|
|
4787
4906
|
}) {
|
|
@@ -4861,9 +4980,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
4861
4980
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
4862
4981
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
4863
4982
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
4864
|
-
var SidebarContext =
|
|
4983
|
+
var SidebarContext = React15__namespace.createContext(null);
|
|
4865
4984
|
function useSidebar() {
|
|
4866
|
-
const context =
|
|
4985
|
+
const context = React15__namespace.useContext(SidebarContext);
|
|
4867
4986
|
if (!context) {
|
|
4868
4987
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
4869
4988
|
}
|
|
@@ -4879,10 +4998,10 @@ function SidebarProvider({
|
|
|
4879
4998
|
...props
|
|
4880
4999
|
}) {
|
|
4881
5000
|
const isMobile = useIsMobile();
|
|
4882
|
-
const [openMobile, setOpenMobile] =
|
|
4883
|
-
const [_open, _setOpen] =
|
|
5001
|
+
const [openMobile, setOpenMobile] = React15__namespace.useState(false);
|
|
5002
|
+
const [_open, _setOpen] = React15__namespace.useState(defaultOpen);
|
|
4884
5003
|
const open = openProp ?? _open;
|
|
4885
|
-
const setOpen =
|
|
5004
|
+
const setOpen = React15__namespace.useCallback(
|
|
4886
5005
|
(value) => {
|
|
4887
5006
|
const openState = typeof value === "function" ? value(open) : value;
|
|
4888
5007
|
if (setOpenProp) {
|
|
@@ -4894,10 +5013,10 @@ function SidebarProvider({
|
|
|
4894
5013
|
},
|
|
4895
5014
|
[setOpenProp, open]
|
|
4896
5015
|
);
|
|
4897
|
-
const toggleSidebar =
|
|
5016
|
+
const toggleSidebar = React15__namespace.useCallback(() => {
|
|
4898
5017
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
4899
5018
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
4900
|
-
|
|
5019
|
+
React15__namespace.useEffect(() => {
|
|
4901
5020
|
const handleKeyDown = (event) => {
|
|
4902
5021
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
4903
5022
|
event.preventDefault();
|
|
@@ -4908,7 +5027,7 @@ function SidebarProvider({
|
|
|
4908
5027
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
4909
5028
|
}, [toggleSidebar]);
|
|
4910
5029
|
const state = open ? "expanded" : "collapsed";
|
|
4911
|
-
const contextValue =
|
|
5030
|
+
const contextValue = React15__namespace.useMemo(
|
|
4912
5031
|
() => ({
|
|
4913
5032
|
state,
|
|
4914
5033
|
open,
|
|
@@ -5366,7 +5485,7 @@ function SidebarMenuSkeleton({
|
|
|
5366
5485
|
showIcon = false,
|
|
5367
5486
|
...props
|
|
5368
5487
|
}) {
|
|
5369
|
-
const width =
|
|
5488
|
+
const width = React15__namespace.useMemo(() => {
|
|
5370
5489
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
5371
5490
|
}, []);
|
|
5372
5491
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5509,7 +5628,7 @@ var sectionVariants = classVarianceAuthority.cva(
|
|
|
5509
5628
|
}
|
|
5510
5629
|
);
|
|
5511
5630
|
var isGlassVariant = (variant) => variant?.startsWith("glass-") ?? false;
|
|
5512
|
-
var Section =
|
|
5631
|
+
var Section = React15__namespace.forwardRef(
|
|
5513
5632
|
({ className, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5514
5633
|
"section",
|
|
5515
5634
|
{
|
|
@@ -5521,7 +5640,7 @@ var Section = React14__namespace.forwardRef(
|
|
|
5521
5640
|
)
|
|
5522
5641
|
);
|
|
5523
5642
|
Section.displayName = "Section";
|
|
5524
|
-
var SectionHeader =
|
|
5643
|
+
var SectionHeader = React15__namespace.forwardRef(
|
|
5525
5644
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5526
5645
|
"div",
|
|
5527
5646
|
{
|
|
@@ -5536,7 +5655,7 @@ var SectionHeader = React14__namespace.forwardRef(
|
|
|
5536
5655
|
)
|
|
5537
5656
|
);
|
|
5538
5657
|
SectionHeader.displayName = "SectionHeader";
|
|
5539
|
-
var SectionTitle =
|
|
5658
|
+
var SectionTitle = React15__namespace.forwardRef(
|
|
5540
5659
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5541
5660
|
"h2",
|
|
5542
5661
|
{
|
|
@@ -5550,7 +5669,7 @@ var SectionTitle = React14__namespace.forwardRef(
|
|
|
5550
5669
|
)
|
|
5551
5670
|
);
|
|
5552
5671
|
SectionTitle.displayName = "SectionTitle";
|
|
5553
|
-
var SectionDescription =
|
|
5672
|
+
var SectionDescription = React15__namespace.forwardRef(
|
|
5554
5673
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5555
5674
|
"p",
|
|
5556
5675
|
{
|
|
@@ -5564,7 +5683,7 @@ var SectionDescription = React14__namespace.forwardRef(
|
|
|
5564
5683
|
)
|
|
5565
5684
|
);
|
|
5566
5685
|
SectionDescription.displayName = "SectionDescription";
|
|
5567
|
-
var SectionContent =
|
|
5686
|
+
var SectionContent = React15__namespace.forwardRef(
|
|
5568
5687
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5569
5688
|
"div",
|
|
5570
5689
|
{
|
|
@@ -5578,7 +5697,7 @@ var SectionContent = React14__namespace.forwardRef(
|
|
|
5578
5697
|
)
|
|
5579
5698
|
);
|
|
5580
5699
|
SectionContent.displayName = "SectionContent";
|
|
5581
|
-
var SectionFooter =
|
|
5700
|
+
var SectionFooter = React15__namespace.forwardRef(
|
|
5582
5701
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5583
5702
|
"div",
|
|
5584
5703
|
{
|
|
@@ -5629,7 +5748,7 @@ function SiteHeader({
|
|
|
5629
5748
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-[var(--header-height,3.5rem)] w-full items-center gap-[var(--j3m-spacing-s)] px-[var(--j3m-spacing-m)]", children: [
|
|
5630
5749
|
trigger,
|
|
5631
5750
|
trigger && /* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "vertical", className: "mr-[var(--j3m-spacing-s)] h-4" }),
|
|
5632
|
-
/* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { className: "hidden sm:block", children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbList, { children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5751
|
+
/* @__PURE__ */ jsxRuntime.jsx(Breadcrumb, { className: "hidden sm:block", children: /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbList, { children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React15__namespace.Fragment, { children: [
|
|
5633
5752
|
index > 0 && /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbSeparator, {}),
|
|
5634
5753
|
/* @__PURE__ */ jsxRuntime.jsx(BreadcrumbItem, { children: item.href ? /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbLink, { href: item.href, children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbPage, { children: item.label }) })
|
|
5635
5754
|
] }, index)) }) }),
|
|
@@ -5841,7 +5960,7 @@ var BADGE_VARIANT_LABELS = {
|
|
|
5841
5960
|
colored: "Colored",
|
|
5842
5961
|
mixed: "Mixed"
|
|
5843
5962
|
};
|
|
5844
|
-
var CalendarContext =
|
|
5963
|
+
var CalendarContext = React15__namespace.createContext(null);
|
|
5845
5964
|
function EventCalendarProvider({
|
|
5846
5965
|
children,
|
|
5847
5966
|
events: initialEvents = [],
|
|
@@ -5856,38 +5975,38 @@ function EventCalendarProvider({
|
|
|
5856
5975
|
onEventUpdate,
|
|
5857
5976
|
onEventDelete
|
|
5858
5977
|
}) {
|
|
5859
|
-
const [selectedDate, setSelectedDate] =
|
|
5860
|
-
const [selectedUserId, setSelectedUserId] =
|
|
5861
|
-
const [events, setEventsState] =
|
|
5862
|
-
const [users] =
|
|
5863
|
-
const [badgeVariant, setBadgeVariant] =
|
|
5864
|
-
const [view, setView] =
|
|
5865
|
-
const [workingHours, setWorkingHours] =
|
|
5866
|
-
const [visibleHours, setVisibleHours] =
|
|
5867
|
-
|
|
5978
|
+
const [selectedDate, setSelectedDate] = React15__namespace.useState(defaultDate);
|
|
5979
|
+
const [selectedUserId, setSelectedUserId] = React15__namespace.useState(defaultUserId);
|
|
5980
|
+
const [events, setEventsState] = React15__namespace.useState(initialEvents);
|
|
5981
|
+
const [users] = React15__namespace.useState(initialUsers);
|
|
5982
|
+
const [badgeVariant, setBadgeVariant] = React15__namespace.useState(defaultBadgeVariant);
|
|
5983
|
+
const [view, setView] = React15__namespace.useState(defaultView);
|
|
5984
|
+
const [workingHours, setWorkingHours] = React15__namespace.useState(defaultWorkingHours);
|
|
5985
|
+
const [visibleHours, setVisibleHours] = React15__namespace.useState(defaultVisibleHours);
|
|
5986
|
+
React15__namespace.useEffect(() => {
|
|
5868
5987
|
setEventsState(initialEvents);
|
|
5869
5988
|
}, [initialEvents]);
|
|
5870
|
-
const setEvents =
|
|
5989
|
+
const setEvents = React15__namespace.useCallback((newEvents) => {
|
|
5871
5990
|
setEventsState(newEvents);
|
|
5872
5991
|
}, []);
|
|
5873
|
-
const addEvent =
|
|
5992
|
+
const addEvent = React15__namespace.useCallback((event) => {
|
|
5874
5993
|
setEventsState((prev) => [...prev, event]);
|
|
5875
5994
|
onEventAdd?.(event);
|
|
5876
5995
|
}, [onEventAdd]);
|
|
5877
|
-
const updateEvent =
|
|
5996
|
+
const updateEvent = React15__namespace.useCallback((event) => {
|
|
5878
5997
|
setEventsState(
|
|
5879
5998
|
(prev) => prev.map((e) => e.id === event.id ? event : e)
|
|
5880
5999
|
);
|
|
5881
6000
|
onEventUpdate?.(event);
|
|
5882
6001
|
}, [onEventUpdate]);
|
|
5883
|
-
const deleteEvent =
|
|
6002
|
+
const deleteEvent = React15__namespace.useCallback((eventId) => {
|
|
5884
6003
|
setEventsState((prev) => prev.filter((e) => e.id !== eventId));
|
|
5885
6004
|
onEventDelete?.(eventId);
|
|
5886
6005
|
}, [onEventDelete]);
|
|
5887
|
-
const goToToday =
|
|
6006
|
+
const goToToday = React15__namespace.useCallback(() => {
|
|
5888
6007
|
setSelectedDate(/* @__PURE__ */ new Date());
|
|
5889
6008
|
}, []);
|
|
5890
|
-
const goToPrevious =
|
|
6009
|
+
const goToPrevious = React15__namespace.useCallback(() => {
|
|
5891
6010
|
setSelectedDate((current) => {
|
|
5892
6011
|
switch (view) {
|
|
5893
6012
|
case "day":
|
|
@@ -5905,7 +6024,7 @@ function EventCalendarProvider({
|
|
|
5905
6024
|
}
|
|
5906
6025
|
});
|
|
5907
6026
|
}, [view]);
|
|
5908
|
-
const goToNext =
|
|
6027
|
+
const goToNext = React15__namespace.useCallback(() => {
|
|
5909
6028
|
setSelectedDate((current) => {
|
|
5910
6029
|
switch (view) {
|
|
5911
6030
|
case "day":
|
|
@@ -5923,7 +6042,7 @@ function EventCalendarProvider({
|
|
|
5923
6042
|
}
|
|
5924
6043
|
});
|
|
5925
6044
|
}, [view]);
|
|
5926
|
-
const contextValue =
|
|
6045
|
+
const contextValue = React15__namespace.useMemo(
|
|
5927
6046
|
() => ({
|
|
5928
6047
|
// State
|
|
5929
6048
|
selectedDate,
|
|
@@ -5970,7 +6089,7 @@ function EventCalendarProvider({
|
|
|
5970
6089
|
return /* @__PURE__ */ jsxRuntime.jsx(CalendarContext.Provider, { value: contextValue, children });
|
|
5971
6090
|
}
|
|
5972
6091
|
function useEventCalendar() {
|
|
5973
|
-
const context =
|
|
6092
|
+
const context = React15__namespace.useContext(CalendarContext);
|
|
5974
6093
|
if (!context) {
|
|
5975
6094
|
throw new Error("useEventCalendar must be used within an EventCalendarProvider");
|
|
5976
6095
|
}
|
|
@@ -5978,14 +6097,14 @@ function useEventCalendar() {
|
|
|
5978
6097
|
}
|
|
5979
6098
|
function useFilteredEvents() {
|
|
5980
6099
|
const { events, selectedUserId } = useEventCalendar();
|
|
5981
|
-
return
|
|
6100
|
+
return React15__namespace.useMemo(() => {
|
|
5982
6101
|
if (!selectedUserId) return events;
|
|
5983
6102
|
return events.filter((event) => event.user.id === selectedUserId);
|
|
5984
6103
|
}, [events, selectedUserId]);
|
|
5985
6104
|
}
|
|
5986
6105
|
function useEventsInRange(startDate, endDate) {
|
|
5987
6106
|
const filteredEvents = useFilteredEvents();
|
|
5988
|
-
return
|
|
6107
|
+
return React15__namespace.useMemo(() => {
|
|
5989
6108
|
return filteredEvents.filter((event) => {
|
|
5990
6109
|
const eventStart = new Date(event.startDate);
|
|
5991
6110
|
const eventEnd = new Date(event.endDate);
|
|
@@ -6543,8 +6662,8 @@ function MoreEvents({ count, onClick, className }) {
|
|
|
6543
6662
|
);
|
|
6544
6663
|
}
|
|
6545
6664
|
function TimeIndicator({ className }) {
|
|
6546
|
-
const [now, setNow] =
|
|
6547
|
-
|
|
6665
|
+
const [now, setNow] = React15__namespace.useState(/* @__PURE__ */ new Date());
|
|
6666
|
+
React15__namespace.useEffect(() => {
|
|
6548
6667
|
const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
|
|
6549
6668
|
return () => clearInterval(interval);
|
|
6550
6669
|
}, []);
|
|
@@ -6581,24 +6700,24 @@ function DateBadge({ date, className }) {
|
|
|
6581
6700
|
}
|
|
6582
6701
|
);
|
|
6583
6702
|
}
|
|
6584
|
-
var DragContext =
|
|
6703
|
+
var DragContext = React15__namespace.createContext(null);
|
|
6585
6704
|
function DragProvider({
|
|
6586
6705
|
children,
|
|
6587
6706
|
snapMinutes = 15,
|
|
6588
6707
|
onDragStart,
|
|
6589
6708
|
onDragEnd
|
|
6590
6709
|
}) {
|
|
6591
|
-
const [draggedEvent, setDraggedEventState] =
|
|
6592
|
-
const [isDragging, setIsDragging] =
|
|
6710
|
+
const [draggedEvent, setDraggedEventState] = React15__namespace.useState(null);
|
|
6711
|
+
const [isDragging, setIsDragging] = React15__namespace.useState(false);
|
|
6593
6712
|
const { updateEvent } = useEventCalendar();
|
|
6594
|
-
const setDraggedEvent =
|
|
6713
|
+
const setDraggedEvent = React15__namespace.useCallback((event) => {
|
|
6595
6714
|
setDraggedEventState(event);
|
|
6596
6715
|
setIsDragging(!!event);
|
|
6597
6716
|
if (event) {
|
|
6598
6717
|
onDragStart?.(event);
|
|
6599
6718
|
}
|
|
6600
6719
|
}, [onDragStart]);
|
|
6601
|
-
const handleDrop =
|
|
6720
|
+
const handleDrop = React15__namespace.useCallback((newStartDate) => {
|
|
6602
6721
|
if (!draggedEvent) return;
|
|
6603
6722
|
const snappedDate = snapToInterval(newStartDate, snapMinutes);
|
|
6604
6723
|
const { startDate, endDate } = calculateDropDates(draggedEvent, snappedDate);
|
|
@@ -6611,7 +6730,7 @@ function DragProvider({
|
|
|
6611
6730
|
onDragEnd?.(updatedEvent, new Date(startDate), new Date(endDate));
|
|
6612
6731
|
setDraggedEvent(null);
|
|
6613
6732
|
}, [draggedEvent, snapMinutes, updateEvent, onDragEnd, setDraggedEvent]);
|
|
6614
|
-
const contextValue =
|
|
6733
|
+
const contextValue = React15__namespace.useMemo(
|
|
6615
6734
|
() => ({
|
|
6616
6735
|
draggedEvent,
|
|
6617
6736
|
setDraggedEvent,
|
|
@@ -6622,7 +6741,7 @@ function DragProvider({
|
|
|
6622
6741
|
return /* @__PURE__ */ jsxRuntime.jsx(DragContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(DragDropHandler, { onDrop: handleDrop, children }) });
|
|
6623
6742
|
}
|
|
6624
6743
|
function useDrag() {
|
|
6625
|
-
const context =
|
|
6744
|
+
const context = React15__namespace.useContext(DragContext);
|
|
6626
6745
|
if (!context) {
|
|
6627
6746
|
throw new Error("useDrag must be used within a DragProvider");
|
|
6628
6747
|
}
|
|
@@ -6667,7 +6786,7 @@ function DroppableZone({
|
|
|
6667
6786
|
}) {
|
|
6668
6787
|
const { draggedEvent, setDraggedEvent } = useDrag();
|
|
6669
6788
|
const { updateEvent } = useEventCalendar();
|
|
6670
|
-
const [isOver, setIsOver] =
|
|
6789
|
+
const [isOver, setIsOver] = React15__namespace.useState(false);
|
|
6671
6790
|
const handleDragOver = (e) => {
|
|
6672
6791
|
e.preventDefault();
|
|
6673
6792
|
e.dataTransfer.dropEffect = "move";
|
|
@@ -6705,23 +6824,23 @@ function DroppableZone({
|
|
|
6705
6824
|
function useDroppable({ date, hour, minute = 0, onDrop }) {
|
|
6706
6825
|
const { draggedEvent, setDraggedEvent } = useDrag();
|
|
6707
6826
|
const { updateEvent } = useEventCalendar();
|
|
6708
|
-
const [isOver, setIsOver] =
|
|
6709
|
-
const dropTargetDate =
|
|
6827
|
+
const [isOver, setIsOver] = React15__namespace.useState(false);
|
|
6828
|
+
const dropTargetDate = React15__namespace.useMemo(() => {
|
|
6710
6829
|
const targetDate = new Date(date);
|
|
6711
6830
|
if (hour !== void 0) {
|
|
6712
6831
|
targetDate.setHours(hour, minute, 0, 0);
|
|
6713
6832
|
}
|
|
6714
6833
|
return targetDate;
|
|
6715
6834
|
}, [date, hour, minute]);
|
|
6716
|
-
const handleDragOver =
|
|
6835
|
+
const handleDragOver = React15__namespace.useCallback((e) => {
|
|
6717
6836
|
e.preventDefault();
|
|
6718
6837
|
e.dataTransfer.dropEffect = "move";
|
|
6719
6838
|
if (!isOver) setIsOver(true);
|
|
6720
6839
|
}, [isOver]);
|
|
6721
|
-
const handleDragLeave =
|
|
6840
|
+
const handleDragLeave = React15__namespace.useCallback(() => {
|
|
6722
6841
|
setIsOver(false);
|
|
6723
6842
|
}, []);
|
|
6724
|
-
const handleDrop =
|
|
6843
|
+
const handleDrop = React15__namespace.useCallback((e) => {
|
|
6725
6844
|
e.preventDefault();
|
|
6726
6845
|
setIsOver(false);
|
|
6727
6846
|
if (!draggedEvent) return;
|
|
@@ -6748,13 +6867,13 @@ function useDroppable({ date, hour, minute = 0, onDrop }) {
|
|
|
6748
6867
|
function useDraggable(event, disabled = false) {
|
|
6749
6868
|
const { setDraggedEvent, draggedEvent } = useDrag();
|
|
6750
6869
|
const isDragged = draggedEvent?.id === event.id;
|
|
6751
|
-
const handleDragStart =
|
|
6870
|
+
const handleDragStart = React15__namespace.useCallback((e) => {
|
|
6752
6871
|
if (disabled) return;
|
|
6753
6872
|
e.dataTransfer.effectAllowed = "move";
|
|
6754
6873
|
e.dataTransfer.setData("text/plain", event.id);
|
|
6755
6874
|
setDraggedEvent(event);
|
|
6756
6875
|
}, [disabled, event, setDraggedEvent]);
|
|
6757
|
-
const handleDragEnd =
|
|
6876
|
+
const handleDragEnd = React15__namespace.useCallback(() => {
|
|
6758
6877
|
setDraggedEvent(null);
|
|
6759
6878
|
}, [setDraggedEvent]);
|
|
6760
6879
|
return {
|
|
@@ -6795,15 +6914,15 @@ function MonthView({
|
|
|
6795
6914
|
}) {
|
|
6796
6915
|
const { selectedDate, badgeVariant, setSelectedDate, setView } = useEventCalendar();
|
|
6797
6916
|
const filteredEvents = useFilteredEvents();
|
|
6798
|
-
const { singleDayEvents, multiDayEvents } =
|
|
6917
|
+
const { singleDayEvents, multiDayEvents } = React15__namespace.useMemo(
|
|
6799
6918
|
() => splitEventsByDuration(filteredEvents),
|
|
6800
6919
|
[filteredEvents]
|
|
6801
6920
|
);
|
|
6802
|
-
const cells =
|
|
6921
|
+
const cells = React15__namespace.useMemo(
|
|
6803
6922
|
() => getCalendarCells(selectedDate),
|
|
6804
6923
|
[selectedDate]
|
|
6805
6924
|
);
|
|
6806
|
-
const eventPositions =
|
|
6925
|
+
const eventPositions = React15__namespace.useMemo(
|
|
6807
6926
|
() => calculateMonthEventPositions(multiDayEvents, singleDayEvents, selectedDate),
|
|
6808
6927
|
[multiDayEvents, singleDayEvents, selectedDate]
|
|
6809
6928
|
);
|
|
@@ -6985,7 +7104,7 @@ function WeekView({
|
|
|
6985
7104
|
visibleHours
|
|
6986
7105
|
} = useEventCalendar();
|
|
6987
7106
|
const filteredEvents = useFilteredEvents();
|
|
6988
|
-
const { singleDayEvents, multiDayEvents } =
|
|
7107
|
+
const { singleDayEvents, multiDayEvents } = React15__namespace.useMemo(
|
|
6989
7108
|
() => splitEventsByDuration(filteredEvents),
|
|
6990
7109
|
[filteredEvents]
|
|
6991
7110
|
);
|
|
@@ -7191,8 +7310,8 @@ function CalendarTimeline({
|
|
|
7191
7310
|
firstVisibleHour,
|
|
7192
7311
|
lastVisibleHour
|
|
7193
7312
|
}) {
|
|
7194
|
-
const [currentTime, setCurrentTime] =
|
|
7195
|
-
|
|
7313
|
+
const [currentTime, setCurrentTime] = React15__namespace.useState(/* @__PURE__ */ new Date());
|
|
7314
|
+
React15__namespace.useEffect(() => {
|
|
7196
7315
|
const interval = setInterval(() => {
|
|
7197
7316
|
setCurrentTime(/* @__PURE__ */ new Date());
|
|
7198
7317
|
}, 6e4);
|
|
@@ -7275,7 +7394,7 @@ function DayView({
|
|
|
7275
7394
|
visibleHours
|
|
7276
7395
|
} = useEventCalendar();
|
|
7277
7396
|
const filteredEvents = useFilteredEvents();
|
|
7278
|
-
const { singleDayEvents, multiDayEvents } =
|
|
7397
|
+
const { singleDayEvents, multiDayEvents } = React15__namespace.useMemo(
|
|
7279
7398
|
() => splitEventsByDuration(filteredEvents),
|
|
7280
7399
|
[filteredEvents]
|
|
7281
7400
|
);
|
|
@@ -7283,7 +7402,7 @@ function DayView({
|
|
|
7283
7402
|
visibleHours,
|
|
7284
7403
|
singleDayEvents
|
|
7285
7404
|
);
|
|
7286
|
-
const currentEvents =
|
|
7405
|
+
const currentEvents = React15__namespace.useMemo(() => {
|
|
7287
7406
|
if (!dateFns.isToday(selectedDate)) return [];
|
|
7288
7407
|
return getCurrentEvents(singleDayEvents);
|
|
7289
7408
|
}, [singleDayEvents, selectedDate]);
|
|
@@ -7507,8 +7626,8 @@ function CalendarTimeline2({
|
|
|
7507
7626
|
firstVisibleHour,
|
|
7508
7627
|
lastVisibleHour
|
|
7509
7628
|
}) {
|
|
7510
|
-
const [currentTime, setCurrentTime] =
|
|
7511
|
-
|
|
7629
|
+
const [currentTime, setCurrentTime] = React15__namespace.useState(/* @__PURE__ */ new Date());
|
|
7630
|
+
React15__namespace.useEffect(() => {
|
|
7512
7631
|
const interval = setInterval(() => {
|
|
7513
7632
|
setCurrentTime(/* @__PURE__ */ new Date());
|
|
7514
7633
|
}, 6e4);
|
|
@@ -7542,7 +7661,7 @@ function YearView({
|
|
|
7542
7661
|
}) {
|
|
7543
7662
|
const { selectedDate, setSelectedDate, setView } = useEventCalendar();
|
|
7544
7663
|
const filteredEvents = useFilteredEvents();
|
|
7545
|
-
const months =
|
|
7664
|
+
const months = React15__namespace.useMemo(() => {
|
|
7546
7665
|
const yearStart = dateFns.startOfYear(selectedDate);
|
|
7547
7666
|
return Array.from({ length: 12 }, (_, i) => dateFns.addMonths(yearStart, i));
|
|
7548
7667
|
}, [selectedDate]);
|
|
@@ -7665,11 +7784,11 @@ function AgendaView({
|
|
|
7665
7784
|
}) {
|
|
7666
7785
|
const { selectedDate, setSelectedDate, setView } = useEventCalendar();
|
|
7667
7786
|
const filteredEvents = useFilteredEvents();
|
|
7668
|
-
const { singleDayEvents, multiDayEvents } =
|
|
7787
|
+
const { singleDayEvents, multiDayEvents } = React15__namespace.useMemo(
|
|
7669
7788
|
() => splitEventsByDuration(filteredEvents),
|
|
7670
7789
|
[filteredEvents]
|
|
7671
7790
|
);
|
|
7672
|
-
const eventsByDay =
|
|
7791
|
+
const eventsByDay = React15__namespace.useMemo(() => {
|
|
7673
7792
|
const allDates = /* @__PURE__ */ new Map();
|
|
7674
7793
|
singleDayEvents.forEach((event) => {
|
|
7675
7794
|
const eventDate = dateFns.parseISO(event.startDate);
|
|
@@ -7842,7 +7961,9 @@ function CalendarHeader({
|
|
|
7842
7961
|
// Hidden by default, controlled via settings
|
|
7843
7962
|
showToday = true,
|
|
7844
7963
|
showAddButton = true,
|
|
7845
|
-
|
|
7964
|
+
showSettings = true,
|
|
7965
|
+
onAddClick,
|
|
7966
|
+
onSettingsClick
|
|
7846
7967
|
}) {
|
|
7847
7968
|
const {
|
|
7848
7969
|
selectedDate,
|
|
@@ -7991,9 +8112,22 @@ function CalendarHeader({
|
|
|
7991
8112
|
}
|
|
7992
8113
|
)
|
|
7993
8114
|
] }),
|
|
7994
|
-
|
|
7995
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7996
|
-
|
|
8115
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8116
|
+
showSettings && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8117
|
+
Button,
|
|
8118
|
+
{
|
|
8119
|
+
variant: "outline",
|
|
8120
|
+
size: "icon",
|
|
8121
|
+
onClick: onSettingsClick,
|
|
8122
|
+
className: "shrink-0",
|
|
8123
|
+
"aria-label": "Calendar settings",
|
|
8124
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4" })
|
|
8125
|
+
}
|
|
8126
|
+
),
|
|
8127
|
+
showAddButton && /* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: onAddClick, className: "w-full sm:w-auto", children: [
|
|
8128
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, {}),
|
|
8129
|
+
"Add Event"
|
|
8130
|
+
] })
|
|
7997
8131
|
] })
|
|
7998
8132
|
] })
|
|
7999
8133
|
]
|
|
@@ -8003,7 +8137,9 @@ function CalendarHeader({
|
|
|
8003
8137
|
function CalendarHeaderCompact({
|
|
8004
8138
|
className,
|
|
8005
8139
|
showAddButton = true,
|
|
8006
|
-
|
|
8140
|
+
showSettings = true,
|
|
8141
|
+
onAddClick,
|
|
8142
|
+
onSettingsClick
|
|
8007
8143
|
}) {
|
|
8008
8144
|
const {
|
|
8009
8145
|
selectedDate,
|
|
@@ -8083,7 +8219,18 @@ function CalendarHeaderCompact({
|
|
|
8083
8219
|
}
|
|
8084
8220
|
)
|
|
8085
8221
|
] }),
|
|
8086
|
-
|
|
8222
|
+
showSettings && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8223
|
+
Button,
|
|
8224
|
+
{
|
|
8225
|
+
variant: "outline",
|
|
8226
|
+
size: "icon",
|
|
8227
|
+
onClick: onSettingsClick,
|
|
8228
|
+
className: "ml-2 size-8",
|
|
8229
|
+
"aria-label": "Calendar settings",
|
|
8230
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4" })
|
|
8231
|
+
}
|
|
8232
|
+
),
|
|
8233
|
+
showAddButton && /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: onAddClick, className: "size-8 p-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-4" }) })
|
|
8087
8234
|
] })
|
|
8088
8235
|
]
|
|
8089
8236
|
}
|
|
@@ -8106,16 +8253,16 @@ function EventDialog({
|
|
|
8106
8253
|
defaultUserId
|
|
8107
8254
|
}) {
|
|
8108
8255
|
const { addEvent, updateEvent, deleteEvent, users } = useEventCalendar();
|
|
8109
|
-
const [title, setTitle] =
|
|
8110
|
-
const [description, setDescription] =
|
|
8111
|
-
const [startDate, setStartDate] =
|
|
8112
|
-
const [startTime, setStartTime] =
|
|
8113
|
-
const [endDate, setEndDate] =
|
|
8114
|
-
const [endTime, setEndTime] =
|
|
8115
|
-
const [color, setColor] =
|
|
8116
|
-
const [userId, setUserId] =
|
|
8117
|
-
const [isSubmitting, setIsSubmitting] =
|
|
8118
|
-
|
|
8256
|
+
const [title, setTitle] = React15__namespace.useState("");
|
|
8257
|
+
const [description, setDescription] = React15__namespace.useState("");
|
|
8258
|
+
const [startDate, setStartDate] = React15__namespace.useState("");
|
|
8259
|
+
const [startTime, setStartTime] = React15__namespace.useState("");
|
|
8260
|
+
const [endDate, setEndDate] = React15__namespace.useState("");
|
|
8261
|
+
const [endTime, setEndTime] = React15__namespace.useState("");
|
|
8262
|
+
const [color, setColor] = React15__namespace.useState("blue");
|
|
8263
|
+
const [userId, setUserId] = React15__namespace.useState("");
|
|
8264
|
+
const [isSubmitting, setIsSubmitting] = React15__namespace.useState(false);
|
|
8265
|
+
React15__namespace.useEffect(() => {
|
|
8119
8266
|
if (open) {
|
|
8120
8267
|
if (mode === "edit" && event) {
|
|
8121
8268
|
const start = dateFns.parseISO(event.startDate);
|
|
@@ -8338,7 +8485,7 @@ function QuickAddEvent({
|
|
|
8338
8485
|
onOpenDialog,
|
|
8339
8486
|
onClose
|
|
8340
8487
|
}) {
|
|
8341
|
-
const [title, setTitle] =
|
|
8488
|
+
const [title, setTitle] = React15__namespace.useState("");
|
|
8342
8489
|
const { users } = useEventCalendar();
|
|
8343
8490
|
const handleSubmit = (e) => {
|
|
8344
8491
|
e.preventDefault();
|
|
@@ -8405,8 +8552,8 @@ var HOUR_OPTIONS = Array.from({ length: 25 }, (_, i) => {
|
|
|
8405
8552
|
});
|
|
8406
8553
|
function ChangeVisibleHoursInput() {
|
|
8407
8554
|
const { visibleHours, setVisibleHours } = useEventCalendar();
|
|
8408
|
-
const [from, setFrom] =
|
|
8409
|
-
const [to, setTo] =
|
|
8555
|
+
const [from, setFrom] = React15__namespace.useState(visibleHours.from);
|
|
8556
|
+
const [to, setTo] = React15__namespace.useState(visibleHours.to);
|
|
8410
8557
|
const handleApply = () => {
|
|
8411
8558
|
const toHour = to === 0 ? 24 : to;
|
|
8412
8559
|
setVisibleHours({ from, to: toHour });
|
|
@@ -8452,7 +8599,7 @@ var HOUR_OPTIONS2 = Array.from({ length: 25 }, (_, i) => {
|
|
|
8452
8599
|
});
|
|
8453
8600
|
function ChangeWorkingHoursInput() {
|
|
8454
8601
|
const { workingHours, setWorkingHours } = useEventCalendar();
|
|
8455
|
-
const [localWorkingHours, setLocalWorkingHours] =
|
|
8602
|
+
const [localWorkingHours, setLocalWorkingHours] = React15__namespace.useState({
|
|
8456
8603
|
...workingHours
|
|
8457
8604
|
});
|
|
8458
8605
|
const handleToggleDay = (dayId) => {
|
|
@@ -8547,27 +8694,62 @@ function ChangeWorkingHoursInput() {
|
|
|
8547
8694
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { className: "mt-4 w-fit", onClick: handleSave, children: "Apply" })
|
|
8548
8695
|
] });
|
|
8549
8696
|
}
|
|
8550
|
-
function
|
|
8697
|
+
function CalendarSettingsContent({
|
|
8551
8698
|
className,
|
|
8552
8699
|
showBadgeVariant = true,
|
|
8553
8700
|
showVisibleHours = true,
|
|
8554
8701
|
showWorkingHours = true
|
|
8555
8702
|
}) {
|
|
8556
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
8703
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-6", className), children: [
|
|
8704
|
+
showBadgeVariant && /* @__PURE__ */ jsxRuntime.jsx(ChangeBadgeVariantInput, {}),
|
|
8705
|
+
showVisibleHours && /* @__PURE__ */ jsxRuntime.jsx(ChangeVisibleHoursInput, {}),
|
|
8706
|
+
showWorkingHours && /* @__PURE__ */ jsxRuntime.jsx(ChangeWorkingHoursInput, {})
|
|
8707
|
+
] });
|
|
8708
|
+
}
|
|
8709
|
+
function CalendarSettingsDialog({
|
|
8710
|
+
open,
|
|
8711
|
+
onOpenChange,
|
|
8712
|
+
showBadgeVariant = true,
|
|
8713
|
+
showVisibleHours = true,
|
|
8714
|
+
showWorkingHours = true
|
|
8715
|
+
}) {
|
|
8716
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-md", children: [
|
|
8717
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
8718
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogTitle, { className: "flex items-center gap-2", children: [
|
|
8719
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-5" }),
|
|
8720
|
+
"Calendar Settings"
|
|
8721
|
+
] }),
|
|
8722
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children: "Customize your calendar view and preferences." })
|
|
8723
|
+
] }),
|
|
8724
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8725
|
+
CalendarSettingsContent,
|
|
8726
|
+
{
|
|
8727
|
+
showBadgeVariant,
|
|
8728
|
+
showVisibleHours,
|
|
8729
|
+
showWorkingHours
|
|
8730
|
+
}
|
|
8731
|
+
)
|
|
8566
8732
|
] }) });
|
|
8567
8733
|
}
|
|
8734
|
+
function CalendarSettingsButton({
|
|
8735
|
+
onClick,
|
|
8736
|
+
className
|
|
8737
|
+
}) {
|
|
8738
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8739
|
+
Button,
|
|
8740
|
+
{
|
|
8741
|
+
variant: "outline",
|
|
8742
|
+
size: "icon",
|
|
8743
|
+
onClick,
|
|
8744
|
+
className: cn("shrink-0", className),
|
|
8745
|
+
"aria-label": "Calendar settings",
|
|
8746
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4" })
|
|
8747
|
+
}
|
|
8748
|
+
);
|
|
8749
|
+
}
|
|
8568
8750
|
function useMediaQuery(query) {
|
|
8569
|
-
const [matches, setMatches] =
|
|
8570
|
-
|
|
8751
|
+
const [matches, setMatches] = React15__namespace.useState(false);
|
|
8752
|
+
React15__namespace.useEffect(() => {
|
|
8571
8753
|
const media = window.matchMedia(query);
|
|
8572
8754
|
setMatches(media.matches);
|
|
8573
8755
|
const listener = (event) => {
|
|
@@ -8619,10 +8801,11 @@ function BigCalendarInner({
|
|
|
8619
8801
|
maxEventsPerDay
|
|
8620
8802
|
}) {
|
|
8621
8803
|
const { view, setView } = useEventCalendar();
|
|
8622
|
-
const [dialogOpen, setDialogOpen] =
|
|
8623
|
-
const [
|
|
8624
|
-
const [
|
|
8625
|
-
const [
|
|
8804
|
+
const [dialogOpen, setDialogOpen] = React15__namespace.useState(false);
|
|
8805
|
+
const [settingsDialogOpen, setSettingsDialogOpen] = React15__namespace.useState(false);
|
|
8806
|
+
const [selectedEvent, setSelectedEvent] = React15__namespace.useState(null);
|
|
8807
|
+
const [dialogMode, setDialogMode] = React15__namespace.useState("add");
|
|
8808
|
+
const [defaultDate, setDefaultDate] = React15__namespace.useState(/* @__PURE__ */ new Date());
|
|
8626
8809
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
8627
8810
|
const isCompact = compact === "auto" ? isMobile : compact;
|
|
8628
8811
|
const handleAddClick = () => {
|
|
@@ -8631,6 +8814,9 @@ function BigCalendarInner({
|
|
|
8631
8814
|
setDefaultDate(/* @__PURE__ */ new Date());
|
|
8632
8815
|
setDialogOpen(true);
|
|
8633
8816
|
};
|
|
8817
|
+
const handleSettingsClick = () => {
|
|
8818
|
+
setSettingsDialogOpen(true);
|
|
8819
|
+
};
|
|
8634
8820
|
const handleEventClick = (event) => {
|
|
8635
8821
|
setSelectedEvent(event);
|
|
8636
8822
|
setDialogMode("edit");
|
|
@@ -8654,45 +8840,46 @@ function BigCalendarInner({
|
|
|
8654
8840
|
const Wrapper = bordered ? Card : "div";
|
|
8655
8841
|
const Content14 = bordered ? CardContent : "div";
|
|
8656
8842
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8657
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8843
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col gap-4 relative", className), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8844
|
+
Wrapper,
|
|
8845
|
+
{
|
|
8846
|
+
className: cn(
|
|
8847
|
+
"flex min-h-[600px] flex-col overflow-hidden rounded-sm",
|
|
8848
|
+
!bordered && "border border-border bg-card"
|
|
8849
|
+
),
|
|
8850
|
+
children: [
|
|
8851
|
+
showHeader && (isCompact ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8852
|
+
CalendarHeaderCompact,
|
|
8853
|
+
{
|
|
8854
|
+
showAddButton,
|
|
8855
|
+
showSettings,
|
|
8856
|
+
onAddClick: handleAddClick,
|
|
8857
|
+
onSettingsClick: handleSettingsClick
|
|
8858
|
+
}
|
|
8859
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
8860
|
+
CalendarHeader,
|
|
8861
|
+
{
|
|
8862
|
+
showAddButton,
|
|
8863
|
+
showSettings,
|
|
8864
|
+
onAddClick: handleAddClick,
|
|
8865
|
+
onSettingsClick: handleSettingsClick
|
|
8866
|
+
}
|
|
8867
|
+
)),
|
|
8868
|
+
/* @__PURE__ */ jsxRuntime.jsx(Content14, { className: cn("flex-1 overflow-hidden", bordered ? "p-0" : ""), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8869
|
+
CalendarView,
|
|
8870
|
+
{
|
|
8871
|
+
view,
|
|
8872
|
+
weekStartsOn,
|
|
8873
|
+
maxEventsPerDay,
|
|
8874
|
+
onEventClick: handleEventClick,
|
|
8875
|
+
onDateClick: handleDateClick,
|
|
8876
|
+
onMoreClick: handleMoreClick,
|
|
8877
|
+
onTimeClick: handleTimeClick
|
|
8878
|
+
}
|
|
8879
|
+
) })
|
|
8880
|
+
]
|
|
8881
|
+
}
|
|
8882
|
+
) }),
|
|
8696
8883
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8697
8884
|
EventDialog,
|
|
8698
8885
|
{
|
|
@@ -8702,6 +8889,13 @@ function BigCalendarInner({
|
|
|
8702
8889
|
event: selectedEvent,
|
|
8703
8890
|
defaultDate
|
|
8704
8891
|
}
|
|
8892
|
+
),
|
|
8893
|
+
showSettings && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8894
|
+
CalendarSettingsDialog,
|
|
8895
|
+
{
|
|
8896
|
+
open: settingsDialogOpen,
|
|
8897
|
+
onOpenChange: setSettingsDialogOpen
|
|
8898
|
+
}
|
|
8705
8899
|
)
|
|
8706
8900
|
] });
|
|
8707
8901
|
}
|
|
@@ -8840,7 +9034,9 @@ exports.CalendarContext = CalendarContext;
|
|
|
8840
9034
|
exports.CalendarDayButton = CalendarDayButton;
|
|
8841
9035
|
exports.CalendarHeader = CalendarHeader;
|
|
8842
9036
|
exports.CalendarHeaderCompact = CalendarHeaderCompact;
|
|
8843
|
-
exports.
|
|
9037
|
+
exports.CalendarSettingsButton = CalendarSettingsButton;
|
|
9038
|
+
exports.CalendarSettingsContent = CalendarSettingsContent;
|
|
9039
|
+
exports.CalendarSettingsDialog = CalendarSettingsDialog;
|
|
8844
9040
|
exports.Card = Card;
|
|
8845
9041
|
exports.CardContent = CardContent;
|
|
8846
9042
|
exports.CardDescription = CardDescription;
|
|
@@ -9114,6 +9310,7 @@ exports.TabsContent = TabsContent;
|
|
|
9114
9310
|
exports.TabsList = TabsList;
|
|
9115
9311
|
exports.TabsTrigger = TabsTrigger;
|
|
9116
9312
|
exports.Textarea = Textarea;
|
|
9313
|
+
exports.ThemeSwitch = ThemeSwitch;
|
|
9117
9314
|
exports.TimeIndicator = TimeIndicator;
|
|
9118
9315
|
exports.Toaster = Toaster;
|
|
9119
9316
|
exports.Toggle = Toggle;
|