@juv/codego-react-ui 3.0.1 → 3.0.3

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/dist/index.d.cts CHANGED
@@ -59,7 +59,7 @@ interface BreadcrumbProps {
59
59
  declare function Breadcrumb({ items, separator, maxItems, className, }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
60
60
 
61
61
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
62
- variant?: "primary" | "secondary" | "outline" | "ghost" | "link" | "danger" | "success";
62
+ variant?: "primary" | "secondary" | "outline" | "ghost" | "link" | "danger" | "success" | "destructive";
63
63
  size?: "xs" | "sm" | "md" | "lg" | "xl";
64
64
  fullWidth?: boolean;
65
65
  width?: number | string;
@@ -336,6 +336,145 @@ interface MetricRowProps {
336
336
  }
337
337
  declare function MetricRow({ items, divided, className }: MetricRowProps): react_jsx_runtime.JSX.Element;
338
338
 
339
+ interface ServerPaginationLink {
340
+ page: number;
341
+ url: string;
342
+ active: boolean;
343
+ }
344
+ interface ServerPagination {
345
+ first_page_url: string;
346
+ last_page_url: string;
347
+ next_page_url: string | null;
348
+ prev_page_url: string | null;
349
+ per_page: number;
350
+ total: number;
351
+ links: ServerPaginationLink[];
352
+ }
353
+ interface ServerTableResponse<T> {
354
+ current_page: number;
355
+ data: T[];
356
+ pagination: ServerPagination;
357
+ }
358
+ interface UseServerTableOptions {
359
+ /** Base URL — page param appended automatically: `url?page=N` */
360
+ url: string;
361
+ /** Extra query params merged on every request */
362
+ params?: Record<string, string | number>;
363
+ }
364
+ interface UseServerTableReturn<T> {
365
+ data: T[];
366
+ columns: Column<T>[];
367
+ currentPage: number;
368
+ pagination: ServerPagination | null;
369
+ serverPagination: ServerPaginationProp | null;
370
+ loading: boolean;
371
+ error: string | null;
372
+ goToPage: (page: number) => void;
373
+ reload: () => void;
374
+ }
375
+ interface ServerPaginationProp {
376
+ pagination: ServerPagination;
377
+ currentPage: number;
378
+ goToPage: (page: number) => void;
379
+ }
380
+ declare function useServerTable<T extends Record<string, any>>({ url, params }: UseServerTableOptions): UseServerTableReturn<T>;
381
+ type ActionFieldType = "input" | "password" | "textarea" | "checkbox" | "toggle" | "select" | "radio" | "slider" | "tag-input" | "otp" | "combobox" | "color-picker" | "date-range" | "rich-text" | "file-upload" | "repeater";
382
+ interface ActionField {
383
+ key: string;
384
+ label: string;
385
+ type?: ActionFieldType;
386
+ /** HTML input type for type="input" (e.g. "email", "number", "password") */
387
+ inputType?: string;
388
+ /** Options for type="select", "radio", "combobox" — string[] or { label, value }[] */
389
+ options?: string[] | {
390
+ label: string;
391
+ value: string;
392
+ }[];
393
+ placeholder?: string;
394
+ required?: boolean;
395
+ /** Min value for type="slider" */
396
+ min?: number;
397
+ /** Max value for type="slider" */
398
+ max?: number;
399
+ /** Step for type="slider" */
400
+ step?: number;
401
+ /** Number of OTP digits for type="otp" */
402
+ digits?: number;
403
+ /** Custom render — overrides built-in field renderer */
404
+ render?: (value: any, onChange: (v: any) => void) => React.ReactNode;
405
+ }
406
+ interface DefaultActionsConfig<T> {
407
+ /**
408
+ * Base URL used to build PUT and DELETE requests.
409
+ * PUT → `{baseUrl}/{id}/update`
410
+ * DELETE → `{baseUrl}/{id}/delete`
411
+ */
412
+ baseUrl: string;
413
+ /** Row key used as the URL id segment. Defaults to "id". */
414
+ idKey?: keyof T;
415
+ /** Fields rendered in the Edit modal form. Auto-derived from row keys when omitted. */
416
+ editForm?: ActionField[];
417
+ /** Fields rendered in the View modal. Auto-derived from row keys when omitted. */
418
+ viewForm?: ActionField[];
419
+ /** Called after a successful edit or delete so the parent can refresh data. */
420
+ onSuccess?: (action: "edit" | "delete", item: T) => void;
421
+ }
422
+ interface Column<T> {
423
+ key: keyof T | string;
424
+ title: string;
425
+ type?: "text" | "image" | "badge" | "icon" | "stack" | "select" | "toggle" | "color" | "checkbox";
426
+ stackProps?: {
427
+ limit?: number;
428
+ stacked?: boolean;
429
+ shape?: "circle" | "square";
430
+ size?: number;
431
+ };
432
+ /** Options for type="select" */
433
+ selectOptions?: string[];
434
+ render?: (item: T) => React.ReactNode;
435
+ sortable?: boolean;
436
+ /** Called when a cell value changes (select, toggle, color, checkbox) */
437
+ onChange?: (item: T, value: any) => void;
438
+ }
439
+ interface TableProps<T> {
440
+ data: T[];
441
+ columns: Column<T>[];
442
+ searchable?: boolean;
443
+ searchPlaceholder?: string;
444
+ pagination?: boolean;
445
+ itemsPerPage?: number;
446
+ selectable?: boolean;
447
+ onBulkDelete?: (selectedIds: string[]) => void;
448
+ idKey?: keyof T;
449
+ /** When provided, appends an Actions column with View / Edit / Delete buttons */
450
+ defaultActions?: DefaultActionsConfig<T>;
451
+ /** Pass the serverPagination object from useServerTable to enable server-side pagination */
452
+ serverPagination?: ServerPaginationProp;
453
+ className?: string;
454
+ }
455
+ declare function Table<T extends Record<string, any>>({ data, columns, searchable, searchPlaceholder, pagination, itemsPerPage, selectable, onBulkDelete, idKey, defaultActions, serverPagination, className, }: TableProps<T>): react_jsx_runtime.JSX.Element;
456
+
457
+ interface ServerDataGridProp {
458
+ pagination: ServerPagination;
459
+ currentPage: number;
460
+ goToPage: (page: number) => void;
461
+ }
462
+ interface UseServerDataGridOptions {
463
+ url: string;
464
+ params?: Record<string, string | number>;
465
+ }
466
+ interface UseServerDataGridReturn<T> {
467
+ data: T[];
468
+ columns: DataGridColumn<T>[];
469
+ currentPage: number;
470
+ pagination: ServerPagination | null;
471
+ serverPagination: ServerDataGridProp | null;
472
+ loading: boolean;
473
+ error: string | null;
474
+ goToPage: (page: number) => void;
475
+ reload: () => void;
476
+ }
477
+ declare function useServerDataGrid<T extends Record<string, any>>({ url, params }: UseServerDataGridOptions): UseServerDataGridReturn<T>;
339
478
  type SortDir = "asc" | "desc" | null;
340
479
  interface DataGridColumn<T> {
341
480
  key: keyof T | string;
@@ -360,8 +499,12 @@ interface DataGridProps<T> {
360
499
  emptyMessage?: string;
361
500
  className?: string;
362
501
  onRowClick?: (row: T) => void;
502
+ /** Appends View / Edit / Delete action buttons per row */
503
+ defaultActions?: DefaultActionsConfig<T>;
504
+ /** Pass the serverPagination object from useServerDataGrid to enable server-driven pagination */
505
+ serverPagination?: ServerDataGridProp;
363
506
  }
364
- declare function DataGrid<T extends Record<string, unknown>>({ columns, data, rowKey, selectable, selected: controlledSelected, onSelectChange, pageSize, showPagination, showColumnToggle, loading, emptyMessage, className, onRowClick, }: DataGridProps<T>): react_jsx_runtime.JSX.Element;
507
+ declare function DataGrid<T extends Record<string, unknown>>({ columns, data, rowKey, selectable, selected: controlledSelected, onSelectChange, pageSize, showPagination, showColumnToggle, loading, emptyMessage, className, onRowClick, defaultActions, serverPagination, }: DataGridProps<T>): react_jsx_runtime.JSX.Element;
365
508
 
366
509
  interface DatePickerProps {
367
510
  mode: "date" | "dateTime" | "time";
@@ -760,24 +903,38 @@ interface ModalConfirmationProps {
760
903
  * A two-button confirmation modal with danger / warning / success / info variants.
761
904
  */
762
905
  declare function ModalConfirmation({ isOpen, onClose, onConfirm, variant, title, description, confirmLabel, cancelLabel, loading, className, }: ModalConfirmationProps): react_jsx_runtime.JSX.Element;
906
+ type FormFieldType = "text" | "email" | "password" | "number" | "textarea" | "checkbox" | "toggle" | "select" | "radio" | "slider" | "tag-input" | "otp" | "combobox" | "color-picker" | "date-range" | "rich-text" | "file-upload" | "repeater" | "button";
763
907
  interface FormField {
764
908
  /** Unique key */
765
909
  name: string;
766
910
  label: string;
767
- type: "text" | "email" | "password" | "textarea" | "select";
911
+ type: FormFieldType;
768
912
  placeholder?: string;
769
913
  required?: boolean;
770
- /** Options for type="select" */
771
- options?: {
914
+ /** Options for select / radio / combobox — string[] or { label, value }[] */
915
+ options?: string[] | {
772
916
  label: string;
773
917
  value: string;
774
918
  }[];
919
+ /** Custom renderer — overrides built-in field */
920
+ render?: (value: any, onChange: (v: any) => void) => React.ReactNode;
921
+ /** Button label (type="button") */
922
+ buttonLabel?: string;
923
+ /** Button variant */
924
+ buttonVariant?: "primary" | "secondary" | "outline" | "ghost" | "link" | "danger" | "success" | "destructive";
925
+ /** onClick for type="button" */
926
+ onClick?: () => void;
927
+ min?: number;
928
+ max?: number;
929
+ step?: number;
930
+ /** OTP digit length */
931
+ digits?: number;
775
932
  }
776
933
  interface ModalWithFormsProps {
777
934
  isOpen: boolean;
778
935
  onClose: () => void;
779
936
  /** Called with the form values on submit */
780
- onSubmit: (values: Record<string, string>) => void;
937
+ onSubmit: (values: Record<string, any>) => void;
781
938
  title?: React.ReactNode;
782
939
  description?: React.ReactNode;
783
940
  fields: FormField[];
@@ -1299,37 +1456,6 @@ interface StepperProps {
1299
1456
  }
1300
1457
  declare function Stepper({ steps, current: controlled, defaultCurrent, onChange, orientation, clickable, className, }: StepperProps): react_jsx_runtime.JSX.Element;
1301
1458
 
1302
- interface Column<T> {
1303
- key: keyof T | string;
1304
- title: string;
1305
- type?: "text" | "image" | "badge" | "icon" | "stack" | "select" | "toggle" | "color" | "checkbox";
1306
- stackProps?: {
1307
- limit?: number;
1308
- stacked?: boolean;
1309
- shape?: "circle" | "square";
1310
- size?: number;
1311
- };
1312
- /** Options for type="select" */
1313
- selectOptions?: string[];
1314
- render?: (item: T) => React.ReactNode;
1315
- sortable?: boolean;
1316
- /** Called when a cell value changes (select, toggle, color, checkbox) */
1317
- onChange?: (item: T, value: any) => void;
1318
- }
1319
- interface TableProps<T> {
1320
- data: T[];
1321
- columns: Column<T>[];
1322
- searchable?: boolean;
1323
- searchPlaceholder?: string;
1324
- pagination?: boolean;
1325
- itemsPerPage?: number;
1326
- selectable?: boolean;
1327
- onBulkDelete?: (selectedIds: string[]) => void;
1328
- idKey?: keyof T;
1329
- className?: string;
1330
- }
1331
- declare function Table<T extends Record<string, any>>({ data, columns, searchable, searchPlaceholder, pagination, itemsPerPage, selectable, onBulkDelete, idKey, className, }: TableProps<T>): react_jsx_runtime.JSX.Element;
1332
-
1333
1459
  type TabVariant = "line" | "pill" | "boxed" | "lifted";
1334
1460
  type TabSize = "sm" | "md" | "lg";
1335
1461
  interface TabItem {
@@ -1377,6 +1503,33 @@ interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaEl
1377
1503
  }
1378
1504
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
1379
1505
 
1506
+ interface TocItem {
1507
+ id: string;
1508
+ label: string;
1509
+ }
1510
+ declare function TocProvider({ children }: {
1511
+ children: React.ReactNode;
1512
+ }): react_jsx_runtime.JSX.Element;
1513
+ declare function useToc(): {
1514
+ items: TocItem[];
1515
+ setItems: (items: TocItem[]) => void;
1516
+ };
1517
+ declare function TableOfContents({ items }: {
1518
+ items: TocItem[];
1519
+ }): react_jsx_runtime.JSX.Element;
1520
+ /**
1521
+ * Wraps a docs page. Registers TOC items into context (consumed by Layout's
1522
+ * right sidebar) and renders children full-width.
1523
+ */
1524
+ declare function DocsLayout({ children, toc, }: {
1525
+ children: React.ReactNode;
1526
+ toc: TocItem[];
1527
+ }): react_jsx_runtime.JSX.Element;
1528
+ declare function Section({ id, children, }: {
1529
+ id: string;
1530
+ children: React.ReactNode;
1531
+ }): react_jsx_runtime.JSX.Element;
1532
+
1380
1533
  type TimelineVariant = "default" | "success" | "error" | "warning" | "info";
1381
1534
  interface TimelineItem {
1382
1535
  id?: string;
@@ -1548,4 +1701,4 @@ interface WizardProps {
1548
1701
  }
1549
1702
  declare function Wizard({ steps, step: controlledStep, defaultStep, onStepChange, onFinish, onClose, layout, variant, size, isOpen, showClose, unchange, title, description, hideHeader, footer, renderActions, backLabel, nextLabel, finishLabel, cancelLabel, showCancel, showBackOnFirst, loading, clickableSteps, className, contentClassName, }: WizardProps): react_jsx_runtime.JSX.Element;
1550
1703
 
1551
- export { Accordion, type AccordionItem, type AccordionProps, type AccordionVariant, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, COLOR_PALETTE, Calendar, CalendarDateRangePicker, type CalendarDateRangePickerProps, type CalendarDateRangeVariant, type CalendarEvent, type CalendarProps, type CalendarView, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChartDataPoint, ChartWidget, type ChartWidgetProps, Checkbox, type CheckboxProps, CircularProgress, type CircularProgressProps, type ClusterVariant, ColorPicker, type ColorPickerProps, type Column, Combobox, type ComboboxOption, type ComboboxProps, type CommandItem, CommandPalette, type CommandPaletteProps, ComposableWidget, type ComposableWidgetProps, type ConfirmVariant, ContextMenu, type ContextMenuItem, type ContextMenuProps, DataGrid, type DataGridColumn, type DataGridProps, DatePickerPopup, type DateRange, DateRangePicker, type DateRangePickerProps, Drawer, type DrawerProps, type DrawerSide, Dropdown, DropdownItem, DropdownLabel, type DropdownProps, DropdownSeparator, EVENT_COLORS, type FileTypeValidation, FileUpload, type FileUploadProps, type FlexAlign, type FlexDirection, type FlexGap, FlexItem, type FlexItemProps, type FlexJustify, FlexLayout, type FlexLayoutProps, type FlexWrap, type FlyToOptions, type FormField, type GridAlign, type GridCols, type GridGap, GridItem, type GridItemProps, GridLayout, type GridLayoutProps, GroupNavigation, type GroupNavigationProps, type ImageEditorMode, type ImageEditorOptions, Input, type InputProps, KanbanBoard, type KanbanBoardProps, type KanbanCard, type KanbanColumn, Label, LeafletMap, type LeafletMapProps, LeftSidebar, type LeftSidebarProps, type MapLibreClusterVariant, MapLibreMap, type MapLibreMarker, type MapLibreProps, type MapLibreRoute, type MapLibreRouteType, type MapLibreStyle, type MapMarker, type MapRoute, type MarkerColor, type MetricItem, MetricRow, type MetricRowProps, Modal, ModalConfirmation, type ModalConfirmationProps, type ModalProps, ModalUnchange, type ModalUnchangeProps, ModalWithForms, type ModalWithFormsProps, type NavGroup, type NavItem, Navigation, type NavigationProps, NotificationBanner, type NotificationBannerProps, type NotificationItem, NotificationPanel, type NotificationPanelProps, type NotificationVariant, OtpInput, type OtpInputProps, Pagination, type PaginationProps, Panel, type PanelProps, PanelSettings, type PanelSettingsProps, type PanelSettingsTab, PanelSidebarGroup, PanelSidebarItem, Popover, type PopoverPlacement, type PopoverProps, Progress, type ProgressProps, type ProgressSize, type ProgressVariant, type PropRow, PropsTable, RadioGroup, type RadioGroupProps, type RadioOption, type RadioSize, type RadioVariant, RangeSlider, type RangeSliderProps, Repeater, type RepeaterProps, ResizablePanels, type ResizablePanelsProps, RichTextEditor, type RichTextEditorProps, RightSidebar, type RightSidebarProps, type RouteType, ScrollArea, type ScrollAreaProps, SectionBlock, type SectionProps, type SectionVariant, Select, type SelectOption, type SelectProps, type SemanticColor, Skeleton, Slider, type SliderProps, type SortDir, StatCard, type StatCardProps, type StatTrend, StatsWidget, type StatsWidgetProps, type Step, type StepStatus, Stepper, type StepperProps, type TabItem, type TabSize, type TabVariant, Table, type TableProps, TableWidget, type TableWidgetProps, Tabs, type TabsProps, TagInput, type TagInputProps, Textarea, type TextareaProps, type ThemeColors, ThemeProvider, type ThemeSettings, Timeline, type TimelineItem, type TimelineProps, type TimelineVariant, type ToastItem, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastVariant, ToggleSwitch, type ToggleSwitchProps, Tooltip, type TooltipProps, Topbar, type TopbarProps, type TreeNode, TreeView, type TreeViewProps, type TrendDir, Widget, type WidgetProps, Wizard, type WizardActionProps, type WizardLayout, type WizardProps, type WizardSize, type WizardStep, type WizardVariant, useTheme, useToast };
1704
+ export { Accordion, type AccordionItem, type AccordionProps, type AccordionVariant, type ActionField, type ActionFieldType, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, COLOR_PALETTE, Calendar, CalendarDateRangePicker, type CalendarDateRangePickerProps, type CalendarDateRangeVariant, type CalendarEvent, type CalendarProps, type CalendarView, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChartDataPoint, ChartWidget, type ChartWidgetProps, Checkbox, type CheckboxProps, CircularProgress, type CircularProgressProps, type ClusterVariant, ColorPicker, type ColorPickerProps, type Column, Combobox, type ComboboxOption, type ComboboxProps, type CommandItem, CommandPalette, type CommandPaletteProps, ComposableWidget, type ComposableWidgetProps, type ConfirmVariant, ContextMenu, type ContextMenuItem, type ContextMenuProps, DataGrid, type DataGridColumn, type DataGridProps, DatePickerPopup, type DateRange, DateRangePicker, type DateRangePickerProps, type DefaultActionsConfig, DocsLayout, Drawer, type DrawerProps, type DrawerSide, Dropdown, DropdownItem, DropdownLabel, type DropdownProps, DropdownSeparator, EVENT_COLORS, type FileTypeValidation, FileUpload, type FileUploadProps, type FlexAlign, type FlexDirection, type FlexGap, FlexItem, type FlexItemProps, type FlexJustify, FlexLayout, type FlexLayoutProps, type FlexWrap, type FlyToOptions, type FormField, type FormFieldType, type GridAlign, type GridCols, type GridGap, GridItem, type GridItemProps, GridLayout, type GridLayoutProps, GroupNavigation, type GroupNavigationProps, type ImageEditorMode, type ImageEditorOptions, Input, type InputProps, KanbanBoard, type KanbanBoardProps, type KanbanCard, type KanbanColumn, Label, LeafletMap, type LeafletMapProps, LeftSidebar, type LeftSidebarProps, type MapLibreClusterVariant, MapLibreMap, type MapLibreMarker, type MapLibreProps, type MapLibreRoute, type MapLibreRouteType, type MapLibreStyle, type MapMarker, type MapRoute, type MarkerColor, type MetricItem, MetricRow, type MetricRowProps, Modal, ModalConfirmation, type ModalConfirmationProps, type ModalProps, ModalUnchange, type ModalUnchangeProps, ModalWithForms, type ModalWithFormsProps, type NavGroup, type NavItem, Navigation, type NavigationProps, NotificationBanner, type NotificationBannerProps, type NotificationItem, NotificationPanel, type NotificationPanelProps, type NotificationVariant, OtpInput, type OtpInputProps, Pagination, type PaginationProps, Panel, type PanelProps, PanelSettings, type PanelSettingsProps, type PanelSettingsTab, PanelSidebarGroup, PanelSidebarItem, Popover, type PopoverPlacement, type PopoverProps, Progress, type ProgressProps, type ProgressSize, type ProgressVariant, type PropRow, PropsTable, RadioGroup, type RadioGroupProps, type RadioOption, type RadioSize, type RadioVariant, RangeSlider, type RangeSliderProps, Repeater, type RepeaterProps, ResizablePanels, type ResizablePanelsProps, RichTextEditor, type RichTextEditorProps, RightSidebar, type RightSidebarProps, type RouteType, ScrollArea, type ScrollAreaProps, Section, SectionBlock, type SectionProps, type SectionVariant, Select, type SelectOption, type SelectProps, type SemanticColor, type ServerDataGridProp, type ServerPagination, type ServerPaginationLink, type ServerPaginationProp, type ServerTableResponse, Skeleton, Slider, type SliderProps, type SortDir, StatCard, type StatCardProps, type StatTrend, StatsWidget, type StatsWidgetProps, type Step, type StepStatus, Stepper, type StepperProps, type TabItem, type TabSize, type TabVariant, Table, TableOfContents, type TableProps, TableWidget, type TableWidgetProps, Tabs, type TabsProps, TagInput, type TagInputProps, Textarea, type TextareaProps, type ThemeColors, ThemeProvider, type ThemeSettings, Timeline, type TimelineItem, type TimelineProps, type TimelineVariant, type ToastItem, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastVariant, type TocItem, TocProvider, ToggleSwitch, type ToggleSwitchProps, Tooltip, type TooltipProps, Topbar, type TopbarProps, type TreeNode, TreeView, type TreeViewProps, type TrendDir, type UseServerDataGridOptions, type UseServerDataGridReturn, type UseServerTableOptions, type UseServerTableReturn, Widget, type WidgetProps, Wizard, type WizardActionProps, type WizardLayout, type WizardProps, type WizardSize, type WizardStep, type WizardVariant, useServerDataGrid, useServerTable, useTheme, useToast, useToc };
package/dist/index.d.ts CHANGED
@@ -59,7 +59,7 @@ interface BreadcrumbProps {
59
59
  declare function Breadcrumb({ items, separator, maxItems, className, }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
60
60
 
61
61
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
62
- variant?: "primary" | "secondary" | "outline" | "ghost" | "link" | "danger" | "success";
62
+ variant?: "primary" | "secondary" | "outline" | "ghost" | "link" | "danger" | "success" | "destructive";
63
63
  size?: "xs" | "sm" | "md" | "lg" | "xl";
64
64
  fullWidth?: boolean;
65
65
  width?: number | string;
@@ -336,6 +336,145 @@ interface MetricRowProps {
336
336
  }
337
337
  declare function MetricRow({ items, divided, className }: MetricRowProps): react_jsx_runtime.JSX.Element;
338
338
 
339
+ interface ServerPaginationLink {
340
+ page: number;
341
+ url: string;
342
+ active: boolean;
343
+ }
344
+ interface ServerPagination {
345
+ first_page_url: string;
346
+ last_page_url: string;
347
+ next_page_url: string | null;
348
+ prev_page_url: string | null;
349
+ per_page: number;
350
+ total: number;
351
+ links: ServerPaginationLink[];
352
+ }
353
+ interface ServerTableResponse<T> {
354
+ current_page: number;
355
+ data: T[];
356
+ pagination: ServerPagination;
357
+ }
358
+ interface UseServerTableOptions {
359
+ /** Base URL — page param appended automatically: `url?page=N` */
360
+ url: string;
361
+ /** Extra query params merged on every request */
362
+ params?: Record<string, string | number>;
363
+ }
364
+ interface UseServerTableReturn<T> {
365
+ data: T[];
366
+ columns: Column<T>[];
367
+ currentPage: number;
368
+ pagination: ServerPagination | null;
369
+ serverPagination: ServerPaginationProp | null;
370
+ loading: boolean;
371
+ error: string | null;
372
+ goToPage: (page: number) => void;
373
+ reload: () => void;
374
+ }
375
+ interface ServerPaginationProp {
376
+ pagination: ServerPagination;
377
+ currentPage: number;
378
+ goToPage: (page: number) => void;
379
+ }
380
+ declare function useServerTable<T extends Record<string, any>>({ url, params }: UseServerTableOptions): UseServerTableReturn<T>;
381
+ type ActionFieldType = "input" | "password" | "textarea" | "checkbox" | "toggle" | "select" | "radio" | "slider" | "tag-input" | "otp" | "combobox" | "color-picker" | "date-range" | "rich-text" | "file-upload" | "repeater";
382
+ interface ActionField {
383
+ key: string;
384
+ label: string;
385
+ type?: ActionFieldType;
386
+ /** HTML input type for type="input" (e.g. "email", "number", "password") */
387
+ inputType?: string;
388
+ /** Options for type="select", "radio", "combobox" — string[] or { label, value }[] */
389
+ options?: string[] | {
390
+ label: string;
391
+ value: string;
392
+ }[];
393
+ placeholder?: string;
394
+ required?: boolean;
395
+ /** Min value for type="slider" */
396
+ min?: number;
397
+ /** Max value for type="slider" */
398
+ max?: number;
399
+ /** Step for type="slider" */
400
+ step?: number;
401
+ /** Number of OTP digits for type="otp" */
402
+ digits?: number;
403
+ /** Custom render — overrides built-in field renderer */
404
+ render?: (value: any, onChange: (v: any) => void) => React.ReactNode;
405
+ }
406
+ interface DefaultActionsConfig<T> {
407
+ /**
408
+ * Base URL used to build PUT and DELETE requests.
409
+ * PUT → `{baseUrl}/{id}/update`
410
+ * DELETE → `{baseUrl}/{id}/delete`
411
+ */
412
+ baseUrl: string;
413
+ /** Row key used as the URL id segment. Defaults to "id". */
414
+ idKey?: keyof T;
415
+ /** Fields rendered in the Edit modal form. Auto-derived from row keys when omitted. */
416
+ editForm?: ActionField[];
417
+ /** Fields rendered in the View modal. Auto-derived from row keys when omitted. */
418
+ viewForm?: ActionField[];
419
+ /** Called after a successful edit or delete so the parent can refresh data. */
420
+ onSuccess?: (action: "edit" | "delete", item: T) => void;
421
+ }
422
+ interface Column<T> {
423
+ key: keyof T | string;
424
+ title: string;
425
+ type?: "text" | "image" | "badge" | "icon" | "stack" | "select" | "toggle" | "color" | "checkbox";
426
+ stackProps?: {
427
+ limit?: number;
428
+ stacked?: boolean;
429
+ shape?: "circle" | "square";
430
+ size?: number;
431
+ };
432
+ /** Options for type="select" */
433
+ selectOptions?: string[];
434
+ render?: (item: T) => React.ReactNode;
435
+ sortable?: boolean;
436
+ /** Called when a cell value changes (select, toggle, color, checkbox) */
437
+ onChange?: (item: T, value: any) => void;
438
+ }
439
+ interface TableProps<T> {
440
+ data: T[];
441
+ columns: Column<T>[];
442
+ searchable?: boolean;
443
+ searchPlaceholder?: string;
444
+ pagination?: boolean;
445
+ itemsPerPage?: number;
446
+ selectable?: boolean;
447
+ onBulkDelete?: (selectedIds: string[]) => void;
448
+ idKey?: keyof T;
449
+ /** When provided, appends an Actions column with View / Edit / Delete buttons */
450
+ defaultActions?: DefaultActionsConfig<T>;
451
+ /** Pass the serverPagination object from useServerTable to enable server-side pagination */
452
+ serverPagination?: ServerPaginationProp;
453
+ className?: string;
454
+ }
455
+ declare function Table<T extends Record<string, any>>({ data, columns, searchable, searchPlaceholder, pagination, itemsPerPage, selectable, onBulkDelete, idKey, defaultActions, serverPagination, className, }: TableProps<T>): react_jsx_runtime.JSX.Element;
456
+
457
+ interface ServerDataGridProp {
458
+ pagination: ServerPagination;
459
+ currentPage: number;
460
+ goToPage: (page: number) => void;
461
+ }
462
+ interface UseServerDataGridOptions {
463
+ url: string;
464
+ params?: Record<string, string | number>;
465
+ }
466
+ interface UseServerDataGridReturn<T> {
467
+ data: T[];
468
+ columns: DataGridColumn<T>[];
469
+ currentPage: number;
470
+ pagination: ServerPagination | null;
471
+ serverPagination: ServerDataGridProp | null;
472
+ loading: boolean;
473
+ error: string | null;
474
+ goToPage: (page: number) => void;
475
+ reload: () => void;
476
+ }
477
+ declare function useServerDataGrid<T extends Record<string, any>>({ url, params }: UseServerDataGridOptions): UseServerDataGridReturn<T>;
339
478
  type SortDir = "asc" | "desc" | null;
340
479
  interface DataGridColumn<T> {
341
480
  key: keyof T | string;
@@ -360,8 +499,12 @@ interface DataGridProps<T> {
360
499
  emptyMessage?: string;
361
500
  className?: string;
362
501
  onRowClick?: (row: T) => void;
502
+ /** Appends View / Edit / Delete action buttons per row */
503
+ defaultActions?: DefaultActionsConfig<T>;
504
+ /** Pass the serverPagination object from useServerDataGrid to enable server-driven pagination */
505
+ serverPagination?: ServerDataGridProp;
363
506
  }
364
- declare function DataGrid<T extends Record<string, unknown>>({ columns, data, rowKey, selectable, selected: controlledSelected, onSelectChange, pageSize, showPagination, showColumnToggle, loading, emptyMessage, className, onRowClick, }: DataGridProps<T>): react_jsx_runtime.JSX.Element;
507
+ declare function DataGrid<T extends Record<string, unknown>>({ columns, data, rowKey, selectable, selected: controlledSelected, onSelectChange, pageSize, showPagination, showColumnToggle, loading, emptyMessage, className, onRowClick, defaultActions, serverPagination, }: DataGridProps<T>): react_jsx_runtime.JSX.Element;
365
508
 
366
509
  interface DatePickerProps {
367
510
  mode: "date" | "dateTime" | "time";
@@ -760,24 +903,38 @@ interface ModalConfirmationProps {
760
903
  * A two-button confirmation modal with danger / warning / success / info variants.
761
904
  */
762
905
  declare function ModalConfirmation({ isOpen, onClose, onConfirm, variant, title, description, confirmLabel, cancelLabel, loading, className, }: ModalConfirmationProps): react_jsx_runtime.JSX.Element;
906
+ type FormFieldType = "text" | "email" | "password" | "number" | "textarea" | "checkbox" | "toggle" | "select" | "radio" | "slider" | "tag-input" | "otp" | "combobox" | "color-picker" | "date-range" | "rich-text" | "file-upload" | "repeater" | "button";
763
907
  interface FormField {
764
908
  /** Unique key */
765
909
  name: string;
766
910
  label: string;
767
- type: "text" | "email" | "password" | "textarea" | "select";
911
+ type: FormFieldType;
768
912
  placeholder?: string;
769
913
  required?: boolean;
770
- /** Options for type="select" */
771
- options?: {
914
+ /** Options for select / radio / combobox — string[] or { label, value }[] */
915
+ options?: string[] | {
772
916
  label: string;
773
917
  value: string;
774
918
  }[];
919
+ /** Custom renderer — overrides built-in field */
920
+ render?: (value: any, onChange: (v: any) => void) => React.ReactNode;
921
+ /** Button label (type="button") */
922
+ buttonLabel?: string;
923
+ /** Button variant */
924
+ buttonVariant?: "primary" | "secondary" | "outline" | "ghost" | "link" | "danger" | "success" | "destructive";
925
+ /** onClick for type="button" */
926
+ onClick?: () => void;
927
+ min?: number;
928
+ max?: number;
929
+ step?: number;
930
+ /** OTP digit length */
931
+ digits?: number;
775
932
  }
776
933
  interface ModalWithFormsProps {
777
934
  isOpen: boolean;
778
935
  onClose: () => void;
779
936
  /** Called with the form values on submit */
780
- onSubmit: (values: Record<string, string>) => void;
937
+ onSubmit: (values: Record<string, any>) => void;
781
938
  title?: React.ReactNode;
782
939
  description?: React.ReactNode;
783
940
  fields: FormField[];
@@ -1299,37 +1456,6 @@ interface StepperProps {
1299
1456
  }
1300
1457
  declare function Stepper({ steps, current: controlled, defaultCurrent, onChange, orientation, clickable, className, }: StepperProps): react_jsx_runtime.JSX.Element;
1301
1458
 
1302
- interface Column<T> {
1303
- key: keyof T | string;
1304
- title: string;
1305
- type?: "text" | "image" | "badge" | "icon" | "stack" | "select" | "toggle" | "color" | "checkbox";
1306
- stackProps?: {
1307
- limit?: number;
1308
- stacked?: boolean;
1309
- shape?: "circle" | "square";
1310
- size?: number;
1311
- };
1312
- /** Options for type="select" */
1313
- selectOptions?: string[];
1314
- render?: (item: T) => React.ReactNode;
1315
- sortable?: boolean;
1316
- /** Called when a cell value changes (select, toggle, color, checkbox) */
1317
- onChange?: (item: T, value: any) => void;
1318
- }
1319
- interface TableProps<T> {
1320
- data: T[];
1321
- columns: Column<T>[];
1322
- searchable?: boolean;
1323
- searchPlaceholder?: string;
1324
- pagination?: boolean;
1325
- itemsPerPage?: number;
1326
- selectable?: boolean;
1327
- onBulkDelete?: (selectedIds: string[]) => void;
1328
- idKey?: keyof T;
1329
- className?: string;
1330
- }
1331
- declare function Table<T extends Record<string, any>>({ data, columns, searchable, searchPlaceholder, pagination, itemsPerPage, selectable, onBulkDelete, idKey, className, }: TableProps<T>): react_jsx_runtime.JSX.Element;
1332
-
1333
1459
  type TabVariant = "line" | "pill" | "boxed" | "lifted";
1334
1460
  type TabSize = "sm" | "md" | "lg";
1335
1461
  interface TabItem {
@@ -1377,6 +1503,33 @@ interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaEl
1377
1503
  }
1378
1504
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
1379
1505
 
1506
+ interface TocItem {
1507
+ id: string;
1508
+ label: string;
1509
+ }
1510
+ declare function TocProvider({ children }: {
1511
+ children: React.ReactNode;
1512
+ }): react_jsx_runtime.JSX.Element;
1513
+ declare function useToc(): {
1514
+ items: TocItem[];
1515
+ setItems: (items: TocItem[]) => void;
1516
+ };
1517
+ declare function TableOfContents({ items }: {
1518
+ items: TocItem[];
1519
+ }): react_jsx_runtime.JSX.Element;
1520
+ /**
1521
+ * Wraps a docs page. Registers TOC items into context (consumed by Layout's
1522
+ * right sidebar) and renders children full-width.
1523
+ */
1524
+ declare function DocsLayout({ children, toc, }: {
1525
+ children: React.ReactNode;
1526
+ toc: TocItem[];
1527
+ }): react_jsx_runtime.JSX.Element;
1528
+ declare function Section({ id, children, }: {
1529
+ id: string;
1530
+ children: React.ReactNode;
1531
+ }): react_jsx_runtime.JSX.Element;
1532
+
1380
1533
  type TimelineVariant = "default" | "success" | "error" | "warning" | "info";
1381
1534
  interface TimelineItem {
1382
1535
  id?: string;
@@ -1548,4 +1701,4 @@ interface WizardProps {
1548
1701
  }
1549
1702
  declare function Wizard({ steps, step: controlledStep, defaultStep, onStepChange, onFinish, onClose, layout, variant, size, isOpen, showClose, unchange, title, description, hideHeader, footer, renderActions, backLabel, nextLabel, finishLabel, cancelLabel, showCancel, showBackOnFirst, loading, clickableSteps, className, contentClassName, }: WizardProps): react_jsx_runtime.JSX.Element;
1550
1703
 
1551
- export { Accordion, type AccordionItem, type AccordionProps, type AccordionVariant, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, COLOR_PALETTE, Calendar, CalendarDateRangePicker, type CalendarDateRangePickerProps, type CalendarDateRangeVariant, type CalendarEvent, type CalendarProps, type CalendarView, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChartDataPoint, ChartWidget, type ChartWidgetProps, Checkbox, type CheckboxProps, CircularProgress, type CircularProgressProps, type ClusterVariant, ColorPicker, type ColorPickerProps, type Column, Combobox, type ComboboxOption, type ComboboxProps, type CommandItem, CommandPalette, type CommandPaletteProps, ComposableWidget, type ComposableWidgetProps, type ConfirmVariant, ContextMenu, type ContextMenuItem, type ContextMenuProps, DataGrid, type DataGridColumn, type DataGridProps, DatePickerPopup, type DateRange, DateRangePicker, type DateRangePickerProps, Drawer, type DrawerProps, type DrawerSide, Dropdown, DropdownItem, DropdownLabel, type DropdownProps, DropdownSeparator, EVENT_COLORS, type FileTypeValidation, FileUpload, type FileUploadProps, type FlexAlign, type FlexDirection, type FlexGap, FlexItem, type FlexItemProps, type FlexJustify, FlexLayout, type FlexLayoutProps, type FlexWrap, type FlyToOptions, type FormField, type GridAlign, type GridCols, type GridGap, GridItem, type GridItemProps, GridLayout, type GridLayoutProps, GroupNavigation, type GroupNavigationProps, type ImageEditorMode, type ImageEditorOptions, Input, type InputProps, KanbanBoard, type KanbanBoardProps, type KanbanCard, type KanbanColumn, Label, LeafletMap, type LeafletMapProps, LeftSidebar, type LeftSidebarProps, type MapLibreClusterVariant, MapLibreMap, type MapLibreMarker, type MapLibreProps, type MapLibreRoute, type MapLibreRouteType, type MapLibreStyle, type MapMarker, type MapRoute, type MarkerColor, type MetricItem, MetricRow, type MetricRowProps, Modal, ModalConfirmation, type ModalConfirmationProps, type ModalProps, ModalUnchange, type ModalUnchangeProps, ModalWithForms, type ModalWithFormsProps, type NavGroup, type NavItem, Navigation, type NavigationProps, NotificationBanner, type NotificationBannerProps, type NotificationItem, NotificationPanel, type NotificationPanelProps, type NotificationVariant, OtpInput, type OtpInputProps, Pagination, type PaginationProps, Panel, type PanelProps, PanelSettings, type PanelSettingsProps, type PanelSettingsTab, PanelSidebarGroup, PanelSidebarItem, Popover, type PopoverPlacement, type PopoverProps, Progress, type ProgressProps, type ProgressSize, type ProgressVariant, type PropRow, PropsTable, RadioGroup, type RadioGroupProps, type RadioOption, type RadioSize, type RadioVariant, RangeSlider, type RangeSliderProps, Repeater, type RepeaterProps, ResizablePanels, type ResizablePanelsProps, RichTextEditor, type RichTextEditorProps, RightSidebar, type RightSidebarProps, type RouteType, ScrollArea, type ScrollAreaProps, SectionBlock, type SectionProps, type SectionVariant, Select, type SelectOption, type SelectProps, type SemanticColor, Skeleton, Slider, type SliderProps, type SortDir, StatCard, type StatCardProps, type StatTrend, StatsWidget, type StatsWidgetProps, type Step, type StepStatus, Stepper, type StepperProps, type TabItem, type TabSize, type TabVariant, Table, type TableProps, TableWidget, type TableWidgetProps, Tabs, type TabsProps, TagInput, type TagInputProps, Textarea, type TextareaProps, type ThemeColors, ThemeProvider, type ThemeSettings, Timeline, type TimelineItem, type TimelineProps, type TimelineVariant, type ToastItem, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastVariant, ToggleSwitch, type ToggleSwitchProps, Tooltip, type TooltipProps, Topbar, type TopbarProps, type TreeNode, TreeView, type TreeViewProps, type TrendDir, Widget, type WidgetProps, Wizard, type WizardActionProps, type WizardLayout, type WizardProps, type WizardSize, type WizardStep, type WizardVariant, useTheme, useToast };
1704
+ export { Accordion, type AccordionItem, type AccordionProps, type AccordionVariant, type ActionField, type ActionFieldType, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, COLOR_PALETTE, Calendar, CalendarDateRangePicker, type CalendarDateRangePickerProps, type CalendarDateRangeVariant, type CalendarEvent, type CalendarProps, type CalendarView, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChartDataPoint, ChartWidget, type ChartWidgetProps, Checkbox, type CheckboxProps, CircularProgress, type CircularProgressProps, type ClusterVariant, ColorPicker, type ColorPickerProps, type Column, Combobox, type ComboboxOption, type ComboboxProps, type CommandItem, CommandPalette, type CommandPaletteProps, ComposableWidget, type ComposableWidgetProps, type ConfirmVariant, ContextMenu, type ContextMenuItem, type ContextMenuProps, DataGrid, type DataGridColumn, type DataGridProps, DatePickerPopup, type DateRange, DateRangePicker, type DateRangePickerProps, type DefaultActionsConfig, DocsLayout, Drawer, type DrawerProps, type DrawerSide, Dropdown, DropdownItem, DropdownLabel, type DropdownProps, DropdownSeparator, EVENT_COLORS, type FileTypeValidation, FileUpload, type FileUploadProps, type FlexAlign, type FlexDirection, type FlexGap, FlexItem, type FlexItemProps, type FlexJustify, FlexLayout, type FlexLayoutProps, type FlexWrap, type FlyToOptions, type FormField, type FormFieldType, type GridAlign, type GridCols, type GridGap, GridItem, type GridItemProps, GridLayout, type GridLayoutProps, GroupNavigation, type GroupNavigationProps, type ImageEditorMode, type ImageEditorOptions, Input, type InputProps, KanbanBoard, type KanbanBoardProps, type KanbanCard, type KanbanColumn, Label, LeafletMap, type LeafletMapProps, LeftSidebar, type LeftSidebarProps, type MapLibreClusterVariant, MapLibreMap, type MapLibreMarker, type MapLibreProps, type MapLibreRoute, type MapLibreRouteType, type MapLibreStyle, type MapMarker, type MapRoute, type MarkerColor, type MetricItem, MetricRow, type MetricRowProps, Modal, ModalConfirmation, type ModalConfirmationProps, type ModalProps, ModalUnchange, type ModalUnchangeProps, ModalWithForms, type ModalWithFormsProps, type NavGroup, type NavItem, Navigation, type NavigationProps, NotificationBanner, type NotificationBannerProps, type NotificationItem, NotificationPanel, type NotificationPanelProps, type NotificationVariant, OtpInput, type OtpInputProps, Pagination, type PaginationProps, Panel, type PanelProps, PanelSettings, type PanelSettingsProps, type PanelSettingsTab, PanelSidebarGroup, PanelSidebarItem, Popover, type PopoverPlacement, type PopoverProps, Progress, type ProgressProps, type ProgressSize, type ProgressVariant, type PropRow, PropsTable, RadioGroup, type RadioGroupProps, type RadioOption, type RadioSize, type RadioVariant, RangeSlider, type RangeSliderProps, Repeater, type RepeaterProps, ResizablePanels, type ResizablePanelsProps, RichTextEditor, type RichTextEditorProps, RightSidebar, type RightSidebarProps, type RouteType, ScrollArea, type ScrollAreaProps, Section, SectionBlock, type SectionProps, type SectionVariant, Select, type SelectOption, type SelectProps, type SemanticColor, type ServerDataGridProp, type ServerPagination, type ServerPaginationLink, type ServerPaginationProp, type ServerTableResponse, Skeleton, Slider, type SliderProps, type SortDir, StatCard, type StatCardProps, type StatTrend, StatsWidget, type StatsWidgetProps, type Step, type StepStatus, Stepper, type StepperProps, type TabItem, type TabSize, type TabVariant, Table, TableOfContents, type TableProps, TableWidget, type TableWidgetProps, Tabs, type TabsProps, TagInput, type TagInputProps, Textarea, type TextareaProps, type ThemeColors, ThemeProvider, type ThemeSettings, Timeline, type TimelineItem, type TimelineProps, type TimelineVariant, type ToastItem, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastVariant, type TocItem, TocProvider, ToggleSwitch, type ToggleSwitchProps, Tooltip, type TooltipProps, Topbar, type TopbarProps, type TreeNode, TreeView, type TreeViewProps, type TrendDir, type UseServerDataGridOptions, type UseServerDataGridReturn, type UseServerTableOptions, type UseServerTableReturn, Widget, type WidgetProps, Wizard, type WizardActionProps, type WizardLayout, type WizardProps, type WizardSize, type WizardStep, type WizardVariant, useServerDataGrid, useServerTable, useTheme, useToast, useToc };