widenarrow-ui 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.css +1 -1
- package/lib/index.d.ts +335 -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,53 @@ 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 SizeTypes.MEDIUM */
|
|
1086
|
+
iconSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE | SizeTypes.AUTO | undefined;
|
|
1087
|
+
/** @default '_blank' */
|
|
1088
|
+
target?: '_blank' | '_self';
|
|
1089
|
+
children?: ReactNode;
|
|
1090
|
+
onClickCallback?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
1091
|
+
/** The link leads to a site outside the domain */
|
|
1092
|
+
external?: boolean;
|
|
1093
|
+
/** @default LinkTypes.SECONDARY */
|
|
1094
|
+
color?: LinkTypes.SECONDARY | LinkTypes.PRIMARY | LinkTypes.WHITE;
|
|
1095
|
+
/** @default '600' */
|
|
1096
|
+
fontWeight?: '300' | '400' | '600' | '700';
|
|
1097
|
+
/** @default 'm' */
|
|
1098
|
+
fontSize?: 's' | 'm' | 'l';
|
|
1099
|
+
className?: string;
|
|
1100
|
+
iconClassName?: string;
|
|
1101
|
+
/** Applied to the element wrapping the link's text, for callers that need to style the label itself. */
|
|
1102
|
+
textClassName?: string;
|
|
1103
|
+
ariaLabel?: string;
|
|
1104
|
+
/**
|
|
1105
|
+
* Marks this link as the one matching the current view, e.g. 'page' for the open item in a
|
|
1106
|
+
* navigation list. Set it yourself rather than relying on route matching, so callers that decide
|
|
1107
|
+
* "current" their own way stay authoritative.
|
|
1108
|
+
*/
|
|
1109
|
+
ariaCurrent?: AriaAttributes['aria-current'];
|
|
1110
|
+
/** @default false */
|
|
1111
|
+
disabled?: boolean;
|
|
1112
|
+
/** @default true */
|
|
1113
|
+
withIconRight?: boolean;
|
|
1114
|
+
/** @default false */
|
|
1115
|
+
displayAsButton?: boolean;
|
|
1116
|
+
/** @default false */
|
|
1117
|
+
withEllipsis?: boolean;
|
|
1118
|
+
/** @default false */
|
|
1119
|
+
withWordBreak?: boolean;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
declare const Link: FC<LinkProps>;
|
|
1123
|
+
|
|
1062
1124
|
interface IconInterface {
|
|
1063
1125
|
loading?: boolean;
|
|
1064
1126
|
disabled?: boolean;
|
|
@@ -1108,6 +1170,68 @@ declare const TextAreaInput: {
|
|
|
1108
1170
|
displayName: string;
|
|
1109
1171
|
};
|
|
1110
1172
|
|
|
1173
|
+
interface ListButtonProps {
|
|
1174
|
+
/** Label of the row. Fades out under a gradient when it is too long to fit. */
|
|
1175
|
+
text: string;
|
|
1176
|
+
/**
|
|
1177
|
+
* Renders the row as a react-router link rather than a button, so that middle click and
|
|
1178
|
+
* open-in-new-tab keep working. Requires a surrounding Router.
|
|
1179
|
+
*/
|
|
1180
|
+
to?: string;
|
|
1181
|
+
/** Applied to the row, for spacing and for restyling the row itself. */
|
|
1182
|
+
className?: string;
|
|
1183
|
+
/** Applied to the clickable area holding the icon and the label. */
|
|
1184
|
+
buttonClassName?: string;
|
|
1185
|
+
/**
|
|
1186
|
+
* Applied to the label. A caller that gives the row its own background needs this to match the
|
|
1187
|
+
* fadeout to it, since the gradient has to end in the colour behind the text.
|
|
1188
|
+
*/
|
|
1189
|
+
labelClassName?: string;
|
|
1190
|
+
iconClassName?: string;
|
|
1191
|
+
icon?: Partial<IconTypes>;
|
|
1192
|
+
/** Applied to the icon if in a Link component. Otherwise, size is inherited from the button's size.
|
|
1193
|
+
* @default SizeTypes.SMALL */
|
|
1194
|
+
iconSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE | SizeTypes.AUTO | undefined;
|
|
1195
|
+
/** Shown at the end of the row at all times, for badges, spinners or status dots. */
|
|
1196
|
+
rightComponent?: ReactNode;
|
|
1197
|
+
/**
|
|
1198
|
+
* Shown at the end of the row on hover and on keyboard focus. Replaces `rightComponent` while
|
|
1199
|
+
* visible; neither reserves space while hidden, so the label keeps the full width until then.
|
|
1200
|
+
*/
|
|
1201
|
+
hoverComponent?: ReactNode;
|
|
1202
|
+
/** Renders the row in its selected colours. */
|
|
1203
|
+
selected?: boolean;
|
|
1204
|
+
/** @default false */
|
|
1205
|
+
disabled?: boolean;
|
|
1206
|
+
/** @default SizeTypes.SMALL */
|
|
1207
|
+
size?: SizeTypes.SMALL | SizeTypes.MEDIUM;
|
|
1208
|
+
id?: string;
|
|
1209
|
+
/** Use when `text` alone does not describe the action. */
|
|
1210
|
+
ariaLabel?: string;
|
|
1211
|
+
/** Button variant only. */
|
|
1212
|
+
toolTip?: string;
|
|
1213
|
+
/** Button variant only. */
|
|
1214
|
+
tabIndex?: number;
|
|
1215
|
+
/** Button variant only. @default false */
|
|
1216
|
+
autoFocus?: boolean;
|
|
1217
|
+
/** Button variant only. */
|
|
1218
|
+
buttonRef?: RefObject<HTMLButtonElement>;
|
|
1219
|
+
onClickCallback?: () => void;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* A full width row that reads as a single button: an optional icon, a label that fades out rather
|
|
1224
|
+
* than ellipsises when it overflows, and an end slot whose contents swap on hover.
|
|
1225
|
+
*
|
|
1226
|
+
* The row and the clickable area are separate elements so that `rightComponent` and `hoverComponent`
|
|
1227
|
+
* can hold their own buttons without nesting them inside this one. Without `to` the clickable area
|
|
1228
|
+
* is an InlineButton and its props carry through; with `to` it is a link.
|
|
1229
|
+
*/
|
|
1230
|
+
declare const ListButton: {
|
|
1231
|
+
({ text, to, className, buttonClassName, labelClassName, iconClassName, icon, iconSize, rightComponent, hoverComponent, selected, disabled, size, id, ariaLabel, toolTip, tabIndex, autoFocus, buttonRef, onClickCallback }: ListButtonProps): JSX.Element;
|
|
1232
|
+
displayName: string;
|
|
1233
|
+
};
|
|
1234
|
+
|
|
1111
1235
|
interface ListItemProps extends MarginInterface, PaddingInterface {
|
|
1112
1236
|
id?: string;
|
|
1113
1237
|
buttonsComponent?: ReactNode;
|
|
@@ -1263,58 +1387,134 @@ declare const SolidSpinner: {
|
|
|
1263
1387
|
displayName: string;
|
|
1264
1388
|
};
|
|
1265
1389
|
|
|
1266
|
-
interface
|
|
1390
|
+
interface SortableTableCellInterface {
|
|
1391
|
+
/** Key on each `data` row whose value fills this column. Also the key handed to `onSortCallback` and matched against `sortBy`. */
|
|
1267
1392
|
key: string;
|
|
1393
|
+
/** Visible column heading. */
|
|
1268
1394
|
title: string;
|
|
1395
|
+
/** Column width, as a percentage (`'25%'`) or a fixed value (`'120px'`). Applied inline to both the header and body cells. */
|
|
1269
1396
|
width: string;
|
|
1270
|
-
|
|
1397
|
+
/** Renders the heading as static text with no sort button. @default false */
|
|
1271
1398
|
disableSort?: boolean;
|
|
1399
|
+
/** Right-aligns the cell contents, and moves the sort chevron to the left of the heading. @default false */
|
|
1272
1400
|
alignRight?: boolean;
|
|
1401
|
+
/** Centres the cell contents. @default false */
|
|
1273
1402
|
alignCenter?: boolean;
|
|
1403
|
+
/** Truncates overflowing cell content with an ellipsis instead of wrapping. @default false */
|
|
1274
1404
|
withEllipsis?: boolean;
|
|
1405
|
+
/** Tooltip on the heading. Falls back to `title` when omitted. */
|
|
1275
1406
|
toolTip?: string;
|
|
1407
|
+
/** Applied to the content span inside every body cell of this column, not to the cell itself. */
|
|
1276
1408
|
className?: string;
|
|
1277
|
-
|
|
1409
|
+
/** Replaces the whole heading, including the sort button. Receives the cell config. */
|
|
1410
|
+
customHeaderCellComponent?: (cell: SortableTableCellInterface) => ReactNode | JSX.Element;
|
|
1411
|
+
/** Replaces the cell value. Receives the whole row, so it can read keys other than `key`. */
|
|
1278
1412
|
customCellComponent?: (row: any) => ReactNode | JSX.Element;
|
|
1279
1413
|
}
|
|
1280
1414
|
interface SortableTableProps {
|
|
1415
|
+
/** Applied to the outer container element. */
|
|
1281
1416
|
id?: string;
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1417
|
+
/**
|
|
1418
|
+
* Visual treatment. `RULED` separates rows with a hairline. `CARDS` gives each row a white
|
|
1419
|
+
* background, rounded corners and a gap, which only reads as separate rows against a tinted
|
|
1420
|
+
* page — put it on `$application-background`, not inside a white card.
|
|
1421
|
+
* @default TableTypes.RULED
|
|
1422
|
+
*/
|
|
1423
|
+
type?: TableTypes.RULED | TableTypes.CARDS;
|
|
1424
|
+
/**
|
|
1425
|
+
* Column configuration, in render order. Each entry accepts:
|
|
1426
|
+
*
|
|
1427
|
+
* **`key`** — `string`, required
|
|
1428
|
+
*
|
|
1429
|
+
* Row key whose value fills the column when there is no `customCellComponent`. Always the sort key: it is what `onSortCallback` reports and what `sortBy` is matched against.
|
|
1430
|
+
*
|
|
1431
|
+
* **`title`** — `string`, required
|
|
1432
|
+
*
|
|
1433
|
+
* Heading text.
|
|
1434
|
+
*
|
|
1435
|
+
* **`width`** — `string`, required
|
|
1436
|
+
*
|
|
1437
|
+
* A percentage (`'25%'`) or a fixed value (`'120px'`), applied inline to the header and body cells.
|
|
1438
|
+
*
|
|
1439
|
+
* **`disableSort`** — `boolean`, defaults to `false`
|
|
1440
|
+
*
|
|
1441
|
+
* Renders the heading as static text with no sort button.
|
|
1442
|
+
*
|
|
1443
|
+
* **`alignRight`** — `boolean`, defaults to `false`
|
|
1444
|
+
*
|
|
1445
|
+
* Right-aligns the cell, and moves the sort chevron to the left of the heading.
|
|
1446
|
+
*
|
|
1447
|
+
* **`alignCenter`** — `boolean`, defaults to `false`
|
|
1448
|
+
*
|
|
1449
|
+
* Centres the cell.
|
|
1450
|
+
*
|
|
1451
|
+
* **`withEllipsis`** — `boolean`, defaults to `false`
|
|
1452
|
+
*
|
|
1453
|
+
* Truncates overflowing content with an ellipsis instead of wrapping.
|
|
1454
|
+
*
|
|
1455
|
+
* **`toolTip`** — `string`
|
|
1456
|
+
*
|
|
1457
|
+
* Tooltip on the heading. Falls back to `title` when omitted.
|
|
1458
|
+
*
|
|
1459
|
+
* **`className`** — `string`
|
|
1460
|
+
*
|
|
1461
|
+
* Applied to the content span inside each body cell, not to the cell itself.
|
|
1462
|
+
*
|
|
1463
|
+
* **`customHeaderCellComponent`** — `(cell) => ReactNode`
|
|
1464
|
+
*
|
|
1465
|
+
* Replaces the entire heading, sort button included.
|
|
1466
|
+
*
|
|
1467
|
+
* **`customCellComponent`** — `(row) => ReactNode`
|
|
1468
|
+
*
|
|
1469
|
+
* Replaces the cell value. Receives the whole row, so it can read keys other than `key`.
|
|
1470
|
+
*
|
|
1471
|
+
* ------------------------------------------------------------
|
|
1472
|
+
*
|
|
1473
|
+
* `width`, `alignRight`, `alignCenter`, `withEllipsis` and `className` apply whether or not the column
|
|
1474
|
+
* has a `customCellComponent` — they sit on the cell and its content span, which wrap a custom cell too.
|
|
1475
|
+
* Only `key` changes meaning: with a custom cell it still drives sorting, but no longer supplies the
|
|
1476
|
+
* displayed value.
|
|
1477
|
+
*
|
|
1478
|
+
* A `customHeaderCellComponent` replaces the heading before any of it is built, so `title`, `toolTip`
|
|
1479
|
+
* and `disableSort` stop having any effect on that column's heading — including its sort button.
|
|
1480
|
+
*/
|
|
1481
|
+
cells: Array<SortableTableCellInterface>;
|
|
1482
|
+
/** Row objects. Each is passed to `customCellComponent`, and indexed by `cell.key` otherwise. */
|
|
1296
1483
|
data: Array<any>;
|
|
1484
|
+
/**
|
|
1485
|
+
* Active sort. Without `onSortCallback` the table sorts `data` itself and treats this as the initial
|
|
1486
|
+
* state only; with `onSortCallback` the table is controlled and this must reflect the current sort.
|
|
1487
|
+
* @default [{ keyName: 'name', ascending: true }]
|
|
1488
|
+
*/
|
|
1297
1489
|
sortBy: Array<{
|
|
1298
1490
|
keyName: string;
|
|
1299
1491
|
ascending: boolean;
|
|
1300
1492
|
}>;
|
|
1493
|
+
/** Applied to the outer container element. */
|
|
1301
1494
|
className?: string;
|
|
1495
|
+
/** Applied to every body row. */
|
|
1302
1496
|
rowClassName?: string;
|
|
1497
|
+
/** Applied to the header row. */
|
|
1303
1498
|
headerClassName?: string;
|
|
1499
|
+
/** Applied to the `tbody`. */
|
|
1304
1500
|
bodyClassName?: string;
|
|
1501
|
+
/** Applied to the loading spinner. */
|
|
1305
1502
|
spinnerClassName?: string;
|
|
1503
|
+
/** Accessible table description. Visually hidden, so it is for screen readers only. */
|
|
1306
1504
|
caption?: string;
|
|
1307
|
-
/** @default false */
|
|
1505
|
+
/** Replaces rows with skeleton placeholders and shows a spinner. Sorting is disabled while true. @default false */
|
|
1308
1506
|
loading?: boolean;
|
|
1309
|
-
/** @default 6 */
|
|
1507
|
+
/** Number of skeleton rows to render while `loading`. @default 6 */
|
|
1310
1508
|
skeletonRows?: number;
|
|
1311
|
-
/** @default false */
|
|
1509
|
+
/** Pins the header to the top of the nearest scroll container. @default false */
|
|
1312
1510
|
withStickyHeader?: boolean;
|
|
1313
|
-
/** @default false */
|
|
1511
|
+
/** Defers rendering each row until it scrolls into view. For long lists. @default false */
|
|
1314
1512
|
withIntersectionObserver?: boolean;
|
|
1513
|
+
/** Minimum table width, e.g. `'900px'`. Makes the container scroll horizontally below it. */
|
|
1315
1514
|
minWidth?: string;
|
|
1515
|
+
/** Takes over sorting. When given, the table stops sorting `data` and becomes controlled by `sortBy`. */
|
|
1316
1516
|
onSortCallback?: (keyName: string, ascending: boolean) => void;
|
|
1317
|
-
|
|
1517
|
+
/** Shown in place of the rows when `data` is empty and `loading` is false. */
|
|
1318
1518
|
noDataMessage?: {
|
|
1319
1519
|
title?: string;
|
|
1320
1520
|
icon?: Partial<IconTypes>;
|
|
@@ -1323,7 +1523,7 @@ interface SortableTableProps {
|
|
|
1323
1523
|
}
|
|
1324
1524
|
|
|
1325
1525
|
declare const SortableTable: {
|
|
1326
|
-
({ id, cells, data, sortBy, skeletonRows, loading, caption, className, headerClassName, rowClassName, bodyClassName, spinnerClassName, withStickyHeader, withIntersectionObserver, noDataMessage, minWidth, onSortCallback }: SortableTableProps): JSX.Element;
|
|
1526
|
+
({ id, cells, data, sortBy, skeletonRows, loading, caption, className, headerClassName, rowClassName, bodyClassName, spinnerClassName, withStickyHeader, withIntersectionObserver, noDataMessage, minWidth, onSortCallback, type }: SortableTableProps): JSX.Element;
|
|
1327
1527
|
displayName: string;
|
|
1328
1528
|
};
|
|
1329
1529
|
|
|
@@ -1359,6 +1559,115 @@ declare const SwitchButton: {
|
|
|
1359
1559
|
displayName: string;
|
|
1360
1560
|
};
|
|
1361
1561
|
|
|
1562
|
+
/**
|
|
1563
|
+
* Identifies a tab within its group. Numbers and strings are both supported so a group can be driven
|
|
1564
|
+
* by an index, an id or a route segment.
|
|
1565
|
+
*/
|
|
1566
|
+
type TabValue = string | number;
|
|
1567
|
+
interface TabProps {
|
|
1568
|
+
/**
|
|
1569
|
+
* Identifies the tab. Defaults to the tab's position within its TabGroup, so it only needs to be
|
|
1570
|
+
* set when the group is driven by something other than an index.
|
|
1571
|
+
*/
|
|
1572
|
+
value?: TabValue;
|
|
1573
|
+
/** Label of the tab. Rendered after `children`. */
|
|
1574
|
+
text?: string;
|
|
1575
|
+
/** Rendered before `text`, for badges, avatars or icon lists alongside the label. */
|
|
1576
|
+
children?: ReactNode;
|
|
1577
|
+
className?: string;
|
|
1578
|
+
id?: string;
|
|
1579
|
+
/** @default false */
|
|
1580
|
+
disabled?: boolean;
|
|
1581
|
+
/** @default false */
|
|
1582
|
+
autoFocus?: boolean;
|
|
1583
|
+
/** @default SizeTypes.MEDIUM */
|
|
1584
|
+
tabSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1585
|
+
/** Share the group's width equally with its siblings. Normally set by TabGroup. @default false */
|
|
1586
|
+
fullWidth?: boolean;
|
|
1587
|
+
/** Remove the tab's horizontal padding. Normally set by TabGroup. @default false */
|
|
1588
|
+
noPadding?: boolean;
|
|
1589
|
+
/**
|
|
1590
|
+
* Ellipsis the label instead of wrapping it, shrinking the tab to fit rather than letting the group
|
|
1591
|
+
* scroll. Normally set by TabGroup.
|
|
1592
|
+
* @default false
|
|
1593
|
+
*/
|
|
1594
|
+
truncateText?: boolean;
|
|
1595
|
+
/** Normally set by TabGroup from its `value`. @default false */
|
|
1596
|
+
selected?: boolean;
|
|
1597
|
+
/** Render a chevron before the tab. Normally set by TabGroup's `withArrows`. @default false */
|
|
1598
|
+
withArrow?: boolean;
|
|
1599
|
+
/** Accessible name for the chevron rendered by `withArrow`. @default 'Arrow' */
|
|
1600
|
+
arrowAriaLabel?: string;
|
|
1601
|
+
/**
|
|
1602
|
+
* Id of the panel this tab controls. Set it, give that panel `role="tabpanel"`, and point the
|
|
1603
|
+
* panel's `aria-labelledby` back at this tab's `id`, and the two are announced as a pair.
|
|
1604
|
+
*/
|
|
1605
|
+
ariaControls?: string;
|
|
1606
|
+
/**
|
|
1607
|
+
* Whether this tab is the one reachable with the Tab key. A tab list is a single stop in the tab
|
|
1608
|
+
* order and the arrow keys move within it, so only one tab carries it. Set by TabGroup.
|
|
1609
|
+
* @default false
|
|
1610
|
+
*/
|
|
1611
|
+
tabbable?: boolean;
|
|
1612
|
+
toolTip?: string;
|
|
1613
|
+
/** Called with the tab's `value` when it is activated. Normally set by TabGroup. */
|
|
1614
|
+
onChange?: (value: TabValue) => void;
|
|
1615
|
+
/** Called with the tab's `value` when it is activated, after `onChange`. */
|
|
1616
|
+
onClickCallback?: (value: TabValue) => void;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
declare const Tab: {
|
|
1620
|
+
({ children, className, id, disabled, fullWidth, noPadding, truncateText, autoFocus, selected, withArrow, arrowAriaLabel, ariaControls, tabbable, text, toolTip, onChange, onClickCallback, value, tabSize }: TabProps): JSX.Element;
|
|
1621
|
+
displayName: string;
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1624
|
+
interface TabIndicatorProps {
|
|
1625
|
+
className?: string;
|
|
1626
|
+
/** Renders the indicator in the disabled colour. @default false */
|
|
1627
|
+
disabled?: boolean;
|
|
1628
|
+
style?: CSSProperties;
|
|
1629
|
+
}
|
|
1630
|
+
interface TabGroupProps {
|
|
1631
|
+
/**
|
|
1632
|
+
* Value of the selected Tab, matched against each Tab's `value`. Pass `false` for no selection at
|
|
1633
|
+
* all, which hides the indicator rather than animating it away.
|
|
1634
|
+
*/
|
|
1635
|
+
value: TabValue | false;
|
|
1636
|
+
/** Tab elements. Falsy entries are skipped, so tabs can be rendered conditionally. */
|
|
1637
|
+
children: ReactNode;
|
|
1638
|
+
/** Called with the selected Tab's `value`. Tabs may also carry their own `onClickCallback`. */
|
|
1639
|
+
onChange?: (value: TabValue) => void;
|
|
1640
|
+
className?: string;
|
|
1641
|
+
id?: string;
|
|
1642
|
+
/** Accessible name for the tab list. */
|
|
1643
|
+
ariaLabel?: string;
|
|
1644
|
+
/** Centre the tabs within the group. @default false */
|
|
1645
|
+
centered?: boolean;
|
|
1646
|
+
/** Let the tabs share the group's width equally. @default false */
|
|
1647
|
+
fullWidth?: boolean;
|
|
1648
|
+
/** Remove the tabs' horizontal padding. @default false */
|
|
1649
|
+
noPadding?: boolean;
|
|
1650
|
+
/**
|
|
1651
|
+
* Ellipsis tab labels instead of wrapping them, shrinking the tabs to fit rather than letting the
|
|
1652
|
+
* group scroll.
|
|
1653
|
+
* @default false
|
|
1654
|
+
*/
|
|
1655
|
+
truncateText?: boolean;
|
|
1656
|
+
/** Render a chevron before every tab except the first, for wizard style navigation. @default false */
|
|
1657
|
+
withArrows?: boolean;
|
|
1658
|
+
/** Accessible name for the chevrons rendered by `withArrows`. @default 'Arrow' */
|
|
1659
|
+
arrowAriaLabel?: string;
|
|
1660
|
+
/** Applied to every Tab. @default SizeTypes.MEDIUM */
|
|
1661
|
+
tabSize?: SizeTypes.SMALL | SizeTypes.MEDIUM | SizeTypes.LARGE;
|
|
1662
|
+
/** Styling overrides for the underline that tracks the selected tab. */
|
|
1663
|
+
tabIndicatorProps?: TabIndicatorProps;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
declare const TabGroup: {
|
|
1667
|
+
({ children: childrenProp, className, id, ariaLabel, onChange, tabIndicatorProps, value, tabSize, noPadding, truncateText, centered, fullWidth, withArrows, arrowAriaLabel }: TabGroupProps): JSX.Element;
|
|
1668
|
+
displayName: string;
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1362
1671
|
interface OptionItem {
|
|
1363
1672
|
text: string;
|
|
1364
1673
|
value: string | number;
|
|
@@ -1510,4 +1819,4 @@ declare const NoDataMessage: {
|
|
|
1510
1819
|
displayName: string;
|
|
1511
1820
|
};
|
|
1512
1821
|
|
|
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 };
|
|
1822
|
+
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, TableTypes, TextAreaInput, ToolTip, borderClassNames, flexClassNames, marginClassNames, paddingClassNames };
|