@coderabbitai/carrot-ui 0.1.19
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/README.md +86 -0
- package/dist/index.d.ts +1821 -0
- package/dist/index.js +2731 -0
- package/package.json +83 -0
- package/src/scales.css +198 -0
- package/src/styles.css +13 -0
- package/src/theme.css +433 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1821 @@
|
|
|
1
|
+
import { Accordion as Accordion_2 } from '@base-ui/react/accordion';
|
|
2
|
+
import { AlertDialog as AlertDialog_2 } from '@base-ui/react/alert-dialog';
|
|
3
|
+
import { Button as Button_2 } from '@base-ui/react/button';
|
|
4
|
+
import { ClassValue } from 'clsx';
|
|
5
|
+
import { Column } from '@tanstack/react-table';
|
|
6
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
7
|
+
import { ColumnFiltersState } from '@tanstack/react-table';
|
|
8
|
+
import { Command as Command_2 } from 'cmdk';
|
|
9
|
+
import { ComponentProps } from 'react';
|
|
10
|
+
import { ComponentType } from 'react';
|
|
11
|
+
import { Dialog as Dialog_2 } from '@base-ui/react/dialog';
|
|
12
|
+
import { Drawer as Drawer_2 } from '@base-ui/react/drawer';
|
|
13
|
+
import { Field } from '@base-ui/react/field';
|
|
14
|
+
import { forwardRef } from 'react';
|
|
15
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
16
|
+
import { JSX } from 'react/jsx-runtime';
|
|
17
|
+
import { Menu } from '@base-ui/react/menu';
|
|
18
|
+
import { Popover as Popover_2 } from '@base-ui/react/popover';
|
|
19
|
+
import { ReactElement } from 'react';
|
|
20
|
+
import { ReactNode } from 'react';
|
|
21
|
+
import { RefAttributes } from 'react';
|
|
22
|
+
import { Row } from '@tanstack/react-table';
|
|
23
|
+
import { RowSelectionState } from '@tanstack/react-table';
|
|
24
|
+
import { Separator as Separator_2 } from '@base-ui/react/separator';
|
|
25
|
+
import { SortingState } from '@tanstack/react-table';
|
|
26
|
+
import { SVGProps } from 'react';
|
|
27
|
+
import { TableOptions } from '@tanstack/react-table';
|
|
28
|
+
import { Tabs as Tabs_2 } from '@base-ui/react/tabs';
|
|
29
|
+
import { Tooltip as Tooltip_2 } from '@base-ui/react/tooltip';
|
|
30
|
+
|
|
31
|
+
export declare const Accordion: {
|
|
32
|
+
Root: ForwardRefExoticComponent<Omit<AccordionRootProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
33
|
+
Item: ForwardRefExoticComponent<Omit<AccordionItemProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
34
|
+
Trigger: ForwardRefExoticComponent<Omit<AccordionTriggerProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
Content: ForwardRefExoticComponent<Omit<AccordionContentProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export declare interface AccordionContentProps extends ComponentProps<typeof Accordion_2.Panel> {
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export declare interface AccordionItemProps extends ComponentProps<typeof Accordion_2.Item> {
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare interface AccordionRootProps extends ComponentProps<typeof Accordion_2.Root> {
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare interface AccordionTriggerProps extends ComponentProps<typeof Accordion_2.Trigger> {
|
|
48
|
+
/** Icon element rendered before the label */
|
|
49
|
+
icon?: ReactNode;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Horizontal banner alert for important messages.
|
|
54
|
+
*
|
|
55
|
+
* Features a flickering pixel grid pattern on the right side that
|
|
56
|
+
* uses the intent color for brand expression. Single-line layout:
|
|
57
|
+
* icon on the left, text in the middle, optional action on the right.
|
|
58
|
+
*
|
|
59
|
+
* Links inside the text are automatically styled with an underline
|
|
60
|
+
* in the intent color.
|
|
61
|
+
*/
|
|
62
|
+
export declare const Alert: ForwardRefExoticComponent<AlertProps & RefAttributes<HTMLDivElement>>;
|
|
63
|
+
|
|
64
|
+
export declare const AlertDialog: {
|
|
65
|
+
Root: typeof AlertDialogRoot;
|
|
66
|
+
Trigger: ForwardRefExoticComponent<Omit<AlertDialogTriggerProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
67
|
+
Content: typeof AlertDialogContent;
|
|
68
|
+
Panel: ForwardRefExoticComponent<AlertDialogPanelProps & RefAttributes<HTMLDivElement>>;
|
|
69
|
+
Title: ForwardRefExoticComponent<Omit<AlertDialogTitleProps, "ref"> & RefAttributes<HTMLHeadingElement>>;
|
|
70
|
+
Description: ForwardRefExoticComponent<Omit<AlertDialogDescriptionProps, "ref"> & RefAttributes<HTMLParagraphElement>>;
|
|
71
|
+
Actions: ForwardRefExoticComponent<AlertDialogActionsProps & RefAttributes<HTMLDivElement>>;
|
|
72
|
+
Close: ForwardRefExoticComponent<Omit<AlertDialogCloseProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export declare interface AlertDialogActionsProps {
|
|
76
|
+
className?: string;
|
|
77
|
+
children: ReactNode;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export declare interface AlertDialogBackdropProps extends ComponentProps<typeof AlertDialog_2.Backdrop> {
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export declare interface AlertDialogCloseProps extends ComponentProps<typeof AlertDialog_2.Close> {
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare function AlertDialogContent({ className, children, ...props }: AlertDialogContentProps): JSX.Element;
|
|
87
|
+
|
|
88
|
+
export declare interface AlertDialogContentProps extends ComponentProps<typeof AlertDialog_2.Popup> {
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export declare interface AlertDialogDescriptionProps extends ComponentProps<typeof AlertDialog_2.Description> {
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export declare interface AlertDialogPanelProps {
|
|
95
|
+
className?: string;
|
|
96
|
+
children: ReactNode;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare function AlertDialogRoot(props: AlertDialogRootProps): JSX.Element;
|
|
100
|
+
|
|
101
|
+
export declare interface AlertDialogRootProps extends ComponentProps<typeof AlertDialog_2.Root> {
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare interface AlertDialogTitleProps extends ComponentProps<typeof AlertDialog_2.Title> {
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export declare interface AlertDialogTriggerProps extends ComponentProps<typeof AlertDialog_2.Trigger> {
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export declare interface AlertProps {
|
|
111
|
+
/** Visual style variant */
|
|
112
|
+
variant?: AlertVariant;
|
|
113
|
+
/** Override the default icon */
|
|
114
|
+
icon?: ReactNode;
|
|
115
|
+
/** Action element rendered at the far right (e.g. a Button) */
|
|
116
|
+
action?: ReactNode;
|
|
117
|
+
/** Called when the dismiss button is clicked. When provided, a close button appears on the right. */
|
|
118
|
+
onDismiss?: () => void;
|
|
119
|
+
className?: string;
|
|
120
|
+
children: ReactNode;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export declare type AlertVariant = keyof typeof variantConfig_2;
|
|
124
|
+
|
|
125
|
+
export declare const AppHeader: ReturnType<typeof forwardRef<HTMLElement, AppHeaderProps>> & {
|
|
126
|
+
Breadcrumb: typeof AppHeaderBreadcrumb;
|
|
127
|
+
Actions: typeof AppHeaderActions;
|
|
128
|
+
Avatar: typeof Avatar;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
declare const AppHeaderActions: ForwardRefExoticComponent<AppHeaderActionsProps & RefAttributes<HTMLDivElement>>;
|
|
132
|
+
|
|
133
|
+
export declare interface AppHeaderActionsProps {
|
|
134
|
+
children: ReactNode;
|
|
135
|
+
className?: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
declare function AppHeaderBreadcrumb({ items, linkComponent: LinkEl, className, }: AppHeaderBreadcrumbProps): JSX.Element;
|
|
139
|
+
|
|
140
|
+
declare interface AppHeaderBreadcrumbItem {
|
|
141
|
+
label: string;
|
|
142
|
+
icon?: ReactNode;
|
|
143
|
+
href?: string;
|
|
144
|
+
selector?: boolean;
|
|
145
|
+
options?: AppHeaderBreadcrumbOption[];
|
|
146
|
+
onSelect?: (value: string) => void;
|
|
147
|
+
value?: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare interface AppHeaderBreadcrumbOption {
|
|
151
|
+
value: string;
|
|
152
|
+
label: string;
|
|
153
|
+
icon?: ReactNode;
|
|
154
|
+
[key: string]: unknown;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export declare interface AppHeaderBreadcrumbProps {
|
|
158
|
+
items: AppHeaderBreadcrumbItem[];
|
|
159
|
+
/** Custom link component (e.g. TanStack Router's Link, Next.js Link, etc.). Defaults to <a>. */
|
|
160
|
+
linkComponent?: LinkComponent;
|
|
161
|
+
className?: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export declare interface AppHeaderProps {
|
|
165
|
+
children: ReactNode;
|
|
166
|
+
className?: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Avatar component with image, initials, or generative pixel-grid fallback.
|
|
171
|
+
*
|
|
172
|
+
* Fallback priority: `src` > `initials` > `seed` (generative) > empty
|
|
173
|
+
*
|
|
174
|
+
* - `circle` variant for users (fully rounded)
|
|
175
|
+
* - `square` variant for organizations/workspaces (rounded corners)
|
|
176
|
+
*/
|
|
177
|
+
export declare function Avatar({ src, initials, seed, generativePattern, alt, variant, size, color, className, }: AvatarProps): JSX.Element;
|
|
178
|
+
|
|
179
|
+
declare type AvatarColor = "neutral" | "accent" | "danger" | "warning" | "success";
|
|
180
|
+
|
|
181
|
+
declare type AvatarGenerativePattern = "grid" | "symmetric" | "dense" | "quad" | "quad-dense" | "diagonal" | "sierpinski";
|
|
182
|
+
|
|
183
|
+
export declare interface AvatarProps {
|
|
184
|
+
/** Image URL */
|
|
185
|
+
src?: string;
|
|
186
|
+
/** Fallback initials (1-2 characters) */
|
|
187
|
+
initials?: string;
|
|
188
|
+
/**
|
|
189
|
+
* Seed string for generative pixel-grid fallback.
|
|
190
|
+
* Used when no `src` or `initials` are provided.
|
|
191
|
+
* Each seed produces a unique deterministic pattern and color.
|
|
192
|
+
*/
|
|
193
|
+
seed?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Pattern variant for the generative fallback.
|
|
196
|
+
* Only used when rendering from `seed`.
|
|
197
|
+
*/
|
|
198
|
+
generativePattern?: AvatarGenerativePattern;
|
|
199
|
+
/** Alt text for the image */
|
|
200
|
+
alt?: string;
|
|
201
|
+
/** Shape variant */
|
|
202
|
+
variant?: AvatarVariant;
|
|
203
|
+
/** Size */
|
|
204
|
+
size?: AvatarSize;
|
|
205
|
+
/** Color preset — automatically sets matching background and text color */
|
|
206
|
+
color?: AvatarColor;
|
|
207
|
+
className?: string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export declare type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
211
|
+
|
|
212
|
+
export declare type AvatarVariant = "circle" | "square";
|
|
213
|
+
|
|
214
|
+
export declare const Badge: ForwardRefExoticComponent<BadgeProps & RefAttributes<HTMLSpanElement>>;
|
|
215
|
+
|
|
216
|
+
export declare interface BadgeProps {
|
|
217
|
+
variant?: BadgeVariant;
|
|
218
|
+
className?: string;
|
|
219
|
+
children: ReactNode;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export declare type BadgeVariant = keyof typeof variantStyles_2;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Button component built on Base UI with Tailwind CSS styling.
|
|
226
|
+
*
|
|
227
|
+
* All variants use an animated hover layer for consistent press/hover
|
|
228
|
+
* feedback. The layer handles bg, border, and shadow - the outer button
|
|
229
|
+
* is just a layout shell.
|
|
230
|
+
*/
|
|
231
|
+
export declare const Button: ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
232
|
+
|
|
233
|
+
export declare interface ButtonProps extends ComponentProps<typeof Button_2> {
|
|
234
|
+
/** Visual style variant */
|
|
235
|
+
variant?: ButtonVariant;
|
|
236
|
+
/** Size of the button */
|
|
237
|
+
size?: ButtonSize;
|
|
238
|
+
/** Icon element rendered before the label */
|
|
239
|
+
iconLeft?: ReactNode;
|
|
240
|
+
/** Icon element rendered after the label */
|
|
241
|
+
iconRight?: ReactNode;
|
|
242
|
+
/** Show a loading spinner overlay */
|
|
243
|
+
loading?: boolean;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export declare type ButtonSize = keyof typeof sizeStyles;
|
|
247
|
+
|
|
248
|
+
export declare type ButtonVariant = keyof typeof variantConfig;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Card compound component.
|
|
252
|
+
*
|
|
253
|
+
* Use Card.Content as the first child to get consistent inner padding,
|
|
254
|
+
* then place Card.Header, Card.Body, Card.Section, or nested Cards inside it.
|
|
255
|
+
*/
|
|
256
|
+
export declare const Card: ReturnType<typeof forwardRef<HTMLDivElement, CardProps>> & {
|
|
257
|
+
Content: typeof CardContent;
|
|
258
|
+
Header: typeof CardHeader;
|
|
259
|
+
Body: typeof CardBody;
|
|
260
|
+
Section: typeof CardSection;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
declare const CardBody: ForwardRefExoticComponent<CardBodyProps & RefAttributes<HTMLDivElement>>;
|
|
264
|
+
|
|
265
|
+
export declare interface CardBodyProps {
|
|
266
|
+
className?: string;
|
|
267
|
+
children: ReactNode;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Inner wrapper that provides consistent padding inside a Card.
|
|
272
|
+
* Put Card.Header, Card.Body, nested Cards, etc. inside this.
|
|
273
|
+
*/
|
|
274
|
+
declare const CardContent: ForwardRefExoticComponent<CardContentProps & RefAttributes<HTMLDivElement>>;
|
|
275
|
+
|
|
276
|
+
export declare interface CardContentProps {
|
|
277
|
+
className?: string;
|
|
278
|
+
children: ReactNode;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare const CardHeader: ForwardRefExoticComponent<CardHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
282
|
+
|
|
283
|
+
export declare interface CardHeaderProps {
|
|
284
|
+
className?: string;
|
|
285
|
+
children: ReactNode;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export declare interface CardProps {
|
|
289
|
+
/** Visual style variant */
|
|
290
|
+
variant?: CardVariant;
|
|
291
|
+
className?: string;
|
|
292
|
+
children: ReactNode;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
declare const CardSection: ForwardRefExoticComponent<CardSectionProps & RefAttributes<HTMLDivElement>>;
|
|
296
|
+
|
|
297
|
+
export declare interface CardSectionProps {
|
|
298
|
+
className?: string;
|
|
299
|
+
children: ReactNode;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
declare type CardVariant = keyof typeof variantStyles;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Checkbox component built on Base UI Checkbox with Tailwind CSS styling.
|
|
306
|
+
*
|
|
307
|
+
* Supports controlled/uncontrolled usage, indeterminate state, disabled
|
|
308
|
+
* state, and an optional label. The label is clickable and toggles the
|
|
309
|
+
* checkbox. An expanded hit area (32px) makes the checkbox easier to click.
|
|
310
|
+
*
|
|
311
|
+
* Checked state uses accent color. Indeterminate state uses neutral gray
|
|
312
|
+
* to visually distinguish it from a deliberate selection.
|
|
313
|
+
*/
|
|
314
|
+
export declare function Checkbox({ checked, defaultChecked, onCheckedChange, indeterminate, disabled, required, size, label, name, className, }: CheckboxProps): JSX.Element;
|
|
315
|
+
|
|
316
|
+
export declare interface CheckboxProps {
|
|
317
|
+
/** Whether the checkbox is ticked. Use for controlled mode. */
|
|
318
|
+
checked?: boolean;
|
|
319
|
+
/** Whether the checkbox is initially ticked. Use for uncontrolled mode. */
|
|
320
|
+
defaultChecked?: boolean;
|
|
321
|
+
/** Called when the checked state changes. */
|
|
322
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
323
|
+
/** Whether the checkbox is in an indeterminate (mixed) state. */
|
|
324
|
+
indeterminate?: boolean;
|
|
325
|
+
/** Whether the checkbox is disabled. */
|
|
326
|
+
disabled?: boolean;
|
|
327
|
+
/** Whether the checkbox is required. */
|
|
328
|
+
required?: boolean;
|
|
329
|
+
/** Size of the checkbox. */
|
|
330
|
+
size?: CheckboxSize;
|
|
331
|
+
/** Optional label rendered beside the checkbox. */
|
|
332
|
+
label?: ReactNode;
|
|
333
|
+
/** Name attribute for form submission. */
|
|
334
|
+
name?: string;
|
|
335
|
+
/** Additional class name for the root element. */
|
|
336
|
+
className?: string;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
declare type CheckboxSize = keyof typeof sizeStyles_3;
|
|
340
|
+
|
|
341
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
342
|
+
|
|
343
|
+
export { Column }
|
|
344
|
+
|
|
345
|
+
export { ColumnDef }
|
|
346
|
+
|
|
347
|
+
export { ColumnFiltersState }
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Searchable combobox with filtering.
|
|
351
|
+
*
|
|
352
|
+
* Wraps Base UI Combobox.Root with shared Menu visual primitives.
|
|
353
|
+
* For non-searchable dropdowns, use Select instead.
|
|
354
|
+
*
|
|
355
|
+
* Supports both controlled (`value` + `onValueChange`)
|
|
356
|
+
* and uncontrolled (`defaultValue`) usage.
|
|
357
|
+
*/
|
|
358
|
+
export declare function Combobox({ value, defaultValue, onValueChange, items, children, className, }: ComboboxProps): ReactElement;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Pre-styled trigger for form contexts.
|
|
362
|
+
* Renders as a Button with the selected value + chevron icon.
|
|
363
|
+
* For fully custom triggers, use ComboboxTrigger instead.
|
|
364
|
+
*/
|
|
365
|
+
export declare const ComboboxButton: ForwardRefExoticComponent<ComboboxButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
366
|
+
|
|
367
|
+
export declare interface ComboboxButtonProps {
|
|
368
|
+
/** Placeholder text shown when no value is selected */
|
|
369
|
+
placeholder?: string;
|
|
370
|
+
className?: string;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Popup with search input and a scrollable list of filtered options.
|
|
375
|
+
* Uses Base UI's render function pattern for automatic filtering.
|
|
376
|
+
*/
|
|
377
|
+
export declare function ComboboxContent({ align, searchPlaceholder, emptyMessage, minWidth, children, className, }: ComboboxContentProps): ReactElement;
|
|
378
|
+
|
|
379
|
+
export declare interface ComboboxContentProps {
|
|
380
|
+
/** Alignment relative to trigger */
|
|
381
|
+
align?: "start" | "center" | "end";
|
|
382
|
+
/** Placeholder text for the search input */
|
|
383
|
+
searchPlaceholder?: string;
|
|
384
|
+
/** Empty state message */
|
|
385
|
+
emptyMessage?: string;
|
|
386
|
+
/** Minimum width of the popup */
|
|
387
|
+
minWidth?: string;
|
|
388
|
+
/**
|
|
389
|
+
* Render function for each item. Receives a ComboboxItem and should return
|
|
390
|
+
* a ComboboxOption element. When not provided, renders a default option
|
|
391
|
+
* with optional icon + label + checkmark.
|
|
392
|
+
*/
|
|
393
|
+
children?: (item: ComboboxItem) => ReactNode;
|
|
394
|
+
className?: string;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export declare interface ComboboxItem {
|
|
398
|
+
readonly value: string;
|
|
399
|
+
readonly label: string;
|
|
400
|
+
readonly icon?: ReactNode;
|
|
401
|
+
readonly [key: string]: unknown;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Individual option in the combobox popup.
|
|
406
|
+
* Automatically includes a checkmark indicator when selected.
|
|
407
|
+
*/
|
|
408
|
+
export declare const ComboboxOption: ForwardRefExoticComponent<ComboboxOptionProps & RefAttributes<HTMLDivElement>>;
|
|
409
|
+
|
|
410
|
+
export declare interface ComboboxOptionProps {
|
|
411
|
+
/** Value for this option */
|
|
412
|
+
readonly value: string;
|
|
413
|
+
/** Icon element rendered before the label */
|
|
414
|
+
readonly icon?: ReactNode;
|
|
415
|
+
readonly children: ReactNode;
|
|
416
|
+
readonly className?: string;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export declare interface ComboboxProps {
|
|
420
|
+
/** Controlled value */
|
|
421
|
+
readonly value?: string;
|
|
422
|
+
/** Uncontrolled default value */
|
|
423
|
+
readonly defaultValue?: string;
|
|
424
|
+
/** Called when a value is selected */
|
|
425
|
+
readonly onValueChange?: (value: string) => void;
|
|
426
|
+
/** Item data for filtering and rendering */
|
|
427
|
+
readonly items: ComboboxItem[];
|
|
428
|
+
readonly children: ReactNode;
|
|
429
|
+
readonly className?: string;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Fully composable trigger. Renders whatever children you give it as the
|
|
434
|
+
* element that opens the combobox popup.
|
|
435
|
+
*
|
|
436
|
+
* Use ComboboxButton for button-based triggers so BaseCombobox.Trigger does
|
|
437
|
+
* not wrap a Button in another native button.
|
|
438
|
+
*/
|
|
439
|
+
export declare const ComboboxTrigger: ForwardRefExoticComponent<ComboboxTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
440
|
+
|
|
441
|
+
export declare interface ComboboxTriggerProps {
|
|
442
|
+
children: ReactNode;
|
|
443
|
+
className?: string;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export declare const Command: {
|
|
447
|
+
Root: ForwardRefExoticComponent<Omit<CommandRootProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
448
|
+
Input: ForwardRefExoticComponent<Omit<CommandInputProps, "ref"> & RefAttributes<HTMLInputElement>>;
|
|
449
|
+
List: ForwardRefExoticComponent<Omit<CommandListProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
450
|
+
Empty: ForwardRefExoticComponent<Omit<CommandEmptyProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
451
|
+
Group: ForwardRefExoticComponent<Omit<CommandGroupProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
452
|
+
Item: ForwardRefExoticComponent<Omit<CommandItemProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
453
|
+
Separator: ForwardRefExoticComponent<Omit<CommandSeparatorProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
454
|
+
Dialog: typeof CommandDialog;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
declare function CommandDialog({ open, onOpenChange, children, className, }: CommandDialogProps): JSX.Element;
|
|
458
|
+
|
|
459
|
+
export declare interface CommandDialogProps {
|
|
460
|
+
/** Controlled open state */
|
|
461
|
+
open?: boolean;
|
|
462
|
+
/** Called when open state changes */
|
|
463
|
+
onOpenChange?: (open: boolean) => void;
|
|
464
|
+
/** Content for the command palette */
|
|
465
|
+
children: ReactNode;
|
|
466
|
+
className?: string;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export declare interface CommandEmptyProps extends ComponentProps<typeof Command_2.Empty> {
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export declare interface CommandGroupProps extends ComponentProps<typeof Command_2.Group> {
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export declare interface CommandInputProps extends ComponentProps<typeof Command_2.Input> {
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export declare interface CommandItemProps extends ComponentProps<typeof Command_2.Item> {
|
|
479
|
+
/** Icon element rendered before the label */
|
|
480
|
+
icon?: ReactNode;
|
|
481
|
+
/** Keyboard shortcut hint rendered on the right */
|
|
482
|
+
shortcut?: string;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export declare interface CommandListProps extends ComponentProps<typeof Command_2.List> {
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export declare interface CommandRootProps extends ComponentProps<typeof Command_2> {
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export declare interface CommandSeparatorProps extends ComponentProps<typeof Command_2.Separator> {
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export declare const createTooltipHandle: typeof Tooltip_2.createHandle;
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Data table powered by TanStack Table.
|
|
498
|
+
*
|
|
499
|
+
* Renders using the existing `Table` primitives (Table.Header, Table.Body,
|
|
500
|
+
* Table.Row, Table.Cell) for visual consistency. TanStack Table provides the
|
|
501
|
+
* headless logic for sorting, filtering, pagination, and row selection.
|
|
502
|
+
*
|
|
503
|
+
* Filtering is handled externally -- use `<DataTableToolbar />` with
|
|
504
|
+
* `<DataTableSearch />`, `<Select />`, or `<Combobox />` above the table.
|
|
505
|
+
* Pass filter state via `tableOptions` or pre-filtered `data`.
|
|
506
|
+
*
|
|
507
|
+
* For simple static tables, use `Table` directly. Use `DataTable` when you
|
|
508
|
+
* need interactive features.
|
|
509
|
+
*/
|
|
510
|
+
export declare function DataTable<TData>({ columns, data, sortable, paginated, pageSize, pageSizeOptions, selectable, rowSelection: controlledRowSelection, onRowSelectionChange, onRowClick, emptyMessage, className, tableOptions, }: DataTableProps<TData>): JSX.Element;
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* A faceted filter button for DataTable, inspired by shadcn's Tasks example.
|
|
514
|
+
*
|
|
515
|
+
* Renders a labeled button (e.g. "+ Status"). When clicked, opens a
|
|
516
|
+
* searchable popover with checkbox options styled to match the Combobox.
|
|
517
|
+
* Selected values show as badges on the trigger button.
|
|
518
|
+
*
|
|
519
|
+
* Supports two modes:
|
|
520
|
+
* - **Controlled** (`value` + `onValueChange`) for composing with your own state
|
|
521
|
+
* - **Column** (`column` prop) for direct TanStack Table integration
|
|
522
|
+
*
|
|
523
|
+
* Uses the shared Menu primitives for visual consistency with Combobox/Select.
|
|
524
|
+
*/
|
|
525
|
+
export declare function DataTableFacetedFilter<TData, TValue>({ column, title, options, value: controlledValue, onValueChange, }: DataTableFacetedFilterProps<TData, TValue>): JSX.Element;
|
|
526
|
+
|
|
527
|
+
export declare interface DataTableFacetedFilterOption {
|
|
528
|
+
/** Display label */
|
|
529
|
+
readonly label: string;
|
|
530
|
+
/** Internal value for filtering */
|
|
531
|
+
readonly value: string;
|
|
532
|
+
/** Optional icon rendered before the label */
|
|
533
|
+
readonly icon?: ReactNode;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export declare interface DataTableFacetedFilterProps<TData = unknown, TValue = unknown> {
|
|
537
|
+
/** TanStack Table column instance (for direct TanStack integration) */
|
|
538
|
+
column?: Column<TData, TValue>;
|
|
539
|
+
/** Label shown on the trigger button */
|
|
540
|
+
title?: string;
|
|
541
|
+
/** Available filter options */
|
|
542
|
+
options: readonly DataTableFacetedFilterOption[];
|
|
543
|
+
/** Controlled selected values (alternative to column) */
|
|
544
|
+
value?: string[];
|
|
545
|
+
/** Called when selection changes (alternative to column) */
|
|
546
|
+
onValueChange?: (values: string[]) => void;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
export declare interface DataTableProps<TData> {
|
|
550
|
+
/** Column definitions - see @tanstack/react-table ColumnDef */
|
|
551
|
+
columns: ColumnDef<TData, unknown>[];
|
|
552
|
+
/** Data array */
|
|
553
|
+
data: TData[];
|
|
554
|
+
/** Enable column sorting. Default false. */
|
|
555
|
+
sortable?: boolean;
|
|
556
|
+
/** Enable pagination. Default false. */
|
|
557
|
+
paginated?: boolean;
|
|
558
|
+
/** Rows per page when paginated. Default 10. */
|
|
559
|
+
pageSize?: number;
|
|
560
|
+
/** Available page size options. Default [10, 25, 50]. */
|
|
561
|
+
pageSizeOptions?: number[];
|
|
562
|
+
/** Enable row selection with checkboxes. Default false. */
|
|
563
|
+
selectable?: boolean;
|
|
564
|
+
/** Controlled row selection state */
|
|
565
|
+
rowSelection?: RowSelectionState;
|
|
566
|
+
/** Called when row selection changes */
|
|
567
|
+
onRowSelectionChange?: (selection: RowSelectionState) => void;
|
|
568
|
+
/** Called when a row is clicked */
|
|
569
|
+
onRowClick?: (row: Row<TData>) => void;
|
|
570
|
+
/** Message shown when data is empty. Default "No results." */
|
|
571
|
+
emptyMessage?: string | ReactNode;
|
|
572
|
+
/** Additional class on the outer wrapper */
|
|
573
|
+
className?: string;
|
|
574
|
+
/** Additional TanStack Table options for advanced use cases */
|
|
575
|
+
tableOptions?: Partial<TableOptions<TData>>;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* A standalone search input for DataTable.
|
|
580
|
+
*
|
|
581
|
+
* Controlled component -- wire `value` and `onChange` to your own state.
|
|
582
|
+
* For server-side search, use `onChange` to trigger an API call (with
|
|
583
|
+
* debounce if needed). For client-side, pass the value to TanStack Table's
|
|
584
|
+
* `globalFilter` or a column-specific filter.
|
|
585
|
+
*
|
|
586
|
+
* ```tsx
|
|
587
|
+
* const [search, setSearch] = useState("")
|
|
588
|
+
*
|
|
589
|
+
* <DataTableSearch value={search} onChange={setSearch} placeholder="Search repositories..." />
|
|
590
|
+
* <DataTable
|
|
591
|
+
* columns={columns}
|
|
592
|
+
* data={data}
|
|
593
|
+
* tableOptions={{
|
|
594
|
+
* state: { globalFilter: search },
|
|
595
|
+
* onGlobalFilterChange: setSearch,
|
|
596
|
+
* }}
|
|
597
|
+
* />
|
|
598
|
+
* ```
|
|
599
|
+
*/
|
|
600
|
+
export declare function DataTableSearch({ value, onChange, placeholder, className, }: DataTableSearchProps): JSX.Element;
|
|
601
|
+
|
|
602
|
+
export declare interface DataTableSearchProps {
|
|
603
|
+
/** Current search value */
|
|
604
|
+
value: string;
|
|
605
|
+
/** Called when the search value changes */
|
|
606
|
+
onChange: (value: string) => void;
|
|
607
|
+
/** Placeholder text. Default "Search..." */
|
|
608
|
+
placeholder?: string;
|
|
609
|
+
/** Additional class on the outer wrapper */
|
|
610
|
+
className?: string;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Layout container for controls above a DataTable.
|
|
615
|
+
*
|
|
616
|
+
* Renders a horizontal flex row that wraps on small screens. Compose with
|
|
617
|
+
* any combination of `DataTableSearch`, `Select`, `Combobox`, `Button`,
|
|
618
|
+
* or custom elements.
|
|
619
|
+
*
|
|
620
|
+
* ```tsx
|
|
621
|
+
* <DataTableToolbar>
|
|
622
|
+
* <DataTableSearch value={search} onChange={setSearch} />
|
|
623
|
+
* <Select value={status} onValueChange={setStatus} items={statusOptions}>
|
|
624
|
+
* <SelectButton placeholder="Status" />
|
|
625
|
+
* <SelectContent>
|
|
626
|
+
* <SelectOption value="all">All</SelectOption>
|
|
627
|
+
* <SelectOption value="active">Active</SelectOption>
|
|
628
|
+
* </SelectContent>
|
|
629
|
+
* </Select>
|
|
630
|
+
* </DataTableToolbar>
|
|
631
|
+
* ```
|
|
632
|
+
*/
|
|
633
|
+
export declare function DataTableToolbar({ children, className, }: DataTableToolbarProps): JSX.Element;
|
|
634
|
+
|
|
635
|
+
export declare interface DataTableToolbarProps {
|
|
636
|
+
/** Toolbar contents -- typically DataTableSearch, Select, Combobox, Button, etc. */
|
|
637
|
+
children: ReactNode;
|
|
638
|
+
/** Additional class on the outer wrapper */
|
|
639
|
+
className?: string;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export declare const Dialog: {
|
|
643
|
+
Root: typeof DialogRoot;
|
|
644
|
+
Trigger: ForwardRefExoticComponent<Omit<DialogTriggerProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
645
|
+
Content: typeof DialogContent;
|
|
646
|
+
Panel: ForwardRefExoticComponent<DialogPanelProps & RefAttributes<HTMLDivElement>>;
|
|
647
|
+
Title: ForwardRefExoticComponent<Omit<DialogTitleProps, "ref"> & RefAttributes<HTMLHeadingElement>>;
|
|
648
|
+
Body: ForwardRefExoticComponent<DialogBodyProps & RefAttributes<HTMLDivElement>>;
|
|
649
|
+
Footer: ForwardRefExoticComponent<DialogFooterProps & RefAttributes<HTMLDivElement>>;
|
|
650
|
+
Close: ForwardRefExoticComponent<Omit<DialogCloseProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
651
|
+
Description: ForwardRefExoticComponent<Omit<DialogDescriptionProps, "ref"> & RefAttributes<HTMLParagraphElement>>;
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
export declare interface DialogBackdropProps extends ComponentProps<typeof Dialog_2.Backdrop> {
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export declare interface DialogBodyProps {
|
|
658
|
+
className?: string;
|
|
659
|
+
children: ReactNode;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
export declare interface DialogCloseProps extends ComponentProps<typeof Dialog_2.Close> {
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
declare function DialogContent({ size, className, children, ...props }: DialogContentProps): JSX.Element;
|
|
666
|
+
|
|
667
|
+
export declare interface DialogContentProps extends ComponentProps<typeof Dialog_2.Popup> {
|
|
668
|
+
size?: DialogSize;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export declare interface DialogDescriptionProps extends ComponentProps<typeof Dialog_2.Description> {
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
export declare interface DialogFooterProps {
|
|
675
|
+
className?: string;
|
|
676
|
+
children: ReactNode;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
export declare interface DialogPanelProps {
|
|
680
|
+
className?: string;
|
|
681
|
+
children: ReactNode;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
declare function DialogRoot({ ...props }: DialogRootProps): JSX.Element;
|
|
685
|
+
|
|
686
|
+
export declare interface DialogRootProps extends ComponentProps<typeof Dialog_2.Root> {
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
export declare type DialogSize = keyof typeof sizeStyles_4;
|
|
690
|
+
|
|
691
|
+
export declare interface DialogTitleProps extends ComponentProps<typeof Dialog_2.Title> {
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
export declare interface DialogTriggerProps extends ComponentProps<typeof Dialog_2.Trigger> {
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Return type for `useDirtyState`.
|
|
699
|
+
*
|
|
700
|
+
* Provides a draft/saved state pair with helpers for detecting changes,
|
|
701
|
+
* updating individual fields, discarding edits, and persisting them.
|
|
702
|
+
*/
|
|
703
|
+
export declare interface DirtyState<T extends object> {
|
|
704
|
+
/** The current in-flight draft (may differ from saved). */
|
|
705
|
+
readonly draft: T;
|
|
706
|
+
/** The last-saved snapshot. */
|
|
707
|
+
readonly saved: T;
|
|
708
|
+
/** `true` when draft differs from saved. */
|
|
709
|
+
readonly dirty: boolean;
|
|
710
|
+
/** Replace the entire draft. */
|
|
711
|
+
readonly setDraft: React.Dispatch<React.SetStateAction<T>>;
|
|
712
|
+
/** Update a single field on the draft. */
|
|
713
|
+
readonly update: <K extends keyof T>(key: K, value: T[K]) => void;
|
|
714
|
+
/** Reset draft back to the saved snapshot. */
|
|
715
|
+
readonly discard: () => void;
|
|
716
|
+
/** Promote the current draft to saved (optimistic save). */
|
|
717
|
+
readonly save: () => void;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export declare const Drawer: {
|
|
721
|
+
Root: typeof DrawerRoot;
|
|
722
|
+
Trigger: ForwardRefExoticComponent<Omit<DrawerTriggerProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
723
|
+
Content: typeof DrawerContent;
|
|
724
|
+
Header: ForwardRefExoticComponent<DrawerHeaderProps & RefAttributes<HTMLDivElement>>;
|
|
725
|
+
Title: ForwardRefExoticComponent<Omit<DrawerTitleProps, "ref"> & RefAttributes<HTMLHeadingElement>>;
|
|
726
|
+
Description: ForwardRefExoticComponent<Omit<DrawerDescriptionProps, "ref"> & RefAttributes<HTMLParagraphElement>>;
|
|
727
|
+
Body: ForwardRefExoticComponent<DrawerBodyProps & RefAttributes<HTMLDivElement>>;
|
|
728
|
+
Footer: ForwardRefExoticComponent<DrawerFooterProps & RefAttributes<HTMLDivElement>>;
|
|
729
|
+
Close: ForwardRefExoticComponent<Omit<DrawerCloseProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
export declare interface DrawerBackdropProps extends ComponentProps<typeof Drawer_2.Backdrop> {
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
export declare interface DrawerBodyProps {
|
|
736
|
+
className?: string;
|
|
737
|
+
children: ReactNode;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
export declare interface DrawerCloseProps extends ComponentProps<typeof Drawer_2.Close> {
|
|
741
|
+
/** Show default X icon. Default: true when no children. */
|
|
742
|
+
asIcon?: boolean;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
declare function DrawerContent({ side, responsive, className, children, ...props }: DrawerContentProps): JSX.Element;
|
|
746
|
+
|
|
747
|
+
export declare interface DrawerContentProps extends ComponentProps<typeof Drawer_2.Popup> {
|
|
748
|
+
/** Which edge. Must match the Root side. Default: "right". */
|
|
749
|
+
side?: DrawerSide;
|
|
750
|
+
/** When true, switches to bottom on mobile. Default: true. */
|
|
751
|
+
responsive?: boolean;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export declare interface DrawerDescriptionProps extends ComponentProps<typeof Drawer_2.Description> {
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
export declare interface DrawerFooterProps {
|
|
758
|
+
className?: string;
|
|
759
|
+
children: ReactNode;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
export declare interface DrawerHeaderProps {
|
|
763
|
+
className?: string;
|
|
764
|
+
children: ReactNode;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
declare function DrawerRoot({ side, responsive: _responsive, children, ...props }: DrawerRootProps): JSX.Element;
|
|
768
|
+
|
|
769
|
+
export declare interface DrawerRootProps extends Omit<ComponentProps<typeof Drawer_2.Root>, "swipeDirection"> {
|
|
770
|
+
/** Which edge the drawer slides in from. Default: "right". */
|
|
771
|
+
side?: DrawerSide;
|
|
772
|
+
/**
|
|
773
|
+
* When true (default), automatically switches to "bottom" on small viewports.
|
|
774
|
+
* The CSS handles this via media queries on the Popup element.
|
|
775
|
+
*/
|
|
776
|
+
responsive?: boolean;
|
|
777
|
+
children: ReactNode;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
declare type DrawerSide = "right" | "left" | "bottom" | "top";
|
|
781
|
+
|
|
782
|
+
export declare interface DrawerTitleProps extends ComponentProps<typeof Drawer_2.Title> {
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
export declare interface DrawerTriggerProps extends ComponentProps<typeof Drawer_2.Trigger> {
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
export declare const DropdownMenu: {
|
|
789
|
+
Root: typeof DropdownMenuRoot;
|
|
790
|
+
Trigger: ForwardRefExoticComponent<Omit<DropdownMenuTriggerProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
791
|
+
Content: typeof DropdownMenuContent;
|
|
792
|
+
Item: ForwardRefExoticComponent<DropdownMenuItemProps & RefAttributes<HTMLDivElement>>;
|
|
793
|
+
Separator: ForwardRefExoticComponent<DropdownMenuSeparatorProps & RefAttributes<HTMLDivElement>>;
|
|
794
|
+
Label: ForwardRefExoticComponent<DropdownMenuLabelProps & RefAttributes<HTMLDivElement>>;
|
|
795
|
+
Group: ForwardRefExoticComponent<DropdownMenuGroupProps & RefAttributes<HTMLDivElement>>;
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
declare function DropdownMenuContent({ side, align, sideOffset, minWidth, className, children, }: DropdownMenuContentProps): JSX.Element;
|
|
799
|
+
|
|
800
|
+
export declare interface DropdownMenuContentProps {
|
|
801
|
+
/** Side relative to the trigger */
|
|
802
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
803
|
+
/** Alignment relative to the trigger */
|
|
804
|
+
align?: "start" | "center" | "end";
|
|
805
|
+
/** Offset from the trigger in px */
|
|
806
|
+
sideOffset?: number;
|
|
807
|
+
/** Minimum width */
|
|
808
|
+
minWidth?: string;
|
|
809
|
+
className?: string;
|
|
810
|
+
children: ReactNode;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export declare interface DropdownMenuGroupProps {
|
|
814
|
+
className?: string;
|
|
815
|
+
children: ReactNode;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
export declare interface DropdownMenuItemProps {
|
|
819
|
+
/** Danger styling (red text) */
|
|
820
|
+
variant?: "default" | "danger";
|
|
821
|
+
/** Icon element rendered before the label */
|
|
822
|
+
icon?: ReactNode;
|
|
823
|
+
/** Called when the item is clicked */
|
|
824
|
+
onClick?: () => void;
|
|
825
|
+
/** Close menu on click. Default true. */
|
|
826
|
+
closeOnClick?: boolean;
|
|
827
|
+
/** Whether the item is disabled */
|
|
828
|
+
disabled?: boolean;
|
|
829
|
+
className?: string;
|
|
830
|
+
children?: ReactNode;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
export declare interface DropdownMenuLabelProps {
|
|
834
|
+
className?: string;
|
|
835
|
+
children: ReactNode;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
declare function DropdownMenuRoot({ open, defaultOpen, onOpenChange, modal, children, }: DropdownMenuRootProps): JSX.Element;
|
|
839
|
+
|
|
840
|
+
export declare interface DropdownMenuRootProps {
|
|
841
|
+
/** Controlled open state */
|
|
842
|
+
open?: boolean;
|
|
843
|
+
/** Uncontrolled default open state */
|
|
844
|
+
defaultOpen?: boolean;
|
|
845
|
+
/** Called when open state changes */
|
|
846
|
+
onOpenChange?: (open: boolean) => void;
|
|
847
|
+
/** Whether the menu is modal (locks scroll + traps focus). Default true. */
|
|
848
|
+
modal?: boolean;
|
|
849
|
+
children: ReactNode;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
export declare interface DropdownMenuSeparatorProps {
|
|
853
|
+
className?: string;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
export declare interface DropdownMenuTriggerProps extends ComponentProps<typeof Menu.Trigger> {
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export declare function FlickeringGrid({ squareSize, gridGap, flickerChance, color, maxOpacity, sweep, sweepDirection, sweepDuration, sweepWidth, sweepOnly, sweepNoise, className, }: FlickeringGridProps): JSX.Element;
|
|
860
|
+
|
|
861
|
+
export declare interface FlickeringGridProps {
|
|
862
|
+
/** Size of each square pixel in px */
|
|
863
|
+
squareSize?: number;
|
|
864
|
+
/** Gap between squares in px */
|
|
865
|
+
gridGap?: number;
|
|
866
|
+
/** Probability per second that a pixel changes opacity (0-1) */
|
|
867
|
+
flickerChance?: number;
|
|
868
|
+
/** Pixel color — CSS color string. Use `currentColor` to inherit from text */
|
|
869
|
+
color?: string;
|
|
870
|
+
/** Max opacity for any pixel (0-1) */
|
|
871
|
+
maxOpacity?: number;
|
|
872
|
+
/**
|
|
873
|
+
* Enable a sweeping wave of brightness across the grid.
|
|
874
|
+
* When enabled, pixels near the wave front appear brighter.
|
|
875
|
+
*/
|
|
876
|
+
sweep?: boolean;
|
|
877
|
+
/** Sweep direction */
|
|
878
|
+
sweepDirection?: "left" | "right";
|
|
879
|
+
/** Duration of one sweep cycle in seconds */
|
|
880
|
+
sweepDuration?: number;
|
|
881
|
+
/** Width of the sweep band as a fraction of total width (0-1) */
|
|
882
|
+
sweepWidth?: number;
|
|
883
|
+
/**
|
|
884
|
+
* When true, disables random flicker and drives pixel opacity purely
|
|
885
|
+
* from the sweep wave. Each pixel gets a fixed noise offset so the
|
|
886
|
+
* wave front has a fuzzy, fringing edge instead of a clean line.
|
|
887
|
+
*/
|
|
888
|
+
sweepOnly?: boolean;
|
|
889
|
+
/**
|
|
890
|
+
* Magnitude of the per-pixel noise offset (0-1) when `sweepOnly` is true.
|
|
891
|
+
* Higher values produce fuzzier, more chaotic edges.
|
|
892
|
+
*/
|
|
893
|
+
sweepNoise?: number;
|
|
894
|
+
className?: string;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
export declare const Form: {
|
|
898
|
+
Field: ForwardRefExoticComponent<Omit<FormFieldProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
899
|
+
Label: ForwardRefExoticComponent<Omit<FormLabelProps, "ref"> & RefAttributes<HTMLLabelElement>>;
|
|
900
|
+
Input: ForwardRefExoticComponent<Omit<FormInputProps, "ref"> & RefAttributes<HTMLInputElement>>;
|
|
901
|
+
Textarea: ForwardRefExoticComponent<Omit<FormTextareaProps, "ref"> & RefAttributes<HTMLTextAreaElement>>;
|
|
902
|
+
Hint: ForwardRefExoticComponent<Omit<FormHintProps, "ref"> & RefAttributes<HTMLParagraphElement>>;
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
export declare interface FormFieldProps extends ComponentProps<typeof Field.Root> {
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
export declare interface FormHintProps extends ComponentProps<typeof Field.Description> {
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
export declare interface FormInputProps extends ComponentProps<typeof Field.Control> {
|
|
912
|
+
/** Icon element rendered before the input */
|
|
913
|
+
iconLeft?: ReactNode;
|
|
914
|
+
/** Icon element rendered after the input */
|
|
915
|
+
iconRight?: ReactNode;
|
|
916
|
+
/** Additional classes on the outer wrapper (only when icons are present) */
|
|
917
|
+
wrapperClassName?: string;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
export declare interface FormLabelProps extends ComponentProps<typeof Field.Label> {
|
|
921
|
+
required?: boolean;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
export declare interface FormTextareaProps extends ComponentProps<typeof Field.Control> {
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Animated hover/focus wrapper.
|
|
929
|
+
*
|
|
930
|
+
* **Standalone**: renders an absolutely-positioned background layer behind its
|
|
931
|
+
* children that transitions in on hover/focus. On press, the background shrinks
|
|
932
|
+
* by 1px on all sides.
|
|
933
|
+
*
|
|
934
|
+
* **Inside Hover.Group**: registers for the shared sliding hover pill.
|
|
935
|
+
* When `active`, renders its own static background with the press inset
|
|
936
|
+
* effect (same as standalone active state). The group pill handles hover.
|
|
937
|
+
*/
|
|
938
|
+
export declare function Hover({ children, active, background, backgroundClassName, borderRadius, focus, interactive, instantHover, disabled, fullWidth, className, }: HoverProps): JSX.Element;
|
|
939
|
+
|
|
940
|
+
export declare function HoverGroup({ children, background, borderRadius, className, }: HoverGroupProps): JSX.Element;
|
|
941
|
+
|
|
942
|
+
export declare interface HoverGroupProps {
|
|
943
|
+
children: ReactNode;
|
|
944
|
+
/** Background class for the sliding pill */
|
|
945
|
+
background?: string;
|
|
946
|
+
/** Border radius class for the sliding pill */
|
|
947
|
+
borderRadius?: string;
|
|
948
|
+
className?: string;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
export declare interface HoverProps {
|
|
952
|
+
children: ReactNode;
|
|
953
|
+
/** Force the hover background visible (e.g. active/selected state) */
|
|
954
|
+
active?: boolean;
|
|
955
|
+
/** Background class applied to the hover layer */
|
|
956
|
+
background?: string;
|
|
957
|
+
/** Additional classes on the animated background layer (border, shadow, hover color shifts, etc.) */
|
|
958
|
+
backgroundClassName?: string;
|
|
959
|
+
/** Border radius class */
|
|
960
|
+
borderRadius?: string;
|
|
961
|
+
/** Enable focus ring */
|
|
962
|
+
focus?: boolean;
|
|
963
|
+
/** Enable active/press shrink effect */
|
|
964
|
+
interactive?: boolean;
|
|
965
|
+
/** When true, hover bg appears instantly (no opacity/inset transition).
|
|
966
|
+
* Only the press effect (inset shrink) animates. Useful for menus. */
|
|
967
|
+
instantHover?: boolean;
|
|
968
|
+
/** Disable all hover/focus effects */
|
|
969
|
+
disabled?: boolean;
|
|
970
|
+
/** Stretch to full width */
|
|
971
|
+
fullWidth?: boolean;
|
|
972
|
+
className?: string;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
declare type LinkComponent = ComponentType<{
|
|
976
|
+
to?: string;
|
|
977
|
+
href?: string;
|
|
978
|
+
className?: string;
|
|
979
|
+
children?: ReactNode;
|
|
980
|
+
}>;
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* CodeRabbit logo mark.
|
|
984
|
+
*/
|
|
985
|
+
export declare const Logo: ForwardRefExoticComponent<LogoProps & RefAttributes<SVGSVGElement>>;
|
|
986
|
+
|
|
987
|
+
export declare interface LogoProps {
|
|
988
|
+
/** Visual variant: 'mark' (rabbit only) or 'circle' (rabbit in a filled circle) */
|
|
989
|
+
variant?: LogoVariant;
|
|
990
|
+
/** Size of the logo SVG */
|
|
991
|
+
size?: number;
|
|
992
|
+
className?: string;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
declare type LogoVariant = "mark" | "circle";
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Individual navigation link item.
|
|
999
|
+
*
|
|
1000
|
+
* Inside a NavLinks (HoverGroup), automatically gets the shared sliding
|
|
1001
|
+
* indicator on hover and a press shrink effect on click.
|
|
1002
|
+
* Renders a `<button>` by default - when `href` is provided,
|
|
1003
|
+
* renders an `<a>` tag instead.
|
|
1004
|
+
*/
|
|
1005
|
+
export declare function NavLink({ active, icon, href, onClick, className, children, }: NavLinkProps): JSX.Element;
|
|
1006
|
+
|
|
1007
|
+
export declare interface NavLinkProps {
|
|
1008
|
+
/** Whether this link is the currently active/selected item */
|
|
1009
|
+
active?: boolean;
|
|
1010
|
+
/** Optional icon rendered before the label */
|
|
1011
|
+
icon?: ReactNode;
|
|
1012
|
+
/** When provided, renders an <a> tag instead of <button> */
|
|
1013
|
+
href?: string;
|
|
1014
|
+
/** Click handler */
|
|
1015
|
+
onClick?: () => void;
|
|
1016
|
+
className?: string;
|
|
1017
|
+
children: ReactNode;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* Container for a horizontal group of navigation links.
|
|
1022
|
+
*
|
|
1023
|
+
* Wraps children in a HoverGroup so the sliding indicator
|
|
1024
|
+
* is shared across all NavLink items.
|
|
1025
|
+
*/
|
|
1026
|
+
export declare function NavLinks({ className, children }: NavLinksProps): JSX.Element;
|
|
1027
|
+
|
|
1028
|
+
export declare interface NavLinksProps {
|
|
1029
|
+
className?: string;
|
|
1030
|
+
children: ReactNode;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Full-page layout shell.
|
|
1035
|
+
*
|
|
1036
|
+
* Provides the standard page structure:
|
|
1037
|
+
* base background → header → content panel with nav.
|
|
1038
|
+
*/
|
|
1039
|
+
export declare const PageLayout: ForwardRefExoticComponent<PageLayoutProps & RefAttributes<HTMLDivElement>>;
|
|
1040
|
+
|
|
1041
|
+
export declare interface PageLayoutProps {
|
|
1042
|
+
/** Header content (typically AppHeader) */
|
|
1043
|
+
header?: ReactNode;
|
|
1044
|
+
/** Navigation content (typically NavLinks) */
|
|
1045
|
+
nav?: ReactNode;
|
|
1046
|
+
className?: string;
|
|
1047
|
+
children: ReactNode;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* Pagination toolbar with clickable page numbers, optional rows-per-page
|
|
1052
|
+
* selector, and optional result count.
|
|
1053
|
+
*
|
|
1054
|
+
* Renders as a cohesive strip - pass `rowsPerPage` + `onRowsPerPageChange`
|
|
1055
|
+
* to show the rows-per-page selector, and `totalItems` to show the result count.
|
|
1056
|
+
*/
|
|
1057
|
+
export declare function Pagination({ page, pageCount, onPageChange, totalItems, rowsPerPage, onRowsPerPageChange, rowOptions, siblingCount, className, }: PaginationProps): JSX.Element | null;
|
|
1058
|
+
|
|
1059
|
+
export declare interface PaginationProps {
|
|
1060
|
+
/** Current page (1-indexed) */
|
|
1061
|
+
page: number;
|
|
1062
|
+
/** Total number of pages */
|
|
1063
|
+
pageCount: number;
|
|
1064
|
+
/** Called when the page changes */
|
|
1065
|
+
onPageChange?: (page: number) => void;
|
|
1066
|
+
/** Total item count - shows "1–10 of X" when provided */
|
|
1067
|
+
totalItems?: number;
|
|
1068
|
+
/** Rows per page - shows selector when provided with onRowsPerPageChange */
|
|
1069
|
+
rowsPerPage?: number;
|
|
1070
|
+
/** Called when rows per page changes */
|
|
1071
|
+
onRowsPerPageChange?: (rows: number) => void;
|
|
1072
|
+
/** Available row count options. Default [10, 25, 50] */
|
|
1073
|
+
rowOptions?: number[];
|
|
1074
|
+
/** Number of sibling pages to show around active page. Default 1 */
|
|
1075
|
+
siblingCount?: number;
|
|
1076
|
+
className?: string;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* A 3x3 pixel-grid spinner with configurable animation variants.
|
|
1081
|
+
*
|
|
1082
|
+
* All 9 cells render; the `variant` controls how they animate:
|
|
1083
|
+
*
|
|
1084
|
+
* - `hole` One dim cell rotates around a bright ring (center bright)
|
|
1085
|
+
* - `trail` A fading 5-cell trail chases around the ring
|
|
1086
|
+
* - `wave` Anti-diagonal wave sweeps top-left to bottom-right
|
|
1087
|
+
* - `radiate` Rings expand outward: center to edges to corners
|
|
1088
|
+
* - `pulse` All cells breathe together with a subtle ripple
|
|
1089
|
+
* - `static` Cells flicker independently (TV static)
|
|
1090
|
+
*/
|
|
1091
|
+
export declare function PixelSpinner({ variant, size, gap, duration, className, }: PixelSpinnerProps): JSX.Element;
|
|
1092
|
+
|
|
1093
|
+
export declare interface PixelSpinnerProps {
|
|
1094
|
+
/** Animation variant */
|
|
1095
|
+
variant?: PixelSpinnerVariant;
|
|
1096
|
+
/**
|
|
1097
|
+
* Size preset or raw px value.
|
|
1098
|
+
* Presets: `xs` = 10px, `sm` = 14px, `md` = 20px, `lg` = 32px.
|
|
1099
|
+
* Default is `xs`.
|
|
1100
|
+
*/
|
|
1101
|
+
size?: PixelSpinnerSize | number;
|
|
1102
|
+
/** Gap between pixels as a fraction of pixel size (0-1). Default 0.25. */
|
|
1103
|
+
gap?: number;
|
|
1104
|
+
/** Cycle duration in seconds. Default 1.2. */
|
|
1105
|
+
duration?: number;
|
|
1106
|
+
className?: string;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
declare type PixelSpinnerSize = "xs" | "sm" | "md" | "lg";
|
|
1110
|
+
|
|
1111
|
+
export declare type PixelSpinnerVariant =
|
|
1112
|
+
/** One dim cell rotates around a bright ring; center bright */
|
|
1113
|
+
"hole"
|
|
1114
|
+
/** Trail of 5 fading cells chases around the ring; center dim */
|
|
1115
|
+
| "trail"
|
|
1116
|
+
/** Diagonal wave sweeps from top-left to bottom-right */
|
|
1117
|
+
| "wave"
|
|
1118
|
+
/** Rings expand outward: center to middle to corners, repeating */
|
|
1119
|
+
| "radiate"
|
|
1120
|
+
/** All cells pulse together */
|
|
1121
|
+
| "pulse"
|
|
1122
|
+
/** All cells flicker independently (TV static) */
|
|
1123
|
+
| "static";
|
|
1124
|
+
|
|
1125
|
+
export declare const Popover: {
|
|
1126
|
+
Root: typeof PopoverRoot;
|
|
1127
|
+
Trigger: ForwardRefExoticComponent<Omit<PopoverTriggerProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
1128
|
+
Content: typeof PopoverContent;
|
|
1129
|
+
Arrow: ForwardRefExoticComponent<Omit<PopoverArrowProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
1130
|
+
Close: ForwardRefExoticComponent<Omit<PopoverCloseProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
1131
|
+
Title: ForwardRefExoticComponent<PopoverTitleProps & RefAttributes<HTMLParagraphElement>>;
|
|
1132
|
+
Description: ForwardRefExoticComponent<Omit<PopoverDescriptionProps, "ref"> & RefAttributes<HTMLParagraphElement>>;
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
export declare interface PopoverArrowProps extends ComponentProps<typeof Popover_2.Arrow> {
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
export declare interface PopoverCloseProps extends ComponentProps<typeof Popover_2.Close> {
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
declare function PopoverContent({ side, align, sideOffset, className, children, ...props }: PopoverContentProps): JSX.Element;
|
|
1142
|
+
|
|
1143
|
+
export declare interface PopoverContentProps extends ComponentProps<typeof Popover_2.Popup> {
|
|
1144
|
+
/** Side relative to the trigger */
|
|
1145
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
1146
|
+
/** Alignment relative to the trigger */
|
|
1147
|
+
align?: "start" | "center" | "end";
|
|
1148
|
+
/** Offset from the trigger in px */
|
|
1149
|
+
sideOffset?: number;
|
|
1150
|
+
children: ReactNode;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
export declare interface PopoverDescriptionProps extends ComponentProps<typeof Popover_2.Description> {
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
declare function PopoverRoot(props: PopoverRootProps): JSX.Element;
|
|
1157
|
+
|
|
1158
|
+
export declare interface PopoverRootProps extends ComponentProps<typeof Popover_2.Root> {
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
export declare interface PopoverTitleProps {
|
|
1162
|
+
className?: string;
|
|
1163
|
+
children: ReactNode;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
export declare interface PopoverTriggerProps extends ComponentProps<typeof Popover_2.Trigger> {
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
export { Row }
|
|
1170
|
+
|
|
1171
|
+
export { RowSelectionState }
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* Floating pill pinned to the bottom of the viewport.
|
|
1175
|
+
* Slides up when a form has unsaved changes.
|
|
1176
|
+
*/
|
|
1177
|
+
export declare const SaveBar: ForwardRefExoticComponent<SaveBarProps & RefAttributes<HTMLDivElement>>;
|
|
1178
|
+
|
|
1179
|
+
export declare interface SaveBarProps {
|
|
1180
|
+
/** Whether the bar is visible (typically bound to a dirty flag). */
|
|
1181
|
+
show: boolean;
|
|
1182
|
+
/** Message shown inside the pill. Defaults to "You have unsaved changes". */
|
|
1183
|
+
message?: ReactNode;
|
|
1184
|
+
/** Label for the discard button. Defaults to "Reset". */
|
|
1185
|
+
discardLabel?: string;
|
|
1186
|
+
/** Label for the save button. Defaults to "Save changes". */
|
|
1187
|
+
saveLabel?: string;
|
|
1188
|
+
/** Called when the user clicks discard. */
|
|
1189
|
+
onDiscard: () => void;
|
|
1190
|
+
/** Called when the user clicks save. */
|
|
1191
|
+
onSave: () => void;
|
|
1192
|
+
/** Show a loading spinner on the save button. */
|
|
1193
|
+
saving?: boolean;
|
|
1194
|
+
/** Disable the save button (e.g. validation failure). */
|
|
1195
|
+
saveDisabled?: boolean;
|
|
1196
|
+
/** Trigger a shake animation to draw attention (e.g. when navigation is blocked). */
|
|
1197
|
+
shake?: boolean;
|
|
1198
|
+
className?: string;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
/**
|
|
1202
|
+
* Segmented control with a sliding indicator that animates between options.
|
|
1203
|
+
*
|
|
1204
|
+
* Two layout modes:
|
|
1205
|
+
* - `fill` (default) - equal-width segments via CSS grid, indicator positioned with translateX
|
|
1206
|
+
* - `fit` - segments size to content, indicator position/width measured from DOM
|
|
1207
|
+
*/
|
|
1208
|
+
export declare function SegmentedControl<T extends string = string>({ options, value: controlledValue, defaultValue, onValueChange, layout, className, }: SegmentedControlProps<T>): JSX.Element;
|
|
1209
|
+
|
|
1210
|
+
export declare interface SegmentedControlOption<T extends string = string> {
|
|
1211
|
+
value: T;
|
|
1212
|
+
label?: string;
|
|
1213
|
+
icon?: ReactNode;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
export declare interface SegmentedControlProps<T extends string = string> {
|
|
1217
|
+
/** Options to display as segments */
|
|
1218
|
+
options: SegmentedControlOption<T>[];
|
|
1219
|
+
/** Controlled value */
|
|
1220
|
+
value?: T;
|
|
1221
|
+
/** Uncontrolled default value */
|
|
1222
|
+
defaultValue?: T;
|
|
1223
|
+
/** Called when the selected segment changes */
|
|
1224
|
+
onValueChange?: (value: T) => void;
|
|
1225
|
+
/**
|
|
1226
|
+
* Layout mode:
|
|
1227
|
+
* - `fill` - segments divide space equally (default)
|
|
1228
|
+
* - `fit` - segments hug their content
|
|
1229
|
+
*/
|
|
1230
|
+
layout?: "fill" | "fit";
|
|
1231
|
+
className?: string;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
/**
|
|
1235
|
+
* Select component for choosing from a list of predefined options.
|
|
1236
|
+
*
|
|
1237
|
+
* For searchable/filterable lists, use Combobox instead.
|
|
1238
|
+
*
|
|
1239
|
+
* Wraps Base UI Select.Root with shared Menu visual primitives.
|
|
1240
|
+
*/
|
|
1241
|
+
export declare function Select({ value, defaultValue, onValueChange, items, disabled, children, className, }: SelectProps): ReactElement;
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* Pre-styled trigger for form contexts.
|
|
1245
|
+
* Renders as a Button with the selected value + chevron icon.
|
|
1246
|
+
*/
|
|
1247
|
+
export declare const SelectButton: ForwardRefExoticComponent<SelectButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
1248
|
+
|
|
1249
|
+
export declare interface SelectButtonProps {
|
|
1250
|
+
/** Placeholder text shown when no value is selected */
|
|
1251
|
+
placeholder?: string;
|
|
1252
|
+
className?: string;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* Popup with a scrollable list of options.
|
|
1257
|
+
* Uses Base UI Select primitives with shared Menu visuals.
|
|
1258
|
+
*/
|
|
1259
|
+
export declare function SelectContent({ align, side, sideOffset, minWidth, children, className, }: SelectContentProps): ReactElement;
|
|
1260
|
+
|
|
1261
|
+
export declare interface SelectContentProps {
|
|
1262
|
+
/** Alignment relative to trigger */
|
|
1263
|
+
align?: "start" | "center" | "end";
|
|
1264
|
+
/** Side relative to the trigger */
|
|
1265
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
1266
|
+
/** Offset from the trigger in px */
|
|
1267
|
+
sideOffset?: number;
|
|
1268
|
+
/** Minimum width */
|
|
1269
|
+
minWidth?: string;
|
|
1270
|
+
/** SelectOption elements */
|
|
1271
|
+
children?: ReactNode;
|
|
1272
|
+
className?: string;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
export declare const SelectGroup: ForwardRefExoticComponent<SelectGroupProps & RefAttributes<HTMLDivElement>>;
|
|
1276
|
+
|
|
1277
|
+
export declare const SelectGroupLabel: ForwardRefExoticComponent<SelectGroupLabelProps & RefAttributes<HTMLDivElement>>;
|
|
1278
|
+
|
|
1279
|
+
export declare interface SelectGroupLabelProps {
|
|
1280
|
+
className?: string;
|
|
1281
|
+
children: ReactNode;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
export declare interface SelectGroupProps {
|
|
1285
|
+
className?: string;
|
|
1286
|
+
children: ReactNode;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
export declare interface SelectItem {
|
|
1290
|
+
value: string;
|
|
1291
|
+
label: string;
|
|
1292
|
+
icon?: ReactNode;
|
|
1293
|
+
[key: string]: unknown;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
/**
|
|
1297
|
+
* Individual option in the select popup.
|
|
1298
|
+
* Automatically includes a checkmark indicator when selected.
|
|
1299
|
+
*/
|
|
1300
|
+
export declare const SelectOption: ForwardRefExoticComponent<SelectOptionProps & RefAttributes<HTMLDivElement>>;
|
|
1301
|
+
|
|
1302
|
+
export declare interface SelectOptionProps {
|
|
1303
|
+
/** Value for this option */
|
|
1304
|
+
value: string;
|
|
1305
|
+
/** Icon element rendered before the label */
|
|
1306
|
+
icon?: ReactNode;
|
|
1307
|
+
children: ReactNode;
|
|
1308
|
+
className?: string;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
export declare interface SelectProps {
|
|
1312
|
+
/** Controlled value */
|
|
1313
|
+
value?: string;
|
|
1314
|
+
/** Uncontrolled default value */
|
|
1315
|
+
defaultValue?: string;
|
|
1316
|
+
/** Called when a value is selected */
|
|
1317
|
+
onValueChange?: (value: string) => void;
|
|
1318
|
+
/** Item data for rendering and value display */
|
|
1319
|
+
items: SelectItem[];
|
|
1320
|
+
/** Whether the select is disabled */
|
|
1321
|
+
disabled?: boolean;
|
|
1322
|
+
children: ReactNode;
|
|
1323
|
+
className?: string;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
export declare const SelectSeparator: ForwardRefExoticComponent<SelectSeparatorProps & RefAttributes<HTMLDivElement>>;
|
|
1327
|
+
|
|
1328
|
+
export declare interface SelectSeparatorProps {
|
|
1329
|
+
className?: string;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* Fully composable trigger. Renders whatever children you give it as the
|
|
1334
|
+
* element that opens the select popup.
|
|
1335
|
+
*/
|
|
1336
|
+
export declare const SelectTrigger: ForwardRefExoticComponent<SelectTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
1337
|
+
|
|
1338
|
+
export declare interface SelectTriggerProps {
|
|
1339
|
+
children: ReactNode;
|
|
1340
|
+
className?: string;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
export declare const Separator: ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & RefAttributes<HTMLHRElement>>;
|
|
1344
|
+
|
|
1345
|
+
export declare interface SeparatorProps extends ComponentProps<typeof Separator_2> {
|
|
1346
|
+
orientation?: "horizontal" | "vertical";
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
/**
|
|
1350
|
+
* A specialized card for settings pages. Uses the Card component internally
|
|
1351
|
+
* with an optional header and a nested card for the settings rows.
|
|
1352
|
+
*
|
|
1353
|
+
* Pass `toggle` to show a toggle in the header. When toggled on, the child
|
|
1354
|
+
* rows are visually disabled (muted + non-interactive).
|
|
1355
|
+
*/
|
|
1356
|
+
export declare const SettingsCard: ForwardRefExoticComponent<SettingsCardProps & RefAttributes<HTMLDivElement>>;
|
|
1357
|
+
|
|
1358
|
+
export declare interface SettingsCardProps {
|
|
1359
|
+
/** Title displayed in the card header */
|
|
1360
|
+
title?: string;
|
|
1361
|
+
/** Description displayed below the title */
|
|
1362
|
+
description?: string;
|
|
1363
|
+
/**
|
|
1364
|
+
* When true, renders a Toggle in the header. Toggling it on disables (mutes)
|
|
1365
|
+
* the card's rows - useful for "Use Organization Settings" patterns.
|
|
1366
|
+
*/
|
|
1367
|
+
toggle?: boolean;
|
|
1368
|
+
/** Controlled toggle state */
|
|
1369
|
+
toggled?: boolean;
|
|
1370
|
+
/** Callback when toggle state changes */
|
|
1371
|
+
onToggleChange?: (toggled: boolean) => void;
|
|
1372
|
+
/** Initial toggle state for uncontrolled usage */
|
|
1373
|
+
defaultToggled?: boolean;
|
|
1374
|
+
/** Settings rows or other content */
|
|
1375
|
+
children: ReactNode;
|
|
1376
|
+
className?: string;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Content shell for settings pages.
|
|
1381
|
+
*
|
|
1382
|
+
* Centers content with a max-width constraint, provides consistent
|
|
1383
|
+
* vertical spacing, and renders an optional page title. Designed
|
|
1384
|
+
* to sit inside a `PageLayout` content area.
|
|
1385
|
+
*
|
|
1386
|
+
* ```tsx
|
|
1387
|
+
* <SettingsPage title="General">
|
|
1388
|
+
* <SettingsCard title="Basic settings">
|
|
1389
|
+
* ...
|
|
1390
|
+
* </SettingsCard>
|
|
1391
|
+
* </SettingsPage>
|
|
1392
|
+
* ```
|
|
1393
|
+
*/
|
|
1394
|
+
export declare const SettingsPage: ForwardRefExoticComponent<SettingsPageProps & RefAttributes<HTMLDivElement>>;
|
|
1395
|
+
|
|
1396
|
+
export declare type SettingsPageMaxWidth = "narrow" | "wide";
|
|
1397
|
+
|
|
1398
|
+
export declare interface SettingsPageProps {
|
|
1399
|
+
/** Page title displayed at the top. */
|
|
1400
|
+
title?: ReactNode;
|
|
1401
|
+
/**
|
|
1402
|
+
* Maximum content width.
|
|
1403
|
+
* - `"narrow"` (default): 800px — for settings forms
|
|
1404
|
+
* - `"wide"`: 1100px — for tables, permissions, dashboards
|
|
1405
|
+
*/
|
|
1406
|
+
maxWidth?: SettingsPageMaxWidth;
|
|
1407
|
+
/** Optional leading content rendered above the title (e.g. a back button). */
|
|
1408
|
+
leading?: ReactNode;
|
|
1409
|
+
/** Main page content (cards, forms, tables, etc.). */
|
|
1410
|
+
children: ReactNode;
|
|
1411
|
+
className?: string;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
/**
|
|
1415
|
+
* A row inside a SettingsCard with a label/description on the left
|
|
1416
|
+
* and a control slot on the right.
|
|
1417
|
+
*/
|
|
1418
|
+
export declare const SettingsRow: ForwardRefExoticComponent<SettingsRowProps & RefAttributes<HTMLDivElement>>;
|
|
1419
|
+
|
|
1420
|
+
export declare interface SettingsRowProps {
|
|
1421
|
+
/** Label for the setting */
|
|
1422
|
+
label: string;
|
|
1423
|
+
/** Description of what the setting controls */
|
|
1424
|
+
description?: string;
|
|
1425
|
+
/** Control element (Toggle, Select, etc.) */
|
|
1426
|
+
children?: ReactNode;
|
|
1427
|
+
className?: string;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
declare const sizeStyles: {
|
|
1431
|
+
readonly xs: {
|
|
1432
|
+
readonly height: "h-6";
|
|
1433
|
+
readonly padding: "px-1.5";
|
|
1434
|
+
readonly textPadding: "px-1";
|
|
1435
|
+
readonly icon: "w-6";
|
|
1436
|
+
};
|
|
1437
|
+
readonly sm: {
|
|
1438
|
+
readonly height: "h-7";
|
|
1439
|
+
readonly padding: "px-1.5";
|
|
1440
|
+
readonly textPadding: "px-1";
|
|
1441
|
+
readonly icon: "w-7";
|
|
1442
|
+
};
|
|
1443
|
+
readonly md: {
|
|
1444
|
+
readonly height: "h-8";
|
|
1445
|
+
readonly padding: "px-2";
|
|
1446
|
+
readonly textPadding: "px-1";
|
|
1447
|
+
readonly icon: "w-8";
|
|
1448
|
+
};
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1451
|
+
declare const sizeStyles_2: {
|
|
1452
|
+
readonly sm: {
|
|
1453
|
+
readonly track: "w-9 h-5";
|
|
1454
|
+
readonly thumb: "h-4 w-4 group-active/toggle:w-5";
|
|
1455
|
+
};
|
|
1456
|
+
readonly md: {
|
|
1457
|
+
readonly track: "w-11 h-6";
|
|
1458
|
+
readonly thumb: "h-5 w-5 group-active/toggle:w-6";
|
|
1459
|
+
};
|
|
1460
|
+
};
|
|
1461
|
+
|
|
1462
|
+
declare const sizeStyles_3: {
|
|
1463
|
+
readonly sm: {
|
|
1464
|
+
readonly root: "size-4 rounded-[4px]";
|
|
1465
|
+
readonly icon: "size-3";
|
|
1466
|
+
readonly label: "text-xs";
|
|
1467
|
+
};
|
|
1468
|
+
readonly md: {
|
|
1469
|
+
readonly root: "size-[18px] rounded-[5px]";
|
|
1470
|
+
readonly icon: "size-3.5";
|
|
1471
|
+
readonly label: "text-sm";
|
|
1472
|
+
};
|
|
1473
|
+
};
|
|
1474
|
+
|
|
1475
|
+
declare const sizeStyles_4: {
|
|
1476
|
+
readonly md: "max-w-[450px]";
|
|
1477
|
+
readonly lg: "max-w-[550px]";
|
|
1478
|
+
};
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* Skeleton loading placeholder with a sweeping pixel wave.
|
|
1482
|
+
*
|
|
1483
|
+
* Uses the `sweepOnly` mode of FlickeringGrid: pixels light up purely
|
|
1484
|
+
* based on the sweep wave position, with a per-pixel noise offset
|
|
1485
|
+
* creating a fuzzy, fringing edge on the wave front. No random flicker,
|
|
1486
|
+
* so the effect reads as a single directional motion rather than noise.
|
|
1487
|
+
*/
|
|
1488
|
+
export declare const Skeleton: ForwardRefExoticComponent<SkeletonProps & RefAttributes<HTMLDivElement>>;
|
|
1489
|
+
|
|
1490
|
+
export declare interface SkeletonProps {
|
|
1491
|
+
/** Use rounded-full instead of rounded-md (for avatar placeholders) */
|
|
1492
|
+
circular?: boolean;
|
|
1493
|
+
className?: string;
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
export { SortingState }
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* Text loading indicator with a 3x3 pixel spinner and animated dots.
|
|
1500
|
+
*
|
|
1501
|
+
* Uses `PixelSpinner` for the animated glyph and a CSS animation to cycle
|
|
1502
|
+
* an animated dots suffix on the label text.
|
|
1503
|
+
*/
|
|
1504
|
+
export declare const Spinner: ForwardRefExoticComponent<SpinnerProps & RefAttributes<HTMLSpanElement>>;
|
|
1505
|
+
|
|
1506
|
+
export declare interface SpinnerProps {
|
|
1507
|
+
/** Text label shown next to the spinner. */
|
|
1508
|
+
label?: string;
|
|
1509
|
+
/** Show the animated dots after the label. */
|
|
1510
|
+
showDots?: boolean;
|
|
1511
|
+
/** Show the pixel spinner glyph. */
|
|
1512
|
+
showSpinner?: boolean;
|
|
1513
|
+
/** Size variant. */
|
|
1514
|
+
size?: "sm" | "md";
|
|
1515
|
+
/** Animation variant for the pixel spinner. Defaults to `wave`. */
|
|
1516
|
+
variant?: PixelSpinnerVariant;
|
|
1517
|
+
className?: string;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* Lightweight list-table container.
|
|
1522
|
+
*
|
|
1523
|
+
* Wraps a semantic `<table>` in a rounded, bordered container.
|
|
1524
|
+
* Designed for simple list-style data displays - not a full data-table.
|
|
1525
|
+
*/
|
|
1526
|
+
export declare const Table: ReturnType<typeof forwardRef<HTMLDivElement, TableProps>> & {
|
|
1527
|
+
Header: typeof TableHeader;
|
|
1528
|
+
Body: typeof TableBody;
|
|
1529
|
+
Row: typeof TableRow;
|
|
1530
|
+
HeaderCell: typeof TableHeaderCell;
|
|
1531
|
+
Cell: typeof TableCell;
|
|
1532
|
+
};
|
|
1533
|
+
|
|
1534
|
+
declare const TableBody: ForwardRefExoticComponent<TableBodyProps & RefAttributes<HTMLTableSectionElement>>;
|
|
1535
|
+
|
|
1536
|
+
export declare interface TableBodyProps {
|
|
1537
|
+
readonly className?: string;
|
|
1538
|
+
readonly children: ReactNode;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
declare const TableCell: ForwardRefExoticComponent<TableCellProps & RefAttributes<HTMLTableCellElement>>;
|
|
1542
|
+
|
|
1543
|
+
export declare interface TableCellProps {
|
|
1544
|
+
/** Fixed width in pixels or CSS value */
|
|
1545
|
+
width?: number | string;
|
|
1546
|
+
/** Column span */
|
|
1547
|
+
colSpan?: number;
|
|
1548
|
+
className?: string;
|
|
1549
|
+
children?: ReactNode;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
declare const TableHeader: ForwardRefExoticComponent<TableHeaderProps & RefAttributes<HTMLTableSectionElement>>;
|
|
1553
|
+
|
|
1554
|
+
declare const TableHeaderCell: ForwardRefExoticComponent<TableHeaderCellProps & RefAttributes<HTMLTableCellElement>>;
|
|
1555
|
+
|
|
1556
|
+
export declare interface TableHeaderCellProps {
|
|
1557
|
+
/** Fixed width in pixels or CSS value */
|
|
1558
|
+
width?: number | string;
|
|
1559
|
+
/** Column span */
|
|
1560
|
+
colSpan?: number;
|
|
1561
|
+
className?: string;
|
|
1562
|
+
children?: ReactNode;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
export declare interface TableHeaderProps {
|
|
1566
|
+
readonly className?: string;
|
|
1567
|
+
readonly children: ReactNode;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
export { TableOptions }
|
|
1571
|
+
|
|
1572
|
+
export declare interface TableProps {
|
|
1573
|
+
readonly className?: string;
|
|
1574
|
+
readonly children: ReactNode;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
declare const TableRow: ForwardRefExoticComponent<Omit<TableRowProps, "ref"> & RefAttributes<HTMLTableRowElement>>;
|
|
1578
|
+
|
|
1579
|
+
export declare interface TableRowProps extends Omit<ComponentProps<"tr">, "children"> {
|
|
1580
|
+
className?: string;
|
|
1581
|
+
children: ReactNode;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
export declare const Tabs: {
|
|
1585
|
+
Root: ForwardRefExoticComponent<Omit<TabsRootProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
1586
|
+
List: ForwardRefExoticComponent<Omit<TabsListProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
1587
|
+
Tab: ForwardRefExoticComponent<Omit<TabsTabProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
1588
|
+
Panel: ForwardRefExoticComponent<Omit<TabsPanelProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
1589
|
+
};
|
|
1590
|
+
|
|
1591
|
+
export declare interface TabsListProps extends ComponentProps<typeof Tabs_2.List> {
|
|
1592
|
+
/**
|
|
1593
|
+
* Layout mode:
|
|
1594
|
+
* - `fit` — tabs hug their content (default)
|
|
1595
|
+
* - `fill` — tabs divide space equally via CSS grid
|
|
1596
|
+
*/
|
|
1597
|
+
layout?: "fill" | "fit";
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
export declare interface TabsPanelProps extends ComponentProps<typeof Tabs_2.Panel> {
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
export declare interface TabsRootProps extends ComponentProps<typeof Tabs_2.Root> {
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
export declare interface TabsTabProps extends ComponentProps<typeof Tabs_2.Tab> {
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
export declare type ThemeMode = "light" | "dark" | "system";
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* Toggle switch component built on Base UI Switch with Tailwind CSS styling.
|
|
1613
|
+
*/
|
|
1614
|
+
export declare const Toggle: ForwardRefExoticComponent<ToggleProps & RefAttributes<HTMLButtonElement>>;
|
|
1615
|
+
|
|
1616
|
+
export declare interface ToggleProps {
|
|
1617
|
+
/** Whether the toggle is on. Use for controlled mode. */
|
|
1618
|
+
checked?: boolean;
|
|
1619
|
+
/** Whether the toggle is initially on. Use for uncontrolled mode. */
|
|
1620
|
+
defaultChecked?: boolean;
|
|
1621
|
+
/** Called when the checked state changes. */
|
|
1622
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
1623
|
+
/** Whether the toggle is disabled. */
|
|
1624
|
+
disabled?: boolean;
|
|
1625
|
+
/** Size of the toggle. */
|
|
1626
|
+
size?: ToggleSize;
|
|
1627
|
+
/** Additional class name for the root element. */
|
|
1628
|
+
className?: string;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
declare type ToggleSize = keyof typeof sizeStyles_2;
|
|
1632
|
+
|
|
1633
|
+
export declare const Tooltip: {
|
|
1634
|
+
Provider: typeof TooltipProvider;
|
|
1635
|
+
Root: typeof TooltipRoot;
|
|
1636
|
+
Trigger: ForwardRefExoticComponent<Omit<TooltipTriggerProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
1637
|
+
Content: typeof TooltipContent;
|
|
1638
|
+
Viewport: ForwardRefExoticComponent<Omit<TooltipViewportProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
1639
|
+
createHandle: typeof Tooltip_2.createHandle;
|
|
1640
|
+
};
|
|
1641
|
+
|
|
1642
|
+
declare function TooltipContent({ side, align, sideOffset, className, children, ...props }: TooltipContentProps): JSX.Element;
|
|
1643
|
+
|
|
1644
|
+
export declare interface TooltipContentProps extends ComponentProps<typeof Tooltip_2.Popup> {
|
|
1645
|
+
/** Side relative to the trigger */
|
|
1646
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
1647
|
+
/** Alignment relative to the trigger */
|
|
1648
|
+
align?: "start" | "center" | "end";
|
|
1649
|
+
/** Offset from the trigger in px */
|
|
1650
|
+
sideOffset?: number;
|
|
1651
|
+
/** Content to display */
|
|
1652
|
+
children: ReactNode;
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
declare function TooltipProvider(props: TooltipProviderProps): JSX.Element;
|
|
1656
|
+
|
|
1657
|
+
export declare interface TooltipProviderProps extends ComponentProps<typeof Tooltip_2.Provider> {
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
declare function TooltipRoot(props: TooltipRootProps): JSX.Element;
|
|
1661
|
+
|
|
1662
|
+
export declare interface TooltipRootProps extends ComponentProps<typeof Tooltip_2.Root> {
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
export declare interface TooltipTriggerProps extends ComponentProps<typeof Tooltip_2.Trigger> {
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
export declare interface TooltipViewportProps extends ComponentProps<typeof Tooltip_2.Viewport> {
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* Manages a draft / saved state pair with built-in dirty detection.
|
|
1673
|
+
*
|
|
1674
|
+
* Replaces the repeated pattern across settings pages of:
|
|
1675
|
+
* ```ts
|
|
1676
|
+
* const [saved, setSaved] = useState(initial)
|
|
1677
|
+
* const [draft, setDraft] = useState(initial)
|
|
1678
|
+
* const dirty = JSON.stringify(draft) !== JSON.stringify(saved)
|
|
1679
|
+
* const update = (key, value) => setDraft(prev => ({ ...prev, [key]: value }))
|
|
1680
|
+
* ```
|
|
1681
|
+
*
|
|
1682
|
+
* @param initial – The starting state for both draft and saved.
|
|
1683
|
+
*/
|
|
1684
|
+
export declare function useDirtyState<T extends object>(initial: T): DirtyState<T>;
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* User menu dropdown - shows user info, theme toggle, navigation items,
|
|
1688
|
+
* and a log out action.
|
|
1689
|
+
*
|
|
1690
|
+
* Designed to be placed inside `<AppHeader.Actions>`. Theme state is passed
|
|
1691
|
+
* as props so the component stays decoupled from any specific theme hook.
|
|
1692
|
+
*/
|
|
1693
|
+
export declare function UserMenu({ user, theme, onThemeChange, items, onLogout, className, }: UserMenuProps): JSX.Element;
|
|
1694
|
+
|
|
1695
|
+
export declare interface UserMenuItem {
|
|
1696
|
+
label: string;
|
|
1697
|
+
icon?: ReactNode;
|
|
1698
|
+
onClick?: () => void;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
export declare interface UserMenuProps {
|
|
1702
|
+
/** User information displayed in the header */
|
|
1703
|
+
user: UserMenuUser;
|
|
1704
|
+
/** Current theme mode */
|
|
1705
|
+
theme?: ThemeMode;
|
|
1706
|
+
/** Called when the theme is changed */
|
|
1707
|
+
onThemeChange?: (theme: ThemeMode) => void;
|
|
1708
|
+
/** Menu items rendered between the theme toggle and log out */
|
|
1709
|
+
items?: UserMenuItem[];
|
|
1710
|
+
/** Called when "Log out" is clicked */
|
|
1711
|
+
onLogout?: () => void;
|
|
1712
|
+
className?: string;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
export declare interface UserMenuUser {
|
|
1716
|
+
/** Display name */
|
|
1717
|
+
name: string;
|
|
1718
|
+
/** Organization or team name */
|
|
1719
|
+
org?: string;
|
|
1720
|
+
/** Avatar image URL */
|
|
1721
|
+
avatarUrl?: string;
|
|
1722
|
+
/** Fallback initials when no image (e.g. "AM") */
|
|
1723
|
+
initials?: string;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
declare const variantConfig: {
|
|
1727
|
+
readonly primary: {
|
|
1728
|
+
readonly active: true;
|
|
1729
|
+
readonly bg: "bg-cui-inverse";
|
|
1730
|
+
readonly bgClassName: "shadow-xs inset-shadow-cui-primary group-hover/btn:bg-cui-inverse/90";
|
|
1731
|
+
readonly text: "text-cui-inverse";
|
|
1732
|
+
};
|
|
1733
|
+
readonly outline: {
|
|
1734
|
+
readonly active: true;
|
|
1735
|
+
readonly bg: "bg-cui-base-2";
|
|
1736
|
+
readonly bgClassName: "border border-cui-neutral shadow-xs group-hover/btn:bg-cui-subtle group-active/btn:bg-cui-subtle";
|
|
1737
|
+
readonly text: "text-cui-primary";
|
|
1738
|
+
};
|
|
1739
|
+
readonly secondary: {
|
|
1740
|
+
readonly active: true;
|
|
1741
|
+
readonly bg: "bg-cui-subtle";
|
|
1742
|
+
readonly bgClassName: "group-hover/btn:bg-cui-subtle/70";
|
|
1743
|
+
readonly text: "text-cui-primary";
|
|
1744
|
+
};
|
|
1745
|
+
readonly transparent: {
|
|
1746
|
+
readonly active: false;
|
|
1747
|
+
readonly bg: "";
|
|
1748
|
+
readonly bgClassName: "group-hover/btn:bg-cui-subtle group-active/btn:bg-cui-subtle";
|
|
1749
|
+
readonly text: "text-cui-secondary";
|
|
1750
|
+
};
|
|
1751
|
+
readonly danger: {
|
|
1752
|
+
readonly active: true;
|
|
1753
|
+
readonly bg: "bg-cui-danger";
|
|
1754
|
+
readonly bgClassName: "border border-cui-danger shadow-xs group-hover/btn:bg-cui-danger-strong group-active/btn:bg-cui-danger-strong";
|
|
1755
|
+
readonly text: "text-cui-danger-on";
|
|
1756
|
+
};
|
|
1757
|
+
readonly "danger-light": {
|
|
1758
|
+
readonly active: true;
|
|
1759
|
+
readonly bg: "bg-cui-danger-subtle";
|
|
1760
|
+
readonly bgClassName: "group-hover/btn:bg-cui-danger/30 group-active/btn:bg-cui-danger/50";
|
|
1761
|
+
readonly text: "text-cui-danger";
|
|
1762
|
+
};
|
|
1763
|
+
};
|
|
1764
|
+
|
|
1765
|
+
declare const variantConfig_2: {
|
|
1766
|
+
readonly info: {
|
|
1767
|
+
readonly container: "bg-cui-accent-subtle";
|
|
1768
|
+
readonly icon: "text-cui-accent";
|
|
1769
|
+
readonly text: "text-cui-accent [&_a]:underline [&_a]:underline-offset-2 [&_a]:hover:opacity-80";
|
|
1770
|
+
readonly pattern: "text-cui-accent";
|
|
1771
|
+
readonly defaultIcon: ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & {
|
|
1772
|
+
title?: string;
|
|
1773
|
+
titleId?: string;
|
|
1774
|
+
} & RefAttributes<SVGSVGElement>>;
|
|
1775
|
+
};
|
|
1776
|
+
readonly success: {
|
|
1777
|
+
readonly container: "bg-cui-success-subtle";
|
|
1778
|
+
readonly icon: "text-cui-success";
|
|
1779
|
+
readonly text: "text-cui-success [&_a]:underline [&_a]:underline-offset-2 [&_a]:hover:opacity-80";
|
|
1780
|
+
readonly pattern: "text-cui-success";
|
|
1781
|
+
readonly defaultIcon: ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & {
|
|
1782
|
+
title?: string;
|
|
1783
|
+
titleId?: string;
|
|
1784
|
+
} & RefAttributes<SVGSVGElement>>;
|
|
1785
|
+
};
|
|
1786
|
+
readonly warning: {
|
|
1787
|
+
readonly container: "bg-cui-warn-subtle";
|
|
1788
|
+
readonly icon: "text-cui-warn";
|
|
1789
|
+
readonly text: "text-cui-warn [&_a]:underline [&_a]:underline-offset-2 [&_a]:hover:opacity-80";
|
|
1790
|
+
readonly pattern: "text-cui-warn";
|
|
1791
|
+
readonly defaultIcon: ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & {
|
|
1792
|
+
title?: string;
|
|
1793
|
+
titleId?: string;
|
|
1794
|
+
} & RefAttributes<SVGSVGElement>>;
|
|
1795
|
+
};
|
|
1796
|
+
readonly danger: {
|
|
1797
|
+
readonly container: "bg-cui-danger-subtle";
|
|
1798
|
+
readonly icon: "text-cui-danger";
|
|
1799
|
+
readonly text: "text-cui-danger [&_a]:underline [&_a]:underline-offset-2 [&_a]:hover:opacity-80";
|
|
1800
|
+
readonly pattern: "text-cui-danger";
|
|
1801
|
+
readonly defaultIcon: ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "ref"> & {
|
|
1802
|
+
title?: string;
|
|
1803
|
+
titleId?: string;
|
|
1804
|
+
} & RefAttributes<SVGSVGElement>>;
|
|
1805
|
+
};
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
declare const variantStyles: {
|
|
1809
|
+
readonly default: "bg-cui-base-1 rounded-lg shadow-xs ring-1 ring-cui-neutral";
|
|
1810
|
+
readonly nested: "bg-cui-base-2 rounded-sm shadow-sm ring-1 ring-cui-neutral";
|
|
1811
|
+
};
|
|
1812
|
+
|
|
1813
|
+
declare const variantStyles_2: {
|
|
1814
|
+
readonly neutral: "bg-cui-subtle text-cui-secondary";
|
|
1815
|
+
readonly accent: "bg-cui-accent-subtle text-cui-accent";
|
|
1816
|
+
readonly danger: "bg-cui-danger-subtle text-cui-danger";
|
|
1817
|
+
readonly warning: "bg-cui-warn-subtle text-cui-warn";
|
|
1818
|
+
readonly success: "bg-cui-success-subtle text-cui-success";
|
|
1819
|
+
};
|
|
1820
|
+
|
|
1821
|
+
export { }
|