@zenkigen-inc/component-ui 1.1.1 → 1.1.2

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
@@ -63,7 +63,7 @@ function Button(_ref) {
63
63
  _ref$variant = _ref.variant,
64
64
  variant = _ref$variant === void 0 ? 'fill' : _ref$variant,
65
65
  props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
66
- var baseClasses = clsx('rounded', 'flex', 'shrink-0', 'gap-1', 'items-center', 'justify-center', buttonColors[variant].base, buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, size === 'large' ? typography.label.label1regular : typography.label.label2regular, {
66
+ var baseClasses = clsx('rounded-button', 'flex', 'shrink-0', 'gap-1', 'items-center', 'justify-center', buttonColors[variant].base, buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, size === 'large' ? typography.label.label1regular : typography.label.label2regular, {
67
67
  'h-6 px-2.5': size === 'small'
68
68
  }, {
69
69
  'h-8 px-3': size === 'medium'
@@ -31436,12 +31436,13 @@ if (process.env.NODE_ENV === 'production') {
31436
31436
  });
31437
31437
 
31438
31438
  var ModalContext = /*#__PURE__*/createContext({
31439
- size: 'medium',
31439
+ width: 480,
31440
31440
  setIsOpen: function setIsOpen() {
31441
31441
  return false;
31442
31442
  }
31443
31443
  });
31444
31444
 
31445
+ var sizeSmallLimit = 420;
31445
31446
  function ModalButtonTab(_ref) {
31446
31447
  var primaryButtonLabel = _ref.primaryButtonLabel,
31447
31448
  secondaryButtonLabel = _ref.secondaryButtonLabel,
@@ -31456,7 +31457,7 @@ function ModalButtonTab(_ref) {
31456
31457
  subButtonLabel = _ref.subButtonLabel,
31457
31458
  onClickSubButton = _ref.onClickSubButton;
31458
31459
  var _useContext = useContext(ModalContext),
31459
- size = _useContext.size,
31460
+ width = _useContext.width,
31460
31461
  setIsOpen = _useContext.setIsOpen;
31461
31462
  var handleClickPrimaryButton = useCallback(function () {
31462
31463
  onClickPrimaryButton();
@@ -31470,17 +31471,18 @@ function ModalButtonTab(_ref) {
31470
31471
  onClickSubButton == null || onClickSubButton();
31471
31472
  }, [onClickSubButton]);
31472
31473
  var wrapperClasses = clsx$1('flex', 'shrink-0', 'items-center', 'w-full', 'rounded-b-lg', 'py-4', 'px-6', {
31473
- 'justify-between': isWithCheckbox || subButtonLabel && size !== 'small',
31474
+ 'justify-between': isWithCheckbox || subButtonLabel && sizeSmallLimit <= width,
31474
31475
  'justify-end': !isWithCheckbox || !subButtonLabel,
31475
- 'justify-center': subButtonLabel && size === 'small',
31476
+ 'justify-center': subButtonLabel && width < sizeSmallLimit,
31476
31477
  'border-t-[1px] border-border-uiBorder01': !isNoBorder,
31477
- 'gap-y-4': size === 'small',
31478
- 'flex-wrap': size === 'small' && isWithCheckbox,
31479
- 'flex-wrap-reverse': size === 'small' && subButtonLabel
31478
+ 'gap-y-4': width < sizeSmallLimit,
31479
+ 'flex-wrap': width < sizeSmallLimit && isWithCheckbox,
31480
+ 'flex-wrap-reverse': width < sizeSmallLimit && subButtonLabel
31480
31481
  });
31481
31482
  var buttonContainerClasses = clsx$1('flex', 'items-center', {
31482
- 'gap-x-2': size === 'small',
31483
- 'gap-x-4': size === 'medium' || size === 'large' || size === 'x-large'
31483
+ 'w-full justify-center': width < sizeSmallLimit,
31484
+ 'gap-x-2': width < sizeSmallLimit,
31485
+ 'gap-x-4': sizeSmallLimit <= width
31484
31486
  });
31485
31487
  return /*#__PURE__*/jsxs("div", {
31486
31488
  className: wrapperClasses,
@@ -31501,13 +31503,13 @@ function ModalButtonTab(_ref) {
31501
31503
  children: [/*#__PURE__*/jsx(Button, {
31502
31504
  variant: "outline",
31503
31505
  size: "large",
31504
- width: size === 'small' ? 132 : 'auto',
31506
+ width: width < sizeSmallLimit ? 132 : 'auto',
31505
31507
  onClick: handleClickSecondaryButton,
31506
31508
  children: secondaryButtonLabel
31507
31509
  }, "1"), /*#__PURE__*/jsx(Button, {
31508
31510
  variant: isDanger ? 'fillDanger' : 'fill',
31509
31511
  size: "large",
31510
- width: size === 'small' ? 132 : 'auto',
31512
+ width: width < sizeSmallLimit ? 132 : 'auto',
31511
31513
  onClick: handleClickPrimaryButton,
31512
31514
  children: primaryButtonLabel
31513
31515
  }, "2")]
@@ -31587,8 +31589,8 @@ function ModalTab(_ref) {
31587
31589
 
31588
31590
  function Modal(_ref) {
31589
31591
  var children = _ref.children,
31590
- _ref$size = _ref.size,
31591
- size = _ref$size === void 0 ? 'medium' : _ref$size,
31592
+ _ref$width = _ref.width,
31593
+ width = _ref$width === void 0 ? 480 : _ref$width,
31592
31594
  height = _ref.height,
31593
31595
  isOpen = _ref.isOpen,
31594
31596
  setIsOpen = _ref.setIsOpen,
@@ -31596,17 +31598,12 @@ function Modal(_ref) {
31596
31598
  headerElement = _ref.headerElement,
31597
31599
  tabElement = _ref.tabElement,
31598
31600
  buttonTabElement = _ref.buttonTabElement;
31599
- var wrapperClasses = clsx$1('flex', 'items-center', 'justify-center', 'z-overlay', 'bg-background-backgroundOverlayBlack', 'fixed left-0 top-0', 'h-full w-full');
31600
- var modalBaseClasses = clsx$1('flex', 'shrink-0', 'flex-col', 'bg-background-uiBackground01', 'rounded-lg', 'shadow-modalShadow', {
31601
- 'w-[320px]': size === 'small',
31602
- 'w-[480px]': size === 'medium',
31603
- 'w-[640px]': size === 'large',
31604
- 'w-[720px]': size === 'x-large'
31605
- });
31606
- var contentClasses = clsx$1('flex', 'items-center', 'justify-center', 'overflow-y-auto');
31601
+ var wrapperClasses = 'flex items-center justify-center z-overlay bg-background-backgroundOverlayBlack fixed left-0 top-0 h-full w-full';
31602
+ var modalBaseClasses = 'flex shrink-0 flex-col bg-background-uiBackground01 rounded-lg shadow-modalShadow';
31603
+ var contentClasses = 'flex items-center justify-center overflow-y-auto';
31607
31604
  return /*#__PURE__*/reactDom.createPortal(isOpen && /*#__PURE__*/jsx(ModalContext.Provider, {
31608
31605
  value: {
31609
- size: size,
31606
+ width: width,
31610
31607
  setIsOpen: setIsOpen
31611
31608
  },
31612
31609
  children: /*#__PURE__*/jsx("div", {
@@ -31614,6 +31611,7 @@ function Modal(_ref) {
31614
31611
  children: /*#__PURE__*/jsxs("div", {
31615
31612
  className: modalBaseClasses,
31616
31613
  style: {
31614
+ width: width,
31617
31615
  height: height
31618
31616
  },
31619
31617
  children: [headerElement, tabElement, /*#__PURE__*/jsx("div", {