@ostack.tech/ui 0.10.5 → 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
@@ -13,13 +13,13 @@ export interface AlertProps extends ComponentPropsWithoutRef<"div"> {
13
13
  /**
14
14
  * Alert variant.
15
15
  *
16
- * @default subtle
16
+ * @default "subtle"
17
17
  */
18
18
  variant?: AlertVariant;
19
19
  /**
20
20
  * Sets the alert's severity.
21
21
  *
22
- * @default info
22
+ * @default "info"
23
23
  */
24
24
  severity?: AlertSeverity;
25
25
  /**
@@ -34,7 +34,7 @@ export interface AlertProps extends ComponentPropsWithoutRef<"div"> {
34
34
  * current speech to announce this immediately (recommended for critical
35
35
  * errors that appear and should stop the user's flow).
36
36
  *
37
- * @default off
37
+ * @default "off"
38
38
  */
39
39
  announce?: AlertAnnounce;
40
40
  /** Alert action. */
@@ -5,8 +5,7 @@ import { AlertDialog as AlertDialogPrimitive } from 'radix-ui';
5
5
  *
6
6
  * Built on top of the [Radix Alert Dialog
7
7
  * primitive](https://www.radix-ui.com/primitives/docs/components/alert-dialog),
8
- * and the [`Card`
9
- * component](https://ui.ostack.tech/?path=/docs/ostack-ui-data-display-card--docs).
8
+ * and the [`Card` component](?path=/docs/ostack-ui-data-display-card--docs).
10
9
  *
11
10
  * It composes the following subcomponents:
12
11
  *
@@ -78,5 +77,10 @@ import { AlertDialog as AlertDialogPrimitive } from 'radix-ui';
78
77
  * );
79
78
  * }
80
79
  * ```
80
+ *
81
+ * > **Note:** In many scenarios you might prefer to use the [`useAlertDialog`
82
+ * > hook](?path=/docs/ostack-ui-overlay-alert-dialog--docs#usealertdialog-hook)
83
+ * > instead, which provides an imperative API for triggering “alert”, “confirm”,
84
+ * > or “prompt” dialogs.
81
85
  */
82
86
  export declare const AlertDialog: import('react').FC<AlertDialogPrimitive.AlertDialogProps>;
@@ -29,19 +29,19 @@ export interface ButtonOwnProps {
29
29
  /**
30
30
  * Button's variant.
31
31
  *
32
- * @default solid
32
+ * @default "solid"
33
33
  */
34
34
  variant?: ButtonVariant;
35
35
  /**
36
36
  * Button's colour.
37
37
  *
38
- * @default neutral
38
+ * @default "neutral"
39
39
  */
40
40
  color?: ButtonColor;
41
41
  /**
42
42
  * Size of the button.
43
43
  *
44
- * @default md
44
+ * @default "md"
45
45
  */
46
46
  size?: ButtonSize;
47
47
  /**
@@ -62,7 +62,7 @@ export interface ButtonOwnProps {
62
62
  * Whether to display the icon at the start or end of the button. This
63
63
  * property also affects the placement of the spinner.
64
64
  *
65
- * @default start
65
+ * @default "start"
66
66
  */
67
67
  iconPlacement?: ButtonIconPlacement;
68
68
  /**
@@ -130,9 +130,9 @@ export interface ButtonOwnProps {
130
130
  * the end of the button's tooltip for visual users and announced to screen
131
131
  * readers via `aria-keyshortcuts`.
132
132
  *
133
- * **Note:** This property does **not** automatically register a keyboard
134
- * shortcut to run the button's action. This should be done manually via
135
- * _e.g._ the `useKeyboardShortcut` hook.
133
+ * > **Note:** This property does **not** automatically register a keyboard
134
+ * > shortcut to run the button's action. This should be done manually via
135
+ * > _e.g._ the `useKeyboardShortcut` hook.
136
136
  */
137
137
  keybinds?: KeyboardShortcutKeybinds;
138
138
  /** Properties to pass to the icon component. */
@@ -2,8 +2,38 @@ import { ComponentPropsWithRef } from 'react';
2
2
  import { DayPickerProps } from 'react-day-picker';
3
3
  import { IconButton } from '../IconButton';
4
4
  import { Select } from '../Select';
5
+ /** Mode for selecting calendar dates. */
6
+ export type CalendarSelectionMode = "none" | "single" | "multiple" | "range" | "range-start" | "range-end";
7
+ /** Accepted range of dates from a start date to an end date. */
8
+ export interface AcceptedDateRange {
9
+ /** Start of the date-range. */
10
+ start?: string | Date | null;
11
+ /** End of the date-range. */
12
+ end?: string | Date | null;
13
+ }
14
+ /** A range of dates from a start date to an end date. */
15
+ export interface DateRange {
16
+ /** Start of the date-range. */
17
+ start: Date | null;
18
+ /** End of the date-range. */
19
+ end: Date | null;
20
+ }
5
21
  /** Properties of the calendar component. */
6
- export interface CalendarProps extends Omit<DayPickerProps, "mode" | "selected" | "onSelect" | "classNames" | "modifiersClassNames" | "styles" | "modifiersStyles" | "fromDate" | "toDate" | "fromMonth" | "toMonth" | "fromYear" | "toYear" | "startMonth" | "endMonth" | "reverseMonths" | "captionLayout" | "navLayout" | "components" | "locale" | "labels" | "formatters" | "dir" | "dateLib"> {
22
+ export type CalendarProps = CalendarNoneSelectionProps | CalendarSingleSelectionProps | CalendarMultipleSelectionProps | CalendarRangeSelectionProps;
23
+ /** Base properties of the calendar component. */
24
+ export interface CalendarPropsBase<TValue extends Date | Date[] | DateRange | null = Date | Date[] | DateRange | null> extends Pick<DayPickerProps, "required" | "className" | "style" | "id" | "defaultMonth" | "month" | "numberOfMonths" | "pagedNavigation" | "disableNavigation" | "fixedWeeks" | "hideWeekdays" | "showOutsideDays" | "showWeekNumber" | "broadcastCalendar" | "ISOWeek" | "timeZone" | "noonSafe" | "footer" | "autoFocus" | "disabled" | "hidden" | "today" | "modifiers" | "aria-label" | "aria-labelledby" | "numerals" | "weekStartsOn" | "firstWeekContainsDate" | "useAdditionalWeekYearTokens" | "useAdditionalDayOfYearTokens" | "onMonthChange" | "onNextClick" | "onPrevClick" | "onDayClick" | "onDayFocus" | "onDayBlur" | "onDayKeyDown" | "onDayMouseEnter" | "onDayMouseLeave"> {
25
+ /**
26
+ * Mode for selecting calendar dates.
27
+ *
28
+ * @default none
29
+ */
30
+ selectionMode?: CalendarSelectionMode;
31
+ /** Value selected by default. */
32
+ defaultValue?: string | Date | (string | Date)[] | AcceptedDateRange | null;
33
+ /** Controlled selected value. */
34
+ value?: string | Date | (string | Date)[] | AcceptedDateRange | null;
35
+ /** Function called when the selected value changes. */
36
+ onValueChange?: (value: TValue) => void;
7
37
  /** Minimum date allowed. */
8
38
  minDate?: string | Date | null;
9
39
  /** Maximum date allowed. */
@@ -37,8 +67,34 @@ export interface CalendarProps extends Omit<DayPickerProps, "mode" | "selected"
37
67
  /** Properties to pass to the year select component. */
38
68
  yearSelectProps?: Omit<ComponentPropsWithRef<typeof Select>, "multiple" | "defaultValue" | "value">;
39
69
  }
70
+ /** Properties of the calendar component in none selection mode. */
71
+ export interface CalendarNoneSelectionProps extends CalendarPropsBase<never> {
72
+ selectionMode?: "none";
73
+ }
74
+ /** Properties of the calendar component in single selection mode. */
75
+ export interface CalendarSingleSelectionProps extends CalendarPropsBase<Date | null> {
76
+ selectionMode: "single";
77
+ }
78
+ /** Properties of the calendar component in multiple selection mode. */
79
+ export interface CalendarMultipleSelectionProps extends CalendarPropsBase<Date[]> {
80
+ selectionMode: "multiple";
81
+ }
82
+ /** Properties of the calendar component in range selection mode. */
83
+ export interface CalendarRangeSelectionProps extends CalendarPropsBase<DateRange> {
84
+ selectionMode: "range" | "range-start" | "range-end";
85
+ }
40
86
  /**
41
- * Calendar component built on top of [React
42
- * DayPicker](https://react-day-picker.js.org).
87
+ * Interactive calendar built on top of the [React
88
+ * DayPicker](https://react-day-picker.js.org/) library.
89
+ *
90
+ * Example usage:
91
+ *
92
+ * ```tsx
93
+ * import { Calendar } from "@ostack.tech/ui";
94
+ *
95
+ * function CurrentMonth() {
96
+ * return <Calendar />;
97
+ * }
98
+ * ```
43
99
  */
44
- export declare function Calendar({ required, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, monthSelectLabel, yearSelectLabel, previousMonthLabel, nextMonthLabel, defaultMonth, month: controlledMonth, onMonthChange, onDayClick, numberOfMonths, showOutsideDays, fixedWeeks, disableNavigation, disabled, modifiers, headerProps, headerLabelProps, previousButtonProps, nextButtonProps, monthSelectProps, yearSelectProps, pagedNavigation, ...otherProps }: CalendarProps): import("react/jsx-runtime").JSX.Element;
100
+ export declare function Calendar({ selectionMode, defaultValue, value: controlledValue, onValueChange, required, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, monthSelectLabel, yearSelectLabel, previousMonthLabel, nextMonthLabel, defaultMonth, month: controlledMonth, onMonthChange, onDayClick, onDayFocus, onDayMouseEnter, numberOfMonths, fixedWeeks, showOutsideDays, disableNavigation, disabled, modifiers, headerProps, headerLabelProps, previousButtonProps, nextButtonProps, monthSelectProps, yearSelectProps, pagedNavigation, ...otherProps }: CalendarProps): import("react/jsx-runtime").JSX.Element;
@@ -15,7 +15,7 @@ export interface CardProps extends ComponentPropsWithoutRef<"div"> {
15
15
  /**
16
16
  * Card variant.
17
17
  *
18
- * @default solid
18
+ * @default "solid"
19
19
  */
20
20
  variant?: CardVariant;
21
21
  /**
@@ -29,7 +29,7 @@ export interface CardProps extends ComponentPropsWithoutRef<"div"> {
29
29
  /**
30
30
  * Card color.
31
31
  *
32
- * @default neutral
32
+ * @default "neutral"
33
33
  */
34
34
  color?: CardColor;
35
35
  }
@@ -13,7 +13,7 @@ export interface CodeProps extends ComponentPropsWithoutRef<"code"> {
13
13
  /**
14
14
  * Code colour.
15
15
  *
16
- * @default neutral
16
+ * @default "neutral"
17
17
  */
18
18
  color?: CodeColor;
19
19
  }
@@ -1,15 +1,15 @@
1
1
  import { Collapsible as CollapsiblePrimitive } from 'radix-ui';
2
2
  import { ComponentPropsWithoutRef } from 'react';
3
- /** Direction in which to collapse/expand content. */
4
- export type CollapsibleDirection = "horizontal" | "vertical";
3
+ /** Orientation in which to collapse/expand content. */
4
+ export type CollapsibleOrientation = "horizontal" | "vertical";
5
5
  /** Properties of the collapsible component. */
6
6
  export interface CollapsibleProps extends ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root> {
7
7
  /**
8
- * Direction in which to collapse/expand content.
8
+ * Orientation in which to collapse/expand content.
9
9
  *
10
10
  * @default vertical
11
11
  */
12
- direction?: CollapsibleDirection;
12
+ orientation?: CollapsibleOrientation;
13
13
  }
14
14
  /**
15
15
  * The collapsible component is an interactive component that expands/collapses
@@ -17,9 +17,27 @@ export interface CollapsibleProps extends ComponentPropsWithoutRef<typeof Collap
17
17
  *
18
18
  * It composes the following subcomponents:
19
19
  *
20
- * - `CollapsibleTrigger`: A trigger, such as an icon, that visually indicates and
21
- * controls the expanded/collapsed states.
22
- * - `CollapsibleContent`: The content that are shown or hidden based on trigger's
23
- * state.
20
+ * - `CollapsibleTrigger`: Trigger that toggles the collapsible content between
21
+ * expanded/collapsed.
22
+ * - `CollapsibleContent`: Component containing the collapsible content.
23
+ *
24
+ * Example usage:
25
+ *
26
+ * ```tsx
27
+ * import {
28
+ * Collapsible,
29
+ * CollapsibleContent,
30
+ * CollapsibleTrigger,
31
+ * } from "@ostack.tech/ui";
32
+ *
33
+ * function ShowMore() {
34
+ * return (
35
+ * <Collapsible>
36
+ * <CollapsibleTrigger />
37
+ * <CollapsibleContent>…</CollapsibleContent>
38
+ * </Collapsible>
39
+ * );
40
+ * }
41
+ * ```
24
42
  */
25
43
  export declare const Collapsible: import('react').ForwardRefExoticComponent<CollapsibleProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,8 +1,8 @@
1
- import { CollapsibleDirection } from './Collapsible.tsx';
1
+ import { CollapsibleOrientation } from './Collapsible.tsx';
2
2
  /** Value of the collapsible context. */
3
3
  export interface CollapsibleContextValue {
4
4
  open: boolean;
5
- direction: CollapsibleDirection;
5
+ orientation: CollapsibleOrientation;
6
6
  }
7
7
  /** Collapsible context. */
8
8
  export declare const CollapsibleContext: import('react').Context<CollapsibleContextValue | null>;
@@ -1,10 +1,26 @@
1
- import { Collapsible as CollapsiblePrimitive } from 'radix-ui';
2
- import { ComponentPropsWithoutRef, ReactNode } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react';
2
+ import { IconProp } from '../Icon/Icon.tsx';
3
+ import { IconButton } from '../IconButton';
3
4
  /** Properties of the collapsible trigger component. */
4
- export interface CollapsibleTriggerProps extends Omit<ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>, "asChild" | "children"> {
5
- defaultTriggerCollapseLabel?: string;
6
- defaultTriggerExpandLabel?: string;
7
- children?: ReactNode | ((open: boolean) => ReactNode);
5
+ export type CollapsibleTriggerProps = CollapsibleTriggerChildlessProps | CollapsibleTriggerChildrenProps;
6
+ /**
7
+ * Properties of the collapsible trigger component when rendered without
8
+ * children.
9
+ */
10
+ export interface CollapsibleTriggerChildlessProps extends Omit<Partial<ComponentPropsWithoutRef<typeof IconButton>>, "asChild" | "children"> {
11
+ /** Icon used for the trigger icon button when the collapsible is collapsed. */
12
+ expandIcon?: IconProp | ReactElement;
13
+ /** Icon used for the trigger icon button when the collapsible is expanded. */
14
+ collapseIcon?: IconProp | ReactElement;
15
+ /** Label used for the trigger icon button when the collapsible is collapsed. */
16
+ expandLabel?: ReactNode;
17
+ /** Label used for the trigger icon button when the collapsible is expanded. */
18
+ collapseLabel?: ReactNode;
19
+ children?: never;
20
+ }
21
+ /** Properties of the collapsible trigger component when rendered with children. */
22
+ export interface CollapsibleTriggerChildrenProps extends Omit<ComponentPropsWithoutRef<"button">, "children"> {
23
+ children: ReactNode | ((open: boolean) => ReactNode);
8
24
  }
9
25
  /** Trigger that toggles the expansion of the collapsible content. */
10
26
  export declare const CollapsibleTrigger: import('react').ForwardRefExoticComponent<CollapsibleTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -65,7 +65,7 @@ export interface CommandMenuProps extends ComponentPropsWithoutRef<typeof Comman
65
65
  *
66
66
  * Built on top of the [cmdk Command primitive](https://github.com/dip/cmdk/)
67
67
  * and the [`MenuList`
68
- * component](https://ui.ostack.tech/?path=/docs/ostack-ui-data-display-menu-list--docs).
68
+ * component](?path=/docs/ostack-ui-data-display-menu-list--docs).
69
69
  *
70
70
  * It composes the following subcomponents:
71
71
  *
@@ -1,8 +1,8 @@
1
1
  import { ComponentPropsWithoutRef } from 'react';
2
2
  import { Breakpoint } from '../../utils/breakpoints.ts';
3
3
  import { Responsive } from '../../utils/useResponsiveValues.ts';
4
- /** Value specifying up to which breakpoint the container should be fluid. */
5
- export type ContainerFluidUntil = Omit<Breakpoint, "xs">;
4
+ /** Breakpoints accepted by the container. */
5
+ export type ContainerSize = Exclude<Breakpoint, "xs">;
6
6
  /** Properties of the container component. */
7
7
  export interface ContainerProps extends ComponentPropsWithoutRef<"div"> {
8
8
  /**
@@ -17,10 +17,17 @@ export interface ContainerProps extends ComponentPropsWithoutRef<"div"> {
17
17
  *
18
18
  * @default "sm"
19
19
  */
20
- fluid?: ContainerFluidUntil | true;
20
+ fluid?: ContainerSize | true;
21
21
  /**
22
- * Size of the left and right margins of the container. When a number `n` is
23
- * provided, each unit corresponds to `spacing(n)`.
22
+ * Control how wide the container is allowed to grow.
23
+ *
24
+ * By default, no maximum width is set. Unless `fluid` is set to `true`, the
25
+ * container is effectively capped by the largest breakpoint (`"xxl"`).
26
+ */
27
+ maxWidth?: ContainerSize | number | (string & {});
28
+ /**
29
+ * Size of the left and right margins of the container. When a number is
30
+ * provided, each unit corresponds to `var(--o-ui-space)`.
24
31
  *
25
32
  * A responsive value may be provided to change the gutter size based on the
26
33
  * current breakpoint.
@@ -29,8 +36,8 @@ export interface ContainerProps extends ComponentPropsWithoutRef<"div"> {
29
36
  */
30
37
  gutter?: Responsive<number | string>;
31
38
  /**
32
- * Size of the left margin of the container. When a number `n` is provided,
33
- * each unit corresponds to `spacing(n)`.
39
+ * Size of the left margin of the container. When a number is provided, each
40
+ * unit corresponds to `var(--o-ui-space)`.
34
41
  *
35
42
  * A responsive value may be provided to change the gutter size based on the
36
43
  * current breakpoint.
@@ -39,8 +46,8 @@ export interface ContainerProps extends ComponentPropsWithoutRef<"div"> {
39
46
  */
40
47
  leftGutter?: Responsive<number | string>;
41
48
  /**
42
- * Size of the right margin of the container. When a number `n` is provided,
43
- * each unit corresponds to `spacing(n)`.
49
+ * Size of the right margin of the container.When a number is provided, each
50
+ * unit corresponds to `var(--o-ui-space)`.
44
51
  *
45
52
  * A responsive value may be provided to change the gutter size based on the
46
53
  * current breakpoint.
@@ -59,7 +66,11 @@ export interface ContainerProps extends ComponentPropsWithoutRef<"div"> {
59
66
  * import { Container } from "@ostack.tech/ui";
60
67
  *
61
68
  * function App() {
62
- * return <Container>…</Container>;
69
+ * return (
70
+ * <Container>
71
+ * <Item>…</Item>
72
+ * </Container>
73
+ * );
63
74
  * }
64
75
  * ```
65
76
  */
@@ -46,7 +46,7 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
46
46
  * Display mode of the data table. Rows are displayed either in pages or
47
47
  * within an infinite scroll component.
48
48
  *
49
- * @default paged
49
+ * @default "paged"
50
50
  */
51
51
  displayMode?: DataTableDisplayMode;
52
52
  /** Data table columns. */
@@ -87,14 +87,14 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
87
87
  *
88
88
  * @default 0
89
89
  */
90
- defaultOffset?: number;
90
+ defaultOffset?: number | string;
91
91
  /**
92
92
  * Controlled offset from which to display rows. When in paged mode, the
93
93
  * actually used offset will always be a multiple of `limit`.
94
94
  *
95
95
  * Use together with `onOffsetChange` to control the offset.
96
96
  */
97
- offset?: number;
97
+ offset?: number | string;
98
98
  /**
99
99
  * Function called whenever the offset changes.
100
100
  *
@@ -106,13 +106,13 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
106
106
  *
107
107
  * @default 10
108
108
  */
109
- defaultLimit?: number;
109
+ defaultLimit?: number | string;
110
110
  /**
111
111
  * Controlled value used to limit the number of rows shown on screen.
112
112
  *
113
113
  * Use together with `onLimitChange` to control the limit.
114
114
  */
115
- limit?: number;
115
+ limit?: number | string;
116
116
  /**
117
117
  * Function called whenever the limit changes.
118
118
  *
@@ -147,13 +147,13 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
147
147
  */
148
148
  sortBy?: string | null;
149
149
  /** Default sort direction. */
150
- defaultSortDirection?: SortDirection;
150
+ defaultSortDirection?: SortDirection | (string & {});
151
151
  /**
152
152
  * Controlled sort direction.
153
153
  *
154
154
  * Use together with `onSort` to change the sort direction.
155
155
  */
156
- sortDirection?: SortDirection;
156
+ sortDirection?: SortDirection | (string & {});
157
157
  /**
158
158
  * Function called whenever the sorting of data changes.
159
159
  *
@@ -242,30 +242,64 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
242
242
  apiRef?: Ref<DataTableApi<T> | undefined>;
243
243
  }
244
244
  /**
245
- * The `DataTable` component is the root component used for displaying a data
246
- * table. It supports features such as different display modes (paged or
247
- * scrolled), pagination, dynamic data loading, custom rows and cells, sorting,
248
- * and filtering, allowing flexible data table functionality via configuration.
245
+ * The data table component allows displaying, browsing, sorting, and filtering
246
+ * large amounts of structured data. Built on top of the [`Table`
247
+ * component](?path=/docs/ostack-ui-data-display-table--docs).
249
248
  *
250
249
  * It composes the following subcomponents:
251
250
  *
252
- * - `DataTableContent`: Represents the core content area of the `DataTable`,
253
- * containing the table itself, including its head and body. It is responsible
254
- * for rendering the main parts of the `DataTable`.
255
- * - `DataTableFilter`: Implements filtering functionality, allowing users to
256
- * filter displayed data based on specific conditions.
257
- * - `DataTablePagination`: Component responsible for handling the pagination
258
- * functionality of the `DataTable`. Allows control over which page of the
259
- * table to display (when in "paged" mode), or insight into the rows being
260
- * currently rendered (in "scrolled" mode).
261
- * - `DataTableRowsPerPage`: Component which allows the user to control the
262
- * `limit` property of the `DataTable`, i.e. how many rows to display per page
263
- * in "paged" mode or how many rows to display at once in "scrolled" mode.
264
- * - `DataTableRow`: Represents an individual row of the `DataTable`. This
265
- * component is only relevant when providing a custom data table row via
266
- * `renderRow`.
267
- * - `DataTableCell`: Represents an individual cell of the `DataTable`. This
268
- * component is only relevant when providing a custom data table cell via
269
- * `renderCell`.
251
+ * - `DataTableContent`: Main content of the data table, containing the table
252
+ * itself.
253
+ * - `DataTablePagination`: Pagination component of the data table, allowing the
254
+ * selection of the current page in `paged` mode and showing the current
255
+ * progress in `scrolled` mode.
256
+ * - `DataTableFilter`: Optional input used for filtering the rows of the data
257
+ * table.
258
+ * - `DataTableRowsPerPage`: Optional component allowing the selection of the
259
+ * number of rows to display per page.
260
+ * - `DataTableSelectionTrigger`: Optional trigger for acting on selected rows.
261
+ * - `DataTableRow`: Individual row of the data table. Shouldn't be used in most
262
+ * scenarios (use in `renderRow` when appropriate).
263
+ * - `DataTableCell`: Individual cell of the data table. Shouldn't be used in most
264
+ * scenarios (use in `renderCell` when appropriate).
265
+ *
266
+ * Example usage:
267
+ *
268
+ * ```tsx
269
+ * import {
270
+ * DataTable,
271
+ * DataTablePagination,
272
+ * DataTableRowsPerPage,
273
+ * } from "@ostack.tech/ui";
274
+ *
275
+ * function InventoryTable() {
276
+ * return (
277
+ * <DataTable
278
+ * columns={{
279
+ * sku: { label: "SKU", header: true },
280
+ * product: { label: "Product" },
281
+ * category: { label: "Category" },
282
+ * stock: { label: "Stock" },
283
+ * condition: { label: "Condition" },
284
+ * }}
285
+ * rowKey="sku"
286
+ * rows={[
287
+ * {
288
+ * sku: "KB-992",
289
+ * product: "Mechanical Keyboard",
290
+ * category: "Peripherals",
291
+ * stock: 42,
292
+ * condition: "New",
293
+ * },
294
+ * // …
295
+ * ]}
296
+ * >
297
+ * <DataTableContent caption="Inventory" />
298
+ * <DataTableRowsPerPage />
299
+ * <DataTablePagination />
300
+ * </DataTable>
301
+ * );
302
+ * }
303
+ * ```
270
304
  */
271
305
  export declare const DataTable: import('react').ForwardRefExoticComponent<DataTableProps<any> & import('react').RefAttributes<HTMLDivElement>>;
@@ -49,7 +49,9 @@ export interface DataTableState<T = any> {
49
49
  offset: () => number;
50
50
  currentPage: () => number;
51
51
  pageOffset: () => number;
52
- limit: number;
52
+ limitOptions?: number[];
53
+ _limit: number;
54
+ limit: () => number;
53
55
  pageLimit: () => number | undefined;
54
56
  filter: string;
55
57
  sortBy: string | null;
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithoutRef, ComponentPropsWithRef, ReactNode } from 'react';
2
- import { DatePicker } from '../DatePicker';
2
+ import { Calendar } from '../Calendar';
3
3
  import { Input } from '../Input';
4
4
  import { PopoverContent } from '../Popover';
5
5
  /** Properties of the date input component. */
@@ -46,8 +46,8 @@ export interface DateInputProps extends Omit<ComponentPropsWithoutRef<typeof Inp
46
46
  calendarButtonLabel?: ReactNode;
47
47
  /** Function called whenever the popover's open state changes. */
48
48
  onPopoverOpenChange?: (open: boolean) => void;
49
- /** Properties to pass to the date picker component. */
50
- datePickerProps?: Omit<ComponentPropsWithRef<typeof DatePicker>, "value" | "defaultValue" | "minDate" | "maxDate" | "minMonth" | "maxMonth" | "minYear" | "maxYear" | "locale">;
49
+ /** Properties to pass to the calendar component. */
50
+ calendarProps?: Omit<ComponentPropsWithRef<typeof Calendar>, "selectionMode" | "defaultValue" | "value" | "onValueChange" | "minDate" | "maxDate" | "minMonth" | "maxMonth" | "minYear" | "maxYear">;
51
51
  /** Properties to pass to the popover content component. */
52
52
  popoverContentProps?: ComponentPropsWithRef<typeof PopoverContent>;
53
53
  }
