@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,16 +1,16 @@
1
1
  import { Checkbox as CheckboxPrimitive } from "radix-ui";
2
- import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type FocusEvent, type ReactNode } from "react";
2
+ import { type ComponentProps, type FocusEvent, type ReactNode } from "react";
3
3
  import { type ControlStatus, type ControlVariant } from "../Control";
4
- import { ControlCode } from "../ControlCode";
4
+ import { type ControlCodeProps } from "../ControlCode";
5
5
  import type { FormValidationMode } from "../Form";
6
6
  import { type FormControlValidateFn } from "../Form/useRegisterFormControl.ts";
7
- import { Icon } from "../Icon";
8
- import { Label } from "../Label";
9
- import { Spinner } from "../Spinner";
7
+ import { type IconProps } from "../Icon";
8
+ import { type LabelProps } from "../Label";
9
+ import { type SpinnerProps } from "../Spinner";
10
10
  /** `checked` state of a checkbox. */
11
11
  export type CheckboxChecked = CheckboxPrimitive.CheckedState;
12
12
  /** Properties of the checkbox component. */
13
- export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, "asChild"> {
13
+ export interface CheckboxProps extends Omit<ComponentProps<typeof CheckboxPrimitive.Root>, "asChild"> {
14
14
  /**
15
15
  * Checkbox style variant. Defaults to the default variant unless when
16
16
  * rendering inside a table cell (in which case it defaults to `"cell"`).
@@ -22,12 +22,16 @@ export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof Chec
22
22
  code?: ReactNode;
23
23
  /** Sets the checkbox as read-only. */
24
24
  readOnly?: boolean;
25
+ /** Checkbox start adornment. */
26
+ startAdornment?: ReactNode;
27
+ /** Checkbox end adornment. */
28
+ endAdornment?: ReactNode;
25
29
  /**
26
30
  * Renders the checkbox in a **loading** state.
27
31
  *
28
32
  * When `true`, the checkbox is “soft-disabled”: it looks disabled and ignores
29
33
  * user interaction but remains focusable. By default, a spinner is shown
30
- * (_i.e._, `showSpinner` is set to `true` unless overridden).
34
+ * (i.e. `showSpinner` is set to `true` unless overridden).
31
35
  *
32
36
  * The checkbox's accessible description while loading can be controlled via
33
37
  * `loadingDescription`.
@@ -71,17 +75,21 @@ export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof Chec
71
75
  */
72
76
  validationMode?: FormValidationMode;
73
77
  /** Properties to pass to the root component. */
74
- rootProps?: ComponentPropsWithRef<"div">;
78
+ rootProps?: ComponentProps<"div">;
75
79
  /** Properties to pass to the container component. */
76
- containerProps?: ComponentPropsWithRef<"div">;
80
+ containerProps?: ComponentProps<"div">;
81
+ /** Properties to pass to the start container element. */
82
+ startContainerProps?: ComponentProps<"div">;
83
+ /** Properties to pass to the end container element. */
84
+ endContainerProps?: ComponentProps<"div">;
77
85
  /** Properties to pass to the code component. */
78
- codeProps?: ComponentPropsWithRef<typeof ControlCode>;
86
+ codeProps?: ControlCodeProps;
79
87
  /** Properties to pass to the indicator component. */
80
- indicatorProps?: ComponentPropsWithRef<typeof Icon>;
88
+ indicatorProps?: IconProps;
81
89
  /** Properties to pass to the label component. */
82
- labelProps?: Omit<ComponentPropsWithRef<typeof Label>, "required">;
90
+ labelProps?: Omit<LabelProps, "required">;
83
91
  /** Properties to pass to the spinner component. */
84
- spinnerProps?: Omit<ComponentPropsWithRef<typeof Spinner>, "size">;
92
+ spinnerProps?: Omit<SpinnerProps, "size">;
85
93
  }
86
94
  /**
87
95
  * The `Checkbox` component allows a user to toggle a “button” between checked
@@ -100,4 +108,4 @@ export interface CheckboxProps extends Omit<ComponentPropsWithoutRef<typeof Chec
100
108
  * }
101
109
  * ```
102
110
  */
103
- export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>;
111
+ export declare function Checkbox({ variant, status, code, loading, loadingDescription, showSpinner, onBlurToOutside, validate, validationMode, children, rootProps, containerProps, codeProps, indicatorProps, labelProps, spinnerProps, value, defaultChecked, checked: controlledChecked, onCheckedChange, onFocus, onBlur, id, name, className, required, disabled, readOnly, startAdornment, endAdornment, "aria-disabled": ariaDisabled, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, startContainerProps, endContainerProps, ref, ...otherProps }: CheckboxProps): import("react").JSX.Element;
@@ -1,11 +1,11 @@
1
- import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type FocusEvent, type ReactNode } from "react";
1
+ import { type ComponentProps, type FocusEvent, type ReactNode } from "react";
2
2
  import { type ControlStatus, type ControlVariant } from "../Control";
