@ostack.tech/ui 0.15.5 → 0.16.1

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 (259) hide show
  1. package/dist/chunks/{en-Buw2XVWt.js → en-DT1KWQei.js} +2 -2
  2. package/dist/chunks/{en-Buw2XVWt.js.map → en-DT1KWQei.js.map} +1 -1
  3. package/dist/locales/en-GB.js +1 -1
  4. package/dist/locales/en-US.js +1 -1
  5. package/dist/locales/fr-FR.js +1 -1
  6. package/dist/locales/fr-FR.js.map +1 -1
  7. package/dist/locales/pt-PT.js +1 -1
  8. package/dist/locales/pt-PT.js.map +1 -1
  9. package/dist/ostack-ui.css +134 -85
  10. package/dist/ostack-ui.js +2155 -1784
  11. package/dist/ostack-ui.js.map +1 -1
  12. package/package.json +5 -4
  13. package/scss/_utils.scss +0 -2
  14. package/scss/components/Checkbox/_Checkbox-variables.scss +7 -4
  15. package/scss/components/Checkbox/_Checkbox.scss +34 -9
  16. package/scss/components/CheckboxGroup/_CheckboxGroup.scss +9 -0
  17. package/scss/components/Code/_Code-variables.scss +8 -4
  18. package/scss/components/DateRangeInput/_DateRangeInput.scss +1 -1
  19. package/scss/components/Feedback/_Feedback-variables.scss +28 -1
  20. package/scss/components/Feedback/_Feedback.scss +99 -2
  21. package/scss/components/Field/_Field-variables.scss +0 -1
  22. package/scss/components/Field/_Field.scss +4 -40
  23. package/scss/components/HelperText/_HelperText-variables.scss +8 -0
  24. package/scss/components/HelperText/_HelperText.scss +15 -0
  25. package/scss/components/RadioGroup/_Radio.scss +13 -0
  26. package/scss/components/RadioGroup/_RadioGroup.scss +9 -0
  27. package/scss/components/Select/_Select.scss +2 -2
  28. package/scss/index.scss +0 -2
  29. package/scss/scss/placeholders/button/_button.scss +10 -6
  30. package/scss/scss/placeholders/checkable/_checkable-variables.scss +3 -2
  31. package/scss/scss/placeholders/checkable/_checkable.scss +25 -7
  32. package/scss/scss/placeholders/checkable-group/_checkable-group-variables.scss +1 -0
  33. package/scss/scss/placeholders/checkable-group/_checkable-group.scss +15 -3
  34. package/scss/scss/placeholders/popover/_popover.scss +3 -0
  35. package/scss/scss/utils/_breakpoints.scss +1 -1
  36. package/scss/scss/utils/_declare-var.scss +1 -1
  37. package/types/components/Alert/Alert.d.ts +12 -15
  38. package/types/components/Alert/AlertTitle.d.ts +2 -2
  39. package/types/components/AlertDialog/AlertDialog.d.ts +6 -2
  40. package/types/components/AlertDialog/AlertDialogAction.d.ts +3 -3
  41. package/types/components/AlertDialog/AlertDialogBody.d.ts +3 -5
  42. package/types/components/AlertDialog/AlertDialogCancel.d.ts +3 -3
  43. package/types/components/AlertDialog/AlertDialogContent.d.ts +6 -6
  44. package/types/components/AlertDialog/AlertDialogDescription.d.ts +3 -3
  45. package/types/components/AlertDialog/AlertDialogFooter.d.ts +3 -5
  46. package/types/components/AlertDialog/AlertDialogHeader.d.ts +3 -4
  47. package/types/components/AlertDialog/AlertDialogTitle.d.ts +4 -4
  48. package/types/components/AlertDialog/AlertDialogTrigger.d.ts +3 -3
  49. package/types/components/Button/Button.d.ts +14 -15
  50. package/types/components/ButtonGroup/ButtonGroup.d.ts +3 -3
  51. package/types/components/Calendar/Calendar.d.ts +6 -6
  52. package/types/components/Calendar/CalendarDay.d.ts +1 -1
  53. package/types/components/Calendar/CalendarHeader.d.ts +1 -1
  54. package/types/components/Calendar/CalendarMonthGrid.d.ts +1 -1
  55. package/types/components/Card/Card.d.ts +3 -3
  56. package/types/components/Card/CardBody.d.ts +3 -3
  57. package/types/components/Card/CardFooter.d.ts +3 -3
  58. package/types/components/Card/CardHeader.d.ts +3 -3
  59. package/types/components/Card/CardTitle.d.ts +3 -3
  60. package/types/components/Checkbox/Checkbox.d.ts +22 -14
  61. package/types/components/CheckboxGroup/CheckboxGroup.d.ts +22 -12
  62. package/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +15 -9
  63. package/types/components/CheckboxGroup/checkboxGroupUtils.d.ts +3 -0
  64. package/types/components/ClearContexts/ClearContexts.d.ts +19 -1
  65. package/types/components/CloseButton/CloseButton.d.ts +3 -4
  66. package/types/components/Code/Code.d.ts +3 -3
  67. package/types/components/Collapsible/Collapsible.d.ts +5 -3
  68. package/types/components/Collapsible/CollapsibleContent.d.ts +3 -3
  69. package/types/components/Collapsible/CollapsibleTrigger.d.ts +5 -5
  70. package/types/components/CommandMenu/CommandMenu.d.ts +18 -20
  71. package/types/components/CommandMenu/CommandMenuDialog.d.ts +6 -6
  72. package/types/components/CommandMenu/CommandMenuGroup.d.ts +3 -3
  73. package/types/components/CommandMenu/CommandMenuItem.d.ts +5 -3
  74. package/types/components/Container/Container.d.ts +3 -3
  75. package/types/components/Control/Control.d.ts +13 -13
  76. package/types/components/Control/ControlWithContainerRef.d.ts +12 -5
  77. package/types/components/Control/controlUtils.d.ts +24 -0
  78. package/types/components/ControlAddon/ControlAddon.d.ts +9 -3
  79. package/types/components/ControlCode/ControlCode.d.ts +3 -3
  80. package/types/components/DataTable/DataTable.d.ts +32 -21
  81. package/types/components/DataTable/DataTableBody.d.ts +4 -4
  82. package/types/components/DataTable/DataTableCell.d.ts +6 -4
  83. package/types/components/DataTable/DataTableColumn.d.ts +32 -11
  84. package/types/components/DataTable/DataTableColumnGroup.d.ts +31 -0
  85. package/types/components/DataTable/DataTableColumns.d.ts +14 -0
  86. package/types/components/DataTable/DataTableContent.d.ts +8 -8
  87. package/types/components/DataTable/DataTableContext.d.ts +7 -6
  88. package/types/components/DataTable/DataTableFilter.d.ts +1 -1
  89. package/types/components/DataTable/DataTableFoot.d.ts +6 -4
  90. package/types/components/DataTable/DataTableHead.d.ts +3 -4
  91. package/types/components/DataTable/DataTablePagination.d.ts +6 -6
  92. package/types/components/DataTable/DataTableRow.d.ts +3 -4
  93. package/types/components/DataTable/DataTableRowsPerPage.d.ts +3 -3
  94. package/types/components/DataTable/DataTableSelectionTrigger.d.ts +4 -4
  95. package/types/components/DataTable/PagedDataTablePagination.d.ts +3 -3
  96. package/types/components/DataTable/ScrolledDataTablePagination.d.ts +3 -3
  97. package/types/components/DataTable/__tests__/spliceWindow.test.d.ts +1 -0
  98. package/types/components/DataTable/columnUtils.d.ts +4 -3
  99. package/types/components/DataTable/index.d.ts +2 -0
  100. package/types/components/DataTable/processRows.d.ts +7 -7
  101. package/types/components/DataTable/sanitizeProps.d.ts +2 -2
  102. package/types/components/DataTable/useDataTableSelectionColumn.d.ts +2 -2
  103. package/types/components/DateInput/DateInput.d.ts +27 -18
  104. package/types/components/DateRangeInput/DateRangeInput.d.ts +37 -24
  105. package/types/components/DescriptionList/DescriptionList.d.ts +4 -4
  106. package/types/components/DescriptionList/DescriptionListItem.d.ts +4 -4
  107. package/types/components/Dialog/Dialog.d.ts +5 -1
  108. package/types/components/Dialog/DialogBody.d.ts +3 -4
  109. package/types/components/Dialog/DialogClose.d.ts +3 -3
  110. package/types/components/Dialog/DialogContent.d.ts +6 -6
  111. package/types/components/Dialog/DialogDescription.d.ts +3 -3
  112. package/types/components/Dialog/DialogFooter.d.ts +3 -4
  113. package/types/components/Dialog/DialogHeader.d.ts +5 -6
  114. package/types/components/Dialog/DialogTitle.d.ts +4 -4
  115. package/types/components/Dialog/DialogTrigger.d.ts +3 -3
  116. package/types/components/DropdownMenu/DropdownMenu.d.ts +4 -4
  117. package/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +5 -5
  118. package/types/components/DropdownMenu/DropdownMenuContent.d.ts +7 -7
  119. package/types/components/DropdownMenu/DropdownMenuGroup.d.ts +3 -3
  120. package/types/components/DropdownMenu/DropdownMenuItem.d.ts +4 -4
  121. package/types/components/DropdownMenu/DropdownMenuRadioGroup.d.ts +3 -3
  122. package/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -4
  123. package/types/components/DropdownMenu/DropdownMenuSub.d.ts +4 -0
  124. package/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +5 -5
  125. package/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +3 -3
  126. package/types/components/DropdownMenu/DropdownMenuTrigger.d.ts +3 -3
  127. package/types/components/ErrorBoundary/ErrorBoundary.d.ts +9 -9
  128. package/types/components/Feedback/Feedback.d.ts +3 -3
  129. package/types/components/Feedback/FeedbackContext.d.ts +46 -0
  130. package/types/components/Feedback/FeedbackList.d.ts +6 -0
  131. package/types/components/Feedback/FeedbackListContext.d.ts +2 -0
  132. package/types/components/{FeedbackPopover → Feedback}/FeedbackPopover.d.ts +7 -7
  133. package/types/components/Feedback/FeedbackProvider.d.ts +13 -0
  134. package/types/components/Feedback/feedbackUtils.d.ts +19 -0
  135. package/types/components/Feedback/index.d.ts +4 -0
  136. package/types/components/Field/Field.d.ts +3 -3
  137. package/types/components/Field/FieldContext.d.ts +2 -70
  138. package/types/components/Field/fieldUtils.d.ts +7 -0
  139. package/types/components/Field/index.d.ts +1 -2
  140. package/types/components/FieldGroup/FieldGroup.d.ts +3 -3
  141. package/types/components/FieldGroup/FieldGroupBody.d.ts +3 -3
  142. package/types/components/FieldGroup/FieldGroupHeader.d.ts +4 -4
  143. package/types/components/FieldGroup/FieldGroupTitle.d.ts +2 -2
  144. package/types/components/Form/Form.d.ts +6 -6
  145. package/types/components/Form/FormContext.d.ts +1 -1
  146. package/types/components/Form/FormReset.d.ts +2 -2
  147. package/types/components/Form/FormSubmit.d.ts +2 -2
  148. package/types/components/Form/HiddenFormControl.d.ts +2 -2
  149. package/types/components/Form/useRegisterFormControl.d.ts +1 -1
  150. package/types/components/Grid/Grid.d.ts +4 -4
  151. package/types/components/Grid/GridContext.d.ts +10 -0
  152. package/types/components/Heading/Heading.d.ts +2 -2
  153. package/types/components/HelperText/HelperText.d.ts +3 -3
  154. package/types/components/HelperText/HelperTextContext.d.ts +38 -0
  155. package/types/components/HelperText/HelperTextProvider.d.ts +13 -0
  156. package/types/components/HelperText/helperTextUtils.d.ts +2 -0
  157. package/types/components/HelperText/index.d.ts +2 -0
  158. package/types/components/Icon/Icon.d.ts +3 -3
  159. package/types/components/IconButton/IconButton.d.ts +17 -17
  160. package/types/components/Input/Input.d.ts +1 -1
  161. package/types/components/Keybinds/Keybinds.d.ts +8 -3
  162. package/types/components/Keyboard/Keyboard.d.ts +3 -3
  163. package/types/components/Label/Label.d.ts +14 -14
  164. package/types/components/Label/LabelContext.d.ts +45 -0
  165. package/types/components/Label/LabelProvider.d.ts +13 -0
  166. package/types/components/Label/index.d.ts +2 -0
  167. package/types/components/Label/labelUtils.d.ts +23 -0
  168. package/types/components/Layer/Layer.d.ts +5 -5
  169. package/types/components/Link/Link.d.ts +4 -5
  170. package/types/components/Mark/Mark.d.ts +3 -3
  171. package/types/components/MenuList/MenuList.d.ts +3 -3
  172. package/types/components/MenuList/MenuListGroup.d.ts +5 -5
  173. package/types/components/MenuList/MenuListItem.d.ts +13 -14
  174. package/types/components/NumericInput/NumericInput.d.ts +5 -5
  175. package/types/components/NumericInput/numericInputUtils.d.ts +2 -2
  176. package/types/components/Output/Output.d.ts +2 -2
  177. package/types/components/Overlay/Overlay.d.ts +3 -3
  178. package/types/components/Popover/Popover.d.ts +4 -0
  179. package/types/components/Popover/PopoverAnchor.d.ts +4 -0
  180. package/types/components/Popover/PopoverClose.d.ts +5 -5
  181. package/types/components/Popover/PopoverContent.d.ts +5 -5
  182. package/types/components/Popover/PopoverTrigger.d.ts +3 -3
  183. package/types/components/Portal/Portal.d.ts +3 -3
  184. package/types/components/Printer/Printer.d.ts +1 -1
  185. package/types/components/Printer/PrinterContent.d.ts +5 -5
  186. package/types/components/Printer/PrinterTrigger.d.ts +4 -4
  187. package/types/components/RadioGroup/Radio.d.ts +23 -13
  188. package/types/components/RadioGroup/RadioGroup.d.ts +19 -16
  189. package/types/components/Root/Root.d.ts +9 -9
  190. package/types/components/Root/RootElement.d.ts +3 -3
  191. package/types/components/Select/Option.d.ts +3 -4
  192. package/types/components/Select/OptionsGroup.d.ts +3 -4
  193. package/types/components/Select/Select.d.ts +17 -13
  194. package/types/components/Select/SelectContext.d.ts +6 -12
  195. package/types/components/Select/SelectNative.d.ts +3 -3
  196. package/types/components/Select/selectUtils.d.ts +3 -0
  197. package/types/components/Separator/Separator.d.ts +3 -3
  198. package/types/components/Slot/Slot.d.ts +5 -0
  199. package/types/components/Slot/Slottable.d.ts +2 -2
  200. package/types/components/Spinner/Spinner.d.ts +3 -3
  201. package/types/components/Stack/Stack.d.ts +4 -4
  202. package/types/components/Stack/StackContext.d.ts +9 -0
  203. package/types/components/Stepper/Step.d.ts +6 -6
  204. package/types/components/Stepper/StepContent.d.ts +5 -5
  205. package/types/components/Stepper/StepList.d.ts +3 -3
  206. package/types/components/Stepper/Stepper.d.ts +6 -6
  207. package/types/components/Stepper/StepperFinishTrigger.d.ts +5 -5
  208. package/types/components/Stepper/StepperNextTrigger.d.ts +5 -5
  209. package/types/components/Stepper/StepperPreviousTrigger.d.ts +5 -5
  210. package/types/components/Table/Table.d.ts +15 -10
  211. package/types/components/Table/TableBody.d.ts +3 -3
  212. package/types/components/Table/TableCell.d.ts +3 -3
  213. package/types/components/Table/TableColumn.d.ts +29 -21
  214. package/types/components/Table/TableColumnGroup.d.ts +38 -0
  215. package/types/components/Table/TableContext.d.ts +1 -1
  216. package/types/components/Table/TableFoot.d.ts +3 -3
  217. package/types/components/Table/TableHead.d.ts +15 -7
  218. package/types/components/Table/TableRow.d.ts +3 -3
  219. package/types/components/Table/columnUtils.d.ts +11 -17
  220. package/types/components/Table/index.d.ts +1 -0
  221. package/types/components/Tabs/Tab.d.ts +7 -7
  222. package/types/components/Tabs/TabContent.d.ts +4 -4
  223. package/types/components/Tabs/TabList.d.ts +8 -8
  224. package/types/components/Tabs/Tabs.d.ts +8 -6
  225. package/types/components/Tag/Badge.d.ts +2 -2
  226. package/types/components/Tag/Tag.d.ts +10 -10
  227. package/types/components/TextArea/TextArea.d.ts +2 -2
  228. package/types/components/Toast/Toast.d.ts +13 -13
  229. package/types/components/Toast/ToastDescription.d.ts +4 -0
  230. package/types/components/Toast/ToastProvider.d.ts +2 -2
  231. package/types/components/Toast/ToastTitle.d.ts +3 -3
  232. package/types/components/Toast/ToastViewport.d.ts +3 -3
  233. package/types/components/Tooltip/Tooltip.d.ts +5 -5
  234. package/types/components/Tooltip/TooltipProvider.d.ts +4 -0
  235. package/types/components/VisuallyHidden/VisuallyHidden.d.ts +2 -2
  236. package/types/index.d.ts +1 -2
  237. package/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +12 -12
  238. package/types/providers/ErrorReportingProvider/ErrorReportingProvider.d.ts +1 -1
  239. package/types/providers/LocalizationProvider/LocalizationObject.d.ts +2 -3
  240. package/types/providers/ToastManagerProvider/ToastManagerContext.d.ts +6 -6
  241. package/types/utils/__tests__/combineEventHandlers.test.d.ts +1 -0
  242. package/types/utils/__tests__/cx.test.d.ts +1 -0
  243. package/types/utils/__tests__/numericStringUtils.test.d.ts +1 -0
  244. package/types/utils/__tests__/useNumericTrasformer.test.d.ts +1 -0
  245. package/types/utils/documentTitleUtils.d.ts +4 -0
  246. package/types/utils/parseChildren.d.ts +64 -0
  247. package/types/utils/polymorphicTypes.d.ts +2 -13
  248. package/types/utils/useLocation.d.ts +3 -3
  249. package/types/utils/useNumericTransformer.d.ts +9 -6
  250. package/scss/components/FeedbackList/_FeedbackList-variables.scss +0 -6
  251. package/scss/components/FeedbackList/_FeedbackList.scss +0 -32
  252. package/scss/components/FeedbackPopover/_FeedbackPopover-variables.scss +0 -26
  253. package/scss/components/FeedbackPopover/_FeedbackPopover.scss +0 -66
  254. package/types/components/FeedbackList/FeedbackList.d.ts +0 -6
  255. package/types/components/FeedbackList/FeedbackListContext.d.ts +0 -4
  256. package/types/components/FeedbackList/index.d.ts +0 -2
  257. package/types/components/FeedbackPopover/index.d.ts +0 -2
  258. package/types/components/Field/FieldProvider.d.ts +0 -13
  259. /package/types/components/{FeedbackPopover → Feedback}/FeedbackPopoverContext.d.ts +0 -0
