@erden-sh/ui 0.0.0-stage → 0.1.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/LICENSE +120 -0
- package/README.md +100 -2
- package/THIRD_PARTY_NOTICES +557 -0
- package/dist/components/access-review.d.ts +18 -0
- package/dist/components/access-review.js +7 -0
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert-dialog.js +41 -0
- package/dist/components/avatar.d.ts +12 -0
- package/dist/components/avatar.js +23 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/badge.js +34 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.js +28 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +38 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.js +31 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +9 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.js +13 -0
- package/dist/components/command.d.ts +20 -0
- package/dist/components/command.js +37 -0
- package/dist/components/copyable-code.d.ts +10 -0
- package/dist/components/copyable-code.js +58 -0
- package/dist/components/dialog.d.ts +19 -0
- package/dist/components/dialog.js +39 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/dropdown-menu.js +55 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +7 -0
- package/dist/components/native-select.d.ts +2 -0
- package/dist/components/native-select.js +5 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.js +17 -0
- package/dist/components/quick-actions.d.ts +13 -0
- package/dist/components/quick-actions.js +7 -0
- package/dist/components/return-focus.d.ts +6 -0
- package/dist/components/return-focus.js +26 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.js +11 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +38 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.js +8 -0
- package/dist/components/sheet.d.ts +14 -0
- package/dist/components/sheet.js +40 -0
- package/dist/components/sidebar.d.ts +75 -0
- package/dist/components/sidebar.js +271 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +7 -0
- package/dist/components/sonner.d.ts +3 -0
- package/dist/components/sonner.js +19 -0
- package/dist/components/switch.d.ts +4 -0
- package/dist/components/switch.js +8 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +28 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +29 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +7 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +17 -0
- package/dist/components/use-mobile.d.ts +1 -0
- package/dist/components/use-mobile.js +15 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +32 -0
- package/dist/styles.css +2 -0
- package/dist/styles.d.ts +1 -0
- package/dist/styles.js +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +6 -0
- package/package.json +67 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Avatar as AvatarPrimitive } from 'radix-ui';
|
|
4
|
+
import { cn } from '../utils.js';
|
|
5
|
+
function Avatar({ className, size = 'default', shape = 'circle', ...props }) {
|
|
6
|
+
return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn('group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6', shape === 'rounded' && 'rounded-lg', className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
function AvatarImage({ className, ...props }) {
|
|
9
|
+
return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn('aspect-square size-full object-cover', className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
function AvatarFallback({ className, ...props }) {
|
|
12
|
+
return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('flex size-full items-center justify-center rounded-[inherit] bg-muted text-sm font-medium text-muted-foreground group-data-[size=sm]/avatar:text-xs', className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
function AvatarBadge({ className, ...props }) {
|
|
15
|
+
return (_jsx("span", { "data-slot": "avatar-badge", className: cn('absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground ring-2 ring-background select-none', 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden', 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2', 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2', className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
function AvatarGroup({ className, ...props }) {
|
|
18
|
+
return (_jsx("div", { "data-slot": "avatar-group", className: cn('group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background', className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
function AvatarGroupCount({ className, ...props }) {
|
|
21
|
+
return (_jsx("div", { "data-slot": "avatar-group-count", className: cn('relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-medium text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3', className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "ghost" | "info" | "link" | "outline" | "secondary" | "success" | "warning" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { Slot } from 'radix-ui';
|
|
5
|
+
import { cn } from '../utils.js';
|
|
6
|
+
const badgeVariants = cva('inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[background-color,border-color,color] duration-150 ease-out motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring aria-invalid:border-destructive [&>svg]:pointer-events-none [&>svg]:size-3', {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: 'bg-primary text-primary-foreground [a&]:hover:bg-primary-hover',
|
|
10
|
+
secondary: 'bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
|
|
11
|
+
destructive: 'bg-destructive text-white dark:bg-destructive/60 [a&]:hover:bg-destructive/90',
|
|
12
|
+
outline: 'border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
|
|
13
|
+
ghost: '[a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
|
|
14
|
+
link: 'text-primary underline-offset-4 [a&]:hover:underline',
|
|
15
|
+
success: 'bg-(--status-success-bg) text-(--status-success-fg)',
|
|
16
|
+
warning: 'bg-(--status-warning-bg) text-(--status-warning-fg)',
|
|
17
|
+
info: 'bg-accent text-accent-foreground',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
compoundVariants: [
|
|
21
|
+
{
|
|
22
|
+
variant: ['success', 'warning', 'info'],
|
|
23
|
+
class: 'rounded-[6px] px-1.5 py-0.5 text-[11px] font-semibold before:size-1.5 before:rounded-full before:bg-current forced-colors:border-current',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: 'default',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
function Badge({ className, variant = 'default', asChild = false, ...props }) {
|
|
31
|
+
const Comp = asChild ? Slot.Root : 'span';
|
|
32
|
+
return (_jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Breadcrumb({ ...props }: React.ComponentProps<'nav'>): React.JSX.Element;
|
|
3
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>): React.JSX.Element;
|
|
4
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
5
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<'a'> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
9
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
10
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
11
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
4
|
+
import { Slot } from 'radix-ui';
|
|
5
|
+
import { cn } from '../utils.js';
|
|
6
|
+
function Breadcrumb({ ...props }) {
|
|
7
|
+
return _jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
8
|
+
}
|
|
9
|
+
function BreadcrumbList({ className, ...props }) {
|
|
10
|
+
return (_jsx("ol", { "data-slot": "breadcrumb-list", className: cn('flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5', className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
13
|
+
return _jsx("li", { "data-slot": "breadcrumb-item", className: cn('inline-flex items-center gap-1.5', className), ...props });
|
|
14
|
+
}
|
|
15
|
+
function BreadcrumbLink({ asChild, className, ...props }) {
|
|
16
|
+
const Comp = asChild ? Slot.Root : 'a';
|
|
17
|
+
return (_jsx(Comp, { "data-slot": "breadcrumb-link", className: cn('transition-colors hover:text-foreground', className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
20
|
+
return (_jsx("span", { "data-slot": "breadcrumb-page", role: "link", "aria-disabled": "true", "aria-current": "page", className: cn('font-normal text-foreground', className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
23
|
+
return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn('[&>svg]:size-3.5', className), ...props, children: children ?? _jsx(ChevronRight, {}) }));
|
|
24
|
+
}
|
|
25
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
26
|
+
return (_jsxs("span", { "data-slot": "breadcrumb-ellipsis", role: "presentation", "aria-hidden": "true", className: cn('flex size-9 items-center justify-center', className), ...props, children: [_jsx(MoreHorizontal, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More" })] }));
|
|
27
|
+
}
|
|
28
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xs" | "lg" | "sm" | "xs" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { Slot } from 'radix-ui';
|
|
5
|
+
import { cn } from '../utils.js';
|
|
6
|
+
const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color,box-shadow,scale] duration-150 ease-out motion-reduce:transition-none motion-safe:active:scale-[.98] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
// Hovered, pressed and disabled on the theme's shades (globals.css),
|
|
10
|
+
// never faded: its words stay 4.5:1 in each.
|
|
11
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary-hover active:bg-primary-hover disabled:bg-primary-disabled disabled:opacity-100',
|
|
12
|
+
destructive: 'bg-destructive text-white hover:bg-destructive/90 dark:bg-destructive/60',
|
|
13
|
+
outline: 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',
|
|
14
|
+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
15
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
|
16
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
|
|
20
|
+
xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
21
|
+
sm: 'h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5',
|
|
22
|
+
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
|
23
|
+
icon: 'size-9',
|
|
24
|
+
'icon-xs': "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
25
|
+
'icon-sm': 'size-8',
|
|
26
|
+
'icon-lg': 'size-10',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: 'default',
|
|
31
|
+
size: 'default',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
function Button({ className, variant = 'default', size = 'default', asChild = false, ...props }) {
|
|
35
|
+
const Comp = asChild ? Slot.Root : 'button';
|
|
36
|
+
return (_jsx(Comp, { "data-component": "button", "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
37
|
+
}
|
|
38
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Card({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
3
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
4
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
5
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
6
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
7
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
8
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
9
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../utils.js';
|
|
4
|
+
function Card({ className, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "card", className: cn('flex min-w-0 flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-xs', className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
// With an action the header has two columns, but the action takes the
|
|
8
|
+
// second only when the header is at least 28rem wide (@md/card-header);
|
|
9
|
+
// narrower, as on a phone, it goes under the description at full width
|
|
10
|
+
// (CB-262). A container can't query its own width, so CardAction places
|
|
11
|
+
// itself, the other children stay in the first column, and the column gap
|
|
12
|
+
// is the action's left padding: an empty second column takes no room.
|
|
13
|
+
function CardHeader({ className, ...props }) {
|
|
14
|
+
return (_jsx("div", { "data-slot": "card-header", className: cn('@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-y-2 px-6 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto] [.border-b]:pb-6 [&>:not([data-slot=card-action])]:col-start-1', className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
function CardTitle({ className, ...props }) {
|
|
17
|
+
return (_jsx("div", { "data-slot": "card-title", className: cn('leading-tight font-medium tracking-tight [overflow-wrap:anywhere]', className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function CardDescription({ className, ...props }) {
|
|
20
|
+
return (_jsx("div", { "data-slot": "card-description", className: cn('text-sm text-muted-foreground [overflow-wrap:anywhere]', className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function CardAction({ className, ...props }) {
|
|
23
|
+
return (_jsx("div", { "data-slot": "card-action", className: cn('col-span-full self-start @md/card-header:col-[2] @md/card-header:row-[1/span_2] @md/card-header:justify-self-end @md/card-header:pl-2', className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function CardContent({ className, ...props }) {
|
|
26
|
+
return _jsx("div", { "data-slot": "card-content", className: cn('px-6', className), ...props });
|
|
27
|
+
}
|
|
28
|
+
function CardFooter({ className, ...props }) {
|
|
29
|
+
return (_jsx("div", { "data-slot": "card-footer", className: cn('flex items-center px-6 [.border-t]:pt-6', className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, MinusIcon } from 'lucide-react';
|
|
4
|
+
import { Checkbox as CheckboxPrimitive } from 'radix-ui';
|
|
5
|
+
import { cn } from '../utils.js';
|
|
6
|
+
function Checkbox({ className, ...props }) {
|
|
7
|
+
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn('group/checkbox peer size-4 shrink-0 rounded-[4px] border border-muted-foreground transition-[background-color,border-color] duration-150 ease-out motion-reduce:transition-none outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive 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 dark:bg-input/30 dark:data-[state=checked]:bg-primary', className), ...props, children: _jsxs(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none", children: [_jsx(CheckIcon, { className: "size-3.5 group-data-[state=indeterminate]/checkbox:hidden" }), _jsx(MinusIcon, { className: "hidden size-3.5 group-data-[state=indeterminate]/checkbox:block" })] }) }));
|
|
8
|
+
}
|
|
9
|
+
export { Checkbox };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from 'radix-ui';
|
|
2
|
+
declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react").JSX.Element;
|
|
3
|
+
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react").JSX.Element;
|
|
4
|
+
declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react").JSX.Element;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Collapsible as CollapsiblePrimitive } from 'radix-ui';
|
|
4
|
+
function Collapsible({ ...props }) {
|
|
5
|
+
return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
6
|
+
}
|
|
7
|
+
function CollapsibleTrigger({ ...props }) {
|
|
8
|
+
return _jsx(CollapsiblePrimitive.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props });
|
|
9
|
+
}
|
|
10
|
+
function CollapsibleContent({ ...props }) {
|
|
11
|
+
return _jsx(CollapsiblePrimitive.CollapsibleContent, { "data-slot": "collapsible-content", ...props });
|
|
12
|
+
}
|
|
13
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Dialog } from './dialog.js';
|
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, commandProps, trigger, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
commandProps?: React.ComponentProps<typeof CommandPrimitive>;
|
|
11
|
+
trigger?: React.ReactElement;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
|
|
14
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
|
|
15
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
|
16
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
|
|
17
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
|
|
18
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
|
|
19
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
20
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
4
|
+
import { SearchIcon } from 'lucide-react';
|
|
5
|
+
import { cn } from '../utils.js';
|
|
6
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from './dialog.js';
|
|
7
|
+
function Command({ className, ...props }) {
|
|
8
|
+
return (_jsx(CommandPrimitive, { "data-slot": "command", className: cn('flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground', className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
// Local edits (keep them if the component is re-added with `shadcn add`):
|
|
11
|
+
// the title and description sit inside DialogContent (Radix warns
|
|
12
|
+
// otherwise), and `commandProps` reaches the Command (e.g. `shouldFilter`).
|
|
13
|
+
function CommandDialog({ title = 'Command Palette', description = 'Search for a command to run...', children, className, showCloseButton = true, commandProps, trigger, ...props }) {
|
|
14
|
+
return (_jsxs(Dialog, { ...props, children: [trigger && _jsx(DialogTrigger, { asChild: true, children: trigger }), _jsxs(DialogContent, { "data-content": "command", className: cn('overflow-hidden p-0', className), showCloseButton: showCloseButton, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(Command, { ...commandProps, className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[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 })] })] }));
|
|
15
|
+
}
|
|
16
|
+
function CommandInput({ className, ...props }) {
|
|
17
|
+
return (_jsxs("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3 has-focus-visible:ring-2 has-focus-visible:ring-ring has-focus-visible:ring-inset", children: [_jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn('flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] }));
|
|
18
|
+
}
|
|
19
|
+
function CommandList({ className, ...props }) {
|
|
20
|
+
return (_jsx(CommandPrimitive.List, { "data-slot": "command-list", className: cn('max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto', className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function CommandEmpty({ ...props }) {
|
|
23
|
+
return _jsx(CommandPrimitive.Empty, { "data-slot": "command-empty", className: "py-6 text-center text-sm", ...props });
|
|
24
|
+
}
|
|
25
|
+
function CommandGroup({ className, ...props }) {
|
|
26
|
+
return (_jsx(CommandPrimitive.Group, { "data-slot": "command-group", className: cn('overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground', className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
function CommandSeparator({ className, ...props }) {
|
|
29
|
+
return (_jsx(CommandPrimitive.Separator, { "data-slot": "command-separator", className: cn('-mx-1 h-px bg-border', className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
function CommandItem({ className, ...props }) {
|
|
32
|
+
return (_jsx(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[selected=true]:ring-2 data-[selected=true]:ring-ring data-[selected=true]:ring-inset [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
function CommandShortcut({ className, ...props }) {
|
|
35
|
+
return (_jsx("span", { "data-slot": "command-shortcut", className: cn('ml-auto text-xs tracking-widest text-muted-foreground', className), ...props }));
|
|
36
|
+
}
|
|
37
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface CopyableCodeProps {
|
|
2
|
+
readonly command: string;
|
|
3
|
+
readonly iconOnly?: boolean;
|
|
4
|
+
readonly copyLabel?: string;
|
|
5
|
+
readonly copiedLabel?: string;
|
|
6
|
+
readonly successMessage?: string;
|
|
7
|
+
readonly failureMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function CopyableCode({ command, iconOnly, copyLabel, copiedLabel, successMessage, failureMessage, }: CopyableCodeProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Check, Copy } from 'lucide-react';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { Button } from './button.js';
|
|
6
|
+
// #endregion Props
|
|
7
|
+
function copyOnHttp(command) {
|
|
8
|
+
const previousFocus = document.activeElement;
|
|
9
|
+
const field = document.createElement('textarea');
|
|
10
|
+
field.className = 'sr-only fixed top-0';
|
|
11
|
+
field.readOnly = true;
|
|
12
|
+
field.value = command;
|
|
13
|
+
document.body.append(field);
|
|
14
|
+
try {
|
|
15
|
+
field.select();
|
|
16
|
+
// The Clipboard API is unavailable on the HTTP preview and other insecure origins.
|
|
17
|
+
return document.execCommand('copy');
|
|
18
|
+
}
|
|
19
|
+
finally {
|
|
20
|
+
field.remove();
|
|
21
|
+
if (previousFocus instanceof HTMLElement) {
|
|
22
|
+
previousFocus.focus({ preventScroll: true });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function CopyableCode({ command, iconOnly = false, copyLabel = 'Copy', copiedLabel = 'Copied', successMessage = 'Copied to clipboard.', failureMessage = 'Copy unavailable. Select the code to copy it.', }) {
|
|
27
|
+
const [feedback, setFeedback] = useState('');
|
|
28
|
+
const copied = feedback === successMessage;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (feedback === '') {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
const timer = window.setTimeout(() => {
|
|
34
|
+
setFeedback('');
|
|
35
|
+
}, 3_000);
|
|
36
|
+
return () => {
|
|
37
|
+
window.clearTimeout(timer);
|
|
38
|
+
};
|
|
39
|
+
}, [feedback]);
|
|
40
|
+
async function copy() {
|
|
41
|
+
try {
|
|
42
|
+
if (window.isSecureContext) {
|
|
43
|
+
await navigator.clipboard.writeText(command);
|
|
44
|
+
}
|
|
45
|
+
else if (!copyOnHttp(command)) {
|
|
46
|
+
setFeedback(failureMessage);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
setFeedback(successMessage);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
setFeedback(failureMessage);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return (_jsxs("div", { "data-slot": "copyable-code", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2 rounded-md border border-border bg-muted p-1", "data-slot": "copyable-code-row", children: [_jsx("code", { className: "min-w-0 flex-1 wrap-anywhere px-2 py-1 font-mono text-sm select-all", children: command }), _jsxs(Button, { className: "copy-button min-h-11 min-w-11", onClick: () => {
|
|
56
|
+
void copy();
|
|
57
|
+
}, type: "button", children: [copied ? _jsx(Check, { "aria-hidden": "true" }) : _jsx(Copy, { "aria-hidden": "true" }), _jsx("span", { className: iconOnly ? 'sr-only' : undefined, children: copied ? copiedLabel : copyLabel })] })] }), _jsx("p", { "aria-live": "polite", className: "copy-feedback text-sm text-muted-foreground", children: feedback })] }));
|
|
58
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, overlayClassName, onCloseAutoFocus, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
/** Classes for the backdrop behind it (the app's lighter, blurred one). */
|
|
11
|
+
overlayClassName?: string;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
14
|
+
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<'div'> & {
|
|
15
|
+
showCloseButton?: boolean;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
18
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
19
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { XIcon } from 'lucide-react';
|
|
4
|
+
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
5
|
+
import { cn } from '../utils.js';
|
|
6
|
+
import { Button } from './button.js';
|
|
7
|
+
import { useReturnFocus } from './return-focus.js';
|
|
8
|
+
function Dialog({ ...props }) {
|
|
9
|
+
return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
10
|
+
}
|
|
11
|
+
function DialogTrigger({ ...props }) {
|
|
12
|
+
return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
13
|
+
}
|
|
14
|
+
function DialogPortal({ ...props }) {
|
|
15
|
+
return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
16
|
+
}
|
|
17
|
+
function DialogClose({ ...props }) {
|
|
18
|
+
return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
19
|
+
}
|
|
20
|
+
function DialogOverlay({ className, ...props }) {
|
|
21
|
+
return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn('fixed inset-0 z-50 bg-black/50 [--tw-animation-duration:150ms] data-[state=closed]:[--tw-animation-duration:100ms] ease-out motion-reduce:animate-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0', className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function DialogContent({ className, children, showCloseButton = true, overlayClassName, onCloseAutoFocus, ...props }) {
|
|
24
|
+
const closeAutoFocus = useReturnFocus(onCloseAutoFocus);
|
|
25
|
+
return (_jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [_jsx(DialogOverlay, { className: overlayClassName }), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn('fixed top-[50%] left-[50%] z-50 grid w-full max-h-[calc(100dvh-2rem)] max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-xl border bg-background p-6 shadow-lg outline-none [--tw-animation-duration:150ms] data-[state=closed]:[--tw-animation-duration:100ms] ease-out motion-reduce:animate-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg', className), onCloseAutoFocus: closeAutoFocus, ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "absolute top-4 right-4 rounded-xs opacity-70 pointer-coarse:after:absolute pointer-coarse:after:-inset-3.5 transition-opacity hover:opacity-100 motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
|
|
26
|
+
}
|
|
27
|
+
function DialogHeader({ className, ...props }) {
|
|
28
|
+
return (_jsx("div", { "data-slot": "dialog-header", className: cn('flex flex-col gap-2 text-center sm:text-left', className), ...props }));
|
|
29
|
+
}
|
|
30
|
+
function DialogFooter({ className, showCloseButton = false, children, ...props }) {
|
|
31
|
+
return (_jsxs("div", { "data-slot": "dialog-footer", className: cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Close" }) }))] }));
|
|
32
|
+
}
|
|
33
|
+
function DialogTitle({ className, ...props }) {
|
|
34
|
+
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn('text-lg leading-none font-semibold', className), ...props }));
|
|
35
|
+
}
|
|
36
|
+
function DialogDescription({ className, ...props }) {
|
|
37
|
+
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn('text-sm text-muted-foreground', className), ...props }));
|
|
38
|
+
}
|
|
39
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
variant?: 'default' | 'destructive';
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
|
13
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
14
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
25
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
|
|
5
|
+
import { cn } from '../utils.js';
|
|
6
|
+
function DropdownMenu({ ...props }) {
|
|
7
|
+
return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
8
|
+
}
|
|
9
|
+
function DropdownMenuPortal({ ...props }) {
|
|
10
|
+
return _jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
11
|
+
}
|
|
12
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
13
|
+
return _jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
14
|
+
}
|
|
15
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
16
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn('z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 [--tw-animation-duration:150ms] data-[state=closed]:[--tw-animation-duration:100ms] ease-out motion-reduce:animate-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0', className), ...props }) }));
|
|
17
|
+
}
|
|
18
|
+
function DropdownMenuGroup({ ...props }) {
|
|
19
|
+
return _jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
20
|
+
}
|
|
21
|
+
function DropdownMenuItem({ className, inset, variant = 'default', ...props }) {
|
|
22
|
+
return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant,
|
|
23
|
+
// The keyboard's item has a ring in the brand (3:1 or more on the
|
|
24
|
+
// menu, in both themes): its tint alone is 1.1:1. So do the other
|
|
25
|
+
// items here, a select's and a command list's.
|
|
26
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
29
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
|
|
30
|
+
}
|
|
31
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
32
|
+
return _jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
|
|
33
|
+
}
|
|
34
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
35
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
|
|
36
|
+
}
|
|
37
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
38
|
+
return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className), ...props }));
|
|
39
|
+
}
|
|
40
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
41
|
+
return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn('-mx-1 my-1 h-px bg-border', className), ...props }));
|
|
42
|
+
}
|
|
43
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
44
|
+
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn('ml-auto text-xs tracking-widest text-muted-foreground', className), ...props }));
|
|
45
|
+
}
|
|
46
|
+
function DropdownMenuSub({ ...props }) {
|
|
47
|
+
return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
48
|
+
}
|
|
49
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
50
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto size-4" })] }));
|
|
51
|
+
}
|
|
52
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
53
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn('z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 [--tw-animation-duration:150ms] data-[state=closed]:[--tw-animation-duration:100ms] ease-out motion-reduce:animate-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0', className), ...props }));
|
|
54
|
+
}
|
|
55
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../utils.js';
|
|
4
|
+
function Input({ className, type, ...props }) {
|
|
5
|
+
return (_jsx("input", { type: type, "data-slot": "input", className: cn('h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[background-color,border-color] duration-150 ease-out motion-reduce:transition-none outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30', 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-ring', 'aria-invalid:border-destructive', className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
export { Input };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../utils.js';
|
|
3
|
+
export function NativeSelect({ className, ...props }) {
|
|
4
|
+
return (_jsx("select", { "data-slot": "native-select", className: cn('min-h-9 max-w-full rounded-md border border-input bg-card px-3 py-2 text-sm text-card-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:opacity-50', className), ...props }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
|
|
6
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
|
|
7
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
4
|
+
import { cn } from '../utils.js';
|
|
5
|
+
function Popover({ ...props }) {
|
|
6
|
+
return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
7
|
+
}
|
|
8
|
+
function PopoverTrigger({ ...props }) {
|
|
9
|
+
return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
10
|
+
}
|
|
11
|
+
function PopoverContent({ className, align = 'center', sideOffset = 4, ...props }) {
|
|
12
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn('z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 [--tw-animation-duration:150ms] data-[state=closed]:[--tw-animation-duration:100ms] ease-out motion-reduce:animate-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0', className), ...props }) }));
|
|
13
|
+
}
|
|
14
|
+
function PopoverAnchor({ ...props }) {
|
|
15
|
+
return _jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
16
|
+
}
|
|
17
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { CommandDialog } from './command.js';
|
|
3
|
+
export type QuickActionsProps = Pick<ComponentProps<typeof CommandDialog>, 'open' | 'onOpenChange' | 'commandProps'> & {
|
|
4
|
+
trigger: ReactElement;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
searchLabel: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
emptyMessage: ReactNode;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/** A searchable dialog. The host supplies command groups, actions, and their labels. */
|
|
13
|
+
export declare function QuickActions({ trigger, title, description, searchLabel, placeholder, emptyMessage, children, ...dialog }: QuickActionsProps): import("react").JSX.Element;
|