pf-common-components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.json +17 -0
- package/dist/assets/Arrow.d.ts +7 -0
- package/dist/assets/Arrow.js +5 -0
- package/dist/assets/CalenderIcon.d.ts +2 -0
- package/dist/assets/CalenderIcon.js +5 -0
- package/dist/assets/ClearAll.d.ts +2 -0
- package/dist/assets/ClearAll.js +5 -0
- package/dist/assets/CrossIcon.d.ts +8 -0
- package/dist/assets/CrossIcon.js +7 -0
- package/dist/assets/DropDown.d.ts +4 -0
- package/dist/assets/DropDown.js +5 -0
- package/dist/global.css +3213 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +25 -0
- package/dist/lib/CommonComponentsUtil.d.ts +7 -0
- package/dist/lib/CommonComponentsUtil.js +22 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +5 -0
- package/dist/ui/BaseTable.d.ts +132 -0
- package/dist/ui/BaseTable.js +330 -0
- package/dist/ui/DateCalendar.d.ts +10 -0
- package/dist/ui/DateCalendar.js +47 -0
- package/dist/ui/DateField.d.ts +35 -0
- package/dist/ui/DateField.js +37 -0
- package/dist/ui/DateOfBirthSelector.d.ts +16 -0
- package/dist/ui/DateOfBirthSelector.js +42 -0
- package/dist/ui/DateRangePicker.d.ts +8 -0
- package/dist/ui/DateRangePicker.js +73 -0
- package/dist/ui/DobCalendar.d.ts +17 -0
- package/dist/ui/DobCalendar.js +86 -0
- package/dist/ui/Formfield.d.ts +12 -0
- package/dist/ui/Formfield.js +36 -0
- package/dist/ui/GetScrollAlert.d.ts +9 -0
- package/dist/ui/GetScrollAlert.js +37 -0
- package/dist/ui/RadioGroupContext/RadioGroupContext.d.ts +8 -0
- package/dist/ui/RadioGroupContext/RadioGroupContext.js +11 -0
- package/dist/ui/SelectCommand.d.ts +69 -0
- package/dist/ui/SelectCommand.js +260 -0
- package/dist/ui/SlashIcon.d.ts +2 -0
- package/dist/ui/SlashIcon.js +5 -0
- package/dist/ui/SortingArrows.d.ts +11 -0
- package/dist/ui/SortingArrows.js +11 -0
- package/dist/ui/TextTags.d.ts +39 -0
- package/dist/ui/TextTags.js +73 -0
- package/dist/ui/accordion.d.ts +10 -0
- package/dist/ui/accordion.js +77 -0
- package/dist/ui/alert-dialog.d.ts +20 -0
- package/dist/ui/alert-dialog.js +62 -0
- package/dist/ui/alert.d.ts +8 -0
- package/dist/ui/alert.js +42 -0
- package/dist/ui/avatar.d.ts +6 -0
- package/dist/ui/avatar.js +32 -0
- package/dist/ui/badge.d.ts +10 -0
- package/dist/ui/badge.js +58 -0
- package/dist/ui/button.d.ts +12 -0
- package/dist/ui/button.js +54 -0
- package/dist/ui/calendar.d.ts +8 -0
- package/dist/ui/calendar.js +45 -0
- package/dist/ui/card.d.ts +8 -0
- package/dist/ui/card.js +45 -0
- package/dist/ui/checkbox.d.ts +12 -0
- package/dist/ui/checkbox.js +44 -0
- package/dist/ui/command.d.ts +47 -0
- package/dist/ui/command.js +67 -0
- package/dist/ui/dialog.d.ts +31 -0
- package/dist/ui/dialog.js +57 -0
- package/dist/ui/dropdown-menu.d.ts +27 -0
- package/dist/ui/dropdown-menu.js +72 -0
- package/dist/ui/form.d.ts +23 -0
- package/dist/ui/form.js +72 -0
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.js +29 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +20 -0
- package/dist/ui/label.d.ts +5 -0
- package/dist/ui/label.js +24 -0
- package/dist/ui/multi-select.d.ts +44 -0
- package/dist/ui/multi-select.js +191 -0
- package/dist/ui/navigation-menu.d.ts +11 -0
- package/dist/ui/navigation-menu.js +69 -0
- package/dist/ui/popover.d.ts +6 -0
- package/dist/ui/popover.js +24 -0
- package/dist/ui/radio-group.d.ts +7 -0
- package/dist/ui/radio-group.js +40 -0
- package/dist/ui/radioButtonCard.d.ts +9 -0
- package/dist/ui/radioButtonCard.js +23 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/scroll-area.js +29 -0
- package/dist/ui/select.d.ts +57 -0
- package/dist/ui/select.js +148 -0
- package/dist/ui/separator.d.ts +4 -0
- package/dist/ui/separator.js +22 -0
- package/dist/ui/sheet.d.ts +25 -0
- package/dist/ui/sheet.js +65 -0
- package/dist/ui/switch.d.ts +10 -0
- package/dist/ui/switch.js +47 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.js +55 -0
- package/dist/ui/tabs.d.ts +7 -0
- package/dist/ui/tabs.js +33 -0
- package/dist/ui/text.d.ts +11 -0
- package/dist/ui/text.js +45 -0
- package/dist/ui/textarea.d.ts +7 -0
- package/dist/ui/textarea.js +21 -0
- package/dist/ui/tooltip.d.ts +11 -0
- package/dist/ui/tooltip.js +26 -0
- package/package.json +123 -0
- package/postcss.config.js +6 -0
- package/src/assets/Arrow.js +5 -0
- package/src/assets/Arrow.tsx +25 -0
- package/src/assets/CalenderIcon.js +5 -0
- package/src/assets/CalenderIcon.tsx +28 -0
- package/src/assets/ClearAll.js +5 -0
- package/src/assets/ClearAll.tsx +20 -0
- package/src/assets/CrossIcon.js +7 -0
- package/src/assets/CrossIcon.tsx +34 -0
- package/src/assets/DropDown.js +5 -0
- package/src/assets/DropDown.tsx +23 -0
- package/src/global.css +560 -0
- package/src/index.ts +34 -0
- package/src/lib/CommonComponentsUtil.js +22 -0
- package/src/lib/CommonComponentsUtil.ts +30 -0
- package/src/lib/utils.js +5 -0
- package/src/lib/utils.ts +6 -0
- package/src/ui/BaseTable.js +330 -0
- package/src/ui/BaseTable.tsx +987 -0
- package/src/ui/DateCalendar.js +47 -0
- package/src/ui/DateCalendar.tsx +111 -0
- package/src/ui/DateField.js +37 -0
- package/src/ui/DateField.tsx +142 -0
- package/src/ui/DateOfBirthSelector.js +42 -0
- package/src/ui/DateOfBirthSelector.tsx +114 -0
- package/src/ui/DateRangePicker.js +73 -0
- package/src/ui/DateRangePicker.tsx +174 -0
- package/src/ui/DobCalendar.js +86 -0
- package/src/ui/DobCalendar.tsx +172 -0
- package/src/ui/Formfield.js +36 -0
- package/src/ui/Formfield.tsx +55 -0
- package/src/ui/GetScrollAlert.js +37 -0
- package/src/ui/GetScrollAlert.tsx +59 -0
- package/src/ui/RadioGroupContext/RadioGroupContext.js +11 -0
- package/src/ui/RadioGroupContext/RadioGroupContext.tsx +21 -0
- package/src/ui/SelectCommand.js +260 -0
- package/src/ui/SelectCommand.tsx +587 -0
- package/src/ui/SlashIcon.js +5 -0
- package/src/ui/SlashIcon.tsx +22 -0
- package/src/ui/SortingArrows.js +11 -0
- package/src/ui/SortingArrows.tsx +29 -0
- package/src/ui/TextTags.js +73 -0
- package/src/ui/TextTags.tsx +149 -0
- package/src/ui/accordion.js +77 -0
- package/src/ui/accordion.tsx +129 -0
- package/src/ui/alert-dialog.js +62 -0
- package/src/ui/alert-dialog.tsx +141 -0
- package/src/ui/alert.js +42 -0
- package/src/ui/alert.tsx +59 -0
- package/src/ui/avatar.js +32 -0
- package/src/ui/avatar.tsx +50 -0
- package/src/ui/badge.js +58 -0
- package/src/ui/badge.tsx +66 -0
- package/src/ui/button.js +54 -0
- package/src/ui/button.tsx +89 -0
- package/src/ui/calendar.js +45 -0
- package/src/ui/calendar.tsx +88 -0
- package/src/ui/card.js +45 -0
- package/src/ui/card.tsx +83 -0
- package/src/ui/checkbox.js +44 -0
- package/src/ui/checkbox.tsx +56 -0
- package/src/ui/command.js +67 -0
- package/src/ui/command.tsx +166 -0
- package/src/ui/dialog.js +57 -0
- package/src/ui/dialog.tsx +154 -0
- package/src/ui/dropdown-menu.js +72 -0
- package/src/ui/dropdown-menu.tsx +200 -0
- package/src/ui/form.js +72 -0
- package/src/ui/form.tsx +177 -0
- package/src/ui/hover-card.js +29 -0
- package/src/ui/hover-card.tsx +63 -0
- package/src/ui/input.js +20 -0
- package/src/ui/input.tsx +22 -0
- package/src/ui/label.js +24 -0
- package/src/ui/label.tsx +26 -0
- package/src/ui/multi-select.js +191 -0
- package/src/ui/multi-select.tsx +518 -0
- package/src/ui/navigation-menu.js +69 -0
- package/src/ui/navigation-menu.tsx +139 -0
- package/src/ui/popover.js +24 -0
- package/src/ui/popover.tsx +31 -0
- package/src/ui/radio-group.js +40 -0
- package/src/ui/radio-group.tsx +97 -0
- package/src/ui/radioButtonCard.js +23 -0
- package/src/ui/radioButtonCard.tsx +57 -0
- package/src/ui/scroll-area.js +29 -0
- package/src/ui/scroll-area.tsx +48 -0
- package/src/ui/select.js +148 -0
- package/src/ui/select.tsx +343 -0
- package/src/ui/separator.js +22 -0
- package/src/ui/separator.tsx +31 -0
- package/src/ui/sheet.js +65 -0
- package/src/ui/sheet.tsx +136 -0
- package/src/ui/switch.js +47 -0
- package/src/ui/switch.tsx +60 -0
- package/src/ui/table.js +55 -0
- package/src/ui/table.tsx +112 -0
- package/src/ui/tabs.js +33 -0
- package/src/ui/tabs.tsx +55 -0
- package/src/ui/text.js +45 -0
- package/src/ui/text.tsx +49 -0
- package/src/ui/textarea.js +21 -0
- package/src/ui/textarea.tsx +28 -0
- package/src/ui/tooltip.js +26 -0
- package/src/ui/tooltip.tsx +54 -0
- package/tailwind.config.js +214 -0
- package/tsconfig.json +35 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
5
|
+
declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
16
|
+
import { cn } from "../lib/utils";
|
|
17
|
+
const Avatar = React.forwardRef((_a, ref) => {
|
|
18
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
19
|
+
return (_jsx(AvatarPrimitive.Root, Object.assign({ ref: ref, className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className) }, props)));
|
|
20
|
+
});
|
|
21
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
22
|
+
const AvatarImage = React.forwardRef((_a, ref) => {
|
|
23
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
24
|
+
return (_jsx(AvatarPrimitive.Image, Object.assign({ ref: ref, className: cn("aspect-square h-full w-full", className) }, props)));
|
|
25
|
+
});
|
|
26
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
27
|
+
const AvatarFallback = React.forwardRef((_a, ref) => {
|
|
28
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
|
+
return (_jsx(AvatarPrimitive.Fallback, Object.assign({ ref: ref, className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className) }, props)));
|
|
30
|
+
});
|
|
31
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
32
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "primary" | "secondary" | "disable" | "success" | "danger" | "warning" | "outline" | "destructive" | "pending" | "border-primary" | "border-success" | "border-danger" | "border-warning" | "border-pending" | "border-disable" | "secondary-primary" | "secondary-success" | "secondary-danger" | "secondary-warning" | "secondary-pending" | "secondary-disable" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
8
|
+
}
|
|
9
|
+
declare function Badge({ className, variant, size, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Badge, badgeVariants };
|
package/dist/ui/badge.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
import { cn } from "../lib/utils";
|
|
15
|
+
const badgeVariants = cva("inline-flex items-center justify-center gap-[5px] whitespace-nowrap max-w-fit ", {
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
primary: "bg-primary-light text-primary",
|
|
19
|
+
success: "bg-green-light text-green",
|
|
20
|
+
danger: "bg-red-light text-red",
|
|
21
|
+
warning: "bg-yellow-light text-yellow",
|
|
22
|
+
pending: "bg-orange-light text-orange",
|
|
23
|
+
disable: "bg-grey2-light text-grey2",
|
|
24
|
+
"border-primary": "bg-primary-light border border-primary text-primary",
|
|
25
|
+
"border-success": "bg-green-light border border-green text-green",
|
|
26
|
+
"border-danger": "bg-red-light border border-red text-red",
|
|
27
|
+
"border-warning": "bg-yellow-light border border-yellow text-yellow",
|
|
28
|
+
"border-pending": "bg-orange-light border border-orange text-orange",
|
|
29
|
+
"border-disable": "bg-grey2-light border border-grey2 text-grey2",
|
|
30
|
+
"secondary-primary": "bg-white text-primary",
|
|
31
|
+
"secondary-success": "bg-white text-green",
|
|
32
|
+
"secondary-danger": "bg-white text-red",
|
|
33
|
+
"secondary-warning": "bg-white text-yellow",
|
|
34
|
+
"secondary-pending": "bg-white text-orange",
|
|
35
|
+
"secondary-disable": "bg-white text-grey2",
|
|
36
|
+
//TODO: Remove bellow styles after new design is implemented
|
|
37
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
38
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
39
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
40
|
+
outline: "text-foreground",
|
|
41
|
+
},
|
|
42
|
+
size: {
|
|
43
|
+
default: "h-6 px-2 py-2 rounded-full text-sm font-semibold",
|
|
44
|
+
sm: "h-7 px-3 py-2 rounded-full text-sm font-medium",
|
|
45
|
+
lg: "h-8 px-3 py-2 rounded-full text-sm font-medium",
|
|
46
|
+
xl: "h-9 px-3 py-2 rounded-full text-sm font-medium",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
defaultVariants: {
|
|
50
|
+
variant: "primary",
|
|
51
|
+
size: "default",
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
function Badge(_a) {
|
|
55
|
+
var { className, variant, size } = _a, props = __rest(_a, ["className", "variant", "size"]);
|
|
56
|
+
return (_jsx("div", Object.assign({ className: cn(badgeVariants({ variant, size }), className) }, props)));
|
|
57
|
+
}
|
|
58
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "primary" | "secondary" | "disable" | "success" | "danger" | "warning" | "outline" | "ghost" | "plain" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "xl" | "xs" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
14
|
+
import { cva } from "class-variance-authority";
|
|
15
|
+
import * as React from "react";
|
|
16
|
+
import { cn } from "../lib/utils";
|
|
17
|
+
const buttonVariants = cva("inline-flex items-center justify-center gap-1 whitespace-nowrap cursor-pointer disabled:cursor-not-allowed focus:outline-keyboardTab", {
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
primary: "bg-primary text-white",
|
|
21
|
+
secondary: "bg-white border border-primary text-primary ",
|
|
22
|
+
disable: "bg-grey2 text-white",
|
|
23
|
+
success: "bg-green text-white",
|
|
24
|
+
danger: "bg-red text-white",
|
|
25
|
+
warning: "bg-yellow text-white",
|
|
26
|
+
link: "bg-white text-primary",
|
|
27
|
+
// TODO: need to remove after implementing the new design
|
|
28
|
+
default: "bg-primary text-primary-foreground ",
|
|
29
|
+
outline: "border border-input bg-white ",
|
|
30
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
31
|
+
plain: "!px-0 !py-1 text-primary",
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
default: "h-10 px-6 py-3 rounded-xl text-base font-medium",
|
|
35
|
+
sm: "h-9 px-6 py-2 rounded-xl text-base font-medium",
|
|
36
|
+
lg: "h-11 px-6 py-3 rounded-xl text-base font-medium",
|
|
37
|
+
xl: "h-12 px-6 py-3 rounded-xl text-base font-medium",
|
|
38
|
+
xs: "px-2 py-2 rounded-xl text-base font-medium",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
variant: "primary",
|
|
43
|
+
size: "default",
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
const Button = React.forwardRef((_a, ref) => {
|
|
47
|
+
var { className, variant, size, asChild = false, isLoading = false, type = "button", // Default type set to "button"
|
|
48
|
+
children } = _a, props = __rest(_a, ["className", "variant", "size", "asChild", "isLoading", "type", "children"]);
|
|
49
|
+
const Comp = asChild ? Slot : "button";
|
|
50
|
+
return (_jsx(Comp, Object.assign({ className: cn(buttonVariants({ variant, size, className }), isLoading && "opacity-50"), ref: ref, disabled: isLoading || props.disabled, type: type }, props, { children: isLoading ? (_jsx("div", Object.assign({ className: "loader-small" }, { children: _jsx("div", { className: "loader" }) }))) : (children) })));
|
|
51
|
+
});
|
|
52
|
+
Button.displayName = "Button";
|
|
53
|
+
Button.displayName = "Button";
|
|
54
|
+
export { Button, buttonVariants };
|
|
@@ -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,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
15
|
+
import { DayPicker } from "react-day-picker";
|
|
16
|
+
import { cn } from "../lib/utils";
|
|
17
|
+
import { buttonVariants } from "./button";
|
|
18
|
+
import dayjs from "dayjs";
|
|
19
|
+
function Calendar(_a) {
|
|
20
|
+
var { className, classNames, showOutsideDays = true } = _a, props = __rest(_a, ["className", "classNames", "showOutsideDays"]);
|
|
21
|
+
return (_jsx(DayPicker, Object.assign({ weekStartsOn: 1, formatters: {
|
|
22
|
+
formatWeekdayName: (date, options) => {
|
|
23
|
+
return dayjs(date).format("ddd");
|
|
24
|
+
},
|
|
25
|
+
}, showOutsideDays: showOutsideDays, className: cn("p-3", className), classNames: Object.assign({ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0", month: "space-y-4", caption: "flex justify-center pt-1 relative items-center", caption_label: "text-sm font-medium", nav: "space-x-1 flex items-center", nav_button: cn(buttonVariants({ variant: "outline" }), "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"), nav_button_previous: "absolute left-1", nav_button_next: "absolute right-1", table: "w-full border-collapse space-y-1", head_row: "flex capitalize w-full text-sm", head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]", row: "flex w-full mt-2", cell: "h-9 w-9 text-center text-sm !rounded-full 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", day: cn(buttonVariants({ variant: "ghost" }), "h-9 w-9 p-0 font-normal aria-selected:opacity-100 text-[13px] !rounded-full"), day_range_end: "day-range-end", day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground", day_today: "bg-accent text-accent-foreground", day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30", day_disabled: "text-muted-foreground opacity-50", day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground", day_hidden: "invisible" }, classNames), components: {
|
|
26
|
+
IconLeft: (_a) => {
|
|
27
|
+
var props = __rest(_a, []);
|
|
28
|
+
return _jsx(ChevronLeft, { className: "h-4 w-4" });
|
|
29
|
+
},
|
|
30
|
+
IconRight: (_a) => {
|
|
31
|
+
var props = __rest(_a, []);
|
|
32
|
+
return _jsx(ChevronRight, { className: "h-4 w-4" });
|
|
33
|
+
},
|
|
34
|
+
CaptionLabel: (_a) => {
|
|
35
|
+
var props = __rest(_a, []);
|
|
36
|
+
// Extract the month from the props
|
|
37
|
+
const { displayMonth } = props;
|
|
38
|
+
const month = dayjs(displayMonth).format("MMMM");
|
|
39
|
+
const year = displayMonth.getFullYear();
|
|
40
|
+
return (_jsxs("div", Object.assign({ className: "flex flex-col items-center gap-1 font-semibold" }, { children: [_jsx("div", Object.assign({ className: "text-[16px] capitalize" }, { children: month })), _jsx("div", Object.assign({ className: "text-[12px] text-[#999999]" }, { children: year }))] })));
|
|
41
|
+
},
|
|
42
|
+
} }, props)));
|
|
43
|
+
}
|
|
44
|
+
Calendar.displayName = "Calendar";
|
|
45
|
+
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, };
|
package/dist/ui/card.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { cn } from "../lib/utils";
|
|
15
|
+
const Card = React.forwardRef((_a, ref) => {
|
|
16
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
|
+
return (_jsx("div", Object.assign({ ref: ref, className: cn("rounded-lg bg-white shadow-sm", className) }, props)));
|
|
18
|
+
});
|
|
19
|
+
Card.displayName = "Card";
|
|
20
|
+
const CardHeader = React.forwardRef((_a, ref) => {
|
|
21
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
22
|
+
return (_jsx("div", Object.assign({ ref: ref, className: cn("flex flex-col space-y-2 p-6", className) }, props)));
|
|
23
|
+
});
|
|
24
|
+
CardHeader.displayName = "CardHeader";
|
|
25
|
+
const CardTitle = React.forwardRef((_a, ref) => {
|
|
26
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
27
|
+
return (_jsx("h3", Object.assign({ ref: ref, className: cn("text-2xl font-semibold leading-none tracking-tight text-grey2-dark-active", className) }, props)));
|
|
28
|
+
});
|
|
29
|
+
CardTitle.displayName = "CardTitle";
|
|
30
|
+
const CardDescription = React.forwardRef((_a, ref) => {
|
|
31
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
32
|
+
return (_jsx("p", Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props)));
|
|
33
|
+
});
|
|
34
|
+
CardDescription.displayName = "CardDescription";
|
|
35
|
+
const CardContent = React.forwardRef((_a, ref) => {
|
|
36
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
37
|
+
return (_jsx("div", Object.assign({ ref: ref, className: cn("p-6 pt-0", className) }, props)));
|
|
38
|
+
});
|
|
39
|
+
CardContent.displayName = "CardContent";
|
|
40
|
+
const CardFooter = React.forwardRef((_a, ref) => {
|
|
41
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
42
|
+
return (_jsx("div", Object.assign({ ref: ref, className: cn("flex items-center p-6 pt-0", className) }, props)));
|
|
43
|
+
});
|
|
44
|
+
CardFooter.displayName = "CardFooter";
|
|
45
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const checkboxVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "lg" | "xl" | "md" | "xxl" | null | undefined;
|
|
6
|
+
error?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
+
interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants> {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { Checkbox, checkboxVariants };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
16
|
+
import { Check } from "lucide-react";
|
|
17
|
+
import { cva } from "class-variance-authority";
|
|
18
|
+
import { cn } from "../lib/utils";
|
|
19
|
+
// Define variants using CVA
|
|
20
|
+
const checkboxVariants = cva("m-1 flex items-center justify-center peer shrink-0 rounded-lg border focus:outline-keyboardTab leading-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white data-[state=checked]:border-transparent data-[state=unchecked]:border-gray-hover box-border", {
|
|
21
|
+
variants: {
|
|
22
|
+
size: {
|
|
23
|
+
sm: "h-4 w-4",
|
|
24
|
+
md: "h-5 w-5",
|
|
25
|
+
lg: "h-6 w-6",
|
|
26
|
+
xl: "h-7 w-7",
|
|
27
|
+
xxl: "h-8 w-8",
|
|
28
|
+
},
|
|
29
|
+
error: {
|
|
30
|
+
true: "border-red",
|
|
31
|
+
false: "border-gray-hover",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
size: "lg",
|
|
36
|
+
error: false,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const Checkbox = React.forwardRef((_a, ref) => {
|
|
40
|
+
var { className, size, error } = _a, props = __rest(_a, ["className", "size", "error"]);
|
|
41
|
+
return (_jsx(CheckboxPrimitive.Root, Object.assign({ ref: ref, className: cn(checkboxVariants({ size, error: !!error }), className) }, props, { children: _jsx(CheckboxPrimitive.Indicator, Object.assign({ className: "flex items-center justify-center text-current" }, { children: _jsx(Check, { className: "h-[80%] w-[80%] transition-transform duration-150" }) })) })));
|
|
42
|
+
});
|
|
43
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
44
|
+
export { Checkbox, checkboxVariants };
|
|
@@ -0,0 +1,47 @@
|
|
|
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.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
19
|
+
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "heading" | "value"> & {
|
|
28
|
+
heading?: React.ReactNode;
|
|
29
|
+
value?: string | undefined;
|
|
30
|
+
forceMount?: boolean | undefined;
|
|
31
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & {
|
|
33
|
+
alwaysRender?: boolean | undefined;
|
|
34
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect" | "disabled" | "value"> & {
|
|
38
|
+
disabled?: boolean | undefined;
|
|
39
|
+
onSelect?: ((value: string) => void) | undefined;
|
|
40
|
+
value?: string | undefined;
|
|
41
|
+
forceMount?: boolean | undefined;
|
|
42
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
declare const CommandShortcut: {
|
|
44
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
displayName: string;
|
|
46
|
+
};
|
|
47
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { Command as CommandPrimitive, useCommandState } from "cmdk";
|
|
16
|
+
import { Search } from "lucide-react";
|
|
17
|
+
import { cn } from "../lib/utils";
|
|
18
|
+
import { Dialog, DialogContent } from "./dialog";
|
|
19
|
+
import { Input } from "./input";
|
|
20
|
+
const Command = React.forwardRef((_a, ref) => {
|
|
21
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
22
|
+
return (_jsx(CommandPrimitive, Object.assign({ ref: ref, className: cn("flex h-full w-full flex-col overflow-hidden rounded-xl bg-popover text-popover-foreground", className) }, props)));
|
|
23
|
+
});
|
|
24
|
+
Command.displayName = CommandPrimitive.displayName;
|
|
25
|
+
const CommandDialog = (_a) => {
|
|
26
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
27
|
+
return (_jsx(Dialog, Object.assign({}, props, { children: _jsx(DialogContent, Object.assign({ className: "overflow-hidden p-0 shadow-lg" }, { children: _jsx(Command, Object.assign({ 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 })) })) })));
|
|
28
|
+
};
|
|
29
|
+
const CommandInput = React.forwardRef((_a, ref) => {
|
|
30
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
31
|
+
return (_jsxs("div", Object.assign({ className: "flex items-center border-none px-3", "cmdk-input-wrapper": "" }, { children: [_jsx(Input, Object.assign({ ref: ref, className: cn("flex h-11 w-full rounded-md bg-transparent px-2 py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className) }, props)), _jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 text-primary" })] })));
|
|
32
|
+
});
|
|
33
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
34
|
+
const CommandList = React.forwardRef((_a, ref) => {
|
|
35
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
36
|
+
return (_jsx(CommandPrimitive.List, Object.assign({ ref: ref, className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className) }, props)));
|
|
37
|
+
});
|
|
38
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
39
|
+
const CommandEmpty = React.forwardRef((_a, forwardedRef) => {
|
|
40
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
41
|
+
const render = useCommandState((state) => state.filtered.count === 0);
|
|
42
|
+
if (!render)
|
|
43
|
+
return null;
|
|
44
|
+
return (_jsx("div", Object.assign({ ref: forwardedRef, className: cn("py-6 text-center text-sm", className), "cmdk-empty": "", role: "presentation" }, props)));
|
|
45
|
+
});
|
|
46
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
47
|
+
const CommandGroup = React.forwardRef((_a, ref) => {
|
|
48
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
49
|
+
return (_jsx(CommandPrimitive.Group, Object.assign({ ref: ref, className: cn("overflow-hidden 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)));
|
|
50
|
+
});
|
|
51
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
52
|
+
const CommandSeparator = React.forwardRef((_a, ref) => {
|
|
53
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
54
|
+
return (_jsx(CommandPrimitive.Separator, Object.assign({ ref: ref, className: cn("-mx-1 h-px bg-border", className) }, props)));
|
|
55
|
+
});
|
|
56
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
57
|
+
const CommandItem = React.forwardRef((_a, ref) => {
|
|
58
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
59
|
+
return (_jsx(CommandPrimitive.Item, Object.assign({ ref: ref, className: cn("relative flex min-h-[44px] cursor-default select-none items-center px-5 py-1.5 text-sm font-semibold text-[#414141] outline-none hover:bg-[#7677F4]/10 aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[selected=true]:bg-accent data-[disabled]:opacity-50", className) }, props)));
|
|
60
|
+
});
|
|
61
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
62
|
+
const CommandShortcut = (_a) => {
|
|
63
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
64
|
+
return (_jsx("span", Object.assign({ className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className) }, props)));
|
|
65
|
+
};
|
|
66
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
67
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
/**
|
|
9
|
+
* Note: if content is overflowing the container, use max-h-[75vh] and overflow-y-scroll. in the main container inside DialogContent
|
|
10
|
+
*/
|
|
11
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
12
|
+
/**
|
|
13
|
+
* flag whether to display close icon or not
|
|
14
|
+
*/
|
|
15
|
+
closeIcon?: boolean | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Function to be passed when we click on close icon in dialog
|
|
18
|
+
*/
|
|
19
|
+
handleClickCloseButton?: (() => void) | undefined;
|
|
20
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
declare const DialogHeader: {
|
|
22
|
+
({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
declare const DialogFooter: {
|
|
26
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
30
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
31
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
15
|
+
import { X } from "lucide-react";
|
|
16
|
+
import * as React from "react";
|
|
17
|
+
import { cn } from "../lib/utils";
|
|
18
|
+
const Dialog = DialogPrimitive.Root;
|
|
19
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
20
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
21
|
+
const DialogClose = DialogPrimitive.Close;
|
|
22
|
+
const DialogOverlay = React.forwardRef((_a, ref) => {
|
|
23
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
24
|
+
return (_jsx(DialogPrimitive.Overlay, Object.assign({ ref: ref, className: cn("fixed inset-0 z-50 bg-black/20 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className) }, props)));
|
|
25
|
+
});
|
|
26
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
27
|
+
/**
|
|
28
|
+
* Note: if content is overflowing the container, use max-h-[75vh] and overflow-y-scroll. in the main container inside DialogContent
|
|
29
|
+
*/
|
|
30
|
+
const DialogContent = React.forwardRef((_a, ref) => {
|
|
31
|
+
var { className, children, closeIcon = true, handleClickCloseButton = () => { } } = _a, props = __rest(_a, ["className", "children", "closeIcon", "handleClickCloseButton"]);
|
|
32
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, Object.assign({ ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 max-h-[95vh] max-w-[95Vw] translate-x-[-50%] translate-y-[-50%] rounded-3xl bg-white p-6 shadow-sm duration-200 focus:outline-none 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%]", className) }, props, { children: [children, closeIcon && (_jsxs(DialogPrimitive.Close, Object.assign({ onClick: () => {
|
|
33
|
+
handleClickCloseButton();
|
|
34
|
+
}, className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground" }, { children: [_jsx(X, { className: "mt-1 h-6 w-6" }), _jsx("span", Object.assign({ className: "sr-only" }, { children: "Close" }))] })))] }))] }));
|
|
35
|
+
});
|
|
36
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
37
|
+
const DialogHeader = (_a) => {
|
|
38
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
39
|
+
return (_jsx("div", Object.assign({ className: cn("sticky top-0 mt-0 flex justify-center pb-2", className) }, props, { children: children })));
|
|
40
|
+
};
|
|
41
|
+
DialogHeader.displayName = "DialogHeader";
|
|
42
|
+
const DialogFooter = (_a) => {
|
|
43
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
44
|
+
return (_jsx("div", Object.assign({ className: cn("mb-1 flex flex-col-reverse justify-center sm:flex-row sm:space-x-2", className) }, props)));
|
|
45
|
+
};
|
|
46
|
+
DialogFooter.displayName = "DialogFooter";
|
|
47
|
+
const DialogTitle = React.forwardRef((_a, ref) => {
|
|
48
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
49
|
+
return (_jsx(DialogPrimitive.Title, Object.assign({ ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className) }, props)));
|
|
50
|
+
});
|
|
51
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
52
|
+
const DialogDescription = React.forwardRef((_a, ref) => {
|
|
53
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
54
|
+
return (_jsx(DialogPrimitive.Description, Object.assign({ ref: ref, className: cn("my-2 text-sm text-muted-foreground", className) }, props)));
|
|
55
|
+
});
|
|
56
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
57
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
inset?: boolean | undefined;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
inset?: boolean | undefined;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
20
|
+
inset?: boolean | undefined;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const DropdownMenuShortcut: {
|
|
24
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|