@stackframe/stack-ui 2.6.19 → 2.6.20
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/CHANGELOG.md +8 -0
- package/dist/components/copy-button.d.ts +4 -2
- package/dist/components/copy-button.js +2 -2
- package/dist/components/data-table/data-table.d.ts +14 -16
- package/dist/components/data-table/data-table.js +36 -4
- package/dist/components/ui/accordion.d.ts +9 -3
- package/dist/components/ui/accordion.js +4 -4
- package/dist/components/ui/alert.d.ts +10 -4
- package/dist/components/ui/alert.js +4 -4
- package/dist/components/ui/avatar.d.ts +9 -3
- package/dist/components/ui/avatar.js +4 -4
- package/dist/components/ui/badge.d.ts +3 -1
- package/dist/components/ui/badge.js +2 -2
- package/dist/components/ui/breadcrumb.d.ts +17 -7
- package/dist/components/ui/breadcrumb.js +6 -6
- package/dist/components/ui/button.d.ts +3 -1
- package/dist/components/ui/button.js +3 -3
- package/dist/components/ui/card.d.ts +24 -8
- package/dist/components/ui/card.js +9 -9
- package/dist/components/ui/checkbox.d.ts +3 -1
- package/dist/components/ui/checkbox.js +2 -2
- package/dist/components/ui/command.d.ts +8 -72
- package/dist/components/ui/command.js +8 -8
- package/dist/components/ui/context-menu.d.ts +27 -11
- package/dist/components/ui/context-menu.js +9 -9
- package/dist/components/ui/dialog.d.ts +12 -4
- package/dist/components/ui/dialog.js +5 -5
- package/dist/components/ui/dropdown-menu.d.ts +30 -12
- package/dist/components/ui/dropdown-menu.js +10 -9
- package/dist/components/ui/form.d.ts +15 -5
- package/dist/components/ui/form.js +6 -5
- package/dist/components/ui/hover-card.d.ts +3 -1
- package/dist/components/ui/hover-card.js +2 -2
- package/dist/components/ui/inline-code.d.ts +3 -1
- package/dist/components/ui/inline-code.js +2 -2
- package/dist/components/ui/input-otp.d.ts +12 -29
- package/dist/components/ui/input-otp.js +5 -4
- package/dist/components/ui/input.d.ts +6 -2
- package/dist/components/ui/input.js +3 -2
- package/dist/components/ui/label.d.ts +6 -2
- package/dist/components/ui/label.js +3 -3
- package/dist/components/ui/menubar.d.ts +4 -5
- package/dist/components/ui/menubar.js +2 -1
- package/dist/components/ui/navigation-menu.d.ts +18 -6
- package/dist/components/ui/navigation-menu.js +7 -7
- package/dist/components/ui/password-input.d.ts +3 -1
- package/dist/components/ui/password-input.js +3 -2
- package/dist/components/ui/popover.d.ts +3 -1
- package/dist/components/ui/popover.js +2 -2
- package/dist/components/ui/progress.d.ts +3 -1
- package/dist/components/ui/progress.js +2 -2
- package/dist/components/ui/radio-group.d.ts +6 -2
- package/dist/components/ui/radio-group.js +3 -3
- package/dist/components/ui/scroll-area.d.ts +6 -2
- package/dist/components/ui/scroll-area.js +3 -3
- package/dist/components/ui/select.d.ts +21 -7
- package/dist/components/ui/select.js +8 -8
- package/dist/components/ui/separator.d.ts +3 -1
- package/dist/components/ui/separator.js +2 -2
- package/dist/components/ui/sheet.d.ts +12 -4
- package/dist/components/ui/sheet.js +5 -5
- package/dist/components/ui/slider.d.ts +3 -1
- package/dist/components/ui/slider.js +2 -2
- package/dist/components/ui/spinner.d.ts +3 -1
- package/dist/components/ui/spinner.js +2 -2
- package/dist/components/ui/switch.d.ts +3 -1
- package/dist/components/ui/switch.js +3 -3
- package/dist/components/ui/table.d.ts +24 -8
- package/dist/components/ui/table.js +9 -9
- package/dist/components/ui/tabs.d.ts +9 -3
- package/dist/components/ui/tabs.js +4 -4
- package/dist/components/ui/textarea.d.ts +3 -1
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/toast.d.ts +19 -7
- package/dist/components/ui/toast.js +7 -7
- package/dist/components/ui/toggle-group.d.ts +8 -4
- package/dist/components/ui/toggle-group.js +3 -2
- package/dist/components/ui/toggle.d.ts +4 -2
- package/dist/components/ui/toggle.js +2 -2
- package/dist/components/ui/tooltip.d.ts +6 -2
- package/dist/components/ui/tooltip.js +3 -3
- package/dist/components/ui/typography.d.ts +3 -1
- package/dist/components/ui/typography.js +2 -2
- package/package.json +52 -44
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const CopyButton: React.
|
|
2
|
+
declare const CopyButton: React.FC<import("./ui/button").ButtonProps & {
|
|
3
|
+
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
4
|
+
} & {
|
|
3
5
|
content: string;
|
|
4
|
-
}
|
|
6
|
+
}>;
|
|
5
7
|
export { CopyButton };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Copy } from "lucide-react";
|
|
4
|
-
import
|
|
4
|
+
import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
|
|
5
5
|
import { Button, cn, useToast } from "..";
|
|
6
|
-
const CopyButton =
|
|
6
|
+
const CopyButton = forwardRefIfNeeded((props, ref) => {
|
|
7
7
|
const { toast } = useToast();
|
|
8
8
|
return (_jsx(Button, { variant: "secondary", ...props, className: cn("h-6 w-6 p-1", props.className), ref: ref, onClick: async (...args) => {
|
|
9
9
|
await props.onClick?.(...args);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnDef, ColumnFiltersState,
|
|
1
|
+
import { ColumnDef, ColumnFiltersState, SortingState, Table as TableType, VisibilityState } from "@tanstack/react-table";
|
|
2
2
|
import React from "react";
|
|
3
3
|
export declare function TableView<TData, TValue>(props: {
|
|
4
4
|
table: TableType<TData>;
|
|
@@ -10,22 +10,20 @@ type DataTableProps<TData, TValue> = {
|
|
|
10
10
|
data: TData[];
|
|
11
11
|
toolbarRender?: (table: TableType<TData>) => React.ReactNode;
|
|
12
12
|
defaultVisibility?: VisibilityState;
|
|
13
|
-
|
|
13
|
+
defaultColumnFilters?: ColumnFiltersState;
|
|
14
14
|
defaultSorting?: SortingState;
|
|
15
15
|
};
|
|
16
|
-
export declare function DataTable<TData, TValue>({ columns, data, toolbarRender, defaultVisibility,
|
|
17
|
-
type
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
globalFilter?: any;
|
|
28
|
-
setGlobalFilter?: OnChangeFn<any>;
|
|
16
|
+
export declare function DataTable<TData, TValue>({ columns, data, toolbarRender, defaultVisibility, defaultColumnFilters, defaultSorting, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
type DataTableManualPaginationProps<TData, TValue> = DataTableProps<TData, TValue> & {
|
|
18
|
+
onUpdate: (options: {
|
|
19
|
+
cursor: string;
|
|
20
|
+
limit: number;
|
|
21
|
+
sorting: SortingState;
|
|
22
|
+
columnFilters: ColumnFiltersState;
|
|
23
|
+
globalFilters: any;
|
|
24
|
+
}) => Promise<{
|
|
25
|
+
nextCursor: string | null;
|
|
26
|
+
}>;
|
|
29
27
|
};
|
|
30
|
-
export declare function
|
|
28
|
+
export declare function DataTableManualPagination<TData, TValue>({ columns, data, toolbarRender, defaultVisibility, defaultColumnFilters, defaultSorting, onUpdate, }: DataTableManualPaginationProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
31
29
|
export {};
|
|
@@ -12,17 +12,49 @@ export function TableView(props) {
|
|
|
12
12
|
: flexRender(header.column.columnDef.header, header.getContext()) }, header.id));
|
|
13
13
|
}) }, headerGroup.id))) }), _jsx(TableBody, { children: props.table.getRowModel().rows.length ? (props.table.getRowModel().rows.map((row) => (_jsx(TableRow, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: props.columns.length, className: "h-24 text-center", children: "No results." }) })) })] }) }), _jsx(DataTablePagination, { table: props.table })] }));
|
|
14
14
|
}
|
|
15
|
-
export function DataTable({ columns, data, toolbarRender, defaultVisibility,
|
|
15
|
+
export function DataTable({ columns, data, toolbarRender, defaultVisibility, defaultColumnFilters, defaultSorting, }) {
|
|
16
16
|
const [sorting, setSorting] = React.useState(defaultSorting || []);
|
|
17
|
-
const [columnFilters, setColumnFilters] = React.useState(
|
|
17
|
+
const [columnFilters, setColumnFilters] = React.useState(defaultColumnFilters || []);
|
|
18
18
|
const [pagination, setPagination] = React.useState({
|
|
19
19
|
pageIndex: 0,
|
|
20
20
|
pageSize: 10,
|
|
21
21
|
});
|
|
22
22
|
const [globalFilter, setGlobalFilter] = React.useState();
|
|
23
|
-
return _jsx(
|
|
23
|
+
return _jsx(DataTableBase, { columns: columns, data: data, toolbarRender: toolbarRender, defaultVisibility: defaultVisibility, sorting: sorting, setSorting: setSorting, columnFilters: columnFilters, setColumnFilters: setColumnFilters, manualPagination: false, manualFiltering: false, pagination: pagination, setPagination: setPagination, globalFilter: globalFilter, setGlobalFilter: setGlobalFilter });
|
|
24
24
|
}
|
|
25
|
-
export function
|
|
25
|
+
export function DataTableManualPagination({ columns, data, toolbarRender, defaultVisibility, defaultColumnFilters, defaultSorting, onUpdate, }) {
|
|
26
|
+
const [sorting, setSorting] = React.useState(defaultSorting || []);
|
|
27
|
+
const [pagination, setPagination] = React.useState({ pageIndex: 0, pageSize: 10 });
|
|
28
|
+
const [cursors, setCursors] = React.useState({});
|
|
29
|
+
const [columnFilters, setColumnFilters] = React.useState(defaultColumnFilters || []);
|
|
30
|
+
const [globalFilter, setGlobalFilter] = React.useState();
|
|
31
|
+
const [refreshCounter, setRefreshCounter] = React.useState(0);
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
onUpdate({
|
|
34
|
+
cursor: cursors[pagination.pageIndex],
|
|
35
|
+
limit: pagination.pageSize,
|
|
36
|
+
sorting,
|
|
37
|
+
columnFilters,
|
|
38
|
+
globalFilters: globalFilter,
|
|
39
|
+
}).then(({ nextCursor }) => {
|
|
40
|
+
setCursors(c => nextCursor ? { ...c, [pagination.pageIndex + 1]: nextCursor } : c);
|
|
41
|
+
}).catch(console.error);
|
|
42
|
+
}, [pagination, sorting, columnFilters, refreshCounter]);
|
|
43
|
+
// Reset to first page when filters change
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
setPagination(pagination => ({ ...pagination, pageIndex: 0 }));
|
|
46
|
+
setCursors({});
|
|
47
|
+
}, [columnFilters, sorting, pagination.pageSize]);
|
|
48
|
+
// Refresh the users when the global filter changes. Delay to prevent unnecessary re-renders.
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
const timer = setTimeout(() => {
|
|
51
|
+
setRefreshCounter(x => x + 1);
|
|
52
|
+
}, 500);
|
|
53
|
+
return () => clearTimeout(timer);
|
|
54
|
+
}, [globalFilter]);
|
|
55
|
+
return _jsx(DataTableBase, { columns: columns, data: data, toolbarRender: toolbarRender, sorting: sorting, setSorting: setSorting, pagination: pagination, setPagination: setPagination, columnFilters: columnFilters, setColumnFilters: setColumnFilters, rowCount: pagination.pageSize * Object.keys(cursors).length + (cursors[pagination.pageIndex + 1] ? 1 : 0), globalFilter: globalFilter, setGlobalFilter: setGlobalFilter, defaultColumnFilters: defaultColumnFilters, defaultSorting: defaultSorting, defaultVisibility: defaultVisibility });
|
|
56
|
+
}
|
|
57
|
+
function DataTableBase({ columns, data, toolbarRender, defaultVisibility, sorting, setSorting, pagination, setPagination, rowCount, columnFilters, setColumnFilters, globalFilter, setGlobalFilter, manualPagination = true, manualFiltering = true, }) {
|
|
26
58
|
const [rowSelection, setRowSelection] = React.useState({});
|
|
27
59
|
const [columnVisibility, setColumnVisibility] = React.useState(defaultVisibility || {});
|
|
28
60
|
const table = useReactTable({
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
3
|
declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
-
declare const AccordionItem: React.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare const AccordionItem: React.FC<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
5
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
6
|
+
}>;
|
|
7
|
+
declare const AccordionTrigger: React.FC<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
8
|
+
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
declare const AccordionContent: React.FC<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
11
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
12
|
+
}>;
|
|
7
13
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
|
|
4
4
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
5
5
|
import { ChevronDownIcon } from "@radix-ui/react-icons";
|
|
6
6
|
import { cn } from "../../lib/utils";
|
|
7
7
|
const Accordion = AccordionPrimitive.Root;
|
|
8
|
-
const AccordionItem =
|
|
8
|
+
const AccordionItem = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(AccordionPrimitive.Item, { ref: ref, className: cn("border-b", className), ...props })));
|
|
9
9
|
AccordionItem.displayName = "AccordionItem";
|
|
10
|
-
const AccordionTrigger =
|
|
10
|
+
const AccordionTrigger = forwardRefIfNeeded(({ className, children, disabled, ...props }, ref) => (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { ref: ref, className: cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className), ...props, children: [children, !disabled && _jsx(ChevronDownIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })] }) })));
|
|
11
11
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
12
|
-
const AccordionContent =
|
|
12
|
+
const AccordionContent = forwardRefIfNeeded(({ className, children, ...props }, ref) => (_jsx(AccordionPrimitive.Content, { ref: ref, className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", ...props, children: _jsx("div", { className: cn("pb-4 pt-0", className), children: children }) })));
|
|
13
13
|
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
14
14
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
|
-
declare const Alert: React.
|
|
3
|
+
declare const Alert: React.FC<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
4
|
variant?: "default" | "destructive" | "success" | null | undefined;
|
|
5
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string> &
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
6
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
7
|
+
}>;
|
|
8
|
+
declare const AlertTitle: React.FC<React.HTMLAttributes<HTMLHeadingElement> & {
|
|
9
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
declare const AlertDescription: React.FC<React.HTMLAttributes<HTMLParagraphElement> & {
|
|
12
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
13
|
+
}>;
|
|
8
14
|
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
5
5
|
const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", {
|
|
@@ -14,10 +14,10 @@ const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm [
|
|
|
14
14
|
variant: "default",
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
|
-
const Alert =
|
|
17
|
+
const Alert = forwardRefIfNeeded(({ className, variant, ...props }, ref) => (_jsx("div", { ref: ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props })));
|
|
18
18
|
Alert.displayName = "Alert";
|
|
19
|
-
const AlertTitle =
|
|
19
|
+
const AlertTitle = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("h5", { ref: ref, className: cn("mb-1 font-medium leading-none tracking-tight", className), ...props })));
|
|
20
20
|
AlertTitle.displayName = "AlertTitle";
|
|
21
|
-
const AlertDescription =
|
|
21
|
+
const AlertDescription = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("text-sm [&_p]:leading-relaxed", className), ...props })));
|
|
22
22
|
AlertDescription.displayName = "AlertDescription";
|
|
23
23
|
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
-
declare const Avatar: React.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
declare const Avatar: React.FC<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & {
|
|
4
|
+
ref?: React.Ref<HTMLSpanElement> | undefined;
|
|
5
|
+
}>;
|
|
6
|
+
declare const AvatarImage: React.FC<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & {
|
|
7
|
+
ref?: React.Ref<HTMLImageElement> | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
declare const AvatarFallback: React.FC<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & {
|
|
10
|
+
ref?: React.Ref<HTMLSpanElement> | undefined;
|
|
11
|
+
}>;
|
|
6
12
|
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
|
|
4
4
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
5
5
|
import { cn } from "../../lib/utils";
|
|
6
|
-
const Avatar =
|
|
6
|
+
const Avatar = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Root, { ref: ref, className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className), ...props })));
|
|
7
7
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
8
|
-
const AvatarImage =
|
|
8
|
+
const AvatarImage = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Image, { ref: ref, className: cn("aspect-square h-full w-full", className), ...props })));
|
|
9
9
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
10
|
-
const AvatarFallback =
|
|
10
|
+
const AvatarFallback = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Fallback, { ref: ref, className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className), ...props })));
|
|
11
11
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
12
12
|
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -5,5 +5,7 @@ declare const badgeVariants: (props?: ({
|
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
7
|
}
|
|
8
|
-
declare const Badge: React.
|
|
8
|
+
declare const Badge: React.FC<BadgeProps & {
|
|
9
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
10
|
+
}>;
|
|
9
11
|
export { Badge, badgeVariants };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
5
5
|
const badgeVariants = cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
|
|
@@ -15,7 +15,7 @@ const badgeVariants = cva("inline-flex items-center rounded-md border px-2.5 py-
|
|
|
15
15
|
variant: "default",
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
|
-
const Badge =
|
|
18
|
+
const Badge = forwardRefIfNeeded(({ className, variant, ...props }, ref) => {
|
|
19
19
|
return (_jsx("div", { ref: ref, className: cn(badgeVariants({ variant }), className), ...props }));
|
|
20
20
|
});
|
|
21
21
|
Badge.displayName = "Badge";
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const Breadcrumb: React.
|
|
2
|
+
declare const Breadcrumb: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
3
3
|
separator?: React.ReactNode;
|
|
4
|
-
} &
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const
|
|
4
|
+
} & {
|
|
5
|
+
ref?: React.Ref<HTMLElement> | undefined;
|
|
6
|
+
}>;
|
|
7
|
+
declare const BreadcrumbList: React.FC<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & {
|
|
8
|
+
ref?: React.Ref<HTMLOListElement> | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
declare const BreadcrumbItem: React.FC<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
11
|
+
ref?: React.Ref<HTMLLIElement> | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
declare const BreadcrumbLink: React.FC<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
8
14
|
asChild?: boolean | undefined;
|
|
9
|
-
} &
|
|
10
|
-
|
|
15
|
+
} & {
|
|
16
|
+
ref?: React.Ref<HTMLAnchorElement> | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
declare const BreadcrumbPage: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
19
|
+
ref?: React.Ref<HTMLSpanElement> | undefined;
|
|
20
|
+
}>;
|
|
11
21
|
declare const BreadcrumbSeparator: {
|
|
12
22
|
({ children, className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
13
23
|
displayName: string;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
|
|
3
3
|
import { ChevronRightIcon, DotsHorizontalIcon } from "@radix-ui/react-icons";
|
|
4
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
5
|
import { cn } from "../../lib/utils";
|
|
6
|
-
const Breadcrumb =
|
|
6
|
+
const Breadcrumb = forwardRefIfNeeded(({ ...props }, ref) => _jsx("nav", { ref: ref, "aria-label": "breadcrumb", ...props }));
|
|
7
7
|
Breadcrumb.displayName = "Breadcrumb";
|
|
8
|
-
const BreadcrumbList =
|
|
8
|
+
const BreadcrumbList = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("ol", { ref: ref, className: cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className), ...props })));
|
|
9
9
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
10
|
-
const BreadcrumbItem =
|
|
10
|
+
const BreadcrumbItem = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("li", { ref: ref, className: cn("inline-flex items-center gap-1.5", className), ...props })));
|
|
11
11
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
12
|
-
const BreadcrumbLink =
|
|
12
|
+
const BreadcrumbLink = forwardRefIfNeeded(({ asChild, className, ...props }, ref) => {
|
|
13
13
|
const Comp = asChild ? Slot : "a";
|
|
14
14
|
return (_jsx(Comp, { ref: ref, className: cn("hover:text-foreground", className), ...props }));
|
|
15
15
|
});
|
|
16
16
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
17
|
-
const BreadcrumbPage =
|
|
17
|
+
const BreadcrumbPage = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("span", { ref: ref, role: "link", "aria-disabled": "true", "aria-current": "page", className: cn("font-normal text-foreground", className), ...props })));
|
|
18
18
|
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
19
19
|
const BreadcrumbSeparator = ({ children, className, ...props }) => (_jsx("li", { role: "presentation", "aria-hidden": "true", className: cn("[&>svg]:size-3.5", className), ...props, children: children ?? _jsx(ChevronRightIcon, {}) }));
|
|
20
20
|
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
@@ -11,5 +11,7 @@ interface ButtonProps extends OriginalButtonProps {
|
|
|
11
11
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>;
|
|
12
12
|
loading?: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare const Button: React.
|
|
14
|
+
declare const Button: React.FC<ButtonProps & {
|
|
15
|
+
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
16
|
+
}>;
|
|
15
17
|
export { Button, buttonVariants, ButtonProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { cn } from "../../lib/utils";
|
|
@@ -28,12 +28,12 @@ const buttonVariants = cva("inline-flex items-center justify-center whitespace-n
|
|
|
28
28
|
size: "default",
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
|
-
const OriginalButton =
|
|
31
|
+
const OriginalButton = forwardRefIfNeeded(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
32
32
|
const Comp = asChild ? Slot : "button";
|
|
33
33
|
return (_jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props }));
|
|
34
34
|
});
|
|
35
35
|
OriginalButton.displayName = "Button";
|
|
36
|
-
const Button =
|
|
36
|
+
const Button = forwardRefIfNeeded(({ onClick, loading: loadingProp, children, ...props }, ref) => {
|
|
37
37
|
const [handleClick, isLoading] = useAsyncCallback(async (e) => {
|
|
38
38
|
await onClick?.(e);
|
|
39
39
|
}, [onClick]);
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const Card: React.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
declare const
|
|
9
|
-
|
|
2
|
+
declare const Card: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
4
|
+
}>;
|
|
5
|
+
declare const ClickableCard: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
7
|
+
}>;
|
|
8
|
+
declare const CardHeader: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
9
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
declare const CardTitle: React.FC<React.HTMLAttributes<HTMLHeadingElement> & {
|
|
12
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
declare const CardDescription: React.FC<React.HTMLAttributes<HTMLParagraphElement> & {
|
|
15
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
declare const CardContent: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
18
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
declare const CardSubtitle: React.FC<React.HTMLAttributes<HTMLParagraphElement> & {
|
|
21
|
+
ref?: React.Ref<HTMLParagraphElement> | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
declare const CardFooter: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
24
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
25
|
+
}>;
|
|
10
26
|
export { Card, ClickableCard, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, CardSubtitle };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
|
|
3
3
|
import { cn } from "../../lib/utils";
|
|
4
|
-
const Card =
|
|
4
|
+
const Card = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("rounded-xl border bg-card text-card-foreground shadow-sm", className), ...props })));
|
|
5
5
|
Card.displayName = "Card";
|
|
6
|
-
const ClickableCard =
|
|
6
|
+
const ClickableCard = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("rounded-xl border bg-card text-card-foreground shadow-sm cursor-pointer hover:border-[color:var(--primary)] ease-in-out", className), ...props })));
|
|
7
7
|
ClickableCard.displayName = "ClickableCard";
|
|
8
|
-
const CardHeader =
|
|
8
|
+
const CardHeader = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col space-y-1.5 p-6 pb-0", className), ...props })));
|
|
9
9
|
CardHeader.displayName = "CardHeader";
|
|
10
|
-
const CardTitle =
|
|
10
|
+
const CardTitle = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("h3", { ref: ref, className: cn("font-semibold leading-none tracking-tight capitalize", className), ...props })));
|
|
11
11
|
CardTitle.displayName = "CardTitle";
|
|
12
|
-
const CardDescription =
|
|
12
|
+
const CardDescription = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("p", { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
13
13
|
CardDescription.displayName = "CardDescription";
|
|
14
|
-
const CardContent =
|
|
14
|
+
const CardContent = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("p-6", className), ...props })));
|
|
15
15
|
CardContent.displayName = "CardContent";
|
|
16
|
-
const CardSubtitle =
|
|
17
|
-
const CardFooter =
|
|
16
|
+
const CardSubtitle = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("h4", { ref: ref, className: cn("text-sm text-muted-foreground font-bold", className), ...props })));
|
|
17
|
+
const CardFooter = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center p-6 pt-0", className), ...props })));
|
|
18
18
|
CardFooter.displayName = "CardFooter";
|
|
19
19
|
export { Card, ClickableCard, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, CardSubtitle };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
-
declare const Checkbox: React.
|
|
3
|
+
declare const Checkbox: React.FC<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
4
|
+
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
5
|
+
}>;
|
|
4
6
|
export { Checkbox };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
|
|
4
4
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
5
5
|
import { CheckIcon } from "@radix-ui/react-icons";
|
|
6
6
|
import { cn } from "../../lib/utils";
|
|
7
|
-
const Checkbox =
|
|
7
|
+
const Checkbox = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(CheckboxPrimitive.Root, { ref: ref, className: cn("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) })));
|
|
8
8
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
9
9
|
export { Checkbox };
|
|
@@ -1,80 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type DialogProps } from "@radix-ui/react-dialog";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
6
|
-
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
7
|
-
} & {
|
|
8
|
-
asChild?: boolean | undefined;
|
|
9
|
-
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
10
|
-
label?: string | undefined;
|
|
11
|
-
shouldFilter?: boolean | undefined;
|
|
12
|
-
filter?: ((value: string, search: string, keywords?: string[] | undefined) => number) | undefined;
|
|
13
|
-
defaultValue?: string | undefined;
|
|
14
|
-
value?: string | undefined;
|
|
15
|
-
onValueChange?: ((value: string) => void) | undefined;
|
|
16
|
-
loop?: boolean | undefined;
|
|
17
|
-
disablePointerSelection?: boolean | undefined;
|
|
18
|
-
vimBindings?: boolean | undefined;
|
|
19
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
4
|
+
declare const Command: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive>>;
|
|
20
5
|
interface CommandDialogProps extends DialogProps {
|
|
21
6
|
}
|
|
22
7
|
declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
declare const CommandInput: React.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
onValueChange?: ((search: string) => void) | undefined;
|
|
30
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
31
|
-
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
32
|
-
children?: React.ReactNode;
|
|
33
|
-
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
34
|
-
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
35
|
-
} & {
|
|
36
|
-
asChild?: boolean | undefined;
|
|
37
|
-
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
38
|
-
label?: string | undefined;
|
|
39
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
-
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
41
|
-
children?: React.ReactNode;
|
|
42
|
-
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
43
|
-
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
44
|
-
} & {
|
|
45
|
-
asChild?: boolean | undefined;
|
|
46
|
-
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
47
|
-
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
48
|
-
children?: React.ReactNode;
|
|
49
|
-
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
50
|
-
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
51
|
-
} & {
|
|
52
|
-
asChild?: boolean | undefined;
|
|
53
|
-
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
|
|
54
|
-
heading?: React.ReactNode;
|
|
55
|
-
value?: string | undefined;
|
|
56
|
-
forceMount?: boolean | undefined;
|
|
57
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
58
|
-
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
59
|
-
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
60
|
-
} & {
|
|
61
|
-
asChild?: boolean | undefined;
|
|
62
|
-
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
63
|
-
alwaysRender?: boolean | undefined;
|
|
64
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
65
|
-
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
66
|
-
children?: React.ReactNode;
|
|
67
|
-
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
68
|
-
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
69
|
-
} & {
|
|
70
|
-
asChild?: boolean | undefined;
|
|
71
|
-
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "disabled" | "value" | "onSelect"> & {
|
|
72
|
-
disabled?: boolean | undefined;
|
|
73
|
-
onSelect?: ((value: string) => void) | undefined;
|
|
74
|
-
value?: string | undefined;
|
|
75
|
-
keywords?: string[] | undefined;
|
|
76
|
-
forceMount?: boolean | undefined;
|
|
77
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const CommandInput: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>>;
|
|
9
|
+
declare const CommandList: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>>;
|
|
10
|
+
declare const CommandEmpty: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>>;
|
|
11
|
+
declare const CommandGroup: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>>;
|
|
12
|
+
declare const CommandSeparator: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>>;
|
|
13
|
+
declare const CommandItem: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>>;
|
|
78
14
|
declare const CommandShortcut: {
|
|
79
15
|
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
80
16
|
displayName: string;
|