luxtable 0.2.1 → 0.2.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.ts CHANGED
@@ -1,19 +1,790 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ColumnDef } from '@tanstack/react-table';
3
- export * from '@tanstack/react-table';
2
+ import { ColumnDef, SortingState, RowSelectionState, Column, Table as Table$1, HeaderContext, CellContext } from '@tanstack/react-table';
3
+ export { ColumnDef, RowSelectionState, SortingState, flexRender, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/react-table';
4
+ import * as React$1 from 'react';
5
+ import * as class_variance_authority_types from 'class-variance-authority/types';
6
+ import { VariantProps } from 'class-variance-authority';
7
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
8
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
9
+ import * as LabelPrimitive from '@radix-ui/react-label';
10
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
11
+ import * as SelectPrimitive from '@radix-ui/react-select';
12
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
4
13
  import { ClassValue } from 'clsx';
5
14
 
6
- interface LuxTableProps<TData, TValue> {
7
- columns: ColumnDef<TData, TValue>[];
15
+ /**
16
+ * All type definitions for LuxTable
17
+ */
18
+ interface LuxTableOptions {
19
+ /** Pagination feature (default: false) */
20
+ pagination?: boolean;
21
+ /** Rows per page (default: 10) */
22
+ pageSize?: number;
23
+ /** Sorting feature (default: true) */
24
+ sorting?: boolean;
25
+ /** Column filtering feature (default: false) */
26
+ filtering?: boolean;
27
+ /** Row selection mode - "single": single select, "multiple": multi-select, "none": disabled */
28
+ selection?: "single" | "multiple" | "none";
29
+ /** Show selection checkbox (default: true if selection !== "none") */
30
+ showSelectionCheckbox?: boolean;
31
+ /** Show toolbar with search and controls (default: false) */
32
+ showToolbar?: boolean;
33
+ /** Show global search in toolbar (default: true when toolbar is shown) */
34
+ showGlobalSearch?: boolean;
35
+ /** Show column visibility controls in toolbar (default: true when toolbar is shown) */
36
+ showColumnVisibility?: boolean;
37
+ }
38
+ interface LuxTableProps<TData> {
39
+ /** Column definitions */
40
+ columns: ColumnDef<TData, any>[];
41
+ /** Table data */
8
42
  data: TData[];
43
+ /** Additional CSS classes */
44
+ className?: string;
45
+ /** Table options */
46
+ options?: LuxTableOptions;
47
+ /** Controlled sorting state */
48
+ sorting?: SortingState;
49
+ /** Called when sorting changes */
50
+ onSortingChange?: (sorting: SortingState) => void;
51
+ /** Controlled row selection state */
52
+ rowSelection?: RowSelectionState;
53
+ /** Called when row selection changes */
54
+ onRowSelectionChange?: (rowSelection: RowSelectionState) => void;
55
+ /** Called when selected rows change (with row data) */
56
+ onSelectedRowsChange?: (rows: TData[]) => void;
57
+ /** Unique ID field for each row (default: "id") */
58
+ getRowId?: (row: TData, index: number) => string;
59
+ }
60
+ /**
61
+ * Extended type for Column meta
62
+ * Can be used in the meta field in column definitions
63
+ */
64
+ interface ColumnMeta {
65
+ /** Filter type: text or select */
66
+ filterVariant?: "text" | "select";
67
+ }
68
+ /**
69
+ * Pagination information
70
+ */
71
+ interface PaginationInfo {
72
+ pageIndex: number;
73
+ pageSize: number;
74
+ totalRows: number;
75
+ totalPages: number;
76
+ }
77
+
78
+ /**
79
+ * LuxTable - Advanced React table component
80
+ *
81
+ * Modern table built on top of TanStack Table, comes with ready-to-use features.
82
+ *
83
+ * @example
84
+ * ```tsx
85
+ * // Simple usage
86
+ * <LuxTable
87
+ * columns={columns}
88
+ * data={data}
89
+ * options={{
90
+ * pagination: true,
91
+ * pageSize: 20,
92
+ * filtering: true,
93
+ * sorting: true
94
+ * }}
95
+ * />
96
+ *
97
+ * // With row selection
98
+ * <LuxTable
99
+ * columns={columns}
100
+ * data={data}
101
+ * options={{
102
+ * selection: "multiple", // or "single"
103
+ * }}
104
+ * onSelectedRowsChange={(selectedRows) => {
105
+ * console.log("Selected rows:", selectedRows);
106
+ * }}
107
+ * />
108
+ * ```
109
+ */
110
+ declare function LuxTable<TData>({ columns, data, className, options, sorting: controlledSorting, onSortingChange, rowSelection: controlledRowSelection, onRowSelectionChange, onSelectedRowsChange, getRowId, }: LuxTableProps<TData>): react_jsx_runtime.JSX.Element;
111
+
112
+ interface ColumnFilterProps<TData, TValue> {
113
+ column: Column<TData, TValue>;
114
+ }
115
+ /**
116
+ * Column filter component
117
+ * Rendered as text input or select dropdown using shadcn/ui components
118
+ *
119
+ * @example
120
+ * ```tsx
121
+ * <ColumnFilter column={column} />
122
+ * ```
123
+ */
124
+ declare function ColumnFilter<TData, TValue>({ column }: ColumnFilterProps<TData, TValue>): react_jsx_runtime.JSX.Element;
125
+
126
+ interface TablePaginationProps<TData> {
127
+ table: Table$1<TData>;
128
+ }
129
+ /**
130
+ * Table pagination component
131
+ * Provides page navigation, record info and page size selection
132
+ */
133
+ declare function TablePagination<TData>({ table }: TablePaginationProps<TData>): react_jsx_runtime.JSX.Element;
134
+
135
+ interface TableToolbarProps<TData> {
136
+ /** TanStack Table instance */
137
+ table: Table$1<TData>;
138
+ /** Whether column filtering is enabled */
139
+ showFiltering?: boolean;
140
+ /** Callback to toggle column filtering UI */
141
+ onFilteringToggle?: (enabled: boolean) => void;
142
+ /** Current filtering state */
143
+ filteringEnabled?: boolean;
144
+ /** Show global search input */
145
+ showGlobalSearch?: boolean;
146
+ /** Show column visibility controls */
147
+ showColumnVisibility?: boolean;
148
+ /** Additional CSS classes */
149
+ className?: string;
150
+ }
151
+ /**
152
+ * TableToolbar - A toolbar component for LuxTable
153
+ *
154
+ * Provides controls for:
155
+ * - Global search across all columns
156
+ * - Column visibility toggle (show/hide columns)
157
+ * - Column filtering toggle (on/off)
158
+ */
159
+ declare function TableToolbar<TData>({ table, showFiltering, onFilteringToggle, filteringEnabled, showGlobalSearch, showColumnVisibility, className, }: TableToolbarProps<TData>): react_jsx_runtime.JSX.Element;
160
+
161
+ interface LuxDataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {
162
+ column: Column<TData, TValue>;
163
+ title: string;
164
+ }
165
+ declare function LuxDataTableColumnHeader<TData, TValue>({ column, title, className, }: LuxDataTableColumnHeaderProps<TData, TValue>): react_jsx_runtime.JSX.Element;
166
+
167
+ declare const Table: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableElement> & React$1.RefAttributes<HTMLTableElement>>;
168
+ declare const TableHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
169
+ declare const TableBody: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
170
+ declare const TableFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableSectionElement> & React$1.RefAttributes<HTMLTableSectionElement>>;
171
+ declare const TableRow: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableRowElement> & React$1.RefAttributes<HTMLTableRowElement>>;
172
+ declare const TableHead: React$1.ForwardRefExoticComponent<React$1.ThHTMLAttributes<HTMLTableCellElement> & React$1.RefAttributes<HTMLTableCellElement>>;
173
+ declare const TableCell: React$1.ForwardRefExoticComponent<React$1.TdHTMLAttributes<HTMLTableCellElement> & React$1.RefAttributes<HTMLTableCellElement>>;
174
+ declare const TableCaption: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableCaptionElement> & React$1.RefAttributes<HTMLTableCaptionElement>>;
175
+
176
+ interface SortIconProps {
177
+ direction?: "asc" | "desc" | false;
178
+ }
179
+ /**
180
+ * Sort status icon
181
+ * - no direction: chevrons up-down icon (sortable indicator)
182
+ * - asc: up arrow (A-Z)
183
+ * - desc: down arrow (Z-A)
184
+ */
185
+ declare function SortIcon({ direction }: SortIconProps): react_jsx_runtime.JSX.Element;
186
+
187
+ /**
188
+ * Default colors for Status Cell
189
+ *
190
+ * 4 values are defined for each status:
191
+ * - bg: Light theme background color
192
+ * - text: Light theme text color
193
+ * - darkBg: Dark theme background color
194
+ * - darkText: Dark theme text color
195
+ */
196
+ declare const defaultStatusColors: Record<string, {
197
+ bg: string;
198
+ text: string;
199
+ darkBg: string;
200
+ darkText: string;
201
+ }>;
202
+ interface StatusCellProps {
203
+ /** Status value to display (e.g., "Active", "Pending") */
204
+ value: string;
205
+ /**
206
+ * Custom color definitions
207
+ * Used to override default colors or add new colors
208
+ *
209
+ * @example
210
+ * ```tsx
211
+ * colors={{
212
+ * Custom: { bg: "bg-purple-100", text: "text-purple-800" }
213
+ * }}
214
+ * ```
215
+ */
216
+ colors?: Record<string, {
217
+ bg: string;
218
+ text: string;
219
+ darkBg?: string;
220
+ darkText?: string;
221
+ }>;
222
+ /** Additional CSS classes */
223
+ className?: string;
224
+ }
225
+ /**
226
+ * Ready-to-use component for status cells
227
+ *
228
+ * Supports the following statuses by default:
229
+ * - **Active** → Green badge
230
+ * - **Inactive** → Red badge
231
+ * - **Pending** → Yellow badge
232
+ * - **Completed** → Blue badge
233
+ * - **Cancelled** → Gray badge
234
+ *
235
+ * Undefined statuses are automatically shown with a gray badge.
236
+ *
237
+ * @example
238
+ * // Basit kullanım
239
+ * ```tsx
240
+ * <StatusCell value="Active" />
241
+ * ```
242
+ *
243
+ * @example
244
+ * // Özel renklerle kullanım
245
+ * ```tsx
246
+ * <StatusCell
247
+ * value="OnHold"
248
+ * colors={{
249
+ * OnHold: {
250
+ * bg: "bg-orange-100",
251
+ * text: "text-orange-800",
252
+ * darkBg: "dark:bg-orange-900",
253
+ * darkText: "dark:text-orange-300"
254
+ * }
255
+ * }}
256
+ * />
257
+ * ```
258
+ *
259
+ * @example
260
+ * // TanStack Table column içinde kullanım
261
+ * ```tsx
262
+ * columnHelper.accessor("status", {
263
+ * header: "Durum",
264
+ * cell: (info) => <StatusCell value={info.getValue()} />,
265
+ * })
266
+ * ```
267
+ */
268
+ declare function StatusCell({ value, colors, className }: StatusCellProps): react_jsx_runtime.JSX.Element;
269
+
270
+ interface ProgressCellProps {
271
+ /** Progress value (between 0-100) */
272
+ value: number;
273
+ /**
274
+ * Progress bar color
275
+ * @default "bg-blue-600"
276
+ */
277
+ barColor?: string;
278
+ /**
279
+ * Background color
280
+ * @default "bg-gray-200 dark:bg-gray-700"
281
+ */
282
+ bgColor?: string;
283
+ /**
284
+ * Show percentage label
285
+ * @default false
286
+ */
287
+ showLabel?: boolean;
288
+ /** Additional CSS classes */
9
289
  className?: string;
10
- options?: {
11
- pagination?: boolean;
12
- selection?: "single" | "multiple" | "none";
13
- };
14
290
  }
15
- declare function LuxTable<TData, TValue>({ columns, data, className, options }: LuxTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
291
+ /**
292
+ * Ready-to-use component for progress bar cells
293
+ *
294
+ * Displays percentage values as a visual progress bar.
295
+ * Value is automatically clamped between 0-100.
296
+ *
297
+ * @example
298
+ * // Basit kullanım
299
+ * ```tsx
300
+ * <ProgressCell value={75} />
301
+ * ```
302
+ *
303
+ * @example
304
+ * // Etiket ile
305
+ * ```tsx
306
+ * <ProgressCell value={42} showLabel />
307
+ * ```
308
+ *
309
+ * @example
310
+ * // Özel renklerle
311
+ * ```tsx
312
+ * <ProgressCell
313
+ * value={60}
314
+ * barColor="bg-green-500"
315
+ * bgColor="bg-green-100"
316
+ * showLabel
317
+ * />
318
+ * ```
319
+ *
320
+ * @example
321
+ * // TanStack Table column içinde kullanım
322
+ * ```tsx
323
+ * columnHelper.accessor("progress", {
324
+ * header: "İlerleme",
325
+ * cell: (info) => <ProgressCell value={info.getValue()} showLabel />,
326
+ * })
327
+ * ```
328
+ */
329
+ declare function ProgressCell({ value, barColor, bgColor, showLabel, className, }: ProgressCellProps): react_jsx_runtime.JSX.Element;
330
+
331
+ interface BooleanCellProps {
332
+ /** Boolean değer */
333
+ value: boolean;
334
+ /**
335
+ * True değeri için metin
336
+ * @default "Yes"
337
+ */
338
+ trueLabel?: string;
339
+ /**
340
+ * False değeri için metin
341
+ * @default "No"
342
+ */
343
+ falseLabel?: string;
344
+ /**
345
+ * True değeri için renk sınıfları
346
+ * @default "text-green-600 dark:text-green-400"
347
+ */
348
+ trueColor?: string;
349
+ /**
350
+ * False değeri için renk sınıfları
351
+ * @default "text-red-600 dark:text-red-400"
352
+ */
353
+ falseColor?: string;
354
+ }
355
+ /**
356
+ * Boolean değerler için hazır bileşen
357
+ *
358
+ * True değerleri yeşil, false değerleri kırmızı renkte gösterir.
359
+ * Etiketler ve renkler tamamen özelleştirilebilir.
360
+ *
361
+ * @example
362
+ * // Basit kullanım
363
+ * ```tsx
364
+ * <BooleanCell value={true} />
365
+ * // Çıktı: "Yes" (yeşil)
366
+ * ```
367
+ *
368
+ * @example
369
+ * // Türkçe etiketlerle
370
+ * ```tsx
371
+ * <BooleanCell value={false} trueLabel="Evet" falseLabel="Hayır" />
372
+ * // Çıktı: "Hayır" (kırmızı)
373
+ * ```
374
+ *
375
+ * @example
376
+ * // İkon kullanımı
377
+ * ```tsx
378
+ * <BooleanCell value={true} trueLabel="✓" falseLabel="✗" />
379
+ * // Çıktı: "✓" (yeşil)
380
+ * ```
381
+ *
382
+ * @example
383
+ * // Özel renklerle
384
+ * ```tsx
385
+ * <BooleanCell
386
+ * value={true}
387
+ * trueLabel="Onaylandı"
388
+ * trueColor="text-blue-600 dark:text-blue-400"
389
+ * />
390
+ * ```
391
+ *
392
+ * @example
393
+ * // TanStack Table column içinde kullanım
394
+ * ```tsx
395
+ * columnHelper.accessor("isActive", {
396
+ * header: "Aktif",
397
+ * cell: (info) => (
398
+ * <BooleanCell
399
+ * value={info.getValue()}
400
+ * trueLabel="Aktif"
401
+ * falseLabel="Pasif"
402
+ * />
403
+ * ),
404
+ * })
405
+ * ```
406
+ */
407
+ declare function BooleanCell({ value, trueLabel, falseLabel, trueColor, falseColor, }: BooleanCellProps): react_jsx_runtime.JSX.Element;
408
+
409
+ interface DateCellProps {
410
+ /** Date value (ISO string or Date object) */
411
+ value: string | Date;
412
+ /**
413
+ * Date format
414
+ * - "short": Short format (e.g., 12/28/2024)
415
+ * - "long": Long format (e.g., December 28, 2024)
416
+ * - "relative": Relative format (e.g., "Today", "Yesterday", "3 days ago")
417
+ * @default "short"
418
+ */
419
+ format?: "short" | "long" | "relative";
420
+ /**
421
+ * Locale (language and region)
422
+ * @default "en-US"
423
+ */
424
+ locale?: string;
425
+ }
426
+ /**
427
+ * Ready-to-use component for date values
428
+ *
429
+ * Supported formats:
430
+ * - **short**: Standard short date format (e.g., 12/28/2024)
431
+ * - **long**: Long format with month name (e.g., December 28, 2024)
432
+ * - **relative**: Relative time (Today, Yesterday, X days ago)
433
+ *
434
+ * Invalid dates are automatically displayed as "-".
435
+ *
436
+ * @example
437
+ * // Simple usage (short format)
438
+ * ```tsx
439
+ * <DateCell value="2024-12-28" />
440
+ * // Output: "12/28/2024"
441
+ * ```
442
+ *
443
+ * @example
444
+ * // Long format
445
+ * ```tsx
446
+ * <DateCell value={new Date()} format="long" />
447
+ * // Output: "December 28, 2024"
448
+ * ```
449
+ *
450
+ * @example
451
+ * // Relative format
452
+ * ```tsx
453
+ * <DateCell value={new Date()} format="relative" />
454
+ * // Output: "Today"
455
+ * ```
456
+ *
457
+ * @example
458
+ * // Different locale
459
+ * ```tsx
460
+ * <DateCell value="2024-12-28" format="long" locale="fr-FR" />
461
+ * // Output: "28 décembre 2024"
462
+ * ```
463
+ *
464
+ * @example
465
+ * // Usage within TanStack Table column
466
+ * ```tsx
467
+ * columnHelper.accessor("createdAt", {
468
+ * header: "Created At",
469
+ * cell: (info) => <DateCell value={info.getValue()} format="long" />,
470
+ * })
471
+ * ```
472
+ */
473
+ declare function DateCell({ value, format, locale }: DateCellProps): react_jsx_runtime.JSX.Element;
474
+
475
+ interface CurrencyCellProps {
476
+ /** Sayısal değer */
477
+ value: number;
478
+ /**
479
+ * Para birimi kodu (ISO 4217)
480
+ * @default "TRY"
481
+ * @example "USD", "EUR", "GBP", "JPY"
482
+ */
483
+ currency?: string;
484
+ /**
485
+ * Locale (dil ve bölge formatı)
486
+ * @default "tr-TR"
487
+ */
488
+ locale?: string;
489
+ }
490
+ /**
491
+ * Para birimi için hazır bileşen
492
+ *
493
+ * Intl.NumberFormat kullanarak sayısal değerleri yerel formatta gösterir.
494
+ * Para birimi sembolü, binlik ayracı ve ondalık formatı otomatik ayarlanır.
495
+ *
496
+ * @example
497
+ * // Türk Lirası (varsayılan)
498
+ * ```tsx
499
+ * <CurrencyCell value={1234.56} />
500
+ * // Çıktı: "₺1.234,56"
501
+ * ```
502
+ *
503
+ * @example
504
+ * // Amerikan Doları
505
+ * ```tsx
506
+ * <CurrencyCell value={1234.56} currency="USD" locale="en-US" />
507
+ * // Çıktı: "$1,234.56"
508
+ * ```
509
+ *
510
+ * @example
511
+ * // Euro
512
+ * ```tsx
513
+ * <CurrencyCell value={1234.56} currency="EUR" locale="de-DE" />
514
+ * // Çıktı: "1.234,56 €"
515
+ * ```
516
+ *
517
+ * @example
518
+ * // TanStack Table column içinde kullanım
519
+ * ```tsx
520
+ * columnHelper.accessor("price", {
521
+ * header: "Fiyat",
522
+ * cell: (info) => <CurrencyCell value={info.getValue()} />,
523
+ * })
524
+ * ```
525
+ *
526
+ * @example
527
+ * // Çoklu para birimi desteği
528
+ * ```tsx
529
+ * columnHelper.accessor("amount", {
530
+ * header: "Tutar",
531
+ * cell: (info) => (
532
+ * <CurrencyCell
533
+ * value={info.getValue()}
534
+ * currency={info.row.original.currency}
535
+ * />
536
+ * ),
537
+ * })
538
+ * ```
539
+ */
540
+ declare function CurrencyCell({ value, currency, locale }: CurrencyCellProps): react_jsx_runtime.JSX.Element;
541
+
542
+ interface CopyableCellProps {
543
+ /** Value to display and copy */
544
+ value: string | number;
545
+ /**
546
+ * Duration of feedback shown after copying (ms)
547
+ * @default 2000
548
+ */
549
+ feedbackDuration?: number;
550
+ /** Callback called after copying */
551
+ onCopy?: (value: string) => void;
552
+ /** Additional CSS classes */
553
+ className?: string;
554
+ /**
555
+ * Tooltip text
556
+ * @default "Click to copy"
557
+ */
558
+ tooltip?: string;
559
+ /**
560
+ * Always show icon?
561
+ * If false, only visible on hover
562
+ * @default false
563
+ */
564
+ alwaysShowIcon?: boolean;
565
+ }
566
+ /**
567
+ * Cell component that copies value to clipboard when clicked
568
+ *
569
+ * Ideal for values users frequently need to copy such as
570
+ * Email addresses, reference codes, IDs.
571
+ *
572
+ * Features:
573
+ * - Single click copy
574
+ * - Shows ✓ icon when copied
575
+ * - Option to show icon on hover or always
576
+ * - Capable of capturing copy event with optional callback
577
+ *
578
+ * @example
579
+ * // Simple usage
580
+ * ```tsx
581
+ * <CopyableCell value="user@example.com" />
582
+ * ```
583
+ *
584
+ * @example
585
+ * // With Callback
586
+ * ```tsx
587
+ * <CopyableCell
588
+ * value="ABC123"
589
+ * onCopy={(val) => console.log('Copied:', val)}
590
+ * tooltip="Copy reference code"
591
+ * />
592
+ * ```
593
+ *
594
+ * @example
595
+ * // Icon always visible
596
+ * ```tsx
597
+ * <CopyableCell
598
+ * value="order-12345"
599
+ * alwaysShowIcon
600
+ * />
601
+ * ```
602
+ *
603
+ * @example
604
+ * // Usage within TanStack Table column
605
+ * ```tsx
606
+ * columnHelper.accessor("email", {
607
+ * header: "Email",
608
+ * cell: (info) => <CopyableCell value={info.getValue()} />,
609
+ * })
610
+ * ```
611
+ */
612
+ declare function CopyableCell({ value, feedbackDuration, onCopy, className, tooltip, alwaysShowIcon, }: CopyableCellProps): react_jsx_runtime.JSX.Element;
613
+ /**
614
+ * Factory function for CopyableCell
615
+ *
616
+ * Designed for easy use with column helper.
617
+ * Creates CopyableCell by passing the value directly.
618
+ *
619
+ * @example
620
+ * ```tsx
621
+ * const columnHelper = createColumnHelper<User>();
622
+ *
623
+ * const columns = [
624
+ * columnHelper.accessor("email", {
625
+ * header: "Email",
626
+ * cell: (info) => createCopyableCell(info.getValue()),
627
+ * }),
628
+ * columnHelper.accessor("orderId", {
629
+ * header: "Order No",
630
+ * cell: (info) => createCopyableCell(info.getValue(), {
631
+ * tooltip: "Copy order number"
632
+ * }),
633
+ * }),
634
+ * ];
635
+ * ```
636
+ */
637
+ declare function createCopyableCell(value: string | number, options?: Omit<CopyableCellProps, "value">): react_jsx_runtime.JSX.Element;
638
+
639
+ declare const buttonVariants: (props?: ({
640
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
641
+ size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
642
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
643
+ declare function Button({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
644
+ asChild?: boolean;
645
+ }): react_jsx_runtime.JSX.Element;
646
+
647
+ declare function Checkbox({ className, ...props }: React$1.ComponentProps<typeof CheckboxPrimitive.Root>): react_jsx_runtime.JSX.Element;
648
+
649
+ declare const DropdownMenu: React$1.FC<DropdownMenuPrimitive.DropdownMenuProps>;
650
+ declare const DropdownMenuTrigger: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
651
+ declare const DropdownMenuGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React$1.RefAttributes<HTMLDivElement>>;
652
+ declare const DropdownMenuPortal: React$1.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
653
+ declare const DropdownMenuSub: React$1.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
654
+ declare const DropdownMenuRadioGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
655
+ declare const DropdownMenuSubTrigger: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
656
+ inset?: boolean;
657
+ } & React$1.RefAttributes<HTMLDivElement>>;
658
+ declare const DropdownMenuSubContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
659
+ declare const DropdownMenuContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
660
+ declare const DropdownMenuItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
661
+ inset?: boolean;
662
+ } & React$1.RefAttributes<HTMLDivElement>>;
663
+ declare const DropdownMenuCheckboxItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
664
+ declare const DropdownMenuRadioItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
665
+ declare const DropdownMenuLabel: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
666
+ inset?: boolean;
667
+ } & React$1.RefAttributes<HTMLDivElement>>;
668
+ declare const DropdownMenuSeparator: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
669
+ declare const DropdownMenuShortcut: {
670
+ ({ className, ...props }: React$1.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
671
+ displayName: string;
672
+ };
673
+
674
+ declare const Input: React$1.ForwardRefExoticComponent<React$1.InputHTMLAttributes<HTMLInputElement> & React$1.RefAttributes<HTMLInputElement>>;
675
+
676
+ declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
677
+
678
+ declare const Popover: React$1.FC<PopoverPrimitive.PopoverProps>;
679
+ declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
680
+ declare const PopoverAnchor: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React$1.RefAttributes<HTMLDivElement>>;
681
+ declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
682
+
683
+ declare const Select: React$1.FC<SelectPrimitive.SelectProps>;
684
+ declare const SelectGroup: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React$1.RefAttributes<HTMLDivElement>>;
685
+ declare const SelectValue: React$1.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React$1.RefAttributes<HTMLSpanElement>>;
686
+ declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
687
+ declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
688
+ declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
689
+ declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
690
+ declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
691
+ declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
692
+ declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
693
+
694
+ declare const Separator: React$1.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
16
695
 
17
696
  declare function cn(...inputs: ClassValue[]): string;
18
697
 
19
- export { LuxTable, cn };
698
+ interface ColumnOptions<TData, TValue> {
699
+ id?: string;
700
+ header?: string | ((context: HeaderContext<TData, TValue>) => React$1.ReactNode);
701
+ cell?: (info: CellContext<TData, TValue>) => React$1.ReactNode;
702
+ enableSorting?: boolean;
703
+ /** Column meta information (e.g. filterVariant) */
704
+ meta?: {
705
+ /** Filter type: "text" (default) or "select" (dropdown) */
706
+ filterVariant?: "text" | "select";
707
+ };
708
+ }
709
+ type ColumnType = "text" | "status" | "progress" | "boolean" | "date" | "currency" | "custom";
710
+ interface SmartColumnOptions<TData, TValue> extends ColumnOptions<TData, TValue> {
711
+ /**
712
+ * Column type - used for automatic rendering
713
+ * - text: Displays value as plain text (default)
714
+ * - status: Displays with StatusCell component
715
+ * - progress: Displays with ProgressCell component
716
+ * - boolean: Displays with BooleanCell component
717
+ * - date: Displays with DateCell component
718
+ * - currency: Displays with CurrencyCell component
719
+ * - custom: Uses your provided cell function
720
+ */
721
+ type?: ColumnType;
722
+ /** Custom colors for Status type */
723
+ statusColors?: Record<string, {
724
+ bg: string;
725
+ text: string;
726
+ darkBg?: string;
727
+ darkText?: string;
728
+ }>;
729
+ /** Bar color for Progress type */
730
+ progressBarColor?: string;
731
+ /** Whether to show label for Progress type */
732
+ showProgressLabel?: boolean;
733
+ /** Labels for Boolean type */
734
+ booleanLabels?: {
735
+ true: string;
736
+ false: string;
737
+ };
738
+ /** Format for Date type */
739
+ dateFormat?: "short" | "long" | "relative";
740
+ /** Currency code for Currency type */
741
+ currency?: string;
742
+ /** Locale */
743
+ locale?: string;
744
+ }
745
+ declare function createColumnHelper<TData>(): {
746
+ /**
747
+ * Simple accessor - if cell is not provided, value is rendered automatically
748
+ */
749
+ accessor: <TValue>(accessor: keyof TData & string, column?: ColumnOptions<TData, TValue>) => ColumnDef<TData, TValue>;
750
+ /**
751
+ * Display column (for actions etc.)
752
+ */
753
+ display: (column: {
754
+ id: string;
755
+ header?: string | (() => React$1.ReactNode);
756
+ cell?: (info: CellContext<TData, unknown>) => React$1.ReactNode;
757
+ enableSorting?: boolean;
758
+ enableHiding?: boolean;
759
+ }) => ColumnDef<TData, unknown>;
760
+ /**
761
+ * Action column - specialized display column for row actions
762
+ * Disables sorting by default
763
+ */
764
+ action: (column: {
765
+ cell: (info: CellContext<TData, unknown>) => React$1.ReactNode;
766
+ id?: string;
767
+ header?: string | (() => React$1.ReactNode);
768
+ }) => ColumnDef<TData, unknown>;
769
+ /**
770
+ * Create all columns automatically - Table directly from JSON
771
+ * Just specifying headers is enough, cell is rendered automatically
772
+ */
773
+ auto: (columns: Array<{
774
+ accessor: keyof TData & string;
775
+ header: string;
776
+ cell?: (info: CellContext<TData, unknown>) => React$1.ReactNode;
777
+ }>) => ColumnDef<TData, unknown>[];
778
+ };
779
+ /**
780
+ * Creates automatic columns from JSON data
781
+ * Uses column names as header (camelCase -> Title Case)
782
+ */
783
+ declare function createColumnsFromData<TData extends Record<string, unknown>>(data: TData[], options?: {
784
+ exclude?: (keyof TData)[];
785
+ include?: (keyof TData)[];
786
+ headers?: Partial<Record<keyof TData, string>>;
787
+ cells?: Partial<Record<keyof TData, (info: CellContext<TData, unknown>) => React$1.ReactNode>>;
788
+ }): ColumnDef<TData, unknown>[];
789
+
790
+ export { BooleanCell, type BooleanCellProps, Button, Checkbox, ColumnFilter, type ColumnMeta, type ColumnOptions, type ColumnType, CopyableCell, type CopyableCellProps, CurrencyCell, type CurrencyCellProps, DateCell, type DateCellProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Input, Label, LuxDataTableColumnHeader, LuxTable, type LuxTableOptions, type LuxTableProps, type PaginationInfo, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProgressCell, type ProgressCellProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SmartColumnOptions, SortIcon, type SortIconProps, StatusCell, type StatusCellProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, TableRow, TableToolbar, buttonVariants, cn, createColumnHelper, createColumnsFromData, createCopyableCell, defaultStatusColors };