3
- import { ControlCode } from "../ControlCode";
3
+ import { type ControlCodeProps } from "../ControlCode";
4
4
  import type { FormValidationMode } from "../Form";
5
5
  import { type FormControlValidateFn } from "../Form/useRegisterFormControl.ts";
6
- import { Spinner } from "../Spinner";
6
+ import { type SpinnerProps } from "../Spinner";
7
7
  /** Properties of the checkbox group component. */
8
- export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
8
+ export interface CheckboxGroupProps extends ComponentProps<"div"> {
9
9
  /**
10
10
  * Whether to display the checkbox group inline. Defaults to `false` unless
11
11
  * when rending inside a table cell.
@@ -27,7 +27,7 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
27
27
  *
28
28
  * When `true`, the checkbox group is “soft-disabled”: it looks disabled and
29
29
  * ignores user interaction but remains focusable. By default, a spinner is
30
- * shown (_i.e._, `showSpinner` is set to `true` unless overridden).
30
+ * shown (i.e. `showSpinner` is set to `true` unless overridden).
31
31
  *
32
32
  * The checkbox group's accessible description while loading can be controlled
33
33
  * via `loadingDescription`.
@@ -56,8 +56,12 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
56
56
  * @default loading
57
57
  */
58
58
  showSpinner?: boolean;
59
- /** Whether the field is required. */
59
+ /** Whether the checkbox group is required. */
60
60
  required?: boolean;
61
+ /** Minimum number of checkboxes that must be checked. */
62
+ minChecked?: number;
63
+ /** Maximum number of checkboxes that can be checked. */
64
+ maxChecked?: number;
61
65
  /** Whether to disable the checkbox group. */
62
66
  disabled?: boolean;
63
67
  /** Sets the checkbox group as read-only. */
@@ -68,6 +72,10 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
68
72
  value?: string[];
69
73
  /** Action to run whenever the checkbox group's value changes. */
70
74
  onValueChange?: (value: string[]) => void;
75
+ /** Checkbox group's start adornment. */
76
+ startAdornment?: ReactNode;
77
+ /** Checkbox group's end adornment. */
78
+ endAdornment?: ReactNode;
71
79
  /**
72
80
  * Function called when the focus moves out of the control as a whole.
73
81
  *
@@ -86,13 +94,15 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
86
94
  */
87
95
  validationMode?: FormValidationMode;
88
96
  /** Properties to pass to the code component. */
89
- codeProps?: ComponentPropsWithRef<typeof ControlCode>;
97
+ codeProps?: ControlCodeProps;
90
98
  /** Properties to pass to the container component. */
91
- containerProps?: ComponentPropsWithRef<"div">;
92
- /** Properties to pass to the end element containing the spinner. */
93
- endContainerProps?: ComponentPropsWithRef<"div">;
99
+ containerProps?: ComponentProps<"div">;
100
+ /** Properties to pass to the start container element. */
101
+ startContainerProps?: ComponentProps<"div">;
102
+ /** Properties to pass to the end container element. */
103
+ endContainerProps?: ComponentProps<"div">;
94
104
  /** Properties to pass to the spinner component. */
95
- spinnerProps?: Omit<ComponentPropsWithRef<typeof Spinner>, "size">;
105
+ spinnerProps?: Omit<SpinnerProps, "size">;
96
106
  }
97
107
  /**
98
108
  * The `CheckboxGroup` component displays a set of `Checkbox` components,
@@ -121,4 +131,4 @@ export interface CheckboxGroupProps extends ComponentPropsWithoutRef<"div"> {
121
131
  * }
122
132
  * ```
123
133
  */
124
- export declare const CheckboxGroup: import("react").ForwardRefExoticComponent<CheckboxGroupProps & import("react").RefAttributes<HTMLDivElement>>;
134
+ export declare function CheckboxGroup({ inline, variant, status, code, name, loading, loadingDescription, showSpinner, required, minChecked, maxChecked, disabled, readOnly, defaultValue, value, onValueChange, onBlurToOutside, validate, validationMode, codeProps, containerProps, startContainerProps, endContainerProps, spinnerProps, id, className, startAdornment, endAdornment, onMouseDown, onFocus, tabIndex: controlledTabIndex, children, "aria-disabled": ariaDisabled, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...otherProps }: CheckboxGroupProps): import("react").JSX.Element;
@@ -1,12 +1,10 @@
1
1
  import { type RefObject } from "react";
2
2
  import type { CheckboxGroupProps } from "./CheckboxGroup.tsx";
3
3
  /** Value of the checkbox group's context. */
