@customafk/lunas-ui 0.2.12 → 0.2.13

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 (159) hide show
  1. package/dist/{alert-DBdAWJoD.d.mts → alert-DUC0U7cI.d.mts} +6 -6
  2. package/dist/{alert-Bi9GgWBf.d.cts → alert-_grSHXD3.d.cts} +6 -6
  3. package/dist/{badge-OocBN04L.d.cts → badge-BwjhcVgG.d.cts} +7 -7
  4. package/dist/{badge-BrBsWjjy.d.mts → badge-DvElo91N.d.mts} +7 -7
  5. package/dist/{button-CM0enIRc.d.mts → button-B46oQvo-.d.mts} +5 -5
  6. package/dist/{button-Bg7LOzPN.d.cts → button-CRujrbey.d.cts} +7 -7
  7. package/dist/cards/simple-card.d.cts +2 -2
  8. package/dist/data-display/statistic.d.cts +2 -2
  9. package/dist/data-display/statistic.d.mts +4 -4
  10. package/dist/{dialog-BXi5bgG0.d.cts → dialog-BuM8wDKV.d.cts} +12 -12
  11. package/dist/{dialog-DLOes4WS.d.mts → dialog-HkbI2x97.d.mts} +12 -12
  12. package/dist/dialogs/detail-dialog/components/sidebar.d.cts +25 -25
  13. package/dist/dialogs/detail-dialog/components/sidebar.d.mts +27 -27
  14. package/dist/features/descriptions/index.d.cts +3 -3
  15. package/dist/features/descriptions/index.d.mts +3 -3
  16. package/dist/features/search-modal/index.d.mts +2 -2
  17. package/dist/features/tables/index.cjs +1 -1
  18. package/dist/features/tables/index.d.cts +2 -1255
  19. package/dist/features/tables/index.d.mts +3 -1255
  20. package/dist/features/tables/index.mjs +1 -1
  21. package/dist/features/tanstack-form/index.d.cts +1 -1
  22. package/dist/features/tanstack-form/index.d.mts +1 -1
  23. package/dist/index-B5wgYino.d.cts +1009 -0
  24. package/dist/{index-CkmisxOx.d.cts → index-DNOZLwxL.d.cts} +237 -237
  25. package/dist/{index-Cyc9v5Az.d.mts → index-DaAbyifH.d.mts} +186 -186
  26. package/dist/index-b6uMbewl.d.mts +1009 -0
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.d.cts +7 -7
  29. package/dist/index.d.mts +7 -7
  30. package/dist/index.mjs +1 -1
  31. package/dist/{input-D9N-kPNc.d.cts → input-BLyJp8UZ.d.cts} +6 -6
  32. package/dist/{input-CvWCE7ft.d.mts → input-BaQTUEQF.d.mts} +4 -4
  33. package/dist/layouts/flex.d.cts +2 -2
  34. package/dist/layouts/flex.d.mts +4 -4
  35. package/dist/pages/FeatureDeveloping.d.cts +2 -2
  36. package/dist/pages/FeatureDeveloping.d.mts +2 -2
  37. package/dist/pages/FeatureFixing.d.cts +2 -2
  38. package/dist/pages/FeatureFixing.d.mts +2 -2
  39. package/dist/pages/NotAuthorized.d.cts +2 -2
  40. package/dist/pages/NotAuthorized.d.mts +2 -2
  41. package/dist/pages/NotFound.d.cts +2 -2
  42. package/dist/pages/NotFound.d.mts +2 -2
  43. package/dist/tables-BtcCgpJB.mjs +4 -0
  44. package/dist/tables-BtcCgpJB.mjs.map +1 -0
  45. package/dist/tables-DZvtd0HA.cjs +4 -0
  46. package/dist/tables-DZvtd0HA.cjs.map +1 -0
  47. package/dist/typography/paragraph.d.cts +3 -3
  48. package/dist/typography/paragraph.d.mts +5 -5
  49. package/dist/typography/title.d.cts +2 -2
  50. package/dist/typography/title.d.mts +2 -2
  51. package/dist/ui/alert-dialog.d.cts +12 -12
  52. package/dist/ui/alert-dialog.d.mts +12 -12
  53. package/dist/ui/alert.d.cts +1 -1
  54. package/dist/ui/alert.d.mts +1 -1
  55. package/dist/ui/aspect-ratio.d.cts +2 -2
  56. package/dist/ui/aspect-ratio.d.mts +2 -2
  57. package/dist/ui/avatar.d.cts +4 -4
  58. package/dist/ui/avatar.d.mts +4 -4
  59. package/dist/ui/badge.d.cts +1 -1
  60. package/dist/ui/badge.d.mts +1 -1
  61. package/dist/ui/breadcrumb.d.cts +8 -8
  62. package/dist/ui/breadcrumb.d.mts +8 -8
  63. package/dist/ui/button-group.d.cts +6 -6
  64. package/dist/ui/button-group.d.mts +4 -4
  65. package/dist/ui/button.d.cts +1 -1
  66. package/dist/ui/button.d.mts +1 -1
  67. package/dist/ui/calendar.d.cts +4 -4
  68. package/dist/ui/calendar.d.mts +4 -4
  69. package/dist/ui/card.d.cts +8 -8
  70. package/dist/ui/card.d.mts +8 -8
  71. package/dist/ui/carousel.d.cts +7 -7
  72. package/dist/ui/carousel.d.mts +7 -7
  73. package/dist/ui/checkbox.d.cts +2 -2
  74. package/dist/ui/checkbox.d.mts +2 -2
  75. package/dist/ui/collapsible.d.cts +4 -4
  76. package/dist/ui/collapsible.d.mts +4 -4
  77. package/dist/ui/command.d.cts +11 -11
  78. package/dist/ui/command.d.mts +11 -11
  79. package/dist/ui/context-menu.d.cts +16 -16
  80. package/dist/ui/context-menu.d.mts +16 -16
  81. package/dist/ui/dialog.d.cts +1 -1
  82. package/dist/ui/dialog.d.mts +1 -1
  83. package/dist/ui/drawer.d.cts +11 -11
  84. package/dist/ui/drawer.d.mts +11 -11
  85. package/dist/ui/dropdown-menu.d.cts +16 -16
  86. package/dist/ui/dropdown-menu.d.mts +16 -16
  87. package/dist/ui/empty.d.cts +7 -7
  88. package/dist/ui/empty.d.mts +9 -9
  89. package/dist/ui/field.d.cts +22 -22
  90. package/dist/ui/field.d.mts +24 -24
  91. package/dist/ui/file-uploader.d.cts +2 -2
  92. package/dist/ui/file-uploader.d.mts +2 -2
  93. package/dist/ui/form.d.cts +11 -11
  94. package/dist/ui/form.d.mts +11 -11
  95. package/dist/ui/hover-card.d.cts +4 -4
  96. package/dist/ui/hover-card.d.mts +4 -4
  97. package/dist/ui/input-otp.d.cts +5 -5
  98. package/dist/ui/input-otp.d.mts +5 -5
  99. package/dist/ui/input.d.cts +1 -1
  100. package/dist/ui/input.d.mts +1 -1
  101. package/dist/ui/inputs/search-input.d.cts +3 -3
  102. package/dist/ui/inputs/search-input.d.mts +3 -3
  103. package/dist/ui/item.d.cts +15 -15
  104. package/dist/ui/item.d.mts +15 -15
  105. package/dist/ui/label.d.cts +2 -2
  106. package/dist/ui/label.d.mts +2 -2
  107. package/dist/ui/menubar.d.cts +17 -17
  108. package/dist/ui/menubar.d.mts +17 -17
  109. package/dist/ui/multi-select.d.cts +2 -2
  110. package/dist/ui/multi-select.d.mts +3 -3
  111. package/dist/ui/navigation-menu.d.cts +11 -11
  112. package/dist/ui/navigation-menu.d.mts +11 -11
  113. package/dist/ui/pagination.d.cts +9 -9
  114. package/dist/ui/pagination.d.mts +9 -9
  115. package/dist/ui/popover.d.cts +6 -6
  116. package/dist/ui/popover.d.mts +6 -6
  117. package/dist/ui/progress.d.cts +2 -2
  118. package/dist/ui/progress.d.mts +2 -2
  119. package/dist/ui/radio-group.d.cts +3 -3
  120. package/dist/ui/radio-group.d.mts +3 -3
  121. package/dist/ui/resizable.d.cts +9 -9
  122. package/dist/ui/resizable.d.mts +9 -9
  123. package/dist/ui/scroll-area.d.cts +6 -6
  124. package/dist/ui/scroll-area.d.mts +6 -6
  125. package/dist/ui/select.d.cts +9 -9
  126. package/dist/ui/select.d.mts +9 -9
  127. package/dist/ui/separator.d.cts +2 -2
  128. package/dist/ui/separator.d.mts +2 -2
  129. package/dist/ui/sheet.d.cts +9 -9
  130. package/dist/ui/sheet.d.mts +9 -9
  131. package/dist/ui/sidebar.d.cts +29 -29
  132. package/dist/ui/sidebar.d.mts +27 -27
  133. package/dist/ui/skeleton.d.cts +2 -2
  134. package/dist/ui/skeleton.d.mts +2 -2
  135. package/dist/ui/slider.d.cts +2 -2
  136. package/dist/ui/slider.d.mts +2 -2
  137. package/dist/ui/sonner.d.cts +2 -2
  138. package/dist/ui/sonner.d.mts +2 -2
  139. package/dist/ui/spinner.d.cts +2 -2
  140. package/dist/ui/spinner.d.mts +2 -2
  141. package/dist/ui/switch.d.cts +2 -2
  142. package/dist/ui/switch.d.mts +2 -2
  143. package/dist/ui/table.d.cts +18 -18
  144. package/dist/ui/table.d.mts +18 -18
  145. package/dist/ui/tabs.d.cts +5 -5
  146. package/dist/ui/tabs.d.mts +5 -5
  147. package/dist/ui/textarea.d.cts +2 -2
  148. package/dist/ui/textarea.d.mts +2 -2
  149. package/dist/ui/toggle-group.d.cts +3 -3
  150. package/dist/ui/toggle-group.d.mts +3 -3
  151. package/dist/ui/toggle.d.cts +5 -5
  152. package/dist/ui/toggle.d.mts +5 -5
  153. package/dist/ui/tooltip.d.cts +5 -5
  154. package/dist/ui/tooltip.d.mts +5 -5
  155. package/package.json +1 -1
  156. package/dist/tables-BQkO4mz6.cjs +0 -4
  157. package/dist/tables-BQkO4mz6.cjs.map +0 -1
  158. package/dist/tables-iT8uH25j.mjs +0 -4
  159. package/dist/tables-iT8uH25j.mjs.map +0 -1
