@igne-agency/react-web-ui 0.3.1 → 0.5.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 (291) hide show
  1. package/README.md +32 -1
  2. package/dist/base.css +3 -0
  3. package/dist/components/accordion/accordion.css +24 -19
  4. package/dist/components/accordion/accordion.d.ts +19 -3
  5. package/dist/components/accordion/accordion.js +86 -32
  6. package/dist/components/accordion/accordion.module.js +8 -8
  7. package/dist/components/active-filters/active-filter-describers.d.ts +1 -1
  8. package/dist/components/active-filters/active-filter-describers.js +1 -1
  9. package/dist/components/active-filters/active-filters.d.ts +35 -2
  10. package/dist/components/active-filters/active-filters.js +57 -52
  11. package/dist/components/active-filters/index.js +2 -2
  12. package/dist/components/attachment-tile/attachment-preview.d.ts +11 -9
  13. package/dist/components/attachment-tile/attachment-preview.js +102 -68
  14. package/dist/components/attachment-tile/attachment-tile.css +22 -13
  15. package/dist/components/attachment-tile/attachment-tile.d.ts +51 -6
  16. package/dist/components/attachment-tile/attachment-tile.js +209 -85
  17. package/dist/components/attachment-tile/attachment-tile.module.js +10 -10
  18. package/dist/components/attachment-tile/index.d.ts +1 -1
  19. package/dist/components/attachment-tile/index.js +2 -2
  20. package/dist/components/avatar/avatar.d.ts +5 -5
  21. package/dist/components/avatar/avatar.js +64 -37
  22. package/dist/components/avatar-group/avatar-group.js +2 -2
  23. package/dist/components/badge/badge.js +1 -1
  24. package/dist/components/breadcrumbs/breadcrumbs.d.ts +22 -7
  25. package/dist/components/breadcrumbs/breadcrumbs.js +189 -170
  26. package/dist/components/button/button.d.ts +2 -3
  27. package/dist/components/button/button.js +58 -77
  28. package/dist/components/button/close-button.d.ts +4 -2
  29. package/dist/components/button/close-button.js +9 -9
  30. package/dist/components/checkbox-field/checkbox-field.d.ts +17 -3
  31. package/dist/components/checkbox-field/checkbox-field.js +108 -131
  32. package/dist/components/checkbox-field/checkbox.css +26 -34
  33. package/dist/components/checkbox-field/checkbox.d.ts +51 -8
  34. package/dist/components/checkbox-field/checkbox.js +221 -57
  35. package/dist/components/checkbox-field/checkbox.module.js +6 -8
  36. package/dist/components/checkbox-field/index.d.ts +0 -1
  37. package/dist/components/checkbox-field/index.js +1 -2
  38. package/dist/components/checkbox-field/tsf-checkbox-field.d.ts +2 -2
  39. package/dist/components/checkbox-group-field/checkbox-group-field.d.ts +4 -1
  40. package/dist/components/checkbox-group-field/checkbox-group-field.js +54 -50
  41. package/dist/components/checkbox-group-field/checkbox-group.d.ts +7 -2
  42. package/dist/components/checkbox-group-field/checkbox-group.js +8 -3
  43. package/dist/components/collapsible/collapsible.css +23 -18
  44. package/dist/components/collapsible/collapsible.d.ts +18 -3
  45. package/dist/components/collapsible/collapsible.js +85 -32
  46. package/dist/components/collapsible/collapsible.module.js +7 -7
  47. package/dist/components/combobox-field/combobox-field.d.ts +9 -1
  48. package/dist/components/combobox-field/combobox-field.js +195 -175
  49. package/dist/components/combobox-field/combobox-items.d.ts +2 -2
  50. package/dist/components/combobox-field/combobox-items.js +4 -4
  51. package/dist/components/combobox-field/combobox.css +99 -96
  52. package/dist/components/combobox-field/combobox.d.ts +94 -15
  53. package/dist/components/combobox-field/combobox.js +484 -159
  54. package/dist/components/combobox-field/combobox.module.js +21 -21
  55. package/dist/components/combobox-field/index.d.ts +0 -1
  56. package/dist/components/combobox-field/selection.d.ts +4 -1
  57. package/dist/components/combobox-field/value-state-view.css +7 -3
  58. package/dist/components/combobox-field/value-state-view.d.ts +4 -2
  59. package/dist/components/combobox-field/value-state-view.js +15 -15
  60. package/dist/components/combobox-field/value-state-view.module.js +6 -4
  61. package/dist/components/composer/composer-attachments.d.ts +11 -3
  62. package/dist/components/composer/composer-attachments.js +61 -47
  63. package/dist/components/composer/composer-editor.d.ts +2 -1
  64. package/dist/components/composer/composer-editor.js +79 -71
  65. package/dist/components/composer/composer-mentions.js +2 -2
  66. package/dist/components/composer/composer.d.ts +42 -21
  67. package/dist/components/composer/composer.js +201 -58
  68. package/dist/components/composer/mention-text.js +3 -3
  69. package/dist/components/confirm-dialog/confirm-dialog.d.ts +8 -7
  70. package/dist/components/confirm-dialog/confirm-dialog.js +10 -9
  71. package/dist/components/conversation/conversation.context.d.ts +0 -5
  72. package/dist/components/conversation/conversation.d.ts +63 -29
  73. package/dist/components/conversation/conversation.js +193 -82
  74. package/dist/components/conversation/index.d.ts +1 -1
  75. package/dist/components/date-field/date-field.d.ts +10 -4
  76. package/dist/components/date-field/date-field.js +57 -43
  77. package/dist/components/date-field/date-input.d.ts +20 -3
  78. package/dist/components/date-field/date-input.js +28 -13
  79. package/dist/components/date-field/index.d.ts +1 -1
  80. package/dist/components/date-field/tsf-date-field.d.ts +1 -1
  81. package/dist/components/date-field/tsf-date-field.js +1 -1
  82. package/dist/components/date-range-field/date-range-field.d.ts +8 -4
  83. package/dist/components/date-range-field/date-range-field.js +57 -45
  84. package/dist/components/date-range-field/date-range-input.d.ts +20 -3
  85. package/dist/components/date-range-field/date-range-input.js +27 -12
  86. package/dist/components/date-range-field/tsf-date-range-field.d.ts +1 -1
  87. package/dist/components/date-range-field/tsf-date-range-field.js +1 -1
  88. package/dist/components/detail-list/detail-list.d.ts +28 -27
  89. package/dist/components/detail-list/detail-list.js +177 -121
  90. package/dist/components/dialog/dialog.d.ts +47 -27
  91. package/dist/components/dialog/dialog.js +101 -38
  92. package/dist/components/divider/divider.js +1 -1
  93. package/dist/components/drawer/drawer.d.ts +48 -30
  94. package/dist/components/drawer/drawer.js +113 -41
  95. package/dist/components/email-field/email-field.d.ts +5 -3
  96. package/dist/components/email-field/email-field.js +1 -3
  97. package/dist/components/email-field/tsf-email-field.d.ts +3 -2
  98. package/dist/components/empty-message/empty-message.d.ts +3 -3
  99. package/dist/components/empty-message/empty-message.js +3 -3
  100. package/dist/components/error-boundary/error-boundary.d.ts +5 -2
  101. package/dist/components/error-boundary/error-boundary.js +2 -3
  102. package/dist/components/error-message/error-message.d.ts +1 -1
  103. package/dist/components/error-message/error-message.js +1 -1
  104. package/dist/components/error-text/error-text.js +3 -3
  105. package/dist/components/field/field.d.ts +5 -5
  106. package/dist/components/field/field.js +9 -9
  107. package/dist/components/field/index.js +2 -2
  108. package/dist/components/field/input-parts.js +1 -1
  109. package/dist/components/field-placeholder/field-placeholder.d.ts +4 -1
  110. package/dist/components/field-placeholder/field-placeholder.js +41 -26
  111. package/dist/components/fieldset/field-group.js +1 -1
  112. package/dist/components/fieldset/fieldset-root.js +1 -1
  113. package/dist/components/fieldset/fieldset.js +1 -1
  114. package/dist/components/file-field/file-field.css +19 -15
  115. package/dist/components/file-field/file-field.d.ts +10 -1
  116. package/dist/components/file-field/file-field.js +130 -109
  117. package/dist/components/file-field/file-field.module.js +6 -4
  118. package/dist/components/file-field/file-input.d.ts +32 -9
  119. package/dist/components/file-field/file-input.js +94 -74
  120. package/dist/components/filter-bar/filter-bar.d.ts +79 -51
  121. package/dist/components/filter-bar/filter-bar.js +552 -216
  122. package/dist/components/form/form.d.ts +4 -6
  123. package/dist/components/form/form.js +6 -8
  124. package/dist/components/icon/icon.d.ts +5 -10
  125. package/dist/components/icon/icon.js +4 -6
  126. package/dist/components/link/link.js +1 -1
  127. package/dist/components/link-button/link-button.d.ts +1 -2
  128. package/dist/components/link-button/link-button.js +12 -22
  129. package/dist/components/loading-message/loading-message.d.ts +2 -2
  130. package/dist/components/loading-message/loading-message.js +1 -1
  131. package/dist/components/locale-provider/locale-provider.js +1 -1
  132. package/dist/components/menu/menu.d.ts +40 -22
  133. package/dist/components/menu/menu.js +100 -40
  134. package/dist/components/nav/nav-context.d.ts +0 -1
  135. package/dist/components/nav/nav-context.js +1 -2
  136. package/dist/components/nav/nav-item-view.d.ts +7 -7
  137. package/dist/components/nav/nav-item-view.js +27 -51
  138. package/dist/components/nav/nav.css +72 -60
  139. package/dist/components/nav/nav.d.ts +15 -8
  140. package/dist/components/nav/nav.js +105 -52
  141. package/dist/components/nav/nav.module.js +14 -14
  142. package/dist/components/number-field/number-field.d.ts +7 -1
  143. package/dist/components/number-field/number-field.js +98 -82
  144. package/dist/components/number-field/number-input.d.ts +53 -4
  145. package/dist/components/number-field/number-input.js +68 -21
  146. package/dist/components/number-field/tsf-number-field.d.ts +1 -1
  147. package/dist/components/number-field/tsf-number-field.js +1 -1
  148. package/dist/components/otp-field/otp-input.d.ts +25 -0
  149. package/dist/components/otp-field/otp-input.js +26 -1
  150. package/dist/components/pagination/pagination.d.ts +82 -23
  151. package/dist/components/pagination/pagination.js +656 -229
  152. package/dist/components/password-field/password-field.d.ts +7 -1
  153. package/dist/components/password-field/password-field.js +117 -126
  154. package/dist/components/password-field/password-strength.js +1 -1
  155. package/dist/components/password-field/tsf-password-field.d.ts +1 -1
  156. package/dist/components/password-field/tsf-password-field.js +1 -1
  157. package/dist/components/photo-field/photo-field.d.ts +17 -3
  158. package/dist/components/photo-field/photo-field.js +168 -89
  159. package/dist/components/photo-field/photo-input-context.d.ts +25 -0
  160. package/dist/components/photo-field/photo-input-context.js +14 -0
  161. package/dist/components/photo-field/photo-input.d.ts +58 -23
  162. package/dist/components/photo-field/photo-input.js +459 -261
  163. package/dist/components/popover/popover.d.ts +55 -23
  164. package/dist/components/popover/popover.js +205 -61
  165. package/dist/components/radio-group-field/radio-group.js +1 -1
  166. package/dist/components/search-field/search-field.d.ts +7 -5
  167. package/dist/components/search-field/search-field.js +4 -6
  168. package/dist/components/search-field/tsf-search-field.d.ts +1 -1
  169. package/dist/components/search-field/tsf-search-field.js +1 -1
  170. package/dist/components/segmented-control-field/segmented-control.js +1 -1
  171. package/dist/components/select-field/select-field.d.ts +7 -1
  172. package/dist/components/select-field/select-field.js +151 -139
  173. package/dist/components/select-field/select.d.ts +28 -6
  174. package/dist/components/select-field/select.js +234 -149
  175. package/dist/components/skeleton/skeleton.js +1 -1
  176. package/dist/components/spinner/spinner.css +47 -1
  177. package/dist/components/spinner/spinner.js +28 -11
  178. package/dist/components/spinner/spinner.module.js +18 -3
  179. package/dist/components/stale/stale.d.ts +17 -21
  180. package/dist/components/stale/stale.js +307 -129
  181. package/dist/components/status-message/status-message.css +22 -21
  182. package/dist/components/status-message/status-message.d.ts +10 -5
  183. package/dist/components/status-message/status-message.js +20 -24
  184. package/dist/components/status-message/status-message.module.js +6 -6
  185. package/dist/components/status-message/status-preset.d.ts +4 -5
  186. package/dist/components/status-message/status-preset.js +3 -3
  187. package/dist/components/switch-field/switch.js +1 -1
  188. package/dist/components/tabs/tabs.d.ts +51 -28
  189. package/dist/components/tabs/tabs.js +219 -144
  190. package/dist/components/tag/tag.css +23 -21
  191. package/dist/components/tag/tag.d.ts +17 -15
  192. package/dist/components/tag/tag.js +140 -65
  193. package/dist/components/tag/tag.module.js +3 -3
  194. package/dist/components/tag-group/tag-group.css +30 -27
  195. package/dist/components/tag-group/tag-group.d.ts +10 -4
  196. package/dist/components/tag-group/tag-group.js +47 -35
  197. package/dist/components/tag-group/tag-group.module.js +4 -4
  198. package/dist/components/text-field/text-field.d.ts +14 -3
  199. package/dist/components/text-field/text-field.js +154 -133
  200. package/dist/components/text-field/text-input.d.ts +89 -3
  201. package/dist/components/text-field/text-input.js +184 -70
  202. package/dist/components/textarea-field/textarea.js +1 -1
  203. package/dist/components/time-field/time-input.d.ts +6 -0
  204. package/dist/components/time-field/time-input.js +6 -0
  205. package/dist/components/time-zone-provider/time-zone-provider.js +1 -1
  206. package/dist/components/toast/index.js +2 -2
  207. package/dist/components/toast/toast-provider.css +38 -34
  208. package/dist/components/toast/toast-provider.d.ts +65 -3
  209. package/dist/components/toast/toast-provider.js +313 -148
  210. package/dist/components/toast/toast-provider.module.js +11 -17
  211. package/dist/components/toast/toast.d.ts +5 -1
  212. package/dist/components/toast/toast.js +2 -1
  213. package/dist/components/toggle-group-field/toggle-group.js +1 -1
  214. package/dist/components/tooltip/tooltip.d.ts +6 -6
  215. package/dist/components/tooltip/tooltip.js +7 -7
  216. package/dist/data-table/data-table-content.d.ts +18 -10
  217. package/dist/data-table/data-table-content.js +145 -290
  218. package/dist/data-table/data-table-context.d.ts +4 -2
  219. package/dist/data-table/data-table-context.js +1 -1
  220. package/dist/data-table/data-table-parts.d.ts +99 -0
  221. package/dist/data-table/data-table-parts.js +1182 -0
  222. package/dist/data-table/data-table-selection.d.ts +7 -3
  223. package/dist/data-table/data-table-selection.js +62 -37
  224. package/dist/data-table/data-table.css +100 -95
  225. package/dist/data-table/data-table.d.ts +49 -25
  226. package/dist/data-table/data-table.js +95 -83
  227. package/dist/data-table/data-table.module.js +34 -34
  228. package/dist/data-table/index.d.ts +2 -1
  229. package/dist/data-table/index.js +2 -1
  230. package/dist/data-view/use-data-view.d.ts +2 -2
  231. package/dist/data-view/use-data-view.js +2 -2
  232. package/dist/index.js +7 -8
  233. package/dist/lib/calendar/calendar-navigation.d.ts +9 -2
  234. package/dist/lib/calendar/calendar-navigation.js +72 -73
  235. package/dist/lib/calendar/calendar-year.d.ts +4 -3
  236. package/dist/lib/calendar/calendar-year.js +137 -156
  237. package/dist/lib/calendar/temporal.d.ts +18 -12
  238. package/dist/lib/calendar/temporal.js +191 -147
  239. package/dist/lib/table-storage.d.ts +2 -2
  240. package/dist/lib/table-storage.js +2 -2
  241. package/dist/lib/unsaved-changes/leave-guard.js +1 -1
  242. package/dist/terrazzo/index.d.ts +20 -3
  243. package/dist/terrazzo/index.js +110 -7
  244. package/dist/tokens.css +94 -71
  245. package/package.json +4 -3
  246. package/tokens/ref.tokens.json +0 -30
  247. package/tokens/sys.tokens.json +0 -7
  248. package/dist/assets/spinner.js +0 -28
  249. package/dist/components/checkbox-field/checkbox-glyph.d.ts +0 -12
  250. package/dist/components/checkbox-field/checkbox-glyph.js +0 -38
  251. package/dist/components/combobox-field/combobox-popup-body.d.ts +0 -34
  252. package/dist/components/combobox-field/combobox-popup-body.js +0 -142
  253. package/dist/components/conversation/conversation.context.js +0 -4
  254. package/dist/vendor/@material-design-icons/svg/outlined/add.js +0 -12
  255. package/dist/vendor/@material-design-icons/svg/outlined/arrow_downward.js +0 -12
  256. package/dist/vendor/@material-design-icons/svg/outlined/arrow_forward.js +0 -12
  257. package/dist/vendor/@material-design-icons/svg/outlined/arrow_upward.js +0 -12
  258. package/dist/vendor/@material-design-icons/svg/outlined/attach_file.js +0 -12
  259. package/dist/vendor/@material-design-icons/svg/outlined/block.js +0 -12
  260. package/dist/vendor/@material-design-icons/svg/outlined/calendar_today.js +0 -12
  261. package/dist/vendor/@material-design-icons/svg/outlined/check.js +0 -12
  262. package/dist/vendor/@material-design-icons/svg/outlined/check_circle.js +0 -12
  263. package/dist/vendor/@material-design-icons/svg/outlined/chevron_left.js +0 -12
  264. package/dist/vendor/@material-design-icons/svg/outlined/chevron_right.js +0 -12
  265. package/dist/vendor/@material-design-icons/svg/outlined/close.js +0 -12
  266. package/dist/vendor/@material-design-icons/svg/outlined/content_copy.js +0 -12
  267. package/dist/vendor/@material-design-icons/svg/outlined/date_range.js +0 -12
  268. package/dist/vendor/@material-design-icons/svg/outlined/description.js +0 -12
  269. package/dist/vendor/@material-design-icons/svg/outlined/download.js +0 -12
  270. package/dist/vendor/@material-design-icons/svg/outlined/error.js +0 -12
  271. package/dist/vendor/@material-design-icons/svg/outlined/error_outline.js +0 -12
  272. package/dist/vendor/@material-design-icons/svg/outlined/expand_less.js +0 -12
  273. package/dist/vendor/@material-design-icons/svg/outlined/expand_more.js +0 -12
  274. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt.js +0 -12
  275. package/dist/vendor/@material-design-icons/svg/outlined/filter_alt_off.js +0 -12
  276. package/dist/vendor/@material-design-icons/svg/outlined/first_page.js +0 -12
  277. package/dist/vendor/@material-design-icons/svg/outlined/info.js +0 -12
  278. package/dist/vendor/@material-design-icons/svg/outlined/keyboard_arrow_down.js +0 -12
  279. package/dist/vendor/@material-design-icons/svg/outlined/last_page.js +0 -12
  280. package/dist/vendor/@material-design-icons/svg/outlined/mail.js +0 -12
  281. package/dist/vendor/@material-design-icons/svg/outlined/more_horiz.js +0 -12
  282. package/dist/vendor/@material-design-icons/svg/outlined/photo_camera.js +0 -12
  283. package/dist/vendor/@material-design-icons/svg/outlined/remove.js +0 -12
  284. package/dist/vendor/@material-design-icons/svg/outlined/restart_alt.js +0 -12
  285. package/dist/vendor/@material-design-icons/svg/outlined/restore.js +0 -12
  286. package/dist/vendor/@material-design-icons/svg/outlined/search.js +0 -12
  287. package/dist/vendor/@material-design-icons/svg/outlined/unfold_more.js +0 -12
  288. package/dist/vendor/@material-design-icons/svg/outlined/upload_file.js +0 -12
  289. package/dist/vendor/@material-design-icons/svg/outlined/visibility.js +0 -12
  290. package/dist/vendor/@material-design-icons/svg/outlined/visibility_off.js +0 -12
  291. package/dist/vendor/@material-design-icons/svg/outlined/warning_amber.js +0 -12
