@work-rjkashyap/unified-ui 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +107 -0
- package/bin/cli.mjs +131 -343
- package/dist/{chunk-EUHL6H76.cjs → chunk-A2DGHQL2.cjs} +5285 -5303
- package/dist/{chunk-AQJ7H5SF.mjs → chunk-XAIUX2YS.mjs} +5285 -5303
- package/dist/components.cjs +310 -310
- package/dist/components.d.cts +730 -730
- package/dist/components.d.ts +730 -730
- package/dist/components.mjs +1 -1
- package/dist/index.cjs +311 -311
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/styles.css +12 -12
package/dist/components.d.ts
CHANGED
|
@@ -1474,6 +1474,104 @@ interface CarouselProps {
|
|
|
1474
1474
|
}
|
|
1475
1475
|
declare const Carousel: react.ForwardRefExoticComponent<CarouselProps & react.RefAttributes<HTMLDivElement>>;
|
|
1476
1476
|
|
|
1477
|
+
interface ChartContainerProps {
|
|
1478
|
+
/** Chart title. */
|
|
1479
|
+
title?: string;
|
|
1480
|
+
/** Chart description/subtitle. */
|
|
1481
|
+
description?: string;
|
|
1482
|
+
/** Chart height in pixels. @default 350 */
|
|
1483
|
+
height?: number;
|
|
1484
|
+
/** The Recharts chart component(s) to render. */
|
|
1485
|
+
children: ReactNode;
|
|
1486
|
+
/** Footer content (e.g., legend, notes). */
|
|
1487
|
+
footer?: ReactNode;
|
|
1488
|
+
/** Whether data is loading. @default false */
|
|
1489
|
+
loading?: boolean;
|
|
1490
|
+
/** Custom loading indicator. */
|
|
1491
|
+
loadingIndicator?: ReactNode;
|
|
1492
|
+
/** Content to show when chart has no data. */
|
|
1493
|
+
emptyContent?: ReactNode;
|
|
1494
|
+
/** Additional CSS classes. */
|
|
1495
|
+
className?: string;
|
|
1496
|
+
}
|
|
1497
|
+
/**
|
|
1498
|
+
* Design system chart colors. Use these as `fill` or `stroke` values
|
|
1499
|
+
* in Recharts components for consistent theming.
|
|
1500
|
+
*
|
|
1501
|
+
* @example
|
|
1502
|
+
* ```tsx
|
|
1503
|
+
* <Bar dataKey="revenue" fill={chartColors[0]} />
|
|
1504
|
+
* <Bar dataKey="expenses" fill={chartColors[1]} />
|
|
1505
|
+
* ```
|
|
1506
|
+
*/
|
|
1507
|
+
declare const chartColors: readonly ["var(--primary)", "var(--info)", "var(--success)", "var(--warning)", "var(--danger)", "var(--secondary)", "var(--muted-foreground)", "oklch(0.65 0.15 250)", "oklch(0.65 0.15 160)", "oklch(0.65 0.15 30)"];
|
|
1508
|
+
/**
|
|
1509
|
+
* `ChartContainer` — a card wrapper for Recharts charts with DS styling.
|
|
1510
|
+
*
|
|
1511
|
+
* Place your Recharts `<BarChart>`, `<LineChart>`, `<PieChart>`, etc.
|
|
1512
|
+
* as children. The container provides a responsive wrapper, title, and
|
|
1513
|
+
* optional footer.
|
|
1514
|
+
*
|
|
1515
|
+
* **Important**: This component does NOT bundle Recharts. You must install
|
|
1516
|
+
* `recharts` separately as a peer dependency.
|
|
1517
|
+
*
|
|
1518
|
+
* @example
|
|
1519
|
+
* ```tsx
|
|
1520
|
+
* import { ChartContainer, chartColors } from "@work-rjkashyap/unified-ui/components";
|
|
1521
|
+
* import { ResponsiveContainer, BarChart, Bar, XAxis, YAxis, Tooltip } from "recharts";
|
|
1522
|
+
*
|
|
1523
|
+
* <ChartContainer title="Monthly Revenue" description="Last 6 months">
|
|
1524
|
+
* <ResponsiveContainer width="100%" height="100%">
|
|
1525
|
+
* <BarChart data={data}>
|
|
1526
|
+
* <XAxis dataKey="month" stroke="var(--muted-foreground)" fontSize={12} />
|
|
1527
|
+
* <YAxis stroke="var(--muted-foreground)" fontSize={12} />
|
|
1528
|
+
* <Tooltip
|
|
1529
|
+
* contentStyle={{
|
|
1530
|
+
* background: "var(--background)",
|
|
1531
|
+
* border: "1px solid var(--border)",
|
|
1532
|
+
* borderRadius: "var(--radius-md)",
|
|
1533
|
+
* fontSize: 13,
|
|
1534
|
+
* }}
|
|
1535
|
+
* />
|
|
1536
|
+
* <Bar dataKey="revenue" fill={chartColors[0]} radius={[4, 4, 0, 0]} />
|
|
1537
|
+
* </BarChart>
|
|
1538
|
+
* </ResponsiveContainer>
|
|
1539
|
+
* </ChartContainer>
|
|
1540
|
+
* ```
|
|
1541
|
+
*/
|
|
1542
|
+
declare const ChartContainer: react.ForwardRefExoticComponent<ChartContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
1543
|
+
interface ChartTooltipContentProps {
|
|
1544
|
+
/** Label for the tooltip header. */
|
|
1545
|
+
label?: string;
|
|
1546
|
+
/** Payload from Recharts tooltip. */
|
|
1547
|
+
payload?: Array<{
|
|
1548
|
+
name: string;
|
|
1549
|
+
value: number | string;
|
|
1550
|
+
color?: string;
|
|
1551
|
+
fill?: string;
|
|
1552
|
+
}>;
|
|
1553
|
+
/** Whether the tooltip is active. */
|
|
1554
|
+
active?: boolean;
|
|
1555
|
+
/** Custom formatter for values. */
|
|
1556
|
+
formatter?: (value: number | string, name: string) => string;
|
|
1557
|
+
/** Additional class names. */
|
|
1558
|
+
className?: string;
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* `ChartTooltipContent` — a pre-styled tooltip content component for Recharts.
|
|
1562
|
+
*
|
|
1563
|
+
* Use as the `content` prop of Recharts' `<Tooltip>`:
|
|
1564
|
+
*
|
|
1565
|
+
* @example
|
|
1566
|
+
* ```tsx
|
|
1567
|
+
* <Tooltip content={<ChartTooltipContent />} />
|
|
1568
|
+
* ```
|
|
1569
|
+
*/
|
|
1570
|
+
declare function ChartTooltipContent({ label, payload, active, formatter, className, }: ChartTooltipContentProps): react_jsx_runtime.JSX.Element | null;
|
|
1571
|
+
declare namespace ChartTooltipContent {
|
|
1572
|
+
var displayName: string;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1477
1575
|
declare const checkboxVariants: (props?: ({
|
|
1478
1576
|
size?: "sm" | "md" | null | undefined;
|
|
1479
1577
|
error?: boolean | null | undefined;
|
|
@@ -1836,6 +1934,38 @@ declare const CollapsibleTrigger: react.ForwardRefExoticComponent<CollapsibleTri
|
|
|
1836
1934
|
*/
|
|
1837
1935
|
declare const CollapsibleContent: react.ForwardRefExoticComponent<CollapsibleContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
1838
1936
|
|
|
1937
|
+
interface ColorPickerProps {
|
|
1938
|
+
/** Current color value in HEX format (e.g., "#ff0000"). */
|
|
1939
|
+
value?: string;
|
|
1940
|
+
/** Default color for uncontrolled mode. @default "#000000" */
|
|
1941
|
+
defaultValue?: string;
|
|
1942
|
+
/** Callback when color changes. */
|
|
1943
|
+
onChange?: (color: string) => void;
|
|
1944
|
+
/** Preset color swatches to display. */
|
|
1945
|
+
presets?: string[];
|
|
1946
|
+
/** Whether to show the HEX input field. @default true */
|
|
1947
|
+
showInput?: boolean;
|
|
1948
|
+
/** Whether the picker is disabled. @default false */
|
|
1949
|
+
disabled?: boolean;
|
|
1950
|
+
/** Size of the trigger swatch. @default "md" */
|
|
1951
|
+
size?: "sm" | "md" | "lg";
|
|
1952
|
+
/** Additional CSS classes. */
|
|
1953
|
+
className?: string;
|
|
1954
|
+
/** Placeholder label for accessibility. @default "Choose color" */
|
|
1955
|
+
label?: string;
|
|
1956
|
+
}
|
|
1957
|
+
/**
|
|
1958
|
+
* `ColorPicker` — a color selection component with spectrum, hue slider,
|
|
1959
|
+
* HEX input, and preset swatches.
|
|
1960
|
+
*
|
|
1961
|
+
* @example
|
|
1962
|
+
* ```tsx
|
|
1963
|
+
* <ColorPicker value={color} onChange={setColor} />
|
|
1964
|
+
* <ColorPicker defaultValue="#3b82f6" presets={["#ef4444", "#22c55e", "#3b82f6"]} />
|
|
1965
|
+
* ```
|
|
1966
|
+
*/
|
|
1967
|
+
declare const ColorPicker: react.ForwardRefExoticComponent<ColorPickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
1968
|
+
|
|
1839
1969
|
declare const comboboxTriggerVariants: (props?: ({
|
|
1840
1970
|
variant?: "default" | "primary" | null | undefined;
|
|
1841
1971
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
@@ -2943,6 +3073,86 @@ interface UseDataTableReturn<_TData> {
|
|
|
2943
3073
|
*/
|
|
2944
3074
|
declare function useDataTable<TData>(options: UseDataTableOptions<TData>): UseDataTableReturn<TData>;
|
|
2945
3075
|
|
|
3076
|
+
interface DataTableFilter {
|
|
3077
|
+
/** Unique identifier for this filter. */
|
|
3078
|
+
id: string;
|
|
3079
|
+
/** Display label. */
|
|
3080
|
+
label: string;
|
|
3081
|
+
/** Available options for this filter. */
|
|
3082
|
+
options: Array<{
|
|
3083
|
+
label: string;
|
|
3084
|
+
value: string;
|
|
3085
|
+
count?: number;
|
|
3086
|
+
}>;
|
|
3087
|
+
/** Currently selected values. */
|
|
3088
|
+
selected: string[];
|
|
3089
|
+
}
|
|
3090
|
+
interface ColumnVisibility {
|
|
3091
|
+
/** Column identifier. */
|
|
3092
|
+
id: string;
|
|
3093
|
+
/** Display label. */
|
|
3094
|
+
label: string;
|
|
3095
|
+
/** Whether the column is visible. */
|
|
3096
|
+
visible: boolean;
|
|
3097
|
+
}
|
|
3098
|
+
type ViewMode = "table" | "grid" | "list";
|
|
3099
|
+
interface DataTableToolbarProps {
|
|
3100
|
+
/** Current search value. */
|
|
3101
|
+
searchValue?: string;
|
|
3102
|
+
/** Callback when search value changes. */
|
|
3103
|
+
onSearchChange?: (value: string) => void;
|
|
3104
|
+
/** Search placeholder text. @default "Search..." */
|
|
3105
|
+
searchPlaceholder?: string;
|
|
3106
|
+
/** Debounce delay for search in ms. @default 300 */
|
|
3107
|
+
searchDebounce?: number;
|
|
3108
|
+
/** Filter definitions and their current state. */
|
|
3109
|
+
filters?: DataTableFilter[];
|
|
3110
|
+
/** Callback when a filter's selected values change. */
|
|
3111
|
+
onFilterChange?: (filterId: string, selected: string[]) => void;
|
|
3112
|
+
/** Callback to clear all filters. */
|
|
3113
|
+
onClearFilters?: () => void;
|
|
3114
|
+
/** Column visibility state. */
|
|
3115
|
+
columns?: ColumnVisibility[];
|
|
3116
|
+
/** Callback when column visibility changes. */
|
|
3117
|
+
onColumnVisibilityChange?: (columnId: string, visible: boolean) => void;
|
|
3118
|
+
/** Current view mode. */
|
|
3119
|
+
viewMode?: ViewMode;
|
|
3120
|
+
/** Available view modes. */
|
|
3121
|
+
viewModes?: ViewMode[];
|
|
3122
|
+
/** Callback when view mode changes. */
|
|
3123
|
+
onViewModeChange?: (mode: ViewMode) => void;
|
|
3124
|
+
/** Extra actions to render on the right side of the toolbar. */
|
|
3125
|
+
actions?: ReactNode;
|
|
3126
|
+
/** Additional CSS classes. */
|
|
3127
|
+
className?: string;
|
|
3128
|
+
}
|
|
3129
|
+
/**
|
|
3130
|
+
* `DataTableToolbar` — a composable toolbar for DataTable with search,
|
|
3131
|
+
* filters, column visibility, and view mode controls.
|
|
3132
|
+
*
|
|
3133
|
+
* @example
|
|
3134
|
+
* ```tsx
|
|
3135
|
+
* <DataTableToolbar
|
|
3136
|
+
* searchValue={search}
|
|
3137
|
+
* onSearchChange={setSearch}
|
|
3138
|
+
* filters={[
|
|
3139
|
+
* {
|
|
3140
|
+
* id: "status",
|
|
3141
|
+
* label: "Status",
|
|
3142
|
+
* options: [
|
|
3143
|
+
* { label: "Active", value: "active", count: 12 },
|
|
3144
|
+
* { label: "Inactive", value: "inactive", count: 5 },
|
|
3145
|
+
* ],
|
|
3146
|
+
* selected: selectedStatuses,
|
|
3147
|
+
* },
|
|
3148
|
+
* ]}
|
|
3149
|
+
* onFilterChange={handleFilter}
|
|
3150
|
+
* onClearFilters={() => setFilters({})}
|
|
3151
|
+
* />
|
|
3152
|
+
* ```
|
|
3153
|
+
*/
|
|
3154
|
+
declare const DataTableToolbar: react.ForwardRefExoticComponent<DataTableToolbarProps & react.RefAttributes<HTMLDivElement>>;
|
|
3155
|
+
|
|
2946
3156
|
type DatePickerMode = "single" | "range";
|
|
2947
3157
|
type DatePickerSize = "sm" | "md" | "lg";
|
|
2948
3158
|
interface DatePickerProps {
|
|
@@ -3102,24 +3312,130 @@ declare const DialogTitle: react.ForwardRefExoticComponent<DialogTitleProps & re
|
|
|
3102
3312
|
declare const DialogDescription: react.ForwardRefExoticComponent<DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
3103
3313
|
declare const DialogClose: react.ForwardRefExoticComponent<DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
3104
3314
|
|
|
3105
|
-
|
|
3315
|
+
declare const drawerContentVariants: (props?: ({
|
|
3316
|
+
size?: "sm" | "md" | "lg" | "full" | null | undefined;
|
|
3317
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
3318
|
+
type DrawerSize = "sm" | "md" | "lg" | "full";
|
|
3319
|
+
interface DrawerProps {
|
|
3106
3320
|
children: ReactNode;
|
|
3321
|
+
/**
|
|
3322
|
+
* Whether the drawer should scale the background content when open.
|
|
3323
|
+
* Requires `[vaul-drawer-wrapper]` attribute on your app wrapper element.
|
|
3324
|
+
* @default true
|
|
3325
|
+
*/
|
|
3326
|
+
shouldScaleBackground?: boolean;
|
|
3327
|
+
/** Controlled open state. */
|
|
3328
|
+
open?: boolean;
|
|
3329
|
+
/** Callback when open state changes. */
|
|
3330
|
+
onOpenChange?: (open: boolean) => void;
|
|
3331
|
+
/** Whether the drawer starts open. */
|
|
3332
|
+
defaultOpen?: boolean;
|
|
3333
|
+
/** Whether to dismiss on outside click. @default true */
|
|
3334
|
+
dismissible?: boolean;
|
|
3335
|
+
/** Direction the drawer opens from. @default "bottom" */
|
|
3336
|
+
direction?: "top" | "bottom" | "left" | "right";
|
|
3337
|
+
/** Whether to nest inside another drawer. */
|
|
3338
|
+
nested?: boolean;
|
|
3339
|
+
/** Whether to block body scroll when drawer is open. @default true */
|
|
3340
|
+
modal?: boolean;
|
|
3341
|
+
/** Called when drawer is closed. */
|
|
3342
|
+
onClose?: () => void;
|
|
3107
3343
|
}
|
|
3108
|
-
interface
|
|
3344
|
+
interface DrawerTriggerProps extends ComponentPropsWithoutRef<typeof Drawer$1.Trigger> {
|
|
3109
3345
|
className?: string;
|
|
3110
3346
|
}
|
|
3111
|
-
interface
|
|
3347
|
+
interface DrawerContentProps extends Omit<ComponentPropsWithoutRef<typeof Drawer$1.Content>, "asChild"> {
|
|
3348
|
+
/** Controls the maximum height of the drawer. @default "md" */
|
|
3349
|
+
size?: DrawerSize;
|
|
3350
|
+
/** Whether to show the drag handle at the top. @default true */
|
|
3351
|
+
showHandle?: boolean;
|
|
3352
|
+
/** Extra classes for the overlay backdrop. */
|
|
3353
|
+
overlayClassName?: string;
|
|
3112
3354
|
className?: string;
|
|
3113
3355
|
children: ReactNode;
|
|
3114
3356
|
}
|
|
3115
|
-
|
|
3116
|
-
interface DropdownMenuItemProps extends ComponentPropsWithoutRef<typeof DropdownMenu$1.Item> {
|
|
3357
|
+
interface DrawerHandleProps extends HTMLAttributes<HTMLDivElement> {
|
|
3117
3358
|
className?: string;
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3359
|
+
}
|
|
3360
|
+
interface DrawerHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
3361
|
+
className?: string;
|
|
3362
|
+
children: ReactNode;
|
|
3363
|
+
}
|
|
3364
|
+
interface DrawerBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
3365
|
+
className?: string;
|
|
3366
|
+
children: ReactNode;
|
|
3367
|
+
}
|
|
3368
|
+
interface DrawerFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
3369
|
+
className?: string;
|
|
3370
|
+
children: ReactNode;
|
|
3371
|
+
}
|
|
3372
|
+
interface DrawerTitleProps extends ComponentPropsWithoutRef<typeof Drawer$1.Title> {
|
|
3373
|
+
className?: string;
|
|
3374
|
+
children: ReactNode;
|
|
3375
|
+
}
|
|
3376
|
+
interface DrawerDescriptionProps extends ComponentPropsWithoutRef<typeof Drawer$1.Description> {
|
|
3377
|
+
className?: string;
|
|
3378
|
+
children: ReactNode;
|
|
3379
|
+
}
|
|
3380
|
+
interface DrawerCloseProps extends ComponentPropsWithoutRef<typeof Drawer$1.Close> {
|
|
3381
|
+
className?: string;
|
|
3382
|
+
}
|
|
3383
|
+
/**
|
|
3384
|
+
* Drawer — a bottom sheet with drag-to-dismiss interaction.
|
|
3385
|
+
*
|
|
3386
|
+
* Wraps vaul's `Drawer.Root` with sensible defaults for the Unified UI
|
|
3387
|
+
* design system. Set `shouldScaleBackground` to control whether the
|
|
3388
|
+
* background content scales down when the drawer opens (requires the
|
|
3389
|
+
* `[vaul-drawer-wrapper]` attribute on your app wrapper).
|
|
3390
|
+
*/
|
|
3391
|
+
declare function Drawer({ shouldScaleBackground, children, ...rest }: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
3392
|
+
declare namespace Drawer {
|
|
3393
|
+
var displayName: string;
|
|
3394
|
+
}
|
|
3395
|
+
declare const DrawerTrigger: react.ForwardRefExoticComponent<DrawerTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
3396
|
+
/**
|
|
3397
|
+
* A visual drag handle rendered at the top of the drawer content.
|
|
3398
|
+
* Provides a clear affordance that the drawer can be dragged to dismiss.
|
|
3399
|
+
*/
|
|
3400
|
+
declare function DrawerHandle({ className, ...rest }: DrawerHandleProps): react_jsx_runtime.JSX.Element;
|
|
3401
|
+
declare namespace DrawerHandle {
|
|
3402
|
+
var displayName: string;
|
|
3403
|
+
}
|
|
3404
|
+
declare const DrawerContent: react.ForwardRefExoticComponent<DrawerContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
3405
|
+
declare function DrawerHeader({ className, children, ...rest }: DrawerHeaderProps): react_jsx_runtime.JSX.Element;
|
|
3406
|
+
declare namespace DrawerHeader {
|
|
3407
|
+
var displayName: string;
|
|
3408
|
+
}
|
|
3409
|
+
declare function DrawerBody({ className, children, ...rest }: DrawerBodyProps): react_jsx_runtime.JSX.Element;
|
|
3410
|
+
declare namespace DrawerBody {
|
|
3411
|
+
var displayName: string;
|
|
3412
|
+
}
|
|
3413
|
+
declare function DrawerFooter({ className, children, ...rest }: DrawerFooterProps): react_jsx_runtime.JSX.Element;
|
|
3414
|
+
declare namespace DrawerFooter {
|
|
3415
|
+
var displayName: string;
|
|
3416
|
+
}
|
|
3417
|
+
declare const DrawerTitle: react.ForwardRefExoticComponent<DrawerTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
3418
|
+
declare const DrawerDescription: react.ForwardRefExoticComponent<DrawerDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
3419
|
+
declare const DrawerClose: react.ForwardRefExoticComponent<DrawerCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
3420
|
+
|
|
3421
|
+
interface DropdownMenuProps extends DropdownMenu$1.DropdownMenuProps {
|
|
3422
|
+
children: ReactNode;
|
|
3423
|
+
}
|
|
3424
|
+
interface DropdownMenuTriggerProps extends ComponentPropsWithoutRef<typeof DropdownMenu$1.Trigger> {
|
|
3425
|
+
className?: string;
|
|
3426
|
+
}
|
|
3427
|
+
interface DropdownMenuContentProps extends ComponentPropsWithoutRef<typeof DropdownMenu$1.Content> {
|
|
3428
|
+
className?: string;
|
|
3429
|
+
children: ReactNode;
|
|
3430
|
+
}
|
|
3431
|
+
type DropdownMenuItemVariant = "default" | "danger";
|
|
3432
|
+
interface DropdownMenuItemProps extends ComponentPropsWithoutRef<typeof DropdownMenu$1.Item> {
|
|
3433
|
+
className?: string;
|
|
3434
|
+
/** Visual variant. @default "default" */
|
|
3435
|
+
variant?: DropdownMenuItemVariant;
|
|
3436
|
+
/** Optional icon displayed before the label. */
|
|
3437
|
+
icon?: ReactNode;
|
|
3438
|
+
/** Optional keyboard shortcut displayed on the right. */
|
|
3123
3439
|
shortcut?: string;
|
|
3124
3440
|
children: ReactNode;
|
|
3125
3441
|
}
|
|
@@ -3413,6 +3729,98 @@ declare namespace HoverCard {
|
|
|
3413
3729
|
declare const HoverCardTrigger: react.ForwardRefExoticComponent<HoverCard$1.HoverCardTriggerProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
3414
3730
|
declare const HoverCardContent: react.ForwardRefExoticComponent<HoverCardContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
3415
3731
|
|
|
3732
|
+
interface GalleryImage {
|
|
3733
|
+
/** Image source URL. */
|
|
3734
|
+
src: string;
|
|
3735
|
+
/** Alt text for accessibility. */
|
|
3736
|
+
alt: string;
|
|
3737
|
+
/** Optional thumbnail URL (falls back to src). */
|
|
3738
|
+
thumbnail?: string;
|
|
3739
|
+
/** Optional caption shown in lightbox. */
|
|
3740
|
+
caption?: string;
|
|
3741
|
+
}
|
|
3742
|
+
interface ImageGalleryProps {
|
|
3743
|
+
/** Array of images to display. */
|
|
3744
|
+
images: GalleryImage[];
|
|
3745
|
+
/** Number of grid columns. @default 3 */
|
|
3746
|
+
columns?: 1 | 2 | 3 | 4;
|
|
3747
|
+
/** Gap between grid items in pixels. @default 8 */
|
|
3748
|
+
gap?: number;
|
|
3749
|
+
/** Aspect ratio for thumbnails. @default "square" */
|
|
3750
|
+
aspectRatio?: "square" | "video" | "auto";
|
|
3751
|
+
/** Whether to show the lightbox on click. @default true */
|
|
3752
|
+
lightbox?: boolean;
|
|
3753
|
+
/** Additional CSS classes on the grid container. */
|
|
3754
|
+
className?: string;
|
|
3755
|
+
/** Render custom thumbnail. */
|
|
3756
|
+
renderThumbnail?: (image: GalleryImage, index: number) => ReactNode;
|
|
3757
|
+
}
|
|
3758
|
+
/**
|
|
3759
|
+
* `ImageGallery` — a grid of images with optional lightbox viewer.
|
|
3760
|
+
*
|
|
3761
|
+
* @example
|
|
3762
|
+
* ```tsx
|
|
3763
|
+
* <ImageGallery
|
|
3764
|
+
* images={[
|
|
3765
|
+
* { src: "/photo-1.jpg", alt: "Beach sunset", caption: "Malibu, CA" },
|
|
3766
|
+
* { src: "/photo-2.jpg", alt: "Mountain view" },
|
|
3767
|
+
* ]}
|
|
3768
|
+
* columns={3}
|
|
3769
|
+
* />
|
|
3770
|
+
* ```
|
|
3771
|
+
*/
|
|
3772
|
+
declare const ImageGallery: react.ForwardRefExoticComponent<ImageGalleryProps & react.RefAttributes<HTMLDivElement>>;
|
|
3773
|
+
|
|
3774
|
+
interface InfiniteScrollProps {
|
|
3775
|
+
/** Content to render (the list items). */
|
|
3776
|
+
children: ReactNode;
|
|
3777
|
+
/** Whether more data is currently being loaded. */
|
|
3778
|
+
loading?: boolean;
|
|
3779
|
+
/** Whether there is more data to load. */
|
|
3780
|
+
hasMore?: boolean;
|
|
3781
|
+
/** Callback to trigger loading more data. */
|
|
3782
|
+
onLoadMore: () => void;
|
|
3783
|
+
/**
|
|
3784
|
+
* IntersectionObserver rootMargin value. Controls how far from the
|
|
3785
|
+
* bottom the trigger fires.
|
|
3786
|
+
* @default "200px"
|
|
3787
|
+
*/
|
|
3788
|
+
threshold?: string;
|
|
3789
|
+
/** Custom loading indicator. */
|
|
3790
|
+
loadingIndicator?: ReactNode;
|
|
3791
|
+
/** Content to show when all data has been loaded. */
|
|
3792
|
+
endMessage?: ReactNode;
|
|
3793
|
+
/** Additional CSS classes on the container. */
|
|
3794
|
+
className?: string;
|
|
3795
|
+
/** Additional CSS classes on the sentinel element. */
|
|
3796
|
+
sentinelClassName?: string;
|
|
3797
|
+
}
|
|
3798
|
+
/**
|
|
3799
|
+
* `InfiniteScroll` — scroll-triggered infinite loading.
|
|
3800
|
+
*
|
|
3801
|
+
* Renders children with a sentinel element at the bottom. When the
|
|
3802
|
+
* sentinel enters the viewport (via IntersectionObserver), it calls
|
|
3803
|
+
* `onLoadMore`. Shows a loading indicator while fetching and an optional
|
|
3804
|
+
* end message when `hasMore` is false.
|
|
3805
|
+
*
|
|
3806
|
+
* @example
|
|
3807
|
+
* ```tsx
|
|
3808
|
+
* const { data, fetchNextPage, hasNextPage, isFetchingNextPage } = useInfiniteQuery(...);
|
|
3809
|
+
*
|
|
3810
|
+
* <InfiniteScroll
|
|
3811
|
+
* loading={isFetchingNextPage}
|
|
3812
|
+
* hasMore={hasNextPage}
|
|
3813
|
+
* onLoadMore={fetchNextPage}
|
|
3814
|
+
* endMessage={<p className="text-center text-sm text-muted-foreground py-4">That's all!</p>}
|
|
3815
|
+
* >
|
|
3816
|
+
* {data.pages.flat().map(item => (
|
|
3817
|
+
* <Card key={item.id}>{item.name}</Card>
|
|
3818
|
+
* ))}
|
|
3819
|
+
* </InfiniteScroll>
|
|
3820
|
+
* ```
|
|
3821
|
+
*/
|
|
3822
|
+
declare const InfiniteScroll: react.ForwardRefExoticComponent<InfiniteScrollProps & react.RefAttributes<HTMLDivElement>>;
|
|
3823
|
+
|
|
3416
3824
|
declare const inputVariants: (props?: ({
|
|
3417
3825
|
variant?: "success" | "default" | "error" | null | undefined;
|
|
3418
3826
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
@@ -3627,6 +4035,44 @@ interface LabelProps extends Omit<React.ComponentPropsWithoutRef<typeof Label$1.
|
|
|
3627
4035
|
*/
|
|
3628
4036
|
declare const Label: react.ForwardRefExoticComponent<LabelProps & react.RefAttributes<HTMLLabelElement>>;
|
|
3629
4037
|
|
|
4038
|
+
interface MarkdownProps {
|
|
4039
|
+
/** Markdown string to render. */
|
|
4040
|
+
content: string;
|
|
4041
|
+
/** Text size variant. @default "base" */
|
|
4042
|
+
size?: "sm" | "base" | "lg";
|
|
4043
|
+
/** Whether to remove max-width constraint. @default false */
|
|
4044
|
+
fluid?: boolean;
|
|
4045
|
+
/** Additional CSS classes. */
|
|
4046
|
+
className?: string;
|
|
4047
|
+
/** Whether to allow raw HTML in the markdown. @default false */
|
|
4048
|
+
allowHtml?: boolean;
|
|
4049
|
+
}
|
|
4050
|
+
/**
|
|
4051
|
+
* `Markdown` — renders a markdown string with design system prose styles.
|
|
4052
|
+
*
|
|
4053
|
+
* For simple markdown display use cases. For full MDX support, use
|
|
4054
|
+
* Fumadocs or a dedicated MDX processor.
|
|
4055
|
+
*
|
|
4056
|
+
* @example
|
|
4057
|
+
* ```tsx
|
|
4058
|
+
* <Markdown content={`
|
|
4059
|
+
* # Hello World
|
|
4060
|
+
*
|
|
4061
|
+
* Some **bold** and *italic* text with \`inline code\`.
|
|
4062
|
+
*
|
|
4063
|
+
* - Item one
|
|
4064
|
+
* - Item two
|
|
4065
|
+
*
|
|
4066
|
+
* > A blockquote
|
|
4067
|
+
*
|
|
4068
|
+
* \`\`\`tsx
|
|
4069
|
+
* const x = 42;
|
|
4070
|
+
* \`\`\`
|
|
4071
|
+
* `} />
|
|
4072
|
+
* ```
|
|
4073
|
+
*/
|
|
4074
|
+
declare const Markdown: react.ForwardRefExoticComponent<MarkdownProps & react.RefAttributes<HTMLDivElement>>;
|
|
4075
|
+
|
|
3630
4076
|
interface MenubarProps extends ComponentPropsWithoutRef<typeof Menubar$1.Root> {
|
|
3631
4077
|
className?: string;
|
|
3632
4078
|
}
|
|
@@ -5026,149 +5472,43 @@ declare const SheetDescription: react.ForwardRefExoticComponent<SheetDescription
|
|
|
5026
5472
|
*/
|
|
5027
5473
|
declare const SheetClose: react.ForwardRefExoticComponent<SheetCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
5028
5474
|
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5475
|
+
type SidebarVariant = "default" | "floating" | "inset";
|
|
5476
|
+
type SidebarCollapsible = "offcanvas" | "icon" | "none";
|
|
5477
|
+
type SidebarSide = "left" | "right";
|
|
5478
|
+
interface SidebarContextValue {
|
|
5479
|
+
state: "expanded" | "collapsed";
|
|
5480
|
+
open: boolean;
|
|
5481
|
+
setOpen: (open: boolean) => void;
|
|
5482
|
+
openMobile: boolean;
|
|
5483
|
+
setOpenMobile: (open: boolean) => void;
|
|
5484
|
+
isMobile: boolean;
|
|
5485
|
+
toggleSidebar: () => void;
|
|
5486
|
+
variant: SidebarVariant;
|
|
5487
|
+
collapsible: SidebarCollapsible;
|
|
5488
|
+
side: SidebarSide;
|
|
5489
|
+
}
|
|
5490
|
+
/**
|
|
5491
|
+
* Hook to access the sidebar context.
|
|
5492
|
+
*
|
|
5493
|
+
* Must be used within a `<SidebarProvider>`.
|
|
5494
|
+
*
|
|
5495
|
+
* @returns The sidebar context value containing state, open/close handlers,
|
|
5496
|
+
* mobile state, toggle function, variant, collapsible mode, and side.
|
|
5497
|
+
*
|
|
5498
|
+
* @example
|
|
5499
|
+
* ```tsx
|
|
5500
|
+
* const { open, toggleSidebar, isMobile, state } = useSidebar();
|
|
5501
|
+
*
|
|
5502
|
+
* // state is "expanded" or "collapsed"
|
|
5503
|
+
* // open is the boolean open state
|
|
5504
|
+
* ```
|
|
5505
|
+
*/
|
|
5506
|
+
declare function useSidebar(): SidebarContextValue;
|
|
5507
|
+
declare const useSidebarContext: typeof useSidebar;
|
|
5508
|
+
interface SidebarProviderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5035
5509
|
/**
|
|
5036
|
-
* Whether the
|
|
5037
|
-
*
|
|
5038
|
-
* @default true
|
|
5039
|
-
*/
|
|
5040
|
-
shouldScaleBackground?: boolean;
|
|
5041
|
-
/** Controlled open state. */
|
|
5042
|
-
open?: boolean;
|
|
5043
|
-
/** Callback when open state changes. */
|
|
5044
|
-
onOpenChange?: (open: boolean) => void;
|
|
5045
|
-
/** Whether the drawer starts open. */
|
|
5046
|
-
defaultOpen?: boolean;
|
|
5047
|
-
/** Whether to dismiss on outside click. @default true */
|
|
5048
|
-
dismissible?: boolean;
|
|
5049
|
-
/** Direction the drawer opens from. @default "bottom" */
|
|
5050
|
-
direction?: "top" | "bottom" | "left" | "right";
|
|
5051
|
-
/** Whether to nest inside another drawer. */
|
|
5052
|
-
nested?: boolean;
|
|
5053
|
-
/** Whether to block body scroll when drawer is open. @default true */
|
|
5054
|
-
modal?: boolean;
|
|
5055
|
-
/** Called when drawer is closed. */
|
|
5056
|
-
onClose?: () => void;
|
|
5057
|
-
}
|
|
5058
|
-
interface DrawerTriggerProps extends ComponentPropsWithoutRef<typeof Drawer$1.Trigger> {
|
|
5059
|
-
className?: string;
|
|
5060
|
-
}
|
|
5061
|
-
interface DrawerContentProps extends Omit<ComponentPropsWithoutRef<typeof Drawer$1.Content>, "asChild"> {
|
|
5062
|
-
/** Controls the maximum height of the drawer. @default "md" */
|
|
5063
|
-
size?: DrawerSize;
|
|
5064
|
-
/** Whether to show the drag handle at the top. @default true */
|
|
5065
|
-
showHandle?: boolean;
|
|
5066
|
-
/** Extra classes for the overlay backdrop. */
|
|
5067
|
-
overlayClassName?: string;
|
|
5068
|
-
className?: string;
|
|
5069
|
-
children: ReactNode;
|
|
5070
|
-
}
|
|
5071
|
-
interface DrawerHandleProps extends HTMLAttributes<HTMLDivElement> {
|
|
5072
|
-
className?: string;
|
|
5073
|
-
}
|
|
5074
|
-
interface DrawerHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
5075
|
-
className?: string;
|
|
5076
|
-
children: ReactNode;
|
|
5077
|
-
}
|
|
5078
|
-
interface DrawerBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
5079
|
-
className?: string;
|
|
5080
|
-
children: ReactNode;
|
|
5081
|
-
}
|
|
5082
|
-
interface DrawerFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
5083
|
-
className?: string;
|
|
5084
|
-
children: ReactNode;
|
|
5085
|
-
}
|
|
5086
|
-
interface DrawerTitleProps extends ComponentPropsWithoutRef<typeof Drawer$1.Title> {
|
|
5087
|
-
className?: string;
|
|
5088
|
-
children: ReactNode;
|
|
5089
|
-
}
|
|
5090
|
-
interface DrawerDescriptionProps extends ComponentPropsWithoutRef<typeof Drawer$1.Description> {
|
|
5091
|
-
className?: string;
|
|
5092
|
-
children: ReactNode;
|
|
5093
|
-
}
|
|
5094
|
-
interface DrawerCloseProps extends ComponentPropsWithoutRef<typeof Drawer$1.Close> {
|
|
5095
|
-
className?: string;
|
|
5096
|
-
}
|
|
5097
|
-
/**
|
|
5098
|
-
* Drawer — a bottom sheet with drag-to-dismiss interaction.
|
|
5099
|
-
*
|
|
5100
|
-
* Wraps vaul's `Drawer.Root` with sensible defaults for the Unified UI
|
|
5101
|
-
* design system. Set `shouldScaleBackground` to control whether the
|
|
5102
|
-
* background content scales down when the drawer opens (requires the
|
|
5103
|
-
* `[vaul-drawer-wrapper]` attribute on your app wrapper).
|
|
5104
|
-
*/
|
|
5105
|
-
declare function Drawer({ shouldScaleBackground, children, ...rest }: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
5106
|
-
declare namespace Drawer {
|
|
5107
|
-
var displayName: string;
|
|
5108
|
-
}
|
|
5109
|
-
declare const DrawerTrigger: react.ForwardRefExoticComponent<DrawerTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
5110
|
-
/**
|
|
5111
|
-
* A visual drag handle rendered at the top of the drawer content.
|
|
5112
|
-
* Provides a clear affordance that the drawer can be dragged to dismiss.
|
|
5113
|
-
*/
|
|
5114
|
-
declare function DrawerHandle({ className, ...rest }: DrawerHandleProps): react_jsx_runtime.JSX.Element;
|
|
5115
|
-
declare namespace DrawerHandle {
|
|
5116
|
-
var displayName: string;
|
|
5117
|
-
}
|
|
5118
|
-
declare const DrawerContent: react.ForwardRefExoticComponent<DrawerContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
5119
|
-
declare function DrawerHeader({ className, children, ...rest }: DrawerHeaderProps): react_jsx_runtime.JSX.Element;
|
|
5120
|
-
declare namespace DrawerHeader {
|
|
5121
|
-
var displayName: string;
|
|
5122
|
-
}
|
|
5123
|
-
declare function DrawerBody({ className, children, ...rest }: DrawerBodyProps): react_jsx_runtime.JSX.Element;
|
|
5124
|
-
declare namespace DrawerBody {
|
|
5125
|
-
var displayName: string;
|
|
5126
|
-
}
|
|
5127
|
-
declare function DrawerFooter({ className, children, ...rest }: DrawerFooterProps): react_jsx_runtime.JSX.Element;
|
|
5128
|
-
declare namespace DrawerFooter {
|
|
5129
|
-
var displayName: string;
|
|
5130
|
-
}
|
|
5131
|
-
declare const DrawerTitle: react.ForwardRefExoticComponent<DrawerTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
5132
|
-
declare const DrawerDescription: react.ForwardRefExoticComponent<DrawerDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
5133
|
-
declare const DrawerClose: react.ForwardRefExoticComponent<DrawerCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
5134
|
-
|
|
5135
|
-
type SidebarVariant = "default" | "floating" | "inset";
|
|
5136
|
-
type SidebarCollapsible = "offcanvas" | "icon" | "none";
|
|
5137
|
-
type SidebarSide = "left" | "right";
|
|
5138
|
-
interface SidebarContextValue {
|
|
5139
|
-
state: "expanded" | "collapsed";
|
|
5140
|
-
open: boolean;
|
|
5141
|
-
setOpen: (open: boolean) => void;
|
|
5142
|
-
openMobile: boolean;
|
|
5143
|
-
setOpenMobile: (open: boolean) => void;
|
|
5144
|
-
isMobile: boolean;
|
|
5145
|
-
toggleSidebar: () => void;
|
|
5146
|
-
variant: SidebarVariant;
|
|
5147
|
-
collapsible: SidebarCollapsible;
|
|
5148
|
-
side: SidebarSide;
|
|
5149
|
-
}
|
|
5150
|
-
/**
|
|
5151
|
-
* Hook to access the sidebar context.
|
|
5152
|
-
*
|
|
5153
|
-
* Must be used within a `<SidebarProvider>`.
|
|
5154
|
-
*
|
|
5155
|
-
* @returns The sidebar context value containing state, open/close handlers,
|
|
5156
|
-
* mobile state, toggle function, variant, collapsible mode, and side.
|
|
5157
|
-
*
|
|
5158
|
-
* @example
|
|
5159
|
-
* ```tsx
|
|
5160
|
-
* const { open, toggleSidebar, isMobile, state } = useSidebar();
|
|
5161
|
-
*
|
|
5162
|
-
* // state is "expanded" or "collapsed"
|
|
5163
|
-
* // open is the boolean open state
|
|
5164
|
-
* ```
|
|
5165
|
-
*/
|
|
5166
|
-
declare function useSidebar(): SidebarContextValue;
|
|
5167
|
-
declare const useSidebarContext: typeof useSidebar;
|
|
5168
|
-
interface SidebarProviderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5169
|
-
/**
|
|
5170
|
-
* Whether the sidebar is open (controlled).
|
|
5171
|
-
* When provided, the component is controlled.
|
|
5510
|
+
* Whether the sidebar is open (controlled).
|
|
5511
|
+
* When provided, the component is controlled.
|
|
5172
5512
|
*/
|
|
5173
5513
|
open?: boolean;
|
|
5174
5514
|
/**
|
|
@@ -6134,6 +6474,61 @@ interface SliderProps extends Omit<ComponentPropsWithoutRef<typeof Slider$1.Root
|
|
|
6134
6474
|
*/
|
|
6135
6475
|
declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLSpanElement>>;
|
|
6136
6476
|
|
|
6477
|
+
type SonnerPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
6478
|
+
interface SonnerToasterProps extends Omit<ComponentPropsWithoutRef<"div">, "dir"> {
|
|
6479
|
+
/** @default "bottom-right" */
|
|
6480
|
+
position?: SonnerPosition;
|
|
6481
|
+
/** @default true */
|
|
6482
|
+
richColors?: boolean;
|
|
6483
|
+
/** @default true */
|
|
6484
|
+
closeButton?: boolean;
|
|
6485
|
+
/** @default 4000 */
|
|
6486
|
+
duration?: number;
|
|
6487
|
+
/** @default 3 */
|
|
6488
|
+
visibleToasts?: number;
|
|
6489
|
+
/** @default true */
|
|
6490
|
+
expand?: boolean;
|
|
6491
|
+
/** @default "system" */
|
|
6492
|
+
theme?: "light" | "dark" | "system";
|
|
6493
|
+
/** @default 16 */
|
|
6494
|
+
offset?: number | string;
|
|
6495
|
+
/** @default 14 */
|
|
6496
|
+
gap?: number;
|
|
6497
|
+
dir?: "ltr" | "rtl" | "auto";
|
|
6498
|
+
className?: string;
|
|
6499
|
+
toastOptions?: {
|
|
6500
|
+
className?: string;
|
|
6501
|
+
descriptionClassName?: string;
|
|
6502
|
+
style?: React.CSSProperties;
|
|
6503
|
+
classNames?: Partial<Record<string, string>>;
|
|
6504
|
+
};
|
|
6505
|
+
}
|
|
6506
|
+
/**
|
|
6507
|
+
* `SonnerToaster` — design-system-styled toast container.
|
|
6508
|
+
*
|
|
6509
|
+
* Place once in your root layout. Uses the `sonner` library under the hood
|
|
6510
|
+
* with Unified UI token styling applied automatically.
|
|
6511
|
+
*
|
|
6512
|
+
* @example
|
|
6513
|
+
* ```tsx
|
|
6514
|
+
* import { SonnerToaster, toast } from "@work-rjkashyap/unified-ui/components";
|
|
6515
|
+
*
|
|
6516
|
+
* // In layout:
|
|
6517
|
+
* <SonnerToaster />
|
|
6518
|
+
*
|
|
6519
|
+
* // Anywhere:
|
|
6520
|
+
* toast("Hello!");
|
|
6521
|
+
* toast.success("Saved!");
|
|
6522
|
+
* toast.error("Failed!");
|
|
6523
|
+
* toast.promise(saveData(), {
|
|
6524
|
+
* loading: "Saving...",
|
|
6525
|
+
* success: "Done!",
|
|
6526
|
+
* error: "Error!",
|
|
6527
|
+
* });
|
|
6528
|
+
* ```
|
|
6529
|
+
*/
|
|
6530
|
+
declare const SonnerToaster: react.ForwardRefExoticComponent<SonnerToasterProps & react.RefAttributes<HTMLDivElement>>;
|
|
6531
|
+
|
|
6137
6532
|
declare const spinnerVariants: (props?: ({
|
|
6138
6533
|
size?: "sm" | "md" | "xs" | "lg" | null | undefined;
|
|
6139
6534
|
variant?: "default" | "primary" | "secondary" | "muted" | null | undefined;
|
|
@@ -6655,6 +7050,61 @@ interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaEl
|
|
|
6655
7050
|
*/
|
|
6656
7051
|
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
6657
7052
|
|
|
7053
|
+
type ThemeToggleMode = "light-dark" | "light-dark-system";
|
|
7054
|
+
type ThemeToggleVariant = "icon" | "segmented";
|
|
7055
|
+
type ThemeToggleSize = "sm" | "md" | "lg";
|
|
7056
|
+
type ThemeValue = "light" | "dark" | "system";
|
|
7057
|
+
interface ThemeToggleProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
7058
|
+
/** Current theme value. */
|
|
7059
|
+
value: ThemeValue;
|
|
7060
|
+
/** Callback when the theme changes. */
|
|
7061
|
+
onChange: (value: ThemeValue) => void;
|
|
7062
|
+
/**
|
|
7063
|
+
* Toggle mode.
|
|
7064
|
+
* - "light-dark": cycles between light and dark only
|
|
7065
|
+
* - "light-dark-system": cycles through light, dark, and system
|
|
7066
|
+
* @default "light-dark"
|
|
7067
|
+
*/
|
|
7068
|
+
mode?: ThemeToggleMode;
|
|
7069
|
+
/**
|
|
7070
|
+
* Visual variant.
|
|
7071
|
+
* - "icon": single button that cycles on click
|
|
7072
|
+
* - "segmented": inline pill group with one button per option
|
|
7073
|
+
* @default "icon"
|
|
7074
|
+
*/
|
|
7075
|
+
variant?: ThemeToggleVariant;
|
|
7076
|
+
/**
|
|
7077
|
+
* Size of the toggle.
|
|
7078
|
+
* @default "md"
|
|
7079
|
+
*/
|
|
7080
|
+
size?: ThemeToggleSize;
|
|
7081
|
+
/** Additional CSS classes. */
|
|
7082
|
+
className?: string;
|
|
7083
|
+
}
|
|
7084
|
+
/**
|
|
7085
|
+
* ThemeToggle — a light/dark/system mode switcher.
|
|
7086
|
+
*
|
|
7087
|
+
* This is a headless, controlled component: you provide `value` and
|
|
7088
|
+
* `onChange`. It works with any theme provider (next-themes, custom
|
|
7089
|
+
* context, etc.).
|
|
7090
|
+
*
|
|
7091
|
+
* @example
|
|
7092
|
+
* ```tsx
|
|
7093
|
+
* // With next-themes
|
|
7094
|
+
* const { theme, setTheme } = useTheme();
|
|
7095
|
+
* <ThemeToggle value={theme as ThemeValue} onChange={setTheme} />
|
|
7096
|
+
*
|
|
7097
|
+
* // Segmented variant with system option
|
|
7098
|
+
* <ThemeToggle
|
|
7099
|
+
* value={theme as ThemeValue}
|
|
7100
|
+
* onChange={setTheme}
|
|
7101
|
+
* variant="segmented"
|
|
7102
|
+
* mode="light-dark-system"
|
|
7103
|
+
* />
|
|
7104
|
+
* ```
|
|
7105
|
+
*/
|
|
7106
|
+
declare const ThemeToggle: react.ForwardRefExoticComponent<ThemeToggleProps & react.RefAttributes<HTMLElement>>;
|
|
7107
|
+
|
|
6658
7108
|
type TimelineVariant = "default" | "outlined" | "filled";
|
|
6659
7109
|
type TimelineSize = "sm" | "md" | "lg";
|
|
6660
7110
|
type TimelineAlign = "left" | "right" | "alternate";
|
|
@@ -7157,147 +7607,128 @@ declare const ToggleGroup: react.ForwardRefExoticComponent<ToggleGroupProps & re
|
|
|
7157
7607
|
*/
|
|
7158
7608
|
declare const ToggleGroupItem: react.ForwardRefExoticComponent<ToggleGroupItemProps & react.RefAttributes<HTMLButtonElement>>;
|
|
7159
7609
|
|
|
7160
|
-
type
|
|
7161
|
-
type
|
|
7162
|
-
|
|
7163
|
-
type ThemeValue = "light" | "dark" | "system";
|
|
7164
|
-
interface ThemeToggleProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
7165
|
-
/** Current theme value. */
|
|
7166
|
-
value: ThemeValue;
|
|
7167
|
-
/** Callback when the theme changes. */
|
|
7168
|
-
onChange: (value: ThemeValue) => void;
|
|
7610
|
+
type TooltipSide = "top" | "right" | "bottom" | "left";
|
|
7611
|
+
type TooltipAlign = "start" | "center" | "end";
|
|
7612
|
+
interface TooltipProps {
|
|
7169
7613
|
/**
|
|
7170
|
-
*
|
|
7171
|
-
* - "light-dark": cycles between light and dark only
|
|
7172
|
-
* - "light-dark-system": cycles through light, dark, and system
|
|
7173
|
-
* @default "light-dark"
|
|
7614
|
+
* The tooltip content. Can be a string or ReactNode.
|
|
7174
7615
|
*/
|
|
7175
|
-
|
|
7616
|
+
content: ReactNode;
|
|
7176
7617
|
/**
|
|
7177
|
-
*
|
|
7178
|
-
* - "icon": single button that cycles on click
|
|
7179
|
-
* - "segmented": inline pill group with one button per option
|
|
7180
|
-
* @default "icon"
|
|
7618
|
+
* The trigger element. Must be a single React element that accepts a ref.
|
|
7181
7619
|
*/
|
|
7182
|
-
|
|
7620
|
+
children: ReactNode;
|
|
7183
7621
|
/**
|
|
7184
|
-
*
|
|
7185
|
-
* @default "
|
|
7622
|
+
* The preferred side of the trigger to render the tooltip.
|
|
7623
|
+
* @default "top"
|
|
7186
7624
|
*/
|
|
7187
|
-
|
|
7188
|
-
/**
|
|
7189
|
-
|
|
7625
|
+
side?: TooltipSide;
|
|
7626
|
+
/**
|
|
7627
|
+
* Alignment of the tooltip relative to the trigger.
|
|
7628
|
+
* @default "center"
|
|
7629
|
+
*/
|
|
7630
|
+
align?: TooltipAlign;
|
|
7631
|
+
/**
|
|
7632
|
+
* The distance in pixels from the trigger.
|
|
7633
|
+
* @default 6
|
|
7634
|
+
*/
|
|
7635
|
+
sideOffset?: number;
|
|
7636
|
+
/**
|
|
7637
|
+
* Whether to show an arrow pointing to the trigger.
|
|
7638
|
+
* @default true
|
|
7639
|
+
*/
|
|
7640
|
+
arrow?: boolean;
|
|
7641
|
+
/**
|
|
7642
|
+
* Maximum width of the tooltip content.
|
|
7643
|
+
* @default 220
|
|
7644
|
+
*/
|
|
7645
|
+
maxWidth?: number;
|
|
7646
|
+
/**
|
|
7647
|
+
* Delay in ms before the tooltip opens.
|
|
7648
|
+
* @default 300
|
|
7649
|
+
*/
|
|
7650
|
+
delayDuration?: number;
|
|
7651
|
+
/**
|
|
7652
|
+
* Delay in ms before the tooltip closes after leaving.
|
|
7653
|
+
* @default 0
|
|
7654
|
+
*/
|
|
7655
|
+
skipDelayDuration?: number;
|
|
7656
|
+
/**
|
|
7657
|
+
* Whether the tooltip is open (controlled).
|
|
7658
|
+
*/
|
|
7659
|
+
open?: boolean;
|
|
7660
|
+
/**
|
|
7661
|
+
* Callback when the open state changes.
|
|
7662
|
+
*/
|
|
7663
|
+
onOpenChange?: (open: boolean) => void;
|
|
7664
|
+
/**
|
|
7665
|
+
* Additional CSS classes for the tooltip content element.
|
|
7666
|
+
*/
|
|
7667
|
+
contentClassName?: string;
|
|
7668
|
+
}
|
|
7669
|
+
interface TooltipProviderProps extends ComponentPropsWithoutRef<typeof Tooltip$1.Provider> {
|
|
7670
|
+
children: ReactNode;
|
|
7190
7671
|
}
|
|
7191
7672
|
/**
|
|
7192
|
-
*
|
|
7673
|
+
* TooltipProvider — wraps your application (or a subtree) to configure
|
|
7674
|
+
* shared tooltip behavior like delay duration.
|
|
7193
7675
|
*
|
|
7194
|
-
*
|
|
7195
|
-
*
|
|
7196
|
-
* context, etc.).
|
|
7676
|
+
* Should be placed near the root of your app, or around any section
|
|
7677
|
+
* that uses tooltips.
|
|
7197
7678
|
*
|
|
7198
7679
|
* @example
|
|
7199
7680
|
* ```tsx
|
|
7200
|
-
*
|
|
7201
|
-
*
|
|
7202
|
-
*
|
|
7203
|
-
*
|
|
7204
|
-
* // Segmented variant with system option
|
|
7205
|
-
* <ThemeToggle
|
|
7206
|
-
* value={theme as ThemeValue}
|
|
7207
|
-
* onChange={setTheme}
|
|
7208
|
-
* variant="segmented"
|
|
7209
|
-
* mode="light-dark-system"
|
|
7210
|
-
* />
|
|
7681
|
+
* <TooltipProvider delayDuration={200}>
|
|
7682
|
+
* <App />
|
|
7683
|
+
* </TooltipProvider>
|
|
7211
7684
|
* ```
|
|
7212
7685
|
*/
|
|
7213
|
-
declare
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
/** Current color value in HEX format (e.g., "#ff0000"). */
|
|
7217
|
-
value?: string;
|
|
7218
|
-
/** Default color for uncontrolled mode. @default "#000000" */
|
|
7219
|
-
defaultValue?: string;
|
|
7220
|
-
/** Callback when color changes. */
|
|
7221
|
-
onChange?: (color: string) => void;
|
|
7222
|
-
/** Preset color swatches to display. */
|
|
7223
|
-
presets?: string[];
|
|
7224
|
-
/** Whether to show the HEX input field. @default true */
|
|
7225
|
-
showInput?: boolean;
|
|
7226
|
-
/** Whether the picker is disabled. @default false */
|
|
7227
|
-
disabled?: boolean;
|
|
7228
|
-
/** Size of the trigger swatch. @default "md" */
|
|
7229
|
-
size?: "sm" | "md" | "lg";
|
|
7230
|
-
/** Additional CSS classes. */
|
|
7231
|
-
className?: string;
|
|
7232
|
-
/** Placeholder label for accessibility. @default "Choose color" */
|
|
7233
|
-
label?: string;
|
|
7686
|
+
declare function TooltipProvider({ children, delayDuration, skipDelayDuration, ...rest }: TooltipProviderProps): react_jsx_runtime.JSX.Element;
|
|
7687
|
+
declare namespace TooltipProvider {
|
|
7688
|
+
var displayName: string;
|
|
7234
7689
|
}
|
|
7235
7690
|
/**
|
|
7236
|
-
*
|
|
7237
|
-
*
|
|
7691
|
+
* Tooltip — a small popup that displays informative text when hovering
|
|
7692
|
+
* or focusing on a trigger element.
|
|
7238
7693
|
*
|
|
7239
|
-
*
|
|
7240
|
-
*
|
|
7241
|
-
* <ColorPicker value={color} onChange={setColor} />
|
|
7242
|
-
* <ColorPicker defaultValue="#3b82f6" presets={["#ef4444", "#22c55e", "#3b82f6"]} />
|
|
7243
|
-
* ```
|
|
7244
|
-
*/
|
|
7245
|
-
declare const ColorPicker: react.ForwardRefExoticComponent<ColorPickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
7246
|
-
|
|
7247
|
-
type SonnerPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
7248
|
-
interface SonnerToasterProps extends Omit<ComponentPropsWithoutRef<"div">, "dir"> {
|
|
7249
|
-
/** @default "bottom-right" */
|
|
7250
|
-
position?: SonnerPosition;
|
|
7251
|
-
/** @default true */
|
|
7252
|
-
richColors?: boolean;
|
|
7253
|
-
/** @default true */
|
|
7254
|
-
closeButton?: boolean;
|
|
7255
|
-
/** @default 4000 */
|
|
7256
|
-
duration?: number;
|
|
7257
|
-
/** @default 3 */
|
|
7258
|
-
visibleToasts?: number;
|
|
7259
|
-
/** @default true */
|
|
7260
|
-
expand?: boolean;
|
|
7261
|
-
/** @default "system" */
|
|
7262
|
-
theme?: "light" | "dark" | "system";
|
|
7263
|
-
/** @default 16 */
|
|
7264
|
-
offset?: number | string;
|
|
7265
|
-
/** @default 14 */
|
|
7266
|
-
gap?: number;
|
|
7267
|
-
dir?: "ltr" | "rtl" | "auto";
|
|
7268
|
-
className?: string;
|
|
7269
|
-
toastOptions?: {
|
|
7270
|
-
className?: string;
|
|
7271
|
-
descriptionClassName?: string;
|
|
7272
|
-
style?: React.CSSProperties;
|
|
7273
|
-
classNames?: Partial<Record<string, string>>;
|
|
7274
|
-
};
|
|
7275
|
-
}
|
|
7276
|
-
/**
|
|
7277
|
-
* `SonnerToaster` — design-system-styled toast container.
|
|
7694
|
+
* Built on Radix UI's Tooltip primitive for full accessibility. The tooltip
|
|
7695
|
+
* appears after a configurable delay and supports keyboard access.
|
|
7278
7696
|
*
|
|
7279
|
-
*
|
|
7280
|
-
*
|
|
7697
|
+
* Accessibility:
|
|
7698
|
+
* - Radix handles `role="tooltip"` and `aria-describedby` automatically
|
|
7699
|
+
* - Opens on hover and focus, closes on blur and Escape
|
|
7700
|
+
* - Keyboard accessible: focusable triggers show the tooltip
|
|
7701
|
+
* - Content is announced by screen readers
|
|
7281
7702
|
*
|
|
7282
7703
|
* @example
|
|
7283
7704
|
* ```tsx
|
|
7284
|
-
*
|
|
7705
|
+
* // Basic usage (wrap app in TooltipProvider first)
|
|
7706
|
+
* <Tooltip content="Save your changes">
|
|
7707
|
+
* <button>Save</button>
|
|
7708
|
+
* </Tooltip>
|
|
7285
7709
|
*
|
|
7286
|
-
* //
|
|
7287
|
-
* <
|
|
7710
|
+
* // With side placement
|
|
7711
|
+
* <Tooltip content="More options" side="right">
|
|
7712
|
+
* <button>⋮</button>
|
|
7713
|
+
* </Tooltip>
|
|
7288
7714
|
*
|
|
7289
|
-
* //
|
|
7290
|
-
*
|
|
7291
|
-
*
|
|
7292
|
-
*
|
|
7293
|
-
*
|
|
7294
|
-
*
|
|
7295
|
-
*
|
|
7296
|
-
*
|
|
7297
|
-
*
|
|
7715
|
+
* // Without arrow
|
|
7716
|
+
* <Tooltip content="Delete" arrow={false}>
|
|
7717
|
+
* <button>🗑️</button>
|
|
7718
|
+
* </Tooltip>
|
|
7719
|
+
*
|
|
7720
|
+
* // Custom max width
|
|
7721
|
+
* <Tooltip content="This is a longer tooltip that needs more space" maxWidth={300}>
|
|
7722
|
+
* <span>Hover me</span>
|
|
7723
|
+
* </Tooltip>
|
|
7724
|
+
*
|
|
7725
|
+
* // Controlled
|
|
7726
|
+
* <Tooltip content="Info" open={isOpen} onOpenChange={setIsOpen}>
|
|
7727
|
+
* <button>i</button>
|
|
7728
|
+
* </Tooltip>
|
|
7298
7729
|
* ```
|
|
7299
7730
|
*/
|
|
7300
|
-
declare const
|
|
7731
|
+
declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLButtonElement>>;
|
|
7301
7732
|
|
|
7302
7733
|
interface TreeNode {
|
|
7303
7734
|
/** Unique identifier for this node. */
|
|
@@ -7362,6 +7793,37 @@ interface TreeViewProps {
|
|
|
7362
7793
|
*/
|
|
7363
7794
|
declare const TreeView: react.ForwardRefExoticComponent<TreeViewProps & react.RefAttributes<HTMLUListElement>>;
|
|
7364
7795
|
|
|
7796
|
+
interface VideoPlayerProps {
|
|
7797
|
+
/** Video source URL. */
|
|
7798
|
+
src: string;
|
|
7799
|
+
/** Poster image URL. */
|
|
7800
|
+
poster?: string;
|
|
7801
|
+
/** Aspect ratio. @default "video" (16:9) */
|
|
7802
|
+
aspectRatio?: "video" | "square" | "4/3" | "auto";
|
|
7803
|
+
/** @default false */
|
|
7804
|
+
autoPlay?: boolean;
|
|
7805
|
+
/** @default false */
|
|
7806
|
+
loop?: boolean;
|
|
7807
|
+
/** @default false */
|
|
7808
|
+
muted?: boolean;
|
|
7809
|
+
/** Whether to show custom controls. @default true */
|
|
7810
|
+
controls?: boolean;
|
|
7811
|
+
/** Additional CSS classes. */
|
|
7812
|
+
className?: string;
|
|
7813
|
+
/** Callback when video ends. */
|
|
7814
|
+
onEnded?: () => void;
|
|
7815
|
+
}
|
|
7816
|
+
/**
|
|
7817
|
+
* `VideoPlayer` — a styled video component with custom controls.
|
|
7818
|
+
*
|
|
7819
|
+
* @example
|
|
7820
|
+
* ```tsx
|
|
7821
|
+
* <VideoPlayer src="/demo.mp4" poster="/poster.jpg" />
|
|
7822
|
+
* <VideoPlayer src="/clip.webm" aspectRatio="4/3" autoPlay loop muted />
|
|
7823
|
+
* ```
|
|
7824
|
+
*/
|
|
7825
|
+
declare const VideoPlayer: react.ForwardRefExoticComponent<VideoPlayerProps & react.RefAttributes<HTMLDivElement>>;
|
|
7826
|
+
|
|
7365
7827
|
interface VirtualListProps<T = unknown> {
|
|
7366
7828
|
/** Array of items to render. */
|
|
7367
7829
|
items: T[];
|
|
@@ -7412,468 +7874,6 @@ declare const VirtualList: <T>(props: VirtualListProps<T> & {
|
|
|
7412
7874
|
ref?: React.Ref<HTMLDivElement>;
|
|
7413
7875
|
}) => ReactNode;
|
|
7414
7876
|
|
|
7415
|
-
interface GalleryImage {
|
|
7416
|
-
/** Image source URL. */
|
|
7417
|
-
src: string;
|
|
7418
|
-
/** Alt text for accessibility. */
|
|
7419
|
-
alt: string;
|
|
7420
|
-
/** Optional thumbnail URL (falls back to src). */
|
|
7421
|
-
thumbnail?: string;
|
|
7422
|
-
/** Optional caption shown in lightbox. */
|
|
7423
|
-
caption?: string;
|
|
7424
|
-
}
|
|
7425
|
-
interface ImageGalleryProps {
|
|
7426
|
-
/** Array of images to display. */
|
|
7427
|
-
images: GalleryImage[];
|
|
7428
|
-
/** Number of grid columns. @default 3 */
|
|
7429
|
-
columns?: 1 | 2 | 3 | 4;
|
|
7430
|
-
/** Gap between grid items in pixels. @default 8 */
|
|
7431
|
-
gap?: number;
|
|
7432
|
-
/** Aspect ratio for thumbnails. @default "square" */
|
|
7433
|
-
aspectRatio?: "square" | "video" | "auto";
|
|
7434
|
-
/** Whether to show the lightbox on click. @default true */
|
|
7435
|
-
lightbox?: boolean;
|
|
7436
|
-
/** Additional CSS classes on the grid container. */
|
|
7437
|
-
className?: string;
|
|
7438
|
-
/** Render custom thumbnail. */
|
|
7439
|
-
renderThumbnail?: (image: GalleryImage, index: number) => ReactNode;
|
|
7440
|
-
}
|
|
7441
|
-
/**
|
|
7442
|
-
* `ImageGallery` — a grid of images with optional lightbox viewer.
|
|
7443
|
-
*
|
|
7444
|
-
* @example
|
|
7445
|
-
* ```tsx
|
|
7446
|
-
* <ImageGallery
|
|
7447
|
-
* images={[
|
|
7448
|
-
* { src: "/photo-1.jpg", alt: "Beach sunset", caption: "Malibu, CA" },
|
|
7449
|
-
* { src: "/photo-2.jpg", alt: "Mountain view" },
|
|
7450
|
-
* ]}
|
|
7451
|
-
* columns={3}
|
|
7452
|
-
* />
|
|
7453
|
-
* ```
|
|
7454
|
-
*/
|
|
7455
|
-
declare const ImageGallery: react.ForwardRefExoticComponent<ImageGalleryProps & react.RefAttributes<HTMLDivElement>>;
|
|
7456
|
-
|
|
7457
|
-
interface VideoPlayerProps {
|
|
7458
|
-
/** Video source URL. */
|
|
7459
|
-
src: string;
|
|
7460
|
-
/** Poster image URL. */
|
|
7461
|
-
poster?: string;
|
|
7462
|
-
/** Aspect ratio. @default "video" (16:9) */
|
|
7463
|
-
aspectRatio?: "video" | "square" | "4/3" | "auto";
|
|
7464
|
-
/** @default false */
|
|
7465
|
-
autoPlay?: boolean;
|
|
7466
|
-
/** @default false */
|
|
7467
|
-
loop?: boolean;
|
|
7468
|
-
/** @default false */
|
|
7469
|
-
muted?: boolean;
|
|
7470
|
-
/** Whether to show custom controls. @default true */
|
|
7471
|
-
controls?: boolean;
|
|
7472
|
-
/** Additional CSS classes. */
|
|
7473
|
-
className?: string;
|
|
7474
|
-
/** Callback when video ends. */
|
|
7475
|
-
onEnded?: () => void;
|
|
7476
|
-
}
|
|
7477
|
-
/**
|
|
7478
|
-
* `VideoPlayer` — a styled video component with custom controls.
|
|
7479
|
-
*
|
|
7480
|
-
* @example
|
|
7481
|
-
* ```tsx
|
|
7482
|
-
* <VideoPlayer src="/demo.mp4" poster="/poster.jpg" />
|
|
7483
|
-
* <VideoPlayer src="/clip.webm" aspectRatio="4/3" autoPlay loop muted />
|
|
7484
|
-
* ```
|
|
7485
|
-
*/
|
|
7486
|
-
declare const VideoPlayer: react.ForwardRefExoticComponent<VideoPlayerProps & react.RefAttributes<HTMLDivElement>>;
|
|
7487
|
-
|
|
7488
|
-
interface ChartContainerProps {
|
|
7489
|
-
/** Chart title. */
|
|
7490
|
-
title?: string;
|
|
7491
|
-
/** Chart description/subtitle. */
|
|
7492
|
-
description?: string;
|
|
7493
|
-
/** Chart height in pixels. @default 350 */
|
|
7494
|
-
height?: number;
|
|
7495
|
-
/** The Recharts chart component(s) to render. */
|
|
7496
|
-
children: ReactNode;
|
|
7497
|
-
/** Footer content (e.g., legend, notes). */
|
|
7498
|
-
footer?: ReactNode;
|
|
7499
|
-
/** Whether data is loading. @default false */
|
|
7500
|
-
loading?: boolean;
|
|
7501
|
-
/** Custom loading indicator. */
|
|
7502
|
-
loadingIndicator?: ReactNode;
|
|
7503
|
-
/** Content to show when chart has no data. */
|
|
7504
|
-
emptyContent?: ReactNode;
|
|
7505
|
-
/** Additional CSS classes. */
|
|
7506
|
-
className?: string;
|
|
7507
|
-
}
|
|
7508
|
-
/**
|
|
7509
|
-
* Design system chart colors. Use these as `fill` or `stroke` values
|
|
7510
|
-
* in Recharts components for consistent theming.
|
|
7511
|
-
*
|
|
7512
|
-
* @example
|
|
7513
|
-
* ```tsx
|
|
7514
|
-
* <Bar dataKey="revenue" fill={chartColors[0]} />
|
|
7515
|
-
* <Bar dataKey="expenses" fill={chartColors[1]} />
|
|
7516
|
-
* ```
|
|
7517
|
-
*/
|
|
7518
|
-
declare const chartColors: readonly ["var(--primary)", "var(--info)", "var(--success)", "var(--warning)", "var(--danger)", "var(--secondary)", "var(--muted-foreground)", "oklch(0.65 0.15 250)", "oklch(0.65 0.15 160)", "oklch(0.65 0.15 30)"];
|
|
7519
|
-
/**
|
|
7520
|
-
* `ChartContainer` — a card wrapper for Recharts charts with DS styling.
|
|
7521
|
-
*
|
|
7522
|
-
* Place your Recharts `<BarChart>`, `<LineChart>`, `<PieChart>`, etc.
|
|
7523
|
-
* as children. The container provides a responsive wrapper, title, and
|
|
7524
|
-
* optional footer.
|
|
7525
|
-
*
|
|
7526
|
-
* **Important**: This component does NOT bundle Recharts. You must install
|
|
7527
|
-
* `recharts` separately as a peer dependency.
|
|
7528
|
-
*
|
|
7529
|
-
* @example
|
|
7530
|
-
* ```tsx
|
|
7531
|
-
* import { ChartContainer, chartColors } from "@work-rjkashyap/unified-ui/components";
|
|
7532
|
-
* import { ResponsiveContainer, BarChart, Bar, XAxis, YAxis, Tooltip } from "recharts";
|
|
7533
|
-
*
|
|
7534
|
-
* <ChartContainer title="Monthly Revenue" description="Last 6 months">
|
|
7535
|
-
* <ResponsiveContainer width="100%" height="100%">
|
|
7536
|
-
* <BarChart data={data}>
|
|
7537
|
-
* <XAxis dataKey="month" stroke="var(--muted-foreground)" fontSize={12} />
|
|
7538
|
-
* <YAxis stroke="var(--muted-foreground)" fontSize={12} />
|
|
7539
|
-
* <Tooltip
|
|
7540
|
-
* contentStyle={{
|
|
7541
|
-
* background: "var(--background)",
|
|
7542
|
-
* border: "1px solid var(--border)",
|
|
7543
|
-
* borderRadius: "var(--radius-md)",
|
|
7544
|
-
* fontSize: 13,
|
|
7545
|
-
* }}
|
|
7546
|
-
* />
|
|
7547
|
-
* <Bar dataKey="revenue" fill={chartColors[0]} radius={[4, 4, 0, 0]} />
|
|
7548
|
-
* </BarChart>
|
|
7549
|
-
* </ResponsiveContainer>
|
|
7550
|
-
* </ChartContainer>
|
|
7551
|
-
* ```
|
|
7552
|
-
*/
|
|
7553
|
-
declare const ChartContainer: react.ForwardRefExoticComponent<ChartContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
7554
|
-
interface ChartTooltipContentProps {
|
|
7555
|
-
/** Label for the tooltip header. */
|
|
7556
|
-
label?: string;
|
|
7557
|
-
/** Payload from Recharts tooltip. */
|
|
7558
|
-
payload?: Array<{
|
|
7559
|
-
name: string;
|
|
7560
|
-
value: number | string;
|
|
7561
|
-
color?: string;
|
|
7562
|
-
fill?: string;
|
|
7563
|
-
}>;
|
|
7564
|
-
/** Whether the tooltip is active. */
|
|
7565
|
-
active?: boolean;
|
|
7566
|
-
/** Custom formatter for values. */
|
|
7567
|
-
formatter?: (value: number | string, name: string) => string;
|
|
7568
|
-
/** Additional class names. */
|
|
7569
|
-
className?: string;
|
|
7570
|
-
}
|
|
7571
|
-
/**
|
|
7572
|
-
* `ChartTooltipContent` — a pre-styled tooltip content component for Recharts.
|
|
7573
|
-
*
|
|
7574
|
-
* Use as the `content` prop of Recharts' `<Tooltip>`:
|
|
7575
|
-
*
|
|
7576
|
-
* @example
|
|
7577
|
-
* ```tsx
|
|
7578
|
-
* <Tooltip content={<ChartTooltipContent />} />
|
|
7579
|
-
* ```
|
|
7580
|
-
*/
|
|
7581
|
-
declare function ChartTooltipContent({ label, payload, active, formatter, className, }: ChartTooltipContentProps): react_jsx_runtime.JSX.Element | null;
|
|
7582
|
-
declare namespace ChartTooltipContent {
|
|
7583
|
-
var displayName: string;
|
|
7584
|
-
}
|
|
7585
|
-
|
|
7586
|
-
interface MarkdownProps {
|
|
7587
|
-
/** Markdown string to render. */
|
|
7588
|
-
content: string;
|
|
7589
|
-
/** Text size variant. @default "base" */
|
|
7590
|
-
size?: "sm" | "base" | "lg";
|
|
7591
|
-
/** Whether to remove max-width constraint. @default false */
|
|
7592
|
-
fluid?: boolean;
|
|
7593
|
-
/** Additional CSS classes. */
|
|
7594
|
-
className?: string;
|
|
7595
|
-
/** Whether to allow raw HTML in the markdown. @default false */
|
|
7596
|
-
allowHtml?: boolean;
|
|
7597
|
-
}
|
|
7598
|
-
/**
|
|
7599
|
-
* `Markdown` — renders a markdown string with design system prose styles.
|
|
7600
|
-
*
|
|
7601
|
-
* For simple markdown display use cases. For full MDX support, use
|
|
7602
|
-
* Fumadocs or a dedicated MDX processor.
|
|
7603
|
-
*
|
|
7604
|
-
* @example
|
|
7605
|
-
* ```tsx
|
|
7606
|
-
* <Markdown content={`
|
|
7607
|
-
* # Hello World
|
|
7608
|
-
*
|
|
7609
|
-
* Some **bold** and *italic* text with \`inline code\`.
|
|
7610
|
-
*
|
|
7611
|
-
* - Item one
|
|
7612
|
-
* - Item two
|
|
7613
|
-
*
|
|
7614
|
-
* > A blockquote
|
|
7615
|
-
*
|
|
7616
|
-
* \`\`\`tsx
|
|
7617
|
-
* const x = 42;
|
|
7618
|
-
* \`\`\`
|
|
7619
|
-
* `} />
|
|
7620
|
-
* ```
|
|
7621
|
-
*/
|
|
7622
|
-
declare const Markdown: react.ForwardRefExoticComponent<MarkdownProps & react.RefAttributes<HTMLDivElement>>;
|
|
7623
|
-
|
|
7624
|
-
interface DataTableFilter {
|
|
7625
|
-
/** Unique identifier for this filter. */
|
|
7626
|
-
id: string;
|
|
7627
|
-
/** Display label. */
|
|
7628
|
-
label: string;
|
|
7629
|
-
/** Available options for this filter. */
|
|
7630
|
-
options: Array<{
|
|
7631
|
-
label: string;
|
|
7632
|
-
value: string;
|
|
7633
|
-
count?: number;
|
|
7634
|
-
}>;
|
|
7635
|
-
/** Currently selected values. */
|
|
7636
|
-
selected: string[];
|
|
7637
|
-
}
|
|
7638
|
-
interface ColumnVisibility {
|
|
7639
|
-
/** Column identifier. */
|
|
7640
|
-
id: string;
|
|
7641
|
-
/** Display label. */
|
|
7642
|
-
label: string;
|
|
7643
|
-
/** Whether the column is visible. */
|
|
7644
|
-
visible: boolean;
|
|
7645
|
-
}
|
|
7646
|
-
type ViewMode = "table" | "grid" | "list";
|
|
7647
|
-
interface DataTableToolbarProps {
|
|
7648
|
-
/** Current search value. */
|
|
7649
|
-
searchValue?: string;
|
|
7650
|
-
/** Callback when search value changes. */
|
|
7651
|
-
onSearchChange?: (value: string) => void;
|
|
7652
|
-
/** Search placeholder text. @default "Search..." */
|
|
7653
|
-
searchPlaceholder?: string;
|
|
7654
|
-
/** Debounce delay for search in ms. @default 300 */
|
|
7655
|
-
searchDebounce?: number;
|
|
7656
|
-
/** Filter definitions and their current state. */
|
|
7657
|
-
filters?: DataTableFilter[];
|
|
7658
|
-
/** Callback when a filter's selected values change. */
|
|
7659
|
-
onFilterChange?: (filterId: string, selected: string[]) => void;
|
|
7660
|
-
/** Callback to clear all filters. */
|
|
7661
|
-
onClearFilters?: () => void;
|
|
7662
|
-
/** Column visibility state. */
|
|
7663
|
-
columns?: ColumnVisibility[];
|
|
7664
|
-
/** Callback when column visibility changes. */
|
|
7665
|
-
onColumnVisibilityChange?: (columnId: string, visible: boolean) => void;
|
|
7666
|
-
/** Current view mode. */
|
|
7667
|
-
viewMode?: ViewMode;
|
|
7668
|
-
/** Available view modes. */
|
|
7669
|
-
viewModes?: ViewMode[];
|
|
7670
|
-
/** Callback when view mode changes. */
|
|
7671
|
-
onViewModeChange?: (mode: ViewMode) => void;
|
|
7672
|
-
/** Extra actions to render on the right side of the toolbar. */
|
|
7673
|
-
actions?: ReactNode;
|
|
7674
|
-
/** Additional CSS classes. */
|
|
7675
|
-
className?: string;
|
|
7676
|
-
}
|
|
7677
|
-
/**
|
|
7678
|
-
* `DataTableToolbar` — a composable toolbar for DataTable with search,
|
|
7679
|
-
* filters, column visibility, and view mode controls.
|
|
7680
|
-
*
|
|
7681
|
-
* @example
|
|
7682
|
-
* ```tsx
|
|
7683
|
-
* <DataTableToolbar
|
|
7684
|
-
* searchValue={search}
|
|
7685
|
-
* onSearchChange={setSearch}
|
|
7686
|
-
* filters={[
|
|
7687
|
-
* {
|
|
7688
|
-
* id: "status",
|
|
7689
|
-
* label: "Status",
|
|
7690
|
-
* options: [
|
|
7691
|
-
* { label: "Active", value: "active", count: 12 },
|
|
7692
|
-
* { label: "Inactive", value: "inactive", count: 5 },
|
|
7693
|
-
* ],
|
|
7694
|
-
* selected: selectedStatuses,
|
|
7695
|
-
* },
|
|
7696
|
-
* ]}
|
|
7697
|
-
* onFilterChange={handleFilter}
|
|
7698
|
-
* onClearFilters={() => setFilters({})}
|
|
7699
|
-
* />
|
|
7700
|
-
* ```
|
|
7701
|
-
*/
|
|
7702
|
-
declare const DataTableToolbar: react.ForwardRefExoticComponent<DataTableToolbarProps & react.RefAttributes<HTMLDivElement>>;
|
|
7703
|
-
|
|
7704
|
-
interface InfiniteScrollProps {
|
|
7705
|
-
/** Content to render (the list items). */
|
|
7706
|
-
children: ReactNode;
|
|
7707
|
-
/** Whether more data is currently being loaded. */
|
|
7708
|
-
loading?: boolean;
|
|
7709
|
-
/** Whether there is more data to load. */
|
|
7710
|
-
hasMore?: boolean;
|
|
7711
|
-
/** Callback to trigger loading more data. */
|
|
7712
|
-
onLoadMore: () => void;
|
|
7713
|
-
/**
|
|
7714
|
-
* IntersectionObserver rootMargin value. Controls how far from the
|
|
7715
|
-
* bottom the trigger fires.
|
|
7716
|
-
* @default "200px"
|
|
7717
|
-
*/
|
|
7718
|
-
threshold?: string;
|
|
7719
|
-
/** Custom loading indicator. */
|
|
7720
|
-
loadingIndicator?: ReactNode;
|
|
7721
|
-
/** Content to show when all data has been loaded. */
|
|
7722
|
-
endMessage?: ReactNode;
|
|
7723
|
-
/** Additional CSS classes on the container. */
|
|
7724
|
-
className?: string;
|
|
7725
|
-
/** Additional CSS classes on the sentinel element. */
|
|
7726
|
-
sentinelClassName?: string;
|
|
7727
|
-
}
|
|
7728
|
-
/**
|
|
7729
|
-
* `InfiniteScroll` — scroll-triggered infinite loading.
|
|
7730
|
-
*
|
|
7731
|
-
* Renders children with a sentinel element at the bottom. When the
|
|
7732
|
-
* sentinel enters the viewport (via IntersectionObserver), it calls
|
|
7733
|
-
* `onLoadMore`. Shows a loading indicator while fetching and an optional
|
|
7734
|
-
* end message when `hasMore` is false.
|
|
7735
|
-
*
|
|
7736
|
-
* @example
|
|
7737
|
-
* ```tsx
|
|
7738
|
-
* const { data, fetchNextPage, hasNextPage, isFetchingNextPage } = useInfiniteQuery(...);
|
|
7739
|
-
*
|
|
7740
|
-
* <InfiniteScroll
|
|
7741
|
-
* loading={isFetchingNextPage}
|
|
7742
|
-
* hasMore={hasNextPage}
|
|
7743
|
-
* onLoadMore={fetchNextPage}
|
|
7744
|
-
* endMessage={<p className="text-center text-sm text-muted-foreground py-4">That's all!</p>}
|
|
7745
|
-
* >
|
|
7746
|
-
* {data.pages.flat().map(item => (
|
|
7747
|
-
* <Card key={item.id}>{item.name}</Card>
|
|
7748
|
-
* ))}
|
|
7749
|
-
* </InfiniteScroll>
|
|
7750
|
-
* ```
|
|
7751
|
-
*/
|
|
7752
|
-
declare const InfiniteScroll: react.ForwardRefExoticComponent<InfiniteScrollProps & react.RefAttributes<HTMLDivElement>>;
|
|
7753
|
-
|
|
7754
|
-
type TooltipSide = "top" | "right" | "bottom" | "left";
|
|
7755
|
-
type TooltipAlign = "start" | "center" | "end";
|
|
7756
|
-
interface TooltipProps {
|
|
7757
|
-
/**
|
|
7758
|
-
* The tooltip content. Can be a string or ReactNode.
|
|
7759
|
-
*/
|
|
7760
|
-
content: ReactNode;
|
|
7761
|
-
/**
|
|
7762
|
-
* The trigger element. Must be a single React element that accepts a ref.
|
|
7763
|
-
*/
|
|
7764
|
-
children: ReactNode;
|
|
7765
|
-
/**
|
|
7766
|
-
* The preferred side of the trigger to render the tooltip.
|
|
7767
|
-
* @default "top"
|
|
7768
|
-
*/
|
|
7769
|
-
side?: TooltipSide;
|
|
7770
|
-
/**
|
|
7771
|
-
* Alignment of the tooltip relative to the trigger.
|
|
7772
|
-
* @default "center"
|
|
7773
|
-
*/
|
|
7774
|
-
align?: TooltipAlign;
|
|
7775
|
-
/**
|
|
7776
|
-
* The distance in pixels from the trigger.
|
|
7777
|
-
* @default 6
|
|
7778
|
-
*/
|
|
7779
|
-
sideOffset?: number;
|
|
7780
|
-
/**
|
|
7781
|
-
* Whether to show an arrow pointing to the trigger.
|
|
7782
|
-
* @default true
|
|
7783
|
-
*/
|
|
7784
|
-
arrow?: boolean;
|
|
7785
|
-
/**
|
|
7786
|
-
* Maximum width of the tooltip content.
|
|
7787
|
-
* @default 220
|
|
7788
|
-
*/
|
|
7789
|
-
maxWidth?: number;
|
|
7790
|
-
/**
|
|
7791
|
-
* Delay in ms before the tooltip opens.
|
|
7792
|
-
* @default 300
|
|
7793
|
-
*/
|
|
7794
|
-
delayDuration?: number;
|
|
7795
|
-
/**
|
|
7796
|
-
* Delay in ms before the tooltip closes after leaving.
|
|
7797
|
-
* @default 0
|
|
7798
|
-
*/
|
|
7799
|
-
skipDelayDuration?: number;
|
|
7800
|
-
/**
|
|
7801
|
-
* Whether the tooltip is open (controlled).
|
|
7802
|
-
*/
|
|
7803
|
-
open?: boolean;
|
|
7804
|
-
/**
|
|
7805
|
-
* Callback when the open state changes.
|
|
7806
|
-
*/
|
|
7807
|
-
onOpenChange?: (open: boolean) => void;
|
|
7808
|
-
/**
|
|
7809
|
-
* Additional CSS classes for the tooltip content element.
|
|
7810
|
-
*/
|
|
7811
|
-
contentClassName?: string;
|
|
7812
|
-
}
|
|
7813
|
-
interface TooltipProviderProps extends ComponentPropsWithoutRef<typeof Tooltip$1.Provider> {
|
|
7814
|
-
children: ReactNode;
|
|
7815
|
-
}
|
|
7816
|
-
/**
|
|
7817
|
-
* TooltipProvider — wraps your application (or a subtree) to configure
|
|
7818
|
-
* shared tooltip behavior like delay duration.
|
|
7819
|
-
*
|
|
7820
|
-
* Should be placed near the root of your app, or around any section
|
|
7821
|
-
* that uses tooltips.
|
|
7822
|
-
*
|
|
7823
|
-
* @example
|
|
7824
|
-
* ```tsx
|
|
7825
|
-
* <TooltipProvider delayDuration={200}>
|
|
7826
|
-
* <App />
|
|
7827
|
-
* </TooltipProvider>
|
|
7828
|
-
* ```
|
|
7829
|
-
*/
|
|
7830
|
-
declare function TooltipProvider({ children, delayDuration, skipDelayDuration, ...rest }: TooltipProviderProps): react_jsx_runtime.JSX.Element;
|
|
7831
|
-
declare namespace TooltipProvider {
|
|
7832
|
-
var displayName: string;
|
|
7833
|
-
}
|
|
7834
|
-
/**
|
|
7835
|
-
* Tooltip — a small popup that displays informative text when hovering
|
|
7836
|
-
* or focusing on a trigger element.
|
|
7837
|
-
*
|
|
7838
|
-
* Built on Radix UI's Tooltip primitive for full accessibility. The tooltip
|
|
7839
|
-
* appears after a configurable delay and supports keyboard access.
|
|
7840
|
-
*
|
|
7841
|
-
* Accessibility:
|
|
7842
|
-
* - Radix handles `role="tooltip"` and `aria-describedby` automatically
|
|
7843
|
-
* - Opens on hover and focus, closes on blur and Escape
|
|
7844
|
-
* - Keyboard accessible: focusable triggers show the tooltip
|
|
7845
|
-
* - Content is announced by screen readers
|
|
7846
|
-
*
|
|
7847
|
-
* @example
|
|
7848
|
-
* ```tsx
|
|
7849
|
-
* // Basic usage (wrap app in TooltipProvider first)
|
|
7850
|
-
* <Tooltip content="Save your changes">
|
|
7851
|
-
* <button>Save</button>
|
|
7852
|
-
* </Tooltip>
|
|
7853
|
-
*
|
|
7854
|
-
* // With side placement
|
|
7855
|
-
* <Tooltip content="More options" side="right">
|
|
7856
|
-
* <button>⋮</button>
|
|
7857
|
-
* </Tooltip>
|
|
7858
|
-
*
|
|
7859
|
-
* // Without arrow
|
|
7860
|
-
* <Tooltip content="Delete" arrow={false}>
|
|
7861
|
-
* <button>🗑️</button>
|
|
7862
|
-
* </Tooltip>
|
|
7863
|
-
*
|
|
7864
|
-
* // Custom max width
|
|
7865
|
-
* <Tooltip content="This is a longer tooltip that needs more space" maxWidth={300}>
|
|
7866
|
-
* <span>Hover me</span>
|
|
7867
|
-
* </Tooltip>
|
|
7868
|
-
*
|
|
7869
|
-
* // Controlled
|
|
7870
|
-
* <Tooltip content="Info" open={isOpen} onOpenChange={setIsOpen}>
|
|
7871
|
-
* <button>i</button>
|
|
7872
|
-
* </Tooltip>
|
|
7873
|
-
* ```
|
|
7874
|
-
*/
|
|
7875
|
-
declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLButtonElement>>;
|
|
7876
|
-
|
|
7877
7877
|
interface VisuallyHiddenProps extends ComponentPropsWithoutRef<typeof VisuallyHidden$1.Root> {
|
|
7878
7878
|
}
|
|
7879
7879
|
declare const VisuallyHidden: react.ForwardRefExoticComponent<VisuallyHiddenProps & react.RefAttributes<HTMLSpanElement>>;
|