adminizer 4.1.1 → 4.2.0-build.45
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/assets/add-DujD3Z0j.js +1 -0
- package/assets/add-form-Ch5HOaI3.js +1 -0
- package/assets/add-group-form-CzjFRYQe.js +1 -0
- package/assets/add-group-xKUhiREd.js +1 -0
- package/assets/add-user-DpTQyN0Z.js +1 -0
- package/assets/add-user-form-DmgL9A2G.js +1 -0
- package/assets/app-layout-Dn8y3paC.js +1 -0
- package/assets/app-shell-C1wDrRCe.js +1 -0
- package/assets/app-sidebar-BisOEG_p.js +1 -0
- package/assets/app-sidebar-header-CL1OSuV8.js +11 -0
- package/assets/app.js +162 -40
- package/assets/breadcrumbs-BVZtAG3J.js +1 -0
- package/assets/catalog-CvJMAtEd.js +16 -0
- package/assets/{chevrons-up-down-kALltqHV.js → chevrons-up-down-D3t3UGV7.js} +2 -2
- package/assets/dashboard-Zsh-5yN2.js +3 -0
- package/assets/date-picker-DKdT6XTZ.js +6 -0
- package/assets/del-modal-DZ5wZWad.js +11 -0
- package/assets/{field-renderer-B6hFAeiU.js → field-renderer-Dgj1S2Vi.js} +137 -137
- package/assets/form-Bgv171J2.js +1 -0
- package/assets/form-DcfEHbPb.js +1 -0
- package/assets/{geo-json-BKmYmu3d.js → geo-json-vodY1YtH.js} +5 -5
- package/assets/{handsontable-B8xVeMAQ.js → handsontable-C-ThjbaJ.js} +1 -1
- package/assets/home-DOm3EaLO.js +2 -0
- package/assets/icon-B-D8X0jg.js +1 -0
- package/assets/init-user-iMMcIQIW.js +1 -0
- package/assets/input-error-F1DL-Fx6.js +1 -0
- package/assets/list-B-vY1rhM.js +1 -0
- package/assets/list-table-8sDi0ZKa.js +52 -0
- package/assets/{check-LAUWAnlX.js → loader-circle-Btx4NYNU.js} +2 -2
- package/assets/{login-DliJrjMQ.js → login-C2J62v4_.js} +2 -2
- package/assets/manifest.json +135 -805
- package/assets/material-icon-DeSoGIhT.js +1 -0
- package/assets/module-I4hW5UqT.js +1 -0
- package/assets/{move-left-BhKZRPb4.js → move-left-DWHsVHUF.js} +1 -1
- package/assets/multi-select-Bu3n-kcV.js +11 -0
- package/assets/nav-footer-DQwIyd7c.js +1 -0
- package/assets/nav-main-DDQ-_Oed.js +1 -0
- package/assets/nav-user-BwBu-VwZ.js +1 -0
- package/assets/pagination-render-BoDDo2E1.js +1 -0
- package/assets/register-aPC0gjjS.js +1 -0
- package/assets/{trash-2-BoK5Xp2F.js → trash-2-CsxWwHNc.js} +2 -2
- package/assets/user-info-CnB2lvpg.js +1 -0
- package/assets/user-menu-content-BFbaJw6v.js +6 -0
- package/assets/welcome-DB_D6KJV.js +1 -0
- package/package.json +9 -3
- package/ui/components/ui/avatar.d.ts +6 -0
- package/ui/components/ui/avatar.js +13 -0
- package/ui/components/ui/badge.d.ts +9 -0
- package/ui/components/ui/badge.js +22 -0
- package/ui/components/ui/breadcrumb.d.ts +11 -0
- package/ui/components/ui/breadcrumb.js +27 -0
- package/ui/components/ui/button.d.ts +10 -0
- package/ui/components/ui/button.js +33 -0
- package/ui/components/ui/calendar.d.ts +4 -0
- package/ui/components/ui/calendar.js +38 -0
- package/ui/components/ui/card.d.ts +9 -0
- package/ui/components/ui/card.js +24 -0
- package/ui/components/ui/checkbox.d.ts +4 -0
- package/ui/components/ui/checkbox.js +8 -0
- package/ui/components/ui/collapsible.d.ts +5 -0
- package/ui/components/ui/collapsible.js +12 -0
- package/ui/components/ui/command.d.ts +16 -0
- package/ui/components/ui/command.js +33 -0
- package/ui/components/ui/context-menu.d.ts +25 -0
- package/ui/components/ui/context-menu.js +50 -0
- package/ui/components/ui/dialog-stack.d.ts +43 -0
- package/ui/components/ui/dialog-stack.js +238 -0
- package/ui/components/ui/dialog.d.ts +13 -0
- package/ui/components/ui/dialog.js +35 -0
- package/ui/components/ui/dropdown-menu.d.ts +25 -0
- package/ui/components/ui/dropdown-menu.js +50 -0
- package/ui/components/ui/input.d.ts +3 -0
- package/ui/components/ui/input.js +6 -0
- package/ui/components/ui/label.d.ts +4 -0
- package/ui/components/ui/label.js +7 -0
- package/ui/components/ui/menubar.d.ts +26 -0
- package/ui/components/ui/menubar.js +53 -0
- package/ui/components/ui/pagination.d.ts +13 -0
- package/ui/components/ui/pagination.js +29 -0
- package/ui/components/ui/popover.d.ts +7 -0
- package/ui/components/ui/popover.js +16 -0
- package/ui/components/ui/select.d.ts +15 -0
- package/ui/components/ui/select.js +37 -0
- package/ui/components/ui/separator.d.ts +4 -0
- package/ui/components/ui/separator.js +8 -0
- package/ui/components/ui/sheet.d.ts +13 -0
- package/ui/components/ui/sheet.js +39 -0
- package/ui/components/ui/sidebar.d.ts +69 -0
- package/ui/components/ui/sidebar.js +211 -0
- package/ui/components/ui/skeleton.d.ts +2 -0
- package/ui/components/ui/skeleton.js +6 -0
- package/ui/components/ui/slider.d.ts +4 -0
- package/ui/components/ui/slider.js +13 -0
- package/ui/components/ui/sonner.d.ts +3 -0
- package/ui/components/ui/sonner.js +12 -0
- package/ui/components/ui/switch.d.ts +4 -0
- package/ui/components/ui/switch.js +7 -0
- package/ui/components/ui/table.d.ts +10 -0
- package/ui/components/ui/table.js +27 -0
- package/ui/components/ui/textarea.d.ts +3 -0
- package/ui/components/ui/textarea.js +6 -0
- package/ui/components/ui/tooltip.d.ts +7 -0
- package/ui/components/ui/tooltip.js +17 -0
- package/ui/hooks/use-mobile.d.ts +1 -0
- package/ui/hooks/use-mobile.js +15 -0
- package/ui/lib/utils.d.ts +2 -0
- package/ui/lib/utils.js +5 -0
- package/assets/add-CJ1-zeA1.js +0 -1
- package/assets/add-form-CbNl0wdS.js +0 -1
- package/assets/add-group-form-Bt_Dx9wm.js +0 -1
- package/assets/add-group-pIFJV5qL.js +0 -1
- package/assets/add-user-D2US8hL_.js +0 -1
- package/assets/add-user-form-Bt8Jy6S2.js +0 -1
- package/assets/app-layout-B86jl9bH.js +0 -1
- package/assets/app-shell-CiGyzQ0C.js +0 -1
- package/assets/app-sidebar-Bz-SRwBg.js +0 -1
- package/assets/app-sidebar-header-7CNCx7Rs.js +0 -11
- package/assets/breadcrumbs-_jhtTcOi.js +0 -1
- package/assets/catalog-CON6moaA.js +0 -16
- package/assets/checkbox-CQdZw5mb.js +0 -1
- package/assets/chevron-down-B5XuAFRu.js +0 -6
- package/assets/chevron-left-CoMhTMUD.js +0 -6
- package/assets/chevron-right-D5q8rF7h.js +0 -6
- package/assets/createLucideIcon-BFG25zNo.js +0 -21
- package/assets/dashboard-es9ZT8qk.js +0 -3
- package/assets/date-picker-Dz-d-YWX.js +0 -6
- package/assets/del-modal-D0mrZvki.js +0 -11
- package/assets/dialog-stack-BiMbfm58.js +0 -1
- package/assets/dropdown-menu-BSBcRiXx.js +0 -1
- package/assets/form-Buslty7y.js +0 -1
- package/assets/form-aqiRmPix.js +0 -1
- package/assets/home-Dr72Jk-w.js +0 -2
- package/assets/icon-B-a7xg54.js +0 -1
- package/assets/index-B68_akQe.js +0 -1
- package/assets/index-B7-xTDyy.js +0 -1
- package/assets/index-BJFFlCSo.js +0 -1
- package/assets/index-BOuMo_nl.js +0 -10
- package/assets/index-BzOcGsBq.js +0 -1
- package/assets/index-CFbQ2Rv0.js +0 -1
- package/assets/index-Cq31rrfZ.js +0 -1
- package/assets/index-D5UDXTFs.js +0 -1
- package/assets/index-DwctwfU0.js +0 -1
- package/assets/index-oxIQWAdI.js +0 -41
- package/assets/init-user-5H689LP0.js +0 -1
- package/assets/input-CSJjrf2i.js +0 -1
- package/assets/input-error-CK92Shhm.js +0 -1
- package/assets/label-Muj0-Efy.js +0 -1
- package/assets/list-Cvh7zbyG.js +0 -1
- package/assets/list-table-Bs_vbQiV.js +0 -52
- package/assets/loader-circle-Utah5tGx.js +0 -6
- package/assets/material-icon-BRS58Qpk.js +0 -1
- package/assets/module-CjG21VCT.js +0 -1
- package/assets/multi-select-CMQIJ0JT.js +0 -11
- package/assets/nav-footer-IGMn9NiE.js +0 -1
- package/assets/nav-main-DBE4rMiZ.js +0 -1
- package/assets/nav-user-CjyLRyq-.js +0 -1
- package/assets/pagination-render-DUAq2klc.js +0 -1
- package/assets/popover-C_cww-4_.js +0 -1
- package/assets/register-UzQn3J0g.js +0 -1
- package/assets/search-BspystAk.js +0 -6
- package/assets/select-DzBno-dc.js +0 -6
- package/assets/sidebar-Dc4iqfu-.js +0 -6
- package/assets/skeleton-Dkmj2o2Z.js +0 -1
- package/assets/sonner-De1t71Gj.js +0 -1
- package/assets/tooltip-CwPrC-HD.js +0 -1
- package/assets/user-info-8RyDk7qh.js +0 -9
- package/assets/user-menu-content-CpxTLH56.js +0 -6
- package/assets/welcome-BYKI6yO-.js +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, HTMLAttributes, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface DialogStackProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
clickable?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export type DialogStackHandle = {
|
|
10
|
+
open: () => void;
|
|
11
|
+
close: () => void;
|
|
12
|
+
next: () => void;
|
|
13
|
+
prev: () => void;
|
|
14
|
+
closeCurrent: () => void;
|
|
15
|
+
};
|
|
16
|
+
type DialogStackChildProps = {
|
|
17
|
+
index?: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const DialogStack: React.ForwardRefExoticComponent<DialogStackProps & React.RefAttributes<DialogStackHandle>>;
|
|
20
|
+
export declare const DialogStackTrigger: ({ children, className, onClick, asChild, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
21
|
+
asChild?: boolean;
|
|
22
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const DialogStackOverlay: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
export declare const DialogStackBody: ({ children, className, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
25
|
+
children: ReactElement<DialogStackChildProps>[] | ReactElement<DialogStackChildProps>;
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
export declare const DialogStackContent: ({ children, className, index, offset, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
28
|
+
index?: number;
|
|
29
|
+
offset?: number;
|
|
30
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
31
|
+
export declare const DialogStackTitle: ({ children, className, ...props }: HTMLAttributes<HTMLHeadingElement>) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare const DialogStackDescription: ({ children, className, ...props }: HTMLAttributes<HTMLParagraphElement>) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare const DialogStackHeader: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const DialogStackFooter: ({ children, className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare const DialogStackNext: ({ children, className, asChild, ...props }: {
|
|
36
|
+
asChild?: boolean;
|
|
37
|
+
} & HTMLAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare const DialogStackPrevious: ({ children, className, asChild, ...props }: {
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
asChild?: boolean;
|
|
42
|
+
} & HTMLAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
import * as Portal from '@radix-ui/react-portal';
|
|
5
|
+
import { Children, cloneElement, createContext, isValidElement, useContext, useEffect, useState, } from 'react';
|
|
6
|
+
import { Button } from "@/components/ui/button";
|
|
7
|
+
import { XIcon } from "lucide-react";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
const DialogStackContext = createContext({
|
|
10
|
+
activeIndex: 0,
|
|
11
|
+
setActiveIndex: () => {
|
|
12
|
+
},
|
|
13
|
+
totalDialogs: 0,
|
|
14
|
+
setTotalDialogs: () => {
|
|
15
|
+
},
|
|
16
|
+
isOpen: false,
|
|
17
|
+
setIsOpen: () => {
|
|
18
|
+
},
|
|
19
|
+
clickable: false,
|
|
20
|
+
shouldAnimate: false,
|
|
21
|
+
setShouldAnimate: () => {
|
|
22
|
+
},
|
|
23
|
+
closeDialog: () => {
|
|
24
|
+
}, // Добавлено
|
|
25
|
+
});
|
|
26
|
+
export const DialogStack = React.forwardRef(({ children, className, open = false, onOpenChange, clickable = false, ...props }, ref) => {
|
|
27
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
28
|
+
const [isOpen, setIsOpen] = useState(open);
|
|
29
|
+
const [shouldAnimate, setShouldAnimate] = useState(false);
|
|
30
|
+
const [totalDialogs, setTotalDialogs] = useState(0);
|
|
31
|
+
const closeDialog = (index) => {
|
|
32
|
+
if (index === activeIndex) {
|
|
33
|
+
if (activeIndex > 0) {
|
|
34
|
+
setActiveIndex(prev => prev - 1);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
setIsOpen(false);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
// Императивные методы
|
|
42
|
+
React.useImperativeHandle(ref, () => ({
|
|
43
|
+
open: () => {
|
|
44
|
+
setIsOpen(true);
|
|
45
|
+
// setActiveIndex(0);
|
|
46
|
+
// setShouldAnimate(true);
|
|
47
|
+
},
|
|
48
|
+
close: () => {
|
|
49
|
+
setIsOpen(false);
|
|
50
|
+
setActiveIndex(0);
|
|
51
|
+
},
|
|
52
|
+
next: () => {
|
|
53
|
+
setActiveIndex(activeIndex + 1);
|
|
54
|
+
},
|
|
55
|
+
prev: () => {
|
|
56
|
+
if (activeIndex > 0) {
|
|
57
|
+
setActiveIndex(activeIndex - 1);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
goTo: (index) => {
|
|
61
|
+
if (index >= 0 && index < totalDialogs) {
|
|
62
|
+
setActiveIndex(index);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
closeCurrent: () => closeDialog(activeIndex),
|
|
66
|
+
isOpen,
|
|
67
|
+
activeIndex,
|
|
68
|
+
totalDialogs
|
|
69
|
+
}), [activeIndex, totalDialogs, isOpen]);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
const htmlElement = document.documentElement;
|
|
72
|
+
if (isOpen) {
|
|
73
|
+
htmlElement.style.overflow = 'hidden';
|
|
74
|
+
setShouldAnimate(true);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
htmlElement.style.overflow = '';
|
|
78
|
+
}
|
|
79
|
+
onOpenChange?.(isOpen);
|
|
80
|
+
return () => {
|
|
81
|
+
htmlElement.style.overflow = '';
|
|
82
|
+
};
|
|
83
|
+
}, [isOpen, onOpenChange]);
|
|
84
|
+
return (_jsx(DialogStackContext.Provider, { value: {
|
|
85
|
+
activeIndex,
|
|
86
|
+
setActiveIndex,
|
|
87
|
+
totalDialogs,
|
|
88
|
+
setTotalDialogs,
|
|
89
|
+
isOpen,
|
|
90
|
+
setIsOpen,
|
|
91
|
+
clickable,
|
|
92
|
+
shouldAnimate,
|
|
93
|
+
setShouldAnimate,
|
|
94
|
+
closeDialog,
|
|
95
|
+
}, children: _jsx("div", { className: className, ...props, children: children }) }));
|
|
96
|
+
});
|
|
97
|
+
DialogStack.displayName = 'DialogStack';
|
|
98
|
+
export const DialogStackTrigger = ({ children, className, onClick, asChild, ...props }) => {
|
|
99
|
+
const context = useContext(DialogStackContext);
|
|
100
|
+
if (!context) {
|
|
101
|
+
throw new Error('DialogStackTrigger must be used within a DialogStack');
|
|
102
|
+
}
|
|
103
|
+
const handleClick = (e) => {
|
|
104
|
+
context.setIsOpen(true);
|
|
105
|
+
onClick?.(e);
|
|
106
|
+
};
|
|
107
|
+
if (asChild && isValidElement(children)) {
|
|
108
|
+
return React.cloneElement(children, {
|
|
109
|
+
onClick: handleClick,
|
|
110
|
+
className: cn(className, children.props.className),
|
|
111
|
+
...props,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return (_jsx("button", { onClick: handleClick, className: cn('inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm', 'ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2', 'focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', 'bg-primary text-primary-foreground hover:bg-primary/90', 'h-10 px-4 py-2', className), ...props, children: children }));
|
|
115
|
+
};
|
|
116
|
+
export const DialogStackOverlay = ({ className, ...props }) => {
|
|
117
|
+
const context = useContext(DialogStackContext);
|
|
118
|
+
if (!context) {
|
|
119
|
+
throw new Error('DialogStackOverlay must be used within a DialogStack');
|
|
120
|
+
}
|
|
121
|
+
if (!context.isOpen) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
return (
|
|
125
|
+
// biome-ignore lint/nursery/noStaticElementInteractions: "This is a clickable overlay"
|
|
126
|
+
_jsx("div", { className: cn('fixed inset-0 z-50 bg-black/80 backdrop-blur-sm', 'data-[state=closed]:animate-out data-[state=open]:animate-in', 'data-[state=closed]:fade-out-0 slide-in-from-right-1/2 data-[state=open]:fade-in-0', className), onClick: () => {
|
|
127
|
+
if (context.activeIndex === 0) {
|
|
128
|
+
context.setIsOpen(false);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
context.setActiveIndex(context.activeIndex - 1);
|
|
132
|
+
}
|
|
133
|
+
}, ...props }));
|
|
134
|
+
};
|
|
135
|
+
export const DialogStackBody = ({ children, className, ...props }) => {
|
|
136
|
+
const context = useContext(DialogStackContext);
|
|
137
|
+
const [totalDialogs, setTotalDialogs] = useState(Children.count(children));
|
|
138
|
+
if (!context) {
|
|
139
|
+
throw new Error('DialogStackBody must be used within a DialogStack');
|
|
140
|
+
}
|
|
141
|
+
if (!context.isOpen) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
return (_jsx(DialogStackContext.Provider, { value: {
|
|
145
|
+
...context,
|
|
146
|
+
totalDialogs,
|
|
147
|
+
setTotalDialogs,
|
|
148
|
+
}, children: _jsx(Portal.Root, { children: _jsx("div", { className: cn('pointer-events-none fixed z-50 w-full max-w-full md:max-w-[67%] right-0 top-0 md:top-[1vh]', className), ...props, children: Children.map(children, (child, index) => isValidElement(child)
|
|
149
|
+
? cloneElement(child, { index })
|
|
150
|
+
: child) }) }) }));
|
|
151
|
+
};
|
|
152
|
+
export const DialogStackContent = ({ children, className, index = 0, offset = 20, ...props }) => {
|
|
153
|
+
const context = useContext(DialogStackContext);
|
|
154
|
+
if (!context) {
|
|
155
|
+
throw new Error('DialogStackContent must be used within a DialogStack');
|
|
156
|
+
}
|
|
157
|
+
if (!context.isOpen) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
const handleClose = () => {
|
|
161
|
+
context.closeDialog(index); // Используем новую функцию
|
|
162
|
+
};
|
|
163
|
+
const handleClick = (e) => {
|
|
164
|
+
e.stopPropagation();
|
|
165
|
+
if (context.clickable && context.activeIndex > index) {
|
|
166
|
+
context.setActiveIndex(index ?? 0);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
const distanceFromActive = index - context.activeIndex;
|
|
170
|
+
const translateX = distanceFromActive < 0
|
|
171
|
+
? `-${Math.abs(distanceFromActive) * offset}px`
|
|
172
|
+
: `0`;
|
|
173
|
+
const showAnimation = index === 0 && context.activeIndex === 0 && context.shouldAnimate;
|
|
174
|
+
useEffect(() => {
|
|
175
|
+
if (showAnimation) {
|
|
176
|
+
const timer = setTimeout(() => {
|
|
177
|
+
context.setShouldAnimate(false);
|
|
178
|
+
}, 200);
|
|
179
|
+
return () => clearTimeout(timer);
|
|
180
|
+
}
|
|
181
|
+
}, [showAnimation]);
|
|
182
|
+
return (_jsxs("div", { onClick: handleClick, className: cn('h-[100vh] md:h-[98vh] w-full md:rounded-l-md border bg-background p-6 shadow-lg md:transition-all duration-200', showAnimation && 'animate-in slide-in-from-right-1/2', distanceFromActive < 0 && 'brightness-75 blur-[2px]', className), style: {
|
|
183
|
+
top: 0,
|
|
184
|
+
marginLeft: `${translateX}`,
|
|
185
|
+
marginTop: `${window.innerWidth > 768 ? Math.abs(distanceFromActive) * 10 : 0}px`,
|
|
186
|
+
width: `calc(100% + ${Math.abs(distanceFromActive) * offset}px)`,
|
|
187
|
+
zIndex: 50 - Math.abs(context.activeIndex - (index ?? 0)),
|
|
188
|
+
position: distanceFromActive ? 'absolute' : 'relative',
|
|
189
|
+
opacity: distanceFromActive > 0 ? 0 : 1,
|
|
190
|
+
pointerEvents: distanceFromActive > 0 ? 'none' : 'auto',
|
|
191
|
+
cursor: context.clickable && context.activeIndex > index
|
|
192
|
+
? 'pointer'
|
|
193
|
+
: 'default',
|
|
194
|
+
}, ...props, children: [context.activeIndex === index && (_jsx(Button, { asChild: true, variant: "ghost", className: "absolute z-[1005] top-4 right-4 p-1 size-8", onClick: handleClose, "aria-label": "Close", children: _jsx(XIcon, {}) })), _jsx("div", { className: cn('h-full w-full transition-all duration-200', context.activeIndex !== index &&
|
|
195
|
+
'pointer-events-none select-none'), children: children })] }));
|
|
196
|
+
};
|
|
197
|
+
export const DialogStackTitle = ({ children, className, ...props }) => (_jsx("h2", { className: cn('font-semibold text-lg leading-none tracking-tight', className), ...props, children: children }));
|
|
198
|
+
export const DialogStackDescription = ({ children, className, ...props }) => (_jsx("p", { className: cn('text-muted-foreground text-sm', className), ...props, children: children }));
|
|
199
|
+
export const DialogStackHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col space-y-1.5 text-center sm:text-left', className), ...props }));
|
|
200
|
+
export const DialogStackFooter = ({ children, className, ...props }) => (_jsx("div", { className: cn('flex items-center justify-end space-x-2 pt-4', className), ...props, children: children }));
|
|
201
|
+
export const DialogStackNext = ({ children, className, asChild, ...props }) => {
|
|
202
|
+
const context = useContext(DialogStackContext);
|
|
203
|
+
if (!context) {
|
|
204
|
+
throw new Error('DialogStackNext must be used within a DialogStack');
|
|
205
|
+
}
|
|
206
|
+
const handleNext = () => {
|
|
207
|
+
if (context.activeIndex < context.totalDialogs - 1) {
|
|
208
|
+
context.setActiveIndex(context.activeIndex + 1);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
if (asChild && isValidElement(children)) {
|
|
212
|
+
return React.cloneElement(children, {
|
|
213
|
+
onClick: handleNext,
|
|
214
|
+
className: cn(className, children.props.className),
|
|
215
|
+
...props,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
return (_jsx("button", { type: "button", onClick: handleNext, className: cn('inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', className), disabled: context.activeIndex >= context.totalDialogs - 1, ...props, children: children || 'Next' }));
|
|
219
|
+
};
|
|
220
|
+
export const DialogStackPrevious = ({ children, className, asChild, ...props }) => {
|
|
221
|
+
const context = useContext(DialogStackContext);
|
|
222
|
+
if (!context) {
|
|
223
|
+
throw new Error('DialogStackPrevious must be used within a DialogStack');
|
|
224
|
+
}
|
|
225
|
+
const handlePrevious = () => {
|
|
226
|
+
if (context.activeIndex > 0) {
|
|
227
|
+
context.setActiveIndex(context.activeIndex - 1);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
if (asChild && isValidElement(children)) {
|
|
231
|
+
return React.cloneElement(children, {
|
|
232
|
+
onClick: handlePrevious,
|
|
233
|
+
className: cn(className, children.props.className),
|
|
234
|
+
...props,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
return (_jsx("button", { type: "button", onClick: handlePrevious, className: cn('inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', className), disabled: context.activeIndex <= 0, ...props, children: children || 'Previous' }));
|
|
238
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
import { XIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
function Dialog({ ...props }) {
|
|
6
|
+
return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
7
|
+
}
|
|
8
|
+
function DialogTrigger({ ...props }) {
|
|
9
|
+
return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
10
|
+
}
|
|
11
|
+
function DialogPortal({ ...props }) {
|
|
12
|
+
return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
13
|
+
}
|
|
14
|
+
function DialogClose({ ...props }) {
|
|
15
|
+
return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
16
|
+
}
|
|
17
|
+
function DialogOverlay({ className, ...props }) {
|
|
18
|
+
return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
function DialogContent({ className, children, ...props }) {
|
|
21
|
+
return (_jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] })] })] }));
|
|
22
|
+
}
|
|
23
|
+
function DialogHeader({ className, ...props }) {
|
|
24
|
+
return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2 text-center sm:text-left", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
function DialogFooter({ className, ...props }) {
|
|
27
|
+
return (_jsx("div", { "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function DialogTitle({ className, ...props }) {
|
|
30
|
+
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("text-lg leading-none font-semibold", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
function DialogDescription({ className, ...props }) {
|
|
33
|
+
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("text-muted-foreground text-sm", className), ...props }));
|
|
34
|
+
}
|
|
35
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
variant?: "default" | "destructive";
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
function DropdownMenu({ ...props }) {
|
|
6
|
+
return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
7
|
+
}
|
|
8
|
+
function DropdownMenuPortal({ ...props }) {
|
|
9
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props }));
|
|
10
|
+
}
|
|
11
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
12
|
+
return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props }));
|
|
13
|
+
}
|
|
14
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
15
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className), ...props }) }));
|
|
16
|
+
}
|
|
17
|
+
function DropdownMenuGroup({ ...props }) {
|
|
18
|
+
return (_jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
|
|
19
|
+
}
|
|
20
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
21
|
+
return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
24
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
|
|
25
|
+
}
|
|
26
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
27
|
+
return (_jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
|
|
28
|
+
}
|
|
29
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
30
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
|
|
31
|
+
}
|
|
32
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
33
|
+
return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className), ...props }));
|
|
34
|
+
}
|
|
35
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
36
|
+
return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("bg-border -mx-1 my-1 h-px", className), ...props }));
|
|
37
|
+
}
|
|
38
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
39
|
+
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className), ...props }));
|
|
40
|
+
}
|
|
41
|
+
function DropdownMenuSub({ ...props }) {
|
|
42
|
+
return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
43
|
+
}
|
|
44
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
45
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto size-4" })] }));
|
|
46
|
+
}
|
|
47
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
48
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className), ...props }));
|
|
49
|
+
}
|
|
50
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@/lib/utils";
|
|
3
|
+
function Input({ className, type, ...props }) {
|
|
4
|
+
return (_jsx("input", { type: type, "data-slot": "input", className: cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[2px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:[&::-webkit-calendar-picker-indicator]:invert", className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
export { Input };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
function Label({ className, ...props }) {
|
|
5
|
+
return (_jsx(LabelPrimitive.Root, { "data-slot": "label", className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
export { Label };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
3
|
+
declare function Menubar({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function MenubarTrigger({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function MenubarContent({ className, align, alignOffset, sideOffset, ...props }: React.ComponentProps<typeof MenubarPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function MenubarItem({ className, inset, variant, ...props }: React.ComponentProps<typeof MenubarPrimitive.Item> & {
|
|
11
|
+
inset?: boolean;
|
|
12
|
+
variant?: "default" | "destructive";
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function MenubarCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function MenubarRadioItem({ className, children, ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function MenubarLabel({ className, inset, ...props }: React.ComponentProps<typeof MenubarPrimitive.Label> & {
|
|
17
|
+
inset?: boolean;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function MenubarSeparator({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function MenubarShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function MenubarSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
|
|
23
|
+
inset?: boolean;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function MenubarSubContent({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export { Menubar, MenubarPortal, MenubarMenu, MenubarTrigger, MenubarContent, MenubarGroup, MenubarSeparator, MenubarLabel, MenubarItem, MenubarShortcut, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubTrigger, MenubarSubContent, };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
3
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
function Menubar({ className, ...props }) {
|
|
6
|
+
return (_jsx(MenubarPrimitive.Root, { "data-slot": "menubar", className: cn("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
function MenubarMenu({ ...props }) {
|
|
9
|
+
return _jsx(MenubarPrimitive.Menu, { "data-slot": "menubar-menu", ...props });
|
|
10
|
+
}
|
|
11
|
+
function MenubarGroup({ ...props }) {
|
|
12
|
+
return _jsx(MenubarPrimitive.Group, { "data-slot": "menubar-group", ...props });
|
|
13
|
+
}
|
|
14
|
+
function MenubarPortal({ ...props }) {
|
|
15
|
+
return _jsx(MenubarPrimitive.Portal, { "data-slot": "menubar-portal", ...props });
|
|
16
|
+
}
|
|
17
|
+
function MenubarRadioGroup({ ...props }) {
|
|
18
|
+
return (_jsx(MenubarPrimitive.RadioGroup, { "data-slot": "menubar-radio-group", ...props }));
|
|
19
|
+
}
|
|
20
|
+
function MenubarTrigger({ className, ...props }) {
|
|
21
|
+
return (_jsx(MenubarPrimitive.Trigger, { "data-slot": "menubar-trigger", className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function MenubarContent({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }) {
|
|
24
|
+
return (_jsx(MenubarPortal, { children: _jsx(MenubarPrimitive.Content, { "data-slot": "menubar-content", align: align, alignOffset: alignOffset, sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md", className), ...props }) }));
|
|
25
|
+
}
|
|
26
|
+
function MenubarItem({ className, inset, variant = "default", ...props }) {
|
|
27
|
+
return (_jsx(MenubarPrimitive.Item, { "data-slot": "menubar-item", "data-inset": inset, "data-variant": variant, className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function MenubarCheckboxItem({ className, children, checked, ...props }) {
|
|
30
|
+
return (_jsxs(MenubarPrimitive.CheckboxItem, { "data-slot": "menubar-checkbox-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(MenubarPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
|
|
31
|
+
}
|
|
32
|
+
function MenubarRadioItem({ className, children, ...props }) {
|
|
33
|
+
return (_jsxs(MenubarPrimitive.RadioItem, { "data-slot": "menubar-radio-item", className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(MenubarPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
|
|
34
|
+
}
|
|
35
|
+
function MenubarLabel({ className, inset, ...props }) {
|
|
36
|
+
return (_jsx(MenubarPrimitive.Label, { "data-slot": "menubar-label", "data-inset": inset, className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className), ...props }));
|
|
37
|
+
}
|
|
38
|
+
function MenubarSeparator({ className, ...props }) {
|
|
39
|
+
return (_jsx(MenubarPrimitive.Separator, { "data-slot": "menubar-separator", className: cn("bg-border -mx-1 my-1 h-px", className), ...props }));
|
|
40
|
+
}
|
|
41
|
+
function MenubarShortcut({ className, ...props }) {
|
|
42
|
+
return (_jsx("span", { "data-slot": "menubar-shortcut", className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className), ...props }));
|
|
43
|
+
}
|
|
44
|
+
function MenubarSub({ ...props }) {
|
|
45
|
+
return _jsx(MenubarPrimitive.Sub, { "data-slot": "menubar-sub", ...props });
|
|
46
|
+
}
|
|
47
|
+
function MenubarSubTrigger({ className, inset, children, ...props }) {
|
|
48
|
+
return (_jsxs(MenubarPrimitive.SubTrigger, { "data-slot": "menubar-sub-trigger", "data-inset": inset, className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto h-4 w-4" })] }));
|
|
49
|
+
}
|
|
50
|
+
function MenubarSubContent({ className, ...props }) {
|
|
51
|
+
return (_jsx(MenubarPrimitive.SubContent, { "data-slot": "menubar-sub-content", className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className), ...props }));
|
|
52
|
+
}
|
|
53
|
+
export { Menubar, MenubarPortal, MenubarMenu, MenubarTrigger, MenubarContent, MenubarGroup, MenubarSeparator, MenubarLabel, MenubarItem, MenubarShortcut, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubTrigger, MenubarSubContent, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button } from "@/components/ui/button";
|
|
3
|
+
declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function PaginationItem({ ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
type PaginationLinkProps = {
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
} & Pick<React.ComponentProps<typeof Button>, "size"> & React.ComponentProps<"a">;
|
|
9
|
+
declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon, } from "lucide-react";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
import { buttonVariants } from "@/components/ui/button";
|
|
5
|
+
function Pagination({ className, ...props }) {
|
|
6
|
+
return (_jsx("nav", { role: "navigation", "aria-label": "pagination", "data-slot": "pagination", className: cn("mx-auto flex w-full justify-center", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
function PaginationContent({ className, ...props }) {
|
|
9
|
+
return (_jsx("ul", { "data-slot": "pagination-content", className: cn("flex flex-row items-center gap-1", className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
function PaginationItem({ ...props }) {
|
|
12
|
+
return _jsx("li", { "data-slot": "pagination-item", ...props });
|
|
13
|
+
}
|
|
14
|
+
function PaginationLink({ className, isActive, size = "icon", ...props }) {
|
|
15
|
+
return (_jsx("a", { "aria-current": isActive ? "page" : undefined, "data-slot": "pagination-link", "data-active": isActive, className: cn(buttonVariants({
|
|
16
|
+
variant: isActive ? "outline" : "ghost",
|
|
17
|
+
size,
|
|
18
|
+
}), className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
function PaginationPrevious({ className, ...props }) {
|
|
21
|
+
return (_jsxs(PaginationLink, { "aria-label": "Go to previous page", size: "default", className: cn("gap-1 px-2.5 sm:pl-2.5", className), ...props, children: [_jsx(ChevronLeftIcon, {}), _jsx("span", { className: "hidden sm:block", children: "Previous" })] }));
|
|
22
|
+
}
|
|
23
|
+
function PaginationNext({ className, ...props }) {
|
|
24
|
+
return (_jsxs(PaginationLink, { "aria-label": "Go to next page", size: "default", className: cn("gap-1 px-2.5 sm:pr-2.5", className), ...props, children: [_jsx("span", { className: "hidden sm:block", children: "Next" }), _jsx(ChevronRightIcon, {})] }));
|
|
25
|
+
}
|
|
26
|
+
function PaginationEllipsis({ className, ...props }) {
|
|
27
|
+
return (_jsxs("span", { "aria-hidden": true, "data-slot": "pagination-ellipsis", className: cn("flex size-9 items-center justify-center", className), ...props, children: [_jsx(MoreHorizontalIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More pages" })] }));
|
|
28
|
+
}
|
|
29
|
+
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
function Popover({ ...props }) {
|
|
5
|
+
return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
6
|
+
}
|
|
7
|
+
function PopoverTrigger({ ...props }) {
|
|
8
|
+
return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
9
|
+
}
|
|
10
|
+
function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
|
|
11
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className), ...props }) }));
|
|
12
|
+
}
|
|
13
|
+
function PopoverAnchor({ ...props }) {
|
|
14
|
+
return _jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
15
|
+
}
|
|
16
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|