@allbluecn/ui 0.3.13 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-command-button.d.ts +10 -0
- package/dist/ai-command-button.js +12 -0
- package/dist/ai-stream-text.d.ts +9 -0
- package/dist/ai-stream-text.js +12 -0
- package/dist/alert-dialog.d.ts +20 -0
- package/dist/alert-dialog.js +101 -0
- package/dist/animated-theme-toggler.d.ts +11 -0
- package/dist/animated-theme-toggler.js +169 -0
- package/dist/auth-client.d.ts +27 -0
- package/dist/auth-client.js +86 -0
- package/dist/auth-layout.d.ts +14 -0
- package/dist/auth-layout.js +43 -0
- package/dist/avatar.d.ts +13 -0
- package/dist/avatar.js +51 -0
- package/dist/badge.d.ts +11 -0
- package/dist/badge.js +28 -0
- package/dist/button.d.ts +12 -0
- package/dist/button.js +48 -0
- package/dist/card.d.ts +13 -0
- package/dist/card.js +56 -0
- package/dist/checkbox.d.ts +6 -0
- package/dist/checkbox.js +22 -0
- package/dist/context-menu.d.ts +33 -0
- package/dist/context-menu.js +125 -0
- package/dist/dialog.d.ts +19 -0
- package/dist/dialog.js +95 -0
- package/dist/dropdown-menu.d.ts +31 -0
- package/dist/dropdown-menu.js +128 -0
- package/dist/empty.d.ts +13 -0
- package/dist/empty.js +59 -0
- package/dist/grid-pattern.d.ts +14 -0
- package/dist/grid-pattern.js +47 -0
- package/dist/icon-packs/index.d.ts +2 -0
- package/dist/icon-packs/index.js +4 -0
- package/dist/icon-packs/knowledge.d.ts +2 -0
- package/dist/icon-packs/knowledge.js +70 -0
- package/dist/icon-packs/prd.d.ts +2 -0
- package/dist/icon-packs/prd.js +86 -0
- package/dist/icon-packs/project.d.ts +2 -0
- package/dist/icon-packs/project.js +74 -0
- package/dist/icon-picker.d.ts +11 -0
- package/dist/icon-picker.js +39 -0
- package/dist/index-CQsbeClc.d.ts +17 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/input.d.ts +5 -0
- package/dist/input.js +14 -0
- package/dist/item.d.ts +25 -0
- package/dist/item.js +118 -0
- package/dist/kbd.d.ts +4 -0
- package/dist/kbd.js +12 -0
- package/dist/label.d.ts +6 -0
- package/dist/label.js +14 -0
- package/dist/layout-panel-top.d.ts +12 -0
- package/dist/layout-panel-top.js +127 -0
- package/dist/name-confirm-dialog.d.ts +15 -0
- package/dist/name-confirm-dialog.js +105 -0
- package/dist/nav-float-button.d.ts +12 -0
- package/dist/nav-float-button.js +249 -0
- package/dist/notion-avatar.d.ts +13 -0
- package/dist/notion-avatar.js +83 -0
- package/dist/placeholder-page.d.ts +10 -0
- package/dist/placeholder-page.js +28 -0
- package/dist/popover.d.ts +12 -0
- package/dist/popover.js +56 -0
- package/dist/reference-inline.d.ts +10 -0
- package/dist/reference-inline.js +35 -0
- package/dist/reference-search.d.ts +12 -0
- package/dist/reference-search.js +26 -0
- package/dist/resizable.d.ts +9 -0
- package/dist/resizable.js +28 -0
- package/dist/select.d.ts +17 -0
- package/dist/select.js +99 -0
- package/dist/separator.d.ts +6 -0
- package/dist/separator.js +17 -0
- package/dist/sheet.d.ts +16 -0
- package/dist/sheet.js +90 -0
- package/dist/sidebar.d.ts +71 -0
- package/dist/sidebar.js +369 -0
- package/dist/skeleton.d.ts +4 -0
- package/dist/skeleton.js +12 -0
- package/dist/sonner.d.ts +5 -0
- package/dist/sonner.js +19 -0
- package/dist/switch.d.ts +8 -0
- package/dist/switch.js +19 -0
- package/dist/textarea.d.ts +5 -0
- package/dist/textarea.js +13 -0
- package/dist/timezone-provider.d.ts +18 -0
- package/dist/timezone-provider.js +29 -0
- package/dist/tooltip.d.ts +9 -0
- package/dist/tooltip.js +35 -0
- package/dist/use-mobile.d.ts +4 -0
- package/dist/use-mobile.js +18 -0
- package/dist/user-avatar.d.ts +14 -0
- package/dist/user-avatar.js +34 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +8 -0
- package/package.json +178 -49
- package/src/ai-command-button.tsx +0 -36
- package/src/ai-stream-text.tsx +0 -37
- package/src/alert-dialog.tsx +0 -216
- package/src/animated-theme-toggler.tsx +0 -272
- package/src/auth-client.ts +0 -108
- package/src/auth-layout.tsx +0 -66
- package/src/avatar.tsx +0 -129
- package/src/badge.tsx +0 -66
- package/src/button.tsx +0 -84
- package/src/card.tsx +0 -120
- package/src/checkbox.tsx +0 -50
- package/src/context-menu.tsx +0 -280
- package/src/dialog.tsx +0 -183
- package/src/dropdown-menu.tsx +0 -286
- package/src/empty.tsx +0 -121
- package/src/grid-pattern.tsx +0 -87
- package/src/icon-packs/index.ts +0 -27
- package/src/icon-packs/knowledge.ts +0 -55
- package/src/icon-packs/prd.ts +0 -63
- package/src/icon-packs/project.ts +0 -59
- package/src/icon-picker.tsx +0 -68
- package/src/index.ts +0 -23
- package/src/input.tsx +0 -36
- package/src/item.tsx +0 -213
- package/src/kbd.tsx +0 -33
- package/src/label.tsx +0 -39
- package/src/layout-panel-top.tsx +0 -160
- package/src/name-confirm-dialog.tsx +0 -153
- package/src/nav-float-button.tsx +0 -301
- package/src/notion-avatar.tsx +0 -126
- package/src/placeholder-page.tsx +0 -42
- package/src/popover.tsx +0 -106
- package/src/reference-inline.tsx +0 -53
- package/src/reference-search.tsx +0 -52
- package/src/resizable.tsx +0 -67
- package/src/select.tsx +0 -207
- package/src/separator.tsx +0 -45
- package/src/sheet.tsx +0 -164
- package/src/sidebar.tsx +0 -708
- package/src/skeleton.tsx +0 -30
- package/src/sonner.tsx +0 -37
- package/src/switch.tsx +0 -48
- package/src/textarea.tsx +0 -35
- package/src/timezone-provider.tsx +0 -55
- package/src/tooltip.tsx +0 -72
- package/src/use-mobile.ts +0 -36
- package/src/user-avatar.tsx +0 -79
- package/src/utils.ts +0 -6
package/dist/button.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cn } from "./utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Slot } from "radix-ui";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
//#region src/button.tsx
|
|
7
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
11
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
13
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
14
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
15
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
19
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
20
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
21
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
22
|
+
icon: "size-8",
|
|
23
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
24
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
25
|
+
"icon-lg": "size-9"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
variant: "default",
|
|
30
|
+
size: "default"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
34
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
35
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
36
|
+
"data-slot": "button",
|
|
37
|
+
"data-variant": variant,
|
|
38
|
+
"data-size": size,
|
|
39
|
+
className: cn(buttonVariants({
|
|
40
|
+
variant,
|
|
41
|
+
size,
|
|
42
|
+
className
|
|
43
|
+
})),
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { Button, buttonVariants };
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/card.d.ts
|
|
3
|
+
declare function Card({ className, size, ...props }: React$1.ComponentProps<"div"> & {
|
|
4
|
+
size?: "default" | "sm";
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function CardHeader({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CardTitle({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function CardDescription({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function CardAction({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function CardContent({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function CardFooter({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn } from "./utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
//#region src/card.tsx
|
|
5
|
+
function Card({ className, size = "default", ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
"data-slot": "card",
|
|
8
|
+
"data-size": size,
|
|
9
|
+
className: cn("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function CardHeader({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("div", {
|
|
15
|
+
"data-slot": "card-header",
|
|
16
|
+
className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className),
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function CardTitle({ className, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx("div", {
|
|
22
|
+
"data-slot": "card-title",
|
|
23
|
+
className: cn("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className),
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function CardDescription({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
"data-slot": "card-description",
|
|
30
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function CardAction({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx("div", {
|
|
36
|
+
"data-slot": "card-action",
|
|
37
|
+
className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function CardContent({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
"data-slot": "card-content",
|
|
44
|
+
className: cn("px-(--card-spacing)", className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function CardFooter({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx("div", {
|
|
50
|
+
"data-slot": "card-footer",
|
|
51
|
+
className: cn("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)", className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Checkbox as Checkbox$1 } from "radix-ui";
|
|
3
|
+
//#region src/checkbox.d.ts
|
|
4
|
+
declare function Checkbox({ className, checked, ...props }: React$1.ComponentProps<typeof Checkbox$1.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { Checkbox };
|
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { cn } from "./utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Checkbox as Checkbox$1 } from "radix-ui";
|
|
5
|
+
import { CheckIcon, MinusIcon } from "lucide-react";
|
|
6
|
+
//#region src/checkbox.tsx
|
|
7
|
+
function Checkbox({ className, checked, ...props }) {
|
|
8
|
+
const indeterminate = checked === "indeterminate";
|
|
9
|
+
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
10
|
+
"data-slot": "checkbox",
|
|
11
|
+
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:border-primary/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground", className),
|
|
12
|
+
checked,
|
|
13
|
+
...props,
|
|
14
|
+
children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
|
|
15
|
+
"data-slot": "checkbox-indicator",
|
|
16
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
17
|
+
children: indeterminate ? /* @__PURE__ */ jsx(MinusIcon, {}) : /* @__PURE__ */ jsx(CheckIcon, {})
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Checkbox };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { ContextMenu as ContextMenu$1 } from "radix-ui";
|
|
3
|
+
//#region src/context-menu.d.ts
|
|
4
|
+
declare function ContextMenu({ ...props }: React$1.ComponentProps<typeof ContextMenu$1.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function ContextMenuTrigger({ className, ...props }: React$1.ComponentProps<typeof ContextMenu$1.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function ContextMenuGroup({ ...props }: React$1.ComponentProps<typeof ContextMenu$1.Group>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function ContextMenuPortal({ ...props }: React$1.ComponentProps<typeof ContextMenu$1.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function ContextMenuSub({ ...props }: React$1.ComponentProps<typeof ContextMenu$1.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function ContextMenuRadioGroup({ ...props }: React$1.ComponentProps<typeof ContextMenu$1.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function ContextMenuContent({ className, ...props }: React$1.ComponentProps<typeof ContextMenu$1.Content> & {
|
|
11
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function ContextMenuItem({ className, inset, variant, ...props }: React$1.ComponentProps<typeof ContextMenu$1.Item> & {
|
|
14
|
+
inset?: boolean;
|
|
15
|
+
variant?: "default" | "destructive";
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React$1.ComponentProps<typeof ContextMenu$1.SubTrigger> & {
|
|
18
|
+
inset?: boolean;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function ContextMenuSubContent({ className, ...props }: React$1.ComponentProps<typeof ContextMenu$1.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }: React$1.ComponentProps<typeof ContextMenu$1.CheckboxItem> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function ContextMenuRadioItem({ className, children, inset, ...props }: React$1.ComponentProps<typeof ContextMenu$1.RadioItem> & {
|
|
25
|
+
inset?: boolean;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare function ContextMenuLabel({ className, inset, ...props }: React$1.ComponentProps<typeof ContextMenu$1.Label> & {
|
|
28
|
+
inset?: boolean;
|
|
29
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare function ContextMenuSeparator({ className, ...props }: React$1.ComponentProps<typeof ContextMenu$1.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare function ContextMenuShortcut({ className, ...props }: React$1.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "./utils.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
import { ContextMenu as ContextMenu$1 } from "radix-ui";
|
|
6
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
7
|
+
//#region src/context-menu.tsx
|
|
8
|
+
function ContextMenu({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Root, {
|
|
10
|
+
"data-slot": "context-menu",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function ContextMenuTrigger({ className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Trigger, {
|
|
16
|
+
"data-slot": "context-menu-trigger",
|
|
17
|
+
className: cn("select-none", className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function ContextMenuGroup({ ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Group, {
|
|
23
|
+
"data-slot": "context-menu-group",
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function ContextMenuPortal({ ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Portal, {
|
|
29
|
+
"data-slot": "context-menu-portal",
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function ContextMenuSub({ ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Sub, {
|
|
35
|
+
"data-slot": "context-menu-sub",
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function ContextMenuRadioGroup({ ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.RadioGroup, {
|
|
41
|
+
"data-slot": "context-menu-radio-group",
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function ContextMenuContent({ className, ...props }) {
|
|
46
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Portal, { children: /* @__PURE__ */ jsx(ContextMenu$1.Content, {
|
|
47
|
+
"data-slot": "context-menu-content",
|
|
48
|
+
className: cn("z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
49
|
+
...props
|
|
50
|
+
}) });
|
|
51
|
+
}
|
|
52
|
+
function ContextMenuItem({ className, inset, variant = "default", ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Item, {
|
|
54
|
+
"data-slot": "context-menu-item",
|
|
55
|
+
"data-inset": inset,
|
|
56
|
+
"data-variant": variant,
|
|
57
|
+
className: cn("group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive", className),
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsxs(ContextMenu$1.SubTrigger, {
|
|
63
|
+
"data-slot": "context-menu-sub-trigger",
|
|
64
|
+
"data-inset": inset,
|
|
65
|
+
className: cn("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
66
|
+
...props,
|
|
67
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function ContextMenuSubContent({ className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.SubContent, {
|
|
72
|
+
"data-slot": "context-menu-sub-content",
|
|
73
|
+
className: cn("z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
78
|
+
return /* @__PURE__ */ jsxs(ContextMenu$1.CheckboxItem, {
|
|
79
|
+
"data-slot": "context-menu-checkbox-item",
|
|
80
|
+
"data-inset": inset,
|
|
81
|
+
className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
82
|
+
checked,
|
|
83
|
+
...props,
|
|
84
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
85
|
+
className: "pointer-events-none absolute right-2",
|
|
86
|
+
children: /* @__PURE__ */ jsx(ContextMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
87
|
+
}), children]
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function ContextMenuRadioItem({ className, children, inset, ...props }) {
|
|
91
|
+
return /* @__PURE__ */ jsxs(ContextMenu$1.RadioItem, {
|
|
92
|
+
"data-slot": "context-menu-radio-item",
|
|
93
|
+
"data-inset": inset,
|
|
94
|
+
className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
95
|
+
...props,
|
|
96
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
97
|
+
className: "pointer-events-none absolute right-2",
|
|
98
|
+
children: /* @__PURE__ */ jsx(ContextMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
99
|
+
}), children]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function ContextMenuLabel({ className, inset, ...props }) {
|
|
103
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Label, {
|
|
104
|
+
"data-slot": "context-menu-label",
|
|
105
|
+
"data-inset": inset,
|
|
106
|
+
className: cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", className),
|
|
107
|
+
...props
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function ContextMenuSeparator({ className, ...props }) {
|
|
111
|
+
return /* @__PURE__ */ jsx(ContextMenu$1.Separator, {
|
|
112
|
+
"data-slot": "context-menu-separator",
|
|
113
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
114
|
+
...props
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function ContextMenuShortcut({ className, ...props }) {
|
|
118
|
+
return /* @__PURE__ */ jsx("span", {
|
|
119
|
+
"data-slot": "context-menu-shortcut",
|
|
120
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground", className),
|
|
121
|
+
...props
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
package/dist/dialog.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Dialog as Dialog$1 } from "radix-ui";
|
|
3
|
+
//#region src/dialog.d.ts
|
|
4
|
+
declare function Dialog({ ...props }: React$1.ComponentProps<typeof Dialog$1.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogTrigger({ ...props }: React$1.ComponentProps<typeof Dialog$1.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DialogPortal({ ...props }: React$1.ComponentProps<typeof Dialog$1.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DialogClose({ ...props }: React$1.ComponentProps<typeof Dialog$1.Close>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DialogOverlay({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React$1.ComponentProps<typeof Dialog$1.Content> & {
|
|
10
|
+
showCloseButton?: boolean;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DialogHeader({ className, ...props }: React$1.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DialogFooter({ className, showCloseButton, children, ...props }: React$1.ComponentProps<"div"> & {
|
|
14
|
+
showCloseButton?: boolean;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function DialogTitle({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Title>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function DialogDescription({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Description>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
package/dist/dialog.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { cn } from "./utils.js";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
import { Dialog as Dialog$1 } from "radix-ui";
|
|
6
|
+
import { XIcon } from "lucide-react";
|
|
7
|
+
//#region src/dialog.tsx
|
|
8
|
+
function Dialog({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Dialog$1.Root, {
|
|
10
|
+
"data-slot": "dialog",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function DialogTrigger({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
|
|
16
|
+
"data-slot": "dialog-trigger",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function DialogPortal({ ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(Dialog$1.Portal, {
|
|
22
|
+
"data-slot": "dialog-portal",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function DialogClose({ ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
28
|
+
"data-slot": "dialog-close",
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function DialogOverlay({ className, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(Dialog$1.Overlay, {
|
|
34
|
+
"data-slot": "dialog-overlay",
|
|
35
|
+
className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog$1.Content, {
|
|
41
|
+
"data-slot": "dialog-content",
|
|
42
|
+
className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 dark:border dark:border-primary/15", className),
|
|
43
|
+
...props,
|
|
44
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
45
|
+
"data-slot": "dialog-close",
|
|
46
|
+
asChild: true,
|
|
47
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
48
|
+
variant: "ghost",
|
|
49
|
+
className: "absolute top-2 right-2",
|
|
50
|
+
size: "icon-sm",
|
|
51
|
+
children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: "sr-only",
|
|
53
|
+
children: "Close"
|
|
54
|
+
})]
|
|
55
|
+
})
|
|
56
|
+
})]
|
|
57
|
+
})] });
|
|
58
|
+
}
|
|
59
|
+
function DialogHeader({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx("div", {
|
|
61
|
+
"data-slot": "dialog-header",
|
|
62
|
+
className: cn("flex flex-col gap-2", className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function DialogFooter({ className, showCloseButton = false, children, ...props }) {
|
|
67
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
68
|
+
"data-slot": "dialog-footer",
|
|
69
|
+
className: cn("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end", className),
|
|
70
|
+
...props,
|
|
71
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
72
|
+
asChild: true,
|
|
73
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
74
|
+
variant: "outline",
|
|
75
|
+
children: "Close"
|
|
76
|
+
})
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function DialogTitle({ className, ...props }) {
|
|
81
|
+
return /* @__PURE__ */ jsx(Dialog$1.Title, {
|
|
82
|
+
"data-slot": "dialog-title",
|
|
83
|
+
className: cn("font-heading text-base leading-none font-medium", className),
|
|
84
|
+
...props
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function DialogDescription({ className, ...props }) {
|
|
88
|
+
return /* @__PURE__ */ jsx(Dialog$1.Description, {
|
|
89
|
+
"data-slot": "dialog-description",
|
|
90
|
+
className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
|
|
3
|
+
//#region src/dropdown-menu.d.ts
|
|
4
|
+
declare function DropdownMenu({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DropdownMenuPortal({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DropdownMenuTrigger({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Content>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DropdownMenuGroup({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Group>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Item> & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
variant?: "default" | "destructive";
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.CheckboxItem> & {
|
|
14
|
+
inset?: boolean;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function DropdownMenuRadioGroup({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.RadioItem> & {
|
|
18
|
+
inset?: boolean;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Label> & {
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function DropdownMenuSeparator({ className, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function DropdownMenuShortcut({ className, ...props }: React$1.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function DropdownMenuSub({ ...props }: React$1.ComponentProps<typeof DropdownMenu$1.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.SubTrigger> & {
|
|
27
|
+
inset?: boolean;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function DropdownMenuSubContent({ className, ...props }: React$1.ComponentProps<typeof DropdownMenu$1.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "./utils.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
|
|
6
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
7
|
+
//#region src/dropdown-menu.tsx
|
|
8
|
+
function DropdownMenu({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Root, {
|
|
10
|
+
"data-slot": "dropdown-menu",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function DropdownMenuPortal({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Portal, {
|
|
16
|
+
"data-slot": "dropdown-menu-portal",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, {
|
|
22
|
+
"data-slot": "dropdown-menu-trigger",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function DropdownMenuContent({ className, align = "start", sideOffset = 4, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Portal, { children: /* @__PURE__ */ jsx(DropdownMenu$1.Content, {
|
|
28
|
+
"data-slot": "dropdown-menu-content",
|
|
29
|
+
sideOffset,
|
|
30
|
+
align,
|
|
31
|
+
className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 dark:border dark:border-border dark:ring-0 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
32
|
+
...props
|
|
33
|
+
}) });
|
|
34
|
+
}
|
|
35
|
+
function DropdownMenuGroup({ ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Group, {
|
|
37
|
+
"data-slot": "dropdown-menu-group",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Item, {
|
|
43
|
+
"data-slot": "dropdown-menu-item",
|
|
44
|
+
"data-inset": inset,
|
|
45
|
+
"data-variant": variant,
|
|
46
|
+
className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:*:[svg]:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className),
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
51
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.CheckboxItem, {
|
|
52
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
53
|
+
"data-inset": inset,
|
|
54
|
+
className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:*:[svg]:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
55
|
+
checked,
|
|
56
|
+
...props,
|
|
57
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
58
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
59
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
60
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
61
|
+
}), children]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.RadioGroup, {
|
|
66
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function DropdownMenuRadioItem({ className, children, inset, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.RadioItem, {
|
|
72
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
73
|
+
"data-inset": inset,
|
|
74
|
+
className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:*:[svg]:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
75
|
+
...props,
|
|
76
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
77
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
78
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
79
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
80
|
+
}), children]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
84
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Label, {
|
|
85
|
+
"data-slot": "dropdown-menu-label",
|
|
86
|
+
"data-inset": inset,
|
|
87
|
+
className: cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", className),
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
92
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Separator, {
|
|
93
|
+
"data-slot": "dropdown-menu-separator",
|
|
94
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsx("span", {
|
|
100
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
101
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", className),
|
|
102
|
+
...props
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function DropdownMenuSub({ ...props }) {
|
|
106
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Sub, {
|
|
107
|
+
"data-slot": "dropdown-menu-sub",
|
|
108
|
+
...props
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
112
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.SubTrigger, {
|
|
113
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
114
|
+
"data-inset": inset,
|
|
115
|
+
className: cn("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:*:[svg]:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
116
|
+
...props,
|
|
117
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
121
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.SubContent, {
|
|
122
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
123
|
+
className: cn("z-50 min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 dark:border dark:border-border dark:ring-0 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
124
|
+
...props
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
package/dist/empty.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
//#region src/empty.d.ts
|
|
3
|
+
declare function Empty({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const emptyMediaVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "icon" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|