@ostack.tech/ui 0.9.1 → 0.10.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.
- package/dist/chunks/{en-Dem8nwZz.js → en-DwZKZVGL.js} +16 -3
- 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 +15 -2
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/pt-PT.js +15 -2
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui.css +59 -49
- package/dist/ostack-ui.js +1953 -939
- package/dist/ostack-ui.js.map +1 -1
- package/dist/types/components/Alert/Alert.d.ts +17 -0
- package/dist/types/components/Alert/AlertContext.d.ts +8 -0
- 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 +4 -3
- package/dist/types/components/CommandMenu/CommandMenuGroup.d.ts +1 -1
- package/dist/types/components/CommandMenu/CommandMenuItem.d.ts +1 -1
- package/dist/types/components/CommandMenu/cmdk/command-score.d.ts +1 -0
- package/dist/types/components/CommandMenu/cmdk/index.d.ts +320 -0
- 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 +11 -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/RadioGroup/RadioGroup.d.ts +5 -0
- package/dist/types/components/Select/Select.d.ts +8 -4
- package/dist/types/components/Select/SelectContext.d.ts +3 -1
- 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 +7 -4
- package/dist/types/utils/numericStringUtils.d.ts +2 -2
- package/package.json +2 -5
- package/scss/components/Code/_Code-variables.scss +1 -1
- package/scss/components/CommandMenu/_CommandMenu.scss +1 -7
- 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/DropdownMenu/_DropdownMenu.scss +3 -3
- package/scss/components/Keyboard/_Keyboard-variables.scss +2 -2
- package/scss/components/Keyboard/_Keyboard.scss +1 -0
- package/scss/components/MenuList/_MenuList.scss +3 -3
- package/scss/components/Select/_Select-variables.scss +4 -0
- package/scss/components/Select/_Select.scss +6 -0
- package/scss/components/Tag/_Tag-variables.scss +1 -1
- 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/placeholders/menu/_menu-variables.scss +24 -15
- package/scss/scss/placeholders/menu/_menu.scss +1 -3
- package/scss/scss/placeholders/notification/_notification-variables.scss +2 -2
- package/scss/scss/placeholders/notification/_notification.scss +1 -0
- package/scss/scss/utils/_animation.scss +0 -104
- package/scss/scss/utils/_spinner.scss +2 -7
- package/dist/chunks/en-Dem8nwZz.js.map +0 -1
- package/dist/ostack-ui.css.map +0 -1
|
@@ -6,6 +6,8 @@ import { Icon, IconProp } from '../Icon';
|
|
|
6
6
|
export type AlertVariant = "solid" | "subtle" | "outlined";
|
|
7
7
|
/** Alert severities. */
|
|
8
8
|
export type AlertSeverity = "neutral" | "info" | "success" | "danger" | "warning";
|
|
9
|
+
/** Alert type of announcement. */
|
|
10
|
+
export type AlertAnnounce = "off" | "polite" | "assertive";
|
|
9
11
|
/** Properties of the alert component. */
|
|
10
12
|
export interface AlertProps extends ComponentPropsWithoutRef<"div"> {
|
|
11
13
|
/**
|
|
@@ -20,6 +22,21 @@ export interface AlertProps extends ComponentPropsWithoutRef<"div"> {
|
|
|
20
22
|
* @default info
|
|
21
23
|
*/
|
|
22
24
|
severity?: AlertSeverity;
|
|
25
|
+
/**
|
|
26
|
+
* Controls how the alert is announced to screen reader users:
|
|
27
|
+
*
|
|
28
|
+
* - `off`: The alert is silent. Recommended for static messages.
|
|
29
|
+
* - `polite`: Sets `role="status"`. The screen reader will announce the alert
|
|
30
|
+
* at the next available opportunity without interrupting the user
|
|
31
|
+
* (recommended for non-critical feedback that appears _after_ a user
|
|
32
|
+
* action).
|
|
33
|
+
* - `assertive`: Sets `role="alert"`. The screen reader will interrupt any
|
|
34
|
+
* current speech to announce this immediately (recommended for critical
|
|
35
|
+
* errors that appear and should stop the user's flow).
|
|
36
|
+
*
|
|
37
|
+
* @default off
|
|
38
|
+
*/
|
|
39
|
+
announce?: AlertAnnounce;
|
|
23
40
|
/** Alert action. */
|
|
24
41
|
action?: ReactNode;
|
|
25
42
|
/**
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Value of the alert context. */
|
|
2
|
+
export interface AlertContextValue {
|
|
3
|
+
setTitleId: (id: string | undefined) => void;
|
|
4
|
+
}
|
|
5
|
+
/** Alert context. */
|
|
6
|
+
export declare const AlertContext: import('react').Context<AlertContextValue | null>;
|
|
7
|
+
/** Hook providing access to the alert context. */
|
|
8
|
+
export declare function useAlertContext(): AlertContextValue;
|
|
@@ -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>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
1
|
import { ComponentPropsWithoutRef, ComponentPropsWithRef, ReactNode } from 'react';
|
|
3
2
|
import { ControlAddon } from '../ControlAddon';
|
|
4
3
|
import { Icon } from '../Icon';
|
|
5
4
|
import { Input } from '../Input';
|
|
6
5
|
import { MenuList, MenuListIconPlacement, MenuListVariant } from '../MenuList';
|
|
7
6
|
import { Spinner } from '../Spinner';
|
|
7
|
+
import { Command as CommandPrimitive } from './cmdk';
|
|
8
8
|
/** Command menu variants. */
|
|
9
9
|
export type CommandMenuVariant = MenuListVariant;
|
|
10
10
|
/** Placement of icons within command menu items. */
|
|
@@ -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
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { Command as CommandPrimitive } from './cmdk';
|
|
3
3
|
/** Properties of the command menu group. */
|
|
4
4
|
export interface CommandMenuGroupProps extends Omit<ComponentPropsWithoutRef<typeof CommandPrimitive.Group>, "asChild" | "heading"> {
|
|
5
5
|
/** Optional label of the command menu group. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
2
|
import { MenuListItemProps } from '../MenuList';
|
|
3
|
+
import { Command as CommandPrimitive } from './cmdk';
|
|
4
4
|
export interface CommandMenuItemProps extends Omit<ComponentPropsWithoutRef<typeof CommandPrimitive.Item>, "asChild" | "color">, Pick<MenuListItemProps, "selected" | "color" | "loading" | "loadingContent" | "showSpinner" | "icon" | "iconPlacement" | "keybinds" | "href" | "target" | "rel" | "actionProps" | "contentProps" | "iconProps" | "spinnerProps" | "keybindsProps"> {
|
|
5
5
|
/**
|
|
6
6
|
* Render the item as a link. When set, you can pass `href`, `target`, and
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function commandScore(string: string, abbreviation: string, aliases: string[]): number;
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type Children = {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
type DivProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
6
|
+
/**
|
|
7
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
8
|
+
* This will merge the original component props with the props of the supplied
|
|
9
|
+
* element/component and change the underlying DOM node.
|
|
10
|
+
*/
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type CommandFilter = (value: string, search: string, keywords?: string[]) => number;
|
|
14
|
+
type State = {
|
|
15
|
+
search: string;
|
|
16
|
+
value: string;
|
|
17
|
+
selectedItemId?: string;
|
|
18
|
+
filtered: {
|
|
19
|
+
count: number;
|
|
20
|
+
items: Map<string, number>;
|
|
21
|
+
groups: Set<string>;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type Group = {
|
|
25
|
+
id: string;
|
|
26
|
+
forceMount?: boolean;
|
|
27
|
+
};
|
|
28
|
+
declare const defaultFilter: CommandFilter;
|
|
29
|
+
declare const Command: React.ForwardRefExoticComponent<Children & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
30
|
+
/**
|
|
31
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
32
|
+
* This will merge the original component props with the props of the supplied
|
|
33
|
+
* element/component and change the underlying DOM node.
|
|
34
|
+
*/
|
|
35
|
+
asChild?: boolean;
|
|
36
|
+
} & {
|
|
37
|
+
/** Accessible label for this command menu. Not shown visibly. */
|
|
38
|
+
label?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Optionally set to `false` to turn off the automatic filtering and
|
|
41
|
+
* sorting. If `false`, you must conditionally render valid items based on
|
|
42
|
+
* the search query yourself.
|
|
43
|
+
*/
|
|
44
|
+
shouldFilter?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Custom filter function for whether each command menu item should matches
|
|
47
|
+
* the given search query. It should return a number between 0 and 1, with 1
|
|
48
|
+
* being the best match and 0 being hidden entirely. By default, uses the
|
|
49
|
+
* `command-score` library.
|
|
50
|
+
*/
|
|
51
|
+
filter?: CommandFilter;
|
|
52
|
+
/** Optional default item value when it is initially rendered. */
|
|
53
|
+
defaultValue?: string;
|
|
54
|
+
/** Optional controlled state of the selected command menu item. */
|
|
55
|
+
value?: string;
|
|
56
|
+
/** Event handler called when the selected item of the menu changes. */
|
|
57
|
+
onValueChange?: (value: string) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Optionally set to `true` to turn on looping around when using the arrow
|
|
60
|
+
* keys.
|
|
61
|
+
*/
|
|
62
|
+
loop?: boolean;
|
|
63
|
+
/** Optionally set to `true` to disable selection via pointer events. */
|
|
64
|
+
disablePointerSelection?: boolean;
|
|
65
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
/**
|
|
67
|
+
* Command menu item. Becomes active on pointer enter or through keyboard
|
|
68
|
+
* navigation. Preferably pass a `value`, otherwise the value will be inferred
|
|
69
|
+
* from `children` or the rendered item's `textContent`.
|
|
70
|
+
*/
|
|
71
|
+
declare const Item: React.ForwardRefExoticComponent<Children & Omit<DivProps, "disabled" | "value" | "onSelect"> & {
|
|
72
|
+
/** Whether this item is currently disabled. */
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Event handler for when this item is selected, either via click or
|
|
76
|
+
* keyboard selection.
|
|
77
|
+
*/
|
|
78
|
+
onSelect?: (value: string) => void;
|
|
79
|
+
/**
|
|
80
|
+
* A unique value for this item. If no value is provided, it will be
|
|
81
|
+
* inferred from `children` or the rendered `textContent`. If your
|
|
82
|
+
* `textContent` changes between renders, you _must_ provide a stable,
|
|
83
|
+
* unique `value`.
|
|
84
|
+
*/
|
|
85
|
+
value?: string;
|
|
86
|
+
/** Optional keywords to match against when filtering. */
|
|
87
|
+
keywords?: string[];
|
|
88
|
+
/** Whether this item is forcibly rendered regardless of filtering. */
|
|
89
|
+
forceMount?: boolean;
|
|
90
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
91
|
+
/**
|
|
92
|
+
* Group command menu items together with a heading. Grouped items are always
|
|
93
|
+
* shown together.
|
|
94
|
+
*/
|
|
95
|
+
declare const Group: React.ForwardRefExoticComponent<Children & Omit<DivProps, "value" | "heading"> & {
|
|
96
|
+
/** Optional heading to render for this group. */
|
|
97
|
+
heading?: React.ReactNode;
|
|
98
|
+
/**
|
|
99
|
+
* If no heading is provided, you must provide a value that is unique for
|
|
100
|
+
* this group.
|
|
101
|
+
*/
|
|
102
|
+
value?: string;
|
|
103
|
+
/** Whether this group is forcibly rendered regardless of filtering. */
|
|
104
|
+
forceMount?: boolean;
|
|
105
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
106
|
+
/**
|
|
107
|
+
* A visual and semantic separator between items or groups. Visible when the
|
|
108
|
+
* search query is empty or `alwaysRender` is true, hidden otherwise.
|
|
109
|
+
*/
|
|
110
|
+
declare const Separator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
111
|
+
/**
|
|
112
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
113
|
+
* This will merge the original component props with the props of the supplied
|
|
114
|
+
* element/component and change the underlying DOM node.
|
|
115
|
+
*/
|
|
116
|
+
asChild?: boolean;
|
|
117
|
+
} & {
|
|
118
|
+
/**
|
|
119
|
+
* Whether this separator should always be rendered. Useful if you disable
|
|
120
|
+
* automatic filtering.
|
|
121
|
+
*/
|
|
122
|
+
alwaysRender?: boolean;
|
|
123
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
124
|
+
/**
|
|
125
|
+
* Command menu input. All props are forwarded to the underyling `input`
|
|
126
|
+
* element.
|
|
127
|
+
*/
|
|
128
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type" | "value" | "onChange"> & {
|
|
129
|
+
/**
|
|
130
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
131
|
+
* This will merge the original component props with the props of the supplied
|
|
132
|
+
* element/component and change the underlying DOM node.
|
|
133
|
+
*/
|
|
134
|
+
asChild?: boolean;
|
|
135
|
+
/** Optional controlled state for the value of the search input. */
|
|
136
|
+
value?: string;
|
|
137
|
+
/** Event handler called when the search value changes. */
|
|
138
|
+
onValueChange?: (search: string) => void;
|
|
139
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
140
|
+
/**
|
|
141
|
+
* Contains `Item`, `Group`, and `Separator`. Use the `--cmdk-list-height` CSS
|
|
142
|
+
* variable to animate height based on the number of results.
|
|
143
|
+
*/
|
|
144
|
+
declare const List: React.ForwardRefExoticComponent<Children & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
145
|
+
/**
|
|
146
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
147
|
+
* This will merge the original component props with the props of the supplied
|
|
148
|
+
* element/component and change the underlying DOM node.
|
|
149
|
+
*/
|
|
150
|
+
asChild?: boolean;
|
|
151
|
+
} & {
|
|
152
|
+
/** Accessible label for this List of suggestions. Not shown visibly. */
|
|
153
|
+
label?: string;
|
|
154
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
155
|
+
/** Automatically renders when there are no results for the search query. */
|
|
156
|
+
declare const Empty: React.ForwardRefExoticComponent<Children & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
157
|
+
/**
|
|
158
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
159
|
+
* This will merge the original component props with the props of the supplied
|
|
160
|
+
* element/component and change the underlying DOM node.
|
|
161
|
+
*/
|
|
162
|
+
asChild?: boolean;
|
|
163
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
164
|
+
/**
|
|
165
|
+
* You should conditionally render this with `progress` while loading
|
|
166
|
+
* asynchronous items.
|
|
167
|
+
*/
|
|
168
|
+
declare const Loading: React.ForwardRefExoticComponent<Children & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
169
|
+
/**
|
|
170
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
171
|
+
* This will merge the original component props with the props of the supplied
|
|
172
|
+
* element/component and change the underlying DOM node.
|
|
173
|
+
*/
|
|
174
|
+
asChild?: boolean;
|
|
175
|
+
} & {
|
|
176
|
+
/** Estimated progress of loading asynchronous options. */
|
|
177
|
+
progress?: number;
|
|
178
|
+
/** Accessible label for this loading progressbar. Not shown visibly. */
|
|
179
|
+
label?: string;
|
|
180
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
181
|
+
declare const pkg: React.ForwardRefExoticComponent<Children & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
182
|
+
/**
|
|
183
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
184
|
+
* This will merge the original component props with the props of the supplied
|
|
185
|
+
* element/component and change the underlying DOM node.
|
|
186
|
+
*/
|
|
187
|
+
asChild?: boolean;
|
|
188
|
+
} & {
|
|
189
|
+
/** Accessible label for this command menu. Not shown visibly. */
|
|
190
|
+
label?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Optionally set to `false` to turn off the automatic filtering and
|
|
193
|
+
* sorting. If `false`, you must conditionally render valid items based on
|
|
194
|
+
* the search query yourself.
|
|
195
|
+
*/
|
|
196
|
+
shouldFilter?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Custom filter function for whether each command menu item should matches
|
|
199
|
+
* the given search query. It should return a number between 0 and 1, with 1
|
|
200
|
+
* being the best match and 0 being hidden entirely. By default, uses the
|
|
201
|
+
* `command-score` library.
|
|
202
|
+
*/
|
|
203
|
+
filter?: CommandFilter;
|
|
204
|
+
/** Optional default item value when it is initially rendered. */
|
|
205
|
+
defaultValue?: string;
|
|
206
|
+
/** Optional controlled state of the selected command menu item. */
|
|
207
|
+
value?: string;
|
|
208
|
+
/** Event handler called when the selected item of the menu changes. */
|
|
209
|
+
onValueChange?: (value: string) => void;
|
|
210
|
+
/**
|
|
211
|
+
* Optionally set to `true` to turn on looping around when using the arrow
|
|
212
|
+
* keys.
|
|
213
|
+
*/
|
|
214
|
+
loop?: boolean;
|
|
215
|
+
/** Optionally set to `true` to disable selection via pointer events. */
|
|
216
|
+
disablePointerSelection?: boolean;
|
|
217
|
+
} & React.RefAttributes<HTMLDivElement>> & {
|
|
218
|
+
List: React.ForwardRefExoticComponent<Children & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
219
|
+
/**
|
|
220
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
221
|
+
* This will merge the original component props with the props of the supplied
|
|
222
|
+
* element/component and change the underlying DOM node.
|
|
223
|
+
*/
|
|
224
|
+
asChild?: boolean;
|
|
225
|
+
} & {
|
|
226
|
+
/** Accessible label for this List of suggestions. Not shown visibly. */
|
|
227
|
+
label?: string;
|
|
228
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
229
|
+
Item: React.ForwardRefExoticComponent<Children & Omit<DivProps, "disabled" | "value" | "onSelect"> & {
|
|
230
|
+
/** Whether this item is currently disabled. */
|
|
231
|
+
disabled?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Event handler for when this item is selected, either via click or
|
|
234
|
+
* keyboard selection.
|
|
235
|
+
*/
|
|
236
|
+
onSelect?: (value: string) => void;
|
|
237
|
+
/**
|
|
238
|
+
* A unique value for this item. If no value is provided, it will be
|
|
239
|
+
* inferred from `children` or the rendered `textContent`. If your
|
|
240
|
+
* `textContent` changes between renders, you _must_ provide a stable,
|
|
241
|
+
* unique `value`.
|
|
242
|
+
*/
|
|
243
|
+
value?: string;
|
|
244
|
+
/** Optional keywords to match against when filtering. */
|
|
245
|
+
keywords?: string[];
|
|
246
|
+
/** Whether this item is forcibly rendered regardless of filtering. */
|
|
247
|
+
forceMount?: boolean;
|
|
248
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
249
|
+
Input: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type" | "value" | "onChange"> & {
|
|
250
|
+
/**
|
|
251
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
252
|
+
* This will merge the original component props with the props of the supplied
|
|
253
|
+
* element/component and change the underlying DOM node.
|
|
254
|
+
*/
|
|
255
|
+
asChild?: boolean;
|
|
256
|
+
/** Optional controlled state for the value of the search input. */
|
|
257
|
+
value?: string;
|
|
258
|
+
/** Event handler called when the search value changes. */
|
|
259
|
+
onValueChange?: (search: string) => void;
|
|
260
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
261
|
+
Group: React.ForwardRefExoticComponent<Children & Omit<DivProps, "value" | "heading"> & {
|
|
262
|
+
/** Optional heading to render for this group. */
|
|
263
|
+
heading?: React.ReactNode;
|
|
264
|
+
/**
|
|
265
|
+
* If no heading is provided, you must provide a value that is unique for
|
|
266
|
+
* this group.
|
|
267
|
+
*/
|
|
268
|
+
value?: string;
|
|
269
|
+
/** Whether this group is forcibly rendered regardless of filtering. */
|
|
270
|
+
forceMount?: boolean;
|
|
271
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
272
|
+
Separator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
273
|
+
/**
|
|
274
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
275
|
+
* This will merge the original component props with the props of the supplied
|
|
276
|
+
* element/component and change the underlying DOM node.
|
|
277
|
+
*/
|
|
278
|
+
asChild?: boolean;
|
|
279
|
+
} & {
|
|
280
|
+
/**
|
|
281
|
+
* Whether this separator should always be rendered. Useful if you disable
|
|
282
|
+
* automatic filtering.
|
|
283
|
+
*/
|
|
284
|
+
alwaysRender?: boolean;
|
|
285
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
286
|
+
Empty: React.ForwardRefExoticComponent<Children & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
287
|
+
/**
|
|
288
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
289
|
+
* This will merge the original component props with the props of the supplied
|
|
290
|
+
* element/component and change the underlying DOM node.
|
|
291
|
+
*/
|
|
292
|
+
asChild?: boolean;
|
|
293
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
294
|
+
Loading: React.ForwardRefExoticComponent<Children & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
295
|
+
/**
|
|
296
|
+
* Change the component to the HTML tag or custom component of the only child.
|
|
297
|
+
* This will merge the original component props with the props of the supplied
|
|
298
|
+
* element/component and change the underlying DOM node.
|
|
299
|
+
*/
|
|
300
|
+
asChild?: boolean;
|
|
301
|
+
} & {
|
|
302
|
+
/** Estimated progress of loading asynchronous options. */
|
|
303
|
+
progress?: number;
|
|
304
|
+
/** Accessible label for this loading progressbar. Not shown visibly. */
|
|
305
|
+
label?: string;
|
|
306
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
307
|
+
};
|
|
308
|
+
export { useCmdk as useCommandState };
|
|
309
|
+
export { pkg as Command };
|
|
310
|
+
export { defaultFilter };
|
|
311
|
+
export { Command as CommandRoot };
|
|
312
|
+
export { List as CommandList };
|
|
313
|
+
export { Item as CommandItem };
|
|
314
|
+
export { Input as CommandInput };
|
|
315
|
+
export { Group as CommandGroup };
|
|
316
|
+
export { Separator as CommandSeparator };
|
|
317
|
+
export { Empty as CommandEmpty };
|
|
318
|
+
export { Loading as CommandLoading };
|
|
319
|
+
/** Run a selector against the store state. */
|
|
320
|
+
declare function useCmdk<T = any>(selector: (state: State) => T): T;
|
|
@@ -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
|