@agregio-solutions/design-system 2.1.0 → 2.3.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/design-system.cjs +398 -317
- package/dist/design-system.js +2686 -2543
- package/dist/packages/components/DataTable/DataTable.d.ts +10 -1
- package/dist/packages/components/DataTable/DataTableRoot/DataTableRoot.d.ts +4 -0
- package/dist/packages/components/DataTable/DataTableSkeletonRows/DataTableSkeletonRows.d.ts +11 -0
- package/dist/packages/components/DataTable/doc.md +123 -22
- package/dist/packages/components/PageLayout/doc.md +11 -11
- package/dist/packages/components/Radio/Radio.d.ts +7 -0
- package/dist/packages/components/Radio/doc.md +4 -0
- package/dist/packages/components/RadioGroup/RadioGroup.d.ts +92 -0
- package/dist/packages/components/RadioGroup/doc.md +569 -0
- package/dist/packages/components/RadioGroupItem/RadioGroupItem.d.ts +27 -0
- package/dist/packages/index.d.ts +3 -1
- package/package.json +1 -1
|
@@ -41,6 +41,15 @@ type Props<TFeatures extends TableFeatures, TData extends RowData> = {
|
|
|
41
41
|
* @default "default".
|
|
42
42
|
*/
|
|
43
43
|
size?: "small" | "default" | "large";
|
|
44
|
+
/**
|
|
45
|
+
* Whether the table is loading its data for the first time.
|
|
46
|
+
* Renders skeleton rows under the real header, as many as the page size
|
|
47
|
+
* (`pagination.pageSize`, else `table.state.pagination.pageSize`, else 10).
|
|
48
|
+
* Map it to react-query `isLoading` (first load, no data yet), not `isFetching`:
|
|
49
|
+
* on refetch, keep the current rows displayed (e.g. with `placeholderData: keepPreviousData`).
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
isLoading?: boolean;
|
|
44
53
|
};
|
|
45
|
-
export default function DataTable<TFeatures extends TableFeatures, TData extends RowData>({ table, pagination, renderSubComponent, itemsPerPageOptions, size, ...divProps }: Props<TFeatures, TData>): React.JSX.Element;
|
|
54
|
+
export default function DataTable<TFeatures extends TableFeatures, TData extends RowData>({ table, pagination, renderSubComponent, itemsPerPageOptions, size, isLoading, ...divProps }: Props<TFeatures, TData>): React.JSX.Element;
|
|
46
55
|
export {};
|
|
@@ -8,6 +8,10 @@ export type Props = {
|
|
|
8
8
|
* The inline style for the element.
|
|
9
9
|
*/
|
|
10
10
|
style?: React.CSSProperties;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the table content is loading.
|
|
13
|
+
*/
|
|
14
|
+
"aria-busy"?: boolean;
|
|
11
15
|
children: React.ReactNode;
|
|
12
16
|
};
|
|
13
17
|
export default function DataTableRoot({ children, ...otherProps }: Props): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* The number of skeleton rows to render.
|
|
4
|
+
*/
|
|
5
|
+
rowCount: number;
|
|
6
|
+
/**
|
|
7
|
+
* The number of skeleton cells to render in each row.
|
|
8
|
+
*/
|
|
9
|
+
columnCount: number;
|
|
10
|
+
};
|
|
11
|
+
export default function DataTableSkeletonRows({ rowCount, columnCount, }: Props): import('react').JSX.Element;
|
|
@@ -45,13 +45,14 @@ import DataTableCell from "@packages/components/DataTable/DataTableCell/DataTabl
|
|
|
45
45
|
import DataTable from "@packages/components/DataTable/DataTable";
|
|
46
46
|
import CheckboxGroup from "../CheckboxGroup/CheckboxGroup";
|
|
47
47
|
import Checkbox from "../Checkbox/Checkbox";
|
|
48
|
-
import
|
|
48
|
+
import RadioGroup from "../RadioGroup/RadioGroup";
|
|
49
|
+
import RadioGroupItem from "../RadioGroupItem/RadioGroupItem";
|
|
49
50
|
import { I18nProvider } from "react-aria-components";
|
|
50
51
|
import Select from "../Select/Select";
|
|
51
52
|
import SelectItem from "../SelectItem/SelectItem";
|
|
52
53
|
import Button from "../Button/Button";
|
|
53
54
|
import Switch from "../Switch/Switch";
|
|
54
|
-
import { within } from "storybook/test";
|
|
55
|
+
import { expect, within } from "storybook/test";
|
|
55
56
|
import { someTime } from "@internal/test-utils-storybook/test-utils-storybook";
|
|
56
57
|
import DataTableRoot from "./DataTableRoot/DataTableRoot";
|
|
57
58
|
import DataTableRow from "./DataTableRow/DataTableRow";
|
|
@@ -160,9 +161,13 @@ export const WithReactTableFrontEndManaged: StoryObj<typeof DataTable> = {
|
|
|
160
161
|
[],
|
|
161
162
|
);
|
|
162
163
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
// Fetch the whole dataset once: filtering, sorting and pagination happen client-side
|
|
165
|
+
// `isLoading` is only true on the first load, while there is no data yet
|
|
166
|
+
const { data, isLoading } = useQuery({
|
|
167
|
+
queryKey: ["all-users"],
|
|
168
|
+
queryFn: async (): Promise<Array<User>> => {
|
|
169
|
+
await someTime(100); // Your API call goes here
|
|
170
|
+
return arrayOfLength(300).map((index) => ({
|
|
166
171
|
firstname: `Firstname ${index + 1}`,
|
|
167
172
|
lastname: `Lastname ${index + 1}`,
|
|
168
173
|
email: `john-doe${index + 1}@example.com`,
|
|
@@ -171,9 +176,13 @@ export const WithReactTableFrontEndManaged: StoryObj<typeof DataTable> = {
|
|
|
171
176
|
day: DAYS[index % DAYS.length],
|
|
172
177
|
organization: ORGANIZATIONS[index % ORGANIZATIONS.length],
|
|
173
178
|
isActive: index % 2 === 0,
|
|
174
|
-
}))
|
|
175
|
-
|
|
176
|
-
);
|
|
179
|
+
}));
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// The table data needs a stable reference: an inline `data ?? []` would create a new array on every render while loading
|
|
184
|
+
// ⚠ This should be memoized!
|
|
185
|
+
const users = useMemo(() => data ?? [], [data]);
|
|
177
186
|
|
|
178
187
|
// Here starts the interesting stuff: columns definitions.
|
|
179
188
|
// All the features of the filters comes from those columns definitions
|
|
@@ -213,18 +222,17 @@ export const WithReactTableFrontEndManaged: StoryObj<typeof DataTable> = {
|
|
|
213
222
|
filterFn: "equals",
|
|
214
223
|
meta: {
|
|
215
224
|
FilterInDrawer: ({ column }) => (
|
|
216
|
-
<
|
|
217
|
-
|
|
218
|
-
|
|
225
|
+
<RadioGroup
|
|
226
|
+
label="Filter by day"
|
|
227
|
+
value={
|
|
228
|
+
(column.getFilterValue() as string | undefined) ?? null
|
|
229
|
+
}
|
|
230
|
+
onChange={(day) => column.setFilterValue(day)}
|
|
231
|
+
>
|
|
219
232
|
{DAYS.map((day) => (
|
|
220
|
-
<
|
|
221
|
-
label={day}
|
|
222
|
-
key={day}
|
|
223
|
-
checked={column.getFilterValue() === day}
|
|
224
|
-
onChange={() => column.setFilterValue(day)}
|
|
225
|
-
/>
|
|
233
|
+
<RadioGroupItem label={day} key={day} value={day} />
|
|
226
234
|
))}
|
|
227
|
-
</
|
|
235
|
+
</RadioGroup>
|
|
228
236
|
),
|
|
229
237
|
} satisfies TypeTableColumnWithFilter<
|
|
230
238
|
typeof clientFeatures,
|
|
@@ -347,7 +355,7 @@ export const WithReactTableFrontEndManaged: StoryObj<typeof DataTable> = {
|
|
|
347
355
|
// And here we define the table as usual
|
|
348
356
|
const table = useTable({
|
|
349
357
|
features: clientFeatures,
|
|
350
|
-
data,
|
|
358
|
+
data: users,
|
|
351
359
|
columns,
|
|
352
360
|
initialState: {
|
|
353
361
|
globalFilter: "", // Add this to show the global filter (aka the Search bar)
|
|
@@ -400,6 +408,7 @@ export const WithReactTableFrontEndManaged: StoryObj<typeof DataTable> = {
|
|
|
400
408
|
table={table}
|
|
401
409
|
pagination={pagination}
|
|
402
410
|
itemsPerPageOptions={[12, 24, 36, 48, 60]} // Add this to customize the page size options available in the select
|
|
411
|
+
isLoading={isLoading}
|
|
403
412
|
/>
|
|
404
413
|
</>
|
|
405
414
|
);
|
|
@@ -407,6 +416,10 @@ export const WithReactTableFrontEndManaged: StoryObj<typeof DataTable> = {
|
|
|
407
416
|
|
|
408
417
|
return <ParentComponent />;
|
|
409
418
|
},
|
|
419
|
+
play: async ({ canvasElement }) => {
|
|
420
|
+
const canvas = within(canvasElement);
|
|
421
|
+
await canvas.findByText("Firstname 1");
|
|
422
|
+
},
|
|
410
423
|
};
|
|
411
424
|
|
|
412
425
|
type User = {
|
|
@@ -485,7 +498,8 @@ export const WithReactTableBackEndManaged: StoryObj<typeof DataTable> = {
|
|
|
485
498
|
);
|
|
486
499
|
|
|
487
500
|
// Fetch data using the table state (filters, pagination, sorting, etc.)
|
|
488
|
-
|
|
501
|
+
// `isLoading` is only true on the first load: on refetch, `keepPreviousData` keeps the current rows displayed
|
|
502
|
+
const { data, isLoading } = useQuery({
|
|
489
503
|
placeholderData: keepPreviousData, // from @tanstack/react-query, recommended to use it in this scenario
|
|
490
504
|
queryKey: ["users", pagination, sorting, columnFilters],
|
|
491
505
|
queryFn: () =>
|
|
@@ -499,6 +513,10 @@ export const WithReactTableBackEndManaged: StoryObj<typeof DataTable> = {
|
|
|
499
513
|
}),
|
|
500
514
|
});
|
|
501
515
|
|
|
516
|
+
// The table data needs a stable reference: an inline `data?.data ?? []` would create a new array on every render while loading
|
|
517
|
+
// ⚠ This should be memoized!
|
|
518
|
+
const users = useMemo(() => data?.data ?? [], [data]);
|
|
519
|
+
|
|
502
520
|
// You will need to create a column helper, typed with the registered features
|
|
503
521
|
// ⚠ This should be memoized!
|
|
504
522
|
const columnHelper = useMemo(
|
|
@@ -595,7 +613,7 @@ export const WithReactTableBackEndManaged: StoryObj<typeof DataTable> = {
|
|
|
595
613
|
// Instantiate the table with @tanstack/react-table
|
|
596
614
|
const table = useTable({
|
|
597
615
|
features: serverFeatures,
|
|
598
|
-
data:
|
|
616
|
+
data: users,
|
|
599
617
|
columns,
|
|
600
618
|
manualPagination: true,
|
|
601
619
|
manualSorting: true,
|
|
@@ -615,7 +633,11 @@ export const WithReactTableBackEndManaged: StoryObj<typeof DataTable> = {
|
|
|
615
633
|
return (
|
|
616
634
|
<>
|
|
617
635
|
<Filter table={table} />
|
|
618
|
-
<DataTable
|
|
636
|
+
<DataTable
|
|
637
|
+
table={table}
|
|
638
|
+
pagination={pagination}
|
|
639
|
+
isLoading={isLoading}
|
|
640
|
+
/>
|
|
619
641
|
</>
|
|
620
642
|
);
|
|
621
643
|
}
|
|
@@ -677,6 +699,85 @@ export const Empty: StoryObj<typeof DataTable> = {
|
|
|
677
699
|
},
|
|
678
700
|
};
|
|
679
701
|
|
|
702
|
+
export const Loading: StoryObj<typeof DataTable> = {
|
|
703
|
+
render: () => {
|
|
704
|
+
const ParentComponent = () => {
|
|
705
|
+
const columnHelper = useMemo(
|
|
706
|
+
() => createColumnHelper<typeof clientFeatures, User>(),
|
|
707
|
+
[],
|
|
708
|
+
);
|
|
709
|
+
|
|
710
|
+
const data = useMemo(() => [], []);
|
|
711
|
+
|
|
712
|
+
const columns = useMemo(
|
|
713
|
+
() =>
|
|
714
|
+
columnHelper.columns([
|
|
715
|
+
columnHelper.accessor("firstname", {
|
|
716
|
+
header: ({ header }) => (
|
|
717
|
+
<DataTableHeader
|
|
718
|
+
onSortClick={header.column.getToggleSortingHandler()}
|
|
719
|
+
sortDirection={header.column.getIsSorted() || "none"}
|
|
720
|
+
text="Firstname"
|
|
721
|
+
/>
|
|
722
|
+
),
|
|
723
|
+
cell: (props) => (
|
|
724
|
+
<DataTableCell>{props.getValue()}</DataTableCell>
|
|
725
|
+
),
|
|
726
|
+
}),
|
|
727
|
+
columnHelper.accessor("lastname", {
|
|
728
|
+
header: () => <DataTableHeader text="Lastname" />,
|
|
729
|
+
cell: (props) => (
|
|
730
|
+
<DataTableCell>{props.getValue()}</DataTableCell>
|
|
731
|
+
),
|
|
732
|
+
}),
|
|
733
|
+
columnHelper.accessor("email", {
|
|
734
|
+
header: () => <DataTableHeader text="Email" />,
|
|
735
|
+
cell: (props) => (
|
|
736
|
+
<DataTableCell>{props.getValue()}</DataTableCell>
|
|
737
|
+
),
|
|
738
|
+
}),
|
|
739
|
+
]),
|
|
740
|
+
[columnHelper],
|
|
741
|
+
);
|
|
742
|
+
|
|
743
|
+
const table = useTable({
|
|
744
|
+
features: clientFeatures,
|
|
745
|
+
data,
|
|
746
|
+
columns,
|
|
747
|
+
initialState: {
|
|
748
|
+
pagination: { pageIndex: 0, pageSize: 10 },
|
|
749
|
+
},
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
const pagination = table.state.pagination;
|
|
753
|
+
|
|
754
|
+
return <DataTable table={table} pagination={pagination} isLoading />;
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
return <ParentComponent />;
|
|
758
|
+
},
|
|
759
|
+
play: async ({ canvasElement }) => {
|
|
760
|
+
const canvas = within(canvasElement);
|
|
761
|
+
|
|
762
|
+
await expect(canvas.getByRole("table")).toHaveAttribute(
|
|
763
|
+
"aria-busy",
|
|
764
|
+
"true",
|
|
765
|
+
);
|
|
766
|
+
await expect(canvas.getAllByRole("columnheader")).toHaveLength(3);
|
|
767
|
+
// 1 skeleton row per item of the page (pageSize: 10)
|
|
768
|
+
await expect(
|
|
769
|
+
canvasElement.querySelectorAll(
|
|
770
|
+
'[data-design-system-component="DataTableSkeletonRows"]',
|
|
771
|
+
),
|
|
772
|
+
).toHaveLength(10);
|
|
773
|
+
// Skeleton rows are hidden from assistive technologies: only the header row is exposed
|
|
774
|
+
await expect(canvas.getAllByRole("row")).toHaveLength(1);
|
|
775
|
+
await expect(
|
|
776
|
+
canvas.queryByText("Sorry, there is currently no data to display."),
|
|
777
|
+
).not.toBeInTheDocument();
|
|
778
|
+
},
|
|
779
|
+
};
|
|
780
|
+
|
|
680
781
|
export const WithSubColumns: StoryObj<typeof DataTable> = {
|
|
681
782
|
render: () => {
|
|
682
783
|
const data: Array<User> = arrayOfLength(300).map((index) => ({
|
|
@@ -51,7 +51,8 @@ import {
|
|
|
51
51
|
} from "@tanstack/react-table";
|
|
52
52
|
import DataTableHeader from "../DataTable/DataTableHeader/DataTableHeader";
|
|
53
53
|
import DataTableCell from "../DataTable/DataTableCell/DataTableCell";
|
|
54
|
-
import
|
|
54
|
+
import RadioGroup from "../RadioGroup/RadioGroup";
|
|
55
|
+
import RadioGroupItem from "../RadioGroupItem/RadioGroupItem";
|
|
55
56
|
import Filter, { TypeTableColumnWithFilter } from "../Filter/Filter";
|
|
56
57
|
import CheckboxGroup from "../CheckboxGroup/CheckboxGroup";
|
|
57
58
|
import Checkbox from "../Checkbox/Checkbox";
|
|
@@ -307,18 +308,17 @@ export const PageLayoutWithDataTable: Story = {
|
|
|
307
308
|
filterFn: "equals",
|
|
308
309
|
meta: {
|
|
309
310
|
FilterInDrawer: ({ column }) => (
|
|
310
|
-
<
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
<RadioGroup
|
|
312
|
+
label="Filter by day"
|
|
313
|
+
value={
|
|
314
|
+
(column.getFilterValue() as string | undefined) ?? null
|
|
315
|
+
}
|
|
316
|
+
onChange={(day) => column.setFilterValue(day)}
|
|
317
|
+
>
|
|
313
318
|
{DAYS.map((day) => (
|
|
314
|
-
<
|
|
315
|
-
label={day}
|
|
316
|
-
key={day}
|
|
317
|
-
checked={column.getFilterValue() === day}
|
|
318
|
-
onChange={() => column.setFilterValue(day)}
|
|
319
|
-
/>
|
|
319
|
+
<RadioGroupItem label={day} key={day} value={day} />
|
|
320
320
|
))}
|
|
321
|
-
</
|
|
321
|
+
</RadioGroup>
|
|
322
322
|
),
|
|
323
323
|
} satisfies TypeTableColumnWithFilter<
|
|
324
324
|
typeof tableFeaturesSet,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `RadioGroup` with `RadioGroupItem` instead.
|
|
4
|
+
*/
|
|
2
5
|
export type Props = Omit<React.HTMLProps<HTMLInputElement>, "label" | "type"> & {
|
|
3
6
|
/**
|
|
4
7
|
* The text to display next to the radio button.
|
|
@@ -13,5 +16,9 @@ export type Props = Omit<React.HTMLProps<HTMLInputElement>, "label" | "type"> &
|
|
|
13
16
|
*/
|
|
14
17
|
wrapperProps?: React.HTMLProps<HTMLDivElement>;
|
|
15
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `RadioGroup` with `RadioGroupItem` instead: it names the group,
|
|
21
|
+
* handles keyboard navigation and displays helper and error texts.
|
|
22
|
+
*/
|
|
16
23
|
declare const Radio: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
17
24
|
export default Radio;
|
|
@@ -350,6 +350,10 @@ import * as RadioTests from "./tests/Radio.stories";
|
|
|
350
350
|
|
|
351
351
|
# Radio
|
|
352
352
|
|
|
353
|
+
> **Deprecated** — use `RadioGroup` with `RadioGroupItem` instead. It names the group for
|
|
354
|
+
> assistive technologies, handles keyboard navigation (one tab stop, arrow keys) and displays
|
|
355
|
+
> helper and error texts. See the "Migrating from `Radio`" section of the `RadioGroup` docs.
|
|
356
|
+
|
|
353
357
|
Use this component exactly like an `<input type="radio">` but with an added `label` prop.
|
|
354
358
|
|
|
355
359
|
<Canvas of={Radio.WithLabel} />
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Props as LabelProps } from '../Label/Label';
|
|
3
|
+
import { Props as FormGroupWrapperProps } from '../../internal-components/FormGroupWrapper/FormGroupWrapper';
|
|
4
|
+
export type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* The `RadioGroupItem`s to display in the group.
|
|
7
|
+
*/
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* The value of the selected radio (controlled). `null` means no radio is selected.
|
|
11
|
+
*/
|
|
12
|
+
value?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* The value of the radio selected on first render (uncontrolled).
|
|
15
|
+
*/
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Handler that is called with the value of the newly selected radio.
|
|
19
|
+
*/
|
|
20
|
+
onChange?: (value: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* The name of the radios, used when submitting an HTML form.
|
|
23
|
+
*/
|
|
24
|
+
name?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether all the radios of the group are disabled.
|
|
27
|
+
*/
|
|
28
|
+
isDisabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the radios can be focused but not changed by the user.
|
|
31
|
+
*/
|
|
32
|
+
isReadOnly?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Layout of the radios inside the group.
|
|
35
|
+
* @default "vertical"
|
|
36
|
+
*/
|
|
37
|
+
direction?: "vertical" | "horizontal";
|
|
38
|
+
/**
|
|
39
|
+
* Accessible name of the group, required when `label` is not a string.
|
|
40
|
+
*/
|
|
41
|
+
"aria-label"?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Props to pass to the wrapper div (for example, `style` or `className`).
|
|
44
|
+
*/
|
|
45
|
+
wrapperProps?: React.HTMLProps<HTMLDivElement>;
|
|
46
|
+
} & Pick<LabelProps, "label" | "labelIconRight" | "labelIconRightTooltip" | "required"> & Pick<FormGroupWrapperProps, "helperText" | "helperTextIcon" | "errorHelperText" | "errorHelperTextIcon" | "successHelperText" | "successHelperTextIcon" | "warningHelperText" | "warningHelperTextIcon" | "orientation" | "className" | "style">;
|
|
47
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<{
|
|
48
|
+
/**
|
|
49
|
+
* The `RadioGroupItem`s to display in the group.
|
|
50
|
+
*/
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* The value of the selected radio (controlled). `null` means no radio is selected.
|
|
54
|
+
*/
|
|
55
|
+
value?: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* The value of the radio selected on first render (uncontrolled).
|
|
58
|
+
*/
|
|
59
|
+
defaultValue?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Handler that is called with the value of the newly selected radio.
|
|
62
|
+
*/
|
|
63
|
+
onChange?: (value: string) => void;
|
|
64
|
+
/**
|
|
65
|
+
* The name of the radios, used when submitting an HTML form.
|
|
66
|
+
*/
|
|
67
|
+
name?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Whether all the radios of the group are disabled.
|
|
70
|
+
*/
|
|
71
|
+
isDisabled?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the radios can be focused but not changed by the user.
|
|
74
|
+
*/
|
|
75
|
+
isReadOnly?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Layout of the radios inside the group.
|
|
78
|
+
* @default "vertical"
|
|
79
|
+
*/
|
|
80
|
+
direction?: "vertical" | "horizontal";
|
|
81
|
+
/**
|
|
82
|
+
* Accessible name of the group, required when `label` is not a string.
|
|
83
|
+
*/
|
|
84
|
+
"aria-label"?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Props to pass to the wrapper div (for example, `style` or `className`).
|
|
87
|
+
*/
|
|
88
|
+
wrapperProps?: React.HTMLProps<HTMLDivElement>;
|
|
89
|
+
} & Pick<LabelProps, "label" | "required" | "labelIconRight" | "labelIconRightTooltip"> & Pick<FormGroupWrapperProps, "className" | "style" | "orientation" | "helperText" | "helperTextIcon" | "errorHelperText" | "errorHelperTextIcon" | "successHelperText" | "successHelperTextIcon" | "warningHelperText" | "warningHelperTextIcon"> & React.RefAttributes<{
|
|
90
|
+
focus: (options?: FocusOptions) => void;
|
|
91
|
+
}>>;
|
|
92
|
+
export default RadioGroup;
|