@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 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 ? target ? 'text' : 'outline' : _ref$variant,
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__*/jsx("button", {
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: "flex shrink-0 flex-col rounded-lg bg-background-uiBackground01 shadow-modalShadow",
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/4 -translate-x-1': props.horizontalAlign === 'center' && props.size === 'small',
32654
- 'left-2/4 -translate-x-2': props.horizontalAlign === 'center' && props.size !== 'small'
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 (targetRef.current === null || isDisabledHover) {
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
- 'left-0': horizontalAlign === 'left',
32725
- 'right-0': horizontalAlign === 'right',
32726
- 'left-auto': horizontalAlign === 'center'
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__*/jsxs("div", {
32734
- className: tooltipBodyClasses,
32735
- style: {
32736
- maxWidth: maxWidth,
32737
- top: verticalPosition === 'bottom' ? size === 'small' ? targetDimensions.height + 8 + "px" : targetDimensions.height + 12 + "px" : 'unset',
32738
- bottom: verticalPosition === 'top' ? size === 'small' ? targetDimensions.height + 8 + "px" : targetDimensions.height + 12 + "px" : 'unset'
32739
- },
32740
- children: [content, /*#__PURE__*/jsx(TailIcon, {
32741
- size: size,
32742
- verticalPosition: verticalPosition,
32743
- horizontalAlign: horizontalAlign
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
  }