@@ -1,4 +1,4 @@
1
- import type { Row } from "@tanstack/react-table";
1
+ import type { Row as TableRow } from "@tanstack/react-table";
2
2
  import { type ReactNode } from "react";
3
3
  import type { DataTableFeatures } from "./table-features.ts";
4
4
  export type DataTableContentProps<TData extends Record<string, unknown>> = Readonly<{
@@ -6,22 +6,30 @@ export type DataTableContentProps<TData extends Record<string, unknown>> = Reado
6
6
  * Renders the expanded content for a row (TanStack expansion API). The
7
7
  * returned node is placed in a full-width cell beneath the row.
8
8
  */
9
- renderSubRow?: (row: Row<DataTableFeatures, TData>) => ReactNode;
10
- /** The body when the query matched nothing, such as "No declarations yet." or an `EmptyMessage`. */
9
+ renderSubRow?: (row: TableRow<DataTableFeatures, TData>) => ReactNode;
10
+ /** The body when the query matched nothing, such as "No invoices yet." or an `EmptyMessage`. */
11
11
  emptyState: ReactNode;
12
- /** What a failed fetch says, as the body or above rows still on screen, such as "The declarations could not be loaded." */
12
+ /** What a failed fetch says, as the body or above rows still on screen, such as "The invoices could not be loaded." */
13
13
  errorLabel: string;
14
- /** What is announced while the first page loads, as the table's caption, such as "Loading declarations". */
14
+ /** What is announced while the first page loads, as the table's caption, such as "Loading invoices". */
15
15
  loadingLabel: string;
16
16
  /** What the overlay says when a refresh runs long, such as "This is taking longer than usual." */
17
- slowLabel: ReactNode;
17
+ slowLabel: string;
18
18
  /** The retry's label, such as "Try again". */
19
19
  retryLabel: string;
20
+ /** The glyph on a header sorted ascending. */
21
+ sortAscendingIcon?: ReactNode;
22
+ /** The glyph on a header sorted descending. */
23
+ sortDescendingIcon?: ReactNode;
24
+ /** The glyph on a sortable header that is not sorted. */
25
+ unsortedIcon?: ReactNode;
26
+ /** Set on the `Scroller`. */
20
27
  className?: string;
21
28
  }>;