@@ -1,7 +1,11 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
2
2
  import { type ControlStatus, type ControlVariant } from "../Control";
3
+ /** Elements a control addon can be rendered as. */
4
+ export type ControlAddonAs = "div" | "button" | "a";
3
5
  /** Properties of the control addon component. */
4
- export interface ControlAddonProps extends ComponentPropsWithoutRef<"div"> {
6
+ export type ControlAddonProps<TAs extends ControlAddonAs = "div"> = PolymorphicProps<ControlAddonAs, TAs, "div", ControlAddonOwnProps>;
7
+ /** Own properties of the control addon component. */
8
+ export interface ControlAddonOwnProps {
5
9
  /**
6
10
  * Change the component to the HTML tag or custom component of the only child.
7
11
  * This will merge the original component props with the props of the supplied
@@ -25,6 +29,8 @@ export interface ControlAddonProps extends ComponentPropsWithoutRef<"div"> {
25
29
  muted?: boolean;
26
30
  /** Styles the addon as read-only. */
27
31
  readOnly?: boolean;
32
+ /** Type of the button or anchor. */
33
+ type?: string;
28
34
  }
29
35
  /**
30
36
  * Component used as an "add-on" for controls.
@@ -33,4 +39,4 @@ export interface ControlAddonProps extends ComponentPropsWithoutRef<"div"> {
33
39
  * `endAdornment` properties of a control, but can also be used standalone where
34
40
  * it makes sense.
35
41
  */
36
- export declare const ControlAddon: import("react").ForwardRefExoticComponent<ControlAddonProps & import("react").RefAttributes<HTMLDivElement>>;
42
+ export declare function ControlAddon<TAs extends ControlAddonAs = "div">({ as, asChild, variant, status, muted, readOnly, className, type, ...otherProps }: ControlAddonProps<TAs>): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
- import { type ComponentPropsWithoutRef, type ReactNode } from "react";
1
+ import type { ComponentProps, ReactNode } from "react";
2
2
  import { type ControlStatus, type ControlVariant } from "../Control";
3
3
  /** Properties of the control's code component. */
4
- export interface ControlCodeProps extends ComponentPropsWithoutRef<"div"> {
4
+ export interface ControlCodeProps extends ComponentProps<"div"> {
5
5
  /**
6
6
  * Change the component to the HTML tag or custom component of the only child.
7
7
  * This will merge the original component props with the props of the supplied
@@ -19,4 +19,4 @@ export interface ControlCodeProps extends ComponentPropsWithoutRef<"div"> {
19
19
  visuallyHiddenPrefix?: ReactNode;
20
20
  }
21
21
  /** Component used to display the "code" of a form control. */
22
- export declare const ControlCode: import("react").ForwardRefExoticComponent<ControlCodeProps & import("react").RefAttributes<HTMLDivElement>>;
22
+ export declare function ControlCode({ asChild, variant, status, visuallyHiddenPrefix, className, children, ...otherProps }: ControlCodeProps): import("react").JSX.Element;
@@ -1,10 +1,13 @@
1
- import { type ComponentPropsWithoutRef, type Key, type ReactNode, type Ref } from "react";
1
+ import { type ComponentProps, type Key, type ReactNode, type Ref } from "react";
2
2
  import type { SortDirection } from "../../utils/sorting.ts";
3
3
  import type { CheckboxChecked } from "../Checkbox";
4
4
  import type { DataTableApi } from "./DataTableApi.ts";
5
5
  import type { DataTableCellProps } from "./DataTableCell.tsx";
6
- import type { DataTableColumns } from "./DataTableColumn.tsx";
6
+ import { type DataTableColumnObject } from "./DataTableColumn.tsx";
7
+ import { type DataTableColumnGroupObject } from "./DataTableColumnGroup.tsx";
7
8
  import type { DataTableRowProps } from "./DataTableRow.tsx";
9
+ /** Object representation of the data table columns. */
10
+ export type DataTableColumnsObject<T = unknown> = Record<string, DataTableColumnObject<T> | DataTableColumnGroupObject<T>>;
8
11
  /** Display mode of the data table. */
9
12
  export type DataTableDisplayMode = "paged" | "scrolled";
10
13
  /** Selection mode of the data table. */
@@ -44,7 +47,15 @@ export interface DataTableGetRowsResult<T = unknown> {
44
47
  totalCount: number;
45
48
  }
46
49
  /** Properties of the data table component. */
47
- export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div"> {
50
+ export interface DataTableProps<T = any> extends ComponentProps<"div"> {
51
+ /** Data table columns in object notation. */
52
+ columns?: DataTableColumnsObject<T>;
53
+ /**
54
+ * Rows of the data table.
55
+ *
56
+ * Either this property or `getRows` should be provided.
57
+ */
58
+ rows?: T[];
48
59
  /**
49
60
  * Display mode of the data table. Rows are displayed either in pages or
50
61
  * within an infinite scroll component.
@@ -52,14 +63,6 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
52
63
  * @default "paged"
53
64
  */
54
65
  displayMode?: DataTableDisplayMode;
55
- /** Data table columns. */
56
- columns: DataTableColumns<T>;
57
- /**
58
- * Rows of the data table.
59
- *
60
- * Either this property or `getRows` should be provided.
61
- */
62
- rows?: T[];
63
66
  /**
64
67
  * Function called whenever the rows visible on screen change. This function
65
68
  * is only called when a `rows` property is provided.
@@ -99,7 +102,10 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
99
102
  * @default 2
100
103
  */
101
104
  loadingCount?: number;
102
- /** Marks the data table as "required" when it is being used as a control. */
105
+ /**
106
+ * Whether the data table should be marked as required when it is being used
107
+ * as a control.
108
+ */
103
109
  required?: boolean;
104
110
  /** Marks the data table as currently loading data. */
105
111
  loading?: boolean;
@@ -290,10 +296,15 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
290
296
  /**
291
297
  * The data table component allows displaying, browsing, sorting, and filtering
292
298
  * large amounts of structured data. Built on top of the [`Table`
293
- * component](?path=/docs/ostack-ui-data-display-table--docs).
299
+ * component](/docs/ostack-ui-data-display-table--docs).
294
300
  *
295
301
  * It composes the following subcomponents:
296
302
  *
303
+ * - `DataTableColumns`: Container for the definition of all data table columns
304
+ * and their groups.
305
+ * - `DataTableColumn`: Component used to define a column of the data table.
306
+ * - `DataTableColumnGroup`: Component used to define a column group of the data
307
+ * table.
297
308
  * - `DataTableContent`: Main content of the data table, containing the table
298
309
  * itself.
299
310
  * - `DataTablePagination`: Pagination component of the data table, allowing the
@@ -321,13 +332,6 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
321
332
  * function InventoryTable() {
322
333
  * return (
323
334
  * <DataTable
324
- * columns={{
325
- * sku: { label: "SKU", header: true },
326
- * product: { label: "Product" },
327
- * category: { label: "Category" },
328
- * stock: { label: "Stock" },
329
- * condition: { label: "Condition" },
330
- * }}
331
335
  * rowKey="sku"
332
336
  * rows={[
333
337
  * {
@@ -340,6 +344,13 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
340
344
  * // …
341
345
  * ]}
342
346
  * >
347
+ * <DataTableColumns>
348
+ * <DataTableColumn name="sku" label="SKU" header />
349
+ * <DataTableColumn name="product" label="Product" />
350
+ * <DataTableColumn name="category" label="Category" />
351
+ * <DataTableColumn name="stock" label="Stock" />
352
+ * <DataTableColumn name="condition" label="Condition" />
353
+ * </DataTableColumns>
343
354
  * <DataTableContent caption="Inventory" />
344
355
  * <DataTableRowsPerPage />
345
356
  * <DataTablePagination />
@@ -348,4 +359,4 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
348
359
  * }
349
360
  * ```
350
361
  */
351
- export declare const DataTable: import("react").ForwardRefExoticComponent<DataTableProps<any> & import("react").RefAttributes<HTMLDivElement>>;
362
+ export declare function DataTable<T = any>({ displayMode, columns: columnsProp, rows, onVisibleRowsChange, onProcessedRowsChange, getRows, rowKey, loadingCount, required, loading, defaultOffset, offset, onOffsetChange, defaultLimit, limit, onLimitChange, defaultFilter, filter, onFilterChange, defaultSortBy, sortBy, defaultSortDirection, sortDirection, onSort, showSelectionColumn, selectionMode, defaultSelectedRows, selectedRows, onSelectedRowsChange, selectAllChecked, onSelectAll, disabledSelections, selectAllRowsLabel, selectRowLabel, renderRow, renderCell, dynamicRowHeight, estimatedRowHeight, overscan, showAllRowsWhilePrinting, apiRef, className, children, ...otherProps }: DataTableProps<T>): import("react").JSX.Element;
@@ -1,9 +1,9 @@
1
- import { type ComponentPropsWithoutRef, type RefObject } from "react";
2
- import { TableBody } from "../Table";
1
+ import type { RefObject } from "react";
2
+ import { type TableBodyProps } from "../Table";
3
3
  import type { DataTableContentProps } from "./DataTableContent.tsx";
4
4
  /** Properties of the data table foot component. */
5
- export interface DataTableBodyProps extends ComponentPropsWithoutRef<typeof TableBody>, Pick<DataTableContentProps, "emptyMessage" | "emptyMessageProps"> {
5
+ export interface DataTableBodyProps extends TableBodyProps, Pick<DataTableContentProps, "emptyMessage" | "emptyMessageProps"> {
6
6
  scrollableRef: RefObject<HTMLDivElement | null>;
7
7
  }
8
8
  /** Body of the data table. */
9
- export declare const DataTableBody: import("react").ForwardRefExoticComponent<DataTableBodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
9
+ export declare function DataTableBody({ emptyMessage, emptyMessageProps, scrollableRef, ...otherProps }: DataTableBodyProps): import("react").JSX.Element;
@@ -1,9 +1,11 @@
1
- import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
- import { TableCell } from "../Table";
1
+ import type { ReactNode } from "react";
2
+ import { type TableCellProps } from "../Table";
3
3
  /** Properties of a data table cell. */
4
- export interface DataTableCellProps extends ComponentPropsWithoutRef<typeof TableCell> {
4
+ export interface DataTableCellProps extends TableCellProps {
5
+ /** Label of the column this cell belongs to. */
5
6
  columnLabel?: ReactNode;
7
+ /** Id of the column label this cell belongs to. */
6
8
  columnLabelId?: string;
7
9
  }
8
10
  /** Data table cell. */
9
- export declare const DataTableCell: import("react").ForwardRefExoticComponent<DataTableCellProps & import("react").RefAttributes<HTMLTableDataCellElement>>;
11
+ export declare function DataTableCell({ columnLabel, columnLabelId, className, ...otherProps }: DataTableCellProps): import("react").JSX.Element;
@@ -1,10 +1,8 @@
1
- import type { ComponentPropsWithRef, ReactNode } from "react";
1
+ import type { ReactNode } from "react";
2
2
  import type { MatchAgainstFilter } from "../../utils/filtering.ts";
3
- import { TableCell, type TableColumn } from "../Table";
4
- /** Data table columns. */
5
- export type DataTableColumns<T = unknown> = Record<string, DataTableColumn<T>>;
6
- /** Data table column. */
7
- export interface DataTableColumn<T = unknown, TValue = any> extends Omit<ComponentPropsWithRef<typeof TableColumn>, "sorted" | "onSort"> {
3
+ import type { TableCellProps, TableColumnObject } from "../Table";
4
+ /** Object representation of a data table column. */
5
+ export interface DataTableColumnObject<T = unknown, TValue = any> extends Omit<TableColumnObject, "sorted" | "onSort"> {
8
6
  /**
9
7
  * Whether values of this column can be filtered.
10
8
  *
@@ -18,8 +16,6 @@ export interface DataTableColumn<T = unknown, TValue = any> extends Omit<Compone
18
16
  * provided.
19
17
  */
20
18
  locale?: string;
21
- /** Sub columns of this column. */
22
- subColumns?: DataTableColumns<T>;
23
19
  /**
24
20
  * Optional function used to get the value associated with this column from
25
21
  * the row. The default getter uses the column identifier as a property to
@@ -35,7 +31,7 @@ export interface DataTableColumn<T = unknown, TValue = any> extends Omit<Compone
35
31
  * Function used to render the cell's content. By default, the formatted value
36
32
  * is rendered, possibly highlighted when it matches the filter.
37
33
  */
38
- render?: (renderData: DataTableColumnRenderData<T, TValue>) => ReactNode;
34
+ render?: ReactNode | ((renderData: DataTableColumnRenderData<T, TValue>) => ReactNode);
39
35
  /**
40
36
  * Comparison function used when sorting values of this column. The default
41
37
  * sorting function can handle primitive values and dates. When sorting other
@@ -51,8 +47,16 @@ export interface DataTableColumn<T = unknown, TValue = any> extends Omit<Compone
51
47
  sortOptions?: DataTableColumnSortOptions;
52
48
  /** Optional footer content to be rendered in the table foot. */
53
49
  footer?: ReactNode | ((footerData: DataTableColumnFooterData<T>) => ReactNode);
50
+ /**
51
+ * Whether the column should be shown while the data table is being printed.
52
+ *
53
+ * @default true
54
+ */
55
+ showWhilePrinting?: boolean;
56
+ /** Column head cell's `id` property. */
57
+ cellId?: string;
54
58
  /** Properties to pass to the column table foot cell. */
55
- footerProps?: ComponentPropsWithRef<typeof TableCell>;
59
+ footerProps?: TableCellProps;
56
60
  }
57
61
  /** Data passed to a data table column's `getValue` function. */
58
62
  export interface DataTableColumnGetValueData<T = unknown> {
@@ -80,7 +84,7 @@ export interface DataTableColumnRenderData<T = unknown, TValue = unknown> extend
80
84
  markedValue: ReactNode;
81
85
  }
82
86
  /** Data passed to a data table column's `footer` function. */
83
- export interface DataTableColumnFooterData<T> {
87
+ export interface DataTableColumnFooterData<T = unknown> {
84
88
  /** Rows. */
85
89
  rows?: T[];
86
90
  /** Total number of rows. */
@@ -88,3 +92,20 @@ export interface DataTableColumnFooterData<T> {
88
92
  }
89
93
  /** Options used when sorting when a custom `compare` is not provided. */
90
94
  export type DataTableColumnSortOptions = Omit<Intl.CollatorOptions, "usage">;
95
+ /** Properties of the data table column component. */
96
+ export interface DataTableColumnProps<T = any, TValue = any> extends Omit<DataTableColumnObject<T, TValue>, "id" | "subColumns"> {
97
+ /** Identifier of the data table column. */
98
+ id: string;
99
+ /**
100
+ * Rendered content of the column's cell. If both `render` and `children` are
101
+ * provided, `render` takes priority.
102
+ */
103
+ children?: DataTableColumnObject<T, TValue>["render"];
104
+ }
105
+ /**
106
+ * Definition of a data table column.
107
+ *
108
+ * This component doesn't actually render anything by itself; it is used by the
109
+ * `DataTable` component to automatically create the `columns` object.
110
+ */
111
+ export declare function DataTableColumn<T = any, TValue = any>(_props: DataTableColumnProps<T, TValue>): null;
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from "react";
2
+ import type { TableColumnGroupObject } from "../Table";
3
+ import type { DataTableColumnsObject } from "./DataTable.tsx";
4
+ /** Object representation of a data table column group. */
5
+ export interface DataTableColumnGroupObject<T = unknown> extends Omit<TableColumnGroupObject, "subColumns"> {
6
+ /** Sub-columns of the data table column group. */
7
+ subColumns: DataTableColumnsObject<T>;
8
+ /**
9
+ * Whether the column group should be shown while the data table is being
10
+ * printed.
11
+ *
12
+ * @default true
13
+ */
14
+ showWhilePrinting?: boolean;
15
+ /** Column head cell's `id` property. */
16
+ cellId?: string;
17
+ }
18
+ /** Properties of the data table column group component. */
19
+ export interface DataTableColumnGroupProps extends Omit<DataTableColumnGroupObject, "id" | "subColumns"> {
20
+ /** Identifier of the data table column. */
21
+ id: string;
22
+ /** Sub-columns of this data table column. */
23
+ children?: ReactNode;
24
+ }
25
+ /**
26
+ * Definition of a data table column group.
27
+ *
28
+ * This component doesn't actually render anything by itself; it is used by the
29
+ * `DataTable` component to automatically create the `columns` object.
30
+ */
31
+ export declare function DataTableColumnGroup(_props: DataTableColumnGroupProps): null;
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from "react";
2
+ /** Properties of the data table columns component. */
3
+ export interface DataTableColumnsProps {
4
+ /** Data table columns. */
5
+ children: ReactNode;
6
+ }
7
+ /**
8
+ * Container for the definition of all data table columns. This component must
9
+ * be a direct child of the `DataTable` component.
10
+ *
11
+ * This component doesn't actually render anything by itself; it is used by the
12
+ * `DataTable` component to automatically create the `columns` object.
13
+ */
14
+ export declare function DataTableColumns(_props: DataTableColumnsProps): null;
@@ -1,7 +1,7 @@
1
- import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from "react";
2
- import { Table, type TableBody, type TableFoot, type TableHead } from "../Table";
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ import { type TableBodyProps, type TableFootProps, type TableHeadProps, type TableProps } from "../Table";
3
3
  /** Properties of the data table content component. */
4
- export interface DataTableContentProps extends Omit<ComponentPropsWithoutRef<typeof Table>, "layout"> {
4
+ export interface DataTableContentProps extends Omit<TableProps, "layout"> {
5
5
  /** Message to display when the data table contains no rows. */
6
6
  emptyMessage?: ReactNode;
7
7
  /** Content of the table foot component. */
@@ -13,16 +13,16 @@ export interface DataTableContentProps extends Omit<ComponentPropsWithoutRef<typ
13
13
  */
14
14
  showTableFootWhenEmpty?: boolean;
15
15
  /** Properties to pass to the table head component. */
16
- tableHeadProps?: ComponentPropsWithRef<typeof TableHead>;
16
+ tableHeadProps?: TableHeadProps;
17
17
  /** Properties to pass to the table body component. */
18
- tableBodyProps?: ComponentPropsWithRef<typeof TableBody>;
18
+ tableBodyProps?: TableBodyProps;
19
19
  /** Properties to pass to the table foot component, when one exists. */
20
- tableFootProps?: ComponentPropsWithRef<typeof TableFoot>;
20
+ tableFootProps?: TableFootProps;
21
21
  /** Properties to pass to the component containing the empty message. */
22
- emptyMessageProps?: ComponentPropsWithRef<"div">;
22
+ emptyMessageProps?: ComponentProps<"div">;
23
23
  }
24
24
  /**
25
25
  * Component containing the "main content" of the data table, i.e. the table
26
26
  * itself.
27
27
  */
28
- export declare const DataTableContent: import("react").ForwardRefExoticComponent<DataTableContentProps & import("react").RefAttributes<HTMLTableElement>>;
28
+ export declare function DataTableContent({ emptyMessage, tableFootContent, showTableFootWhenEmpty, containerProps, scrollableProps, tableHeadProps, tableBodyProps, tableFootProps, emptyMessageProps, className, ref, ...otherProps }: DataTableContentProps): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { type Key, type ReactNode } from "react";
2
2
  import type { SortDirection } from "../../utils/sorting.ts";
3
- import type { DataTableDisplayMode, DataTableGetRowsOptions, DataTableGetRowsResult, DataTableProps, DataTableSelectionMode } from "./DataTable.tsx";
4
- import type { DataTableColumns } from "./DataTableColumn.tsx";
3
+ import type { DataTableColumnsObject, DataTableDisplayMode, DataTableGetRowsOptions, DataTableGetRowsResult, DataTableProps, DataTableSelectionMode } from "./DataTable.tsx";
4
+ import type { DataTableColumnObject } from "./DataTableColumn.tsx";
5
5
  /** Value of the data table context. */
6
6
  export interface DataTableContextValue<T = any> extends Pick<DataTableProps<T>, "required" | "renderRow" | "renderCell" | "selectAllChecked" | "onSelectAll" | "selectAllRowsLabel" | "selectRowLabel" | "showAllRowsWhilePrinting" | "apiRef"> {
7
7
  displayMode: DataTableDisplayMode;
@@ -15,8 +15,8 @@ export interface DataTableContextValue<T = any> extends Pick<DataTableProps<T>,
15
15
  }
16
16
  /** State of the data table. */
17
17
  export interface DataTableState<T = any> {
18
- columns: DataTableColumns<T>;
19
- leafColumns: DataTableColumns<T>;
18
+ columns: DataTableColumnsObject<T>;
19
+ leafColumns: Record<string, DataTableColumnObject<T>>;
20
20
  hasFooterCells: () => boolean;
21
21
  headCount: number;
22
22
  _rows?: T[];
@@ -77,8 +77,9 @@ export type DataTableStore<T> = ReturnType<typeof useCreateDataTableContext<T>>[
77
77
  /** Data table context. */
78
78
  export declare const DataTableContext: import("react").Context<DataTableContextValue<any> | null>;
79
79
  /** Options used to create the data table context value. */
80
- export interface UseCreateDataTableContextOptions<T> extends Pick<DataTableProps<T>, "columns" | "rows" | "onVisibleRowsChange" | "onProcessedRowsChange" | "getRows" | "onOffsetChange" | "onLimitChange" | "filter" | "onFilterChange" | "sortBy" | "onSort" | "defaultSelectedRows" | "selectedRows" | "onSelectedRowsChange" | "disabledSelections" | "selectAllRowsLabel" | "selectRowLabel">, Omit<DataTableContextValue<T>, "generatedId" | "store"> {
81
- leafColumns: DataTableColumns<T>;
80
+ export interface UseCreateDataTableContextOptions<T> extends Pick<DataTableProps<T>, "rows" | "onVisibleRowsChange" | "onProcessedRowsChange" | "getRows" | "onOffsetChange" | "onLimitChange" | "filter" | "onFilterChange" | "sortBy" | "onSort" | "defaultSelectedRows" | "selectedRows" | "onSelectedRowsChange" | "disabledSelections" | "selectAllRowsLabel" | "selectRowLabel">, Omit<DataTableContextValue<T>, "generatedId" | "store"> {
81
+ columns: DataTableColumnsObject<T>;
82
+ leafColumns: Record<string, DataTableColumnObject<T>>;
82
83
  headCount: number;
83
84
  loading: boolean;
84
85
  loadingCount: number;
@@ -10,4 +10,4 @@ export interface DataTableFilterProps extends Omit<InputNonFileProps, "defaultVa
10
10
  preferRightAlignment?: boolean;
11
11
  }
12
12
  /** Input used to globally filter a data table. */
13
- export declare const DataTableFilter: import("react").ForwardRefExoticComponent<DataTableFilterProps & import("react").RefAttributes<HTMLInputElement>>;
13
+ export declare function DataTableFilter({ preferRightAlignment, endAdornment, placeholder, ["aria-label"]: ariaLabel, onValueChange, className, rootProps, ...otherProps }: DataTableFilterProps): import("react").JSX.Element;
@@ -1,9 +1,11 @@
1
- import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
- import { TableFoot } from "../Table";
1
+ import { type ReactNode } from "react";
2
+ import { type TableFootProps } from "../Table";
3
3
  /** Properties of the data table foot component. */
4
- export interface DataTableFootProps extends ComponentPropsWithoutRef<typeof TableFoot> {
4
+ export interface DataTableFootProps extends TableFootProps {
5
+ /** Content to be rendered in the data table foot. */
5
6
  footContent?: ReactNode;
7
+ /** Whether the data table foot should be shown when the data table is empty. */
6
8
  showWhenEmpty: boolean;
7
9
  }
8
10
  /** Foot of the data table. */
9
- export declare const DataTableFoot: import("react").ForwardRefExoticComponent<DataTableFootProps & import("react").RefAttributes<HTMLTableSectionElement>>;
11
+ export declare function DataTableFoot({ footContent, showWhenEmpty, ref, ...otherProps }: DataTableFootProps): false | "" | 0 | 0n | import("react").JSX.Element | null | undefined;
@@ -1,7 +1,6 @@
1
- import { type ComponentPropsWithoutRef } from "react";
2
- import { TableHead } from "../Table";
1
+ import { type TableHeadProps } from "../Table";
3
2
  /** Properties of the data table head component. */
4
- export interface DataTableHeadProps extends ComponentPropsWithoutRef<typeof TableHead> {
3
+ export interface DataTableHeadProps extends TableHeadProps {
5
4
  }
6
5
  /** Head of the data table. */
7
- export declare const DataTableHead: import("react").ForwardRefExoticComponent<DataTableHeadProps & import("react").RefAttributes<HTMLTableSectionElement>>;
6
+ export declare function DataTableHead({ rowProps, ref, ...otherProps }: DataTableHeadProps): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
- import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from "react";
2
- import { IconButton } from "../IconButton";
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import type { IconButtonProps } from "../IconButton";
3
3
  /** Properties of the data table pagination component. */
4
- export interface DataTablePaginationProps extends ComponentPropsWithoutRef<"div"> {
4
+ export interface DataTablePaginationProps extends ComponentProps<"div"> {
5
5
  /**
6
6
  * Function used to render the range of displayed rows.
7
7
  *
@@ -27,9 +27,9 @@ export interface DataTablePaginationProps extends ComponentPropsWithoutRef<"div"
27
27
  * Properties to pass to the previous page button (only relevant in paged
28
28
  * mode).
29
29
  */
30
- previousPageButtonProps?: ComponentPropsWithRef<typeof IconButton<"button">>;
30
+ previousPageButtonProps?: IconButtonProps;
31
31
  /** Properties to pass to the next page button (only relevant in paged mode). */
32
- nextPageButtonProps?: ComponentPropsWithRef<typeof IconButton<"button">>;
32
+ nextPageButtonProps?: IconButtonProps;
33
33
  }
34
34
  /** Component used to provide pagination to the data table. */
35
- export declare const DataTablePagination: import("react").ForwardRefExoticComponent<DataTablePaginationProps & import("react").RefAttributes<HTMLDivElement>>;
35
+ export declare function DataTablePagination({ rowsRange, rowsRangeSelectLabel, previousPageButtonLabel, nextPageButtonLabel, previousPageButtonProps, nextPageButtonProps, preferRightAlignment, ...otherProps }: DataTablePaginationProps): import("react").JSX.Element | null;
@@ -1,11 +1,10 @@
1
- import { type ComponentPropsWithoutRef } from "react";
2
- import { TableRow } from "../Table";
1
+ import { type TableRowProps } from "../Table";
3
2
  /** Properties of a data table row. */
4
- export interface DataTableRowProps<T = any> extends ComponentPropsWithoutRef<typeof TableRow> {
3
+ export interface DataTableRowProps<T = any> extends TableRowProps {
5
4
  /** Row data. When `undefined`, the row is rendered as "loading". */
6
5
  row: T | undefined;
7
6
  /** Row index. */
8
7
  index: number;
9
8
  }
10
9
  /** Data table row. */
11
- export declare const DataTableRow: import("react").NamedExoticComponent<DataTableRowProps<any> & import("react").RefAttributes<HTMLTableRowElement>>;
10
+ export declare function DataTableRow<T = unknown>({ row, index, className, ...otherProps }: DataTableRowProps<T>): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
- import { type ComponentPropsWithoutRef, type ReactNode } from "react";
1
+ import { type ComponentProps, type ReactNode } from "react";
2
2
  /** Properties of the data table rows per page component. */
3
- export interface DataTableRowsPerPageProps extends ComponentPropsWithoutRef<"div"> {
3
+ export interface DataTableRowsPerPageProps extends ComponentProps<"div"> {
4
4
  /**
5
5
  * Options used to set the data table's `limit` (the maximum number of rows
6
6
  * shown per page).
@@ -23,4 +23,4 @@ export interface DataTableRowsPerPageProps extends ComponentPropsWithoutRef<"div
23
23
  preferRightAlignment?: boolean;
24
24
  }
25
25
  /** Component displaying a select used to change the number of rows per page. */
26
- export declare const DataTableRowsPerPage: import("react").ForwardRefExoticComponent<DataTableRowsPerPageProps & import("react").RefAttributes<HTMLDivElement>>;
26
+ export declare function DataTableRowsPerPage({ limitOptions, label, preferRightAlignment, className, ...otherProps }: DataTableRowsPerPageProps): import("react").JSX.Element;
@@ -1,8 +1,8 @@
1
- import { type ComponentPropsWithoutRef, type Key, type MouseEvent, type ReactNode } from "react";
2
- import { Button } from "../Button";
1
+ import { type Key, type MouseEvent, type ReactNode } from "react";
2
+ import { type ButtonProps } from "../Button";
3
3
  import type { DataTableSelectionMode } from "./DataTable.tsx";
4
4
  /** Properties of the data table selection trigger component. */
5
- export interface DataTableSelectionTriggerProps extends Omit<ComponentPropsWithoutRef<typeof Button<"button">>, "onClick"> {
5
+ export interface DataTableSelectionTriggerProps extends Omit<ButtonProps, "onClick"> {
6
6
  /**
7
7
  * Whether the component should preferably be aligned to the right. This only
8
8
  * has an effect when the component is nested directly under the `DataTable`.
@@ -27,4 +27,4 @@ export interface DataTableSelectionTriggerProps extends Omit<ComponentPropsWitho
27
27
  children: ReactNode;
28
28
  }
29
29
  /** Trigger used to run an action over selected rows. */
30
- export declare const DataTableSelectionTrigger: import("react").ForwardRefExoticComponent<DataTableSelectionTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
30
+ export declare function DataTableSelectionTrigger({ preferRightAlignment, showWhenNoneSelected, onClick, className, children, ...otherProps }: DataTableSelectionTriggerProps): false | import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  import type { DataTablePaginationProps } from "./DataTablePagination.tsx";
3
3
  /** Properties of the scrolled data table pagination. */
4
- export interface PagedDataTablePaginationProps extends ComponentPropsWithoutRef<"div">, Pick<DataTablePaginationProps, "rowsRange" | "rowsRangeSelectLabel" | "previousPageButtonLabel" | "nextPageButtonLabel" | "preferRightAlignment" | "previousPageButtonProps" | "nextPageButtonProps"> {
4
+ export interface PagedDataTablePaginationProps extends ComponentProps<"div">, Pick<DataTablePaginationProps, "rowsRange" | "rowsRangeSelectLabel" | "previousPageButtonLabel" | "nextPageButtonLabel" | "preferRightAlignment" | "previousPageButtonProps" | "nextPageButtonProps"> {
5
5
  }
6
6
  /** Pagination component of the scrolled data table. */
7
- export declare const PagedDataTablePagination: import("react").ForwardRefExoticComponent<PagedDataTablePaginationProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export declare function PagedDataTablePagination({ rowsRange, rowsRangeSelectLabel, previousPageButtonLabel, nextPageButtonLabel, preferRightAlignment, previousPageButtonProps, nextPageButtonProps, className, "aria-label": ariaLabel, ...otherProps }: PagedDataTablePaginationProps): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import type { ComponentProps } from "react";
2
2
  import type { DataTablePaginationProps } from "./DataTablePagination.tsx";
3
3
  /** Properties of the scrolled data table pagination. */
4
- export interface ScrolledDataTablePaginationProps extends ComponentPropsWithoutRef<"div">, Pick<DataTablePaginationProps, "rowsRange" | "preferRightAlignment"> {
4
+ export interface ScrolledDataTablePaginationProps extends ComponentProps<"div">, Pick<DataTablePaginationProps, "rowsRange" | "preferRightAlignment"> {
5
5
  }
6
6
  /** Pagination component of the scrolled data table. */
7
- export declare const ScrolledDataTablePagination: import("react").ForwardRefExoticComponent<ScrolledDataTablePaginationProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export declare function ScrolledDataTablePagination({ rowsRange, preferRightAlignment, className, ...otherProps }: ScrolledDataTablePaginationProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
- import type { DataTableColumns } from "./DataTableColumn.tsx";
1
+ import type { DataTableColumnsObject } from "./DataTable.tsx";
2
+ import type { DataTableColumnObject } from "./DataTableColumn.tsx";
2
3
  /** List of "leaf" columns (columns with no sub columns, i.e. the "bottom" ones). */
3
- export declare function leafColumns<T>(columns: DataTableColumns<T>): DataTableColumns<T>;
4
+ export declare function leafColumns<T>(columns: DataTableColumnsObject<T>): Record<string, DataTableColumnObject<T>>;
4
5
  /** Total number of table rows of the head. */
5
- export declare function numberOfRows<T>(columns: DataTableColumns<T>): number;
6
+ export declare function numberOfRows<T>(columns: DataTableColumnsObject<T>): number;
@@ -2,6 +2,8 @@ export * from "./DataTable.tsx";
2
2
  export * from "./DataTableApi.ts";
3
3
  export * from "./DataTableCell.tsx";
4
4
  export * from "./DataTableColumn.tsx";
5
+ export * from "./DataTableColumnGroup.tsx";
6
+ export * from "./DataTableColumns.tsx";
5
7
  export * from "./DataTableContent.tsx";
6
8
  export { useDataTableColumnLabel, useDataTableColumnLabelId, } from "./DataTableContext.ts";
7
9
  export * from "./DataTableFilter.tsx";
@@ -1,10 +1,10 @@
1
1
  import { type SortDirection } from "../../utils/sorting.ts";
2
- import type { DataTableColumns } from "./DataTableColumn.tsx";
2
+ import type { DataTableColumnObject } from "./DataTableColumn.tsx";
3
3
  /** Filters the provided rows. */
4
- export declare function filterRows<T>(leafColumns: DataTableColumns<T>, rows: T[], filter: string, locale?: Intl.LocalesArgument): T[];
5
- export declare function filterRows<T>(leafColumns: DataTableColumns<T>, rows: undefined, filter: string, locale?: Intl.LocalesArgument): undefined;
6
- export declare function filterRows<T>(leafColumns: DataTableColumns<T>, rows: T[] | undefined, filter: string, locale?: Intl.LocalesArgument): T[] | undefined;
4
+ export declare function filterRows<T>(leafColumns: Record<string, DataTableColumnObject<T>>, rows: T[], filter: string, locale?: Intl.LocalesArgument): T[];
5
+ export declare function filterRows<T>(leafColumns: Record<string, DataTableColumnObject<T>>, rows: undefined, filter: string, locale?: Intl.LocalesArgument): undefined;
6
+ export declare function filterRows<T>(leafColumns: Record<string, DataTableColumnObject<T>>, rows: T[] | undefined, filter: string, locale?: Intl.LocalesArgument): T[] | undefined;
7
7
  /** Sorts the provided rows. */
8
- export declare function sortRows<T>(leafColumns: DataTableColumns<T>, rows: T[], sortBy: string | null, sortDirection: SortDirection | null, locale?: Intl.LocalesArgument): T[];
9
- export declare function sortRows<T>(leafColumns: DataTableColumns<T>, rows: undefined, sortBy: string | null, sortDirection: SortDirection | null, locale?: Intl.LocalesArgument): undefined;
10
- export declare function sortRows<T>(leafColumns: DataTableColumns<T>, rows: T[] | undefined, sortBy: string | null, sortDirection: SortDirection | null, locale?: Intl.LocalesArgument): T[] | undefined;
8
+ export declare function sortRows<T>(leafColumns: Record<string, DataTableColumnObject<T>>, rows: T[], sortBy: string | null, sortDirection: SortDirection | null, locale?: Intl.LocalesArgument): T[];
9
+ export declare function sortRows<T>(leafColumns: Record<string, DataTableColumnObject<T>>, rows: undefined, sortBy: string | null, sortDirection: SortDirection | null, locale?: Intl.LocalesArgument): undefined;
10
+ export declare function sortRows<T>(leafColumns: Record<string, DataTableColumnObject<T>>, rows: T[] | undefined, sortBy: string | null, sortDirection: SortDirection | null, locale?: Intl.LocalesArgument): T[] | undefined;
@@ -1,8 +1,8 @@
1
1
  import type { SortDirection } from "../../utils/sorting.ts";
2
- import type { DataTableColumns } from "./DataTableColumn.tsx";
2
+ import type { DataTableColumnObject } from "./DataTableColumn.tsx";
3
3
  /** Sanitizes an integer property. */
4
4
  export declare function sanitizeInt(value: number | string | undefined): number | undefined;
5
5
  /** Sanitizes the `sortBy` property. */
6
- export declare function sanitizeSortBy<T>(sortBy: string | null | undefined, leaves: DataTableColumns<T>): string | null | undefined;
6
+ export declare function sanitizeSortBy<T>(sortBy: string | null | undefined, leaves: Record<string, DataTableColumnObject<T>>): string | null | undefined;
7
7
  /** Sanitizes the `sortDirection` property. */
8
8
  export declare function sanitizeSortDirection(sortDirection: string | undefined): SortDirection | undefined;
@@ -1,4 +1,4 @@
1
- import type { DataTableColumn } from "./DataTableColumn.tsx";
1
+ import type { DataTableColumnObject } from "./DataTableColumn.tsx";
2
2
  export declare const DATA_TABLE_SELECTION_COLUMN_WIDTH = 42;
3
- export declare function useDataTableSelectionColumn<T = unknown, TValue = any>(): DataTableColumn<T, TValue> | undefined;
3
+ export declare function useDataTableSelectionColumn<T = unknown, TValue = any>(): DataTableColumnObject<T, TValue> | undefined;
4
4
  export declare function useDataTableSelectionColumnId(): string;