@@ -1,1255 +1,3 @@
1
- import { t as AnyEntity } from "../../types-CkRjAQZ2.mjs";
2
- import { t as Input } from "../../input-CvWCE7ft.mjs";
3
- import * as react286 from "react";
4
- import * as react_jsx_runtime346 from "react/jsx-runtime";
5
- import { AccessorKeyColumnDef, CellContext, Column, ColumnPinningPosition, ColumnPinningState, Header, HeaderGroup, Row, RowSelectionState, Table } from "@tanstack/react-table";
6
- import { VirtualItem, Virtualizer } from "@tanstack/react-virtual";
7
-
8
- //#region packages/components/features/tables/components/atoms/badge-display.d.ts
9
-
10
- /**
11
- * Renders a pill-shaped badge for a table cell that optionally supports a click
12
- * action and an inline remove button; falls back to {@link UITableEmpty} when
13
- * `label` is falsy.
14
- *
15
- * @example
16
- * import { UITableBadgeDisplay } from '@customafk/lunas-ui/features/tables';
17
- *
18
- * <UITableBadgeDisplay
19
- * label="Active"
20
- * onClick={() => console.log('badge clicked')}
21
- * onRemove={() => console.log('remove clicked')}
22
- * />
23
- */
24
- declare const UITableBadgeDisplay: React.FC<{
25
- /** The text or number to display inside the badge. */
26
- label: string | number | null | undefined;
27
- /** Optional callback fired when the badge itself is clicked. */
28
- onClick?: () => void;
29
- /** When provided, renders a remove (×) button and fires this callback on click. */
30
- onRemove?: () => void;
31
- }>;
32
- //#endregion
33
- //#region packages/components/features/tables/components/atoms/boolean-display.d.ts
34
- /**
35
- * Displays a green check icon for `true`, a red X icon for `false`, and a
36
- * double-dash placeholder via {@link UITableEmpty} when the value is
37
- * `null` or `undefined`.
38
- *
39
- * @example
40
- * import { UITableBooleanDisplay } from '@customafk/lunas-ui/features/tables';
41
- *
42
- * <UITableBooleanDisplay value={isActive} />
43
- */
44
- declare const UITableBooleanDisplay: React.FC<{
45
- /** The boolean value to visualise; `null`/`undefined` renders an empty state. */
46
- value: boolean | null | undefined;
47
- }>;
48
- //#endregion
49
- //#region packages/components/features/tables/components/atoms/currency-display.d.ts
50
- /** Props for the {@link UITableCurrencyDisplay} component. */
51
- type Props$7 = {
52
- /** The numeric value to format as currency; falsy / `NaN` renders an empty state. */
53
- value: number | string | null | undefined;
54
- /** ISO 4217 currency code (default: `'USD'`). */
55
- currency?: string;
56
- /**
57
- * BCP 47 locale used for number formatting (default: `'en-US'`).
58
- * Controls digit grouping and decimal separators.
59
- */
60
- locale?: string;
61
- /** How to display the currency symbol — `'symbol'` (default), `'code'`, or `'name'`. */
62
- display?: 'symbol' | 'code' | 'name';
63
- /** Font-size variant (default: `'md'`). */
64
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
65
- /** When `true`, applies a green tint for positive and red tint for negative values. */
66
- colorize?: boolean;
67
- };
68
- /**
69
- * Formats a numeric value as a locale-aware currency string in a table cell.
70
- * Always shows exactly two decimal places and uses the browser's `Intl` API for
71
- * symbol placement. Renders {@link UITableEmpty} when the value is absent or
72
- * invalid.
73
- *
74
- * @example
75
- * import { UITableCurrencyDisplay } from '@customafk/lunas-ui/features/tables';
76
- *
77
- * <UITableCurrencyDisplay value={1234.5} currency="USD" colorize />
78
- */
79
- declare const UITableCurrencyDisplay: react286.MemoExoticComponent<({
80
- value,
81
- currency,
82
- locale,
83
- display,
84
- size,
85
- colorize
86
- }: Props$7) => react_jsx_runtime346.JSX.Element>;
87
- //#endregion
88
- //#region packages/components/features/tables/components/atoms/date-display.d.ts
89
- /** Props for the {@link UITableDateDisplay} component. */
90
- type Props$6 = {
91
- /** The date value to format and display; `null`/`undefined` renders an empty state. */
92
- date: Date | string | number | null | undefined;
93
- };
94
- /**
95
- * Displays a date as a compact badge in a table cell with a tooltip that shows
96
- * the full date and time on hover; renders {@link UITableEmpty} when `date` is
97
- * `null` or `undefined`.
98
- *
99
- * @example
100
- * import { UITableDateDisplay } from '@customafk/lunas-ui/features/tables';
101
- *
102
- * <UITableDateDisplay date={new Date('2024-06-15T10:30:00Z')} />
103
- */
104
- declare const UITableDateDisplay: React.FC<Props$6>;
105
- //#endregion
106
- //#region packages/components/features/tables/components/atoms/description-display.d.ts
107
- /**
108
- * Renders a two-line-clamped description in a table cell with a tooltip that
109
- * reveals the full text and its character count; falls back to
110
- * {@link UITableEmpty} when `content` is `null` or `undefined`.
111
- *
112
- * @example
113
- * import { UITableDescriptionDisplay } from '@customafk/lunas-ui/features/tables';
114
- *
115
- * <UITableDescriptionDisplay content="A detailed description of this record." />
116
- */
117
- declare const UITableDescriptionDisplay: React.FC<{
118
- /** The text or numeric value to display; `null`/`undefined` renders an empty state. */
119
- content: string | null | undefined | number;
120
- }>;
121
- //#endregion
122
- //#region packages/components/features/tables/components/atoms/email-display.d.ts
123
- /** Props for the {@link UITableEmailDisplay} component. */
124
- type Props$5 = {
125
- /** The email address to display; `null`/`undefined`/empty renders an empty state. */
126
- email: string | null | undefined;
127
- /** When `true`, a `mailto:` anchor wraps the address (default: `true`). */
128
- linkable?: boolean;
129
- };
130
- /**
131
- * Displays an email address in a table cell with a copy-to-clipboard button.
132
- * Shows a brief checkmark confirmation after copying. Optionally wraps the
133
- * address in a `mailto:` link. Renders {@link UITableEmpty} when `email` is
134
- * absent.
135
- *
136
- * @example
137
- * import { UITableEmailDisplay } from '@customafk/lunas-ui/features/tables';
138
- *
139
- * <UITableEmailDisplay email="jane@example.com" />
140
- */
141
- declare const UITableEmailDisplay: React.FC<Props$5>;
142
- //#endregion
143
- //#region packages/components/features/tables/components/atoms/list-display.d.ts
144
- /** Props for the {@link UITableListDisplay} component. */
145
- type Props$4 = {
146
- /** Array of strings or numbers to render as inline pills. */
147
- items: (string | number)[] | null | undefined;
148
- /**
149
- * Maximum number of pills shown before a `+N more` overflow badge appears
150
- * (default: `3`).
151
- */
152
- maxVisible?: number;
153
- };
154
- /**
155
- * Renders an array of values as compact inline pills in a table cell. When the
156
- * list exceeds `maxVisible`, a `+N more` badge is shown; hovering it reveals all
157
- * remaining items in a tooltip. Renders {@link UITableEmpty} for empty or absent
158
- * arrays.
159
- *
160
- * @example
161
- * import { UITableListDisplay } from '@customafk/lunas-ui/features/tables';
162
- *
163
- * <UITableListDisplay items={['React', 'TypeScript', 'TailwindCSS', 'Vite']} maxVisible={3} />
164
- */
165
- declare const UITableListDisplay: React.FC<Props$4>;
166
- //#endregion
167
- //#region packages/components/features/tables/components/atoms/more-button.d.ts
168
- /**
169
- * A vertical-ellipsis icon button that opens a dropdown menu populated from the
170
- * `items` array; intended for use in table row action columns.
171
- *
172
- * @example
173
- * import { UITableMoreButton } from '@customafk/lunas-ui/features/tables';
174
- *
175
- * <UITableMoreButton
176
- * items={[
177
- * { id: 'edit', label: 'Edit', onClick: (id) => console.log(id) },
178
- * { id: 'delete', label: 'Delete', onClick: (id) => console.log(id) },
179
- * ]}
180
- * />
181
- */
182
- declare const UITableMoreButton: React.FC<{
183
- /**
184
- * List of menu items to render inside the dropdown.
185
- * Each item must have a unique `id`, a display `label`, and an `onClick`
186
- * handler that receives the item's `id`.
187
- */
188
- items?: {
189
- id: string;
190
- label: string;
191
- onClick: (id: string) => void;
192
- }[];
193
- /** Reserved for future use; currently unused by the component. */
194
- onClick?: () => void;
195
- }>;
196
- //#endregion
197
- //#region packages/components/features/tables/components/atoms/name-display.d.ts
198
- /** Props for the {@link UITableNameDisplay} component. */
199
- type NameDisplayProps = {
200
- /** The name string to display; renders an empty placeholder when falsy. */
201
- name?: string | null | undefined;
202
- };
203
- /**
204
- * Renders a clamped, truncated name string inside a tooltip that shows the full
205
- * text and character count on hover; falls back to {@link UITableEmpty} when the
206
- * value is absent.
207
- *
208
- * @example
209
- * import { UITableNameDisplay } from '@customafk/lunas-ui/features/tables';
210
- *
211
- * <UITableNameDisplay name="John Doe" />
212
- */
213
- declare const UITableNameDisplay: React.FC<NameDisplayProps>;
214
- //#endregion
215
- //#region packages/components/features/tables/components/atoms/permalink.d.ts
216
- /**
217
- * Renders an external-link anchor with an icon for use in table cells, opening
218
- * the target URL in a new tab with safe `rel` attributes.
219
- *
220
- * @example
221
- * import { UITablePermalink } from '@customafk/lunas-ui/features/tables';
222
- *
223
- * <UITablePermalink href="https://example.com/records/42" label="View record" />
224
- */
225
- declare const UITablePermalink: React.FC<{
226
- /** The destination URL the anchor navigates to. */
227
- href: string;
228
- /** Optional display text; falls back to the raw `href` when omitted. */
229
- label?: string;
230
- }>;
231
- //#endregion
232
- //#region packages/components/features/tables/components/atoms/phone-number.d.ts
233
- /**
234
- * Formats and displays a phone number string in a table cell using the
235
- * `(NXX) NXX-XXXX` pattern, with a tooltip that shows the full international
236
- * dialling representation.
237
- *
238
- * @example
239
- * import { UITablePhoneNumberDisplay } from '@customafk/lunas-ui/features/tables';
240
- *
241
- * <UITablePhoneNumberDisplay value="0843456789" />
242
- */
243
- declare const UITablePhoneNumberDisplay: React.FC<React.PropsWithChildren<{
244
- /** The raw phone number string to format and display. */
245
- value: string;
246
- }>>;
247
- //#endregion
248
- //#region packages/components/features/tables/components/atoms/progress-display.d.ts
249
- /** Props for the {@link UITableProgressDisplay} component. */
250
- type Props$3 = {
251
- /** Percentage value between 0 and 100; `null`/`undefined` renders an empty state. */
252
- value: number | null | undefined;
253
- /** When `true`, shows the numeric percentage next to the bar (default: `true`). */
254
- showLabel?: boolean;
255
- /**
256
- * Color thresholds applied to the progress indicator.
257
- * - `≥ successThreshold` → green
258
- * - `≥ warningThreshold` → yellow
259
- * - otherwise → red
260
- *
261
- * Defaults: `successThreshold = 70`, `warningThreshold = 40`.
262
- */
263
- successThreshold?: number;
264
- warningThreshold?: number;
265
- };
266
- /**
267
- * Renders a horizontal progress bar with an optional percentage label for a
268
- * table cell. The bar color shifts from red → yellow → green based on
269
- * configurable thresholds. Renders {@link UITableEmpty} when `value` is absent.
270
- *
271
- * @example
272
- * import { UITableProgressDisplay } from '@customafk/lunas-ui/features/tables';
273
- *
274
- * <UITableProgressDisplay value={75} />
275
- */
276
- declare const UITableProgressDisplay: react286.MemoExoticComponent<({
277
- value,
278
- showLabel,
279
- successThreshold,
280
- warningThreshold
281
- }: Props$3) => react_jsx_runtime346.JSX.Element>;
282
- //#endregion
283
- //#region packages/components/features/tables/components/atoms/remove-button.d.ts
284
- /**
285
- * A ghost danger icon button with a trash icon that triggers an async removal
286
- * handler; displays a descriptive tooltip on hover to confirm the action intent.
287
- *
288
- * @example
289
- * import { UITableRemoveButton } from '@customafk/lunas-ui/features/tables';
290
- *
291
- * <UITableRemoveButton
292
- * title="Remove member from project"
293
- * onClick={async () => await deleteRow(rowId)}
294
- * />
295
- */
296
- declare const UITableRemoveButton: React.FC<{
297
- /** Tooltip label describing what will be removed; defaults to a generic message. */
298
- title?: string;
299
- /** Async-compatible callback invoked when the button is clicked. */
300
- onClick?: () => void | Promise<void>;
301
- }>;
302
- //#endregion
303
- //#region packages/components/features/tables/components/atoms/statistic.d.ts
304
- /** Props for the {@link UITableStatisticDisplay} component. */
305
- type Props$2 = {
306
- /** Character used to separate the integer and fractional parts (default: `'.'`). */
307
- decimalSeparator?: string;
308
- /** Character used to separate thousands groups (default: `','`). */
309
- groupSeparator?: string;
310
- /** Optional node rendered before the formatted number (e.g. a currency symbol). */
311
- prefix?: React.ReactNode;
312
- /** Optional node rendered after the formatted number (e.g. a unit label). */
313
- suffix?: React.ReactNode;
314
- /** Number of decimal digits to display. */
315
- precision?: number;
316
- /** Rounding strategy applied before formatting (default: `'round'`). */
317
- roundingMode?: 'round' | 'floor' | 'ceil';
318
- /** When `true`, pads the fractional part with trailing zeros up to `precision` digits. */
319
- showTrailingZeros?: boolean;
320
- /** Font-size variant for the displayed number (default: `'lg'`). */
321
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
322
- /** The numeric or string value to format; falsy / invalid values render an empty state. */
323
- value: number | string | null | undefined;
324
- };
325
- /**
326
- * A memoized table-cell component that formats a numeric value with configurable
327
- * separators, precision, rounding, and size; renders {@link UITableEmpty} when
328
- * the value is zero, invalid, or absent.
329
- *
330
- * @example
331
- * import { UITableStatisticDisplay } from '@customafk/lunas-ui/features/tables';
332
- *
333
- * <UITableStatisticDisplay value={1234567.89} precision={2} prefix="$" size="md" />
334
- */
335
- declare const UITableStatisticDisplay: react286.MemoExoticComponent<({
336
- decimalSeparator,
337
- groupSeparator,
338
- prefix: Prefix,
339
- suffix: Suffix,
340
- precision,
341
- roundingMode,
342
- showTrailingZeros,
343
- size,
344
- value
345
- }: Props$2) => react_jsx_runtime346.JSX.Element>;
346
- //#endregion
347
- //#region packages/components/features/tables/components/atoms/status-display.d.ts
348
- type BadgeColor = 'primary' | 'secondary' | 'muted' | 'accent' | 'info' | 'success' | 'warning' | 'danger';
349
- /** Props for the {@link UITableStatusDisplay} component. */
350
- type Props$1 = {
351
- /** The status string to display; `null`/`undefined` renders an empty state. */
352
- value: string | null | undefined;
353
- /**
354
- * Maps each status string to a badge color. Any key not present in the map
355
- * falls back to `defaultColor`.
356
- */
357
- colorMap?: Record<string, BadgeColor>;
358
- /** Color used when `value` is not found in `colorMap` (default: `'muted'`). */
359
- defaultColor?: BadgeColor;
360
- /** Badge variant forwarded to the underlying {@link Badge} (default: `'soft'`). */
361
- variant?: 'solid' | 'soft' | 'outline';
362
- };
363
- /**
364
- * Renders a color-coded status badge for a table cell. The mapping from status
365
- * string to badge color is fully configurable via `colorMap`; unknown statuses
366
- * fall back to `defaultColor`.
367
- *
368
- * @example
369
- * import { UITableStatusDisplay } from '@customafk/lunas-ui/features/tables';
370
- *
371
- * <UITableStatusDisplay
372
- * value="active"
373
- * colorMap={{ active: 'success', inactive: 'danger', pending: 'warning' }}
374
- * />
375
- */
376
- declare const UITableStatusDisplay: React.FC<Props$1>;
377
- //#endregion
378
- //#region packages/components/features/tables/components/atoms/user.d.ts
379
- /** Props for the {@link UITableUserDataDisplay} component. */
380
- type Props = {
381
- /** Unique identifier used to deterministically generate the avatar background colour. */
382
- uuid?: string | null | undefined;
383
- /** Display name shown below the avatar; falls back to `'Unknown User'` when absent. */
384
- username?: string | null | undefined;
385
- /** Email address shown as secondary text beneath the username. */
386
- email?: string | null | undefined;
387
- };
388
- /**
389
- * Renders a user avatar paired with username and email for use in table cells;
390
- * derives a consistent avatar background colour from the user's `uuid` via a
391
- * colour-hash utility.
392
- *
393
- * @example
394
- * import { UITableUserDataDisplay } from '@customafk/lunas-ui/features/tables';
395
- *
396
- * <UITableUserDataDisplay
397
- * uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890"
398
- * username="Jane Smith"
399
- * email="jane@example.com"
400
- * />
401
- */
402
- declare const UITableUserDataDisplay: React.FC<Props>;
403
- //#endregion
404
- //#region packages/components/features/tables/types.d.ts
405
- /**
406
- * Base constraint for all row data objects used with UITable.
407
- *
408
- * Any property key is allowed so that generic column definitions remain
409
- * flexible, but the optional `subRows` field is the well-known expansion
410
- * hook understood by TanStack Table's grouped-row model.
411
- */
412
- type RowData<TData extends RowData<AnyEntity>> = {
413
- /** Allows any property key so column `accessorKey` values type-check. */
414
- [x: string | number | symbol]: AnyEntity;
415
- /** Nested child rows used by the grouped/expanded row model. */
416
- subRows?: TData[] | undefined;
417
- };
418
- /** Props for `UITableEmptyDisplay` — controls which placeholder state is shown. */
419
- type TUITableEmptyDisplay = {
420
- /** When `true` a loading spinner is shown instead of the empty-box illustration. */
421
- isFetching?: boolean;
422
- /** When `true` (and `isFetching` is `false`) the "No data available" illustration is shown. */
423
- isEmpty?: boolean;
424
- };
425
- /** Props for `UITableWrapper` — all native `<div>` attributes are forwarded. */
426
- type TUITableWrapper = React.PropsWithChildren<React.ComponentProps<'div'>>;
427
- /** Props for `UITableInnerWrapper` — all native `<div>` attributes are forwarded. */
428
- type TUITableInnerWrapper = React.PropsWithChildren<React.ComponentProps<'div'>>;
429
- /** Props for `UITableInnerTable` — all native `<table>` attributes are forwarded. */
430
- type TUITableInnerTable = React.PropsWithChildren<React.ComponentProps<'table'>>;
431
- /** Props for `UITableHead` — all native `<thead>` attributes are forwarded. */
432
- type TUITableHead = React.PropsWithChildren<React.ComponentProps<'thead'>>;
433
- /** Props for `UITableHeadCellOption` — the pin/unpin dropdown on a header cell. */
434
- type TUITableHeadCellOption = {
435
- /** Current pinning position of the column (`'left'`, `'right'`, or `false`). */
436
- isPinned?: ColumnPinningPosition;
437
- /** Whether the column is currently visible; reserved for future hide/show actions. */
438
- isVisible?: boolean;
439
- /** Additional CSS classes applied to the dropdown trigger button. */
440
- className?: string;
441
- /** Called with `'left'` when the user selects "Pin to Left". */
442
- onLeftPin?: (pos: ColumnPinningPosition) => void;
443
- /** Called with `'right'` when the user selects "Pin to Right". */
444
- onRightPin?: (pos: ColumnPinningPosition) => void;
445
- /** Called with `false` when the user selects "Unpin". */
446
- onUnpin?: (pos: ColumnPinningPosition) => void;
447
- /** Called when the user toggles column visibility via the dropdown. */
448
- onToggleVisibility?: (props: AnyEntity) => void;
449
- };
450
- /** Props for `UITableHeadCellSelect` — the "select all rows" header checkbox cell. */
451
- type TUITableHeadCellSelect = React.ComponentProps<'th'> & {
452
- /** Whether the column is pinned to a side (the select cell is always sticky). */
453
- isPinned?: ColumnPinningPosition;
454
- /** Reflects `table.getIsAllRowsSelected()` to set the checkbox state. */
455
- isAllRowsSelected?: boolean;
456
- /** Calls `table.toggleAllRowsSelected` when the checkbox value changes. */
457
- onToggleAllRowsSelected?: (value?: boolean) => void;
458
- };
459
- /** Props for `UITableHeadRow` — a single header `<tr>` built from a TanStack `HeaderGroup`. */
460
- type TUITableHeadRow = React.PropsWithChildren<React.ComponentProps<'tr'> & {
461
- /** The TanStack `HeaderGroup` whose `headers` are rendered as `<th>` cells. */
462
- headerGroup: HeaderGroup<unknown>;
463
- /** Forwarded to `UITableHeadCellSelect`; toggles all-row selection. */
464
- onToggleAllRowsSelected?: (value?: boolean) => void;
465
- }>;
466
- /** Props for `UITableHeadCell` — a single data `<th>` with pinning and resize support. */
467
- type TUITableHeadCell = React.PropsWithChildren<React.ComponentProps<'th'> & {
468
- /** Whether the column is currently visible (used for future hide/show UI). */
469
- isVisible?: boolean;
470
- /** Current pinning position (`'left'`, `'right'`, or `false`). */
471
- isPinned?: ColumnPinningPosition;
472
- /** `true` when this is the first cell in the right-pinned group (adds a left border). */
473
- isFirstCell?: boolean;
474
- /** `true` when this is the last cell in the left-pinned group (adds a right border). */
475
- isLastCell?: boolean;
476
- /** When `false` the pin/unpin option dropdown is hidden (e.g. `actions` column). */
477
- isOptionsVisible?: boolean;
478
- /** Column id used to look up the CSS custom property `--header-<id>-size`. */
479
- headerId?: string;
480
- /** TanStack `Column` instance used to derive `left`/`right` sticky offsets and size constraints. */
481
- headerColumn?: Column<unknown, unknown>;
482
- /** Calls `column.pin` with the chosen `ColumnPinningPosition`. */
483
- onColumnPin?: (pos: ColumnPinningPosition) => void;
484
- /** Calls `column.toggleVisibility` when hide/show is triggered from the dropdown. */
485
- onToggleVisibility?: (value?: boolean) => void;
486
- }>;
487
- /** Props for `UITableBody` — the virtual-scroll `<tbody>` container. */
488
- type TUITableBody = React.PropsWithChildren<React.ComponentProps<'tbody'> & {
489
- /** When `true` the body renders `null` (loading state is handled by `UITableEmptyDisplay`). */
490
- isFetching?: boolean;
491
- /** When `true` the body renders `null` (empty state is handled by `UITableEmptyDisplay`). */
492
- isEmpty?: boolean;
493
- /** CSS string for the total virtual height of all rows, e.g. `"4200px"`. */
494
- height: string;
495
- }>;
496
- /** Props for `UITableRow` — a single virtualised data `<tr>`. */
497
- type TUITableRow = React.ComponentProps<'tr'> & {
498
- /** The TanStack `Row` object whose visible cells are iterated. */
499
- row: Row<AnyEntity>;
500
- /** Whether this row is currently selected (drives `data-selected` attribute). */
501
- isSelected?: boolean;
502
- /** Zero-based virtual row index used for `data-index` and passed to `onClickRow`. */
503
- virtualRowIndex: number;
504
- /** Pixel offset from the top of the scroll container for the CSS `translateY`. */
505
- virtualRowStart: number;
506
- };
507
- /** Props for `UITableCellSelect` — the per-row selection checkbox `<td>`. */
508
- type TUITableCellSelect = React.ComponentProps<'td'> & {
509
- /** Pinning position; the select cell is always rendered sticky regardless. */
510
- isPinned?: ColumnPinningPosition;
511
- /** Whether the checkbox should appear checked. */
512
- isSelected?: boolean;
513
- /** Calls `row.toggleSelected` when the checkbox value changes. */
514
- onToggleRowSelected?: (value?: boolean) => void;
515
- };
516
- /** Props for `UITableCellActions` — the sticky right-edge actions `<td>`. */
517
- type TUITableCellActions = React.ComponentProps<'td'> & {
518
- /** Virtual row index forwarded to the cell renderer via `data-cell`. */
519
- virtualRowIndex: number;
520
- /** TanStack `Column` whose `columnDef.cell` is rendered inside the `<td>`. */
521
- column?: Column<unknown, unknown>;
522
- /** Returns the `CellContext` passed to `flexRender`. */
523
- getContext: () => CellContext<unknown, unknown>;
524
- };
525
- /** Props for `UITableCell` — a standard data `<td>` with pinning and sizing support. */
526
- type TUITableCell = React.ComponentProps<'td'> & {
527
- /** Current pinning position of the column. */
528
- isPinned?: ColumnPinningPosition;
529
- /** `true` when this is the first cell in the right-pinned group (adds a left border separator). */
530
- isFirstCell?: boolean;
531
- /** `true` when this is the last cell in the left-pinned group (adds a right border separator). */
532
- isLastCell?: boolean;
533
- /** Column id used to read `--col-<id>-size` CSS custom property for width. */
534
- colId?: string;
535
- /** Unused reserved field for a future per-cell identifier. */
536
- cellId?: string;
537
- /** Horizontal alignment of the cell content (`'start'` is the default). */
538
- position?: 'start' | 'center' | 'end';
539
- /** TanStack `Column` instance used to derive sticky offsets and content-fit sizing. */
540
- column?: Column<unknown, unknown>;
541
- /** Returns the `CellContext` passed to `flexRender`. */
542
- getContext: () => CellContext<unknown, unknown>;
543
- };
544
- /** Props for `UITableFooter` — all native `<tfoot>` attributes are forwarded. */
545
- type TUITableFooter = React.PropsWithChildren<React.ComponentProps<'tfoot'>>;
546
- /** Props for `UITableLoadMore` — the append-row "load more" trigger. */
547
- type TUITableLoadMore = React.PropsWithChildren<React.ComponentProps<'tr'> & {
548
- /** Virtual index of this synthetic row (appended after the last data row). */
549
- virtualRowIndex: number;
550
- /** Pixel offset used for the CSS `translateY` to position the row correctly. */
551
- virtualRowStart: number;
552
- /**
553
- * Async callback that fetches the next page of data.
554
- * When omitted the component renders `null`.
555
- */
556
- fetchMoreData?: () => void | Promise<void>;
557
- }>;
558
- /**
559
- * Typed column definition accepted by `UITableProvider`.
560
- *
561
- * Extends TanStack's `AccessorKeyColumnDef` with a typed `meta` block so that
562
- * the alignment and auto-fit behaviour can be specified in a type-safe manner.
563
- */
564
- type TUITableColumn<TData extends RowData<TData>> = Pick<AccessorKeyColumnDef<TData, AnyEntity>, 'id' | 'accessorKey' | 'size' | 'maxSize' | 'minSize' | 'header' | 'cell' | 'meta'> & {
565
- meta?: {
566
- /** Horizontal alignment of the column's cells and header. Defaults to `'start'`. */
567
- position?: 'start' | 'center' | 'end';
568
- /** When `true`, the cell auto-expands to fit its rendered content width. */
569
- fitContent?: boolean;
570
- };
571
- };
572
- /** A single cell in a CSV export row. */
573
- type CsvCell = {
574
- /** Column header label for this cell. */
575
- label: string;
576
- /** Cell value — numbers render right-aligned in spreadsheet editors. */
577
- value: string | number | boolean | null | undefined;
578
- };
579
- /**
580
- * Value shape of the root `TableContext` consumed by toolbar and body
581
- * components via `useUITableContext`.
582
- */
583
- type TTableContext<TData extends RowData<TData>> = {
584
- /** Human-readable table title rendered in `UITableTooltip`. */
585
- title: string;
586
- /** The TanStack `Table` instance for the current dataset. */
587
- table: Table<TData>;
588
- /** `true` when no rows exist after a successful (non-loading) fetch. */
589
- isEmpty: boolean;
590
- /** `true` while the initial data fetch is in-flight. */
591
- isFetching?: boolean;
592
- /** `true` while a background refetch is running (data is already present). */
593
- isRefetching?: boolean;
594
- /** Total number of rows in the remote dataset, used for virtual scroll height. */
595
- totalRows?: number;
596
- /** Callback that loads the next page; forwarded to `UITableLoadMore`. */
597
- fetchMoreData?: () => void | Promise<void>;
598
- /** CSV export rows; each row is an ordered array of `{ label, value }` cells. */
599
- csvData?: CsvCell[][];
600
- /** File name (without `.csv`) for the downloaded file. Defaults to the table title. */
601
- csvFileName?: string;
602
- /** Definitions of all filterable fields shown in the "Add Filter" dropdown. */
603
- filterDefinitions?: FilterDefinition[];
604
- /** Called with the full list of active filters whenever filters are added, removed, or updated. */
605
- onFilterChange?: (filters: ActiveFilter[]) => void;
606
- };
607
- /** Context value provided by `UITableInnerWrapperProvider`. */
608
- type TTableInnerWrapperContext = {
609
- /** Stable `useId`-generated id on the scrollable inner wrapper `<div>`. */
610
- innerWrapperId: string;
611
- };
612
- /** Context value provided by `UITableInnerTableProvider`. */
613
- type TTableInnerTableContext = {
614
- /** The TanStack `Table` instance (typed as `AnyEntity` for the context boundary). */
615
- table: Table<AnyEntity>;
616
- /** Stable `useId`-generated id on the `<table>` element. */
617
- innerTableId: string;
618
- /** Pre-computed sum of all column sizes used as the `<table>` `minWidth`. */
619
- totalSize: number;
620
- };
621
- /** Context value provided by `UITableHeadRowProvider`. */
622
- type TTableHeadRowContext = {
623
- /** Whether every visible row is currently selected. */
624
- isAllRowsSelected: boolean;
625
- /** The current `{ left, right }` column pinning map. */
626
- columnPinningState: ColumnPinningState;
627
- /** Ordered list of `Header` objects in the left-pinned group. */
628
- leftPinnedHeaders: Header<AnyEntity, unknown>[];
629
- /** Ordered list of `Header` objects in the right-pinned group. */
630
- rightPinnedHeaders: Header<AnyEntity, unknown>[];
631
- /** Toggles all-row selection; delegates to `table.toggleAllRowsSelected`. */
632
- onToggleAllRowsSelected?: (value?: boolean) => void;
633
- };
634
- /** Context value provided by `UITableBodyProvider`. */
635
- type TTableBodyContext = {
636
- /** `true` while data is loading; causes `UITableBody` to render `null`. */
637
- isFetching: boolean;
638
- /** `true` when there are no rows after a successful fetch. */
639
- isEmpty: boolean;
640
- /** The current `Record<rowId, boolean>` row-selection map from TanStack state. */
641
- rowSelectionState: RowSelectionState;
642
- };
643
- /** Context value provided by `UITableRowProvider`, consumed by individual `UITableRow` renders. */
644
- type TTableRowContext<TData extends RowData<TData> = RowData<AnyEntity>, TKey extends keyof TData = keyof TData> = {
645
- /** The data key whose value is passed as the second argument to `onClickRow`. */
646
- keyOfClickRow?: TKey;
647
- /** Whether all rows are selected (drives the select cell's checked state). */
648
- isAllRowsSelected?: boolean;
649
- /** The current `{ left, right }` column pinning map used by each cell. */
650
- columnPinningState: ColumnPinningState;
651
- /** Called with the virtual row index and the extracted `keyOfClickRow` value. */
652
- onClickRow?: (rowIndex: number, rowId?: AnyEntity) => void;
653
- /** Left-pinned headers used to determine border separator placement. */
654
- leftPinnedHeaders?: Header<TData, unknown>[];
655
- /** Right-pinned headers used to determine border separator placement. */
656
- rightPinnedHeaders?: Header<TData, unknown>[];
657
- };
658
- /** Context value for the virtualiser, shared between the body and the load-more row. */
659
- type TTableVirtualizerContext = {
660
- /** The TanStack Virtual `Virtualizer` instance driving row windowing. */
661
- rowVirtualizer: Virtualizer<HTMLDivElement, HTMLTableRowElement>;
662
- /** The currently visible `VirtualItem` slice (index + start offset for each row). */
663
- virtualItems: VirtualItem[];
664
- };
665
- /**
666
- * Props accepted by `UITableProvider` — the single entry point for configuring
667
- * a UITable instance.
668
- *
669
- * @example
670
- * ```tsx
671
- * import { UITableProvider } from '@customafk/lunas-ui/features/tables';
672
- *
673
- * <UITableProvider<User>
674
- * title="Users"
675
- * data={users}
676
- * columns={columns}
677
- * totalRows={total}
678
- * isFetching={isLoading}
679
- * leftPinnedColumns={['name']}
680
- * onClickRow={(index, id) => openDetail(id)}
681
- * onRowSelection={sel => setSelected(sel)}
682
- * fetchMoreData={fetchNextPage}
683
- * >
684
- * <UITable />
685
- * </UITableProvider>
686
- * ```
687
- */
688
- type TableProviderProps<TData extends RowData<TData>, TKey extends keyof TData = keyof TData, TColumns extends ReadonlyArray<TUITableColumn<TData>> = TUITableColumn<TData>[]> = {
689
- /** Human-readable label shown in `UITableTooltip`. */
690
- title: string;
691
- /** Pass `true` while the initial page of data is being fetched. */
692
- isFetching?: boolean;
693
- /** Pass `true` while a background refetch is running (stale data remains visible). */
694
- isRefetching?: boolean;
695
- /** The current page / slice of row data. */
696
- data: TData[];
697
- /** Typed column definitions; use `TUITableColumn<TData>` for full type safety. */
698
- columns: TColumns;
699
- /** Total number of rows in the remote dataset; required for accurate virtual-scroll height. */
700
- totalRows?: number;
701
- /**
702
- * Async callback invoked by `UITableLoadMore` when the user scrolls to the
703
- * bottom or clicks "Load More". Omit to hide the load-more row entirely.
704
- */
705
- fetchMoreData?: () => void | Promise<void>;
706
- /** Column accessor keys to pin on the left (the `select` column is always pinned left). */
707
- leftPinnedColumns?: Array<TColumns[number]['accessorKey']>;
708
- /** Column accessor keys (or plain string ids) to pin on the right. */
709
- rightPinnedColumns?: Array<TColumns[number]['accessorKey']> | string[];
710
- /** Data key whose value is extracted and passed as the second argument of `onClickRow`. */
711
- keyOfClickRow?: TTableRowContext<TData, TKey>['keyOfClickRow'];
712
- /** Called with the virtual row index and the value of `keyOfClickRow` when a row is clicked. */
713
- onClickRow?: TTableRowContext<TData, TKey>['onClickRow'];
714
- /** Called with the updated row-selection map after each selection change. */
715
- onRowSelection?: (rowSelection: RowSelectionState) => void;
716
- /** Called with the updated column-pinning state after each pin/unpin action. */
717
- onColumnPinning?: (columnPinning: ColumnPinningState) => void;
718
- /** CSV export rows; each row is an ordered array of `{ label, value }` cells. */
719
- csvData?: CsvCell[][];
720
- /** File name (without `.csv`) for the downloaded file. Defaults to the table title. */
721
- csvFileName?: string;
722
- /** Definitions of all filterable fields shown in the "Add Filter" dropdown. */
723
- filterDefinitions?: FilterDefinition[];
724
- /** Called with the full list of active filters whenever filters are added, removed, or updated. */
725
- onFilterChange?: (filters: ActiveFilter[]) => void;
726
- };
727
- type FilterType = 'tag' | 'date-range' | 'number' | 'text' | 'boolean';
728
- /** A selectable option for tag/enum filters. */
729
- type FilterOption = {
730
- label: string;
731
- value: string;
732
- };
733
- /**
734
- * Declares a filterable field available in the "Add Filter" dropdown.
735
- * `options` is required when `type === 'tag'`.
736
- */
737
- type FilterDefinition = {
738
- id: string;
739
- label: string;
740
- type: FilterType;
741
- options?: FilterOption[];
742
- };
743
- type TagFilterValue = {
744
- type: 'tag';
745
- values: string[];
746
- };
747
- type DateRangeFilterValue = {
748
- type: 'date-range';
749
- /** ISO date string, e.g. `"2024-01-01"`. */
750
- from?: string;
751
- to?: string;
752
- };
753
- type NumberFilterValue = {
754
- type: 'number';
755
- operator: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'between';
756
- value?: number;
757
- valueTo?: number;
758
- };
759
- type TextFilterValue = {
760
- type: 'text';
761
- operator: 'contains' | 'equals' | 'starts-with' | 'ends-with';
762
- value: string;
763
- };
764
- type BooleanFilterValue = {
765
- type: 'boolean';
766
- value: boolean | null;
767
- };
768
- type FilterValue = TagFilterValue | DateRangeFilterValue | NumberFilterValue | TextFilterValue | BooleanFilterValue;
769
- /** An active (added) filter instance with its current value. */
770
- type ActiveFilter = {
771
- /** Unique instance id for this filter entry. */
772
- id: string;
773
- /** References a `FilterDefinition.id`. */
774
- definitionId: string;
775
- value: FilterValue;
776
- };
777
- /** Context value exposed by `UITableProvider` for the filter panel. */
778
- type TTableFilterContext = {
779
- filterDefinitions: FilterDefinition[];
780
- activeFilters: ActiveFilter[];
781
- addFilter: (definitionId: string) => void;
782
- removeFilter: (filterId: string) => void;
783
- updateFilter: (filterId: string, value: FilterValue) => void;
784
- };
785
- //#endregion
786
- //#region packages/components/features/tables/components/common.d.ts
787
- /**
788
- * Ellipsis dropdown menu attached to a header cell that lets the user pin the
789
- * column to the left, pin it to the right, or unpin it.
790
- *
791
- * The trigger button is invisible until the parent `<th>` is hovered
792
- * (`group-hover:opacity-100`), keeping the header clean by default.
793
- *
794
- * @example
795
- * ```tsx
796
- * import { UITableHeadCellOption } from '@customafk/lunas-ui/features/tables';
797
- *
798
- * <UITableHeadCellOption
799
- * isPinned="left"
800
- * onLeftPin={col.pin}
801
- * onRightPin={col.pin}
802
- * onUnpin={col.pin}
803
- * />
804
- * ```
805
- */
806
- declare const UITableHeadCellOption: react286.NamedExoticComponent<TUITableHeadCellOption>;
807
- /**
808
- * Sticky `<th>` cell that renders a "select all rows" checkbox in the leftmost
809
- * header position.
810
- *
811
- * The cell is always pinned at `left: 0` and uses a fixed width of
812
- * `SELECT_WIDTH` to align with the corresponding body select cells.
813
- *
814
- * @example
815
- * ```tsx
816
- * import { UITableHeadCellSelect } from '@customafk/lunas-ui/features/tables';
817
- *
818
- * <UITableHeadCellSelect
819
- * isPinned="left"
820
- * isAllRowsSelected={table.getIsAllRowsSelected()}
821
- * onToggleAllRowsSelected={table.toggleAllRowsSelected}
822
- * />
823
- * ```
824
- */
825
- declare const UITableHeadCellSelect: react286.NamedExoticComponent<TUITableHeadCellSelect>;
826
- /**
827
- * Overlay displayed in place of table rows when the table is loading data or
828
- * when the dataset is empty after a successful fetch.
829
- *
830
- * Returns `null` when neither `isEmpty` nor `isFetching` is true, so it adds
831
- * zero DOM overhead during normal rendering.
832
- *
833
- * @example
834
- * ```tsx
835
- * import { UITableEmptyDisplay } from '@customafk/lunas-ui/features/tables';
836
- *
837
- * <UITableEmptyDisplay isFetching={isLoading} isEmpty={data.length === 0} />
838
- * ```
839
- */
840
- declare const UITableEmptyDisplay: react286.NamedExoticComponent<TUITableEmptyDisplay>;
841
- /**
842
- * Outermost layout container for the entire UITable composition.
843
- *
844
- * Renders a full-width, full-height flex column that positions the toolbar,
845
- * the scrollable table area, and the footer in a single stack.
846
- *
847
- * @example
848
- * ```tsx
849
- * import { UITableWrapper } from '@customafk/lunas-ui/features/tables';
850
- *
851
- * <UITableWrapper className="h-[600px]">
852
- * {children}
853
- * </UITableWrapper>
854
- * ```
855
- */
856
- declare const UITableWrapper: react286.NamedExoticComponent<TUITableWrapper>;
857
- /**
858
- * Scrollable `<div>` that wraps the `<table>` element and acts as the
859
- * viewport for both horizontal and vertical virtual scrolling.
860
- *
861
- * Reads its stable id from `UITableInnerWrapperContext` so that other
862
- * components (e.g. `UITableLoadMore`) can reference the DOM node via
863
- * `document.querySelector` without prop-drilling.
864
- *
865
- * @example
866
- * ```tsx
867
- * import { UITableInnerWrapper } from '@customafk/lunas-ui/features/tables';
868
- *
869
- * <UITableInnerWrapper>
870
- * <UITableInnerTable>…</UITableInnerTable>
871
- * </UITableInnerWrapper>
872
- * ```
873
- */
874
- declare const UITableInnerWrapper: react286.NamedExoticComponent<TUITableInnerWrapper>;
875
- /**
876
- * The actual `<table>` element that drives the UITable layout.
877
- *
878
- * Attaches a `ResizeObserver` to the table element and calculates per-column
879
- * CSS custom properties (`--header-<id>-size`, `--col-<id>-size`) in a single
880
- * pass on every resize, avoiding expensive per-cell `column.getSize()` calls.
881
- * Flexible columns share the remaining width equally; fixed-size and pinned
882
- * columns are excluded from the distribution.
883
- *
884
- * @example
885
- * ```tsx
886
- * import { UITableInnerTable } from '@customafk/lunas-ui/features/tables';
887
- *
888
- * <UITableInnerTable>
889
- * <UITableHead>…</UITableHead>
890
- * <UITableBody height="600px">…</UITableBody>
891
- * </UITableInnerTable>
892
- * ```
893
- */
894
- declare const UITableInnerTable: react286.NamedExoticComponent<TUITableInnerTable>;
895
- /**
896
- * Sticky `<thead>` element that stays fixed at the top of the scrollable
897
- * table area while the body scrolls beneath it.
898
- *
899
- * Applies column-border, background, and font styling uniformly to all
900
- * descendant `<th>` elements via Tailwind child selectors.
901
- *
902
- * @example
903
- * ```tsx
904
- * import { UITableHead } from '@customafk/lunas-ui/features/tables';
905
- *
906
- * <UITableHead>
907
- * {table.getHeaderGroups().map(hg => (
908
- * <UITableHeadRow key={hg.id} headerGroup={hg} />
909
- * ))}
910
- * </UITableHead>
911
- * ```
912
- */
913
- declare const UITableHead: react286.NamedExoticComponent<TUITableHead>;
914
- /**
915
- * Renders a single `<tr>` for a TanStack `HeaderGroup`, mapping each header
916
- * to either `UITableHeadCellSelect` (for the `select` column) or
917
- * `UITableHeadCell` (for all other columns).
918
- *
919
- * Reads pinning state and "select all" handler from `UITableHeadRowContext`
920
- * so the row itself does not need to receive those as props.
921
- *
922
- * @example
923
- * ```tsx
924
- * import { UITableHeadRow } from '@customafk/lunas-ui/features/tables';
925
- *
926
- * {table.getHeaderGroups().map(hg => (
927
- * <UITableHeadRow key={hg.id} headerGroup={hg} />
928
- * ))}
929
- * ```
930
- */
931
- declare const UITableHeadRow: react286.NamedExoticComponent<TUITableHeadRow>;
932
- /**
933
- * Individual `<th>` cell that supports left/right sticky pinning, dynamic
934
- * CSS-variable-driven width, min/max size constraints, and an optional
935
- * `UITableHeadCellOption` pin/unpin dropdown.
936
- *
937
- * Width is driven by the CSS custom property `--header-<headerId>-size` set
938
- * by `UITableInnerTable`, avoiding per-cell `column.getSize()` calls.
939
- *
940
- * @example
941
- * ```tsx
942
- * import { UITableHeadCell } from '@customafk/lunas-ui/features/tables';
943
- *
944
- * <UITableHeadCell
945
- * headerId={header.id}
946
- * headerColumn={header.column}
947
- * isPinned="left"
948
- * isLastCell
949
- * onColumnPin={header.column.pin}
950
- * >
951
- * {flexRender(header.column.columnDef.header, header.getContext())}
952
- * </UITableHeadCell>
953
- * ```
954
- */
955
- declare const UITableHeadCell: react286.NamedExoticComponent<TUITableHeadCell>;
956
- /**
957
- * `<tbody>` element that acts as the virtual-scroll container.
958
- *
959
- * Renders `null` while data is loading or the table is empty (the
960
- * `UITableEmptyDisplay` overlay handles those states instead). The `height`
961
- * prop must be supplied as the total height of all virtual rows so that the
962
- * scroll track reflects the full dataset length.
963
- *
964
- * @example
965
- * ```tsx
966
- * import { UITableBody } from '@customafk/lunas-ui/features/tables';
967
- *
968
- * <UITableBody height={`${rowVirtualizer.getTotalSize()}px`}>
969
- * {virtualItems.map(vRow => (
970
- * <UITableRow key={vRow.index} … />
971
- * ))}
972
- * </UITableBody>
973
- * ```
974
- */
975
- declare const UITableBody: react286.NamedExoticComponent<TUITableBody>;
976
- /**
977
- * Virtualised `<tr>` that renders a single data row by translating itself to
978
- * the correct vertical position via a CSS `transform`.
979
- *
980
- * Iterates the row's visible cells and delegates to `UITableCellActions`,
981
- * `UITableCellSelect`, or `UITableCell` based on the column id. Click
982
- * handling, pinning state, and the "select all" flag are sourced from
983
- * `UITableRowContext`.
984
- *
985
- * @example
986
- * ```tsx
987
- * import { UITableRow } from '@customafk/lunas-ui/features/tables';
988
- *
989
- * {virtualItems.map(vRow => {
990
- * const row = rows[vRow.index];
991
- * return (
992
- * <UITableRow
993
- * key={row.id}
994
- * row={row}
995
- * isSelected={row.getIsSelected()}
996
- * virtualRowIndex={vRow.index}
997
- * virtualRowStart={vRow.start}
998
- * />
999
- * );
1000
- * })}
1001
- * ```
1002
- */
1003
- declare const UITableRow: react286.NamedExoticComponent<TUITableRow>;
1004
- /**
1005
- * Sticky `<td>` cell in the leftmost column that renders a per-row selection
1006
- * checkbox.
1007
- *
1008
- * The cell stops click-event propagation so that selecting a row does not also
1009
- * trigger the row's `onClickRow` handler.
1010
- *
1011
- * @example
1012
- * ```tsx
1013
- * import { UITableCellSelect } from '@customafk/lunas-ui/features/tables';
1014
- *
1015
- * <UITableCellSelect
1016
- * isPinned="left"
1017
- * isSelected={row.getIsSelected()}
1018
- * onToggleRowSelected={row.toggleSelected}
1019
- * />
1020
- * ```
1021
- */
1022
- declare const UITableCellSelect: react286.NamedExoticComponent<TUITableCellSelect>;
1023
- /**
1024
- * Sticky `<td>` cell pinned to the right edge of each row that renders the
1025
- * column's custom `cell` renderer (typically a row-action menu).
1026
- *
1027
- * The cell is always sticky (`right: 0`, `z-index: 50`) and gains a hover
1028
- * background via the `group-hover` Tailwind variant on the parent `<tr>`.
1029
- *
1030
- * @example
1031
- * ```tsx
1032
- * import { UITableCellActions } from '@customafk/lunas-ui/features/tables';
1033
- *
1034
- * <UITableCellActions
1035
- * virtualRowIndex={vRow.index}
1036
- * column={cell.column}
1037
- * getContext={cell.getContext}
1038
- * />
1039
- * ```
1040
- */
1041
- declare const UITableCellActions: react286.NamedExoticComponent<TUITableCellActions>;
1042
- /**
1043
- * Standard `<td>` data cell with support for left/right sticky pinning,
1044
- * CSS-variable-driven width, content-fit auto-sizing, and configurable
1045
- * horizontal alignment (`start` | `center` | `end`).
1046
- *
1047
- * A `ResizeObserver` on the inner content div measures actual rendered content
1048
- * width and calls `table.setColumnSizing` when the content overflows the
1049
- * column's current size, but only when the column definition has
1050
- * `meta.fitContent: true`.
1051
- *
1052
- * @example
1053
- * ```tsx
1054
- * import { UITableCell } from '@customafk/lunas-ui/features/tables';
1055
- *
1056
- * <UITableCell
1057
- * colId={cell.column.id}
1058
- * isPinned="left"
1059
- * position="start"
1060
- * column={cell.column}
1061
- * getContext={cell.getContext}
1062
- * />
1063
- * ```
1064
- */
1065
- declare const UITableCell: react286.NamedExoticComponent<TUITableCell>;
1066
- /**
1067
- * `<tfoot>` element rendered below the table body, typically used for
1068
- * summary rows or pagination controls.
1069
- *
1070
- * @example
1071
- * ```tsx
1072
- * import { UITableFooter } from '@customafk/lunas-ui/features/tables';
1073
- *
1074
- * <UITableFooter>
1075
- * <tr><td>Total: {totalRows}</td></tr>
1076
- * </UITableFooter>
1077
- * ```
1078
- */
1079
- declare const UITableFooter: react286.NamedExoticComponent<TUITableFooter>;
1080
- /**
1081
- * Virtualised `<tr>` appended after the last data row that renders a
1082
- * "Load More" / "Loading…" / "Error! Retry?" button.
1083
- *
1084
- * Returns `null` when `fetchMoreData` is not provided, making it safe to
1085
- * include unconditionally in the row list. A `ResizeObserver` on the inner
1086
- * wrapper ensures the row always matches the current table width.
1087
- *
1088
- * @example
1089
- * ```tsx
1090
- * import { UITableLoadMore } from '@customafk/lunas-ui/features/tables';
1091
- *
1092
- * <UITableLoadMore
1093
- * virtualRowIndex={rows.length}
1094
- * virtualRowStart={rowVirtualizer.getTotalSize()}
1095
- * fetchMoreData={fetchNextPage}
1096
- * />
1097
- * ```
1098
- */
1099
- declare const UITableLoadMore: react286.NamedExoticComponent<TUITableLoadMore>;
1100
- //#endregion
1101
- //#region packages/components/features/tables/components/table.d.ts
1102
- declare const UITableContainer: React.FC<React.PropsWithChildren>;
1103
- //#endregion
1104
- //#region packages/components/features/tables/components/table/filter.d.ts
1105
- /**
1106
- * Collapsible side-panel that lets users toggle column visibility and build
1107
- * row filters without leaving the table view.
1108
- *
1109
- * The panel collapses to a narrow icon strip when no tab is active and expands
1110
- * to at least 64 units when the "Columns" or "Filters" tab is selected.
1111
- *
1112
- * Wire filter capability by passing `filterDefinitions` and `onFilterChange` to
1113
- * the parent `UITableProvider`.
1114
- *
1115
- * @example
1116
- * ```tsx
1117
- * <UITableProvider
1118
- * filterDefinitions={[
1119
- * { id: 'status', label: 'Status', type: 'tag', options: [{ label: 'Active', value: 'active' }] },
1120
- * { id: 'created', label: 'Created At', type: 'date-range' },
1121
- * { id: 'amount', label: 'Amount', type: 'number' },
1122
- * ]}
1123
- * onFilterChange={filters => console.log(filters)}
1124
- * >
1125
- * <ResizablePanelGroup direction="horizontal">
1126
- * <ResizablePanel><UITable /></ResizablePanel>
1127
- * <ResizableHandle />
1128
- * <UITableFilter />
1129
- * </ResizablePanelGroup>
1130
- * </UITableProvider>
1131
- * ```
1132
- */
1133
- declare const UITableFilter: () => react_jsx_runtime346.JSX.Element;
1134
- //#endregion
1135
- //#region packages/components/features/tables/components/table/provider.d.ts
1136
- /**
1137
- * Root context provider for the UITable component family.
1138
- *
1139
- * Instantiates a TanStack Table instance with virtualisation-friendly settings
1140
- * (column pinning, row selection, row grouping, row expansion) and propagates
1141
- * all derived state through a nested set of memoised context providers so that
1142
- * each layer only re-renders when its own slice of state changes.
1143
- *
1144
- * @example
1145
- * ```tsx
1146
- * import { UITableProvider } from '@customafk/lunas-ui/features/tables';
1147
- *
1148
- * const columns = [
1149
- * { accessorKey: 'name', header: 'Name' },
1150
- * { accessorKey: 'email', header: 'Email' },
1151
- * ];
1152
- *
1153
- * function MyPage() {
1154
- * return (
1155
- * <UITableProvider
1156
- * title="Users"
1157
- * data={users}
1158
- * columns={columns}
1159
- * isFetching={isLoading}
1160
- * onClickRow={(index, id) => console.log(index, id)}
1161
- * >
1162
- * <UITable />
1163
- * </UITableProvider>
1164
- * );
1165
- * }
1166
- * ```
1167
- */
1168
- declare const UITableProvider: <TData extends RowData<TData> = RowData<AnyEntity>, TKey extends keyof TData = keyof TData, TColumns extends ReadonlyArray<TUITableColumn<TData>> = TUITableColumn<TData>[]>({
1169
- title,
1170
- isFetching,
1171
- isRefetching,
1172
- data,
1173
- columns,
1174
- totalRows,
1175
- leftPinnedColumns,
1176
- rightPinnedColumns,
1177
- keyOfClickRow,
1178
- onClickRow,
1179
- onRowSelection,
1180
- onColumnPinning,
1181
- fetchMoreData,
1182
- csvData,
1183
- csvFileName,
1184
- filterDefinitions,
1185
- onFilterChange,
1186
- children
1187
- }: React.PropsWithChildren<TableProviderProps<TData, TKey, TColumns>>) => react_jsx_runtime346.JSX.Element;
1188
- //#endregion
1189
- //#region packages/components/features/tables/components/table/tooltip.d.ts
1190
- /**
1191
- * Debounced search input rendered inside the table toolbar.
1192
- *
1193
- * Fires `onSearch` 500 ms after the user stops typing and delegates all other
1194
- * native input events via the spread `props`.
1195
- *
1196
- * @example
1197
- * ```tsx
1198
- * import { UITableTooltipFilter } from '@customafk/lunas-ui/features/tables';
1199
- *
1200
- * <UITableTooltipFilter
1201
- * placeholder="Search users…"
1202
- * onSearch={value => setQuery(value)}
1203
- * />
1204
- * ```
1205
- */
1206
- declare const UITableTooltipFilter: React.FC<Omit<React.ComponentProps<typeof Input>, 'className'> & {
1207
- onSearch?: (value: string) => void;
1208
- }>;
1209
- /**
1210
- * Grouped action buttons (create, refresh, download) displayed in the table
1211
- * toolbar.
1212
- *
1213
- * Each button is disabled automatically when the corresponding handler prop is
1214
- * omitted, so only the actions relevant to a given table need to be provided.
1215
- *
1216
- * @example
1217
- * ```tsx
1218
- * import { UITableTooltipActions } from '@customafk/lunas-ui/features/tables';
1219
- *
1220
- * <UITableTooltipActions
1221
- * onCreate={() => setOpenCreate(true)}
1222
- * onRefresh={() => refetch()}
1223
- * />
1224
- * ```
1225
- */
1226
- declare const UITableTooltipActions: React.FC<{
1227
- onCreate?: () => void;
1228
- onRefresh?: () => void;
1229
- onDownload?: () => void;
1230
- }>;
1231
- /**
1232
- * Outer toolbar shell for the UITable component.
1233
- *
1234
- * Reads the table `title` from `UITableContext` and renders it as a heading
1235
- * above the `children` slot, which typically contains a
1236
- * `UITableTooltipFilter` and/or `UITableTooltipActions`.
1237
- *
1238
- * @example
1239
- * ```tsx
1240
- * import {
1241
- * UITableTooltip,
1242
- * UITableTooltipFilter,
1243
- * UITableTooltipActions,
1244
- * } from '@customafk/lunas-ui/features/tables';
1245
- *
1246
- * <UITableTooltip>
1247
- * <UITableTooltipFilter onSearch={setQuery} />
1248
- * <UITableTooltipActions onCreate={handleCreate} onRefresh={refetch} />
1249
- * </UITableTooltip>
1250
- * ```
1251
- */
1252
- declare const UITableTooltip: React.FC<React.PropsWithChildren>;
1253
- //#endregion
1254
- export { ActiveFilter, BooleanFilterValue, CsvCell, DateRangeFilterValue, FilterDefinition, FilterOption, FilterType, FilterValue, NumberFilterValue, RowData, TTableBodyContext, TTableContext, TTableFilterContext, TTableHeadRowContext, TTableInnerTableContext, TTableInnerWrapperContext, TTableRowContext, TTableVirtualizerContext, TUITableBody, TUITableCell, TUITableCellActions, TUITableCellSelect, TUITableColumn, TUITableEmptyDisplay, TUITableFooter, TUITableHead, TUITableHeadCell, TUITableHeadCellOption, TUITableHeadCellSelect, TUITableHeadRow, TUITableInnerTable, TUITableInnerWrapper, TUITableLoadMore, TUITableRow, TUITableWrapper, TableProviderProps, TagFilterValue, TextFilterValue, UITableBadgeDisplay, UITableBody, UITableBooleanDisplay, UITableCell, UITableCellActions, UITableCellSelect, UITableContainer, UITableCurrencyDisplay, UITableDateDisplay, UITableDescriptionDisplay, UITableEmailDisplay, UITableEmptyDisplay, UITableFilter, UITableFooter, UITableHead, UITableHeadCell, UITableHeadCellOption, UITableHeadCellSelect, UITableHeadRow, UITableInnerTable, UITableInnerWrapper, UITableListDisplay, UITableLoadMore, UITableMoreButton, UITableNameDisplay, UITablePermalink, UITablePhoneNumberDisplay, UITableProgressDisplay, UITableProvider, UITableRemoveButton, UITableRow, UITableStatisticDisplay, UITableStatusDisplay, UITableTooltip, UITableTooltipActions, UITableTooltipFilter, UITableUserDataDisplay, UITableWrapper };
1255
- //# sourceMappingURL=index.d.mts.map
1
+ import { $ as TUITableInnerTable, A as FilterValue, B as TTableVirtualizerContext, C as ActiveFilter, D as FilterDefinition, E as DateRangeFilterValue, F as TTableFilterContext, G as TUITableColumn, H as TUITableCell, I as TTableHeadRowContext, J as TUITableHead, K as TUITableEmptyDisplay, L as TTableInnerTableContext, M as RowData, N as TTableBodyContext, O as FilterOption, P as TTableContext, Q as TUITableHeadRow, R as TTableInnerWrapperContext, S as UITableBody, St as UITableBadgeDisplay, T as CsvCell, U as TUITableCellActions, V as TUITableBody, W as TUITableCellSelect, X as TUITableHeadCellOption, Y as TUITableHeadCell, Z as TUITableHeadCellSelect, _ as UITableFooter, _t as UITableEmailDisplay, a as UITableFilter, at as TagFilterValue, b as UITableCellActions, bt as UITableCurrencyDisplay, c as UITableRow, ct as UITableStatusDisplay, d as UITableInnerTable, dt as UITableProgressDisplay, et as TUITableInnerWrapper, f as UITableHeadRow, ft as UITablePhoneNumberDisplay, g as UITableHead, gt as UITableListDisplay, h as UITableHeadCell, ht as UITableMoreButton, i as UITableProvider, it as TableProviderProps, j as NumberFilterValue, k as FilterType, l as UITableLoadMore, lt as UITableStatisticDisplay, m as UITableHeadCellOption, mt as UITableNameDisplay, n as UITableTooltipActions, nt as TUITableRow, o as UITableContainer, ot as TextFilterValue, p as UITableHeadCellSelect, pt as UITablePermalink, q as TUITableFooter, r as UITableTooltipFilter, rt as TUITableWrapper, s as UITableWrapper, st as UITableUserDataDisplay, t as UITableTooltip, tt as TUITableLoadMore, u as UITableInnerWrapper, ut as UITableRemoveButton, v as UITableEmptyDisplay, vt as UITableDescriptionDisplay, w as BooleanFilterValue, x as UITableCell, xt as UITableBooleanDisplay, y as UITableCellSelect, yt as UITableDateDisplay, z as TTableRowContext } from "../../index-b6uMbewl.mjs";
2
+ import "../../input-BaQTUEQF.mjs";
3
+ export { ActiveFilter, BooleanFilterValue, CsvCell, DateRangeFilterValue, FilterDefinition, FilterOption, FilterType, FilterValue, NumberFilterValue, RowData, TTableBodyContext, TTableContext, TTableFilterContext, TTableHeadRowContext, TTableInnerTableContext, TTableInnerWrapperContext, TTableRowContext, TTableVirtualizerContext, TUITableBody, TUITableCell, TUITableCellActions, TUITableCellSelect, TUITableColumn, TUITableEmptyDisplay, TUITableFooter, TUITableHead, TUITableHeadCell, TUITableHeadCellOption, TUITableHeadCellSelect, TUITableHeadRow, TUITableInnerTable, TUITableInnerWrapper, TUITableLoadMore, TUITableRow, TUITableWrapper, TableProviderProps, TagFilterValue, TextFilterValue, UITableBadgeDisplay, UITableBody, UITableBooleanDisplay, UITableCell, UITableCellActions, UITableCellSelect, UITableContainer, UITableCurrencyDisplay, UITableDateDisplay, UITableDescriptionDisplay, UITableEmailDisplay, UITableEmptyDisplay, UITableFilter, UITableFooter, UITableHead, UITableHeadCell, UITableHeadCellOption, UITableHeadCellSelect, UITableHeadRow, UITableInnerTable, UITableInnerWrapper, UITableListDisplay, UITableLoadMore, UITableMoreButton, UITableNameDisplay, UITablePermalink, UITablePhoneNumberDisplay, UITableProgressDisplay, UITableProvider, UITableRemoveButton, UITableRow, UITableStatisticDisplay, UITableStatusDisplay, UITableTooltip, UITableTooltipActions, UITableTooltipFilter, UITableUserDataDisplay, UITableWrapper };