ikoncomponents 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/hooks/use-mobile.js +2 -38
  2. package/dist/ikoncomponents/action-menu/index.js +15 -18
  3. package/dist/ikoncomponents/action-menu/type.js +1 -2
  4. package/dist/ikoncomponents/alert-dialog/index.js +6 -10
  5. package/dist/ikoncomponents/buttons/index.js +32 -23
  6. package/dist/ikoncomponents/combobox-input/index.js +14 -16
  7. package/dist/ikoncomponents/combobox-input/type.js +1 -2
  8. package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +13 -16
  9. package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +22 -58
  10. package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +18 -21
  11. package/dist/ikoncomponents/data-table/datatable-pagination/index.js +10 -13
  12. package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +17 -19
  13. package/dist/ikoncomponents/data-table/function.js +4 -7
  14. package/dist/ikoncomponents/data-table/index.js +81 -116
  15. package/dist/ikoncomponents/data-table/type.js +1 -2
  16. package/dist/ikoncomponents/e-chart/index.js +32 -37
  17. package/dist/ikoncomponents/file-input/index.js +20 -11
  18. package/dist/ikoncomponents/glowing-effect/index.js +16 -18
  19. package/dist/ikoncomponents/icon/index.js +16 -40
  20. package/dist/ikoncomponents/loading-spinner/index.js +16 -8
  21. package/dist/ikoncomponents/multi-combobox/index.js +31 -30
  22. package/dist/ikoncomponents/no-data/index.js +4 -7
  23. package/dist/ikoncomponents/page-wrapper/index.js +5 -8
  24. package/dist/ikoncomponents/password-strength-meter/index.js +6 -13
  25. package/dist/ikoncomponents/phone-input/index.js +30 -54
  26. package/dist/ikoncomponents/resource-spreadsheet/index.js +11 -48
  27. package/dist/ikoncomponents/search-input/index.js +18 -9
  28. package/dist/ikoncomponents/sheet/index.js +5 -8
  29. package/dist/ikoncomponents/simple-widget/index.js +8 -11
  30. package/dist/ikoncomponents/tabs/index.js +20 -22
  31. package/dist/ikoncomponents/tabs/type.js +1 -2
  32. package/dist/ikoncomponents/theme-toggle-btn/index.js +8 -11
  33. package/dist/ikoncomponents/title-progress/index.js +4 -7
  34. package/dist/ikoncomponents/tooltip/index.js +4 -7
  35. package/dist/ikoncomponents/twolevel-dropdown/index.js +20 -53
  36. package/dist/ikoncomponents/widgets/index.js +10 -13
  37. package/dist/ikoncomponents/widgets/type.js +1 -2
  38. package/dist/index.d.ts +3 -3
  39. package/dist/index.js +70 -123
  40. package/dist/shadcn/accordion.js +28 -51
  41. package/dist/shadcn/alert-dialog.js +60 -70
  42. package/dist/shadcn/alert.d.ts +1 -1
  43. package/dist/shadcn/alert.js +25 -15
  44. package/dist/shadcn/avatar.js +24 -47
  45. package/dist/shadcn/badge.d.ts +1 -1
  46. package/dist/shadcn/badge.js +21 -13
  47. package/dist/shadcn/button.d.ts +1 -1
  48. package/dist/shadcn/button.js +21 -13
  49. package/dist/shadcn/calendar.js +42 -97
  50. package/dist/shadcn/card.js +35 -25
  51. package/dist/shadcn/checkbox.js +19 -42
  52. package/dist/shadcn/command.js +53 -43
  53. package/dist/shadcn/date-input.js +25 -60
  54. package/dist/shadcn/date-range-picker.js +14 -18
  55. package/dist/shadcn/dialog.js +56 -79
  56. package/dist/shadcn/dropdown-menu.js +61 -84
  57. package/dist/shadcn/hover-card.js +24 -47
  58. package/dist/shadcn/input.js +17 -7
  59. package/dist/shadcn/label.js +18 -41
  60. package/dist/shadcn/navigation-menu.d.ts +1 -1
  61. package/dist/shadcn/navigation-menu.js +43 -68
  62. package/dist/shadcn/popover.js +27 -50
  63. package/dist/shadcn/progress.js +19 -42
  64. package/dist/shadcn/radio-group.js +23 -45
  65. package/dist/shadcn/scroll-area.js +22 -45
  66. package/dist/shadcn/select.js +58 -81
  67. package/dist/shadcn/separator.js +18 -41
  68. package/dist/shadcn/sheet.js +52 -73
  69. package/dist/shadcn/sidebar.d.ts +1 -1
  70. package/dist/shadcn/sidebar.js +113 -141
  71. package/dist/shadcn/skeleton.js +17 -7
  72. package/dist/shadcn/slider.js +19 -42
  73. package/dist/shadcn/sonner.js +20 -11
  74. package/dist/shadcn/switch.js +18 -41
  75. package/dist/shadcn/table.js +46 -36
  76. package/dist/shadcn/tabs.js +27 -50
  77. package/dist/shadcn/textarea.js +17 -7
  78. package/dist/shadcn/tooltip.js +27 -50
  79. package/dist/shadcn/workflow.js +8 -8
  80. package/dist/styles.css +3 -0
  81. package/dist/utils/cn.js +4 -7
  82. package/dist/utils/theme-provider/index.js +16 -7
  83. package/package.json +2 -1
