@lumx/react 3.11.3 → 3.12.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/index.d.ts +5 -1
- package/index.js +23 -11
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/dialog/Dialog.test.tsx +16 -0
- package/src/components/dialog/Dialog.tsx +66 -56
- package/src/components/lightbox/Lightbox.test.tsx +18 -0
- package/src/components/lightbox/Lightbox.tsx +10 -8
- package/src/components/popover-dialog/PopoverDialog.stories.tsx +2 -1
- package/src/components/popover-dialog/PopoverDialog.test.tsx +21 -1
- package/src/components/popover-dialog/PopoverDialog.tsx +2 -1
- package/src/components/user-block/UserBlock.stories.tsx +29 -2
- package/src/components/user-block/UserBlock.test.tsx +15 -3
- package/src/components/user-block/UserBlock.tsx +15 -4
package/index.d.ts
CHANGED
|
@@ -3345,7 +3345,7 @@ interface UserBlockProps extends GenericProps, HasTheme {
|
|
|
3345
3345
|
/** Multiple action toolbar content. */
|
|
3346
3346
|
multipleActions?: ReactNode;
|
|
3347
3347
|
/** User name. */
|
|
3348
|
-
name?:
|
|
3348
|
+
name?: React.ReactNode;
|
|
3349
3349
|
/** Props to pass to the name block. */
|
|
3350
3350
|
nameProps?: GenericProps;
|
|
3351
3351
|
/** Orientation. */
|
|
@@ -3360,6 +3360,10 @@ interface UserBlockProps extends GenericProps, HasTheme {
|
|
|
3360
3360
|
onMouseEnter?(): void;
|
|
3361
3361
|
/** On mouse leave callback. */
|
|
3362
3362
|
onMouseLeave?(): void;
|
|
3363
|
+
/** Display additional fields below the original name and fields */
|
|
3364
|
+
additionalFields?: React.ReactNode;
|
|
3365
|
+
/** Display an additional element after the entire component. (to the right if orientation is horizontal, at the bottom if orientation is vertical) */
|
|
3366
|
+
after?: React.ReactNode;
|
|
3363
3367
|
}
|
|
3364
3368
|
/**
|
|
3365
3369
|
* UserBlock component.
|
package/index.js
CHANGED
|
@@ -6958,7 +6958,9 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
6958
6958
|
}
|
|
6959
6959
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
6960
6960
|
className: `${CLASSNAME$10}__overlay`
|
|
6961
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
6961
|
+
}), /*#__PURE__*/React__default.createElement(HeadingLevelProvider, {
|
|
6962
|
+
level: 2
|
|
6963
|
+
}, /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
6962
6964
|
value: undefined
|
|
6963
6965
|
}, /*#__PURE__*/React__default.createElement("section", _extends({
|
|
6964
6966
|
className: `${CLASSNAME$10}__container`,
|
|
@@ -6988,7 +6990,7 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
6988
6990
|
className: `${CLASSNAME$10}__progress-overlay`
|
|
6989
6991
|
}, /*#__PURE__*/React__default.createElement(Progress, {
|
|
6990
6992
|
variant: ProgressVariant.circular
|
|
6991
|
-
}))))))), document.body) : null;
|
|
6993
|
+
})))))))), document.body) : null;
|
|
6992
6994
|
});
|
|
6993
6995
|
Dialog.displayName = COMPONENT_NAME$10;
|
|
6994
6996
|
Dialog.className = CLASSNAME$10;
|
|
@@ -9055,7 +9057,9 @@ const Lightbox = forwardRef((props, ref) => {
|
|
|
9055
9057
|
theme: "dark",
|
|
9056
9058
|
type: "button",
|
|
9057
9059
|
onClick: onClose
|
|
9058
|
-
}))), /*#__PURE__*/React__default.createElement(
|
|
9060
|
+
}))), /*#__PURE__*/React__default.createElement(HeadingLevelProvider, {
|
|
9061
|
+
level: 2
|
|
9062
|
+
}, /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
9059
9063
|
value: undefined
|
|
9060
9064
|
}, /*#__PURE__*/React__default.createElement(ClickAwayProvider, {
|
|
9061
9065
|
callback: !preventAutoClose && onClose,
|
|
@@ -9064,7 +9068,7 @@ const Lightbox = forwardRef((props, ref) => {
|
|
|
9064
9068
|
ref: childrenRef,
|
|
9065
9069
|
className: `${CLASSNAME$L}__wrapper`,
|
|
9066
9070
|
role: "presentation"
|
|
9067
|
-
}, children)))), document.body);
|
|
9071
|
+
}, children))))), document.body);
|
|
9068
9072
|
});
|
|
9069
9073
|
Lightbox.displayName = COMPONENT_NAME$L;
|
|
9070
9074
|
Lightbox.className = CLASSNAME$L;
|
|
@@ -9914,7 +9918,9 @@ const PopoverDialog = forwardRef((props, ref) => {
|
|
|
9914
9918
|
closeOnClickAway: true,
|
|
9915
9919
|
closeOnEscape: true,
|
|
9916
9920
|
withFocusTrap: true
|
|
9917
|
-
}),
|
|
9921
|
+
}), /*#__PURE__*/React__default.createElement(HeadingLevelProvider, {
|
|
9922
|
+
level: 2
|
|
9923
|
+
}, children));
|
|
9918
9924
|
});
|
|
9919
9925
|
PopoverDialog.displayName = COMPONENT_NAME$A;
|
|
9920
9926
|
PopoverDialog.className = CLASSNAME$A;
|
|
@@ -14338,7 +14344,7 @@ Uploader.displayName = COMPONENT_NAME$1;
|
|
|
14338
14344
|
Uploader.className = CLASSNAME$1;
|
|
14339
14345
|
Uploader.defaultProps = DEFAULT_PROPS$1;
|
|
14340
14346
|
|
|
14341
|
-
const _excluded = ["avatarProps", "className", "fields", "linkProps", "linkAs", "multipleActions", "name", "nameProps", "onClick", "onMouseEnter", "onMouseLeave", "orientation", "simpleAction", "size", "theme"];
|
|
14347
|
+
const _excluded = ["avatarProps", "className", "fields", "linkProps", "linkAs", "multipleActions", "name", "nameProps", "onClick", "onMouseEnter", "onMouseLeave", "orientation", "simpleAction", "size", "theme", "children", "additionalFields", "after"];
|
|
14342
14348
|
|
|
14343
14349
|
/**
|
|
14344
14350
|
* User block sizes.
|
|
@@ -14390,7 +14396,10 @@ const UserBlock = forwardRef((props, ref) => {
|
|
|
14390
14396
|
orientation,
|
|
14391
14397
|
simpleAction,
|
|
14392
14398
|
size,
|
|
14393
|
-
theme = defaultTheme
|
|
14399
|
+
theme = defaultTheme,
|
|
14400
|
+
children,
|
|
14401
|
+
additionalFields,
|
|
14402
|
+
after
|
|
14394
14403
|
} = props,
|
|
14395
14404
|
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
14396
14405
|
let componentSize = size;
|
|
@@ -14424,7 +14433,8 @@ const UserBlock = forwardRef((props, ref) => {
|
|
|
14424
14433
|
}
|
|
14425
14434
|
return /*#__PURE__*/React__default.createElement(NameComponent, nProps, name);
|
|
14426
14435
|
}, [avatarProps, isClickable, linkAs, linkProps, name, nameProps, onClick]);
|
|
14427
|
-
const
|
|
14436
|
+
const shouldDisplayFields = componentSize !== Size.s && componentSize !== Size.xs;
|
|
14437
|
+
const fieldsBlock = fields && shouldDisplayFields && /*#__PURE__*/React__default.createElement("div", {
|
|
14428
14438
|
className: `${CLASSNAME}__fields`
|
|
14429
14439
|
}, fields.map((field, idx) => /*#__PURE__*/React__default.createElement("span", {
|
|
14430
14440
|
key: idx,
|
|
@@ -14451,13 +14461,15 @@ const UserBlock = forwardRef((props, ref) => {
|
|
|
14451
14461
|
size: componentSize,
|
|
14452
14462
|
onClick: onClick,
|
|
14453
14463
|
theme: theme
|
|
14454
|
-
})), (fields || name) && /*#__PURE__*/React__default.createElement("div", {
|
|
14464
|
+
})), (fields || name || children || additionalFields) && /*#__PURE__*/React__default.createElement("div", {
|
|
14455
14465
|
className: `${CLASSNAME}__wrapper`
|
|
14456
|
-
}, nameBlock, fieldsBlock), shouldDisplayActions && simpleAction && /*#__PURE__*/React__default.createElement("div", {
|
|
14466
|
+
}, children || nameBlock, fieldsBlock, shouldDisplayFields ? additionalFields : null), shouldDisplayActions && simpleAction && /*#__PURE__*/React__default.createElement("div", {
|
|
14457
14467
|
className: `${CLASSNAME}__action`
|
|
14458
14468
|
}, simpleAction), shouldDisplayActions && multipleActions && /*#__PURE__*/React__default.createElement("div", {
|
|
14459
14469
|
className: `${CLASSNAME}__actions`
|
|
14460
|
-
}, multipleActions)
|
|
14470
|
+
}, multipleActions), after ? /*#__PURE__*/React__default.createElement("div", {
|
|
14471
|
+
className: `${CLASSNAME}__after`
|
|
14472
|
+
}, after) : null);
|
|
14461
14473
|
});
|
|
14462
14474
|
UserBlock.displayName = COMPONENT_NAME;
|
|
14463
14475
|
UserBlock.className = CLASSNAME;
|