4
- export interface CheckboxGroupContextValue {
5
- name?: string;
6
- required?: boolean;
4
+ export interface CheckboxGroupContextValue extends Pick<CheckboxGroupProps, "name" | "minChecked" | "maxChecked"> {
7
5
  loadingDescriptionId?: string;
8
- errorMessageIds?: string[];
9
- descriptionIds?: string[];
6
+ feedbackIds?: string[];
7
+ helperTextIds?: string[];
10
8
  store: CheckboxGroupStore;
11
9
  }
12
10
  /** State of the checkbox group. */
@@ -29,12 +27,13 @@ export interface UseCreateCheckboxGroupContextOptions extends Omit<CheckboxGroup
29
27
  formOnChange: (value: string[]) => void;
30
28
  }
31
29
  /** Hook which creates the checkbox group's store. */
32
- export declare function useCreateCheckboxGroupContext({ defaultValue, value, onValueChange, formOnChange, name, required, loadingDescriptionId, errorMessageIds, descriptionIds, checkboxGroupRef, }: UseCreateCheckboxGroupContextOptions): {
30
+ export declare function useCreateCheckboxGroupContext({ defaultValue, value, onValueChange, formOnChange, name, minChecked, maxChecked, loadingDescriptionId, feedbackIds, helperTextIds, checkboxGroupRef, }: UseCreateCheckboxGroupContextOptions): {
33
31
  name: string | undefined;
34
- required: boolean | undefined;
32
+ minChecked: number | undefined;
33
+ maxChecked: number | undefined;
35
34
  loadingDescriptionId: string | undefined;
36
- errorMessageIds: string[] | undefined;
37
- descriptionIds: string[] | undefined;
35
+ feedbackIds: string[] | undefined;
36
+ helperTextIds: string[] | undefined;
38
37
  store: Omit<import("zustand").StoreApi<CheckboxGroupState>, "subscribe"> & {
39
38
  subscribe: {
40
39
  (listener: (selectedState: CheckboxGroupState, previousSelectedState: CheckboxGroupState) => void): () => void;
@@ -59,6 +58,13 @@ export declare function useIsCheckedInGroup(checkboxValue: string): [boolean | u
59
58
  * required and no checkboxes have been checked.
60
59
  */
61
60
  export declare function useIsRequiredInGroup(): boolean | undefined;
61
+ /**
62
+ * Returns whether a checkbox within a group should be soft-disabled.
63
+ *
64
+ * Non-checked checkboxes within a group that has reached its `maxChecked` will
65
+ * be soft-disabled.
66
+ */
67
+ export declare function useIsSoftDisabledInGroup(isChecked?: boolean): boolean | undefined;
62
68
  /**
63
69
  * Returns the description ids to set on a checkbox of a checkbox group.
64
70
  *
@@ -0,0 +1,3 @@
1
+ import type { CheckboxGroupProps } from "./CheckboxGroup.tsx";
2
+ /** Validates checkbox group props. */
3
+ export declare function validateCheckboxGroupProps({ minChecked, maxChecked, }: Pick<CheckboxGroupProps, "minChecked" | "maxChecked">): void;
@@ -13,6 +13,24 @@ export interface ClearContextsProps {
13
13
  * @default true
14
14
  */
15
15
  field?: boolean;
16
+ /**
17
+ * Clear the label context.
18
+ *
19
+ * @default field
20
+ */
21
+ label?: boolean;
22
+ /**
23
+ * Clear the feedback context.
24
+ *
25
+ * @default field
26
+ */
27
+ feedback?: boolean;
28
+ /**
29
+ * Clear the helper text context.
30
+ *
31
+ * @default field
32
+ */
33
+ helperText?: boolean;
16
34
  /**
17
35
  * Clear the link context.
18
36
  *
@@ -28,4 +46,4 @@ export interface ClearContextsProps {
28
46
  children?: ReactNode;
29
47
  }
30
48
  /** Component used to clear component contexts. */
31
- export declare function ClearContexts({ dataTableCell, field, link, tableCell, children, }: ClearContextsProps): ReactNode;
49
+ export declare function ClearContexts({ dataTableCell, field, label, feedback, helperText, link, tableCell, children, }: ClearContextsProps): ReactNode;
@@ -1,7 +1,6 @@
1
- import { type ComponentPropsWithoutRef } from "react";
2
- import { IconButton } from "../IconButton";
1
+ import { type IconButtonProps } from "../IconButton";
3
2
  /** Properties of the close button component. */
4
- export interface CloseButtonProps extends Partial<ComponentPropsWithoutRef<typeof IconButton<"button">>> {
3
+ export interface CloseButtonProps extends Partial<IconButtonProps> {
5
4
  }
6
5
  /** Component rendering a “close” button. */
7
- export declare const CloseButton: import("react").ForwardRefExoticComponent<CloseButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
6
+ export declare function CloseButton({ icon, label, className, ...otherProps }: CloseButtonProps): import("react").JSX.Element;
@@ -1,9 +1,9 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import type { ComponentProps } from "react";
2
2
  import type { AccentColor } from "../../utils/accent.ts";
3
3
  /** Code colours. */
4
4
  export type CodeColor = AccentColor;
5
5
  /** Properties of the code component. */
6
- export interface CodeProps extends ComponentPropsWithoutRef<"code"> {
6
+ export interface CodeProps extends ComponentProps<"code"> {
7
7
  /**
8
8
  * Change the component to the HTML tag or custom component of the only child.
9
9
  * This will merge the original component props with the props of the supplied
@@ -32,4 +32,4 @@ export interface CodeProps extends ComponentPropsWithoutRef<"code"> {
32
32
  * }
33
33
  * ```
34
34
  */
35
- export declare const Code: import("react").ForwardRefExoticComponent<CodeProps & import("react").RefAttributes<HTMLElement>>;
35
+ export declare function Code({ asChild, color, className, ...otherProps }: CodeProps): import("react").JSX.Element;
@@ -1,9 +1,11 @@
1
1
  import { Collapsible as CollapsiblePrimitive } from "radix-ui";
2
- import { type ComponentPropsWithoutRef } from "react";
2
+ import type { ComponentProps } from "react";
3
3
  /** Orientation in which to collapse/expand content. */
4
4
  export type CollapsibleOrientation = "horizontal" | "vertical";
5
5
  /** Properties of the collapsible component. */
6
- export interface CollapsibleProps extends ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root> {
6
+ export interface CollapsibleProps extends Omit<ComponentProps<typeof CollapsiblePrimitive.Root>, "onOpenChange"> {
7
+ /** Function called when the collapsible's open state changes. */
8
+ onOpenChange?: (open: boolean) => void;
7
9
  /**
8
10
  * Orientation in which to collapse/expand content.
9
11
  *
@@ -40,4 +42,4 @@ export interface CollapsibleProps extends ComponentPropsWithoutRef<typeof Collap
40
42
  * }
41
43
  * ```
42
44
  */
43
- export declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
45
+ export declare function Collapsible({ defaultOpen, open: controlledOpen, onOpenChange, orientation, className, ...otherProps }: CollapsibleProps): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { Collapsible as CollapsiblePrimitive } from "radix-ui";
2
- import { type ComponentPropsWithoutRef } from "react";
2
+ import type { ComponentProps } from "react";
3
3
  /** Properties of the collapsible content component. */
4
- export interface CollapsibleContentProps extends ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content> {
4
+ export interface CollapsibleContentProps extends ComponentProps<typeof CollapsiblePrimitive.Content> {
5
5
  }
6
6
  /** Component containing the collapsible content. */
7
- export declare const CollapsibleContent: import("react").ForwardRefExoticComponent<CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ export declare function CollapsibleContent({ className, ...otherProps }: CollapsibleContentProps): import("react").JSX.Element;
@@ -1,13 +1,13 @@
1
- import { type ComponentPropsWithoutRef, type ReactElement, type ReactNode } from "react";
1
+ import type { ComponentProps, ReactElement, ReactNode } from "react";
2
2
  import type { IconProp } from "../Icon/Icon.tsx";
3
- import { IconButton } from "../IconButton";
3
+ import { type IconButtonProps } from "../IconButton";
4
4
  /** Properties of the collapsible trigger component. */
5
5
  export type CollapsibleTriggerProps = CollapsibleTriggerChildlessProps | CollapsibleTriggerChildrenProps;
6
6
  /**
7
7
  * Properties of the collapsible trigger component when rendered without
8
8
  * children.
9
9
  */
10
- export interface CollapsibleTriggerChildlessProps extends Omit<Partial<ComponentPropsWithoutRef<typeof IconButton>>, "asChild" | "children"> {
10
+ export interface CollapsibleTriggerChildlessProps extends Omit<Partial<IconButtonProps>, "asChild" | "children"> {
11
11
  /** Icon used for the trigger icon button when the collapsible is collapsed. */
12
12
  expandIcon?: IconProp | ReactElement;
13
13
  /** Icon used for the trigger icon button when the collapsible is expanded. */
@@ -19,8 +19,8 @@ export interface CollapsibleTriggerChildlessProps extends Omit<Partial<Component
19
19
  children?: never;
20
20
  }
21
21
  /** Properties of the collapsible trigger component when rendered with children. */
22
- export interface CollapsibleTriggerChildrenProps extends Omit<ComponentPropsWithoutRef<"button">, "children"> {
22
+ export interface CollapsibleTriggerChildrenProps extends Omit<ComponentProps<"button">, "children"> {
23
23
  children: ReactNode | ((open: boolean) => ReactNode);
24
24
  }
25
25
  /** Trigger that toggles the expansion of the collapsible content. */
26
- export declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
26
+ export declare function CollapsibleTrigger({ children, ...otherProps }: CollapsibleTriggerProps): import("react").JSX.Element;
@@ -1,16 +1,16 @@
1
- import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode, type Ref } from "react";
2
- import { ControlAddon } from "../ControlAddon";
3
- import { Icon } from "../Icon";
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { type ControlAddonProps } from "../ControlAddon";
3
+ import { type IconProps } from "../Icon";
4
4
  import { type InputNonFileProps } from "../Input";
5
- import { MenuList, type MenuListIconPlacement, type MenuListVariant } from "../MenuList";
6
- import { Spinner } from "../Spinner";
5
+ import { type MenuListIconPlacement, type MenuListProps, type MenuListVariant } from "../MenuList";
6
+ import { type SpinnerProps } from "../Spinner";
7
7
  import { Command as CommandPrimitive } from "./cmdk";
8
8
  /** Command menu variants. */
9
9
  export type CommandMenuVariant = MenuListVariant;
10
10
  /** Placement of icons within command menu items. */
11
11
  export type CommandMenuIconPlacement = MenuListIconPlacement;
12
12
  /** Properties of the command menu component. */
13
- export interface CommandMenuProps extends ComponentPropsWithoutRef<typeof CommandPrimitive> {
13
+ export interface CommandMenuProps extends ComponentProps<typeof CommandPrimitive> {
14
14
  /**
15
15
  * Style variant of the command menu list.
16
16
  *
@@ -45,21 +45,19 @@ export interface CommandMenuProps extends ComponentPropsWithoutRef<typeof Comman
45
45
  /** Message to display when no items were found. */
46
46
  emptyMessage?: ReactNode;
47
47
  /** Properties to pass to the search `Input` component. */
48
- searchProps?: Omit<InputNonFileProps, "asChild" | "variant" | "status" | "code" | "defaultValue" | "value" | "onValueChange" | "startAdornment" | "endAdornment" | "showClearButton"> & {
49
- ref?: Ref<HTMLInputElement>;
50
- };
48
+ searchProps?: Omit<InputNonFileProps, "asChild" | "variant" | "status" | "code" | "defaultValue" | "value" | "onValueChange" | "startAdornment" | "endAdornment" | "showClearButton">;
51
49
  /** Properties to pass to the search adornment `ControlAddon` component. */
52
- searchAdornmentProps?: ComponentPropsWithRef<typeof ControlAddon>;
50
+ searchAdornmentProps?: ControlAddonProps;
53
51
  /** Properties to pass to the search `Icon` component. */
54
- searchIconProps?: ComponentPropsWithRef<typeof Icon>;
55
- /** Properties to pass to the list component. */
56
- listProps?: Omit<ComponentPropsWithRef<typeof MenuList>, "asChild" | "variant" | "iconPlacement">;
52
+ searchIconProps?: IconProps;
53
+ /** Properties to pass to the `MenuList` component. */
54
+ listProps?: Omit<MenuListProps, "asChild" | "variant" | "iconPlacement">;
57
55
  /** Properties to pass to the loading element. */
58
- loadingProps?: ComponentPropsWithRef<"div">;
59
- /** Properties to pass to the spinner component. */
60
- spinnerProps?: ComponentPropsWithRef<typeof Spinner>;
61
- /** Properties to pass to the component containing the empty message. */
62
- emptyMessageProps?: ComponentPropsWithRef<"div">;
56
+ loadingProps?: ComponentProps<"div">;
57
+ /** Properties to pass to the `Spinner` component. */
58
+ spinnerProps?: SpinnerProps;
59
+ /** Properties to pass to the element containing the empty message. */
60
+ emptyMessageProps?: ComponentProps<"div">;
63
61
  }
64
62
  /**
65
63
  * The command menu renders a menu of selectable items which can be filtered and
@@ -67,7 +65,7 @@ export interface CommandMenuProps extends ComponentPropsWithoutRef<typeof Comman
67
65
  *
68
66
  * Built on top of the [cmdk Command primitive](https://github.com/dip/cmdk/)
69
67
  * and the [`MenuList`
70
- * component](?path=/docs/ostack-ui-data-display-menu-list--docs).
68
+ * component](/docs/ostack-ui-data-display-menu-list--docs).
71
69
  *
72
70
  * It composes the following subcomponents:
73
71
  *
@@ -91,4 +89,4 @@ export interface CommandMenuProps extends ComponentPropsWithoutRef<typeof Comman
91
89
  * }
92
90
  * ```
93
91
  */
94
- export declare const CommandMenu: import("react").ForwardRefExoticComponent<CommandMenuProps & import("react").RefAttributes<HTMLDivElement>>;
92
+ export declare function CommandMenu({ variant, iconPlacement, label, searchPlaceholder, searchValue, onSearchValueChange, listLabel, loading, loadingLabel, loadingProgress, emptyMessage, className, searchProps, searchAdornmentProps, searchIconProps, listProps, loadingProps, spinnerProps, emptyMessageProps, children, ...otherProps }: CommandMenuProps): import("react").JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import { Dialog as DialogPrimitive } from "radix-ui";
2
- import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from "react";
2
+ import type { ComponentProps, ReactNode } from "react";
3
3
  import type { DialogContentSize } from "../Dialog";
4
- import { Overlay } from "../Overlay";
4
+ import { type OverlayProps } from "../Overlay";
5
5
  /** Possible command menu dialog sizes. */
6
6
  export type CommandMenuDialogSize = DialogContentSize;
7
7
  /** Properties of the command menu dialog. */
8
- export interface CommandMenuDialogProps extends Omit<ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, "asChild" | "title"> {
8
+ export interface CommandMenuDialogProps extends Omit<ComponentProps<typeof DialogPrimitive.Content>, "asChild" | "title"> {
9
9
  /** Accessible dialog title. Not shown visibly. */
10
10
  title?: ReactNode;
11
11
  /** Accessible dialog description. Not shown visibly. */
@@ -37,9 +37,9 @@ export interface CommandMenuDialogProps extends Omit<ComponentPropsWithoutRef<ty
37
37
  */
38
38
  modal?: boolean;
39
39
  /** Properties to pass to the portal component. */
40
- portalProps?: Omit<ComponentPropsWithRef<typeof DialogPrimitive.Portal>, "forceMount">;
40
+ portalProps?: Omit<ComponentProps<typeof DialogPrimitive.Portal>, "forceMount">;
41
41
  /** Properties to pass to the `Overlay` component. */
42
- overlayProps?: ComponentPropsWithRef<typeof Overlay>;
42
+ overlayProps?: OverlayProps;
43
43
  }
44
44
  /** Component used to display the command menu within a dialog. */
45
- export declare const CommandMenuDialog: import("react").ForwardRefExoticComponent<CommandMenuDialogProps & import("react").RefAttributes<HTMLDivElement>>;
45
+ export declare function CommandMenuDialog({ title, description, size, open, defaultOpen, onOpenChange, modal, forceMount, portalProps, overlayProps, className, children, ...otherProps }: CommandMenuDialogProps): import("react").JSX.Element;
@@ -1,9 +1,9 @@
1
- import { type ComponentPropsWithoutRef, type ReactNode } from "react";
1
+ import type { ComponentProps, ReactNode } from "react";
2
2
  import { Command as CommandPrimitive } from "./cmdk";
3
3
  /** Properties of the command menu group. */
4
- export interface CommandMenuGroupProps extends Omit<ComponentPropsWithoutRef<typeof CommandPrimitive.Group>, "asChild" | "heading"> {
4
+ export interface CommandMenuGroupProps extends Omit<ComponentProps<typeof CommandPrimitive.Group>, "asChild" | "heading"> {
5
5
  /** Optional label of the command menu group. */
6
6
  label?: ReactNode;
7
7
  }
8
8
  /** Component used to group multiple command items. */
9
- export declare const CommandMenuGroup: import("react").ForwardRefExoticComponent<CommandMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
9
+ export declare function CommandMenuGroup({ label, className, ...otherProps }: CommandMenuGroupProps): import("react").JSX.Element;
@@ -1,7 +1,8 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  import { type MenuListItemProps } from "../MenuList";
3
3
  import { Command as CommandPrimitive } from "./cmdk";
4
- export interface CommandMenuItemProps extends Omit<ComponentPropsWithoutRef<typeof CommandPrimitive.Item>, "asChild" | "color">, Pick<MenuListItemProps, "selected" | "color" | "loading" | "loadingContent" | "showSpinner" | "icon" | "iconPlacement" | "keybinds" | "href" | "target" | "rel" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps" | "keybindsProps"> {
4
+ /** Properties of the command menu item component. */
5
+ export interface CommandMenuItemProps extends Omit<ComponentProps<typeof CommandPrimitive.Item>, "asChild" | "color">, Pick<MenuListItemProps, "selected" | "color" | "loading" | "loadingContent" | "showSpinner" | "icon" | "iconPlacement" | "keybinds" | "href" | "target" | "rel" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps" | "keybindsProps"> {
5
6
  /**
6
7
  * Render the item as a link. When set, you can pass `href`, `target`, and
7
8
  * `rel` properties to the item.
@@ -10,4 +11,5 @@ export interface CommandMenuItemProps extends Omit<ComponentPropsWithoutRef<type
10
11
  */
11
12
  asLink?: boolean;
12
13
  }
13
- export declare const CommandMenuItem: import("react").ForwardRefExoticComponent<CommandMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
14
+ /** Item of the command menu. */
15
+ export declare function CommandMenuItem({ onSelect, selected, asLink, color, disabled, loading, loadingContent, showSpinner, icon, iconPlacement, keybinds, href, target, rel, keywords, actionProps, contentProps, iconProps, spinnerProps, keybindsProps, className, children, "aria-disabled": ariaDisabled, ...otherProps }: CommandMenuItemProps): import("react").JSX.Element;
@@ -1,10 +1,10 @@
1
- import { type ComponentPropsWithoutRef } from "react";
1
+ import type { ComponentProps } from "react";
2
2
  import { type Breakpoint } from "../../utils/breakpoints.ts";
3
3
  import { type Responsive } from "../../utils/useResponsiveValues.ts";
4
4
  /** Breakpoints accepted by the container. */
5
5
  export type ContainerSize = Exclude<Breakpoint, "xs">;
6
6
  /** Properties of the container component. */
7
- export interface ContainerProps extends ComponentPropsWithoutRef<"div"> {
7
+ export interface ContainerProps extends ComponentProps<"div"> {
8
8
  /**
9
9
  * Change the component to the HTML tag or custom component of the only child.
10
10
  * This will merge the original component props with the props of the supplied
@@ -74,4 +74,4 @@ export interface ContainerProps extends ComponentPropsWithoutRef<"div"> {
74
74
  * }
75
75
  * ```
76
76
  */
77
- export declare const Container: import("react").ForwardRefExoticComponent<ContainerProps & import("react").RefAttributes<HTMLDivElement>>;
77
+ export declare function Container({ asChild, fluid, maxWidth, gutter, leftGutter, rightGutter, className, style, ...otherProps }: ContainerProps): import("react").JSX.Element;
@@ -1,8 +1,8 @@
1
- import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type CSSProperties, type ElementType, type FocusEvent, type ReactNode } from "react";
1
+ import { type ComponentProps, type CSSProperties, type ElementType, type FocusEvent, type ReactNode } from "react";
2
2
  import { type Responsive } from "../../utils/useResponsiveValues.ts";
3
- import { CloseButton } from "../CloseButton";
4
- import type { ControlAddon } from "../ControlAddon";
5
- import { Spinner } from "../Spinner";
3
+ import { type CloseButtonProps } from "../CloseButton";
4
+ import { type ControlCodeProps } from "../ControlCode";
5
+ import { type SpinnerProps } from "../Spinner";
6
6
  /** Accepted control types. */
7
7
  export type ControlType = "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week";
8
8
  /** Possible status of a control. */
@@ -16,7 +16,7 @@ export type ControlVariant = "default" | "cell";
16
16
  /** Accepted values for "show clear button". */
17
17
  export type ControlShowClearButton = boolean | "auto";
18
18
  /** Base properties of the control component. */
19
- type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue> = Omit<ComponentPropsWithoutRef<TElem>, "children" | "type" | "multiple" | "defaultValue" | "value"> & {
19
+ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue> = Omit<ComponentProps<TElem>, "children" | "type" | "multiple" | "defaultValue" | "value"> & {
20
20
  /**
21
21
  * Change the component to the HTML tag or custom component of the only child.
22
22
  * This will merge the original component props with the props of the supplied
@@ -54,7 +54,7 @@ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue
54
54
  *
55
55
  * When `true`, the control is “soft-disabled”: it looks disabled and ignores
56
56
  * user interaction but remains focusable. By default, a spinner is shown
57
- * (_i.e._, `showSpinner` is set to `true` unless overridden).
57
+ * (i.e. `showSpinner` is set to `true` unless overridden).
58
58
  *
59
59
  * The control's accessible description while loading can be controlled via
60
60
  * `loadingDescription`.
@@ -98,7 +98,7 @@ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue
98
98
  * is visible.
99
99
  *
100
100
  * This field should be provided when adding extra keybinds to clear the
101
- * control (_e.g._ the control is a file input and pressing Backspace/Delete
101
+ * control (e.g. the control is a file input and pressing Backspace/Delete
102
102
  * clears it).
103
103
  */
104
104
  clearDescription?: ReactNode;
@@ -110,15 +110,15 @@ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue
110
110
  */
111
111
  onBlurToOutside?: (event: FocusEvent) => void;
112
112
  /** Properties to pass to the root component. */
113
- rootProps?: ComponentPropsWithRef<"div">;
113
+ rootProps?: ComponentProps<"div">;
114
114
  /** Properties to pass to the code component. */
115
- codeProps?: Omit<ComponentPropsWithRef<typeof ControlAddon>, "status">;
115
+ codeProps?: Omit<ControlCodeProps, "status">;
116
116
  /** Properties to pass to the container component. */
117
- containerProps?: ComponentPropsWithRef<"div">;
117
+ containerProps?: ComponentProps<"div">;
118
118
  /** Properties to pass to the clear button component. */
119
- clearButtonProps?: ComponentPropsWithRef<typeof CloseButton>;
119
+ clearButtonProps?: CloseButtonProps;
120
120
  /** Properties to pass to the spinner component. */
121
- spinnerProps?: Omit<ComponentPropsWithRef<typeof Spinner>, "size">;
121
+ spinnerProps?: Omit<SpinnerProps, "size">;
122
122
  };
123
123
  /** Base properties of a single file input control. */
124
124
  export interface ControlFileInputSingleProps extends ControlPropsBase<"input", File | null, never> {
@@ -158,5 +158,5 @@ export interface ControlOutputProps extends ControlPropsBase<"output", never> {
158
158
  /** Properties of the control component. */
159
159
  export type ControlProps = ControlFileInputSingleProps | ControlFileInputMultipleProps | ControlNonFileInputProps | ControlSelectSingleProps | ControlSelectMultipleProps | ControlTextAreaProps | ControlOutputProps;
160
160
  /** Form control. */
161
- export declare const Control: import("react").ForwardRefExoticComponent<ControlProps & import("react").RefAttributes<HTMLElement>>;
161
+ export declare function Control({ asChild, type, defaultValue, value, variant, status, code, loading, loadingDescription, showSpinner, align, startAdornment, endAdornment, showClearButton, clearDescription, clearButtonLabel, onValueChange, onBlurToOutside, rootProps, codeProps, containerProps, clearButtonProps, spinnerProps, name, id, className, required, disabled, readOnly, style, onChange, onFocus, onBlur, onClick, "aria-disabled": ariaDisabled, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ref, ...otherProps }: ControlProps): import("react").JSX.Element;
162
162
  export {};
@@ -1,5 +1,14 @@
1
- import { type ComponentRef, type Ref } from "react";
2
- import { Control, type ControlProps } from "./Control.tsx";
1
+ import type { ComponentPropsWithoutRef, ComponentRef, Ref } from "react";
2
+ import { Control } from "./Control.tsx";
3
+ /** Properties of the control with container ref component. */
4
+ export type ControlWithContainerRefProps = ComponentPropsWithoutRef<typeof Control> & ControlWithContainerRefOwnProps;
5
+ /** Own properties of the control with container ref component. */
6
+ export interface ControlWithContainerRefOwnProps {
7
+ /** Reference to the control element. */
8
+ controlRef?: Ref<ComponentRef<typeof Control>>;
9
+ /** Reference to the container element. */
10
+ ref?: Ref<HTMLDivElement>;
11
+ }
3
12
  /**
4
13
  * Utility control component whose `ref` is passed to the control's container.
5
14
  * Use `controlRef` to provide the control's ref instead.
@@ -9,6 +18,4 @@ import { Control, type ControlProps } from "./Control.tsx";
9
18
  * container (since popovers/menus align themselves based on the element
10
19
  * referenced by their trigger).
11
20
  */
12
- export declare const ControlWithContainerRef: import("react").ForwardRefExoticComponent<(ControlProps & {
13
- controlRef?: Ref<ComponentRef<typeof Control>>;
14
- }) & import("react").RefAttributes<HTMLDivElement>>;
21
+ export declare function ControlWithContainerRef({ containerProps, controlRef, ref, ...otherProps }: ControlWithContainerRefProps): import("react").JSX.Element;
@@ -1,4 +1,28 @@
1
+ import { type ReactNode } from "react";
1
2
  import type { AccentColor } from "../../utils/accent.ts";
3
+ import type { ControlCodeProps } from "../ControlCode";
2
4
  import type { ControlStatus } from "./Control.tsx";
5
+ /** Options of the {@link useRegisterControl} hook. */
6
+ export interface UseRegisterControlOptions {
7
+ id: string | undefined;
8
+ name?: string;
9
+ tagName: string | undefined;
10
+ required: boolean | undefined;
11
+ status: ControlStatus | undefined;
12
+ code?: ReactNode;
13
+ codeProps?: ControlCodeProps;
14
+ }
15
+ /** Result of the {@link useRegisterControl} hook. */
16
+ export interface UseRegisterControlResult {
17
+ generatedId: string;
18
+ controlId: string | undefined;
19
+ codeId: string | undefined;
20
+ labelId: string | undefined;
21
+ dataTableColumnLabelId: string | null;
22
+ feedbackIds: string[] | undefined;
23
+ helperTextIds: string[] | undefined;
24
+ }
25
+ /** Hook used to register a control where necessary. */
26
+ export declare function useRegisterControl({ id, name, tagName, required, status, code, codeProps, }: UseRegisterControlOptions): UseRegisterControlResult;
3
27
  /** Transforms a control status into a colour accent. */
4
28
  export declare function controlStatusToAccent(status?: ControlStatus, defaultAccent?: AccentColor): AccentColor | undefined;