@@ -1,116 +1,61 @@
1
- "use strict";
2
1
  "use client";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.Calendar = Calendar;
38
- exports.CalendarDayButton = CalendarDayButton;
39
- const jsx_runtime_1 = require("react/jsx-runtime");
40
- const React = __importStar(require("react"));
41
- const lucide_react_1 = require("lucide-react");
42
- const react_day_picker_1 = require("react-day-picker");
43
- const cn_1 = require("../utils/cn");
44
- const button_1 = require("./button");
45
- function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, ...props }) {
46
- const defaultClassNames = (0, react_day_picker_1.getDefaultClassNames)();
47
- return ((0, jsx_runtime_1.jsx)(react_day_picker_1.DayPicker, { showOutsideDays: showOutsideDays, className: (0, cn_1.cn)("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]&]:bg-transparent [[data-slot=popover-content]&]:bg-transparent", "dark:bg-[#202020]", String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: {
48
- formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
49
- ...formatters,
50
- }, classNames: {
51
- root: (0, cn_1.cn)("w-fit", defaultClassNames.root),
52
- months: (0, cn_1.cn)("flex gap-4 flex-col md:flex-row relative", defaultClassNames.months),
53
- month: (0, cn_1.cn)("flex flex-col w-full gap-4", defaultClassNames.month),
54
- nav: (0, cn_1.cn)("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between", defaultClassNames.nav),
55
- button_previous: (0, cn_1.cn)((0, button_1.buttonVariants)({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_previous),
56
- button_next: (0, cn_1.cn)((0, button_1.buttonVariants)({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_next),
57
- month_caption: (0, cn_1.cn)("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)", defaultClassNames.month_caption),
58
- dropdowns: (0, cn_1.cn)("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5", defaultClassNames.dropdowns),
59
- dropdown_root: (0, cn_1.cn)("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md", "bg-[rgba(0,0,0,0.17)]", defaultClassNames.dropdown_root),
60
- dropdown: (0, cn_1.cn)("absolute bg-popover inset-0 opacity-0", defaultClassNames.dropdown),
61
- caption_label: (0, cn_1.cn)("select-none font-medium", captionLayout === "label"
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import * as React from "react";
15
+ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, } from "lucide-react";
16
+ import { DayPicker, getDefaultClassNames } from "react-day-picker";
17
+ import { cn } from "../utils/cn";
18
+ import { Button, buttonVariants } from "./button";
19
+ function Calendar(_a) {
20
+ var { className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components } = _a, props = __rest(_a, ["className", "classNames", "showOutsideDays", "captionLayout", "buttonVariant", "formatters", "components"]);
21
+ const defaultClassNames = getDefaultClassNames();
22
+ return (_jsx(DayPicker, Object.assign({ showOutsideDays: showOutsideDays, className: cn("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]&]:bg-transparent [[data-slot=popover-content]&]:bg-transparent", "dark:bg-[#202020]", String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: Object.assign({ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }) }, formatters), classNames: Object.assign({ root: cn("w-fit", defaultClassNames.root), months: cn("flex gap-4 flex-col md:flex-row relative", defaultClassNames.months), month: cn("flex flex-col w-full gap-4", defaultClassNames.month), nav: cn("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between", defaultClassNames.nav), button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_previous), button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_next), month_caption: cn("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)", defaultClassNames.month_caption), dropdowns: cn("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5", defaultClassNames.dropdowns), dropdown_root: cn("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md", "bg-[rgba(0,0,0,0.17)]", defaultClassNames.dropdown_root), dropdown: cn("absolute bg-popover inset-0 opacity-0", defaultClassNames.dropdown), caption_label: cn("select-none font-medium", captionLayout === "label"
62
23
  ? "text-sm"
63
- : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5", defaultClassNames.caption_label),
64
- table: "w-full border-collapse",
65
- weekdays: (0, cn_1.cn)("flex", defaultClassNames.weekdays),
66
- weekday: (0, cn_1.cn)("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none", defaultClassNames.weekday),
67
- week: (0, cn_1.cn)("flex w-full mt-2", defaultClassNames.week),
68
- week_number_header: (0, cn_1.cn)("select-none w-(--cell-size)", defaultClassNames.week_number_header),
69
- week_number: (0, cn_1.cn)("text-[0.8rem] select-none text-muted-foreground", defaultClassNames.week_number),
70
- day: (0, cn_1.cn)("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none", defaultClassNames.day),
71
- range_start: (0, cn_1.cn)("rounded-l-md bg-accent", defaultClassNames.range_start),
72
- range_middle: (0, cn_1.cn)("rounded-none", defaultClassNames.range_middle),
73
- range_end: (0, cn_1.cn)("rounded-r-md bg-accent", defaultClassNames.range_end),
74
- today: (0, cn_1.cn)("bg-[var(--hover-back)] text-primary rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
75
- outside: (0, cn_1.cn)("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
76
- disabled: (0, cn_1.cn)("text-muted-foreground opacity-50", defaultClassNames.disabled),
77
- hidden: (0, cn_1.cn)("invisible", defaultClassNames.hidden),
78
- ...classNames,
79
- }, components: {
80
- Root: ({ className, rootRef, ...props }) => {
81
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "calendar", ref: rootRef, className: (0, cn_1.cn)(className), ...props }));
82
- },
83
- Chevron: ({ className, orientation, ...props }) => {
24
+ : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5", defaultClassNames.caption_label), table: "w-full border-collapse", weekdays: cn("flex", defaultClassNames.weekdays), weekday: cn("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none", defaultClassNames.weekday), week: cn("flex w-full mt-2", defaultClassNames.week), week_number_header: cn("select-none w-(--cell-size)", defaultClassNames.week_number_header), week_number: cn("text-[0.8rem] select-none text-muted-foreground", defaultClassNames.week_number), day: cn("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none", defaultClassNames.day), range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start), range_middle: cn("rounded-none", defaultClassNames.range_middle), range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end), today: cn("bg-[var(--hover-back)] text-primary rounded-md data-[selected=true]:rounded-none", defaultClassNames.today), outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside), disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled), hidden: cn("invisible", defaultClassNames.hidden) }, classNames), components: Object.assign({ Root: (_a) => {
25
+ var { className, rootRef } = _a, props = __rest(_a, ["className", "rootRef"]);
26
+ return (_jsx("div", Object.assign({ "data-slot": "calendar", ref: rootRef, className: cn(className) }, props)));
27
+ }, Chevron: (_a) => {
28
+ var { className, orientation } = _a, props = __rest(_a, ["className", "orientation"]);
84
29
  if (orientation === "left") {
85
- return ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeftIcon, { className: (0, cn_1.cn)("size-4", className), ...props }));
30
+ return (_jsx(ChevronLeftIcon, Object.assign({ className: cn("size-4", className) }, props)));
86
31
  }
87
32
  if (orientation === "right") {
88
- return ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightIcon, { className: (0, cn_1.cn)("size-4", className), ...props }));
33
+ return (_jsx(ChevronRightIcon, Object.assign({ className: cn("size-4", className) }, props)));
89
34
  }
90
- return ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDownIcon, { className: (0, cn_1.cn)("size-4", className), ...props }));
91
- },
92
- DayButton: CalendarDayButton,
93
- WeekNumber: ({ children, ...props }) => {
94
- return ((0, jsx_runtime_1.jsx)("td", { ...props, children: (0, jsx_runtime_1.jsx)("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
95
- },
96
- ...components,
97
- }, ...props }));
35
+ return (_jsx(ChevronDownIcon, Object.assign({ className: cn("size-4", className) }, props)));
36
+ }, DayButton: CalendarDayButton, WeekNumber: (_a) => {
37
+ var { children } = _a, props = __rest(_a, ["children"]);
38
+ return (_jsx("td", Object.assign({}, props, { children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) })));
39
+ } }, components) }, props)));
98
40
  }
