@ostack.tech/ui 1.3.0-beta.0 → 1.3.0-beta.2
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.
- package/dist/chunks/{en-DGLb7rrz.js → en-W4OWqPrv.js} +3 -4
- package/dist/chunks/en-W4OWqPrv.js.map +1 -0
- package/dist/chunks/{platformUtils-dLFQaWJG.js → platformUtils-Dm2Fkhni.js} +2 -3
- package/dist/chunks/{platformUtils-dLFQaWJG.js.map → platformUtils-Dm2Fkhni.js.map} +1 -1
- package/dist/locales/en-GB.js +2 -3
- package/dist/locales/en-GB.js.map +1 -1
- package/dist/locales/en-US.js +2 -3
- package/dist/locales/en-US.js.map +1 -1
- package/dist/locales/fr-FR.js +2 -3
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/pt-PT.js +2 -3
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui.css +84 -24
- package/dist/ostack-ui.js +2070 -2307
- package/dist/ostack-ui.js.map +1 -1
- package/package.json +7 -7
- package/scss/components/DropdownMenu/_DropdownMenu.scss +8 -2
- package/scss/components/Grid/_Grid.scss +6 -0
- package/scss/components/Stack/_Stack.scss +2 -2
- package/scss/scss/placeholders/popover/_popover.scss +2 -2
- package/types/components/Alert/Alert.d.ts +1 -1
- package/types/components/AlertDialog/AlertDialog.d.ts +0 -1
- package/types/components/AlertDialog/AlertDialogBody.d.ts +2 -2
- package/types/components/AlertDialog/AlertDialogFooter.d.ts +2 -2
- package/types/components/Box/Box.d.ts +1 -1
- package/types/components/Calendar/Calendar.d.ts +1 -1
- package/types/components/Calendar/CalendarContext.d.ts +1 -0
- package/types/components/CheckboxGroup/CheckboxGroup.d.ts +2 -2
- package/types/components/CommandMenu/CommandMenuItem.d.ts +6 -0
- package/types/components/CommandMenu/cmdk/index.d.ts +2 -2
- package/types/components/Container/Container.d.ts +1 -1
- package/types/components/DataTable/DataTable.d.ts +13 -6
- package/types/components/DataTable/DataTableBody.d.ts +2 -3
- package/types/components/DataTable/DataTableContent.d.ts +1 -1
- package/types/components/DataTable/DataTableRowsPerPage.d.ts +1 -5
- package/types/components/DataTable/ScrolledDataTableRows.d.ts +2 -2
- package/types/components/DataTable/useVirtualizerSnapshot.d.ts +13 -0
- package/types/components/DateInput/DateInput.d.ts +4 -4
- package/types/components/DateRangeInput/DateRangeInput.d.ts +1 -1
- package/types/components/DropdownMenu/DropdownMenuContent.d.ts +3 -2
- package/types/components/DropdownMenu/DropdownMenuItem.d.ts +6 -0
- package/types/components/Form/Form.d.ts +12 -3
- package/types/components/Form/FormError.d.ts +3 -2
- package/types/components/Grid/Grid.d.ts +8 -1
- package/types/components/Keyboard/Keyboard.d.ts +1 -5
- package/types/components/Link/Link.d.ts +1 -1
- package/types/components/NumericInput/NumericInput.d.ts +4 -4
- package/types/components/Output/Output.d.ts +12 -0
- package/types/components/Select/Select.d.ts +1 -1
- package/types/components/Separator/Separator.d.ts +1 -1
- package/types/components/Slot/Slot.d.ts +1 -1
- package/types/components/Stack/Stack.d.ts +6 -2
- package/types/components/Table/TableCell.d.ts +2 -2
- package/types/components/Text/Text.d.ts +2 -6
- package/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/types/index.d.ts +8 -7
- package/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +1 -1
- package/types/utils/localeUtils.d.ts +8 -0
- package/dist/chunks/en-DGLb7rrz.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ostack.tech/ui",
|
|
3
|
-
"version": "1.3.0-beta.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.3.0-beta.2",
|
|
4
|
+
"description": "Accessible React component library.",
|
|
5
5
|
"homepage": "https://ui.ostack.tech/",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Opensoft",
|
|
@@ -48,16 +48,16 @@
|
|
|
48
48
|
"test": "vitest --run"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@daypicker/react": "^10.0.
|
|
51
|
+
"@daypicker/react": "^10.0.2",
|
|
52
52
|
"@fortawesome/react-fontawesome": "^3.5.0",
|
|
53
|
-
"@tanstack/react-virtual": "^3.14.
|
|
53
|
+
"@tanstack/react-virtual": "^3.14.26",
|
|
54
54
|
"esm-env": "^1.2.2",
|
|
55
55
|
"from-exponential": "^1.1.1",
|
|
56
|
-
"radix-ui": "^1.
|
|
57
|
-
"react-error-boundary": "^6.1.
|
|
56
|
+
"radix-ui": "^1.8.1",
|
|
57
|
+
"react-error-boundary": "^6.1.6",
|
|
58
58
|
"react-number-format": "^5.4.5",
|
|
59
59
|
"react-to-print": "^3.3.0",
|
|
60
|
-
"tinykeys": "^4.0.
|
|
60
|
+
"tinykeys": "^4.0.1"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@fortawesome/fontawesome-svg-core": "^6.2.0 || ^7.0.0",
|
|
@@ -10,8 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
@extend %#{$prefix}popover;
|
|
12
12
|
|
|
13
|
-
max-width:
|
|
14
|
-
|
|
13
|
+
max-width: min(
|
|
14
|
+
var(--#{$prefix}max-w, 100dvw),
|
|
15
|
+
var(--radix-dropdown-menu-content-available-width)
|
|
16
|
+
);
|
|
17
|
+
max-height: min(
|
|
18
|
+
var(--#{$prefix}max-h, 100dvh),
|
|
19
|
+
var(--radix-dropdown-menu-content-available-height)
|
|
20
|
+
);
|
|
15
21
|
|
|
16
22
|
&__arrow {
|
|
17
23
|
@extend %#{$prefix}popover__arrow;
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
// Grid container
|
|
17
17
|
&__container {
|
|
18
18
|
display: flex;
|
|
19
|
+
align-items: var(--#{$prefix}grid-align-items);
|
|
20
|
+
justify-content: var(--#{$prefix}grid-justify-content);
|
|
21
|
+
align-content: var(--#{$prefix}grid-align-content);
|
|
19
22
|
flex-wrap: wrap;
|
|
20
23
|
margin-top: calc(var(--#{$prefix}mt, 0px) + var(--#{$prefix}grid-row-gap) * -1);
|
|
21
24
|
margin-left: calc(var(--#{$prefix}ml, 0px) + var(--#{$prefix}grid-column-gap) / -2);
|
|
@@ -26,6 +29,9 @@
|
|
|
26
29
|
(
|
|
27
30
|
row-gap: $default-row-gap,
|
|
28
31
|
column-gap: $default-column-gap,
|
|
32
|
+
align-items: null,
|
|
33
|
+
justify-content: null,
|
|
34
|
+
align-content: null,
|
|
29
35
|
)
|
|
30
36
|
);
|
|
31
37
|
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
.#{$prefix}stack {
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: var(--#{$prefix}stack-direction);
|
|
9
|
-
justify-content: var(--#{$prefix}stack-justify-content);
|
|
10
9
|
align-items: var(--#{$prefix}stack-align-items);
|
|
10
|
+
justify-content: var(--#{$prefix}stack-justify-content);
|
|
11
11
|
align-content: var(--#{$prefix}stack-align-content);
|
|
12
12
|
flex-wrap: var(--#{$prefix}stack-wrap);
|
|
13
13
|
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
child-mr: 0px,
|
|
22
22
|
child-mb: 0px,
|
|
23
23
|
child-ml: 0px,
|
|
24
|
-
justify-content: null,
|
|
25
24
|
align-items: null,
|
|
25
|
+
justify-content: null,
|
|
26
26
|
align-content: null,
|
|
27
27
|
wrap: null,
|
|
28
28
|
)
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
%#{$prefix}popover {
|
|
8
8
|
$popover: &;
|
|
9
9
|
|
|
10
|
-
max-width: var(--#{$prefix}max-w, var(--radix-popover-content-available-width));
|
|
11
|
-
max-height: var(--#{$prefix}max-h, var(--radix-popover-content-available-height));
|
|
10
|
+
max-width: min(var(--#{$prefix}max-w, 100dvw), var(--radix-popover-content-available-width));
|
|
11
|
+
max-height: min(var(--#{$prefix}max-h, 100dvh), var(--radix-popover-content-available-height));
|
|
12
12
|
|
|
13
13
|
border: $popover-border-width solid $popover-border-color;
|
|
14
14
|
border-radius: $popover-border-radius;
|
|
@@ -83,7 +83,7 @@ export interface AlertProps extends UseMarginPropsOptions, ComponentProps<"div">
|
|
|
83
83
|
* ```tsx
|
|
84
84
|
* import { Alert, AlertTitle } from "@ostack.tech/ui";
|
|
85
85
|
*
|
|
86
|
-
* function TermsAndConditionsNotice {
|
|
86
|
+
* function TermsAndConditionsNotice() {
|
|
87
87
|
* return (
|
|
88
88
|
* <Alert>
|
|
89
89
|
* <AlertTitle>Notice</AlertTitle>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type DialogBodyProps } from "../Dialog";
|
|
2
2
|
/** Properties to the alert dialog body component. */
|
|
3
3
|
export type AlertDialogBodyProps = DialogBodyProps;
|
|
4
4
|
/** Body section of the alert dialog. */
|
|
5
|
-
export declare
|
|
5
|
+
export declare function AlertDialogBody(props: DialogBodyProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type DialogFooterProps } from "../Dialog";
|
|
2
2
|
/** Properties to the alert dialog footer component. */
|
|
3
3
|
export type AlertDialogFooterProps = DialogFooterProps;
|
|
4
4
|
/** Footer section of the alert dialog. */
|
|
5
|
-
export declare
|
|
5
|
+
export declare function AlertDialogFooter(props: DialogFooterProps): import("react").JSX.Element;
|
|
@@ -18,7 +18,7 @@ export interface BoxOwnProps extends UseMarginPropsOptions, UsePaddingPropsOptio
|
|
|
18
18
|
/**
|
|
19
19
|
* Basic layout component. Built on top of the browser's [`<div>`
|
|
20
20
|
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/div) with access to
|
|
21
|
-
* margin, padding,
|
|
21
|
+
* margin, padding, and sizing properties.
|
|
22
22
|
*
|
|
23
23
|
* Example usage:
|
|
24
24
|
*
|
|
@@ -115,4 +115,4 @@ export interface CalendarRangeSelectionProps extends CalendarPropsBase<DateRange
|
|
|
115
115
|
* }
|
|
116
116
|
* ```
|
|
117
117
|
*/
|
|
118
|
-
export declare function Calendar({ selectionMode, defaultValue, value: controlledValue, onValueChange, required, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, monthSelectLabel: monthSelectLabelProp, yearSelectLabel: yearSelectLabelProp, previousMonthLabel: previousMonthLabelProp, nextMonthLabel: nextMonthLabelProp, defaultMonth, month: controlledMonth, onMonthChange, onDayClick, onDayFocus, onDayMouseEnter, numberOfMonths, fixedWeeks, showOutsideDays, disableNavigation, disabled, modifiers, apiRef, headerProps, headerLabelProps, previousButtonProps, nextButtonProps, monthSelectProps, yearSelectProps, pagedNavigation, style, ...otherProps }: CalendarProps): import("react").JSX.Element;
|
|
118
|
+
export declare function Calendar({ selectionMode, defaultValue, value: controlledValue, onValueChange, required, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, monthSelectLabel: monthSelectLabelProp, yearSelectLabel: yearSelectLabelProp, previousMonthLabel: previousMonthLabelProp, nextMonthLabel: nextMonthLabelProp, defaultMonth, month: controlledMonth, onMonthChange, onDayClick, onDayFocus, onDayMouseEnter, numberOfMonths, fixedWeeks, showOutsideDays, disableNavigation, disabled, modifiers, today, apiRef, headerProps, headerLabelProps, previousButtonProps, nextButtonProps, monthSelectProps, yearSelectProps, pagedNavigation, style, ...otherProps }: CalendarProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CalendarProps } from "./Calendar.tsx";
|
|
2
2
|
/** Value of the calendar context. */
|
|
3
3
|
export interface CalendarContextValue {
|
|
4
|
+
curDate: Date;
|
|
4
5
|
minAllowedDate: Date | undefined;
|
|
5
6
|
maxAllowedDate: Date | undefined;
|
|
6
7
|
monthSelectLabel: CalendarProps["monthSelectLabel"];
|
|
@@ -8,8 +8,8 @@ import { type SpinnerProps } from "../Spinner";
|
|
|
8
8
|
/** Properties of the checkbox group component. */
|
|
9
9
|
export interface CheckboxGroupProps extends UseMarginPropsOptions, ComponentProps<"div"> {
|
|
10
10
|
/**
|
|
11
|
-
* Whether to display the checkbox group inline. Defaults to `false` unless when
|
|
12
|
-
* table cell.
|
|
11
|
+
* Whether to display the checkbox group inline. Defaults to `false` unless when rendering inside
|
|
12
|
+
* a table cell.
|
|
13
13
|
*/
|
|
14
14
|
inline?: boolean;
|
|
15
15
|
/**
|
|
@@ -10,6 +10,12 @@ export interface CommandMenuItemProps extends Omit<ComponentProps<typeof Command
|
|
|
10
10
|
* @default false
|
|
11
11
|
*/
|
|
12
12
|
asLink?: boolean;
|
|
13
|
+
/** Href for the link, when `asLink` is set. */
|
|
14
|
+
href?: ComponentProps<"a">["href"];
|
|
15
|
+
/** Target of the link, when `asLink` is set. */
|
|
16
|
+
target?: ComponentProps<"a">["target"];
|
|
17
|
+
/** Rel of the link, when `asLink` is set. */
|
|
18
|
+
rel?: ComponentProps<"a">["rel"];
|
|
13
19
|
}
|
|
14
20
|
/** Item of the command menu. */
|
|
15
21
|
export declare function CommandMenuItem({ onSelect, selected, asLink, color, disabled, loading, loadingContent, showSpinner, icon, iconPlacement, keybinds, href, target, rel, keywords, actionProps, contentProps, iconProps, spinnerProps, keybindsProps, className, children, "aria-disabled": ariaDisabled, ...otherProps }: CommandMenuItemProps): import("react").JSX.Element;
|
|
@@ -42,7 +42,7 @@ declare const Command: React.ForwardRefExoticComponent<Children & Omit<React.Det
|
|
|
42
42
|
*/
|
|
43
43
|
shouldFilter?: boolean;
|
|
44
44
|
/**
|
|
45
|
-
* Custom filter function for whether each command menu item should
|
|
45
|
+
* Custom filter function for whether each command menu item should match the given search
|
|
46
46
|
* query. It should return a number between 0 and 1, with 1 being the best match and 0 being
|
|
47
47
|
* hidden entirely. By default, uses the `command-score` library.
|
|
48
48
|
*/
|
|
@@ -170,7 +170,7 @@ declare const pkg: React.ForwardRefExoticComponent<Children & Omit<React.Detaile
|
|
|
170
170
|
*/
|
|
171
171
|
shouldFilter?: boolean;
|
|
172
172
|
/**
|
|
173
|
-
* Custom filter function for whether each command menu item should
|
|
173
|
+
* Custom filter function for whether each command menu item should match the given search
|
|
174
174
|
* query. It should return a number between 0 and 1, with 1 being the best match and 0 being
|
|
175
175
|
* hidden entirely. By default, uses the `command-score` library.
|
|
176
176
|
*/
|
|
@@ -45,7 +45,7 @@ export interface ContainerProps extends UseMarginPropsOptions, ComponentProps<"d
|
|
|
45
45
|
*/
|
|
46
46
|
leftGutter?: Responsive<number | string>;
|
|
47
47
|
/**
|
|
48
|
-
* Size of the right margin of the container.When a number is provided, each unit corresponds to
|
|
48
|
+
* Size of the right margin of the container. When a number is provided, each unit corresponds to
|
|
49
49
|
* `var(--o-ui-space)`.
|
|
50
50
|
*
|
|
51
51
|
* A responsive value may be provided to change the gutter size based on the current breakpoint.
|
|
@@ -296,7 +296,14 @@ export interface DataTableProps<T = any> extends ComponentProps<"div"> {
|
|
|
296
296
|
* Example usage:
|
|
297
297
|
*
|
|
298
298
|
* ```tsx
|
|
299
|
-
* import {
|
|
299
|
+
* import {
|
|
300
|
+
* DataTable,
|
|
301
|
+
* DataTableColumn,
|
|
302
|
+
* DataTableColumns,
|
|
303
|
+
* DataTableContent,
|
|
304
|
+
* DataTablePagination,
|
|
305
|
+
* DataTableRowsPerPage,
|
|
306
|
+
* } from "@ostack.tech/ui";
|
|
300
307
|
*
|
|
301
308
|
* function InventoryTable() {
|
|
302
309
|
* return (
|
|
@@ -314,11 +321,11 @@ export interface DataTableProps<T = any> extends ComponentProps<"div"> {
|
|
|
314
321
|
* ]}
|
|
315
322
|
* >
|
|
316
323
|
* <DataTableColumns>
|
|
317
|
-
* <DataTableColumn
|
|
318
|
-
* <DataTableColumn
|
|
319
|
-
* <DataTableColumn
|
|
320
|
-
* <DataTableColumn
|
|
321
|
-
* <DataTableColumn
|
|
324
|
+
* <DataTableColumn id="sku" label="SKU" header />
|
|
325
|
+
* <DataTableColumn id="product" label="Product" />
|
|
326
|
+
* <DataTableColumn id="category" label="Category" />
|
|
327
|
+
* <DataTableColumn id="stock" label="Stock" />
|
|
328
|
+
* <DataTableColumn id="condition" label="Condition" />
|
|
322
329
|
* </DataTableColumns>
|
|
323
330
|
* <DataTableContent caption="Inventory" />
|
|
324
331
|
* <DataTableRowsPerPage />
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { RefObject } from "react";
|
|
2
1
|
import { type TableBodyProps } from "../Table";
|
|
3
2
|
import type { DataTableContentProps } from "./DataTableContent.tsx";
|
|
4
3
|
/** Properties of the data table foot component. */
|
|
5
4
|
export interface DataTableBodyProps extends TableBodyProps, Pick<DataTableContentProps, "emptyMessage" | "emptyMessageProps"> {
|
|
6
|
-
|
|
5
|
+
scrollableEl: HTMLDivElement | null;
|
|
7
6
|
}
|
|
8
7
|
/** Body of the data table. */
|
|
9
|
-
export declare function DataTableBody({ emptyMessage, emptyMessageProps,
|
|
8
|
+
export declare function DataTableBody({ emptyMessage, emptyMessageProps, scrollableEl, ...otherProps }: DataTableBodyProps): import("react").JSX.Element;
|
|
@@ -7,7 +7,7 @@ export interface DataTableContentProps extends Omit<TableProps, "layout"> {
|
|
|
7
7
|
/** Content of the table foot component. */
|
|
8
8
|
tableFootContent?: ReactNode;
|
|
9
9
|
/**
|
|
10
|
-
* Whether the table foot
|
|
10
|
+
* Whether the table foot should be shown when the data table is empty.
|
|
11
11
|
*
|
|
12
12
|
* @default false
|
|
13
13
|
*/
|
|
@@ -8,11 +8,7 @@ export interface DataTableRowsPerPageProps extends UseMarginPropsOptions, Compon
|
|
|
8
8
|
* @default [10, 15, 25, 50]
|
|
9
9
|
*/
|
|
10
10
|
limitOptions?: number[];
|
|
11
|
-
/**
|
|
12
|
-
* Function used to render the number of rows per page.
|
|
13
|
-
*
|
|
14
|
-
* @param rows Node representing the number of rows (a select).
|
|
15
|
-
*/
|
|
11
|
+
/** Label of the rows per page select. */
|
|
16
12
|
label?: ReactNode;
|
|
17
13
|
/**
|
|
18
14
|
* Whether the component should preferably be aligned to the right. This only has an effect when
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataTableBodyProps } from "./DataTableBody.tsx";
|
|
2
2
|
/** Properties of the scrolled data table body component. */
|
|
3
|
-
interface ScrolledDataTableRowsProps extends Pick<DataTableBodyProps, "
|
|
3
|
+
interface ScrolledDataTableRowsProps extends Pick<DataTableBodyProps, "scrollableEl"> {
|
|
4
4
|
}
|
|
5
5
|
/** Body of the data table in "scrolled" display mode. */
|
|
6
|
-
export declare function ScrolledDataTableRows({
|
|
6
|
+
export declare function ScrolledDataTableRows({ scrollableEl }: ScrolledDataTableRowsProps): import("react").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
2
|
+
/**
|
|
3
|
+
* Wraps `useVirtualizer`, exposing render-relevant state as immutable values so that consumers can
|
|
4
|
+
* be safely optimized by React Compiler. The `virtualizer` instance itself must only be used
|
|
5
|
+
* imperatively (effects, callbacks, refs).
|
|
6
|
+
*/
|
|
7
|
+
export declare function useVirtualizerSnapshot<TScroll extends Element, TItem extends Element>(options: Parameters<typeof useVirtualizer<TScroll, TItem>>[0]): {
|
|
8
|
+
virtualizer: import("@tanstack/react-virtual").ReactVirtualizer<TScroll, TItem>;
|
|
9
|
+
virtualItems: import("@tanstack/virtual-core").VirtualItem[];
|
|
10
|
+
totalSize: number;
|
|
11
|
+
startIndex: number;
|
|
12
|
+
endIndex: number;
|
|
13
|
+
};
|
|
@@ -20,22 +20,22 @@ export interface DateInputProps extends Omit<ControlNonFileInputProps, "defaultV
|
|
|
20
20
|
*/
|
|
21
21
|
onValueChange?: (valueRepresentations: DateValueRepresentations) => void;
|
|
22
22
|
/**
|
|
23
|
-
* Minimum date allowed. When a string
|
|
23
|
+
* Minimum date allowed. When a string is provided, it should represent the date in the ISO 8601
|
|
24
24
|
* format, i.e. `"2020-01-01"` should be provided instead of a formatted `"01/01/2020"`.
|
|
25
25
|
*/
|
|
26
26
|
minDate?: string | Date | null;
|
|
27
27
|
/**
|
|
28
|
-
* Maximum date allowed. When a string
|
|
28
|
+
* Maximum date allowed. When a string is provided, it should represent the date in the ISO 8601
|
|
29
29
|
* format, i.e. `"2020-01-01"` should be provided instead of a formatted `"01/01/2020"`.
|
|
30
30
|
*/
|
|
31
31
|
maxDate?: string | Date | null;
|
|
32
32
|
/**
|
|
33
|
-
* Minimum month allowed. When a string
|
|
33
|
+
* Minimum month allowed. When a string is provided, it should represent the date in the ISO 8601
|
|
34
34
|
* format, i.e. `"2020-01"` should be provided instead of a formatted `"01/2020"`.
|
|
35
35
|
*/
|
|
36
36
|
minMonth?: string | Date | null;
|
|
37
37
|
/**
|
|
38
|
-
* Maximum month allowed. When a string
|
|
38
|
+
* Maximum month allowed. When a string is provided, it should represent the date in the ISO 8601
|
|
39
39
|
* format, i.e. `"2020-01"` should be provided instead of a formatted `"01/2020"`.
|
|
40
40
|
*/
|
|
41
41
|
maxMonth?: string | Date | null;
|
|
@@ -49,7 +49,7 @@ export interface DateRangeInputProps extends UseMarginPropsOptions, Pick<UseText
|
|
|
49
49
|
* @param valueRepresentations Different representations of the date-range value.
|
|
50
50
|
*/
|
|
51
51
|
onValueChange?: (valueRepresentations: DateRangeValueRepresentations) => void;
|
|
52
|
-
/** Whether the
|
|
52
|
+
/** Whether the date-range input is required. */
|
|
53
53
|
required?: boolean;
|
|
54
54
|
/** Disables the control. */
|
|
55
55
|
disabled?: boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
2
2
|
import type { ComponentProps } from "react";
|
|
3
|
+
import { type UseSizingPropsOptions } from "../../utils/useSizingProps.ts";
|
|
3
4
|
import { type MenuListProps } from "../MenuList";
|
|
4
5
|
/** Properties of the dropdown menu content component. */
|
|
5
|
-
export interface DropdownMenuContentProps extends Omit<ComponentProps<typeof DropdownMenuPrimitive.Content>, "asChild">, Pick<MenuListProps, "variant" | "iconPlacement"> {
|
|
6
|
+
export interface DropdownMenuContentProps extends UseSizingPropsOptions, Omit<ComponentProps<typeof DropdownMenuPrimitive.Content>, "asChild">, Pick<MenuListProps, "variant" | "iconPlacement"> {
|
|
6
7
|
/**
|
|
7
8
|
* Whether to show an arrow pointing to the anchor.
|
|
8
9
|
*
|
|
@@ -17,4 +18,4 @@ export interface DropdownMenuContentProps extends Omit<ComponentProps<typeof Dro
|
|
|
17
18
|
menuListProps?: Omit<MenuListProps, "variant" | "iconPlacement" | "asChild">;
|
|
18
19
|
}
|
|
19
20
|
/** The component that pops out when the dropdown menu is open. */
|
|
20
|
-
export declare function DropdownMenuContent({ variant, iconPlacement, showArrow, sideOffset, collisionPadding, forceMount, className, portalProps, arrowProps, menuListProps, children, ...otherProps }: DropdownMenuContentProps): import("react").JSX.Element;
|
|
21
|
+
export declare function DropdownMenuContent({ variant, iconPlacement, showArrow, sideOffset, collisionPadding, forceMount, className, style, portalProps, arrowProps, menuListProps, children, ...otherProps }: DropdownMenuContentProps): import("react").JSX.Element;
|
|
@@ -10,6 +10,12 @@ export interface DropdownMenuItemProps extends Omit<ComponentProps<typeof Dropdo
|
|
|
10
10
|
* @default false
|
|
11
11
|
*/
|
|
12
12
|
asLink?: boolean;
|
|
13
|
+
/** Href for the link, when `asLink` is set. */
|
|
14
|
+
href?: ComponentProps<"a">["href"];
|
|
15
|
+
/** Target of the link, when `asLink` is set. */
|
|
16
|
+
target?: ComponentProps<"a">["target"];
|
|
17
|
+
/** Rel of the link, when `asLink` is set. */
|
|
18
|
+
rel?: ComponentProps<"a">["rel"];
|
|
13
19
|
}
|
|
14
20
|
/** Dropdown menu item. */
|
|
15
21
|
export declare function DropdownMenuItem({ onSelect, asLink, selected, color, disabled, loading, loadingContent, showSpinner, icon, iconPlacement, keybinds, href, target, rel, actionProps, contentProps, iconProps, spinnerProps, keybindsProps, className, "aria-disabled": ariaDisabled, ...otherProps }: DropdownMenuItemProps): import("react").JSX.Element;
|
|
@@ -89,8 +89,8 @@ export interface FormProps<T extends FormValues = any> extends Omit<BoxProps, ke
|
|
|
89
89
|
apiRef?: Ref<FormApi<T> | null>;
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
|
-
* The `Form` provides a wrapper over the browser's native validation capabilities and can
|
|
93
|
-
* to declaratively build simple forms.
|
|
92
|
+
* The `Form` component provides a wrapper over the browser's native validation capabilities and can
|
|
93
|
+
* be used to declaratively build simple forms.
|
|
94
94
|
*
|
|
95
95
|
* It composes the following subcomponents:
|
|
96
96
|
*
|
|
@@ -106,7 +106,16 @@ export interface FormProps<T extends FormValues = any> extends Omit<BoxProps, ke
|
|
|
106
106
|
* Example usage:
|
|
107
107
|
*
|
|
108
108
|
* ```tsx
|
|
109
|
-
* import {
|
|
109
|
+
* import {
|
|
110
|
+
* Button,
|
|
111
|
+
* Field,
|
|
112
|
+
* Form,
|
|
113
|
+
* FormError,
|
|
114
|
+
* FormSubmit,
|
|
115
|
+
* Input,
|
|
116
|
+
* Label,
|
|
117
|
+
* Stack,
|
|
118
|
+
* } from "@ostack.tech/ui";
|
|
110
119
|
*
|
|
111
120
|
* function SignInForm() {
|
|
112
121
|
* return (
|
|
@@ -5,8 +5,9 @@ export interface FormErrorProps {
|
|
|
5
5
|
/**
|
|
6
6
|
* Name of the field for which to display the error.
|
|
7
7
|
*
|
|
8
|
-
* By default, the name is inherited from the parent `Field` component if one
|
|
9
|
-
* provided a name. Otherwise, it defaults to the empty string, which represents a
|
|
8
|
+
* By default, the name is inherited from a control within the parent `Field` component if one
|
|
9
|
+
* exists and was provided a name. Otherwise, it defaults to the empty string, which represents a
|
|
10
|
+
* global error.
|
|
10
11
|
*/
|
|
11
12
|
name?: string;
|
|
12
13
|
/** How errors should be displayed. This property is, by default, inherited from the `Form`. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
1
2
|
import { type Responsive } from "../../utils/responsiveValues.ts";
|
|
2
3
|
import { type BoxProps } from "../Box";
|
|
3
4
|
/** Size of a column. */
|
|
@@ -53,6 +54,12 @@ export interface GridPropsBase extends BoxProps {
|
|
|
53
54
|
* @default gap
|
|
54
55
|
*/
|
|
55
56
|
columnGap?: Responsive<number | string>;
|
|
57
|
+
/** Sets the `align-items` CSS property. */
|
|
58
|
+
alignItems?: Responsive<CSSProperties["alignItems"]>;
|
|
59
|
+
/** Sets the `justify-content` CSS property. */
|
|
60
|
+
justifyContent?: Responsive<CSSProperties["justifyContent"]>;
|
|
61
|
+
/** Sets the `align-content` CSS property. */
|
|
62
|
+
alignContent?: Responsive<CSSProperties["alignContent"]>;
|
|
56
63
|
/** Column size (number of columns) at the `xs` breakpoint. */
|
|
57
64
|
xs?: GridColumnSize;
|
|
58
65
|
/** Offset size (number of columns) at the `xs` breakpoint. */
|
|
@@ -135,4 +142,4 @@ export interface GridItemProps extends GridPropsBase {
|
|
|
135
142
|
* }
|
|
136
143
|
* ```
|
|
137
144
|
*/
|
|
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;
|
|
145
|
+
export declare function Grid({ container, columns, gap, rowGap, columnGap, xs, sm, md, lg, xl, xxl, xsOffset, smOffset, mdOffset, lgOffset, xlOffset, xxlOffset, alignItems, justifyContent, alignContent, className, style, ...otherProps }: GridProps): import("react").JSX.Element;
|
|
@@ -12,11 +12,7 @@ export interface KeyboardProps extends UseMarginPropsOptions, UseTextPropsOption
|
|
|
12
12
|
* underlying DOM node.
|
|
13
13
|
*/
|
|
14
14
|
asChild?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Colour of the keyboard element.
|
|
17
|
-
*
|
|
18
|
-
* @default "primary"
|
|
19
|
-
*/
|
|
15
|
+
/** Colour of the keyboard element. */
|
|
20
16
|
color?: KeyboardColor;
|
|
21
17
|
}
|
|
22
18
|
/**
|
|
@@ -35,7 +35,7 @@ export interface LinkOwnProps extends UseMarginPropsOptions, UseTextPropsOptions
|
|
|
35
35
|
* `rel="noopener noreferrer"`).
|
|
36
36
|
*
|
|
37
37
|
* If a `Referer` header should be included when navigating, then the `rel` attribute should be
|
|
38
|
-
*
|
|
38
|
+
* overridden to simply `rel="noopener"`.
|
|
39
39
|
*/
|
|
40
40
|
external?: boolean;
|
|
41
41
|
/** Link icon. By default, only `external` links have an icon. */
|
|
@@ -30,22 +30,22 @@ export interface NumericInputProps extends NumericTransformerOptions, Omit<Contr
|
|
|
30
30
|
precision?: number | null;
|
|
31
31
|
/**
|
|
32
32
|
* Minimum number allowed. If a string is provided, it should **not** be the formatted
|
|
33
|
-
* representation, e.g. `"999999.99" should be provided instead of `"999 999,99 €"`.
|
|
33
|
+
* representation, e.g. `"999999.99"` should be provided instead of `"999 999,99 €"`.
|
|
34
34
|
*/
|
|
35
35
|
min?: string | number | bigint | null;
|
|
36
36
|
/**
|
|
37
37
|
* Maximum number allowed. If a string is provided, it should **not** be the formatted
|
|
38
|
-
* representation, e.g. `"999999.99" should be provided instead of `"999 999,99 €"`.
|
|
38
|
+
* representation, e.g. `"999999.99"` should be provided instead of `"999 999,99 €"`.
|
|
39
39
|
*/
|
|
40
40
|
max?: string | number | bigint | null;
|
|
41
41
|
/**
|
|
42
42
|
* Value that the number should be greater than. If a string is provided, it should **not** be the
|
|
43
|
-
* formatted representation, e.g. `"999999.99" should be provided instead of `"999 999,99 €"`.
|
|
43
|
+
* formatted representation, e.g. `"999999.99"` should be provided instead of `"999 999,99 €"`.
|
|
44
44
|
*/
|
|
45
45
|
exclusiveMin?: string | number | bigint | null;
|
|
46
46
|
/**
|
|
47
47
|
* Value that the number should be less than. If a string is provided, it should **not** be the
|
|
48
|
-
* formatted representation, e.g. `"999999.99" should be provided instead of `"999 999,99 €"`.
|
|
48
|
+
* formatted representation, e.g. `"999999.99"` should be provided instead of `"999 999,99 €"`.
|
|
49
49
|
*/
|
|
50
50
|
exclusiveMax?: string | number | bigint | null;
|
|
51
51
|
/** Custom validation function meant to validate the control when it is part of a `Form`. */
|
|
@@ -19,6 +19,18 @@ export interface OutputProps extends Omit<ControlOutputProps, "asChild" | "disab
|
|
|
19
19
|
* will remain unchanged.
|
|
20
20
|
*/
|
|
21
21
|
pendingContent?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to show a spinner in the output.
|
|
24
|
+
*
|
|
25
|
+
* Defaults to the value of the `pending` property. In most cases, prefer `pending`, which also
|
|
26
|
+
* marks the output as busy for assistive technologies.
|
|
27
|
+
*
|
|
28
|
+
* Use `showSpinner` when you want a spinner **without** marking the output as busy. To mark as
|
|
29
|
+
* busy **without** a spinner, set `pending` to `true` and `showSpinner` to `false`.
|
|
30
|
+
*
|
|
31
|
+
* @default pending
|
|
32
|
+
*/
|
|
33
|
+
showSpinner?: boolean;
|
|
22
34
|
}
|
|
23
35
|
/**
|
|
24
36
|
* The output component is used to display the result of a calculation or user action. It is built
|
|
@@ -55,7 +55,7 @@ interface SelectPropsBase<TValue> extends SelectPopoverTriggerProps, Pick<Comman
|
|
|
55
55
|
valueProps?: ComponentProps<"div">;
|
|
56
56
|
/** Properties to pass to each `Tag` holding a value, when `multiple` is set. */
|
|
57
57
|
valueTagProps?: Omit<TagProps, "defaultOpen" | "open" | "onOpenChange" | "color" | "showCloseButton">;
|
|
58
|
-
/** Properties to pass to the arrow `
|
|
58
|
+
/** Properties to pass to the arrow `IconButton` component. */
|
|
59
59
|
arrowProps?: Omit<IconButtonProps, "icon" | "label">;
|
|
60
60
|
/** Properties to pass to the `Popover` component. */
|
|
61
61
|
popoverProps?: PopoverContentProps;
|
|
@@ -22,7 +22,7 @@ export interface SeparatorProps extends UseMarginPropsOptions, ComponentProps<ty
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Component that visually or semantically separates content. Built on top of the [Radix Separator
|
|
25
|
-
* primitive](https://www.radix-ui.com/primitives/docs/components/separator)
|
|
25
|
+
* primitive](https://www.radix-ui.com/primitives/docs/components/separator).
|
|
26
26
|
*
|
|
27
27
|
* Example usage:
|
|
28
28
|
*
|
|
@@ -9,5 +9,5 @@ export interface SlotProps extends ComponentProps<typeof SlotPrimitive.Root> {
|
|
|
9
9
|
* Used to support components with an `asChild` property.
|
|
10
10
|
*/
|
|
11
11
|
export declare const Slot: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLElement> & {
|
|
12
|
-
children?: React.ReactNode;
|
|
12
|
+
children?: React.ReactNode | undefined;
|
|
13
13
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -21,9 +21,13 @@ export interface StackProps extends BoxProps {
|
|
|
21
21
|
gap?: Responsive<number | string>;
|
|
22
22
|
/** Adds a divider between elements. */
|
|
23
23
|
divider?: ReactElement;
|
|
24
|
-
|
|
24
|
+
/** Sets the `align-items` CSS property. */
|
|
25
25
|
alignItems?: Responsive<CSSProperties["alignItems"]>;
|
|
26
|
+
/** Sets the `justify-content` CSS property. */
|
|
27
|
+
justifyContent?: Responsive<CSSProperties["justifyContent"]>;
|
|
28
|
+
/** Sets the `align-content` CSS property. */
|
|
26
29
|
alignContent?: Responsive<CSSProperties["alignContent"]>;
|
|
30
|
+
/** Sets the `flex-wrap` property. A boolean value sets `"wrap"`/`"nowrap"` respectively. */
|
|
27
31
|
wrap?: Responsive<StackWrap>;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
@@ -52,4 +56,4 @@ export interface StackProps extends BoxProps {
|
|
|
52
56
|
* }
|
|
53
57
|
* ```
|
|
54
58
|
*/
|
|
55
|
-
export declare function Stack({ direction, gap, divider,
|
|
59
|
+
export declare function Stack({ direction, gap, divider, alignItems, justifyContent, alignContent, wrap, className, style, children, ...otherProps }: StackProps): import("react").JSX.Element;
|
|
@@ -28,8 +28,8 @@ export interface TableCellProps extends Omit<ComponentProps<"td" | "th">, "align
|
|
|
28
28
|
/** Specifies how to align the cell's content. Numeric fields should typically be right aligned. */
|
|
29
29
|
align?: CSSProperties["textAlign"];
|
|
30
30
|
/**
|
|
31
|
-
* Style variant to use.
|
|
32
|
-
*
|
|
31
|
+
* Style variant to use. Defaults to `"header"` when the cell is a `header`, and to `"data"`
|
|
32
|
+
* otherwise.
|
|
33
33
|
*/
|
|
34
34
|
variant?: TableCellVariant;
|
|
35
35
|
/**
|
|
@@ -16,18 +16,14 @@ export interface TextOwnProps extends UseMarginPropsOptions, UseTextPropsOptions
|
|
|
16
16
|
* underlying DOM node.
|
|
17
17
|
*/
|
|
18
18
|
asChild?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Colour of the text.
|
|
21
|
-
*
|
|
22
|
-
* @default "primary"
|
|
23
|
-
*/
|
|
19
|
+
/** Colour of the text. */
|
|
24
20
|
color?: TextColor;
|
|
25
21
|
/** Uses a higher contrast colour for the text. */
|
|
26
22
|
highContrast?: boolean;
|
|
27
23
|
}
|
|
28
24
|
/**
|
|
29
25
|
* Component used to render text. By default, it renders as a [`<span>`
|
|
30
|
-
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/
|
|
26
|
+
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/span). Use the `as`
|
|
31
27
|
* property to render as an `<em>`, `<p>`, `<strong>`, or other text elements.
|
|
32
28
|
*
|
|
33
29
|
* Example usage:
|
|
@@ -54,7 +54,7 @@ export interface TooltipProps extends Omit<ComponentProps<typeof TooltipPrimitiv
|
|
|
54
54
|
* ```tsx
|
|
55
55
|
* import { Button, Tooltip } from "@ostack.tech/ui";
|
|
56
56
|
*
|
|
57
|
-
* function BookmarkButton() {
|
|
57
|
+
* function BookmarkButton() {
|
|
58
58
|
* return (
|
|
59
59
|
* <Tooltip content="Save for later…">
|
|
60
60
|
* <Button>Bookmark</Button>
|