@zenkigen-inc/component-ui 1.6.2 → 1.6.4
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/hooks/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +32 -33
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -31
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-outside-click';
|
package/dist/index.d.ts
CHANGED
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,
|
|
@@ -32650,8 +32650,8 @@ var TailIcon = function TailIcon(props) {
|
|
|
32650
32650
|
'right-4': props.horizontalAlign === 'right' && props.size !== 'small',
|
|
32651
32651
|
'left-2': props.horizontalAlign === 'left' && props.size === 'small',
|
|
32652
32652
|
'left-4': props.horizontalAlign === 'left' && props.size !== 'small',
|
|
32653
|
-
'left-2
|
|
32654
|
-
'left-2
|
|
32653
|
+
'left-1/2 -translate-x-1': props.horizontalAlign === 'center' && props.size === 'small',
|
|
32654
|
+
'left-1/2 -translate-x-2': props.horizontalAlign === 'center' && props.size !== 'small'
|
|
32655
32655
|
});
|
|
32656
32656
|
if (props.size === 'small') {
|
|
32657
32657
|
return /*#__PURE__*/jsx("svg", {
|
|
@@ -32694,57 +32694,56 @@ function Tooltip(_ref) {
|
|
|
32694
32694
|
var _useState = useState(false),
|
|
32695
32695
|
isVisible = _useState[0],
|
|
32696
32696
|
setIsVisible = _useState[1];
|
|
32697
|
-
var _useState2 = useState({
|
|
32698
|
-
width: 0,
|
|
32699
|
-
height: 0
|
|
32700
|
-
}),
|
|
32701
|
-
targetDimensions = _useState2[0],
|
|
32702
|
-
setTargetDimensions = _useState2[1];
|
|
32703
32697
|
var targetRef = useRef(null);
|
|
32704
32698
|
var handleMouseOverWrapper = useCallback(function () {
|
|
32705
|
-
if (
|
|
32699
|
+
if (isDisabledHover) {
|
|
32706
32700
|
return;
|
|
32707
32701
|
}
|
|
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
32702
|
setIsVisible(true);
|
|
32715
32703
|
}, [isDisabledHover]);
|
|
32716
32704
|
var handleMouseOutWrapper = useCallback(function () {
|
|
32717
32705
|
setIsVisible(false);
|
|
32718
32706
|
}, []);
|
|
32707
|
+
var tooltipWrapClasses = clsx$1('absolute inset-x-0 z-tooltip m-auto flex', {
|
|
32708
|
+
'top-0': verticalPosition !== 'bottom',
|
|
32709
|
+
'bottom-0': verticalPosition === 'bottom',
|
|
32710
|
+
'justify-start': horizontalAlign === 'left',
|
|
32711
|
+
'justify-center': horizontalAlign === 'center',
|
|
32712
|
+
'justify-end': horizontalAlign === 'right',
|
|
32713
|
+
'w-[24px]': size === 'small',
|
|
32714
|
+
'w-[46px]': size !== 'small'
|
|
32715
|
+
});
|
|
32719
32716
|
var tooltipBodyClasses = clsx$1('absolute z-tooltip inline-block w-max rounded bg-background-uiBackgroundTooltip text-text-textOnColor', {
|
|
32720
32717
|
'typography-body3regular': size === 'small',
|
|
32721
32718
|
'typography-body2regular': size === 'medium',
|
|
32722
32719
|
'px-2 pb-1 pt-1.5': size === 'small',
|
|
32723
32720
|
'px-4 py-3': size === 'medium',
|
|
32724
|
-
'
|
|
32725
|
-
'
|
|
32726
|
-
'
|
|
32721
|
+
'bottom-2': verticalPosition !== 'bottom' && size === 'small',
|
|
32722
|
+
'bottom-3': verticalPosition !== 'bottom' && size === 'medium',
|
|
32723
|
+
'top-2': verticalPosition === 'bottom' && size === 'small',
|
|
32724
|
+
'top-3': verticalPosition === 'bottom' && size === 'medium'
|
|
32727
32725
|
});
|
|
32728
32726
|
return /*#__PURE__*/jsxs("div", {
|
|
32729
32727
|
ref: targetRef,
|
|
32730
32728
|
className: "relative flex items-center justify-center",
|
|
32731
32729
|
onMouseOver: handleMouseOverWrapper,
|
|
32732
32730
|
onMouseLeave: handleMouseOutWrapper,
|
|
32733
|
-
children: [children, isVisible && /*#__PURE__*/
|
|
32734
|
-
className:
|
|
32735
|
-
|
|
32736
|
-
|
|
32737
|
-
|
|
32738
|
-
|
|
32739
|
-
|
|
32740
|
-
|
|
32741
|
-
|
|
32742
|
-
|
|
32743
|
-
|
|
32744
|
-
|
|
32731
|
+
children: [children, isVisible && /*#__PURE__*/jsx("div", {
|
|
32732
|
+
className: tooltipWrapClasses,
|
|
32733
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
32734
|
+
className: tooltipBodyClasses,
|
|
32735
|
+
style: {
|
|
32736
|
+
maxWidth: maxWidth
|
|
32737
|
+
},
|
|
32738
|
+
children: [content, /*#__PURE__*/jsx(TailIcon, {
|
|
32739
|
+
size: size,
|
|
32740
|
+
verticalPosition: verticalPosition,
|
|
32741
|
+
horizontalAlign: horizontalAlign
|
|
32742
|
+
})]
|
|
32743
|
+
})
|
|
32745
32744
|
})]
|
|
32746
32745
|
});
|
|
32747
32746
|
}
|
|
32748
32747
|
|
|
32749
|
-
export { Avatar, Breadcrumb, Button, Checkbox, Dropdown, EvaluationStar, Heading, Icon, IconButton, Loading, Modal, NotificationInline, Pagination, PaginationSelect, Radio, Search, Select, SelectSort, Tab, TabItem, Table, TableCell, TableRow, Tag, TextArea, TextInput, Toast, ToastProvider, Toggle, Tooltip, useToast };
|
|
32748
|
+
export { Avatar, Breadcrumb, Button, Checkbox, Dropdown, EvaluationStar, Heading, Icon, IconButton, Loading, Modal, NotificationInline, Pagination, PaginationSelect, Radio, Search, Select, SelectSort, Tab, TabItem, Table, TableCell, TableRow, Tag, TextArea, TextInput, Toast, ToastProvider, Toggle, Tooltip, useOutsideClick, useToast };
|
|
32750
32749
|
//# sourceMappingURL=index.esm.js.map
|