@lumx/react 4.3.2-alpha.35 → 4.3.2-alpha.37
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/index.d.ts +15 -22
- package/index.js +108 -91
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -647,7 +647,8 @@ declare const BadgeWrapper: Comp<BadgeWrapperProps, HTMLDivElement>;
|
|
|
647
647
|
|
|
648
648
|
interface BaseClickableProps extends HasDisabled, HasAriaDisabled {
|
|
649
649
|
children?: JSXElement;
|
|
650
|
-
|
|
650
|
+
handleClick?: (event?: any) => void;
|
|
651
|
+
handleKeyPress?: (event?: any) => void;
|
|
651
652
|
ref?: CommonRef;
|
|
652
653
|
}
|
|
653
654
|
|
|
@@ -820,7 +821,7 @@ interface CheckboxProps$1 extends HasTheme, HasClassName, HasAriaDisabled, HasDi
|
|
|
820
821
|
/** Native input id. */
|
|
821
822
|
inputId: string;
|
|
822
823
|
/** On change callback. */
|
|
823
|
-
|
|
824
|
+
handleChange?(isChecked: boolean, value?: string, name?: string, event?: any): void;
|
|
824
825
|
/** reference to the root element */
|
|
825
826
|
ref?: CommonRef;
|
|
826
827
|
}
|
|
@@ -1871,9 +1872,9 @@ interface ThumbnailProps$1 extends HasTheme$1, HasClassName$1 {
|
|
|
1871
1872
|
/** Ref of an existing placeholder image to display while loading. */
|
|
1872
1873
|
loadingPlaceholderImageRef?: React.RefObject<HTMLImageElement>;
|
|
1873
1874
|
/** On click callback. */
|
|
1874
|
-
|
|
1875
|
+
handleClick?: (event: any) => void;
|
|
1875
1876
|
/** On key press callback. */
|
|
1876
|
-
|
|
1877
|
+
handleKeyPress?: (event: any) => void;
|
|
1877
1878
|
/** Variant of the component. */
|
|
1878
1879
|
variant?: ThumbnailVariant$1;
|
|
1879
1880
|
/** Props to pass to the link wrapping the thumbnail. */
|
|
@@ -2770,7 +2771,7 @@ interface RadioButtonProps$1 extends HasTheme, HasClassName, HasAriaDisabled, Ha
|
|
|
2770
2771
|
/** Native input id. */
|
|
2771
2772
|
inputId: string;
|
|
2772
2773
|
/** On change callback. */
|
|
2773
|
-
|
|
2774
|
+
handleChange?(value?: string, name?: string, event?: any): void;
|
|
2774
2775
|
/** reference to the root element */
|
|
2775
2776
|
ref?: CommonRef;
|
|
2776
2777
|
}
|
|
@@ -3323,7 +3324,7 @@ interface SwitchProps$1 extends HasTheme, HasClassName, HasAriaDisabled, HasDisa
|
|
|
3323
3324
|
/** Native input id. */
|
|
3324
3325
|
inputId: string;
|
|
3325
3326
|
/** On change callback. */
|
|
3326
|
-
|
|
3327
|
+
handleChange?(isChecked: boolean, value?: string, name?: string, event?: any): void;
|
|
3327
3328
|
/** Position of the switch relative to the label. */
|
|
3328
3329
|
position?: 'left' | 'right';
|
|
3329
3330
|
/** reference to the root element */
|
|
@@ -3363,9 +3364,7 @@ interface TableProps$1 extends HasTheme, HasClassName {
|
|
|
3363
3364
|
/**
|
|
3364
3365
|
* Defines the props of the component.
|
|
3365
3366
|
*/
|
|
3366
|
-
interface TableProps extends GenericProps$1,
|
|
3367
|
-
/** Children */
|
|
3368
|
-
children?: React.ReactNode;
|
|
3367
|
+
interface TableProps extends GenericProps$1, ReactToJSX<TableProps$1> {
|
|
3369
3368
|
}
|
|
3370
3369
|
/**
|
|
3371
3370
|
* Table component.
|
|
@@ -3389,9 +3388,7 @@ interface TableBodyProps$1 extends HasClassName {
|
|
|
3389
3388
|
/**
|
|
3390
3389
|
* Defines the props of the component.
|
|
3391
3390
|
*/
|
|
3392
|
-
interface TableBodyProps extends GenericProps$1,
|
|
3393
|
-
/** Children */
|
|
3394
|
-
children?: React.ReactNode;
|
|
3391
|
+
interface TableBodyProps extends GenericProps$1, ReactToJSX<TableBodyProps$1> {
|
|
3395
3392
|
}
|
|
3396
3393
|
/**
|
|
3397
3394
|
* TableBody component.
|
|
@@ -3431,7 +3428,7 @@ interface TableCellProps$1 extends HasClassName {
|
|
|
3431
3428
|
/** Variant. */
|
|
3432
3429
|
variant?: TableCellVariant;
|
|
3433
3430
|
/** On header cell click callback. */
|
|
3434
|
-
|
|
3431
|
+
handleClick?(): void;
|
|
3435
3432
|
/** Children */
|
|
3436
3433
|
children?: JSXElement;
|
|
3437
3434
|
/** reference to the root element */
|
|
@@ -3441,9 +3438,9 @@ interface TableCellProps$1 extends HasClassName {
|
|
|
3441
3438
|
/**
|
|
3442
3439
|
* Defines the props of the component.
|
|
3443
3440
|
*/
|
|
3444
|
-
interface TableCellProps extends GenericProps$1,
|
|
3445
|
-
/**
|
|
3446
|
-
|
|
3441
|
+
interface TableCellProps extends GenericProps$1, ReactToJSX<TableCellProps$1> {
|
|
3442
|
+
/** On header cell click callback. */
|
|
3443
|
+
onHeaderClick?: () => void;
|
|
3447
3444
|
}
|
|
3448
3445
|
/**
|
|
3449
3446
|
* TableCell component.
|
|
@@ -3467,9 +3464,7 @@ interface TableHeaderProps$1 extends HasClassName {
|
|
|
3467
3464
|
/**
|
|
3468
3465
|
* Defines the props of the component.
|
|
3469
3466
|
*/
|
|
3470
|
-
interface TableHeaderProps extends GenericProps$1,
|
|
3471
|
-
/** Children */
|
|
3472
|
-
children?: React.ReactNode;
|
|
3467
|
+
interface TableHeaderProps extends GenericProps$1, ReactToJSX<TableHeaderProps$1, 'ref'> {
|
|
3473
3468
|
}
|
|
3474
3469
|
/**
|
|
3475
3470
|
* TableHeader component.
|
|
@@ -3499,11 +3494,9 @@ interface TableRowProps$1 extends HasClassName, HasAriaDisabled {
|
|
|
3499
3494
|
/**
|
|
3500
3495
|
* Defines the props of the component.
|
|
3501
3496
|
*/
|
|
3502
|
-
interface TableRowProps extends GenericProps$1,
|
|
3497
|
+
interface TableRowProps extends GenericProps$1, ReactToJSX<TableRowProps$1, 'tabIndex' | 'aria-disabled'> {
|
|
3503
3498
|
/** Whether the component is disabled or not. */
|
|
3504
3499
|
isDisabled?: boolean;
|
|
3505
|
-
/** Children */
|
|
3506
|
-
children?: React.ReactNode;
|
|
3507
3500
|
}
|
|
3508
3501
|
/**
|
|
3509
3502
|
* TableRow component.
|
package/index.js
CHANGED
|
@@ -1026,10 +1026,11 @@ BadgeWrapper.className = CLASSNAME$1e;
|
|
|
1026
1026
|
* Render clickable element (link, button or custom element)
|
|
1027
1027
|
* (also does some basic disabled state handling)
|
|
1028
1028
|
*/
|
|
1029
|
-
const RawClickable
|
|
1029
|
+
const RawClickable = props => {
|
|
1030
1030
|
const {
|
|
1031
1031
|
children,
|
|
1032
|
-
|
|
1032
|
+
handleClick,
|
|
1033
|
+
handleKeyPress,
|
|
1033
1034
|
disabled,
|
|
1034
1035
|
isDisabled = disabled,
|
|
1035
1036
|
'aria-disabled': ariaDisabled,
|
|
@@ -1053,13 +1054,14 @@ const RawClickable$1 = props => {
|
|
|
1053
1054
|
"aria-disabled": isAnyDisabled || undefined,
|
|
1054
1055
|
...forwardedProps,
|
|
1055
1056
|
...clickableProps,
|
|
1057
|
+
onKeyPress: handleKeyPress,
|
|
1056
1058
|
onClick: event => {
|
|
1057
1059
|
if (isAnyDisabled) {
|
|
1058
1060
|
event.stopPropagation();
|
|
1059
1061
|
event.preventDefault();
|
|
1060
1062
|
return;
|
|
1061
1063
|
}
|
|
1062
|
-
|
|
1064
|
+
handleClick?.(event);
|
|
1063
1065
|
},
|
|
1064
1066
|
children: children
|
|
1065
1067
|
});
|
|
@@ -1156,7 +1158,7 @@ const ButtonRoot = props => {
|
|
|
1156
1158
|
[`variant-${variant}`]: Boolean(variant),
|
|
1157
1159
|
'is-full-width': fullWidth
|
|
1158
1160
|
}));
|
|
1159
|
-
return RawClickable
|
|
1161
|
+
return RawClickable({
|
|
1160
1162
|
as: linkAs || (forwardedProps.href ? 'a' : 'button'),
|
|
1161
1163
|
...forwardedProps,
|
|
1162
1164
|
'aria-disabled': ariaDisabled,
|
|
@@ -1255,6 +1257,10 @@ const Button = forwardRef((props, ref) => {
|
|
|
1255
1257
|
disabledStateProps,
|
|
1256
1258
|
otherProps
|
|
1257
1259
|
} = useDisableStateProps(props);
|
|
1260
|
+
const {
|
|
1261
|
+
onClick,
|
|
1262
|
+
...restOfOtherProps
|
|
1263
|
+
} = otherProps;
|
|
1258
1264
|
const {
|
|
1259
1265
|
leftIcon,
|
|
1260
1266
|
rightIcon,
|
|
@@ -1264,8 +1270,9 @@ const Button = forwardRef((props, ref) => {
|
|
|
1264
1270
|
ref,
|
|
1265
1271
|
theme: defaultTheme,
|
|
1266
1272
|
...disabledStateProps,
|
|
1267
|
-
...
|
|
1273
|
+
...restOfOtherProps,
|
|
1268
1274
|
'aria-disabled': isAnyDisabled,
|
|
1275
|
+
handleClick: onClick,
|
|
1269
1276
|
children: /*#__PURE__*/jsxs(Fragment, {
|
|
1270
1277
|
children: [leftIcon && !isEmpty(leftIcon) &&
|
|
1271
1278
|
/*#__PURE__*/
|
|
@@ -1463,6 +1470,10 @@ const IconButton = forwardRef((props, ref) => {
|
|
|
1463
1470
|
disabledStateProps,
|
|
1464
1471
|
otherProps
|
|
1465
1472
|
} = useDisableStateProps(forwardedProps);
|
|
1473
|
+
const {
|
|
1474
|
+
onClick,
|
|
1475
|
+
...restOfOtherProps
|
|
1476
|
+
} = otherProps;
|
|
1466
1477
|
return /*#__PURE__*/jsx(Tooltip, {
|
|
1467
1478
|
label: hideTooltip ? '' : label,
|
|
1468
1479
|
...tooltipProps,
|
|
@@ -1470,7 +1481,8 @@ const IconButton = forwardRef((props, ref) => {
|
|
|
1470
1481
|
ref,
|
|
1471
1482
|
theme: defaultTheme,
|
|
1472
1483
|
...disabledStateProps,
|
|
1473
|
-
...
|
|
1484
|
+
...restOfOtherProps,
|
|
1485
|
+
handleClick: onClick,
|
|
1474
1486
|
'aria-disabled': isAnyDisabled,
|
|
1475
1487
|
label
|
|
1476
1488
|
})
|
|
@@ -1669,7 +1681,7 @@ const Checkbox$1 = props => {
|
|
|
1669
1681
|
label,
|
|
1670
1682
|
name,
|
|
1671
1683
|
ref,
|
|
1672
|
-
|
|
1684
|
+
handleChange,
|
|
1673
1685
|
theme,
|
|
1674
1686
|
value,
|
|
1675
1687
|
inputProps = {},
|
|
@@ -1678,9 +1690,9 @@ const Checkbox$1 = props => {
|
|
|
1678
1690
|
...forwardedProps
|
|
1679
1691
|
} = props;
|
|
1680
1692
|
const intermediateState = isChecked === INTERMEDIATE_STATE;
|
|
1681
|
-
const
|
|
1682
|
-
if (
|
|
1683
|
-
|
|
1693
|
+
const handleOnChange = event => {
|
|
1694
|
+
if (handleChange) {
|
|
1695
|
+
handleChange(!isChecked, value, name, event);
|
|
1684
1696
|
}
|
|
1685
1697
|
};
|
|
1686
1698
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -1703,7 +1715,7 @@ const Checkbox$1 = props => {
|
|
|
1703
1715
|
name: name,
|
|
1704
1716
|
value: value,
|
|
1705
1717
|
checked: isChecked,
|
|
1706
|
-
onChange:
|
|
1718
|
+
onChange: handleOnChange,
|
|
1707
1719
|
"aria-describedby": helper ? `${inputId}-helper` : undefined,
|
|
1708
1720
|
"aria-checked": intermediateState ? 'mixed' : Boolean(isChecked),
|
|
1709
1721
|
...(inputProps?.readOnly ? {
|
|
@@ -1792,7 +1804,7 @@ const Checkbox = forwardRef((props, ref) => {
|
|
|
1792
1804
|
isChecked,
|
|
1793
1805
|
label,
|
|
1794
1806
|
name,
|
|
1795
|
-
onChange,
|
|
1807
|
+
handleChange: onChange,
|
|
1796
1808
|
theme,
|
|
1797
1809
|
value,
|
|
1798
1810
|
inputProps: {
|
|
@@ -9264,7 +9276,7 @@ const Message$1 = props => {
|
|
|
9264
9276
|
}), isCloseButtonDisplayed && IconButton$1({
|
|
9265
9277
|
className: element$r('close-button'),
|
|
9266
9278
|
icon: mdiClose,
|
|
9267
|
-
onClick,
|
|
9279
|
+
handleClick: onClick,
|
|
9268
9280
|
label: closeButtonLabel,
|
|
9269
9281
|
emphasis: Emphasis.low
|
|
9270
9282
|
})]
|
|
@@ -9375,20 +9387,6 @@ Mosaic.displayName = COMPONENT_NAME$D;
|
|
|
9375
9387
|
Mosaic.className = CLASSNAME$E;
|
|
9376
9388
|
Mosaic.defaultProps = DEFAULT_PROPS$G;
|
|
9377
9389
|
|
|
9378
|
-
/** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
|
|
9379
|
-
const forwardRefPolymorphic = React__default.forwardRef;
|
|
9380
|
-
|
|
9381
|
-
/**
|
|
9382
|
-
* Render clickable element (link, button or custom element)
|
|
9383
|
-
* (also does some basic disabled state handling)
|
|
9384
|
-
*/
|
|
9385
|
-
const RawClickable = forwardRefPolymorphic((props, ref) => {
|
|
9386
|
-
return RawClickable$1({
|
|
9387
|
-
ref,
|
|
9388
|
-
...props
|
|
9389
|
-
});
|
|
9390
|
-
});
|
|
9391
|
-
|
|
9392
9390
|
const NavigationContext = /*#__PURE__*/createContext({
|
|
9393
9391
|
orientation: Orientation$1.vertical
|
|
9394
9392
|
});
|
|
@@ -9441,31 +9439,33 @@ const NavigationSection = forwardRef((props, ref) => {
|
|
|
9441
9439
|
[`theme-${theme}`]: Boolean(theme)
|
|
9442
9440
|
})),
|
|
9443
9441
|
ref: ref,
|
|
9444
|
-
children: [
|
|
9445
|
-
as:
|
|
9442
|
+
children: [RawClickable({
|
|
9443
|
+
as: 'button',
|
|
9446
9444
|
...forwardedProps,
|
|
9447
|
-
|
|
9448
|
-
|
|
9445
|
+
'aria-controls': sectionId,
|
|
9446
|
+
'aria-expanded': isOpen,
|
|
9449
9447
|
className: itemElement('link'),
|
|
9450
9448
|
ref: buttonRef,
|
|
9451
|
-
|
|
9449
|
+
handleClick: event => {
|
|
9452
9450
|
setIsOpen(!isOpen);
|
|
9453
9451
|
event.stopPropagation();
|
|
9454
9452
|
},
|
|
9455
|
-
children:
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9453
|
+
children: /*#__PURE__*/jsxs(Fragment, {
|
|
9454
|
+
children: [icon ? /*#__PURE__*/jsx(Icon, {
|
|
9455
|
+
className: itemElement('icon'),
|
|
9456
|
+
icon: icon,
|
|
9457
|
+
size: Size$1.xs
|
|
9458
|
+
}) : null, /*#__PURE__*/jsx(Text, {
|
|
9459
|
+
as: "span",
|
|
9460
|
+
truncate: true,
|
|
9461
|
+
className: itemElement('label'),
|
|
9462
|
+
ref: ref,
|
|
9463
|
+
children: label
|
|
9464
|
+
}), /*#__PURE__*/jsx(Icon, {
|
|
9465
|
+
className: classNames.join(itemElement('icon'), sectionElement('chevron')),
|
|
9466
|
+
icon: isOpen ? mdiChevronUp : mdiChevronDown
|
|
9467
|
+
})]
|
|
9468
|
+
})
|
|
9469
9469
|
}), isOpen && (isDropdown ? /*#__PURE__*/jsx(Popover, {
|
|
9470
9470
|
anchorRef: buttonRef,
|
|
9471
9471
|
isOpen: isOpen,
|
|
@@ -9501,6 +9501,9 @@ const NavigationSection = forwardRef((props, ref) => {
|
|
|
9501
9501
|
NavigationSection.displayName = COMPONENT_NAME$C;
|
|
9502
9502
|
NavigationSection.className = CLASSNAME$D;
|
|
9503
9503
|
|
|
9504
|
+
/** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
|
|
9505
|
+
const forwardRefPolymorphic = React__default.forwardRef;
|
|
9506
|
+
|
|
9504
9507
|
const {
|
|
9505
9508
|
block: block$z,
|
|
9506
9509
|
element: element$p
|
|
@@ -9517,6 +9520,7 @@ const NavigationItem = Object.assign(forwardRefPolymorphic((props, ref) => {
|
|
|
9517
9520
|
label,
|
|
9518
9521
|
isCurrentPage,
|
|
9519
9522
|
as: Element = 'a',
|
|
9523
|
+
onClick,
|
|
9520
9524
|
...forwardedProps
|
|
9521
9525
|
} = props;
|
|
9522
9526
|
const theme = useTheme();
|
|
@@ -9531,26 +9535,29 @@ const NavigationItem = Object.assign(forwardRefPolymorphic((props, ref) => {
|
|
|
9531
9535
|
children: /*#__PURE__*/jsx(Tooltip, {
|
|
9532
9536
|
label: tooltipLabel,
|
|
9533
9537
|
placement: Placement.TOP,
|
|
9534
|
-
children:
|
|
9538
|
+
children: RawClickable({
|
|
9535
9539
|
as: Element,
|
|
9536
9540
|
className: element$p('link', {
|
|
9537
9541
|
'is-selected': isCurrentPage
|
|
9538
9542
|
}),
|
|
9539
|
-
ref
|
|
9540
|
-
|
|
9543
|
+
ref,
|
|
9544
|
+
'aria-current': isCurrentPage ? 'page' : undefined,
|
|
9541
9545
|
...forwardedProps,
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9546
|
+
handleClick: onClick,
|
|
9547
|
+
children: /*#__PURE__*/jsxs(Fragment, {
|
|
9548
|
+
children: [icon ? /*#__PURE__*/jsx(Icon, {
|
|
9549
|
+
className: element$p('icon'),
|
|
9550
|
+
icon: icon,
|
|
9551
|
+
size: Size$1.xs,
|
|
9552
|
+
theme: theme
|
|
9553
|
+
}) : null, /*#__PURE__*/jsx(Text, {
|
|
9554
|
+
as: "span",
|
|
9555
|
+
truncate: true,
|
|
9556
|
+
className: element$p('label'),
|
|
9557
|
+
ref: labelRef,
|
|
9558
|
+
children: label
|
|
9559
|
+
})]
|
|
9560
|
+
})
|
|
9554
9561
|
})
|
|
9555
9562
|
})
|
|
9556
9563
|
});
|
|
@@ -10671,7 +10678,7 @@ const RadioButton$1 = props => {
|
|
|
10671
10678
|
label,
|
|
10672
10679
|
name,
|
|
10673
10680
|
ref,
|
|
10674
|
-
|
|
10681
|
+
handleChange,
|
|
10675
10682
|
theme,
|
|
10676
10683
|
value,
|
|
10677
10684
|
inputProps = {},
|
|
@@ -10679,9 +10686,9 @@ const RadioButton$1 = props => {
|
|
|
10679
10686
|
inputId,
|
|
10680
10687
|
...forwardedProps
|
|
10681
10688
|
} = props;
|
|
10682
|
-
const
|
|
10683
|
-
if (
|
|
10684
|
-
|
|
10689
|
+
const handleOnChange = event => {
|
|
10690
|
+
if (handleChange) {
|
|
10691
|
+
handleChange(value, name, event);
|
|
10685
10692
|
}
|
|
10686
10693
|
};
|
|
10687
10694
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -10703,7 +10710,7 @@ const RadioButton$1 = props => {
|
|
|
10703
10710
|
name: name,
|
|
10704
10711
|
value: value,
|
|
10705
10712
|
checked: isChecked,
|
|
10706
|
-
onChange:
|
|
10713
|
+
onChange: handleOnChange,
|
|
10707
10714
|
"aria-describedby": helper ? `${inputId}-helper` : undefined,
|
|
10708
10715
|
...(inputProps?.readOnly ? {
|
|
10709
10716
|
readOnly: inputProps.readOnly
|
|
@@ -10782,7 +10789,7 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
10782
10789
|
isChecked,
|
|
10783
10790
|
label,
|
|
10784
10791
|
name,
|
|
10785
|
-
onChange,
|
|
10792
|
+
handleChange: onChange,
|
|
10786
10793
|
theme,
|
|
10787
10794
|
value,
|
|
10788
10795
|
inputProps: {
|
|
@@ -11413,18 +11420,20 @@ const SideNavigationItem = forwardRef((props, ref) => {
|
|
|
11413
11420
|
})),
|
|
11414
11421
|
children: [shouldSplitActions ? /*#__PURE__*/jsxs("div", {
|
|
11415
11422
|
className: element$d('wrapper'),
|
|
11416
|
-
children: [
|
|
11423
|
+
children: [RawClickable({
|
|
11417
11424
|
as: linkAs || (linkProps?.href ? 'a' : 'button'),
|
|
11418
11425
|
...linkProps,
|
|
11419
11426
|
className: element$d('link'),
|
|
11420
|
-
|
|
11421
|
-
children:
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
-
|
|
11427
|
+
handleClick: onClick,
|
|
11428
|
+
children: /*#__PURE__*/jsxs(Fragment, {
|
|
11429
|
+
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
11430
|
+
className: element$d('icon'),
|
|
11431
|
+
icon: icon,
|
|
11432
|
+
size: Size$1.xs
|
|
11433
|
+
}), /*#__PURE__*/jsx("span", {
|
|
11434
|
+
children: label
|
|
11435
|
+
})]
|
|
11436
|
+
})
|
|
11428
11437
|
}), /*#__PURE__*/jsx(IconButton, {
|
|
11429
11438
|
...toggleButtonProps,
|
|
11430
11439
|
className: element$d('toggle'),
|
|
@@ -13041,7 +13050,7 @@ const Switch$1 = props => {
|
|
|
13041
13050
|
label,
|
|
13042
13051
|
name,
|
|
13043
13052
|
ref,
|
|
13044
|
-
|
|
13053
|
+
handleChange,
|
|
13045
13054
|
theme,
|
|
13046
13055
|
value,
|
|
13047
13056
|
inputProps = {},
|
|
@@ -13050,9 +13059,9 @@ const Switch$1 = props => {
|
|
|
13050
13059
|
position = DEFAULT_PROPS$h.position,
|
|
13051
13060
|
...forwardedProps
|
|
13052
13061
|
} = props;
|
|
13053
|
-
const
|
|
13054
|
-
if (
|
|
13055
|
-
|
|
13062
|
+
const handleOnChange = event => {
|
|
13063
|
+
if (handleChange) {
|
|
13064
|
+
handleChange(!isChecked, value, name, event);
|
|
13056
13065
|
}
|
|
13057
13066
|
};
|
|
13058
13067
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -13076,7 +13085,7 @@ const Switch$1 = props => {
|
|
|
13076
13085
|
name: name,
|
|
13077
13086
|
value: value,
|
|
13078
13087
|
checked: Boolean(isChecked),
|
|
13079
|
-
onChange:
|
|
13088
|
+
onChange: handleOnChange,
|
|
13080
13089
|
"aria-describedby": helper ? `${inputId}-helper` : undefined,
|
|
13081
13090
|
"aria-checked": Boolean(isChecked),
|
|
13082
13091
|
...(inputProps?.readOnly ? {
|
|
@@ -13160,7 +13169,7 @@ const Switch = forwardRef((props, ref) => {
|
|
|
13160
13169
|
isChecked,
|
|
13161
13170
|
label: children,
|
|
13162
13171
|
name,
|
|
13163
|
-
onChange,
|
|
13172
|
+
handleChange: onChange,
|
|
13164
13173
|
position,
|
|
13165
13174
|
theme,
|
|
13166
13175
|
value,
|
|
@@ -13362,7 +13371,7 @@ const TableCell$1 = props => {
|
|
|
13362
13371
|
className,
|
|
13363
13372
|
icon,
|
|
13364
13373
|
isSortable,
|
|
13365
|
-
|
|
13374
|
+
handleClick,
|
|
13366
13375
|
ref,
|
|
13367
13376
|
sortOrder,
|
|
13368
13377
|
variant = DEFAULT_PROPS$e.variant,
|
|
@@ -13370,10 +13379,10 @@ const TableCell$1 = props => {
|
|
|
13370
13379
|
} = props;
|
|
13371
13380
|
|
|
13372
13381
|
// Use button if clickable
|
|
13373
|
-
const Wrapper =
|
|
13382
|
+
const Wrapper = handleClick ? 'button' : 'div';
|
|
13374
13383
|
const wrapperProps = Wrapper === 'button' ? {
|
|
13375
13384
|
type: 'button',
|
|
13376
|
-
onClick:
|
|
13385
|
+
onClick: handleClick
|
|
13377
13386
|
} : undefined;
|
|
13378
13387
|
|
|
13379
13388
|
// ARIA sort
|
|
@@ -13440,13 +13449,13 @@ const TableCell$1 = props => {
|
|
|
13440
13449
|
*/
|
|
13441
13450
|
const TableCell = forwardRef((props, ref) => {
|
|
13442
13451
|
const {
|
|
13443
|
-
|
|
13452
|
+
onHeaderClick,
|
|
13444
13453
|
...otherProps
|
|
13445
13454
|
} = props;
|
|
13446
13455
|
return TableCell$1({
|
|
13447
13456
|
ref,
|
|
13448
|
-
|
|
13449
|
-
|
|
13457
|
+
...otherProps,
|
|
13458
|
+
handleClick: onHeaderClick
|
|
13450
13459
|
});
|
|
13451
13460
|
});
|
|
13452
13461
|
TableCell.displayName = COMPONENT_NAME$a;
|
|
@@ -14464,6 +14473,8 @@ const Thumbnail$1 = props => {
|
|
|
14464
14473
|
variant,
|
|
14465
14474
|
linkProps,
|
|
14466
14475
|
linkAs,
|
|
14476
|
+
handleClick,
|
|
14477
|
+
handleKeyPress,
|
|
14467
14478
|
...forwardedProps
|
|
14468
14479
|
} = props;
|
|
14469
14480
|
const isLoading = isLoadingProp || loadingState === 'isLoading';
|
|
@@ -14479,7 +14490,7 @@ const Thumbnail$1 = props => {
|
|
|
14479
14490
|
imageErrorStyle.display = 'none';
|
|
14480
14491
|
}
|
|
14481
14492
|
const isLink = Boolean(linkProps?.href || linkAs);
|
|
14482
|
-
const isClickable = !isAnyDisabled && Boolean(isLink || !!
|
|
14493
|
+
const isClickable = !isAnyDisabled && Boolean(isLink || !!handleClick || !!handleKeyPress);
|
|
14483
14494
|
const wrapperProps = {
|
|
14484
14495
|
...forwardedProps
|
|
14485
14496
|
};
|
|
@@ -14557,11 +14568,13 @@ const Thumbnail$1 = props => {
|
|
|
14557
14568
|
|
|
14558
14569
|
/** Render `RawClickable` as a function since it is a core component which needs to be treated as such */
|
|
14559
14570
|
if (isClickable) {
|
|
14560
|
-
return RawClickable
|
|
14571
|
+
return RawClickable({
|
|
14561
14572
|
ref,
|
|
14562
14573
|
...wrapperProps,
|
|
14563
14574
|
className: wrapperClassName,
|
|
14564
|
-
children: innerImage
|
|
14575
|
+
children: innerImage,
|
|
14576
|
+
handleClick,
|
|
14577
|
+
handleKeyPress
|
|
14565
14578
|
});
|
|
14566
14579
|
}
|
|
14567
14580
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -14668,6 +14681,8 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
14668
14681
|
focusPoint,
|
|
14669
14682
|
image,
|
|
14670
14683
|
imgRef: propImgRef,
|
|
14684
|
+
onClick,
|
|
14685
|
+
onKeyPress,
|
|
14671
14686
|
...forwardedProps
|
|
14672
14687
|
} = otherProps;
|
|
14673
14688
|
const [imgElement, setImgElement] = useState();
|
|
@@ -14687,6 +14702,8 @@ const Thumbnail = forwardRef((props, ref) => {
|
|
|
14687
14702
|
focusPointStyle,
|
|
14688
14703
|
loadingState,
|
|
14689
14704
|
imgRef: useMergeRefs(setImgElement, propImgRef),
|
|
14705
|
+
handleClick: onClick,
|
|
14706
|
+
handleKeyPress: onKeyPress,
|
|
14690
14707
|
image,
|
|
14691
14708
|
badge: badge && /*#__PURE__*/React__default.cloneElement(badge, {
|
|
14692
14709
|
className: classNames.join(element$4('badge'), badge.props.className)
|