@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.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +157 -0
  3. package/dist-lib/components/patterns/AppShell.d.ts +9 -0
  4. package/dist-lib/components/patterns/Authentication.d.ts +45 -0
  5. package/dist-lib/components/patterns/DataTablePage.d.ts +1 -0
  6. package/dist-lib/components/patterns/FirstRunEmpty.d.ts +1 -0
  7. package/dist-lib/components/patterns/Onboarding.d.ts +1 -0
  8. package/dist-lib/components/patterns/Pricing.d.ts +1 -0
  9. package/dist-lib/components/patterns/RecordDetail.d.ts +1 -0
  10. package/dist-lib/components/patterns/Settings.d.ts +1 -0
  11. package/dist-lib/components/ui/Accordion.d.ts +21 -0
  12. package/dist-lib/components/ui/Alert.d.ts +35 -0
  13. package/dist-lib/components/ui/Avatar.d.ts +52 -0
  14. package/dist-lib/components/ui/Badge.d.ts +24 -0
  15. package/dist-lib/components/ui/Breadcrumbs.d.ts +31 -0
  16. package/dist-lib/components/ui/Button.d.ts +50 -0
  17. package/dist-lib/components/ui/Card.d.ts +37 -0
  18. package/dist-lib/components/ui/Checkbox.d.ts +28 -0
  19. package/dist-lib/components/ui/Combobox.d.ts +58 -0
  20. package/dist-lib/components/ui/CommandPalette.d.ts +109 -0
  21. package/dist-lib/components/ui/ContextMenu.d.ts +45 -0
  22. package/dist-lib/components/ui/DataGrid.d.ts +66 -0
  23. package/dist-lib/components/ui/DatePicker.d.ts +42 -0
  24. package/dist-lib/components/ui/Dialog.d.ts +62 -0
  25. package/dist-lib/components/ui/DropdownMenu.d.ts +47 -0
  26. package/dist-lib/components/ui/EmptyState.d.ts +31 -0
  27. package/dist-lib/components/ui/ErrorState.d.ts +29 -0
  28. package/dist-lib/components/ui/Form.d.ts +22 -0
  29. package/dist-lib/components/ui/IconButton.d.ts +34 -0
  30. package/dist-lib/components/ui/Input.d.ts +49 -0
  31. package/dist-lib/components/ui/Kbd.d.ts +16 -0
  32. package/dist-lib/components/ui/MultiSelect.d.ts +62 -0
  33. package/dist-lib/components/ui/Pagination.d.ts +32 -0
  34. package/dist-lib/components/ui/Popover.d.ts +16 -0
  35. package/dist-lib/components/ui/Progress.d.ts +40 -0
  36. package/dist-lib/components/ui/RadioGroup.d.ts +27 -0
  37. package/dist-lib/components/ui/ScrollArea.d.ts +13 -0
  38. package/dist-lib/components/ui/Select.d.ts +56 -0
  39. package/dist-lib/components/ui/Separator.d.ts +13 -0
  40. package/dist-lib/components/ui/Sheet.d.ts +46 -0
  41. package/dist-lib/components/ui/Sidebar.d.ts +67 -0
  42. package/dist-lib/components/ui/Skeleton.d.ts +26 -0
  43. package/dist-lib/components/ui/Slider.d.ts +33 -0
  44. package/dist-lib/components/ui/Spinner.d.ts +23 -0
  45. package/dist-lib/components/ui/Stepper.d.ts +34 -0
  46. package/dist-lib/components/ui/Switch.d.ts +33 -0
  47. package/dist-lib/components/ui/Table.d.ts +35 -0
  48. package/dist-lib/components/ui/Tabs.d.ts +32 -0
  49. package/dist-lib/components/ui/Textarea.d.ts +34 -0
  50. package/dist-lib/components/ui/Toast.d.ts +33 -0
  51. package/dist-lib/components/ui/Tooltip.d.ts +35 -0
  52. package/dist-lib/components/ui/TopNav.d.ts +33 -0
  53. package/dist-lib/hooks/use-media-query.d.ts +9 -0
  54. package/dist-lib/hooks/use-toast.d.ts +43 -0
  55. package/dist-lib/icons/index.d.ts +11 -0
  56. package/dist-lib/index.cjs +8 -0
  57. package/dist-lib/index.cjs.map +1 -0
  58. package/dist-lib/index.d.ts +58 -0
  59. package/dist-lib/index.js +4336 -0
  60. package/dist-lib/index.js.map +1 -0
  61. package/dist-lib/lib/cva.d.ts +6 -0
  62. package/dist-lib/lib/utils.d.ts +12 -0
  63. package/dist-lib/styles.css +1 -0
  64. package/package.json +118 -0
