@craftzbay/ui 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 +21 -0
- package/README.md +157 -0
- package/dist-lib/components/patterns/AppShell.d.ts +9 -0
- package/dist-lib/components/patterns/Authentication.d.ts +45 -0
- package/dist-lib/components/patterns/DataTablePage.d.ts +1 -0
- package/dist-lib/components/patterns/FirstRunEmpty.d.ts +1 -0
- package/dist-lib/components/patterns/Onboarding.d.ts +1 -0
- package/dist-lib/components/patterns/Pricing.d.ts +1 -0
- package/dist-lib/components/patterns/RecordDetail.d.ts +1 -0
- package/dist-lib/components/patterns/Settings.d.ts +1 -0
- package/dist-lib/components/ui/Accordion.d.ts +21 -0
- package/dist-lib/components/ui/Alert.d.ts +35 -0
- package/dist-lib/components/ui/Avatar.d.ts +52 -0
- package/dist-lib/components/ui/Badge.d.ts +24 -0
- package/dist-lib/components/ui/Breadcrumbs.d.ts +31 -0
- package/dist-lib/components/ui/Button.d.ts +50 -0
- package/dist-lib/components/ui/Card.d.ts +37 -0
- package/dist-lib/components/ui/Checkbox.d.ts +28 -0
- package/dist-lib/components/ui/Combobox.d.ts +58 -0
- package/dist-lib/components/ui/CommandPalette.d.ts +109 -0
- package/dist-lib/components/ui/ContextMenu.d.ts +45 -0
- package/dist-lib/components/ui/DataGrid.d.ts +66 -0
- package/dist-lib/components/ui/DatePicker.d.ts +42 -0
- package/dist-lib/components/ui/Dialog.d.ts +62 -0
- package/dist-lib/components/ui/DropdownMenu.d.ts +47 -0
- package/dist-lib/components/ui/EmptyState.d.ts +31 -0
- package/dist-lib/components/ui/ErrorState.d.ts +29 -0
- package/dist-lib/components/ui/Form.d.ts +22 -0
- package/dist-lib/components/ui/IconButton.d.ts +34 -0
- package/dist-lib/components/ui/Input.d.ts +49 -0
- package/dist-lib/components/ui/Kbd.d.ts +16 -0
- package/dist-lib/components/ui/MultiSelect.d.ts +62 -0
- package/dist-lib/components/ui/Pagination.d.ts +32 -0
- package/dist-lib/components/ui/Popover.d.ts +16 -0
- package/dist-lib/components/ui/Progress.d.ts +40 -0
- package/dist-lib/components/ui/RadioGroup.d.ts +27 -0
- package/dist-lib/components/ui/ScrollArea.d.ts +13 -0
- package/dist-lib/components/ui/Select.d.ts +56 -0
- package/dist-lib/components/ui/Separator.d.ts +13 -0
- package/dist-lib/components/ui/Sheet.d.ts +46 -0
- package/dist-lib/components/ui/Sidebar.d.ts +67 -0
- package/dist-lib/components/ui/Skeleton.d.ts +26 -0
- package/dist-lib/components/ui/Slider.d.ts +33 -0
- package/dist-lib/components/ui/Spinner.d.ts +23 -0
- package/dist-lib/components/ui/Stepper.d.ts +34 -0
- package/dist-lib/components/ui/Switch.d.ts +33 -0
- package/dist-lib/components/ui/Table.d.ts +35 -0
- package/dist-lib/components/ui/Tabs.d.ts +32 -0
- package/dist-lib/components/ui/Textarea.d.ts +34 -0
- package/dist-lib/components/ui/Toast.d.ts +33 -0
- package/dist-lib/components/ui/Tooltip.d.ts +35 -0
- package/dist-lib/components/ui/TopNav.d.ts +33 -0
- package/dist-lib/hooks/use-media-query.d.ts +9 -0
- package/dist-lib/hooks/use-toast.d.ts +43 -0
- package/dist-lib/icons/index.d.ts +11 -0
- package/dist-lib/index.cjs +8 -0
- package/dist-lib/index.cjs.map +1 -0
- package/dist-lib/index.d.ts +58 -0
- package/dist-lib/index.js +4336 -0
- package/dist-lib/index.js.map +1 -0
- package/dist-lib/lib/cva.d.ts +6 -0
- package/dist-lib/lib/utils.d.ts +12 -0
- package/dist-lib/styles.css +1 -0
- package/package.json +118 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface PaginationProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** 1-indexed current page. */
|
|
4
|
+
page: number;
|
|
5
|
+
/** Total number of pages. Set to 0 to hide page numbers. */
|
|
6
|
+
pageCount: number;
|
|
7
|
+
/** Called with the new page when navigating. */
|
|
8
|
+
onPageChange: (page: number) => void;
|
|
9
|
+
/** Total item count, for the "Showing 1-20 of 200" hint. Omit to hide. */
|
|
10
|
+
totalItems?: number;
|
|
11
|
+
/** Items shown per page (controlled if `onPageSizeChange` is provided). */
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
/** Options for the page-size select. */
|
|
14
|
+
pageSizeOptions?: number[];
|
|
15
|
+
/** Called when the user picks a new page size. */
|
|
16
|
+
onPageSizeChange?: (size: number) => void;
|
|
17
|
+
/** Show first/last (« ») jump buttons. Default true. */
|
|
18
|
+
showJump?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Numbered pagination with prev/next, first/last jumps, page-size selector,
|
|
22
|
+
* and item-count summary.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <Pagination page={page} pageCount={20} onPageChange={setPage}
|
|
26
|
+
* totalItems={400} pageSize={20}
|
|
27
|
+
* pageSizeOptions={[10, 20, 50]} onPageSizeChange={setSize} />
|
|
28
|
+
*
|
|
29
|
+
* @do Place the count summary on the left and controls on the right.
|
|
30
|
+
* @dont Show numbers when there are >100 pages — use a "jump to" input instead.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Pagination: import('react').ForwardRefExoticComponent<PaginationProps & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
2
|
+
export declare const Popover: import('react').FC<PopoverPrimitive.PopoverProps>;
|
|
3
|
+
export declare const PopoverTrigger: import('react').ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export declare const PopoverAnchor: import('react').ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const PopoverClose: import('react').ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const PopoverContent: import('react').ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
|
+
/**
|
|
8
|
+
* @example
|
|
9
|
+
* <Popover>
|
|
10
|
+
* <PopoverTrigger asChild><Button variant="outline">Options</Button></PopoverTrigger>
|
|
11
|
+
* <PopoverContent>…</PopoverContent>
|
|
12
|
+
* </Popover>
|
|
13
|
+
*
|
|
14
|
+
* @do Reserve Popover for low-stakes, transient UI — pickers, mini-forms.
|
|
15
|
+
* @dont Use Popover for navigation menus — that's DropdownMenu.
|
|
16
|
+
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, SVGProps } from 'react';
|
|
2
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
3
|
+
export interface ProgressProps extends Omit<ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>, 'value'> {
|
|
4
|
+
/** 0–100. Omit for indeterminate. */
|
|
5
|
+
value?: number | null;
|
|
6
|
+
/** Bar height. */
|
|
7
|
+
size?: 'sm' | 'md' | 'lg';
|
|
8
|
+
/** Visual tone. Use `success`/`danger` to colour-code completion state. */
|
|
9
|
+
tone?: 'accent' | 'success' | 'warning' | 'danger';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Linear progress bar.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <Progress value={uploadPct} aria-label="Upload progress" />
|
|
16
|
+
* <Progress aria-label="Loading" /> // indeterminate
|
|
17
|
+
*
|
|
18
|
+
* @do Always pair Progress with an `aria-label` describing what is progressing.
|
|
19
|
+
* @dont Use a Progress for an unknown-completion task — use a Spinner.
|
|
20
|
+
*/
|
|
21
|
+
export declare const Progress: import('react').ForwardRefExoticComponent<ProgressProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export interface ProgressCircleProps extends SVGProps<SVGSVGElement> {
|
|
23
|
+
/** 0–100. Omit for indeterminate. */
|
|
24
|
+
value?: number;
|
|
25
|
+
/** Pixel size of the SVG. */
|
|
26
|
+
size?: number;
|
|
27
|
+
/** Stroke thickness. */
|
|
28
|
+
thickness?: number;
|
|
29
|
+
/** Visible label for screen readers. */
|
|
30
|
+
'aria-label': string;
|
|
31
|
+
tone?: 'accent' | 'success' | 'warning' | 'danger';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Circular progress ring. Pairs with a numeric label for percentage-style
|
|
35
|
+
* indicators.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <ProgressCircle value={72} aria-label="Storage used" />
|
|
39
|
+
*/
|
|
40
|
+
export declare const ProgressCircle: import('react').ForwardRefExoticComponent<Omit<ProgressCircleProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
export interface RadioGroupProps extends ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {
|
|
4
|
+
/** Lay out the radios horizontally (default) or vertically. */
|
|
5
|
+
orientation?: 'horizontal' | 'vertical';
|
|
6
|
+
}
|
|
7
|
+
export declare const RadioGroup: import('react').ForwardRefExoticComponent<RadioGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export interface RadioItemProps extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'asChild'> {
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
hideLabel?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* One radio option with inline label + description.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <RadioGroup defaultValue="weekly">
|
|
18
|
+
* <RadioItem value="daily" label="Daily" description="Every morning at 9am" />
|
|
19
|
+
* <RadioItem value="weekly" label="Weekly" description="Monday mornings" />
|
|
20
|
+
* <RadioItem value="never" label="Never" />
|
|
21
|
+
* </RadioGroup>
|
|
22
|
+
*
|
|
23
|
+
* @do Pair every RadioItem with a label — naked radios are unreachable for
|
|
24
|
+
* screen reader users.
|
|
25
|
+
* @dont Use RadioGroup for binary choices — use Switch.
|
|
26
|
+
*/
|
|
27
|
+
export declare const RadioItem: import('react').ForwardRefExoticComponent<RadioItemProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
2
|
+
/**
|
|
3
|
+
* Custom scroll container with consistent styled scrollbars across OS / browsers.
|
|
4
|
+
* Use when the default OS scrollbar would visually clash (sidebars, command
|
|
5
|
+
* palettes, code panes). Falls back to native scroll inside the viewport.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <ScrollArea className="h-64 rounded-md border border-border">
|
|
9
|
+
* <div className="p-3">…long content…</div>
|
|
10
|
+
* </ScrollArea>
|
|
11
|
+
*/
|
|
12
|
+
export declare const ScrollArea: import('react').ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const ScrollBar: import('react').ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
|
+
export declare const Select: import('react').FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
export declare const SelectValue: import('react').ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
export interface SelectTriggerProps extends Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'children'> {
|
|
6
|
+
/** Placeholder shown when no value is selected. */
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/** Trigger height — matches Input sizes. */
|
|
9
|
+
size?: 'sm' | 'md' | 'lg';
|
|
10
|
+
/** Visual tone — `error` swaps the border + ring to danger. */
|
|
11
|
+
tone?: 'default' | 'error';
|
|
12
|
+
}
|
|
13
|
+
export declare const SelectTrigger: import('react').ForwardRefExoticComponent<SelectTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export declare const SelectScrollUpButton: import('react').ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const SelectScrollDownButton: import('react').ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export declare const SelectContent: import('react').ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare const SelectLabel: import('react').ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export interface SelectItemProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {
|
|
19
|
+
/** Icon shown to the left of the label. */
|
|
20
|
+
leadingIcon?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare const SelectItem: import('react').ForwardRefExoticComponent<SelectItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export declare const SelectSeparator: import('react').ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
24
|
+
/** Optional grouping with a label header. Pure composition over Radix Group + Label. */
|
|
25
|
+
export interface SelectGroupProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Group> {
|
|
26
|
+
label?: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export declare const SelectGroup: import('react').ForwardRefExoticComponent<SelectGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
29
|
+
/**
|
|
30
|
+
* Compose `Select` + `SelectTrigger` + `SelectContent` + `SelectItem` for a
|
|
31
|
+
* single-choice picker. Keyboard, type-ahead, and ARIA come from Radix.
|
|
32
|
+
*
|
|
33
|
+
* @example Basic
|
|
34
|
+
* <Select onValueChange={setStatus}>
|
|
35
|
+
* <SelectTrigger placeholder="Status" />
|
|
36
|
+
* <SelectContent>
|
|
37
|
+
* <SelectItem value="open">Open</SelectItem>
|
|
38
|
+
* <SelectItem value="closed">Closed</SelectItem>
|
|
39
|
+
* </SelectContent>
|
|
40
|
+
* </Select>
|
|
41
|
+
*
|
|
42
|
+
* @example Grouped
|
|
43
|
+
* <SelectContent>
|
|
44
|
+
* <SelectGroup label="People">
|
|
45
|
+
* <SelectItem value="anu">Anu</SelectItem>
|
|
46
|
+
* <SelectItem value="bat">Bat</SelectItem>
|
|
47
|
+
* </SelectGroup>
|
|
48
|
+
* <SelectSeparator />
|
|
49
|
+
* <SelectGroup label="Bots">
|
|
50
|
+
* <SelectItem value="robo">Robo</SelectItem>
|
|
51
|
+
* </SelectGroup>
|
|
52
|
+
* </SelectContent>
|
|
53
|
+
*
|
|
54
|
+
* @do Use `placeholder` on the trigger when there is no default value.
|
|
55
|
+
* @dont Use Select for more than ~12 options — switch to `Combobox`.
|
|
56
|
+
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
2
|
+
/**
|
|
3
|
+
* Hairline divider. Decorative by default (no role announced). Pass
|
|
4
|
+
* `decorative={false}` when the separator carries semantic meaning, e.g.
|
|
5
|
+
* splitting two regions in a landmark.
|
|
6
|
+
*
|
|
7
|
+
* @example Section divider
|
|
8
|
+
* <Separator className="my-6" />
|
|
9
|
+
*
|
|
10
|
+
* @example Vertical inside a toolbar
|
|
11
|
+
* <Separator orientation="vertical" className="h-5 mx-2" />
|
|
12
|
+
*/
|
|
13
|
+
export declare const Separator: import('react').ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, HTMLAttributes } from 'react';
|
|
2
|
+
import { VariantProps } from '../../lib/cva';
|
|
3
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
+
export declare const Sheet: import('react').FC<DialogPrimitive.DialogProps>;
|
|
5
|
+
export declare const SheetTrigger: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const SheetClose: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare const SheetPortal: import('react').FC<DialogPrimitive.DialogPortalProps>;
|
|
8
|
+
declare const sheet: (props?: ({
|
|
9
|
+
side?: "top" | "right" | "bottom" | "left" | null | undefined;
|
|
10
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
11
|
+
export interface SheetContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheet> {
|
|
12
|
+
showClose?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const SheetContent: import('react').ForwardRefExoticComponent<SheetContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare function SheetHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare namespace SheetHeader {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function SheetFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare namespace SheetFooter {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const SheetTitle: import('react').ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & import('react').RefAttributes<HTMLHeadingElement>, "ref"> & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
24
|
+
export declare const SheetDescription: import('react').ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & import('react').RefAttributes<HTMLParagraphElement>, "ref"> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
25
|
+
export {};
|
|
26
|
+
/**
|
|
27
|
+
* @example Right-side filter drawer
|
|
28
|
+
* <Sheet>
|
|
29
|
+
* <SheetTrigger asChild><Button variant="outline">Filters</Button></SheetTrigger>
|
|
30
|
+
* <SheetContent side="right">
|
|
31
|
+
* <SheetHeader>
|
|
32
|
+
* <SheetTitle>Filters</SheetTitle>
|
|
33
|
+
* <SheetDescription>Refine the result set.</SheetDescription>
|
|
34
|
+
* </SheetHeader>
|
|
35
|
+
* …
|
|
36
|
+
* <SheetFooter>
|
|
37
|
+
* <SheetClose asChild><Button variant="outline">Cancel</Button></SheetClose>
|
|
38
|
+
* <Button>Apply</Button>
|
|
39
|
+
* </SheetFooter>
|
|
40
|
+
* </SheetContent>
|
|
41
|
+
* </Sheet>
|
|
42
|
+
*
|
|
43
|
+
* @do Use right side for filters/inspectors, left for navigation, bottom for
|
|
44
|
+
* mobile sheets.
|
|
45
|
+
* @dont Use a full-screen sheet on desktop — prefer Dialog or a dedicated page.
|
|
46
|
+
*/
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface SidebarProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** Default state on first mount. Use `defaultCollapsed` for uncontrolled. */
|
|
4
|
+
defaultCollapsed?: boolean;
|
|
5
|
+
/** Controlled collapsed state. */
|
|
6
|
+
collapsed?: boolean;
|
|
7
|
+
/** Called when the user toggles via the rail or keyboard. */
|
|
8
|
+
onCollapsedChange?: (next: boolean) => void;
|
|
9
|
+
/** Footer slot pinned to the bottom (user card, version, etc.). */
|
|
10
|
+
footer?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* App-level navigation rail. Holds `SidebarSection` → `SidebarItem` lists,
|
|
14
|
+
* and optionally a `footer`. Supports collapse to icon-only on desktop.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <Sidebar footer={<UserCard />}>
|
|
18
|
+
* <SidebarSection label="Workspace">
|
|
19
|
+
* <SidebarItem icon={<Home />} active>Home</SidebarItem>
|
|
20
|
+
* <SidebarItem icon={<Folder />}>Projects</SidebarItem>
|
|
21
|
+
* </SidebarSection>
|
|
22
|
+
* <SidebarSection label="Account">
|
|
23
|
+
* <SidebarItem icon={<Settings />}>Settings</SidebarItem>
|
|
24
|
+
* </SidebarSection>
|
|
25
|
+
* </Sidebar>
|
|
26
|
+
*
|
|
27
|
+
* @do Use 1–3 sections. More than that signals the IA needs restructuring.
|
|
28
|
+
* @dont Hide critical navigation under the collapsed state — keep icons
|
|
29
|
+
* always visible with tooltips.
|
|
30
|
+
*/
|
|
31
|
+
export declare const Sidebar: import('react').ForwardRefExoticComponent<SidebarProps & import('react').RefAttributes<HTMLElement>>;
|
|
32
|
+
export interface SidebarSectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
33
|
+
/** Visible section header. Hidden when collapsed. */
|
|
34
|
+
label?: ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export declare function SidebarSection({ label, className, children, ...props }: SidebarSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare namespace SidebarSection {
|
|
38
|
+
var displayName: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SidebarItemProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
41
|
+
/** Lucide icon shown to the left. */
|
|
42
|
+
icon?: ReactNode;
|
|
43
|
+
/** Mark as the current page. */
|
|
44
|
+
active?: boolean;
|
|
45
|
+
/** Optional `href` — when absent, renders as a `<button>` so consumers can
|
|
46
|
+
* bind their own handler / routing wrapper via `onClick`. */
|
|
47
|
+
href?: string;
|
|
48
|
+
/** Trailing badge / counter slot. */
|
|
49
|
+
trailing?: ReactNode;
|
|
50
|
+
/** Render a sub-item indented under a parent. */
|
|
51
|
+
sub?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export declare function SidebarItem({ icon, active, href, trailing, sub, className, children, ...props }: SidebarItemProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare namespace SidebarItem {
|
|
55
|
+
var displayName: string;
|
|
56
|
+
}
|
|
57
|
+
/** Lightweight collapsible sub-section inside the sidebar. */
|
|
58
|
+
export interface SidebarGroupProps {
|
|
59
|
+
icon?: ReactNode;
|
|
60
|
+
label: ReactNode;
|
|
61
|
+
defaultOpen?: boolean;
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
}
|
|
64
|
+
export declare function SidebarGroup({ icon, label, defaultOpen, children }: SidebarGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export declare namespace SidebarGroup {
|
|
66
|
+
var displayName: string;
|
|
67
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Predefined silhouette presets. */
|
|
4
|
+
variant?: 'text' | 'circle' | 'card' | 'avatar';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Animated placeholder. Use `Skeleton.Text` / `Skeleton.Avatar` for common
|
|
8
|
+
* shapes; pass `className` directly for one-off sizes.
|
|
9
|
+
*
|
|
10
|
+
* @example List item
|
|
11
|
+
* <div className="flex items-center gap-3">
|
|
12
|
+
* <Skeleton variant="avatar" />
|
|
13
|
+
* <div className="space-y-1.5 flex-1">
|
|
14
|
+
* <Skeleton variant="text" className="w-1/3" />
|
|
15
|
+
* <Skeleton variant="text" className="w-1/2" />
|
|
16
|
+
* </div>
|
|
17
|
+
* </div>
|
|
18
|
+
*
|
|
19
|
+
* @example Card
|
|
20
|
+
* <Skeleton variant="card" className="h-32" />
|
|
21
|
+
*
|
|
22
|
+
* @do Match the silhouette of the eventual content so the layout doesn't
|
|
23
|
+
* shift when data arrives.
|
|
24
|
+
* @dont Show a full-page skeleton for sub-300ms loads — use a single Spinner.
|
|
25
|
+
*/
|
|
26
|
+
export declare const Skeleton: import('react').ForwardRefExoticComponent<SkeletonProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
3
|
+
export interface SliderProps extends Omit<ComponentPropsWithoutRef<typeof SliderPrimitive.Root>, 'value' | 'defaultValue'> {
|
|
4
|
+
/**
|
|
5
|
+
* Controlled value. Pass `[n]` for a single-thumb slider, `[a, b]` for a range slider.
|
|
6
|
+
*/
|
|
7
|
+
value?: number[];
|
|
8
|
+
defaultValue?: number[];
|
|
9
|
+
/** Inline label rendered above the slider. */
|
|
10
|
+
label?: ReactNode;
|
|
11
|
+
/** Show the numeric value next to the label. */
|
|
12
|
+
showValue?: boolean;
|
|
13
|
+
/** Format the displayed value (e.g. `(v) => \`${v}%\``). */
|
|
14
|
+
formatValue?: (value: number) => string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Single- or range-thumb slider. Pass one item in `value` for a single
|
|
18
|
+
* thumb, two for a range.
|
|
19
|
+
*
|
|
20
|
+
* @example Single value
|
|
21
|
+
* <Slider label="Volume" showValue defaultValue={[60]} max={100} step={1} />
|
|
22
|
+
*
|
|
23
|
+
* @example Price range
|
|
24
|
+
* <Slider label="Price"
|
|
25
|
+
* defaultValue={[50, 250]}
|
|
26
|
+
* min={0} max={500} step={10}
|
|
27
|
+
* formatValue={(v) => \`$\${v}\`}
|
|
28
|
+
* showValue />
|
|
29
|
+
*
|
|
30
|
+
* @do Use `showValue` when the absolute number matters (price, volume, weight).
|
|
31
|
+
* @dont Hide the value when users will need to reason about exact thresholds.
|
|
32
|
+
*/
|
|
33
|
+
export declare const Slider: import('react').ForwardRefExoticComponent<SliderProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
export interface SpinnerProps extends SVGProps<SVGSVGElement> {
|
|
3
|
+
/** Visual weight. */
|
|
4
|
+
tone?: 'accent' | 'neutral' | 'on-accent';
|
|
5
|
+
/** Pixel size. */
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
/** Accessible label. Required unless `decorative` is true. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Hide from assistive tech (set when a parent already announces busy state). */
|
|
10
|
+
decorative?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Small indeterminate progress indicator. Use when the operation duration is
|
|
14
|
+
* unknown and Progress isn't appropriate.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <Spinner label="Loading users" />
|
|
18
|
+
* <Button loading>Saving…</Button> // uses Spinner internally
|
|
19
|
+
*
|
|
20
|
+
* @do Provide a `label` so the busy state is announced.
|
|
21
|
+
* @dont Use a Spinner for tasks that take 300ms+; use Skeleton instead.
|
|
22
|
+
*/
|
|
23
|
+
export declare const Spinner: import('react').ForwardRefExoticComponent<Omit<SpinnerProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface Step {
|
|
3
|
+
/** Step heading. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** Optional secondary description, only shown in vertical orientation. */
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface StepperProps extends HTMLAttributes<HTMLOListElement> {
|
|
9
|
+
/** Ordered list of steps. */
|
|
10
|
+
steps: Step[];
|
|
11
|
+
/** 0-indexed active step. Steps before it are marked complete. */
|
|
12
|
+
current: number;
|
|
13
|
+
/** Layout direction. */
|
|
14
|
+
orientation?: 'horizontal' | 'vertical';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Multi-step progress indicator. Use the horizontal variant in narrow flows
|
|
18
|
+
* (top of an onboarding modal) and vertical for deeper context.
|
|
19
|
+
*
|
|
20
|
+
* @example Onboarding
|
|
21
|
+
* <Stepper
|
|
22
|
+
* current={step}
|
|
23
|
+
* steps={[
|
|
24
|
+
* { title: 'Workspace' },
|
|
25
|
+
* { title: 'Invite team' },
|
|
26
|
+
* { title: 'Connect data' },
|
|
27
|
+
* { title: 'Done' },
|
|
28
|
+
* ]}
|
|
29
|
+
* />
|
|
30
|
+
*
|
|
31
|
+
* @do Keep titles 1–2 words. Save explanations for the page body.
|
|
32
|
+
* @dont Use Stepper for free-form navigation. It implies a linear flow.
|
|
33
|
+
*/
|
|
34
|
+
export declare const Stepper: import('react').ForwardRefExoticComponent<StepperProps & import('react').RefAttributes<HTMLOListElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
3
|
+
export interface SwitchProps extends Omit<ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, 'asChild'> {
|
|
4
|
+
/** Inline label rendered to the right. */
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
/** Secondary description rendered below the label. */
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
/** Position the label before the switch instead of after. */
|
|
9
|
+
labelPosition?: 'before' | 'after';
|
|
10
|
+
/** Visual size. */
|
|
11
|
+
size?: 'sm' | 'md';
|
|
12
|
+
/** Hide the label visually while keeping it accessible. */
|
|
13
|
+
hideLabel?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Binary on/off toggle for instant-apply settings. Use Checkbox when the
|
|
17
|
+
* choice is part of a form that needs explicit submission.
|
|
18
|
+
*
|
|
19
|
+
* @example Instant toggle
|
|
20
|
+
* <Switch label="Email digest" checked={on} onCheckedChange={setOn} />
|
|
21
|
+
*
|
|
22
|
+
* @example With description
|
|
23
|
+
* <Switch label="Two-factor authentication"
|
|
24
|
+
* description="Required for admins on production accounts."
|
|
25
|
+
* checked={tfa}
|
|
26
|
+
* onCheckedChange={setTfa} />
|
|
27
|
+
*
|
|
28
|
+
* @do Use Switch when the change takes effect immediately. Pair with
|
|
29
|
+
* a toast confirming the new state.
|
|
30
|
+
* @dont Use Switch inside a form that requires submission — Checkbox
|
|
31
|
+
* better matches that mental model.
|
|
32
|
+
*/
|
|
33
|
+
export declare const Switch: import('react').ForwardRefExoticComponent<SwitchProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { HTMLAttributes, ThHTMLAttributes, TdHTMLAttributes } from 'react';
|
|
2
|
+
export declare const Table: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLTableElement> & import('react').RefAttributes<HTMLTableElement>>;
|
|
3
|
+
export declare const TableHeader: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & import('react').RefAttributes<HTMLTableSectionElement>>;
|
|
4
|
+
export declare const TableBody: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & import('react').RefAttributes<HTMLTableSectionElement>>;
|
|
5
|
+
export declare const TableFooter: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & import('react').RefAttributes<HTMLTableSectionElement>>;
|
|
6
|
+
export declare const TableRow: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLTableRowElement> & {
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
} & import('react').RefAttributes<HTMLTableRowElement>>;
|
|
9
|
+
export declare const TableHead: import('react').ForwardRefExoticComponent<ThHTMLAttributes<HTMLTableCellElement> & import('react').RefAttributes<HTMLTableCellElement>>;
|
|
10
|
+
export declare const TableCell: import('react').ForwardRefExoticComponent<TdHTMLAttributes<HTMLTableCellElement> & import('react').RefAttributes<HTMLTableCellElement>>;
|
|
11
|
+
export declare const TableCaption: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLTableCaptionElement> & import('react').RefAttributes<HTMLTableCaptionElement>>;
|
|
12
|
+
export interface TableSortHeaderProps extends ThHTMLAttributes<HTMLTableCellElement> {
|
|
13
|
+
/** Stable column key used in `currentSort.key`. */
|
|
14
|
+
sortKey: string;
|
|
15
|
+
/** Currently sorted column + direction (or null). */
|
|
16
|
+
currentSort: {
|
|
17
|
+
key: string;
|
|
18
|
+
direction: 'asc' | 'desc';
|
|
19
|
+
} | null;
|
|
20
|
+
/** Called when the user clicks the header. */
|
|
21
|
+
onSortChange: (key: string, direction: 'asc' | 'desc') => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sortable column header. Click toggles asc → desc → asc; the icon reflects
|
|
25
|
+
* the current state.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* <TableSortHeader sortKey="name" currentSort={sort} onSortChange={onSort}>
|
|
29
|
+
* Name
|
|
30
|
+
* </TableSortHeader>
|
|
31
|
+
*
|
|
32
|
+
* @do Sort by one column at a time. Multi-sort hides state from users.
|
|
33
|
+
* @dont Sort silently — the icon must change so users see what changed.
|
|
34
|
+
*/
|
|
35
|
+
export declare const TableSortHeader: import('react').ForwardRefExoticComponent<TableSortHeaderProps & import('react').RefAttributes<HTMLTableCellElement>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { VariantProps } from '../../lib/cva';
|
|
3
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
4
|
+
export declare const Tabs: import('react').ForwardRefExoticComponent<TabsPrimitive.TabsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const list: (props?: ({
|
|
6
|
+
variant?: "underline" | "pills" | null | undefined;
|
|
7
|
+
size?: "md" | "sm" | "lg" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
export interface TabsListProps extends ComponentPropsWithoutRef<typeof TabsPrimitive.List>, VariantProps<typeof list> {
|
|
10
|
+
}
|
|
11
|
+
export declare const TabsList: import('react').ForwardRefExoticComponent<TabsListProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const TabsTrigger: import('react').ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
export declare const TabsContent: import('react').ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export {};
|
|
15
|
+
/**
|
|
16
|
+
* @example Underline (default)
|
|
17
|
+
* <Tabs defaultValue="overview">
|
|
18
|
+
* <TabsList>
|
|
19
|
+
* <TabsTrigger value="overview">Overview</TabsTrigger>
|
|
20
|
+
* <TabsTrigger value="activity">Activity</TabsTrigger>
|
|
21
|
+
* </TabsList>
|
|
22
|
+
* <TabsContent value="overview">…</TabsContent>
|
|
23
|
+
* <TabsContent value="activity">…</TabsContent>
|
|
24
|
+
* </Tabs>
|
|
25
|
+
*
|
|
26
|
+
* @example Pills
|
|
27
|
+
* <TabsList variant="pills"><TabsTrigger value="all">All</TabsTrigger>…</TabsList>
|
|
28
|
+
*
|
|
29
|
+
* @do Use `underline` at the top of a page or panel. Use `pills` inside a
|
|
30
|
+
* card or for filter-style switches.
|
|
31
|
+
* @dont Mix variants on the same screen — pick one and commit.
|
|
32
|
+
*/
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
/** Visible label above the field. */
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
/** Hint below the field. Hidden when `error` is set. */
|
|
6
|
+
helperText?: ReactNode;
|
|
7
|
+
/** Validation message. Sets `aria-invalid`. */
|
|
8
|
+
error?: ReactNode;
|
|
9
|
+
/** Grow vertically as content is added. */
|
|
10
|
+
autoResize?: boolean;
|
|
11
|
+
/** Minimum rows when `autoResize`. Defaults to 3. */
|
|
12
|
+
minRows?: number;
|
|
13
|
+
/** Maximum rows before scrolling when `autoResize`. Defaults to 12. */
|
|
14
|
+
maxRows?: number;
|
|
15
|
+
/** Visually hide the label while keeping it accessible. */
|
|
16
|
+
hideLabel?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Multi-line text input. With `autoResize`, height tracks content from
|
|
20
|
+
* `minRows` to `maxRows`. Without it, behaves like a native `<textarea>`.
|
|
21
|
+
*
|
|
22
|
+
* @example Comment box
|
|
23
|
+
* <Textarea label="Note" autoResize minRows={3} maxRows={10} />
|
|
24
|
+
*
|
|
25
|
+
* @example With error
|
|
26
|
+
* <Textarea label="Description"
|
|
27
|
+
* error={errors.description?.message}
|
|
28
|
+
* {...register('description')} />
|
|
29
|
+
*
|
|
30
|
+
* @do Default to `autoResize` for multi-line free-form input.
|
|
31
|
+
* @dont Add `resize-none` without auto-resize — users will be stuck with a
|
|
32
|
+
* 3-line box for long content.
|
|
33
|
+
*/
|
|
34
|
+
export declare const Textarea: import('react').ForwardRefExoticComponent<TextareaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { VariantProps } from '../../lib/cva';
|
|
3
|
+
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
4
|
+
export declare const ToastProvider: import('react').FC<ToastPrimitive.ToastProviderProps>;
|
|
5
|
+
export declare const ToastViewport: import('react').ForwardRefExoticComponent<Omit<ToastPrimitive.ToastViewportProps & import('react').RefAttributes<HTMLOListElement>, "ref"> & import('react').RefAttributes<HTMLOListElement>>;
|
|
6
|
+
declare const toast: (props?: ({
|
|
7
|
+
variant?: "default" | "success" | "warning" | "danger" | "info" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
export interface ToastProps extends ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, VariantProps<typeof toast> {
|
|
10
|
+
}
|
|
11
|
+
export declare const Toast: import('react').ForwardRefExoticComponent<ToastProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
12
|
+
export declare const ToastTitle: import('react').ForwardRefExoticComponent<Omit<ToastPrimitive.ToastTitleProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const ToastDescription: import('react').ForwardRefExoticComponent<Omit<ToastPrimitive.ToastDescriptionProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const ToastAction: import('react').ForwardRefExoticComponent<Omit<ToastPrimitive.ToastActionProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export declare const ToastClose: import('react').ForwardRefExoticComponent<Omit<ToastPrimitive.ToastCloseProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
export {};
|
|
17
|
+
/**
|
|
18
|
+
* @example
|
|
19
|
+
* <ToastProvider>
|
|
20
|
+
* …app…
|
|
21
|
+
* <Toast variant="success">
|
|
22
|
+
* <ToastTitle>Saved</ToastTitle>
|
|
23
|
+
* <ToastDescription>Your changes are live.</ToastDescription>
|
|
24
|
+
* <ToastAction altText="Undo">Undo</ToastAction>
|
|
25
|
+
* <ToastClose />
|
|
26
|
+
* </Toast>
|
|
27
|
+
* <ToastViewport />
|
|
28
|
+
* </ToastProvider>
|
|
29
|
+
*
|
|
30
|
+
* @do Use the `useToast()` hook (in `src/hooks/use-toast.ts`) in app code —
|
|
31
|
+
* the components here are the primitives the hook renders.
|
|
32
|
+
* @dont Stack more than two toasts at a time. Newer toasts replace older ones.
|
|
33
|
+
*/
|