@ostack.tech/ui 1.2.0-beta.1 → 1.3.0-beta.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 (118) hide show
  1. package/dist/ostack-ui.css +867 -240
  2. package/dist/ostack-ui.js +8740 -6419
  3. package/dist/ostack-ui.js.map +1 -1
  4. package/package.json +1 -1
  5. package/scss/_utils.scss +2 -1
  6. package/scss/components/ButtonGroup/_ButtonGroup.scss +7 -4
  7. package/scss/components/Calendar/_Calendar.scss +0 -1
  8. package/scss/components/Card/_Card.scss +16 -7
  9. package/scss/components/Code/_Code.scss +3 -3
  10. package/scss/components/Container/_Container.scss +3 -3
  11. package/scss/components/ControlCode/_ControlCode.scss +1 -1
  12. package/scss/components/DataTable/_DataTable.scss +8 -8
  13. package/scss/components/DescriptionList/_DescriptionList.scss +1 -1
  14. package/scss/components/Feedback/_Feedback.scss +12 -9
  15. package/scss/components/Field/_Field.scss +3 -3
  16. package/scss/components/FieldGroup/_FieldGroup.scss +2 -1
  17. package/scss/components/Form/_Form.scss +2 -2
  18. package/scss/components/Grid/_Grid.scss +11 -11
  19. package/scss/components/Heading/_Heading-variables.scss +4 -1
  20. package/scss/components/Heading/_Heading.scss +22 -10
  21. package/scss/components/HelperText/_HelperText.scss +9 -7
  22. package/scss/components/Icon/_Icon-variables.scss +1 -0
  23. package/scss/components/Icon/_Icon.scss +2 -6
  24. package/scss/components/Keyboard/_Keyboard-variables.scss +4 -2
  25. package/scss/components/Keyboard/_Keyboard.scss +8 -4
  26. package/scss/components/Label/_Label-variables.scss +4 -0
  27. package/scss/components/Label/_Label.scss +13 -4
  28. package/scss/components/Link/_Link-variables.scss +1 -1
  29. package/scss/components/Link/_Link.scss +12 -3
  30. package/scss/components/Mark/_Mark.scss +2 -1
  31. package/scss/components/Spinner/_Spinner-variables.scss +1 -1
  32. package/scss/components/Spinner/_Spinner.scss +0 -7
  33. package/scss/components/Stack/_Stack.scss +20 -10
  34. package/scss/components/Stepper/_Stepper-variables.scss +0 -4
  35. package/scss/components/Stepper/_Stepper.scss +1 -6
  36. package/scss/components/Tabs/_Tabs-variables.scss +0 -1
  37. package/scss/components/Tabs/_Tabs.scss +4 -3
  38. package/scss/components/Tag/_Tag-variables.scss +1 -0
  39. package/scss/components/Tag/_Tag.scss +4 -3
  40. package/scss/components/Text/_Text-variables.scss +4 -0
  41. package/scss/components/Text/_Text.scss +19 -0
  42. package/scss/index.scss +5 -0
  43. package/scss/scss/helpers/_margin-utils.scss +35 -0
  44. package/scss/scss/helpers/_padding-utils.scss +35 -0
  45. package/scss/scss/helpers/_print-utils.scss +1 -1
  46. package/scss/scss/helpers/_sizing-utils.scss +45 -0
  47. package/scss/scss/helpers/_text-utils.scss +43 -0
  48. package/scss/scss/placeholders/checkable-group/_checkable-group.scss +2 -2
  49. package/scss/scss/placeholders/control/_control.scss +1 -9
  50. package/scss/scss/placeholders/menu/_menu.scss +2 -1
  51. package/scss/scss/placeholders/popover/_popover.scss +2 -2
  52. package/scss/scss/utils/_responsive-values.scss +7 -8
  53. package/types/components/Actions/Action.d.ts +1 -1
  54. package/types/components/Actions/Actions.d.ts +1 -1
  55. package/types/components/Alert/Alert.d.ts +3 -2
  56. package/types/components/Box/Box.d.ts +37 -0
  57. package/types/components/Box/index.d.ts +1 -0
  58. package/types/components/Button/Button.d.ts +3 -2
  59. package/types/components/ButtonGroup/ButtonGroup.d.ts +3 -2
  60. package/types/components/Calendar/Calendar.d.ts +3 -2
  61. package/types/components/Card/Card.d.ts +3 -2
  62. package/types/components/Card/CardTitle.d.ts +3 -2
  63. package/types/components/Checkbox/Checkbox.d.ts +2 -1
  64. package/types/components/CheckboxGroup/CheckboxGroup.d.ts +3 -2
  65. package/types/components/Code/Code.d.ts +4 -2
  66. package/types/components/Container/Container.d.ts +3 -2
  67. package/types/components/Control/Control.d.ts +13 -13
  68. package/types/components/ControlCode/ControlCode.d.ts +3 -2
  69. package/types/components/DataTable/DataTablePagination.d.ts +3 -2
  70. package/types/components/DataTable/DataTableRowsPerPage.d.ts +3 -2
  71. package/types/components/DateRangeInput/DateRangeInput.d.ts +5 -6
  72. package/types/components/Feedback/Feedback.d.ts +6 -4
  73. package/types/components/Feedback/FeedbackList.d.ts +3 -2
  74. package/types/components/Field/Field.d.ts +5 -10
  75. package/types/components/FieldGroup/FieldGroup.d.ts +3 -2
  76. package/types/components/FieldGroup/FieldGroupTitle.d.ts +3 -2
  77. package/types/components/Form/Form.d.ts +3 -8
  78. package/types/components/Grid/Grid.d.ts +4 -4
  79. package/types/components/Grid/GridContext.d.ts +1 -1
  80. package/types/components/Heading/Heading.d.ts +12 -3
  81. package/types/components/HelperText/HelperText.d.ts +4 -2
  82. package/types/components/Icon/Icon.d.ts +9 -4
  83. package/types/components/IconButton/IconButton.d.ts +3 -2
  84. package/types/components/Keybinds/Keybinds.d.ts +3 -2
  85. package/types/components/Keyboard/Keyboard.d.ts +17 -4
  86. package/types/components/Label/Label.d.ts +11 -2
  87. package/types/components/Link/Link.d.ts +4 -2
  88. package/types/components/Mark/Mark.d.ts +7 -5
  89. package/types/components/MenuList/MenuList.d.ts +3 -2
  90. package/types/components/Popover/Popover.d.ts +1 -1
  91. package/types/components/Popover/PopoverContent.d.ts +4 -2
  92. package/types/components/Printer/PrinterContent.d.ts +3 -9
  93. package/types/components/RadioGroup/Radio.d.ts +2 -1
  94. package/types/components/RadioGroup/RadioGroup.d.ts +3 -2
  95. package/types/components/Root/Root.d.ts +3 -8
  96. package/types/components/Root/RootElement.d.ts +2 -2
  97. package/types/components/Separator/Separator.d.ts +2 -1
  98. package/types/components/Spinner/Spinner.d.ts +7 -4
  99. package/types/components/Stack/Stack.d.ts +5 -10
  100. package/types/components/Stack/StackContext.d.ts +1 -1
  101. package/types/components/Stepper/StepContent.d.ts +3 -8
  102. package/types/components/Stepper/StepList.d.ts +3 -2
  103. package/types/components/Stepper/Stepper.d.ts +9 -13
  104. package/types/components/Table/Table.d.ts +2 -1
  105. package/types/components/Tabs/TabContent.d.ts +3 -2
  106. package/types/components/Tabs/TabList.d.ts +2 -1
  107. package/types/components/Tabs/Tabs.d.ts +6 -4
  108. package/types/components/Tag/Tag.d.ts +4 -2
  109. package/types/components/Text/Text.d.ts +48 -0
  110. package/types/components/Text/index.d.ts +1 -0
  111. package/types/index.d.ts +7 -1
  112. package/types/utils/responsiveValues.d.ts +41 -0
  113. package/types/utils/useMarginProps.d.ts +46 -0
  114. package/types/utils/usePaddingProps.d.ts +46 -0
  115. package/types/utils/useSizingProps.d.ts +23 -0
  116. package/types/utils/useTextProps.d.ts +50 -0
  117. package/types/utils/changeCase.d.ts +0 -2
  118. package/types/utils/useResponsiveValues.d.ts +0 -41
