@zenkigen-inc/component-ui 1.1.2 → 1.2.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.d.ts +1 -0
- package/dist/index.esm.js +255 -273
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +248 -273
- package/dist/index.js.map +1 -1
- package/dist/modal/modal-body.d.ts +2 -0
- package/dist/modal/modal-context.d.ts +0 -1
- package/dist/modal/modal-footer.d.ts +6 -0
- package/dist/modal/modal-header.d.ts +2 -3
- package/dist/modal/modal.d.ts +7 -11
- package/dist/pagination-select/index.d.ts +1 -0
- package/dist/pagination-select/pagination-select.d.ts +23 -0
- package/package.json +3 -3
- package/dist/modal/modal-button-tab.d.ts +0 -25
- package/dist/modal/modal-tab.d.ts +0 -11
package/dist/index.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { userColors, typography, buttonColors, focusVisible, iconColors, tagColors, tagLightColors } from '@zenkigen-inc/component-theme';
|
|
2
2
|
import clsx$1, { clsx } from 'clsx';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import aa, { useState, useCallback, useEffect, createContext, useContext, useRef,
|
|
4
|
+
import aa, { useState, useCallback, useEffect, createContext, useContext, useRef, forwardRef } from 'react';
|
|
5
5
|
import { iconElements } from '@zenkigen-inc/component-icons';
|
|
6
6
|
|
|
7
7
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -345,11 +345,7 @@ function Dropdown(_ref) {
|
|
|
345
345
|
}
|
|
346
346
|
}, [isVisible]);
|
|
347
347
|
var wrapperClasses = clsx$1('relative', 'flex shrink-0 items-center gap-1', 'rounded', isDisabled && 'cursor-not-allowed');
|
|
348
|
-
var childrenButtonClasses = clsx$1('flex items-center justify-center', 'rounded', 'hover:bg-hover-hover02', 'active:bg-active-active02', focusVisible.normal, isDisabled && 'pointer-events-none', {
|
|
349
|
-
'h-6 w-6': size === 'x-small',
|
|
350
|
-
'h-8 w-8': size === 'small',
|
|
351
|
-
'h-10 w-10': size === 'medium',
|
|
352
|
-
'h-12 w-12': size === 'large',
|
|
348
|
+
var childrenButtonClasses = clsx$1('flex items-center justify-center', 'rounded', 'hover:bg-hover-hover02', 'active:bg-active-active02', focusVisible.normal, isDisabled && 'pointer-events-none', 'p-1', {
|
|
353
349
|
'border border-border-uiBorder02': variant === 'outline'
|
|
354
350
|
});
|
|
355
351
|
var buttonClasses = clsx$1('flex items-center', 'rounded', buttonColors[variant].base, buttonColors[variant].hover, buttonColors[variant].active, buttonColors[variant].disabled, focusVisible.normal, isDisabled && 'pointer-events-none', {
|
|
@@ -358,9 +354,6 @@ function Dropdown(_ref) {
|
|
|
358
354
|
'h-10 px-4': size === 'large'
|
|
359
355
|
});
|
|
360
356
|
var labelClasses = clsx$1('flex', 'items-center', !isArrowHidden ? size === 'x-small' ? 'mr-1' : 'mr-2' : null, typography.label[size === 'x-small' ? 'label3regular' : size === 'small' || size === 'medium' ? 'label2regular' : 'label1regular']);
|
|
361
|
-
var targetWithProps = target && /*#__PURE__*/cloneElement(target, {
|
|
362
|
-
isDisabled: isDisabled
|
|
363
|
-
});
|
|
364
357
|
return /*#__PURE__*/jsx(DropdownContext.Provider, {
|
|
365
358
|
value: {
|
|
366
359
|
isVisible: isVisible,
|
|
@@ -378,7 +371,7 @@ function Dropdown(_ref) {
|
|
|
378
371
|
className: childrenButtonClasses,
|
|
379
372
|
onClick: handleToggle,
|
|
380
373
|
disabled: isDisabled,
|
|
381
|
-
children:
|
|
374
|
+
children: target
|
|
382
375
|
}) : /*#__PURE__*/jsxs("button", {
|
|
383
376
|
type: "button",
|
|
384
377
|
title: title,
|
|
@@ -31435,85 +31428,29 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
31435
31428
|
}
|
|
31436
31429
|
});
|
|
31437
31430
|
|
|
31431
|
+
function ModalBody(_ref) {
|
|
31432
|
+
var children = _ref.children;
|
|
31433
|
+
return /*#__PURE__*/jsx("div", {
|
|
31434
|
+
className: "overflow-y-auto",
|
|
31435
|
+
children: children
|
|
31436
|
+
});
|
|
31437
|
+
}
|
|
31438
|
+
|
|
31438
31439
|
var ModalContext = /*#__PURE__*/createContext({
|
|
31439
|
-
width: 480,
|
|
31440
31440
|
setIsOpen: function setIsOpen() {
|
|
31441
31441
|
return false;
|
|
31442
31442
|
}
|
|
31443
31443
|
});
|
|
31444
31444
|
|
|
31445
|
-
|
|
31446
|
-
|
|
31447
|
-
|
|
31448
|
-
secondaryButtonLabel = _ref.secondaryButtonLabel,
|
|
31449
|
-
onClickPrimaryButton = _ref.onClickPrimaryButton,
|
|
31450
|
-
onClickSecondaryButton = _ref.onClickSecondaryButton,
|
|
31451
|
-
isDanger = _ref.isDanger,
|
|
31452
|
-
isNoBorder = _ref.isNoBorder,
|
|
31453
|
-
isWithCheckbox = _ref.isWithCheckbox,
|
|
31454
|
-
checkboxLabel = _ref.checkboxLabel,
|
|
31455
|
-
isChecked = _ref.isChecked,
|
|
31456
|
-
onChange = _ref.onChange,
|
|
31457
|
-
subButtonLabel = _ref.subButtonLabel,
|
|
31458
|
-
onClickSubButton = _ref.onClickSubButton;
|
|
31459
|
-
var _useContext = useContext(ModalContext),
|
|
31460
|
-
width = _useContext.width,
|
|
31461
|
-
setIsOpen = _useContext.setIsOpen;
|
|
31462
|
-
var handleClickPrimaryButton = useCallback(function () {
|
|
31463
|
-
onClickPrimaryButton();
|
|
31464
|
-
setIsOpen(false);
|
|
31465
|
-
}, [onClickPrimaryButton, setIsOpen]);
|
|
31466
|
-
var handleClickSecondaryButton = useCallback(function () {
|
|
31467
|
-
onClickSecondaryButton();
|
|
31468
|
-
setIsOpen(false);
|
|
31469
|
-
}, [onClickSecondaryButton, setIsOpen]);
|
|
31470
|
-
var handleClickSubButton = useCallback(function () {
|
|
31471
|
-
onClickSubButton == null || onClickSubButton();
|
|
31472
|
-
}, [onClickSubButton]);
|
|
31445
|
+
function ModalFooter(_ref) {
|
|
31446
|
+
var children = _ref.children,
|
|
31447
|
+
isNoBorder = _ref.isNoBorder;
|
|
31473
31448
|
var wrapperClasses = clsx$1('flex', 'shrink-0', 'items-center', 'w-full', 'rounded-b-lg', 'py-4', 'px-6', {
|
|
31474
|
-
'
|
|
31475
|
-
'justify-end': !isWithCheckbox || !subButtonLabel,
|
|
31476
|
-
'justify-center': subButtonLabel && width < sizeSmallLimit,
|
|
31477
|
-
'border-t-[1px] border-border-uiBorder01': !isNoBorder,
|
|
31478
|
-
'gap-y-4': width < sizeSmallLimit,
|
|
31479
|
-
'flex-wrap': width < sizeSmallLimit && isWithCheckbox,
|
|
31480
|
-
'flex-wrap-reverse': width < sizeSmallLimit && subButtonLabel
|
|
31481
|
-
});
|
|
31482
|
-
var buttonContainerClasses = clsx$1('flex', 'items-center', {
|
|
31483
|
-
'w-full justify-center': width < sizeSmallLimit,
|
|
31484
|
-
'gap-x-2': width < sizeSmallLimit,
|
|
31485
|
-
'gap-x-4': sizeSmallLimit <= width
|
|
31449
|
+
'border-t-[1px] border-border-uiBorder01': !isNoBorder
|
|
31486
31450
|
});
|
|
31487
|
-
return /*#__PURE__*/
|
|
31451
|
+
return /*#__PURE__*/jsx("div", {
|
|
31488
31452
|
className: wrapperClasses,
|
|
31489
|
-
children:
|
|
31490
|
-
children: /*#__PURE__*/jsx(Checkbox, {
|
|
31491
|
-
id: "modal-checkbox",
|
|
31492
|
-
label: checkboxLabel,
|
|
31493
|
-
isChecked: isChecked,
|
|
31494
|
-
onChange: onChange
|
|
31495
|
-
})
|
|
31496
|
-
}) : subButtonLabel && onClickSubButton ? /*#__PURE__*/jsx(Button, {
|
|
31497
|
-
variant: "text",
|
|
31498
|
-
size: "large",
|
|
31499
|
-
onClick: handleClickSubButton,
|
|
31500
|
-
children: subButtonLabel
|
|
31501
|
-
}, "0") : null, /*#__PURE__*/jsxs("div", {
|
|
31502
|
-
className: buttonContainerClasses,
|
|
31503
|
-
children: [/*#__PURE__*/jsx(Button, {
|
|
31504
|
-
variant: "outline",
|
|
31505
|
-
size: "large",
|
|
31506
|
-
width: width < sizeSmallLimit ? 132 : 'auto',
|
|
31507
|
-
onClick: handleClickSecondaryButton,
|
|
31508
|
-
children: secondaryButtonLabel
|
|
31509
|
-
}, "1"), /*#__PURE__*/jsx(Button, {
|
|
31510
|
-
variant: isDanger ? 'fillDanger' : 'fill',
|
|
31511
|
-
size: "large",
|
|
31512
|
-
width: width < sizeSmallLimit ? 132 : 'auto',
|
|
31513
|
-
onClick: handleClickPrimaryButton,
|
|
31514
|
-
children: primaryButtonLabel
|
|
31515
|
-
}, "2")]
|
|
31516
|
-
})]
|
|
31453
|
+
children: children
|
|
31517
31454
|
});
|
|
31518
31455
|
}
|
|
31519
31456
|
|
|
@@ -31530,7 +31467,9 @@ function ModalHeader(_ref) {
|
|
|
31530
31467
|
});
|
|
31531
31468
|
return /*#__PURE__*/jsxs("div", {
|
|
31532
31469
|
className: headerClasses,
|
|
31533
|
-
children: [
|
|
31470
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
31471
|
+
children: children
|
|
31472
|
+
}), !isNoCloseButton && /*#__PURE__*/jsx(IconButton, {
|
|
31534
31473
|
icon: "close",
|
|
31535
31474
|
size: "small",
|
|
31536
31475
|
variant: "text",
|
|
@@ -31541,52 +31480,8 @@ function ModalHeader(_ref) {
|
|
|
31541
31480
|
});
|
|
31542
31481
|
}
|
|
31543
31482
|
|
|
31544
|
-
var
|
|
31545
|
-
|
|
31546
|
-
var classes = clsx('relative', 'flex', 'z-0', 'py-2', 'leading-[24px]', 'before:h-px', 'before:absolute', 'before:left-0', 'before:right-0', 'before:bottom-0', 'hover:text-text-text01', 'disabled:text-disabled-disabled01', 'disabled:pointer-events-none', (_clsx = {}, _clsx["" + typography.label.label2regular] = !props.isSelected, _clsx['text-interactive-interactive02 hover:before:bg-border-uiBorder02Dark'] = !props.isSelected, _clsx["" + typography.label.label2bold] = props.isSelected, _clsx['before:bg-interactive-interactive01 hover:before:bg-interactive-interactive01 pointer-events-none'] = props.isSelected, _clsx));
|
|
31547
|
-
return /*#__PURE__*/jsx("button", {
|
|
31548
|
-
type: "button",
|
|
31549
|
-
role: "tab",
|
|
31550
|
-
"aria-selected": props.isSelected,
|
|
31551
|
-
className: classes,
|
|
31552
|
-
disabled: props.isDisabled,
|
|
31553
|
-
onClick: function onClick() {
|
|
31554
|
-
return props.onClick(props.id);
|
|
31555
|
-
},
|
|
31556
|
-
children: props.children
|
|
31557
|
-
});
|
|
31558
|
-
};
|
|
31559
|
-
|
|
31560
|
-
function Tab(_ref) {
|
|
31561
|
-
var children = _ref.children;
|
|
31562
|
-
var classes = clsx('flex', 'px-6', 'gap-4', 'relative', 'before:bg-border-uiBorder01', 'before:h-px', 'before:bottom-0', 'before:left-0', 'before:right-0', 'before:absolute', {});
|
|
31563
|
-
return /*#__PURE__*/jsx("div", {
|
|
31564
|
-
role: "tablist",
|
|
31565
|
-
className: classes,
|
|
31566
|
-
children: children
|
|
31567
|
-
});
|
|
31568
|
-
}
|
|
31569
|
-
Tab.Item = TabItem;
|
|
31570
|
-
|
|
31571
|
-
function ModalTab(_ref) {
|
|
31572
|
-
var tabItems = _ref.tabItems,
|
|
31573
|
-
selectedTab = _ref.selectedTab,
|
|
31574
|
-
setSelectedTab = _ref.setSelectedTab;
|
|
31575
|
-
return /*#__PURE__*/jsx("div", {
|
|
31576
|
-
className: "mt-2 w-full",
|
|
31577
|
-
children: /*#__PURE__*/jsx(Tab, {
|
|
31578
|
-
children: tabItems.map(function (item) {
|
|
31579
|
-
return /*#__PURE__*/jsx(TabItem, {
|
|
31580
|
-
id: item.id,
|
|
31581
|
-
isSelected: selectedTab === item.id,
|
|
31582
|
-
onClick: setSelectedTab,
|
|
31583
|
-
children: item.label
|
|
31584
|
-
}, item.id);
|
|
31585
|
-
})
|
|
31586
|
-
})
|
|
31587
|
-
});
|
|
31588
|
-
}
|
|
31589
|
-
|
|
31483
|
+
var LIMIT_WIDTH = 320;
|
|
31484
|
+
var LIMIT_HEIGHT = 184;
|
|
31590
31485
|
function Modal(_ref) {
|
|
31591
31486
|
var children = _ref.children,
|
|
31592
31487
|
_ref$width = _ref.width,
|
|
@@ -31594,37 +31489,29 @@ function Modal(_ref) {
|
|
|
31594
31489
|
height = _ref.height,
|
|
31595
31490
|
isOpen = _ref.isOpen,
|
|
31596
31491
|
setIsOpen = _ref.setIsOpen,
|
|
31597
|
-
portalTargetRef = _ref.portalTargetRef
|
|
31598
|
-
|
|
31599
|
-
|
|
31600
|
-
buttonTabElement = _ref.buttonTabElement;
|
|
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';
|
|
31492
|
+
portalTargetRef = _ref.portalTargetRef;
|
|
31493
|
+
var renderWidth = typeof width === 'number' ? Math.max(width, LIMIT_WIDTH) : width;
|
|
31494
|
+
var renderHeight = typeof height === 'number' ? Math.max(height, LIMIT_HEIGHT) : height;
|
|
31604
31495
|
return /*#__PURE__*/reactDom.createPortal(isOpen && /*#__PURE__*/jsx(ModalContext.Provider, {
|
|
31605
31496
|
value: {
|
|
31606
|
-
width: width,
|
|
31607
31497
|
setIsOpen: setIsOpen
|
|
31608
31498
|
},
|
|
31609
31499
|
children: /*#__PURE__*/jsx("div", {
|
|
31610
|
-
className:
|
|
31611
|
-
children: /*#__PURE__*/
|
|
31612
|
-
className:
|
|
31500
|
+
className: "fixed left-0 top-0 z-overlay flex h-full w-full items-center justify-center bg-background-backgroundOverlayBlack",
|
|
31501
|
+
children: /*#__PURE__*/jsx("div", {
|
|
31502
|
+
className: "flex shrink-0 flex-col rounded-lg bg-background-uiBackground01 shadow-modalShadow",
|
|
31613
31503
|
style: {
|
|
31614
|
-
width:
|
|
31615
|
-
height:
|
|
31504
|
+
width: renderWidth,
|
|
31505
|
+
height: renderHeight
|
|
31616
31506
|
},
|
|
31617
|
-
children:
|
|
31618
|
-
className: contentClasses,
|
|
31619
|
-
children: children
|
|
31620
|
-
}), buttonTabElement]
|
|
31507
|
+
children: children
|
|
31621
31508
|
})
|
|
31622
31509
|
})
|
|
31623
31510
|
}), !portalTargetRef || (portalTargetRef == null ? void 0 : portalTargetRef.current) === null ? document.body : portalTargetRef.current);
|
|
31624
31511
|
}
|
|
31512
|
+
Modal.Body = ModalBody;
|
|
31625
31513
|
Modal.Header = ModalHeader;
|
|
31626
|
-
Modal.
|
|
31627
|
-
Modal.ButtonTab = ModalButtonTab;
|
|
31514
|
+
Modal.Footer = ModalFooter;
|
|
31628
31515
|
|
|
31629
31516
|
var _excluded$1 = ["state", "size"];
|
|
31630
31517
|
function NotificationInline(_ref) {
|
|
@@ -31680,132 +31567,6 @@ function NotificationInline(_ref) {
|
|
|
31680
31567
|
});
|
|
31681
31568
|
}
|
|
31682
31569
|
|
|
31683
|
-
function Radio(_ref) {
|
|
31684
|
-
var name = _ref.name,
|
|
31685
|
-
value = _ref.value,
|
|
31686
|
-
id = _ref.id,
|
|
31687
|
-
label = _ref.label,
|
|
31688
|
-
_ref$isChecked = _ref.isChecked,
|
|
31689
|
-
isChecked = _ref$isChecked === void 0 ? false : _ref$isChecked,
|
|
31690
|
-
_ref$isDisabled = _ref.isDisabled,
|
|
31691
|
-
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
31692
|
-
onChange = _ref.onChange;
|
|
31693
|
-
var _useState = useState(false),
|
|
31694
|
-
isMouseOver = _useState[0],
|
|
31695
|
-
setIsMouseOver = _useState[1];
|
|
31696
|
-
var handleMouseOverInput = useCallback(function () {
|
|
31697
|
-
setIsMouseOver(true);
|
|
31698
|
-
}, []);
|
|
31699
|
-
var handleMouseOutInput = useCallback(function () {
|
|
31700
|
-
setIsMouseOver(false);
|
|
31701
|
-
}, []);
|
|
31702
|
-
var handleChange = useCallback(function (e) {
|
|
31703
|
-
return !isDisabled && (onChange == null ? void 0 : onChange(e));
|
|
31704
|
-
}, [isDisabled, onChange]);
|
|
31705
|
-
var inputClasses = clsx$1('absolute', 'z-[1]', 'opacity-0', 'peer', 'h-6', 'w-6', {
|
|
31706
|
-
'cursor-not-allowed': isDisabled,
|
|
31707
|
-
'cursor-pointer': !isDisabled
|
|
31708
|
-
});
|
|
31709
|
-
var boxClasses = clsx$1('inline-flex', 'items-center', 'justify-center', 'h-5', 'w-5', 'bg-white', 'border', 'border-solid', 'rounded-full', focusVisible.normalPeer, {
|
|
31710
|
-
'border-disabled-disabled01 hover:border-disabled-disabled01': isDisabled && !isMouseOver,
|
|
31711
|
-
'border-hover-hoverUiBorder': !isDisabled && isMouseOver,
|
|
31712
|
-
'border-border-uiBorder03': !isDisabled,
|
|
31713
|
-
'cursor-not-allowed': isDisabled,
|
|
31714
|
-
'cursor-pointer': !isDisabled
|
|
31715
|
-
});
|
|
31716
|
-
var afterClasses = clsx$1('h-3', 'w-3', 'absolute', 'top-0', 'right-0', 'bottom-0', 'left-0', 'block', 'm-auto', 'rounded-full', {
|
|
31717
|
-
'bg-disabled-disabled01': isDisabled && isChecked,
|
|
31718
|
-
'bg-active-activeSelectedUi': !isDisabled && isChecked,
|
|
31719
|
-
'scale-0': !isChecked,
|
|
31720
|
-
'scale-100': isChecked
|
|
31721
|
-
});
|
|
31722
|
-
var hoverIndicatorClasses = clsx$1('w-3', 'h-3', 'inline-block', 'rounded-full', !isDisabled && !isChecked && isMouseOver && 'bg-hover-hoverUi');
|
|
31723
|
-
var labelClasses = clsx$1('flex-[1_0_0]', 'ml-2', typography.label.label2regular, 'break-all', 'select-none', {
|
|
31724
|
-
'pointer-events-none cursor-not-allowed text-disabled-disabled01': isDisabled,
|
|
31725
|
-
'cursor-pointer text-text-text01': !isDisabled
|
|
31726
|
-
});
|
|
31727
|
-
return /*#__PURE__*/jsxs("div", {
|
|
31728
|
-
className: "flex items-center",
|
|
31729
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
31730
|
-
className: "flex h-6 w-6 items-center justify-center",
|
|
31731
|
-
children: [/*#__PURE__*/jsx("input", {
|
|
31732
|
-
type: "checkbox",
|
|
31733
|
-
value: value,
|
|
31734
|
-
name: name,
|
|
31735
|
-
id: id,
|
|
31736
|
-
checked: isChecked,
|
|
31737
|
-
disabled: isDisabled,
|
|
31738
|
-
onChange: handleChange,
|
|
31739
|
-
onMouseOver: handleMouseOverInput,
|
|
31740
|
-
onMouseLeave: handleMouseOutInput,
|
|
31741
|
-
className: inputClasses
|
|
31742
|
-
}), /*#__PURE__*/jsx("div", {
|
|
31743
|
-
className: boxClasses,
|
|
31744
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
31745
|
-
className: "relative flex h-5 w-5 flex-[0_0_auto] items-center justify-center",
|
|
31746
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
31747
|
-
className: afterClasses
|
|
31748
|
-
}), /*#__PURE__*/jsx("span", {
|
|
31749
|
-
className: hoverIndicatorClasses
|
|
31750
|
-
})]
|
|
31751
|
-
})
|
|
31752
|
-
})]
|
|
31753
|
-
}), /*#__PURE__*/jsx("label", {
|
|
31754
|
-
htmlFor: id,
|
|
31755
|
-
className: labelClasses,
|
|
31756
|
-
children: label
|
|
31757
|
-
})]
|
|
31758
|
-
});
|
|
31759
|
-
}
|
|
31760
|
-
|
|
31761
|
-
var _excluded = ["width", "size"];
|
|
31762
|
-
var Search = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
31763
|
-
var _clsx;
|
|
31764
|
-
var _ref$width = _ref.width,
|
|
31765
|
-
width = _ref$width === void 0 ? '100%' : _ref$width,
|
|
31766
|
-
_ref$size = _ref.size,
|
|
31767
|
-
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
31768
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
31769
|
-
var classes = clsx('flex', 'items-center', 'rounded-full', 'border', 'border-border-uiBorder02', 'focus-within:border-active-activeInput', {
|
|
31770
|
-
'h-8 px-3': size === 'medium'
|
|
31771
|
-
}, {
|
|
31772
|
-
'h-10 px-4': size === 'large'
|
|
31773
|
-
});
|
|
31774
|
-
var inputClasses = clsx('ml-2.5', 'mr-2.5', 'h-full', 'flex-1', 'outline-0', 'text-text-text01', 'placeholder:text-text-textPlaceholder', (_clsx = {}, _clsx["" + typography.label.label2regular] = size === 'medium', _clsx["" + typography.label.label1regular] = size === 'large', _clsx));
|
|
31775
|
-
return /*#__PURE__*/jsx("div", {
|
|
31776
|
-
className: "relative",
|
|
31777
|
-
ref: ref,
|
|
31778
|
-
children: /*#__PURE__*/jsx("form", {
|
|
31779
|
-
onSubmit: props.onSubmit,
|
|
31780
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
31781
|
-
className: classes,
|
|
31782
|
-
style: {
|
|
31783
|
-
width: width
|
|
31784
|
-
},
|
|
31785
|
-
children: [/*#__PURE__*/jsx(Icon, {
|
|
31786
|
-
name: "search",
|
|
31787
|
-
color: "icon01",
|
|
31788
|
-
size: "medium"
|
|
31789
|
-
}), /*#__PURE__*/jsx("input", {
|
|
31790
|
-
type: "text",
|
|
31791
|
-
size: 1,
|
|
31792
|
-
value: props.value,
|
|
31793
|
-
className: inputClasses,
|
|
31794
|
-
placeholder: props.placeholder,
|
|
31795
|
-
onChange: props.onChange
|
|
31796
|
-
}), props.onClickClearButton && props.value && props.value.length !== 0 && /*#__PURE__*/jsx(IconButton, {
|
|
31797
|
-
variant: "text",
|
|
31798
|
-
icon: "close",
|
|
31799
|
-
size: size === 'medium' ? 'small' : 'medium',
|
|
31800
|
-
isNoPadding: true,
|
|
31801
|
-
onClick: props.onClickClearButton
|
|
31802
|
-
})]
|
|
31803
|
-
})
|
|
31804
|
-
})
|
|
31805
|
-
});
|
|
31806
|
-
});
|
|
31807
|
-
Search.displayName = 'Search';
|
|
31808
|
-
|
|
31809
31570
|
var SelectContext = /*#__PURE__*/createContext({
|
|
31810
31571
|
size: 'medium',
|
|
31811
31572
|
setIsOptionListOpen: function setIsOptionListOpen() {
|
|
@@ -31984,6 +31745,200 @@ function Select(_ref) {
|
|
|
31984
31745
|
}
|
|
31985
31746
|
Select.Option = SelectItem$1;
|
|
31986
31747
|
|
|
31748
|
+
function PaginationSelect(_ref) {
|
|
31749
|
+
var totalSize = _ref.totalSize,
|
|
31750
|
+
currentPage = _ref.currentPage,
|
|
31751
|
+
sizePerPage = _ref.sizePerPage,
|
|
31752
|
+
_ref$countLabel = _ref.countLabel,
|
|
31753
|
+
countLabel = _ref$countLabel === void 0 ? '件' : _ref$countLabel,
|
|
31754
|
+
_ref$pageLabel = _ref.pageLabel,
|
|
31755
|
+
pageLabel = _ref$pageLabel === void 0 ? 'ページ' : _ref$pageLabel,
|
|
31756
|
+
_ref$optionListMaxHei = _ref.optionListMaxHeight,
|
|
31757
|
+
optionListMaxHeight = _ref$optionListMaxHei === void 0 ? 190 : _ref$optionListMaxHei,
|
|
31758
|
+
onClickPrevButton = _ref.onClickPrevButton,
|
|
31759
|
+
onClickNextButton = _ref.onClickNextButton,
|
|
31760
|
+
_onChange = _ref.onChange;
|
|
31761
|
+
var pageMax = Math.ceil(totalSize / sizePerPage);
|
|
31762
|
+
var optionsList = [].concat(Array(pageMax)).map(function (_, index) {
|
|
31763
|
+
var value = (index + 1).toString();
|
|
31764
|
+
return {
|
|
31765
|
+
id: value,
|
|
31766
|
+
value: value,
|
|
31767
|
+
label: value
|
|
31768
|
+
};
|
|
31769
|
+
});
|
|
31770
|
+
return /*#__PURE__*/jsxs("nav", {
|
|
31771
|
+
"aria-label": "pagination",
|
|
31772
|
+
className: "flex items-center gap-x-1",
|
|
31773
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
31774
|
+
className: "flex items-center gap-x-2",
|
|
31775
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
31776
|
+
className: clsx$1('text-text-text01', typography.label.label2regular),
|
|
31777
|
+
children: [(currentPage - 1) * sizePerPage + 1, " -", ' ', currentPage * sizePerPage > totalSize ? totalSize : currentPage * sizePerPage, countLabel]
|
|
31778
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
31779
|
+
size: "medium",
|
|
31780
|
+
variant: "outline",
|
|
31781
|
+
selectedOption: optionsList.find(function (option) {
|
|
31782
|
+
return option.value === currentPage.toString();
|
|
31783
|
+
}),
|
|
31784
|
+
optionListMaxHeight: optionListMaxHeight,
|
|
31785
|
+
onChange: function onChange(option) {
|
|
31786
|
+
return option && _onChange(Number(option.value));
|
|
31787
|
+
},
|
|
31788
|
+
children: optionsList && optionsList.map(function (option) {
|
|
31789
|
+
return /*#__PURE__*/jsx(Select.Option, {
|
|
31790
|
+
option: option
|
|
31791
|
+
}, option.id);
|
|
31792
|
+
})
|
|
31793
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
31794
|
+
className: clsx$1('text-text-text03', typography.label.label2regular),
|
|
31795
|
+
children: ["/ ", pageMax, pageLabel]
|
|
31796
|
+
})]
|
|
31797
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
31798
|
+
className: "flex items-center",
|
|
31799
|
+
children: [/*#__PURE__*/jsx(IconButton, {
|
|
31800
|
+
variant: "text",
|
|
31801
|
+
icon: "angle-left",
|
|
31802
|
+
size: "small",
|
|
31803
|
+
isDisabled: currentPage === 1,
|
|
31804
|
+
onClick: onClickPrevButton
|
|
31805
|
+
}), /*#__PURE__*/jsx(IconButton, {
|
|
31806
|
+
variant: "text",
|
|
31807
|
+
icon: "angle-right",
|
|
31808
|
+
size: "small",
|
|
31809
|
+
isDisabled: currentPage === pageMax,
|
|
31810
|
+
onClick: onClickNextButton
|
|
31811
|
+
})]
|
|
31812
|
+
})]
|
|
31813
|
+
});
|
|
31814
|
+
}
|
|
31815
|
+
|
|
31816
|
+
function Radio(_ref) {
|
|
31817
|
+
var name = _ref.name,
|
|
31818
|
+
value = _ref.value,
|
|
31819
|
+
id = _ref.id,
|
|
31820
|
+
label = _ref.label,
|
|
31821
|
+
_ref$isChecked = _ref.isChecked,
|
|
31822
|
+
isChecked = _ref$isChecked === void 0 ? false : _ref$isChecked,
|
|
31823
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
31824
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
31825
|
+
onChange = _ref.onChange;
|
|
31826
|
+
var _useState = useState(false),
|
|
31827
|
+
isMouseOver = _useState[0],
|
|
31828
|
+
setIsMouseOver = _useState[1];
|
|
31829
|
+
var handleMouseOverInput = useCallback(function () {
|
|
31830
|
+
setIsMouseOver(true);
|
|
31831
|
+
}, []);
|
|
31832
|
+
var handleMouseOutInput = useCallback(function () {
|
|
31833
|
+
setIsMouseOver(false);
|
|
31834
|
+
}, []);
|
|
31835
|
+
var handleChange = useCallback(function (e) {
|
|
31836
|
+
return !isDisabled && (onChange == null ? void 0 : onChange(e));
|
|
31837
|
+
}, [isDisabled, onChange]);
|
|
31838
|
+
var inputClasses = clsx$1('absolute', 'z-[1]', 'opacity-0', 'peer', 'h-6', 'w-6', {
|
|
31839
|
+
'cursor-not-allowed': isDisabled,
|
|
31840
|
+
'cursor-pointer': !isDisabled
|
|
31841
|
+
});
|
|
31842
|
+
var boxClasses = clsx$1('inline-flex', 'items-center', 'justify-center', 'h-5', 'w-5', 'bg-white', 'border', 'border-solid', 'rounded-full', focusVisible.normalPeer, {
|
|
31843
|
+
'border-disabled-disabled01 hover:border-disabled-disabled01': isDisabled && !isMouseOver,
|
|
31844
|
+
'border-hover-hoverUiBorder': !isDisabled && isMouseOver,
|
|
31845
|
+
'border-border-uiBorder03': !isDisabled,
|
|
31846
|
+
'cursor-not-allowed': isDisabled,
|
|
31847
|
+
'cursor-pointer': !isDisabled
|
|
31848
|
+
});
|
|
31849
|
+
var afterClasses = clsx$1('h-3', 'w-3', 'absolute', 'top-0', 'right-0', 'bottom-0', 'left-0', 'block', 'm-auto', 'rounded-full', {
|
|
31850
|
+
'bg-disabled-disabled01': isDisabled && isChecked,
|
|
31851
|
+
'bg-active-activeSelectedUi': !isDisabled && isChecked,
|
|
31852
|
+
'scale-0': !isChecked,
|
|
31853
|
+
'scale-100': isChecked
|
|
31854
|
+
});
|
|
31855
|
+
var hoverIndicatorClasses = clsx$1('w-3', 'h-3', 'inline-block', 'rounded-full', !isDisabled && !isChecked && isMouseOver && 'bg-hover-hoverUi');
|
|
31856
|
+
var labelClasses = clsx$1('flex-[1_0_0]', 'ml-2', typography.label.label2regular, 'break-all', 'select-none', {
|
|
31857
|
+
'pointer-events-none cursor-not-allowed text-disabled-disabled01': isDisabled,
|
|
31858
|
+
'cursor-pointer text-text-text01': !isDisabled
|
|
31859
|
+
});
|
|
31860
|
+
return /*#__PURE__*/jsxs("div", {
|
|
31861
|
+
className: "flex items-center",
|
|
31862
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
31863
|
+
className: "flex h-6 w-6 items-center justify-center",
|
|
31864
|
+
children: [/*#__PURE__*/jsx("input", {
|
|
31865
|
+
type: "checkbox",
|
|
31866
|
+
value: value,
|
|
31867
|
+
name: name,
|
|
31868
|
+
id: id,
|
|
31869
|
+
checked: isChecked,
|
|
31870
|
+
disabled: isDisabled,
|
|
31871
|
+
onChange: handleChange,
|
|
31872
|
+
onMouseOver: handleMouseOverInput,
|
|
31873
|
+
onMouseLeave: handleMouseOutInput,
|
|
31874
|
+
className: inputClasses
|
|
31875
|
+
}), /*#__PURE__*/jsx("div", {
|
|
31876
|
+
className: boxClasses,
|
|
31877
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
31878
|
+
className: "relative flex h-5 w-5 flex-[0_0_auto] items-center justify-center",
|
|
31879
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
31880
|
+
className: afterClasses
|
|
31881
|
+
}), /*#__PURE__*/jsx("span", {
|
|
31882
|
+
className: hoverIndicatorClasses
|
|
31883
|
+
})]
|
|
31884
|
+
})
|
|
31885
|
+
})]
|
|
31886
|
+
}), /*#__PURE__*/jsx("label", {
|
|
31887
|
+
htmlFor: id,
|
|
31888
|
+
className: labelClasses,
|
|
31889
|
+
children: label
|
|
31890
|
+
})]
|
|
31891
|
+
});
|
|
31892
|
+
}
|
|
31893
|
+
|
|
31894
|
+
var _excluded = ["width", "size"];
|
|
31895
|
+
var Search = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
31896
|
+
var _clsx;
|
|
31897
|
+
var _ref$width = _ref.width,
|
|
31898
|
+
width = _ref$width === void 0 ? '100%' : _ref$width,
|
|
31899
|
+
_ref$size = _ref.size,
|
|
31900
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
31901
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
31902
|
+
var classes = clsx('flex', 'items-center', 'rounded-full', 'border', 'border-border-uiBorder02', 'focus-within:border-active-activeInput', {
|
|
31903
|
+
'h-8 px-3': size === 'medium'
|
|
31904
|
+
}, {
|
|
31905
|
+
'h-10 px-4': size === 'large'
|
|
31906
|
+
});
|
|
31907
|
+
var inputClasses = clsx('ml-2.5', 'mr-2.5', 'h-full', 'flex-1', 'outline-0', 'text-text-text01', 'placeholder:text-text-textPlaceholder', (_clsx = {}, _clsx["" + typography.label.label2regular] = size === 'medium', _clsx["" + typography.label.label1regular] = size === 'large', _clsx));
|
|
31908
|
+
return /*#__PURE__*/jsx("div", {
|
|
31909
|
+
className: "relative",
|
|
31910
|
+
ref: ref,
|
|
31911
|
+
children: /*#__PURE__*/jsx("form", {
|
|
31912
|
+
onSubmit: props.onSubmit,
|
|
31913
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
31914
|
+
className: classes,
|
|
31915
|
+
style: {
|
|
31916
|
+
width: width
|
|
31917
|
+
},
|
|
31918
|
+
children: [/*#__PURE__*/jsx(Icon, {
|
|
31919
|
+
name: "search",
|
|
31920
|
+
color: "icon01",
|
|
31921
|
+
size: "medium"
|
|
31922
|
+
}), /*#__PURE__*/jsx("input", {
|
|
31923
|
+
type: "text",
|
|
31924
|
+
size: 1,
|
|
31925
|
+
value: props.value,
|
|
31926
|
+
className: inputClasses,
|
|
31927
|
+
placeholder: props.placeholder,
|
|
31928
|
+
onChange: props.onChange
|
|
31929
|
+
}), props.onClickClearButton && props.value && props.value.length !== 0 && /*#__PURE__*/jsx(IconButton, {
|
|
31930
|
+
variant: "text",
|
|
31931
|
+
icon: "close",
|
|
31932
|
+
size: size === 'medium' ? 'small' : 'medium',
|
|
31933
|
+
isNoPadding: true,
|
|
31934
|
+
onClick: props.onClickClearButton
|
|
31935
|
+
})]
|
|
31936
|
+
})
|
|
31937
|
+
})
|
|
31938
|
+
});
|
|
31939
|
+
});
|
|
31940
|
+
Search.displayName = 'Search';
|
|
31941
|
+
|
|
31987
31942
|
function SelectItem(_ref) {
|
|
31988
31943
|
var children = _ref.children,
|
|
31989
31944
|
isSortKey = _ref.isSortKey,
|
|
@@ -32123,6 +32078,33 @@ function SelectSort(_ref) {
|
|
|
32123
32078
|
});
|
|
32124
32079
|
}
|
|
32125
32080
|
|
|
32081
|
+
var TabItem = function TabItem(props) {
|
|
32082
|
+
var _clsx;
|
|
32083
|
+
var classes = clsx('relative', 'flex', 'z-0', 'py-2', 'leading-[24px]', 'before:h-px', 'before:absolute', 'before:left-0', 'before:right-0', 'before:bottom-0', 'hover:text-text-text01', 'disabled:text-disabled-disabled01', 'disabled:pointer-events-none', (_clsx = {}, _clsx["" + typography.label.label2regular] = !props.isSelected, _clsx['text-interactive-interactive02 hover:before:bg-border-uiBorder02Dark'] = !props.isSelected, _clsx["" + typography.label.label2bold] = props.isSelected, _clsx['before:bg-interactive-interactive01 hover:before:bg-interactive-interactive01 pointer-events-none'] = props.isSelected, _clsx));
|
|
32084
|
+
return /*#__PURE__*/jsx("button", {
|
|
32085
|
+
type: "button",
|
|
32086
|
+
role: "tab",
|
|
32087
|
+
"aria-selected": props.isSelected,
|
|
32088
|
+
className: classes,
|
|
32089
|
+
disabled: props.isDisabled,
|
|
32090
|
+
onClick: function onClick() {
|
|
32091
|
+
return props.onClick(props.id);
|
|
32092
|
+
},
|
|
32093
|
+
children: props.children
|
|
32094
|
+
});
|
|
32095
|
+
};
|
|
32096
|
+
|
|
32097
|
+
function Tab(_ref) {
|
|
32098
|
+
var children = _ref.children;
|
|
32099
|
+
var classes = clsx('flex', 'px-6', 'gap-4', 'relative', 'before:bg-border-uiBorder01', 'before:h-px', 'before:bottom-0', 'before:left-0', 'before:right-0', 'before:absolute', {});
|
|
32100
|
+
return /*#__PURE__*/jsx("div", {
|
|
32101
|
+
role: "tablist",
|
|
32102
|
+
className: classes,
|
|
32103
|
+
children: children
|
|
32104
|
+
});
|
|
32105
|
+
}
|
|
32106
|
+
Tab.Item = TabItem;
|
|
32107
|
+
|
|
32126
32108
|
function TableCell(_ref) {
|
|
32127
32109
|
var children = _ref.children,
|
|
32128
32110
|
className = _ref.className;
|
|
@@ -32488,5 +32470,5 @@ function Tooltip(_ref) {
|
|
|
32488
32470
|
});
|
|
32489
32471
|
}
|
|
32490
32472
|
|
|
32491
|
-
export { Avatar, Breadcrumb, Button, Checkbox, Dropdown, EvaluationStar, Heading, Icon, IconButton, Loading, Modal, NotificationInline, Radio, Search, Select, SelectSort, Tab, TabItem, Table, TableCell, TableRow, Tag, Toast, ToastProvider, Toggle, Tooltip, useToast };
|
|
32473
|
+
export { Avatar, Breadcrumb, Button, Checkbox, Dropdown, EvaluationStar, Heading, Icon, IconButton, Loading, Modal, NotificationInline, PaginationSelect, Radio, Search, Select, SelectSort, Tab, TabItem, Table, TableCell, TableRow, Tag, Toast, ToastProvider, Toggle, Tooltip, useToast };
|
|
32492
32474
|
//# sourceMappingURL=index.esm.js.map
|