@@ -0,0 +1,109 @@
1
+ import { ReactNode } from 'react';
2
+ export declare const Command: import('react').ForwardRefExoticComponent<Omit<{
3
+ children?: React.ReactNode;
4
+ } & Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
5
+ ref?: React.Ref<HTMLDivElement>;
6
+ } & {
7
+ asChild?: boolean;
8
+ }, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild"> & {
9
+ label?: string;
10
+ shouldFilter?: boolean;
11
+ filter?: (value: string, search: string, keywords?: string[]) => number;
12
+ defaultValue?: string;
13
+ value?: string;
14
+ onValueChange?: (value: string) => void;
15
+ loop?: boolean;
16
+ disablePointerSelection?: boolean;
17
+ vimBindings?: boolean;
18
+ } & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
19
+ export declare const CommandInput: import('react').ForwardRefExoticComponent<Omit<Omit<Pick<Pick<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import('react').InputHTMLAttributes<HTMLInputElement>> & {
20
+ ref?: React.Ref<HTMLInputElement>;
21
+ } & {
22
+ asChild?: boolean;
23
+ }, "key" | "asChild" | keyof import('react').InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
24
+ value?: string;
25
+ onValueChange?: (search: string) => void;
26
+ } & import('react').RefAttributes<HTMLInputElement>, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
27
+ export declare const CommandList: import('react').ForwardRefExoticComponent<Omit<{
28
+ children?: React.ReactNode;
29
+ } & Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
30
+ ref?: React.Ref<HTMLDivElement>;
31
+ } & {
32
+ asChild?: boolean;
33
+ }, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild"> & {
34
+ label?: string;
35
+ } & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
36
+ export declare const CommandEmpty: import('react').ForwardRefExoticComponent<Omit<{
37
+ children?: React.ReactNode;
38
+ } & Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
39
+ ref?: React.Ref<HTMLDivElement>;
40
+ } & {
41
+ asChild?: boolean;
42
+ }, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild"> & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
43
+ export declare const CommandGroup: import('react').ForwardRefExoticComponent<Omit<{
44
+ children?: React.ReactNode;
45
+ } & Omit<Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
46
+ ref?: React.Ref<HTMLDivElement>;
47
+ } & {
48
+ asChild?: boolean;
49
+ }, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
50
+ heading?: React.ReactNode;
51
+ value?: string;
52
+ forceMount?: boolean;
53
+ } & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
54
+ export declare const CommandSeparator: import('react').ForwardRefExoticComponent<Omit<Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
55
+ ref?: React.Ref<HTMLDivElement>;
56
+ } & {
57
+ asChild?: boolean;
58
+ }, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild"> & {
59
+ alwaysRender?: boolean;
60
+ } & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
61
+ export declare const CommandItem: import('react').ForwardRefExoticComponent<Omit<{
62
+ children?: React.ReactNode;
63
+ } & Omit<Pick<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import('react').HTMLAttributes<HTMLDivElement>> & {
64
+ ref?: React.Ref<HTMLDivElement>;
65
+ } & {
66
+ asChild?: boolean;
67
+ }, "key" | keyof import('react').HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
68
+ disabled?: boolean;
69
+ onSelect?: (value: string) => void;
70
+ value?: string;
71
+ keywords?: string[];
72
+ forceMount?: boolean;
73
+ } & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
74
+ export declare function CommandShortcut({ children, className }: {
75
+ children: ReactNode;
76
+ className?: string;
77
+ }): import("react/jsx-runtime").JSX.Element;
78
+ export interface CommandDialogProps {
79
+ open: boolean;
80
+ onOpenChange: (open: boolean) => void;
81
+ children: ReactNode;
82
+ /** Visible label for screen readers. */
83
+ title?: string;
84
+ }
85
+ export declare function CommandDialog({ open, onOpenChange, children, title }: CommandDialogProps): import("react/jsx-runtime").JSX.Element;
86
+ /**
87
+ * Hook that wires ⌘K / Ctrl+K to a setter — the canonical way to mount the
88
+ * palette in an app shell.
89
+ *
90
+ * @example
91
+ * const [open, setOpen] = useState(false);
92
+ * useCommandPaletteShortcut(setOpen);
93
+ * …
94
+ * <CommandDialog open={open} onOpenChange={setOpen}>
95
+ * <CommandInput placeholder="Type a command…" />
96
+ * <CommandList>
97
+ * <CommandEmpty>No results.</CommandEmpty>
98
+ * <CommandGroup heading="Suggestions">
99
+ * <CommandItem>Create project</CommandItem>
100
+ * <CommandItem>Invite teammate</CommandItem>
101
+ * </CommandGroup>
102
+ * </CommandList>
103
+ * </CommandDialog>
104
+ *
105
+ * @do Group items by category. Show "Recent" first when the query is empty.
106
+ * @dont Hide essential actions behind the palette only — keep at least one
107
+ * button entry in the UI.
108
+ */
109
+ export declare function useCommandPaletteShortcut(setOpen: (open: boolean) => void): void;
@@ -0,0 +1,45 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
3
+ /**
4
+ * Right-click (or two-finger tap) menu. Visual surface mirrors DropdownMenu
5
+ * for consistency.
6
+ *
7
+ * @example
8
+ * <ContextMenu>
9
+ * <ContextMenuTrigger asChild>
10
+ * <div className="grid h-32 place-items-center rounded-lg border border-border">
11
+ * Right-click me
12
+ * </div>
13
+ * </ContextMenuTrigger>
14
+ * <ContextMenuContent>
15
+ * <ContextMenuItem>Open</ContextMenuItem>
16
+ * <ContextMenuSeparator />
17
+ * <ContextMenuItem destructive>Delete</ContextMenuItem>
18
+ * </ContextMenuContent>
19
+ * </ContextMenu>
20
+ *
21
+ * @do Mirror DropdownMenu items for the same surface — users expect the same
22
+ * operations from both.
23
+ * @dont Hide critical actions behind right-click — they must also exist in
24
+ * a visible button or menu.
25
+ */
26
+ export declare const ContextMenu: import('react').FC<ContextMenuPrimitive.ContextMenuProps>;
27
+ export declare const ContextMenuTrigger: import('react').ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & import('react').RefAttributes<HTMLSpanElement>>;
28
+ export declare const ContextMenuGroup: import('react').ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & import('react').RefAttributes<HTMLDivElement>>;
29
+ export declare const ContextMenuPortal: import('react').FC<ContextMenuPrimitive.ContextMenuPortalProps>;
30
+ export declare const ContextMenuSub: import('react').FC<ContextMenuPrimitive.ContextMenuSubProps>;
31
+ export declare const ContextMenuRadioGroup: import('react').ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & import('react').RefAttributes<HTMLDivElement>>;
32
+ export declare const ContextMenuSubTrigger: import('react').ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
33
+ export declare const ContextMenuSubContent: import('react').ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
34
+ export declare const ContextMenuContent: import('react').ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
35
+ export declare const ContextMenuItem: import('react').ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
36
+ destructive?: boolean;
37
+ } & import('react').RefAttributes<HTMLDivElement>>;
38
+ export declare const ContextMenuCheckboxItem: import('react').ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
39
+ export declare const ContextMenuRadioItem: import('react').ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
40
+ export declare const ContextMenuLabel: import('react').ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuLabelProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
41
+ export declare const ContextMenuSeparator: import('react').ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
42
+ export declare function ContextMenuShortcut({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
43
+ export declare namespace ContextMenuShortcut {
44
+ var displayName: string;
45
+ }
@@ -0,0 +1,66 @@
1
+ import { ReactNode } from 'react';
2
+ export interface DataGridColumn<TRow> {
3
+ /** Stable key used for visibility, sort, and React lists. */
4
+ key: string;
5
+ /** Header label. */
6
+ header: ReactNode;
7
+ /** Render the cell. Defaults to the value at `row[key]`. */
8
+ cell?: (row: TRow) => ReactNode;
9
+ /** Cell width — passed to `<col>` so the grid keeps shape during loading. */
10
+ width?: string;
11
+ /** Allow sorting on this column. */
12
+ sortable?: boolean;
13
+ /** Right-align numeric / monetary columns. */
14
+ align?: 'left' | 'right';
15
+ }
16
+ export interface DataGridProps<TRow extends {
17
+ id: string | number;
18
+ }> {
19
+ columns: DataGridColumn<TRow>[];
20
+ rows: TRow[];
21
+ loading?: boolean;
22
+ /** Initial sort state. */
23
+ sort?: {
24
+ key: string;
25
+ direction: 'asc' | 'desc';
26
+ } | null;
27
+ onSortChange?: (sort: {
28
+ key: string;
29
+ direction: 'asc' | 'desc';
30
+ }) => void;
31
+ /** Show a filter input row above the grid. */
32
+ filter?: {
33
+ value: string;
34
+ onChange: (q: string) => void;
35
+ placeholder?: string;
36
+ };
37
+ /** Empty-state node when no rows are visible. */
38
+ emptyState?: ReactNode;
39
+ className?: string;
40
+ }
41
+ /**
42
+ * Composite grid built from `Table` + DropdownMenu + Input. Provides
43
+ * column visibility toggle, an inline filter, sortable headers, and
44
+ * loading / empty states.
45
+ *
46
+ * @example
47
+ * <DataGrid
48
+ * columns={[
49
+ * { key: 'name', header: 'Name', sortable: true },
50
+ * { key: 'status', header: 'Status', cell: r => <Badge tone={...}>{r.status}</Badge> },
51
+ * { key: 'updatedAt', header: 'Updated', align: 'right' },
52
+ * ]}
53
+ * rows={rows}
54
+ * filter={{ value: q, onChange: setQ }}
55
+ * sort={sort}
56
+ * onSortChange={setSort}
57
+ * />
58
+ *
59
+ * @do Provide a meaningful empty state with a primary action when the grid
60
+ * starts empty (no items at all, not just filtered out).
61
+ * @dont Render thousands of rows synchronously — virtualise with `@tanstack/react-virtual`
62
+ * and wrap with this component's headers as a shell.
63
+ */
64
+ export declare function DataGrid<TRow extends {
65
+ id: string | number;
66
+ }>({ columns, rows, loading, sort, onSortChange, filter, emptyState, className, }: DataGridProps<TRow>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from 'react';
2
+ import { DateRange } from 'react-day-picker';
3
+ export interface DatePickerProps {
4
+ value?: Date;
5
+ onChange: (date: Date | undefined) => void;
6
+ label?: ReactNode;
7
+ placeholder?: string;
8
+ error?: ReactNode;
9
+ disabled?: boolean;
10
+ /** Restrict to a date range. Days outside are not selectable. */
11
+ fromDate?: Date;
12
+ toDate?: Date;
13
+ className?: string;
14
+ }
15
+ /**
16
+ * Single-date picker.
17
+ *
18
+ * @example
19
+ * <DatePicker label="Date of birth" value={dob} onChange={setDob} />
20
+ *
21
+ * @do Use locale-aware formatting via the consumer's display layer.
22
+ * @dont Roll a custom calendar — Radix Popover + react-day-picker handles a11y.
23
+ */
24
+ export declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLDivElement>>;
25
+ export interface DateRangePickerProps {
26
+ value?: DateRange;
27
+ onChange: (range: DateRange | undefined) => void;
28
+ label?: ReactNode;
29
+ placeholder?: string;
30
+ error?: ReactNode;
31
+ disabled?: boolean;
32
+ fromDate?: Date;
33
+ toDate?: Date;
34
+ className?: string;
35
+ }
36
+ /**
37
+ * Two-date range picker. `value` is `{from, to}`.
38
+ *
39
+ * @example
40
+ * <DateRangePicker label="Reporting period" value={range} onChange={setRange} />
41
+ */
42
+ export declare const DateRangePicker: import('react').ForwardRefExoticComponent<DateRangePickerProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,62 @@
1
+ import { ComponentPropsWithoutRef, HTMLAttributes, ReactNode } from 'react';
2
+ import { ButtonProps } from './Button';
3
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
4
+ export declare const Dialog: import('react').FC<DialogPrimitive.DialogProps>;
5
+ export declare const DialogTrigger: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
6
+ export declare const DialogPortal: import('react').FC<DialogPrimitive.DialogPortalProps>;
7
+ export declare const DialogClose: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
8
+ export declare const DialogOverlay: import('react').ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
9
+ export interface DialogContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
10
+ /** Show the default close (×) button in the top-right. */
11
+ showClose?: boolean;
12
+ /** Dialog width — `sm` 400 / `md` 520 / `lg` 720. */
13
+ size?: 'sm' | 'md' | 'lg';
14
+ }
15
+ export declare const DialogContent: import('react').ForwardRefExoticComponent<DialogContentProps & import('react').RefAttributes<HTMLDivElement>>;
16
+ export declare function DialogHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
17
+ export declare namespace DialogHeader {
18
+ var displayName: string;
19
+ }
20
+ export declare function DialogFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
21
+ export declare namespace DialogFooter {
22
+ var displayName: string;
23
+ }
24
+ export declare const DialogTitle: import('react').ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & import('react').RefAttributes<HTMLHeadingElement>, "ref"> & import('react').RefAttributes<HTMLHeadingElement>>;
25
+ export declare const DialogDescription: import('react').ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & import('react').RefAttributes<HTMLParagraphElement>, "ref"> & import('react').RefAttributes<HTMLParagraphElement>>;
26
+ export interface ConfirmationDialogProps {
27
+ open: boolean;
28
+ onOpenChange: (open: boolean) => void;
29
+ title: ReactNode;
30
+ description?: ReactNode;
31
+ /** Label of the confirm button. */
32
+ confirmLabel?: string;
33
+ /** Label of the cancel button. */
34
+ cancelLabel?: string;
35
+ /** Variant of the confirm button — typically `primary` or `destructive`. */
36
+ confirmVariant?: ButtonProps['variant'];
37
+ /** Called when the user confirms. Awaited — shows a spinner while pending. */
38
+ onConfirm: () => void | Promise<void>;
39
+ /** Whether the confirm button is currently submitting. */
40
+ loading?: boolean;
41
+ }
42
+ /**
43
+ * Confirmation dialog with title, description, cancel + confirm buttons.
44
+ *
45
+ * @example Destructive confirmation
46
+ * <ConfirmationDialog
47
+ * open={open} onOpenChange={setOpen}
48
+ * title="Delete project?"
49
+ * description="This permanently deletes the project and all its data."
50
+ * confirmLabel="Delete project"
51
+ * confirmVariant="destructive"
52
+ * onConfirm={handleDelete}
53
+ * />
54
+ *
55
+ * @do Lead the title with the action: "Delete project?" not "Are you sure?".
56
+ * State consequences in the description.
57
+ * @dont Use for low-risk reversible actions — those don't need a dialog.
58
+ */
59
+ export declare function ConfirmationDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, confirmVariant, onConfirm, loading, }: ConfirmationDialogProps): import("react/jsx-runtime").JSX.Element;
60
+ export declare namespace ConfirmationDialog {
61
+ var displayName: string;
62
+ }
@@ -0,0 +1,47 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
+ export declare const DropdownMenu: import('react').FC<DropdownMenuPrimitive.DropdownMenuProps>;
4
+ export declare const DropdownMenuTrigger: import('react').ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
5
+ export declare const DropdownMenuGroup: import('react').ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & import('react').RefAttributes<HTMLDivElement>>;
6
+ export declare const DropdownMenuPortal: import('react').FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
7
+ export declare const DropdownMenuSub: import('react').FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
8
+ export declare const DropdownMenuRadioGroup: import('react').ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & import('react').RefAttributes<HTMLDivElement>>;
9
+ export declare const DropdownMenuSubTrigger: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
10
+ inset?: boolean;
11
+ } & import('react').RefAttributes<HTMLDivElement>>;
12
+ export declare const DropdownMenuSubContent: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
13
+ export declare const DropdownMenuContent: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
14
+ export declare const DropdownMenuItem: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
15
+ inset?: boolean;
16
+ destructive?: boolean;
17
+ } & import('react').RefAttributes<HTMLDivElement>>;
18
+ export declare const DropdownMenuCheckboxItem: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
19
+ export declare const DropdownMenuRadioItem: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
20
+ export declare const DropdownMenuLabel: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
21
+ inset?: boolean;
22
+ } & import('react').RefAttributes<HTMLDivElement>>;
23
+ export declare const DropdownMenuSeparator: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
24
+ /**
25
+ * Trailing right-aligned shortcut label inside a menu item. Pair with `<Kbd>`
26
+ * inside the Kbd component file if you want stylised keys.
27
+ */
28
+ export declare function DropdownMenuShortcut({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
29
+ export declare namespace DropdownMenuShortcut {
30
+ var displayName: string;
31
+ }
32
+ /**
33
+ * @example
34
+ * <DropdownMenu>
35
+ * <DropdownMenuTrigger asChild><IconButton aria-label="More" icon={<MoreHorizontal />} /></DropdownMenuTrigger>
36
+ * <DropdownMenuContent>
37
+ * <DropdownMenuItem>Open<DropdownMenuShortcut>⌘O</DropdownMenuShortcut></DropdownMenuItem>
38
+ * <DropdownMenuItem>Rename</DropdownMenuItem>
39
+ * <DropdownMenuSeparator />
40
+ * <DropdownMenuItem destructive>Delete</DropdownMenuItem>
41
+ * </DropdownMenuContent>
42
+ * </DropdownMenu>
43
+ *
44
+ * @do Group destructive items at the bottom with a separator.
45
+ * @dont Mix link navigation and action items in the same menu — split into
46
+ * two menus or two groups with labels.
47
+ */
@@ -0,0 +1,31 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface EmptyStateProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Visual marker — small Lucide icon or custom illustration. */
4
+ icon?: ReactNode;
5
+ /** Heading. One short sentence. */
6
+ title: ReactNode;
7
+ /** Description. One or two sentences max. */
8
+ description?: ReactNode;
9
+ /** Primary action — usually a `<Button>` that creates the missing item. */
10
+ action?: ReactNode;
11
+ /** Secondary helper link — "Learn more", "Import existing", etc. */
12
+ secondaryAction?: ReactNode;
13
+ }
14
+ /**
15
+ * Shown when a list / dataset / surface has no content yet. Tone is helpful,
16
+ * never apologetic.
17
+ *
18
+ * @example
19
+ * <EmptyState
20
+ * icon={<Folder className="size-6" />}
21
+ * title="No projects yet"
22
+ * description="Create a project to start tracking work."
23
+ * action={<Button>New project</Button>}
24
+ * />
25
+ *
26
+ * @do Lead with the next action. The icon is decoration; the button is the
27
+ * point.
28
+ * @dont Use elaborate illustrations on internal product surfaces — they
29
+ * break the refined-minimal direction.
30
+ */
31
+ export declare const EmptyState: import('react').ForwardRefExoticComponent<EmptyStateProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,29 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface ErrorStateProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** `404` not-found, `500` server, or `generic` (catch-all). */
4
+ variant?: '404' | '500' | 'generic';
5
+ /** Override the default title. */
6
+ title?: ReactNode;
7
+ /** Override the default description. */
8
+ description?: ReactNode;
9
+ /** Custom action node. Replaces the default retry button. */
10
+ action?: ReactNode;
11
+ /** When provided, renders a default "Try again" button calling this handler. */
12
+ onRetry?: () => void;
13
+ }
14
+ /**
15
+ * Page-level error placeholder. Pair with `onRetry` for transient failures.
16
+ *
17
+ * @example 500
18
+ * <ErrorState variant="500" onRetry={refetch} />
19
+ *
20
+ * @example Custom
21
+ * <ErrorState title="Quota exceeded"
22
+ * description="Your plan allows 1,000 events/day."
23
+ * action={<Button>Upgrade plan</Button>} />
24
+ *
25
+ * @do Match the tone to the cause — server errors apologise, user errors
26
+ * explain. Always offer a next step.
27
+ * @dont Show a raw stack trace to end users.
28
+ */
29
+ export declare const ErrorState: import('react').ForwardRefExoticComponent<ErrorStateProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,22 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';
3
+ import * as LabelPrimitive from '@radix-ui/react-label';
4
+ export declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
5
+ export declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: ControllerProps<TFieldValues, TName>): import("react/jsx-runtime").JSX.Element;
6
+ export declare function useFormField(): {
7
+ invalid: boolean;
8
+ isDirty: boolean;
9
+ isTouched: boolean;
10
+ isValidating: boolean;
11
+ error?: import('react-hook-form').FieldError;
12
+ id: string;
13
+ name: string;
14
+ formItemId: string;
15
+ formDescriptionId: string;
16
+ formMessageId: string;
17
+ };
18
+ export declare const FormItem: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
19
+ export declare const FormLabel: import('react').ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & import('react').RefAttributes<HTMLLabelElement>, "ref"> & import('react').RefAttributes<HTMLLabelElement>>;
20
+ export declare const FormControl: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-slot').SlotProps & import('react').RefAttributes<HTMLElement>, "ref"> & import('react').RefAttributes<HTMLElement>>;
21
+ export declare const FormDescription: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
22
+ export declare const FormError: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
@@ -0,0 +1,34 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ import { VariantProps } from '../../lib/cva';
3
+ declare const iconButton: (props?: ({
4
+ variant?: "outline" | "primary" | "secondary" | "ghost" | "destructive" | null | undefined;
5
+ size?: "md" | "sm" | "lg" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof iconButton> {
8
+ /**
9
+ * Accessible label for screen readers. **Required** — an icon-only button
10
+ * with no label is invisible to assistive tech.
11
+ */
12
+ 'aria-label': string;
13
+ /** The Lucide icon to render. */
14
+ icon: ReactNode;
15
+ /** Show a spinner instead of the icon. */
16
+ loading?: boolean;
17
+ }
18
+ /**
19
+ * Square, icon-only button. Default variant is `ghost` because most
20
+ * IconButtons sit in dense toolbars or tables. Always pass `aria-label`.
21
+ *
22
+ * @example Toolbar action
23
+ * <IconButton aria-label="Edit row" icon={<Edit2 />} onClick={onEdit} />
24
+ *
25
+ * @example Dismissible chip
26
+ * <IconButton aria-label="Remove tag" size="sm" icon={<X />} />
27
+ *
28
+ * @do Use `ghost` for in-row actions; `outline` when next to a label-less
29
+ * primary button you want users to consider as an alternative.
30
+ * @dont Use IconButton when the action's meaning isn't universally
31
+ * recognised. If users need to learn the icon, ship a Button with text.
32
+ */
33
+ export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
34
+ export {};
@@ -0,0 +1,49 @@
1
+ import { InputHTMLAttributes, ReactNode } from 'react';
2
+ import { VariantProps } from '../../lib/cva';
3
+ declare const field: (props?: ({
4
+ size?: "md" | "sm" | "lg" | null | undefined;
5
+ tone?: "default" | "error" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ type InputType = 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url';
8
+ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'>, VariantProps<typeof field> {
9
+ /** Field type. `password` enables a show/hide toggle; `search` adds a clear button. */
10
+ type?: InputType;
11
+ /** Visible label rendered above the input. */
12
+ label?: ReactNode;
13
+ /** Hint below the input. Hidden while `error` is set. */
14
+ helperText?: ReactNode;
15
+ /** Validation message. Renders in `danger` colour and sets `aria-invalid`. */
16
+ error?: ReactNode;
17
+ /** Content rendered inside the field, before the input — icon or short text. */
18
+ prefix?: ReactNode;
19
+ /** Content rendered inside the field, after the input. */
20
+ suffix?: ReactNode;
21
+ /** Show an inline clear (×) button when the input has a value. */
22
+ clearable?: boolean;
23
+ /** Fires when the clear button is pressed. The consumer owns the state. */
24
+ onClear?: () => void;
25
+ /** Visually conceal the label while keeping it for screen readers. */
26
+ hideLabel?: boolean;
27
+ }
28
+ /**
29
+ * Text-style input with optional label, helper / error, prefix / suffix,
30
+ * clear, and password show-hide. Wraps a single native `<input>` so it works
31
+ * with `react-hook-form` and any controlled / uncontrolled pattern.
32
+ *
33
+ * @example Email with helper
34
+ * <Input type="email" label="Work email" helperText="We never share this." />
35
+ *
36
+ * @example Password with show/hide
37
+ * <Input type="password" label="Password" autoComplete="current-password" />
38
+ *
39
+ * @example Search with clear
40
+ * <Input type="search" placeholder="Search…" value={q} onChange={…}
41
+ * clearable onClear={() => setQ('')} />
42
+ *
43
+ * @do Always pair an input with a visible label. If space forces hiding it,
44
+ * use `hideLabel` so the label stays in the accessibility tree.
45
+ * @dont Use placeholder as the only label — placeholders disappear on input
46
+ * and fail accessibility.
47
+ */
48
+ export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
49
+ export {};
@@ -0,0 +1,16 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface KbdProps extends HTMLAttributes<HTMLElement> {
3
+ /** Visual size — match the surrounding text. */
4
+ size?: 'sm' | 'md';
5
+ }
6
+ /**
7
+ * Stylised keyboard shortcut indicator. Compose multiple `<Kbd>` for chords.
8
+ *
9
+ * @example
10
+ * Press <Kbd>⌘</Kbd>+<Kbd>K</Kbd> to open the command palette.
11
+ *
12
+ * @do Use OS-conventional symbols (⌘ ⇧ ⌥ ⌃ ⏎) — keep visuals consistent
13
+ * across the app.
14
+ * @dont Use Kbd for clickable buttons — it implies a real keyboard input.
15
+ */
16
+ export declare const Kbd: import('react').ForwardRefExoticComponent<KbdProps & import('react').RefAttributes<HTMLElement>>;
@@ -0,0 +1,62 @@
1
+ import { ReactNode } from 'react';
2
+ export interface MultiSelectOption {
3
+ /** Stable, unique value submitted in `onChange`. */
4
+ value: string;
5
+ /** Visible label shown both in the menu and in the selected chip. */
6
+ label: string;
7
+ /** Optional secondary text shown after the label in the menu. */
8
+ description?: string;
9
+ /** Disable selecting this option. */
10
+ disabled?: boolean;
11
+ }
12
+ export interface MultiSelectProps {
13
+ /** All possible options. */
14
+ options: MultiSelectOption[];
15
+ /** Currently selected values. Controlled. */
16
+ value: string[];
17
+ /** Called whenever the selection changes. */
18
+ onChange: (next: string[]) => void;
19
+ /** Visible label above the field. */
20
+ label?: ReactNode;
21
+ /** Hint below the field. Hidden when `error` is set. */
22
+ helperText?: ReactNode;
23
+ /** Validation message. */
24
+ error?: ReactNode;
25
+ /** Empty-state placeholder shown when nothing is selected. */
26
+ placeholder?: string;
27
+ /** Text shown when no options match the search. */
28
+ emptyText?: string;
29
+ /** Max number of chips rendered inline; remainder shown as "+N more". */
30
+ maxVisibleChips?: number;
31
+ /** Whether the user can clear all selections with a single click. */
32
+ clearable?: boolean;
33
+ /** Disable the entire field. */
34
+ disabled?: boolean;
35
+ className?: string;
36
+ }
37
+ /**
38
+ * Chip-based multi-select with a searchable menu (cmdk under the hood).
39
+ *
40
+ * Keyboard:
41
+ * - Backspace on the input with empty query removes the last chip
42
+ * - Enter / Space toggles the highlighted option
43
+ * - Escape closes the menu
44
+ *
45
+ * @example Tag picker
46
+ * <MultiSelect label="Tags"
47
+ * options={tags}
48
+ * value={selected}
49
+ * onChange={setSelected}
50
+ * placeholder="Pick tags" />
51
+ *
52
+ * @example Bounded with overflow chip
53
+ * <MultiSelect options={users}
54
+ * value={value}
55
+ * onChange={setValue}
56
+ * maxVisibleChips={3} />
57
+ *
58
+ * @do Cap `maxVisibleChips` (3–5) on narrow surfaces so the field doesn't
59
+ * reflow as the user adds selections.
60
+ * @dont Use MultiSelect for fewer than ~6 options. CheckboxGroup is clearer.
61
+ */
62
+ export declare const MultiSelect: import('react').ForwardRefExoticComponent<MultiSelectProps & import('react').RefAttributes<HTMLDivElement>>;