@momo-webplatform/mobase 0.0.3
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/README.md +23 -0
- package/package.json +154 -0
- package/publish/cjs/components/ui/button.js +60 -0
- package/publish/cjs/components/utils/SpinerIcon.js +7 -0
- package/publish/cjs/lib/utils.js +9 -0
- package/publish/cjs/src/components/Accordion/Accordion.js +44 -0
- package/publish/cjs/src/components/Accordion/index.js +8 -0
- package/publish/cjs/src/components/Alert/Alert.js +50 -0
- package/publish/cjs/src/components/AlertDialog/AlertDialog.js +62 -0
- package/publish/cjs/src/components/AlertDialog/index.js +14 -0
- package/publish/cjs/src/components/Avatar/Avatar.js +74 -0
- package/publish/cjs/src/components/Avatar/index.js +7 -0
- package/publish/cjs/src/components/Badge/Badge.js +24 -0
- package/publish/cjs/src/components/Button/Button.js +74 -0
- package/publish/cjs/src/components/Button/index.js +5 -0
- package/publish/cjs/src/components/Calendar/calendar.js +39 -0
- package/publish/cjs/src/components/Card/Card.js +47 -0
- package/publish/cjs/src/components/Checkbox/Checkbox.js +67 -0
- package/publish/cjs/src/components/Checkbox/index.js +9 -0
- package/publish/cjs/src/components/Collapsible/collapsible.js +33 -0
- package/publish/cjs/src/components/Command/command.js +62 -0
- package/publish/cjs/src/components/Dialog/dialog.js +57 -0
- package/publish/cjs/src/components/Drawer/drawer.js +57 -0
- package/publish/cjs/src/components/DropdownMenu/dropdownmenu.js +75 -0
- package/publish/cjs/src/components/HoverCard/hover-card.js +38 -0
- package/publish/cjs/src/components/IconButton/IconButton.js +67 -0
- package/publish/cjs/src/components/IconButton/index.js +5 -0
- package/publish/cjs/src/components/Input/input.js +34 -0
- package/publish/cjs/src/components/Label/Label.js +35 -0
- package/publish/cjs/src/components/Menubar/menubar.js +77 -0
- package/publish/cjs/src/components/NavigationMenu/navigation-menu.js +102 -0
- package/publish/cjs/src/components/Pagination/Pagination.js +52 -0
- package/publish/cjs/src/components/Popover/popover.js +37 -0
- package/publish/cjs/src/components/Progress/Progress.js +33 -0
- package/publish/cjs/src/components/RadioGroup/Radio.js +110 -0
- package/publish/cjs/src/components/RadioGroup/RadioGroup.js +53 -0
- package/publish/cjs/src/components/RadioGroup/index.js +6 -0
- package/publish/cjs/src/components/Select/Select.js +61 -0
- package/publish/cjs/src/components/Sheet/sheet.js +71 -0
- package/publish/cjs/src/components/Skeleton/skeleton.js +9 -0
- package/publish/cjs/src/components/Slider/slider.js +33 -0
- package/publish/cjs/src/components/Switch/Switch.js +54 -0
- package/publish/cjs/src/components/Switch/index.js +6 -0
- package/publish/cjs/src/components/Table/Table.js +53 -0
- package/publish/cjs/src/components/Tabs/Tabs.js +42 -0
- package/publish/cjs/src/components/Textarea/Textarea.js +14 -0
- package/publish/cjs/src/components/Toast/Toast.js +65 -0
- package/publish/cjs/src/components/Toast/toaster.js +14 -0
- package/publish/cjs/src/components/Toast/use-toast.js +155 -0
- package/publish/cjs/src/components/Tooltip/Tooltip.js +41 -0
- package/publish/cjs/src/helpers/clone-deep.js +15 -0
- package/publish/cjs/src/helpers/clone-deep.spec.js +22 -0
- package/publish/cjs/src/helpers/generic-forward-ref.js +5 -0
- package/publish/cjs/src/helpers/http.js +10 -0
- package/publish/cjs/src/helpers/is-client.js +7 -0
- package/publish/cjs/src/helpers/is-object.js +12 -0
- package/publish/cjs/src/helpers/is-object.spec.js +24 -0
- package/publish/cjs/src/helpers/merge-deep.js +29 -0
- package/publish/cjs/src/helpers/merge-deep.spec.js +56 -0
- package/publish/cjs/src/helpers/omit.js +16 -0
- package/publish/cjs/src/helpers/omit.spec.js +9 -0
- package/publish/cjs/src/index.js +19 -0
- package/publish/cjs/src/types/index.js +2 -0
- package/publish/cjs/tsconfig.lib.tsbuildinfo +1 -0
- package/publish/esm/components/ui/button.d.ts +11 -0
- package/publish/esm/components/ui/button.js +33 -0
- package/publish/esm/components/utils/SpinerIcon.d.ts +6 -0
- package/publish/esm/components/utils/SpinerIcon.js +5 -0
- package/publish/esm/lib/utils.d.ts +2 -0
- package/publish/esm/lib/utils.js +5 -0
- package/publish/esm/src/components/Accordion/Accordion.d.ts +20 -0
- package/publish/esm/src/components/Accordion/Accordion.js +15 -0
- package/publish/esm/src/components/Accordion/index.d.ts +2 -0
- package/publish/esm/src/components/Accordion/index.js +1 -0
- package/publish/esm/src/components/Alert/Alert.d.ts +8 -0
- package/publish/esm/src/components/Alert/Alert.js +22 -0
- package/publish/esm/src/components/AlertDialog/AlertDialog.d.ts +49 -0
- package/publish/esm/src/components/AlertDialog/AlertDialog.js +26 -0
- package/publish/esm/src/components/AlertDialog/index.d.ts +2 -0
- package/publish/esm/src/components/AlertDialog/index.js +5 -0
- package/publish/esm/src/components/Avatar/Avatar.d.ts +33 -0
- package/publish/esm/src/components/Avatar/Avatar.js +46 -0
- package/publish/esm/src/components/Avatar/index.d.ts +2 -0
- package/publish/esm/src/components/Avatar/index.js +1 -0
- package/publish/esm/src/components/Badge/Badge.d.ts +9 -0
- package/publish/esm/src/components/Badge/Badge.js +20 -0
- package/publish/esm/src/components/Button/Button.d.ts +26 -0
- package/publish/esm/src/components/Button/Button.js +44 -0
- package/publish/esm/src/components/Button/index.d.ts +2 -0
- package/publish/esm/src/components/Button/index.js +1 -0
- package/publish/esm/src/components/Calendar/calendar.d.ts +8 -0
- package/publish/esm/src/components/Calendar/calendar.js +36 -0
- package/publish/esm/src/components/Card/Card.d.ts +8 -0
- package/publish/esm/src/components/Card/Card.js +16 -0
- package/publish/esm/src/components/Checkbox/Checkbox.d.ts +40 -0
- package/publish/esm/src/components/Checkbox/Checkbox.js +36 -0
- package/publish/esm/src/components/Checkbox/index.d.ts +2 -0
- package/publish/esm/src/components/Checkbox/index.js +4 -0
- package/publish/esm/src/components/Collapsible/collapsible.d.ts +5 -0
- package/publish/esm/src/components/Collapsible/collapsible.js +5 -0
- package/publish/esm/src/components/Command/command.d.ts +50 -0
- package/publish/esm/src/components/Command/command.js +28 -0
- package/publish/esm/src/components/Dialog/dialog.d.ts +19 -0
- package/publish/esm/src/components/Dialog/dialog.js +22 -0
- package/publish/esm/src/components/Drawer/drawer.d.ts +24 -0
- package/publish/esm/src/components/Drawer/drawer.js +22 -0
- package/publish/esm/src/components/DropdownMenu/dropdownmenu.d.ts +27 -0
- package/publish/esm/src/components/DropdownMenu/dropdownmenu.js +35 -0
- package/publish/esm/src/components/HoverCard/hover-card.d.ts +6 -0
- package/publish/esm/src/components/HoverCard/hover-card.js +10 -0
- package/publish/esm/src/components/IconButton/IconButton.d.ts +22 -0
- package/publish/esm/src/components/IconButton/IconButton.js +40 -0
- package/publish/esm/src/components/IconButton/index.d.ts +2 -0
- package/publish/esm/src/components/IconButton/index.js +1 -0
- package/publish/esm/src/components/Input/input.d.ts +5 -0
- package/publish/esm/src/components/Input/input.js +8 -0
- package/publish/esm/src/components/Label/Label.d.ts +5 -0
- package/publish/esm/src/components/Label/Label.js +9 -0
- package/publish/esm/src/components/Menubar/menubar.d.ts +31 -0
- package/publish/esm/src/components/Menubar/menubar.js +36 -0
- package/publish/esm/src/components/NavigationMenu/navigation-menu.d.ts +13 -0
- package/publish/esm/src/components/NavigationMenu/navigation-menu.js +64 -0
- package/publish/esm/src/components/Pagination/Pagination.d.ts +19 -0
- package/publish/esm/src/components/Pagination/Pagination.js +20 -0
- package/publish/esm/src/components/Popover/popover.d.ts +6 -0
- package/publish/esm/src/components/Popover/popover.js +9 -0
- package/publish/esm/src/components/Progress/Progress.d.ts +4 -0
- package/publish/esm/src/components/Progress/Progress.js +7 -0
- package/publish/esm/src/components/RadioGroup/Radio.d.ts +22 -0
- package/publish/esm/src/components/RadioGroup/Radio.js +84 -0
- package/publish/esm/src/components/RadioGroup/RadioGroup.d.ts +44 -0
- package/publish/esm/src/components/RadioGroup/RadioGroup.js +25 -0
- package/publish/esm/src/components/RadioGroup/index.d.ts +2 -0
- package/publish/esm/src/components/RadioGroup/index.js +1 -0
- package/publish/esm/src/components/Select/Select.d.ts +13 -0
- package/publish/esm/src/components/Select/Select.js +26 -0
- package/publish/esm/src/components/Sheet/sheet.d.ts +25 -0
- package/publish/esm/src/components/Sheet/sheet.js +36 -0
- package/publish/esm/src/components/Skeleton/skeleton.d.ts +2 -0
- package/publish/esm/src/components/Skeleton/skeleton.js +6 -0
- package/publish/esm/src/components/Slider/slider.d.ts +4 -0
- package/publish/esm/src/components/Slider/slider.js +7 -0
- package/publish/esm/src/components/Switch/Switch.d.ts +37 -0
- package/publish/esm/src/components/Switch/Switch.js +26 -0
- package/publish/esm/src/components/Switch/index.d.ts +2 -0
- package/publish/esm/src/components/Switch/index.js +1 -0
- package/publish/esm/src/components/Table/Table.d.ts +10 -0
- package/publish/esm/src/components/Table/Table.js +20 -0
- package/publish/esm/src/components/Tabs/Tabs.d.ts +7 -0
- package/publish/esm/src/components/Tabs/Tabs.js +13 -0
- package/publish/esm/src/components/Textarea/Textarea.d.ts +5 -0
- package/publish/esm/src/components/Textarea/Textarea.js +8 -0
- package/publish/esm/src/components/Toast/Toast.d.ts +15 -0
- package/publish/esm/src/components/Toast/Toast.js +33 -0
- package/publish/esm/src/components/Toast/toaster.d.ts +1 -0
- package/publish/esm/src/components/Toast/toaster.js +10 -0
- package/publish/esm/src/components/Toast/use-toast.d.ts +44 -0
- package/publish/esm/src/components/Toast/use-toast.js +127 -0
- package/publish/esm/src/components/Tooltip/Tooltip.d.ts +8 -0
- package/publish/esm/src/components/Tooltip/Tooltip.js +11 -0
- package/publish/esm/src/helpers/clone-deep.d.ts +1 -0
- package/publish/esm/src/helpers/clone-deep.js +11 -0
- package/publish/esm/src/helpers/clone-deep.spec.d.ts +1 -0
- package/publish/esm/src/helpers/clone-deep.spec.js +20 -0
- package/publish/esm/src/helpers/generic-forward-ref.d.ts +5 -0
- package/publish/esm/src/helpers/generic-forward-ref.js +3 -0
- package/publish/esm/src/helpers/http.d.ts +1 -0
- package/publish/esm/src/helpers/http.js +6 -0
- package/publish/esm/src/helpers/is-client.d.ts +1 -0
- package/publish/esm/src/helpers/is-client.js +3 -0
- package/publish/esm/src/helpers/is-object.d.ts +6 -0
- package/publish/esm/src/helpers/is-object.js +8 -0
- package/publish/esm/src/helpers/is-object.spec.d.ts +1 -0
- package/publish/esm/src/helpers/is-object.spec.js +22 -0
- package/publish/esm/src/helpers/merge-deep.d.ts +7 -0
- package/publish/esm/src/helpers/merge-deep.js +25 -0
- package/publish/esm/src/helpers/merge-deep.spec.d.ts +1 -0
- package/publish/esm/src/helpers/merge-deep.spec.js +54 -0
- package/publish/esm/src/helpers/omit.d.ts +1 -0
- package/publish/esm/src/helpers/omit.js +12 -0
- package/publish/esm/src/helpers/omit.spec.d.ts +1 -0
- package/publish/esm/src/helpers/omit.spec.js +7 -0
- package/publish/esm/src/index.d.ts +3 -0
- package/publish/esm/src/index.js +3 -0
- package/publish/esm/src/types/index.d.ts +3 -0
- package/publish/esm/src/types/index.js +1 -0
- package/publish/esm/tsconfig.lib.tsbuildinfo +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from "./Accordion";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
+
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
const alertVariants = cva("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-background text-foreground",
|
|
9
|
+
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
variant: "default",
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
const Alert = React.forwardRef(({ className, variant, ...props }, ref) => (_jsx("div", { ref: ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props })));
|
|
17
|
+
Alert.displayName = "Alert";
|
|
18
|
+
const AlertTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("h5", { ref: ref, className: cn("mb-1 font-medium leading-none tracking-tight", className), ...props })));
|
|
19
|
+
AlertTitle.displayName = "AlertTitle";
|
|
20
|
+
const AlertDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("text-sm [&_p]:leading-relaxed", className), ...props })));
|
|
21
|
+
AlertDescription.displayName = "AlertDescription";
|
|
22
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import type * as Radix from "@radix-ui/react-primitive";
|
|
5
|
+
declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
6
|
+
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
8
|
+
type DialogProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
|
|
9
|
+
interface AlertDialogProps extends Omit<DialogProps, "modal"> {
|
|
10
|
+
}
|
|
11
|
+
type DialogTriggerProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;
|
|
12
|
+
interface AlertDialogTriggerProps extends DialogTriggerProps {
|
|
13
|
+
}
|
|
14
|
+
type DialogPortalProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>;
|
|
15
|
+
interface AlertDialogPortalProps extends DialogPortalProps {
|
|
16
|
+
}
|
|
17
|
+
type DialogOverlayProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
|
18
|
+
interface AlertDialogOverlayProps extends DialogOverlayProps {
|
|
19
|
+
}
|
|
20
|
+
type DialogCloseProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;
|
|
21
|
+
interface AlertDialogActionProps extends DialogCloseProps {
|
|
22
|
+
}
|
|
23
|
+
interface AlertDialogCancelProps extends DialogCloseProps {
|
|
24
|
+
}
|
|
25
|
+
type DialogTitleProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
|
26
|
+
interface AlertDialogTitleProps extends DialogTitleProps {
|
|
27
|
+
}
|
|
28
|
+
type DialogDescriptionProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
|
29
|
+
interface AlertDialogDescriptionProps extends DialogDescriptionProps {
|
|
30
|
+
}
|
|
31
|
+
type DialogContentProps = Radix.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;
|
|
32
|
+
interface AlertDialogContentProps extends Omit<DialogContentProps, "onPointerDownOutside" | "onInteractOutside"> {
|
|
33
|
+
}
|
|
34
|
+
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
declare const AlertDialogHeader: {
|
|
37
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
declare const AlertDialogFooter: {
|
|
41
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
displayName: string;
|
|
43
|
+
};
|
|
44
|
+
declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
45
|
+
declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
46
|
+
declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
47
|
+
declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
48
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
49
|
+
export type { AlertDialogProps, AlertDialogTriggerProps, AlertDialogPortalProps, AlertDialogOverlayProps, AlertDialogContentProps, AlertDialogActionProps, AlertDialogCancelProps, AlertDialogTitleProps, AlertDialogDescriptionProps, };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
import { buttonVariants } from "@/components/ui/button";
|
|
6
|
+
const AlertDialog = AlertDialogPrimitive.Root;
|
|
7
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
8
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
9
|
+
const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Overlay, { className: cn("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props, ref: ref })));
|
|
10
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
11
|
+
const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] bg-white text-gray-700 border rounded-sm border-gray-300 top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props })] })));
|
|
12
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
13
|
+
const AlertDialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props }));
|
|
14
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
15
|
+
const AlertDialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
|
|
16
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
17
|
+
const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Title, { ref: ref, className: cn("text-lg text-gray-900 font-semibold", className), ...props })));
|
|
18
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
19
|
+
const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
20
|
+
AlertDialogDescription.displayName =
|
|
21
|
+
AlertDialogPrimitive.Description.displayName;
|
|
22
|
+
const AlertDialogAction = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Action, { ref: ref, className: cn(buttonVariants(), "", className), ...props })));
|
|
23
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
24
|
+
const AlertDialogCancel = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Cancel, { ref: ref, className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className), ...props })));
|
|
25
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
26
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { AlertDialog, AlertDialogTrigger, AlertDialogPortal, AlertDialogOverlay, AlertDialogContent, AlertDialogAction, AlertDialogCancel, AlertDialogTitle, AlertDialogDescription, } from "./AlertDialog";
|
|
2
|
+
export type { AlertDialogProps, AlertDialogTriggerProps, AlertDialogPortalProps, AlertDialogOverlayProps, AlertDialogContentProps, AlertDialogActionProps, AlertDialogCancelProps, AlertDialogTitleProps, AlertDialogDescriptionProps, } from "./AlertDialog";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
import type * as Radix from "@radix-ui/react-primitive";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
|
+
declare const AvatarVariants: (props?: ({
|
|
7
|
+
variant?: null | undefined;
|
|
8
|
+
size?: "sm" | "lg" | "xs" | "md" | "xl" | null | undefined;
|
|
9
|
+
shape?: "square" | "rounded" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
11
|
+
type ImageLoadingStatus = "idle" | "loading" | "loaded" | "error";
|
|
12
|
+
type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
13
|
+
interface AvatarProps extends PrimitiveSpanProps {
|
|
14
|
+
}
|
|
15
|
+
type PrimitiveImageProps = Radix.ComponentPropsWithoutRef<typeof Primitive.img>;
|
|
16
|
+
interface AvatarVariantProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>, VariantProps<typeof AvatarVariants> {
|
|
17
|
+
asChild?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface SubImageProps {
|
|
20
|
+
subImage?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & AvatarVariantProps & SubImageProps & React.RefAttributes<HTMLSpanElement>>;
|
|
23
|
+
interface AvatarImageProps extends PrimitiveImageProps {
|
|
24
|
+
onLoadingStatusChange?: (status: ImageLoadingStatus) => void;
|
|
25
|
+
}
|
|
26
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
27
|
+
interface AvatarFallbackProps extends PrimitiveSpanProps {
|
|
28
|
+
delayMs?: number;
|
|
29
|
+
anonymous?: boolean;
|
|
30
|
+
}
|
|
31
|
+
declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>>;
|
|
32
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
33
|
+
export type { AvatarProps, AvatarImageProps, AvatarFallbackProps, SubImageProps, AvatarVariantProps, };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
/* -------------------------------------------------------------------------------------------------
|
|
7
|
+
* AvatarVariants
|
|
8
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
9
|
+
const AvatarVariants = cva("aspect-square object-cover relative overflow-hidden flex shrink-0 bg-pink-100 border border-gray-200", {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {},
|
|
12
|
+
size: {
|
|
13
|
+
xs: "w-6 h-6 text-xs",
|
|
14
|
+
sm: "w-8 h-8 text-xs",
|
|
15
|
+
md: "w-10 h-10 text-xs",
|
|
16
|
+
lg: "w-12 h-12 text-lg",
|
|
17
|
+
xl: "w-14 h-14 text-xl",
|
|
18
|
+
},
|
|
19
|
+
shape: {
|
|
20
|
+
rounded: "rounded-full",
|
|
21
|
+
square: "rounded-lg",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
shape: "rounded",
|
|
26
|
+
size: "sm",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const subImageVariants = cva("absolute -bottom-0.5 -right-1 z-10 ", {
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
xs: "w-3 h-3 rounded-md",
|
|
33
|
+
sm: "w-4 h-4 rounded-md",
|
|
34
|
+
md: "w-5 h-5 text-xs rounded-md",
|
|
35
|
+
lg: "w-5 h-5 text-lg rounded-lg",
|
|
36
|
+
xl: "w-6 h-6 text-xl rounded-lg",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const Avatar = React.forwardRef(({ size = "md", shape = "rounded", subImage = "", className, ...props }, ref) => (_jsxs("div", { className: "relative", children: [_jsx(AvatarPrimitive.Root, { ref: ref, className: cn(AvatarVariants({ size, shape }), "", className), ...props }), subImage && (_jsx("div", { className: cn(subImageVariants({ size })), children: _jsx("img", { src: subImage, className: cn("object-cover w-full h-full", subImageVariants({})), alt: "" }) }))] })));
|
|
41
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
42
|
+
const AvatarImage = React.forwardRef(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Image, { ref: ref, className: cn("w-full h-full aspect-square z-10", className), ...props })));
|
|
43
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
44
|
+
const AvatarFallback = React.forwardRef(({ anonymous = false, className, ...props }, ref) => (_jsx(_Fragment, { children: anonymous ? (_jsx("div", { className: "flex items-center font-medium flex-shrink-0 w-full h-full text-pink-500 justify-center rounded-full bg-muted", children: _jsx("img", { src: "https://homepage.momocdn.net/fileuploads/svg/momo-file-240228134145.svg ", alt: "", className: "aspect-[1/1] w-5 h-5\t" }) })) : (_jsx(AvatarPrimitive.Fallback, { ref: ref, className: cn("flex h-full w-full items-center font-medium text-pink-500 justify-center rounded-full bg-muted", className), ...props })) })));
|
|
45
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
46
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Avatar, AvatarImage, AvatarFallback } from "./Avatar";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "secondary" | "outline" | "danger" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
const badgeVariants = cva("inline-flex items-center rounded-md border border-gray-300 px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 font-semibold", {
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
default: "border-transparent bg-pink-500 text-white/90 shadow hover:bg-pink-500/80",
|
|
8
|
+
secondary: "border-transparent bg-gray-200 text-gray-900 hover:bg-gray-200/80",
|
|
9
|
+
outline: "text-gray-900",
|
|
10
|
+
danger: "border-transparent bg-red-500 text-white/90 shadow hover:bg-red-500/80",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
function Badge({ className, variant, ...props }) {
|
|
18
|
+
return (_jsx("div", { className: cn(badgeVariants({ variant }), className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "text" | "primary" | "secondary" | "outline" | "tonal" | "danger" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
/**
|
|
9
|
+
* CSS class to be appended to the root element.
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
14
|
+
*/
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Adds loading indicator icon and disables interactions
|
|
18
|
+
*/
|
|
19
|
+
isLoading?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Disabled interaction and applies disabled styles
|
|
22
|
+
*/
|
|
23
|
+
isDisabled?: boolean;
|
|
24
|
+
}
|
|
25
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
import SpinerIcon from "~/components/utils/SpinerIcon";
|
|
7
|
+
// /dwd
|
|
8
|
+
const buttonVariants = cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed border border-transparent", {
|
|
9
|
+
variants: {
|
|
10
|
+
/**
|
|
11
|
+
* Determines style variation of Button component.
|
|
12
|
+
*/
|
|
13
|
+
variant: {
|
|
14
|
+
primary: "bg-pink-500 text-white hover:bg-pink-600 disabled:bg-pink-300",
|
|
15
|
+
secondary: "bg-white text-gray-900 hover:bg-gray-100 disabled:text-gray-400 disabled:bg-white border-gray-300",
|
|
16
|
+
outline: "border-pink-500 text-pink-500 bg-white hover:bg-pink-50 disabled:bg-white disabled:border-pink-300 disabled:text-pink-300",
|
|
17
|
+
tonal: "bg-pink-100 text-pink-500 hover:bg-pink-200 disabled:bg-gray-200 disabled:text-gray-400",
|
|
18
|
+
danger: "bg-red-500 text-white hover:bg-red-600 disabled:bg-red-300",
|
|
19
|
+
text: "text-gray-900 bg-transparent hover:bg-gray-100 disabled:text-gray-400 disabled:bg-transparent",
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* Determines size variation of Button component.
|
|
23
|
+
*/
|
|
24
|
+
size: {
|
|
25
|
+
default: "text-sm h-10 px-4",
|
|
26
|
+
sm: "h-8 px-3 text-sm",
|
|
27
|
+
lg: "h-12 px-4 text-base",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
variant: "primary",
|
|
32
|
+
size: "default",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
const Button = React.forwardRef(({ className, variant = "primary", size = "default", asChild = false, isLoading = false, isDisabled = false, ...props }, ref) => {
|
|
36
|
+
const Comp = asChild ? Slot : "button";
|
|
37
|
+
const buttonClassName = cn(buttonVariants({ variant, size, className }), {
|
|
38
|
+
"cursor-wait": isLoading,
|
|
39
|
+
});
|
|
40
|
+
const loaderSize = size === "default" || size === "sm" ? "w-4 h-4" : "w-5 h-5";
|
|
41
|
+
return (_jsx(_Fragment, { children: asChild ? (_jsx(Comp, { className: buttonClassName, disabled: isDisabled, ref: ref, ...props, children: props.children })) : (_jsxs(Comp, { className: buttonClassName, disabled: isDisabled, ref: ref, ...props, children: [isLoading && (_jsx(SpinerIcon, { className: `${loaderSize} animate-spin-loading mr-2` })), props.children] })) }));
|
|
42
|
+
});
|
|
43
|
+
Button.displayName = "Button";
|
|
44
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from "./Button";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DayPicker } from "react-day-picker";
|
|
3
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare namespace Calendar {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export { Calendar };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
3
|
+
import { DayPicker } from "react-day-picker";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
import { buttonVariants } from "@/components/ui/button";
|
|
6
|
+
function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
|
|
7
|
+
return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn("p-3", className), classNames: {
|
|
8
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
9
|
+
month: "space-y-4",
|
|
10
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
11
|
+
caption_label: "text-sm font-medium",
|
|
12
|
+
nav: "space-x-1 flex items-center",
|
|
13
|
+
nav_button: cn(buttonVariants({ variant: "outline" }), "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),
|
|
14
|
+
nav_button_previous: "absolute left-1",
|
|
15
|
+
nav_button_next: "absolute right-1",
|
|
16
|
+
table: "w-full border-collapse space-y-1",
|
|
17
|
+
head_row: "flex",
|
|
18
|
+
head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
|
19
|
+
row: "flex w-full mt-2",
|
|
20
|
+
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
21
|
+
day: cn(buttonVariants({ variant: "ghost" }), "h-9 w-9 p-0 font-normal aria-selected:opacity-100"),
|
|
22
|
+
day_range_end: "day-range-end",
|
|
23
|
+
day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
|
24
|
+
day_today: "bg-accent text-accent-foreground",
|
|
25
|
+
day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
|
|
26
|
+
day_disabled: "text-muted-foreground opacity-50",
|
|
27
|
+
day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
28
|
+
day_hidden: "invisible",
|
|
29
|
+
...classNames,
|
|
30
|
+
}, components: {
|
|
31
|
+
IconLeft: () => _jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
32
|
+
IconRight: () => _jsx(ChevronRight, { className: "h-4 w-4" }),
|
|
33
|
+
}, ...props }));
|
|
34
|
+
}
|
|
35
|
+
Calendar.displayName = "Calendar";
|
|
36
|
+
export { Calendar };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
const Card = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className), ...props })));
|
|
5
|
+
Card.displayName = "Card";
|
|
6
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })));
|
|
7
|
+
CardHeader.displayName = "CardHeader";
|
|
8
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("h3", { ref: ref, className: cn("text-2xl font-semibold leading-none tracking-tight", className), ...props })));
|
|
9
|
+
CardTitle.displayName = "CardTitle";
|
|
10
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("p", { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
11
|
+
CardDescription.displayName = "CardDescription";
|
|
12
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("p-6 pt-0", className), ...props })));
|
|
13
|
+
CardContent.displayName = "CardContent";
|
|
14
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center p-6 pt-0", className), ...props })));
|
|
15
|
+
CardFooter.displayName = "CardFooter";
|
|
16
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
|
+
import type * as Radix from "@radix-ui/react-primitive";
|
|
5
|
+
import type { Scope } from "@radix-ui/react-context";
|
|
6
|
+
declare const createCheckboxScope: import("@radix-ui/react-context").CreateScope;
|
|
7
|
+
type CheckedState = boolean | "indeterminate";
|
|
8
|
+
type CheckboxContextValue = {
|
|
9
|
+
state: CheckedState;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const CheckboxProvider: {
|
|
13
|
+
(props: CheckboxContextValue & {
|
|
14
|
+
scope: Scope<CheckboxContextValue>;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}): JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
}, useCheckboxContext: (consumerName: string, scope: Scope<CheckboxContextValue | undefined>) => CheckboxContextValue;
|
|
19
|
+
type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
20
|
+
interface CheckboxProps extends Omit<PrimitiveButtonProps, "checked" | "defaultChecked"> {
|
|
21
|
+
checked?: CheckedState;
|
|
22
|
+
defaultChecked?: CheckedState;
|
|
23
|
+
required?: boolean;
|
|
24
|
+
onCheckedChange?(checked: CheckedState): void;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
28
|
+
interface CheckboxIndicatorProps extends PrimitiveSpanProps {
|
|
29
|
+
/**
|
|
30
|
+
* Used to force mounting when more control is needed. Useful when
|
|
31
|
+
* controlling animation with React animation libraries.
|
|
32
|
+
*/
|
|
33
|
+
forceMount?: true;
|
|
34
|
+
}
|
|
35
|
+
declare const CheckboxIndicator: React.ForwardRefExoticComponent<CheckboxIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
36
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
37
|
+
declare const Root: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
declare const Indicator: React.ForwardRefExoticComponent<CheckboxIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
39
|
+
export { Checkbox, CheckboxIndicator, createCheckboxScope, Root, Indicator };
|
|
40
|
+
export type { CheckboxProps, CheckboxIndicatorProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
+
import { Check } from "lucide-react";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
|
+
import { createContextScope } from "@radix-ui/react-context";
|
|
7
|
+
import { Presence } from "@radix-ui/react-presence";
|
|
8
|
+
import { cn } from "@/lib/utils";
|
|
9
|
+
/* -------------------------------------------------------------------------------------------------
|
|
10
|
+
* Checkbox
|
|
11
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
12
|
+
const CHECKBOX_NAME = "Checkbox";
|
|
13
|
+
const [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
|
|
14
|
+
export const [CheckboxProvider, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
|
|
15
|
+
const INDICATOR_NAME = "CheckboxIndicator";
|
|
16
|
+
function getState(checked) {
|
|
17
|
+
return isIndeterminate(checked)
|
|
18
|
+
? "indeterminate"
|
|
19
|
+
: checked
|
|
20
|
+
? "checked"
|
|
21
|
+
: "unchecked";
|
|
22
|
+
}
|
|
23
|
+
const CheckboxIndicator = React.forwardRef((props, forwardedRef) => {
|
|
24
|
+
const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
|
|
25
|
+
const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
|
|
26
|
+
return (_jsx(Presence, { present: forceMount || isIndeterminate(context.state) || context.state === true, children: _jsx(Primitive.span, { "data-state": getState(context.state), "data-disabled": context.disabled ? "" : undefined, ...indicatorProps, ref: forwardedRef, style: { pointerEvents: "none", ...props.style } }) }));
|
|
27
|
+
});
|
|
28
|
+
function isIndeterminate(checked) {
|
|
29
|
+
return checked === "indeterminate";
|
|
30
|
+
}
|
|
31
|
+
CheckboxIndicator.displayName = INDICATOR_NAME;
|
|
32
|
+
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (_jsx(CheckboxPrimitive.Root, { ref: ref, className: cn("peer h-4 w-4 shrink-0 rounded-sm border-2 disabled:bg-gray-300 border-gray-300 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-default disabled:opacity-50 data-[state=checked]:border-none disabled:data-[state=checked]:bg-gray-300 disabled:data-[state=checked]:text-gray-600 data-[state=checked]:bg-pink-500 data-[state=checked]:text-white", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: _jsx(Check, { className: "h-3.5 w-3.5" }) }) })));
|
|
33
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
34
|
+
const Root = Checkbox;
|
|
35
|
+
const Indicator = CheckboxIndicator;
|
|
36
|
+
export { Checkbox, CheckboxIndicator, createCheckboxScope, Root, Indicator };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
|
+
declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const CollapsibleContent: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
|
3
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
4
|
+
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type DialogProps } from "@radix-ui/react-dialog";
|
|
3
|
+
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
} & React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
shouldFilter?: boolean | undefined;
|
|
8
|
+
filter?: ((value: string, search: string) => number) | undefined;
|
|
9
|
+
defaultValue?: string | undefined;
|
|
10
|
+
value?: string | undefined;
|
|
11
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
12
|
+
loop?: boolean | undefined;
|
|
13
|
+
vimBindings?: boolean | undefined;
|
|
14
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
interface CommandDialogProps extends DialogProps {
|
|
16
|
+
}
|
|
17
|
+
declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "type" | "value"> & {
|
|
19
|
+
value?: string | undefined;
|
|
20
|
+
onValueChange?: ((search: string) => void) | undefined;
|
|
21
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
22
|
+
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "value" | "heading"> & {
|
|
31
|
+
heading?: React.ReactNode;
|
|
32
|
+
value?: string | undefined;
|
|
33
|
+
forceMount?: boolean | undefined;
|
|
34
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & {
|
|
36
|
+
alwaysRender?: boolean | undefined;
|
|
37
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect" | "disabled" | "value"> & {
|
|
41
|
+
disabled?: boolean | undefined;
|
|
42
|
+
onSelect?: ((value: string) => void) | undefined;
|
|
43
|
+
value?: string | undefined;
|
|
44
|
+
forceMount?: boolean | undefined;
|
|
45
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
declare const CommandShortcut: {
|
|
47
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
displayName: string;
|
|
49
|
+
};
|
|
50
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
4
|
+
import { Search } from "lucide-react";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
import { Dialog, DialogContent } from "~/src/components/Dialog/dialog";
|
|
7
|
+
const Command = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive, { ref: ref, className: cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className), ...props })));
|
|
8
|
+
Command.displayName = CommandPrimitive.displayName;
|
|
9
|
+
const CommandDialog = ({ children, ...props }) => {
|
|
10
|
+
return (_jsx(Dialog, { ...props, children: _jsx(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: _jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) }) }));
|
|
11
|
+
};
|
|
12
|
+
const CommandInput = React.forwardRef(({ className, ...props }, ref) => (_jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [_jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { ref: ref, className: cn("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className), ...props })] })));
|
|
13
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
14
|
+
const CommandList = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.List, { ref: ref, className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className), ...props })));
|
|
15
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
16
|
+
const CommandEmpty = React.forwardRef((props, ref) => (_jsx(CommandPrimitive.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
|
|
17
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
18
|
+
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Group, { ref: ref, className: cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className), ...props })));
|
|
19
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
20
|
+
const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Separator, { ref: ref, className: cn("-mx-1 h-px bg-border", className), ...props })));
|
|
21
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
22
|
+
const CommandItem = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props })));
|
|
23
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
24
|
+
const CommandShortcut = ({ className, ...props }) => {
|
|
25
|
+
return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props }));
|
|
26
|
+
};
|
|
27
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
28
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|