@luscii-healthtech/web-ui 60.0.0 → 60.2.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/esm/components/Checkbox/LabeledCheckboxCardGroup.js +2 -2
- package/dist/esm/components/Checkbox/LabeledCheckboxCardGroup.js.map +1 -1
- package/dist/esm/components/Checkbox/LabeledCheckboxGroup.js +2 -2
- package/dist/esm/components/Checkbox/LabeledCheckboxGroup.js.map +1 -1
- package/dist/esm/components/{Table/Table.js → DataGrid/DataGrid.js} +5 -4
- package/dist/esm/components/DataGrid/DataGrid.js.map +1 -0
- package/dist/esm/components/{Table/Table.utils.js → DataGrid/DataGrid.utils.js} +1 -1
- package/dist/esm/components/DataGrid/DataGrid.utils.js.map +1 -0
- package/dist/esm/components/DataGrid/TableBody.js.map +1 -0
- package/dist/esm/components/{Table → DataGrid}/TableBodyRowDataCell.js +1 -1
- package/dist/esm/components/DataGrid/TableBodyRowDataCell.js.map +1 -0
- package/dist/esm/components/DataGrid/TableFooter.js.map +1 -0
- package/dist/esm/components/DataGrid/TableHeader.js.map +1 -0
- package/dist/esm/components/DatePicker/LabeledDatePicker.js +1 -1
- package/dist/esm/components/DatePicker/LabeledDatePicker.js.map +1 -1
- package/dist/esm/components/Input/LabeledInput.js +4 -2
- package/dist/esm/components/Input/LabeledInput.js.map +1 -1
- package/dist/esm/components/Input/StyledInput.js +18 -4
- package/dist/esm/components/Input/StyledInput.js.map +1 -1
- package/dist/esm/components/Radio/LabeledRadioCardGroup.js +2 -2
- package/dist/esm/components/Radio/LabeledRadioCardGroup.js.map +1 -1
- package/dist/esm/components/Radio/LabeledRadioGroup.js +2 -2
- package/dist/esm/components/Radio/LabeledRadioGroup.js.map +1 -1
- package/dist/esm/components/Select/LabeledSelect.js +1 -1
- package/dist/esm/components/Select/LabeledSelect.js.map +1 -1
- package/dist/esm/components/Select/LabeledSelectSearchable.js +2 -1
- package/dist/esm/components/Select/LabeledSelectSearchable.js.map +1 -1
- package/dist/esm/components/forms/shared/FieldsetLegend.js +17 -0
- package/dist/esm/components/forms/shared/FieldsetLegend.js.map +1 -0
- package/dist/esm/components/forms/shared/HelperAndErrorText.js +1 -1
- package/dist/esm/components/forms/shared/HelperAndErrorText.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/index.development.js +44 -15
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/Checkbox/LabeledCheckboxCardGroup.d.ts +10 -2
- package/dist/src/components/Checkbox/LabeledCheckboxGroup.d.ts +9 -1
- package/dist/src/{generated/components/Table/Table.d.ts → components/DataGrid/DataGrid.d.ts} +14 -5
- package/dist/src/components/{Table/Table.types.d.ts → DataGrid/DataGrid.types.d.ts} +13 -5
- package/dist/src/{generated/components/Table/Table.utils.d.ts → components/DataGrid/DataGrid.utils.d.ts} +3 -3
- package/dist/src/{generated/components/Table → components/DataGrid}/TableBody.d.ts +2 -2
- package/dist/src/components/{Table → DataGrid}/TableBodyRowDataCell.d.ts +2 -2
- package/dist/src/{generated/components/Table → components/DataGrid}/TableHeader.d.ts +2 -2
- package/dist/src/components/DatePicker/LabeledDatePicker.d.ts +9 -1
- package/dist/src/components/Input/LabeledInput.d.ts +10 -1
- package/dist/src/components/Radio/LabeledRadioCardGroup.d.ts +10 -2
- package/dist/src/components/Radio/LabeledRadioGroup.d.ts +9 -1
- package/dist/src/components/Select/LabeledSelect.d.ts +9 -1
- package/dist/src/components/Select/LabeledSelectSearchable.d.ts +8 -1
- package/dist/src/components/forms/shared/FieldsetLegend.d.ts +22 -0
- package/dist/src/generated/components/Checkbox/LabeledCheckboxCardGroup.d.ts +10 -2
- package/dist/src/generated/components/Checkbox/LabeledCheckboxGroup.d.ts +9 -1
- package/dist/src/{components/Table/Table.d.ts → generated/components/DataGrid/DataGrid.d.ts} +14 -5
- package/dist/src/generated/components/{Table/Table.types.d.ts → DataGrid/DataGrid.types.d.ts} +13 -5
- package/dist/src/{components/Table/Table.utils.d.ts → generated/components/DataGrid/DataGrid.utils.d.ts} +3 -3
- package/dist/src/{components/Table → generated/components/DataGrid}/TableBody.d.ts +2 -2
- package/dist/src/generated/components/{Table → DataGrid}/TableBodyRowDataCell.d.ts +2 -2
- package/dist/src/{components/Table → generated/components/DataGrid}/TableHeader.d.ts +2 -2
- package/dist/src/generated/components/DatePicker/LabeledDatePicker.d.ts +9 -1
- package/dist/src/generated/components/Input/LabeledInput.d.ts +10 -1
- package/dist/src/generated/components/Radio/LabeledRadioCardGroup.d.ts +10 -2
- package/dist/src/generated/components/Radio/LabeledRadioGroup.d.ts +9 -1
- package/dist/src/generated/components/Select/LabeledSelect.d.ts +9 -1
- package/dist/src/generated/components/Select/LabeledSelectSearchable.d.ts +8 -1
- package/dist/src/generated/components/forms/shared/FieldsetLegend.d.ts +22 -0
- package/dist/src/generated/index.d.ts +3 -3
- package/dist/src/index.d.ts +3 -3
- package/dist/stories/{Table.stories.d.ts → DataGrid.stories.d.ts} +16 -17
- package/dist/stories/LabeledCheckbox.stories.d.ts +5 -0
- package/dist/stories/LabeledDatePicker.stories.d.ts +6 -1
- package/dist/stories/LabeledInput.stories.d.ts +13 -1
- package/dist/stories/LabeledRadio.stories.d.ts +10 -0
- package/dist/stories/LabeledSelectSearchable.stories.d.ts +6 -1
- package/dist/stories/Select.stories.d.ts +5 -0
- package/dist/web-ui-tailwind.css +3 -0
- package/package.json +1 -1
- package/dist/esm/components/Table/Table.js.map +0 -1
- package/dist/esm/components/Table/Table.utils.js.map +0 -1
- package/dist/esm/components/Table/TableBody.js.map +0 -1
- package/dist/esm/components/Table/TableBodyRowDataCell.js.map +0 -1
- package/dist/esm/components/Table/TableFooter.js.map +0 -1
- package/dist/esm/components/Table/TableHeader.js.map +0 -1
- /package/dist/esm/components/{Table → DataGrid}/TableBody.js +0 -0
- /package/dist/esm/components/{Table → DataGrid}/TableFooter.js +0 -0
- /package/dist/esm/components/{Table → DataGrid}/TableHeader.js +0 -0
- /package/dist/src/components/{Table → DataGrid}/TableFooter.d.ts +0 -0
- /package/dist/src/generated/components/{Table → DataGrid}/TableFooter.d.ts +0 -0
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
type Props = React.ComponentPropsWithoutRef<"fieldset"> & {
|
|
2
|
+
type Props = Omit<React.ComponentPropsWithoutRef<"fieldset">, "title"> & {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The group's title, rendered as the fieldset's `<legend>`. A string is
|
|
6
|
+
* rendered as body text; pass a node for anything else, such as a
|
|
7
|
+
* `Heading` or an info icon next to the text.
|
|
8
|
+
*
|
|
9
|
+
* All of the title's text names the group, including the label of an
|
|
10
|
+
* (info) button inside it.
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
5
13
|
className?: string;
|
|
6
14
|
/**
|
|
7
15
|
* Over how many columns the checkbox cards should be distributed.
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
type Props = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The group's title, rendered as the fieldset's `<legend>`. A string is
|
|
6
|
+
* rendered as body text; pass a node for anything else, such as a
|
|
7
|
+
* `Heading` or an info icon next to the text.
|
|
8
|
+
*
|
|
9
|
+
* All of the title's text names the group, including the label of an
|
|
10
|
+
* (info) button inside it.
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
5
13
|
className?: string;
|
|
6
14
|
/**
|
|
7
15
|
* Any additional information to show underneath the radio group.
|
package/dist/src/{generated/components/Table/Table.d.ts → components/DataGrid/DataGrid.d.ts}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
2
|
import { type PaginationMenuProps } from "../PaginationMenu/PaginationMenu.types";
|
|
3
|
-
import { type
|
|
3
|
+
import { type DataGridFieldConfig } from "./DataGrid.types";
|
|
4
4
|
type SelectableTableRow<Item> = {
|
|
5
5
|
index: number;
|
|
6
6
|
value: Item;
|
|
7
7
|
};
|
|
8
|
-
export interface
|
|
8
|
+
export interface DataGridProps<Item> extends HTMLAttributes<HTMLTableElement> {
|
|
9
9
|
items?: Item[];
|
|
10
|
-
fieldConfigurations:
|
|
10
|
+
fieldConfigurations: DataGridFieldConfig<Item>[];
|
|
11
11
|
emptyRowsText: string;
|
|
12
12
|
emptyFieldContentText?: string;
|
|
13
13
|
isLoading?: boolean;
|
|
@@ -49,7 +49,16 @@ export interface TableProps<Item> extends HTMLAttributes<HTMLTableElement> {
|
|
|
49
49
|
onSelectedRowsChange?: (params: Array<SelectableTableRow<Item>>) => void;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Config-driven data grid: `items` plus `fieldConfigurations` render the rows, with pagination,
|
|
53
|
+
* selection, loading and empty states built in. For a table with custom structure (colspan,
|
|
54
|
+
* grouped rows, sticky columns), use `TableNew`.
|
|
53
55
|
*/
|
|
54
|
-
export declare function
|
|
56
|
+
export declare function DataGrid<Item>({ items, fieldConfigurations, emptyRowsText, emptyFieldContentText, isLoading, showHeader, paginationMenuProps, onRowClick, className, dataTestId, isSelectable, selectedItems, onSelectedRowsChange, rowSelectionHeaderAccessories, ...otherAttributes }: DataGridProps<Item>): import("react").JSX.Element;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated Renamed to `DataGrid`. In the next major, `Table` becomes the compositional table
|
|
59
|
+
* that is now `TableNew`.
|
|
60
|
+
*/
|
|
61
|
+
export declare const Table: typeof DataGrid;
|
|
62
|
+
/** @deprecated Renamed to `DataGridProps`. */
|
|
63
|
+
export type TableProps<Item> = DataGridProps<Item>;
|
|
55
64
|
export {};
|
|
@@ -6,7 +6,7 @@ type TableFieldConfigBase = {
|
|
|
6
6
|
onlyShowContentOnHovering?: boolean;
|
|
7
7
|
};
|
|
8
8
|
type TableFieldConfigWithContent<Item> = TableFieldConfigBase & {
|
|
9
|
-
content: (item: Item) =>
|
|
9
|
+
content: (item: Item) => DataGridFieldContent<Item>;
|
|
10
10
|
render?: never;
|
|
11
11
|
};
|
|
12
12
|
type TableFieldConfigWithComponent<Item> = TableFieldConfigBase & {
|
|
@@ -17,9 +17,9 @@ type TableFieldConfigWithComponent<Item> = TableFieldConfigBase & {
|
|
|
17
17
|
* By adding the `content` property, it will use an opinionated layout with the <Text /> and optionally the <Tag /> component.
|
|
18
18
|
* By adding the `render` property, it will render any component returned in the function, based on the item (with type) passed.
|
|
19
19
|
*/
|
|
20
|
-
export type
|
|
21
|
-
export type
|
|
22
|
-
export interface
|
|
20
|
+
export type DataGridFieldConfig<Item> = TableFieldConfigWithComponent<Item> | TableFieldConfigWithContent<Item>;
|
|
21
|
+
export type DataGridFieldContent<Item> = DataGridFieldText | [DataGridFieldAction<Item>?, DataGridFieldAction<Item>?];
|
|
22
|
+
export interface DataGridFieldText {
|
|
23
23
|
text?: string;
|
|
24
24
|
description?: {
|
|
25
25
|
content: string;
|
|
@@ -31,7 +31,7 @@ export interface TableFieldText {
|
|
|
31
31
|
color: "red" | "amber" | "green" | "gray" | "blue";
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
export type
|
|
34
|
+
export type DataGridFieldAction<Item> = {
|
|
35
35
|
isDisabled?: boolean;
|
|
36
36
|
title?: string;
|
|
37
37
|
icon?: FC<IconProps> | IconKey;
|
|
@@ -42,4 +42,12 @@ export type TableFieldAction<Item> = {
|
|
|
42
42
|
*/
|
|
43
43
|
handleClick: (item: Item) => void;
|
|
44
44
|
};
|
|
45
|
+
/** @deprecated Renamed to `DataGridFieldConfig`. */
|
|
46
|
+
export type TableFieldConfig<Item> = DataGridFieldConfig<Item>;
|
|
47
|
+
/** @deprecated Renamed to `DataGridFieldContent`. */
|
|
48
|
+
export type TableFieldContent<Item> = DataGridFieldContent<Item>;
|
|
49
|
+
/** @deprecated Renamed to `DataGridFieldText`. */
|
|
50
|
+
export type TableFieldText = DataGridFieldText;
|
|
51
|
+
/** @deprecated Renamed to `DataGridFieldAction`. */
|
|
52
|
+
export type TableFieldAction<Item> = DataGridFieldAction<Item>;
|
|
45
53
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PaginationMenuProps } from "../PaginationMenu/PaginationMenu.types";
|
|
2
|
-
import { type
|
|
3
|
-
export declare function isTableFieldText<Item>(content:
|
|
4
|
-
export declare function isTableFieldAction<Item>(content:
|
|
2
|
+
import { type DataGridFieldText, type DataGridFieldAction, type DataGridFieldContent } from "./DataGrid.types";
|
|
3
|
+
export declare function isTableFieldText<Item>(content: DataGridFieldContent<Item>): content is DataGridFieldText;
|
|
4
|
+
export declare function isTableFieldAction<Item>(content: DataGridFieldContent<Item>): content is [DataGridFieldAction<Item>?, DataGridFieldAction<Item>?];
|
|
5
5
|
export declare const shouldShowPagination: (paginationMenuProps: PaginationMenuProps | undefined) => paginationMenuProps is PaginationMenuProps;
|
|
6
6
|
/**
|
|
7
7
|
* This function is to be used when the data we need can be completely on the client side.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DataGridFieldConfig } from "./DataGrid.types";
|
|
2
2
|
export interface TableBody<RowData> {
|
|
3
3
|
items?: RowData[];
|
|
4
4
|
selectedItems?: {
|
|
5
5
|
index: number;
|
|
6
6
|
}[];
|
|
7
|
-
fieldConfigurations:
|
|
7
|
+
fieldConfigurations: DataGridFieldConfig<RowData>[];
|
|
8
8
|
emptyItemsText: string;
|
|
9
9
|
emptyFieldContentText?: string;
|
|
10
10
|
isLoading: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DataGridFieldConfig } from "./DataGrid.types";
|
|
2
2
|
export interface TableBodyRowDataCellProps<Item> {
|
|
3
3
|
item: Item;
|
|
4
|
-
fieldConfig:
|
|
4
|
+
fieldConfig: DataGridFieldConfig<Item>;
|
|
5
5
|
emptyFieldContentText?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function TableBodyRowDataCell<Item>(props: TableBodyRowDataCellProps<Item>): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type DataGridFieldConfig } from "./DataGrid.types";
|
|
3
3
|
export type TableHeaderProps<Item> = {
|
|
4
|
-
fieldConfigurations:
|
|
4
|
+
fieldConfigurations: DataGridFieldConfig<Item>[];
|
|
5
5
|
className?: string;
|
|
6
6
|
/**
|
|
7
7
|
* The combination of checkbox and action button above the table,
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type DatePickerProps } from "./DatePicker";
|
|
3
3
|
type Props = DatePickerProps & {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The visible label above the date picker.
|
|
6
|
+
*
|
|
7
|
+
* Besides a string, this can be a node, for example to add an icon next to
|
|
8
|
+
* the text. It's rendered inside a `<label>`, so keep it phrasing content
|
|
9
|
+
* (no headings or blocks) and non-interactive: interactive content would
|
|
10
|
+
* become part of the field's accessible name.
|
|
11
|
+
*/
|
|
12
|
+
label?: React.ReactNode;
|
|
5
13
|
helperText?: React.ReactNode;
|
|
6
14
|
errorText?: React.ReactNode;
|
|
7
15
|
/**
|
|
@@ -12,7 +12,16 @@ export declare const LabeledInput: React.ForwardRefExoticComponent<Omit<Omit<Omi
|
|
|
12
12
|
isClearIconVisible?: boolean;
|
|
13
13
|
onClickClearField?: () => void;
|
|
14
14
|
} & React.RefAttributes<HTMLInputElement>, "ref">, "width" | "icon"> & {
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The visible label, linked to the input with `htmlFor`. When omitted, give
|
|
17
|
+
* the input an accessible name with `aria-label` or `aria-labelledby`.
|
|
18
|
+
*
|
|
19
|
+
* Besides a string, this can be a node, for example to add an icon next to
|
|
20
|
+
* the text. It's rendered inside a `<label>`, so keep it phrasing content
|
|
21
|
+
* (no headings or blocks) and non-interactive: interactive content would
|
|
22
|
+
* become part of the field's accessible name.
|
|
23
|
+
*/
|
|
24
|
+
label?: React.ReactNode;
|
|
16
25
|
icon?: React.FC<IconProps>;
|
|
17
26
|
/**
|
|
18
27
|
* Any additional information to show underneath the input.
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
type Props = React.ComponentPropsWithoutRef<"fieldset"> & {
|
|
2
|
+
type Props = Omit<React.ComponentPropsWithoutRef<"fieldset">, "title"> & {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The group's title, rendered as the fieldset's `<legend>`. A string is
|
|
6
|
+
* rendered as body text; pass a node for anything else, such as a
|
|
7
|
+
* `Heading` or an info icon next to the text.
|
|
8
|
+
*
|
|
9
|
+
* All of the title's text names the group, including the label of an
|
|
10
|
+
* (info) button inside it.
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
5
13
|
className?: string;
|
|
6
14
|
/**
|
|
7
15
|
* Over how many columns the radio cards should be distributed.
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
type Props = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The group's title, rendered as the fieldset's `<legend>`. A string is
|
|
6
|
+
* rendered as body text; pass a node for anything else, such as a
|
|
7
|
+
* `Heading` or an info icon next to the text.
|
|
8
|
+
*
|
|
9
|
+
* All of the title's text names the group, including the label of an
|
|
10
|
+
* (info) button inside it.
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
5
13
|
className?: string;
|
|
6
14
|
/**
|
|
7
15
|
* The orientation of the radio buttons in the group. This only has a
|
|
@@ -8,7 +8,15 @@ export declare const LabeledSelect: React.ForwardRefExoticComponent<Omit<Omit<Om
|
|
|
8
8
|
height?: import("../../system/Sizes").FormHeightNames;
|
|
9
9
|
isError?: boolean;
|
|
10
10
|
} & React.RefAttributes<HTMLSelectElement>, "ref">, "width" | "icon"> & {
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The visible label above the select.
|
|
13
|
+
*
|
|
14
|
+
* Besides a string, this can be a node, for example to add an icon next to
|
|
15
|
+
* the text. It's rendered inside a `<label>`, so keep it phrasing content
|
|
16
|
+
* (no headings or blocks) and non-interactive: interactive content would
|
|
17
|
+
* become part of the field's accessible name.
|
|
18
|
+
*/
|
|
19
|
+
label?: React.ReactNode;
|
|
12
20
|
icon?: React.FC<IconProps>;
|
|
13
21
|
/**
|
|
14
22
|
* Any additional information to show underneath the input.
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type SelectProps } from "./Select";
|
|
3
3
|
export declare const LabeledSelectSearchable: React.ForwardRefExoticComponent<Omit<SelectProps<import("./Select.types").OptionMinimal, any, import("react-select").GroupBase<import("./Select.types").OptionMinimal>>, "isError"> & {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The visible label above the select, linked to it with `aria-labelledby`.
|
|
6
|
+
*
|
|
7
|
+
* Besides a string, this can be a node, for example to add an icon next to
|
|
8
|
+
* the text. Keep it phrasing content (no headings or blocks) and
|
|
9
|
+
* non-interactive: all of its text becomes the select's accessible name.
|
|
10
|
+
*/
|
|
11
|
+
label?: React.ReactNode;
|
|
5
12
|
/**
|
|
6
13
|
* Any additional information to show underneath the select.
|
|
7
14
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type FC, type ReactNode } from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
/**
|
|
4
|
+
* A string is rendered as body text. Any other node is rendered as-is, so
|
|
5
|
+
* it can be a `Heading` or contain an icon. A `<legend>` may contain
|
|
6
|
+
* phrasing and heading content.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The title of a labelled group (radio group, checkbox group, …), rendered as
|
|
12
|
+
* the `<legend>` of its `<fieldset>`, so it names the group.
|
|
13
|
+
*
|
|
14
|
+
* Browsers render a fieldset's legend outside of the fieldset's (flex)
|
|
15
|
+
* layout, so the legend gets `display: contents` and its content becomes the
|
|
16
|
+
* flex item instead. That content must be a single element to stay one item
|
|
17
|
+
* that follows the parent `Stack`'s gap: a string is wrapped in `Text`, a
|
|
18
|
+
* single element is rendered as-is, and anything else (a fragment, several
|
|
19
|
+
* nodes) is wrapped in a block `span`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const FieldsetLegend: FC<Props>;
|
|
22
|
+
export {};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
type Props = React.ComponentPropsWithoutRef<"fieldset"> & {
|
|
2
|
+
type Props = Omit<React.ComponentPropsWithoutRef<"fieldset">, "title"> & {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The group's title, rendered as the fieldset's `<legend>`. A string is
|
|
6
|
+
* rendered as body text; pass a node for anything else, such as a
|
|
7
|
+
* `Heading` or an info icon next to the text.
|
|
8
|
+
*
|
|
9
|
+
* All of the title's text names the group, including the label of an
|
|
10
|
+
* (info) button inside it.
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
5
13
|
className?: string;
|
|
6
14
|
/**
|
|
7
15
|
* Over how many columns the checkbox cards should be distributed.
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
type Props = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The group's title, rendered as the fieldset's `<legend>`. A string is
|
|
6
|
+
* rendered as body text; pass a node for anything else, such as a
|
|
7
|
+
* `Heading` or an info icon next to the text.
|
|
8
|
+
*
|
|
9
|
+
* All of the title's text names the group, including the label of an
|
|
10
|
+
* (info) button inside it.
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
5
13
|
className?: string;
|
|
6
14
|
/**
|
|
7
15
|
* Any additional information to show underneath the radio group.
|
package/dist/src/{components/Table/Table.d.ts → generated/components/DataGrid/DataGrid.d.ts}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
2
|
import { type PaginationMenuProps } from "../PaginationMenu/PaginationMenu.types";
|
|
3
|
-
import { type
|
|
3
|
+
import { type DataGridFieldConfig } from "./DataGrid.types";
|
|
4
4
|
type SelectableTableRow<Item> = {
|
|
5
5
|
index: number;
|
|
6
6
|
value: Item;
|
|
7
7
|
};
|
|
8
|
-
export interface
|
|
8
|
+
export interface DataGridProps<Item> extends HTMLAttributes<HTMLTableElement> {
|
|
9
9
|
items?: Item[];
|
|
10
|
-
fieldConfigurations:
|
|
10
|
+
fieldConfigurations: DataGridFieldConfig<Item>[];
|
|
11
11
|
emptyRowsText: string;
|
|
12
12
|
emptyFieldContentText?: string;
|
|
13
13
|
isLoading?: boolean;
|
|
@@ -49,7 +49,16 @@ export interface TableProps<Item> extends HTMLAttributes<HTMLTableElement> {
|
|
|
49
49
|
onSelectedRowsChange?: (params: Array<SelectableTableRow<Item>>) => void;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Config-driven data grid: `items` plus `fieldConfigurations` render the rows, with pagination,
|
|
53
|
+
* selection, loading and empty states built in. For a table with custom structure (colspan,
|
|
54
|
+
* grouped rows, sticky columns), use `TableNew`.
|
|
53
55
|
*/
|
|
54
|
-
export declare function
|
|
56
|
+
export declare function DataGrid<Item>({ items, fieldConfigurations, emptyRowsText, emptyFieldContentText, isLoading, showHeader, paginationMenuProps, onRowClick, className, dataTestId, isSelectable, selectedItems, onSelectedRowsChange, rowSelectionHeaderAccessories, ...otherAttributes }: DataGridProps<Item>): import("react").JSX.Element;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated Renamed to `DataGrid`. In the next major, `Table` becomes the compositional table
|
|
59
|
+
* that is now `TableNew`.
|
|
60
|
+
*/
|
|
61
|
+
export declare const Table: typeof DataGrid;
|
|
62
|
+
/** @deprecated Renamed to `DataGridProps`. */
|
|
63
|
+
export type TableProps<Item> = DataGridProps<Item>;
|
|
55
64
|
export {};
|
package/dist/src/generated/components/{Table/Table.types.d.ts → DataGrid/DataGrid.types.d.ts}
RENAMED
|
@@ -6,7 +6,7 @@ type TableFieldConfigBase = {
|
|
|
6
6
|
onlyShowContentOnHovering?: boolean;
|
|
7
7
|
};
|
|
8
8
|
type TableFieldConfigWithContent<Item> = TableFieldConfigBase & {
|
|
9
|
-
content: (item: Item) =>
|
|
9
|
+
content: (item: Item) => DataGridFieldContent<Item>;
|
|
10
10
|
render?: never;
|
|
11
11
|
};
|
|
12
12
|
type TableFieldConfigWithComponent<Item> = TableFieldConfigBase & {
|
|
@@ -17,9 +17,9 @@ type TableFieldConfigWithComponent<Item> = TableFieldConfigBase & {
|
|
|
17
17
|
* By adding the `content` property, it will use an opinionated layout with the <Text /> and optionally the <Tag /> component.
|
|
18
18
|
* By adding the `render` property, it will render any component returned in the function, based on the item (with type) passed.
|
|
19
19
|
*/
|
|
20
|
-
export type
|
|
21
|
-
export type
|
|
22
|
-
export interface
|
|
20
|
+
export type DataGridFieldConfig<Item> = TableFieldConfigWithComponent<Item> | TableFieldConfigWithContent<Item>;
|
|
21
|
+
export type DataGridFieldContent<Item> = DataGridFieldText | [DataGridFieldAction<Item>?, DataGridFieldAction<Item>?];
|
|
22
|
+
export interface DataGridFieldText {
|
|
23
23
|
text?: string;
|
|
24
24
|
description?: {
|
|
25
25
|
content: string;
|
|
@@ -31,7 +31,7 @@ export interface TableFieldText {
|
|
|
31
31
|
color: "red" | "amber" | "green" | "gray" | "blue";
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
export type
|
|
34
|
+
export type DataGridFieldAction<Item> = {
|
|
35
35
|
isDisabled?: boolean;
|
|
36
36
|
title?: string;
|
|
37
37
|
icon?: FC<IconProps> | IconKey;
|
|
@@ -42,4 +42,12 @@ export type TableFieldAction<Item> = {
|
|
|
42
42
|
*/
|
|
43
43
|
handleClick: (item: Item) => void;
|
|
44
44
|
};
|
|
45
|
+
/** @deprecated Renamed to `DataGridFieldConfig`. */
|
|
46
|
+
export type TableFieldConfig<Item> = DataGridFieldConfig<Item>;
|
|
47
|
+
/** @deprecated Renamed to `DataGridFieldContent`. */
|
|
48
|
+
export type TableFieldContent<Item> = DataGridFieldContent<Item>;
|
|
49
|
+
/** @deprecated Renamed to `DataGridFieldText`. */
|
|
50
|
+
export type TableFieldText = DataGridFieldText;
|
|
51
|
+
/** @deprecated Renamed to `DataGridFieldAction`. */
|
|
52
|
+
export type TableFieldAction<Item> = DataGridFieldAction<Item>;
|
|
45
53
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PaginationMenuProps } from "../PaginationMenu/PaginationMenu.types";
|
|
2
|
-
import { type
|
|
3
|
-
export declare function isTableFieldText<Item>(content:
|
|
4
|
-
export declare function isTableFieldAction<Item>(content:
|
|
2
|
+
import { type DataGridFieldText, type DataGridFieldAction, type DataGridFieldContent } from "./DataGrid.types";
|
|
3
|
+
export declare function isTableFieldText<Item>(content: DataGridFieldContent<Item>): content is DataGridFieldText;
|
|
4
|
+
export declare function isTableFieldAction<Item>(content: DataGridFieldContent<Item>): content is [DataGridFieldAction<Item>?, DataGridFieldAction<Item>?];
|
|
5
5
|
export declare const shouldShowPagination: (paginationMenuProps: PaginationMenuProps | undefined) => paginationMenuProps is PaginationMenuProps;
|
|
6
6
|
/**
|
|
7
7
|
* This function is to be used when the data we need can be completely on the client side.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DataGridFieldConfig } from "./DataGrid.types";
|
|
2
2
|
export interface TableBody<RowData> {
|
|
3
3
|
items?: RowData[];
|
|
4
4
|
selectedItems?: {
|
|
5
5
|
index: number;
|
|
6
6
|
}[];
|
|
7
|
-
fieldConfigurations:
|
|
7
|
+
fieldConfigurations: DataGridFieldConfig<RowData>[];
|
|
8
8
|
emptyItemsText: string;
|
|
9
9
|
emptyFieldContentText?: string;
|
|
10
10
|
isLoading: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DataGridFieldConfig } from "./DataGrid.types";
|
|
2
2
|
export interface TableBodyRowDataCellProps<Item> {
|
|
3
3
|
item: Item;
|
|
4
|
-
fieldConfig:
|
|
4
|
+
fieldConfig: DataGridFieldConfig<Item>;
|
|
5
5
|
emptyFieldContentText?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function TableBodyRowDataCell<Item>(props: TableBodyRowDataCellProps<Item>): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type DataGridFieldConfig } from "./DataGrid.types";
|
|
3
3
|
export type TableHeaderProps<Item> = {
|
|
4
|
-
fieldConfigurations:
|
|
4
|
+
fieldConfigurations: DataGridFieldConfig<Item>[];
|
|
5
5
|
className?: string;
|
|
6
6
|
/**
|
|
7
7
|
* The combination of checkbox and action button above the table,
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type DatePickerProps } from "./DatePicker";
|
|
3
3
|
type Props = DatePickerProps & {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The visible label above the date picker.
|
|
6
|
+
*
|
|
7
|
+
* Besides a string, this can be a node, for example to add an icon next to
|
|
8
|
+
* the text. It's rendered inside a `<label>`, so keep it phrasing content
|
|
9
|
+
* (no headings or blocks) and non-interactive: interactive content would
|
|
10
|
+
* become part of the field's accessible name.
|
|
11
|
+
*/
|
|
12
|
+
label?: React.ReactNode;
|
|
5
13
|
helperText?: React.ReactNode;
|
|
6
14
|
errorText?: React.ReactNode;
|
|
7
15
|
/**
|
|
@@ -12,7 +12,16 @@ export declare const LabeledInput: React.ForwardRefExoticComponent<Omit<Omit<Omi
|
|
|
12
12
|
isClearIconVisible?: boolean;
|
|
13
13
|
onClickClearField?: () => void;
|
|
14
14
|
} & React.RefAttributes<HTMLInputElement>, "ref">, "width" | "icon"> & {
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The visible label, linked to the input with `htmlFor`. When omitted, give
|
|
17
|
+
* the input an accessible name with `aria-label` or `aria-labelledby`.
|
|
18
|
+
*
|
|
19
|
+
* Besides a string, this can be a node, for example to add an icon next to
|
|
20
|
+
* the text. It's rendered inside a `<label>`, so keep it phrasing content
|
|
21
|
+
* (no headings or blocks) and non-interactive: interactive content would
|
|
22
|
+
* become part of the field's accessible name.
|
|
23
|
+
*/
|
|
24
|
+
label?: React.ReactNode;
|
|
16
25
|
icon?: React.FC<IconProps>;
|
|
17
26
|
/**
|
|
18
27
|
* Any additional information to show underneath the input.
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
type Props = React.ComponentPropsWithoutRef<"fieldset"> & {
|
|
2
|
+
type Props = Omit<React.ComponentPropsWithoutRef<"fieldset">, "title"> & {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The group's title, rendered as the fieldset's `<legend>`. A string is
|
|
6
|
+
* rendered as body text; pass a node for anything else, such as a
|
|
7
|
+
* `Heading` or an info icon next to the text.
|
|
8
|
+
*
|
|
9
|
+
* All of the title's text names the group, including the label of an
|
|
10
|
+
* (info) button inside it.
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
5
13
|
className?: string;
|
|
6
14
|
/**
|
|
7
15
|
* Over how many columns the radio cards should be distributed.
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
type Props = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The group's title, rendered as the fieldset's `<legend>`. A string is
|
|
6
|
+
* rendered as body text; pass a node for anything else, such as a
|
|
7
|
+
* `Heading` or an info icon next to the text.
|
|
8
|
+
*
|
|
9
|
+
* All of the title's text names the group, including the label of an
|
|
10
|
+
* (info) button inside it.
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
5
13
|
className?: string;
|
|
6
14
|
/**
|
|
7
15
|
* The orientation of the radio buttons in the group. This only has a
|
|
@@ -8,7 +8,15 @@ export declare const LabeledSelect: React.ForwardRefExoticComponent<Omit<Omit<Om
|
|
|
8
8
|
height?: import("../../system/Sizes").FormHeightNames;
|
|
9
9
|
isError?: boolean;
|
|
10
10
|
} & React.RefAttributes<HTMLSelectElement>, "ref">, "width" | "icon"> & {
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The visible label above the select.
|
|
13
|
+
*
|
|
14
|
+
* Besides a string, this can be a node, for example to add an icon next to
|
|
15
|
+
* the text. It's rendered inside a `<label>`, so keep it phrasing content
|
|
16
|
+
* (no headings or blocks) and non-interactive: interactive content would
|
|
17
|
+
* become part of the field's accessible name.
|
|
18
|
+
*/
|
|
19
|
+
label?: React.ReactNode;
|
|
12
20
|
icon?: React.FC<IconProps>;
|
|
13
21
|
/**
|
|
14
22
|
* Any additional information to show underneath the input.
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type SelectProps } from "./Select";
|
|
3
3
|
export declare const LabeledSelectSearchable: React.ForwardRefExoticComponent<Omit<SelectProps<import("./Select.types").OptionMinimal, any, import("react-select").GroupBase<import("./Select.types").OptionMinimal>>, "isError"> & {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The visible label above the select, linked to it with `aria-labelledby`.
|
|
6
|
+
*
|
|
7
|
+
* Besides a string, this can be a node, for example to add an icon next to
|
|
8
|
+
* the text. Keep it phrasing content (no headings or blocks) and
|
|
9
|
+
* non-interactive: all of its text becomes the select's accessible name.
|
|
10
|
+
*/
|
|
11
|
+
label?: React.ReactNode;
|
|
5
12
|
/**
|
|
6
13
|
* Any additional information to show underneath the select.
|
|
7
14
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type FC, type ReactNode } from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
/**
|
|
4
|
+
* A string is rendered as body text. Any other node is rendered as-is, so
|
|
5
|
+
* it can be a `Heading` or contain an icon. A `<legend>` may contain
|
|
6
|
+
* phrasing and heading content.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The title of a labelled group (radio group, checkbox group, …), rendered as
|
|
12
|
+
* the `<legend>` of its `<fieldset>`, so it names the group.
|
|
13
|
+
*
|
|
14
|
+
* Browsers render a fieldset's legend outside of the fieldset's (flex)
|
|
15
|
+
* layout, so the legend gets `display: contents` and its content becomes the
|
|
16
|
+
* flex item instead. That content must be a single element to stay one item
|
|
17
|
+
* that follows the parent `Stack`'s gap: a string is wrapped in `Text`, a
|
|
18
|
+
* single element is rendered as-is, and anything else (a fragment, several
|
|
19
|
+
* nodes) is wrapped in a block `span`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const FieldsetLegend: FC<Props>;
|
|
22
|
+
export {};
|
|
@@ -57,10 +57,10 @@ export { Tooltip, TooltipProvider } from "./components/Tooltip";
|
|
|
57
57
|
export { Tabs } from "./components/Tabs";
|
|
58
58
|
export { PrimaryTabBar } from "./components/PrimaryTabBar/PrimaryTabBar";
|
|
59
59
|
export { default as Line } from "./components/Line/Line";
|
|
60
|
-
export { Table, type TableProps } from "./components/
|
|
61
|
-
export { prepareClientSidePagination } from "./components/
|
|
60
|
+
export { DataGrid, type DataGridProps, Table, type TableProps, } from "./components/DataGrid/DataGrid";
|
|
61
|
+
export { prepareClientSidePagination } from "./components/DataGrid/DataGrid.utils";
|
|
62
62
|
export { TableNew } from "./components/TableNew/TableNew";
|
|
63
|
-
export { type TableFieldConfig, type TableFieldContent, type TableFieldText, type TableFieldAction, } from "./components/
|
|
63
|
+
export { type DataGridFieldConfig, type DataGridFieldContent, type DataGridFieldText, type DataGridFieldAction, type TableFieldConfig, type TableFieldContent, type TableFieldText, type TableFieldAction, } from "./components/DataGrid/DataGrid.types";
|
|
64
64
|
export { LoadingIndicator, type LoadingIndicatorProps, } from "./components/LoadingIndicator/LoadingIndicator";
|
|
65
65
|
export { CheckboxList, type CheckboxListProps, } from "./components/CheckboxList/CheckboxList";
|
|
66
66
|
export { NavLayout, type Props as NavLayoutProps, } from "./components/NavMenu/NavLayout";
|
package/dist/src/index.d.ts
CHANGED
|
@@ -57,10 +57,10 @@ export { Tooltip, TooltipProvider } from "./components/Tooltip";
|
|
|
57
57
|
export { Tabs } from "./components/Tabs";
|
|
58
58
|
export { PrimaryTabBar } from "./components/PrimaryTabBar/PrimaryTabBar";
|
|
59
59
|
export { default as Line } from "./components/Line/Line";
|
|
60
|
-
export { Table, type TableProps } from "./components/
|
|
61
|
-
export { prepareClientSidePagination } from "./components/
|
|
60
|
+
export { DataGrid, type DataGridProps, Table, type TableProps, } from "./components/DataGrid/DataGrid";
|
|
61
|
+
export { prepareClientSidePagination } from "./components/DataGrid/DataGrid.utils";
|
|
62
62
|
export { TableNew } from "./components/TableNew/TableNew";
|
|
63
|
-
export { type TableFieldConfig, type TableFieldContent, type TableFieldText, type TableFieldAction, } from "./components/
|
|
63
|
+
export { type DataGridFieldConfig, type DataGridFieldContent, type DataGridFieldText, type DataGridFieldAction, type TableFieldConfig, type TableFieldContent, type TableFieldText, type TableFieldAction, } from "./components/DataGrid/DataGrid.types";
|
|
64
64
|
export { LoadingIndicator, type LoadingIndicatorProps, } from "./components/LoadingIndicator/LoadingIndicator";
|
|
65
65
|
export { CheckboxList, type CheckboxListProps, } from "./components/CheckboxList/CheckboxList";
|
|
66
66
|
export { NavLayout, type Props as NavLayoutProps, } from "./components/NavMenu/NavLayout";
|