@zenkigen-inc/component-ui 1.6.3 → 1.7.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/dist/index.esm.js +41 -36
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +41 -34
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -49,8 +49,8 @@ function Avatar(_ref) {
|
|
|
49
49
|
'bg-disabled-disabled01': props.isDisabled,
|
|
50
50
|
'bg-icon-icon01': !props.userId
|
|
51
51
|
}, _clsx[userColors[((_props$userId = props.userId) != null ? _props$userId : 0) % userColors.length]] = props.userId && !props.isDisabled, _clsx));
|
|
52
|
-
var trimmedFirstName = props.firstName.trim();
|
|
53
|
-
var trimmedLastName = props.lastName.trim();
|
|
52
|
+
var trimmedFirstName = props.firstName.replace(' ', ' ').trim();
|
|
53
|
+
var trimmedLastName = props.lastName.replace(' ', ' ').trim().trim();
|
|
54
54
|
var nameOnIcon = isAsciiString(trimmedLastName) ? trimmedFirstName.slice(0, 1).toUpperCase() + trimmedLastName.slice(0, 1).toUpperCase() : (trimmedLastName + trimmedFirstName).slice(0, 2);
|
|
55
55
|
return /*#__PURE__*/jsx("span", {
|
|
56
56
|
className: classes,
|
|
@@ -31210,7 +31210,7 @@ function Dropdown(_ref) {
|
|
|
31210
31210
|
_ref$size = _ref.size,
|
|
31211
31211
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
31212
31212
|
_ref$variant = _ref.variant,
|
|
31213
|
-
variant = _ref$variant === void 0 ?
|
|
31213
|
+
variant = _ref$variant === void 0 ? 'outline' : _ref$variant,
|
|
31214
31214
|
title = _ref.title,
|
|
31215
31215
|
_ref$isDisabled = _ref.isDisabled,
|
|
31216
31216
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
@@ -31278,13 +31278,19 @@ function Dropdown(_ref) {
|
|
|
31278
31278
|
children: /*#__PURE__*/jsxs("div", {
|
|
31279
31279
|
ref: targetRef,
|
|
31280
31280
|
className: wrapperClasses,
|
|
31281
|
-
children: [target ? /*#__PURE__*/
|
|
31281
|
+
children: [target ? /*#__PURE__*/jsxs("button", {
|
|
31282
31282
|
type: "button",
|
|
31283
31283
|
title: title,
|
|
31284
31284
|
className: childrenButtonClasses,
|
|
31285
31285
|
onClick: handleToggle,
|
|
31286
31286
|
disabled: isDisabled,
|
|
31287
|
-
children: target
|
|
31287
|
+
children: [target, !isArrowHidden && /*#__PURE__*/jsx("div", {
|
|
31288
|
+
className: "ml-2 flex items-center fill-icon-icon01",
|
|
31289
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
31290
|
+
name: isVisible ? 'angle-small-up' : 'angle-small-down',
|
|
31291
|
+
size: size === 'large' ? 'medium' : 'small'
|
|
31292
|
+
})
|
|
31293
|
+
})]
|
|
31288
31294
|
}) : /*#__PURE__*/jsxs("button", {
|
|
31289
31295
|
type: "button",
|
|
31290
31296
|
title: title,
|
|
@@ -31551,7 +31557,7 @@ function Modal(_ref) {
|
|
|
31551
31557
|
children: /*#__PURE__*/jsx("div", {
|
|
31552
31558
|
className: "fixed left-0 top-0 z-overlay flex h-full w-full items-center justify-center bg-background-backgroundOverlayBlack",
|
|
31553
31559
|
children: /*#__PURE__*/jsx("div", {
|
|
31554
|
-
className: "
|
|
31560
|
+
className: "grid grid-rows-[max-content_1fr_max-content] flex-col rounded-lg bg-background-uiBackground01 shadow-modalShadow",
|
|
31555
31561
|
style: {
|
|
31556
31562
|
width: renderWidth,
|
|
31557
31563
|
height: renderHeight
|
|
@@ -32650,8 +32656,8 @@ var TailIcon = function TailIcon(props) {
|
|
|
32650
32656
|
'right-4': props.horizontalAlign === 'right' && props.size !== 'small',
|
|
32651
32657
|
'left-2': props.horizontalAlign === 'left' && props.size === 'small',
|
|
32652
32658
|
'left-4': props.horizontalAlign === 'left' && props.size !== 'small',
|
|
32653
|
-
'left-2
|
|
32654
|
-
'left-2
|
|
32659
|
+
'left-1/2 -translate-x-1': props.horizontalAlign === 'center' && props.size === 'small',
|
|
32660
|
+
'left-1/2 -translate-x-2': props.horizontalAlign === 'center' && props.size !== 'small'
|
|
32655
32661
|
});
|
|
32656
32662
|
if (props.size === 'small') {
|
|
32657
32663
|
return /*#__PURE__*/jsx("svg", {
|
|
@@ -32694,54 +32700,53 @@ function Tooltip(_ref) {
|
|
|
32694
32700
|
var _useState = useState(false),
|
|
32695
32701
|
isVisible = _useState[0],
|
|
32696
32702
|
setIsVisible = _useState[1];
|
|
32697
|
-
var _useState2 = useState({
|
|
32698
|
-
width: 0,
|
|
32699
|
-
height: 0
|
|
32700
|
-
}),
|
|
32701
|
-
targetDimensions = _useState2[0],
|
|
32702
|
-
setTargetDimensions = _useState2[1];
|
|
32703
32703
|
var targetRef = useRef(null);
|
|
32704
32704
|
var handleMouseOverWrapper = useCallback(function () {
|
|
32705
|
-
if (
|
|
32705
|
+
if (isDisabledHover) {
|
|
32706
32706
|
return;
|
|
32707
32707
|
}
|
|
32708
|
-
var dimensions = targetRef.current.getBoundingClientRect();
|
|
32709
|
-
var calculatedDimensions = {
|
|
32710
|
-
width: dimensions.right - dimensions.left,
|
|
32711
|
-
height: dimensions.bottom - dimensions.top
|
|
32712
|
-
};
|
|
32713
|
-
setTargetDimensions(calculatedDimensions);
|
|
32714
32708
|
setIsVisible(true);
|
|
32715
32709
|
}, [isDisabledHover]);
|
|
32716
32710
|
var handleMouseOutWrapper = useCallback(function () {
|
|
32717
32711
|
setIsVisible(false);
|
|
32718
32712
|
}, []);
|
|
32713
|
+
var tooltipWrapClasses = clsx$1('absolute inset-x-0 z-tooltip m-auto flex', {
|
|
32714
|
+
'top-0': verticalPosition !== 'bottom',
|
|
32715
|
+
'bottom-0': verticalPosition === 'bottom',
|
|
32716
|
+
'justify-start': horizontalAlign === 'left',
|
|
32717
|
+
'justify-center': horizontalAlign === 'center',
|
|
32718
|
+
'justify-end': horizontalAlign === 'right',
|
|
32719
|
+
'w-[24px]': size === 'small',
|
|
32720
|
+
'w-[46px]': size !== 'small'
|
|
32721
|
+
});
|
|
32719
32722
|
var tooltipBodyClasses = clsx$1('absolute z-tooltip inline-block w-max rounded bg-background-uiBackgroundTooltip text-text-textOnColor', {
|
|
32720
32723
|
'typography-body3regular': size === 'small',
|
|
32721
32724
|
'typography-body2regular': size === 'medium',
|
|
32722
32725
|
'px-2 pb-1 pt-1.5': size === 'small',
|
|
32723
32726
|
'px-4 py-3': size === 'medium',
|
|
32724
|
-
'
|
|
32725
|
-
'
|
|
32726
|
-
'
|
|
32727
|
+
'bottom-2': verticalPosition !== 'bottom' && size === 'small',
|
|
32728
|
+
'bottom-3': verticalPosition !== 'bottom' && size === 'medium',
|
|
32729
|
+
'top-2': verticalPosition === 'bottom' && size === 'small',
|
|
32730
|
+
'top-3': verticalPosition === 'bottom' && size === 'medium'
|
|
32727
32731
|
});
|
|
32728
32732
|
return /*#__PURE__*/jsxs("div", {
|
|
32729
32733
|
ref: targetRef,
|
|
32730
32734
|
className: "relative flex items-center justify-center",
|
|
32731
32735
|
onMouseOver: handleMouseOverWrapper,
|
|
32732
32736
|
onMouseLeave: handleMouseOutWrapper,
|
|
32733
|
-
children: [children, isVisible && /*#__PURE__*/
|
|
32734
|
-
className:
|
|
32735
|
-
|
|
32736
|
-
|
|
32737
|
-
|
|
32738
|
-
|
|
32739
|
-
|
|
32740
|
-
|
|
32741
|
-
|
|
32742
|
-
|
|
32743
|
-
|
|
32744
|
-
|
|
32737
|
+
children: [children, isVisible && /*#__PURE__*/jsx("div", {
|
|
32738
|
+
className: tooltipWrapClasses,
|
|
32739
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
32740
|
+
className: tooltipBodyClasses,
|
|
32741
|
+
style: {
|
|
32742
|
+
maxWidth: maxWidth
|
|
32743
|
+
},
|
|
32744
|
+
children: [content, /*#__PURE__*/jsx(TailIcon, {
|
|
32745
|
+
size: size,
|
|
32746
|
+
verticalPosition: verticalPosition,
|
|
32747
|
+
horizontalAlign: horizontalAlign
|
|
32748
|
+
})]
|
|
32749
|
+
})
|
|
32745
32750
|
})]
|
|
32746
32751
|
});
|
|
32747
32752
|
}
|