@zenkigen-inc/component-ui 1.1.0 → 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 +24 -26
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +23 -25
- package/dist/index.js.map +1 -1
- package/dist/modal/modal-context.d.ts +1 -1
- package/dist/modal/modal.d.ts +2 -2
- package/package.json +3 -3
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
|
-
|
|
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
|
-
|
|
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 &&
|
|
31474
|
+
'justify-between': isWithCheckbox || subButtonLabel && sizeSmallLimit <= width,
|
|
31474
31475
|
'justify-end': !isWithCheckbox || !subButtonLabel,
|
|
31475
|
-
'justify-center': subButtonLabel &&
|
|
31476
|
+
'justify-center': subButtonLabel && width < sizeSmallLimit,
|
|
31476
31477
|
'border-t-[1px] border-border-uiBorder01': !isNoBorder,
|
|
31477
|
-
'gap-y-4':
|
|
31478
|
-
'flex-wrap':
|
|
31479
|
-
'flex-wrap-reverse':
|
|
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
|
-
'
|
|
31483
|
-
'gap-x-
|
|
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:
|
|
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:
|
|
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$
|
|
31591
|
-
|
|
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 =
|
|
31600
|
-
var modalBaseClasses =
|
|
31601
|
-
|
|
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
|
-
|
|
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", {
|
|
@@ -31974,7 +31972,7 @@ function Select(_ref) {
|
|
|
31974
31972
|
className: "ml-auto flex items-center",
|
|
31975
31973
|
children: /*#__PURE__*/jsx(Icon, {
|
|
31976
31974
|
name: isOptionListOpen ? 'angle-small-up' : 'angle-small-down',
|
|
31977
|
-
size:
|
|
31975
|
+
size: size === 'large' ? 'medium' : 'small'
|
|
31978
31976
|
})
|
|
31979
31977
|
})]
|
|
31980
31978
|
}), isOptionListOpen && !isDisabled && /*#__PURE__*/jsx(SelectList$1, {
|
|
@@ -32112,7 +32110,7 @@ function SelectSort(_ref) {
|
|
|
32112
32110
|
size: size === 'large' ? 'medium' : 'small'
|
|
32113
32111
|
}) : /*#__PURE__*/jsx(Icon, {
|
|
32114
32112
|
name: isOptionListOpen ? 'angle-small-up' : 'angle-small-down',
|
|
32115
|
-
size:
|
|
32113
|
+
size: size === 'large' ? 'medium' : 'small'
|
|
32116
32114
|
})
|
|
32117
32115
|
})]
|
|
32118
32116
|
}), isOptionListOpen && !isDisabled && /*#__PURE__*/jsx(SelectList, {
|
|
@@ -32468,7 +32466,7 @@ function Tooltip(_ref) {
|
|
|
32468
32466
|
setIsVisible(false);
|
|
32469
32467
|
}, []);
|
|
32470
32468
|
var targetClasses = clsx$1('relative', 'flex', 'items-center', 'justify-center');
|
|
32471
|
-
var tooltipBodyClasses = clsx$1('z-tooltip', 'absolute', 'w-max', horizontalAlign === 'left' ? 'left-0' : horizontalAlign === 'right' ? 'right-0' : 'left-auto', 'inline-block', size === 'small' ? 'px-2 pb-1 pt-1.5' : 'px-4 py-3', 'text-text-textOnColor', 'bg-background-uiBackgroundTooltip', 'rounded',
|
|
32469
|
+
var tooltipBodyClasses = clsx$1('z-tooltip', 'absolute', 'w-max', horizontalAlign === 'left' ? 'left-0' : horizontalAlign === 'right' ? 'right-0' : 'left-auto', 'inline-block', size === 'small' ? 'px-2 pb-1 pt-1.5' : 'px-4 py-3', 'text-text-textOnColor', 'bg-background-uiBackgroundTooltip', 'rounded', typography.body[size === 'small' ? 'body3regular' : 'body2regular']);
|
|
32472
32470
|
return /*#__PURE__*/jsxs("div", {
|
|
32473
32471
|
ref: targetRef,
|
|
32474
32472
|
className: targetClasses,
|