22
29
  /**
23
- * Renders the `<table>` header and body from the enclosing `DataTable`
24
- * instance, resolving the injected query state into one of four bodies:
25
- * loading, error, empty, or ready.
30
+ * The whole table from the enclosing `DataTable` instance: its headers, with a
31
+ * sort toggle on every sortable column, and one of four bodies resolved from
32
+ * the injected query state: loading, error, empty, or ready. Compose the parts
33
+ * where the table needs other markup.
26
34
  */
27
- export declare const DataTableContent: <TData extends Record<string, unknown>>({ renderSubRow, emptyState, errorLabel, loadingLabel, slowLabel, retryLabel, className, }: DataTableContentProps<TData>) => ReactNode;
35
+ export declare const DataTableContent: <TData extends Record<string, unknown>>({ renderSubRow, emptyState, errorLabel, loadingLabel, slowLabel, retryLabel, sortAscendingIcon, sortDescendingIcon, unsortedIcon, className, }: DataTableContentProps<TData>) => ReactNode;
@@ -1,311 +1,166 @@
1
- import SvgArrowDownward from "../vendor/@material-design-icons/svg/outlined/arrow_downward.js";
2
- import SvgArrowUpward from "../vendor/@material-design-icons/svg/outlined/arrow_upward.js";
3
- import SvgUnfoldMore from "../vendor/@material-design-icons/svg/outlined/unfold_more.js";
4
1
  import { Button } from "../components/button/button.js";