@@ -60,8 +60,11 @@ export interface DateValueRepresentations {
60
60
  }
61
61
  /**
62
62
  * The date input component is used to allow a user to enter a date with the aid
63
- * of a popover calendar. It is built on top of the `Input`, `Popover`, and
64
- * `DatePicker` components (and, by extension, the browser's [`<input>`
63
+ * of a popover calendar. It is built on top of the
64
+ * [`Input`](?path=/docs/ostack-ui-forms-input--docs),
65
+ * [`Popover`](?path=/docs/ostack-ui-overlay-popover--docs), and
66
+ * [`Calendar`](?path=/docs/ostack-ui-data-display-calendar--docs) components
67
+ * (and, by extension, the browser's [`<input>`
65
68
  * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input)).
66
69
  *
67
70
  * For accessibility purposes, date inputs are usually included within a `Field`
@@ -1,9 +1,9 @@
1
1
  import { ComponentPropsWithoutRef, ComponentPropsWithRef, CSSProperties, FocusEvent, ReactNode } from 'react';
2
2
  import { ControlStatus, ControlVariant } from '../../utils/control.ts';
3
3
  import { Responsive } from '../../utils/useResponsiveValues.ts';
4
+ import { Calendar, DateRange } from '../Calendar';
4
5
  import { CloseButton } from '../CloseButton';
5
6
  import { ControlCode } from '../ControlCode';
6
- import { DateRange, DateRangePicker } from '../DateRangePicker';
7
7
  import { ShowClearButton } from '../Input';
8
8
  import { PopoverAnchor, PopoverContent } from '../Popover';
9
9
  import { Spinner } from '../Spinner';
@@ -190,7 +190,7 @@ export interface DateRangeInputProps extends Omit<ComponentPropsWithoutRef<"div"
190
190
  /** Properties to pass to the spinner component. */
