@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 +21 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -22
- 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.js
CHANGED
|
@@ -71,7 +71,7 @@ function Button(_ref) {
|
|
|
71
71
|
variant = 'fill'
|
|
72
72
|
} = _ref,
|
|
73
73
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
74
|
-
const 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, {
|
|
74
|
+
const 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, {
|
|
75
75
|
'h-6 px-2.5': size === 'small'
|
|
76
76
|
}, {
|
|
77
77
|
'h-8 px-3': size === 'medium'
|
|
@@ -31422,10 +31422,11 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
31422
31422
|
});
|
|
31423
31423
|
|
|
31424
31424
|
const ModalContext = /*#__PURE__*/createContext({
|
|
31425
|
-
|
|
31425
|
+
width: 480,
|
|
31426
31426
|
setIsOpen: () => false
|
|
31427
31427
|
});
|
|
31428
31428
|
|
|
31429
|
+
const sizeSmallLimit = 420;
|
|
31429
31430
|
function ModalButtonTab({
|
|
31430
31431
|
primaryButtonLabel,
|
|
31431
31432
|
secondaryButtonLabel,
|
|
@@ -31441,7 +31442,7 @@ function ModalButtonTab({
|
|
|
31441
31442
|
onClickSubButton
|
|
31442
31443
|
}) {
|
|
31443
31444
|
const {
|
|
31444
|
-
|
|
31445
|
+
width,
|
|
31445
31446
|
setIsOpen
|
|
31446
31447
|
} = useContext(ModalContext);
|
|
31447
31448
|
const handleClickPrimaryButton = useCallback(() => {
|
|
@@ -31456,17 +31457,18 @@ function ModalButtonTab({
|
|
|
31456
31457
|
onClickSubButton == null || onClickSubButton();
|
|
31457
31458
|
}, [onClickSubButton]);
|
|
31458
31459
|
const wrapperClasses = clsx$1('flex', 'shrink-0', 'items-center', 'w-full', 'rounded-b-lg', 'py-4', 'px-6', {
|
|
31459
|
-
'justify-between': isWithCheckbox || subButtonLabel &&
|
|
31460
|
+
'justify-between': isWithCheckbox || subButtonLabel && sizeSmallLimit <= width,
|
|
31460
31461
|
'justify-end': !isWithCheckbox || !subButtonLabel,
|
|
31461
|
-
'justify-center': subButtonLabel &&
|
|
31462
|
+
'justify-center': subButtonLabel && width < sizeSmallLimit,
|
|
31462
31463
|
'border-t-[1px] border-border-uiBorder01': !isNoBorder,
|
|
31463
|
-
'gap-y-4':
|
|
31464
|
-
'flex-wrap':
|
|
31465
|
-
'flex-wrap-reverse':
|
|
31464
|
+
'gap-y-4': width < sizeSmallLimit,
|
|
31465
|
+
'flex-wrap': width < sizeSmallLimit && isWithCheckbox,
|
|
31466
|
+
'flex-wrap-reverse': width < sizeSmallLimit && subButtonLabel
|
|
31466
31467
|
});
|
|
31467
31468
|
const buttonContainerClasses = clsx$1('flex', 'items-center', {
|
|
31468
|
-
'
|
|
31469
|
-
'gap-x-
|
|
31469
|
+
'w-full justify-center': width < sizeSmallLimit,
|
|
31470
|
+
'gap-x-2': width < sizeSmallLimit,
|
|
31471
|
+
'gap-x-4': sizeSmallLimit <= width
|
|
31470
31472
|
});
|
|
31471
31473
|
return /*#__PURE__*/jsxs("div", {
|
|
31472
31474
|
className: wrapperClasses,
|
|
@@ -31487,13 +31489,13 @@ function ModalButtonTab({
|
|
|
31487
31489
|
children: [/*#__PURE__*/jsx(Button, {
|
|
31488
31490
|
variant: "outline",
|
|
31489
31491
|
size: "large",
|
|
31490
|
-
width:
|
|
31492
|
+
width: width < sizeSmallLimit ? 132 : 'auto',
|
|
31491
31493
|
onClick: handleClickSecondaryButton,
|
|
31492
31494
|
children: secondaryButtonLabel
|
|
31493
31495
|
}, "1"), /*#__PURE__*/jsx(Button, {
|
|
31494
31496
|
variant: isDanger ? 'fillDanger' : 'fill',
|
|
31495
31497
|
size: "large",
|
|
31496
|
-
width:
|
|
31498
|
+
width: width < sizeSmallLimit ? 132 : 'auto',
|
|
31497
31499
|
onClick: handleClickPrimaryButton,
|
|
31498
31500
|
children: primaryButtonLabel
|
|
31499
31501
|
}, "2")]
|
|
@@ -31575,7 +31577,7 @@ function ModalTab({
|
|
|
31575
31577
|
|
|
31576
31578
|
function Modal({
|
|
31577
31579
|
children,
|
|
31578
|
-
|
|
31580
|
+
width = 480,
|
|
31579
31581
|
height,
|
|
31580
31582
|
isOpen,
|
|
31581
31583
|
setIsOpen,
|
|
@@ -31584,17 +31586,12 @@ function Modal({
|
|
|
31584
31586
|
tabElement,
|
|
31585
31587
|
buttonTabElement
|
|
31586
31588
|
}) {
|
|
31587
|
-
const wrapperClasses =
|
|
31588
|
-
const modalBaseClasses =
|
|
31589
|
-
|
|
31590
|
-
'w-[480px]': size === 'medium',
|
|
31591
|
-
'w-[640px]': size === 'large',
|
|
31592
|
-
'w-[720px]': size === 'x-large'
|
|
31593
|
-
});
|
|
31594
|
-
const contentClasses = clsx$1('flex', 'items-center', 'justify-center', 'overflow-y-auto');
|
|
31589
|
+
const wrapperClasses = 'flex items-center justify-center z-overlay bg-background-backgroundOverlayBlack fixed left-0 top-0 h-full w-full';
|
|
31590
|
+
const modalBaseClasses = 'flex shrink-0 flex-col bg-background-uiBackground01 rounded-lg shadow-modalShadow';
|
|
31591
|
+
const contentClasses = 'flex items-center justify-center overflow-y-auto';
|
|
31595
31592
|
return /*#__PURE__*/reactDom.createPortal(isOpen && /*#__PURE__*/jsx(ModalContext.Provider, {
|
|
31596
31593
|
value: {
|
|
31597
|
-
|
|
31594
|
+
width,
|
|
31598
31595
|
setIsOpen
|
|
31599
31596
|
},
|
|
31600
31597
|
children: /*#__PURE__*/jsx("div", {
|
|
@@ -31602,6 +31599,7 @@ function Modal({
|
|
|
31602
31599
|
children: /*#__PURE__*/jsxs("div", {
|
|
31603
31600
|
className: modalBaseClasses,
|
|
31604
31601
|
style: {
|
|
31602
|
+
width,
|
|
31605
31603
|
height
|
|
31606
31604
|
},
|
|
31607
31605
|
children: [headerElement, tabElement, /*#__PURE__*/jsx("div", {
|