@zenkigen-inc/component-ui 1.17.0 → 1.18.1
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/README.md +9 -0
- package/dist/index.d.mts +237 -76
- package/dist/index.d.ts +237 -76
- package/dist/index.js +1307 -462
- package/dist/index.mjs +1282 -442
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -83,20 +83,21 @@ Breadcrumb.Item = BreadcrumbItem;
|
|
|
83
83
|
import { buttonColors, focusVisible } from "@zenkigen-inc/component-theme";
|
|
84
84
|
import { clsx as clsx3 } from "clsx";
|
|
85
85
|
import { jsxs } from "react/jsx-runtime";
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
86
|
+
var createButton = (props) => {
|
|
87
|
+
const {
|
|
88
|
+
size = "medium",
|
|
89
|
+
variant = "fill",
|
|
90
|
+
isDisabled,
|
|
91
|
+
isSelected = false,
|
|
92
|
+
width,
|
|
93
|
+
borderRadius,
|
|
94
|
+
justifyContent = "center",
|
|
95
|
+
before,
|
|
96
|
+
after,
|
|
97
|
+
elementAs,
|
|
98
|
+
children,
|
|
99
|
+
...restProps
|
|
100
|
+
} = props;
|
|
100
101
|
const baseClasses = clsx3(
|
|
101
102
|
"flex shrink-0 items-center gap-1",
|
|
102
103
|
buttonColors[variant].hover,
|
|
@@ -104,13 +105,13 @@ var Button = ({
|
|
|
104
105
|
buttonColors[variant].disabled,
|
|
105
106
|
focusVisible.normal,
|
|
106
107
|
{
|
|
107
|
-
"h-6 px-2
|
|
108
|
+
"h-6 px-2": size === "small",
|
|
108
109
|
"h-8 px-3": size === "medium",
|
|
109
110
|
"h-10 px-4 leading-[24px]": size === "large",
|
|
110
111
|
"inline-flex": elementAs === "a",
|
|
111
112
|
[buttonColors[variant].selected]: isSelected,
|
|
112
113
|
[buttonColors[variant].base]: !isSelected,
|
|
113
|
-
"hover:text-textOnColor active:text-textOnColor [&:hover>*]:fill-iconOnColor [&:active>*]:fill-iconOnColor": isSelected && variant !== "outline" && variant !== "text",
|
|
114
|
+
"hover:text-textOnColor active:text-textOnColor [&:hover>*]:fill-iconOnColor [&:active>*]:fill-iconOnColor": isSelected && variant !== "outline" && variant !== "text" && variant !== "outlineDanger",
|
|
114
115
|
"pointer-events-none": isDisabled,
|
|
115
116
|
"rounded-button": borderRadius == null,
|
|
116
117
|
"justify-start": justifyContent === "start",
|
|
@@ -120,12 +121,18 @@ var Button = ({
|
|
|
120
121
|
}
|
|
121
122
|
);
|
|
122
123
|
const Component = elementAs ?? "button";
|
|
123
|
-
return /* @__PURE__ */ jsxs(Component, { className: baseClasses, style: { width, borderRadius }, disabled: isDisabled, ...
|
|
124
|
+
return /* @__PURE__ */ jsxs(Component, { className: baseClasses, style: { width, borderRadius }, disabled: isDisabled, ...restProps, children: [
|
|
124
125
|
before,
|
|
125
126
|
children,
|
|
126
127
|
after
|
|
127
128
|
] });
|
|
128
129
|
};
|
|
130
|
+
var Button = (props) => {
|
|
131
|
+
return createButton(props);
|
|
132
|
+
};
|
|
133
|
+
var InternalButton = (props) => {
|
|
134
|
+
return createButton(props);
|
|
135
|
+
};
|
|
129
136
|
|
|
130
137
|
// src/checkbox/checkbox.tsx
|
|
131
138
|
import { focusVisible as focusVisible2 } from "@zenkigen-inc/component-theme";
|
|
@@ -494,17 +501,352 @@ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "med
|
|
|
494
501
|
return /* @__PURE__ */ jsx11("span", { className: "flex flex-row", children: ratingStars });
|
|
495
502
|
}
|
|
496
503
|
|
|
504
|
+
// src/file-input/file-input.tsx
|
|
505
|
+
import { clsx as clsx10 } from "clsx";
|
|
506
|
+
import { forwardRef, useCallback as useCallback4, useId, useImperativeHandle, useRef as useRef2, useState as useState4 } from "react";
|
|
507
|
+
|
|
508
|
+
// src/icon-button/icon-button.tsx
|
|
509
|
+
import { buttonColors as buttonColors3, focusVisible as focusVisible6 } from "@zenkigen-inc/component-theme";
|
|
510
|
+
import { clsx as clsx9 } from "clsx";
|
|
511
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
512
|
+
function IconButton({
|
|
513
|
+
icon,
|
|
514
|
+
size = "medium",
|
|
515
|
+
variant = "outline",
|
|
516
|
+
isNoPadding = false,
|
|
517
|
+
isDisabled = false,
|
|
518
|
+
isSelected = false,
|
|
519
|
+
...props
|
|
520
|
+
}) {
|
|
521
|
+
const baseClasses = clsx9(
|
|
522
|
+
"typography-label16regular flex items-center justify-center gap-1 rounded",
|
|
523
|
+
buttonColors3[variant].hover,
|
|
524
|
+
buttonColors3[variant].active,
|
|
525
|
+
buttonColors3[variant].disabled,
|
|
526
|
+
focusVisible6.normal,
|
|
527
|
+
{
|
|
528
|
+
"h-4 w-4": size === "small" && isNoPadding,
|
|
529
|
+
"h-6 w-6": size === "small" && !isNoPadding || (size === "medium" || size === "large") && isNoPadding,
|
|
530
|
+
"h-8 w-8": size === "medium" && !isNoPadding,
|
|
531
|
+
"h-10 w-10": size === "large" && !isNoPadding,
|
|
532
|
+
"inline-flex": props.isAnchor,
|
|
533
|
+
"pointer-events-none": isDisabled,
|
|
534
|
+
[buttonColors3[variant].selected]: isSelected,
|
|
535
|
+
[buttonColors3[variant].base]: !isSelected
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
const iconSize = size === "small" ? "small" : "medium";
|
|
539
|
+
if (props.isAnchor === true) {
|
|
540
|
+
const buttonProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== "isAnchor"));
|
|
541
|
+
return /* @__PURE__ */ jsx12("a", { className: baseClasses, ...buttonProps, children: /* @__PURE__ */ jsx12(Icon, { name: icon, size: iconSize }) });
|
|
542
|
+
} else {
|
|
543
|
+
const buttonProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== "isAnchor"));
|
|
544
|
+
return /* @__PURE__ */ jsx12("button", { type: "button", className: baseClasses, disabled: isDisabled, ...buttonProps, children: /* @__PURE__ */ jsx12(Icon, { name: icon, size: iconSize }) });
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// src/file-input/file-input.tsx
|
|
549
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
550
|
+
var ERROR_TYPES = {
|
|
551
|
+
SIZE_TOO_LARGE: "SIZE_TOO_LARGE",
|
|
552
|
+
UNSUPPORTED_FORMAT: "UNSUPPORTED_FORMAT"
|
|
553
|
+
};
|
|
554
|
+
var ERROR_MESSAGES = {
|
|
555
|
+
SIZE_TOO_LARGE: "\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u304C\u5927\u304D\u904E\u304E\u307E\u3059\u3002",
|
|
556
|
+
UNSUPPORTED_FORMAT: "\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002"
|
|
557
|
+
};
|
|
558
|
+
var FileInput = forwardRef(
|
|
559
|
+
({ id, variant, accept, maxSize, isDisabled = false, isError = false, onSelect, onError, errorMessages, ...rest }, ref) => {
|
|
560
|
+
const size = variant === "button" ? rest.size ?? "medium" : "medium";
|
|
561
|
+
const [selectedFile, setSelectedFile] = useState4(null);
|
|
562
|
+
const [isDragOver, setIsDragOver] = useState4(false);
|
|
563
|
+
const fileInputRef = useRef2(null);
|
|
564
|
+
const errorId = useId();
|
|
565
|
+
const fallbackId = useId();
|
|
566
|
+
const inputId = id ?? fallbackId;
|
|
567
|
+
const validateFile = useCallback4(
|
|
568
|
+
(file) => {
|
|
569
|
+
const errors = [];
|
|
570
|
+
if (maxSize != null && maxSize > 0 && file.size > maxSize) {
|
|
571
|
+
errors.push({
|
|
572
|
+
type: ERROR_TYPES.SIZE_TOO_LARGE,
|
|
573
|
+
message: ERROR_MESSAGES.SIZE_TOO_LARGE
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
if (accept != null && accept.length > 0) {
|
|
577
|
+
const acceptTypes = accept.split(",").map((t) => t.trim());
|
|
578
|
+
const fileName = file.name.toLowerCase();
|
|
579
|
+
const fileExtension = fileName.substring(fileName.lastIndexOf(".")).toLowerCase();
|
|
580
|
+
const fileMimeType = file.type;
|
|
581
|
+
const isAccepted = acceptTypes.some((acceptType) => {
|
|
582
|
+
if (acceptType.startsWith(".")) {
|
|
583
|
+
return fileExtension === acceptType.toLowerCase();
|
|
584
|
+
}
|
|
585
|
+
if (acceptType.includes("/")) {
|
|
586
|
+
if (acceptType.endsWith("/*")) {
|
|
587
|
+
const mainType = acceptType.split("/")[0];
|
|
588
|
+
return fileMimeType.startsWith(`${mainType}/`);
|
|
589
|
+
}
|
|
590
|
+
return fileMimeType === acceptType;
|
|
591
|
+
}
|
|
592
|
+
return false;
|
|
593
|
+
});
|
|
594
|
+
if (!isAccepted) {
|
|
595
|
+
errors.push({ type: ERROR_TYPES.UNSUPPORTED_FORMAT, message: ERROR_MESSAGES.UNSUPPORTED_FORMAT });
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
if (errors.length > 0) {
|
|
599
|
+
onError?.(errors);
|
|
600
|
+
return false;
|
|
601
|
+
}
|
|
602
|
+
return true;
|
|
603
|
+
},
|
|
604
|
+
[accept, maxSize, onError]
|
|
605
|
+
);
|
|
606
|
+
const handleFileSelect = useCallback4(
|
|
607
|
+
(file) => {
|
|
608
|
+
if (file && !validateFile(file)) {
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
setSelectedFile(file);
|
|
612
|
+
onSelect?.(file);
|
|
613
|
+
},
|
|
614
|
+
[validateFile, onSelect]
|
|
615
|
+
);
|
|
616
|
+
const handleFileInputChange = useCallback4(
|
|
617
|
+
(event) => {
|
|
618
|
+
if (isDisabled) {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
const files = event.target.files;
|
|
622
|
+
if (files == null || files.length === 0) {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
const file = files[0];
|
|
626
|
+
if (file != null) {
|
|
627
|
+
handleFileSelect(file);
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
[isDisabled, handleFileSelect]
|
|
631
|
+
);
|
|
632
|
+
const handleDragOver = useCallback4(
|
|
633
|
+
(event) => {
|
|
634
|
+
event.preventDefault();
|
|
635
|
+
if (!isDisabled) {
|
|
636
|
+
setIsDragOver(true);
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
[isDisabled]
|
|
640
|
+
);
|
|
641
|
+
const handleDragLeave = useCallback4((event) => {
|
|
642
|
+
event.preventDefault();
|
|
643
|
+
setIsDragOver(false);
|
|
644
|
+
}, []);
|
|
645
|
+
const handleDrop = useCallback4(
|
|
646
|
+
(event) => {
|
|
647
|
+
event.preventDefault();
|
|
648
|
+
setIsDragOver(false);
|
|
649
|
+
if (isDisabled) return;
|
|
650
|
+
const file = event.dataTransfer.files[0];
|
|
651
|
+
if (file != null) {
|
|
652
|
+
handleFileSelect(file);
|
|
653
|
+
}
|
|
654
|
+
},
|
|
655
|
+
[isDisabled, handleFileSelect]
|
|
656
|
+
);
|
|
657
|
+
const handleButtonClick = useCallback4(() => {
|
|
658
|
+
if (!isDisabled) {
|
|
659
|
+
fileInputRef.current?.click();
|
|
660
|
+
}
|
|
661
|
+
}, [isDisabled]);
|
|
662
|
+
const handleClear = useCallback4(() => {
|
|
663
|
+
setSelectedFile(null);
|
|
664
|
+
if (fileInputRef.current) {
|
|
665
|
+
fileInputRef.current.value = "";
|
|
666
|
+
}
|
|
667
|
+
onSelect?.(null);
|
|
668
|
+
}, [onSelect]);
|
|
669
|
+
useImperativeHandle(
|
|
670
|
+
ref,
|
|
671
|
+
() => ({
|
|
672
|
+
reset: handleClear
|
|
673
|
+
}),
|
|
674
|
+
[handleClear]
|
|
675
|
+
);
|
|
676
|
+
const hasErrorMessages = !isDisabled && errorMessages != null && errorMessages.length > 0;
|
|
677
|
+
const hasErrors = !isDisabled && isError === true;
|
|
678
|
+
const dropzoneClasses = clsx10(
|
|
679
|
+
"flex flex-1 flex-col items-center justify-center gap-4 rounded border border-dashed px-6 text-center",
|
|
680
|
+
selectedFile ? "py-[52px]" : "py-4",
|
|
681
|
+
{
|
|
682
|
+
"border-uiBorder03 bg-white text-text01": !isDisabled && !isDragOver && !hasErrors,
|
|
683
|
+
"border-activeInput bg-activeInput/5": !isDisabled && isDragOver && !hasErrors,
|
|
684
|
+
"border-supportDanger bg-white": hasErrors && !isDisabled,
|
|
685
|
+
"cursor-pointer hover:bg-hover02 active:bg-active02": !isDisabled,
|
|
686
|
+
"hover:bg-uiBackgroundError active:bg-red-red20": !isDisabled && hasErrors,
|
|
687
|
+
"border-disabled01 bg-disabled02 text-textPlaceholder cursor-not-allowed": isDisabled
|
|
688
|
+
}
|
|
689
|
+
);
|
|
690
|
+
const maxSizeLabel = (() => {
|
|
691
|
+
if (maxSize != null && maxSize > 0) {
|
|
692
|
+
const KB = 1024;
|
|
693
|
+
const MB = KB * 1024;
|
|
694
|
+
const GB = MB * 1024;
|
|
695
|
+
if (maxSize < MB) {
|
|
696
|
+
return `${Math.round(maxSize / KB)}KB\u4EE5\u4E0B`;
|
|
697
|
+
}
|
|
698
|
+
if (maxSize < GB) {
|
|
699
|
+
return `${Math.round(maxSize / MB)}MB\u4EE5\u4E0B`;
|
|
700
|
+
}
|
|
701
|
+
return `${Math.round(maxSize / GB)}GB\u4EE5\u4E0B`;
|
|
702
|
+
}
|
|
703
|
+
return "\u5236\u9650\u306A\u3057";
|
|
704
|
+
})();
|
|
705
|
+
const acceptLabel = (() => {
|
|
706
|
+
if (accept == null || accept.trim().length === 0) {
|
|
707
|
+
return "\u5236\u9650\u306A\u3057";
|
|
708
|
+
}
|
|
709
|
+
const tokens = accept.split(",").map((t) => t.trim()).filter((t) => t.length > 0);
|
|
710
|
+
const normalized = tokens.map((token) => {
|
|
711
|
+
if (token.startsWith(".")) {
|
|
712
|
+
return token.slice(1);
|
|
713
|
+
}
|
|
714
|
+
const slashIndex = token.indexOf("/");
|
|
715
|
+
if (slashIndex !== -1) {
|
|
716
|
+
const type = token.slice(0, slashIndex);
|
|
717
|
+
const subtype = token.slice(slashIndex + 1);
|
|
718
|
+
return subtype === "*" ? `${type}/*` : subtype;
|
|
719
|
+
}
|
|
720
|
+
return token;
|
|
721
|
+
});
|
|
722
|
+
return normalized.join(", ");
|
|
723
|
+
})();
|
|
724
|
+
if (variant === "button") {
|
|
725
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
726
|
+
/* @__PURE__ */ jsx13("div", { className: hasErrors ? "flex-1" : "min-w-0 flex-1", children: /* @__PURE__ */ jsx13(
|
|
727
|
+
InternalButton,
|
|
728
|
+
{
|
|
729
|
+
size,
|
|
730
|
+
variant: hasErrors ? "outlineDanger" : "outline",
|
|
731
|
+
isDisabled,
|
|
732
|
+
width: "100%",
|
|
733
|
+
onClick: handleButtonClick,
|
|
734
|
+
before: /* @__PURE__ */ jsx13(Icon, { name: "upload", size: "small" }),
|
|
735
|
+
after: /* @__PURE__ */ jsx13(Fragment2, { children: selectedFile ? /* @__PURE__ */ jsx13("span", { className: clsx10("typography-label12regular truncate", !isDisabled && "text-text01"), children: selectedFile.name }) : "" }),
|
|
736
|
+
children: /* @__PURE__ */ jsx13("span", { className: "truncate", children: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E" })
|
|
737
|
+
}
|
|
738
|
+
) }),
|
|
739
|
+
selectedFile && !isDisabled && /* @__PURE__ */ jsx13("div", { className: "shrink-0", children: /* @__PURE__ */ jsx13(IconButton, { variant: "text", icon: "close", size: "small", onClick: handleClear }) }),
|
|
740
|
+
hasErrors && hasErrorMessages && /* @__PURE__ */ jsx13("div", { id: errorId, "data-testid": "error-messages", className: "typography-label12regular text-supportError", children: errorMessages.map((message, index) => /* @__PURE__ */ jsx13("div", { className: "break-all", children: message }, index)) }),
|
|
741
|
+
/* @__PURE__ */ jsx13(
|
|
742
|
+
"input",
|
|
743
|
+
{
|
|
744
|
+
id: inputId,
|
|
745
|
+
ref: fileInputRef,
|
|
746
|
+
type: "file",
|
|
747
|
+
accept,
|
|
748
|
+
onChange: handleFileInputChange,
|
|
749
|
+
className: "hidden",
|
|
750
|
+
"aria-invalid": hasErrors,
|
|
751
|
+
...hasErrors && hasErrorMessages && { "aria-describedby": errorId }
|
|
752
|
+
}
|
|
753
|
+
)
|
|
754
|
+
] });
|
|
755
|
+
}
|
|
756
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex min-w-[320px] flex-col gap-2", children: [
|
|
757
|
+
/* @__PURE__ */ jsxs4(
|
|
758
|
+
"div",
|
|
759
|
+
{
|
|
760
|
+
className: dropzoneClasses,
|
|
761
|
+
role: "button",
|
|
762
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
763
|
+
onDragOver: handleDragOver,
|
|
764
|
+
onDragLeave: handleDragLeave,
|
|
765
|
+
onDrop: handleDrop,
|
|
766
|
+
onClick: handleButtonClick,
|
|
767
|
+
onKeyDown: (e) => {
|
|
768
|
+
if ((e.key === "Enter" || e.key === " ") && !isDisabled) {
|
|
769
|
+
e.preventDefault();
|
|
770
|
+
handleButtonClick();
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
"aria-label": "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E",
|
|
774
|
+
"aria-disabled": isDisabled,
|
|
775
|
+
...hasErrors && hasErrorMessages && { "aria-describedby": errorId },
|
|
776
|
+
children: [
|
|
777
|
+
/* @__PURE__ */ jsx13(Icon, { name: "upload-document", size: "large", color: isDisabled ? "icon03" : "icon01" }),
|
|
778
|
+
!selectedFile && /* @__PURE__ */ jsx13("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ jsx13("div", { className: "typography-body13regular select-none", children: /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
779
|
+
"\u3053\u3053\u306B\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
780
|
+
/* @__PURE__ */ jsx13("br", {}),
|
|
781
|
+
"\u307E\u305F\u306F\u3001",
|
|
782
|
+
/* @__PURE__ */ jsx13("span", { className: clsx10(!isDisabled ? "text-link01" : ""), children: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E" }),
|
|
783
|
+
"\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
784
|
+
] }) }) }),
|
|
785
|
+
!selectedFile && /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-1", children: [
|
|
786
|
+
/* @__PURE__ */ jsx13("div", { className: clsx10("typography-label11regular", isDisabled ? "text-textPlaceholder" : "text-text02"), children: "\u5BFE\u5FDC\u5F62\u5F0F" }),
|
|
787
|
+
/* @__PURE__ */ jsx13("div", { className: clsx10("typography-body12regular", isDisabled ? "text-textPlaceholder" : "text-text01"), children: acceptLabel }),
|
|
788
|
+
/* @__PURE__ */ jsx13("div", { className: clsx10("typography-label11regular", isDisabled ? "text-textPlaceholder" : "text-text02"), children: "\u30B5\u30A4\u30BA" }),
|
|
789
|
+
/* @__PURE__ */ jsx13("div", { className: clsx10("typography-body12regular", isDisabled ? "text-textPlaceholder" : "text-text01"), children: maxSizeLabel })
|
|
790
|
+
] }),
|
|
791
|
+
selectedFile && /* @__PURE__ */ jsxs4("div", { className: "mt-2 flex flex-col items-center gap-1", children: [
|
|
792
|
+
/* @__PURE__ */ jsx13("span", { className: "typography-label11regular text-text02", children: "\u30D5\u30A1\u30A4\u30EB\u540D" }),
|
|
793
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
794
|
+
/* @__PURE__ */ jsx13("span", { className: "typography-label14regular", children: selectedFile.name }),
|
|
795
|
+
!isDisabled && /* @__PURE__ */ jsx13(
|
|
796
|
+
IconButton,
|
|
797
|
+
{
|
|
798
|
+
variant: "text",
|
|
799
|
+
icon: "close",
|
|
800
|
+
size: "small",
|
|
801
|
+
onClick: (event) => {
|
|
802
|
+
event.stopPropagation();
|
|
803
|
+
handleClear();
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
)
|
|
807
|
+
] })
|
|
808
|
+
] }),
|
|
809
|
+
/* @__PURE__ */ jsx13(
|
|
810
|
+
"input",
|
|
811
|
+
{
|
|
812
|
+
id: inputId,
|
|
813
|
+
ref: fileInputRef,
|
|
814
|
+
type: "file",
|
|
815
|
+
accept,
|
|
816
|
+
onChange: handleFileInputChange,
|
|
817
|
+
className: "hidden",
|
|
818
|
+
"aria-invalid": hasErrors,
|
|
819
|
+
...hasErrors && hasErrorMessages && { "aria-describedby": errorId }
|
|
820
|
+
}
|
|
821
|
+
)
|
|
822
|
+
]
|
|
823
|
+
}
|
|
824
|
+
),
|
|
825
|
+
hasErrors && hasErrorMessages && /* @__PURE__ */ jsx13(
|
|
826
|
+
"div",
|
|
827
|
+
{
|
|
828
|
+
id: errorId,
|
|
829
|
+
"data-testid": "error-messages",
|
|
830
|
+
className: "typography-body13regular flex flex-col text-supportDanger",
|
|
831
|
+
children: errorMessages.map((message, index) => /* @__PURE__ */ jsx13("div", { children: message }, index))
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
] });
|
|
835
|
+
}
|
|
836
|
+
);
|
|
837
|
+
FileInput.displayName = "FileInput";
|
|
838
|
+
|
|
497
839
|
// src/heading/heading.tsx
|
|
498
840
|
import { typography } from "@zenkigen-inc/component-theme";
|
|
499
|
-
import { clsx as
|
|
500
|
-
import { jsxs as
|
|
841
|
+
import { clsx as clsx11 } from "clsx";
|
|
842
|
+
import { jsxs as jsxs5 } from "react/jsx-runtime";
|
|
501
843
|
function Heading(props) {
|
|
502
844
|
const TagName = `h${props.level}`;
|
|
503
|
-
const classes =
|
|
845
|
+
const classes = clsx11(`flex items-center text-text01`, typography.heading[TagName], {
|
|
504
846
|
"gap-2": props.level === 1,
|
|
505
847
|
"gap-1": props.level > 1
|
|
506
848
|
});
|
|
507
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ jsxs5(TagName, { className: classes, children: [
|
|
508
850
|
props.before,
|
|
509
851
|
props.children,
|
|
510
852
|
props.after
|
|
@@ -512,22 +854,22 @@ function Heading(props) {
|
|
|
512
854
|
}
|
|
513
855
|
|
|
514
856
|
// src/hooks/use-roving-focus.ts
|
|
515
|
-
import { useCallback as
|
|
857
|
+
import { useCallback as useCallback5, useState as useState5 } from "react";
|
|
516
858
|
var useRovingFocus = ({
|
|
517
859
|
values,
|
|
518
860
|
defaultFocusedValue,
|
|
519
861
|
isDisabled = false
|
|
520
862
|
}) => {
|
|
521
|
-
const [focusedValue, setFocusedValue] =
|
|
863
|
+
const [focusedValue, setFocusedValue] = useState5(
|
|
522
864
|
typeof defaultFocusedValue === "undefined" ? null : defaultFocusedValue
|
|
523
865
|
);
|
|
524
|
-
const handleFocusChange =
|
|
866
|
+
const handleFocusChange = useCallback5((newValue) => {
|
|
525
867
|
setFocusedValue(newValue);
|
|
526
868
|
}, []);
|
|
527
|
-
const handleBlur =
|
|
869
|
+
const handleBlur = useCallback5(() => {
|
|
528
870
|
setFocusedValue(null);
|
|
529
871
|
}, []);
|
|
530
|
-
const handleKeyDown =
|
|
872
|
+
const handleKeyDown = useCallback5(
|
|
531
873
|
(event) => {
|
|
532
874
|
if (isDisabled === true || values.length === 0) return;
|
|
533
875
|
const currentIndex = focusedValue !== null && focusedValue !== "" ? values.indexOf(focusedValue) : -1;
|
|
@@ -581,60 +923,18 @@ var useRovingFocus = ({
|
|
|
581
923
|
};
|
|
582
924
|
};
|
|
583
925
|
|
|
584
|
-
// src/icon-button/icon-button.tsx
|
|
585
|
-
import { buttonColors as buttonColors3, focusVisible as focusVisible6 } from "@zenkigen-inc/component-theme";
|
|
586
|
-
import { clsx as clsx10 } from "clsx";
|
|
587
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
588
|
-
function IconButton({
|
|
589
|
-
icon,
|
|
590
|
-
size = "medium",
|
|
591
|
-
variant = "outline",
|
|
592
|
-
isNoPadding = false,
|
|
593
|
-
isDisabled = false,
|
|
594
|
-
isSelected = false,
|
|
595
|
-
...props
|
|
596
|
-
}) {
|
|
597
|
-
const baseClasses = clsx10(
|
|
598
|
-
"typography-label16regular flex items-center justify-center gap-1 rounded",
|
|
599
|
-
buttonColors3[variant].hover,
|
|
600
|
-
buttonColors3[variant].active,
|
|
601
|
-
buttonColors3[variant].disabled,
|
|
602
|
-
focusVisible6.normal,
|
|
603
|
-
{
|
|
604
|
-
"h-4 w-4": size === "small" && isNoPadding,
|
|
605
|
-
"h-6 w-6": size === "small" && !isNoPadding || (size === "medium" || size === "large") && isNoPadding,
|
|
606
|
-
"h-8 w-8": size === "medium" && !isNoPadding,
|
|
607
|
-
"h-10 w-10": size === "large" && !isNoPadding,
|
|
608
|
-
"inline-flex": props.isAnchor,
|
|
609
|
-
"pointer-events-none": isDisabled,
|
|
610
|
-
[buttonColors3[variant].selected]: isSelected,
|
|
611
|
-
[buttonColors3[variant].base]: !isSelected
|
|
612
|
-
}
|
|
613
|
-
);
|
|
614
|
-
const iconSize = size === "small" ? "small" : "medium";
|
|
615
|
-
if (props.isAnchor === true) {
|
|
616
|
-
const buttonProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== "isAnchor"));
|
|
617
|
-
return /* @__PURE__ */ jsx12("a", { className: baseClasses, ...buttonProps, children: /* @__PURE__ */ jsx12(Icon, { name: icon, size: iconSize }) });
|
|
618
|
-
} else {
|
|
619
|
-
const buttonProps = Object.fromEntries(
|
|
620
|
-
Object.entries(props).filter(([key]) => key !== "isAnchor" && key !== "onClick")
|
|
621
|
-
);
|
|
622
|
-
return /* @__PURE__ */ jsx12("button", { type: "button", className: baseClasses, disabled: isDisabled, onClick: props.onClick, ...buttonProps, children: /* @__PURE__ */ jsx12(Icon, { name: icon, size: iconSize }) });
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
|
|
626
926
|
// src/loading/loading.tsx
|
|
627
|
-
import
|
|
628
|
-
import { Fragment as
|
|
927
|
+
import clsx12 from "clsx";
|
|
928
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
629
929
|
function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
630
|
-
const wrapperClasses =
|
|
631
|
-
const svgClasses =
|
|
930
|
+
const wrapperClasses = clsx12(position, "left-0 top-0 z-20 flex w-full items-center justify-center");
|
|
931
|
+
const svgClasses = clsx12({
|
|
632
932
|
"h-4 w-4": size === "small",
|
|
633
933
|
"h-8 w-8": size === "medium",
|
|
634
934
|
"h-16 w-16": size === "large"
|
|
635
935
|
});
|
|
636
|
-
return /* @__PURE__ */
|
|
637
|
-
size === "small" && /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ jsx14(Fragment3, { children: /* @__PURE__ */ jsxs6("div", { className: wrapperClasses, style: { height }, children: [
|
|
937
|
+
size === "small" && /* @__PURE__ */ jsx14("svg", { className: svgClasses, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx14(
|
|
638
938
|
"circle",
|
|
639
939
|
{
|
|
640
940
|
className: "origin-center animate-circular-small-move stroke-interactive01",
|
|
@@ -646,7 +946,7 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
646
946
|
fill: "none"
|
|
647
947
|
}
|
|
648
948
|
) }),
|
|
649
|
-
size === "medium" && /* @__PURE__ */
|
|
949
|
+
size === "medium" && /* @__PURE__ */ jsx14("svg", { className: svgClasses, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx14(
|
|
650
950
|
"circle",
|
|
651
951
|
{
|
|
652
952
|
className: "origin-center animate-circular-medium-move stroke-interactive01",
|
|
@@ -658,7 +958,7 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
658
958
|
fill: "none"
|
|
659
959
|
}
|
|
660
960
|
) }),
|
|
661
|
-
size === "large" && /* @__PURE__ */
|
|
961
|
+
size === "large" && /* @__PURE__ */ jsx14("svg", { className: svgClasses, viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx14(
|
|
662
962
|
"circle",
|
|
663
963
|
{
|
|
664
964
|
className: "origin-center animate-circular-large-move stroke-interactive01",
|
|
@@ -674,7 +974,7 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
674
974
|
}
|
|
675
975
|
|
|
676
976
|
// src/modal/modal.tsx
|
|
677
|
-
import { useEffect as useEffect2, useState as
|
|
977
|
+
import { useEffect as useEffect2, useState as useState6 } from "react";
|
|
678
978
|
import { createPortal as createPortal2 } from "react-dom";
|
|
679
979
|
|
|
680
980
|
// src/modal/body-scroll-lock.tsx
|
|
@@ -725,9 +1025,9 @@ function restoreProperty(element, property, value) {
|
|
|
725
1025
|
}
|
|
726
1026
|
|
|
727
1027
|
// src/modal/modal-body.tsx
|
|
728
|
-
import { jsx as
|
|
1028
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
729
1029
|
function ModalBody({ children }) {
|
|
730
|
-
return /* @__PURE__ */
|
|
1030
|
+
return /* @__PURE__ */ jsx15("div", { className: "overflow-y-auto", children });
|
|
731
1031
|
}
|
|
732
1032
|
|
|
733
1033
|
// src/modal/modal-context.ts
|
|
@@ -737,22 +1037,22 @@ var ModalContext = createContext2({
|
|
|
737
1037
|
});
|
|
738
1038
|
|
|
739
1039
|
// src/modal/modal-footer.tsx
|
|
740
|
-
import
|
|
741
|
-
import { jsx as
|
|
1040
|
+
import clsx13 from "clsx";
|
|
1041
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
742
1042
|
function ModalFooter({ children, isNoBorder = false }) {
|
|
743
|
-
const wrapperClasses =
|
|
1043
|
+
const wrapperClasses = clsx13("flex w-full shrink-0 items-center rounded-b-lg px-6 py-4", {
|
|
744
1044
|
"border-t-[1px] border-uiBorder01": !isNoBorder
|
|
745
1045
|
});
|
|
746
|
-
return /* @__PURE__ */
|
|
1046
|
+
return /* @__PURE__ */ jsx16("div", { className: wrapperClasses, children });
|
|
747
1047
|
}
|
|
748
1048
|
|
|
749
1049
|
// src/modal/modal-header.tsx
|
|
750
|
-
import
|
|
1050
|
+
import clsx14 from "clsx";
|
|
751
1051
|
import { useContext as useContext3 } from "react";
|
|
752
|
-
import { jsx as
|
|
1052
|
+
import { jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
753
1053
|
function ModalHeader({ children, isNoBorder = false }) {
|
|
754
1054
|
const { onClose } = useContext3(ModalContext);
|
|
755
|
-
const headerClasses =
|
|
1055
|
+
const headerClasses = clsx14(
|
|
756
1056
|
"typography-h5 flex w-full shrink-0 items-center justify-between rounded-t-lg px-6 text-text01",
|
|
757
1057
|
{
|
|
758
1058
|
"border-b border-uiBorder01": !isNoBorder,
|
|
@@ -760,14 +1060,14 @@ function ModalHeader({ children, isNoBorder = false }) {
|
|
|
760
1060
|
"h-12": onClose
|
|
761
1061
|
}
|
|
762
1062
|
);
|
|
763
|
-
return /* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
765
|
-
onClose && /* @__PURE__ */
|
|
1063
|
+
return /* @__PURE__ */ jsxs7("div", { className: headerClasses, children: [
|
|
1064
|
+
/* @__PURE__ */ jsx17("div", { children }),
|
|
1065
|
+
onClose && /* @__PURE__ */ jsx17(IconButton, { icon: "close", size: "small", variant: "text", onClick: onClose })
|
|
766
1066
|
] });
|
|
767
1067
|
}
|
|
768
1068
|
|
|
769
1069
|
// src/modal/modal.tsx
|
|
770
|
-
import { Fragment as
|
|
1070
|
+
import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
771
1071
|
var LIMIT_WIDTH = 320;
|
|
772
1072
|
var LIMIT_HEIGHT = 184;
|
|
773
1073
|
function Modal({
|
|
@@ -779,16 +1079,16 @@ function Modal({
|
|
|
779
1079
|
onClose,
|
|
780
1080
|
portalTargetRef
|
|
781
1081
|
}) {
|
|
782
|
-
const [isMounted, setIsMounted] =
|
|
1082
|
+
const [isMounted, setIsMounted] = useState6(false);
|
|
783
1083
|
const renderWidth = typeof width === "number" ? Math.max(width, LIMIT_WIDTH) : width;
|
|
784
1084
|
const renderHeight = typeof height === "number" ? Math.max(height, LIMIT_HEIGHT) : height;
|
|
785
1085
|
useEffect2(() => {
|
|
786
1086
|
setIsMounted(true);
|
|
787
1087
|
}, []);
|
|
788
|
-
return isMounted && isOpen ? /* @__PURE__ */
|
|
789
|
-
/* @__PURE__ */
|
|
1088
|
+
return isMounted && isOpen ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
1089
|
+
/* @__PURE__ */ jsx18(BodyScrollLock, {}),
|
|
790
1090
|
createPortal2(
|
|
791
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ jsx18(ModalContext.Provider, { value: { onClose }, children: /* @__PURE__ */ jsx18("div", { className: "fixed left-0 top-0 z-overlay flex size-full items-center justify-center bg-backgroundOverlayBlack py-4", children: /* @__PURE__ */ jsx18(
|
|
792
1092
|
"div",
|
|
793
1093
|
{
|
|
794
1094
|
className: "grid max-h-full min-h-[120px] grid-rows-[max-content_1fr_max-content] flex-col rounded-lg bg-uiBackground01 shadow-modalShadow",
|
|
@@ -805,10 +1105,10 @@ Modal.Header = ModalHeader;
|
|
|
805
1105
|
Modal.Footer = ModalFooter;
|
|
806
1106
|
|
|
807
1107
|
// src/notification-inline/notification-inline.tsx
|
|
808
|
-
import { clsx as
|
|
809
|
-
import { jsx as
|
|
1108
|
+
import { clsx as clsx15 } from "clsx";
|
|
1109
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
810
1110
|
function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
811
|
-
const wrapperClasses =
|
|
1111
|
+
const wrapperClasses = clsx15("typography-body13regular flex items-center gap-1 rounded text-text01", {
|
|
812
1112
|
"bg-uiBackgroundError": state === "attention",
|
|
813
1113
|
"bg-uiBackgroundWarning": state === "warning",
|
|
814
1114
|
"bg-uiBackgroundBlue": state === "information",
|
|
@@ -817,7 +1117,7 @@ function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
|
817
1117
|
"p-2": size === "small",
|
|
818
1118
|
"p-3": size === "medium"
|
|
819
1119
|
});
|
|
820
|
-
const iconClasses =
|
|
1120
|
+
const iconClasses = clsx15("flex items-center", {
|
|
821
1121
|
"fill-supportError": state === "attention",
|
|
822
1122
|
"fill-supportWarning": state === "warning",
|
|
823
1123
|
"fill-blue-blue50": state === "information",
|
|
@@ -833,15 +1133,15 @@ function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
|
833
1133
|
small: "small",
|
|
834
1134
|
medium: "medium"
|
|
835
1135
|
};
|
|
836
|
-
return /* @__PURE__ */
|
|
837
|
-
state !== "default" && /* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */
|
|
839
|
-
props.showClose === true && /* @__PURE__ */
|
|
1136
|
+
return /* @__PURE__ */ jsxs9("div", { className: wrapperClasses, children: [
|
|
1137
|
+
state !== "default" && /* @__PURE__ */ jsx19("div", { className: iconClasses, children: /* @__PURE__ */ jsx19(Icon, { name: iconName[state], size: iconSize[size] }) }),
|
|
1138
|
+
/* @__PURE__ */ jsx19("p", { className: "flex-1", children: props.children }),
|
|
1139
|
+
props.showClose === true && /* @__PURE__ */ jsx19("div", { className: "flex items-center", children: /* @__PURE__ */ jsx19(IconButton, { icon: "close", size: "small", variant: "text" }) })
|
|
840
1140
|
] });
|
|
841
1141
|
}
|
|
842
1142
|
|
|
843
1143
|
// src/pagination/pagination-button.tsx
|
|
844
|
-
import { clsx as
|
|
1144
|
+
import { clsx as clsx16 } from "clsx";
|
|
845
1145
|
import { useContext as useContext4 } from "react";
|
|
846
1146
|
|
|
847
1147
|
// src/pagination/pagination-context.ts
|
|
@@ -851,10 +1151,10 @@ var PaginationContext = createContext3({
|
|
|
851
1151
|
});
|
|
852
1152
|
|
|
853
1153
|
// src/pagination/pagination-button.tsx
|
|
854
|
-
import { jsx as
|
|
1154
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
855
1155
|
function PaginationButton({ page, onClick }) {
|
|
856
1156
|
const { currentPage } = useContext4(PaginationContext);
|
|
857
|
-
const buttonClasses =
|
|
1157
|
+
const buttonClasses = clsx16(
|
|
858
1158
|
"flex h-8 min-w-8 items-center justify-center rounded fill-icon01 px-1",
|
|
859
1159
|
"typography-label14regular",
|
|
860
1160
|
"text-interactive02",
|
|
@@ -862,54 +1162,76 @@ function PaginationButton({ page, onClick }) {
|
|
|
862
1162
|
{ "border border-uiBorder02": page === currentPage },
|
|
863
1163
|
{ "border-transparent": page !== currentPage }
|
|
864
1164
|
);
|
|
865
|
-
return /* @__PURE__ */
|
|
1165
|
+
return /* @__PURE__ */ jsx20("button", { type: "button", className: buttonClasses, onClick: () => onClick(page), children: page });
|
|
866
1166
|
}
|
|
867
1167
|
|
|
868
1168
|
// src/pagination/pagination.tsx
|
|
869
|
-
import { jsx as
|
|
1169
|
+
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
870
1170
|
var START_PAGE = 1;
|
|
871
1171
|
function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick }) {
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
const
|
|
876
|
-
const
|
|
877
|
-
const
|
|
1172
|
+
if (totalPage < START_PAGE) {
|
|
1173
|
+
return null;
|
|
1174
|
+
}
|
|
1175
|
+
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
1176
|
+
const clampedCurrentPage = clamp(currentPage, START_PAGE, totalPage);
|
|
1177
|
+
const maxSideNumPagesToShow = Math.max(0, totalPage - 2);
|
|
1178
|
+
const side = clamp(sideNumPagesToShow, 0, maxSideNumPagesToShow);
|
|
1179
|
+
const minPage = START_PAGE + 1;
|
|
1180
|
+
const maxPage = totalPage - 1;
|
|
1181
|
+
const availablePagesCount = Math.max(0, maxPage - minPage + 1);
|
|
1182
|
+
const hasBothSides = clampedCurrentPage > START_PAGE && clampedCurrentPage < totalPage;
|
|
1183
|
+
const windowSize = Math.min(availablePagesCount, hasBothSides ? side * 2 + 1 : side * 2);
|
|
1184
|
+
let start = minPage;
|
|
1185
|
+
if (windowSize > 0) {
|
|
1186
|
+
if (hasBothSides) {
|
|
1187
|
+
start = Math.max(minPage, Math.min(clampedCurrentPage - side, maxPage - windowSize + 1));
|
|
1188
|
+
} else if (clampedCurrentPage === totalPage) {
|
|
1189
|
+
start = Math.max(minPage, maxPage - windowSize + 1);
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
const end = windowSize === 0 ? minPage - 1 : Math.min(maxPage, start + windowSize - 1);
|
|
878
1193
|
const pageList = [];
|
|
879
|
-
for (let i = start
|
|
1194
|
+
for (let i = start; i <= end; i++) {
|
|
880
1195
|
pageList.push(i);
|
|
881
1196
|
}
|
|
882
1197
|
const threeDotIconClasses = "flex h-8 w-8 items-center justify-center gap-1 fill-icon01";
|
|
883
|
-
|
|
1198
|
+
const isFirstPage = clampedCurrentPage === START_PAGE;
|
|
1199
|
+
const isLastPage = clampedCurrentPage === totalPage;
|
|
1200
|
+
const firstPageInList = pageList.at(0) ?? null;
|
|
1201
|
+
const lastPageInList = pageList.at(-1) ?? null;
|
|
1202
|
+
const hasHeadEllipsis = firstPageInList !== null && firstPageInList > START_PAGE + 1;
|
|
1203
|
+
const hasTailEllipsis = lastPageInList !== null && lastPageInList < totalPage - 1;
|
|
1204
|
+
const hasLastPageButton = totalPage > START_PAGE;
|
|
1205
|
+
return /* @__PURE__ */ jsx21(
|
|
884
1206
|
PaginationContext.Provider,
|
|
885
1207
|
{
|
|
886
1208
|
value: {
|
|
887
|
-
currentPage
|
|
1209
|
+
currentPage: clampedCurrentPage
|
|
888
1210
|
},
|
|
889
|
-
children: /* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
1211
|
+
children: /* @__PURE__ */ jsxs10("ul", { className: "flex gap-1", children: [
|
|
1212
|
+
/* @__PURE__ */ jsx21("li", { className: "flex items-center", children: /* @__PURE__ */ jsx21(
|
|
891
1213
|
IconButton,
|
|
892
1214
|
{
|
|
893
|
-
isDisabled:
|
|
1215
|
+
isDisabled: isFirstPage,
|
|
894
1216
|
variant: "text",
|
|
895
1217
|
icon: "angle-left",
|
|
896
1218
|
size: "small",
|
|
897
|
-
onClick: () => onClick(
|
|
1219
|
+
onClick: () => onClick(Math.max(START_PAGE, clampedCurrentPage - 1))
|
|
898
1220
|
}
|
|
899
1221
|
) }),
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
-
|
|
902
|
-
pageList.map((page, index) => /* @__PURE__ */
|
|
903
|
-
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
/* @__PURE__ */
|
|
1222
|
+
/* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsx21(PaginationButton, { onClick: () => onClick(START_PAGE), page: START_PAGE }) }),
|
|
1223
|
+
hasHeadEllipsis && /* @__PURE__ */ jsx21("li", { className: threeDotIconClasses, children: /* @__PURE__ */ jsx21(Icon, { name: "more", size: "small" }) }),
|
|
1224
|
+
pageList.map((page, index) => /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsx21(PaginationButton, { onClick: () => onClick(page), page }) }, index)),
|
|
1225
|
+
hasTailEllipsis && /* @__PURE__ */ jsx21("li", { className: threeDotIconClasses, children: /* @__PURE__ */ jsx21(Icon, { name: "more", size: "small" }) }),
|
|
1226
|
+
hasLastPageButton && /* @__PURE__ */ jsx21("li", { children: /* @__PURE__ */ jsx21(PaginationButton, { onClick: () => onClick(totalPage), page: totalPage }) }),
|
|
1227
|
+
/* @__PURE__ */ jsx21("li", { className: "flex items-center", children: /* @__PURE__ */ jsx21(
|
|
906
1228
|
IconButton,
|
|
907
1229
|
{
|
|
908
|
-
isDisabled:
|
|
1230
|
+
isDisabled: isLastPage,
|
|
909
1231
|
variant: "text",
|
|
910
1232
|
icon: "angle-right",
|
|
911
1233
|
size: "small",
|
|
912
|
-
onClick: () => onClick(
|
|
1234
|
+
onClick: () => onClick(Math.min(totalPage, clampedCurrentPage + 1))
|
|
913
1235
|
}
|
|
914
1236
|
) })
|
|
915
1237
|
] })
|
|
@@ -920,8 +1242,8 @@ function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick })
|
|
|
920
1242
|
// src/select/select.tsx
|
|
921
1243
|
import { autoUpdate, FloatingPortal, offset, size as sizeMiddleware, useFloating } from "@floating-ui/react";
|
|
922
1244
|
import { focusVisible as focusVisible9, selectColors } from "@zenkigen-inc/component-theme";
|
|
923
|
-
import
|
|
924
|
-
import { useRef as
|
|
1245
|
+
import clsx19 from "clsx";
|
|
1246
|
+
import { useRef as useRef3, useState as useState7 } from "react";
|
|
925
1247
|
|
|
926
1248
|
// src/select/select-context.ts
|
|
927
1249
|
import { createContext as createContext4 } from "react";
|
|
@@ -934,16 +1256,16 @@ var SelectContext = createContext4({
|
|
|
934
1256
|
|
|
935
1257
|
// src/select/select-item.tsx
|
|
936
1258
|
import { focusVisible as focusVisible7 } from "@zenkigen-inc/component-theme";
|
|
937
|
-
import
|
|
1259
|
+
import clsx17 from "clsx";
|
|
938
1260
|
import { useContext as useContext5 } from "react";
|
|
939
|
-
import { jsx as
|
|
1261
|
+
import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
940
1262
|
function SelectItem({ option }) {
|
|
941
1263
|
const { setIsOptionListOpen, selectedOption, onChange, isError } = useContext5(SelectContext);
|
|
942
1264
|
const handleClickItem = (option2) => {
|
|
943
1265
|
onChange?.(option2);
|
|
944
1266
|
setIsOptionListOpen(false);
|
|
945
1267
|
};
|
|
946
|
-
const itemClasses =
|
|
1268
|
+
const itemClasses = clsx17(
|
|
947
1269
|
"typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
948
1270
|
focusVisible7.inset,
|
|
949
1271
|
{
|
|
@@ -953,19 +1275,19 @@ function SelectItem({ option }) {
|
|
|
953
1275
|
"pr-10": option.id !== selectedOption?.id
|
|
954
1276
|
}
|
|
955
1277
|
);
|
|
956
|
-
return /* @__PURE__ */
|
|
957
|
-
option.icon && /* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
option.id === selectedOption?.id && /* @__PURE__ */
|
|
1278
|
+
return /* @__PURE__ */ jsx22("li", { className: "flex w-full items-center", "data-id": option.id, children: /* @__PURE__ */ jsxs11("button", { className: itemClasses, type: "button", onClick: () => handleClickItem(option), children: [
|
|
1279
|
+
option.icon && /* @__PURE__ */ jsx22(Icon, { name: option.icon, size: "small" }),
|
|
1280
|
+
/* @__PURE__ */ jsx22("span", { className: "ml-1 flex-1 truncate text-left", children: option.label }),
|
|
1281
|
+
option.id === selectedOption?.id && /* @__PURE__ */ jsx22("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ jsx22(Icon, { name: "check", size: "small" }) })
|
|
960
1282
|
] }) }, option.id);
|
|
961
1283
|
}
|
|
962
1284
|
|
|
963
1285
|
// src/select/select-list.tsx
|
|
964
1286
|
import { focusVisible as focusVisible8 } from "@zenkigen-inc/component-theme";
|
|
965
|
-
import
|
|
966
|
-
import { forwardRef, useContext as useContext6, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
967
|
-
import { jsx as
|
|
968
|
-
var SelectList =
|
|
1287
|
+
import clsx18 from "clsx";
|
|
1288
|
+
import { forwardRef as forwardRef2, useContext as useContext6, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
1289
|
+
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1290
|
+
var SelectList = forwardRef2(({ children, maxHeight }, ref) => {
|
|
969
1291
|
const { selectedOption, setIsOptionListOpen, variant, placeholder, onChange, floatingStyles, floatingRef } = useContext6(SelectContext);
|
|
970
1292
|
const handleClickDeselect = () => {
|
|
971
1293
|
onChange?.(null);
|
|
@@ -989,22 +1311,22 @@ var SelectList = forwardRef(({ children, maxHeight }, ref) => {
|
|
|
989
1311
|
}
|
|
990
1312
|
}
|
|
991
1313
|
}, [selectedOption, maxHeight, floatingRef]);
|
|
992
|
-
const listClasses =
|
|
1314
|
+
const listClasses = clsx18("z-dropdown overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow", {
|
|
993
1315
|
"border-solid border border-uiBorder01": variant === "outline"
|
|
994
1316
|
});
|
|
995
|
-
const deselectButtonClasses =
|
|
1317
|
+
const deselectButtonClasses = clsx18(
|
|
996
1318
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
997
1319
|
focusVisible8.inset
|
|
998
1320
|
);
|
|
999
|
-
return /* @__PURE__ */
|
|
1321
|
+
return /* @__PURE__ */ jsxs12("ul", { className: listClasses, style: { maxHeight, ...floatingStyles }, ref, children: [
|
|
1000
1322
|
children,
|
|
1001
|
-
placeholder != null && selectedOption !== null && /* @__PURE__ */
|
|
1323
|
+
placeholder != null && selectedOption !== null && /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsx23("button", { className: deselectButtonClasses, type: "button", onClick: handleClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
|
|
1002
1324
|
] });
|
|
1003
1325
|
});
|
|
1004
1326
|
SelectList.displayName = "SelectList";
|
|
1005
1327
|
|
|
1006
1328
|
// src/select/select.tsx
|
|
1007
|
-
import { jsx as
|
|
1329
|
+
import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1008
1330
|
var FLOATING_OFFSET = 4;
|
|
1009
1331
|
function Select({
|
|
1010
1332
|
children,
|
|
@@ -1021,8 +1343,8 @@ function Select({
|
|
|
1021
1343
|
onChange,
|
|
1022
1344
|
optionListMaxHeight
|
|
1023
1345
|
}) {
|
|
1024
|
-
const [isOptionListOpen, setIsOptionListOpen] =
|
|
1025
|
-
const targetRef =
|
|
1346
|
+
const [isOptionListOpen, setIsOptionListOpen] = useState7(false);
|
|
1347
|
+
const targetRef = useRef3(null);
|
|
1026
1348
|
useOutsideClick(targetRef, () => setIsOptionListOpen(false));
|
|
1027
1349
|
const { refs, floatingStyles } = useFloating({
|
|
1028
1350
|
open: isOptionListOpen,
|
|
@@ -1043,13 +1365,13 @@ function Select({
|
|
|
1043
1365
|
const handleClickToggle = () => setIsOptionListOpen((prev) => !prev);
|
|
1044
1366
|
const buttonVariant = isError && !isDisabled ? `${variant}Error` : variant;
|
|
1045
1367
|
const isSelected = isOptionSelected && !isDisabled && selectedOption !== null && !isError;
|
|
1046
|
-
const wrapperClasses =
|
|
1368
|
+
const wrapperClasses = clsx19("relative flex shrink-0 items-center gap-1 rounded bg-uiBackground01", {
|
|
1047
1369
|
"h-6": size === "x-small" || size === "small",
|
|
1048
1370
|
"h-8": size === "medium",
|
|
1049
1371
|
"h-10": size === "large",
|
|
1050
1372
|
"cursor-not-allowed": isDisabled
|
|
1051
1373
|
});
|
|
1052
|
-
const buttonClasses =
|
|
1374
|
+
const buttonClasses = clsx19(
|
|
1053
1375
|
"flex size-full items-center rounded",
|
|
1054
1376
|
selectColors[buttonVariant].hover,
|
|
1055
1377
|
selectColors[buttonVariant].active,
|
|
@@ -1064,14 +1386,14 @@ function Select({
|
|
|
1064
1386
|
"border-supportError": !isSelected && !isDisabled && isError
|
|
1065
1387
|
}
|
|
1066
1388
|
);
|
|
1067
|
-
const labelClasses =
|
|
1389
|
+
const labelClasses = clsx19("overflow-hidden", {
|
|
1068
1390
|
"mr-1": size === "x-small",
|
|
1069
1391
|
"mr-2": size !== "x-small",
|
|
1070
1392
|
"typography-label12regular": size === "x-small",
|
|
1071
1393
|
"typography-label14regular": size === "small" || size === "medium",
|
|
1072
1394
|
"typography-label16regular": size === "large"
|
|
1073
1395
|
});
|
|
1074
|
-
return /* @__PURE__ */
|
|
1396
|
+
return /* @__PURE__ */ jsx24(
|
|
1075
1397
|
SelectContext.Provider,
|
|
1076
1398
|
{
|
|
1077
1399
|
value: {
|
|
@@ -1085,8 +1407,8 @@ function Select({
|
|
|
1085
1407
|
floatingStyles,
|
|
1086
1408
|
floatingRef: refs.floating
|
|
1087
1409
|
},
|
|
1088
|
-
children: /* @__PURE__ */
|
|
1089
|
-
/* @__PURE__ */
|
|
1410
|
+
children: /* @__PURE__ */ jsxs13("div", { className: wrapperClasses, style: { width, maxWidth }, ref: targetRef, children: [
|
|
1411
|
+
/* @__PURE__ */ jsxs13(
|
|
1090
1412
|
"button",
|
|
1091
1413
|
{
|
|
1092
1414
|
ref: refs.setReference,
|
|
@@ -1095,9 +1417,9 @@ function Select({
|
|
|
1095
1417
|
onClick: handleClickToggle,
|
|
1096
1418
|
disabled: isDisabled,
|
|
1097
1419
|
children: [
|
|
1098
|
-
selectedOption?.icon ? /* @__PURE__ */
|
|
1099
|
-
/* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
1420
|
+
selectedOption?.icon ? /* @__PURE__ */ jsx24("div", { className: "mr-1 flex", children: /* @__PURE__ */ jsx24(Icon, { name: selectedOption.icon, size: size === "large" ? "medium" : "small" }) }) : placeholder != null && placeholderIcon && /* @__PURE__ */ jsx24("div", { className: "mr-1 flex", children: /* @__PURE__ */ jsx24(Icon, { name: placeholderIcon, size: size === "large" ? "medium" : "small" }) }),
|
|
1421
|
+
/* @__PURE__ */ jsx24("div", { className: labelClasses, children: /* @__PURE__ */ jsx24("div", { className: "truncate", children: selectedOption ? selectedOption.label : placeholder != null && placeholder }) }),
|
|
1422
|
+
/* @__PURE__ */ jsx24("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx24(
|
|
1101
1423
|
Icon,
|
|
1102
1424
|
{
|
|
1103
1425
|
name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
|
|
@@ -1107,7 +1429,7 @@ function Select({
|
|
|
1107
1429
|
]
|
|
1108
1430
|
}
|
|
1109
1431
|
),
|
|
1110
|
-
isOptionListOpen && !isDisabled && /* @__PURE__ */
|
|
1432
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ jsx24(FloatingPortal, { children: /* @__PURE__ */ jsx24("div", { className: "relative z-overlay", children: /* @__PURE__ */ jsx24(SelectList, { ref: refs.setFloating, maxHeight: optionListMaxHeight, children }) }) })
|
|
1111
1433
|
] })
|
|
1112
1434
|
}
|
|
1113
1435
|
);
|
|
@@ -1115,7 +1437,7 @@ function Select({
|
|
|
1115
1437
|
Select.Option = SelectItem;
|
|
1116
1438
|
|
|
1117
1439
|
// src/pagination-select/pagination-select.tsx
|
|
1118
|
-
import { jsx as
|
|
1440
|
+
import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1119
1441
|
function PaginationSelect({
|
|
1120
1442
|
totalSize,
|
|
1121
1443
|
currentPage,
|
|
@@ -1138,14 +1460,14 @@ function PaginationSelect({
|
|
|
1138
1460
|
});
|
|
1139
1461
|
const minCount = totalSize ? (currentPage - 1) * sizePerPage + 1 : 0;
|
|
1140
1462
|
const maxCount = currentPage * sizePerPage > totalSize ? totalSize : currentPage * sizePerPage;
|
|
1141
|
-
return /* @__PURE__ */
|
|
1142
|
-
/* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1463
|
+
return /* @__PURE__ */ jsxs14("nav", { "aria-label": "pagination", className: "flex items-center gap-x-1", children: [
|
|
1464
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-x-2", children: [
|
|
1465
|
+
/* @__PURE__ */ jsxs14("div", { className: "typography-label14regular text-text01", children: [
|
|
1144
1466
|
minCount > 0 && `${minCount} - `,
|
|
1145
1467
|
maxCount,
|
|
1146
1468
|
countLabel
|
|
1147
1469
|
] }),
|
|
1148
|
-
/* @__PURE__ */
|
|
1470
|
+
/* @__PURE__ */ jsx25(
|
|
1149
1471
|
Select,
|
|
1150
1472
|
{
|
|
1151
1473
|
size: "medium",
|
|
@@ -1154,17 +1476,17 @@ function PaginationSelect({
|
|
|
1154
1476
|
optionListMaxHeight,
|
|
1155
1477
|
onChange: (option) => option && onChange(Number(option.value)),
|
|
1156
1478
|
isDisabled: pageMax === 0,
|
|
1157
|
-
children: optionsList.map((option) => /* @__PURE__ */
|
|
1479
|
+
children: optionsList.map((option) => /* @__PURE__ */ jsx25(Select.Option, { option }, option.id))
|
|
1158
1480
|
}
|
|
1159
1481
|
),
|
|
1160
|
-
/* @__PURE__ */
|
|
1482
|
+
/* @__PURE__ */ jsxs14("div", { className: "typography-label14regular text-text02", children: [
|
|
1161
1483
|
"/ ",
|
|
1162
1484
|
pageMax,
|
|
1163
1485
|
pageLabel
|
|
1164
1486
|
] })
|
|
1165
1487
|
] }),
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1488
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center", children: [
|
|
1489
|
+
/* @__PURE__ */ jsx25(
|
|
1168
1490
|
IconButton,
|
|
1169
1491
|
{
|
|
1170
1492
|
variant: "text",
|
|
@@ -1174,7 +1496,7 @@ function PaginationSelect({
|
|
|
1174
1496
|
onClick: onClickPrevButton
|
|
1175
1497
|
}
|
|
1176
1498
|
),
|
|
1177
|
-
/* @__PURE__ */
|
|
1499
|
+
/* @__PURE__ */ jsx25(
|
|
1178
1500
|
IconButton,
|
|
1179
1501
|
{
|
|
1180
1502
|
variant: "text",
|
|
@@ -1189,50 +1511,182 @@ function PaginationSelect({
|
|
|
1189
1511
|
}
|
|
1190
1512
|
|
|
1191
1513
|
// src/password-input/password-input.tsx
|
|
1192
|
-
import { forwardRef as
|
|
1514
|
+
import { forwardRef as forwardRef6, useState as useState8 } from "react";
|
|
1193
1515
|
|
|
1194
1516
|
// src/text-input/text-input.tsx
|
|
1195
|
-
import { clsx as
|
|
1196
|
-
import { forwardRef as
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1517
|
+
import { clsx as clsx22 } from "clsx";
|
|
1518
|
+
import { Children, cloneElement, forwardRef as forwardRef5, isValidElement, useId as useId2, useMemo } from "react";
|
|
1519
|
+
|
|
1520
|
+
// src/text-input/text-input-context.tsx
|
|
1521
|
+
import { createContext as createContext5, useContext as useContext7 } from "react";
|
|
1522
|
+
var TextInputCompoundContext = createContext5(null);
|
|
1523
|
+
var useTextInputCompoundContext = (componentName) => {
|
|
1524
|
+
const context = useContext7(TextInputCompoundContext);
|
|
1525
|
+
if (context == null) {
|
|
1526
|
+
throw new Error(`${componentName} \u3092\u4F7F\u7528\u3059\u308B\u306B\u306F TextInput \u306E\u5B50\u8981\u7D20\u3068\u3057\u3066\u914D\u7F6E\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u3002`);
|
|
1527
|
+
}
|
|
1528
|
+
return context;
|
|
1529
|
+
};
|
|
1530
|
+
|
|
1531
|
+
// src/text-input/text-input-error-message.tsx
|
|
1532
|
+
import { clsx as clsx20 } from "clsx";
|
|
1533
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
1534
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1535
|
+
var TextInputErrorMessage = forwardRef3(
|
|
1536
|
+
({ "aria-live": ariaLive = "assertive", ...props }, ref) => {
|
|
1537
|
+
const { inputProps } = useTextInputCompoundContext("TextInput.ErrorMessage");
|
|
1538
|
+
const typographyClass = inputProps.size === "large" ? "typography-label12regular" : "typography-label11regular";
|
|
1539
|
+
const shouldRender = inputProps.isError === true;
|
|
1540
|
+
if (!shouldRender) {
|
|
1541
|
+
return null;
|
|
1542
|
+
}
|
|
1543
|
+
const errorMessageClassName = clsx20(typographyClass, "text-supportError");
|
|
1544
|
+
return /* @__PURE__ */ jsx26("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
1545
|
+
}
|
|
1546
|
+
);
|
|
1547
|
+
TextInputErrorMessage.displayName = "TextInput.ErrorMessage";
|
|
1548
|
+
|
|
1549
|
+
// src/text-input/text-input-helper-message.tsx
|
|
1550
|
+
import { clsx as clsx21 } from "clsx";
|
|
1551
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
1552
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1553
|
+
var TextInputHelperMessage = forwardRef4((props, ref) => {
|
|
1554
|
+
const { inputProps } = useTextInputCompoundContext("TextInput.HelperMessage");
|
|
1555
|
+
const typographyClass = inputProps.size === "large" ? "typography-label12regular" : "typography-label11regular";
|
|
1556
|
+
const helperMessageClassName = clsx21(typographyClass, "text-text02");
|
|
1557
|
+
return /* @__PURE__ */ jsx27("div", { ref, className: helperMessageClassName, ...props });
|
|
1558
|
+
});
|
|
1559
|
+
TextInputHelperMessage.displayName = "TextInput.HelperMessage";
|
|
1560
|
+
|
|
1561
|
+
// src/text-input/text-input.tsx
|
|
1562
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1563
|
+
function TextInputInner({
|
|
1564
|
+
size = "medium",
|
|
1565
|
+
isError = false,
|
|
1566
|
+
disabled = false,
|
|
1567
|
+
onClickClearButton,
|
|
1568
|
+
after,
|
|
1569
|
+
children,
|
|
1570
|
+
...props
|
|
1571
|
+
}, ref) {
|
|
1572
|
+
const autoGeneratedId = useId2();
|
|
1573
|
+
const { className: _className, ...restInputProps } = props;
|
|
1574
|
+
const inputPropsForContext = useMemo(
|
|
1575
|
+
() => ({
|
|
1576
|
+
...restInputProps,
|
|
1577
|
+
size,
|
|
1578
|
+
isError,
|
|
1579
|
+
disabled,
|
|
1580
|
+
onClickClearButton,
|
|
1581
|
+
after
|
|
1582
|
+
}),
|
|
1583
|
+
[restInputProps, size, isError, disabled, onClickClearButton, after]
|
|
1584
|
+
);
|
|
1585
|
+
const contextValue = useMemo(
|
|
1586
|
+
() => ({
|
|
1587
|
+
inputProps: inputPropsForContext,
|
|
1588
|
+
forwardedRef: ref
|
|
1589
|
+
}),
|
|
1590
|
+
[inputPropsForContext, ref]
|
|
1591
|
+
);
|
|
1592
|
+
const helperMessageIds = [];
|
|
1593
|
+
const errorIds = [];
|
|
1594
|
+
const describedByBaseId = restInputProps.id ?? autoGeneratedId;
|
|
1595
|
+
const enhancedChildren = Children.map(children, (child) => {
|
|
1596
|
+
if (!isValidElement(child)) {
|
|
1597
|
+
return child;
|
|
1598
|
+
}
|
|
1599
|
+
if (child.type === TextInputHelperMessage) {
|
|
1600
|
+
const helperChild = child;
|
|
1601
|
+
const assignedId = helperChild.props.id ?? `${describedByBaseId}-helper-${helperMessageIds.length + 1}`;
|
|
1602
|
+
helperMessageIds.push(assignedId);
|
|
1603
|
+
return cloneElement(helperChild, { id: assignedId });
|
|
1604
|
+
}
|
|
1605
|
+
if (child.type === TextInputErrorMessage && isError) {
|
|
1606
|
+
const errorChild = child;
|
|
1607
|
+
const assignedId = errorChild.props.id ?? `${describedByBaseId}-error-${errorIds.length + 1}`;
|
|
1608
|
+
errorIds.push(assignedId);
|
|
1609
|
+
return cloneElement(errorChild, { id: assignedId });
|
|
1610
|
+
}
|
|
1611
|
+
return child;
|
|
1612
|
+
});
|
|
1613
|
+
const describedByFromProps = typeof restInputProps["aria-describedby"] === "string" ? restInputProps["aria-describedby"] : null;
|
|
1614
|
+
const describedByList = [describedByFromProps, ...helperMessageIds, ...errorIds].filter(
|
|
1615
|
+
(id) => typeof id === "string" && id.trim().length > 0
|
|
1616
|
+
);
|
|
1617
|
+
const describedByProps = describedByList.length > 0 ? {
|
|
1618
|
+
"aria-describedby": describedByList.join(" ")
|
|
1619
|
+
} : {};
|
|
1620
|
+
const shouldMarkInvalid = isError === true || errorIds.length > 0;
|
|
1621
|
+
const ariaInvalidFromProps = restInputProps["aria-invalid"];
|
|
1622
|
+
const ariaInvalidValue = ariaInvalidFromProps != null ? ariaInvalidFromProps : shouldMarkInvalid ? true : null;
|
|
1623
|
+
const ariaInvalidProps = ariaInvalidValue == null ? {} : { "aria-invalid": ariaInvalidValue };
|
|
1624
|
+
const mergedInputProps = {
|
|
1625
|
+
...restInputProps,
|
|
1626
|
+
...describedByProps,
|
|
1627
|
+
...ariaInvalidProps,
|
|
1628
|
+
disabled
|
|
1629
|
+
};
|
|
1630
|
+
const isShowClearButton = !!onClickClearButton && restInputProps.value.length !== 0 && !disabled;
|
|
1631
|
+
const hasTrailingElement = isShowClearButton || after != null;
|
|
1632
|
+
const inputWrapClasses = clsx22("relative flex items-center gap-2 overflow-hidden rounded border", {
|
|
1633
|
+
"border-uiBorder02": !isError && !disabled,
|
|
1634
|
+
"border-supportError": isError && !disabled,
|
|
1635
|
+
"hover:border-hoverInput": !disabled && !isError,
|
|
1636
|
+
"hover:focus-within:border-activeInput": !isError,
|
|
1637
|
+
"focus-within:border-activeInput": !isError,
|
|
1638
|
+
"bg-disabled02 border-disabled01": disabled,
|
|
1639
|
+
"pr-2": size === "medium" && hasTrailingElement,
|
|
1640
|
+
"pr-3": size === "large" && hasTrailingElement
|
|
1641
|
+
});
|
|
1642
|
+
const inputClasses = clsx22("flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
|
|
1643
|
+
["typography-label14regular min-h-8 px-2"]: size === "medium",
|
|
1644
|
+
["typography-label16regular min-h-10 px-3"]: size === "large",
|
|
1645
|
+
"text-text01": !isError,
|
|
1646
|
+
"text-supportError": isError,
|
|
1647
|
+
"pr-0": hasTrailingElement
|
|
1648
|
+
});
|
|
1649
|
+
const inputElement = /* @__PURE__ */ jsxs15("div", { className: inputWrapClasses, children: [
|
|
1650
|
+
/* @__PURE__ */ jsx28("input", { ref, size: 1, className: inputClasses, ...mergedInputProps }),
|
|
1651
|
+
after,
|
|
1652
|
+
isShowClearButton && /* @__PURE__ */ jsx28(IconButton, { variant: "text", icon: "close", size: "small", onClick: onClickClearButton })
|
|
1653
|
+
] });
|
|
1654
|
+
const stackedChildren = enhancedChildren == null ? [] : Children.toArray(enhancedChildren);
|
|
1655
|
+
const hasMessageChildren = stackedChildren.length > 0;
|
|
1656
|
+
if (!hasMessageChildren) {
|
|
1657
|
+
return /* @__PURE__ */ jsx28(TextInputCompoundContext.Provider, { value: contextValue, children: inputElement });
|
|
1658
|
+
}
|
|
1659
|
+
return /* @__PURE__ */ jsx28(TextInputCompoundContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-2", children: [
|
|
1660
|
+
inputElement,
|
|
1661
|
+
stackedChildren
|
|
1662
|
+
] }) });
|
|
1663
|
+
}
|
|
1664
|
+
var attachStatics = (component) => {
|
|
1665
|
+
component.HelperMessage = TextInputHelperMessage;
|
|
1666
|
+
component.ErrorMessage = TextInputErrorMessage;
|
|
1667
|
+
component.displayName = "TextInput";
|
|
1668
|
+
return component;
|
|
1669
|
+
};
|
|
1670
|
+
var TextInputPublic = forwardRef5(function TextInputPublic2(props, ref) {
|
|
1671
|
+
return TextInputInner(props, ref);
|
|
1672
|
+
});
|
|
1673
|
+
var InternalTextInputBase = forwardRef5(
|
|
1674
|
+
function InternalTextInputBase2(props, ref) {
|
|
1675
|
+
return TextInputInner(props, ref);
|
|
1224
1676
|
}
|
|
1225
1677
|
);
|
|
1226
|
-
TextInput
|
|
1678
|
+
var TextInput = attachStatics(TextInputPublic);
|
|
1679
|
+
var InternalTextInput = attachStatics(InternalTextInputBase);
|
|
1227
1680
|
|
|
1228
1681
|
// src/password-input/password-input.tsx
|
|
1229
|
-
import { jsx as
|
|
1230
|
-
var
|
|
1231
|
-
const [isPasswordVisible, setIsPasswordVisible] =
|
|
1682
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1683
|
+
var PasswordInputBase = forwardRef6(function PasswordInput({ disabled = false, children, ...props }, ref) {
|
|
1684
|
+
const [isPasswordVisible, setIsPasswordVisible] = useState8(false);
|
|
1685
|
+
const { className: _className, ...textInputProps } = props;
|
|
1232
1686
|
const handlePasswordVisibilityToggle = () => {
|
|
1233
|
-
setIsPasswordVisible(!
|
|
1687
|
+
setIsPasswordVisible((prev) => !prev);
|
|
1234
1688
|
};
|
|
1235
|
-
const passwordToggleButton = /* @__PURE__ */
|
|
1689
|
+
const passwordToggleButton = /* @__PURE__ */ jsx29(
|
|
1236
1690
|
IconButton,
|
|
1237
1691
|
{
|
|
1238
1692
|
variant: "text",
|
|
@@ -1243,41 +1697,303 @@ var PasswordInput = forwardRef3(({ disabled = false, ...props }, ref) => {
|
|
|
1243
1697
|
"aria-label": isPasswordVisible === true ? "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u975E\u8868\u793A\u306B\u3059\u308B" : "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8868\u793A\u3059\u308B"
|
|
1244
1698
|
}
|
|
1245
1699
|
);
|
|
1246
|
-
return /* @__PURE__ */
|
|
1247
|
-
|
|
1700
|
+
return /* @__PURE__ */ jsx29(
|
|
1701
|
+
InternalTextInput,
|
|
1248
1702
|
{
|
|
1249
1703
|
ref,
|
|
1250
1704
|
type: isPasswordVisible === true ? "text" : "password",
|
|
1251
1705
|
disabled,
|
|
1252
|
-
|
|
1253
|
-
...
|
|
1706
|
+
after: passwordToggleButton,
|
|
1707
|
+
...textInputProps,
|
|
1708
|
+
children
|
|
1709
|
+
}
|
|
1710
|
+
);
|
|
1711
|
+
});
|
|
1712
|
+
var PasswordInput2 = Object.assign(PasswordInputBase, {
|
|
1713
|
+
HelperMessage: TextInputHelperMessage,
|
|
1714
|
+
ErrorMessage: TextInputErrorMessage,
|
|
1715
|
+
displayName: "PasswordInput"
|
|
1716
|
+
});
|
|
1717
|
+
|
|
1718
|
+
// src/popover/popover.tsx
|
|
1719
|
+
import { autoUpdate as autoUpdate2, offset as offset2, useFloating as useFloating2, useId as useFloatingId } from "@floating-ui/react";
|
|
1720
|
+
import { useEffect as useEffect4, useMemo as useMemo2, useRef as useRef4 } from "react";
|
|
1721
|
+
|
|
1722
|
+
// src/popover/popover-content.tsx
|
|
1723
|
+
import { FloatingPortal as FloatingPortal2, useDismiss, useInteractions, useRole } from "@floating-ui/react";
|
|
1724
|
+
import * as React from "react";
|
|
1725
|
+
import { forwardRef as forwardRef7, useCallback as useCallback6, useEffect as useEffect3 } from "react";
|
|
1726
|
+
|
|
1727
|
+
// src/utils/react-utils.ts
|
|
1728
|
+
function composeRefs(...refs) {
|
|
1729
|
+
return (node) => {
|
|
1730
|
+
for (const ref of refs) {
|
|
1731
|
+
if (ref == null) {
|
|
1732
|
+
continue;
|
|
1733
|
+
}
|
|
1734
|
+
if (typeof ref === "function") {
|
|
1735
|
+
ref(node);
|
|
1736
|
+
} else {
|
|
1737
|
+
ref.current = node;
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
}
|
|
1742
|
+
function isElement(node) {
|
|
1743
|
+
return node != null && typeof node === "object" && "type" in node;
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
// src/popover/popover-context.ts
|
|
1747
|
+
import { createContext as createContext6, useContext as useContext8 } from "react";
|
|
1748
|
+
var PopoverContext = createContext6(null);
|
|
1749
|
+
var usePopoverContext = () => {
|
|
1750
|
+
const context = useContext8(PopoverContext);
|
|
1751
|
+
if (context == null) {
|
|
1752
|
+
throw new Error("Popover components must be used inside <Popover.Root>");
|
|
1753
|
+
}
|
|
1754
|
+
return context;
|
|
1755
|
+
};
|
|
1756
|
+
|
|
1757
|
+
// src/popover/popover-content.tsx
|
|
1758
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1759
|
+
var PopoverContent = forwardRef7(function PopoverContent2({ children }, ref) {
|
|
1760
|
+
const { isOpen, triggerRef, floating, panelId, onClose } = usePopoverContext();
|
|
1761
|
+
const shouldCloseOnOutsidePress = useCallback6(
|
|
1762
|
+
(event) => {
|
|
1763
|
+
const target = event.target;
|
|
1764
|
+
if (!(target instanceof Element)) {
|
|
1765
|
+
return true;
|
|
1766
|
+
}
|
|
1767
|
+
const floatingElement = floating.refs.floating.current;
|
|
1768
|
+
const closestOverlay = target.closest(".z-overlay, .z-dropdown");
|
|
1769
|
+
if (closestOverlay !== null && floatingElement instanceof Element) {
|
|
1770
|
+
const isInsideOwnFloating = floatingElement.contains(closestOverlay);
|
|
1771
|
+
return isInsideOwnFloating;
|
|
1772
|
+
}
|
|
1773
|
+
return true;
|
|
1774
|
+
},
|
|
1775
|
+
[floating.refs.floating]
|
|
1776
|
+
);
|
|
1777
|
+
const dismiss = useDismiss(floating.context, {
|
|
1778
|
+
outsidePressEvent: "pointerdown",
|
|
1779
|
+
outsidePress: shouldCloseOnOutsidePress,
|
|
1780
|
+
escapeKey: false
|
|
1781
|
+
});
|
|
1782
|
+
const interactions = useInteractions([dismiss, useRole(floating.context, { role: "dialog" })]);
|
|
1783
|
+
useEffect3(() => {
|
|
1784
|
+
if (isOpen) {
|
|
1785
|
+
const element = floating.refs.floating.current;
|
|
1786
|
+
element?.focus?.({ preventScroll: true });
|
|
1787
|
+
}
|
|
1788
|
+
}, [isOpen, floating.refs.floating]);
|
|
1789
|
+
useEffect3(() => {
|
|
1790
|
+
if (!isOpen) {
|
|
1791
|
+
triggerRef.current?.focus({ preventScroll: true });
|
|
1792
|
+
}
|
|
1793
|
+
}, [isOpen, triggerRef]);
|
|
1794
|
+
const handleKeyDown = useCallback6(
|
|
1795
|
+
(event) => {
|
|
1796
|
+
if (event.key === "Escape") {
|
|
1797
|
+
event.stopPropagation();
|
|
1798
|
+
if (onClose != null) {
|
|
1799
|
+
onClose({ reason: "escape-key-down" });
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
},
|
|
1803
|
+
[onClose]
|
|
1804
|
+
);
|
|
1805
|
+
let wrappedChildren = children;
|
|
1806
|
+
if (isElement(children)) {
|
|
1807
|
+
const childProps = children.props;
|
|
1808
|
+
wrappedChildren = React.cloneElement(children, {
|
|
1809
|
+
...childProps,
|
|
1810
|
+
...childProps.id == null && { id: panelId },
|
|
1811
|
+
...childProps.role == null && { role: "dialog" }
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
return /* @__PURE__ */ jsx30(FloatingPortal2, { children: isOpen ? /* @__PURE__ */ jsx30(
|
|
1815
|
+
"div",
|
|
1816
|
+
{
|
|
1817
|
+
...interactions.getFloatingProps({
|
|
1818
|
+
ref: composeRefs(floating.refs.setFloating, ref),
|
|
1819
|
+
tabIndex: -1,
|
|
1820
|
+
onKeyDown: handleKeyDown,
|
|
1821
|
+
style: {
|
|
1822
|
+
position: floating.strategy,
|
|
1823
|
+
top: floating.y ?? 0,
|
|
1824
|
+
left: floating.x ?? 0,
|
|
1825
|
+
outline: "0"
|
|
1826
|
+
}
|
|
1827
|
+
}),
|
|
1828
|
+
children: wrappedChildren
|
|
1829
|
+
}
|
|
1830
|
+
) : null });
|
|
1831
|
+
});
|
|
1832
|
+
|
|
1833
|
+
// src/popover/popover-trigger.tsx
|
|
1834
|
+
import * as React2 from "react";
|
|
1835
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
1836
|
+
var PopoverTrigger = forwardRef8(function PopoverTrigger2({ children }, ref) {
|
|
1837
|
+
const { isOpen, floating, triggerRef, anchorRef, panelId } = usePopoverContext();
|
|
1838
|
+
if (!isElement(children)) {
|
|
1839
|
+
return null;
|
|
1840
|
+
}
|
|
1841
|
+
const handleTriggerRef = (node) => {
|
|
1842
|
+
triggerRef.current = node;
|
|
1843
|
+
if (anchorRef == null) {
|
|
1844
|
+
floating.refs.setReference(node);
|
|
1845
|
+
}
|
|
1846
|
+
if (typeof ref === "function") {
|
|
1847
|
+
ref(node);
|
|
1848
|
+
} else if (ref != null) {
|
|
1849
|
+
ref.current = node;
|
|
1254
1850
|
}
|
|
1851
|
+
};
|
|
1852
|
+
const childProps = children.props;
|
|
1853
|
+
const childRef = childProps.ref;
|
|
1854
|
+
return React2.cloneElement(children, {
|
|
1855
|
+
...childProps,
|
|
1856
|
+
ref: composeRefs(childRef, handleTriggerRef),
|
|
1857
|
+
"aria-haspopup": "dialog",
|
|
1858
|
+
"aria-expanded": isOpen,
|
|
1859
|
+
"aria-controls": panelId
|
|
1860
|
+
});
|
|
1861
|
+
});
|
|
1862
|
+
|
|
1863
|
+
// src/popover/popover.tsx
|
|
1864
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1865
|
+
function Popover({
|
|
1866
|
+
isOpen,
|
|
1867
|
+
children,
|
|
1868
|
+
placement = "top",
|
|
1869
|
+
offset: offsetValue = 8,
|
|
1870
|
+
onClose,
|
|
1871
|
+
anchorRef
|
|
1872
|
+
}) {
|
|
1873
|
+
const triggerRef = useRef4(null);
|
|
1874
|
+
const floating = useFloating2({
|
|
1875
|
+
open: isOpen,
|
|
1876
|
+
onOpenChange: (open) => {
|
|
1877
|
+
if (!open && onClose != null) {
|
|
1878
|
+
onClose({ reason: "outside-click" });
|
|
1879
|
+
}
|
|
1880
|
+
},
|
|
1881
|
+
placement,
|
|
1882
|
+
middleware: [offset2(offsetValue)],
|
|
1883
|
+
whileElementsMounted: autoUpdate2,
|
|
1884
|
+
strategy: "fixed"
|
|
1885
|
+
});
|
|
1886
|
+
useEffect4(() => {
|
|
1887
|
+
if (anchorRef?.current) {
|
|
1888
|
+
floating.refs.setReference(anchorRef.current);
|
|
1889
|
+
}
|
|
1890
|
+
}, [anchorRef, floating.refs]);
|
|
1891
|
+
const contentId = useFloatingId() ?? "";
|
|
1892
|
+
const panelId = `${contentId}-panel`;
|
|
1893
|
+
const contextValue = useMemo2(
|
|
1894
|
+
() => ({
|
|
1895
|
+
isOpen,
|
|
1896
|
+
triggerRef,
|
|
1897
|
+
anchorRef,
|
|
1898
|
+
floating,
|
|
1899
|
+
contentId,
|
|
1900
|
+
panelId,
|
|
1901
|
+
onClose
|
|
1902
|
+
}),
|
|
1903
|
+
[isOpen, triggerRef, anchorRef, floating, contentId, panelId, onClose]
|
|
1255
1904
|
);
|
|
1905
|
+
return /* @__PURE__ */ jsx31(PopoverContext.Provider, { value: contextValue, children });
|
|
1906
|
+
}
|
|
1907
|
+
Popover.Trigger = PopoverTrigger;
|
|
1908
|
+
Popover.Content = PopoverContent;
|
|
1909
|
+
|
|
1910
|
+
// src/popup/popup.tsx
|
|
1911
|
+
import { useContext as useContext10 } from "react";
|
|
1912
|
+
|
|
1913
|
+
// src/popup/popup-body.tsx
|
|
1914
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1915
|
+
function PopupBody({ children }) {
|
|
1916
|
+
return /* @__PURE__ */ jsx32("div", { className: "overflow-y-auto", children });
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
// src/popup/popup-context.ts
|
|
1920
|
+
import { createContext as createContext7 } from "react";
|
|
1921
|
+
var PopupContext = createContext7({
|
|
1922
|
+
isOpen: false,
|
|
1923
|
+
onClose: () => null
|
|
1256
1924
|
});
|
|
1257
|
-
|
|
1925
|
+
|
|
1926
|
+
// src/popup/popup-footer.tsx
|
|
1927
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1928
|
+
function PopupFooter({ children }) {
|
|
1929
|
+
return /* @__PURE__ */ jsx33("div", { className: "flex w-full shrink-0 items-center rounded-b-lg px-6 py-3", children });
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
// src/popup/popup-header.tsx
|
|
1933
|
+
import { useContext as useContext9 } from "react";
|
|
1934
|
+
import { jsx as jsx34, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1935
|
+
function PopupHeader({ children, before }) {
|
|
1936
|
+
const { onClose } = useContext9(PopupContext);
|
|
1937
|
+
return /* @__PURE__ */ jsxs16("div", { className: "typography-h5 flex h-12 w-full shrink-0 items-start justify-between rounded-t-lg px-6 pt-3 text-text01", children: [
|
|
1938
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1", children: [
|
|
1939
|
+
before,
|
|
1940
|
+
children
|
|
1941
|
+
] }),
|
|
1942
|
+
onClose && /* @__PURE__ */ jsx34(IconButton, { icon: "close", size: "small", variant: "text", onClick: onClose })
|
|
1943
|
+
] });
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
// src/popup/popup.tsx
|
|
1947
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1948
|
+
var LIMIT_WIDTH2 = 320;
|
|
1949
|
+
var LIMIT_HEIGHT2 = 184;
|
|
1950
|
+
function useOptionalPopoverContext() {
|
|
1951
|
+
return useContext10(PopoverContext);
|
|
1952
|
+
}
|
|
1953
|
+
function Popup({ children, isOpen: controlledIsOpen, width = 480, height, onClose }) {
|
|
1954
|
+
const renderWidth = typeof width === "number" ? Math.max(width, LIMIT_WIDTH2) : width;
|
|
1955
|
+
const renderHeight = typeof height === "number" ? Math.max(height, LIMIT_HEIGHT2) : height;
|
|
1956
|
+
const popoverContext = useOptionalPopoverContext();
|
|
1957
|
+
const isInPopover = popoverContext != null;
|
|
1958
|
+
const isOpen = isInPopover ? popoverContext.isOpen : controlledIsOpen ?? false;
|
|
1959
|
+
if (!isOpen) {
|
|
1960
|
+
return null;
|
|
1961
|
+
}
|
|
1962
|
+
return /* @__PURE__ */ jsx35(PopupContext.Provider, { value: { isOpen, onClose }, children: /* @__PURE__ */ jsx35(
|
|
1963
|
+
"div",
|
|
1964
|
+
{
|
|
1965
|
+
className: "grid max-h-full grid-rows-[max-content_1fr_max-content] flex-col rounded-lg bg-uiBackground01 shadow-floatingShadow",
|
|
1966
|
+
style: { width: renderWidth, height: renderHeight },
|
|
1967
|
+
children
|
|
1968
|
+
}
|
|
1969
|
+
) });
|
|
1970
|
+
}
|
|
1971
|
+
Popup.Body = PopupBody;
|
|
1972
|
+
Popup.Header = PopupHeader;
|
|
1973
|
+
Popup.Footer = PopupFooter;
|
|
1258
1974
|
|
|
1259
1975
|
// src/radio/radio.tsx
|
|
1260
1976
|
import { focusVisible as focusVisible10 } from "@zenkigen-inc/component-theme";
|
|
1261
|
-
import
|
|
1262
|
-
import { useCallback as
|
|
1263
|
-
import { jsx as
|
|
1977
|
+
import clsx23 from "clsx";
|
|
1978
|
+
import { useCallback as useCallback7, useState as useState9 } from "react";
|
|
1979
|
+
import { jsx as jsx36, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1264
1980
|
function Radio({ name, value, id, label, isChecked = false, isDisabled = false, onChange }) {
|
|
1265
|
-
const [isMouseOver, setIsMouseOver] =
|
|
1266
|
-
const handleMouseOverInput =
|
|
1981
|
+
const [isMouseOver, setIsMouseOver] = useState9(false);
|
|
1982
|
+
const handleMouseOverInput = useCallback7(() => {
|
|
1267
1983
|
setIsMouseOver(true);
|
|
1268
1984
|
}, []);
|
|
1269
|
-
const handleMouseOutInput =
|
|
1985
|
+
const handleMouseOutInput = useCallback7(() => {
|
|
1270
1986
|
setIsMouseOver(false);
|
|
1271
1987
|
}, []);
|
|
1272
|
-
const handleChange =
|
|
1988
|
+
const handleChange = useCallback7(
|
|
1273
1989
|
(e) => !isDisabled && onChange?.(e),
|
|
1274
1990
|
[isDisabled, onChange]
|
|
1275
1991
|
);
|
|
1276
|
-
const inputClasses =
|
|
1992
|
+
const inputClasses = clsx23("peer absolute z-[1] size-6 opacity-0", {
|
|
1277
1993
|
"cursor-not-allowed": isDisabled,
|
|
1278
1994
|
"cursor-pointer": !isDisabled
|
|
1279
1995
|
});
|
|
1280
|
-
const boxClasses =
|
|
1996
|
+
const boxClasses = clsx23(
|
|
1281
1997
|
"inline-flex size-5 items-center justify-center rounded-full border border-solid bg-white",
|
|
1282
1998
|
focusVisible10.normalPeer,
|
|
1283
1999
|
{
|
|
@@ -1288,22 +2004,22 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
1288
2004
|
"cursor-pointer": !isDisabled
|
|
1289
2005
|
}
|
|
1290
2006
|
);
|
|
1291
|
-
const afterClasses =
|
|
2007
|
+
const afterClasses = clsx23("absolute inset-0 m-auto block size-3 rounded-full", {
|
|
1292
2008
|
"bg-disabled01": isDisabled && isChecked,
|
|
1293
2009
|
"bg-activeSelectedUi": !isDisabled && isChecked,
|
|
1294
2010
|
"scale-0": !isChecked,
|
|
1295
2011
|
"scale-100": isChecked
|
|
1296
2012
|
});
|
|
1297
|
-
const hoverIndicatorClasses =
|
|
2013
|
+
const hoverIndicatorClasses = clsx23("inline-block size-3 rounded-full", {
|
|
1298
2014
|
"bg-hoverUi": !isDisabled && !isChecked && isMouseOver
|
|
1299
2015
|
});
|
|
1300
|
-
const labelClasses =
|
|
2016
|
+
const labelClasses = clsx23("typography-label14regular ml-2 flex-[1_0_0] select-none break-all", {
|
|
1301
2017
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
1302
2018
|
"cursor-pointer text-text01": !isDisabled
|
|
1303
2019
|
});
|
|
1304
|
-
return /* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
2020
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex items-center", children: [
|
|
2021
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex size-6 items-center justify-center", children: [
|
|
2022
|
+
/* @__PURE__ */ jsx36(
|
|
1307
2023
|
"input",
|
|
1308
2024
|
{
|
|
1309
2025
|
type: "checkbox",
|
|
@@ -1318,32 +2034,32 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
1318
2034
|
className: inputClasses
|
|
1319
2035
|
}
|
|
1320
2036
|
),
|
|
1321
|
-
/* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
2037
|
+
/* @__PURE__ */ jsx36("div", { className: boxClasses, children: /* @__PURE__ */ jsxs17("div", { className: "relative flex size-5 flex-[0_0_auto] items-center justify-center", children: [
|
|
2038
|
+
/* @__PURE__ */ jsx36("span", { className: afterClasses }),
|
|
2039
|
+
/* @__PURE__ */ jsx36("span", { className: hoverIndicatorClasses })
|
|
1324
2040
|
] }) })
|
|
1325
2041
|
] }),
|
|
1326
|
-
/* @__PURE__ */
|
|
2042
|
+
/* @__PURE__ */ jsx36("label", { htmlFor: id, className: labelClasses, children: label })
|
|
1327
2043
|
] });
|
|
1328
2044
|
}
|
|
1329
2045
|
|
|
1330
2046
|
// src/search/search.tsx
|
|
1331
|
-
import { clsx as
|
|
1332
|
-
import { forwardRef as
|
|
1333
|
-
import { jsx as
|
|
1334
|
-
var Search =
|
|
1335
|
-
const classes =
|
|
2047
|
+
import { clsx as clsx24 } from "clsx";
|
|
2048
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
2049
|
+
import { jsx as jsx37, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2050
|
+
var Search = forwardRef9(({ width = "100%", size = "medium", ...props }, ref) => {
|
|
2051
|
+
const classes = clsx24(
|
|
1336
2052
|
"flex items-center rounded-full border border-uiBorder02 bg-uiBackground01 focus-within:border-activeInput",
|
|
1337
2053
|
{ "h-8 px-3": size === "medium" },
|
|
1338
2054
|
{ "h-10 px-4": size === "large" }
|
|
1339
2055
|
);
|
|
1340
|
-
const inputClasses =
|
|
2056
|
+
const inputClasses = clsx24("mx-2 h-full flex-1 text-text01 outline-0 placeholder:text-textPlaceholder", {
|
|
1341
2057
|
["typography-label14regular"]: size === "medium",
|
|
1342
2058
|
["typography-label16regular"]: size === "large"
|
|
1343
2059
|
});
|
|
1344
|
-
return /* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ jsx37("div", { className: "relative", ref, children: /* @__PURE__ */ jsx37("form", { onSubmit: props.onSubmit, children: /* @__PURE__ */ jsxs18("div", { className: classes, style: { width }, children: [
|
|
2061
|
+
/* @__PURE__ */ jsx37(Icon, { name: "search", color: "icon01", size: "medium" }),
|
|
2062
|
+
/* @__PURE__ */ jsx37(
|
|
1347
2063
|
"input",
|
|
1348
2064
|
{
|
|
1349
2065
|
type: "text",
|
|
@@ -1354,7 +2070,7 @@ var Search = forwardRef4(({ width = "100%", size = "medium", ...props }, ref) =>
|
|
|
1354
2070
|
onChange: props.onChange
|
|
1355
2071
|
}
|
|
1356
2072
|
),
|
|
1357
|
-
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */
|
|
2073
|
+
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */ jsx37(
|
|
1358
2074
|
IconButton,
|
|
1359
2075
|
{
|
|
1360
2076
|
variant: "text",
|
|
@@ -1369,17 +2085,17 @@ var Search = forwardRef4(({ width = "100%", size = "medium", ...props }, ref) =>
|
|
|
1369
2085
|
Search.displayName = "Search";
|
|
1370
2086
|
|
|
1371
2087
|
// src/segmented-control/segmented-control.tsx
|
|
1372
|
-
import
|
|
2088
|
+
import React4, { Children as Children2, useRef as useRef6 } from "react";
|
|
1373
2089
|
|
|
1374
2090
|
// src/segmented-control/segmented-control-context.ts
|
|
1375
|
-
import { createContext as
|
|
1376
|
-
var SegmentedControlContext =
|
|
2091
|
+
import { createContext as createContext8 } from "react";
|
|
2092
|
+
var SegmentedControlContext = createContext8(null);
|
|
1377
2093
|
|
|
1378
2094
|
// src/segmented-control/segmented-control-item.tsx
|
|
1379
2095
|
import { focusVisible as focusVisible11 } from "@zenkigen-inc/component-theme";
|
|
1380
|
-
import { clsx as
|
|
1381
|
-
import { useContext as
|
|
1382
|
-
import { jsx as
|
|
2096
|
+
import { clsx as clsx25 } from "clsx";
|
|
2097
|
+
import { useContext as useContext11, useEffect as useEffect5, useRef as useRef5 } from "react";
|
|
2098
|
+
import { jsx as jsx38, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1383
2099
|
var SegmentedControlItem = ({
|
|
1384
2100
|
label,
|
|
1385
2101
|
value,
|
|
@@ -1388,9 +2104,9 @@ var SegmentedControlItem = ({
|
|
|
1388
2104
|
"aria-label": ariaLabel,
|
|
1389
2105
|
...rest
|
|
1390
2106
|
}) => {
|
|
1391
|
-
const context =
|
|
1392
|
-
const buttonRef =
|
|
1393
|
-
const lastInteractionWasMouse =
|
|
2107
|
+
const context = useContext11(SegmentedControlContext);
|
|
2108
|
+
const buttonRef = useRef5(null);
|
|
2109
|
+
const lastInteractionWasMouse = useRef5(false);
|
|
1394
2110
|
if (context === null) {
|
|
1395
2111
|
throw new Error("SegmentedControl.Item must be used within SegmentedControl");
|
|
1396
2112
|
}
|
|
@@ -1406,7 +2122,7 @@ var SegmentedControlItem = ({
|
|
|
1406
2122
|
const isSelected = value === selectedValue;
|
|
1407
2123
|
const isFocused = value === focusedValue;
|
|
1408
2124
|
const isOptionDisabled = isContextDisabled || itemDisabled === true;
|
|
1409
|
-
|
|
2125
|
+
useEffect5(() => {
|
|
1410
2126
|
if (isFocused === true && buttonRef.current !== null) {
|
|
1411
2127
|
buttonRef.current.focus();
|
|
1412
2128
|
}
|
|
@@ -1428,7 +2144,7 @@ var SegmentedControlItem = ({
|
|
|
1428
2144
|
lastInteractionWasMouse.current = false;
|
|
1429
2145
|
onBlur?.();
|
|
1430
2146
|
};
|
|
1431
|
-
const buttonClasses =
|
|
2147
|
+
const buttonClasses = clsx25("relative flex items-center justify-center gap-1 rounded", focusVisible11.normal, {
|
|
1432
2148
|
"px-2 min-h-[24px] typography-label12regular": size === "small",
|
|
1433
2149
|
"px-4 min-h-[32px] typography-label14regular": size === "medium",
|
|
1434
2150
|
// States - Default with hover
|
|
@@ -1438,7 +2154,7 @@ var SegmentedControlItem = ({
|
|
|
1438
2154
|
// States - Disabled
|
|
1439
2155
|
"text-disabled01 bg-transparent": isOptionDisabled === true
|
|
1440
2156
|
});
|
|
1441
|
-
return /* @__PURE__ */
|
|
2157
|
+
return /* @__PURE__ */ jsxs19(
|
|
1442
2158
|
"button",
|
|
1443
2159
|
{
|
|
1444
2160
|
ref: buttonRef,
|
|
@@ -1455,25 +2171,25 @@ var SegmentedControlItem = ({
|
|
|
1455
2171
|
onMouseDown: handleMouseDown,
|
|
1456
2172
|
...rest,
|
|
1457
2173
|
children: [
|
|
1458
|
-
Boolean(icon) === true && icon && /* @__PURE__ */
|
|
2174
|
+
Boolean(icon) === true && icon && /* @__PURE__ */ jsx38(
|
|
1459
2175
|
"span",
|
|
1460
2176
|
{
|
|
1461
|
-
className:
|
|
2177
|
+
className: clsx25("flex items-center", {
|
|
1462
2178
|
"fill-disabled01": isOptionDisabled === true,
|
|
1463
2179
|
"fill-interactive01": isSelected === true && isOptionDisabled === false,
|
|
1464
2180
|
"fill-icon01": isSelected === false && isOptionDisabled === false
|
|
1465
2181
|
}),
|
|
1466
|
-
children: /* @__PURE__ */
|
|
2182
|
+
children: /* @__PURE__ */ jsx38(Icon, { name: icon, size: "small" })
|
|
1467
2183
|
}
|
|
1468
2184
|
),
|
|
1469
|
-
Boolean(label) === true && /* @__PURE__ */
|
|
2185
|
+
Boolean(label) === true && /* @__PURE__ */ jsx38("span", { className: "whitespace-nowrap", children: label })
|
|
1470
2186
|
]
|
|
1471
2187
|
}
|
|
1472
2188
|
);
|
|
1473
2189
|
};
|
|
1474
2190
|
|
|
1475
2191
|
// src/segmented-control/segmented-control.tsx
|
|
1476
|
-
import { Fragment as
|
|
2192
|
+
import { Fragment as Fragment5, jsx as jsx39 } from "react/jsx-runtime";
|
|
1477
2193
|
var SegmentedControl = ({
|
|
1478
2194
|
children,
|
|
1479
2195
|
value,
|
|
@@ -1483,15 +2199,15 @@ var SegmentedControl = ({
|
|
|
1483
2199
|
"aria-label": ariaLabel,
|
|
1484
2200
|
...rest
|
|
1485
2201
|
}) => {
|
|
1486
|
-
const containerRef =
|
|
1487
|
-
const itemIds =
|
|
1488
|
-
if (!
|
|
2202
|
+
const containerRef = useRef6(null);
|
|
2203
|
+
const itemIds = Children2.toArray(children).filter((child) => {
|
|
2204
|
+
if (!React4.isValidElement(child) || typeof child.props !== "object" || child.props === null || !("value" in child.props)) {
|
|
1489
2205
|
return false;
|
|
1490
2206
|
}
|
|
1491
2207
|
const props = child.props;
|
|
1492
2208
|
return props.isDisabled !== true;
|
|
1493
2209
|
}).map((child) => child.props.value);
|
|
1494
|
-
const childrenCount =
|
|
2210
|
+
const childrenCount = Children2.count(children);
|
|
1495
2211
|
const containerStyle = { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` };
|
|
1496
2212
|
const {
|
|
1497
2213
|
focusedValue,
|
|
@@ -1518,7 +2234,7 @@ var SegmentedControl = ({
|
|
|
1518
2234
|
onBlur: handleBlurRovingFocus,
|
|
1519
2235
|
values: itemIds
|
|
1520
2236
|
};
|
|
1521
|
-
return /* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ jsx39(Fragment5, { children: /* @__PURE__ */ jsx39(SegmentedControlContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx39(
|
|
1522
2238
|
"div",
|
|
1523
2239
|
{
|
|
1524
2240
|
ref: containerRef,
|
|
@@ -1536,19 +2252,19 @@ SegmentedControl.Item = SegmentedControlItem;
|
|
|
1536
2252
|
|
|
1537
2253
|
// src/select-sort/select-sort.tsx
|
|
1538
2254
|
import { buttonColors as buttonColors4, focusVisible as focusVisible14 } from "@zenkigen-inc/component-theme";
|
|
1539
|
-
import
|
|
1540
|
-
import { useCallback as
|
|
2255
|
+
import clsx28 from "clsx";
|
|
2256
|
+
import { useCallback as useCallback8, useRef as useRef7, useState as useState10 } from "react";
|
|
1541
2257
|
|
|
1542
2258
|
// src/select-sort/select-list.tsx
|
|
1543
2259
|
import { focusVisible as focusVisible13 } from "@zenkigen-inc/component-theme";
|
|
1544
|
-
import
|
|
2260
|
+
import clsx27 from "clsx";
|
|
1545
2261
|
|
|
1546
2262
|
// src/select-sort/select-item.tsx
|
|
1547
2263
|
import { focusVisible as focusVisible12 } from "@zenkigen-inc/component-theme";
|
|
1548
|
-
import
|
|
1549
|
-
import { jsx as
|
|
2264
|
+
import clsx26 from "clsx";
|
|
2265
|
+
import { jsx as jsx40, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1550
2266
|
function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
1551
|
-
const itemClasses =
|
|
2267
|
+
const itemClasses = clsx26(
|
|
1552
2268
|
"typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
1553
2269
|
focusVisible12.inset,
|
|
1554
2270
|
{
|
|
@@ -1556,16 +2272,16 @@ function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
|
1556
2272
|
"bg-uiBackground01 fill-icon01 text-interactive02": !isSortKey
|
|
1557
2273
|
}
|
|
1558
2274
|
);
|
|
1559
|
-
return /* @__PURE__ */
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
isSortKey && /* @__PURE__ */
|
|
2275
|
+
return /* @__PURE__ */ jsx40("li", { className: "flex w-full items-center", onClick: onClickItem, children: /* @__PURE__ */ jsxs20("button", { className: itemClasses, type: "button", children: [
|
|
2276
|
+
/* @__PURE__ */ jsx40("span", { className: "ml-1 mr-6", children }),
|
|
2277
|
+
isSortKey && /* @__PURE__ */ jsx40("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx40(Icon, { name: "check", size: "small" }) })
|
|
1562
2278
|
] }) });
|
|
1563
2279
|
}
|
|
1564
2280
|
|
|
1565
2281
|
// src/select-sort/select-list.tsx
|
|
1566
|
-
import { jsx as
|
|
2282
|
+
import { jsx as jsx41, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1567
2283
|
function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect }) {
|
|
1568
|
-
const listClasses =
|
|
2284
|
+
const listClasses = clsx27(
|
|
1569
2285
|
"absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow",
|
|
1570
2286
|
{
|
|
1571
2287
|
"top-7": size === "x-small" || size === "small",
|
|
@@ -1574,19 +2290,19 @@ function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect })
|
|
|
1574
2290
|
"border-solid border border-uiBorder01": variant === "outline"
|
|
1575
2291
|
}
|
|
1576
2292
|
);
|
|
1577
|
-
const deselectButtonClasses =
|
|
2293
|
+
const deselectButtonClasses = clsx27(
|
|
1578
2294
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
1579
2295
|
focusVisible13.inset
|
|
1580
2296
|
);
|
|
1581
|
-
return /* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
/* @__PURE__ */
|
|
1584
|
-
sortOrder !== null && onClickDeselect && /* @__PURE__ */
|
|
2297
|
+
return /* @__PURE__ */ jsxs21("ul", { className: listClasses, children: [
|
|
2298
|
+
/* @__PURE__ */ jsx41(SelectItem2, { isSortKey: sortOrder === "ascend", onClickItem: () => onClickItem("ascend"), children: "\u6607\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
2299
|
+
/* @__PURE__ */ jsx41(SelectItem2, { isSortKey: sortOrder === "descend", onClickItem: () => onClickItem("descend"), children: "\u964D\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
2300
|
+
sortOrder !== null && onClickDeselect && /* @__PURE__ */ jsx41("li", { children: /* @__PURE__ */ jsx41("button", { className: deselectButtonClasses, type: "button", onClick: onClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
|
|
1585
2301
|
] });
|
|
1586
2302
|
}
|
|
1587
2303
|
|
|
1588
2304
|
// src/select-sort/select-sort.tsx
|
|
1589
|
-
import { jsx as
|
|
2305
|
+
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1590
2306
|
function SelectSort({
|
|
1591
2307
|
size = "medium",
|
|
1592
2308
|
variant = "outline",
|
|
@@ -1598,24 +2314,24 @@ function SelectSort({
|
|
|
1598
2314
|
onChange,
|
|
1599
2315
|
onClickDeselect
|
|
1600
2316
|
}) {
|
|
1601
|
-
const [isOptionListOpen, setIsOptionListOpen] =
|
|
1602
|
-
const targetRef =
|
|
2317
|
+
const [isOptionListOpen, setIsOptionListOpen] = useState10(false);
|
|
2318
|
+
const targetRef = useRef7(null);
|
|
1603
2319
|
useOutsideClick(targetRef, () => setIsOptionListOpen(false));
|
|
1604
2320
|
const handleClickToggle = () => setIsOptionListOpen((prev) => !prev);
|
|
1605
|
-
const handleClickItem =
|
|
2321
|
+
const handleClickItem = useCallback8(
|
|
1606
2322
|
(value) => {
|
|
1607
2323
|
onChange?.(value);
|
|
1608
2324
|
setIsOptionListOpen(false);
|
|
1609
2325
|
},
|
|
1610
2326
|
[onChange]
|
|
1611
2327
|
);
|
|
1612
|
-
const wrapperClasses =
|
|
2328
|
+
const wrapperClasses = clsx28("relative flex shrink-0 items-center gap-1 rounded", {
|
|
1613
2329
|
"h-6": size === "x-small" || size === "small",
|
|
1614
2330
|
"h-8": size === "medium",
|
|
1615
2331
|
"h-10": size === "large",
|
|
1616
2332
|
"cursor-not-allowed": isDisabled
|
|
1617
2333
|
});
|
|
1618
|
-
const buttonClasses =
|
|
2334
|
+
const buttonClasses = clsx28(
|
|
1619
2335
|
"flex size-full items-center rounded",
|
|
1620
2336
|
buttonColors4[variant].hover,
|
|
1621
2337
|
buttonColors4[variant].active,
|
|
@@ -1629,23 +2345,23 @@ function SelectSort({
|
|
|
1629
2345
|
"pointer-events-none": isDisabled
|
|
1630
2346
|
}
|
|
1631
2347
|
);
|
|
1632
|
-
const labelClasses =
|
|
2348
|
+
const labelClasses = clsx28("truncate", {
|
|
1633
2349
|
"typography-label12regular": size === "x-small",
|
|
1634
2350
|
"typography-label14regular": size === "small" || size === "medium",
|
|
1635
2351
|
"typography-label16regular": size === "large",
|
|
1636
2352
|
"mr-1": size === "x-small",
|
|
1637
2353
|
"mr-2": size !== "x-small"
|
|
1638
2354
|
});
|
|
1639
|
-
return /* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
2355
|
+
return /* @__PURE__ */ jsxs22("div", { className: wrapperClasses, style: { width }, ref: targetRef, children: [
|
|
2356
|
+
/* @__PURE__ */ jsxs22("button", { className: buttonClasses, type: "button", onClick: handleClickToggle, disabled: isDisabled, children: [
|
|
2357
|
+
/* @__PURE__ */ jsx42("div", { className: labelClasses, children: label }),
|
|
2358
|
+
/* @__PURE__ */ jsx42("div", { className: "ml-auto flex items-center", children: isSortKey ? /* @__PURE__ */ jsx42(
|
|
1643
2359
|
Icon,
|
|
1644
2360
|
{
|
|
1645
2361
|
name: sortOrder === "ascend" ? "arrow-up" : "arrow-down",
|
|
1646
2362
|
size: size === "large" ? "medium" : "small"
|
|
1647
2363
|
}
|
|
1648
|
-
) : /* @__PURE__ */
|
|
2364
|
+
) : /* @__PURE__ */ jsx42(
|
|
1649
2365
|
Icon,
|
|
1650
2366
|
{
|
|
1651
2367
|
name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
|
|
@@ -1653,7 +2369,7 @@ function SelectSort({
|
|
|
1653
2369
|
}
|
|
1654
2370
|
) })
|
|
1655
2371
|
] }),
|
|
1656
|
-
isOptionListOpen && !isDisabled && /* @__PURE__ */
|
|
2372
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ jsx42(
|
|
1657
2373
|
SelectList2,
|
|
1658
2374
|
{
|
|
1659
2375
|
size,
|
|
@@ -1668,9 +2384,9 @@ function SelectSort({
|
|
|
1668
2384
|
|
|
1669
2385
|
// src/sort-button/sort-button.tsx
|
|
1670
2386
|
import { buttonColors as buttonColors5, focusVisible as focusVisible15 } from "@zenkigen-inc/component-theme";
|
|
1671
|
-
import
|
|
1672
|
-
import { useCallback as
|
|
1673
|
-
import { jsx as
|
|
2387
|
+
import clsx29 from "clsx";
|
|
2388
|
+
import { useCallback as useCallback9 } from "react";
|
|
2389
|
+
import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1674
2390
|
function SortButton({
|
|
1675
2391
|
size = "medium",
|
|
1676
2392
|
width,
|
|
@@ -1681,7 +2397,7 @@ function SortButton({
|
|
|
1681
2397
|
"aria-label": ariaLabel,
|
|
1682
2398
|
...rest
|
|
1683
2399
|
}) {
|
|
1684
|
-
const handleClick =
|
|
2400
|
+
const handleClick = useCallback9(() => {
|
|
1685
2401
|
if (isDisabled || !onClick) return;
|
|
1686
2402
|
onClick();
|
|
1687
2403
|
}, [isDisabled, onClick]);
|
|
@@ -1690,13 +2406,13 @@ function SortButton({
|
|
|
1690
2406
|
if (sortOrder === "descend") return "arrow-down";
|
|
1691
2407
|
return "angle-small-down";
|
|
1692
2408
|
};
|
|
1693
|
-
const wrapperClasses =
|
|
2409
|
+
const wrapperClasses = clsx29("relative flex shrink-0 items-center gap-1 rounded", {
|
|
1694
2410
|
"h-6": size === "x-small" || size === "small",
|
|
1695
2411
|
"h-8": size === "medium",
|
|
1696
2412
|
"h-10": size === "large",
|
|
1697
2413
|
"cursor-not-allowed": isDisabled
|
|
1698
2414
|
});
|
|
1699
|
-
const buttonClasses =
|
|
2415
|
+
const buttonClasses = clsx29(
|
|
1700
2416
|
"flex size-full items-center rounded",
|
|
1701
2417
|
buttonColors5.text.hover,
|
|
1702
2418
|
buttonColors5.text.active,
|
|
@@ -1712,14 +2428,14 @@ function SortButton({
|
|
|
1712
2428
|
"pointer-events-none": isDisabled
|
|
1713
2429
|
}
|
|
1714
2430
|
);
|
|
1715
|
-
const labelClasses =
|
|
2431
|
+
const labelClasses = clsx29("truncate", {
|
|
1716
2432
|
"typography-label12regular": size === "x-small",
|
|
1717
2433
|
"typography-label14regular": size === "small" || size === "medium",
|
|
1718
2434
|
"typography-label16regular": size === "large",
|
|
1719
2435
|
"mr-1": size === "x-small",
|
|
1720
2436
|
"mr-2": size !== "x-small"
|
|
1721
2437
|
});
|
|
1722
|
-
return /* @__PURE__ */
|
|
2438
|
+
return /* @__PURE__ */ jsx43("div", { className: wrapperClasses, style: { width }, children: /* @__PURE__ */ jsxs23(
|
|
1723
2439
|
"button",
|
|
1724
2440
|
{
|
|
1725
2441
|
className: buttonClasses,
|
|
@@ -1730,78 +2446,85 @@ function SortButton({
|
|
|
1730
2446
|
"aria-label": ariaLabel,
|
|
1731
2447
|
"aria-disabled": isDisabled,
|
|
1732
2448
|
children: [
|
|
1733
|
-
/* @__PURE__ */
|
|
1734
|
-
/* @__PURE__ */
|
|
2449
|
+
/* @__PURE__ */ jsx43("div", { className: labelClasses, children: label }),
|
|
2450
|
+
/* @__PURE__ */ jsx43("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx43(Icon, { name: getIconName(), size: size === "large" ? "medium" : "small" }) })
|
|
1735
2451
|
]
|
|
1736
2452
|
}
|
|
1737
2453
|
) });
|
|
1738
2454
|
}
|
|
1739
2455
|
|
|
1740
2456
|
// src/tab/tab.tsx
|
|
1741
|
-
import { clsx as
|
|
1742
|
-
import { Children as
|
|
2457
|
+
import { clsx as clsx31 } from "clsx";
|
|
2458
|
+
import { Children as Children3 } from "react";
|
|
1743
2459
|
|
|
1744
2460
|
// src/tab/tab-item.tsx
|
|
1745
|
-
import { clsx as
|
|
1746
|
-
import { jsx as
|
|
1747
|
-
var TabItem = ({ isSelected = false, ...props }) => {
|
|
1748
|
-
const classes =
|
|
1749
|
-
"relative z-0 flex justify-center py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-
|
|
2461
|
+
import { clsx as clsx30 } from "clsx";
|
|
2462
|
+
import { jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2463
|
+
var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
2464
|
+
const classes = clsx30(
|
|
2465
|
+
"group relative z-0 flex items-center justify-center gap-1 py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-[2px] hover:text-interactive01 disabled:pointer-events-none disabled:text-disabled01",
|
|
1750
2466
|
{
|
|
1751
|
-
"typography-label14regular": !isSelected,
|
|
1752
|
-
"
|
|
1753
|
-
"typography-label14bold": isSelected,
|
|
2467
|
+
"typography-label14regular text-interactive02": !isSelected,
|
|
2468
|
+
"typography-label14bold text-interactive01": isSelected,
|
|
1754
2469
|
"before:bg-interactive01 hover:before:bg-interactive01 pointer-events-none": isSelected
|
|
1755
2470
|
}
|
|
1756
2471
|
);
|
|
1757
|
-
|
|
2472
|
+
const iconWrapperClasses = clsx30("flex shrink-0 items-center", {
|
|
2473
|
+
"fill-disabled01": isDisabled,
|
|
2474
|
+
"fill-interactive01": !isDisabled && isSelected,
|
|
2475
|
+
"fill-icon01 group-hover:fill-interactive01": !isDisabled && !isSelected
|
|
2476
|
+
});
|
|
2477
|
+
return /* @__PURE__ */ jsxs24(
|
|
1758
2478
|
"button",
|
|
1759
2479
|
{
|
|
1760
2480
|
type: "button",
|
|
1761
2481
|
role: "tab",
|
|
1762
2482
|
"aria-selected": isSelected,
|
|
1763
2483
|
className: classes,
|
|
1764
|
-
disabled:
|
|
2484
|
+
disabled: isDisabled,
|
|
1765
2485
|
onClick: () => props.onClick(props.id),
|
|
1766
|
-
children:
|
|
2486
|
+
children: [
|
|
2487
|
+
icon != null && /* @__PURE__ */ jsx44("span", { className: iconWrapperClasses, children: /* @__PURE__ */ jsx44(Icon, { name: icon, size: "small" }) }),
|
|
2488
|
+
props.children
|
|
2489
|
+
]
|
|
1767
2490
|
}
|
|
1768
2491
|
);
|
|
1769
2492
|
};
|
|
1770
2493
|
|
|
1771
2494
|
// src/tab/tab.tsx
|
|
1772
|
-
import { jsx as
|
|
2495
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
1773
2496
|
function Tab({ children, layout = "auto" }) {
|
|
1774
|
-
const childrenCount =
|
|
2497
|
+
const childrenCount = Children3.count(children);
|
|
1775
2498
|
const containerStyle = layout === "equal" ? { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` } : {};
|
|
1776
|
-
const containerClasses =
|
|
2499
|
+
const containerClasses = clsx31(
|
|
1777
2500
|
"relative gap-4 px-6 before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-uiBorder01",
|
|
1778
2501
|
{
|
|
1779
2502
|
flex: layout === "auto",
|
|
1780
2503
|
grid: layout === "equal"
|
|
1781
2504
|
}
|
|
1782
2505
|
);
|
|
1783
|
-
return /* @__PURE__ */
|
|
2506
|
+
return /* @__PURE__ */ jsx45("div", { role: "tablist", className: containerClasses, style: containerStyle, children });
|
|
1784
2507
|
}
|
|
1785
2508
|
Tab.Item = TabItem;
|
|
1786
2509
|
|
|
1787
2510
|
// src/table/table-cell.tsx
|
|
1788
|
-
import
|
|
1789
|
-
import { jsx as
|
|
2511
|
+
import clsx32 from "clsx";
|
|
2512
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
1790
2513
|
function TableCell({ children, className, isHeader = false }) {
|
|
1791
|
-
const classes =
|
|
1792
|
-
return /* @__PURE__ */
|
|
2514
|
+
const classes = clsx32("border-b border-uiBorder01", { "sticky top-0 z-10 bg-white": isHeader }, className);
|
|
2515
|
+
return /* @__PURE__ */ jsx46("div", { className: classes, children });
|
|
1793
2516
|
}
|
|
1794
2517
|
|
|
1795
2518
|
// src/table/table-row.tsx
|
|
1796
|
-
import
|
|
1797
|
-
import { jsx as
|
|
2519
|
+
import clsx33 from "clsx";
|
|
2520
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
1798
2521
|
function TableRow({ children, isHoverBackgroundVisible = false }) {
|
|
1799
|
-
const rowClasses =
|
|
1800
|
-
return /* @__PURE__ */
|
|
2522
|
+
const rowClasses = clsx33("contents", isHoverBackgroundVisible && "[&:hover>div]:bg-hoverUi02");
|
|
2523
|
+
return /* @__PURE__ */ jsx47("div", { className: rowClasses, children });
|
|
1801
2524
|
}
|
|
1802
2525
|
|
|
1803
2526
|
// src/table/table.tsx
|
|
1804
|
-
import { jsx as
|
|
2527
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
1805
2528
|
function Table({
|
|
1806
2529
|
width,
|
|
1807
2530
|
templateRows,
|
|
@@ -1810,7 +2533,7 @@ function Table({
|
|
|
1810
2533
|
autoRows,
|
|
1811
2534
|
children
|
|
1812
2535
|
}) {
|
|
1813
|
-
return /* @__PURE__ */
|
|
2536
|
+
return /* @__PURE__ */ jsx48(
|
|
1814
2537
|
"div",
|
|
1815
2538
|
{
|
|
1816
2539
|
className: "grid",
|
|
@@ -1830,22 +2553,22 @@ Table.Cell = TableCell;
|
|
|
1830
2553
|
|
|
1831
2554
|
// src/tag/tag.tsx
|
|
1832
2555
|
import { tagColors, tagLightColors } from "@zenkigen-inc/component-theme";
|
|
1833
|
-
import
|
|
2556
|
+
import clsx35 from "clsx";
|
|
1834
2557
|
|
|
1835
2558
|
// src/tag/delete-icon.tsx
|
|
1836
2559
|
import { focusVisible as focusVisible16 } from "@zenkigen-inc/component-theme";
|
|
1837
|
-
import
|
|
1838
|
-
import { jsx as
|
|
2560
|
+
import clsx34 from "clsx";
|
|
2561
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
1839
2562
|
var DeleteIcon = ({ color, variant, onClick }) => {
|
|
1840
|
-
const deleteButtonClasses =
|
|
2563
|
+
const deleteButtonClasses = clsx34(
|
|
1841
2564
|
"group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor",
|
|
1842
2565
|
focusVisible16.normal
|
|
1843
2566
|
);
|
|
1844
|
-
const deletePathClasses =
|
|
2567
|
+
const deletePathClasses = clsx34({
|
|
1845
2568
|
"fill-interactive02": color === "gray" || variant === "light",
|
|
1846
2569
|
"group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor": color !== "gray"
|
|
1847
2570
|
});
|
|
1848
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsx49("button", { type: "button", className: deleteButtonClasses, onClick, children: /* @__PURE__ */ jsx49("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx49(
|
|
1849
2572
|
"path",
|
|
1850
2573
|
{
|
|
1851
2574
|
fillRule: "evenodd",
|
|
@@ -1857,9 +2580,9 @@ var DeleteIcon = ({ color, variant, onClick }) => {
|
|
|
1857
2580
|
};
|
|
1858
2581
|
|
|
1859
2582
|
// src/tag/tag.tsx
|
|
1860
|
-
import { jsx as
|
|
2583
|
+
import { jsx as jsx50, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1861
2584
|
function Tag({ id, children, color, variant = "normal", size = "medium", isEditable, onDelete }) {
|
|
1862
|
-
const wrapperClasses =
|
|
2585
|
+
const wrapperClasses = clsx35("flex", "items-center", "justify-center", {
|
|
1863
2586
|
[tagColors[color]]: variant === "normal",
|
|
1864
2587
|
[tagLightColors[color]]: variant === "light",
|
|
1865
2588
|
"h-[14px] typography-label11regular": !isEditable && size === "x-small",
|
|
@@ -1871,65 +2594,177 @@ function Tag({ id, children, color, variant = "normal", size = "medium", isEdita
|
|
|
1871
2594
|
"py-0.5 px-1": !isEditable,
|
|
1872
2595
|
"py-1 px-2": isEditable
|
|
1873
2596
|
});
|
|
1874
|
-
return /* @__PURE__ */
|
|
2597
|
+
return /* @__PURE__ */ jsxs25("div", { className: wrapperClasses, children: [
|
|
1875
2598
|
children,
|
|
1876
|
-
isEditable ? /* @__PURE__ */
|
|
2599
|
+
isEditable ? /* @__PURE__ */ jsx50(DeleteIcon, { onClick: () => onDelete(id), color, variant }) : null
|
|
1877
2600
|
] });
|
|
1878
2601
|
}
|
|
1879
2602
|
|
|
1880
2603
|
// src/text-area/text-area.tsx
|
|
1881
|
-
import { clsx as
|
|
1882
|
-
import { forwardRef as
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
);
|
|
1909
|
-
return /* @__PURE__ */ jsx42("div", { className: "flex", children: /* @__PURE__ */ jsx42(
|
|
1910
|
-
"textarea",
|
|
1911
|
-
{
|
|
1912
|
-
ref,
|
|
1913
|
-
className: classes,
|
|
1914
|
-
disabled,
|
|
1915
|
-
...props,
|
|
1916
|
-
style: {
|
|
1917
|
-
...{ maxHeight },
|
|
1918
|
-
// 自動高さではない場合で、height 指定がある場合は設定する
|
|
1919
|
-
...!autoHeight && height !== null ? { height } : {},
|
|
1920
|
-
// 自動高さの場合で、height が指定されている場合は、height を minHeight に設定する
|
|
1921
|
-
...autoHeight && height !== null ? { minHeight: height } : {}
|
|
1922
|
-
}
|
|
1923
|
-
}
|
|
1924
|
-
) });
|
|
2604
|
+
import { clsx as clsx38 } from "clsx";
|
|
2605
|
+
import { Children as Children4, cloneElement as cloneElement4, forwardRef as forwardRef12, isValidElement as isValidElement2, useId as useId3, useMemo as useMemo3 } from "react";
|
|
2606
|
+
|
|
2607
|
+
// src/text-area/text-area-context.tsx
|
|
2608
|
+
import { createContext as createContext9, useContext as useContext12 } from "react";
|
|
2609
|
+
var TextAreaCompoundContext = createContext9(null);
|
|
2610
|
+
var useTextAreaCompoundContext = (componentName) => {
|
|
2611
|
+
const context = useContext12(TextAreaCompoundContext);
|
|
2612
|
+
if (context == null) {
|
|
2613
|
+
throw new Error(`${componentName} \u3092\u4F7F\u7528\u3059\u308B\u306B\u306F TextArea \u306E\u5B50\u8981\u7D20\u3068\u3057\u3066\u914D\u7F6E\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\u3002`);
|
|
2614
|
+
}
|
|
2615
|
+
return context;
|
|
2616
|
+
};
|
|
2617
|
+
|
|
2618
|
+
// src/text-area/text-area-error-message.tsx
|
|
2619
|
+
import { clsx as clsx36 } from "clsx";
|
|
2620
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
2621
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2622
|
+
var TextAreaErrorMessage = forwardRef10(
|
|
2623
|
+
({ "aria-live": ariaLive = "assertive", ...props }, ref) => {
|
|
2624
|
+
const { textAreaProps } = useTextAreaCompoundContext("TextArea.ErrorMessage");
|
|
2625
|
+
const typographyClass = textAreaProps.size === "large" ? "typography-label12regular" : "typography-label11regular";
|
|
2626
|
+
const shouldRender = textAreaProps.isError === true;
|
|
2627
|
+
if (!shouldRender) {
|
|
2628
|
+
return null;
|
|
2629
|
+
}
|
|
2630
|
+
const errorMessageClassName = clsx36(typographyClass, "text-supportError");
|
|
2631
|
+
return /* @__PURE__ */ jsx51("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
1925
2632
|
}
|
|
1926
2633
|
);
|
|
1927
|
-
|
|
2634
|
+
TextAreaErrorMessage.displayName = "TextArea.ErrorMessage";
|
|
2635
|
+
|
|
2636
|
+
// src/text-area/text-area-helper-message.tsx
|
|
2637
|
+
import { clsx as clsx37 } from "clsx";
|
|
2638
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
2639
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2640
|
+
var TextAreaHelperMessage = forwardRef11((props, ref) => {
|
|
2641
|
+
const { textAreaProps } = useTextAreaCompoundContext("TextArea.HelperMessage");
|
|
2642
|
+
const typographyClass = textAreaProps.size === "large" ? "typography-label12regular" : "typography-label11regular";
|
|
2643
|
+
const helperMessageClassName = clsx37(typographyClass, "text-text02");
|
|
2644
|
+
return /* @__PURE__ */ jsx52("div", { ref, className: helperMessageClassName, ...props });
|
|
2645
|
+
});
|
|
2646
|
+
TextAreaHelperMessage.displayName = "TextArea.HelperMessage";
|
|
2647
|
+
|
|
2648
|
+
// src/text-area/text-area.tsx
|
|
2649
|
+
import { jsx as jsx53, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2650
|
+
function TextAreaInner({
|
|
2651
|
+
size = "medium",
|
|
2652
|
+
isResizable = false,
|
|
2653
|
+
autoHeight = false,
|
|
2654
|
+
maxHeight,
|
|
2655
|
+
isError = false,
|
|
2656
|
+
disabled = false,
|
|
2657
|
+
height,
|
|
2658
|
+
children,
|
|
2659
|
+
...props
|
|
2660
|
+
}, ref) {
|
|
2661
|
+
const autoGeneratedId = useId3();
|
|
2662
|
+
const textAreaPropsForContext = useMemo3(
|
|
2663
|
+
() => ({
|
|
2664
|
+
size,
|
|
2665
|
+
isError
|
|
2666
|
+
}),
|
|
2667
|
+
[size, isError]
|
|
2668
|
+
);
|
|
2669
|
+
const contextValue = useMemo3(
|
|
2670
|
+
() => ({
|
|
2671
|
+
textAreaProps: textAreaPropsForContext,
|
|
2672
|
+
forwardedRef: ref
|
|
2673
|
+
}),
|
|
2674
|
+
[textAreaPropsForContext, ref]
|
|
2675
|
+
);
|
|
2676
|
+
const helperMessageIds = [];
|
|
2677
|
+
const errorIds = [];
|
|
2678
|
+
const describedByBaseId = props.id ?? autoGeneratedId;
|
|
2679
|
+
const enhancedChildren = Children4.map(children, (child) => {
|
|
2680
|
+
if (!isValidElement2(child)) {
|
|
2681
|
+
return child;
|
|
2682
|
+
}
|
|
2683
|
+
if (child.type === TextAreaHelperMessage) {
|
|
2684
|
+
const helperChild = child;
|
|
2685
|
+
const assignedId = helperChild.props.id ?? `${describedByBaseId}-helper-${helperMessageIds.length + 1}`;
|
|
2686
|
+
helperMessageIds.push(assignedId);
|
|
2687
|
+
return cloneElement4(helperChild, { id: assignedId });
|
|
2688
|
+
}
|
|
2689
|
+
if (child.type === TextAreaErrorMessage && isError) {
|
|
2690
|
+
const errorChild = child;
|
|
2691
|
+
const assignedId = errorChild.props.id ?? `${describedByBaseId}-error-${errorIds.length + 1}`;
|
|
2692
|
+
errorIds.push(assignedId);
|
|
2693
|
+
return cloneElement4(errorChild, { id: assignedId });
|
|
2694
|
+
}
|
|
2695
|
+
return child;
|
|
2696
|
+
});
|
|
2697
|
+
const describedByFromProps = typeof props["aria-describedby"] === "string" ? props["aria-describedby"] : null;
|
|
2698
|
+
const describedByList = [describedByFromProps, ...helperMessageIds, ...errorIds].filter(
|
|
2699
|
+
(id) => typeof id === "string" && id.trim().length > 0
|
|
2700
|
+
);
|
|
2701
|
+
const describedByProps = describedByList.length > 0 ? {
|
|
2702
|
+
"aria-describedby": describedByList.join(" ")
|
|
2703
|
+
} : {};
|
|
2704
|
+
const shouldMarkInvalid = isError === true || errorIds.length > 0;
|
|
2705
|
+
const ariaInvalidFromProps = props["aria-invalid"];
|
|
2706
|
+
const ariaInvalidValue = ariaInvalidFromProps != null ? ariaInvalidFromProps : shouldMarkInvalid ? true : null;
|
|
2707
|
+
const ariaInvalidProps = ariaInvalidValue == null ? {} : { "aria-invalid": ariaInvalidValue };
|
|
2708
|
+
const mergedTextAreaProps = {
|
|
2709
|
+
...props,
|
|
2710
|
+
...describedByProps,
|
|
2711
|
+
...ariaInvalidProps
|
|
2712
|
+
};
|
|
2713
|
+
const classes = clsx38(
|
|
2714
|
+
"w-full rounded border outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder",
|
|
2715
|
+
{
|
|
2716
|
+
"border-supportError": isError && !disabled,
|
|
2717
|
+
"hover:border-hoverInput": !disabled && !isError,
|
|
2718
|
+
"border-uiBorder02 hover:focus-within:border-activeInput focus-within:border-activeInput text-text01": !isError,
|
|
2719
|
+
"bg-disabled02 border-disabled01": disabled,
|
|
2720
|
+
"typography-body14regular px-2 pt-2 pb-2": size === "medium",
|
|
2721
|
+
"text-4 leading-normal px-3.5 py-2.5": size === "large",
|
|
2722
|
+
"field-sizing-content": autoHeight,
|
|
2723
|
+
"text-supportError": isError,
|
|
2724
|
+
"resize-none": !isResizable
|
|
2725
|
+
}
|
|
2726
|
+
);
|
|
2727
|
+
const textAreaElement = /* @__PURE__ */ jsx53("div", { className: "flex", children: /* @__PURE__ */ jsx53(
|
|
2728
|
+
"textarea",
|
|
2729
|
+
{
|
|
2730
|
+
ref,
|
|
2731
|
+
className: classes,
|
|
2732
|
+
...mergedTextAreaProps,
|
|
2733
|
+
disabled,
|
|
2734
|
+
style: {
|
|
2735
|
+
...{ maxHeight },
|
|
2736
|
+
// 自動高さではない場合で、height 指定がある場合は設定する
|
|
2737
|
+
...!autoHeight && height !== null ? { height } : {},
|
|
2738
|
+
// 自動高さの場合で、height が指定されている場合は、height を minHeight に設定する
|
|
2739
|
+
...autoHeight && height !== null ? { minHeight: height } : {}
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
) });
|
|
2743
|
+
const stackedChildren = enhancedChildren == null ? [] : Children4.toArray(enhancedChildren);
|
|
2744
|
+
const hasMessageChildren = stackedChildren.length > 0;
|
|
2745
|
+
if (!hasMessageChildren) {
|
|
2746
|
+
return /* @__PURE__ */ jsx53(TextAreaCompoundContext.Provider, { value: contextValue, children: textAreaElement });
|
|
2747
|
+
}
|
|
2748
|
+
return /* @__PURE__ */ jsx53(TextAreaCompoundContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-2", children: [
|
|
2749
|
+
textAreaElement,
|
|
2750
|
+
stackedChildren
|
|
2751
|
+
] }) });
|
|
2752
|
+
}
|
|
2753
|
+
var attachStatics2 = (component) => {
|
|
2754
|
+
component.HelperMessage = TextAreaHelperMessage;
|
|
2755
|
+
component.ErrorMessage = TextAreaErrorMessage;
|
|
2756
|
+
component.displayName = "TextArea";
|
|
2757
|
+
return component;
|
|
2758
|
+
};
|
|
2759
|
+
var TextAreaBase = forwardRef12(function TextAreaBase2(props, ref) {
|
|
2760
|
+
return TextAreaInner(props, ref);
|
|
2761
|
+
});
|
|
2762
|
+
var TextArea = attachStatics2(TextAreaBase);
|
|
1928
2763
|
|
|
1929
2764
|
// src/toast/toast.tsx
|
|
1930
|
-
import
|
|
1931
|
-
import { useCallback as
|
|
1932
|
-
import { jsx as
|
|
2765
|
+
import clsx39 from "clsx";
|
|
2766
|
+
import { useCallback as useCallback10, useEffect as useEffect6, useState as useState11 } from "react";
|
|
2767
|
+
import { jsx as jsx54, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1933
2768
|
var CLOSE_TIME_MSEC = 5e3;
|
|
1934
2769
|
function Toast({
|
|
1935
2770
|
state = "information",
|
|
@@ -1939,8 +2774,8 @@ function Toast({
|
|
|
1939
2774
|
children,
|
|
1940
2775
|
onClickClose
|
|
1941
2776
|
}) {
|
|
1942
|
-
const [isRemoving, setIsRemoving] =
|
|
1943
|
-
const handleClose =
|
|
2777
|
+
const [isRemoving, setIsRemoving] = useState11(false);
|
|
2778
|
+
const handleClose = useCallback10(() => {
|
|
1944
2779
|
if (isAnimation) {
|
|
1945
2780
|
setIsRemoving(true);
|
|
1946
2781
|
} else {
|
|
@@ -1948,17 +2783,17 @@ function Toast({
|
|
|
1948
2783
|
}
|
|
1949
2784
|
}, [isAnimation, onClickClose]);
|
|
1950
2785
|
const handleAnimationEnd = (e) => window.getComputedStyle(e.currentTarget).opacity === "0" && onClickClose();
|
|
1951
|
-
const wrapperClasses =
|
|
2786
|
+
const wrapperClasses = clsx39("pointer-events-auto flex items-start gap-1 bg-white p-4 shadow-floatingShadow", {
|
|
1952
2787
|
["animate-toast-in"]: isAnimation && !isRemoving,
|
|
1953
2788
|
["animate-toast-out opacity-0"]: isAnimation && isRemoving
|
|
1954
2789
|
});
|
|
1955
|
-
const iconClasses =
|
|
2790
|
+
const iconClasses = clsx39("flex items-center", {
|
|
1956
2791
|
"fill-supportSuccess": state === "success",
|
|
1957
2792
|
"fill-supportError": state === "error",
|
|
1958
2793
|
"fill-supportWarning": state === "warning",
|
|
1959
2794
|
"fill-supportInfo": state === "information"
|
|
1960
2795
|
});
|
|
1961
|
-
const textClasses =
|
|
2796
|
+
const textClasses = clsx39("typography-body13regular flex-1 pt-[3px]", {
|
|
1962
2797
|
"text-supportError": state === "error",
|
|
1963
2798
|
"text-text01": state === "success" || state === "warning" || state === "information"
|
|
1964
2799
|
});
|
|
@@ -1968,7 +2803,7 @@ function Toast({
|
|
|
1968
2803
|
warning: "warning",
|
|
1969
2804
|
information: "information-filled"
|
|
1970
2805
|
};
|
|
1971
|
-
|
|
2806
|
+
useEffect6(() => {
|
|
1972
2807
|
const timer = window.setTimeout(() => {
|
|
1973
2808
|
if (isAutoClose) {
|
|
1974
2809
|
setIsRemoving(true);
|
|
@@ -1976,45 +2811,45 @@ function Toast({
|
|
|
1976
2811
|
}, CLOSE_TIME_MSEC);
|
|
1977
2812
|
return () => window.clearTimeout(timer);
|
|
1978
2813
|
}, [isAutoClose]);
|
|
1979
|
-
return /* @__PURE__ */
|
|
1980
|
-
/* @__PURE__ */
|
|
1981
|
-
/* @__PURE__ */
|
|
1982
|
-
/* @__PURE__ */
|
|
2814
|
+
return /* @__PURE__ */ jsxs27("div", { className: wrapperClasses, style: { width }, onAnimationEnd: handleAnimationEnd, children: [
|
|
2815
|
+
/* @__PURE__ */ jsx54("div", { className: iconClasses, children: /* @__PURE__ */ jsx54(Icon, { name: iconName[state] }) }),
|
|
2816
|
+
/* @__PURE__ */ jsx54("p", { className: textClasses, children }),
|
|
2817
|
+
/* @__PURE__ */ jsx54(IconButton, { icon: "close", size: "medium", variant: "text", onClick: handleClose, isNoPadding: true })
|
|
1983
2818
|
] });
|
|
1984
2819
|
}
|
|
1985
2820
|
|
|
1986
2821
|
// src/toast/toast-provider.tsx
|
|
1987
|
-
import { createContext as
|
|
2822
|
+
import { createContext as createContext10, useCallback as useCallback11, useContext as useContext13, useEffect as useEffect7, useState as useState12 } from "react";
|
|
1988
2823
|
import { createPortal as createPortal3 } from "react-dom";
|
|
1989
|
-
import { jsx as
|
|
1990
|
-
var ToastContext =
|
|
2824
|
+
import { jsx as jsx55, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2825
|
+
var ToastContext = createContext10({});
|
|
1991
2826
|
var ToastProvider = ({ children }) => {
|
|
1992
|
-
const [isClientRender, setIsClientRender] =
|
|
1993
|
-
const [toasts, setToasts] =
|
|
1994
|
-
const addToast =
|
|
2827
|
+
const [isClientRender, setIsClientRender] = useState12(false);
|
|
2828
|
+
const [toasts, setToasts] = useState12([]);
|
|
2829
|
+
const addToast = useCallback11(({ message, state }) => {
|
|
1995
2830
|
setToasts((prev) => [...prev, { id: Math.trunc(Math.random() * 1e5), message, state }]);
|
|
1996
2831
|
}, []);
|
|
1997
|
-
const removeToast =
|
|
2832
|
+
const removeToast = useCallback11((id) => {
|
|
1998
2833
|
setToasts((prev) => prev.filter((snackbar) => snackbar.id !== id));
|
|
1999
2834
|
}, []);
|
|
2000
|
-
|
|
2835
|
+
useEffect7(() => {
|
|
2001
2836
|
setIsClientRender(true);
|
|
2002
2837
|
}, []);
|
|
2003
|
-
return /* @__PURE__ */
|
|
2838
|
+
return /* @__PURE__ */ jsxs28(ToastContext.Provider, { value: { addToast, removeToast }, children: [
|
|
2004
2839
|
children,
|
|
2005
2840
|
isClientRender && createPortal3(
|
|
2006
|
-
/* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ jsx55("div", { className: "pointer-events-none fixed bottom-0 left-0 z-toast mb-4 ml-4 flex w-full flex-col-reverse gap-[16px]", children: toasts.map(({ id, message, state }) => /* @__PURE__ */ jsx55(Toast, { state, isAutoClose: true, isAnimation: true, onClickClose: () => removeToast(id), width: 475, children: message }, id)) }),
|
|
2007
2842
|
document.body
|
|
2008
2843
|
)
|
|
2009
2844
|
] });
|
|
2010
2845
|
};
|
|
2011
2846
|
var useToast = () => {
|
|
2012
|
-
return
|
|
2847
|
+
return useContext13(ToastContext);
|
|
2013
2848
|
};
|
|
2014
2849
|
|
|
2015
2850
|
// src/toggle/toggle.tsx
|
|
2016
|
-
import
|
|
2017
|
-
import { jsx as
|
|
2851
|
+
import clsx40 from "clsx";
|
|
2852
|
+
import { jsx as jsx56, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2018
2853
|
function Toggle({
|
|
2019
2854
|
id,
|
|
2020
2855
|
size = "medium",
|
|
@@ -2024,7 +2859,7 @@ function Toggle({
|
|
|
2024
2859
|
labelPosition = "right",
|
|
2025
2860
|
isDisabled = false
|
|
2026
2861
|
}) {
|
|
2027
|
-
const baseClasses =
|
|
2862
|
+
const baseClasses = clsx40("relative flex items-center rounded-full", {
|
|
2028
2863
|
"bg-disabledOn": isDisabled && isChecked,
|
|
2029
2864
|
"bg-disabled01": isDisabled && !isChecked,
|
|
2030
2865
|
"bg-interactive01 peer-hover:bg-hover01": !isDisabled && isChecked,
|
|
@@ -2032,16 +2867,16 @@ function Toggle({
|
|
|
2032
2867
|
"w-8 h-4 px-[3px]": size === "small",
|
|
2033
2868
|
"w-12 h-6 px-1": size === "medium" || size === "large"
|
|
2034
2869
|
});
|
|
2035
|
-
const inputClasses =
|
|
2870
|
+
const inputClasses = clsx40(
|
|
2036
2871
|
"peer absolute inset-0 z-[1] opacity-0",
|
|
2037
2872
|
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2038
2873
|
);
|
|
2039
|
-
const indicatorClasses =
|
|
2874
|
+
const indicatorClasses = clsx40("rounded-full bg-iconOnColor", {
|
|
2040
2875
|
"w-2.5 h-2.5": size === "small",
|
|
2041
2876
|
"w-4 h-4": size === "medium" || size === "large",
|
|
2042
2877
|
"ml-auto": isChecked
|
|
2043
2878
|
});
|
|
2044
|
-
const labelClasses =
|
|
2879
|
+
const labelClasses = clsx40("break-all", {
|
|
2045
2880
|
"mr-2": labelPosition === "left",
|
|
2046
2881
|
"ml-2": labelPosition === "right",
|
|
2047
2882
|
"typography-label14regular": size === "small" || size === "medium",
|
|
@@ -2049,9 +2884,9 @@ function Toggle({
|
|
|
2049
2884
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
2050
2885
|
"cursor-pointer text-text01": !isDisabled
|
|
2051
2886
|
});
|
|
2052
|
-
return /* @__PURE__ */
|
|
2053
|
-
label != null && labelPosition === "left" && /* @__PURE__ */
|
|
2054
|
-
/* @__PURE__ */
|
|
2887
|
+
return /* @__PURE__ */ jsxs29("div", { className: "relative flex flex-[0_0_auto] items-center", children: [
|
|
2888
|
+
label != null && labelPosition === "left" && /* @__PURE__ */ jsx56("label", { htmlFor: id, className: labelClasses, children: label }),
|
|
2889
|
+
/* @__PURE__ */ jsx56(
|
|
2055
2890
|
"input",
|
|
2056
2891
|
{
|
|
2057
2892
|
className: inputClasses,
|
|
@@ -2063,23 +2898,23 @@ function Toggle({
|
|
|
2063
2898
|
disabled: isDisabled
|
|
2064
2899
|
}
|
|
2065
2900
|
),
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
label != null && labelPosition === "right" && /* @__PURE__ */
|
|
2901
|
+
/* @__PURE__ */ jsx56("div", { className: baseClasses, children: /* @__PURE__ */ jsx56("span", { className: indicatorClasses }) }),
|
|
2902
|
+
label != null && labelPosition === "right" && /* @__PURE__ */ jsx56("label", { htmlFor: id, className: labelClasses, children: label })
|
|
2068
2903
|
] });
|
|
2069
2904
|
}
|
|
2070
2905
|
|
|
2071
2906
|
// src/tooltip/tooltip.tsx
|
|
2072
|
-
import { useCallback as
|
|
2907
|
+
import { useCallback as useCallback13, useEffect as useEffect8, useRef as useRef8, useState as useState13 } from "react";
|
|
2073
2908
|
import { createPortal as createPortal4 } from "react-dom";
|
|
2074
2909
|
|
|
2075
2910
|
// src/tooltip/tooltip-content.tsx
|
|
2076
|
-
import
|
|
2911
|
+
import clsx42 from "clsx";
|
|
2077
2912
|
|
|
2078
2913
|
// src/tooltip/tail-icon.tsx
|
|
2079
|
-
import
|
|
2080
|
-
import { jsx as
|
|
2914
|
+
import clsx41 from "clsx";
|
|
2915
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2081
2916
|
var TailIcon = (props) => {
|
|
2082
|
-
const tailClasses =
|
|
2917
|
+
const tailClasses = clsx41("absolute fill-uiBackgroundTooltip", {
|
|
2083
2918
|
"rotate-180": props.verticalPosition === "bottom",
|
|
2084
2919
|
"rotate-0": props.verticalPosition !== "bottom",
|
|
2085
2920
|
"-top-1": props.verticalPosition === "bottom" && props.size === "small",
|
|
@@ -2094,9 +2929,9 @@ var TailIcon = (props) => {
|
|
|
2094
2929
|
"left-1/2 -translate-x-2": props.horizontalAlign === "center" && props.size !== "small"
|
|
2095
2930
|
});
|
|
2096
2931
|
if (props.size === "small") {
|
|
2097
|
-
return /* @__PURE__ */
|
|
2932
|
+
return /* @__PURE__ */ jsx57("svg", { className: tailClasses, width: "8", height: "4", viewBox: "0 0 8 4", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx57("path", { d: "M4 4L0 0H8L4 4Z" }) });
|
|
2098
2933
|
} else {
|
|
2099
|
-
return /* @__PURE__ */
|
|
2934
|
+
return /* @__PURE__ */ jsx57(
|
|
2100
2935
|
"svg",
|
|
2101
2936
|
{
|
|
2102
2937
|
className: tailClasses,
|
|
@@ -2105,14 +2940,14 @@ var TailIcon = (props) => {
|
|
|
2105
2940
|
viewBox: "0 0 14 8",
|
|
2106
2941
|
fill: "none",
|
|
2107
2942
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2108
|
-
children: /* @__PURE__ */
|
|
2943
|
+
children: /* @__PURE__ */ jsx57("path", { d: "M7 8L0 0H14L7 8Z" })
|
|
2109
2944
|
}
|
|
2110
2945
|
);
|
|
2111
2946
|
}
|
|
2112
2947
|
};
|
|
2113
2948
|
|
|
2114
2949
|
// src/tooltip/tooltip-content.tsx
|
|
2115
|
-
import { jsx as
|
|
2950
|
+
import { jsx as jsx58, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2116
2951
|
var TooltipContent = ({
|
|
2117
2952
|
content,
|
|
2118
2953
|
horizontalAlign,
|
|
@@ -2122,7 +2957,7 @@ var TooltipContent = ({
|
|
|
2122
2957
|
maxWidth,
|
|
2123
2958
|
isPortal = false
|
|
2124
2959
|
}) => {
|
|
2125
|
-
const tooltipWrapperClasses =
|
|
2960
|
+
const tooltipWrapperClasses = clsx42("absolute z-tooltip m-auto flex", {
|
|
2126
2961
|
"top-0": !isPortal && verticalPosition === "top",
|
|
2127
2962
|
"bottom-0": !isPortal && verticalPosition === "bottom",
|
|
2128
2963
|
"justify-start": horizontalAlign === "left",
|
|
@@ -2131,7 +2966,7 @@ var TooltipContent = ({
|
|
|
2131
2966
|
"w-[24px]": size === "small",
|
|
2132
2967
|
"w-[46px]": size !== "small"
|
|
2133
2968
|
});
|
|
2134
|
-
const tooltipBodyClasses =
|
|
2969
|
+
const tooltipBodyClasses = clsx42(
|
|
2135
2970
|
"absolute z-tooltip inline-block w-max rounded bg-uiBackgroundTooltip text-textOnColor",
|
|
2136
2971
|
{
|
|
2137
2972
|
"typography-body12regular": size === "small",
|
|
@@ -2148,7 +2983,7 @@ var TooltipContent = ({
|
|
|
2148
2983
|
transform: `translate(${tooltipPosition.translateX}, ${tooltipPosition.translateY})`,
|
|
2149
2984
|
...tooltipPosition
|
|
2150
2985
|
} : {};
|
|
2151
|
-
return /* @__PURE__ */
|
|
2986
|
+
return /* @__PURE__ */ jsx58("div", { className: tooltipWrapperClasses, style: tooltipWrapperStyle, children: /* @__PURE__ */ jsxs30(
|
|
2152
2987
|
"div",
|
|
2153
2988
|
{
|
|
2154
2989
|
className: tooltipBodyClasses,
|
|
@@ -2157,16 +2992,16 @@ var TooltipContent = ({
|
|
|
2157
2992
|
},
|
|
2158
2993
|
children: [
|
|
2159
2994
|
content,
|
|
2160
|
-
/* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ jsx58(TailIcon, { size, verticalPosition, horizontalAlign })
|
|
2161
2996
|
]
|
|
2162
2997
|
}
|
|
2163
2998
|
) });
|
|
2164
2999
|
};
|
|
2165
3000
|
|
|
2166
3001
|
// src/tooltip/tooltip-hook.ts
|
|
2167
|
-
import { useCallback as
|
|
3002
|
+
import { useCallback as useCallback12 } from "react";
|
|
2168
3003
|
var useTooltip = () => {
|
|
2169
|
-
const calculatePosition =
|
|
3004
|
+
const calculatePosition = useCallback12(
|
|
2170
3005
|
(args) => {
|
|
2171
3006
|
const result = {
|
|
2172
3007
|
maxWidth: "none",
|
|
@@ -2218,7 +3053,7 @@ var useTooltip = () => {
|
|
|
2218
3053
|
};
|
|
2219
3054
|
|
|
2220
3055
|
// src/tooltip/tooltip.tsx
|
|
2221
|
-
import { jsx as
|
|
3056
|
+
import { jsx as jsx59, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2222
3057
|
function Tooltip({
|
|
2223
3058
|
children,
|
|
2224
3059
|
content,
|
|
@@ -2230,8 +3065,8 @@ function Tooltip({
|
|
|
2230
3065
|
portalTarget
|
|
2231
3066
|
}) {
|
|
2232
3067
|
const { calculatePosition } = useTooltip();
|
|
2233
|
-
const [isVisible, setIsVisible] =
|
|
2234
|
-
const [tooltipPosition, setTooltipPosition] =
|
|
3068
|
+
const [isVisible, setIsVisible] = useState13(false);
|
|
3069
|
+
const [tooltipPosition, setTooltipPosition] = useState13({
|
|
2235
3070
|
maxWidth: "none",
|
|
2236
3071
|
width: "auto",
|
|
2237
3072
|
left: "0px",
|
|
@@ -2240,23 +3075,23 @@ function Tooltip({
|
|
|
2240
3075
|
translateX: "0",
|
|
2241
3076
|
translateY: "0"
|
|
2242
3077
|
});
|
|
2243
|
-
const targetRef =
|
|
2244
|
-
const handleMouseOverWrapper =
|
|
3078
|
+
const targetRef = useRef8(null);
|
|
3079
|
+
const handleMouseOverWrapper = useCallback13(() => {
|
|
2245
3080
|
if (isDisabledHover) {
|
|
2246
3081
|
return;
|
|
2247
3082
|
}
|
|
2248
3083
|
setIsVisible(true);
|
|
2249
3084
|
}, [isDisabledHover]);
|
|
2250
|
-
const handleMouseOutWrapper =
|
|
3085
|
+
const handleMouseOutWrapper = useCallback13(() => {
|
|
2251
3086
|
setIsVisible(false);
|
|
2252
3087
|
}, []);
|
|
2253
|
-
|
|
3088
|
+
useEffect8(() => {
|
|
2254
3089
|
if (targetRef.current === null) return;
|
|
2255
3090
|
const dimensions = targetRef.current?.getBoundingClientRect();
|
|
2256
3091
|
const position = calculatePosition({ dimensions, maxWidth, verticalPosition, horizontalAlign, tooltipSize: size });
|
|
2257
3092
|
setTooltipPosition(position);
|
|
2258
3093
|
}, [calculatePosition, horizontalAlign, maxWidth, size, verticalPosition]);
|
|
2259
|
-
return /* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ jsxs31(
|
|
2260
3095
|
"div",
|
|
2261
3096
|
{
|
|
2262
3097
|
ref: targetRef,
|
|
@@ -2265,7 +3100,7 @@ function Tooltip({
|
|
|
2265
3100
|
onMouseLeave: handleMouseOutWrapper,
|
|
2266
3101
|
children: [
|
|
2267
3102
|
children,
|
|
2268
|
-
isVisible && (portalTarget == null ? /* @__PURE__ */
|
|
3103
|
+
isVisible && (portalTarget == null ? /* @__PURE__ */ jsx59(
|
|
2269
3104
|
TooltipContent,
|
|
2270
3105
|
{
|
|
2271
3106
|
content,
|
|
@@ -2276,7 +3111,7 @@ function Tooltip({
|
|
|
2276
3111
|
tooltipPosition
|
|
2277
3112
|
}
|
|
2278
3113
|
) : createPortal4(
|
|
2279
|
-
/* @__PURE__ */
|
|
3114
|
+
/* @__PURE__ */ jsx59(
|
|
2280
3115
|
TooltipContent,
|
|
2281
3116
|
{
|
|
2282
3117
|
isPortal: true,
|
|
@@ -2301,6 +3136,7 @@ export {
|
|
|
2301
3136
|
Checkbox,
|
|
2302
3137
|
Dropdown,
|
|
2303
3138
|
EvaluationStar,
|
|
3139
|
+
FileInput,
|
|
2304
3140
|
Heading,
|
|
2305
3141
|
Icon,
|
|
2306
3142
|
IconButton,
|
|
@@ -2309,7 +3145,11 @@ export {
|
|
|
2309
3145
|
NotificationInline,
|
|
2310
3146
|
Pagination,
|
|
2311
3147
|
PaginationSelect,
|
|
2312
|
-
PasswordInput,
|
|
3148
|
+
PasswordInput2 as PasswordInput,
|
|
3149
|
+
Popover,
|
|
3150
|
+
PopoverContent,
|
|
3151
|
+
PopoverTrigger,
|
|
3152
|
+
Popup,
|
|
2313
3153
|
Radio,
|
|
2314
3154
|
Search,
|
|
2315
3155
|
SegmentedControl,
|