@ostack.tech/ui 0.9.2 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{en-GEeEwItR.js → en-DwZKZVGL.js} +10 -4
- package/dist/chunks/en-DwZKZVGL.js.map +1 -0
- package/dist/locales/en-GB.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/fr-FR.js +9 -3
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/pt-PT.js +9 -3
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui.css +23 -13
- package/dist/ostack-ui.js +824 -743
- package/dist/ostack-ui.js.map +1 -1
- package/dist/types/components/AlertDialog/AlertDialog.d.ts +2 -1
- package/dist/types/components/Button/Button.d.ts +2 -1
- package/dist/types/components/Calendar/CalendarMonthGrid.d.ts +1 -0
- package/dist/types/components/CommandMenu/CommandMenu.d.ts +3 -2
- package/dist/types/components/DataTable/DataTable.d.ts +4 -0
- package/dist/types/components/DataTable/DataTableContext.d.ts +7 -1
- package/dist/types/components/DataTable/DataTablePagination.d.ts +2 -0
- package/dist/types/components/DataTable/PagedDataTablePagination.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +2 -1
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +2 -1
- package/dist/types/components/Field/Field.d.ts +35 -6
- package/dist/types/components/Field/FieldProvider.d.ts +13 -0
- package/dist/types/components/Field/index.d.ts +1 -0
- package/dist/types/components/Heading/Heading.d.ts +3 -1
- package/dist/types/components/Icon/Icon.d.ts +5 -6
- package/dist/types/components/IconButton/IconButton.d.ts +7 -0
- package/dist/types/components/Input/Input.d.ts +2 -2
- package/dist/types/components/Keyboard/Keyboard.d.ts +17 -2
- package/dist/types/components/NumericInput/NumericInput.d.ts +27 -14
- package/dist/types/components/Select/Select.d.ts +2 -2
- package/dist/types/components/Tabs/Tabs.d.ts +3 -0
- package/dist/types/components/TextArea/TextArea.d.ts +14 -11
- package/dist/types/components/Tooltip/Tooltip.d.ts +25 -14
- package/dist/types/providers/LocalizationProvider/LocalizationObject.d.ts +4 -3
- package/dist/types/utils/numericStringUtils.d.ts +2 -2
- package/package.json +2 -4
- package/scss/components/Code/_Code-variables.scss +1 -1
- package/scss/components/DataTable/_DataTable-variables.scss +6 -0
- package/scss/components/DataTable/_DataTable.scss +7 -0
- package/scss/components/Dialog/_Dialog.scss +2 -1
- package/scss/components/Keyboard/_Keyboard-variables.scss +2 -2
- package/scss/components/Keyboard/_Keyboard.scss +1 -0
- package/scss/components/Toast/_Toast.scss +4 -0
- package/scss/index.scss +1 -0
- package/scss/scss/helpers/_keyframes.scss +114 -0
- package/scss/scss/utils/_animation.scss +0 -104
- package/scss/scss/utils/_spinner.scss +2 -7
- package/dist/chunks/en-GEeEwItR.js.map +0 -1
- package/dist/ostack-ui.css.map +0 -1
|
@@ -5,7 +5,8 @@ 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`
|
|
8
|
+
* and the [`Card`
|
|
9
|
+
* component](https://ui.ostack.tech/?path=/docs/ostack-ui-data-display-card--docs).
|
|
9
10
|
*
|
|
10
11
|
* It composes the following subcomponents:
|
|
11
12
|
*
|
|
@@ -146,7 +146,8 @@ export interface ButtonOwnProps {
|
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* The button component is used to trigger actions or events, such as opening a
|
|
149
|
-
* dialog or submitting a form.
|
|
149
|
+
* dialog or submitting a form. It is built on top of the browser's [`<button>`
|
|
150
|
+
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button).
|
|
150
151
|
*
|
|
151
152
|
* Example usage:
|
|
152
153
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CalendarMonthGrid: import('react').NamedExoticComponent<import('react').TableHTMLAttributes<HTMLTableElement>>;
|
|
@@ -63,8 +63,9 @@ export interface CommandMenuProps extends ComponentPropsWithoutRef<typeof Comman
|
|
|
63
63
|
* The command menu renders a menu of selectable items which can be filtered and
|
|
64
64
|
* sorted via a search query.
|
|
65
65
|
*
|
|
66
|
-
* Built on top of the [cmdk Command primitive](https://cmdk
|
|
67
|
-
* `MenuList`
|
|
66
|
+
* Built on top of the [cmdk Command primitive](https://github.com/dip/cmdk/)
|
|
67
|
+
* and the [`MenuList`
|
|
68
|
+
* component](https://ui.ostack.tech/?path=/docs/ostack-ui-data-display-menu-list--docs).
|
|
68
69
|
*
|
|
69
70
|
* It composes the following subcomponents:
|
|
70
71
|
*
|
|
@@ -187,6 +187,10 @@ export interface DataTableProps<T = any> extends ComponentPropsWithoutRef<"div">
|
|
|
187
187
|
* identifiers provided will have their selection checkboxes disabled).
|
|
188
188
|
*/
|
|
189
189
|
disabledSelections?: Key[];
|
|
190
|
+
/** Visually hidden label of the “select all rows” checkbox. */
|
|
191
|
+
selectAllRowsLabel?: ReactNode;
|
|
192
|
+
/** Visually hidden label of a “select row” checkbox. */
|
|
193
|
+
selectRowLabel?: ReactNode;
|
|
190
194
|
/**
|
|
191
195
|
* Function used to render each row. This function should typically return a
|
|
192
196
|
* `DataTableRow` with the provided properties. This function is useful to
|
|
@@ -16,6 +16,8 @@ export interface DataTableContextValue<T = any> {
|
|
|
16
16
|
dynamicRowHeight: boolean;
|
|
17
17
|
estimatedRowHeight: number | ((index: number) => number);
|
|
18
18
|
overscan: number;
|
|
19
|
+
selectAllRowsLabel?: ReactNode;
|
|
20
|
+
selectRowLabel?: ReactNode;
|
|
19
21
|
generatedId: string;
|
|
20
22
|
showAllRowsWhilePrinting?: boolean;
|
|
21
23
|
apiRef?: Ref<DataTableApi<T> | undefined>;
|
|
@@ -105,9 +107,11 @@ export interface UseCreateDataTableContextOptions<T> extends Omit<DataTableConte
|
|
|
105
107
|
selectedRows?: Key[];
|
|
106
108
|
onSelectedRowsChange?: (selectedRows: Key[]) => void;
|
|
107
109
|
disabledSelections?: Key[];
|
|
110
|
+
selectAllRowsLabel?: ReactNode;
|
|
111
|
+
selectRowLabel?: ReactNode;
|
|
108
112
|
}
|
|
109
113
|
/** Hook which creates the data table context value. */
|
|
110
|
-
export declare function useCreateDataTableContext<T>({ displayMode, columns, rows, getRows, rowKey, loadingCount, required, loading, renderRow, renderCell, dynamicRowHeight, estimatedRowHeight, overscan, showAllRowsWhilePrinting, apiRef, leafColumns, headCount, defaultOffset, offset, onOffsetChange, defaultLimit, limit, onLimitChange, defaultFilter, filter, onFilterChange, defaultSortBy, sortBy, defaultSortDirection, sortDirection, onSort, showSelectionColumn, defaultSelectedRows, selectedRows, onSelectedRowsChange, disabledSelections, }: UseCreateDataTableContextOptions<T>): {
|
|
114
|
+
export declare function useCreateDataTableContext<T>({ displayMode, columns, rows, getRows, rowKey, loadingCount, required, loading, renderRow, renderCell, dynamicRowHeight, estimatedRowHeight, overscan, showAllRowsWhilePrinting, apiRef, leafColumns, headCount, defaultOffset, offset, onOffsetChange, defaultLimit, limit, onLimitChange, defaultFilter, filter, onFilterChange, defaultSortBy, sortBy, defaultSortDirection, sortDirection, onSort, showSelectionColumn, defaultSelectedRows, selectedRows, onSelectedRowsChange, disabledSelections, selectAllRowsLabel, selectRowLabel, }: UseCreateDataTableContextOptions<T>): {
|
|
111
115
|
displayMode: DataTableDisplayMode;
|
|
112
116
|
rowKey: string | number | symbol | ((row: any) => Key);
|
|
113
117
|
required: boolean | undefined;
|
|
@@ -117,6 +121,8 @@ export declare function useCreateDataTableContext<T>({ displayMode, columns, row
|
|
|
117
121
|
dynamicRowHeight: boolean;
|
|
118
122
|
estimatedRowHeight: number | ((index: number) => number);
|
|
119
123
|
overscan: number;
|
|
124
|
+
selectAllRowsLabel: ReactNode;
|
|
125
|
+
selectRowLabel: ReactNode;
|
|
120
126
|
generatedId: string;
|
|
121
127
|
showAllRowsWhilePrinting: boolean | undefined;
|
|
122
128
|
apiRef: Ref<DataTableApi<any> | undefined> | undefined;
|
|
@@ -10,6 +10,8 @@ export interface DataTablePaginationProps extends ComponentPropsWithoutRef<"div"
|
|
|
10
10
|
* @param total Total number of rows.
|
|
11
11
|
*/
|
|
12
12
|
rowsRange?: (range: ReactNode, total: number) => ReactNode;
|
|
13
|
+
/** Label of the rows range select (only relevant in paged mode). */
|
|
14
|
+
rowsRangeSelectLabel?: (total: number) => string;
|
|
13
15
|
/** Label of the previous page button (only relevant in paged mode). */
|
|
14
16
|
previousPageButtonLabel?: string;
|
|
15
17
|
/** Label of the next page button (only relevant in paged mode). */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { DataTablePaginationProps } from './DataTablePagination.tsx';
|
|
3
3
|
/** Properties of the scrolled data table pagination. */
|
|
4
|
-
export interface PagedDataTablePaginationProps extends ComponentPropsWithoutRef<"div">, Pick<DataTablePaginationProps, "rowsRange" | "previousPageButtonLabel" | "nextPageButtonLabel" | "preferRightAlignment" | "previousPageButtonProps" | "nextPageButtonProps"> {
|
|
4
|
+
export interface PagedDataTablePaginationProps extends ComponentPropsWithoutRef<"div">, Pick<DataTablePaginationProps, "rowsRange" | "rowsRangeSelectLabel" | "previousPageButtonLabel" | "nextPageButtonLabel" | "preferRightAlignment" | "previousPageButtonProps" | "nextPageButtonProps"> {
|
|
5
5
|
}
|
|
6
6
|
/** Pagination component of the scrolled data table. */
|
|
7
7
|
export declare const PagedDataTablePagination: import('react').ForwardRefExoticComponent<PagedDataTablePaginationProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -5,7 +5,8 @@ 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`
|
|
8
|
+
* the [`Card`
|
|
9
|
+
* component](https://ui.ostack.tech/?path=/docs/ostack-ui-data-display-card--docs).
|
|
9
10
|
*
|
|
10
11
|
* It composes the following subcomponents:
|
|
11
12
|
*
|
|
@@ -8,7 +8,8 @@ export interface DropdownMenuProps extends Omit<ComponentPropsWithoutRef<typeof
|
|
|
8
8
|
*
|
|
9
9
|
* Built on top of the [Radix Dropdown Menu
|
|
10
10
|
* primitive](https://www.radix-ui.com/primitives/docs/components/dropdown-menu)
|
|
11
|
-
* and the `MenuList`
|
|
11
|
+
* and the [`MenuList`
|
|
12
|
+
* component](https://ui.ostack.tech/?path=/docs/ostack-ui-data-display-menu-list--docs).
|
|
12
13
|
*
|
|
13
14
|
* It composes the following subcomponents:
|
|
14
15
|
*
|
|
@@ -9,12 +9,41 @@ export interface FieldProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* The `Field` component
|
|
13
|
-
*
|
|
14
|
-
* input, with an associated `Label`, `HelperText`, and feedback such as errors
|
|
15
|
-
* or validation messages.
|
|
12
|
+
* The `Field` component acts as a container that associates a form control with
|
|
13
|
+
* a label, helper text, and validation feedback.
|
|
16
14
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* Use a `Label` to identify the control, a `HelperText` to provide additional
|
|
16
|
+
* guidance or descriptions, and `Feedback` to display error, warning, or
|
|
17
|
+
* success messages.
|
|
18
|
+
*
|
|
19
|
+
* It supports the following form controls:
|
|
20
|
+
*
|
|
21
|
+
* - `Checkbox`
|
|
22
|
+
* - `CheckboxGroup`
|
|
23
|
+
* - `DataTable`
|
|
24
|
+
* - `DateInput`
|
|
25
|
+
* - `DateRangeInput`
|
|
26
|
+
* - `NumericInput`
|
|
27
|
+
* - `Input`
|
|
28
|
+
* - `RadioGroup`
|
|
29
|
+
* - `Select`
|
|
30
|
+
* - `Table`
|
|
31
|
+
* - `TextArea`
|
|
32
|
+
*
|
|
33
|
+
* Example usage:
|
|
34
|
+
*
|
|
35
|
+
* ```tsx
|
|
36
|
+
* import { Field, HelperText, Label, Input } from "@ostack.tech/ui";
|
|
37
|
+
*
|
|
38
|
+
* function UsernameField() {
|
|
39
|
+
* return (
|
|
40
|
+
* <Field>
|
|
41
|
+
* <Label>Username</Label>
|
|
42
|
+
* <Input />
|
|
43
|
+
* <HelperText>May only contain alphanumeric characters.</HelperText>
|
|
44
|
+
* </Field>
|
|
45
|
+
* );
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
19
48
|
*/
|
|
20
49
|
export declare const Field: import('react').ForwardRefExoticComponent<FieldProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** Properties of the field provider component. */
|
|
3
|
+
export interface FieldProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Component providing the context necessary for auto-registration of labels,
|
|
8
|
+
* controls, helper text, and feedback.
|
|
9
|
+
*
|
|
10
|
+
* This is automatically done by the `Field` component, so they shouldn't be
|
|
11
|
+
* used together.
|
|
12
|
+
*/
|
|
13
|
+
export declare function FieldProvider({ children }: FieldProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export * from './Field.tsx';
|
|
2
2
|
export { type FieldActions, useFieldControlFocused, useFieldControlId, useFieldControlRequired, useFieldControlTagName, useFieldDescriptionIds, useFieldErrorMessageIds, useFieldLabel, useFieldLabelId, useOnFieldLabelChange, useSetFieldControl, useSetFieldControlFocused, useSetFieldFeedback, useSetFieldHelperText, useSetFieldLabel, } from './FieldContext.ts';
|
|
3
|
+
export * from './FieldProvider.tsx';
|
|
@@ -26,7 +26,9 @@ export interface HeadingOwnProps {
|
|
|
26
26
|
level?: HeadingLevel;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* Component used to render semantic HTML
|
|
29
|
+
* Component used to render semantic HTML headings. It is built on top of the
|
|
30
|
+
* browser's [`<h1>`–`<h6>` heading
|
|
31
|
+
* elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements).
|
|
30
32
|
*
|
|
31
33
|
* Example usage:
|
|
32
34
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
4
4
|
import { AccentColor } from '../../utils/accent.ts';
|
|
5
5
|
export type { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
6
6
|
/** Possible sizes of an icon. */
|
|
@@ -8,7 +8,7 @@ export type IconSize = "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
|
|
|
8
8
|
/** Possible colours of an icon. */
|
|
9
9
|
export type IconColor = AccentColor;
|
|
10
10
|
/** Properties of the icon component. */
|
|
11
|
-
export interface IconProps extends Omit<ComponentPropsWithoutRef<typeof FontAwesomeIcon>, "icon" | "size"
|
|
11
|
+
export interface IconProps extends Omit<ComponentPropsWithoutRef<typeof FontAwesomeIcon>, "icon" | "size"> {
|
|
12
12
|
/** Icon to display. */
|
|
13
13
|
icon: IconProp;
|
|
14
14
|
/**
|
|
@@ -27,15 +27,14 @@ export interface IconProps extends Omit<ComponentPropsWithoutRef<typeof FontAwes
|
|
|
27
27
|
* When provided, a visually hidden label is added so that assistive
|
|
28
28
|
* technologies correctly announce it.
|
|
29
29
|
*/
|
|
30
|
-
label?:
|
|
31
|
-
flip?: boolean | FlipProp;
|
|
30
|
+
label?: ReactNode;
|
|
32
31
|
}
|
|
33
32
|
/**
|
|
34
33
|
* Icon component extending the FontAwesome's `FontAwesomeIcon` component.
|
|
35
34
|
*
|
|
36
35
|
* Properties supported by FontAwesome are also supported by this component. For
|
|
37
36
|
* more information on all supported properties, see [FontAwesome's React
|
|
38
|
-
* documentation](https://docs.fontawesome.com/
|
|
37
|
+
* documentation](https://docs.fontawesome.com/web/use-with/react/).
|
|
39
38
|
*
|
|
40
39
|
* For a list of existing icons, consult:
|
|
41
40
|
* https://fontawesome.com/search?ic=free.
|
|
@@ -149,6 +149,13 @@ export interface IconButtonOwnProps {
|
|
|
149
149
|
* A `label` property is required for screen-readers to give meaning to the
|
|
150
150
|
* button. This label is also, by default, displayed as a tooltip.
|
|
151
151
|
*
|
|
152
|
+
* Built on top of the browser's [`<button>`
|
|
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).
|
|
158
|
+
*
|
|
152
159
|
* Example usage:
|
|
153
160
|
*
|
|
154
161
|
* ```tsx
|
|
@@ -123,8 +123,8 @@ export interface InputPropsBase {
|
|
|
123
123
|
* ```tsx
|
|
124
124
|
* import { Input } from "@ostack.tech/ui";
|
|
125
125
|
*
|
|
126
|
-
* function
|
|
127
|
-
* return <Input placeholder="
|
|
126
|
+
* function UsernameInput() {
|
|
127
|
+
* return <Input placeholder="Enter username…" />;
|
|
128
128
|
* }
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
@@ -9,7 +9,22 @@ export interface KeyboardProps extends ComponentPropsWithoutRef<"kbd"> {
|
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* Component
|
|
13
|
-
*
|
|
12
|
+
* Component which represents a span of inline text denoting textual user input
|
|
13
|
+
* from a keyboard, voice input, or any other text entry device. It is built on
|
|
14
|
+
* top of the browser's [`<kbd>` (keyboard input)
|
|
15
|
+
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/kbd).
|
|
16
|
+
*
|
|
17
|
+
* Example usage:
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* function BookmarkInstructions() {
|
|
21
|
+
* return (
|
|
22
|
+
* <>
|
|
23
|
+
* Press <Keyboard>Ctrl</Keyboard> + <Keyboard>D</Keyboard> to
|
|
24
|
+
* bookmark this page.
|
|
25
|
+
* </>
|
|
26
|
+
* );
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
14
29
|
*/
|
|
15
30
|
export declare const Keyboard: import('react').ForwardRefExoticComponent<KeyboardProps & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -5,9 +5,9 @@ import { Input } from '../Input';
|
|
|
5
5
|
export interface NumericInputProps extends NumericTransformerOptions, Omit<ComponentPropsWithoutRef<typeof Input>, "defaultValue" | "value" | "onValueChange" | "type" | "min" | "max"> {
|
|
6
6
|
type?: "text" | "tel" | "password";
|
|
7
7
|
/** Numeric input's default value. */
|
|
8
|
-
defaultValue?: string | number | null;
|
|
8
|
+
defaultValue?: string | number | bigint | null;
|
|
9
9
|
/** Numeric input's controlled value. */
|
|
10
|
-
value?: string | number | null;
|
|
10
|
+
value?: string | number | bigint | null;
|
|
11
11
|
/**
|
|
12
12
|
* Function called whenever the value of the numeric input changes.
|
|
13
13
|
*
|
|
@@ -34,28 +34,28 @@ export interface NumericInputProps extends NumericTransformerOptions, Omit<Compo
|
|
|
34
34
|
* `"999 999,99 €"`, i.e. `valueIsUnformattedString` has no effect on this
|
|
35
35
|
* property.
|
|
36
36
|
*/
|
|
37
|
-
min?: string | number | null;
|
|
37
|
+
min?: string | number | bigint | null;
|
|
38
38
|
/**
|
|
39
39
|
* Maximum number allowed. If a string is provided, it should **not** be the
|
|
40
40
|
* formatted representation, e.g. `"999999.99" should be provided instead of
|
|
41
41
|
* `"999 999,99 €"`, i.e. `valueIsUnformattedString` has no effect on this
|
|
42
42
|
* property.
|
|
43
43
|
*/
|
|
44
|
-
max?: string | number | null;
|
|
44
|
+
max?: string | number | bigint | null;
|
|
45
45
|
/**
|
|
46
46
|
* Value that the number should be greater than. If a string is provided, it
|
|
47
47
|
* should **not** be the formatted representation, e.g. `"999999.99" should be
|
|
48
48
|
* provided instead of `"999 999,99 €"`, i.e. `valueIsUnformattedString` has
|
|
49
49
|
* no effect on this property.
|
|
50
50
|
*/
|
|
51
|
-
exclusiveMin?: string | number | null;
|
|
51
|
+
exclusiveMin?: string | number | bigint | null;
|
|
52
52
|
/**
|
|
53
53
|
* Value that the number should be less than. If a string is provided, it
|
|
54
54
|
* should **not** be the formatted representation, e.g. `"999999.99" should be
|
|
55
55
|
* provided instead of `"999 999,99 €"`, i.e. `valueIsUnformattedString` has
|
|
56
56
|
* no effect on this property.
|
|
57
57
|
*/
|
|
58
|
-
exclusiveMax?: string | number | null;
|
|
58
|
+
exclusiveMax?: string | number | bigint | null;
|
|
59
59
|
/**
|
|
60
60
|
* Whether the numeric value should be allowed.
|
|
61
61
|
*
|
|
@@ -73,14 +73,27 @@ export interface NumericValueRepresentations {
|
|
|
73
73
|
numberValue: number | null;
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
|
-
* The
|
|
77
|
-
*
|
|
78
|
-
*
|
|
76
|
+
* The numeric input component is used to collect numeric user input. It is
|
|
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`
|
|
80
|
+
* library](https://s-yadav.github.io/react-number-format/).
|
|
79
81
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* `
|
|
82
|
+
* It supports specifying the precision, scale, separators, grouping of digits,
|
|
83
|
+
* restrictions, or affixes of a number.
|
|
84
|
+
*
|
|
85
|
+
* For accessibility purposes, numeric inputs are usually included within a
|
|
86
|
+
* `Field` together with a `Label` and optionally `HelperText` and/or
|
|
87
|
+
* `Feedback`.
|
|
88
|
+
*
|
|
89
|
+
* Example usage:
|
|
90
|
+
*
|
|
91
|
+
* ```tsx
|
|
92
|
+
* import { NumericInput } from "@ostack.tech/ui";
|
|
93
|
+
*
|
|
94
|
+
* function NumberOfTickets() {
|
|
95
|
+
* return <NumericInput placeholder="Enter number of tickets…" />;
|
|
96
|
+
* }
|
|
97
|
+
* ```
|
|
85
98
|
*/
|
|
86
99
|
export declare const NumericInput: import('react').ForwardRefExoticComponent<NumericInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -87,8 +87,8 @@ export type SelectProps = SelectSingleProps | SelectMultipleProps;
|
|
|
87
87
|
* Control which displays a menu of options for the user to pick from. Provides
|
|
88
88
|
* an alternative to the browser's [`<select>`
|
|
89
89
|
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/select)
|
|
90
|
-
*
|
|
91
|
-
*
|
|
90
|
+
* while also allowing users to search for options. It is built on top of the
|
|
91
|
+
* `Input`, `Popover`, and `CommandMenu` components.
|
|
92
92
|
*
|
|
93
93
|
* It supports the selection of more than one option by setting the `multiple`
|
|
94
94
|
* property.
|
|
@@ -23,6 +23,9 @@ export interface TabsProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrim
|
|
|
23
23
|
*
|
|
24
24
|
* The `value` set on each tab should match the `value` of its content.
|
|
25
25
|
*
|
|
26
|
+
* Built on top of the [Radix Tabs
|
|
27
|
+
* primitive](https://radix-ui.com/primitives/docs/components/tabs).
|
|
28
|
+
*
|
|
26
29
|
* It composes the following subcomponents:
|
|
27
30
|
*
|
|
28
31
|
* - `TabList`: A container holding the list of tabs.
|
|
@@ -4,18 +4,21 @@ import { InputPropsBase } from '../Input';
|
|
|
4
4
|
export interface TextAreaProps extends Omit<InputPropsBase, "asChild" | "children">, ComponentPropsWithoutRef<"textarea"> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* The
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* The text area component is used to collect multi-line user input. It is built
|
|
8
|
+
* on top of the browser's [`<textarea>`
|
|
9
|
+
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/textarea).
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* can be combined with the `Field` component for better structure and
|
|
14
|
-
* accessibility. The `Field` ensures proper associations between the `Label`,
|
|
15
|
-
* `TextArea`, and related elements like `HelperText`, improving usability and
|
|
16
|
-
* accessibility for users.
|
|
11
|
+
* For accessibility purposes, text areas are usually included within a `Field`
|
|
12
|
+
* together with a `Label` and optionally `HelperText` and/or `Feedback`.
|
|
17
13
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
14
|
+
* Example usage:
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { TextArea } from "@ostack.tech/ui";
|
|
18
|
+
*
|
|
19
|
+
* function CommentArea() {
|
|
20
|
+
* return <TextArea placeholder="Leave a comment…" />;
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
20
23
|
*/
|
|
21
24
|
export declare const TextArea: import('react').ForwardRefExoticComponent<TextAreaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -12,14 +12,18 @@ export interface TooltipProps extends Omit<ComponentPropsWithoutRef<typeof Toolt
|
|
|
12
12
|
showArrow?: boolean;
|
|
13
13
|
/** Tooltip's trigger element. */
|
|
14
14
|
children: ReactElement;
|
|
15
|
-
/**
|
|
15
|
+
/** Default open state of the tooltip. */
|
|
16
16
|
defaultOpen?: boolean;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Controlled open state of the tooltip.
|
|
19
|
+
*
|
|
20
|
+
* Use together with `onOpenChange`.
|
|
20
21
|
*/
|
|
21
22
|
open?: boolean;
|
|
22
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Function called when the open state of the tooltip changes. Use it to
|
|
25
|
+
* control the tooltip's open state together with the `open` property.
|
|
26
|
+
*/
|
|
23
27
|
onOpenChange?: (open: boolean) => void;
|
|
24
28
|
/**
|
|
25
29
|
* Override the duration given to the `TooltipProvider` to customise the open
|
|
@@ -39,17 +43,24 @@ export interface TooltipProps extends Omit<ComponentPropsWithoutRef<typeof Toolt
|
|
|
39
43
|
arrowProps?: ComponentPropsWithRef<typeof TooltipPrimitive.Arrow>;
|
|
40
44
|
}
|
|
41
45
|
/**
|
|
42
|
-
* The
|
|
43
|
-
*
|
|
44
|
-
*
|
|
46
|
+
* The tooltip component displays a popup containing information related to an
|
|
47
|
+
* element when the user focuses or hovers over it.
|
|
48
|
+
*
|
|
49
|
+
* Built on top of the [Radix Tooltip
|
|
50
|
+
* primitive](https://www.radix-ui.com/primitives/docs/components/tooltip).
|
|
51
|
+
*
|
|
52
|
+
* Example usage:
|
|
45
53
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* application. Developers typically don't need to configure it manually, as the
|
|
49
|
-
* default setup handles delay times and interactions seamlessly.
|
|
54
|
+
* ```tsx
|
|
55
|
+
* import { Button, Tooltip } from "@ostack.tech/ui";
|
|
50
56
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
57
|
+
* function BookmarkButton() {}
|
|
58
|
+
* return (
|
|
59
|
+
* <Tooltip content="Save for later…">
|
|
60
|
+
* <Button>Bookmark</Button>
|
|
61
|
+
* </Tooltip>
|
|
62
|
+
* );
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
54
65
|
*/
|
|
55
66
|
export declare const Tooltip: import('react').ForwardRefExoticComponent<TooltipProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -3,7 +3,7 @@ import { CalendarProps } from '../../components/Calendar';
|
|
|
3
3
|
import { CloseButtonProps } from '../../components/CloseButton';
|
|
4
4
|
import { CommandMenuDialogProps, CommandMenuProps } from '../../components/CommandMenu';
|
|
5
5
|
import { ControlCodeProps } from '../../components/ControlCode';
|
|
6
|
-
import { DataTableContentProps, DataTableFilterProps, DataTablePaginationProps, DataTableRowsPerPageProps } from '../../components/DataTable';
|
|
6
|
+
import { DataTableContentProps, DataTableFilterProps, DataTablePaginationProps, DataTableProps, DataTableRowsPerPageProps } from '../../components/DataTable';
|
|
7
7
|
import { DateInputProps } from '../../components/DateInput';
|
|
8
8
|
import { DateRangeInputProps } from '../../components/DateRangeInput';
|
|
9
9
|
import { ErrorBoundaryProps } from '../../components/ErrorBoundary';
|
|
@@ -31,9 +31,10 @@ export interface LocalizationObject {
|
|
|
31
31
|
CommandMenuDialog: Pick<CommandMenuDialogProps, "title" | "description">;
|
|
32
32
|
ConfirmDialog: Pick<ConfirmDialogOptions, "okText" | "cancelText">;
|
|
33
33
|
ControlCode: Pick<ControlCodeProps, "visuallyHiddenPrefix">;
|
|
34
|
-
DataTable: Pick<
|
|
34
|
+
DataTable: Pick<DataTableProps, "selectAllRowsLabel" | "selectRowLabel">;
|
|
35
|
+
DataTableContent: Pick<DataTableContentProps, "emptyMessage">;
|
|
35
36
|
DataTableFilter: Pick<DataTableFilterProps, "aria-label" | "placeholder">;
|
|
36
|
-
DataTablePagination: Pick<DataTablePaginationProps, "rowsRange" | "previousPageButtonLabel" | "nextPageButtonLabel">;
|
|
37
|
+
DataTablePagination: Pick<DataTablePaginationProps, "aria-label" | "rowsRange" | "rowsRangeSelectLabel" | "previousPageButtonLabel" | "nextPageButtonLabel">;
|
|
37
38
|
DataTableRowsPerPage: Pick<DataTableRowsPerPageProps, "label">;
|
|
38
39
|
DateInput: Pick<DateInputProps, "format" | "announcedFormat" | "placeholder" | "formatDescription" | "selectedDateDescription" | "calendarButtonLabel">;
|
|
39
40
|
DateRangeInput: Pick<DateRangeInputProps, "startInputLabel" | "endInputLabel" | "selectedDateRangeDescription" | "calendarButtonLabel">;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Converts a
|
|
2
|
+
* Converts a numeric value to a string, removing exponential notation. Nullish
|
|
3
3
|
* or `NaN` values become the empty string.
|
|
4
4
|
*/
|
|
5
|
-
export declare function numericToString(v: string | number | null | undefined): string;
|
|
5
|
+
export declare function numericToString(v: string | number | bigint | null | undefined): string;
|
|
6
6
|
/** Whether a numeric string represents a negative number. */
|
|
7
7
|
export declare function isNumericStringNegative(v: string): boolean;
|
|
8
8
|
/** Whether a numeric string represents the `null` value. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ostack.tech/ui",
|
|
3
3
|
"description": "ostack/UI component library.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.10.1",
|
|
5
5
|
"homepage": "https://ui.ostack.tech/",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Opensoft",
|
|
@@ -38,9 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
40
|
"clean": "rimraf dist/ scss/",
|
|
41
|
-
"build": "
|
|
42
|
-
"build:js": "vite build",
|
|
43
|
-
"build:css": "npm run copy:scss && sass -I ../../node_modules/ scss/index.scss dist/ostack-ui.css",
|
|
41
|
+
"build": "vite build && npm run copy:scss",
|
|
44
42
|
"copy:scss": "cpy 'src/**/*.scss' '!src/**/*.stories.scss' scss/"
|
|
45
43
|
},
|
|
46
44
|
"dependencies": {
|
|
@@ -6,7 +6,7 @@ $code-padding-x: spacing(1) !default;
|
|
|
6
6
|
$code-border-radius: var(--#{$prefix}border-radius-sm) !default;
|
|
7
7
|
$code-font-family: var(--#{$prefix}font-family-code) !default;
|
|
8
8
|
$code-font-weight: $font-weight-normal !default;
|
|
9
|
-
$code-font-size: 0.
|
|
9
|
+
$code-font-size: 0.875em !default;
|
|
10
10
|
$code-line-height: 1.25 !default;
|
|
11
11
|
$code-background-color: var(--#{$prefix}accent-a3) !default;
|
|
12
12
|
$code-color: var(--#{$prefix}accent-a11) !default;
|
|
@@ -13,9 +13,15 @@ $data-table-filter-max-width: 250px !default;
|
|
|
13
13
|
|
|
14
14
|
// Rows per page
|
|
15
15
|
$data-table-rows-per-page-gap-x: spacing(1) !default;
|
|
16
|
+
$data-table-rows-per-page-font-size: var(--#{$prefix}font-size-sm) !default;
|
|
17
|
+
$data-table-rows-per-page-line-height: var(--#{$prefix}line-height-sm) !default;
|
|
18
|
+
$data-table-rows-per-page-font-weight: $font-weight-normal !default;
|
|
16
19
|
|
|
17
20
|
// Pagination
|
|
18
21
|
$data-table-pagination-gap-x: spacing(2) !default;
|
|
22
|
+
$data-table-pagination-font-size: var(--#{$prefix}font-size-sm) !default;
|
|
23
|
+
$data-table-pagination-line-height: var(--#{$prefix}line-height-sm) !default;
|
|
24
|
+
$data-table-pagination-font-weight: null !default;
|
|
19
25
|
|
|
20
26
|
// Pagination arrows
|
|
21
27
|
$data-table-pagination-arrows-gap-x: spacing(1) !default;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
@use "../../scss/utils/breakpoints" as *;
|
|
5
5
|
@use "../../scss/utils/spacing" as *;
|
|
6
6
|
@use "../../scss/utils/transition" as *;
|
|
7
|
+
@use "../../scss/utils/maybe-important" as *;
|
|
7
8
|
|
|
8
9
|
.#{$prefix}data-table {
|
|
9
10
|
$data-table: &;
|
|
@@ -48,6 +49,9 @@
|
|
|
48
49
|
|
|
49
50
|
&__rows-per-page-label {
|
|
50
51
|
margin-right: $data-table-rows-per-page-gap-x;
|
|
52
|
+
font-size: $data-table-rows-per-page-font-size;
|
|
53
|
+
line-height: $data-table-rows-per-page-line-height;
|
|
54
|
+
font-weight: maybe-important($data-table-rows-per-page-font-weight);
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
&__rows-per-page-select-root,
|
|
@@ -59,6 +63,9 @@
|
|
|
59
63
|
display: flex;
|
|
60
64
|
flex-wrap: wrap;
|
|
61
65
|
align-items: center;
|
|
66
|
+
font-size: $data-table-pagination-font-size;
|
|
67
|
+
line-height: $data-table-pagination-line-height;
|
|
68
|
+
font-weight: $data-table-pagination-font-weight;
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
&__pagination-arrows {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
@use "../../scss/utils/spacing" as *;
|
|
3
3
|
@use "../../scss/utils/css-color-functions" as *;
|
|
4
4
|
|
|
5
|
-
$keyboard-padding:
|
|
5
|
+
$keyboard-padding: 1px 0.25em 0 !default;
|
|
6
6
|
$keyboard-border-radius: var(--#{$prefix}border-radius-sm) !default;
|
|
7
7
|
|
|
8
8
|
$keyboard-font-family: var(--#{$prefix}font-family-code) !default;
|
|
9
9
|
$keyboard-font-weight: $font-weight-normal !default;
|
|
10
10
|
$keyboard-font-size: 0.875em !default;
|
|
11
|
-
$keyboard-line-height: 1 !default;
|
|
11
|
+
$keyboard-line-height: 1.25 !default;
|
|
12
12
|
$keyboard-word-wrap: break-word !default;
|
|
13
13
|
|
|
14
14
|
$keyboard-border-width: 1px 1px 2px !default;
|