99
- function CalendarDayButton({ className, day, modifiers, ...props }) {
100
- const defaultClassNames = (0, react_day_picker_1.getDefaultClassNames)();
41
+ function CalendarDayButton(_a) {
42
+ var { className, day, modifiers } = _a, props = __rest(_a, ["className", "day", "modifiers"]);
43
+ const defaultClassNames = getDefaultClassNames();
101
44
  const ref = React.useRef(null);
102
45
  React.useEffect(() => {
46
+ var _a;
103
47
  if (modifiers.focused)
104
- ref.current?.focus();
48
+ (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
105
49
  }, [modifiers.focused]);
106
- return ((0, jsx_runtime_1.jsx)(button_1.Button, { ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
50
+ return (_jsx(Button, Object.assign({ ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
107
51
  !modifiers.range_start &&
108
52
  !modifiers.range_end &&
109
- !modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: (0, cn_1.cn)("data-[selected-single=true]:bg-[var(--calender-foreground)] data-[selected-single=true]:text-white dark:data-[selected-single=true]:text-black",
53
+ !modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn("data-[selected-single=true]:bg-[var(--calender-foreground)] data-[selected-single=true]:text-white dark:data-[selected-single=true]:text-black",
110
54
  // Make sure the background is transparent for dates in the middle of the range
111
55
  "data-[range-middle=true]:bg-[var(--ring)] data-[range-middle=true]:text-white root:text-black",
112
56
  // Set background color for the start of the range
113
57
  "data-[range-start=true]:bg-[var(--calender-foreground)] dark:data-[range-start=true]:text-black data-[range-start=true]:text-white",
114
58
  // Set background color for the end of the range
115
- "hover:bg-[var(--keross-skeleton-bg)] hover:text-white", "data-[range-end=true]:bg-[var(--calender-foreground)] data-[range-end=true]:text-white dark:data-[range-end=true]:text-black", "group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70 root:text-black", defaultClassNames.day, className), ...props }));
59
+ "hover:bg-[var(--keross-skeleton-bg)] hover:text-white", "data-[range-end=true]:bg-[var(--calender-foreground)] data-[range-end=true]:text-white dark:data-[range-end=true]:text-black", "group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70 root:text-black", defaultClassNames.day, className) }, props)));
116
60
  }
61
+ export { Calendar, CalendarDayButton };
@@ -1,32 +1,42 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Card = Card;
4
- exports.CardHeader = CardHeader;
5
- exports.CardFooter = CardFooter;
6
- exports.CardTitle = CardTitle;
7
- exports.CardAction = CardAction;
8
- exports.CardDescription = CardDescription;
9
- exports.CardContent = CardContent;
10
- const jsx_runtime_1 = require("react/jsx-runtime");
11
- const cn_1 = require("../utils/cn");
12
- function Card({ className, ...props }) {
13
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card", className: (0, cn_1.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className), ...props }));
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { cn } from "../utils/cn";
14
+ function Card(_a) {
15
+ var { className } = _a, props = __rest(_a, ["className"]);
16
+ return (_jsx("div", Object.assign({ "data-slot": "card", className: cn("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className) }, props)));
14
17
  }
15
- function CardHeader({ className, ...props }) {
16
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-header", className: (0, cn_1.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className), ...props }));
18
+ function CardHeader(_a) {
19
+ var { className } = _a, props = __rest(_a, ["className"]);
20
+ return (_jsx("div", Object.assign({ "data-slot": "card-header", className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className) }, props)));
17
21
  }
18
- function CardTitle({ className, ...props }) {
19
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-title", className: (0, cn_1.cn)("leading-none font-semibold", className), ...props }));
22
+ function CardTitle(_a) {
23
+ var { className } = _a, props = __rest(_a, ["className"]);
24
+ return (_jsx("div", Object.assign({ "data-slot": "card-title", className: cn("leading-none font-semibold", className) }, props)));
20
25
  }
21
- function CardDescription({ className, ...props }) {
22
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-description", className: (0, cn_1.cn)("text-muted-foreground text-sm", className), ...props }));
26
+ function CardDescription(_a) {
27
+ var { className } = _a, props = __rest(_a, ["className"]);
28
+ return (_jsx("div", Object.assign({ "data-slot": "card-description", className: cn("text-muted-foreground text-sm", className) }, props)));
23
29
  }
24
- function CardAction({ className, ...props }) {
25
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-action", className: (0, cn_1.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className), ...props }));
30
+ function CardAction(_a) {
31
+ var { className } = _a, props = __rest(_a, ["className"]);
32
+ return (_jsx("div", Object.assign({ "data-slot": "card-action", className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className) }, props)));
26
33
  }
27
- function CardContent({ className, ...props }) {
28
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-content", className: (0, cn_1.cn)("px-6", className), ...props }));
34
+ function CardContent(_a) {
35
+ var { className } = _a, props = __rest(_a, ["className"]);
36
+ return (_jsx("div", Object.assign({ "data-slot": "card-content", className: cn("px-6", className) }, props)));
29
37
  }
30
- function CardFooter({ className, ...props }) {
31
- return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "card-footer", className: (0, cn_1.cn)("flex items-center px-6 [.border-t]:pt-6", className), ...props }));
38
+ function CardFooter(_a) {
39
+ var { className } = _a, props = __rest(_a, ["className"]);
40
+ return (_jsx("div", Object.assign({ "data-slot": "card-footer", className: cn("flex items-center px-6 [.border-t]:pt-6", className) }, props)));
32
41
  }
42
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
@@ -1,44 +1,21 @@
1
- "use strict";
2
1
  "use client";
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.Checkbox = Checkbox;
38
- const jsx_runtime_1 = require("react/jsx-runtime");
39
- const CheckboxPrimitive = __importStar(require("@radix-ui/react-checkbox"));
40
- const lucide_react_1 = require("lucide-react");
41
- const cn_1 = require("../utils/cn");
42
- function Checkbox({ className, ...props }) {
43
- return ((0, jsx_runtime_1.jsx)(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: (0, cn_1.cn)("peer border-input bg-[var(--background)] dark:bg-[var(--border)] data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border-1 shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className), ...props, children: (0, jsx_runtime_1.jsx)(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center text-current transition-none", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckIcon, { className: "size-3.5" }) }) }));
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
15
+ import { CheckIcon } from "lucide-react";
16
+ import { cn } from "../utils/cn";
17
+ function Checkbox(_a) {
18
+ var { className } = _a, props = __rest(_a, ["className"]);
19
+ return (_jsx(CheckboxPrimitive.Root, Object.assign({ "data-slot": "checkbox", className: cn("peer border-input bg-[var(--background)] dark:bg-[var(--border)] data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border-1 shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className) }, props, { children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center text-current transition-none", children: _jsx(CheckIcon, { className: "size-3.5" }) }) })));
44
20
  }
21
+ export { Checkbox };
@@ -1,44 +1,54 @@
1
- "use strict";
2
1
  "use client";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Command = Command;
5
- exports.CommandDialog = CommandDialog;
6
- exports.CommandInput = CommandInput;
7
- exports.CommandList = CommandList;
8
- exports.CommandEmpty = CommandEmpty;
9
- exports.CommandGroup = CommandGroup;
10
- exports.CommandItem = CommandItem;
11
- exports.CommandShortcut = CommandShortcut;
12
- exports.CommandSeparator = CommandSeparator;
13
- const jsx_runtime_1 = require("react/jsx-runtime");
14
- const cmdk_1 = require("cmdk");
15
- const lucide_react_1 = require("lucide-react");
16
- const cn_1 = require("../utils/cn");
17
- const dialog_1 = require("./dialog");
18
- function Command({ className, ...props }) {
19
- return ((0, jsx_runtime_1.jsx)(cmdk_1.Command, { "data-slot": "command", className: (0, cn_1.cn)("bg-card text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className), ...props }));
20
- }
21
- function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = true, ...props }) {
22
- return ((0, jsx_runtime_1.jsxs)(dialog_1.Dialog, { ...props, children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { className: "sr-only", children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogTitle, { children: title }), (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { children: description })] }), (0, jsx_runtime_1.jsx)(dialog_1.DialogContent, { className: (0, cn_1.cn)("overflow-hidden p-0", className), showCloseButton: showCloseButton, children: (0, jsx_runtime_1.jsx)(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) })] }));
23
- }
24
- function CommandInput({ className, ...props }) {
25
- return ((0, jsx_runtime_1.jsxs)("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.SearchIcon, { className: "size-4 shrink-0 opacity-50" }), (0, jsx_runtime_1.jsx)(cmdk_1.Command.Input, { "data-slot": "command-input", className: (0, cn_1.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className), ...props })] }));
26
- }
27
- function CommandList({ className, ...props }) {
28
- return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.List, { "data-slot": "command-list", className: (0, cn_1.cn)("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className), ...props }));
29
- }
30
- function CommandEmpty({ ...props }) {
31
- return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.Empty, { "data-slot": "command-empty", className: "py-6 text-center text-sm", ...props }));
32
- }
33
- function CommandGroup({ className, ...props }) {
34
- return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.Group, { "data-slot": "command-group", className: (0, cn_1.cn)("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className), ...props }));
35
- }
36
- function CommandSeparator({ className, ...props }) {
37
- return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.Separator, { "data-slot": "command-separator", className: (0, cn_1.cn)("bg-border -mx-1 h-px", className), ...props }));
38
- }
39
- function CommandItem({ className, ...props }) {
40
- return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.Item, { "data-slot": "command-item", className: (0, cn_1.cn)("data-[selected=true]:bg-[var(--input)] data-[selected=true]:text-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
41
- }
42
- function CommandShortcut({ className, ...props }) {
43
- return ((0, jsx_runtime_1.jsx)("span", { "data-slot": "command-shortcut", className: (0, cn_1.cn)("text-muted-foreground ml-auto text-xs tracking-widest", className), ...props }));
44
- }
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { Command as CommandPrimitive } from "cmdk";
15
+ import { SearchIcon } from "lucide-react";
16
+ import { cn } from "../utils/cn";
17
+ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog";
18
+ function Command(_a) {
19
+ var { className } = _a, props = __rest(_a, ["className"]);
20
+ return (_jsx(CommandPrimitive, Object.assign({ "data-slot": "command", className: cn("bg-card text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className) }, props)));
21
+ }
22
+ function CommandDialog(_a) {
23
+ var { title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = true } = _a, props = __rest(_a, ["title", "description", "children", "className", "showCloseButton"]);
24
+ return (_jsxs(Dialog, Object.assign({}, props, { children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("overflow-hidden p-0", className), showCloseButton: showCloseButton, children: _jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) })] })));
25
+ }
26
+ function CommandInput(_a) {
27
+ var { className } = _a, props = __rest(_a, ["className"]);
28
+ return (_jsxs("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3", children: [_jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, Object.assign({ "data-slot": "command-input", className: cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className) }, props))] }));
29
+ }
30
+ function CommandList(_a) {
31
+ var { className } = _a, props = __rest(_a, ["className"]);
32
+ return (_jsx(CommandPrimitive.List, Object.assign({ "data-slot": "command-list", className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className) }, props)));
33
+ }
34
+ function CommandEmpty(_a) {
35
+ var props = __rest(_a, []);
36
+ return (_jsx(CommandPrimitive.Empty, Object.assign({ "data-slot": "command-empty", className: "py-6 text-center text-sm" }, props)));
37
+ }
38
+ function CommandGroup(_a) {
39
+ var { className } = _a, props = __rest(_a, ["className"]);
40
+ return (_jsx(CommandPrimitive.Group, Object.assign({ "data-slot": "command-group", className: cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className) }, props)));
41
+ }
42
+ function CommandSeparator(_a) {
43
+ var { className } = _a, props = __rest(_a, ["className"]);
44
+ return (_jsx(CommandPrimitive.Separator, Object.assign({ "data-slot": "command-separator", className: cn("bg-border -mx-1 h-px", className) }, props)));
45
+ }
46
+ function CommandItem(_a) {
47
+ var { className } = _a, props = __rest(_a, ["className"]);
48
+ return (_jsx(CommandPrimitive.Item, Object.assign({ "data-slot": "command-item", className: cn("data-[selected=true]:bg-[var(--input)] data-[selected=true]:text-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className) }, props)));
49
+ }
50
+ function CommandShortcut(_a) {
51
+ var { className } = _a, props = __rest(_a, ["className"]);
52
+ return (_jsx("span", Object.assign({ "data-slot": "command-shortcut", className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className) }, props)));
53
+ }
54
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
@@ -1,43 +1,7 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.DateInput = void 0;
37
- const jsx_runtime_1 = require("react/jsx-runtime");
38
- const react_1 = __importStar(require("react"));
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useEffect, useRef } from 'react';
39
3
  const DateInput = ({ value, onChange }) => {
40
- const [date, setDate] = react_1.default.useState(() => {
4
+ const [date, setDate] = React.useState(() => {
41
5
  const d = value ? new Date(value) : new Date();
42
6
  return {
43
7
  day: d.getDate(),
@@ -45,10 +9,10 @@ const DateInput = ({ value, onChange }) => {
45
9
  year: d.getFullYear()
46
10
  };
47
11
  });
48
- const monthRef = (0, react_1.useRef)(null);
49
- const dayRef = (0, react_1.useRef)(null);
50
- const yearRef = (0, react_1.useRef)(null);
51
- (0, react_1.useEffect)(() => {
12
+ const monthRef = useRef(null);
13
+ const dayRef = useRef(null);
14
+ const yearRef = useRef(null);
15
+ useEffect(() => {
52
16
  const d = value ? new Date(value) : new Date();
53
17
  setDate({
54
18
  day: d.getDate(),
@@ -63,7 +27,7 @@ const DateInput = ({ value, onChange }) => {
63
27
  return false;
64
28
  }
65
29
  // Validate the day of the month
66
- const newDate = { ...date, [field]: value };
30
+ const newDate = Object.assign(Object.assign({}, date), { [field]: value });
67
31
  const d = new Date(newDate.year, newDate.month - 1, newDate.day);
68
32
  return d.getFullYear() === newDate.year &&
69
33
  d.getMonth() + 1 === newDate.month &&
@@ -73,14 +37,14 @@ const DateInput = ({ value, onChange }) => {
73
37
  const newValue = e.target.value ? Number(e.target.value) : '';
74
38
  const isValid = typeof newValue === 'number' && validateDate(field, newValue);
75
39
  // If the new value is valid, update the date
76
- const newDate = { ...date, [field]: newValue };
40
+ const newDate = Object.assign(Object.assign({}, date), { [field]: newValue });
77
41
  setDate(newDate);
78
42
  // only call onChange when the entry is valid
79
43
  if (isValid) {
80
44
  onChange(new Date(newDate.year, newDate.month - 1, newDate.day));
81
45
  }
82
46
  };
83
- const initialDate = (0, react_1.useRef)(date);
47
+ const initialDate = useRef(date);
84
48
  const handleBlur = (field) => (e) => {
85
49
  if (!e.target.value) {
86
50
  setDate(initialDate.current);
@@ -93,10 +57,11 @@ const DateInput = ({ value, onChange }) => {
93
57
  }
94
58
  else {
95
59
  // If the new value is valid, update the initial value
96
- initialDate.current = { ...date, [field]: newValue };
60
+ initialDate.current = Object.assign(Object.assign({}, date), { [field]: newValue });
97
61
  }
98
62
  };
99
63
  const handleKeyDown = (field) => (e) => {
64
+ var _a, _b, _c, _d;
100
65
  // Allow command (or control) combinations
101
66
  if (e.metaKey || e.ctrlKey) {
102
67
  return;
@@ -118,10 +83,10 @@ const DateInput = ({ value, onChange }) => {
118
83
  }
119
84
  if (e.key === 'ArrowUp') {
120
85
  e.preventDefault();
121
- let newDate = { ...date };
86
+ let newDate = Object.assign({}, date);
122
87
  if (field === 'day') {
123
88
  if (date[field] === new Date(date.year, date.month, 0).getDate()) {
124
- newDate = { ...newDate, day: 1, month: (date.month % 12) + 1 };
89
+ newDate = Object.assign(Object.assign({}, newDate), { day: 1, month: (date.month % 12) + 1 });
125
90
  if (newDate.month === 1)
126
91
  newDate.year += 1;
127
92
  }
@@ -131,7 +96,7 @@ const DateInput = ({ value, onChange }) => {
131
96
  }
132
97
  if (field === 'month') {
133
98
  if (date[field] === 12) {
134
- newDate = { ...newDate, month: 1, year: date.year + 1 };
99
+ newDate = Object.assign(Object.assign({}, newDate), { month: 1, year: date.year + 1 });
135
100
  }
136
101
  else {
137
102
  newDate.month += 1;
@@ -145,7 +110,7 @@ const DateInput = ({ value, onChange }) => {
145
110
  }
146
111
  else if (e.key === 'ArrowDown') {
147
112
  e.preventDefault();
148
- let newDate = { ...date };
113
+ let newDate = Object.assign({}, date);
149
114
  if (field === 'day') {
150
115
  if (date[field] === 1) {
151
116
  newDate.month -= 1;
@@ -161,7 +126,7 @@ const DateInput = ({ value, onChange }) => {
161
126
  }
162
127
  if (field === 'month') {
163
128
  if (date[field] === 1) {
164
- newDate = { ...newDate, month: 12, year: date.year - 1 };
129
+ newDate = Object.assign(Object.assign({}, newDate), { month: 12, year: date.year - 1 });
165
130
  }
166
131
  else {
167
132
  newDate.month -= 1;
@@ -179,9 +144,9 @@ const DateInput = ({ value, onChange }) => {
179
144
  e.currentTarget.selectionEnd === e.currentTarget.value.length)) {
180
145
  e.preventDefault();
181
146
  if (field === 'month')
182
- dayRef.current?.focus();
147
+ (_a = dayRef.current) === null || _a === void 0 ? void 0 : _a.focus();
183
148
  if (field === 'day')
184
- yearRef.current?.focus();
149
+ (_b = yearRef.current) === null || _b === void 0 ? void 0 : _b.focus();
185
150
  }
186
151
  }
187
152
  else if (e.key === 'ArrowLeft') {
@@ -190,25 +155,25 @@ const DateInput = ({ value, onChange }) => {
190
155
  e.currentTarget.selectionEnd === e.currentTarget.value.length)) {
191
156
  e.preventDefault();
192
157
  if (field === 'day')
193
- monthRef.current?.focus();
158
+ (_c = monthRef.current) === null || _c === void 0 ? void 0 : _c.focus();
194
159
  if (field === 'year')
195
- dayRef.current?.focus();
160
+ (_d = dayRef.current) === null || _d === void 0 ? void 0 : _d.focus();
196
161
  }
197
162
  }
198
163
  };
199
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex border rounded-lg items-center text-sm px-1", children: [(0, jsx_runtime_1.jsx)("input", { type: "text", ref: monthRef, max: 12, maxLength: 2, value: date.month.toString(), onChange: handleInputChange('month'), onKeyDown: handleKeyDown('month'), onFocus: (e) => {
164
+ return (_jsxs("div", { className: "flex border rounded-lg items-center text-sm px-1", children: [_jsx("input", { type: "text", ref: monthRef, max: 12, maxLength: 2, value: date.month.toString(), onChange: handleInputChange('month'), onKeyDown: handleKeyDown('month'), onFocus: (e) => {
200
165
  if (window.innerWidth > 1024) {
201
166
  e.target.select();
202
167
  }
203
- }, onBlur: handleBlur('month'), className: "p-0 outline-none w-6 border-none text-center", placeholder: "M" }), (0, jsx_runtime_1.jsx)("span", { className: "opacity-20 -mx-px", children: "/" }), (0, jsx_runtime_1.jsx)("input", { type: "text", ref: dayRef, max: 31, maxLength: 2, value: date.day.toString(), onChange: handleInputChange('day'), onKeyDown: handleKeyDown('day'), onFocus: (e) => {
168
+ }, onBlur: handleBlur('month'), className: "p-0 outline-none w-6 border-none text-center", placeholder: "M" }), _jsx("span", { className: "opacity-20 -mx-px", children: "/" }), _jsx("input", { type: "text", ref: dayRef, max: 31, maxLength: 2, value: date.day.toString(), onChange: handleInputChange('day'), onKeyDown: handleKeyDown('day'), onFocus: (e) => {
204
169
  if (window.innerWidth > 1024) {
205
170
  e.target.select();
206
171
  }
207
- }, onBlur: handleBlur('day'), className: "p-0 outline-none w-7 border-none text-center", placeholder: "D" }), (0, jsx_runtime_1.jsx)("span", { className: "opacity-20 -mx-px", children: "/" }), (0, jsx_runtime_1.jsx)("input", { type: "text", ref: yearRef, max: 9999, maxLength: 4, value: date.year.toString(), onChange: handleInputChange('year'), onKeyDown: handleKeyDown('year'), onFocus: (e) => {
172
+ }, onBlur: handleBlur('day'), className: "p-0 outline-none w-7 border-none text-center", placeholder: "D" }), _jsx("span", { className: "opacity-20 -mx-px", children: "/" }), _jsx("input", { type: "text", ref: yearRef, max: 9999, maxLength: 4, value: date.year.toString(), onChange: handleInputChange('year'), onKeyDown: handleKeyDown('year'), onFocus: (e) => {
208
173
  if (window.innerWidth > 1024) {
209
174
  e.target.select();
210
175
  }
211
176
  }, onBlur: handleBlur('year'), className: "p-0 outline-none w-12 border-none text-center", placeholder: "YYYY" })] }));
212
177
  };
213
- exports.DateInput = DateInput;
214
178
  DateInput.displayName = 'DateInput';
179
+ export { DateInput };