191
191
  spinnerProps?: Omit<ComponentPropsWithRef<typeof Spinner>, "size">;
192
192
  /** Properties to pass to the date-range picker component. */
193
- dateRangePickerProps?: Omit<ComponentPropsWithRef<typeof DateRangePicker>, "value" | "defaultValue" | "minDate" | "maxDate" | "minMonth" | "maxMonth" | "minYear" | "maxYear" | "locale">;
193
+ calendarProps?: Omit<ComponentPropsWithRef<typeof Calendar>, "selectionMode" | "defaultValue" | "value" | "onValueChange" | "minDate" | "maxDate" | "minMonth" | "maxMonth" | "minYear" | "maxYear">;
194
194
  /** Properties to pass to the popover content component. */
195
195
  popoverContentProps?: ComponentPropsWithRef<typeof PopoverContent>;
196
196
  }
@@ -204,9 +204,10 @@ export interface DateRangeValueRepresentations {
204
204
  /**
205
205
  * The date-range input component displays two inputs used to allow a user to
206
206
  * specify a date interval with the aid of popover calendars. It is built on top
207
- * of the `Input`, `Popover`, and `DateRangePicker` components (and, by
208
- * extension, the browser's [`<input>`
209
- * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input)).
207
+ * of the [`Popover`](?path=/docs/ostack-ui-overlay-popover--docs) and
208
+ * [`Calendar`](?path=/docs/ostack-ui-data-display-calendar--docs) components,
209
+ * as well as the browser's [`<input>`
210
+ * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input).
210
211
  *
211
212
  * For accessibility purposes, date-range inputs are usually included within a
212
213
  * `Field` together with a `Label` and optionally `HelperText` and/or
@@ -0,0 +1,38 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ import { GridContainerProps } from '../Grid';
3
+ /** Properties of the description list component. */
4
+ export interface DescriptionListProps extends Pick<GridContainerProps, "asChild" | "columns" | "gap" | "rowGap" | "columnGap">, ComponentPropsWithoutRef<"dl"> {
5
+ }
6
+ /**
7
+ * A list of descriptions pairing terms with their associated details. Built on
8
+ * top of the browser's
9
+ * [`<dl>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dl),
10
+ * [`<dt>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dt),
11
+ * and
12
+ * [`<dd>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dd)
13
+ * elements, as well as the [`Grid`
14
+ * component](?path=/docs/ostack-ui-layout-grid--docs) for layout.
15
+ *
16
+ * It composes the following subcomponent:
17
+ *
18
+ * - `DescriptionListItem`: A single term and details pair.
19
+ *
20
+ * Example usage:
21
+ *
22
+ * ```tsx
23
+ * import { DescriptionList, DescriptionListItem } from "@ostack.tech/ui";
24
+ *
25
+ * function UserInformation() {
26
+ * return (
27
+ * <DescriptionList>
28
+ * <DescriptionListItem term="Username">aacevedo</DescriptionListItem>
29
+ * <DescriptionListItem term="Name">Ava Acevedo</DescriptionListItem>
30
+ * <DescriptionListItem term="Date of birth">
31
+ * 1995-06-21
32
+ * </DescriptionListItem>
33
+ * </DescriptionList>
34
+ * );
35
+ * }
36
+ * ```
37
+ */
38
+ export declare const DescriptionList: import('react').ForwardRefExoticComponent<DescriptionListProps & import('react').RefAttributes<HTMLDListElement>>;