@ostack.tech/ui 0.10.4 → 0.11.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 (113) hide show
  1. package/dist/chunks/{en-DwZKZVGL.js → en-DtnihkTA.js} +20 -3
  2. package/dist/chunks/en-DtnihkTA.js.map +1 -0
  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 +19 -2
  6. package/dist/locales/fr-FR.js.map +1 -1
  7. package/dist/locales/pt-PT.js +19 -2
  8. package/dist/locales/pt-PT.js.map +1 -1
  9. package/dist/ostack-ui.css +186 -110
  10. package/dist/ostack-ui.js +1466 -681
  11. package/dist/ostack-ui.js.map +1 -1
  12. package/dist/types/components/Alert/Alert.d.ts +3 -3
  13. package/dist/types/components/AlertDialog/AlertDialog.d.ts +6 -2
  14. package/dist/types/components/Button/Button.d.ts +7 -7
  15. package/dist/types/components/Calendar/Calendar.d.ts +60 -4
  16. package/dist/types/components/Card/Card.d.ts +2 -2
  17. package/dist/types/components/Code/Code.d.ts +1 -1
  18. package/dist/types/components/Collapsible/Collapsible.d.ts +26 -8
  19. package/dist/types/components/Collapsible/CollapsibleContext.d.ts +2 -2
  20. package/dist/types/components/Collapsible/CollapsibleTrigger.d.ts +22 -6
  21. package/dist/types/components/CommandMenu/CommandMenu.d.ts +1 -1
  22. package/dist/types/components/Container/Container.d.ts +21 -10
  23. package/dist/types/components/DataTable/DataTable.d.ts +63 -29
  24. package/dist/types/components/DataTable/DataTableContext.d.ts +3 -1
  25. package/dist/types/components/DateInput/DateInput.d.ts +8 -5
  26. package/dist/types/components/DateRangeInput/DateRangeInput.d.ts +6 -5
  27. package/dist/types/components/DescriptionList/DescriptionList.d.ts +38 -0
  28. package/dist/types/components/DescriptionList/DescriptionListItem.d.ts +15 -0
  29. package/dist/types/components/DescriptionList/index.d.ts +2 -0
  30. package/dist/types/components/Dialog/Dialog.d.ts +1 -2
  31. package/dist/types/components/Dialog/DialogContent.d.ts +3 -3
  32. package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +1 -1
  33. package/dist/types/components/FieldGroup/FieldGroup.d.ts +42 -14
  34. package/dist/types/components/Grid/Grid.d.ts +64 -11
  35. package/dist/types/components/Icon/Icon.d.ts +1 -1
  36. package/dist/types/components/IconButton/IconButton.d.ts +8 -10
  37. package/dist/types/components/Input/Input.d.ts +2 -3
  38. package/dist/types/components/Link/Link.d.ts +1 -3
  39. package/dist/types/components/Mark/Mark.d.ts +1 -1
  40. package/dist/types/components/MenuList/MenuList.d.ts +5 -0
  41. package/dist/types/components/MenuList/MenuListItem.d.ts +3 -3
  42. package/dist/types/components/NumericInput/NumericInput.d.ts +2 -2
  43. package/dist/types/components/Popover/Popover.d.ts +32 -19
  44. package/dist/types/components/Popover/PopoverClose.d.ts +10 -3
  45. package/dist/types/components/Printer/Printer.d.ts +4 -4
  46. package/dist/types/components/Printer/PrinterContentContext.d.ts +4 -4
  47. package/dist/types/components/Printer/PrinterContext.d.ts +2 -2
  48. package/dist/types/components/Root/Root.d.ts +7 -7
  49. package/dist/types/components/Select/Select.d.ts +6 -0
  50. package/dist/types/components/Select/SelectContext.d.ts +2 -1
  51. package/dist/types/components/Select/SelectNative.d.ts +7 -0
  52. package/dist/types/components/Separator/Separator.d.ts +39 -1
  53. package/dist/types/components/Stack/Stack.d.ts +27 -5
  54. package/dist/types/components/Stepper/Step.d.ts +21 -6
  55. package/dist/types/components/Stepper/StepContent.d.ts +13 -4
  56. package/dist/types/components/Stepper/StepList.d.ts +8 -3
  57. package/dist/types/components/Stepper/Stepper.d.ts +51 -34
  58. package/dist/types/components/Stepper/StepperContext.d.ts +77 -4
  59. package/dist/types/components/Stepper/StepperFinishTrigger.d.ts +37 -0
  60. package/dist/types/components/Stepper/StepperNextTrigger.d.ts +34 -0
  61. package/dist/types/components/Stepper/StepperPreviousTrigger.d.ts +37 -0
  62. package/dist/types/components/Stepper/StepperState.d.ts +8 -0
  63. package/dist/types/components/Stepper/index.d.ts +5 -0
  64. package/dist/types/components/Table/Table.d.ts +2 -2
  65. package/dist/types/components/Table/TableColumn.d.ts +1 -1
  66. package/dist/types/components/Tabs/Tab.d.ts +6 -1
  67. package/dist/types/components/Tabs/Tabs.d.ts +1 -1
  68. package/dist/types/components/Toast/Toast.d.ts +81 -15
  69. package/dist/types/components/Tooltip/Tooltip.d.ts +4 -0
  70. package/dist/types/components/VisuallyHidden/VisuallyHidden.d.ts +22 -1
  71. package/dist/types/index.d.ts +1 -2
  72. package/dist/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +2 -2
  73. package/dist/types/providers/ErrorReportingProvider/ErrorReport.d.ts +3 -3
  74. package/dist/types/providers/ErrorReportingProvider/ErrorReportingProvider.d.ts +2 -2
  75. package/dist/types/providers/LocalizationProvider/LocalizationObject.d.ts +7 -0
  76. package/dist/types/providers/ToastManagerProvider/ToastManagerContext.d.ts +4 -2
  77. package/dist/types/utils/control.d.ts +1 -1
  78. package/dist/types/utils/keyboardShortcut.d.ts +1 -1
  79. package/dist/types/utils/useSearchParam.d.ts +5 -5
  80. package/dist/types/utils/useSearchParams.d.ts +7 -4
  81. package/package.json +3 -3
  82. package/scss/_utils.scss +3 -0
  83. package/scss/components/Checkbox/_Checkbox.scss +1 -1
  84. package/scss/components/Collapsible/_Collapsible-variables.scss +0 -1
  85. package/scss/components/Collapsible/_Collapsible.scss +2 -6
  86. package/scss/components/Container/_Container.scss +16 -5
  87. package/scss/components/DescriptionList/_DescriptionList-variables.scss +21 -0
  88. package/scss/components/DescriptionList/_DescriptionList.scss +33 -0
  89. package/scss/components/DropdownMenu/_DropdownMenu.scss +1 -3
  90. package/scss/components/FeedbackPopover/_FeedbackPopover-variables.scss +9 -9
  91. package/scss/components/FeedbackPopover/_FeedbackPopover.scss +1 -1
  92. package/scss/components/Field/_Field-variables.scss +9 -0
  93. package/scss/components/Field/_Field.scss +6 -8
  94. package/scss/components/Input/_Input.scss +5 -0
  95. package/scss/components/Label/_Label-variables.scss +1 -1
  96. package/scss/components/MenuList/_MenuList.scss +4 -1
  97. package/scss/components/RadioGroup/_Radio.scss +1 -1
  98. package/scss/components/Separator/_Separator-variables.scss +11 -0
  99. package/scss/components/Separator/_Separator.scss +13 -5
  100. package/scss/components/Stepper/_Stepper-variables.scss +37 -9
  101. package/scss/components/Stepper/_Stepper.scss +69 -22
  102. package/scss/components/Tabs/_Tabs.scss +6 -4
  103. package/scss/index.scss +1 -0
  104. package/scss/scss/placeholders/checkable/_checkable.scss +3 -3
  105. package/scss/scss/placeholders/control/_control.scss +1 -1
  106. package/scss/scss/placeholders/menu/_menu.scss +5 -16
  107. package/scss/scss/utils/_animation.scss +1 -1
  108. package/scss/scss/utils/_transition.scss +1 -1
  109. package/dist/chunks/en-DwZKZVGL.js.map +0 -1
  110. package/dist/types/components/DatePicker/DatePicker.d.ts +0 -27
  111. package/dist/types/components/DatePicker/index.d.ts +0 -1
  112. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +0 -41
  113. package/dist/types/components/DateRangePicker/index.d.ts +0 -1
