@ostack.tech/ui 0.15.5 → 0.16.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 (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 +128 -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 +95 -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 +7 -0
  24. package/scss/components/HelperText/_HelperText.scss +9 -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,11 +1,11 @@
1
1
  import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
2
- import { type ComponentPropsWithoutRef } from "react";
2
+ import type { ComponentProps } from "react";
3
3
  import { type MenuListItemProps } from "../MenuList";
4
4
  /** Properties of the dropdown menu submenu trigger. */
5
- export interface DropdownMenuSubTriggerProps extends Omit<ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger>, "asChild" | "color">, Pick<MenuListItemProps, "color" | "icon" | "disabled" | "actionProps" | "contentProps" | "iconProps"> {
5
+ export interface DropdownMenuSubTriggerProps extends Omit<ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>, "asChild" | "color">, Pick<MenuListItemProps, "color" | "icon" | "disabled" | "actionProps" | "contentProps" | "iconProps"> {
6
6
  }
7
7
  /**
8
8
  * A dropdown menu item that opens a submenu. Must be rendered within a
9
9
  * `DropdownMenuSub`.
10
10
  */
11
- export declare const DropdownMenuSubTrigger: import("react").ForwardRefExoticComponent<DropdownMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
11
+ export declare function DropdownMenuSubTrigger({ color, icon, disabled, actionProps, contentProps, iconProps, className, ...otherProps }: DropdownMenuSubTriggerProps): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
2
- import { type ComponentPropsWithoutRef } from "react";
2
+ import type { ComponentProps } from "react";
3
3
  /** Properties of the dropdown menu trigger component. */
4
- export interface DropdownMenuTriggerProps extends Omit<ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>, "asChild"> {
4
+ export interface DropdownMenuTriggerProps extends Omit<ComponentProps<typeof DropdownMenuPrimitive.Trigger>, "asChild"> {
5
5
  }
6
6
  /** Trigger component for the dropdown menu. */
7
- export declare const DropdownMenuTrigger: import("react").ForwardRefExoticComponent<DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
7
+ export declare function DropdownMenuTrigger(props: DropdownMenuTriggerProps): import("react").JSX.Element;
@@ -1,9 +1,9 @@
1
- import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ComponentType, type ReactNode } from "react";
1
+ import { type ComponentProps, type ComponentType, type ReactNode } from "react";
2
2
  import { ErrorBoundary as ReactErrorBoundary } from "react-error-boundary";
3
- import { Alert } from "../Alert";
4
- import { IconButton } from "../IconButton";
3
+ import { type AlertProps } from "../Alert";
4
+ import { type IconButtonProps } from "../IconButton";
5
5
  /** Properties provided to the fallback element. */
6
- export interface FallbackProps {
6
+ export interface ErrorBoundaryFallbackProps {
7
7
  /** Error that occurred. */
8
8
  error: unknown;
9
9
  /**
@@ -14,7 +14,7 @@ export interface FallbackProps {
14
14
  resetErrorBoundary: (...args: unknown[]) => void;
15
15
  }
16
16
  /** Properties of the error boundary component. */
17
- export interface ErrorBoundaryProps extends Pick<ComponentPropsWithoutRef<typeof ReactErrorBoundary>, "resetKeys" | "onError" | "onReset"> {
17
+ export interface ErrorBoundaryProps extends Pick<ComponentProps<typeof ReactErrorBoundary>, "resetKeys" | "onError" | "onReset"> {
18
18
  /**
19
19
  * Fallback component to render in the event of an error while rendering
20
20
  * `children`.
@@ -26,7 +26,7 @@ export interface ErrorBoundaryProps extends Pick<ComponentPropsWithoutRef<typeof
26
26
  * By default, a “danger” `Alert` is displayed with a message (specified via
27
27
  * `fallbackMessage`) or the error that occurred when `showError` is set.
28
28
  */
29
- fallback?: ReactNode | ComponentType<FallbackProps> | ((props: FallbackProps) => ReactNode);
29
+ fallback?: ReactNode | ComponentType<ErrorBoundaryFallbackProps> | ((props: ErrorBoundaryFallbackProps) => ReactNode);
30
30
  /**
31
31
  * Whether to show the error that occurred in the default fallback `Alert`.
32
32
  *
@@ -63,12 +63,12 @@ export interface ErrorBoundaryProps extends Pick<ComponentPropsWithoutRef<typeof
63
63
  */
64
64
  resetButtonLabel?: ReactNode;
65
65
  /** Properties to pass to the default fallback `Alert` component. */
66
- fallbackProps?: ComponentPropsWithRef<typeof Alert>;
66
+ fallbackProps?: AlertProps;
67
67
  /**
68
68
  * Properties to pass to the `IconButton` component used to reset the error
69
69
  * boundary.
70
70
  */
71
- resetButtonProps?: ComponentPropsWithRef<typeof IconButton<"button">>;
71
+ resetButtonProps?: IconButtonProps;
72
72
  children?: ReactNode;
73
73
  }
74
74
  /**
@@ -94,4 +94,4 @@ export interface ErrorBoundaryProps extends Pick<ComponentPropsWithoutRef<typeof
94
94
  * }
95
95
  * ```
96
96
  */
97
- export declare const ErrorBoundary: import("react").ForwardRefExoticComponent<ErrorBoundaryProps & import("react").RefAttributes<ReactErrorBoundary>>;
97
+ export declare function ErrorBoundary({ fallback, showError, showResetButton, fallbackTitle, fallbackMessage, onError, resetButtonLabel, fallbackProps, resetButtonProps, ...otherProps }: ErrorBoundaryProps): import("react").JSX.Element;
@@ -1,8 +1,8 @@
1
- import { type ComponentPropsWithoutRef, type ReactNode } from "react";
1
+ import type { ComponentProps, ReactNode } from "react";
2
2
  /** Possible types of feedback. */
3
3
  export type FeedbackType = "success" | "error" | "warning";
4
4
  /** Properties of the feedback component. */
5
- export type FeedbackProps = ComponentPropsWithoutRef<"div" | "li"> & {
5
+ export type FeedbackProps = ComponentProps<"div" | "li"> & {
6
6
  /**
7
7
  * Change the component to the HTML tag or custom component of the only child.
8
8
  * This will merge the original component props with the props of the supplied
@@ -18,4 +18,4 @@ export type FeedbackProps = ComponentPropsWithoutRef<"div" | "li"> & {
18
18
  visuallyHiddenPrefix?: ReactNode | ((type: FeedbackType) => ReactNode);
19
19
  };
20
20
  /** Component used to provide some feedback to a form control. */
21
- export declare const Feedback: import("react").ForwardRefExoticComponent<FeedbackProps & import("react").RefAttributes<HTMLDivElement | HTMLLIElement>>;
21
+ export declare function Feedback({ asChild, type, visuallyHiddenPrefix, id, className, children, ...otherProps }: FeedbackProps): import("react").JSX.Element;
@@ -0,0 +1,46 @@
1
+ import type { ControlStatus } from "../Control";
2
+ /** Value of the feedback context. */
3
+ export type FeedbackContextValue = FeedbackStore;
4
+ /** State of the feedback context. */
5
+ export interface FeedbackState {
6
+ controlName?: string;
7
+ controlStatus?: ControlStatus;
8
+ controlFocused: boolean;
9
+ feedbackIds: string[];
10
+ actions: {
11
+ addFeedbackId: (id: string) => void;
12
+ removeFeedbackId: (id: string) => void;
13
+ };
14
+ }
15
+ /** Helper text store. */
16
+ export type FeedbackStore = ReturnType<typeof useCreateFeedbackContext>;
17
+ /** Helper text context. */
18
+ export declare const FeedbackContext: import("react").Context<(Omit<import("zustand").StoreApi<FeedbackState>, "subscribe"> & {
19
+ subscribe: {
20
+ (listener: (selectedState: FeedbackState, previousSelectedState: FeedbackState) => void): () => void;
21
+ <U>(selector: (state: FeedbackState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
22
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
23
+ fireImmediately?: boolean;
24
+ } | undefined): () => void;
25
+ };
26
+ }) | null>;
27
+ /** Hook which creates the feedback context value. */
28
+ export declare function useCreateFeedbackContext(): Omit<import("zustand").StoreApi<FeedbackState>, "subscribe"> & {
29
+ subscribe: {
30
+ (listener: (selectedState: FeedbackState, previousSelectedState: FeedbackState) => void): () => void;
31
+ <U>(selector: (state: FeedbackState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
32
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
33
+ fireImmediately?: boolean;
34
+ } | undefined): () => void;
35
+ };
36
+ };
37
+ /** Hook returning the feedback's context value. */
38
+ export declare function useFeedbackContext(): FeedbackContextValue | null;
39
+ /** Hook that returns access to the feedback's store. */
40
+ export declare function useFeedbackStore<T>(selector: (state: Partial<FeedbackState>) => T): T;
41
+ /** Hook exposing whether the `status` of a control. */
42
+ export declare function useFeedbackControlStatus(): ControlStatus | undefined;
43
+ /** Hook exposing the focused status of a control. */
44
+ export declare function useFeedbackControlFocused(): boolean | undefined;
45
+ /** Hook that registers a feedback and returns its identifier. */
46
+ export declare function useRegisterFeedback(feedbackId: string | undefined): string | undefined;
@@ -0,0 +1,6 @@
1
+ import type { ComponentProps } from "react";
2
+ /** Properties of the feedback list component. */
3
+ export interface FeedbackListProps extends ComponentProps<"ul"> {
4
+ }
5
+ /** Component used to provide a list of feedbacks to a form control. */
6
+ export declare function FeedbackList({ className, children, ...otherProps }: FeedbackListProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ /** Context present within a feedback list. */
2
+ export declare const FeedbackListContext: import("react").Context<boolean>;
@@ -1,9 +1,9 @@
1
- import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from "react";
1
+ import { type ComponentProps, type ReactNode } from "react";
2
2
  import type { IconProp } from "../Icon";
3
- import { IconButton, type IconButtonSize } from "../IconButton";
4
- import { PopoverContent } from "../Popover";
3
+ import { type IconButtonProps, type IconButtonSize } from "../IconButton";
4
+ import { type PopoverContentProps } from "../Popover";
5
5
  /** Properties of the feedback popover component. */
6
- export interface FeedbackPopoverProps extends ComponentPropsWithoutRef<typeof PopoverContent> {
6
+ export interface FeedbackPopoverProps extends PopoverContentProps {
7
7
  /** Default open state of the feedback popover. */
8
8
  defaultOpen?: boolean;
9
9
  /** Controlled open state of the feedback popover. */
@@ -23,12 +23,12 @@ export interface FeedbackPopoverProps extends ComponentPropsWithoutRef<typeof Po
23
23
  /** Label of the feedback popover button. */
24
24
  label?: ReactNode;
25
25
  /** Properties to pass to the element containing the button. */
26
- buttonContainerProps?: ComponentPropsWithRef<"div">;
26
+ buttonContainerProps?: ComponentProps<"div">;
27
27
  /** Properties to pass to the `IconButton` component. */
28
- iconButtonProps?: Omit<ComponentPropsWithRef<typeof IconButton<"button">>, "size" | "icon" | "label">;
28
+ iconButtonProps?: Omit<IconButtonProps, "size" | "icon" | "label">;
29
29
  }
30
30
  /**
31
31
  * Component used to provide feedback to a form control, where the feedback is
32
32
  * displayed within a popover.
33
33
  */
34
- export declare const FeedbackPopover: import("react").ForwardRefExoticComponent<FeedbackPopoverProps & import("react").RefAttributes<HTMLDivElement>>;
34
+ export declare function FeedbackPopover({ defaultOpen, open: controlledOpen, onOpenChange, modal, icon, size, onOpenAutoFocus, label, buttonContainerProps, iconButtonProps, className, children, ...otherProps }: FeedbackPopoverProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from "react";
2
+ /** Properties of the feedback provider component. */
3
+ export interface FeedbackProviderProps {
4
+ children?: ReactNode;
5
+ }
6
+ /**
7
+ * Component providing context necessary for form controls aware of feedbacks
8
+ * and vice versa.
9
+ *
10
+ * The `Field` component uses this component internally. As such, it is seldom
11
+ * necessary to use it manually.
12
+ */
13
+ export declare function FeedbackProvider({ children }: FeedbackProviderProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import type { ControlStatus } from "../Control";
2
+ /** Hook exposing whether a component is being rendered within a label provider. */
3
+ export declare function useIsInFeedbackProvider(): boolean;
4
+ /** Hook exposing whether a component is being rendered within a feedback list. */
5
+ export declare function useIsInFeedbackList(): boolean;
6
+ /** Hook exposing whether the `id`s of feedbacks. */
7
+ export declare function useFeedbackIds(): string[] | undefined;
8
+ /** Hook exposing whether the `name` of a control. */
9
+ export declare function useFeedbackControlName(): string | undefined;
10
+ /**
11
+ * Hook that registers whether a control is marked as required. Returns whether
12
+ * there is a feedback provider to register in.
13
+ */
14
+ export declare function useRegisterControlInFeedbackProvider(name?: string, status?: ControlStatus): boolean;
15
+ /**
16
+ * Hook which returns a function that can be used to set the focus status of the
17
+ * field's control.
18
+ */
19
+ export declare function useSetControlFocusedInFeedbackProvider(): (controlFocused: boolean) => void | undefined;
@@ -1 +1,5 @@
1
1
  export * from "./Feedback.tsx";
2
+ export * from "./FeedbackList.tsx";
3
+ export * from "./FeedbackPopover.tsx";
4
+ export * from "./FeedbackProvider.tsx";
5
+ export * from "./feedbackUtils.ts";
@@ -1,6 +1,6 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  /** Properties of the field component. */
3
- export interface FieldProps extends ComponentPropsWithoutRef<"div"> {
3
+ export interface FieldProps extends ComponentProps<"div"> {
4
4
  /**
5
5
  * Change the component to the HTML tag or custom component of the only child.
6
6
  * This will merge the original component props with the props of the supplied
@@ -35,4 +35,4 @@ export interface FieldProps extends ComponentPropsWithoutRef<"div"> {
35
35
  * }
36
36
  * ```
37
37
  */
38
- export declare const Field: import("react").ForwardRefExoticComponent<FieldProps & import("react").RefAttributes<HTMLDivElement>>;
38
+ export declare function Field({ asChild, className, ref, ...otherProps }: FieldProps): import("react").JSX.Element;
@@ -1,28 +1,8 @@
1
- import { type ReactNode } from "react";
2
- import type { ControlStatus } from "../Control";
3
1
  /** Value of the field context. */
4
2
  export type FieldContextValue = FieldStore;
5
3
  /** State of the field. */
6
4
  export interface FieldState {
7
- controlName?: string;
8
- controlId?: string;
9
- controlTagName?: string;
10
- controlFocused: boolean;
11
5
  controlHasCode: boolean;
12
- controlRequired: boolean;
13
- controlStatus?: ControlStatus;
14
- label?: ReactNode;
15
- labelId?: string;
16
- descriptionIds: string[];
17
- errorMessageIds: string[];
18
- actions: FieldActions;
19
- }
20
- /** Actions of the field. */
21
- export interface FieldActions {
22
- addDescriptionId: (descriptionId: string) => void;
23
- removeDescriptionId: (descriptionId: string) => void;
24
- addErrorMessageId: (errorMessageId: string) => void;
25
- removeErrorMessageId: (errorMessageId: string) => void;
26
6
  }
27
7
  /** Field store. */
28
8
  export type FieldStore = ReturnType<typeof useCreateFieldContext>;
@@ -46,53 +26,5 @@ export declare function useCreateFieldContext(): Omit<import("zustand").StoreApi
46
26
  } | undefined): () => void;
47
27
  };
48
28
  };
49
- /** Hook exposing the field control's name. */
50
- export declare function useFieldControlName(): string | undefined;
51
- /** Hook exposing the field control's id. */
52
- export declare function useFieldControlId(): string | undefined;
53
- /** Hook exposing the field control's tag name. */
54
- export declare function useFieldControlTagName(): string | undefined;
55
- /** Hook exposing whether the field's control is focused. */
56
- export declare function useFieldControlFocused(): boolean | undefined;
57
- /** Hook exposing whether the field's control is required. */
58
- export declare function useFieldControlRequired(): boolean | undefined;
59
- /** Hook exposing the field's control status. */
60
- export declare function useFieldControlStatus(): ControlStatus | undefined;
61
- /** Hook exposing the `children` of the field's label. */
62
- export declare function useFieldLabel(): ReactNode;
63
- /** Hook exposing the field label's id. */
64
- export declare function useFieldLabelId(): string | undefined;
65
- /** Hook exposing the field's description ids. */
66
- export declare function useFieldDescriptionIds(): string[] | undefined;
67
- /** Hook exposing the field's error message ids. */
68
- export declare function useFieldErrorMessageIds(): string[] | undefined;
69
- /** Hook that makes a field aware of its control's information. */
70
- export declare function useRegisterFieldControl(controlId: string | undefined, controlTagName: string | undefined, controlCodeId: string | undefined, controlHasCode?: boolean | undefined, controlRequired?: boolean | undefined, controlStatus?: ControlStatus | undefined): {
71
- generatedId: string;
72
- controlId: string;
73
- codeId: string | undefined;
74
- };
75
- /** Hook which register's a control's name into its field. */
76
- export declare function useRegisterFieldName(name: string | undefined): void;
77
- /**
78
- * Hook which returns a function that can be used to set the focus status of the
79
- * field's control.
80
- */
81
- export declare function useSetFieldControlFocused(): (controlFocused: boolean) => void | undefined;
82
- /** Hook that makes the field aware of its label. */
83
- export declare function useSetFieldLabel(label: ReactNode, labelId: string | undefined): string | undefined;
84
- /** Options available to the {@link useOnFieldLabelChange} hook. */
85
- export interface UseOnFieldLabelChangeOptions {
86
- /**
87
- * Whether to run the callback immediately with the current label.
88
- *
89
- * @default true
90
- */
91
- fireImmediately?: boolean;
92
- }
93
- /** Hook which runs the provided callback whenever the field's label changes. */
94
- export declare function useOnFieldLabelChange(cb: (label: ReactNode) => (() => void) | void, { fireImmediately }?: UseOnFieldLabelChangeOptions): void;
95
- /** Hook that makes the field aware of some helper text. */
96
- export declare function useSetFieldHelperText(helperTextId: string | undefined): string | undefined;
97
- /** Hook that makes the field aware of some feedback. */
98
- export declare function useSetFieldFeedback(feedbackId: string | undefined, isError: boolean): string | undefined;
29
+ /** Hook returning the field's context value. */
30
+ export declare function useFieldContext(): FieldContextValue | null;
@@ -0,0 +1,7 @@
1
+ /** Hook exposing whether a component is being rendered within a field. */
2
+ export declare function useIsInField(): boolean;
3
+ /**
4
+ * Hook that registers whether a control is marked as required. Returns whether
5
+ * there is a field to register in.
6
+ */
7
+ export declare function useRegisterControlInField(hasCode: boolean): boolean;
@@ -1,3 +1,2 @@
1
1
  export * from "./Field.tsx";
2
- export { type FieldActions, useFieldControlFocused, useFieldControlId, useFieldControlRequired, useFieldControlTagName, useFieldDescriptionIds, useFieldErrorMessageIds, useFieldLabel, useFieldLabelId, useOnFieldLabelChange, useRegisterFieldControl, useSetFieldControlFocused, useSetFieldFeedback, useSetFieldHelperText, useSetFieldLabel, } from "./FieldContext.ts";
3
- export * from "./FieldProvider.tsx";
2
+ export * from "./fieldUtils.ts";
@@ -1,6 +1,6 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  /** Properties of the field group component. */
3
- export interface FieldGroupProps extends ComponentPropsWithoutRef<"div"> {
3
+ export interface FieldGroupProps extends ComponentProps<"div"> {
4
4
  /**
5
5
  * Change the component to the HTML tag or custom component of the only child.
6
6
  * This will merge the original component props with the props of the supplied
@@ -55,4 +55,4 @@ export interface FieldGroupProps extends ComponentPropsWithoutRef<"div"> {
55
55
  * }
56
56
  * ```
57
57
  */
58
- export declare const FieldGroup: import("react").ForwardRefExoticComponent<FieldGroupProps & import("react").RefAttributes<HTMLDivElement>>;
58
+ export declare function FieldGroup({ asChild, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...otherProps }: FieldGroupProps): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import type { ComponentProps } from "react";
2
2
  /** Properties of the field group body component. */
3
- export interface FieldGroupBodyProps extends ComponentPropsWithoutRef<"div"> {
3
+ export interface FieldGroupBodyProps extends ComponentProps<"div"> {
4
4
  /**
5
5
  * Change the component to the HTML tag or custom component of the only child.
6
6
  * This will merge the original component props with the props of the supplied
@@ -9,4 +9,4 @@ export interface FieldGroupBodyProps extends ComponentPropsWithoutRef<"div"> {
9
9
  asChild?: boolean;
10
10
  }
11
11
  /** Component used to display the body of a field group. */
12
- export declare const FieldGroupBody: import("react").ForwardRefExoticComponent<FieldGroupBodyProps & import("react").RefAttributes<HTMLDivElement>>;
12
+ export declare function FieldGroupBody({ asChild, className, ...otherProps }: FieldGroupBodyProps): 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 field group header component. */
3
- export interface FieldGroupHeaderProps extends ComponentPropsWithoutRef<"div"> {
3
+ export interface FieldGroupHeaderProps extends ComponentProps<"div"> {
4
4
  /**
5
5
  * Change the component to the HTML tag or custom component of the only child.
6
6
  * This will merge the original component props with the props of the supplied
@@ -12,7 +12,7 @@ export interface FieldGroupHeaderProps extends ComponentPropsWithoutRef<"div"> {
12
12
  /** Text prefixed to the code to be announced by assistive technologies. */
13
13
  visuallyHiddenCodePrefix?: ReactNode;
14
14
  /** Properties to pass to the code element. */
15
- codeProps?: ComponentPropsWithoutRef<"span">;
15
+ codeProps?: ComponentProps<"span">;
16
16
  }
17
17
  /** Component used to display the header of a field group. */
18
- export declare const FieldGroupHeader: import("react").ForwardRefExoticComponent<FieldGroupHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
18
+ export declare function FieldGroupHeader({ asChild, code, visuallyHiddenCodePrefix, codeProps, className, children, ...otherProps }: FieldGroupHeaderProps): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { PolymorphicComponent, PolymorphicProps } from "../../utils/polymorphicTypes.ts";
1
+ import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
2
2
  /** Element a field group title can be rendered as. */
3
3
  export type FieldGroupTitleAs = "div" | "span" | "label" | "h2" | "h3" | "h4" | "h5" | "h6";
4
4
  /** Properties of the field group title component. */
@@ -13,4 +13,4 @@ export interface FieldGroupTitleOwnProps {
13
13
  asChild?: boolean;
14
14
  }
15
15
  /** Component used to display the caption of a field group. */
16
- export declare const FieldGroupTitle: PolymorphicComponent<FieldGroupTitleAs, "div", FieldGroupTitleOwnProps>;
16
+ export declare function FieldGroupTitle<TAs extends FieldGroupTitleAs = "div">({ as, asChild, id, className, ...otherProps }: FieldGroupTitleProps<TAs>): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithRef, type ReactNode, type Ref, type SubmitEvent } from "react";
1
+ import { type ComponentProps, type ReactNode, type Ref, type SubmitEvent } from "react";
2
2
  /** Form values. */
3
3
  export type FormValues = Record<string, any>;
4
4
  /** Validation mode of the form. */
@@ -12,7 +12,7 @@ export type FormNativeErrorMessages = Partial<Record<FormNativeErrorCode, ReactN
12
12
  /** Validation errors to set on a form. */
13
13
  export type FormValidationErrors<T extends FormValues = any> = Partial<Record<keyof T | "", ReactNode>>;
14
14
  /** Function used to validate a form. */
15
- export type FormValidateFn<T extends FormValues = any> = (formValues: T) => ReactNode | FormValidationErrors | void | Promise<ReactNode | FormValidationErrors | void>;
15
+ export type FormValidateFn<T extends FormValues = any> = (formValues: T) => ReactNode | FormValidationErrors | void | PromiseLike<ReactNode | FormValidationErrors | void>;
16
16
  /** Form API. */
17
17
  export interface FormApi<T extends FormValues = any> {
18
18
  getElement: (name?: keyof T | "") => RadioNodeList | Element | null;
@@ -30,7 +30,7 @@ export interface FormApi<T extends FormValues = any> {
30
30
  focus: (name: keyof T | "") => void;
31
31
  }
32
32
  /** Properties of the form component. */
33
- export interface FormProps<T extends FormValues = any> extends Omit<ComponentPropsWithRef<"form">, "noValidate" | "onSubmit"> {
33
+ export interface FormProps<T extends FormValues = any> extends Omit<ComponentProps<"form">, "noValidate" | "onSubmit"> {
34
34
  /**
35
35
  * Change the component to the HTML tag or custom component of the only child.
36
36
  * This will merge the original component props with the props of the supplied
@@ -83,14 +83,14 @@ export interface FormProps<T extends FormValues = any> extends Omit<ComponentPro
83
83
  confirmUnloadWhenDirty?: boolean;
84
84
  /**
85
85
  * Disables native validations such as `required`, `minLength`, `pattern`,
86
- * _etc._ from affecting the form.
86
+ * etc. from affecting the form.
87
87
  */
88
88
  disableNativeValidations?: boolean;
89
89
  /**
90
90
  * Function called when the form is submitted. The default behaviour is
91
91
  * automatically prevented.
92
92
  */
93
- onSubmit?: (formValues: T, formData: FormData, evt: SubmitEvent<HTMLFormElement>) => FormValidationErrors | void | Promise<FormValidationErrors | void>;
93
+ onSubmit?: (formValues: T, formData: FormData, evt: SubmitEvent<HTMLFormElement>) => FormValidationErrors | void | PromiseLike<FormValidationErrors | void>;
94
94
  /** Function called whenever a value of the form changes. */
95
95
  onValueChange?: (formValues: T) => void;
96
96
  /** Message shown when an error occurs while submitting the form. */
@@ -152,4 +152,4 @@ export interface FormProps<T extends FormValues = any> extends Omit<ComponentPro
152
152
  * }
153
153
  * ```
154
154
  */
155
- export declare const Form: import("react").ForwardRefExoticComponent<Omit<FormProps<FormValues>, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
155
+ export declare function Form<T extends FormValues = any>({ asChild, validationMode, errorDisplayMode, validate, externalErrors, nativeErrorMessages, className, confirmUnloadWhenDirty, disableNativeValidations, onSubmit, onReset, onValueChange, submitErrorMessage, apiRef, ref, ...otherProps }: FormProps<T>): import("react").JSX.Element;
@@ -40,7 +40,7 @@ interface FormStoreActions<T extends FormValues = FormValues> extends FormApi<T>
40
40
  setValue: (name: keyof T, value: unknown) => void;
41
41
  queueValidate: () => void;
42
42
  firstInvalid: () => keyof T | "" | null;
43
- runFormValidate: (formValues: T) => void | Promise<void>;
43
+ runFormValidate: (formValues: T) => void | PromiseLike<void>;
44
44
  setNativeErrors: (name: keyof T, errors: FormNativeError[]) => void;
45
45
  setValidateErrors: (name: keyof T | "", errors: ReactNode) => void;
46
46
  }
@@ -1,6 +1,6 @@
1
- import { type ComponentPropsWithoutRef, type ReactElement } from "react";
1
+ import { type ComponentProps, type ReactElement } from "react";
2
2
  /** Properties of the form reset component. */
3
- export interface FormResetProps extends Omit<ComponentPropsWithoutRef<"button">, "form" | "children"> {
3
+ export interface FormResetProps extends Omit<ComponentProps<"button">, "form" | "children"> {
4
4
  children: ReactElement<HTMLButtonElement>;
5
5
  }
6
6
  /** Component used to wrap a button to reset the form. */
@@ -1,6 +1,6 @@
1
- import { type ComponentPropsWithoutRef, type ReactElement } from "react";
1
+ import { type ComponentProps, type ReactElement } from "react";
2
2
  /** Properties of the form submit component. */
3
- export interface FormSubmitProps extends Omit<ComponentPropsWithoutRef<"button">, "form" | "children"> {
3
+ export interface FormSubmitProps extends Omit<ComponentProps<"button">, "form" | "children"> {
4
4
  children: ReactElement<HTMLButtonElement>;
5
5
  }
6
6
  /** Component used to wrap a button to submit the form. */
@@ -1,6 +1,6 @@
1
- import type { ChangeEvent, ComponentPropsWithoutRef } from "react";
1
+ import type { ChangeEvent, ComponentProps } from "react";
2
2
  /** Properties of the hidden native control. */
3
- export type HiddenNativeControlProps<TElem extends "input" | "select" | "textarea"> = ComponentPropsWithoutRef<TElem> & {
3
+ export type HiddenNativeControlProps<TElem extends "input" | "select" | "textarea"> = ComponentProps<TElem> & {
4
4
  actualElement: HTMLElement | null;
5
5
  onChange: (evt: ChangeEvent<any>) => void;
6
6
  };
@@ -2,7 +2,7 @@ import { type ReactNode } from "react";
2
2
  import type { ControlStatus } from "../Control";
3
3
  import type { FormValidationMode } from "./Form.tsx";
4
4
  /** Type of function used to validate a form control. */
5
- export type FormControlValidateFn<T> = (value: T, formValues: Record<string, any>) => ReactNode | void | Promise<ReactNode | void>;
5
+ export type FormControlValidateFn<T> = (value: T, formValues: Record<string, any>) => ReactNode | void | PromiseLike<ReactNode | void>;
6
6
  /** Result of the `useRegisterFormControl` hook. */
7
7
  export interface UseRegisterFormControlResult<T = any> {
8
8
  status: ControlStatus | undefined;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  import { type Responsive } from "../../utils/useResponsiveValues.ts";
3
3
  /** Size of a column. */
4
4
  export type GridColumnSize = number | "auto" | "content";
@@ -7,7 +7,7 @@ export type GridOffsetSize = number | "auto";
7
7
  /** Properties of the grid component. */
8
8
  export type GridProps = GridContainerProps | GridItemProps;
9
9
  /** Base properties of the grid component. */
10
- export interface GridPropsBase extends ComponentPropsWithoutRef<"div"> {
10
+ export interface GridPropsBase extends ComponentProps<"div"> {
11
11
  /**
12
12
  * Change the component to the HTML tag or custom component of the only child.
13
13
  * This will merge the original component props with the props of the supplied
@@ -113,7 +113,7 @@ export interface GridItemProps extends GridPropsBase {
113
113
  *
114
114
  * For one-dimensional vertical layouts or one-dimensional horizontal layouts
115
115
  * without a fixed number of columns, you might prefer to use the [`Stack`
116
- * component](?path=/docs/ostack-ui-layout-stack--docs) instead.
116
+ * component](/docs/ostack-ui-layout-stack--docs) instead.
117
117
  *
118
118
  * Example usage:
119
119
  *
@@ -140,4 +140,4 @@ export interface GridItemProps extends GridPropsBase {
140
140
  * }
141
141
  * ```
142
142
  */
143
- export declare const Grid: import("react").ForwardRefExoticComponent<GridProps & import("react").RefAttributes<HTMLDivElement>>;
143
+ export declare function Grid({ asChild, container, columns, gap, rowGap, columnGap, xs, sm, md, lg, xl, xxl, xsOffset, smOffset, mdOffset, lgOffset, xlOffset, xxlOffset, className, style, ...otherProps }: GridProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { Responsive } from "../../utils/useResponsiveValues.ts";
2
+ /** Grid context value. */
3
+ export interface GridContextValue {
4
+ container: boolean;
5
+ columns?: Responsive<number>;
6
+ rowGap?: Responsive<number | string>;
7
+ columnGap?: Responsive<number | string>;
8
+ }
9
+ /** Grid context. */
10
+ export declare const GridContext: import("react").Context<GridContextValue | null>;
@@ -1,4 +1,4 @@
1
- import type { PolymorphicComponent, PolymorphicProps } from "../../utils/polymorphicTypes.ts";
1
+ import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
2
2
  /** Elements a heading can be rendered as. */
3
3
  export type HeadingAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span" | "label";
4
4
  /** Heading levels. */
@@ -40,4 +40,4 @@ export interface HeadingOwnProps {
40
40
  * }
41
41
  * ```
42
42
  */
43
- export declare const Heading: PolymorphicComponent<HeadingAs, "h2", HeadingOwnProps>;
43
+ export declare function Heading<TAs extends HeadingAs = "h2">({ as, asChild, level, className, ...otherProps }: HeadingProps<TAs>): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import type { ComponentProps } from "react";
2
2
  /** Properties of the helper text component. */
3
- export interface HelperTextProps extends ComponentPropsWithoutRef<"div"> {
3
+ export interface HelperTextProps extends ComponentProps<"div"> {
4
4
  /**
5
5
  * Change the component to the HTML tag or custom component of the only child.
6
6
  * This will merge the original component props with the props of the supplied
@@ -9,4 +9,4 @@ export interface HelperTextProps extends ComponentPropsWithoutRef<"div"> {
9
9
  asChild?: boolean;
10
10
  }
11
11
  /** Component used to provide helper text to a form control. */
12
- export declare const HelperText: import("react").ForwardRefExoticComponent<HelperTextProps & import("react").RefAttributes<HTMLDivElement>>;
12
+ export declare function HelperText({ asChild, id, className, ...otherProps }: HelperTextProps): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ /** Value of the helper text context. */
2
+ export type HelperTextContextValue = HelperTextStore;
3
+ /** State of the helper text context. */
4
+ export interface HelperTextState {
5
+ helperTextIds: string[];
6
+ actions: {
7
+ addHelperTextId: (id: string) => void;
8
+ removeHelperTextId: (id: string) => void;
9
+ };
10
+ }
11
+ /** Helper text store. */
12
+ export type HelperTextStore = ReturnType<typeof useCreateHelperTextContext>;
13
+ /** Helper text context. */
14
+ export declare const HelperTextContext: import("react").Context<(Omit<import("zustand").StoreApi<HelperTextState>, "subscribe"> & {
15
+ subscribe: {
16
+ (listener: (selectedState: HelperTextState, previousSelectedState: HelperTextState) => void): () => void;
17
+ <U>(selector: (state: HelperTextState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
18
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
19
+ fireImmediately?: boolean;
20
+ } | undefined): () => void;
21
+ };
22
+ }) | null>;
23
+ /** Hook which creates the helper text context value. */
24
+ export declare function useCreateHelperTextContext(): Omit<import("zustand").StoreApi<HelperTextState>, "subscribe"> & {
25
+ subscribe: {
26
+ (listener: (selectedState: HelperTextState, previousSelectedState: HelperTextState) => void): () => void;
27
+ <U>(selector: (state: HelperTextState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
28
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
29
+ fireImmediately?: boolean;
30
+ } | undefined): () => void;
31
+ };
32
+ };
33
+ /** Hook returning the helper text's context value. */
34
+ export declare function useHelperTextContext(): HelperTextContextValue | null;
35
+ /** Hook that returns access to the helper text's store. */
36
+ export declare function useHelperTextStore<T>(selector: (state: Partial<HelperTextState>) => T): T;
37
+ /** Hook that registers a helper text and returns its identifier. */
38
+ export declare function useRegisterHelperText(helperTextId: string | undefined): string | undefined;