5
- import { Icon } from "../components/icon/icon.js";
6
- import { Skeleton } from "../components/skeleton/skeleton.js";
7
2
  import { Stale } from "../components/stale/stale.js";
8
3
  import { useDataTable } from "./data-table-context.js";
9
- import { resolveView } from "./resolve-view.js";
10
- import { useStickyOffsets } from "./use-sticky-offsets.js";
11
- import data_table_module_default from "./data-table.module.js";
4
+ import { Body, Cell, ErrorMessage, Frame, Head, HeaderCell, HeaderRow, LoadingCaption, PlaceholderRows, RefreshFailed, Row, Scroller, SortButton, StaleOverlay, StateRow, SubRow, Table, useDataTableView } from "./data-table-parts.js";
12
5
  import { c } from "react/compiler-runtime";
13
- import { Fragment } from "react";
14
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
15
- import { clsx } from "clsx";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { Fragment as Fragment$1 } from "react";
16
8
  // src/data-table/data-table-content.tsx
17
- var SORT_ICON = {
18
- asc: SvgArrowUpward,
19
- desc: SvgArrowDownward
20
- };
21
- var ARIA_SORT = {
22
- asc: "ascending",
23
- desc: "descending"
24
- };
25
- /**
26
- * The `aria-sort` value for a header cell, given its column's sort state.
27
- *
28
- * @example
29
- * ariaSort("desc"); // -> "descending"
30
- * ariaSort(false); // -> undefined
31
- */
32
- var ariaSort = (sorted) => sorted === false ? void 0 : ARIA_SORT[sorted];
33
9
  /**
34
- * The props a column's layout options put on its header and body cells: the
35
- * data attributes the stylesheet reads, plus the inset a pinned cell sits at.
36
- *
37
- * @example
38
- * <td {...cellProps(cell.column.columnDef.meta, pins.get(cell.column.id))} />
39
- */
40
- var cellProps = (meta, pin) => ({
41
- "data-fit": meta?.fit ? "true" : void 0,
42
- "data-numeric": meta?.numeric ? "true" : void 0,
43
- "data-sticky": pin?.side,
44
- style: pin === void 0 ? void 0 : pin.side === "start" ? { insetInlineStart: `var(--table-sticky-inset-${pin.index}, 0px)` } : { insetInlineEnd: `var(--table-sticky-end-${pin.index}, 0px)` }
45
- });
46
- /**
47
- * Maps each pinned column's id to the edge it sits at and its position in that
48
- * edge's group.
49
- *
50
- * @example
51
- * columnPins(columns).get("actions"); // -> { side: "end", index: 0 }
52
- */
53
- var columnPins = (columns) => new Map(["start", "end"].flatMap((side) => columns.filter((column) => column.columnDef.meta?.sticky === side).map((column, index) => [column.id, {
54
- side,
55
- index
56
- }])));
57
- /**
58
- * Renders the `<table>` header and body from the enclosing `DataTable`
59
- * instance, resolving the injected query state into one of four bodies:
60
- * loading, error, empty, or ready.
10
+ * The whole table from the enclosing `DataTable` instance: its headers, with a
11
+ * sort toggle on every sortable column, and one of four bodies resolved from
12
+ * the injected query state: loading, error, empty, or ready. Compose the parts
13
+ * where the table needs other markup.
61
14
  */
