@mantajs/ui 0.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert-dialog.d.ts +21 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +25 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +13 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +32 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/avatar.d.ts +16 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +23 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +14 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +30 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.d.ts +16 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +45 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +8 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +43 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +17 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/chart.d.ts +63 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +122 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +5 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +9 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/command.d.ts +78 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +17 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/date-range-picker.d.ts +12 -0
- package/dist/components/date-range-picker.d.ts.map +1 -0
- package/dist/components/date-range-picker.js +51 -0
- package/dist/components/date-range-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +14 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +17 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +49 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +47 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/input.d.ts +7 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +9 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.d.ts +9 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +10 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/pagination.d.ts +14 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +14 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +10 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +5 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +8 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +6 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +11 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/scroll-area.d.ts +6 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +8 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +12 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +22 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +9 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +16 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +20 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +30 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/skeleton.d.ts +3 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +7 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/sonner.d.ts +5 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +17 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/switch.d.ts +5 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +8 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +40 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +40 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +8 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +10 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +4 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +7 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/tooltip.d.ts +16 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +16 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/hooks/use-prompt.d.ts +17 -0
- package/dist/hooks/use-prompt.d.ts.map +1 -0
- package/dist/hooks/use-prompt.js +39 -0
- package/dist/hooks/use-prompt.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/__tests__/date-range.test.d.ts +2 -0
- package/dist/lib/__tests__/date-range.test.d.ts.map +1 -0
- package/dist/lib/__tests__/date-range.test.js +63 -0
- package/dist/lib/__tests__/date-range.test.js.map +1 -0
- package/dist/lib/date-range.d.ts +41 -0
- package/dist/lib/date-range.d.ts.map +1 -0
- package/dist/lib/date-range.js +111 -0
- package/dist/lib/date-range.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Tooltip as RadixTooltip } from 'radix-ui';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
declare const TooltipProvider: React.FC<RadixTooltip.TooltipProviderProps>;
|
|
4
|
+
declare const TooltipRoot: React.FC<RadixTooltip.TooltipProps>;
|
|
5
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<RadixTooltip.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<RadixTooltip.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export interface TooltipProps {
|
|
8
|
+
content?: React.ReactNode;
|
|
9
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const Tooltip: ({ content, side, children, className }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger };
|
|
16
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,eAAe,6CAAwB,CAAA;AAE7C,QAAA,MAAM,WAAW,qCAAoB,CAAA;AACrC,QAAA,MAAM,cAAc,4GAAuB,CAAA;AAE3C,QAAA,MAAM,cAAc,4JAelB,CAAA;AAKF,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,OAAO,GAAI,wCAAwC,YAAY,4CAWpE,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as RadixTooltip } from 'radix-ui';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { cn } from '../lib/utils';
|
|
5
|
+
const TooltipProvider = RadixTooltip.Provider;
|
|
6
|
+
const TooltipRoot = RadixTooltip.Root;
|
|
7
|
+
const TooltipTrigger = RadixTooltip.Trigger;
|
|
8
|
+
const TooltipContent = forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(RadixTooltip.Portal, { children: _jsx(RadixTooltip.Content, { ref: ref, sideOffset: sideOffset, className: cn('z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props }) })));
|
|
9
|
+
TooltipContent.displayName = 'TooltipContent';
|
|
10
|
+
const Tooltip = ({ content, side, children, className }) => {
|
|
11
|
+
if (!content)
|
|
12
|
+
return _jsx(_Fragment, { children: children });
|
|
13
|
+
return (_jsxs(TooltipRoot, { children: [_jsx(TooltipTrigger, { asChild: true, children: children }), _jsx(TooltipContent, { side: side, className: className, children: content })] }));
|
|
14
|
+
};
|
|
15
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger };
|
|
16
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,UAAU,CAAA;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAEjC,MAAM,eAAe,GAAG,YAAY,CAAC,QAAQ,CAAA;AAE7C,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAA;AACrC,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CAAA;AAE3C,MAAM,cAAc,GAAG,UAAU,CAG/B,CAAC,EAAE,SAAS,EAAE,UAAU,GAAG,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClD,KAAC,YAAY,CAAC,MAAM,cAClB,KAAC,YAAY,CAAC,OAAO,IACnB,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,EAAE,CACX,oYAAoY,EACpY,SAAS,CACV,KACG,KAAK,GACT,GACkB,CACvB,CAAC,CAAA;AACF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAA;AAY7C,MAAM,OAAO,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAgB,EAAE,EAAE;IACvE,IAAI,CAAC,OAAO;QAAE,OAAO,4BAAG,QAAQ,GAAI,CAAA;IAEpC,OAAO,CACL,MAAC,WAAW,eACV,KAAC,cAAc,IAAC,OAAO,kBAAE,QAAQ,GAAkB,EACnD,KAAC,cAAc,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,YAC7C,OAAO,GACO,IACL,CACf,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface PromptOptions {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
confirmText?: string;
|
|
5
|
+
cancelText?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* usePrompt — shows a confirmation dialog and returns a promise resolving to boolean.
|
|
9
|
+
* Drop-in replacement for @medusajs/ui usePrompt.
|
|
10
|
+
*/
|
|
11
|
+
export declare function usePrompt(): (options: PromptOptions) => Promise<boolean>;
|
|
12
|
+
export {};
|
|
13
|
+
/**
|
|
14
|
+
* PromptDialogRenderer — place this in your provider tree to render prompt dialogs.
|
|
15
|
+
* Not needed if using @mantajs/ui Toaster (prompts render via portal).
|
|
16
|
+
*/
|
|
17
|
+
//# sourceMappingURL=use-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-prompt.d.ts","sourceRoot":"","sources":["../../src/hooks/use-prompt.tsx"],"names":[],"mappings":"AAaA,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAuDxE;;AAED;;;GAGG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '../components/alert-dialog';
|
|
5
|
+
/**
|
|
6
|
+
* usePrompt — shows a confirmation dialog and returns a promise resolving to boolean.
|
|
7
|
+
* Drop-in replacement for @medusajs/ui usePrompt.
|
|
8
|
+
*/
|
|
9
|
+
export function usePrompt() {
|
|
10
|
+
const [state, setState] = useState({
|
|
11
|
+
open: false,
|
|
12
|
+
options: { title: '', description: '' },
|
|
13
|
+
resolve: null,
|
|
14
|
+
});
|
|
15
|
+
const prompt = useCallback((options) => {
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
|
+
setState({ open: true, options, resolve });
|
|
18
|
+
});
|
|
19
|
+
}, []);
|
|
20
|
+
const handleConfirm = useCallback(() => {
|
|
21
|
+
state.resolve?.(true);
|
|
22
|
+
setState((prev) => ({ ...prev, open: false, resolve: null }));
|
|
23
|
+
}, [state.resolve]);
|
|
24
|
+
const handleCancel = useCallback(() => {
|
|
25
|
+
state.resolve?.(false);
|
|
26
|
+
setState((prev) => ({ ...prev, open: false, resolve: null }));
|
|
27
|
+
}, [state.resolve]);
|
|
28
|
+
// Render the dialog via portal
|
|
29
|
+
const dialog = state.open
|
|
30
|
+
? createPortal(_jsx(AlertDialog, { open: true, onOpenChange: (open) => !open && handleCancel(), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: state.options.title }), _jsx(AlertDialogDescription, { children: state.options.description })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { onClick: handleCancel, children: state.options.cancelText || 'Cancel' }), _jsx(AlertDialogAction, { onClick: handleConfirm, children: state.options.confirmText || 'Confirm' })] })] }) }), document.body)
|
|
31
|
+
: null;
|
|
32
|
+
// Attach dialog to component tree — caller must render it
|
|
33
|
+
// We use a trick: return the prompt function but also need the dialog rendered.
|
|
34
|
+
// Solution: return a function that also has a .Dialog property.
|
|
35
|
+
const fn = useCallback((options) => prompt(options), [prompt]);
|
|
36
|
+
fn.__dialog = dialog;
|
|
37
|
+
return fn;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=use-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-prompt.js","sourceRoot":"","sources":["../../src/hooks/use-prompt.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,4BAA4B,CAAA;AASnC;;;GAGG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAI/B;QACD,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;QACvC,OAAO,EAAE,IAAI;KACd,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,OAAsB,EAAoB,EAAE;QACtE,OAAO,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,EAAE;YACtC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAA;QAC5C,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;QACrC,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAA;QACrB,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI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IAAC,EAAU,CAAC,QAAQ,GAAG,MAAM,CAAA;IAE9B,OAAO,EAAE,CAAA;AACX,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type { AlertProps } from './components/alert';
|
|
2
|
+
export { Alert, AlertDescription, AlertTitle } from './components/alert';
|
|
3
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from './components/alert-dialog';
|
|
4
|
+
export type { AvatarProps } from './components/avatar';
|
|
5
|
+
export { Avatar, AvatarFallback, AvatarImage, AvatarRoot } from './components/avatar';
|
|
6
|
+
export type { BadgeProps, StatusBadgeProps } from './components/badge';
|
|
7
|
+
export { Badge, badgeVariants, StatusBadge } from './components/badge';
|
|
8
|
+
export type { ButtonProps, IconButtonProps } from './components/button';
|
|
9
|
+
export { Button, buttonVariants, IconButton } from './components/button';
|
|
10
|
+
export type { CalendarProps } from './components/calendar';
|
|
11
|
+
export { Calendar } from './components/calendar';
|
|
12
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './components/card';
|
|
13
|
+
export type { ChartConfig } from './components/chart';
|
|
14
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, } from './components/chart';
|
|
15
|
+
export { Checkbox } from './components/checkbox';
|
|
16
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from './components/command';
|
|
17
|
+
export type { DateRangePickerProps } from './components/date-range-picker';
|
|
18
|
+
export { DateRangePicker } from './components/date-range-picker';
|
|
19
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from './components/dialog';
|
|
20
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from './components/dropdown-menu';
|
|
21
|
+
export { Input } from './components/input';
|
|
22
|
+
export { Label } from './components/label';
|
|
23
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from './components/pagination';
|
|
24
|
+
export { Popover, PopoverContent, PopoverTrigger } from './components/popover';
|
|
25
|
+
export { Progress } from './components/progress';
|
|
26
|
+
export { RadioGroup, RadioGroupItem } from './components/radio-group';
|
|
27
|
+
export { ScrollArea, ScrollBar } from './components/scroll-area';
|
|
28
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, } from './components/select';
|
|
29
|
+
export { Divider, Separator } from './components/separator';
|
|
30
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, } from './components/sheet';
|
|
31
|
+
export { Skeleton } from './components/skeleton';
|
|
32
|
+
export { Toaster, toast } from './components/sonner';
|
|
33
|
+
export { Switch } from './components/switch';
|
|
34
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from './components/table';
|
|
35
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from './components/tabs';
|
|
36
|
+
export { Textarea } from './components/textarea';
|
|
37
|
+
export type { TooltipProps } from './components/tooltip';
|
|
38
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from './components/tooltip';
|
|
39
|
+
export { usePrompt } from './hooks/use-prompt';
|
|
40
|
+
export type { DateRangePreset, DateRangeValue } from './lib/date-range';
|
|
41
|
+
export { formatRangeLabel, parseRange, RANGE_PRESETS, resolveRange, serializeRange } from './lib/date-range';
|
|
42
|
+
export { cn } from './lib/utils';
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAExE,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,2BAA2B,CAAA;AAElC,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErF,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEtE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAExE,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAEzG,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EACL,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,mBAAmB,GACpB,MAAM,oBAAoB,CAA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,EACV,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,GACZ,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAE3D,OAAO,EACL,KAAK,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,GACb,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAE5C,OAAO,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG5G,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAE5G,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// ── Components ──────────────────────────────────────
|
|
2
|
+
export { Alert, AlertDescription, AlertTitle } from './components/alert';
|
|
3
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from './components/alert-dialog';
|
|
4
|
+
export { Avatar, AvatarFallback, AvatarImage, AvatarRoot } from './components/avatar';
|
|
5
|
+
export { Badge, badgeVariants, StatusBadge } from './components/badge';
|
|
6
|
+
export { Button, buttonVariants, IconButton } from './components/button';
|
|
7
|
+
export { Calendar } from './components/calendar';
|
|
8
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './components/card';
|
|
9
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, } from './components/chart';
|
|
10
|
+
export { Checkbox } from './components/checkbox';
|
|
11
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from './components/command';
|
|
12
|
+
export { DateRangePicker } from './components/date-range-picker';
|
|
13
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from './components/dialog';
|
|
14
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from './components/dropdown-menu';
|
|
15
|
+
export { Input } from './components/input';
|
|
16
|
+
export { Label } from './components/label';
|
|
17
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from './components/pagination';
|
|
18
|
+
export { Popover, PopoverContent, PopoverTrigger } from './components/popover';
|
|
19
|
+
export { Progress } from './components/progress';
|
|
20
|
+
export { RadioGroup, RadioGroupItem } from './components/radio-group';
|
|
21
|
+
export { ScrollArea, ScrollBar } from './components/scroll-area';
|
|
22
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, } from './components/select';
|
|
23
|
+
export { Divider, Separator } from './components/separator';
|
|
24
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, } from './components/sheet';
|
|
25
|
+
export { Skeleton } from './components/skeleton';
|
|
26
|
+
export { Toaster, toast } from './components/sonner';
|
|
27
|
+
export { Switch } from './components/switch';
|
|
28
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from './components/table';
|
|
29
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from './components/tabs';
|
|
30
|
+
export { Textarea } from './components/textarea';
|
|
31
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from './components/tooltip';
|
|
32
|
+
// ── Hooks ───────────────────────────────────────────
|
|
33
|
+
export { usePrompt } from './hooks/use-prompt';
|
|
34
|
+
export { formatRangeLabel, parseRange, RANGE_PRESETS, resolveRange, serializeRange } from './lib/date-range';
|
|
35
|
+
// ── Utils ───────────────────────────────────────────
|
|
36
|
+
export { cn } from './lib/utils';
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAGvD,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAExE,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,2BAA2B,CAAA;AAGlC,OAAO,EAAE,MA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c,EAAE,MAAM,sBAAsB,CAAA;AAE5G,uDAAuD;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5G,uDAAuD;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-range.test.d.ts","sourceRoot":"","sources":["../../../src/lib/__tests__/date-range.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// DR — date-range parser/serializer round-trip + resolveRange clamping.
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { formatRangeLabel, parseRange, RANGE_PRESETS, resolveRange, serializeRange, } from '../date-range';
|
|
4
|
+
describe('DR — date-range', () => {
|
|
5
|
+
it('DR-01: presets round-trip', () => {
|
|
6
|
+
for (const p of RANGE_PRESETS) {
|
|
7
|
+
const v = { kind: 'preset', preset: p.value };
|
|
8
|
+
const s = serializeRange(v);
|
|
9
|
+
expect(s).toBe(p.value);
|
|
10
|
+
expect(parseRange(s)).toEqual(v);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
it('DR-02: custom range round-trips', () => {
|
|
14
|
+
const v = { kind: 'custom', from: '2025-01-01', to: '2025-02-15' };
|
|
15
|
+
const s = serializeRange(v);
|
|
16
|
+
expect(s).toBe('2025-01-01..2025-02-15');
|
|
17
|
+
expect(parseRange(s)).toEqual(v);
|
|
18
|
+
});
|
|
19
|
+
it('DR-03: single date round-trips', () => {
|
|
20
|
+
const v = { kind: 'date', date: '2025-05-11' };
|
|
21
|
+
const s = serializeRange(v);
|
|
22
|
+
expect(s).toBe('2025-05-11');
|
|
23
|
+
expect(parseRange(s)).toEqual(v);
|
|
24
|
+
});
|
|
25
|
+
it('DR-04: invalid input returns undefined', () => {
|
|
26
|
+
expect(parseRange(null)).toBeUndefined();
|
|
27
|
+
expect(parseRange('')).toBeUndefined();
|
|
28
|
+
expect(parseRange(undefined)).toBeUndefined();
|
|
29
|
+
expect(parseRange('garbage')).toBeUndefined();
|
|
30
|
+
expect(parseRange('2025-13-01')).toBeUndefined(); // bad month
|
|
31
|
+
expect(parseRange('2025-02-31')).toBeUndefined(); // not a real day
|
|
32
|
+
expect(parseRange('not..a..range')).toBeUndefined();
|
|
33
|
+
expect(parseRange('2025-01-01..bogus')).toBeUndefined();
|
|
34
|
+
});
|
|
35
|
+
it('DR-05: parseRange clamps to >= from for inverted custom input', () => {
|
|
36
|
+
const r = parseRange('2025-03-10..2025-03-01');
|
|
37
|
+
expect(r).toEqual({ kind: 'custom', from: '2025-03-01', to: '2025-03-10' });
|
|
38
|
+
});
|
|
39
|
+
it('DR-06: resolveRange clamps to >= from for inverted value', () => {
|
|
40
|
+
const v = { kind: 'custom', from: '2025-03-10', to: '2025-03-01' };
|
|
41
|
+
const { from, to } = resolveRange(v);
|
|
42
|
+
expect(to.getTime() >= from.getTime()).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
it('DR-07: resolveRange anchors `to` to end-of-day UTC for presets', () => {
|
|
45
|
+
const now = new Date('2025-05-11T08:30:00.000Z');
|
|
46
|
+
const { from, to } = resolveRange({ kind: 'preset', preset: '7d' }, now);
|
|
47
|
+
expect(to.toISOString().endsWith('T23:59:59.999Z')).toBe(true);
|
|
48
|
+
expect(from.toISOString().endsWith('T00:00:00.000Z')).toBe(true);
|
|
49
|
+
// 7-day window anchored on 2025-05-11 UTC end-of-day
|
|
50
|
+
expect(to.toISOString().slice(0, 10)).toBe('2025-05-11');
|
|
51
|
+
});
|
|
52
|
+
it('DR-08: resolveRange honors date kind', () => {
|
|
53
|
+
const { from, to } = resolveRange({ kind: 'date', date: '2025-05-11' });
|
|
54
|
+
expect(from.toISOString()).toBe('2025-05-11T00:00:00.000Z');
|
|
55
|
+
expect(to.toISOString()).toBe('2025-05-11T23:59:59.999Z');
|
|
56
|
+
});
|
|
57
|
+
it('DR-09: formatRangeLabel returns readable string for each kind', () => {
|
|
58
|
+
expect(formatRangeLabel({ kind: 'preset', preset: '30d' })).toContain('30');
|
|
59
|
+
expect(formatRangeLabel({ kind: 'date', date: '2025-05-11' })).toBe('2025-05-11');
|
|
60
|
+
expect(formatRangeLabel({ kind: 'custom', from: '2025-01-01', to: '2025-02-01' })).toBe('2025-01-01 → 2025-02-01');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=date-range.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-range.test.js","sourceRoot":"","sources":["../../../src/lib/__tests__/date-range.test.ts"],"names":[],"mappings":"AAAA,wEAAwE;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAEL,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,eAAe,CAAA;AAEtB,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;YAC9B,MAAM,CAAC,GAAmB,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,CAAA;YAC7D,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;YAC3B,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;YACvB,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAClC,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,CAAC,GAAmB,EAA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|
+
} | {
|
|
6
|
+
kind: 'custom';
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'date';
|
|
11
|
+
date: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const RANGE_PRESETS: ReadonlyArray<{
|
|
14
|
+
value: DateRangePreset;
|
|
15
|
+
label: string;
|
|
16
|
+
days: number;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Parse a serialized range string (typically from URL).
|
|
20
|
+
* Returns undefined for null/empty/invalid input.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseRange(s: string | null | undefined): DateRangeValue | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Serialize a range to a stable string suitable for URL storage.
|
|
25
|
+
*/
|
|
26
|
+
export declare function serializeRange(r: DateRangeValue): string;
|
|
27
|
+
/**
|
|
28
|
+
* Resolve a DateRangeValue into concrete Date bounds.
|
|
29
|
+
* - presets anchor `to` to end-of-day UTC of `now`, `from` = `to` - N days.
|
|
30
|
+
* - custom: from = 00:00:00 UTC of `from`, to = 23:59:59.999 UTC of `to`.
|
|
31
|
+
* - date: from = 00:00:00 UTC, to = 23:59:59.999 UTC same day.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveRange(r: DateRangeValue, now?: Date): {
|
|
34
|
+
from: Date;
|
|
35
|
+
to: Date;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Human-readable label for a range, suitable for the picker button.
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatRangeLabel(r: DateRangeValue): string;
|
|
41
|
+
//# sourceMappingURL=date-range.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-range.d.ts","sourceRoot":"","sources":["../../src/lib/date-range.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAAA;AAElD,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAElC,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAIhG,CAAA;AAYD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAiBnF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,cAAc,GAAG,MAAM,CAMxD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,cAAc,EAAE,GAAG,GAAE,IAAiB,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,IAAI,CAAA;CAAE,CAwBhG;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,cAAc,GAAG,MAAM,CAM1D"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Date range value + URL serialization helpers for ChartCard.
|
|
2
|
+
// Pure functions — no React, no DOM, no time-zone-sensitive math
|
|
3
|
+
// beyond UTC anchoring. Three encodings:
|
|
4
|
+
// - preset: "7d" | "30d" | "90d"
|
|
5
|
+
// - custom: "YYYY-MM-DD..YYYY-MM-DD"
|
|
6
|
+
// - date: "YYYY-MM-DD"
|
|
7
|
+
export const RANGE_PRESETS = [
|
|
8
|
+
{ value: '7d', label: '7 derniers jours', days: 7 },
|
|
9
|
+
{ value: '30d', label: '30 derniers jours', days: 30 },
|
|
10
|
+
{ value: '90d', label: '90 derniers jours', days: 90 },
|
|
11
|
+
];
|
|
12
|
+
const ISO_DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
13
|
+
function isValidIsoDate(s) {
|
|
14
|
+
if (!ISO_DATE_RE.test(s))
|
|
15
|
+
return false;
|
|
16
|
+
const d = new Date(`${s}T00:00:00.000Z`);
|
|
17
|
+
if (Number.isNaN(d.getTime()))
|
|
18
|
+
return false;
|
|
19
|
+
// Round-trip check guards against e.g. "2025-02-31"
|
|
20
|
+
return d.toISOString().slice(0, 10) === s;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Parse a serialized range string (typically from URL).
|
|
24
|
+
* Returns undefined for null/empty/invalid input.
|
|
25
|
+
*/
|
|
26
|
+
export function parseRange(s) {
|
|
27
|
+
if (!s)
|
|
28
|
+
return undefined;
|
|
29
|
+
// Preset?
|
|
30
|
+
for (const p of RANGE_PRESETS) {
|
|
31
|
+
if (s === p.value)
|
|
32
|
+
return { kind: 'preset', preset: p.value };
|
|
33
|
+
}
|
|
34
|
+
// Custom range?
|
|
35
|
+
if (s.includes('..')) {
|
|
36
|
+
const [from, to] = s.split('..');
|
|
37
|
+
if (!isValidIsoDate(from) || !isValidIsoDate(to))
|
|
38
|
+
return undefined;
|
|
39
|
+
// Clamp: if to < from, swap so callers always get to >= from.
|
|
40
|
+
if (to < from)
|
|
41
|
+
return { kind: 'custom', from: to, to: from };
|
|
42
|
+
return { kind: 'custom', from, to };
|
|
43
|
+
}
|
|
44
|
+
// Single date?
|
|
45
|
+
if (isValidIsoDate(s))
|
|
46
|
+
return { kind: 'date', date: s };
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Serialize a range to a stable string suitable for URL storage.
|
|
51
|
+
*/
|
|
52
|
+
export function serializeRange(r) {
|
|
53
|
+
if (r.kind === 'preset')
|
|
54
|
+
return r.preset;
|
|
55
|
+
if (r.kind === 'date')
|
|
56
|
+
return r.date;
|
|
57
|
+
// custom — defensive swap to keep to >= from
|
|
58
|
+
if (r.to < r.from)
|
|
59
|
+
return `${r.to}..${r.from}`;
|
|
60
|
+
return `${r.from}..${r.to}`;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Resolve a DateRangeValue into concrete Date bounds.
|
|
64
|
+
* - presets anchor `to` to end-of-day UTC of `now`, `from` = `to` - N days.
|
|
65
|
+
* - custom: from = 00:00:00 UTC of `from`, to = 23:59:59.999 UTC of `to`.
|
|
66
|
+
* - date: from = 00:00:00 UTC, to = 23:59:59.999 UTC same day.
|
|
67
|
+
*/
|
|
68
|
+
export function resolveRange(r, now = new Date()) {
|
|
69
|
+
if (r.kind === 'preset') {
|
|
70
|
+
const days = RANGE_PRESETS.find((p) => p.value === r.preset)?.days ?? 30;
|
|
71
|
+
const to = endOfUtcDay(now);
|
|
72
|
+
const from = new Date(to.getTime() - days * 86_400_000 + 1);
|
|
73
|
+
// Anchor `from` to start-of-day UTC for predictable buckets
|
|
74
|
+
const fromStart = startOfUtcDay(from);
|
|
75
|
+
return { from: fromStart, to };
|
|
76
|
+
}
|
|
77
|
+
if (r.kind === 'date') {
|
|
78
|
+
const base = new Date(`${r.date}T00:00:00.000Z`);
|
|
79
|
+
return { from: startOfUtcDay(base), to: endOfUtcDay(base) };
|
|
80
|
+
}
|
|
81
|
+
// custom
|
|
82
|
+
const fromRaw = new Date(`${r.from}T00:00:00.000Z`);
|
|
83
|
+
const toRaw = new Date(`${r.to}T00:00:00.000Z`);
|
|
84
|
+
let from = startOfUtcDay(fromRaw);
|
|
85
|
+
let to = endOfUtcDay(toRaw);
|
|
86
|
+
if (to.getTime() < from.getTime()) {
|
|
87
|
+
const swap = from;
|
|
88
|
+
from = startOfUtcDay(toRaw);
|
|
89
|
+
to = endOfUtcDay(swap);
|
|
90
|
+
}
|
|
91
|
+
return { from, to };
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Human-readable label for a range, suitable for the picker button.
|
|
95
|
+
*/
|
|
96
|
+
export function formatRangeLabel(r) {
|
|
97
|
+
if (r.kind === 'preset') {
|
|
98
|
+
return RANGE_PRESETS.find((p) => p.value === r.preset)?.label ?? r.preset;
|
|
99
|
+
}
|
|
100
|
+
if (r.kind === 'date')
|
|
101
|
+
return r.date;
|
|
102
|
+
return `${r.from} → ${r.to}`;
|
|
103
|
+
}
|
|
104
|
+
// ── internals ───────────────────────────────────────────
|
|
105
|
+
function startOfUtcDay(d) {
|
|
106
|
+
return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), 0, 0, 0, 0));
|
|
107
|
+
}
|
|
108
|
+
function endOfUtcDay(d) {
|
|
109
|
+
return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), 23, 59, 59, 999));
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=date-range.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-range.js","sourceRoot":"","sources":["../../src/lib/date-range.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,iEAAiE;AACjE,yCAAyC;AACzC,mCAAmC;AACnC,uCAAuC;AACvC,2BAA2B;AAS3B,MAAM,CAAC,MAAM,aAAa,GAA2E;IACnG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,EAAE;IACnD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,EAAE,EAAE;IACtD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,EAAE,EAAE;CACvD,CAAA;AAED,MAAM,WAAW,GAAG,qBAAqB,CAAA;AAEzC,SAAS,cAAc,CAAC,CAAS;IAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IACtC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,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C,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAC5F,CAAC;AAED,SAAS,WAAW,CAAC,CAAO;IAC1B,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;AACjG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,IAAI,EAAE,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AAC9B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mantajs/ui",
|
|
3
|
+
"version": "0.2.0-beta.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@radix-ui/react-checkbox": "^1.3.4",
|
|
8
|
+
"@radix-ui/react-dialog": "^1.1.16",
|
|
9
|
+
"@radix-ui/react-popover": "^1.1.16",
|
|
10
|
+
"@radix-ui/react-progress": "^1.1.9",
|
|
11
|
+
"@radix-ui/react-radio-group": "^1.4.0",
|
|
12
|
+
"@radix-ui/react-scroll-area": "^1.2.11",
|
|
13
|
+
"@radix-ui/react-select": "^2.3.0",
|
|
14
|
+
"@radix-ui/react-slot": "^1.2.5",
|
|
15
|
+
"@radix-ui/react-switch": "^1.3.0",
|
|
16
|
+
"@radix-ui/react-tabs": "^1.1.14",
|
|
17
|
+
"class-variance-authority": "^0.7.0",
|
|
18
|
+
"clsx": "^2.1.0",
|
|
19
|
+
"cmdk": "^1.0.0",
|
|
20
|
+
"date-fns": "^4.0.0",
|
|
21
|
+
"lucide-react": "^0.460.0",
|
|
22
|
+
"radix-ui": "^1.1.2",
|
|
23
|
+
"react": "^19.0.0",
|
|
24
|
+
"react-day-picker": "^9.0.0",
|
|
25
|
+
"react-dom": "^19.0.0",
|
|
26
|
+
"recharts": "^2.15.0",
|
|
27
|
+
"sonner": "^1.7.0",
|
|
28
|
+
"tailwind-merge": "^2.6.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/react": "^19.0.0",
|
|
32
|
+
"@types/react-dom": "^19.0.0"
|
|
33
|
+
},
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"import": "./dist/index.js",
|
|
39
|
+
"default": "./dist/index.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist"
|
|
44
|
+
]
|
|
45
|
+
}
|