@@ -0,0 +1,15 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { GridItemProps } from '../Grid';
3
+ /** Properties of the description list item component. */
4
+ export interface DescriptionListItemProps extends GridItemProps {
5
+ /** Term of the description list item. */
6
+ term: ReactNode;
7
+ /** Details of the description list item. */
8
+ children: ReactNode;
9
+ /** Properties to pass to the description term element. */
10
+ descriptionTermProps?: ComponentPropsWithRef<"dt">;
11
+ /** Properties to pass to the description details element. */
12
+ descriptionDetailsProps?: ComponentPropsWithRef<"dd">;
13
+ }
14
+ /** Item of the description list: a grouping of a term and its details. */
15
+ export declare const DescriptionListItem: import('react').ForwardRefExoticComponent<DescriptionListItemProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ export * from './DescriptionList.tsx';
2
+ export * from './DescriptionListItem.tsx';
@@ -5,8 +5,7 @@ import { Dialog as DialogPrimitive } from 'radix-ui';
5
5
  *
6
6
  * Built on top of the [Radix Dialog
7
7
  * primitive](https://www.radix-ui.com/primitives/docs/components/dialog), and
8
- * the [`Card`
9
- * component](https://ui.ostack.tech/?path=/docs/ostack-ui-data-display-card--docs).
8
+ * the [`Card` component](?path=/docs/ostack-ui-data-display-card--docs).
10
9
  *
11
10
  * It composes the following subcomponents:
12
11
  *
@@ -13,7 +13,7 @@ export interface DialogContentProps extends ComponentPropsWithoutRef<typeof Dial
13
13
  /**
14
14
  * Dialog content variant.
15
15
  *
16
- * @default solid
16
+ * @default "solid"
17
17
  */
18
18
  variant?: DialogContentVariant;
19
19
  /**
@@ -27,13 +27,13 @@ export interface DialogContentProps extends ComponentPropsWithoutRef<typeof Dial
27
27
  /**
28
28
  * Dialog content color.
29
29
  *
30
- * @default neutral
30
+ * @default "neutral"
31
31
  */
32
32
  color?: DialogContentColor;
33
33
  /**
34
34
  * Size of the dialog content.
35
35
  *
36
- * @default md
36
+ * @default "md"
37
37
  */
38
38
  size?: DialogContentSize;
39
39
  /** Properties to pass to the portal component. */
@@ -9,7 +9,7 @@ export interface DropdownMenuProps extends Omit<ComponentPropsWithoutRef<typeof
9
9
  * Built on top of the [Radix Dropdown Menu
10
10
  * primitive](https://www.radix-ui.com/primitives/docs/components/dropdown-menu)
11
11
  * and the [`MenuList`
12
- * component](https://ui.ostack.tech/?path=/docs/ostack-ui-data-display-menu-list--docs).
12
+ * component](?path=/docs/ostack-ui-data-display-menu-list--docs).
13
13
  *
14
14
  * It composes the following subcomponents:
15
15
  *
@@ -9,22 +9,50 @@ export interface FieldGroupProps extends ComponentPropsWithoutRef<"div"> {
9
9
  asChild?: boolean;
10
10
  }
11
11
  /**
12
- * Component used to group a set of fields of a form, improving the organization
13
- * and usability of forms. By combining a header and body layout, it makes forms
14
- * more readable and accessible, especially for complex interfaces. The header
15
- * gives the group a clear title, while the body contains all related input
16
- * controls.
17
- *
18
- * This component is especially useful for creating forms where logical grouping
19
- * of fields is essential for user comprehension. It ensures consistency in
20
- * design and simplifies the process of building accessible and maintainable
21
- * forms.
12
+ * The field group component can be used to group multiple related form fields
13
+ * together.
22
14
  *
23
15
  * It composes the following subcomponents:
24
16
  *
25
- * - `FieldGroupHeader`: Acts as the headers for the group, typically containing
26
- * the `FieldGroupTitle` of the section.
27
- * - `FieldGroupTitle`: Displays the title within the header.
28
- * - `FieldGroupBody`: The container for all fields and controls within the group.
17
+ * - `FieldGroupHeader`: Header of the field group.
18
+ * - `FieldGroupTitle`: Title of the field group, used to label the group.
19
+ * - `FieldGroupBody`: The container for fields within the group.
20
+ *
21
+ * Example usage:
22
+ *
23
+ * ```tsx
24
+ * import {
25
+ * Field,
26
+ * FieldGroup,
27
+ * FieldGroupBody,
28
+ * FieldGroupHeader,
29
+ * FieldGroupTitle,
30
+ * Input,
31
+ * Label,
32
+ * Stack,
33
+ * } from "@ostack.tech/ui";
34
+ *
35
+ * export function PassengerIdentification() {
36
+ * return (
37
+ * <FieldGroup>
38
+ * <FieldGroupHeader>
39
+ * <FieldGroupTitle>Passenger identification</FieldGroupTitle>
40
+ * </FieldGroupHeader>
41
+ * <FieldGroupBody>
42
+ * <Stack gap={3}>
43
+ * <Field>
44
+ * <Label>Full name</Label>
45
+ * <Input />
46
+ * </Field>
47
+ * <Field>
48
+ * <Label>Passport number</Label>
49
+ * <Input />
50
+ * </Field>
51
+ * </Stack>
52
+ * </FieldGroupBody>
53
+ * </FieldGroup>
54
+ * );
55
+ * }
56
+ * ```
29
57
  */
30
58
  export declare const FieldGroup: import('react').ForwardRefExoticComponent<FieldGroupProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -5,7 +5,9 @@ export type GridColumnSize = number | "auto" | "content";
5
5
  /** Offset of a column. */
6
6
  export type GridOffsetSize = number | "auto";
7
7
  /** Properties of the grid component. */
8
- export interface GridProps extends ComponentPropsWithoutRef<"div"> {
8
+ export type GridProps = GridContainerProps | GridItemProps;
9
+ /** Base properties of the grid component. */
10
+ export interface GridPropsBase extends ComponentPropsWithoutRef<"div"> {
9
11
  /**
10
12
  * Change the component to the HTML tag or custom component of the only child.
11
13
  * This will merge the original component props with the props of the supplied
@@ -27,8 +29,8 @@ export interface GridProps extends ComponentPropsWithoutRef<"div"> {
27
29
  */
28
30
  columns?: Responsive<number>;
29
31
  /**
30
- * Gap between both rows and columns. When a number `n` is provided, each unit
31
- * corresponds to `spacing(n)`.
32
+ * Gap between both rows and columns. When a number is provided, each unit
33
+ * corresponds to `var(--o-ui-space)`.
32
34
  *
33
35
  * A responsive value may be provided to change the gap based on the current
34
36
  * breakpoint.
@@ -37,8 +39,8 @@ export interface GridProps extends ComponentPropsWithoutRef<"div"> {
37
39
  */
38
40
  gap?: Responsive<number | string>;
39
41
  /**
40
- * Gap between rows. When a number `n` is provided, each unit corresponds to
41
- * `spacing(n)`.
42
+ * Gap between rows. When a number is provided, each unit corresponds to
43
+ * `var(--o-ui-space)`.
42
44
  *
43
45
  * A responsive value may be provided to change the row gap based on the
44
46
  * current breakpoint.
@@ -47,8 +49,8 @@ export interface GridProps extends ComponentPropsWithoutRef<"div"> {
47
49
  */
48
50
  rowGap?: Responsive<number | string>;
49
51
  /**
50
- * Gap between columns. When a number `n` is provided, each unit corresponds
51
- * to `spacing(n)`.
52
+ * Gap between columns. When a number is provided, each unit corresponds to
53
+ * `var(--o-ui-space)`.
52
54
  *
53
55
  * A responsive value may be provided to change the column gap based on the
54
56
  * current breakpoint.
@@ -81,10 +83,61 @@ export interface GridProps extends ComponentPropsWithoutRef<"div"> {
81
83
  /** Offset size (number of columns) at the `xxl` breakpoint. */
82
84
  xxlOffset?: GridOffsetSize;
83
85
  }
86
+ /** Properties of the grid component when `container` is set. */
87
+ export interface GridContainerProps extends GridPropsBase {
88
+ container: true;
89
+ xs?: never;
90
+ xsOffset?: never;
91
+ sm?: never;
92
+ smOffset?: never;
93
+ md?: never;
94
+ mdOffset?: never;
95
+ lg?: never;
96
+ lgOffset?: never;
97
+ xl?: never;
98
+ xlOffset?: never;
99
+ xxl?: never;
100
+ xxlOffset?: never;
101
+ }
102
+ /** Properties of the grid component when `container` is not set. */
103
+ export interface GridItemProps extends GridPropsBase {
104
+ container?: false;
105
+ columns?: never;
106
+ gap?: never;
107
+ rowGap?: never;
108
+ columnGap?: never;
109
+ }
84
110
  /**
85
- * The `Grid` component is designed for creating layouts with a defined number
86
- * of columns. It allows you to configure columns responsively by specifying
87
- * different column spans for each child at various breakpoints, enabling
88
- * flexible and adaptive designs across screen sizes.
111
+ * The `Grid` component is designed for creating one or two-dimensional layouts
112
+ * within a defined number of columns.
113
+ *
114
+ * For one-dimensional vertical layouts or one-dimensional horizontal layouts
115
+ * without a fixed number of columns, you might prefer to use the [`Stack`
116
+ * component](?path=/docs/ostack-ui-layout-stack--docs) instead.
117
+ *
118
+ * Example usage:
119
+ *
120
+ * ```tsx
121
+ * import { Grid } from "@ostack.tech/ui";
122
+ *
123
+ * function Items() {
124
+ * return (
125
+ * <Grid container>
126
+ * <Grid xs={8}>
127
+ * <Item>Item 1</Item>
128
+ * </Grid>
129
+ * <Grid xs={4}>
130
+ * <Item>Item 2</Item>
131
+ * </Grid>
132
+ * <Grid xs={4}>
133
+ * <Item>Item 3</Item>
134
+ * </Grid>
135
+ * <Grid xs={8}>
136
+ * <Item>Item 4</Item>
137
+ * </Grid>
138
+ * </Grid>
139
+ * );
140
+ * }
141
+ * ```
89
142
  */
90
143
  export declare const Grid: import('react').ForwardRefExoticComponent<GridProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -36,7 +36,7 @@ export interface IconProps extends Omit<ComponentPropsWithoutRef<typeof FontAwes
36
36
  * more information on all supported properties, see [FontAwesome's React
37
37
  * documentation](https://docs.fontawesome.com/web/use-with/react/).
38
38
  *
39
- * For a list of existing icons, consult:
39
+ * For a list of existing free icons, consult:
40
40
  * https://fontawesome.com/search?ic=free.
41
41
  *
42
42
  * For tree-shaking purposes, we recommend importing icons individually from
@@ -28,19 +28,19 @@ export interface IconButtonOwnProps {
28
28
  /**
29
29
  * Icon button's variant.
30
30
  *
31
- * @default solid
31
+ * @default "solid"
32
32
  */
33
33
  variant?: IconButtonVariant;
34
34
  /**
35
35
  * Icon button's colour.
36
36
  *
37
- * @default neutral
37
+ * @default "neutral"
38
38
  */
39
39
  color?: IconButtonColor;
40
40
  /**
41
41
  * Size of the icon button.
42
42
  *
43
- * @default md
43
+ * @default "md"
44
44
  */
45
45
  size?: IconButtonSize;
46
46
  /** Whether to display the icon button as a circle. */
@@ -125,9 +125,9 @@ export interface IconButtonOwnProps {
125
125
  * at the end of the icon button's tooltip for visual users and announced to
126
126
  * screen readers via `aria-keyshortcuts`.
127
127
  *
128
- * **Note:** This property does **not** automatically register a keyboard
129
- * shortcut to run the icon button's action. This should be done manually via
130
- * _e.g._ the `useKeyboardShortcut` hook.
128
+ * > **Note:** This property does **not** automatically register a keyboard
129
+ * > shortcut to run the icon button's action. This should be done manually via
130
+ * > _e.g._ the `useKeyboardShortcut` hook.
131
131
  */
132
132
  keybinds?: KeyboardShortcutKeybinds;
133
133
  /** Properties to pass to the `Icon` component. */
@@ -151,10 +151,8 @@ export interface IconButtonOwnProps {
151
151
  *
152
152
  * Built on top of the browser's [`<button>`
153
153
  * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button),
154
- * [`Icon`
155
- * component](https://ui.ostack.tech/?path=/docs/ostack-ui-data-display-icon--docs),
156
- * and [`Tooltip`
157
- * component](https://ui.ostack.tech/?path=/docs/ostack-ui-overlay-tooltip--docs).
154
+ * [`Icon` component](?path=/docs/ostack-ui-data-display-icon--docs), and
155
+ * [`Tooltip` component](?path=/docs/ostack-ui-overlay-tooltip--docs).
158
156
  *
159
157
  * Example usage:
160
158
  *
@@ -70,9 +70,8 @@ export interface InputPropsBase {
70
70
  /** Input's end adornment. */
71
71
  endAdornment?: ReactNode;
72
72
  /**
73
- * Whether to show a button to clear the input when it has content.
74
- *
75
- * @default false
73
+ * Whether to show a button to clear the input when it has content. Defaults
74
+ * `"auto"` when `type="search"`, `false` otherwise.
76
75
  */
77
76
  showClearButton?: ShowClearButton;
78
77
  /** Label of the clear button announced to assistive technologies. */
@@ -21,14 +21,12 @@ export interface LinkOwnProps {
21
21
  /**
22
22
  * Colour of the link.
23
23
  *
24
- * @default primary
24
+ * @default "primary"
25
25
  */
26
26
  color?: LinkColor;
27
27
  /**
28
28
  * Link variant. Defaults to `"default"`, unless when rendered within an
29
29
  * `Alert`, in which case the `"alert"` variant is used.
30
- *
31
- * @default default
32
30
  */
33
31
  variant?: LinkVariant;
34
32
  /**
@@ -13,7 +13,7 @@ export interface MarkProps extends ComponentPropsWithoutRef<"mark"> {
13
13
  /**
14
14
  * Colour to use for marking the text.
15
15
  *
16
- * @default warning
16
+ * @default "warning"
17
17
  */
18
18
  color?: MarkColor;
19
19
  }
@@ -29,6 +29,11 @@ export interface MenuListProps extends ComponentPropsWithoutRef<"ul"> {
29
29
  * The menu list component is used to display a list as a menu of actionable
30
30
  * items.
31
31
  *
32
+ * It composes the following subcomponents:
33
+ *
34
+ * - `MenuListGroup`: Group of items in the menu list.
35
+ * - `MenuListItem`: Single item in the menu list.
36
+ *
32
37
  * Example usage:
33
38
  *
34
39
  * ```tsx
@@ -94,9 +94,9 @@ export interface MenuListItemProps extends Omit<ComponentPropsWithoutRef<"li">,
94
94
  * the item for visual users and announced to screen readers via
95
95
  * `aria-keyshortcuts`.
96
96
  *
97
- * **Note:** This property does **not** automatically register a keyboard
98
- * shortcut to run the item's action. This should be done manually via _e.g._
99
- * the `useKeyboardShortcut` hook.
97
+ * > **Note:** This property does **not** automatically register a keyboard
98
+ * > shortcut to run the item's action. This should be done manually via _e.g._
99
+ * > the `useKeyboardShortcut` hook.
100
100
  */
101
101
  keybinds?: KeyboardShortcutKeybinds;
102
102
  /** Href for the link, when `type` is set to `"link"`. */
@@ -75,8 +75,8 @@ export interface NumericValueRepresentations {
75
75
  /**
76
76
  * The numeric input component is used to collect numeric user input. It is
77
77
  * built on top of the [`Input`
78
- * component](https://ui.ostack.tech/?path=/docs/ostack-ui-forms-input--docs)
79
- * and the [`react-number-format`
78
+ * component](?path=/docs/ostack-ui-forms-input--docs) and the
79
+ * [`react-number-format`
80
80
  * library](https://s-yadav.github.io/react-number-format/).
81
81
  *
82
82
  * It supports specifying the precision, scale, separators, grouping of digits,
@@ -1,27 +1,40 @@
1
1
  import { Popover as PopoverPrimitive } from 'radix-ui';
2
2
  /**
3
- * Root popover component that provides an interactive and versatile overlay to
4
- * display additional content or actions in a contextual manner. It is ideal for
5
- * creating dynamic overlays that enhance user interactions by presenting
6
- * supplementary information or controls directly related to a trigger element.
3
+ * The popover component displays content in a floating pop-up, triggered by a
4
+ * button. Built on top of the [Radix Popover
5
+ * primitive](https://www.radix-ui.com/primitives/docs/components/popover)
7
6
  *
8
7
  * It composes the following subcomponents:
9
8
  *
10
- * - `PopoverAnchor`: A utility to anchor the popover to a specific element. It
11
- * ensures the popover aligns accurately with the anchor, allowing for dynamic
12
- * placement and responsiveness.
13
- * - `PopoverClose`: An interactive element that closes the popover when clicked.
14
- * It is used to provide a seamless and accessible way for users to dismiss
15
- * the popover.
16
- * - `PopoverContent`: The container for the content displayed within the popover.
17
- * It supports customization of appearance and behavior, including position
18
- * `side` and whether an arrow is shown `showArrow`.
19
- * - `PopoverTrigger`: An interactive element, such as a button, that toggles the
20
- * visibility of the popover. It acts as the primary control for opening and
21
- * closing the popover.
9
+ * - `PopoverTrigger`: Button that toggles the popover. By default, popover
10
+ * content positions itself against this component.
11
+ * - `PopoverContent`: Content that pops out when the popover is open.
12
+ * - `PopoverAnchor`: Optional element to position the popover content against
13
+ * instead of the trigger.
14
+ * - `PopoverClose`: Optional button that closes an open popover.
22
15
  *
23
- * For detailed information on these props, which do not have descriptions,
24
- * please refer to the
25
- * [docs](https://www.radix-ui.com/primitives/docs/components/popover).
16
+ * Example usage:
17
+ *
18
+ * ```tsx
19
+ * import {
20
+ * Button,
21
+ * Popover,
22
+ * PopoverContent,
23
+ * PopoverTrigger,
24
+ * } from "@ostack.tech/ui";
25
+ *
26
+ * export function AccountInformation() {
27
+ * return (
28
+ * <Popover>
29
+ * <PopoverTrigger>
30
+ * <Button>Account information</Button>
31
+ * </PopoverTrigger>
32
+ * <PopoverContent>
33
+ * <strong>Account name:</strong> Alana Richards
34
+ * </PopoverContent>
35
+ * </Popover>
36
+ * );
37
+ * }
38
+ * ```
26
39
  */
27
40
  export declare const Popover: import('react').FC<PopoverPrimitive.PopoverProps>;
@@ -1,7 +1,14 @@
1
- import { Popover as PopoverPrimitive } from 'radix-ui';
2
- import { ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { CloseButton } from '../CloseButton';
3
3
  /** Properties of the popover close component. */
4
- export interface PopoverCloseProps extends Omit<ComponentPropsWithoutRef<typeof PopoverPrimitive.Close>, "asChild"> {
4
+ export type PopoverCloseProps = PopoverCloseChildlessProps | PopoverCloseChildrenProps;
5
+ /** Properties of the popover close component when rendered without children. */
6
+ export interface PopoverCloseChildlessProps extends Omit<ComponentPropsWithoutRef<typeof CloseButton>, "asChild"> {
7
+ children?: never;
8
+ }
9
+ /** Properties of the popover close component when rendered with children. */
10
+ export interface PopoverCloseChildrenProps extends ComponentPropsWithoutRef<"button"> {
11
+ children: ReactNode;
5
12
  }
6
13
  /** The button that closes an open popover. */
7
14
  export declare const PopoverClose: import('react').ForwardRefExoticComponent<PopoverCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -24,7 +24,7 @@ export interface PrintOptions {
24
24
  * [`print-color-adjust`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/print-color-adjust)
25
25
  * CSS property.
26
26
  *
27
- * @default exact
27
+ * @default "exact"
28
28
  */
29
29
  printColorAdjust?: CSSProperties["printColorAdjust"];
30
30
  /**
@@ -114,9 +114,9 @@ export interface PrinterProps extends PrintOptions {
114
114
  * Built on top of the
115
115
  * [`react-to-print`](https://github.com/MatthewHerbst/react-to-print) package.
116
116
  *
117
- * **Note**: While printing, the content to print is typically (unless
118
- * `printInForeground` is provided) rendered twice: once for the content visible
119
- * on the screen and another in a hidden and “portalled” element for printing.
117
+ * > **Note:** While printing, the content to print is typically (unless
118
+ * > `printInForeground` is provided) rendered twice: once for the content visible
119
+ * > on the screen and another in a hidden and “portalled” element for printing.
120
120
  *
121
121
  * It composes the following subcomponents:
122
122
  *
@@ -9,13 +9,13 @@ export declare const PrinterContentContext: import('react').Context<PrinterConte
9
9
  /**
10
10
  * Hook providing access to the printer content context.
11
11
  *
12
- * **Note**: This hook **can** be called outside the printer context.
12
+ * > **Note:** This hook **can** be called outside the printer context.
13
13
  */
14
14
  export declare function usePrinterContentContext(): PrinterContextValue;
15
15
  /**
16
16
  * Returns whether the component calling this hook is currently being printed.
17
17
  *
18
- * **Note**: This hook **can** be called outside the printer context.
18
+ * > **Note:** This hook **can** be called outside the printer context.
19
19
  */
20
20
  export declare function usePrinting(): boolean;
21
21
  /** Options for the `useStartPrintingTask` hook. */
@@ -32,7 +32,7 @@ export interface UseStartPrintingTaskOptions {
32
32
  * called when it finishes. The printer will wait for any ongoing printing tasks
33
33
  * before printing.
34
34
  *
35
- * **Note**: This hook **can** be called outside the printer context, in which
36
- * case starting/finishing printing tasks will be no-ops but **won't** fail.
35
+ * > **Note:** This hook **can** be called outside the printer context, in which
36
+ * > case starting/finishing printing tasks will be no-ops but **won't** fail.
37
37
  */
38
38
  export declare function useStartPrintingTask({ enabled, }?: UseStartPrintingTaskOptions): () => void;
@@ -21,8 +21,8 @@ export declare function usePrinterDocumentTitle(): PrinterProps["documentTitle"]
21
21
  /**
22
22
  * Returns whether printing is currently in progress.
23
23
  *
24
- * **Note**: This hook can be called even when a printer context is **not** in
25
- * scope, in which case `false` will be returned.
24
+ * > **Note:** This hook can be called even when a printer context is **not** in
25
+ * > scope, in which case `false` will be returned.
26
26
  */
27
27
  export declare function usePrintInProgress(): boolean;
28
28
  /**
@@ -55,21 +55,21 @@ export interface RootProps extends ComponentPropsWithoutRef<"div">, Pick<Compone
55
55
  * The duration from when the pointer enters the trigger until the tooltip
56
56
  * gets opened.
57
57
  *
58
- * @defaultValue 700
58
+ * @default 700
59
59
  */
60
60
  tooltipsDelayDuration?: number;
61
61
  /**
62
62
  * How much time a user has to enter another trigger without incurring a delay
63
63
  * again.
64
64
  *
65
- * @defaultValue 300
65
+ * @default 300
66
66
  */
67
67
  tooltipsSkipDelayDuration?: number;
68
68
  /**
69
69
  * When set, trying to hover the content will result in the tooltip closing as
70
70
  * the pointer leaves the trigger.
71
71
  *
72
- * @defaultValue false
72
+ * @default false
73
73
  */
74
74
  disableTooltipsHoverableContent?: boolean;
75
75
  /**
@@ -81,26 +81,26 @@ export interface RootProps extends ComponentPropsWithoutRef<"div">, Pick<Compone
81
81
  /**
82
82
  * Time in milliseconds that each toast should remain visible for.
83
83
  *
84
- * @defaultValue 5000
84
+ * @default 5000
85
85
  */
86
86
  toastsDuration?: number;
87
87
  /**
88
88
  * Direction of pointer swipe that should close the toast.
89
89
  *
90
- * @defaultValue "right"
90
+ * @default "right"
91
91
  */
92
92
  toastsSwipeDirection?: ToastSwipeDirection;
93
93
  /**
94
94
  * Distance in pixels that the swipe must pass before a close is triggered.
95
95
  *
96
- * @defaultValue 50
96
+ * @default 50
97
97
  */
98
98
  toastsSwipeThreshold?: number;
99
99
  /**
100
100
  * The keys to use as the keyboard shortcut that will move focus to the toast
101
101
  * viewport.
102
102
  *
103
- * @defaultValue ["F8"]
103
+ * @default ["F8"]
104
104
  */
105
105
  toastViewportHotkey?: string[];
106
106
  /**
@@ -38,6 +38,12 @@ export interface SelectPropsBase<T extends string | number | readonly string[] =
38
38
  onOpenChange?: (open: boolean) => void;
39
39
  /** Select's placeholder. */
40
40
  placeholder?: ReactNode;
41
+ /**
42
+ * Select
43
+ * [`autocomplete`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete)
44
+ * attribute.
45
+ */
46
+ autoComplete?: ComponentPropsWithoutRef<"select">["autoComplete"];
41
47
  /** Accessible label for the search input. Not shown visibly. */
42
48
  searchLabel?: string;
43
49
  /** Accessible label for the list of options. Not shown visibly. */
@@ -17,13 +17,14 @@ export interface SelectContextValue {
17
17
  }
18
18
  /** State of an option. */
19
19
  export interface OptionState {
20
+ value: string;
20
21
  content: ReactNode;
21
22
  color?: AccentColor;
22
23
  disabled?: boolean;
23
24
  }
24
25
  /** State of the select. */
25
26
  export interface SelectState {
26
- optionsContent: [Map<string, OptionState>];
27
+ options: [Map<string, OptionState>];
27
28
  actions: SelectActions;
28
29
  }
29
30
  export interface SelectActions {
@@ -0,0 +1,7 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ /** Properties of the native `<select>` element. */
3
+ export interface SelectNativeProps extends ComponentPropsWithoutRef<"select"> {
4
+ onValueChange: (value: string | string[]) => void;
5
+ }
6
+ /** Native `<select>` element used by the `Select` component. */
7
+ export declare function SelectNative({ multiple, onValueChange, ...otherProps }: SelectNativeProps): import("react/jsx-runtime").JSX.Element;