62
15
  var DataTableContent = (t0) => {
63
- const $ = c(24);
64
- const { renderSubRow, emptyState, errorLabel, loadingLabel, slowLabel, retryLabel, className } = t0;
65
- const { table, status, isFetching, onRetry } = useDataTable();
66
- const rows = table.getRowModel().rows;
67
- const leafColumns = table.getAllLeafColumns();
68
- const columnCount = leafColumns.length;
69
- const pins = columnPins(leafColumns);
70
- const pinCount = (side) => [...pins.values()].filter((pin) => pin.side === side).length;
71
- const startPinCount = pinCount("start");
72
- const endPinCount = pinCount("end");
73
- const frameRef = useStickyOffsets([...pins].map(_temp).join(","));
74
- const t1 = rows.length > 0;
16
+ const $ = c(51);
17
+ const { renderSubRow, emptyState, errorLabel, loadingLabel, slowLabel, retryLabel, sortAscendingIcon, sortDescendingIcon, unsortedIcon, className } = t0;
18
+ const { table, onRetry } = useDataTable();
19
+ const { view } = useDataTableView();
20
+ let t1;
21
+ if ($[0] !== errorLabel) {
22
+ t1 = /* @__PURE__ */ jsx("span", { children: errorLabel });
23
+ $[0] = errorLabel;
24
+ $[1] = t1;
25
+ } else t1 = $[1];
75
26
  let t2;
76
- if ($[0] !== isFetching || $[1] !== status || $[2] !== t1) {
77
- t2 = resolveView({
78
- status,
79
- isFetching,
80
- hasRows: t1
81
- });
82
- $[0] = isFetching;
83
- $[1] = status;
84
- $[2] = t1;
85
- $[3] = t2;
86
- } else t2 = $[3];
87
- const { view, stale, refreshFailed } = t2;
88
- let t3;
89
- if ($[4] !== errorLabel || $[5] !== onRetry || $[6] !== refreshFailed || $[7] !== retryLabel) {
90
- t3 = refreshFailed ? /* @__PURE__ */ jsxs("div", {
91
- className: data_table_module_default.refreshFailed,
92
- role: "alert",
93
- children: [/* @__PURE__ */ jsx("span", { children: errorLabel }), onRetry ? /* @__PURE__ */ jsx(Button, {
94
- variant: "tertiary",
95
- size: "sm",
96
- onClick: onRetry,
97
- children: retryLabel
98
- }) : null]
27
+ if ($[2] !== onRetry || $[3] !== retryLabel) {
28
+ t2 = onRetry ? /* @__PURE__ */ jsx(Button, {
29
+ variant: "tertiary",
30
+ size: "sm",
31
+ onClick: onRetry,
32
+ children: retryLabel
99
33
  }) : null;
100
- $[4] = errorLabel;
101
- $[5] = onRetry;
102
- $[6] = refreshFailed;
103
- $[7] = retryLabel;
104
- $[8] = t3;
105
- } else t3 = $[8];
34
+ $[2] = onRetry;
35
+ $[3] = retryLabel;
36
+ $[4] = t2;
37
+ } else t2 = $[4];
38
+ let t3;
39
+ if ($[5] !== t1 || $[6] !== t2) {
40
+ t3 = /* @__PURE__ */ jsxs(RefreshFailed, { children: [t1, t2] });
41
+ $[5] = t1;
42
+ $[6] = t2;
43
+ $[7] = t3;
44
+ } else t3 = $[7];
106
45
  let t4;
107
- if ($[9] !== className) {
108
- t4 = clsx(data_table_module_default.contentWrap, className);
109
- $[9] = className;
110
- $[10] = t4;
111
- } else t4 = $[10];
46
+ if ($[8] !== loadingLabel) {
47
+ t4 = /* @__PURE__ */ jsx(LoadingCaption, { children: loadingLabel });
48
+ $[8] = loadingLabel;
49
+ $[9] = t4;
50
+ } else t4 = $[9];
112
51
  let t5;
113
- if ($[11] !== loadingLabel || $[12] !== view) {
114
- t5 = view === "loading" ? /* @__PURE__ */ jsx("caption", {
115
- className: data_table_module_default.busyCaption,
116
- children: loadingLabel
117
- }) : null;
118
- $[11] = loadingLabel;
119
- $[12] = view;
120
- $[13] = t5;
121
- } else t5 = $[13];
122
- const t6 = view === "ready" ? rows.map((row) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("tr", {
123
- className: data_table_module_default.row,
124
- "data-stripe": row.index % 2 === 1 ? "true" : void 0,
125
- children: row.getAllCells().map((cell) => /* @__PURE__ */ jsx("td", {
126
- className: data_table_module_default.td,
127
- ...cellProps(cell.column.columnDef.meta, pins.get(cell.column.id)),
128
- children: /* @__PURE__ */ jsx(table.FlexRender, { cell })
129
- }, cell.id))
130
- }), renderSubRow && row.getIsExpanded() ? /* @__PURE__ */ jsxs("tr", {
131
- className: data_table_module_default.subRow,
132
- children: [
133
- startPinCount > 0 ? /* @__PURE__ */ jsx("td", {
134
- className: data_table_module_default.td,
135
- colSpan: startPinCount,
136
- "data-sticky": "start",
137
- style: { insetInlineStart: 0 }
138
- }) : null,
139
- /* @__PURE__ */ jsx("td", {
140
- colSpan: columnCount - startPinCount - endPinCount,
141
- children: renderSubRow(row)
142
- }),
143
- endPinCount > 0 ? /* @__PURE__ */ jsx("td", {
144
- className: data_table_module_default.td,
145
- colSpan: endPinCount,
146
- "data-sticky": "end",
147
- style: { insetInlineEnd: 0 }
148
- }) : null
149
- ]
150
- }) : null] }, row.id)) : view === "loading" ? /* @__PURE__ */ jsx(PlaceholderRows, {
151
- rowCount: table.state.pagination.pageSize,
152
- columns: leafColumns.map((column) => ({
153
- id: column.id,
154
- meta: column.columnDef.meta,
155
- pin: pins.get(column.id)
156
- }))
157
- }) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
158
- colSpan: columnCount,
159
- className: data_table_module_default.stateCell,
160
- children: /* @__PURE__ */ jsx(StateBody, {
161
- view,
162
- emptyState,
163
- errorLabel
164
- })
165
- }) });
52
+ if ($[10] !== sortAscendingIcon || $[11] !== sortDescendingIcon || $[12] !== table || $[13] !== unsortedIcon) {
53
+ let t6;
54
+ if ($[15] !== sortAscendingIcon || $[16] !== sortDescendingIcon || $[17] !== table.FlexRender || $[18] !== unsortedIcon) {
55
+ t6 = (headerGroup) => /* @__PURE__ */ jsx(HeaderRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(HeaderCell, {
56
+ header,
57
+ children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsx(SortButton, {
58
+ header,
59
+ sortAscendingIcon,
60
+ sortDescendingIcon,
61
+ unsortedIcon
62
+ }) : /* @__PURE__ */ jsx(table.FlexRender, { header })
63
+ }, header.id)) }, headerGroup.id);
64
+ $[15] = sortAscendingIcon;
65
+ $[16] = sortDescendingIcon;
66
+ $[17] = table.FlexRender;
67
+ $[18] = unsortedIcon;
68
+ $[19] = t6;
69
+ } else t6 = $[19];
70
+ t5 = table.getHeaderGroups().map(t6);
71
+ $[10] = sortAscendingIcon;
72
+ $[11] = sortDescendingIcon;
73
+ $[12] = table;
74
+ $[13] = unsortedIcon;
75
+ $[14] = t5;
76
+ } else t5 = $[14];
77
+ let t6;
78
+ if ($[20] !== t5) {
79
+ t6 = /* @__PURE__ */ jsx(Head, { children: t5 });
80
+ $[20] = t5;
81
+ $[21] = t6;
82
+ } else t6 = $[21];
166
83
  let t7;
