@caffeinebounce/ui 0.62.3 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +1 -1
  2. package/dist/blog.js +7 -6
  3. package/dist/blog.mjs +2 -1
  4. package/dist/charts.d.cts +1 -1
  5. package/dist/charts.d.ts +1 -1
  6. package/dist/{chunk-6DVWMJ3H.mjs → chunk-2EFVMX6V.mjs} +3 -3
  7. package/dist/{chunk-6ZJCK6KH.js → chunk-375DECW4.js} +31 -31
  8. package/dist/{chunk-PZRI43EZ.js → chunk-46JYKBRX.js} +0 -43
  9. package/dist/chunk-5D55OVD5.js +75 -0
  10. package/dist/{chunk-JORVSG52.js → chunk-663CFAHS.js} +211 -269
  11. package/dist/chunk-6HKJDV43.mjs +48 -0
  12. package/dist/chunk-6NCRGHV3.mjs +64 -0
  13. package/dist/{chunk-OLAAXLXY.mjs → chunk-6QAKQG57.mjs} +4 -4
  14. package/dist/{chunk-N6AFNFZR.mjs → chunk-7ERVZXIN.mjs} +214 -270
  15. package/dist/chunk-APFEP5B7.mjs +100 -0
  16. package/dist/chunk-C3OADNSG.js +348 -0
  17. package/dist/{chunk-GIJQE3JR.js → chunk-DH5Z3ETN.js} +66 -45
  18. package/dist/chunk-DYWZ23QT.mjs +90 -0
  19. package/dist/{chunk-DTVWRRFN.mjs → chunk-E67IR6HU.mjs} +30 -9
  20. package/dist/{chunk-OVNLC5RD.mjs → chunk-EXQSWHLD.mjs} +6 -6
  21. package/dist/{chunk-ZOA7B32D.js → chunk-F35KL6TX.js} +9 -9
  22. package/dist/{chunk-YSLD2HLP.mjs → chunk-FFJC66KO.mjs} +1 -1
  23. package/dist/{chunk-MPZFPU4X.js → chunk-GMBLPQ3I.js} +3 -3
  24. package/dist/chunk-IJFPPLQW.js +50 -0
  25. package/dist/{chunk-BMFQG6RA.mjs → chunk-KJIX6V32.mjs} +107 -1885
  26. package/dist/chunk-LABHD4PU.js +109 -0
  27. package/dist/{chunk-GAIQJCAZ.js → chunk-LT5VD4KR.js} +149 -1953
  28. package/dist/{chunk-7DHKQODW.mjs → chunk-LTLCIRZY.mjs} +256 -474
  29. package/dist/chunk-N5BHXWR3.mjs +34 -0
  30. package/dist/chunk-OCO3Z5YA.js +37 -0
  31. package/dist/chunk-OIJ7XMDV.mjs +71 -0
  32. package/dist/chunk-ORBH4IBC.mjs +316 -0
  33. package/dist/chunk-OWWOAYIY.js +2652 -0
  34. package/dist/chunk-PFHOXDSW.mjs +10 -0
  35. package/dist/chunk-QRS7DJGS.js +103 -0
  36. package/dist/{chunk-NXPEJ2UR.mjs → chunk-R3X4B4JJ.mjs} +53 -6
  37. package/dist/chunk-RM7ACPTM.mjs +2601 -0
  38. package/dist/chunk-RODSGPBB.mjs +75 -0
  39. package/dist/{chunk-T6ZBA6VJ.js → chunk-UHAV34YX.js} +8 -8
  40. package/dist/{chunk-GUSTCU2W.mjs → chunk-ULANYJ7Y.mjs} +1 -59
  41. package/dist/chunk-ULDE7QSN.js +70 -0
  42. package/dist/chunk-UT36VNVZ.mjs +47 -0
  43. package/dist/chunk-UY3H4PKB.js +71 -0
  44. package/dist/{chunk-KB7UXIQZ.mjs → chunk-VIVWFQG5.mjs} +2 -1
  45. package/dist/{chunk-ESZ7CBA2.js → chunk-VKBJ3SGT.js} +6 -5
  46. package/dist/{chunk-UM7WMXIU.js → chunk-W3YOQ5ZD.js} +264 -505
  47. package/dist/{chunk-GHOFYK2E.js → chunk-XGJL6DLV.js} +55 -5
  48. package/dist/chunk-YRIBFIQ5.js +116 -0
  49. package/dist/chunk-ZWWJ3RRA.js +15 -0
  50. package/dist/data-grid.d.cts +241 -0
  51. package/dist/data-grid.d.ts +241 -0
  52. package/dist/data-grid.js +6486 -0
  53. package/dist/data-grid.mjs +6459 -0
  54. package/dist/data-table-CDQBo-Ve.d.ts +818 -0
  55. package/dist/data-table-jLzt6plY.d.cts +818 -0
  56. package/dist/data-table.d.cts +8 -42
  57. package/dist/data-table.d.ts +8 -42
  58. package/dist/data-table.js +61 -187
  59. package/dist/data-table.mjs +11 -5
  60. package/dist/finance.d.cts +534 -0
  61. package/dist/finance.d.ts +534 -0
  62. package/dist/finance.js +188 -0
  63. package/dist/finance.mjs +15 -0
  64. package/dist/forms.js +9 -6
  65. package/dist/forms.mjs +7 -4
  66. package/dist/{hooks-B2jU1GVT.d.ts → hooks-A55E0fgf.d.ts} +3 -2
  67. package/dist/{hooks-8ORd7T1A.d.cts → hooks-Bys_AZPI.d.cts} +3 -2
  68. package/dist/hooks.d.cts +1 -1
  69. package/dist/hooks.d.ts +1 -1
  70. package/dist/hooks.js +26 -23
  71. package/dist/hooks.mjs +6 -3
  72. package/dist/index.d.cts +536 -665
  73. package/dist/index.d.ts +536 -665
  74. package/dist/index.js +3829 -3408
  75. package/dist/index.mjs +2067 -1767
  76. package/dist/layouts.js +25 -25
  77. package/dist/layouts.mjs +4 -4
  78. package/dist/marketing.js +74 -74
  79. package/dist/marketing.mjs +4 -4
  80. package/dist/navigation.js +28 -28
  81. package/dist/navigation.mjs +6 -6
  82. package/dist/primitives.d.cts +72 -109
  83. package/dist/primitives.d.ts +72 -109
  84. package/dist/primitives.js +78 -72
  85. package/dist/primitives.mjs +8 -6
  86. package/dist/settings.js +9 -9
  87. package/dist/settings.mjs +4 -4
  88. package/package.json +17 -1
  89. package/dist/UnifiedTableControls-CG299y9h.d.ts +0 -1233
  90. package/dist/UnifiedTableControls-CIjRpNhy.d.cts +0 -1233
  91. package/dist/chunk-GMBGWOCR.mjs +0 -49
  92. package/dist/chunk-HBLKVQIQ.mjs +0 -23
  93. package/dist/chunk-HMAMMC72.js +0 -26
  94. package/dist/chunk-MVYRNJA6.js +0 -75
  95. /package/dist/{chunk-RVEFPVZF.mjs → chunk-C57MX3BG.mjs} +0 -0
  96. /package/dist/{chunk-C4UT5V3P.js → chunk-OWHI5VGJ.js} +0 -0
