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.
- package/dist/hooks/use-mobile.js +2 -38
- package/dist/ikoncomponents/action-menu/index.js +15 -18
- package/dist/ikoncomponents/action-menu/type.js +1 -2
- package/dist/ikoncomponents/alert-dialog/index.js +6 -10
- package/dist/ikoncomponents/buttons/index.js +32 -23
- package/dist/ikoncomponents/combobox-input/index.js +14 -16
- package/dist/ikoncomponents/combobox-input/type.js +1 -2
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +13 -16
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +22 -58
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +18 -21
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +10 -13
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +17 -19
- package/dist/ikoncomponents/data-table/function.js +4 -7
- package/dist/ikoncomponents/data-table/index.js +81 -116
- package/dist/ikoncomponents/data-table/type.js +1 -2
- package/dist/ikoncomponents/e-chart/index.js +32 -37
- package/dist/ikoncomponents/file-input/index.js +20 -11
- package/dist/ikoncomponents/glowing-effect/index.js +16 -18
- package/dist/ikoncomponents/icon/index.js +16 -40
- package/dist/ikoncomponents/loading-spinner/index.js +16 -8
- package/dist/ikoncomponents/multi-combobox/index.js +31 -30
- package/dist/ikoncomponents/no-data/index.js +4 -7
- package/dist/ikoncomponents/page-wrapper/index.js +5 -8
- package/dist/ikoncomponents/password-strength-meter/index.js +6 -13
- package/dist/ikoncomponents/phone-input/index.js +30 -54
- package/dist/ikoncomponents/resource-spreadsheet/index.js +11 -48
- package/dist/ikoncomponents/search-input/index.js +18 -9
- package/dist/ikoncomponents/sheet/index.js +5 -8
- package/dist/ikoncomponents/simple-widget/index.js +8 -11
- package/dist/ikoncomponents/tabs/index.js +20 -22
- package/dist/ikoncomponents/tabs/type.js +1 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.js +8 -11
- package/dist/ikoncomponents/title-progress/index.js +4 -7
- package/dist/ikoncomponents/tooltip/index.js +4 -7
- package/dist/ikoncomponents/twolevel-dropdown/index.js +20 -53
- package/dist/ikoncomponents/widgets/index.js +10 -13
- package/dist/ikoncomponents/widgets/type.js +1 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +70 -123
- package/dist/shadcn/accordion.js +28 -51
- package/dist/shadcn/alert-dialog.js +60 -70
- package/dist/shadcn/alert.d.ts +1 -1
- package/dist/shadcn/alert.js +25 -15
- package/dist/shadcn/avatar.js +24 -47
- package/dist/shadcn/badge.d.ts +1 -1
- package/dist/shadcn/badge.js +21 -13
- package/dist/shadcn/button.d.ts +1 -1
- package/dist/shadcn/button.js +21 -13
- package/dist/shadcn/calendar.js +42 -97
- package/dist/shadcn/card.js +35 -25
- package/dist/shadcn/checkbox.js +19 -42
- package/dist/shadcn/command.js +53 -43
- package/dist/shadcn/date-input.js +25 -60
- package/dist/shadcn/date-range-picker.js +14 -18
- package/dist/shadcn/dialog.js +56 -79
- package/dist/shadcn/dropdown-menu.js +61 -84
- package/dist/shadcn/hover-card.js +24 -47
- package/dist/shadcn/input.js +17 -7
- package/dist/shadcn/label.js +18 -41
- package/dist/shadcn/navigation-menu.d.ts +1 -1
- package/dist/shadcn/navigation-menu.js +43 -68
- package/dist/shadcn/popover.js +27 -50
- package/dist/shadcn/progress.js +19 -42
- package/dist/shadcn/radio-group.js +23 -45
- package/dist/shadcn/scroll-area.js +22 -45
- package/dist/shadcn/select.js +58 -81
- package/dist/shadcn/separator.js +18 -41
- package/dist/shadcn/sheet.js +52 -73
- package/dist/shadcn/sidebar.d.ts +1 -1
- package/dist/shadcn/sidebar.js +113 -141
- package/dist/shadcn/skeleton.js +17 -7
- package/dist/shadcn/slider.js +19 -42
- package/dist/shadcn/sonner.js +20 -11
- package/dist/shadcn/switch.js +18 -41
- package/dist/shadcn/table.js +46 -36
- package/dist/shadcn/tabs.js +27 -50
- package/dist/shadcn/textarea.js +17 -7
- package/dist/shadcn/tooltip.js +27 -50
- package/dist/shadcn/workflow.js +8 -8
- package/dist/styles.css +3 -0
- package/dist/utils/cn.js +4 -7
- package/dist/utils/theme-provider/index.js +16 -7
- package/package.json +2 -1
package/dist/shadcn/calendar.js
CHANGED
|
@@ -1,116 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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 ((
|
|
30
|
+
return (_jsx(ChevronLeftIcon, Object.assign({ className: cn("size-4", className) }, props)));
|
|
86
31
|
}
|
|
87
32
|
if (orientation === "right") {
|
|
88
|
-
return ((
|
|
33
|
+
return (_jsx(ChevronRightIcon, Object.assign({ className: cn("size-4", className) }, props)));
|
|
89
34
|
}
|
|
90
|
-
return ((
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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(
|
|
100
|
-
|
|
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
|
|
48
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
105
49
|
}, [modifiers.focused]);
|
|
106
|
-
return ((
|
|
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:
|
|
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),
|
|
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 };
|
package/dist/shadcn/card.js
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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(
|
|
16
|
-
|
|
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(
|
|
19
|
-
|
|
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(
|
|
22
|
-
|
|
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(
|
|
25
|
-
|
|
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(
|
|
28
|
-
|
|
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(
|
|
31
|
-
|
|
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, };
|
package/dist/shadcn/checkbox.js
CHANGED
|
@@ -1,44 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
var
|
|
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 };
|
package/dist/shadcn/command.js
CHANGED
|
@@ -1,44 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ((
|
|
26
|
-
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return ((
|
|
38
|
-
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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] =
|
|
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 =
|
|
49
|
-
const dayRef =
|
|
50
|
-
const yearRef =
|
|
51
|
-
|
|
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 = {
|
|
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 = {
|
|
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 =
|
|
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 = {
|
|
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 = {
|
|
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 = {
|
|
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 = {
|
|
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 = {
|
|
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 = {
|
|
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
|
|
147
|
+
(_a = dayRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
183
148
|
if (field === 'day')
|
|
184
|
-
yearRef.current
|
|
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
|
|
158
|
+
(_c = monthRef.current) === null || _c === void 0 ? void 0 : _c.focus();
|
|
194
159
|
if (field === 'year')
|
|
195
|
-
dayRef.current
|
|
160
|
+
(_d = dayRef.current) === null || _d === void 0 ? void 0 : _d.focus();
|
|
196
161
|
}
|
|
197
162
|
}
|
|
198
163
|
};
|
|
199
|
-
return ((
|
|
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" }), (
|
|
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" }), (
|
|
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 };
|