widenarrow-ui 2.2.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/lib/index.css +1 -1
- package/lib/index.d.ts +354 -26
- package/lib/index.esm.css +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import react__default, { CSSProperties, MouseEvent, RefObject, ReactNode, ChangeEvent, KeyboardEvent, FocusEvent, FC } from 'react';
|
|
2
|
+
import react__default, { CSSProperties, MouseEvent, RefObject, ReactNode, ChangeEvent, KeyboardEvent, FocusEvent, FC, AriaAttributes } from 'react';
|
|
3
3
|
import { Placement, PositioningStrategy } from '@popperjs/core';
|
|
4
4
|
|
|
5
5
|
declare enum IconTypes {
|
|
@@ -280,6 +280,15 @@ declare enum HierarchyTypes {
|
|
|
280
280
|
TERTIARY = "tertiary",
|
|
281
281
|
QUATERNARY = "quaternary"
|
|
282
282
|
}
|
|
283
|
+
declare enum LinkTypes {
|
|
284
|
+
PRIMARY = "colorPrimary",
|
|
285
|
+
SECONDARY = "colorSecondary",
|
|
286
|
+
WHITE = "colorWhite"
|
|
287
|
+
}
|
|
288
|
+
declare enum TableTypes {
|
|
289
|
+
RULED = "ruled",
|
|
290
|
+
CARDS = "cards"
|
|
291
|
+
}
|
|
283
292
|
declare enum AspectRatioTypes {
|
|
284
293
|
ar4_1 = "ar4_1",// 25 %
|
|
285
294
|
ar3_1 = "ar3_1",// 33 %
|
|
@@ -502,13 +511,19 @@ interface ButtonProps {
|
|
|
502
511
|
/** @default false */
|
|
503
512
|
autoFocus?: boolean;
|
|
504
513
|
ariaLabel?: string;
|
|
514
|
+
/** ARIA role for the rendered button, when it stands for something other than a plain button. */
|
|
515
|
+
role?: string;
|
|
516
|
+
/** Selected state, for roles that carry one such as 'tab'. */
|
|
517
|
+
ariaSelected?: boolean;
|
|
518
|
+
/** Id of the element this button controls, for roles such as 'tab' that own a panel. */
|
|
519
|
+
ariaControls?: string;
|
|
505
520
|
children?: ReactNode;
|
|
506
521
|
toolTip?: string;
|
|
507
522
|
toolTipComponent?: ReactNode;
|
|
508
523
|
tabIndex?: number;
|
|
509
524
|
}
|
|
510
525
|
|
|
511
|
-
declare const Button: react.MemoExoticComponent<({ className, id, style, type, size, sizeMd, sizeLg, sizeXl, text, toolTip, toolTipComponent, icon, buttonRef, iconSize, iconColor, leftIcon, rightIcon, withIconRight, rotateIconByDegree, withEllipsis, onClickCallback, loading, disabled, children, autoFocus, ariaLabel, tabIndex }: ButtonProps) => JSX.Element>;
|
|
526
|
+
declare const Button: react.MemoExoticComponent<({ className, id, style, type, size, sizeMd, sizeLg, sizeXl, text, toolTip, toolTipComponent, icon, buttonRef, iconSize, iconColor, leftIcon, rightIcon, withIconRight, rotateIconByDegree, withEllipsis, onClickCallback, loading, disabled, children, autoFocus, ariaLabel, role, ariaSelected, ariaControls, tabIndex }: ButtonProps) => JSX.Element>;
|
|
512
527
|
|
|
513
528
|
interface CheckboxProps {
|
|
514
529
|
label: string;
|
|
@@ -1059,6 +1074,51 @@ interface InlineButtonProps {
|
|
|
1059
1074
|
|
|
1060
1075
|
declare const InlineButton: react.MemoExoticComponent<({ className, id, loading, ariaLabel, text, buttonRef, style, size, sizeMd, sizeLg, sizeXl, type, textClassName, children, icon, withIconRight, withoutHoverEffect, withPrimaryHoverEffect, withSecondaryHoverEffect, withTertiaryHoverEffect, iconSize, autoFocus, iconClassName, tabIndex, rotateIcon, rotateIconByDegree, onClickCallback, withEllipsis, disabled, toolTip, toolTipComponent }: InlineButtonProps) => JSX.Element>;
|
|
1061
1076
|
|
|
1077
|
+
interface LinkProps {
|
|
1078
|
+
href?: string;
|
|
1079
|
+
/** Renders a react-router Link instead of an anchor. Requires a surrounding Router. */
|
|
1080
|
+
to?: string;
|
|
1081
|
+
text?: string;
|
|
1082
|
+
icon?: Partial<IconTypes>;
|
|
1083
|
+
/** @default ColorTypes.CURRENT */
|
|
1084
|
+
iconColor?: Partial<ColorTypes>;
|
|
1085
|
+
/** @default '_blank' */
|
|
1086
|
+
target?: '_blank' | '_self';
|
|
1087
|
+
children?: ReactNode;
|
|
1088
|
+
onClickCallback?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
1089
|
+
/** The link leads to a site outside the domain */
|
|
1090
|
+
external?: boolean;
|
|
1091
|
+
/** @default LinkTypes.SECONDARY */
|
|
1092
|
+
color?: LinkTypes.SECONDARY | LinkTypes.PRIMARY | LinkTypes.WHITE;
|
|
1093
|
+
/** @default '600' */
|
|
1094
|
+
fontWeight?: '300' | '400' | '600' | '700';
|
|
1095
|
+
/** @default 'm' */
|
|
1096
|
+
fontSize?: 's' | 'm' | 'l';
|
|
1097
|
+
className?: string;
|
|
1098
|
+
iconClassName?: string;
|
|
1099
|
+
/** Applied to the element wrapping the link's text, for callers that need to style the label itself. */
|
|
1100
|
+
textClassName?: string;
|
|
1101
|
+
ariaLabel?: string;
|
|
1102
|
+
/**
|
|
1103
|
+
* Marks this link as the one matching the current view, e.g. 'page' for the open item in a
|
|
1104
|
+
* navigation list. Set it yourself rather than relying on route matching, so callers that decide
|
|
1105
|
+
* "current" their own way stay authoritative.
|
|
1106
|
+
*/
|
|
1107
|
+
ariaCurrent?: AriaAttributes['aria-current'];
|
|
1108
|
+
/** @default false */
|
|
1109
|
+
disabled?: boolean;
|
|
1110
|
+
/** @default true */
|
|
1111
|
+
withIconRight?: boolean;
|
|
1112
|
+
/** @default false */
|
|
1113
|
+
displayAsButton?: boolean;
|
|
1114
|
+
/** @default false */
|
|
1115
|
+
withEllipsis?: boolean;
|
|
1116
|
+
/** @default false */
|
|
1117
|
+
withWordBreak?: boolean;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
declare const Link: FC<LinkProps>;
|
|
1121
|
+
|
|
1062
1122
|
interface IconInterface {
|
|
1063
1123
|
loading?: boolean;
|
|
1064
1124
|
disabled?: boolean;
|
|
@@ -1108,6 +1168,65 @@ declare const TextAreaInput: {
|
|
|
1108
1168
|
displayName: string;
|
|
1109
1169
|
};
|
|
1110
1170
|
|
|
1171
|
+
interface ListButtonProps {
|
|
1172
|
+
/** Label of the row. Fades out under a gradient when it is too long to fit. */
|
|
1173
|
+
text: string;
|
|
1174
|
+
/**
|
|
1175
|
+
* Renders the row as a react-router link rather than a button, so that middle click and
|
|
1176
|
+
* open-in-new-tab keep working. Requires a surrounding Router.
|
|
1177
|
+
*/
|
|
1178
|
+
to?: string;
|
|
1179
|
+
/** Applied to the row, for spacing and for restyling the row itself. */
|
|
1180
|
+
className?: string;
|
|
1181
|
+
/** Applied to the clickable area holding the icon and the label. */
|
|
1182
|
+
buttonClassName?: string;
|
|
1183
|
+
/**
|
|
1184
|
+
* Applied to the label. A caller that gives the row its own background needs this to match the
|
|
1185
|
+
* fadeout to it, since the gradient has to end in the colour behind the text.
|
|
1186
|
+
*/
|
|
1187
|
+
labelClassName?: string;
|
|
1188
|
+
iconClassName?: string;
|
|
1189
|
+
icon?: Partial<IconTypes>;
|
|
1190
|
+
/** Shown at the end of the row at all times, for badges, spinners or status dots. */
|
|
1191
|
+
rightComponent?: ReactNode;
|
|
1192
|
+
/**
|
|
1193
|
+
* Shown at the end of the row on hover and on keyboard focus. Replaces `rightComponent` while
|
|
1194
|
+
* visible; neither reserves space while hidden, so the label keeps the full width until then.
|
|
1195
|
+
*/
|
|
1196
|
+
hoverComponent?: ReactNode;
|
|
1197
|
+
/** Renders the row in its selected colours. */
|
|
1198
|
+
selected?: boolean;
|
|
1199
|
+
/** @default false */
|
|
1200
|
+
disabled?: boolean;
|
|
1201
|
+
/** @default SizeTypes.SMALL */
|
|
1202
|
+
size?: SizeTypes.SMALL | SizeTypes.MEDIUM;
|
|
1203
|
+
id?: string;
|
|
1204
|
+
/** Use when `text` alone does not describe the action. */
|
|
1205
|
+
ariaLabel?: string;
|
|
1206
|
+
/** Button variant only. */
|
|
1207
|
+
toolTip?: string;
|
|
1208
|
+
/** Button variant only. */
|
|
1209
|
+
tabIndex?: number;
|
|
1210
|
+
/** Button variant only. @default false */
|
|
1211
|
+
autoFocus?: boolean;
|
|
1212
|
+
/** Button variant only. */
|
|
1213
|
+
buttonRef?: RefObject<HTMLButtonElement>;
|
|
1214
|
+
onClickCallback?: () => void;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* A full width row that reads as a single button: an optional icon, a label that fades out rather
|
|
1219
|
+
* than ellipsises when it overflows, and an end slot whose contents swap on hover.
|
|
1220
|
+
*
|
|
1221
|
+
* The row and the clickable area are separate elements so that `rightComponent` and `hoverComponent`
|
|
1222
|
+
* can hold their own buttons without nesting them inside this one. Without `to` the clickable area
|
|
1223
|
+
* is an InlineButton and its props carry through; with `to` it is a link.
|
|
1224
|
+
*/
|
|
1225
|
+
declare const ListButton: {
|
|
1226
|
+
({ text, to, className, buttonClassName, labelClassName, iconClassName, icon, rightComponent, hoverComponent, selected, disabled, size, id, ariaLabel, toolTip, tabIndex, autoFocus, buttonRef, onClickCallback }: ListButtonProps): JSX.Element;
|
|
1227
|
+
displayName: string;
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1111
1230
|
interface ListItemProps extends MarginInterface, PaddingInterface {
|
|
1112
1231
|
id?: string;
|
|
1113
1232
|
buttonsComponent?: ReactNode;
|
|
@@ -1263,58 +1382,78 @@ declare const SolidSpinner: {
|
|
|
1263
1382
|
displayName: string;
|
|
1264
1383
|
};
|
|
1265
1384
|
|
|
1266
|
-
interface
|
|
1385
|
+
interface SortableTableCellInterface {
|
|
1386
|
+
/** Key on each `data` row whose value fills this column. Also the key handed to `onSortCallback` and matched against `sortBy`. */
|
|
1267
1387
|
key: string;
|
|
1388
|
+
/** Visible column heading. */
|
|
1268
1389
|
title: string;
|
|
1390
|
+
/** Column width, as a percentage (`'25%'`) or a fixed value (`'120px'`). Applied inline to both the header and body cells. */
|
|
1269
1391
|
width: string;
|
|
1270
|
-
|
|
1392
|
+
/** Renders the heading as static text with no sort button. @default false */
|
|
1271
1393
|
disableSort?: boolean;
|
|
1394
|
+
/** Right-aligns the cell contents, and moves the sort chevron to the left of the heading. @default false */
|
|
1272
1395
|
alignRight?: boolean;
|
|
1396
|
+
/** Centres the cell contents. @default false */
|
|
1273
1397
|
alignCenter?: boolean;
|
|
1398
|
+
/** Truncates overflowing cell content with an ellipsis instead of wrapping. @default false */
|
|
1274
1399
|
withEllipsis?: boolean;
|
|
1400
|
+
/** Tooltip on the heading. Falls back to `title` when omitted. */
|
|
1275
1401
|
toolTip?: string;
|
|
1402
|
+
/** Applied to the content span inside every body cell of this column, not to the cell itself. */
|
|
1276
1403
|
className?: string;
|
|
1277
|
-
|
|
1404
|
+
/** Replaces the whole heading, including the sort button. Receives the cell config. */
|
|
1405
|
+
customHeaderCellComponent?: (cell: SortableTableCellInterface) => ReactNode | JSX.Element;
|
|
1406
|
+
/** Replaces the cell value. Receives the whole row, so it can read keys other than `key`. */
|
|
1278
1407
|
customCellComponent?: (row: any) => ReactNode | JSX.Element;
|
|
1279
1408
|
}
|
|
1280
1409
|
interface SortableTableProps {
|
|
1410
|
+
/** Applied to the outer container element. */
|
|
1281
1411
|
id?: string;
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
className?: string;
|
|
1293
|
-
customHeaderCellComponent?: (cell: CellInterface) => ReactNode | JSX.Element;
|
|
1294
|
-
customCellComponent?: (row: any) => ReactNode | JSX.Element;
|
|
1295
|
-
}>;
|
|
1412
|
+
/**
|
|
1413
|
+
* Visual treatment. `RULED` separates rows with a hairline. `CARDS` gives each row a white
|
|
1414
|
+
* background, rounded corners and a gap, which only reads as separate rows against a tinted
|
|
1415
|
+
* page — put it on `$application-background`, not inside a white card.
|
|
1416
|
+
* @default TableTypes.RULED
|
|
1417
|
+
*/
|
|
1418
|
+
type?: TableTypes.RULED | TableTypes.CARDS;
|
|
1419
|
+
/** Column configuration, in render order. */
|
|
1420
|
+
cells: Array<SortableTableCellInterface>;
|
|
1421
|
+
/** Row objects. Each is passed to `customCellComponent`, and indexed by `cell.key` otherwise. */
|
|
1296
1422
|
data: Array<any>;
|
|
1423
|
+
/**
|
|
1424
|
+
* Active sort. Without `onSortCallback` the table sorts `data` itself and treats this as the initial
|
|
1425
|
+
* state only; with `onSortCallback` the table is controlled and this must reflect the current sort.
|
|
1426
|
+
* @default [{ keyName: 'name', ascending: true }]
|
|
1427
|
+
*/
|
|
1297
1428
|
sortBy: Array<{
|
|
1298
1429
|
keyName: string;
|
|
1299
1430
|
ascending: boolean;
|
|
1300
1431
|
}>;
|
|
1432
|
+
/** Applied to the outer container element. */
|
|
1301
1433
|
className?: string;
|
|
1434
|
+
/** Applied to every body row. */
|
|
1302
1435
|
rowClassName?: string;
|
|
1436
|
+
/** Applied to the header row. */
|
|
1303
1437
|
headerClassName?: string;
|
|
1438
|
+
/** Applied to the `tbody`. */
|
|
1304
1439
|
bodyClassName?: string;
|
|
1440
|
+
/** Applied to the loading spinner. */
|
|
1305
1441
|
spinnerClassName?: string;
|
|
1442
|
+
/** Accessible table description. Visually hidden, so it is for screen readers only. */
|
|
1306
1443
|
caption?: string;
|
|
1307
|
-
/** @default false */
|
|
1444
|
+
/** Replaces rows with skeleton placeholders and shows a spinner. Sorting is disabled while true. @default false */
|
|
1308
1445
|
loading?: boolean;
|
|
1309
|
-
/** @default 6 */
|
|
1446
|
+
/** Number of skeleton rows to render while `loading`. @default 6 */
|
|
1310
1447
|
skeletonRows?: number;
|
|
1311
|
-
/** @default false */
|
|
1448
|
+
/** Pins the header to the top of the nearest scroll container. @default false */
|
|
1312
1449
|
withStickyHeader?: boolean;
|
|
1313
|
-
/** @default false */
|
|
1450
|
+
/** Defers rendering each row until it scrolls into view. For long lists. @default false */
|
|
1314
1451
|
withIntersectionObserver?: boolean;
|
|
1452
|
+
/** Minimum table width, e.g. `'900px'`. Makes the container scroll horizontally below it. */
|
|
1315
1453
|
minWidth?: string;
|
|
1454
|
+
/** Takes over sorting. When given, the table stops sorting `data` and becomes controlled by `sortBy`. */
|
|
1316
1455
|
onSortCallback?: (keyName: string, ascending: boolean) => void;
|
|
1317
|
-
|
|
1456
|
+
/** Shown in place of the rows when `data` is empty and `loading` is false. */
|
|
1318
1457
|
noDataMessage?: {
|
|
1319
1458
|
title?: string;
|
|
1320
1459
|
icon?: Partial<IconTypes>;
|
|
@@ -1323,10 +1462,90 @@ interface SortableTableProps {
|
|
|
1323
1462
|
}
|
|
1324
1463
|
|
|
1325
1464
|
declare const SortableTable: {
|
|
1326
|
-
({ id, cells, data, sortBy, skeletonRows, loading, caption, className, headerClassName, rowClassName, bodyClassName, spinnerClassName, withStickyHeader, withIntersectionObserver, noDataMessage, minWidth, onSortCallback }: SortableTableProps): JSX.Element;
|
|
1465
|
+
({ id, cells, data, sortBy, skeletonRows, loading, caption, className, headerClassName, rowClassName, bodyClassName, spinnerClassName, withStickyHeader, withIntersectionObserver, noDataMessage, minWidth, onSortCallback, type }: SortableTableProps): JSX.Element;
|
|
1327
1466
|
displayName: string;
|
|
1328
1467
|
};
|
|
1329
1468
|
|
|
1469
|
+
interface TableAction {
|
|
1470
|
+
icon: Partial<IconTypes>;
|
|
1471
|
+
/** Tooltip, and the accessible name of the button. Required, because the button has no visible text. */
|
|
1472
|
+
toolTip: string;
|
|
1473
|
+
onClickCallback: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
1474
|
+
/** @default false */
|
|
1475
|
+
disabled?: boolean;
|
|
1476
|
+
id?: string;
|
|
1477
|
+
}
|
|
1478
|
+
interface TableActionsCellProps {
|
|
1479
|
+
/** Buttons to render, in order. */
|
|
1480
|
+
actions: Array<TableAction>;
|
|
1481
|
+
/** Size of every button in the group. @default SizeTypes.SMALL */
|
|
1482
|
+
size?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1483
|
+
/** Text shown before the buttons. For bulk headers, e.g. "3 selected". */
|
|
1484
|
+
label?: string;
|
|
1485
|
+
className?: string;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
declare const TableActionsCell: FC<TableActionsCellProps>;
|
|
1489
|
+
|
|
1490
|
+
interface TableSelectionCellProps {
|
|
1491
|
+
/** Whether this row is selected. */
|
|
1492
|
+
checked: boolean;
|
|
1493
|
+
/** Fired with the next selected state. */
|
|
1494
|
+
onChangeCallback: (checked: boolean) => void;
|
|
1495
|
+
/** Accessible name for the checkbox, e.g. `Select ${row.name}`. Never rendered visibly. */
|
|
1496
|
+
label: string;
|
|
1497
|
+
/** @default false */
|
|
1498
|
+
disabled?: boolean;
|
|
1499
|
+
className?: string;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
declare const TableSelectionCell: FC<TableSelectionCellProps>;
|
|
1503
|
+
|
|
1504
|
+
interface TableSelectionHeaderCellProps {
|
|
1505
|
+
/** How many rows are currently selected. Drives both the checked and indeterminate states. */
|
|
1506
|
+
selectedCount: number;
|
|
1507
|
+
/** How many rows are selectable in total. Usually the full result count, not just the loaded page. */
|
|
1508
|
+
totalCount: number;
|
|
1509
|
+
/** Fired with the next selected state: true to select every row, false to clear the selection. */
|
|
1510
|
+
onChangeCallback: (selectAll: boolean) => void;
|
|
1511
|
+
/** Accessible name for the checkbox. Never rendered visibly. */
|
|
1512
|
+
label: string;
|
|
1513
|
+
/**
|
|
1514
|
+
* Bulk actions revealed once at least one row is selected. Supply already-translated tooltips.
|
|
1515
|
+
* Omit to keep the header as a plain select-all checkbox.
|
|
1516
|
+
*/
|
|
1517
|
+
actions?: Array<TableAction>;
|
|
1518
|
+
/** Text beside the bulk actions, e.g. `${selectedCount} selected`. Only shown when `actions` are present. */
|
|
1519
|
+
selectedLabel?: string;
|
|
1520
|
+
/** @default false */
|
|
1521
|
+
disabled?: boolean;
|
|
1522
|
+
className?: string;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
declare const TableSelectionHeaderCell: FC<TableSelectionHeaderCellProps>;
|
|
1526
|
+
|
|
1527
|
+
interface TableTextCellProps {
|
|
1528
|
+
/** Primary value. */
|
|
1529
|
+
text: string | number;
|
|
1530
|
+
/** Second line below `text`, rendered smaller and muted. For the common "name over email" cell. */
|
|
1531
|
+
secondaryText?: string | number;
|
|
1532
|
+
/** Colour of the primary line. Use for status values such as an inactive row. */
|
|
1533
|
+
color?: Partial<ColorTypes>;
|
|
1534
|
+
/** Weight of the primary line. @default '400' */
|
|
1535
|
+
fontWeight?: TypographyFontWeight;
|
|
1536
|
+
/**
|
|
1537
|
+
* Truncates both lines with an ellipsis. A tooltip carrying the full text is added automatically,
|
|
1538
|
+
* so truncated values stay readable.
|
|
1539
|
+
* @default false
|
|
1540
|
+
*/
|
|
1541
|
+
withEllipsis?: boolean;
|
|
1542
|
+
/** Overrides the tooltip that `withEllipsis` derives from `text`. Set on its own to add a tooltip without truncating. */
|
|
1543
|
+
toolTip?: string;
|
|
1544
|
+
className?: string;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
declare const TableTextCell: FC<TableTextCellProps>;
|
|
1548
|
+
|
|
1330
1549
|
interface SwitchButtonProps {
|
|
1331
1550
|
checked: boolean;
|
|
1332
1551
|
id?: string;
|
|
@@ -1359,6 +1578,115 @@ declare const SwitchButton: {
|
|
|
1359
1578
|
displayName: string;
|
|
1360
1579
|
};
|
|
1361
1580
|
|
|
1581
|
+
/**
|
|
1582
|
+
* Identifies a tab within its group. Numbers and strings are both supported so a group can be driven
|
|
1583
|
+
* by an index, an id or a route segment.
|
|
1584
|
+
*/
|
|
1585
|
+
type TabValue = string | number;
|
|
1586
|
+
interface TabProps {
|
|
1587
|
+
/**
|
|
1588
|
+
* Identifies the tab. Defaults to the tab's position within its TabGroup, so it only needs to be
|
|
1589
|
+
* set when the group is driven by something other than an index.
|
|
1590
|
+
*/
|
|
1591
|
+
value?: TabValue;
|
|
1592
|
+
/** Label of the tab. Rendered after `children`. */
|
|
1593
|
+
text?: string;
|
|
1594
|
+
/** Rendered before `text`, for badges, avatars or icon lists alongside the label. */
|
|
1595
|
+
children?: ReactNode;
|
|
1596
|
+
className?: string;
|
|
1597
|
+
id?: string;
|
|
1598
|
+
/** @default false */
|
|
1599
|
+
disabled?: boolean;
|
|
1600
|
+
/** @default false */
|
|
1601
|
+
autoFocus?: boolean;
|
|
1602
|
+
/** @default SizeTypes.MEDIUM */
|
|
1603
|
+
tabSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1604
|
+
/** Share the group's width equally with its siblings. Normally set by TabGroup. @default false */
|
|
1605
|
+
fullWidth?: boolean;
|
|
1606
|
+
/** Remove the tab's horizontal padding. Normally set by TabGroup. @default false */
|
|
1607
|
+
noPadding?: boolean;
|
|
1608
|
+
/**
|
|
1609
|
+
* Ellipsis the label instead of wrapping it, shrinking the tab to fit rather than letting the group
|
|
1610
|
+
* scroll. Normally set by TabGroup.
|
|
1611
|
+
* @default false
|
|
1612
|
+
*/
|
|
1613
|
+
truncateText?: boolean;
|
|
1614
|
+
/** Normally set by TabGroup from its `value`. @default false */
|
|
1615
|
+
selected?: boolean;
|
|
1616
|
+
/** Render a chevron before the tab. Normally set by TabGroup's `withArrows`. @default false */
|
|
1617
|
+
withArrow?: boolean;
|
|
1618
|
+
/** Accessible name for the chevron rendered by `withArrow`. @default 'Arrow' */
|
|
1619
|
+
arrowAriaLabel?: string;
|
|
1620
|
+
/**
|
|
1621
|
+
* Id of the panel this tab controls. Set it, give that panel `role="tabpanel"`, and point the
|
|
1622
|
+
* panel's `aria-labelledby` back at this tab's `id`, and the two are announced as a pair.
|
|
1623
|
+
*/
|
|
1624
|
+
ariaControls?: string;
|
|
1625
|
+
/**
|
|
1626
|
+
* Whether this tab is the one reachable with the Tab key. A tab list is a single stop in the tab
|
|
1627
|
+
* order and the arrow keys move within it, so only one tab carries it. Set by TabGroup.
|
|
1628
|
+
* @default false
|
|
1629
|
+
*/
|
|
1630
|
+
tabbable?: boolean;
|
|
1631
|
+
toolTip?: string;
|
|
1632
|
+
/** Called with the tab's `value` when it is activated. Normally set by TabGroup. */
|
|
1633
|
+
onChange?: (value: TabValue) => void;
|
|
1634
|
+
/** Called with the tab's `value` when it is activated, after `onChange`. */
|
|
1635
|
+
onClickCallback?: (value: TabValue) => void;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
declare const Tab: {
|
|
1639
|
+
({ children, className, id, disabled, fullWidth, noPadding, truncateText, autoFocus, selected, withArrow, arrowAriaLabel, ariaControls, tabbable, text, toolTip, onChange, onClickCallback, value, tabSize }: TabProps): JSX.Element;
|
|
1640
|
+
displayName: string;
|
|
1641
|
+
};
|
|
1642
|
+
|
|
1643
|
+
interface TabIndicatorProps {
|
|
1644
|
+
className?: string;
|
|
1645
|
+
/** Renders the indicator in the disabled colour. @default false */
|
|
1646
|
+
disabled?: boolean;
|
|
1647
|
+
style?: CSSProperties;
|
|
1648
|
+
}
|
|
1649
|
+
interface TabGroupProps {
|
|
1650
|
+
/**
|
|
1651
|
+
* Value of the selected Tab, matched against each Tab's `value`. Pass `false` for no selection at
|
|
1652
|
+
* all, which hides the indicator rather than animating it away.
|
|
1653
|
+
*/
|
|
1654
|
+
value: TabValue | false;
|
|
1655
|
+
/** Tab elements. Falsy entries are skipped, so tabs can be rendered conditionally. */
|
|
1656
|
+
children: ReactNode;
|
|
1657
|
+
/** Called with the selected Tab's `value`. Tabs may also carry their own `onClickCallback`. */
|
|
1658
|
+
onChange?: (value: TabValue) => void;
|
|
1659
|
+
className?: string;
|
|
1660
|
+
id?: string;
|
|
1661
|
+
/** Accessible name for the tab list. */
|
|
1662
|
+
ariaLabel?: string;
|
|
1663
|
+
/** Centre the tabs within the group. @default false */
|
|
1664
|
+
centered?: boolean;
|
|
1665
|
+
/** Let the tabs share the group's width equally. @default false */
|
|
1666
|
+
fullWidth?: boolean;
|
|
1667
|
+
/** Remove the tabs' horizontal padding. @default false */
|
|
1668
|
+
noPadding?: boolean;
|
|
1669
|
+
/**
|
|
1670
|
+
* Ellipsis tab labels instead of wrapping them, shrinking the tabs to fit rather than letting the
|
|
1671
|
+
* group scroll.
|
|
1672
|
+
* @default false
|
|
1673
|
+
*/
|
|
1674
|
+
truncateText?: boolean;
|
|
1675
|
+
/** Render a chevron before every tab except the first, for wizard style navigation. @default false */
|
|
1676
|
+
withArrows?: boolean;
|
|
1677
|
+
/** Accessible name for the chevrons rendered by `withArrows`. @default 'Arrow' */
|
|
1678
|
+
arrowAriaLabel?: string;
|
|
1679
|
+
/** Applied to every Tab. @default SizeTypes.MEDIUM */
|
|
1680
|
+
tabSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1681
|
+
/** Styling overrides for the underline that tracks the selected tab. */
|
|
1682
|
+
tabIndicatorProps?: TabIndicatorProps;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
declare const TabGroup: {
|
|
1686
|
+
({ children: childrenProp, className, id, ariaLabel, onChange, tabIndicatorProps, value, tabSize, noPadding, truncateText, centered, fullWidth, withArrows, arrowAriaLabel }: TabGroupProps): JSX.Element;
|
|
1687
|
+
displayName: string;
|
|
1688
|
+
};
|
|
1689
|
+
|
|
1362
1690
|
interface OptionItem {
|
|
1363
1691
|
text: string;
|
|
1364
1692
|
value: string | number;
|
|
@@ -1510,4 +1838,4 @@ declare const NoDataMessage: {
|
|
|
1510
1838
|
displayName: string;
|
|
1511
1839
|
};
|
|
1512
1840
|
|
|
1513
|
-
export { AppColors, AspectRatioTypes, BorderInterface, Box, Button, Card, Checkbox, ColorStyleInterface, ColorTypes, DropDown, DropDownItem, DropDownRef, FacetButton, FlexStylingInterface, FontFamilyTypes, FormSkeleton, Grid, Heading, HierarchyInterface, HierarchyTypes, Icon, IconButton, IconStyleInterface, IconTypes, Image, InlineButton, Input, Label, ListItem, ListSkeleton, MarginInterface, MultiActionButton, NoDataMessage, PaddingInterface, Pagination, Paragraph, RadioButton, SelectInput, Separator, SizeStyleInterface, SizeTypes, SkeletonItem, SolidSpinner, SortableTable, Span, SwitchButton, TextAreaInput, ToolTip, borderClassNames, flexClassNames, marginClassNames, paddingClassNames };
|
|
1841
|
+
export { AppColors, AspectRatioTypes, BorderInterface, Box, Button, Card, Checkbox, ColorStyleInterface, ColorTypes, DropDown, DropDownItem, DropDownRef, FacetButton, FlexStylingInterface, FontFamilyTypes, FormSkeleton, Grid, Heading, HierarchyInterface, HierarchyTypes, Icon, IconButton, IconStyleInterface, IconTypes, Image, InlineButton, Input, Label, Link, LinkTypes, ListButton, ListButtonProps, ListItem, ListSkeleton, MarginInterface, MultiActionButton, NoDataMessage, PaddingInterface, Pagination, Paragraph, RadioButton, SelectInput, Separator, SizeStyleInterface, SizeTypes, SkeletonItem, SolidSpinner, SortableTable, SortableTableCellInterface, SortableTableProps, Span, SwitchButton, Tab, TabGroup, TabGroupProps, TabIndicatorProps, TabProps, TabValue, TableAction, TableActionsCell, TableActionsCellProps, TableSelectionCell, TableSelectionCellProps, TableSelectionHeaderCell, TableSelectionHeaderCellProps, TableTextCell, TableTextCellProps, TableTypes, TextAreaInput, ToolTip, borderClassNames, flexClassNames, marginClassNames, paddingClassNames };
|