@@ -1,10 +1,11 @@
1
1
  import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
2
3
  /** Elements a card title can be rendered as. */
3
4
  export type CardTitleAs = "div" | "span" | "h2" | "h3" | "h4" | "h5" | "h6";
4
5
  /** Properties of the card title component. */
5
6
  export type CardTitleProps<TAs extends CardTitleAs = "div"> = PolymorphicProps<CardTitleAs, TAs, "div", CardTitleOwnProps>;
6
7
  /** Own properties of the card title component. */
7
- export interface CardTitleOwnProps {
8
+ export interface CardTitleOwnProps extends UseMarginPropsOptions {
8
9
  /**
9
10
  * Change the component to the HTML tag or custom component of the only child. This will merge the
10
11
  * original component props with the props of the supplied element/component and change the
@@ -13,4 +14,4 @@ export interface CardTitleOwnProps {
13
14
  asChild?: boolean;
14
15
  }
15
16
  /** Title of the `Card` component. */
16
- export declare function CardTitle<TAs extends CardTitleAs = "div">({ as, asChild, className, ...otherProps }: CardTitleProps<TAs>): import("react").JSX.Element;
17
+ export declare function CardTitle<TAs extends CardTitleAs = "div">({ as, asChild, className, style, ...otherProps }: CardTitleProps<TAs>): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { Checkbox as CheckboxPrimitive } from "radix-ui";
2
2
  import { type ComponentProps, type FocusEvent, type ReactNode } from "react";
3
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
3
4
  import { type ControlStatus, type ControlVariant } from "../Control";
4
5
  import { type ControlCodeProps } from "../ControlCode";
5
6
  import type { FormValidationMode } from "../Form";
@@ -10,7 +11,7 @@ import { type SpinnerProps } from "../Spinner";
10
11
  /** `checked` state of a checkbox. */
11
12
  export type CheckboxChecked = CheckboxPrimitive.CheckedState;
12
13
  /** Properties of the checkbox component. */
13
- export interface CheckboxProps extends Omit<ComponentProps<typeof CheckboxPrimitive.Root>, "asChild"> {
14
+ export interface CheckboxProps extends UseMarginPropsOptions, Omit<ComponentProps<typeof CheckboxPrimitive.Root>, "asChild"> {
14
15
  /**
15
16
  * Checkbox style variant. Defaults to the default variant unless when rendering inside a table
16
17
  * cell (in which case it defaults to `"cell"`).
@@ -1,11 +1,12 @@
1
1
  import { type ComponentProps, type FocusEvent, type ReactNode } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
2
3
  import { type ControlStatus, type ControlVariant } from "../Control";
3
4
  import { type ControlCodeProps } from "../ControlCode";
4
5
  import type { FormValidationMode } from "../Form";
5
6
  import { type FormControlValidateFn } from "../Form/useRegisterFormControl.ts";
6
7
  import { type SpinnerProps } from "../Spinner";
7
8
  /** Properties of the checkbox group component. */
8
- export interface CheckboxGroupProps extends ComponentProps<"div"> {
9
+ export interface CheckboxGroupProps extends UseMarginPropsOptions, ComponentProps<"div"> {
9
10
  /**
10
11
  * Whether to display the checkbox group inline. Defaults to `false` unless when rending inside a
11
12
  * table cell.
@@ -117,4 +118,4 @@ export interface CheckboxGroupProps extends ComponentProps<"div"> {
117
118
  * }
118
119
  * ```
119
120
  */
120
- export declare function CheckboxGroup({ inline: inlineProp, variant: variantProp, status: statusProp, code, name, loading, loadingDescription: loadingDescriptionProp, showSpinner, required, minChecked: minCheckedProp, maxChecked, disabled: disabledProp, 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;
121
+ export declare function CheckboxGroup({ inline: inlineProp, variant: variantProp, status: statusProp, code, name, loading, loadingDescription: loadingDescriptionProp, showSpinner, required, minChecked: minCheckedProp, maxChecked, disabled: disabledProp, readOnly, defaultValue, value, onValueChange, onBlurToOutside, validate, validationMode, codeProps, containerProps, startContainerProps, endContainerProps, spinnerProps, id, className, startAdornment, endAdornment, onMouseDown, onFocus, tabIndex: controlledTabIndex, style, children, "aria-disabled": ariaDisabled, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ref, ...otherProps }: CheckboxGroupProps): import("react").JSX.Element;
@@ -1,9 +1,11 @@
1
1
  import type { ComponentProps } from "react";
2
2
  import type { AccentColor } from "../../utils/accent.ts";
3
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
4
+ import { type UseTextPropsOptions } from "../../utils/useTextProps.ts";
3
5
  /** Code colours. */
4
6
  export type CodeColor = AccentColor;
5
7
  /** Properties of the code component. */
6
- export interface CodeProps extends ComponentProps<"code"> {
8
+ export interface CodeProps extends UseMarginPropsOptions, UseTextPropsOptions, ComponentProps<"code"> {
7
9
  /**
8
10
  * Change the component to the HTML tag or custom component of the only child. This will merge the
9
11
  * original component props with the props of the supplied element/component and change the
@@ -31,4 +33,4 @@ export interface CodeProps extends ComponentProps<"code"> {
31
33
  * }
32
34
  * ```
33
35
  */
34
- export declare function Code({ asChild, color, className, ...otherProps }: CodeProps): import("react").JSX.Element;
36
+ export declare function Code({ asChild, color, className, style, ...otherProps }: CodeProps): import("react").JSX.Element;
@@ -1,10 +1,11 @@
1
1
  import type { ComponentProps } from "react";
2
2
  import { type Breakpoint } from "../../utils/breakpoints.ts";
3
- import { type Responsive } from "../../utils/useResponsiveValues.ts";
3
+ import { type Responsive } from "../../utils/responsiveValues.ts";
4
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
4
5
  /** Breakpoints accepted by the container. */
5
6
  export type ContainerSize = Exclude<Breakpoint, "xs">;
6
7
  /** Properties of the container component. */
7
- export interface ContainerProps extends ComponentProps<"div"> {
8
+ export interface ContainerProps extends UseMarginPropsOptions, ComponentProps<"div"> {
8
9
  /**
9
10
  * Change the component to the HTML tag or custom component of the only child. This will merge the
10
11
  * original component props with the props of the supplied element/component and change the
@@ -1,5 +1,6 @@
1
- import { type ComponentProps, type CSSProperties, type ElementType, type FocusEvent, type ReactNode } from "react";
2
- import { type Responsive } from "../../utils/useResponsiveValues.ts";
1
+ import { type ComponentProps, type ElementType, type FocusEvent, type ReactNode } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
3
+ import { type UseTextPropsOptions } from "../../utils/useTextProps.ts";
3
4
  import { type CloseButtonProps } from "../CloseButton";
4
5
  import { type ControlCodeProps } from "../ControlCode";
5
6
  import { type SpinnerProps } from "../Spinner";
@@ -16,10 +17,10 @@ export type ControlVariant = "default" | "cell";
16
17
  /** Accepted values for "show clear button". */
17
18
  export type ControlShowClearButton = boolean | "auto";
18
19
  /** Base properties of the control component. */
19
- type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue> = Omit<ComponentProps<TElem>, "children" | "type" | "multiple" | "defaultValue" | "value"> & {
20
+ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue> = Omit<ComponentProps<TElem>, "children" | "type" | "multiple" | "defaultValue" | "value"> & UseMarginPropsOptions & Pick<UseTextPropsOptions, "align"> & {
20
21
  /**
21
- * Change the component to the HTML tag or custom component of the only child. This will merge the
22
- * original component props with the props of the supplied element/component and change the
22
+ * Change the component to the HTML tag or custom component of the only child. This will merge
23
+ * the original component props with the props of the supplied element/component and change the
23
24
  * underlying DOM node.
24
25
  */
25
26
  asChild?: boolean;
@@ -52,11 +53,12 @@ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue
52
53
  /**
53
54
  * Renders the control in a **loading** state.
54
55
  *
55
- * When `true`, the control is “soft-disabled”: it looks disabled and ignores user interaction but
56
- * remains focusable. By default, a spinner is shown (i.e. `showSpinner` is set to `true` unless
57
- * overridden).
56
+ * When `true`, the control is “soft-disabled”: it looks disabled and ignores user interaction
57
+ * but remains focusable. By default, a spinner is shown (i.e. `showSpinner` is set to `true`
58
+ * unless overridden).
58
59
  *
59
- * The control's accessible description while loading can be controlled via `loadingDescription`.
60
+ * The control's accessible description while loading can be controlled via
61
+ * `loadingDescription`.
60
62
  *
61
63
  * To only show a spinner without “soft-disabling” the control, set `showSpinner` instead.
62
64
  *
@@ -77,8 +79,6 @@ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue
77
79
  * @default loading
78
80
  */
79
81
  showSpinner?: boolean;
80
- /** Sets the control's text align. */
81
- align?: Responsive<CSSProperties["textAlign"]>;
82
82
  /** Control's start adornment. */
83
83
  startAdornment?: ReactNode;
84
84
  /** Control's end adornment. */
@@ -93,8 +93,8 @@ type ControlPropsBase<TElem extends ElementType, TValue, TAcceptedValue = TValue
93
93
  /**
94
94
  * Accessible description for how to clear the control when the clear button is visible.
95
95
  *
96
- * This field should be provided when adding extra keybinds to clear the control (e.g. the control
97
- * is a file input and pressing Backspace/Delete clears it).
96
+ * This field should be provided when adding extra keybinds to clear the control (e.g. the
97
+ * control is a file input and pressing Backspace/Delete clears it).
98
98
  */
99
99
  clearDescription?: ReactNode;
100
100
  /**
@@ -1,7 +1,8 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
2
3
  import { type ControlStatus, type ControlVariant } from "../Control";
3
4
  /** Properties of the control's code component. */
4
- export interface ControlCodeProps extends ComponentProps<"div"> {
5
+ export interface ControlCodeProps extends UseMarginPropsOptions, ComponentProps<"div"> {
5
6
  /**
6
7
  * Change the component to the HTML tag or custom component of the only child. This will merge the
7
8
  * original component props with the props of the supplied element/component and change the
@@ -16,4 +17,4 @@ export interface ControlCodeProps extends ComponentProps<"div"> {
16
17
  visuallyHiddenPrefix?: ReactNode;
17
18
  }
18
19
  /** Component used to display the "code" of a form control. */
19
- export declare function ControlCode({ asChild, variant, status, visuallyHiddenPrefix: visuallyHiddenPrefixProp, className, children, ...otherProps }: ControlCodeProps): import("react").JSX.Element;
20
+ export declare function ControlCode({ asChild, variant, status, visuallyHiddenPrefix: visuallyHiddenPrefixProp, className, style, children, ...otherProps }: ControlCodeProps): import("react").JSX.Element;
@@ -1,7 +1,8 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
2
3
  import type { IconButtonProps } from "../IconButton";
3
4
  /** Properties of the data table pagination component. */
4
- export interface DataTablePaginationProps extends ComponentProps<"div"> {
5
+ export interface DataTablePaginationProps extends UseMarginPropsOptions, ComponentProps<"div"> {
5
6
  /**
6
7
  * Function used to render the range of displayed rows.
7
8
  *
@@ -28,4 +29,4 @@ export interface DataTablePaginationProps extends ComponentProps<"div"> {
28
29
  nextPageButtonProps?: IconButtonProps;
29
30
  }
30
31
  /** Component used to provide pagination to the data table. */
31
- export declare function DataTablePagination({ rowsRange: rowsRangeProp, rowsRangeSelectLabel: rowsRangeSelectLabelProp, previousPageButtonLabel: previousPageButtonLabelProp, nextPageButtonLabel: nextPageButtonLabelProp, previousPageButtonProps, nextPageButtonProps, preferRightAlignment, ...otherProps }: DataTablePaginationProps): import("react").JSX.Element | null;
32
+ export declare function DataTablePagination({ rowsRange: rowsRangeProp, rowsRangeSelectLabel: rowsRangeSelectLabelProp, previousPageButtonLabel: previousPageButtonLabelProp, nextPageButtonLabel: nextPageButtonLabelProp, previousPageButtonProps, nextPageButtonProps, preferRightAlignment, style, ...otherProps }: DataTablePaginationProps): import("react").JSX.Element | null;
@@ -1,6 +1,7 @@
1
1
  import { type ComponentProps, type ReactNode } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
2
3
  /** Properties of the data table rows per page component. */
3
- export interface DataTableRowsPerPageProps extends ComponentProps<"div"> {
4
+ export interface DataTableRowsPerPageProps extends UseMarginPropsOptions, ComponentProps<"div"> {
4
5
  /**
5
6
  * Options used to set the data table's `limit` (the maximum number of rows shown per page).
6
7
  *
@@ -22,4 +23,4 @@ export interface DataTableRowsPerPageProps extends ComponentProps<"div"> {
22
23
  preferRightAlignment?: boolean;
23
24
  }
24
25
  /** Component displaying a select used to change the number of rows per page. */
25
- export declare function DataTableRowsPerPage({ limitOptions, label: labelProp, preferRightAlignment, className, ...otherProps }: DataTableRowsPerPageProps): import("react").JSX.Element;
26
+ export declare function DataTableRowsPerPage({ limitOptions, label: labelProp, preferRightAlignment, className, style, ...otherProps }: DataTableRowsPerPageProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
- import { type ComponentProps, type CSSProperties, type FocusEvent, type ReactNode } from "react";
2
- import { type Responsive } from "../../utils/useResponsiveValues.ts";
1
+ import { type ComponentProps, type FocusEvent, type ReactNode } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
3
+ import { type UseTextPropsOptions } from "../../utils/useTextProps.ts";
3
4
  import { type CalendarProps, type DateRange } from "../Calendar";
4
5
  import { type CloseButtonProps } from "../CloseButton";
5
6
  import { type ControlShowClearButton, type ControlStatus, type ControlVariant } from "../Control";
@@ -26,7 +27,7 @@ export interface StringRange {
26
27
  end: string | null;
27
28
  }
28
29
  /** Properties of the date-range input component. */
29
- export interface DateRangeInputProps extends Omit<ComponentProps<"div">, "defaultValue"> {
30
+ export interface DateRangeInputProps extends UseMarginPropsOptions, Pick<UseTextPropsOptions, "align">, Omit<ComponentProps<"div">, "defaultValue"> {
30
31
  /** Name of the control. Both inputs will share the same name. */
31
32
  name?: string;
32
33
  /**
@@ -114,8 +115,6 @@ export interface DateRangeInputProps extends Omit<ComponentProps<"div">, "defaul
114
115
  * @default showSpinners
115
116
  */
116
117
  showEndSpinner?: boolean;
117
- /** Sets the inputs' text align. */
118
- align?: Responsive<CSSProperties["textAlign"]>;
119
118
  /** Date-range input's start adornment. */
120
119
  startAdornment?: ReactNode;
121
120
  /** Date-range input's start-middle adornment. */
@@ -238,4 +237,4 @@ export interface DateRangeValueRepresentations {
238
237
  * }
239
238
  * ```
240
239
  */
241
- export declare function DateRangeInput({ name, variant: variantProp, status: statusProp, code, value: controlledValue, defaultValue, onValueChange, required, disabled: disabledProp, readOnly, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, loading, loadingDescription: loadingDescriptionProp, showSpinners, showStartSpinner, showEndSpinner, align, startAdornment, startMiddleAdornment, endMiddleAdornment, endAdornment, showClearButtons, clearButtonsLabel: clearButtonsLabelProp, format, announcedFormat: announcedFormatProp, formatDescription: formatDescriptionProp, startInputLabel: startInputLabelProp, endInputLabel: endInputLabelProp, selectedDateDescription: selectedDateDescriptionProp, selectedDateRangeDescription: selectedDateRangeDescriptionProp, calendarButtonLabel: calendarButtonLabelProp, placeholder: placeholderProp, startPlaceholder, endPlaceholder, className, onPopoverOpenChange, onBlurToOutside, form, validate, validationMode, codeProps, popoverAnchorProps, startContainerProps, endContainerProps, startInputProps, endInputProps, startClearButtonProps, endClearButtonProps, spinnerProps, calendarButtonTooltipProps, calendarButtonProps, calendarButtonIconProps, calendarProps, popoverContentProps, "aria-disabled": ariaDisabled, ...otherProps }: DateRangeInputProps): import("react").JSX.Element;
240
+ export declare function DateRangeInput({ name, variant: variantProp, status: statusProp, code, value: controlledValue, defaultValue, onValueChange, required, disabled: disabledProp, readOnly, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, loading, loadingDescription: loadingDescriptionProp, showSpinners, showStartSpinner, showEndSpinner, align, startAdornment, startMiddleAdornment, endMiddleAdornment, endAdornment, showClearButtons, clearButtonsLabel: clearButtonsLabelProp, format, announcedFormat: announcedFormatProp, formatDescription: formatDescriptionProp, startInputLabel: startInputLabelProp, endInputLabel: endInputLabelProp, selectedDateDescription: selectedDateDescriptionProp, selectedDateRangeDescription: selectedDateRangeDescriptionProp, calendarButtonLabel: calendarButtonLabelProp, placeholder: placeholderProp, startPlaceholder, endPlaceholder, className, onPopoverOpenChange, onBlurToOutside, form, validate, validationMode, codeProps, popoverAnchorProps, startContainerProps, endContainerProps, startInputProps, endInputProps, startClearButtonProps, endClearButtonProps, spinnerProps, calendarButtonTooltipProps, calendarButtonProps, calendarButtonIconProps, calendarProps, popoverContentProps, "aria-disabled": ariaDisabled, style, ...otherProps }: DateRangeInputProps): import("react").JSX.Element;
@@ -1,11 +1,13 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
3
+ import { type UseTextPropsOptions } from "../../utils/useTextProps.ts";
2
4
  /** Possible types of feedback. */
3
5
  export type FeedbackType = "success" | "error" | "warning";
4
6
  /** Properties of the feedback component. */
5
- export type FeedbackProps = ComponentProps<"div" | "li"> & {
7
+ export type FeedbackProps = UseMarginPropsOptions & UseTextPropsOptions & ComponentProps<"div" | "li"> & {
6
8
  /**
7
- * Change the component to the HTML tag or custom component of the only child. This will merge the
8
- * original component props with the props of the supplied element/component and change the
9
+ * Change the component to the HTML tag or custom component of the only child. This will merge
10
+ * the original component props with the props of the supplied element/component and change the
9
11
  * underlying DOM node.
10
12
  */
11
13
  asChild?: boolean;
@@ -18,4 +20,4 @@ export type FeedbackProps = ComponentProps<"div" | "li"> & {
18
20
  visuallyHiddenPrefix?: ReactNode | ((type: FeedbackType) => ReactNode);
19
21
  };
20
22
  /** Component used to provide some feedback to a form control. */
21
- export declare function Feedback({ asChild, type: typeProp, visuallyHiddenPrefix: visuallyHiddenPrefixProp, id, className, children, ...otherProps }: FeedbackProps): import("react").JSX.Element;
23
+ export declare function Feedback({ asChild, type: typeProp, visuallyHiddenPrefix: visuallyHiddenPrefixProp, id, className, style, children, ...otherProps }: FeedbackProps): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import type { ComponentProps } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
2
3
  /** Properties of the feedback list component. */
3
- export interface FeedbackListProps extends ComponentProps<"ul"> {
4
+ export interface FeedbackListProps extends UseMarginPropsOptions, ComponentProps<"ul"> {
4
5
  }
5
6
  /** 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;
7
+ export declare function FeedbackList({ className, style, children, ...otherProps }: FeedbackListProps): import("react").JSX.Element;
@@ -1,16 +1,11 @@
1
- import { type ComponentProps } from "react";
1
+ import { type BoxProps } from "../Box";
2
2
  /** Properties of the field component. */
3
- export interface FieldProps extends ComponentProps<"div"> {
4
- /**
5
- * Change the component to the HTML tag or custom component of the only child. This will merge the
6
- * original component props with the props of the supplied element/component and change the
7
- * underlying DOM node.
8
- */
9
- asChild?: boolean;
3
+ export interface FieldProps extends Omit<BoxProps, "as"> {
10
4
  }
11
5
  /**
12
6
  * The `Field` component acts as a container that associates a form control with a label, helper
13
- * text, and/or validation feedback.
7
+ * text, and/or validation feedback. Built on top of the [`Box`
8
+ * component](/docs/ostack-ui-layout-box--docs).
14
9
  *
15
10
  * Use a `Label` to identify the control, a `HelperText` to provide additional guidance or
16
11
  * descriptions, and `Feedback` to display error, warning, or success messages.
@@ -33,4 +28,4 @@ export interface FieldProps extends ComponentProps<"div"> {
33
28
  * }
34
29
  * ```
35
30
  */
36
- export declare function Field({ asChild, className, ref, ...otherProps }: FieldProps): import("react").JSX.Element;
31
+ export declare function Field({ className, ref, ...otherProps }: FieldProps): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { type ComponentProps } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
2
3
  /** Properties of the field group component. */
3
- export interface FieldGroupProps extends ComponentProps<"div"> {
4
+ export interface FieldGroupProps extends UseMarginPropsOptions, ComponentProps<"div"> {
4
5
  /**
5
6
  * Change the component to the HTML tag or custom component of the only child. This will merge the
6
7
  * original component props with the props of the supplied element/component and change the
@@ -54,4 +55,4 @@ export interface FieldGroupProps extends ComponentProps<"div"> {
54
55
  * }
55
56
  * ```
56
57
  */
57
- export declare function FieldGroup({ asChild, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...otherProps }: FieldGroupProps): import("react").JSX.Element;
58
+ export declare function FieldGroup({ asChild, className, style, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...otherProps }: FieldGroupProps): import("react").JSX.Element;
@@ -1,10 +1,11 @@
1
1
  import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
2
3
  /** Element a field group title can be rendered as. */
3
4
  export type FieldGroupTitleAs = "div" | "span" | "label" | "h2" | "h3" | "h4" | "h5" | "h6";
4
5
  /** Properties of the field group title component. */
5
6
  export type FieldGroupTitleProps<TAs extends FieldGroupTitleAs = "div"> = PolymorphicProps<FieldGroupTitleAs, TAs, "div", FieldGroupTitleOwnProps>;
6
7
  /** Own properties of the field group title component. */
7
- export interface FieldGroupTitleOwnProps {
8
+ export interface FieldGroupTitleOwnProps extends UseMarginPropsOptions {
8
9
  /**
9
10
  * Change the component to the HTML tag or custom component of the only child. This will merge the
10
11
  * original component props with the props of the supplied element/component and change the
@@ -13,4 +14,4 @@ export interface FieldGroupTitleOwnProps {
13
14
  asChild?: boolean;
14
15
  }
15
16
  /** Component used to display the caption of a field group. */
16
- export declare function FieldGroupTitle<TAs extends FieldGroupTitleAs = "div">({ as, asChild, id, className, ...otherProps }: FieldGroupTitleProps<TAs>): import("react").JSX.Element;
17
+ export declare function FieldGroupTitle<TAs extends FieldGroupTitleAs = "div">({ as, asChild, id, className, style, ...otherProps }: FieldGroupTitleProps<TAs>): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { type ComponentProps, type ReactNode, type Ref, type SubmitEvent } from "react";
2
+ import { type BoxProps } from "../Box";
2
3
  /** Form values. */
3
4
  export type FormValues = Record<string, any>;
4
5
  /** Validation mode of the form. */
@@ -30,13 +31,7 @@ export interface FormApi<T extends FormValues = any> {
30
31
  focus: (name: keyof T | "") => void;
31
32
  }
32
33
  /** Properties of the form component. */
33
- export interface FormProps<T extends FormValues = any> extends Omit<ComponentProps<"form">, "noValidate" | "onSubmit"> {
34
- /**
35
- * Change the component to the HTML tag or custom component of the only child. This will merge the
36
- * original component props with the props of the supplied element/component and change the
37
- * underlying DOM node.
38
- */
39
- asChild?: boolean;
34
+ export interface FormProps<T extends FormValues = any> extends Omit<BoxProps, keyof ComponentProps<"form">>, Omit<ComponentProps<"form">, "noValidate" | "onSubmit"> {
40
35
  /** Function used to validate the whole form. */
41
36
  validate?: FormValidateFn<T>;
42
37
  /**
@@ -137,4 +132,4 @@ export interface FormProps<T extends FormValues = any> extends Omit<ComponentPro
137
132
  * }
138
133
  * ```
139
134
  */
140
- export declare function Form<T extends FormValues = any>({ asChild, validationMode, errorDisplayMode, validate, externalErrors, nativeErrorMessages, className, confirmUnloadWhenDirty, disableNativeValidations, onSubmit, onReset, onValueChange, submitErrorMessage: submitErrorMessageProp, apiRef, ref, ...otherProps }: FormProps<T>): import("react").JSX.Element;
135
+ export declare function Form<T extends FormValues = any>({ asChild, validationMode, errorDisplayMode, validate, externalErrors, nativeErrorMessages, className, confirmUnloadWhenDirty, disableNativeValidations, onSubmit, onReset, onValueChange, submitErrorMessage: submitErrorMessageProp, children, apiRef, ref, ...otherProps }: FormProps<T>): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
- import { type ComponentProps } from "react";
2
- import { type Responsive } from "../../utils/useResponsiveValues.ts";
1
+ import { type Responsive } from "../../utils/responsiveValues.ts";
2
+ import { type BoxProps } from "../Box";
3
3
  /** Size of a column. */
4
4
  export type GridColumnSize = number | "auto" | "content";
5
5
  /** Offset of a column. */
@@ -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 ComponentProps<"div"> {
10
+ export interface GridPropsBase extends BoxProps {
11
11
  /**
12
12
  * Change the component to the HTML tag or custom component of the only child. This will merge the
13
13
  * original component props with the props of the supplied element/component and change the
@@ -135,4 +135,4 @@ export interface GridItemProps extends GridPropsBase {
135
135
  * }
136
136
  * ```
137
137
  */
138
- 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;
138
+ export declare function Grid({ 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;
@@ -1,4 +1,4 @@
1
- import type { Responsive } from "../../utils/useResponsiveValues.ts";
1
+ import type { Responsive } from "../../utils/responsiveValues.ts";
2
2
  /** Grid context value. */
3
3
  export interface GridContextValue {
4
4
  container: boolean;
@@ -1,12 +1,17 @@
1
+ import type { AccentColor } from "../../utils/accent.ts";
1
2
  import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
3
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
4
+ import { type UseTextPropsOptions } from "../../utils/useTextProps.ts";
2
5
  /** Elements a heading can be rendered as. */
3
- export type HeadingAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span" | "label";
6
+ export type HeadingAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span";
4
7
  /** Heading levels. */
5
8
  export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
9
+ /** Heading colours. */
10
+ export type HeadingColor = AccentColor;
6
11
  /** Properties of the heading component. */
7
12
  export type HeadingProps<TAs extends HeadingAs = "h2"> = PolymorphicProps<HeadingAs, TAs, "h2", HeadingOwnProps>;
8
13
  /** Own properties of the heading component. */
9
- export interface HeadingOwnProps {
14
+ export interface HeadingOwnProps extends UseMarginPropsOptions, UseTextPropsOptions {
10
15
  /**
11
16
  * Change the component to the HTML tag or custom component of the only child. This will merge the
12
17
  * original component props with the props of the supplied element/component and change the
@@ -23,6 +28,10 @@ export interface HeadingOwnProps {
23
28
  * @default 2
24
29
  */
25
30
  level?: HeadingLevel;
31
+ /** Colour of the heading. */
32
+ color?: HeadingColor;
33
+ /** Uses a higher contrast colour for the text. */
34
+ highContrast?: boolean;
26
35
  }
27
36
  /**
28
37
  * Component used to render semantic HTML headings. It is built on top of the browser's
@@ -39,4 +48,4 @@ export interface HeadingOwnProps {
39
48
  * }
40
49
  * ```
41
50
  */
42
- export declare function Heading<TAs extends HeadingAs = "h2">({ as, asChild, level, className, ...otherProps }: HeadingProps<TAs>): import("react").JSX.Element;
51
+ export declare function Heading<TAs extends HeadingAs = "h2">({ as, asChild, level, color, highContrast, className, style, ...otherProps }: HeadingProps<TAs>): import("react").JSX.Element;
@@ -1,6 +1,8 @@
1
1
  import type { ComponentProps } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
3
+ import { type UseTextPropsOptions } from "../../utils/useTextProps.ts";
2
4
  /** Properties of the helper text component. */
3
- export interface HelperTextProps extends ComponentProps<"div"> {
5
+ export interface HelperTextProps extends UseMarginPropsOptions, UseTextPropsOptions, ComponentProps<"div"> {
4
6
  /**
5
7
  * Change the component to the HTML tag or custom component of the only child. This will merge the
6
8
  * original component props with the props of the supplied element/component and change the
@@ -9,4 +11,4 @@ export interface HelperTextProps extends ComponentProps<"div"> {
9
11
  asChild?: boolean;
10
12
  }
11
13
  /** Component used to provide helper text to a form control. */
12
- export declare function HelperText({ asChild, id, className, ...otherProps }: HelperTextProps): import("react").JSX.Element;
14
+ export declare function HelperText({ asChild, id, className, style, ...otherProps }: HelperTextProps): import("react").JSX.Element;
@@ -2,19 +2,24 @@ import type { IconProp } from "@fortawesome/fontawesome-svg-core";
2
2
  import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3
3
  import type { ComponentProps, ReactNode } from "react";
4
4
  import type { AccentColor } from "../../utils/accent.ts";
5
+ import type { Responsive } from "../../utils/responsiveValues.ts";
6
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
7
+ import { type TextSize } from "../../utils/useTextProps.ts";
5
8
  export type { IconProp } from "@fortawesome/fontawesome-svg-core";
6
9
  /** Possible sizes of an icon. */
7
- export type IconSize = "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl";
10
+ export type IconSize = TextSize;
8
11
  /** Possible colours of an icon. */
9
12
  export type IconColor = AccentColor;
10
13
  /** Properties of the icon component. */
11
- export interface IconProps extends Omit<ComponentProps<typeof FontAwesomeIcon>, "icon" | "size"> {
14
+ export interface IconProps extends UseMarginPropsOptions, Omit<ComponentProps<typeof FontAwesomeIcon>, "icon" | "size"> {
12
15
  /** Icon to display. */
13
16
  icon: IconProp;
14
17
  /** Size of the icon. By default, the icon will be sized according to the current font size. */
15
- size?: IconSize;
18
+ size?: Responsive<IconSize>;
16
19
  /** Colour of the icon. By default, the icon will have the current font's colour. */
17
20
  color?: IconColor;
21
+ /** Uses a higher contrast colour for the icon. */
22
+ highContrast?: boolean;
18
23
  /**
19
24
  * Optional accessible label for the icon.
20
25
  *
@@ -46,4 +51,4 @@ export interface IconProps extends Omit<ComponentProps<typeof FontAwesomeIcon>,
46
51
  * }
47
52
  * ```
48
53
  */
49
- export declare function Icon({ size, color, label, className, ...otherProps }: IconProps): import("react").JSX.Element;
54
+ export declare function Icon({ size, color, highContrast, label, style, className, ...otherProps }: IconProps): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { type ReactElement, type ReactNode } from "react";
2
2
  import { type KeyboardShortcutKeybinds } from "../../utils/keyboardShortcut.ts";
3
3
  import type { PolymorphicProps } from "../../utils/polymorphicTypes.ts";
4
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
4
5
  import type { ButtonAs, ButtonColor, ButtonSize, ButtonVariant } from "../Button";
5
6
  import { type IconProp, type IconProps } from "../Icon";
6
7
  import { type KeybindsProps } from "../Keybinds";
@@ -18,7 +19,7 @@ export type IconButtonSize = ButtonSize;
18
19
  /** Properties of the icon button component. */
19
20
  export type IconButtonProps<TAs extends IconButtonAs = "button"> = PolymorphicProps<IconButtonAs, TAs, "button", IconButtonOwnProps>;
20
21
  /** Own properties of the icon button component. */
21
- export interface IconButtonOwnProps {
22
+ export interface IconButtonOwnProps extends UseMarginPropsOptions {
22
23
  /**
23
24
  * Change the component to the HTML tag or custom component of the only child. This will merge the
24
25
  * original component props with the props of the supplied element/component and change the
@@ -153,4 +154,4 @@ export interface IconButtonOwnProps {
153
154
  * }
154
155
  * ```
155
156
  */
156
- export declare function IconButton<TAs extends IconButtonAs = "button">({ as, asChild, variant, color, size, circle, icon, label, active, disabled, loading, loadingLabel, showSpinner, tooltipContent: tooltipContentProp, keybinds, iconProps, labelProps, spinnerProps, tooltipProps, keybindsProps, type, onClick, className, children, "aria-disabled": ariaDisabled, ...otherProps }: IconButtonProps<TAs>): import("react").JSX.Element;
157
+ export declare function IconButton<TAs extends IconButtonAs = "button">({ as, asChild, variant, color, size, circle, icon, label, active, disabled, loading, loadingLabel, showSpinner, tooltipContent: tooltipContentProp, keybinds, iconProps, labelProps, spinnerProps, tooltipProps, keybindsProps, type, onClick, className, style, children, "aria-disabled": ariaDisabled, ...otherProps }: IconButtonProps<TAs>): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { type ComponentProps, type ReactNode } from "react";
2
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
2
3
  /** Properties of the keybinds component. */
3
- export interface KeybindsProps extends Omit<ComponentProps<"span">, "children"> {
4
+ export interface KeybindsProps extends UseMarginPropsOptions, Omit<ComponentProps<"span">, "children"> {
4
5
  keybinds: string | string[] | null | undefined;
5
6
  /** Limits the number of keybinds to display. Must be >= 1. By default, all keybinds are displayed. */
6
7
  limit?: number;
@@ -16,4 +17,4 @@ export interface KeybindsProps extends Omit<ComponentProps<"span">, "children">
16
17
  keyLabels?: Record<string, ReactNode>;
17
18
  }
18
19
  /** Component which visually renders [`tinykeys`](https://jamiebuilds.github.io/tinykeys) keybinds. */
19
- export declare function Keybinds({ keybinds: keybindsProp, limit, keybindsSeparatorLabel: keybindsSeparatorLabelProp, keyPressesSeparatorLabel, keySymbols, keyLabels, className, ...otherProps }: KeybindsProps): import("react").JSX.Element | null;
20
+ export declare function Keybinds({ keybinds: keybindsProp, limit, keybindsSeparatorLabel: keybindsSeparatorLabelProp, keyPressesSeparatorLabel, keySymbols, keyLabels, className, style, ...otherProps }: KeybindsProps): import("react").JSX.Element | null;
@@ -1,12 +1,23 @@
1
1
  import type { ComponentProps } from "react";
2
+ import type { AccentColor } from "../../utils/accent.ts";
3
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
4
+ import { type UseTextPropsOptions } from "../../utils/useTextProps.ts";
5
+ /** Keyboard colour. */
6
+ export type KeyboardColor = AccentColor;
2
7
  /** Properties of the keyboard component. */
3
- export interface KeyboardProps extends ComponentProps<"kbd"> {
8
+ export interface KeyboardProps extends UseMarginPropsOptions, UseTextPropsOptions, ComponentProps<"kbd"> {
4
9
  /**
5
10
  * Change the component to the HTML tag or custom component of the only child. This will merge the
6
11
  * original component props with the props of the supplied element/component and change the
7
12
  * underlying DOM node.
8
13
  */
9
14
  asChild?: boolean;
15
+ /**
16
+ * Colour of the keyboard element.
17
+ *
18
+ * @default "primary"
19
+ */
20
+ color?: KeyboardColor;
10
21
  }
11
22
  /**
12
23
  * Component which represents a span of inline text denoting textual user input from a keyboard,
@@ -17,13 +28,15 @@ export interface KeyboardProps extends ComponentProps<"kbd"> {
17
28
  * Example usage:
18
29
  *
19
30
  * ```tsx
31
+ * import { Keyboard, Text } from "@ostack.tech/ui";
32
+ *
20
33
  * function BookmarkInstructions() {
21
34
  * return (
22
- * <>
35
+ * <Text>
23
36
  * Press <Keyboard>Ctrl</Keyboard> + <Keyboard>D</Keyboard> to bookmark this page.
24
- * </>
37
+ * </Text>
25
38
  * );
26
39
  * }
27
40
  * ```
28
41
  */
29
- export declare function Keyboard({ asChild, className, ...otherProps }: KeyboardProps): import("react").JSX.Element;
42
+ export declare function Keyboard({ asChild, color, className, style, ...otherProps }: KeyboardProps): import("react").JSX.Element;
@@ -1,16 +1,25 @@
1
1
  import { Label as LabelPrimitive } from "radix-ui";
2
2
  import type { ComponentProps, ReactNode } from "react";
3
+ import type { AccentColor } from "../../utils/accent.ts";
4
+ import { type UseMarginPropsOptions } from "../../utils/useMarginProps.ts";
5
+ import { type UseTextPropsOptions } from "../../utils/useTextProps.ts";
3
6
  import { type IconProps } from "../Icon";
4
7
  import { type IconButtonProps } from "../IconButton";
5
8
  import { type PopoverContentProps, type PopoverProps } from "../Popover";
9
+ /** Label colours. */
10
+ export type LabelColor = AccentColor;
6
11
  /** Properties of the label component. */
7
- export interface LabelProps extends ComponentProps<typeof LabelPrimitive.Root> {
12
+ export interface LabelProps extends UseMarginPropsOptions, UseTextPropsOptions, ComponentProps<typeof LabelPrimitive.Root> {
8
13
  /** Shows a "required" symbol next to the label. */
9
14
  required?: boolean;
10
15
  /** Optional helper text displayed as a popover triggered by an icon button. */
11
16
  helperText?: ReactNode;
12
17
  /** Label of the helper button announced to assistive technologies. */
13
18
  helperButtonLabel?: string;
19
+ /** Colour of the label. */
20
+ color?: LabelColor;
21
+ /** Uses a higher contrast colour for the text. */
22
+ highContrast?: boolean;
14
23
  /** Properties to pass to the container element. */
15
24
  containerProps?: ComponentProps<"div">;
16
25
  /** Properties to pass to the required icon container element. */
@@ -41,4 +50,4 @@ export interface LabelProps extends ComponentProps<typeof LabelPrimitive.Root> {
41
50
  * }
42
51
  * ```
43
52
  */
44
- export declare function Label({ asChild, required, helperText, helperButtonLabel: helperButtonLabelProp, htmlFor, id, className, children, containerProps, requiredIconProps, requiredIconContainerProps, helperButtonProps, helperPopoverProps, helperPopoverContentProps, onClick, ...otherProps }: LabelProps): import("react").JSX.Element;
53
+ export declare function Label({ asChild, required, helperText, helperButtonLabel: helperButtonLabelProp, color, highContrast, htmlFor, id, className, truncate, style, children, containerProps, requiredIconProps, requiredIconContainerProps, helperButtonProps, helperPopoverProps, helperPopoverContentProps, onClick, ...otherProps }: LabelProps): import("react").JSX.Element;