@@ -0,0 +1,241 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React$1 from 'react';
3
+ import { RowData, Cell, TableMeta, TableOptions, ColumnDef, Column } from '@tanstack/react-table';
4
+ import * as _tanstack_virtual_core from '@tanstack/virtual-core';
5
+ import * as _tanstack_table_core from '@tanstack/table-core';
6
+
7
+ type Direction = "ltr" | "rtl";
8
+ type RowHeightValue = "short" | "medium" | "tall" | "extra-tall";
9
+ interface CellSelectOption {
10
+ label: string;
11
+ value: string;
12
+ icon?: React.ComponentType<React.ComponentProps<"svg">>;
13
+ count?: number;
14
+ }
15
+ type CellOpts = {
16
+ variant: "short-text";
17
+ } | {
18
+ variant: "long-text";
19
+ } | {
20
+ variant: "number";
21
+ min?: number;
22
+ max?: number;
23
+ step?: number;
24
+ } | {
25
+ variant: "select";
26
+ options: CellSelectOption[];
27
+ } | {
28
+ variant: "multi-select";
29
+ options: CellSelectOption[];
30
+ } | {
31
+ variant: "checkbox";
32
+ } | {
33
+ variant: "date";
34
+ } | {
35
+ variant: "url";
36
+ } | {
37
+ variant: "file";
38
+ maxFileSize?: number;
39
+ maxFiles?: number;
40
+ accept?: string;
41
+ multiple?: boolean;
42
+ };
43
+ interface CellUpdate {
44
+ rowIndex: number;
45
+ columnId: string;
46
+ value: unknown;
47
+ }
48
+ declare module "@tanstack/react-table" {
49
+ interface ColumnMeta<TData extends RowData, TValue> {
50
+ label?: string;
51
+ cell?: CellOpts;
52
+ }
53
+ interface TableMeta<TData extends RowData> {
54
+ dataGridRef?: React.RefObject<HTMLElement | null>;
55
+ cellMapRef?: React.RefObject<Map<string, HTMLDivElement>>;
56
+ focusedCell?: CellPosition | null;
57
+ editingCell?: CellPosition | null;
58
+ selectionState?: SelectionState;
59
+ searchOpen?: boolean;
60
+ getIsCellSelected?: (rowIndex: number, columnId: string) => boolean;
61
+ getIsSearchMatch?: (rowIndex: number, columnId: string) => boolean;
62
+ getIsActiveSearchMatch?: (rowIndex: number, columnId: string) => boolean;
63
+ getVisualRowIndex?: (rowId: string) => number | undefined;
64
+ scrollToCell?: (rowIndex: number, columnId: string, align?: "auto" | "start" | "center" | "end") => void;
65
+ rowHeight?: RowHeightValue;
66
+ onRowHeightChange?: (value: RowHeightValue) => void;
67
+ onRowSelect?: (rowId: string, checked: boolean, shiftKey: boolean) => void;
68
+ onDataUpdate?: (params: CellUpdate | Array<CellUpdate>) => void;
69
+ onRowsDelete?: (rowIndices: number[]) => void | Promise<void>;
70
+ onColumnClick?: (columnId: string) => void;
71
+ onCellClick?: (rowIndex: number, columnId: string, event?: React.MouseEvent) => void;
72
+ onCellDoubleClick?: (rowIndex: number, columnId: string) => void;
73
+ onCellMouseDown?: (rowIndex: number, columnId: string, event: React.MouseEvent) => void;
74
+ onCellMouseEnter?: (rowIndex: number, columnId: string) => void;
75
+ onCellMouseUp?: () => void;
76
+ onCellContextMenu?: (rowIndex: number, columnId: string, event: React.MouseEvent) => void;
77
+ onCellEditingStart?: (rowIndex: number, columnId: string) => void;
78
+ onCellEditingStop?: (opts?: {
79
+ direction?: NavigationDirection;
80
+ moveToNextRow?: boolean;
81
+ }) => void;
82
+ onCellsCopy?: () => void;
83
+ onCellsCut?: () => void;
84
+ onCellsPaste?: (expand?: boolean) => void;
85
+ onSelectionClear?: () => void;
86
+ onFilesUpload?: (params: {
87
+ files: File[];
88
+ rowIndex: number;
89
+ columnId: string;
90
+ }) => Promise<FileCellData[]>;
91
+ onFilesDelete?: (params: {
92
+ fileIds: string[];
93
+ rowIndex: number;
94
+ columnId: string;
95
+ }) => void | Promise<void>;
96
+ contextMenu?: ContextMenuState;
97
+ onContextMenuOpenChange?: (open: boolean) => void;
98
+ pasteDialog?: PasteDialogState;
99
+ onPasteDialogOpenChange?: (open: boolean) => void;
100
+ readOnly?: boolean;
101
+ }
102
+ }
103
+ interface CellPosition {
104
+ rowIndex: number;
105
+ columnId: string;
106
+ }
107
+ interface CellRange {
108
+ start: CellPosition;
109
+ end: CellPosition;
110
+ }
111
+ interface SelectionState {
112
+ selectedCells: Set<string>;
113
+ selectionRange: CellRange | null;
114
+ isSelecting: boolean;
115
+ }
116
+ interface ContextMenuState {
117
+ open: boolean;
118
+ x: number;
119
+ y: number;
120
+ }
121
+ interface PasteDialogState {
122
+ open: boolean;
123
+ rowsNeeded: number;
124
+ clipboardText: string;
125
+ }
126
+ type NavigationDirection = "up" | "down" | "left" | "right" | "home" | "end" | "ctrl+up" | "ctrl+down" | "ctrl+home" | "ctrl+end" | "pageup" | "pagedown" | "pageleft" | "pageright";
127
+ interface SearchState {
128
+ searchMatches: CellPosition[];
129
+ matchIndex: number;
130
+ searchOpen: boolean;
131
+ onSearchOpenChange: (open: boolean) => void;
132
+ searchQuery: string;
133
+ onSearchQueryChange: (query: string) => void;
134
+ onSearch: (query: string) => void;
135
+ onNavigateToNextMatch: () => void;
136
+ onNavigateToPrevMatch: () => void;
137
+ }
138
+ interface DataGridCellProps<TData> {
139
+ cell: Cell<TData, unknown>;
140
+ tableMeta: TableMeta<TData>;
141
+ rowIndex: number;
142
+ columnId: string;
143
+ rowHeight: RowHeightValue;
144
+ isEditing: boolean;
145
+ isFocused: boolean;
146
+ isSelected: boolean;
147
+ isSearchMatch: boolean;
148
+ isActiveSearchMatch: boolean;
149
+ readOnly: boolean;
150
+ }
151
+ interface FileCellData {
152
+ id: string;
153
+ name: string;
154
+ size: number;
155
+ type: string;
156
+ url?: string;
157
+ }
158
+ type TextFilterOperator = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "isEmpty" | "isNotEmpty";
159
+ type NumberFilterOperator = "equals" | "notEquals" | "lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "isBetween" | "isEmpty" | "isNotEmpty";
160
+ type DateFilterOperator = "equals" | "notEquals" | "before" | "after" | "onOrBefore" | "onOrAfter" | "isBetween" | "isEmpty" | "isNotEmpty";
161
+ type SelectFilterOperator = "is" | "isNot" | "isAnyOf" | "isNoneOf" | "isEmpty" | "isNotEmpty";
162
+ type BooleanFilterOperator = "isTrue" | "isFalse";
163
+ type FilterOperator = TextFilterOperator | NumberFilterOperator | DateFilterOperator | SelectFilterOperator | BooleanFilterOperator;
164
+ interface FilterValue {
165
+ operator: FilterOperator;
166
+ value?: string | number | string[];
167
+ endValue?: string | number;
168
+ }
169
+
170
+ interface UseDataGridProps<TData> extends Omit<TableOptions<TData>, "pageCount" | "getCoreRowModel"> {
171
+ onDataChange?: (data: TData[]) => void;
172
+ onRowAdd?: (event?: React$1.MouseEvent<HTMLDivElement>) => Partial<CellPosition> | Promise<Partial<CellPosition> | null> | null;
173
+ onRowsAdd?: (count: number) => void | Promise<void>;
174
+ onRowsDelete?: (rows: TData[], rowIndices: number[]) => void | Promise<void>;
175
+ onPaste?: (updates: Array<CellUpdate>) => void | Promise<void>;
176
+ onFilesUpload?: (params: {
177
+ files: File[];
178
+ rowIndex: number;
179
+ columnId: string;
180
+ }) => Promise<FileCellData[]>;
181
+ onFilesDelete?: (params: {
182
+ fileIds: string[];
183
+ rowIndex: number;
184
+ columnId: string;
185
+ }) => void | Promise<void>;
186
+ rowHeight?: RowHeightValue;
187
+ onRowHeightChange?: (rowHeight: RowHeightValue) => void;
188
+ overscan?: number;
189
+ dir?: Direction;
190
+ autoFocus?: boolean | Partial<CellPosition>;
191
+ enableSingleCellSelection?: boolean;
192
+ enableColumnSelection?: boolean;
193
+ enableSearch?: boolean;
194
+ enablePaste?: boolean;
195
+ readOnly?: boolean;
196
+ }
197
+ declare function useDataGrid<TData>({ data, columns, rowHeight: rowHeightProp, overscan, dir: dirProp, initialState, ...props }: UseDataGridProps<TData>): {
198
+ dataGridRef: React$1.RefObject<HTMLDivElement | null>;
199
+ headerRef: React$1.RefObject<HTMLDivElement | null>;
200
+ rowMapRef: React$1.RefObject<Map<number, HTMLDivElement>>;
201
+ footerRef: React$1.RefObject<HTMLDivElement | null>;
202
+ dir: "ltr" | "rtl";
203
+ table: _tanstack_table_core.Table<TData>;
204
+ tableMeta: TableMeta<TData>;
205
+ virtualTotalSize: number;
206
+ virtualItems: _tanstack_virtual_core.VirtualItem[];
207
+ measureElement: (node: Element | null) => void;
208
+ columns: ColumnDef<TData, any>[];
209
+ columnSizeVars: {
210
+ [key: string]: number;
211
+ };
212
+ searchState: SearchState | undefined;
213
+ searchMatchesByRow: Map<number, Set<string>> | null;
214
+ activeSearchMatch: CellPosition | null;
215
+ cellSelectionMap: Map<number, Set<string>> | null;
216
+ focusedCell: CellPosition | null;
217
+ editingCell: CellPosition | null;
218
+ rowHeight: RowHeightValue;
219
+ contextMenu: ContextMenuState;
220
+ pasteDialog: PasteDialogState;
221
+ onRowAdd: ((event?: React$1.MouseEvent<HTMLDivElement>) => Promise<void>) | undefined;
222
+ adjustLayout: boolean;
223
+ };
224
+
225
+ interface DataGridProps<TData> extends Omit<ReturnType<typeof useDataGrid<TData>>, "dir">, Omit<React$1.ComponentProps<"div">, "contextMenu"> {
226
+ dir?: Direction;
227
+ height?: number;
228
+ stretchColumns?: boolean;
229
+ }
230
+ declare function DataGrid<TData>({ dataGridRef, headerRef, rowMapRef, footerRef, dir, table, tableMeta, virtualTotalSize, virtualItems, measureElement, columns, columnSizeVars, searchState, searchMatchesByRow, activeSearchMatch, cellSelectionMap, focusedCell, editingCell, rowHeight, contextMenu, pasteDialog, onRowAdd: onRowAddProp, height, stretchColumns, adjustLayout, className, ...props }: DataGridProps<TData>): react_jsx_runtime.JSX.Element;
231
+
232
+ declare function getCellKey(rowIndex: number, columnId: string): string;
233
+ declare function parseCellKey(cellKey: string): Required<CellPosition>;
234
+ declare function getRowHeightValue(rowHeight: RowHeightValue): number;
235
+ declare function getColumnPinningStyle<TData>(params: {
236
+ column: Column<TData>;
237
+ withBorder?: boolean;
238
+ dir?: Direction;
239
+ }): React$1.CSSProperties;
240
+
241
+ export { type BooleanFilterOperator, type CellOpts, type CellPosition, type CellRange, type CellSelectOption, type CellUpdate, type ContextMenuState, DataGrid, type DataGridCellProps, type DateFilterOperator, type Direction, type FileCellData, type FilterOperator, type FilterValue, type NavigationDirection, type NumberFilterOperator, type PasteDialogState, type RowHeightValue, type SearchState, type SelectFilterOperator, type SelectionState, type TextFilterOperator, type UseDataGridProps, getCellKey, getColumnPinningStyle as getGridColumnPinningStyle, getRowHeightValue, parseCellKey, useDataGrid };