@caffeinebounce/ui 0.62.2 → 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 (122) hide show
  1. package/README.md +1 -1
  2. package/dist/blog.js +8 -6
  3. package/dist/blog.mjs +3 -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} +4 -3
  7. package/dist/chunk-33JR5SYE.js +1 -0
  8. package/dist/{chunk-OZZWDIOY.js → chunk-375DECW4.js} +32 -31
  9. package/dist/chunk-3NDB4YPC.js +1 -0
  10. package/dist/{chunk-PZRI43EZ.js → chunk-46JYKBRX.js} +0 -43
  11. package/dist/chunk-5D55OVD5.js +75 -0
  12. package/dist/chunk-5RW4PYZ6.js +1 -0
  13. package/dist/chunk-5THF4YP6.mjs +1 -0
  14. package/dist/{chunk-JORVSG52.js → chunk-663CFAHS.js} +212 -269
  15. package/dist/chunk-6BUBNZPG.mjs +1 -0
  16. package/dist/chunk-6HKJDV43.mjs +48 -0
  17. package/dist/chunk-6NCRGHV3.mjs +64 -0
  18. package/dist/{chunk-OLAAXLXY.mjs → chunk-6QAKQG57.mjs} +5 -4
  19. package/dist/chunk-72JGQ7IJ.mjs +1 -0
  20. package/dist/{chunk-N6AFNFZR.mjs → chunk-7ERVZXIN.mjs} +215 -270
  21. package/dist/chunk-7IKHZKAC.js +1 -0
  22. package/dist/chunk-APFEP5B7.mjs +100 -0
  23. package/dist/chunk-C3OADNSG.js +348 -0
  24. package/dist/{chunk-RVEFPVZF.mjs → chunk-C57MX3BG.mjs} +1 -0
  25. package/dist/{chunk-CC4KUIKC.js → chunk-DH5Z3ETN.js} +67 -45
  26. package/dist/chunk-DYWZ23QT.mjs +90 -0
  27. package/dist/{chunk-KRRIRS6A.mjs → chunk-E67IR6HU.mjs} +31 -9
  28. package/dist/{chunk-D3QXPL47.mjs → chunk-EXQSWHLD.mjs} +7 -6
  29. package/dist/{chunk-ZOA7B32D.js → chunk-F35KL6TX.js} +10 -9
  30. package/dist/{chunk-YSLD2HLP.mjs → chunk-FFJC66KO.mjs} +2 -1
  31. package/dist/chunk-FRRS2YZH.mjs +1 -0
  32. package/dist/chunk-G5TQWWQA.mjs +1 -0
  33. package/dist/{chunk-MPZFPU4X.js → chunk-GMBLPQ3I.js} +4 -3
  34. package/dist/chunk-IJFPPLQW.js +50 -0
  35. package/dist/chunk-J6OLBSZR.js +1 -0
  36. package/dist/chunk-KGGQ5NZV.js +1 -0
  37. package/dist/chunk-KHCC5UKW.mjs +1 -0
  38. package/dist/{chunk-BMFQG6RA.mjs → chunk-KJIX6V32.mjs} +108 -1885
  39. package/dist/chunk-LABHD4PU.js +109 -0
  40. package/dist/chunk-LQCVRWVF.js +1 -0
  41. package/dist/{chunk-GAIQJCAZ.js → chunk-LT5VD4KR.js} +150 -1953
  42. package/dist/{chunk-7DHKQODW.mjs → chunk-LTLCIRZY.mjs} +257 -474
  43. package/dist/chunk-N5BHXWR3.mjs +34 -0
  44. package/dist/chunk-OCO3Z5YA.js +37 -0
  45. package/dist/chunk-OFQLWSUR.mjs +1 -0
  46. package/dist/chunk-OIJ7XMDV.mjs +71 -0
  47. package/dist/chunk-ORBH4IBC.mjs +316 -0
  48. package/dist/{chunk-C4UT5V3P.js → chunk-OWHI5VGJ.js} +1 -0
  49. package/dist/chunk-OWWOAYIY.js +2652 -0
  50. package/dist/chunk-PFHOXDSW.mjs +10 -0
  51. package/dist/chunk-Q52ZEL62.mjs +1 -0
  52. package/dist/chunk-QRS7DJGS.js +103 -0
  53. package/dist/chunk-R26Y7LGJ.js +1 -0
  54. package/dist/{chunk-BFWX5GJZ.mjs → chunk-R3X4B4JJ.mjs} +56 -8
  55. package/dist/chunk-RBUYW6QQ.js +1 -0
  56. package/dist/chunk-RM7ACPTM.mjs +2601 -0
  57. package/dist/chunk-RODSGPBB.mjs +75 -0
  58. package/dist/chunk-SORWLKOK.js +1 -0
  59. package/dist/{chunk-T6ZBA6VJ.js → chunk-UHAV34YX.js} +9 -8
  60. package/dist/{chunk-GUSTCU2W.mjs → chunk-ULANYJ7Y.mjs} +1 -59
  61. package/dist/chunk-ULDE7QSN.js +70 -0
  62. package/dist/chunk-UT36VNVZ.mjs +47 -0
  63. package/dist/chunk-UY3H4PKB.js +71 -0
  64. package/dist/{chunk-KB7UXIQZ.mjs → chunk-VIVWFQG5.mjs} +3 -1
  65. package/dist/{chunk-ESZ7CBA2.js → chunk-VKBJ3SGT.js} +7 -5
  66. package/dist/{chunk-UM7WMXIU.js → chunk-W3YOQ5ZD.js} +265 -505
  67. package/dist/chunk-WOITB4JL.js +1 -0
  68. package/dist/{chunk-E42B4GSB.js → chunk-XGJL6DLV.js} +58 -7
  69. package/dist/chunk-YKZEKJMZ.mjs +1 -0
  70. package/dist/chunk-YRIBFIQ5.js +116 -0
  71. package/dist/chunk-ZFLZA7UP.mjs +1 -0
  72. package/dist/chunk-ZKUIUE7W.mjs +1 -0
  73. package/dist/chunk-ZWWJ3RRA.js +15 -0
  74. package/dist/data-grid.d.cts +241 -0
  75. package/dist/data-grid.d.ts +241 -0
  76. package/dist/data-grid.js +6486 -0
  77. package/dist/data-grid.mjs +6459 -0
  78. package/dist/data-table-CDQBo-Ve.d.ts +818 -0
  79. package/dist/data-table-jLzt6plY.d.cts +818 -0
  80. package/dist/data-table.d.cts +8 -42
  81. package/dist/data-table.d.ts +8 -42
  82. package/dist/data-table.js +61 -187
  83. package/dist/data-table.mjs +11 -5
  84. package/dist/finance.d.cts +534 -0
  85. package/dist/finance.d.ts +534 -0
  86. package/dist/finance.js +188 -0
  87. package/dist/finance.mjs +15 -0
  88. package/dist/forms.js +9 -6
  89. package/dist/forms.mjs +7 -4
  90. package/dist/{hooks-B2jU1GVT.d.ts → hooks-A55E0fgf.d.ts} +3 -2
  91. package/dist/{hooks-8ORd7T1A.d.cts → hooks-Bys_AZPI.d.cts} +3 -2
  92. package/dist/hooks.d.cts +1 -1
  93. package/dist/hooks.d.ts +1 -1
  94. package/dist/hooks.js +26 -23
  95. package/dist/hooks.mjs +6 -3
  96. package/dist/index.d.cts +536 -665
  97. package/dist/index.d.ts +536 -665
  98. package/dist/index.js +3830 -3408
  99. package/dist/index.mjs +2068 -1767
  100. package/dist/layouts.js +26 -25
  101. package/dist/layouts.mjs +5 -4
  102. package/dist/marketing-3d.js +1 -0
  103. package/dist/marketing-3d.mjs +1 -0
  104. package/dist/marketing.js +75 -74
  105. package/dist/marketing.mjs +5 -4
  106. package/dist/media.js +1 -0
  107. package/dist/media.mjs +1 -0
  108. package/dist/navigation.js +29 -28
  109. package/dist/navigation.mjs +7 -6
  110. package/dist/primitives.d.cts +72 -109
  111. package/dist/primitives.d.ts +72 -109
  112. package/dist/primitives.js +78 -72
  113. package/dist/primitives.mjs +8 -6
  114. package/dist/settings.js +9 -9
  115. package/dist/settings.mjs +4 -4
  116. package/package.json +21 -4
  117. package/dist/UnifiedTableControls-CG299y9h.d.ts +0 -1233
  118. package/dist/UnifiedTableControls-CIjRpNhy.d.cts +0 -1233
  119. package/dist/chunk-GMBGWOCR.mjs +0 -48
  120. package/dist/chunk-HBLKVQIQ.mjs +0 -23
  121. package/dist/chunk-HMAMMC72.js +0 -26
  122. package/dist/chunk-MVYRNJA6.js +0 -74
@@ -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 };