167
- if ($[14] !== t6) {
168
- t7 = /* @__PURE__ */ jsx("tbody", { children: t6 });
169
- $[14] = t6;
170
- $[15] = t7;
171
- } else t7 = $[15];
84
+ if ($[22] !== emptyState || $[23] !== errorLabel || $[24] !== renderSubRow || $[25] !== table || $[26] !== view) {
85
+ t7 = view === "ready" ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Row, {
86
+ row,
87
+ children: row.getAllCells().map(_temp)
88
+ }), renderSubRow && row.getIsExpanded() ? /* @__PURE__ */ jsx(SubRow, { children: renderSubRow(row) }) : null] }, row.id)) : view === "loading" ? /* @__PURE__ */ jsx(PlaceholderRows, {}) : /* @__PURE__ */ jsx(StateRow, { children: view === "error" ? /* @__PURE__ */ jsx(ErrorMessage, { children: errorLabel }) : emptyState });
89
+ $[22] = emptyState;
90
+ $[23] = errorLabel;
91
+ $[24] = renderSubRow;
92
+ $[25] = table;
93
+ $[26] = view;
94
+ $[27] = t7;
95
+ } else t7 = $[27];
172
96
  let t8;
173
- if ($[16] !== slowLabel) {
174
- t8 = /* @__PURE__ */ jsx(Stale.Message, { children: slowLabel });
175
- $[16] = slowLabel;
176
- $[17] = t8;
177
- } else t8 = $[17];
97
+ if ($[28] !== t7) {
98
+ t8 = /* @__PURE__ */ jsx(Body, { children: t7 });
99
+ $[28] = t7;
100
+ $[29] = t8;
101
+ } else t8 = $[29];
178
102
  let t9;
179
- if ($[18] !== onRetry || $[19] !== retryLabel) {
180
- t9 = onRetry ? /* @__PURE__ */ jsx(Stale.Retry, {
103
+ if ($[30] !== t4 || $[31] !== t6 || $[32] !== t8) {
104
+ t9 = /* @__PURE__ */ jsxs(Table, { children: [
105
+ t4,
106
+ t6,
107
+ t8
108
+ ] });
109
+ $[30] = t4;
110
+ $[31] = t6;
111
+ $[32] = t8;
112
+ $[33] = t9;
113
+ } else t9 = $[33];
114
+ let t10;
115
+ if ($[34] !== className || $[35] !== t9) {
116
+ t10 = /* @__PURE__ */ jsx(Scroller, {
117
+ className,
118
+ children: t9
119
+ });
120
+ $[34] = className;
121
+ $[35] = t9;
122
+ $[36] = t10;
123
+ } else t10 = $[36];
124
+ let t11;
125
+ if ($[37] !== slowLabel) {
126
+ t11 = /* @__PURE__ */ jsx(Stale.Message, { children: slowLabel });
127
+ $[37] = slowLabel;
128
+ $[38] = t11;
129
+ } else t11 = $[38];
130
+ let t12;
131
+ if ($[39] !== onRetry || $[40] !== retryLabel) {
132
+ t12 = onRetry ? /* @__PURE__ */ jsx(Stale.Retry, {
181
133
  onRetry,
182
134
  children: retryLabel
183
135
  }) : null;
184
- $[18] = onRetry;
185
- $[19] = retryLabel;
186
- $[20] = t9;
187
- } else t9 = $[20];
188
- let t10;
189
- if ($[21] !== t8 || $[22] !== t9) {
190
- t10 = /* @__PURE__ */ jsxs(Stale.Overlay, {
191
- className: data_table_module_default.staleOverlay,
192
- children: [t8, t9]
193
- });
194
- $[21] = t8;
195
- $[22] = t9;
196
- $[23] = t10;
197
- } else t10 = $[23];
198
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [t3, /* @__PURE__ */ jsx("div", {
199
- ref: frameRef,
200
- className: data_table_module_default.scrollFrame,
201
- children: /* @__PURE__ */ jsxs(Stale.Root, {
202
- busy: stale,
203
- className: data_table_module_default.stale,
204
- children: [/* @__PURE__ */ jsx(Stale.Content, {
205
- className: data_table_module_default.stale,
206
- children: /* @__PURE__ */ jsx("div", {
207
- "data-scroller": true,
208
- className: t4,
209
- children: /* @__PURE__ */ jsxs("table", {
210
- className: data_table_module_default.table,
211
- "aria-busy": view === "loading" ? "true" : void 0,
212
- children: [
213
- t5,
214
- /* @__PURE__ */ jsx("thead", {
215
- className: data_table_module_default.thead,
216
- children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", { children: headerGroup.headers.map((header) => {
217
- const sorted = header.column.getIsSorted();
218
- return /* @__PURE__ */ jsx("th", {
219
- scope: "col",
220
- colSpan: header.colSpan,
221
- className: data_table_module_default.th,
222
- "aria-sort": ariaSort(sorted),
223
- ...cellProps(header.column.columnDef.meta, pins.get(header.column.id)),
224
- children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsxs("button", {
225
- type: "button",
226
- className: data_table_module_default.sortToggle,
227
- onClick: () => {
228
- header.column.toggleSorting();
229
- table.setPageIndex(0);
230
- },
231
- children: [/* @__PURE__ */ jsx(table.FlexRender, { header }), /* @__PURE__ */ jsx(Icon, {
232
- svg: sorted === false ? SvgUnfoldMore : SORT_ICON[sorted],
233
- label: "",
234
- className: sorted === false ? data_table_module_default.sortIconIdle : void 0
235
- })]
236
- }) : /* @__PURE__ */ jsx(table.FlexRender, { header })
237
- }, header.id);
238
- }) }, headerGroup.id))
239
- }),
240
- t7
241
- ]
242
- })
243
- })
244
- }), t10]
245
- })
246
- })] });
247
- };
248
- /**
249
- * Inert placeholder rows for a first load: one row per row of the selected page
250
- * size. A column that declares a `placeholderCell` draws it; every other column
251
- * gets a skeleton bar.
252
- */
253
- var PlaceholderRows = (t0) => {
254
- const $ = c(5);
255
- const { rowCount, columns } = t0;
256
- let t1;
257
- if ($[0] !== columns || $[1] !== rowCount) {
258
- let t2;
259
- if ($[3] !== columns) {
260
- t2 = (_, index) => /* @__PURE__ */ jsx("tr", {
261
- className: data_table_module_default.row,
262
- "data-stripe": index % 2 === 1 ? "true" : void 0,
263
- inert: true,
264
- children: columns.map(_temp2)
265
- }, index);
266
- $[3] = columns;
267
- $[4] = t2;
268
- } else t2 = $[4];
269
- t1 = /* @__PURE__ */ jsx(Fragment$1, { children: Array.from({ length: rowCount }, t2) });
270
- $[0] = columns;
271
- $[1] = rowCount;
272
- $[2] = t1;
273
- } else t1 = $[2];
274
- return t1;
136
+ $[39] = onRetry;
137
+ $[40] = retryLabel;
138
+ $[41] = t12;
139
+ } else t12 = $[41];
140
+ let t13;
141
+ if ($[42] !== t11 || $[43] !== t12) {
142
+ t13 = /* @__PURE__ */ jsxs(StaleOverlay, { children: [t11, t12] });
143
+ $[42] = t11;
144
+ $[43] = t12;
145
+ $[44] = t13;
146
+ } else t13 = $[44];
147
+ let t14;
148
+ if ($[45] !== t10 || $[46] !== t13) {
149
+ t14 = /* @__PURE__ */ jsxs(Frame, { children: [t10, t13] });
150
+ $[45] = t10;
151
+ $[46] = t13;
152
+ $[47] = t14;
153
+ } else t14 = $[47];
154
+ let t15;
155
+ if ($[48] !== t14 || $[49] !== t3) {
156
+ t15 = /* @__PURE__ */ jsxs(Fragment, { children: [t3, t14] });
157
+ $[48] = t14;
158
+ $[49] = t3;
159
+ $[50] = t15;
160
+ } else t15 = $[50];
161
+ return t15;
275
162
  };
