@lumx/react 3.11.4-alpha.0 → 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
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
|
@@ -14344,7 +14344,7 @@ Uploader.displayName = COMPONENT_NAME$1;
|
|
|
14344
14344
|
Uploader.className = CLASSNAME$1;
|
|
14345
14345
|
Uploader.defaultProps = DEFAULT_PROPS$1;
|
|
14346
14346
|
|
|
14347
|
-
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"];
|
|
14348
14348
|
|
|
14349
14349
|
/**
|
|
14350
14350
|
* User block sizes.
|
|
@@ -14396,7 +14396,10 @@ const UserBlock = forwardRef((props, ref) => {
|
|
|
14396
14396
|
orientation,
|
|
14397
14397
|
simpleAction,
|
|
14398
14398
|
size,
|
|
14399
|
-
theme = defaultTheme
|
|
14399
|
+
theme = defaultTheme,
|
|
14400
|
+
children,
|
|
14401
|
+
additionalFields,
|
|
14402
|
+
after
|
|
14400
14403
|
} = props,
|
|
14401
14404
|
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
14402
14405
|
let componentSize = size;
|
|
@@ -14430,7 +14433,8 @@ const UserBlock = forwardRef((props, ref) => {
|
|
|
14430
14433
|
}
|
|
14431
14434
|
return /*#__PURE__*/React__default.createElement(NameComponent, nProps, name);
|
|
14432
14435
|
}, [avatarProps, isClickable, linkAs, linkProps, name, nameProps, onClick]);
|
|
14433
|
-
const
|
|
14436
|
+
const shouldDisplayFields = componentSize !== Size.s && componentSize !== Size.xs;
|
|
14437
|
+
const fieldsBlock = fields && shouldDisplayFields && /*#__PURE__*/React__default.createElement("div", {
|
|
14434
14438
|
className: `${CLASSNAME}__fields`
|
|
14435
14439
|
}, fields.map((field, idx) => /*#__PURE__*/React__default.createElement("span", {
|
|
14436
14440
|
key: idx,
|
|
@@ -14457,13 +14461,15 @@ const UserBlock = forwardRef((props, ref) => {
|
|
|
14457
14461
|
size: componentSize,
|
|
14458
14462
|
onClick: onClick,
|
|
14459
14463
|
theme: theme
|
|
14460
|
-
})), (fields || name) && /*#__PURE__*/React__default.createElement("div", {
|
|
14464
|
+
})), (fields || name || children || additionalFields) && /*#__PURE__*/React__default.createElement("div", {
|
|
14461
14465
|
className: `${CLASSNAME}__wrapper`
|
|
14462
|
-
}, nameBlock, fieldsBlock), shouldDisplayActions && simpleAction && /*#__PURE__*/React__default.createElement("div", {
|
|
14466
|
+
}, children || nameBlock, fieldsBlock, shouldDisplayFields ? additionalFields : null), shouldDisplayActions && simpleAction && /*#__PURE__*/React__default.createElement("div", {
|
|
14463
14467
|
className: `${CLASSNAME}__action`
|
|
14464
14468
|
}, simpleAction), shouldDisplayActions && multipleActions && /*#__PURE__*/React__default.createElement("div", {
|
|
14465
14469
|
className: `${CLASSNAME}__actions`
|
|
14466
|
-
}, multipleActions)
|
|
14470
|
+
}, multipleActions), after ? /*#__PURE__*/React__default.createElement("div", {
|
|
14471
|
+
className: `${CLASSNAME}__after`
|
|
14472
|
+
}, after) : null);
|
|
14467
14473
|
});
|
|
14468
14474
|
UserBlock.displayName = COMPONENT_NAME;
|
|
14469
14475
|
UserBlock.className = CLASSNAME;
|