@moontra/moonui 2.1.7 → 2.1.9
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.js +200 -200
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +202 -202
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/index.ts +0 -1
- package/src/index.tsx +3 -1
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
1
3
|
import * as t from 'react';
|
|
2
4
|
import t__default, { useState, useCallback, useEffect } from 'react';
|
|
3
5
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
4
|
-
import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronUp, ChevronRight, Circle, Upload, Bold, Italic, Underline, Strikethrough, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Code, Link, Image, Palette, Undo, Redo, Edit, Eye,
|
|
6
|
+
import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, Minus, Search, ChevronUp, ChevronRight, Circle, Upload, Bold, Italic, Underline, Strikethrough, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Code, Link, Image, Palette, Undo, Redo, Edit, Eye, Copy, Download, RefreshCw, Columns, ArrowDown, ArrowUp, ArrowUpDown, ChevronsLeft, ChevronLeft, ChevronsRight, Calendar as Calendar$1, Clock, CheckCircle, Star, GitFork, ExternalLink, Video, Music, FileText, File } from 'lucide-react';
|
|
5
7
|
export { Palette, Pipette } from 'lucide-react';
|
|
6
|
-
import { clsx } from 'clsx';
|
|
7
|
-
import { twMerge } from 'tailwind-merge';
|
|
8
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
import { cva } from 'class-variance-authority';
|
|
10
10
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
11
|
-
import { format, isSameMonth, isToday, isValid, subMonths, addMonths, isSameDay, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek } from 'date-fns';
|
|
12
|
-
export { format } from 'date-fns';
|
|
13
11
|
import { motion, AnimatePresence, useMotionValue, useTransform, animate } from 'framer-motion';
|
|
14
12
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
15
13
|
import 'react-dom';
|
|
@@ -20,6 +18,8 @@ import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
|
20
18
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
21
19
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
22
20
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
21
|
+
import { isValid, format, isSameMonth, isToday, subMonths, addMonths, isSameDay, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek } from 'date-fns';
|
|
22
|
+
export { format } from 'date-fns';
|
|
23
23
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
24
24
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
25
25
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
@@ -815,202 +815,6 @@ var Button = t.forwardRef(
|
|
|
815
815
|
}
|
|
816
816
|
);
|
|
817
817
|
Button.displayName = "Button";
|
|
818
|
-
function Calendar({
|
|
819
|
-
mode = "single",
|
|
820
|
-
selected,
|
|
821
|
-
onSelect,
|
|
822
|
-
disabled,
|
|
823
|
-
showOutsideDays = false,
|
|
824
|
-
className,
|
|
825
|
-
classNames,
|
|
826
|
-
numberOfMonths = 1,
|
|
827
|
-
defaultMonth,
|
|
828
|
-
...props
|
|
829
|
-
}) {
|
|
830
|
-
const [currentMonth, setCurrentMonth] = t.useState(
|
|
831
|
-
defaultMonth || selected && selected || /* @__PURE__ */ new Date()
|
|
832
|
-
);
|
|
833
|
-
const weekDays = [
|
|
834
|
-
{ short: "S", full: "Sunday" },
|
|
835
|
-
{ short: "M", full: "Monday" },
|
|
836
|
-
{ short: "T", full: "Tuesday" },
|
|
837
|
-
{ short: "W", full: "Wednesday" },
|
|
838
|
-
{ short: "T", full: "Thursday" },
|
|
839
|
-
{ short: "F", full: "Friday" },
|
|
840
|
-
{ short: "S", full: "Saturday" }
|
|
841
|
-
];
|
|
842
|
-
const handlePreviousMonth = () => {
|
|
843
|
-
setCurrentMonth(subMonths(currentMonth, 1));
|
|
844
|
-
};
|
|
845
|
-
const handleNextMonth = () => {
|
|
846
|
-
setCurrentMonth(addMonths(currentMonth, 1));
|
|
847
|
-
};
|
|
848
|
-
const handleDateClick = (date) => {
|
|
849
|
-
if (disabled?.(date))
|
|
850
|
-
return;
|
|
851
|
-
if (mode === "single") {
|
|
852
|
-
onSelect?.(date);
|
|
853
|
-
} else if (mode === "range") {
|
|
854
|
-
const currentSelection = selected;
|
|
855
|
-
if (!currentSelection?.from || currentSelection.from && currentSelection.to) {
|
|
856
|
-
onSelect?.({ from: date, to: void 0 });
|
|
857
|
-
} else {
|
|
858
|
-
if (date < currentSelection.from) {
|
|
859
|
-
onSelect?.({ from: date, to: currentSelection.from });
|
|
860
|
-
} else {
|
|
861
|
-
onSelect?.({ from: currentSelection.from, to: date });
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
};
|
|
866
|
-
const isDateSelected = (date) => {
|
|
867
|
-
if (!selected)
|
|
868
|
-
return false;
|
|
869
|
-
if (mode === "single") {
|
|
870
|
-
return isSameDay(date, selected);
|
|
871
|
-
} else if (mode === "range") {
|
|
872
|
-
const range = selected;
|
|
873
|
-
if (range.from && range.to) {
|
|
874
|
-
return date >= range.from && date <= range.to;
|
|
875
|
-
}
|
|
876
|
-
return range.from ? isSameDay(date, range.from) : false;
|
|
877
|
-
}
|
|
878
|
-
return false;
|
|
879
|
-
};
|
|
880
|
-
const isRangeStart = (date) => {
|
|
881
|
-
if (mode !== "range" || !selected)
|
|
882
|
-
return false;
|
|
883
|
-
const range = selected;
|
|
884
|
-
return range.from ? isSameDay(date, range.from) : false;
|
|
885
|
-
};
|
|
886
|
-
const isRangeEnd = (date) => {
|
|
887
|
-
if (mode !== "range" || !selected)
|
|
888
|
-
return false;
|
|
889
|
-
const range = selected;
|
|
890
|
-
return range.to ? isSameDay(date, range.to) : false;
|
|
891
|
-
};
|
|
892
|
-
const isRangeMiddle = (date) => {
|
|
893
|
-
if (mode !== "range" || !selected)
|
|
894
|
-
return false;
|
|
895
|
-
const range = selected;
|
|
896
|
-
if (!range.from || !range.to)
|
|
897
|
-
return false;
|
|
898
|
-
return date > range.from && date < range.to;
|
|
899
|
-
};
|
|
900
|
-
const getDaysInMonth = () => {
|
|
901
|
-
const start = startOfMonth(currentMonth);
|
|
902
|
-
const end = endOfMonth(currentMonth);
|
|
903
|
-
const days2 = eachDayOfInterval({ start, end });
|
|
904
|
-
const firstDayOfWeek = getDay(start);
|
|
905
|
-
const previousMonthDays = [];
|
|
906
|
-
if (firstDayOfWeek > 0 && showOutsideDays) {
|
|
907
|
-
const previousMonthStart = startOfWeek(start);
|
|
908
|
-
const previousMonthEnd = new Date(start);
|
|
909
|
-
previousMonthEnd.setDate(previousMonthEnd.getDate() - 1);
|
|
910
|
-
previousMonthDays.push(...eachDayOfInterval({
|
|
911
|
-
start: previousMonthStart,
|
|
912
|
-
end: previousMonthEnd
|
|
913
|
-
}));
|
|
914
|
-
}
|
|
915
|
-
const lastDayOfWeek = getDay(end);
|
|
916
|
-
const nextMonthDays = [];
|
|
917
|
-
if (lastDayOfWeek < 6 && showOutsideDays) {
|
|
918
|
-
const nextMonthStart = new Date(end);
|
|
919
|
-
nextMonthStart.setDate(nextMonthStart.getDate() + 1);
|
|
920
|
-
const nextMonthEnd = endOfWeek(end);
|
|
921
|
-
nextMonthDays.push(...eachDayOfInterval({
|
|
922
|
-
start: nextMonthStart,
|
|
923
|
-
end: nextMonthEnd
|
|
924
|
-
}));
|
|
925
|
-
}
|
|
926
|
-
const emptyCells = [];
|
|
927
|
-
if (!showOutsideDays && firstDayOfWeek > 0) {
|
|
928
|
-
for (let i = 0; i < firstDayOfWeek; i++) {
|
|
929
|
-
emptyCells.push(null);
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
return [...previousMonthDays, ...emptyCells, ...days2, ...nextMonthDays];
|
|
933
|
-
};
|
|
934
|
-
const days = getDaysInMonth();
|
|
935
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("p-0", className), children: [
|
|
936
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
937
|
-
/* @__PURE__ */ jsx(
|
|
938
|
-
"button",
|
|
939
|
-
{
|
|
940
|
-
onClick: handlePreviousMonth,
|
|
941
|
-
className: cn(
|
|
942
|
-
"h-10 w-10 bg-transparent p-0 rounded-lg",
|
|
943
|
-
"hover:bg-muted transition-colors",
|
|
944
|
-
"inline-flex items-center justify-center"
|
|
945
|
-
),
|
|
946
|
-
type: "button",
|
|
947
|
-
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-5 w-5" })
|
|
948
|
-
}
|
|
949
|
-
),
|
|
950
|
-
/* @__PURE__ */ jsx("h2", { className: "text-base font-medium", children: format(currentMonth, "MMMM yyyy") }),
|
|
951
|
-
/* @__PURE__ */ jsx(
|
|
952
|
-
"button",
|
|
953
|
-
{
|
|
954
|
-
onClick: handleNextMonth,
|
|
955
|
-
className: cn(
|
|
956
|
-
"h-10 w-10 bg-transparent p-0 rounded-lg",
|
|
957
|
-
"hover:bg-muted transition-colors",
|
|
958
|
-
"inline-flex items-center justify-center"
|
|
959
|
-
),
|
|
960
|
-
type: "button",
|
|
961
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-5 w-5" })
|
|
962
|
-
}
|
|
963
|
-
)
|
|
964
|
-
] }),
|
|
965
|
-
/* @__PURE__ */ jsxs("div", { className: "px-6 pb-4", children: [
|
|
966
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 mb-2", children: weekDays.map((day, index) => /* @__PURE__ */ jsx(
|
|
967
|
-
"div",
|
|
968
|
-
{
|
|
969
|
-
className: "text-muted-foreground text-xs font-medium h-10 flex items-center justify-center",
|
|
970
|
-
title: day.full,
|
|
971
|
-
children: day.short
|
|
972
|
-
},
|
|
973
|
-
`weekday-${index}`
|
|
974
|
-
)) }),
|
|
975
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1", children: days.map((date, index) => {
|
|
976
|
-
if (!date) {
|
|
977
|
-
return /* @__PURE__ */ jsx("div", { className: "h-10 w-10" }, `empty-${index}`);
|
|
978
|
-
}
|
|
979
|
-
const isOutsideMonth = !isSameMonth(date, currentMonth);
|
|
980
|
-
const isDisabled = disabled?.(date) || false;
|
|
981
|
-
const isSelected = isDateSelected(date);
|
|
982
|
-
const isTodayDate = isToday(date);
|
|
983
|
-
const rangeStart = isRangeStart(date);
|
|
984
|
-
const rangeEnd = isRangeEnd(date);
|
|
985
|
-
const rangeMiddle = isRangeMiddle(date);
|
|
986
|
-
return /* @__PURE__ */ jsx(
|
|
987
|
-
"button",
|
|
988
|
-
{
|
|
989
|
-
onClick: () => handleDateClick(date),
|
|
990
|
-
disabled: isDisabled,
|
|
991
|
-
className: cn(
|
|
992
|
-
"h-10 w-10 p-0 font-normal",
|
|
993
|
-
"inline-flex items-center justify-center rounded-lg",
|
|
994
|
-
"hover:bg-muted transition-colors text-sm",
|
|
995
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
996
|
-
isOutsideMonth && "text-muted-foreground/50",
|
|
997
|
-
isDisabled && "text-muted-foreground/30 cursor-not-allowed hover:bg-transparent",
|
|
998
|
-
isSelected && !rangeMiddle && "bg-primary text-primary-foreground font-medium hover:bg-primary hover:text-primary-foreground",
|
|
999
|
-
isTodayDate && "font-semibold relative after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:h-1 after:w-1 after:rounded-full after:bg-primary",
|
|
1000
|
-
rangeMiddle && "bg-accent/30 text-accent-foreground rounded-none",
|
|
1001
|
-
rangeStart && "rounded-r-none",
|
|
1002
|
-
rangeEnd && "rounded-l-none"
|
|
1003
|
-
),
|
|
1004
|
-
type: "button",
|
|
1005
|
-
children: format(date, "d")
|
|
1006
|
-
},
|
|
1007
|
-
date.toISOString()
|
|
1008
|
-
);
|
|
1009
|
-
}) })
|
|
1010
|
-
] })
|
|
1011
|
-
] });
|
|
1012
|
-
}
|
|
1013
|
-
Calendar.displayName = "Calendar";
|
|
1014
818
|
var microInteractionVariants = cva("", {
|
|
1015
819
|
variants: {
|
|
1016
820
|
hover: {
|
|
@@ -8104,6 +7908,202 @@ function createFilterableColumn(accessorKey, header, filterFn) {
|
|
|
8104
7908
|
filterFn
|
|
8105
7909
|
};
|
|
8106
7910
|
}
|
|
7911
|
+
function Calendar({
|
|
7912
|
+
mode = "single",
|
|
7913
|
+
selected,
|
|
7914
|
+
onSelect,
|
|
7915
|
+
disabled,
|
|
7916
|
+
showOutsideDays = false,
|
|
7917
|
+
className,
|
|
7918
|
+
classNames,
|
|
7919
|
+
numberOfMonths = 1,
|
|
7920
|
+
defaultMonth,
|
|
7921
|
+
...props
|
|
7922
|
+
}) {
|
|
7923
|
+
const [currentMonth, setCurrentMonth] = t.useState(
|
|
7924
|
+
defaultMonth || selected && selected || /* @__PURE__ */ new Date()
|
|
7925
|
+
);
|
|
7926
|
+
const weekDays = [
|
|
7927
|
+
{ short: "S", full: "Sunday" },
|
|
7928
|
+
{ short: "M", full: "Monday" },
|
|
7929
|
+
{ short: "T", full: "Tuesday" },
|
|
7930
|
+
{ short: "W", full: "Wednesday" },
|
|
7931
|
+
{ short: "T", full: "Thursday" },
|
|
7932
|
+
{ short: "F", full: "Friday" },
|
|
7933
|
+
{ short: "S", full: "Saturday" }
|
|
7934
|
+
];
|
|
7935
|
+
const handlePreviousMonth = () => {
|
|
7936
|
+
setCurrentMonth(subMonths(currentMonth, 1));
|
|
7937
|
+
};
|
|
7938
|
+
const handleNextMonth = () => {
|
|
7939
|
+
setCurrentMonth(addMonths(currentMonth, 1));
|
|
7940
|
+
};
|
|
7941
|
+
const handleDateClick = (date) => {
|
|
7942
|
+
if (disabled?.(date))
|
|
7943
|
+
return;
|
|
7944
|
+
if (mode === "single") {
|
|
7945
|
+
onSelect?.(date);
|
|
7946
|
+
} else if (mode === "range") {
|
|
7947
|
+
const currentSelection = selected;
|
|
7948
|
+
if (!currentSelection?.from || currentSelection.from && currentSelection.to) {
|
|
7949
|
+
onSelect?.({ from: date, to: void 0 });
|
|
7950
|
+
} else {
|
|
7951
|
+
if (date < currentSelection.from) {
|
|
7952
|
+
onSelect?.({ from: date, to: currentSelection.from });
|
|
7953
|
+
} else {
|
|
7954
|
+
onSelect?.({ from: currentSelection.from, to: date });
|
|
7955
|
+
}
|
|
7956
|
+
}
|
|
7957
|
+
}
|
|
7958
|
+
};
|
|
7959
|
+
const isDateSelected = (date) => {
|
|
7960
|
+
if (!selected)
|
|
7961
|
+
return false;
|
|
7962
|
+
if (mode === "single") {
|
|
7963
|
+
return isSameDay(date, selected);
|
|
7964
|
+
} else if (mode === "range") {
|
|
7965
|
+
const range = selected;
|
|
7966
|
+
if (range.from && range.to) {
|
|
7967
|
+
return date >= range.from && date <= range.to;
|
|
7968
|
+
}
|
|
7969
|
+
return range.from ? isSameDay(date, range.from) : false;
|
|
7970
|
+
}
|
|
7971
|
+
return false;
|
|
7972
|
+
};
|
|
7973
|
+
const isRangeStart = (date) => {
|
|
7974
|
+
if (mode !== "range" || !selected)
|
|
7975
|
+
return false;
|
|
7976
|
+
const range = selected;
|
|
7977
|
+
return range.from ? isSameDay(date, range.from) : false;
|
|
7978
|
+
};
|
|
7979
|
+
const isRangeEnd = (date) => {
|
|
7980
|
+
if (mode !== "range" || !selected)
|
|
7981
|
+
return false;
|
|
7982
|
+
const range = selected;
|
|
7983
|
+
return range.to ? isSameDay(date, range.to) : false;
|
|
7984
|
+
};
|
|
7985
|
+
const isRangeMiddle = (date) => {
|
|
7986
|
+
if (mode !== "range" || !selected)
|
|
7987
|
+
return false;
|
|
7988
|
+
const range = selected;
|
|
7989
|
+
if (!range.from || !range.to)
|
|
7990
|
+
return false;
|
|
7991
|
+
return date > range.from && date < range.to;
|
|
7992
|
+
};
|
|
7993
|
+
const getDaysInMonth = () => {
|
|
7994
|
+
const start = startOfMonth(currentMonth);
|
|
7995
|
+
const end = endOfMonth(currentMonth);
|
|
7996
|
+
const days2 = eachDayOfInterval({ start, end });
|
|
7997
|
+
const firstDayOfWeek = getDay(start);
|
|
7998
|
+
const previousMonthDays = [];
|
|
7999
|
+
if (firstDayOfWeek > 0 && showOutsideDays) {
|
|
8000
|
+
const previousMonthStart = startOfWeek(start);
|
|
8001
|
+
const previousMonthEnd = new Date(start);
|
|
8002
|
+
previousMonthEnd.setDate(previousMonthEnd.getDate() - 1);
|
|
8003
|
+
previousMonthDays.push(...eachDayOfInterval({
|
|
8004
|
+
start: previousMonthStart,
|
|
8005
|
+
end: previousMonthEnd
|
|
8006
|
+
}));
|
|
8007
|
+
}
|
|
8008
|
+
const lastDayOfWeek = getDay(end);
|
|
8009
|
+
const nextMonthDays = [];
|
|
8010
|
+
if (lastDayOfWeek < 6 && showOutsideDays) {
|
|
8011
|
+
const nextMonthStart = new Date(end);
|
|
8012
|
+
nextMonthStart.setDate(nextMonthStart.getDate() + 1);
|
|
8013
|
+
const nextMonthEnd = endOfWeek(end);
|
|
8014
|
+
nextMonthDays.push(...eachDayOfInterval({
|
|
8015
|
+
start: nextMonthStart,
|
|
8016
|
+
end: nextMonthEnd
|
|
8017
|
+
}));
|
|
8018
|
+
}
|
|
8019
|
+
const emptyCells = [];
|
|
8020
|
+
if (!showOutsideDays && firstDayOfWeek > 0) {
|
|
8021
|
+
for (let i = 0; i < firstDayOfWeek; i++) {
|
|
8022
|
+
emptyCells.push(null);
|
|
8023
|
+
}
|
|
8024
|
+
}
|
|
8025
|
+
return [...previousMonthDays, ...emptyCells, ...days2, ...nextMonthDays];
|
|
8026
|
+
};
|
|
8027
|
+
const days = getDaysInMonth();
|
|
8028
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("p-0", className), children: [
|
|
8029
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
8030
|
+
/* @__PURE__ */ jsx(
|
|
8031
|
+
"button",
|
|
8032
|
+
{
|
|
8033
|
+
onClick: handlePreviousMonth,
|
|
8034
|
+
className: cn(
|
|
8035
|
+
"h-10 w-10 bg-transparent p-0 rounded-lg",
|
|
8036
|
+
"hover:bg-muted transition-colors",
|
|
8037
|
+
"inline-flex items-center justify-center"
|
|
8038
|
+
),
|
|
8039
|
+
type: "button",
|
|
8040
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-5 w-5" })
|
|
8041
|
+
}
|
|
8042
|
+
),
|
|
8043
|
+
/* @__PURE__ */ jsx("h2", { className: "text-base font-medium", children: format(currentMonth, "MMMM yyyy") }),
|
|
8044
|
+
/* @__PURE__ */ jsx(
|
|
8045
|
+
"button",
|
|
8046
|
+
{
|
|
8047
|
+
onClick: handleNextMonth,
|
|
8048
|
+
className: cn(
|
|
8049
|
+
"h-10 w-10 bg-transparent p-0 rounded-lg",
|
|
8050
|
+
"hover:bg-muted transition-colors",
|
|
8051
|
+
"inline-flex items-center justify-center"
|
|
8052
|
+
),
|
|
8053
|
+
type: "button",
|
|
8054
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-5 w-5" })
|
|
8055
|
+
}
|
|
8056
|
+
)
|
|
8057
|
+
] }),
|
|
8058
|
+
/* @__PURE__ */ jsxs("div", { className: "px-6 pb-4", children: [
|
|
8059
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 mb-2", children: weekDays.map((day, index) => /* @__PURE__ */ jsx(
|
|
8060
|
+
"div",
|
|
8061
|
+
{
|
|
8062
|
+
className: "text-muted-foreground text-xs font-medium h-10 flex items-center justify-center",
|
|
8063
|
+
title: day.full,
|
|
8064
|
+
children: day.short
|
|
8065
|
+
},
|
|
8066
|
+
`weekday-${index}`
|
|
8067
|
+
)) }),
|
|
8068
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1", children: days.map((date, index) => {
|
|
8069
|
+
if (!date) {
|
|
8070
|
+
return /* @__PURE__ */ jsx("div", { className: "h-10 w-10" }, `empty-${index}`);
|
|
8071
|
+
}
|
|
8072
|
+
const isOutsideMonth = !isSameMonth(date, currentMonth);
|
|
8073
|
+
const isDisabled = disabled?.(date) || false;
|
|
8074
|
+
const isSelected = isDateSelected(date);
|
|
8075
|
+
const isTodayDate = isToday(date);
|
|
8076
|
+
const rangeStart = isRangeStart(date);
|
|
8077
|
+
const rangeEnd = isRangeEnd(date);
|
|
8078
|
+
const rangeMiddle = isRangeMiddle(date);
|
|
8079
|
+
return /* @__PURE__ */ jsx(
|
|
8080
|
+
"button",
|
|
8081
|
+
{
|
|
8082
|
+
onClick: () => handleDateClick(date),
|
|
8083
|
+
disabled: isDisabled,
|
|
8084
|
+
className: cn(
|
|
8085
|
+
"h-10 w-10 p-0 font-normal",
|
|
8086
|
+
"inline-flex items-center justify-center rounded-lg",
|
|
8087
|
+
"hover:bg-muted transition-colors text-sm",
|
|
8088
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
8089
|
+
isOutsideMonth && "text-muted-foreground/50",
|
|
8090
|
+
isDisabled && "text-muted-foreground/30 cursor-not-allowed hover:bg-transparent",
|
|
8091
|
+
isSelected && !rangeMiddle && "bg-primary text-primary-foreground font-medium hover:bg-primary hover:text-primary-foreground",
|
|
8092
|
+
isTodayDate && "font-semibold relative after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:h-1 after:w-1 after:rounded-full after:bg-primary",
|
|
8093
|
+
rangeMiddle && "bg-accent/30 text-accent-foreground rounded-none",
|
|
8094
|
+
rangeStart && "rounded-r-none",
|
|
8095
|
+
rangeEnd && "rounded-l-none"
|
|
8096
|
+
),
|
|
8097
|
+
type: "button",
|
|
8098
|
+
children: format(date, "d")
|
|
8099
|
+
},
|
|
8100
|
+
date.toISOString()
|
|
8101
|
+
);
|
|
8102
|
+
}) })
|
|
8103
|
+
] })
|
|
8104
|
+
] });
|
|
8105
|
+
}
|
|
8106
|
+
Calendar.displayName = "Calendar";
|
|
8107
8107
|
var datePickerVariants = cva(
|
|
8108
8108
|
"w-full justify-start text-left font-normal",
|
|
8109
8109
|
{
|
|
@@ -10935,6 +10935,6 @@ function Toaster() {
|
|
|
10935
10935
|
*)
|
|
10936
10936
|
*/
|
|
10937
10937
|
|
|
10938
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button,
|
|
10938
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CheckboxLabel, CheckboxWithLabel, Collapsible2 as Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorPicker, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DataTable, DatePicker, DateRangePicker, DateTimePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogForm, DialogHeader, DialogTitle, DialogTrigger, DraggableList, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FileUpload, GestureDrawer, GitHubStarButton, GitHubStars, GradientPicker, Input, Label, MonthPicker, MoonLogo, MoonLogoAnimated, MoonLogoIcon, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverFooter, PopoverHeader, PopoverSeparator, PopoverTrigger, Progress, RadioGroup2 as RadioGroup, RadioGroupItem, RadioItemWithLabel, RadioLabel, RichTextEditor, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, SimpleColorPicker, SimpleEditor, SimpleTooltip, Skeleton, SkeletonAvatar, SkeletonCard, SkeletonText, Slider, SwipeableCard, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Toggle2 as Toggle, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, aspectRatioVariants, badgeVariants, buttonVariants, cn, collapsibleContentVariants, collapsibleTriggerVariants, createFilterableColumn, createSortableHeader, popoverContentVariants, progressVariants, separatorVariants, skeletonVariants, toast, toggleVariants, tooltipVariants, useToast };
|
|
10939
10939
|
//# sourceMappingURL=out.js.map
|
|
10940
10940
|
//# sourceMappingURL=index.mjs.map
|