276
- var StateBody = (t0) => {
277
- const $ = c(4);
278
- const { view, emptyState, errorLabel } = t0;
279
- if (view === "error") {
280
- let t1;
281
- if ($[0] !== errorLabel) {
282
- t1 = /* @__PURE__ */ jsx("span", {
283
- className: data_table_module_default.errorState,
284
- role: "alert",
285
- children: errorLabel
286
- });
287
- $[0] = errorLabel;
288
- $[1] = t1;
289
- } else t1 = $[1];
290
- return t1;
291
- }
292
- let t1;
293
- if ($[2] !== emptyState) {
294
- t1 = /* @__PURE__ */ jsx(Fragment$1, { children: emptyState });
295
- $[2] = emptyState;
296
- $[3] = t1;
297
- } else t1 = $[3];
298
- return t1;
299
- };
300
- function _temp(t0) {
301
- const [id, pin_0] = t0;
302
- return `${id}:${pin_0.side}`;
303
- }
304
- function _temp2(column) {
305
- return /* @__PURE__ */ jsx("td", {
306
- className: data_table_module_default.td,
307
- ...cellProps(column.meta, column.pin),
308
- children: column.meta?.placeholderCell?.() ?? /* @__PURE__ */ jsx(Skeleton, { className: data_table_module_default.skeletonBar })
309
- }, column.id);
163
+ function _temp(cell) {
164
+ return /* @__PURE__ */ jsx(Cell, { cell }, cell.id);
310
165
  }
311
166
  export { DataTableContent };
@@ -1,4 +1,4 @@
1
- import type { ReactTable } from "@tanstack/react-table";
1
+ import type { ReactTable, SortingState } from "@tanstack/react-table";
2
2
  import { type Context } from "react";
3
3
  import type { RowSelectionView } from "../lib/hooks/use-row-selection.ts";
4
4
  import type { DataTableStatus } from "./resolve-view.ts";
@@ -10,6 +10,8 @@ import type { DataTableFeatures } from "./table-features.ts";
10
10
  */
11
11
  export type DataTableContextValue = Readonly<{
12
12
  table: unknown;
13
+ /** The table's sorting, held beside the instance so a part re-renders when it changes. */
14
+ sorting: SortingState;
13
15
  status: DataTableStatus;
14
16
  isFetching: boolean;
15
17
  /** Refetches; the stale overlay and the refresh-failed notice offer it as a retry. */
@@ -27,7 +29,7 @@ export type DataTableState<TData extends Record<string, unknown>> = Omit<DataTab
27
29
  * caller's row type. Pass the same `TData` the table was built with.
28
30
  *
29
31
  * @example
30
- * const { table } = useDataTable<Appointment>();
32
+ * const { table } = useDataTable<Invoice>();
31
33
  * const rows = table.getRowModel().rows;
32
34
  */
33
35
  export declare const useDataTable: <TData extends Record<string, unknown> = Record<string, unknown>>() => DataTableState<TData>;
@@ -9,7 +9,7 @@ var DataTableContext = createContext(null);
9
9
  * caller's row type. Pass the same `TData` the table was built with.
10
10
  *
11
11
  * @example
12
- * const { table } = useDataTable<Appointment>();
12
+ * const { table } = useDataTable<Invoice>();
13
13
  * const rows = table.getRowModel().rows;
14
14
  */
15
15
  var useDataTable = () => {
@@ -0,0 +1,99 @@
1
+ import { useRender } from "@base-ui/react/use-render";
2
+ import type { Cell as TableCell, Header as TableHeader, Row as TableRow } from "@tanstack/react-table";
3
+ import type { ComponentProps, ReactElement, ReactNode } from "react";
4
+ import { type StaleOverlayProps } from "../components/stale/stale.tsx";
5
+ import { type ResolvedView } from "./resolve-view.ts";
6
+ import type { DataTableFeatures } from "./table-features.ts";
7
+ /**
8
+ * Which body the enclosing `DataTable` shows, whether its rows are stale, and
9
+ * whether a refresh failed over rows still on screen.
10
+ *
11
+ * @example
12
+ * const { view } = useDataTableView();
13
+ * if (view === "empty") return <DataTable.StateRow>No invoices yet.</DataTable.StateRow>;
14
+ */
15
+ export declare const useDataTableView: () => ResolvedView;
16
+ export type DataTableRefreshFailedProps = useRender.ComponentProps<"div">;
17
+ /** The alert above rows still on screen when a refresh fails. Renders nothing otherwise. */
18
+ export declare const RefreshFailed: ({ render, className, ref, ...props }: DataTableRefreshFailedProps) => ReactElement | null;
19
+ export type DataTableFrameProps = useRender.ComponentProps<"div">;
20
+ /**
21
+ * The frame that stays put around the scroller: it measures the pinned columns
22
+ * and holds the stale state, so it takes a `Scroller` and a `StaleOverlay`.
23
+ */
24
+ export declare const Frame: ({ render, className, ref, children, ...props }: DataTableFrameProps) => ReactElement;
25
+ export type DataTableScrollerProps = useRender.ComponentProps<"div">;
26
+ /** The scrolling card that holds the `Table`, dimmed while its rows are stale. */
27
+ export declare const Scroller: ({ render, className, ref, ...props }: DataTableScrollerProps) => ReactNode;
28
+ /** What covers the table once a refresh is slow: its `Stale.Message` and `Stale.Retry`. */
29
+ export declare const StaleOverlay: ({ className, ...props }: StaleOverlayProps) => ReactNode;
30
+ export type DataTableTableProps = useRender.ComponentProps<"table">;
31
+ /** The `<table>`, marked busy while its first page loads. */
32
+ export declare const Table: ({ render, className, ref, ...props }: DataTableTableProps) => ReactElement;
33
+ export type DataTableLoadingCaptionProps = useRender.ComponentProps<"caption">;
34
+ /** What is announced while the first page loads, such as "Loading invoices". Renders nothing otherwise. */
35
+ export declare const LoadingCaption: ({ render, className, ref, ...props }: DataTableLoadingCaptionProps) => ReactElement | null;
36
+ export type DataTableHeadProps = useRender.ComponentProps<"thead">;
37
+ /** The header, stuck to the top of the scroller. */
38
+ export declare const Head: ({ render, className, ref, ...props }: DataTableHeadProps) => ReactElement;
39
+ export type DataTableHeaderRowProps = useRender.ComponentProps<"tr">;
40
+ /** One row of header cells. */
41
+ export declare const HeaderRow: ({ render, ref, ...props }: DataTableHeaderRowProps) => ReactElement;
42
+ export type DataTableHeaderCellProps<TData extends Record<string, unknown>> = useRender.ComponentProps<"th"> & Readonly<{
43
+ /** The header this cell draws. */
44
+ header: TableHeader<DataTableFeatures, TData>;
45
+ }>;
46
+ /**
47
+ * A column header, laid out by its column's `meta` and announcing its sort.
48
+ * It draws the column's header unless given children, such as a `SortButton`.
49
+ */
50
+ export declare const HeaderCell: <TData extends Record<string, unknown>>({ header, render, className, style: inlineStyle, ref, children, ...props }: DataTableHeaderCellProps<TData>) => ReactElement;
51
+ export type DataTableSortButtonProps<TData extends Record<string, unknown>> = Omit<ComponentProps<"button">, "ref"> & Readonly<{
52
+ /** The header whose column this sorts. */
53
+ header: TableHeader<DataTableFeatures, TData>;
54
+ /** The glyph while the column sorts ascending. */
55
+ sortAscendingIcon?: ReactNode;
56
+ /** The glyph while the column sorts descending. */
57
+ sortDescendingIcon?: ReactNode;
58
+ /** The glyph while the column is not sorted. */
59
+ unsortedIcon?: ReactNode;
60
+ }>;
61
+ /**
62
+ * The header's sort toggle, which returns the table to its first page. It
63
+ * draws the column's header unless given children, followed by the glyph for
64
+ * the column's sort, where one is given.
65
+ */
66
+ export declare const SortButton: <TData extends Record<string, unknown>>({ header, sortAscendingIcon, sortDescendingIcon, unsortedIcon, className, children, onClick, ...props }: DataTableSortButtonProps<TData>) => ReactNode;
67
+ export type DataTableBodyProps = useRender.ComponentProps<"tbody">;
68
+ /** The body: the page's `Row`s, the `PlaceholderRows` or a `StateRow`. */
69
+ export declare const Body: ({ render, ref, ...props }: DataTableBodyProps) => ReactElement;
70
+ export type DataTableRowProps<TData extends Record<string, unknown>> = useRender.ComponentProps<"tr"> & Readonly<{
71
+ /** The row this draws, which sets its stripe. */
72
+ row: TableRow<DataTableFeatures, TData>;
73
+ }>;
74
+ /** A body row, striped on every other row. */
75
+ export declare const Row: <TData extends Record<string, unknown>>({ row, render, className, ref, ...props }: DataTableRowProps<TData>) => ReactElement;
76
+ export type DataTableCellProps<TData extends Record<string, unknown>> = useRender.ComponentProps<"td"> & Readonly<{
77
+ /** The cell this draws. */
78
+ cell: TableCell<DataTableFeatures, TData>;
79
+ }>;
80
+ /** A body cell, laid out by its column's `meta`. It draws the column's cell unless given children. */
81
+ export declare const Cell: <TData extends Record<string, unknown>>({ cell, render, className, style: inlineStyle, ref, children, ...props }: DataTableCellProps<TData>) => ReactElement;
82
+ export type DataTableSubRowProps = useRender.ComponentProps<"tr">;
83
+ /**
84
+ * The full-width row beneath an expanded row, holding its children. The pinned
85
+ * columns keep their place beside it.
86
+ */
87
+ export declare const SubRow: ({ render, className, ref, children, ...props }: DataTableSubRowProps) => ReactElement;
88
+ /**
89
+ * Inert placeholder rows for a first load: one row per row of the selected page
90
+ * size. A column that declares a `placeholderCell` draws it; every other column
91
+ * gets a skeleton bar.
92
+ */
93
+ export declare const PlaceholderRows: () => ReactNode;
94
+ export type DataTableStateRowProps = useRender.ComponentProps<"tr">;
95
+ /** A row across every column for the body's state, such as the empty state or an `ErrorMessage`. */
96
+ export declare const StateRow: ({ render, ref, children, ...props }: DataTableStateRowProps) => ReactElement;
97
+ export type DataTableErrorMessageProps = useRender.ComponentProps<"span">;
98
+ /** What a failed first load says, as an alert. */
99
+ export declare const ErrorMessage: ({ render, className, ref, ...props }: DataTableErrorMessageProps) => ReactElement;