@g4rcez/components 0.0.18 → 0.0.20

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 (57) hide show
  1. package/dist/components/core/resizable.d.ts +3 -0
  2. package/dist/components/core/resizable.d.ts.map +1 -0
  3. package/dist/components/core/resizable.js +8 -0
  4. package/dist/components/display/calendar.d.ts +11 -0
  5. package/dist/components/display/calendar.d.ts.map +1 -0
  6. package/dist/components/display/calendar.js +156 -0
  7. package/dist/components/display/tabs.d.ts.map +1 -1
  8. package/dist/components/display/tabs.js +1 -0
  9. package/dist/components/floating/dropdown.d.ts.map +1 -1
  10. package/dist/components/floating/dropdown.js +2 -1
  11. package/dist/components/floating/modal.d.ts +1 -0
  12. package/dist/components/floating/modal.d.ts.map +1 -1
  13. package/dist/components/floating/modal.js +12 -10
  14. package/dist/components/floating/tooltip.d.ts.map +1 -1
  15. package/dist/components/floating/tooltip.js +2 -1
  16. package/dist/components/form/autocomplete.d.ts.map +1 -1
  17. package/dist/components/form/autocomplete.js +5 -3
  18. package/dist/components/form/date-picker.d.ts +7 -0
  19. package/dist/components/form/date-picker.d.ts.map +1 -0
  20. package/dist/components/form/date-picker.js +65 -0
  21. package/dist/components/form/file-upload.d.ts.map +1 -1
  22. package/dist/components/form/file-upload.js +1 -0
  23. package/dist/components/form/switch.d.ts.map +1 -1
  24. package/dist/components/form/switch.js +1 -0
  25. package/dist/components/index.d.ts +3 -1
  26. package/dist/components/index.d.ts.map +1 -1
  27. package/dist/components/index.js +3 -1
  28. package/dist/components/table/index.d.ts +2 -0
  29. package/dist/components/table/index.d.ts.map +1 -1
  30. package/dist/components/table/index.js +36 -5
  31. package/dist/components/table/table-lib.d.ts +16 -5
  32. package/dist/components/table/table-lib.d.ts.map +1 -1
  33. package/dist/components/table/thead.js +1 -1
  34. package/dist/hooks/use-debounce.d.ts +4 -0
  35. package/dist/hooks/use-debounce.d.ts.map +1 -0
  36. package/dist/hooks/use-debounce.js +12 -0
  37. package/dist/index.css +1 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/index.mjs +13523 -10216
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/index.umd.js +68 -53
  42. package/dist/index.umd.js.map +1 -1
  43. package/dist/lib/dom.d.ts +1 -0
  44. package/dist/lib/dom.d.ts.map +1 -1
  45. package/dist/lib/dom.js +7 -0
  46. package/dist/preset/preset.tailwind.d.ts +1 -1
  47. package/dist/preset/preset.tailwind.d.ts.map +1 -1
  48. package/dist/preset/preset.tailwind.js +7 -4
  49. package/dist/preset/src/styles/theme.d.ts.map +1 -1
  50. package/dist/preset/src/styles/theme.js +10 -5
  51. package/dist/preset/src/styles/theme.types.d.ts +1 -0
  52. package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
  53. package/dist/styles/theme.d.ts.map +1 -1
  54. package/dist/styles/theme.js +10 -5
  55. package/dist/styles/theme.types.d.ts +1 -0
  56. package/dist/styles/theme.types.d.ts.map +1 -1
  57. package/package.json +19 -10
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ export declare const Resizable: ({ children }: React.PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=resizable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../../src/components/core/resizable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,SAAS,iBAAkB,KAAK,CAAC,iBAAiB,4CAO9D,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { motion } from "framer-motion";
4
+ import useMeasure from "react-use-measure";
5
+ export const Resizable = ({ children }) => {
6
+ const [ref, bounds] = useMeasure();
7
+ return (_jsx(motion.div, { animate: { height: bounds.height > 0 ? bounds.height : 'auto' }, children: _jsx("div", { ref: ref, children: children }) }));
8
+ };
@@ -0,0 +1,11 @@
1
+ import { Locales } from "the-mask-input";
2
+ export type CalendarProps = {
3
+ disabledDate?: (date: Date) => boolean;
4
+ date?: Date;
5
+ locale?: Locales;
6
+ markToday?: boolean;
7
+ autoFocusToday?: boolean;
8
+ onChange?: (d: Date) => void;
9
+ };
10
+ export declare const Calendar: ({ locale, disabledDate, markToday, autoFocusToday, date, onChange }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/display/calendar.tsx"],"names":[],"mappings":"AAsBA,OAAqB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAmBvD,MAAM,MAAM,aAAa,GAAG;IACxB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IACvC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;CAChC,CAAC;AAmDF,eAAO,MAAM,QAAQ,wEAAuF,aAAa,4CAmMxH,CAAC"}
@@ -0,0 +1,156 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { addDays, addMonths, addWeeks, addYears, eachDayOfInterval, endOfWeek, isSameMonth, isToday, startOfDay, startOfMonth, startOfWeek, subDays, subMonths, subWeeks, subYears, } from "date-fns";
4
+ import { AnimatePresence, motion, MotionConfig } from "framer-motion";
5
+ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
6
+ import { useEffect } from "react";
7
+ import { Is } from "sidekicker";
8
+ import TheMaskInput from "the-mask-input";
9
+ import { useReducer } from "use-typed-reducer";
10
+ import { useDebounce } from "../../hooks/use-debounce";
11
+ import { Resizable } from "../core/resizable";
12
+ const transition = { type: "spring", bounce: 0.1, duration: 0.3 };
13
+ const dir = (mod) => (n = 1) => ({ x: `${100 * mod * n}%`, opacity: 0.5 });
14
+ const variants = {
15
+ middle: { x: "0%", opacity: 1 },
16
+ enter: dir(1),
17
+ exit: dir(-1),
18
+ };
19
+ const removeImmediately = { exit: { visibility: "hidden" } };
20
+ const createDays = (month) => {
21
+ const start = startOfWeek(startOfMonth(month));
22
+ return eachDayOfInterval({ start, end: addDays(start, 41) });
23
+ };
24
+ const formatMonth = (d, locale) => d.toLocaleDateString(locale, { month: "long" });
25
+ const getOptionsMonth = (date, locale) => Array.from({ length: 12 }).map((_, i) => {
26
+ const month = startOfMonth(new Date(date).setMonth(i));
27
+ const label = formatMonth(month, locale);
28
+ return (_jsx("option", { value: label, "data-index": i, children: label }, label));
29
+ });
30
+ const onChangeUsingKeyboard = {
31
+ ArrowLeft: (date, duration) => {
32
+ if (duration === "days")
33
+ return subDays(date, 1);
34
+ return subMonths(date, 1);
35
+ },
36
+ ArrowRight: (date, duration) => {
37
+ if (duration === "days")
38
+ return addDays(date, 1);
39
+ return addMonths(date, 1);
40
+ },
41
+ ArrowUp: (date, duration) => {
42
+ if (duration === "days")
43
+ return subWeeks(date, 1);
44
+ return subYears(date, 1);
45
+ },
46
+ ArrowDown: (date, duration) => {
47
+ if (duration === "days")
48
+ return addWeeks(date, 1);
49
+ return addYears(date, 1);
50
+ },
51
+ };
52
+ const focusDate = (next, delay = 0) => {
53
+ const d = next.toISOString();
54
+ const select = () => {
55
+ const element = document.querySelector(`button[data-date="${d}"]`);
56
+ if (element)
57
+ return element.focus({ preventScroll: false });
58
+ };
59
+ if (delay === 0)
60
+ select();
61
+ setTimeout(select, delay);
62
+ };
63
+ const formatYear = (now) => now.getFullYear().toString().padStart(4, "0");
64
+ export const Calendar = ({ locale, disabledDate, markToday = true, autoFocusToday = true, date, onChange }) => {
65
+ const now = date || new Date();
66
+ const [state, dispatch] = useReducer({
67
+ date: now,
68
+ isAnimating: false,
69
+ year: formatYear(now),
70
+ direction: undefined,
71
+ months: getOptionsMonth(now, locale),
72
+ week: eachDayOfInterval({ start: startOfWeek(now), end: endOfWeek(now) }),
73
+ }, (get) => ({
74
+ onChangeYear: (year) => ({ year }),
75
+ setToday: () => ({ date: startOfDay(new Date()) }),
76
+ onExitComplete: () => {
77
+ focusDate(get.state().date, 200);
78
+ return { isAnimating: false };
79
+ },
80
+ date: (callback) => {
81
+ const newDate = callback(get.state().date);
82
+ return { date: newDate, year: formatYear(newDate) };
83
+ },
84
+ nextMonth: () => {
85
+ const state = get.state();
86
+ if (state.isAnimating)
87
+ return state;
88
+ const date = addMonths(state.date, 1);
89
+ return { date, isAnimating: true, direction: 1, year: formatYear(date) };
90
+ },
91
+ previousMonth: () => {
92
+ const state = get.state();
93
+ if (state.isAnimating)
94
+ return state;
95
+ const date = subMonths(state.date, 1);
96
+ return { date, isAnimating: true, direction: -1, year: formatYear(date) };
97
+ },
98
+ onSelectDate: (e) => {
99
+ const d = e.currentTarget.dataset.date || "";
100
+ const date = new Date(d);
101
+ return { date, year: formatYear(date) };
102
+ },
103
+ onChangeMonth: (e) => {
104
+ const value = e.target.value;
105
+ const array = Array.from(e.target.options);
106
+ const month = array.find((x) => x.value === value);
107
+ if (month) {
108
+ const i = month.dataset.index || "";
109
+ const d = new Date(get.state().date);
110
+ d.setMonth(+i);
111
+ return { date: d, year: formatYear(d) };
112
+ }
113
+ return get.state();
114
+ },
115
+ onKeyDown: (e) => {
116
+ const key = e.key;
117
+ if (key in onChangeUsingKeyboard) {
118
+ if (key === "ArrowUp" || key === "ArrowDown")
119
+ e.preventDefault();
120
+ const prev = get.state().date;
121
+ const date = Is.keyof(onChangeUsingKeyboard, key) ? onChangeUsingKeyboard[key](prev, e.shiftKey ? "month" : "days") : null;
122
+ if (date !== null) {
123
+ focusDate(date);
124
+ return { date, year: formatYear(date) };
125
+ }
126
+ }
127
+ return get.state();
128
+ },
129
+ }));
130
+ const days = createDays(state.date);
131
+ const currentAsString = state.date.toISOString();
132
+ const monthString = formatMonth(state.date, locale);
133
+ useEffect(() => onChange === null || onChange === void 0 ? void 0 : onChange(state.date), [currentAsString]);
134
+ const defer = useDebounce((y) => {
135
+ dispatch.date((prev) => {
136
+ const d = new Date(prev);
137
+ d.setFullYear(+y);
138
+ return d;
139
+ });
140
+ }, 700);
141
+ const onChangeYear = (e) => {
142
+ const value = e.currentTarget.value;
143
+ dispatch.onChangeYear(value);
144
+ defer(value);
145
+ };
146
+ return (_jsx(MotionConfig, { transition: transition, children: _jsxs("div", { className: "relative overflow-hidden", children: [_jsx("div", { className: "flex flex-col justify-center rounded text-center", children: _jsx(Resizable, { children: _jsx(AnimatePresence, { presenceAffectsLayout: true, mode: "popLayout", initial: false, custom: state.direction, onExitComplete: dispatch.onExitComplete, children: _jsxs(motion.div, { initial: "enter", animate: "middle", exit: "exit", children: [_jsxs("header", { className: "relative flex justify-between", children: [_jsx(motion.button, { onClick: dispatch.previousMonth, variants: removeImmediately, className: "z-calendar rounded-full p-1.5 hover:bg-primary-subtle", children: _jsx(ChevronLeftIcon, { className: "h-4 w-4" }) }), _jsx(motion.span, { variants: variants, custom: state.direction, className: "absolute z-normal isolate inset-0 flex items-center justify-center font-semibold", children: _jsxs("span", { className: "w-fit flex items-center justify-center gap-0.5 py-1", children: [_jsx("select", { style: { width: `${monthString.length}ch` }, value: monthString, onChange: dispatch.onChangeMonth, className: "appearance-none capitalize bg-transparent proportional-nums hover:text-primary cursor-pointer w-fit", children: state.months }), _jsx(TheMaskInput, { mask: "int", value: state.year, maxLength: 4, placeholder: "YYYY", onChange: onChangeYear, style: { width: `${state.year.length}ch` }, className: "w-16 bg-transparent appearance-none hover:text-primary cursor-pointer" })] }) }), _jsx(motion.button, { variants: removeImmediately, className: "z-calendar rounded-full p-1.5 hover:bg-primary-subtle", onClick: dispatch.nextMonth, children: _jsx(ChevronRightIcon, { className: "h-4 w-4" }) }), _jsx("div", { className: "absolute inset-0", style: {
147
+ backgroundImage: "linear-gradient(to right, hsla(var(--card-background)) 15%, transparent 30%, transparent 70%, hsla(var(--card-background)) 85%)",
148
+ } })] }), _jsx("div", { className: "mt-4 grid grid-cols-7 gap-y-4", children: state.week.map((dayOfWeek) => (_jsx("span", { className: "font-medium capitalize text-sm", children: dayOfWeek.toLocaleDateString(locale, { weekday: "short" }) }, dayOfWeek.toString()))) }), _jsx(motion.ul, { onKeyDown: dispatch.onKeyDown, variants: variants, custom: state.direction, className: "mt-4 pb-2 grid grid-cols-7 gap-y-4", children: days.map((day) => {
149
+ const key = day.toISOString();
150
+ const isSelected = key === currentAsString;
151
+ const today = isToday(day) && markToday;
152
+ const disabledByFn = (disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(day)) || false;
153
+ const disableDate = !isSameMonth(day, state.date) || disabledByFn;
154
+ return (_jsx("li", { className: "w-full flex items-center justify-center", children: _jsx("button", { type: "button", "data-date": key, disabled: disabledByFn, onClick: dispatch.onSelectDate, "data-view": state.date.getMonth().toString(), className: `size-8 disabled:cursor-not-allowed rounded-full font-semibold flex items-center justify-center proportional-nums ${today ? "text-primary" : ""} ${disableDate ? "text-disabled" : ""} ${isSelected ? "bg-primary text-primary-foreground" : ""}`, children: day.getDate() }) }, key));
155
+ }) })] }, monthString) }) }) }), _jsx("footer", { className: "text-center text-primary mt-2", children: _jsx("button", { className: "hover:scale-105 transition-transform duration-300", type: "button", onClick: dispatch.setToday, children: "Today" }) })] }) }));
156
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/display/tabs.tsx"],"names":[],"mappings":"AACA,OAAc,EAA2B,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAEzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,MAAM,SAAS,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAI/F,eAAO,MAAM,IAAI,UAAW,iBAAiB,CAAC,SAAS,CAAC,4CAgGvD,CAAC;AAIF,MAAM,MAAM,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC;AAEpD,eAAO,MAAM,GAAG,UAAW,iBAAiB,CAAC,QAAQ,CAAC,4CAGrD,CAAC"}
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/display/tabs.tsx"],"names":[],"mappings":"AAEA,OAAc,EAA2B,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAEzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,MAAM,SAAS,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAI/F,eAAO,MAAM,IAAI,UAAW,iBAAiB,CAAC,SAAS,CAAC,4CAgGvD,CAAC;AAIF,MAAM,MAAM,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC;AAEpD,eAAO,MAAM,GAAG,UAAW,iBAAiB,CAAC,QAAQ,CAAC,4CAGrD,CAAC"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { motion, useMotionValue } from "framer-motion";
3
4
  import React, { createContext, Fragment, useContext, useEffect, useRef } from "react";
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/floating/dropdown.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,EAAmB,iBAAiB,EAA6B,MAAM,OAAO,CAAC;AAE7F,KAAK,aAAa,GAAG;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;CACzD,CAAC;AAEF,eAAO,MAAM,QAAQ,UAAW,iBAAiB,CAAC,aAAa,CAAC,4CA4D/D,CAAC"}
1
+ {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/floating/dropdown.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,EAAmB,iBAAiB,EAA6B,MAAM,OAAO,CAAC;AAE7F,KAAK,aAAa,GAAG;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;CACzD,CAAC;AAEF,eAAO,MAAM,QAAQ,UAAW,iBAAiB,CAAC,aAAa,CAAC,4CA4D/D,CAAC"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { arrow, autoUpdate, flip, FloatingArrow, FloatingFocusManager, FloatingPortal, offset, shift, useClick, useDismiss, useFloating, useInteractions, useRole, } from "@floating-ui/react";
3
4
  import { Fragment, useId, useMemo, useRef, useState } from "react";
@@ -26,5 +27,5 @@ export const Dropdown = (props) => {
26
27
  const dismiss = useDismiss(context);
27
28
  const role = useRole(context);
28
29
  const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role]);
29
- return (_jsxs(Fragment, { children: [_jsx("button", Object.assign({ ref: refs.setReference }, getReferenceProps(), { type: "button", children: props.trigger })), open && (_jsx(FloatingPortal, { id: `${headingId}-portal`, children: _jsx(FloatingFocusManager, { returnFocus: true, visuallyHiddenDismiss: true, restoreFocus: true, context: context, modal: false, children: _jsxs("div", Object.assign({ className: "bg-floating-background relative min-w-96 isolate z-floating border shadow-2xl p-6 border-floating-border rounded-lg", ref: refs.setFloating, style: floatingStyles, "aria-labelledby": headingId }, getFloatingProps(), { children: [_jsx(FloatingArrow, { ref: arrowRef, context: context, strokeWidth: 0.1, className: "fill-floating-background stroke-floating-border" }), _jsx("header", { className: "mb-2", children: _jsx("h3", { className: "leading-snug font-medium text-2xl tracking-tight text-left", children: props.title }) }), props.children] })) }) }))] }));
30
+ return (_jsxs(Fragment, { children: [_jsx("button", Object.assign({ ref: refs.setReference }, getReferenceProps(), { type: "button", children: props.trigger })), open && (_jsx(FloatingPortal, { id: `${headingId}-portal`, children: _jsx(FloatingFocusManager, { returnFocus: true, visuallyHiddenDismiss: true, restoreFocus: true, context: context, modal: false, children: _jsxs("div", Object.assign({ className: "bg-floating-background relative min-w-96 isolate z-floating border shadow-2xl p-6 border-floating-border rounded-lg", ref: refs.setFloating, style: floatingStyles, "aria-labelledby": headingId }, getFloatingProps(), { children: [_jsx(FloatingArrow, { ref: arrowRef, context: context, strokeWidth: 0.1, className: "fill-floating-background stroke-floating-border" }), _jsx("header", { className: "mb-2", children: _jsx("h3", { className: "leading-snug font-medium text-2xl tracking-wide text-left", children: props.title }) }), props.children] })) }) }))] }));
30
31
  };
@@ -6,6 +6,7 @@ export type DrawerProps = {
6
6
  footer?: Label;
7
7
  resizer?: boolean;
8
8
  asChild?: boolean;
9
+ closable?: boolean;
9
10
  type?: "dialog" | "drawer";
10
11
  position?: "left" | "right";
11
12
  trigger: Label | React.FC<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAS,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AA6CpC,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,OAAO,EAAE,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAC/B,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CAAC;AAiCF,eAAO,MAAM,KAAK,gCAAmD,iBAAiB,CAAC,WAAW,CAAC,4CA+DlG,CAAC"}
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAS,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AA+CpC,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,OAAO,EAAE,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAC/B,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CAAC;AAiCF,eAAO,MAAM,KAAK,gCAAmD,iBAAiB,CAAC,WAAW,CAAC,4CA4ElG,CAAC"}
@@ -5,27 +5,29 @@ import { FloatingFocusManager, FloatingOverlay, FloatingPortal, useClick, useDis
5
5
  import { Slot } from "@radix-ui/react-slot";
6
6
  import { cva } from "class-variance-authority";
7
7
  import { AnimatePresence, motion, useMotionValue } from "framer-motion";
8
+ import { XIcon } from "lucide-react";
8
9
  import { Fragment, useId } from "react";
10
+ const animationDuration = '600ms';
9
11
  const createDrawerAnimation = (side) => ({
10
- initial: { [side]: "-60%", opacity: 0.8 },
11
- enter: { [side]: 0, opacity: 1 },
12
- exit: { [side]: "-60%", opacity: 0.8 },
12
+ initial: { [side]: "-60%", opacity: 0.8, animationDuration },
13
+ enter: { [side]: 0, opacity: 1, animationDuration },
14
+ exit: { [side]: ["-50%", "-90%"], opacity: 0, animationDuration },
13
15
  });
14
16
  const drawerLeft = createDrawerAnimation("left");
15
17
  const drawerRight = createDrawerAnimation("right");
16
18
  const animations = {
17
19
  drawer: (type) => (type === "left" ? drawerLeft : drawerRight),
18
20
  dialog: {
19
- initial: { opacity: 0, scale: 0.9 },
20
- enter: { opacity: 1, scale: [1.125, 1] },
21
- exit: { opacity: 0, scale: 0.9 },
21
+ initial: { opacity: 0, scale: 0.95, animationDuration },
22
+ enter: { opacity: 1, scale: [1.05, 1], animationDuration },
23
+ exit: { opacity: 0, scale: 0.97, animationDuration },
22
24
  },
23
25
  };
24
- const variants = cva("isolate ring-0 outline-0 appearance-none container flex flex-col gap-4 flex-nowrap min-w-xs bg-floating-background", {
26
+ const variants = cva("isolate ring-0 outline-0 appearance-none flex flex-col gap-4 flex-nowrap min-w-xs bg-floating-background", {
25
27
  variants: {
26
28
  type: {
27
- drawer: "max-h-screen h-screen min-h-0",
28
- dialog: "max-h-[calc(100lvh-10%)] h-[inherit] relative rounded-lg py-8",
29
+ drawer: "max-h-screen max-w-[90%] w-auto h-screen min-h-0",
30
+ dialog: "max-h-[calc(100lvh-10%)] container h-[inherit] rounded-lg py-8",
29
31
  },
30
32
  position: {
31
33
  none: "",
@@ -61,5 +63,5 @@ export const Modal = (_a) => {
61
63
  const { getReferenceProps, getFloatingProps } = useInteractions([click, role, dismiss]);
62
64
  const Trigger = props.trigger;
63
65
  const value = useMotionValue(undefined);
64
- return (_jsxs(Fragment, { children: [props.asChild ? (_jsx(Slot, Object.assign({ ref: refs.setReference }, getReferenceProps(), { children: Trigger }))) : (_jsx("button", Object.assign({ ref: refs.setReference }, getReferenceProps(), { type: "button", children: Trigger }))), _jsx(FloatingPortal, { children: _jsx(AnimatePresence, { presenceAffectsLayout: true, children: props.open && (_jsx(FloatingOverlay, { lockScroll: true, className: `relative !overflow-clip h-[100dvh] z-floating bg-floating-overlay/70 ${type === "drawer" ? "" : "grid items-baseline p-8"}`, children: _jsx(FloatingFocusManager, { modal: true, closeOnFocusOut: true, context: context, children: _jsxs(motion.div, Object.assign({ animate: "enter", "aria-describedby": descriptionId, "aria-labelledby": headingId, className: variants({ position, type }), exit: "exit", initial: "initial", ref: refs.setFloating, variants: animation, style: { width: value } }, getFloatingProps(), { children: [!isDialog && resizer ? _jsx(Draggable, { value: value, parent: refs.floating, type: position }) : null, props.title ? (_jsx("header", { className: "w-full", children: _jsx("h2", { className: "px-8 pb-4 border-b border-floating-border text-3xl font-medium leading-relaxed", children: props.title }) })) : null, _jsx("div", { className: "flex-1 px-8 overflow-y-auto", children: props.children }), props.footer ? (_jsx("footer", { className: "px-8 border-t border-floating-border pt-4 w-full", children: props.footer })) : null] })) }) })) }) })] }));
66
+ return (_jsxs(Fragment, { children: [props.asChild ? (_jsx(Slot, Object.assign({ ref: refs.setReference }, getReferenceProps(), { children: Trigger }))) : (_jsx("button", Object.assign({ ref: refs.setReference }, getReferenceProps(), { type: "button", children: Trigger }))), _jsx(FloatingPortal, { children: _jsx(AnimatePresence, { presenceAffectsLayout: true, children: props.open && (_jsx(FloatingOverlay, { lockScroll: true, className: `relative !overflow-clip h-[100dvh] z-floating bg-floating-overlay/70 ${type === "drawer" ? "" : "grid justify-center p-8"}`, children: _jsx(FloatingFocusManager, { modal: true, closeOnFocusOut: true, context: context, children: _jsxs(motion.div, Object.assign({ animate: "enter", "aria-describedby": descriptionId, "aria-labelledby": headingId, className: variants({ position, type }), exit: "exit", initial: "initial", ref: refs.setFloating, variants: animation, style: { width: value } }, getFloatingProps(), { children: [!isDialog && resizer ? _jsx(Draggable, { value: value, parent: refs.floating, type: position }) : null, props.title || props.closable ? (_jsxs("header", { className: "w-full relative", children: [props.title ? (_jsx("h2", { className: "px-8 pb-4 border-b border-floating-border text-3xl font-medium leading-relaxed", children: props.title })) : null, props.closable !== false ? (_jsx("nav", { className: "absolute -top-1 right-8", children: _jsx("button", { type: "button", onClick: () => { var _a; return (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, false); }, className: "p-1 transition-colors hover:text-danger focus:text-danger", children: _jsx(XIcon, {}) }) })) : null] })) : null, _jsx("div", { className: "flex-1 px-8 overflow-y-auto", children: props.children }), props.footer ? (_jsx("footer", { className: "px-8 border-t border-floating-border pt-4 w-full", children: props.footer })) : null] })) }) })) }) })] }));
65
67
  };
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/floating/tooltip.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAa,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9C,KAAK,YAAY,GAAG,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAEzG,eAAO,MAAM,OAAO,sCAAuC,YAAY,4CA6CtE,CAAC"}
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/floating/tooltip.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAa,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9C,KAAK,YAAY,GAAG,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAEzG,eAAO,MAAM,OAAO,sCAAuC,YAAY,4CA6CtE,CAAC"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { __rest } from "tslib";
2
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
4
  import { arrow, autoUpdate, flip, FloatingArrow, FloatingPortal, offset, shift, useDismiss, useFloating, useFocus, useHover, useInteractions, useRole, } from "@floating-ui/react";
@@ -28,5 +29,5 @@ export const Tooltip = (_a) => {
28
29
  const dismiss = useDismiss(context);
29
30
  const role = useRole(context, { role: "tooltip" });
30
31
  const { getReferenceProps, getFloatingProps } = useInteractions([hover, focus, dismiss, role]);
31
- return (_jsxs(Fragment, { children: [_jsx(Component, Object.assign({ ref: refs.setReference }, getReferenceProps(props), { children: title })), _jsx(FloatingPortal, { children: isOpen && (_jsxs(Polymorph, Object.assign({}, getFloatingProps(), { ref: refs.setFloating, style: floatingStyles, className: "bg-tooltip-background text-tooltip-foreground border border-tooltip-border p-3 rounded-lg", children: [_jsx(FloatingArrow, { ref: arrowRef, context: context, strokeWidth: 0.1, className: "fill-tooltip-background stroke-tooltip-border" }), children] }))) })] }));
32
+ return (_jsxs(Fragment, { children: [_jsx(Component, Object.assign({ ref: refs.setReference }, getReferenceProps(props), { children: title })), _jsx(FloatingPortal, { children: isOpen && (_jsxs(Polymorph, Object.assign({}, getFloatingProps(), { ref: refs.setFloating, style: floatingStyles, className: "bg-tooltip-background z-tooltip text-tooltip-foreground border border-tooltip-border p-3 rounded-lg", children: [_jsx(FloatingArrow, { ref: arrowRef, context: context, strokeWidth: 0.1, className: "fill-tooltip-background stroke-tooltip-border" }), children] }))) })] }));
32
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAI5C,KAAK,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,GAAG;IAChE,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,MAAM,8FAWjB,CAAC;AAEH,KAAK,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,EAAE,CAAC;CAC1B,CAAC;AAaF,eAAO,MAAM,YAAY,mGAoKvB,CAAC"}
1
+ {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,KAAK,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,GAAG;IAChE,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,MAAM,8FAWjB,CAAC;AAEH,KAAK,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,EAAE,CAAC;CAC1B,CAAC;AAaF,eAAO,MAAM,YAAY,mGAsKvB,CAAC"}
@@ -6,9 +6,9 @@ import { autoUpdate, FloatingFocusManager, FloatingPortal, offset, size, useDism
6
6
  import Fuzzy from "fuzzy-search";
7
7
  import { ChevronDown } from "lucide-react";
8
8
  import { forwardRef, useImperativeHandle, useRef, useState } from "react";
9
- import { InputField } from "./input-field";
10
9
  import { usePrevious } from "../../hooks/use-previous";
11
- import { css } from "../../lib/dom";
10
+ import { css, dispatchInput } from "../../lib/dom";
11
+ import { InputField } from "./input-field";
12
12
  export const Option = forwardRef((_a, ref) => {
13
13
  var _b;
14
14
  var { selected, active, onClick, option } = _a, rest = __rest(_a, ["selected", "active", "onClick", "option"]);
@@ -16,7 +16,7 @@ export const Option = forwardRef((_a, ref) => {
16
16
  });
17
17
  const transitionStyles = {
18
18
  duration: 300,
19
- initial: { transform: "scaleY(0)", opacity: 0.2 },
19
+ initial: { transform: "scaleY(0)", opacity: 0.4 },
20
20
  open: { transform: "scaleY(1)", opacity: 1 },
21
21
  close: { transform: "scaleY(0)", opacity: 0 },
22
22
  };
@@ -79,6 +79,7 @@ export const Autocomplete = forwardRef((_a, externalRef) => {
79
79
  ]);
80
80
  const onSelect = (opt) => {
81
81
  setValue(opt.value);
82
+ dispatchInput(refs.reference.current, opt.value);
82
83
  setOpen(false);
83
84
  setShadow("");
84
85
  };
@@ -97,6 +98,7 @@ export const Autocomplete = forwardRef((_a, externalRef) => {
97
98
  const onClose = () => {
98
99
  setShadow("");
99
100
  setValue("");
101
+ dispatchInput(refs.reference.current, "");
100
102
  setOpen(false);
101
103
  };
102
104
  return (_jsxs("fieldset", { className: "relative w-auto", children: [_jsx(InputField, Object.assign({}, props, { required: required, right: _jsxs("span", { className: "flex items-center gap-0.5", children: [_jsx(ChevronDown, { size: 20 }), value ? (_jsx("button", { type: "button", onClick: onClose, className: "link:text-danger transition-colors", children: _jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }) })) : null] }), children: _jsx("input", Object.assign({}, getReferenceProps(Object.assign(Object.assign({}, props), { onChange,
@@ -0,0 +1,7 @@
1
+ import { Override } from "../../types";
2
+ import { CalendarProps } from "../display/calendar";
3
+ import { InputProps } from "./input";
4
+ type DatePickerProps = Override<InputProps, CalendarProps & {}>;
5
+ export declare const DatePicker: ({ date, locale, disabledDate, autoFocusToday, onChange, markToday, ...props }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=date-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/components/form/date-picker.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAY,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAS,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,eAAe,GAAG,QAAQ,CAAC,UAAU,EAAE,aAAa,GAAG,EAAE,CAAC,CAAC;AAyBhE,eAAO,MAAM,UAAU,kFAAmF,eAAe,4CAuExH,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { format, parse, startOfDay } from "date-fns";
4
+ import { CalendarIcon } from "lucide-react";
5
+ import { Fragment, useMemo, useState } from "react";
6
+ import { Is } from "sidekicker";
7
+ import { Calendar } from "../display/calendar";
8
+ import { Dropdown } from "../floating/dropdown";
9
+ import { Input } from "./input";
10
+ const fixedDate = new Date(1970, 11, 31);
11
+ const parts = {
12
+ year: () => [/\d/, /\d/, /\d/, /\d/],
13
+ month: () => [/\d/, /\d/],
14
+ day: () => [/\d/, /\d/],
15
+ literal: (str) => str.split(""),
16
+ };
17
+ const placeholders = {
18
+ year: () => "yyyy",
19
+ month: () => "MM",
20
+ day: () => "dd",
21
+ literal: (str) => str,
22
+ };
23
+ const partValues = {
24
+ literal: (date, str) => str,
25
+ year: (date) => date.getFullYear(),
26
+ day: (date) => date.getDate().toString().padStart(2, "0"),
27
+ month: (date) => (date.getMonth() + 1).toString().padStart(2, "0"),
28
+ };
29
+ export const DatePicker = (_a) => {
30
+ var _b;
31
+ var { date, locale, disabledDate, autoFocusToday, onChange, markToday } = _a, props = __rest(_a, ["date", "locale", "disabledDate", "autoFocusToday", "onChange", "markToday"]);
32
+ const datetimeFormat = useMemo(() => new Intl.DateTimeFormat(locale), [locale]);
33
+ const [innerDate, setInnerDate] = useState(date || undefined);
34
+ const [open, setOpen] = useState(false);
35
+ const mask = datetimeFormat.formatToParts(fixedDate).flatMap((x) => (Is.keyof(parts, x.type) ? parts[x.type](x.value) : []));
36
+ const placeholder = datetimeFormat
37
+ .formatToParts(fixedDate)
38
+ .reduce((acc, x) => acc + (Is.keyof(placeholders, x.type) ? placeholders[x.type](x.value) : ""), "");
39
+ const [value, setValue] = useState(!innerDate
40
+ ? ""
41
+ : datetimeFormat
42
+ .formatToParts(innerDate)
43
+ .reduce((acc, x) => acc + (Is.keyof(parts, x.type) ? partValues[x.type](innerDate, x.value) : ""), ""));
44
+ const onChangeDateInput = (e) => {
45
+ const v = e.target.value;
46
+ setValue(v);
47
+ if (mask.length === v.length) {
48
+ const matches = mask.every((x, i) => {
49
+ const c = v.charAt(i);
50
+ return typeof x === "string" ? c === x : x.test(c);
51
+ });
52
+ if (matches) {
53
+ const d = startOfDay(parse(v, placeholder, new Date()));
54
+ setInnerDate(d);
55
+ onChange === null || onChange === void 0 ? void 0 : onChange(d);
56
+ }
57
+ }
58
+ };
59
+ const onChangeDate = (d) => {
60
+ setInnerDate(d);
61
+ onChange === null || onChange === void 0 ? void 0 : onChange(d);
62
+ setValue(format(d, placeholder));
63
+ };
64
+ return (_jsx(Input, Object.assign({}, props, { mask: mask, value: value, onChange: onChangeDateInput, className: "uppercase", formNoValidate: !open, placeholder: placeholder, required: (_b = props.required) !== null && _b !== void 0 ? _b : true, error: open ? undefined : props.error, name: props.name ? `${props.name}-picker` : props.name, right: _jsxs(Fragment, { children: [_jsx("input", { defaultValue: innerDate === null || innerDate === void 0 ? void 0 : innerDate.toISOString(), hidden: true, type: "date", name: props.name }), _jsx(Dropdown, { trigger: _jsx(CalendarIcon, {}), onChange: setOpen, open: open, children: _jsx(Calendar, Object.assign({}, props, { locale: locale, date: innerDate, onChange: onChangeDate, markToday: markToday, disabledDate: disabledDate, autoFocusToday: autoFocusToday })) })] }) })));
65
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../src/components/form/file-upload.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAe,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,KAAK,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG;IAClE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;CACnC,CAAC;AAmGF,eAAO,MAAM,UAAU,6CAA4D,KAAK,4CAiBvF,CAAC"}
1
+ {"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../src/components/form/file-upload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAe,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,KAAK,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG;IAClE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;CACnC,CAAC;AAmGF,eAAO,MAAM,UAAU,6CAA4D,KAAK,4CAiBvF,CAAC"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { __rest } from "tslib";
2
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
4
  import { FileIcon, Trash2Icon, UploadIcon } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/form/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAE/C,KAAK,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE,CAAC;AAEhH,eAAO,MAAM,MAAM,2BAA4B,WAAW,4CAmCzD,CAAC"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/form/switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAE/C,KAAK,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE,CAAC;AAEhH,eAAO,MAAM,MAAM,2BAA4B,WAAW,4CAmCzD,CAAC"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { __rest } from "tslib";
2
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
4
  import { useId, useState } from "react";
@@ -8,15 +8,17 @@ export * from "./form/switch";
8
8
  export * from "./form/input-field";
9
9
  export * from "./form/transfer-list";
10
10
  export * from "./form/checkbox";
11
+ export * from "./form/date-picker";
11
12
  export * from "./core/button";
12
13
  export * from "./core/polymorph";
13
14
  export * from "./core/tag";
14
15
  export * from "./display/card";
15
16
  export * from "./display/stats";
16
17
  export * from "./display/tabs";
18
+ export * from "./display/calendar";
17
19
  export * from "./floating/dropdown";
18
20
  export * from "./floating/tooltip";
19
21
  export * from "./floating/modal";
20
22
  export * from "./table/index";
21
- export { createColumns, createOptionCols, ColType, useTablePreferences } from "./table/table-lib";
23
+ export { createColumns, createOptionCols, type ColType, useTablePreferences, type TablePagination } from "./table/table-lib";
22
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,KAAK,OAAO,EAAE,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -8,14 +8,16 @@ export * from "./form/switch";
8
8
  export * from "./form/input-field";
9
9
  export * from "./form/transfer-list";
10
10
  export * from "./form/checkbox";
11
+ export * from "./form/date-picker";
11
12
  export * from "./core/button";
12
13
  export * from "./core/polymorph";
13
14
  export * from "./core/tag";
14
15
  export * from "./display/card";
15
16
  export * from "./display/stats";
16
17
  export * from "./display/tabs";
18
+ export * from "./display/calendar";
17
19
  export * from "./floating/dropdown";
18
20
  export * from "./floating/tooltip";
19
21
  export * from "./floating/modal";
20
22
  export * from "./table/index";
21
- export { createColumns, createOptionCols, ColType, useTablePreferences } from "./table/table-lib";
23
+ export { createColumns, createOptionCols, useTablePreferences } from "./table/table-lib";
@@ -5,6 +5,7 @@ import { GroupItem } from "./group";
5
5
  import { Sorter } from "./sort";
6
6
  import { Col, TableOperationProps } from "./table-lib";
7
7
  type InnerTableProps<T extends {}> = HTMLAttributes<HTMLTableElement> & TableOperationProps<T> & {
8
+ useControl?: boolean;
8
9
  loading?: boolean;
9
10
  group?: GroupItem<T>;
10
11
  groups?: GroupItem<T>[];
@@ -20,6 +21,7 @@ type InnerTableProps<T extends {}> = HTMLAttributes<HTMLTableElement> & TableOpe
20
21
  loadingMore?: boolean;
21
22
  };
22
23
  export type TableProps<T extends {}> = Pick<InnerTableProps<T>, "cols" | "rows" | "loadingMore"> & {
24
+ useControl?: boolean;
23
25
  name: string;
24
26
  operations?: boolean;
25
27
  onScrollEnd?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAY,cAAc,EAAwC,MAAM,OAAO,CAAC;AAM9F,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAa,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAoB,GAAG,EAA+B,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGtG,KAAK,eAAe,CAAC,CAAC,SAAS,EAAE,IAAI,cAAc,CAAC,gBAAgB,CAAC,GACjE,mBAAmB,CAAC,CAAC,CAAC,GAAG;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACxB,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AA2IN,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,GAAG;IAC/F,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAO/E,eAAO,MAAM,KAAK,GAAI,CAAC,SAAS,EAAE,SAAS,UAAU,CAAC,CAAC,CAAC,4CA6FvD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAY,cAAc,EAAwC,MAAM,OAAO,CAAC;AAM9F,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAa,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAoB,GAAG,EAA+B,mBAAmB,EAAmB,MAAM,aAAa,CAAC;AAMvH,KAAK,eAAe,CAAC,CAAC,SAAS,EAAE,IAAI,cAAc,CAAC,gBAAgB,CAAC,GACjE,mBAAmB,CAAC,CAAC,CAAC,GAAG;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACxB,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAiMN,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,GAAG;IAC/F,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAO/E,eAAO,MAAM,KAAK,GAAI,CAAC,SAAS,EAAE,SAAS,UAAU,CAAC,CAAC,CAAC,4CAgGvD,CAAC"}