@zenkigen-inc/component-ui 1.16.3 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/index.d.mts +231 -48
- package/dist/index.d.ts +231 -48
- package/dist/index.js +1061 -419
- package/dist/index.mjs +1036 -400
- package/package.json +6 -4
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
Checkbox: () => Checkbox,
|
|
37
37
|
Dropdown: () => Dropdown,
|
|
38
38
|
EvaluationStar: () => EvaluationStar,
|
|
39
|
+
FileInput: () => FileInput,
|
|
39
40
|
Heading: () => Heading,
|
|
40
41
|
Icon: () => Icon,
|
|
41
42
|
IconButton: () => IconButton,
|
|
@@ -44,6 +45,11 @@ __export(index_exports, {
|
|
|
44
45
|
NotificationInline: () => NotificationInline,
|
|
45
46
|
Pagination: () => Pagination,
|
|
46
47
|
PaginationSelect: () => PaginationSelect,
|
|
48
|
+
PasswordInput: () => PasswordInput,
|
|
49
|
+
Popover: () => Popover,
|
|
50
|
+
PopoverContent: () => PopoverContent,
|
|
51
|
+
PopoverTrigger: () => PopoverTrigger,
|
|
52
|
+
Popup: () => Popup,
|
|
47
53
|
Radio: () => Radio,
|
|
48
54
|
Search: () => Search,
|
|
49
55
|
SegmentedControl: () => SegmentedControl,
|
|
@@ -94,7 +100,13 @@ var Icon = ({ size = "medium", isDisabled = false, ...props }) => {
|
|
|
94
100
|
},
|
|
95
101
|
props.className
|
|
96
102
|
);
|
|
97
|
-
|
|
103
|
+
const IconComponent = import_component_icons.iconElements[props.name];
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
|
+
IconComponent,
|
|
106
|
+
{
|
|
107
|
+
...isDisabled !== true && typeof props.accentColor === "string" ? { accentClassName: `fill-${String(props.accentColor)}` } : {}
|
|
108
|
+
}
|
|
109
|
+
) }) });
|
|
98
110
|
};
|
|
99
111
|
|
|
100
112
|
// src/avatar/avatar.tsx
|
|
@@ -147,20 +159,21 @@ Breadcrumb.Item = BreadcrumbItem;
|
|
|
147
159
|
var import_component_theme3 = require("@zenkigen-inc/component-theme");
|
|
148
160
|
var import_clsx3 = require("clsx");
|
|
149
161
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
var createButton = (props) => {
|
|
163
|
+
const {
|
|
164
|
+
size = "medium",
|
|
165
|
+
variant = "fill",
|
|
166
|
+
isDisabled,
|
|
167
|
+
isSelected = false,
|
|
168
|
+
width,
|
|
169
|
+
borderRadius,
|
|
170
|
+
justifyContent = "center",
|
|
171
|
+
before,
|
|
172
|
+
after,
|
|
173
|
+
elementAs,
|
|
174
|
+
children,
|
|
175
|
+
...restProps
|
|
176
|
+
} = props;
|
|
164
177
|
const baseClasses = (0, import_clsx3.clsx)(
|
|
165
178
|
"flex shrink-0 items-center gap-1",
|
|
166
179
|
import_component_theme3.buttonColors[variant].hover,
|
|
@@ -174,7 +187,7 @@ var Button = ({
|
|
|
174
187
|
"inline-flex": elementAs === "a",
|
|
175
188
|
[import_component_theme3.buttonColors[variant].selected]: isSelected,
|
|
176
189
|
[import_component_theme3.buttonColors[variant].base]: !isSelected,
|
|
177
|
-
"hover:text-textOnColor active:text-textOnColor [&:hover>*]:fill-iconOnColor [&:active>*]:fill-iconOnColor": isSelected && variant !== "outline" && variant !== "text",
|
|
190
|
+
"hover:text-textOnColor active:text-textOnColor [&:hover>*]:fill-iconOnColor [&:active>*]:fill-iconOnColor": isSelected && variant !== "outline" && variant !== "text" && variant !== "outlineDanger",
|
|
178
191
|
"pointer-events-none": isDisabled,
|
|
179
192
|
"rounded-button": borderRadius == null,
|
|
180
193
|
"justify-start": justifyContent === "start",
|
|
@@ -184,12 +197,18 @@ var Button = ({
|
|
|
184
197
|
}
|
|
185
198
|
);
|
|
186
199
|
const Component = elementAs ?? "button";
|
|
187
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Component, { className: baseClasses, style: { width, borderRadius }, disabled: isDisabled, ...
|
|
200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Component, { className: baseClasses, style: { width, borderRadius }, disabled: isDisabled, ...restProps, children: [
|
|
188
201
|
before,
|
|
189
202
|
children,
|
|
190
203
|
after
|
|
191
204
|
] });
|
|
192
205
|
};
|
|
206
|
+
var Button = (props) => {
|
|
207
|
+
return createButton(props);
|
|
208
|
+
};
|
|
209
|
+
var InternalButton = (props) => {
|
|
210
|
+
return createButton(props);
|
|
211
|
+
};
|
|
193
212
|
|
|
194
213
|
// src/checkbox/checkbox.tsx
|
|
195
214
|
var import_component_theme4 = require("@zenkigen-inc/component-theme");
|
|
@@ -541,6 +560,7 @@ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "med
|
|
|
541
560
|
const starClasses = (0, import_clsx8.default)(import_component_theme7.focusVisible.inset, { "w-6 h-6": size === "large", "w-4 h-4": size === "medium" });
|
|
542
561
|
const renderStar = (rating) => {
|
|
543
562
|
const color = rating <= currentRating ? "fill-yellow-yellow50" : "fill-icon03";
|
|
563
|
+
const IconComponent = import_component_icons2.iconElements["star-filled"];
|
|
544
564
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
545
565
|
"button",
|
|
546
566
|
{
|
|
@@ -548,7 +568,7 @@ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "med
|
|
|
548
568
|
onClick: () => handleChangeRating(rating),
|
|
549
569
|
className: (0, import_clsx8.default)(color, starClasses),
|
|
550
570
|
disabled: !isEditable,
|
|
551
|
-
children:
|
|
571
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconComponent, {})
|
|
552
572
|
},
|
|
553
573
|
rating
|
|
554
574
|
);
|
|
@@ -557,17 +577,351 @@ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "med
|
|
|
557
577
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex flex-row", children: ratingStars });
|
|
558
578
|
}
|
|
559
579
|
|
|
560
|
-
// src/
|
|
580
|
+
// src/file-input/file-input.tsx
|
|
581
|
+
var import_clsx10 = require("clsx");
|
|
582
|
+
var import_react8 = require("react");
|
|
583
|
+
|
|
584
|
+
// src/icon-button/icon-button.tsx
|
|
561
585
|
var import_component_theme8 = require("@zenkigen-inc/component-theme");
|
|
562
586
|
var import_clsx9 = require("clsx");
|
|
563
587
|
var import_jsx_runtime13 = require("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 = (0, import_clsx9.clsx)(
|
|
598
|
+
"typography-label16regular flex items-center justify-center gap-1 rounded",
|
|
599
|
+
import_component_theme8.buttonColors[variant].hover,
|
|
600
|
+
import_component_theme8.buttonColors[variant].active,
|
|
601
|
+
import_component_theme8.buttonColors[variant].disabled,
|
|
602
|
+
import_component_theme8.focusVisible.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
|
+
[import_component_theme8.buttonColors[variant].selected]: isSelected,
|
|
611
|
+
[import_component_theme8.buttonColors[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__ */ (0, import_jsx_runtime13.jsx)("a", { className: baseClasses, ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: icon, size: iconSize }) });
|
|
618
|
+
} else {
|
|
619
|
+
const buttonProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== "isAnchor"));
|
|
620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: baseClasses, disabled: isDisabled, ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: icon, size: iconSize }) });
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// src/file-input/file-input.tsx
|
|
625
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
626
|
+
var ERROR_TYPES = {
|
|
627
|
+
SIZE_TOO_LARGE: "SIZE_TOO_LARGE",
|
|
628
|
+
UNSUPPORTED_FORMAT: "UNSUPPORTED_FORMAT"
|
|
629
|
+
};
|
|
630
|
+
var ERROR_MESSAGES = {
|
|
631
|
+
SIZE_TOO_LARGE: "\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u304C\u5927\u304D\u904E\u304E\u307E\u3059\u3002",
|
|
632
|
+
UNSUPPORTED_FORMAT: "\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002"
|
|
633
|
+
};
|
|
634
|
+
var FileInput = (0, import_react8.forwardRef)(
|
|
635
|
+
({ id, variant, accept, maxSize, isDisabled = false, isError = false, onSelect, onError, errorMessages, ...rest }, ref) => {
|
|
636
|
+
const size = variant === "button" ? rest.size ?? "medium" : "medium";
|
|
637
|
+
const [selectedFile, setSelectedFile] = (0, import_react8.useState)(null);
|
|
638
|
+
const [isDragOver, setIsDragOver] = (0, import_react8.useState)(false);
|
|
639
|
+
const fileInputRef = (0, import_react8.useRef)(null);
|
|
640
|
+
const errorId = (0, import_react8.useId)();
|
|
641
|
+
const fallbackId = (0, import_react8.useId)();
|
|
642
|
+
const inputId = id ?? fallbackId;
|
|
643
|
+
const validateFile = (0, import_react8.useCallback)(
|
|
644
|
+
(file) => {
|
|
645
|
+
const errors = [];
|
|
646
|
+
if (maxSize != null && maxSize > 0 && file.size > maxSize) {
|
|
647
|
+
errors.push({
|
|
648
|
+
type: ERROR_TYPES.SIZE_TOO_LARGE,
|
|
649
|
+
message: ERROR_MESSAGES.SIZE_TOO_LARGE
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
if (accept != null && accept.length > 0) {
|
|
653
|
+
const acceptTypes = accept.split(",").map((t) => t.trim());
|
|
654
|
+
const fileName = file.name.toLowerCase();
|
|
655
|
+
const fileExtension = fileName.substring(fileName.lastIndexOf(".")).toLowerCase();
|
|
656
|
+
const fileMimeType = file.type;
|
|
657
|
+
const isAccepted = acceptTypes.some((acceptType) => {
|
|
658
|
+
if (acceptType.startsWith(".")) {
|
|
659
|
+
return fileExtension === acceptType.toLowerCase();
|
|
660
|
+
}
|
|
661
|
+
if (acceptType.includes("/")) {
|
|
662
|
+
if (acceptType.endsWith("/*")) {
|
|
663
|
+
const mainType = acceptType.split("/")[0];
|
|
664
|
+
return fileMimeType.startsWith(`${mainType}/`);
|
|
665
|
+
}
|
|
666
|
+
return fileMimeType === acceptType;
|
|
667
|
+
}
|
|
668
|
+
return false;
|
|
669
|
+
});
|
|
670
|
+
if (!isAccepted) {
|
|
671
|
+
errors.push({ type: ERROR_TYPES.UNSUPPORTED_FORMAT, message: ERROR_MESSAGES.UNSUPPORTED_FORMAT });
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
if (errors.length > 0) {
|
|
675
|
+
onError?.(errors);
|
|
676
|
+
return false;
|
|
677
|
+
}
|
|
678
|
+
return true;
|
|
679
|
+
},
|
|
680
|
+
[accept, maxSize, onError]
|
|
681
|
+
);
|
|
682
|
+
const handleFileSelect = (0, import_react8.useCallback)(
|
|
683
|
+
(file) => {
|
|
684
|
+
if (file && !validateFile(file)) {
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
setSelectedFile(file);
|
|
688
|
+
onSelect?.(file);
|
|
689
|
+
},
|
|
690
|
+
[validateFile, onSelect]
|
|
691
|
+
);
|
|
692
|
+
const handleFileInputChange = (0, import_react8.useCallback)(
|
|
693
|
+
(event) => {
|
|
694
|
+
if (isDisabled) {
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
const files = event.target.files;
|
|
698
|
+
if (files == null || files.length === 0) {
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
const file = files[0];
|
|
702
|
+
if (file != null) {
|
|
703
|
+
handleFileSelect(file);
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
[isDisabled, handleFileSelect]
|
|
707
|
+
);
|
|
708
|
+
const handleDragOver = (0, import_react8.useCallback)(
|
|
709
|
+
(event) => {
|
|
710
|
+
event.preventDefault();
|
|
711
|
+
if (!isDisabled) {
|
|
712
|
+
setIsDragOver(true);
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
[isDisabled]
|
|
716
|
+
);
|
|
717
|
+
const handleDragLeave = (0, import_react8.useCallback)((event) => {
|
|
718
|
+
event.preventDefault();
|
|
719
|
+
setIsDragOver(false);
|
|
720
|
+
}, []);
|
|
721
|
+
const handleDrop = (0, import_react8.useCallback)(
|
|
722
|
+
(event) => {
|
|
723
|
+
event.preventDefault();
|
|
724
|
+
setIsDragOver(false);
|
|
725
|
+
if (isDisabled) return;
|
|
726
|
+
const file = event.dataTransfer.files[0];
|
|
727
|
+
if (file != null) {
|
|
728
|
+
handleFileSelect(file);
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
[isDisabled, handleFileSelect]
|
|
732
|
+
);
|
|
733
|
+
const handleButtonClick = (0, import_react8.useCallback)(() => {
|
|
734
|
+
if (!isDisabled) {
|
|
735
|
+
fileInputRef.current?.click();
|
|
736
|
+
}
|
|
737
|
+
}, [isDisabled]);
|
|
738
|
+
const handleClear = (0, import_react8.useCallback)(() => {
|
|
739
|
+
setSelectedFile(null);
|
|
740
|
+
if (fileInputRef.current) {
|
|
741
|
+
fileInputRef.current.value = "";
|
|
742
|
+
}
|
|
743
|
+
onSelect?.(null);
|
|
744
|
+
}, [onSelect]);
|
|
745
|
+
(0, import_react8.useImperativeHandle)(
|
|
746
|
+
ref,
|
|
747
|
+
() => ({
|
|
748
|
+
reset: handleClear
|
|
749
|
+
}),
|
|
750
|
+
[handleClear]
|
|
751
|
+
);
|
|
752
|
+
const hasErrorMessages = !isDisabled && errorMessages != null && errorMessages.length > 0;
|
|
753
|
+
const hasErrors = !isDisabled && isError === true;
|
|
754
|
+
const dropzoneClasses = (0, import_clsx10.clsx)(
|
|
755
|
+
"flex flex-1 flex-col items-center justify-center gap-4 rounded border border-dashed px-6 text-center",
|
|
756
|
+
selectedFile ? "py-[52px]" : "py-4",
|
|
757
|
+
{
|
|
758
|
+
"border-uiBorder03 bg-white text-text01": !isDisabled && !isDragOver && !hasErrors,
|
|
759
|
+
"border-activeInput bg-activeInput/5": !isDisabled && isDragOver && !hasErrors,
|
|
760
|
+
"border-supportDanger bg-white": hasErrors && !isDisabled,
|
|
761
|
+
"hover:bg-hover02 cursor-pointer": !isDisabled,
|
|
762
|
+
"border-disabled01 bg-disabled02 text-textPlaceholder cursor-not-allowed": isDisabled
|
|
763
|
+
}
|
|
764
|
+
);
|
|
765
|
+
const maxSizeLabel = (() => {
|
|
766
|
+
if (maxSize != null && maxSize > 0) {
|
|
767
|
+
const KB = 1024;
|
|
768
|
+
const MB = KB * 1024;
|
|
769
|
+
const GB = MB * 1024;
|
|
770
|
+
if (maxSize < MB) {
|
|
771
|
+
return `${Math.round(maxSize / KB)}KB\u4EE5\u4E0B`;
|
|
772
|
+
}
|
|
773
|
+
if (maxSize < GB) {
|
|
774
|
+
return `${Math.round(maxSize / MB)}MB\u4EE5\u4E0B`;
|
|
775
|
+
}
|
|
776
|
+
return `${Math.round(maxSize / GB)}GB\u4EE5\u4E0B`;
|
|
777
|
+
}
|
|
778
|
+
return "\u5236\u9650\u306A\u3057";
|
|
779
|
+
})();
|
|
780
|
+
const acceptLabel = (() => {
|
|
781
|
+
if (accept == null || accept.trim().length === 0) {
|
|
782
|
+
return "\u5236\u9650\u306A\u3057";
|
|
783
|
+
}
|
|
784
|
+
const tokens = accept.split(",").map((t) => t.trim()).filter((t) => t.length > 0);
|
|
785
|
+
const normalized = tokens.map((token) => {
|
|
786
|
+
if (token.startsWith(".")) {
|
|
787
|
+
return token.slice(1);
|
|
788
|
+
}
|
|
789
|
+
const slashIndex = token.indexOf("/");
|
|
790
|
+
if (slashIndex !== -1) {
|
|
791
|
+
const type = token.slice(0, slashIndex);
|
|
792
|
+
const subtype = token.slice(slashIndex + 1);
|
|
793
|
+
return subtype === "*" ? `${type}/*` : subtype;
|
|
794
|
+
}
|
|
795
|
+
return token;
|
|
796
|
+
});
|
|
797
|
+
return normalized.join(", ");
|
|
798
|
+
})();
|
|
799
|
+
if (variant === "button") {
|
|
800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
801
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: hasErrors ? "flex-1" : "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
802
|
+
InternalButton,
|
|
803
|
+
{
|
|
804
|
+
size,
|
|
805
|
+
variant: hasErrors ? "outlineDanger" : "outline",
|
|
806
|
+
isDisabled,
|
|
807
|
+
width: "100%",
|
|
808
|
+
onClick: handleButtonClick,
|
|
809
|
+
before: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "upload", size: "small" }),
|
|
810
|
+
after: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: selectedFile ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: (0, import_clsx10.clsx)("typography-label12regular truncate", !isDisabled && "text-text01"), children: selectedFile.name }) : "" }),
|
|
811
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "truncate", children: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E" })
|
|
812
|
+
}
|
|
813
|
+
) }),
|
|
814
|
+
selectedFile && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconButton, { variant: "text", icon: "close", size: "small", onClick: handleClear }) }),
|
|
815
|
+
hasErrors && hasErrorMessages && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { id: errorId, "data-testid": "error-messages", className: "typography-label12regular text-supportError", children: errorMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "break-all", children: message }, index)) }),
|
|
816
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
817
|
+
"input",
|
|
818
|
+
{
|
|
819
|
+
id: inputId,
|
|
820
|
+
ref: fileInputRef,
|
|
821
|
+
type: "file",
|
|
822
|
+
accept,
|
|
823
|
+
onChange: handleFileInputChange,
|
|
824
|
+
className: "hidden",
|
|
825
|
+
"aria-invalid": hasErrors,
|
|
826
|
+
...hasErrors && hasErrorMessages && { "aria-describedby": errorId }
|
|
827
|
+
}
|
|
828
|
+
)
|
|
829
|
+
] });
|
|
830
|
+
}
|
|
831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex min-w-[320px] flex-col gap-2", children: [
|
|
832
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
833
|
+
"div",
|
|
834
|
+
{
|
|
835
|
+
className: dropzoneClasses,
|
|
836
|
+
role: "button",
|
|
837
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
838
|
+
onDragOver: handleDragOver,
|
|
839
|
+
onDragLeave: handleDragLeave,
|
|
840
|
+
onDrop: handleDrop,
|
|
841
|
+
onClick: handleButtonClick,
|
|
842
|
+
onKeyDown: (e) => {
|
|
843
|
+
if ((e.key === "Enter" || e.key === " ") && !isDisabled) {
|
|
844
|
+
e.preventDefault();
|
|
845
|
+
handleButtonClick();
|
|
846
|
+
}
|
|
847
|
+
},
|
|
848
|
+
"aria-label": "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E",
|
|
849
|
+
"aria-disabled": isDisabled,
|
|
850
|
+
...hasErrors && hasErrorMessages && { "aria-describedby": errorId },
|
|
851
|
+
children: [
|
|
852
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "upload-document", size: "large", color: isDisabled ? "icon03" : "icon01" }),
|
|
853
|
+
!selectedFile && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "typography-body13regular select-none", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
854
|
+
"\u3053\u3053\u306B\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
855
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("br", {}),
|
|
856
|
+
"\u307E\u305F\u306F\u3001",
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: (0, import_clsx10.clsx)(!isDisabled ? "text-link01" : ""), children: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E" }),
|
|
858
|
+
"\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
859
|
+
] }) }) }),
|
|
860
|
+
!selectedFile && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
861
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_clsx10.clsx)("typography-label11regular", isDisabled ? "text-textPlaceholder" : "text-text02"), children: "\u5BFE\u5FDC\u5F62\u5F0F" }),
|
|
862
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_clsx10.clsx)("typography-body12regular", isDisabled ? "text-textPlaceholder" : "text-text01"), children: acceptLabel }),
|
|
863
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_clsx10.clsx)("typography-label11regular", isDisabled ? "text-textPlaceholder" : "text-text02"), children: "\u30B5\u30A4\u30BA" }),
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_clsx10.clsx)("typography-body12regular", isDisabled ? "text-textPlaceholder" : "text-text01"), children: maxSizeLabel })
|
|
865
|
+
] }),
|
|
866
|
+
selectedFile && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "mt-2 flex flex-col items-center gap-1", children: [
|
|
867
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "typography-label11regular text-text02", children: "\u30D5\u30A1\u30A4\u30EB\u540D" }),
|
|
868
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
869
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "typography-label14regular", children: selectedFile.name }),
|
|
870
|
+
!isDisabled && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
871
|
+
IconButton,
|
|
872
|
+
{
|
|
873
|
+
variant: "text",
|
|
874
|
+
icon: "close",
|
|
875
|
+
size: "small",
|
|
876
|
+
onClick: (event) => {
|
|
877
|
+
event.stopPropagation();
|
|
878
|
+
handleClear();
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
)
|
|
882
|
+
] })
|
|
883
|
+
] }),
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
885
|
+
"input",
|
|
886
|
+
{
|
|
887
|
+
id: inputId,
|
|
888
|
+
ref: fileInputRef,
|
|
889
|
+
type: "file",
|
|
890
|
+
accept,
|
|
891
|
+
onChange: handleFileInputChange,
|
|
892
|
+
className: "hidden",
|
|
893
|
+
"aria-invalid": hasErrors,
|
|
894
|
+
...hasErrors && hasErrorMessages && { "aria-describedby": errorId }
|
|
895
|
+
}
|
|
896
|
+
)
|
|
897
|
+
]
|
|
898
|
+
}
|
|
899
|
+
),
|
|
900
|
+
hasErrors && hasErrorMessages && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
901
|
+
"div",
|
|
902
|
+
{
|
|
903
|
+
id: errorId,
|
|
904
|
+
"data-testid": "error-messages",
|
|
905
|
+
className: "typography-body13regular flex flex-col text-supportDanger",
|
|
906
|
+
children: errorMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: message }, index))
|
|
907
|
+
}
|
|
908
|
+
)
|
|
909
|
+
] });
|
|
910
|
+
}
|
|
911
|
+
);
|
|
912
|
+
FileInput.displayName = "FileInput";
|
|
913
|
+
|
|
914
|
+
// src/heading/heading.tsx
|
|
915
|
+
var import_component_theme9 = require("@zenkigen-inc/component-theme");
|
|
916
|
+
var import_clsx11 = require("clsx");
|
|
917
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
564
918
|
function Heading(props) {
|
|
565
919
|
const TagName = `h${props.level}`;
|
|
566
|
-
const classes = (0,
|
|
920
|
+
const classes = (0, import_clsx11.clsx)(`flex items-center text-text01`, import_component_theme9.typography.heading[TagName], {
|
|
567
921
|
"gap-2": props.level === 1,
|
|
568
922
|
"gap-1": props.level > 1
|
|
569
923
|
});
|
|
570
|
-
return /* @__PURE__ */ (0,
|
|
924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(TagName, { className: classes, children: [
|
|
571
925
|
props.before,
|
|
572
926
|
props.children,
|
|
573
927
|
props.after
|
|
@@ -575,22 +929,22 @@ function Heading(props) {
|
|
|
575
929
|
}
|
|
576
930
|
|
|
577
931
|
// src/hooks/use-roving-focus.ts
|
|
578
|
-
var
|
|
932
|
+
var import_react9 = require("react");
|
|
579
933
|
var useRovingFocus = ({
|
|
580
934
|
values,
|
|
581
935
|
defaultFocusedValue,
|
|
582
936
|
isDisabled = false
|
|
583
937
|
}) => {
|
|
584
|
-
const [focusedValue, setFocusedValue] = (0,
|
|
938
|
+
const [focusedValue, setFocusedValue] = (0, import_react9.useState)(
|
|
585
939
|
typeof defaultFocusedValue === "undefined" ? null : defaultFocusedValue
|
|
586
940
|
);
|
|
587
|
-
const handleFocusChange = (0,
|
|
941
|
+
const handleFocusChange = (0, import_react9.useCallback)((newValue) => {
|
|
588
942
|
setFocusedValue(newValue);
|
|
589
943
|
}, []);
|
|
590
|
-
const handleBlur = (0,
|
|
944
|
+
const handleBlur = (0, import_react9.useCallback)(() => {
|
|
591
945
|
setFocusedValue(null);
|
|
592
946
|
}, []);
|
|
593
|
-
const handleKeyDown = (0,
|
|
947
|
+
const handleKeyDown = (0, import_react9.useCallback)(
|
|
594
948
|
(event) => {
|
|
595
949
|
if (isDisabled === true || values.length === 0) return;
|
|
596
950
|
const currentIndex = focusedValue !== null && focusedValue !== "" ? values.indexOf(focusedValue) : -1;
|
|
@@ -644,60 +998,18 @@ var useRovingFocus = ({
|
|
|
644
998
|
};
|
|
645
999
|
};
|
|
646
1000
|
|
|
647
|
-
// src/icon-button/icon-button.tsx
|
|
648
|
-
var import_component_theme9 = require("@zenkigen-inc/component-theme");
|
|
649
|
-
var import_clsx10 = require("clsx");
|
|
650
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
651
|
-
function IconButton({
|
|
652
|
-
icon,
|
|
653
|
-
size = "medium",
|
|
654
|
-
variant = "outline",
|
|
655
|
-
isNoPadding = false,
|
|
656
|
-
isDisabled = false,
|
|
657
|
-
isSelected = false,
|
|
658
|
-
...props
|
|
659
|
-
}) {
|
|
660
|
-
const baseClasses = (0, import_clsx10.clsx)(
|
|
661
|
-
"typography-label16regular flex items-center justify-center gap-1 rounded",
|
|
662
|
-
import_component_theme9.buttonColors[variant].hover,
|
|
663
|
-
import_component_theme9.buttonColors[variant].active,
|
|
664
|
-
import_component_theme9.buttonColors[variant].disabled,
|
|
665
|
-
import_component_theme9.focusVisible.normal,
|
|
666
|
-
{
|
|
667
|
-
"h-4 w-4": size === "small" && isNoPadding,
|
|
668
|
-
"h-6 w-6": size === "small" && !isNoPadding || (size === "medium" || size === "large") && isNoPadding,
|
|
669
|
-
"h-8 w-8": size === "medium" && !isNoPadding,
|
|
670
|
-
"h-10 w-10": size === "large" && !isNoPadding,
|
|
671
|
-
"inline-flex": props.isAnchor,
|
|
672
|
-
"pointer-events-none": isDisabled,
|
|
673
|
-
[import_component_theme9.buttonColors[variant].selected]: isSelected,
|
|
674
|
-
[import_component_theme9.buttonColors[variant].base]: !isSelected
|
|
675
|
-
}
|
|
676
|
-
);
|
|
677
|
-
const iconSize = size === "small" ? "small" : "medium";
|
|
678
|
-
if (props.isAnchor === true) {
|
|
679
|
-
const buttonProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== "isAnchor"));
|
|
680
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { className: baseClasses, ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: icon, size: iconSize }) });
|
|
681
|
-
} else {
|
|
682
|
-
const buttonProps = Object.fromEntries(
|
|
683
|
-
Object.entries(props).filter(([key]) => key !== "isAnchor" && key !== "onClick")
|
|
684
|
-
);
|
|
685
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: baseClasses, disabled: isDisabled, onClick: props.onClick, ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: icon, size: iconSize }) });
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
|
|
689
1001
|
// src/loading/loading.tsx
|
|
690
|
-
var
|
|
691
|
-
var
|
|
1002
|
+
var import_clsx12 = __toESM(require("clsx"));
|
|
1003
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
692
1004
|
function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
693
|
-
const wrapperClasses = (0,
|
|
694
|
-
const svgClasses = (0,
|
|
1005
|
+
const wrapperClasses = (0, import_clsx12.default)(position, "left-0 top-0 z-20 flex w-full items-center justify-center");
|
|
1006
|
+
const svgClasses = (0, import_clsx12.default)({
|
|
695
1007
|
"h-4 w-4": size === "small",
|
|
696
1008
|
"h-8 w-8": size === "medium",
|
|
697
1009
|
"h-16 w-16": size === "large"
|
|
698
1010
|
});
|
|
699
|
-
return /* @__PURE__ */ (0,
|
|
700
|
-
size === "small" && /* @__PURE__ */ (0,
|
|
1011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: wrapperClasses, style: { height }, children: [
|
|
1012
|
+
size === "small" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { className: svgClasses, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
701
1013
|
"circle",
|
|
702
1014
|
{
|
|
703
1015
|
className: "origin-center animate-circular-small-move stroke-interactive01",
|
|
@@ -709,7 +1021,7 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
709
1021
|
fill: "none"
|
|
710
1022
|
}
|
|
711
1023
|
) }),
|
|
712
|
-
size === "medium" && /* @__PURE__ */ (0,
|
|
1024
|
+
size === "medium" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { className: svgClasses, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
713
1025
|
"circle",
|
|
714
1026
|
{
|
|
715
1027
|
className: "origin-center animate-circular-medium-move stroke-interactive01",
|
|
@@ -721,7 +1033,7 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
721
1033
|
fill: "none"
|
|
722
1034
|
}
|
|
723
1035
|
) }),
|
|
724
|
-
size === "large" && /* @__PURE__ */ (0,
|
|
1036
|
+
size === "large" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { className: svgClasses, viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
725
1037
|
"circle",
|
|
726
1038
|
{
|
|
727
1039
|
className: "origin-center animate-circular-large-move stroke-interactive01",
|
|
@@ -737,13 +1049,13 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
737
1049
|
}
|
|
738
1050
|
|
|
739
1051
|
// src/modal/modal.tsx
|
|
740
|
-
var
|
|
1052
|
+
var import_react13 = require("react");
|
|
741
1053
|
var import_react_dom2 = require("react-dom");
|
|
742
1054
|
|
|
743
1055
|
// src/modal/body-scroll-lock.tsx
|
|
744
|
-
var
|
|
1056
|
+
var import_react10 = require("react");
|
|
745
1057
|
var BodyScrollLock = () => {
|
|
746
|
-
(0,
|
|
1058
|
+
(0, import_react10.useLayoutEffect)(() => {
|
|
747
1059
|
const { scrollX, scrollY } = window;
|
|
748
1060
|
const { body } = document;
|
|
749
1061
|
const hasVerticalScrollbar = document.documentElement.scrollHeight > document.documentElement.clientHeight;
|
|
@@ -788,34 +1100,34 @@ function restoreProperty(element, property, value) {
|
|
|
788
1100
|
}
|
|
789
1101
|
|
|
790
1102
|
// src/modal/modal-body.tsx
|
|
791
|
-
var
|
|
1103
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
792
1104
|
function ModalBody({ children }) {
|
|
793
|
-
return /* @__PURE__ */ (0,
|
|
1105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "overflow-y-auto", children });
|
|
794
1106
|
}
|
|
795
1107
|
|
|
796
1108
|
// src/modal/modal-context.ts
|
|
797
|
-
var
|
|
798
|
-
var ModalContext = (0,
|
|
1109
|
+
var import_react11 = require("react");
|
|
1110
|
+
var ModalContext = (0, import_react11.createContext)({
|
|
799
1111
|
onClose: () => null
|
|
800
1112
|
});
|
|
801
1113
|
|
|
802
1114
|
// src/modal/modal-footer.tsx
|
|
803
|
-
var
|
|
804
|
-
var
|
|
1115
|
+
var import_clsx13 = __toESM(require("clsx"));
|
|
1116
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
805
1117
|
function ModalFooter({ children, isNoBorder = false }) {
|
|
806
|
-
const wrapperClasses = (0,
|
|
1118
|
+
const wrapperClasses = (0, import_clsx13.default)("flex w-full shrink-0 items-center rounded-b-lg px-6 py-4", {
|
|
807
1119
|
"border-t-[1px] border-uiBorder01": !isNoBorder
|
|
808
1120
|
});
|
|
809
|
-
return /* @__PURE__ */ (0,
|
|
1121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: wrapperClasses, children });
|
|
810
1122
|
}
|
|
811
1123
|
|
|
812
1124
|
// src/modal/modal-header.tsx
|
|
813
|
-
var
|
|
814
|
-
var
|
|
815
|
-
var
|
|
1125
|
+
var import_clsx14 = __toESM(require("clsx"));
|
|
1126
|
+
var import_react12 = require("react");
|
|
1127
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
816
1128
|
function ModalHeader({ children, isNoBorder = false }) {
|
|
817
|
-
const { onClose } = (0,
|
|
818
|
-
const headerClasses = (0,
|
|
1129
|
+
const { onClose } = (0, import_react12.useContext)(ModalContext);
|
|
1130
|
+
const headerClasses = (0, import_clsx14.default)(
|
|
819
1131
|
"typography-h5 flex w-full shrink-0 items-center justify-between rounded-t-lg px-6 text-text01",
|
|
820
1132
|
{
|
|
821
1133
|
"border-b border-uiBorder01": !isNoBorder,
|
|
@@ -823,14 +1135,14 @@ function ModalHeader({ children, isNoBorder = false }) {
|
|
|
823
1135
|
"h-12": onClose
|
|
824
1136
|
}
|
|
825
1137
|
);
|
|
826
|
-
return /* @__PURE__ */ (0,
|
|
827
|
-
/* @__PURE__ */ (0,
|
|
828
|
-
onClose && /* @__PURE__ */ (0,
|
|
1138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: headerClasses, children: [
|
|
1139
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children }),
|
|
1140
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IconButton, { icon: "close", size: "small", variant: "text", onClick: onClose })
|
|
829
1141
|
] });
|
|
830
1142
|
}
|
|
831
1143
|
|
|
832
1144
|
// src/modal/modal.tsx
|
|
833
|
-
var
|
|
1145
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
834
1146
|
var LIMIT_WIDTH = 320;
|
|
835
1147
|
var LIMIT_HEIGHT = 184;
|
|
836
1148
|
function Modal({
|
|
@@ -842,16 +1154,16 @@ function Modal({
|
|
|
842
1154
|
onClose,
|
|
843
1155
|
portalTargetRef
|
|
844
1156
|
}) {
|
|
845
|
-
const [isMounted, setIsMounted] = (0,
|
|
1157
|
+
const [isMounted, setIsMounted] = (0, import_react13.useState)(false);
|
|
846
1158
|
const renderWidth = typeof width === "number" ? Math.max(width, LIMIT_WIDTH) : width;
|
|
847
1159
|
const renderHeight = typeof height === "number" ? Math.max(height, LIMIT_HEIGHT) : height;
|
|
848
|
-
(0,
|
|
1160
|
+
(0, import_react13.useEffect)(() => {
|
|
849
1161
|
setIsMounted(true);
|
|
850
1162
|
}, []);
|
|
851
|
-
return isMounted && isOpen ? /* @__PURE__ */ (0,
|
|
852
|
-
/* @__PURE__ */ (0,
|
|
1163
|
+
return isMounted && isOpen ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
1164
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BodyScrollLock, {}),
|
|
853
1165
|
(0, import_react_dom2.createPortal)(
|
|
854
|
-
/* @__PURE__ */ (0,
|
|
1166
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ModalContext.Provider, { value: { onClose }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fixed left-0 top-0 z-overlay flex size-full items-center justify-center bg-backgroundOverlayBlack py-4", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
855
1167
|
"div",
|
|
856
1168
|
{
|
|
857
1169
|
className: "grid max-h-full min-h-[120px] grid-rows-[max-content_1fr_max-content] flex-col rounded-lg bg-uiBackground01 shadow-modalShadow",
|
|
@@ -868,10 +1180,10 @@ Modal.Header = ModalHeader;
|
|
|
868
1180
|
Modal.Footer = ModalFooter;
|
|
869
1181
|
|
|
870
1182
|
// src/notification-inline/notification-inline.tsx
|
|
871
|
-
var
|
|
872
|
-
var
|
|
1183
|
+
var import_clsx15 = require("clsx");
|
|
1184
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
873
1185
|
function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
874
|
-
const wrapperClasses = (0,
|
|
1186
|
+
const wrapperClasses = (0, import_clsx15.clsx)("typography-body13regular flex items-center gap-1 rounded text-text01", {
|
|
875
1187
|
"bg-uiBackgroundError": state === "attention",
|
|
876
1188
|
"bg-uiBackgroundWarning": state === "warning",
|
|
877
1189
|
"bg-uiBackgroundBlue": state === "information",
|
|
@@ -880,7 +1192,7 @@ function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
|
880
1192
|
"p-2": size === "small",
|
|
881
1193
|
"p-3": size === "medium"
|
|
882
1194
|
});
|
|
883
|
-
const iconClasses = (0,
|
|
1195
|
+
const iconClasses = (0, import_clsx15.clsx)("flex items-center", {
|
|
884
1196
|
"fill-supportError": state === "attention",
|
|
885
1197
|
"fill-supportWarning": state === "warning",
|
|
886
1198
|
"fill-blue-blue50": state === "information",
|
|
@@ -896,28 +1208,28 @@ function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
|
896
1208
|
small: "small",
|
|
897
1209
|
medium: "medium"
|
|
898
1210
|
};
|
|
899
|
-
return /* @__PURE__ */ (0,
|
|
900
|
-
state !== "default" && /* @__PURE__ */ (0,
|
|
901
|
-
/* @__PURE__ */ (0,
|
|
902
|
-
props.showClose === true && /* @__PURE__ */ (0,
|
|
1211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: wrapperClasses, children: [
|
|
1212
|
+
state !== "default" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { name: iconName[state], size: iconSize[size] }) }),
|
|
1213
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "flex-1", children: props.children }),
|
|
1214
|
+
props.showClose === true && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(IconButton, { icon: "close", size: "small", variant: "text" }) })
|
|
903
1215
|
] });
|
|
904
1216
|
}
|
|
905
1217
|
|
|
906
1218
|
// src/pagination/pagination-button.tsx
|
|
907
|
-
var
|
|
908
|
-
var
|
|
1219
|
+
var import_clsx16 = require("clsx");
|
|
1220
|
+
var import_react15 = require("react");
|
|
909
1221
|
|
|
910
1222
|
// src/pagination/pagination-context.ts
|
|
911
|
-
var
|
|
912
|
-
var PaginationContext = (0,
|
|
1223
|
+
var import_react14 = require("react");
|
|
1224
|
+
var PaginationContext = (0, import_react14.createContext)({
|
|
913
1225
|
currentPage: 0
|
|
914
1226
|
});
|
|
915
1227
|
|
|
916
1228
|
// src/pagination/pagination-button.tsx
|
|
917
|
-
var
|
|
1229
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
918
1230
|
function PaginationButton({ page, onClick }) {
|
|
919
|
-
const { currentPage } = (0,
|
|
920
|
-
const buttonClasses = (0,
|
|
1231
|
+
const { currentPage } = (0, import_react15.useContext)(PaginationContext);
|
|
1232
|
+
const buttonClasses = (0, import_clsx16.clsx)(
|
|
921
1233
|
"flex h-8 min-w-8 items-center justify-center rounded fill-icon01 px-1",
|
|
922
1234
|
"typography-label14regular",
|
|
923
1235
|
"text-interactive02",
|
|
@@ -925,11 +1237,11 @@ function PaginationButton({ page, onClick }) {
|
|
|
925
1237
|
{ "border border-uiBorder02": page === currentPage },
|
|
926
1238
|
{ "border-transparent": page !== currentPage }
|
|
927
1239
|
);
|
|
928
|
-
return /* @__PURE__ */ (0,
|
|
1240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "button", className: buttonClasses, onClick: () => onClick(page), children: page });
|
|
929
1241
|
}
|
|
930
1242
|
|
|
931
1243
|
// src/pagination/pagination.tsx
|
|
932
|
-
var
|
|
1244
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
933
1245
|
var START_PAGE = 1;
|
|
934
1246
|
function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick }) {
|
|
935
1247
|
let center = Math.max(currentPage, START_PAGE + 1);
|
|
@@ -943,14 +1255,14 @@ function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick })
|
|
|
943
1255
|
pageList.push(i);
|
|
944
1256
|
}
|
|
945
1257
|
const threeDotIconClasses = "flex h-8 w-8 items-center justify-center gap-1 fill-icon01";
|
|
946
|
-
return /* @__PURE__ */ (0,
|
|
1258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
947
1259
|
PaginationContext.Provider,
|
|
948
1260
|
{
|
|
949
1261
|
value: {
|
|
950
1262
|
currentPage
|
|
951
1263
|
},
|
|
952
|
-
children: /* @__PURE__ */ (0,
|
|
953
|
-
/* @__PURE__ */ (0,
|
|
1264
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("ul", { className: "flex gap-1", children: [
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
954
1266
|
IconButton,
|
|
955
1267
|
{
|
|
956
1268
|
isDisabled: currentPage === START_PAGE,
|
|
@@ -960,12 +1272,12 @@ function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick })
|
|
|
960
1272
|
onClick: () => onClick(currentPage - 1)
|
|
961
1273
|
}
|
|
962
1274
|
) }),
|
|
963
|
-
/* @__PURE__ */ (0,
|
|
964
|
-
pageList.length !== 0 && pageList[0] !== 2 && /* @__PURE__ */ (0,
|
|
965
|
-
pageList.map((page, index) => /* @__PURE__ */ (0,
|
|
966
|
-
pageList.length !== 0 && pageList[pageList.length - 1] !== totalPage - 1 && /* @__PURE__ */ (0,
|
|
967
|
-
/* @__PURE__ */ (0,
|
|
968
|
-
/* @__PURE__ */ (0,
|
|
1275
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PaginationButton, { onClick: () => onClick(START_PAGE), page: START_PAGE }) }),
|
|
1276
|
+
pageList.length !== 0 && pageList[0] !== 2 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { className: threeDotIconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "more", size: "small" }) }),
|
|
1277
|
+
pageList.map((page, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PaginationButton, { onClick: () => onClick(page), page }) }, index)),
|
|
1278
|
+
pageList.length !== 0 && pageList[pageList.length - 1] !== totalPage - 1 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { className: threeDotIconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "more", size: "small" }) }),
|
|
1279
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PaginationButton, { onClick: () => onClick(totalPage), page: totalPage }) }),
|
|
1280
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
969
1281
|
IconButton,
|
|
970
1282
|
{
|
|
971
1283
|
isDisabled: currentPage === totalPage,
|
|
@@ -981,13 +1293,14 @@ function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick })
|
|
|
981
1293
|
}
|
|
982
1294
|
|
|
983
1295
|
// src/select/select.tsx
|
|
1296
|
+
var import_react19 = require("@floating-ui/react");
|
|
984
1297
|
var import_component_theme12 = require("@zenkigen-inc/component-theme");
|
|
985
|
-
var
|
|
986
|
-
var
|
|
1298
|
+
var import_clsx19 = __toESM(require("clsx"));
|
|
1299
|
+
var import_react20 = require("react");
|
|
987
1300
|
|
|
988
1301
|
// src/select/select-context.ts
|
|
989
|
-
var
|
|
990
|
-
var SelectContext = (0,
|
|
1302
|
+
var import_react16 = require("react");
|
|
1303
|
+
var SelectContext = (0, import_react16.createContext)({
|
|
991
1304
|
size: "medium",
|
|
992
1305
|
setIsOptionListOpen: () => false,
|
|
993
1306
|
variant: "outline",
|
|
@@ -996,76 +1309,78 @@ var SelectContext = (0, import_react15.createContext)({
|
|
|
996
1309
|
|
|
997
1310
|
// src/select/select-item.tsx
|
|
998
1311
|
var import_component_theme10 = require("@zenkigen-inc/component-theme");
|
|
999
|
-
var
|
|
1000
|
-
var
|
|
1001
|
-
var
|
|
1312
|
+
var import_clsx17 = __toESM(require("clsx"));
|
|
1313
|
+
var import_react17 = require("react");
|
|
1314
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1002
1315
|
function SelectItem({ option }) {
|
|
1003
|
-
const { setIsOptionListOpen, selectedOption, onChange, isError } = (0,
|
|
1316
|
+
const { setIsOptionListOpen, selectedOption, onChange, isError } = (0, import_react17.useContext)(SelectContext);
|
|
1004
1317
|
const handleClickItem = (option2) => {
|
|
1005
1318
|
onChange?.(option2);
|
|
1006
1319
|
setIsOptionListOpen(false);
|
|
1007
1320
|
};
|
|
1008
|
-
const itemClasses = (0,
|
|
1321
|
+
const itemClasses = (0, import_clsx17.default)(
|
|
1009
1322
|
"typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
1010
1323
|
import_component_theme10.focusVisible.inset,
|
|
1011
1324
|
{
|
|
1012
1325
|
"text-interactive01 fill-interactive01 bg-selectedUi": option.id === selectedOption?.id && !(isError ?? false),
|
|
1013
1326
|
"text-supportError fill-supportError bg-uiBackgroundError": option.id === selectedOption?.id && isError,
|
|
1014
|
-
"text-interactive02 fill-icon01 bg-uiBackground01": option.id !== selectedOption?.id
|
|
1327
|
+
"text-interactive02 fill-icon01 bg-uiBackground01": option.id !== selectedOption?.id,
|
|
1328
|
+
"pr-10": option.id !== selectedOption?.id
|
|
1015
1329
|
}
|
|
1016
1330
|
);
|
|
1017
|
-
return /* @__PURE__ */ (0,
|
|
1018
|
-
option.icon && /* @__PURE__ */ (0,
|
|
1019
|
-
/* @__PURE__ */ (0,
|
|
1020
|
-
option.id === selectedOption?.id && /* @__PURE__ */ (0,
|
|
1331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { className: "flex w-full items-center", "data-id": option.id, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("button", { className: itemClasses, type: "button", onClick: () => handleClickItem(option), children: [
|
|
1332
|
+
option.icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: option.icon, size: "small" }),
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "ml-1 flex-1 truncate text-left", children: option.label }),
|
|
1334
|
+
option.id === selectedOption?.id && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "check", size: "small" }) })
|
|
1021
1335
|
] }) }, option.id);
|
|
1022
1336
|
}
|
|
1023
1337
|
|
|
1024
1338
|
// src/select/select-list.tsx
|
|
1025
1339
|
var import_component_theme11 = require("@zenkigen-inc/component-theme");
|
|
1026
|
-
var
|
|
1027
|
-
var
|
|
1028
|
-
var
|
|
1029
|
-
|
|
1030
|
-
const
|
|
1031
|
-
const { size, selectedOption, setIsOptionListOpen, variant, placeholder, onChange } = (0, import_react17.useContext)(SelectContext);
|
|
1340
|
+
var import_clsx18 = __toESM(require("clsx"));
|
|
1341
|
+
var import_react18 = require("react");
|
|
1342
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1343
|
+
var SelectList = (0, import_react18.forwardRef)(({ children, maxHeight }, ref) => {
|
|
1344
|
+
const { selectedOption, setIsOptionListOpen, variant, placeholder, onChange, floatingStyles, floatingRef } = (0, import_react18.useContext)(SelectContext);
|
|
1032
1345
|
const handleClickDeselect = () => {
|
|
1033
1346
|
onChange?.(null);
|
|
1034
1347
|
setIsOptionListOpen(false);
|
|
1035
1348
|
};
|
|
1036
|
-
(0,
|
|
1037
|
-
if (maxHeight != null &&
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1349
|
+
(0, import_react18.useLayoutEffect)(() => {
|
|
1350
|
+
if (maxHeight != null && selectedOption != null) {
|
|
1351
|
+
const container = floatingRef?.current;
|
|
1352
|
+
if (container != null) {
|
|
1353
|
+
const element = container.querySelector(`[data-id="${selectedOption.id}"]`);
|
|
1354
|
+
if (element != null) {
|
|
1355
|
+
const htmlElement = element;
|
|
1356
|
+
const elementTop = htmlElement.offsetTop;
|
|
1357
|
+
const elementHeight = htmlElement.offsetHeight;
|
|
1358
|
+
const containerHeight = container.clientHeight;
|
|
1359
|
+
const scrollTop = elementTop - (containerHeight - elementHeight) / 2;
|
|
1360
|
+
container.scrollTo({
|
|
1361
|
+
top: Math.max(0, scrollTop)
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1045
1364
|
}
|
|
1046
1365
|
}
|
|
1047
|
-
}, []);
|
|
1048
|
-
const listClasses = (0,
|
|
1049
|
-
"
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
"top-9": size === "medium",
|
|
1053
|
-
"top-11": size === "large",
|
|
1054
|
-
"border-solid border border-uiBorder01": variant === "outline"
|
|
1055
|
-
}
|
|
1056
|
-
);
|
|
1057
|
-
const deselectButtonClasses = (0, import_clsx17.default)(
|
|
1366
|
+
}, [selectedOption, maxHeight, floatingRef]);
|
|
1367
|
+
const listClasses = (0, import_clsx18.default)("z-dropdown overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow", {
|
|
1368
|
+
"border-solid border border-uiBorder01": variant === "outline"
|
|
1369
|
+
});
|
|
1370
|
+
const deselectButtonClasses = (0, import_clsx18.default)(
|
|
1058
1371
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
1059
1372
|
import_component_theme11.focusVisible.inset
|
|
1060
1373
|
);
|
|
1061
|
-
return /* @__PURE__ */ (0,
|
|
1374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("ul", { className: listClasses, style: { maxHeight, ...floatingStyles }, ref, children: [
|
|
1062
1375
|
children,
|
|
1063
|
-
placeholder != null && selectedOption !== null && /* @__PURE__ */ (0,
|
|
1376
|
+
placeholder != null && selectedOption !== null && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { className: deselectButtonClasses, type: "button", onClick: handleClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
|
|
1064
1377
|
] });
|
|
1065
|
-
}
|
|
1378
|
+
});
|
|
1379
|
+
SelectList.displayName = "SelectList";
|
|
1066
1380
|
|
|
1067
1381
|
// src/select/select.tsx
|
|
1068
|
-
var
|
|
1382
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1383
|
+
var FLOATING_OFFSET = 4;
|
|
1069
1384
|
function Select({
|
|
1070
1385
|
children,
|
|
1071
1386
|
size = "medium",
|
|
@@ -1081,19 +1396,35 @@ function Select({
|
|
|
1081
1396
|
onChange,
|
|
1082
1397
|
optionListMaxHeight
|
|
1083
1398
|
}) {
|
|
1084
|
-
const [isOptionListOpen, setIsOptionListOpen] = (0,
|
|
1085
|
-
const targetRef = (0,
|
|
1399
|
+
const [isOptionListOpen, setIsOptionListOpen] = (0, import_react20.useState)(false);
|
|
1400
|
+
const targetRef = (0, import_react20.useRef)(null);
|
|
1086
1401
|
useOutsideClick(targetRef, () => setIsOptionListOpen(false));
|
|
1402
|
+
const { refs, floatingStyles } = (0, import_react19.useFloating)({
|
|
1403
|
+
open: isOptionListOpen,
|
|
1404
|
+
onOpenChange: setIsOptionListOpen,
|
|
1405
|
+
placement: "bottom-start",
|
|
1406
|
+
middleware: [
|
|
1407
|
+
(0, import_react19.offset)(FLOATING_OFFSET),
|
|
1408
|
+
(0, import_react19.size)({
|
|
1409
|
+
apply({ availableWidth, elements, rects }) {
|
|
1410
|
+
const referenceWidth = rects.reference.width;
|
|
1411
|
+
elements.floating.style.minWidth = `${referenceWidth}px`;
|
|
1412
|
+
elements.floating.style.maxWidth = `${availableWidth}px`;
|
|
1413
|
+
}
|
|
1414
|
+
})
|
|
1415
|
+
],
|
|
1416
|
+
whileElementsMounted: import_react19.autoUpdate
|
|
1417
|
+
});
|
|
1087
1418
|
const handleClickToggle = () => setIsOptionListOpen((prev) => !prev);
|
|
1088
1419
|
const buttonVariant = isError && !isDisabled ? `${variant}Error` : variant;
|
|
1089
1420
|
const isSelected = isOptionSelected && !isDisabled && selectedOption !== null && !isError;
|
|
1090
|
-
const wrapperClasses = (0,
|
|
1421
|
+
const wrapperClasses = (0, import_clsx19.default)("relative flex shrink-0 items-center gap-1 rounded bg-uiBackground01", {
|
|
1091
1422
|
"h-6": size === "x-small" || size === "small",
|
|
1092
1423
|
"h-8": size === "medium",
|
|
1093
1424
|
"h-10": size === "large",
|
|
1094
1425
|
"cursor-not-allowed": isDisabled
|
|
1095
1426
|
});
|
|
1096
|
-
const buttonClasses = (0,
|
|
1427
|
+
const buttonClasses = (0, import_clsx19.default)(
|
|
1097
1428
|
"flex size-full items-center rounded",
|
|
1098
1429
|
import_component_theme12.selectColors[buttonVariant].hover,
|
|
1099
1430
|
import_component_theme12.selectColors[buttonVariant].active,
|
|
@@ -1108,14 +1439,14 @@ function Select({
|
|
|
1108
1439
|
"border-supportError": !isSelected && !isDisabled && isError
|
|
1109
1440
|
}
|
|
1110
1441
|
);
|
|
1111
|
-
const labelClasses = (0,
|
|
1442
|
+
const labelClasses = (0, import_clsx19.default)("overflow-hidden", {
|
|
1112
1443
|
"mr-1": size === "x-small",
|
|
1113
1444
|
"mr-2": size !== "x-small",
|
|
1114
1445
|
"typography-label12regular": size === "x-small",
|
|
1115
1446
|
"typography-label14regular": size === "small" || size === "medium",
|
|
1116
1447
|
"typography-label16regular": size === "large"
|
|
1117
1448
|
});
|
|
1118
|
-
return /* @__PURE__ */ (0,
|
|
1449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1119
1450
|
SelectContext.Provider,
|
|
1120
1451
|
{
|
|
1121
1452
|
value: {
|
|
@@ -1125,21 +1456,33 @@ function Select({
|
|
|
1125
1456
|
setIsOptionListOpen,
|
|
1126
1457
|
selectedOption,
|
|
1127
1458
|
onChange,
|
|
1128
|
-
isError
|
|
1459
|
+
isError,
|
|
1460
|
+
floatingStyles,
|
|
1461
|
+
floatingRef: refs.floating
|
|
1129
1462
|
},
|
|
1130
|
-
children: /* @__PURE__ */ (0,
|
|
1131
|
-
/* @__PURE__ */ (0,
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1463
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: wrapperClasses, style: { width, maxWidth }, ref: targetRef, children: [
|
|
1464
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1465
|
+
"button",
|
|
1466
|
+
{
|
|
1467
|
+
ref: refs.setReference,
|
|
1468
|
+
className: buttonClasses,
|
|
1469
|
+
type: "button",
|
|
1470
|
+
onClick: handleClickToggle,
|
|
1471
|
+
disabled: isDisabled,
|
|
1472
|
+
children: [
|
|
1473
|
+
selectedOption?.icon ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mr-1 flex", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: selectedOption.icon, size: size === "large" ? "medium" : "small" }) }) : placeholder != null && placeholderIcon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mr-1 flex", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: placeholderIcon, size: size === "large" ? "medium" : "small" }) }),
|
|
1474
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: labelClasses, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "truncate", children: selectedOption ? selectedOption.label : placeholder != null && placeholder }) }),
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1476
|
+
Icon,
|
|
1477
|
+
{
|
|
1478
|
+
name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
|
|
1479
|
+
size: size === "large" ? "medium" : "small"
|
|
1480
|
+
}
|
|
1481
|
+
) })
|
|
1482
|
+
]
|
|
1483
|
+
}
|
|
1484
|
+
),
|
|
1485
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react19.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "relative z-overlay", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectList, { ref: refs.setFloating, maxHeight: optionListMaxHeight, children }) }) })
|
|
1143
1486
|
] })
|
|
1144
1487
|
}
|
|
1145
1488
|
);
|
|
@@ -1147,7 +1490,7 @@ function Select({
|
|
|
1147
1490
|
Select.Option = SelectItem;
|
|
1148
1491
|
|
|
1149
1492
|
// src/pagination-select/pagination-select.tsx
|
|
1150
|
-
var
|
|
1493
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1151
1494
|
function PaginationSelect({
|
|
1152
1495
|
totalSize,
|
|
1153
1496
|
currentPage,
|
|
@@ -1170,14 +1513,14 @@ function PaginationSelect({
|
|
|
1170
1513
|
});
|
|
1171
1514
|
const minCount = totalSize ? (currentPage - 1) * sizePerPage + 1 : 0;
|
|
1172
1515
|
const maxCount = currentPage * sizePerPage > totalSize ? totalSize : currentPage * sizePerPage;
|
|
1173
|
-
return /* @__PURE__ */ (0,
|
|
1174
|
-
/* @__PURE__ */ (0,
|
|
1175
|
-
/* @__PURE__ */ (0,
|
|
1516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("nav", { "aria-label": "pagination", className: "flex items-center gap-x-1", children: [
|
|
1517
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-x-2", children: [
|
|
1518
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "typography-label14regular text-text01", children: [
|
|
1176
1519
|
minCount > 0 && `${minCount} - `,
|
|
1177
1520
|
maxCount,
|
|
1178
1521
|
countLabel
|
|
1179
1522
|
] }),
|
|
1180
|
-
/* @__PURE__ */ (0,
|
|
1523
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1181
1524
|
Select,
|
|
1182
1525
|
{
|
|
1183
1526
|
size: "medium",
|
|
@@ -1186,17 +1529,17 @@ function PaginationSelect({
|
|
|
1186
1529
|
optionListMaxHeight,
|
|
1187
1530
|
onChange: (option) => option && onChange(Number(option.value)),
|
|
1188
1531
|
isDisabled: pageMax === 0,
|
|
1189
|
-
children: optionsList.map((option) => /* @__PURE__ */ (0,
|
|
1532
|
+
children: optionsList.map((option) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Select.Option, { option }, option.id))
|
|
1190
1533
|
}
|
|
1191
1534
|
),
|
|
1192
|
-
/* @__PURE__ */ (0,
|
|
1535
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "typography-label14regular text-text02", children: [
|
|
1193
1536
|
"/ ",
|
|
1194
1537
|
pageMax,
|
|
1195
1538
|
pageLabel
|
|
1196
1539
|
] })
|
|
1197
1540
|
] }),
|
|
1198
|
-
/* @__PURE__ */ (0,
|
|
1199
|
-
/* @__PURE__ */ (0,
|
|
1541
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center", children: [
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1200
1543
|
IconButton,
|
|
1201
1544
|
{
|
|
1202
1545
|
variant: "text",
|
|
@@ -1206,7 +1549,7 @@ function PaginationSelect({
|
|
|
1206
1549
|
onClick: onClickPrevButton
|
|
1207
1550
|
}
|
|
1208
1551
|
),
|
|
1209
|
-
/* @__PURE__ */ (0,
|
|
1552
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1210
1553
|
IconButton,
|
|
1211
1554
|
{
|
|
1212
1555
|
variant: "text",
|
|
@@ -1220,28 +1563,353 @@ function PaginationSelect({
|
|
|
1220
1563
|
] });
|
|
1221
1564
|
}
|
|
1222
1565
|
|
|
1566
|
+
// src/password-input/password-input.tsx
|
|
1567
|
+
var import_react22 = require("react");
|
|
1568
|
+
|
|
1569
|
+
// src/text-input/text-input.tsx
|
|
1570
|
+
var import_clsx20 = require("clsx");
|
|
1571
|
+
var import_react21 = require("react");
|
|
1572
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1573
|
+
var TextInput = (0, import_react21.forwardRef)(
|
|
1574
|
+
({ size = "medium", isError = false, disabled = false, onClickClearButton, after, ...props }, ref) => {
|
|
1575
|
+
const isShowClearButton = !!onClickClearButton && props.value.length !== 0 && !disabled;
|
|
1576
|
+
const hasTrailingElement = isShowClearButton || after != null;
|
|
1577
|
+
const inputWrapClasses = (0, import_clsx20.clsx)("relative flex items-center gap-2 overflow-hidden rounded border", {
|
|
1578
|
+
"border-uiBorder02": !isError && !disabled,
|
|
1579
|
+
"border-supportError": isError && !disabled,
|
|
1580
|
+
"hover:border-hoverInput": !disabled && !isError,
|
|
1581
|
+
"hover:focus-within:border-activeInput": !isError,
|
|
1582
|
+
"focus-within:border-activeInput": !isError,
|
|
1583
|
+
"bg-disabled02 border-disabled01": disabled,
|
|
1584
|
+
"pr-2": size === "medium" && hasTrailingElement,
|
|
1585
|
+
"pr-3": size === "large" && hasTrailingElement
|
|
1586
|
+
});
|
|
1587
|
+
const inputClasses = (0, import_clsx20.clsx)("flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
|
|
1588
|
+
["typography-label14regular min-h-8 px-2"]: size === "medium",
|
|
1589
|
+
["typography-label16regular min-h-10 px-3"]: size === "large",
|
|
1590
|
+
"text-text01": !isError,
|
|
1591
|
+
"text-supportError": isError,
|
|
1592
|
+
"pr-0": hasTrailingElement
|
|
1593
|
+
});
|
|
1594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: inputWrapClasses, children: [
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("input", { ref, size: 1, className: inputClasses, disabled, onChange: props.onChange, ...props }),
|
|
1596
|
+
after,
|
|
1597
|
+
isShowClearButton && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(IconButton, { variant: "text", icon: "close", size: "small", onClick: onClickClearButton })
|
|
1598
|
+
] });
|
|
1599
|
+
}
|
|
1600
|
+
);
|
|
1601
|
+
TextInput.displayName = "TextInput";
|
|
1602
|
+
|
|
1603
|
+
// src/password-input/password-input.tsx
|
|
1604
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1605
|
+
var PasswordInput = (0, import_react22.forwardRef)(({ disabled = false, ...props }, ref) => {
|
|
1606
|
+
const [isPasswordVisible, setIsPasswordVisible] = (0, import_react22.useState)(false);
|
|
1607
|
+
const handlePasswordVisibilityToggle = () => {
|
|
1608
|
+
setIsPasswordVisible(!isPasswordVisible);
|
|
1609
|
+
};
|
|
1610
|
+
const passwordToggleButton = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1611
|
+
IconButton,
|
|
1612
|
+
{
|
|
1613
|
+
variant: "text",
|
|
1614
|
+
icon: isPasswordVisible === true ? "visibility-off" : "visibility",
|
|
1615
|
+
size: "small",
|
|
1616
|
+
onClick: handlePasswordVisibilityToggle,
|
|
1617
|
+
isDisabled: disabled,
|
|
1618
|
+
"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"
|
|
1619
|
+
}
|
|
1620
|
+
);
|
|
1621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1622
|
+
TextInput,
|
|
1623
|
+
{
|
|
1624
|
+
ref,
|
|
1625
|
+
type: isPasswordVisible === true ? "text" : "password",
|
|
1626
|
+
disabled,
|
|
1627
|
+
...props,
|
|
1628
|
+
...{ after: passwordToggleButton }
|
|
1629
|
+
}
|
|
1630
|
+
);
|
|
1631
|
+
});
|
|
1632
|
+
PasswordInput.displayName = "PasswordInput";
|
|
1633
|
+
|
|
1634
|
+
// src/popover/popover.tsx
|
|
1635
|
+
var import_react27 = require("@floating-ui/react");
|
|
1636
|
+
var import_react28 = require("react");
|
|
1637
|
+
|
|
1638
|
+
// src/popover/popover-content.tsx
|
|
1639
|
+
var import_react24 = require("@floating-ui/react");
|
|
1640
|
+
var React = __toESM(require("react"));
|
|
1641
|
+
var import_react25 = require("react");
|
|
1642
|
+
|
|
1643
|
+
// src/utils/react-utils.ts
|
|
1644
|
+
function composeRefs(...refs) {
|
|
1645
|
+
return (node) => {
|
|
1646
|
+
for (const ref of refs) {
|
|
1647
|
+
if (ref == null) {
|
|
1648
|
+
continue;
|
|
1649
|
+
}
|
|
1650
|
+
if (typeof ref === "function") {
|
|
1651
|
+
ref(node);
|
|
1652
|
+
} else {
|
|
1653
|
+
ref.current = node;
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
}
|
|
1658
|
+
function isElement(node) {
|
|
1659
|
+
return node != null && typeof node === "object" && "type" in node;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
// src/popover/popover-context.ts
|
|
1663
|
+
var import_react23 = require("react");
|
|
1664
|
+
var PopoverContext = (0, import_react23.createContext)(null);
|
|
1665
|
+
var usePopoverContext = () => {
|
|
1666
|
+
const context = (0, import_react23.useContext)(PopoverContext);
|
|
1667
|
+
if (context == null) {
|
|
1668
|
+
throw new Error("Popover components must be used inside <Popover.Root>");
|
|
1669
|
+
}
|
|
1670
|
+
return context;
|
|
1671
|
+
};
|
|
1672
|
+
|
|
1673
|
+
// src/popover/popover-content.tsx
|
|
1674
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1675
|
+
var PopoverContent = (0, import_react25.forwardRef)(function PopoverContent2({ children }, ref) {
|
|
1676
|
+
const { isOpen, triggerRef, floating, panelId, onClose } = usePopoverContext();
|
|
1677
|
+
const shouldCloseOnOutsidePress = (0, import_react25.useCallback)(
|
|
1678
|
+
(event) => {
|
|
1679
|
+
const target = event.target;
|
|
1680
|
+
if (!(target instanceof Element)) {
|
|
1681
|
+
return true;
|
|
1682
|
+
}
|
|
1683
|
+
const floatingElement = floating.refs.floating.current;
|
|
1684
|
+
const closestOverlay = target.closest(".z-overlay, .z-dropdown");
|
|
1685
|
+
if (closestOverlay !== null && floatingElement instanceof Element) {
|
|
1686
|
+
const isInsideOwnFloating = floatingElement.contains(closestOverlay);
|
|
1687
|
+
return isInsideOwnFloating;
|
|
1688
|
+
}
|
|
1689
|
+
return true;
|
|
1690
|
+
},
|
|
1691
|
+
[floating.refs.floating]
|
|
1692
|
+
);
|
|
1693
|
+
const dismiss = (0, import_react24.useDismiss)(floating.context, {
|
|
1694
|
+
outsidePressEvent: "pointerdown",
|
|
1695
|
+
outsidePress: shouldCloseOnOutsidePress,
|
|
1696
|
+
escapeKey: false
|
|
1697
|
+
});
|
|
1698
|
+
const interactions = (0, import_react24.useInteractions)([dismiss, (0, import_react24.useRole)(floating.context, { role: "dialog" })]);
|
|
1699
|
+
(0, import_react25.useEffect)(() => {
|
|
1700
|
+
if (isOpen) {
|
|
1701
|
+
const element = floating.refs.floating.current;
|
|
1702
|
+
element?.focus?.({ preventScroll: true });
|
|
1703
|
+
}
|
|
1704
|
+
}, [isOpen, floating.refs.floating]);
|
|
1705
|
+
(0, import_react25.useEffect)(() => {
|
|
1706
|
+
if (!isOpen) {
|
|
1707
|
+
triggerRef.current?.focus({ preventScroll: true });
|
|
1708
|
+
}
|
|
1709
|
+
}, [isOpen, triggerRef]);
|
|
1710
|
+
const handleKeyDown = (0, import_react25.useCallback)(
|
|
1711
|
+
(event) => {
|
|
1712
|
+
if (event.key === "Escape") {
|
|
1713
|
+
event.stopPropagation();
|
|
1714
|
+
if (onClose != null) {
|
|
1715
|
+
onClose({ reason: "escape-key-down" });
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
},
|
|
1719
|
+
[onClose]
|
|
1720
|
+
);
|
|
1721
|
+
let wrappedChildren = children;
|
|
1722
|
+
if (isElement(children)) {
|
|
1723
|
+
const childProps = children.props;
|
|
1724
|
+
wrappedChildren = React.cloneElement(children, {
|
|
1725
|
+
...childProps,
|
|
1726
|
+
...childProps.id == null && { id: panelId },
|
|
1727
|
+
...childProps.role == null && { role: "dialog" }
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react24.FloatingPortal, { children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1731
|
+
"div",
|
|
1732
|
+
{
|
|
1733
|
+
...interactions.getFloatingProps({
|
|
1734
|
+
ref: composeRefs(floating.refs.setFloating, ref),
|
|
1735
|
+
tabIndex: -1,
|
|
1736
|
+
onKeyDown: handleKeyDown,
|
|
1737
|
+
style: {
|
|
1738
|
+
position: floating.strategy,
|
|
1739
|
+
top: floating.y ?? 0,
|
|
1740
|
+
left: floating.x ?? 0,
|
|
1741
|
+
outline: "0"
|
|
1742
|
+
}
|
|
1743
|
+
}),
|
|
1744
|
+
children: wrappedChildren
|
|
1745
|
+
}
|
|
1746
|
+
) : null });
|
|
1747
|
+
});
|
|
1748
|
+
|
|
1749
|
+
// src/popover/popover-trigger.tsx
|
|
1750
|
+
var React2 = __toESM(require("react"));
|
|
1751
|
+
var import_react26 = require("react");
|
|
1752
|
+
var PopoverTrigger = (0, import_react26.forwardRef)(function PopoverTrigger2({ children }, ref) {
|
|
1753
|
+
const { isOpen, floating, triggerRef, anchorRef, panelId } = usePopoverContext();
|
|
1754
|
+
if (!isElement(children)) {
|
|
1755
|
+
return null;
|
|
1756
|
+
}
|
|
1757
|
+
const handleTriggerRef = (node) => {
|
|
1758
|
+
triggerRef.current = node;
|
|
1759
|
+
if (anchorRef == null) {
|
|
1760
|
+
floating.refs.setReference(node);
|
|
1761
|
+
}
|
|
1762
|
+
if (typeof ref === "function") {
|
|
1763
|
+
ref(node);
|
|
1764
|
+
} else if (ref != null) {
|
|
1765
|
+
ref.current = node;
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1768
|
+
const childProps = children.props;
|
|
1769
|
+
const childRef = childProps.ref;
|
|
1770
|
+
return React2.cloneElement(children, {
|
|
1771
|
+
...childProps,
|
|
1772
|
+
ref: composeRefs(childRef, handleTriggerRef),
|
|
1773
|
+
"aria-haspopup": "dialog",
|
|
1774
|
+
"aria-expanded": isOpen,
|
|
1775
|
+
"aria-controls": panelId
|
|
1776
|
+
});
|
|
1777
|
+
});
|
|
1778
|
+
|
|
1779
|
+
// src/popover/popover.tsx
|
|
1780
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1781
|
+
function Popover({
|
|
1782
|
+
isOpen,
|
|
1783
|
+
children,
|
|
1784
|
+
placement = "top",
|
|
1785
|
+
offset: offsetValue = 8,
|
|
1786
|
+
onClose,
|
|
1787
|
+
anchorRef
|
|
1788
|
+
}) {
|
|
1789
|
+
const triggerRef = (0, import_react28.useRef)(null);
|
|
1790
|
+
const floating = (0, import_react27.useFloating)({
|
|
1791
|
+
open: isOpen,
|
|
1792
|
+
onOpenChange: (open) => {
|
|
1793
|
+
if (!open && onClose != null) {
|
|
1794
|
+
onClose({ reason: "outside-click" });
|
|
1795
|
+
}
|
|
1796
|
+
},
|
|
1797
|
+
placement,
|
|
1798
|
+
middleware: [(0, import_react27.offset)(offsetValue)],
|
|
1799
|
+
whileElementsMounted: import_react27.autoUpdate,
|
|
1800
|
+
strategy: "fixed"
|
|
1801
|
+
});
|
|
1802
|
+
(0, import_react28.useEffect)(() => {
|
|
1803
|
+
if (anchorRef?.current) {
|
|
1804
|
+
floating.refs.setReference(anchorRef.current);
|
|
1805
|
+
}
|
|
1806
|
+
}, [anchorRef, floating.refs]);
|
|
1807
|
+
const contentId = (0, import_react27.useId)() ?? "";
|
|
1808
|
+
const panelId = `${contentId}-panel`;
|
|
1809
|
+
const contextValue = (0, import_react28.useMemo)(
|
|
1810
|
+
() => ({
|
|
1811
|
+
isOpen,
|
|
1812
|
+
triggerRef,
|
|
1813
|
+
anchorRef,
|
|
1814
|
+
floating,
|
|
1815
|
+
contentId,
|
|
1816
|
+
panelId,
|
|
1817
|
+
onClose
|
|
1818
|
+
}),
|
|
1819
|
+
[isOpen, triggerRef, anchorRef, floating, contentId, panelId, onClose]
|
|
1820
|
+
);
|
|
1821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PopoverContext.Provider, { value: contextValue, children });
|
|
1822
|
+
}
|
|
1823
|
+
Popover.Trigger = PopoverTrigger;
|
|
1824
|
+
Popover.Content = PopoverContent;
|
|
1825
|
+
|
|
1826
|
+
// src/popup/popup.tsx
|
|
1827
|
+
var import_react31 = require("react");
|
|
1828
|
+
|
|
1829
|
+
// src/popup/popup-body.tsx
|
|
1830
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1831
|
+
function PopupBody({ children }) {
|
|
1832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "overflow-y-auto", children });
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
// src/popup/popup-context.ts
|
|
1836
|
+
var import_react29 = require("react");
|
|
1837
|
+
var PopupContext = (0, import_react29.createContext)({
|
|
1838
|
+
isOpen: false,
|
|
1839
|
+
onClose: () => null
|
|
1840
|
+
});
|
|
1841
|
+
|
|
1842
|
+
// src/popup/popup-footer.tsx
|
|
1843
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1844
|
+
function PopupFooter({ children }) {
|
|
1845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex w-full shrink-0 items-center rounded-b-lg px-6 py-3", children });
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
// src/popup/popup-header.tsx
|
|
1849
|
+
var import_react30 = require("react");
|
|
1850
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1851
|
+
function PopupHeader({ children, before }) {
|
|
1852
|
+
const { onClose } = (0, import_react30.useContext)(PopupContext);
|
|
1853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("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: [
|
|
1854
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
1855
|
+
before,
|
|
1856
|
+
children
|
|
1857
|
+
] }),
|
|
1858
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(IconButton, { icon: "close", size: "small", variant: "text", onClick: onClose })
|
|
1859
|
+
] });
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
// src/popup/popup.tsx
|
|
1863
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1864
|
+
var LIMIT_WIDTH2 = 320;
|
|
1865
|
+
var LIMIT_HEIGHT2 = 184;
|
|
1866
|
+
function useOptionalPopoverContext() {
|
|
1867
|
+
return (0, import_react31.useContext)(PopoverContext);
|
|
1868
|
+
}
|
|
1869
|
+
function Popup({ children, isOpen: controlledIsOpen, width = 480, height, onClose }) {
|
|
1870
|
+
const renderWidth = typeof width === "number" ? Math.max(width, LIMIT_WIDTH2) : width;
|
|
1871
|
+
const renderHeight = typeof height === "number" ? Math.max(height, LIMIT_HEIGHT2) : height;
|
|
1872
|
+
const popoverContext = useOptionalPopoverContext();
|
|
1873
|
+
const isInPopover = popoverContext != null;
|
|
1874
|
+
const isOpen = isInPopover ? popoverContext.isOpen : controlledIsOpen ?? false;
|
|
1875
|
+
if (!isOpen) {
|
|
1876
|
+
return null;
|
|
1877
|
+
}
|
|
1878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PopupContext.Provider, { value: { isOpen, onClose }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1879
|
+
"div",
|
|
1880
|
+
{
|
|
1881
|
+
className: "grid max-h-full grid-rows-[max-content_1fr_max-content] flex-col rounded-lg bg-uiBackground01 shadow-floatingShadow",
|
|
1882
|
+
style: { width: renderWidth, height: renderHeight },
|
|
1883
|
+
children
|
|
1884
|
+
}
|
|
1885
|
+
) });
|
|
1886
|
+
}
|
|
1887
|
+
Popup.Body = PopupBody;
|
|
1888
|
+
Popup.Header = PopupHeader;
|
|
1889
|
+
Popup.Footer = PopupFooter;
|
|
1890
|
+
|
|
1223
1891
|
// src/radio/radio.tsx
|
|
1224
1892
|
var import_component_theme13 = require("@zenkigen-inc/component-theme");
|
|
1225
|
-
var
|
|
1226
|
-
var
|
|
1227
|
-
var
|
|
1893
|
+
var import_clsx21 = __toESM(require("clsx"));
|
|
1894
|
+
var import_react32 = require("react");
|
|
1895
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1228
1896
|
function Radio({ name, value, id, label, isChecked = false, isDisabled = false, onChange }) {
|
|
1229
|
-
const [isMouseOver, setIsMouseOver] = (0,
|
|
1230
|
-
const handleMouseOverInput = (0,
|
|
1897
|
+
const [isMouseOver, setIsMouseOver] = (0, import_react32.useState)(false);
|
|
1898
|
+
const handleMouseOverInput = (0, import_react32.useCallback)(() => {
|
|
1231
1899
|
setIsMouseOver(true);
|
|
1232
1900
|
}, []);
|
|
1233
|
-
const handleMouseOutInput = (0,
|
|
1901
|
+
const handleMouseOutInput = (0, import_react32.useCallback)(() => {
|
|
1234
1902
|
setIsMouseOver(false);
|
|
1235
1903
|
}, []);
|
|
1236
|
-
const handleChange = (0,
|
|
1904
|
+
const handleChange = (0, import_react32.useCallback)(
|
|
1237
1905
|
(e) => !isDisabled && onChange?.(e),
|
|
1238
1906
|
[isDisabled, onChange]
|
|
1239
1907
|
);
|
|
1240
|
-
const inputClasses = (0,
|
|
1908
|
+
const inputClasses = (0, import_clsx21.default)("peer absolute z-[1] size-6 opacity-0", {
|
|
1241
1909
|
"cursor-not-allowed": isDisabled,
|
|
1242
1910
|
"cursor-pointer": !isDisabled
|
|
1243
1911
|
});
|
|
1244
|
-
const boxClasses = (0,
|
|
1912
|
+
const boxClasses = (0, import_clsx21.default)(
|
|
1245
1913
|
"inline-flex size-5 items-center justify-center rounded-full border border-solid bg-white",
|
|
1246
1914
|
import_component_theme13.focusVisible.normalPeer,
|
|
1247
1915
|
{
|
|
@@ -1252,22 +1920,22 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
1252
1920
|
"cursor-pointer": !isDisabled
|
|
1253
1921
|
}
|
|
1254
1922
|
);
|
|
1255
|
-
const afterClasses = (0,
|
|
1923
|
+
const afterClasses = (0, import_clsx21.default)("absolute inset-0 m-auto block size-3 rounded-full", {
|
|
1256
1924
|
"bg-disabled01": isDisabled && isChecked,
|
|
1257
1925
|
"bg-activeSelectedUi": !isDisabled && isChecked,
|
|
1258
1926
|
"scale-0": !isChecked,
|
|
1259
1927
|
"scale-100": isChecked
|
|
1260
1928
|
});
|
|
1261
|
-
const hoverIndicatorClasses = (0,
|
|
1929
|
+
const hoverIndicatorClasses = (0, import_clsx21.default)("inline-block size-3 rounded-full", {
|
|
1262
1930
|
"bg-hoverUi": !isDisabled && !isChecked && isMouseOver
|
|
1263
1931
|
});
|
|
1264
|
-
const labelClasses = (0,
|
|
1932
|
+
const labelClasses = (0, import_clsx21.default)("typography-label14regular ml-2 flex-[1_0_0] select-none break-all", {
|
|
1265
1933
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
1266
1934
|
"cursor-pointer text-text01": !isDisabled
|
|
1267
1935
|
});
|
|
1268
|
-
return /* @__PURE__ */ (0,
|
|
1269
|
-
/* @__PURE__ */ (0,
|
|
1270
|
-
/* @__PURE__ */ (0,
|
|
1936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center", children: [
|
|
1937
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex size-6 items-center justify-center", children: [
|
|
1938
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1271
1939
|
"input",
|
|
1272
1940
|
{
|
|
1273
1941
|
type: "checkbox",
|
|
@@ -1282,32 +1950,32 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
1282
1950
|
className: inputClasses
|
|
1283
1951
|
}
|
|
1284
1952
|
),
|
|
1285
|
-
/* @__PURE__ */ (0,
|
|
1286
|
-
/* @__PURE__ */ (0,
|
|
1287
|
-
/* @__PURE__ */ (0,
|
|
1953
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: boxClasses, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "relative flex size-5 flex-[0_0_auto] items-center justify-center", children: [
|
|
1954
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: afterClasses }),
|
|
1955
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: hoverIndicatorClasses })
|
|
1288
1956
|
] }) })
|
|
1289
1957
|
] }),
|
|
1290
|
-
/* @__PURE__ */ (0,
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("label", { htmlFor: id, className: labelClasses, children: label })
|
|
1291
1959
|
] });
|
|
1292
1960
|
}
|
|
1293
1961
|
|
|
1294
1962
|
// src/search/search.tsx
|
|
1295
|
-
var
|
|
1296
|
-
var
|
|
1297
|
-
var
|
|
1298
|
-
var Search = (0,
|
|
1299
|
-
const classes = (0,
|
|
1963
|
+
var import_clsx22 = require("clsx");
|
|
1964
|
+
var import_react33 = require("react");
|
|
1965
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1966
|
+
var Search = (0, import_react33.forwardRef)(({ width = "100%", size = "medium", ...props }, ref) => {
|
|
1967
|
+
const classes = (0, import_clsx22.clsx)(
|
|
1300
1968
|
"flex items-center rounded-full border border-uiBorder02 bg-uiBackground01 focus-within:border-activeInput",
|
|
1301
1969
|
{ "h-8 px-3": size === "medium" },
|
|
1302
1970
|
{ "h-10 px-4": size === "large" }
|
|
1303
1971
|
);
|
|
1304
|
-
const inputClasses = (0,
|
|
1972
|
+
const inputClasses = (0, import_clsx22.clsx)("mx-2 h-full flex-1 text-text01 outline-0 placeholder:text-textPlaceholder", {
|
|
1305
1973
|
["typography-label14regular"]: size === "medium",
|
|
1306
1974
|
["typography-label16regular"]: size === "large"
|
|
1307
1975
|
});
|
|
1308
|
-
return /* @__PURE__ */ (0,
|
|
1309
|
-
/* @__PURE__ */ (0,
|
|
1310
|
-
/* @__PURE__ */ (0,
|
|
1976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "relative", ref, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("form", { onSubmit: props.onSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: classes, style: { width }, children: [
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Icon, { name: "search", color: "icon01", size: "medium" }),
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1311
1979
|
"input",
|
|
1312
1980
|
{
|
|
1313
1981
|
type: "text",
|
|
@@ -1318,7 +1986,7 @@ var Search = (0, import_react20.forwardRef)(({ width = "100%", size = "medium",
|
|
|
1318
1986
|
onChange: props.onChange
|
|
1319
1987
|
}
|
|
1320
1988
|
),
|
|
1321
|
-
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */ (0,
|
|
1989
|
+
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1322
1990
|
IconButton,
|
|
1323
1991
|
{
|
|
1324
1992
|
variant: "text",
|
|
@@ -1333,17 +2001,17 @@ var Search = (0, import_react20.forwardRef)(({ width = "100%", size = "medium",
|
|
|
1333
2001
|
Search.displayName = "Search";
|
|
1334
2002
|
|
|
1335
2003
|
// src/segmented-control/segmented-control.tsx
|
|
1336
|
-
var
|
|
2004
|
+
var import_react36 = __toESM(require("react"));
|
|
1337
2005
|
|
|
1338
2006
|
// src/segmented-control/segmented-control-context.ts
|
|
1339
|
-
var
|
|
1340
|
-
var SegmentedControlContext = (0,
|
|
2007
|
+
var import_react34 = require("react");
|
|
2008
|
+
var SegmentedControlContext = (0, import_react34.createContext)(null);
|
|
1341
2009
|
|
|
1342
2010
|
// src/segmented-control/segmented-control-item.tsx
|
|
1343
2011
|
var import_component_theme14 = require("@zenkigen-inc/component-theme");
|
|
1344
|
-
var
|
|
1345
|
-
var
|
|
1346
|
-
var
|
|
2012
|
+
var import_clsx23 = require("clsx");
|
|
2013
|
+
var import_react35 = require("react");
|
|
2014
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1347
2015
|
var SegmentedControlItem = ({
|
|
1348
2016
|
label,
|
|
1349
2017
|
value,
|
|
@@ -1352,9 +2020,9 @@ var SegmentedControlItem = ({
|
|
|
1352
2020
|
"aria-label": ariaLabel,
|
|
1353
2021
|
...rest
|
|
1354
2022
|
}) => {
|
|
1355
|
-
const context = (0,
|
|
1356
|
-
const buttonRef = (0,
|
|
1357
|
-
const lastInteractionWasMouse = (0,
|
|
2023
|
+
const context = (0, import_react35.useContext)(SegmentedControlContext);
|
|
2024
|
+
const buttonRef = (0, import_react35.useRef)(null);
|
|
2025
|
+
const lastInteractionWasMouse = (0, import_react35.useRef)(false);
|
|
1358
2026
|
if (context === null) {
|
|
1359
2027
|
throw new Error("SegmentedControl.Item must be used within SegmentedControl");
|
|
1360
2028
|
}
|
|
@@ -1370,7 +2038,7 @@ var SegmentedControlItem = ({
|
|
|
1370
2038
|
const isSelected = value === selectedValue;
|
|
1371
2039
|
const isFocused = value === focusedValue;
|
|
1372
2040
|
const isOptionDisabled = isContextDisabled || itemDisabled === true;
|
|
1373
|
-
(0,
|
|
2041
|
+
(0, import_react35.useEffect)(() => {
|
|
1374
2042
|
if (isFocused === true && buttonRef.current !== null) {
|
|
1375
2043
|
buttonRef.current.focus();
|
|
1376
2044
|
}
|
|
@@ -1392,7 +2060,7 @@ var SegmentedControlItem = ({
|
|
|
1392
2060
|
lastInteractionWasMouse.current = false;
|
|
1393
2061
|
onBlur?.();
|
|
1394
2062
|
};
|
|
1395
|
-
const buttonClasses = (0,
|
|
2063
|
+
const buttonClasses = (0, import_clsx23.clsx)("relative flex items-center justify-center gap-1 rounded", import_component_theme14.focusVisible.normal, {
|
|
1396
2064
|
"px-2 min-h-[24px] typography-label12regular": size === "small",
|
|
1397
2065
|
"px-4 min-h-[32px] typography-label14regular": size === "medium",
|
|
1398
2066
|
// States - Default with hover
|
|
@@ -1402,7 +2070,7 @@ var SegmentedControlItem = ({
|
|
|
1402
2070
|
// States - Disabled
|
|
1403
2071
|
"text-disabled01 bg-transparent": isOptionDisabled === true
|
|
1404
2072
|
});
|
|
1405
|
-
return /* @__PURE__ */ (0,
|
|
2073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
1406
2074
|
"button",
|
|
1407
2075
|
{
|
|
1408
2076
|
ref: buttonRef,
|
|
@@ -1419,25 +2087,25 @@ var SegmentedControlItem = ({
|
|
|
1419
2087
|
onMouseDown: handleMouseDown,
|
|
1420
2088
|
...rest,
|
|
1421
2089
|
children: [
|
|
1422
|
-
Boolean(icon) === true && icon && /* @__PURE__ */ (0,
|
|
2090
|
+
Boolean(icon) === true && icon && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1423
2091
|
"span",
|
|
1424
2092
|
{
|
|
1425
|
-
className: (0,
|
|
2093
|
+
className: (0, import_clsx23.clsx)("flex items-center", {
|
|
1426
2094
|
"fill-disabled01": isOptionDisabled === true,
|
|
1427
2095
|
"fill-interactive01": isSelected === true && isOptionDisabled === false,
|
|
1428
2096
|
"fill-icon01": isSelected === false && isOptionDisabled === false
|
|
1429
2097
|
}),
|
|
1430
|
-
children: /* @__PURE__ */ (0,
|
|
2098
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, { name: icon, size: "small" })
|
|
1431
2099
|
}
|
|
1432
2100
|
),
|
|
1433
|
-
Boolean(label) === true && /* @__PURE__ */ (0,
|
|
2101
|
+
Boolean(label) === true && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "whitespace-nowrap", children: label })
|
|
1434
2102
|
]
|
|
1435
2103
|
}
|
|
1436
2104
|
);
|
|
1437
2105
|
};
|
|
1438
2106
|
|
|
1439
2107
|
// src/segmented-control/segmented-control.tsx
|
|
1440
|
-
var
|
|
2108
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1441
2109
|
var SegmentedControl = ({
|
|
1442
2110
|
children,
|
|
1443
2111
|
value,
|
|
@@ -1447,15 +2115,15 @@ var SegmentedControl = ({
|
|
|
1447
2115
|
"aria-label": ariaLabel,
|
|
1448
2116
|
...rest
|
|
1449
2117
|
}) => {
|
|
1450
|
-
const containerRef = (0,
|
|
1451
|
-
const itemIds =
|
|
1452
|
-
if (!
|
|
2118
|
+
const containerRef = (0, import_react36.useRef)(null);
|
|
2119
|
+
const itemIds = import_react36.Children.toArray(children).filter((child) => {
|
|
2120
|
+
if (!import_react36.default.isValidElement(child) || typeof child.props !== "object" || child.props === null || !("value" in child.props)) {
|
|
1453
2121
|
return false;
|
|
1454
2122
|
}
|
|
1455
2123
|
const props = child.props;
|
|
1456
2124
|
return props.isDisabled !== true;
|
|
1457
2125
|
}).map((child) => child.props.value);
|
|
1458
|
-
const childrenCount =
|
|
2126
|
+
const childrenCount = import_react36.Children.count(children);
|
|
1459
2127
|
const containerStyle = { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` };
|
|
1460
2128
|
const {
|
|
1461
2129
|
focusedValue,
|
|
@@ -1482,7 +2150,7 @@ var SegmentedControl = ({
|
|
|
1482
2150
|
onBlur: handleBlurRovingFocus,
|
|
1483
2151
|
values: itemIds
|
|
1484
2152
|
};
|
|
1485
|
-
return /* @__PURE__ */ (0,
|
|
2153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SegmentedControlContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1486
2154
|
"div",
|
|
1487
2155
|
{
|
|
1488
2156
|
ref: containerRef,
|
|
@@ -1500,19 +2168,19 @@ SegmentedControl.Item = SegmentedControlItem;
|
|
|
1500
2168
|
|
|
1501
2169
|
// src/select-sort/select-sort.tsx
|
|
1502
2170
|
var import_component_theme17 = require("@zenkigen-inc/component-theme");
|
|
1503
|
-
var
|
|
1504
|
-
var
|
|
2171
|
+
var import_clsx26 = __toESM(require("clsx"));
|
|
2172
|
+
var import_react37 = require("react");
|
|
1505
2173
|
|
|
1506
2174
|
// src/select-sort/select-list.tsx
|
|
1507
2175
|
var import_component_theme16 = require("@zenkigen-inc/component-theme");
|
|
1508
|
-
var
|
|
2176
|
+
var import_clsx25 = __toESM(require("clsx"));
|
|
1509
2177
|
|
|
1510
2178
|
// src/select-sort/select-item.tsx
|
|
1511
2179
|
var import_component_theme15 = require("@zenkigen-inc/component-theme");
|
|
1512
|
-
var
|
|
1513
|
-
var
|
|
2180
|
+
var import_clsx24 = __toESM(require("clsx"));
|
|
2181
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1514
2182
|
function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
1515
|
-
const itemClasses = (0,
|
|
2183
|
+
const itemClasses = (0, import_clsx24.default)(
|
|
1516
2184
|
"typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
1517
2185
|
import_component_theme15.focusVisible.inset,
|
|
1518
2186
|
{
|
|
@@ -1520,16 +2188,16 @@ function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
|
1520
2188
|
"bg-uiBackground01 fill-icon01 text-interactive02": !isSortKey
|
|
1521
2189
|
}
|
|
1522
2190
|
);
|
|
1523
|
-
return /* @__PURE__ */ (0,
|
|
1524
|
-
/* @__PURE__ */ (0,
|
|
1525
|
-
isSortKey && /* @__PURE__ */ (0,
|
|
2191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("li", { className: "flex w-full items-center", onClick: onClickItem, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("button", { className: itemClasses, type: "button", children: [
|
|
2192
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "ml-1 mr-6", children }),
|
|
2193
|
+
isSortKey && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { name: "check", size: "small" }) })
|
|
1526
2194
|
] }) });
|
|
1527
2195
|
}
|
|
1528
2196
|
|
|
1529
2197
|
// src/select-sort/select-list.tsx
|
|
1530
|
-
var
|
|
2198
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1531
2199
|
function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect }) {
|
|
1532
|
-
const listClasses = (0,
|
|
2200
|
+
const listClasses = (0, import_clsx25.default)(
|
|
1533
2201
|
"absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow",
|
|
1534
2202
|
{
|
|
1535
2203
|
"top-7": size === "x-small" || size === "small",
|
|
@@ -1538,19 +2206,19 @@ function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect })
|
|
|
1538
2206
|
"border-solid border border-uiBorder01": variant === "outline"
|
|
1539
2207
|
}
|
|
1540
2208
|
);
|
|
1541
|
-
const deselectButtonClasses = (0,
|
|
2209
|
+
const deselectButtonClasses = (0, import_clsx25.default)(
|
|
1542
2210
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
1543
2211
|
import_component_theme16.focusVisible.inset
|
|
1544
2212
|
);
|
|
1545
|
-
return /* @__PURE__ */ (0,
|
|
1546
|
-
/* @__PURE__ */ (0,
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1548
|
-
sortOrder !== null && onClickDeselect && /* @__PURE__ */ (0,
|
|
2213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("ul", { className: listClasses, children: [
|
|
2214
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SelectItem2, { isSortKey: sortOrder === "ascend", onClickItem: () => onClickItem("ascend"), children: "\u6607\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
2215
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SelectItem2, { isSortKey: sortOrder === "descend", onClickItem: () => onClickItem("descend"), children: "\u964D\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
2216
|
+
sortOrder !== null && onClickDeselect && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { className: deselectButtonClasses, type: "button", onClick: onClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
|
|
1549
2217
|
] });
|
|
1550
2218
|
}
|
|
1551
2219
|
|
|
1552
2220
|
// src/select-sort/select-sort.tsx
|
|
1553
|
-
var
|
|
2221
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1554
2222
|
function SelectSort({
|
|
1555
2223
|
size = "medium",
|
|
1556
2224
|
variant = "outline",
|
|
@@ -1562,24 +2230,24 @@ function SelectSort({
|
|
|
1562
2230
|
onChange,
|
|
1563
2231
|
onClickDeselect
|
|
1564
2232
|
}) {
|
|
1565
|
-
const [isOptionListOpen, setIsOptionListOpen] = (0,
|
|
1566
|
-
const targetRef = (0,
|
|
2233
|
+
const [isOptionListOpen, setIsOptionListOpen] = (0, import_react37.useState)(false);
|
|
2234
|
+
const targetRef = (0, import_react37.useRef)(null);
|
|
1567
2235
|
useOutsideClick(targetRef, () => setIsOptionListOpen(false));
|
|
1568
2236
|
const handleClickToggle = () => setIsOptionListOpen((prev) => !prev);
|
|
1569
|
-
const handleClickItem = (0,
|
|
2237
|
+
const handleClickItem = (0, import_react37.useCallback)(
|
|
1570
2238
|
(value) => {
|
|
1571
2239
|
onChange?.(value);
|
|
1572
2240
|
setIsOptionListOpen(false);
|
|
1573
2241
|
},
|
|
1574
2242
|
[onChange]
|
|
1575
2243
|
);
|
|
1576
|
-
const wrapperClasses = (0,
|
|
2244
|
+
const wrapperClasses = (0, import_clsx26.default)("relative flex shrink-0 items-center gap-1 rounded", {
|
|
1577
2245
|
"h-6": size === "x-small" || size === "small",
|
|
1578
2246
|
"h-8": size === "medium",
|
|
1579
2247
|
"h-10": size === "large",
|
|
1580
2248
|
"cursor-not-allowed": isDisabled
|
|
1581
2249
|
});
|
|
1582
|
-
const buttonClasses = (0,
|
|
2250
|
+
const buttonClasses = (0, import_clsx26.default)(
|
|
1583
2251
|
"flex size-full items-center rounded",
|
|
1584
2252
|
import_component_theme17.buttonColors[variant].hover,
|
|
1585
2253
|
import_component_theme17.buttonColors[variant].active,
|
|
@@ -1593,23 +2261,23 @@ function SelectSort({
|
|
|
1593
2261
|
"pointer-events-none": isDisabled
|
|
1594
2262
|
}
|
|
1595
2263
|
);
|
|
1596
|
-
const labelClasses = (0,
|
|
2264
|
+
const labelClasses = (0, import_clsx26.default)("truncate", {
|
|
1597
2265
|
"typography-label12regular": size === "x-small",
|
|
1598
2266
|
"typography-label14regular": size === "small" || size === "medium",
|
|
1599
2267
|
"typography-label16regular": size === "large",
|
|
1600
2268
|
"mr-1": size === "x-small",
|
|
1601
2269
|
"mr-2": size !== "x-small"
|
|
1602
2270
|
});
|
|
1603
|
-
return /* @__PURE__ */ (0,
|
|
1604
|
-
/* @__PURE__ */ (0,
|
|
1605
|
-
/* @__PURE__ */ (0,
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
2271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: wrapperClasses, style: { width }, ref: targetRef, children: [
|
|
2272
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("button", { className: buttonClasses, type: "button", onClick: handleClickToggle, disabled: isDisabled, children: [
|
|
2273
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: labelClasses, children: label }),
|
|
2274
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "ml-auto flex items-center", children: isSortKey ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1607
2275
|
Icon,
|
|
1608
2276
|
{
|
|
1609
2277
|
name: sortOrder === "ascend" ? "arrow-up" : "arrow-down",
|
|
1610
2278
|
size: size === "large" ? "medium" : "small"
|
|
1611
2279
|
}
|
|
1612
|
-
) : /* @__PURE__ */ (0,
|
|
2280
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1613
2281
|
Icon,
|
|
1614
2282
|
{
|
|
1615
2283
|
name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
|
|
@@ -1617,7 +2285,7 @@ function SelectSort({
|
|
|
1617
2285
|
}
|
|
1618
2286
|
) })
|
|
1619
2287
|
] }),
|
|
1620
|
-
isOptionListOpen && !isDisabled && /* @__PURE__ */ (0,
|
|
2288
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1621
2289
|
SelectList2,
|
|
1622
2290
|
{
|
|
1623
2291
|
size,
|
|
@@ -1632,9 +2300,9 @@ function SelectSort({
|
|
|
1632
2300
|
|
|
1633
2301
|
// src/sort-button/sort-button.tsx
|
|
1634
2302
|
var import_component_theme18 = require("@zenkigen-inc/component-theme");
|
|
1635
|
-
var
|
|
1636
|
-
var
|
|
1637
|
-
var
|
|
2303
|
+
var import_clsx27 = __toESM(require("clsx"));
|
|
2304
|
+
var import_react38 = require("react");
|
|
2305
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1638
2306
|
function SortButton({
|
|
1639
2307
|
size = "medium",
|
|
1640
2308
|
width,
|
|
@@ -1645,7 +2313,7 @@ function SortButton({
|
|
|
1645
2313
|
"aria-label": ariaLabel,
|
|
1646
2314
|
...rest
|
|
1647
2315
|
}) {
|
|
1648
|
-
const handleClick = (0,
|
|
2316
|
+
const handleClick = (0, import_react38.useCallback)(() => {
|
|
1649
2317
|
if (isDisabled || !onClick) return;
|
|
1650
2318
|
onClick();
|
|
1651
2319
|
}, [isDisabled, onClick]);
|
|
@@ -1654,13 +2322,13 @@ function SortButton({
|
|
|
1654
2322
|
if (sortOrder === "descend") return "arrow-down";
|
|
1655
2323
|
return "angle-small-down";
|
|
1656
2324
|
};
|
|
1657
|
-
const wrapperClasses = (0,
|
|
2325
|
+
const wrapperClasses = (0, import_clsx27.default)("relative flex shrink-0 items-center gap-1 rounded", {
|
|
1658
2326
|
"h-6": size === "x-small" || size === "small",
|
|
1659
2327
|
"h-8": size === "medium",
|
|
1660
2328
|
"h-10": size === "large",
|
|
1661
2329
|
"cursor-not-allowed": isDisabled
|
|
1662
2330
|
});
|
|
1663
|
-
const buttonClasses = (0,
|
|
2331
|
+
const buttonClasses = (0, import_clsx27.default)(
|
|
1664
2332
|
"flex size-full items-center rounded",
|
|
1665
2333
|
import_component_theme18.buttonColors.text.hover,
|
|
1666
2334
|
import_component_theme18.buttonColors.text.active,
|
|
@@ -1676,14 +2344,14 @@ function SortButton({
|
|
|
1676
2344
|
"pointer-events-none": isDisabled
|
|
1677
2345
|
}
|
|
1678
2346
|
);
|
|
1679
|
-
const labelClasses = (0,
|
|
2347
|
+
const labelClasses = (0, import_clsx27.default)("truncate", {
|
|
1680
2348
|
"typography-label12regular": size === "x-small",
|
|
1681
2349
|
"typography-label14regular": size === "small" || size === "medium",
|
|
1682
2350
|
"typography-label16regular": size === "large",
|
|
1683
2351
|
"mr-1": size === "x-small",
|
|
1684
2352
|
"mr-2": size !== "x-small"
|
|
1685
2353
|
});
|
|
1686
|
-
return /* @__PURE__ */ (0,
|
|
2354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: wrapperClasses, style: { width }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
1687
2355
|
"button",
|
|
1688
2356
|
{
|
|
1689
2357
|
className: buttonClasses,
|
|
@@ -1694,22 +2362,22 @@ function SortButton({
|
|
|
1694
2362
|
"aria-label": ariaLabel,
|
|
1695
2363
|
"aria-disabled": isDisabled,
|
|
1696
2364
|
children: [
|
|
1697
|
-
/* @__PURE__ */ (0,
|
|
1698
|
-
/* @__PURE__ */ (0,
|
|
2365
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: labelClasses, children: label }),
|
|
2366
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { name: getIconName(), size: size === "large" ? "medium" : "small" }) })
|
|
1699
2367
|
]
|
|
1700
2368
|
}
|
|
1701
2369
|
) });
|
|
1702
2370
|
}
|
|
1703
2371
|
|
|
1704
2372
|
// src/tab/tab.tsx
|
|
1705
|
-
var
|
|
1706
|
-
var
|
|
2373
|
+
var import_clsx29 = require("clsx");
|
|
2374
|
+
var import_react39 = require("react");
|
|
1707
2375
|
|
|
1708
2376
|
// src/tab/tab-item.tsx
|
|
1709
|
-
var
|
|
1710
|
-
var
|
|
2377
|
+
var import_clsx28 = require("clsx");
|
|
2378
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1711
2379
|
var TabItem = ({ isSelected = false, ...props }) => {
|
|
1712
|
-
const classes = (0,
|
|
2380
|
+
const classes = (0, import_clsx28.clsx)(
|
|
1713
2381
|
"relative z-0 flex justify-center py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-px hover:text-text01 disabled:pointer-events-none disabled:text-disabled01",
|
|
1714
2382
|
{
|
|
1715
2383
|
"typography-label14regular": !isSelected,
|
|
@@ -1718,7 +2386,7 @@ var TabItem = ({ isSelected = false, ...props }) => {
|
|
|
1718
2386
|
"before:bg-interactive01 hover:before:bg-interactive01 pointer-events-none": isSelected
|
|
1719
2387
|
}
|
|
1720
2388
|
);
|
|
1721
|
-
return /* @__PURE__ */ (0,
|
|
2389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1722
2390
|
"button",
|
|
1723
2391
|
{
|
|
1724
2392
|
type: "button",
|
|
@@ -1733,39 +2401,39 @@ var TabItem = ({ isSelected = false, ...props }) => {
|
|
|
1733
2401
|
};
|
|
1734
2402
|
|
|
1735
2403
|
// src/tab/tab.tsx
|
|
1736
|
-
var
|
|
2404
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1737
2405
|
function Tab({ children, layout = "auto" }) {
|
|
1738
|
-
const childrenCount =
|
|
2406
|
+
const childrenCount = import_react39.Children.count(children);
|
|
1739
2407
|
const containerStyle = layout === "equal" ? { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` } : {};
|
|
1740
|
-
const containerClasses = (0,
|
|
2408
|
+
const containerClasses = (0, import_clsx29.clsx)(
|
|
1741
2409
|
"relative gap-4 px-6 before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-uiBorder01",
|
|
1742
2410
|
{
|
|
1743
2411
|
flex: layout === "auto",
|
|
1744
2412
|
grid: layout === "equal"
|
|
1745
2413
|
}
|
|
1746
2414
|
);
|
|
1747
|
-
return /* @__PURE__ */ (0,
|
|
2415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { role: "tablist", className: containerClasses, style: containerStyle, children });
|
|
1748
2416
|
}
|
|
1749
2417
|
Tab.Item = TabItem;
|
|
1750
2418
|
|
|
1751
2419
|
// src/table/table-cell.tsx
|
|
1752
|
-
var
|
|
1753
|
-
var
|
|
2420
|
+
var import_clsx30 = __toESM(require("clsx"));
|
|
2421
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1754
2422
|
function TableCell({ children, className, isHeader = false }) {
|
|
1755
|
-
const classes = (0,
|
|
1756
|
-
return /* @__PURE__ */ (0,
|
|
2423
|
+
const classes = (0, import_clsx30.default)("border-b border-uiBorder01", { "sticky top-0 z-10 bg-white": isHeader }, className);
|
|
2424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: classes, children });
|
|
1757
2425
|
}
|
|
1758
2426
|
|
|
1759
2427
|
// src/table/table-row.tsx
|
|
1760
|
-
var
|
|
1761
|
-
var
|
|
2428
|
+
var import_clsx31 = __toESM(require("clsx"));
|
|
2429
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
1762
2430
|
function TableRow({ children, isHoverBackgroundVisible = false }) {
|
|
1763
|
-
const rowClasses = (0,
|
|
1764
|
-
return /* @__PURE__ */ (0,
|
|
2431
|
+
const rowClasses = (0, import_clsx31.default)("contents", isHoverBackgroundVisible && "[&:hover>div]:bg-hoverUi02");
|
|
2432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: rowClasses, children });
|
|
1765
2433
|
}
|
|
1766
2434
|
|
|
1767
2435
|
// src/table/table.tsx
|
|
1768
|
-
var
|
|
2436
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
1769
2437
|
function Table({
|
|
1770
2438
|
width,
|
|
1771
2439
|
templateRows,
|
|
@@ -1774,7 +2442,7 @@ function Table({
|
|
|
1774
2442
|
autoRows,
|
|
1775
2443
|
children
|
|
1776
2444
|
}) {
|
|
1777
|
-
return /* @__PURE__ */ (0,
|
|
2445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1778
2446
|
"div",
|
|
1779
2447
|
{
|
|
1780
2448
|
className: "grid",
|
|
@@ -1794,22 +2462,22 @@ Table.Cell = TableCell;
|
|
|
1794
2462
|
|
|
1795
2463
|
// src/tag/tag.tsx
|
|
1796
2464
|
var import_component_theme20 = require("@zenkigen-inc/component-theme");
|
|
1797
|
-
var
|
|
2465
|
+
var import_clsx33 = __toESM(require("clsx"));
|
|
1798
2466
|
|
|
1799
2467
|
// src/tag/delete-icon.tsx
|
|
1800
2468
|
var import_component_theme19 = require("@zenkigen-inc/component-theme");
|
|
1801
|
-
var
|
|
1802
|
-
var
|
|
2469
|
+
var import_clsx32 = __toESM(require("clsx"));
|
|
2470
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
1803
2471
|
var DeleteIcon = ({ color, variant, onClick }) => {
|
|
1804
|
-
const deleteButtonClasses = (0,
|
|
2472
|
+
const deleteButtonClasses = (0, import_clsx32.default)(
|
|
1805
2473
|
"group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor",
|
|
1806
2474
|
import_component_theme19.focusVisible.normal
|
|
1807
2475
|
);
|
|
1808
|
-
const deletePathClasses = (0,
|
|
2476
|
+
const deletePathClasses = (0, import_clsx32.default)({
|
|
1809
2477
|
"fill-interactive02": color === "gray" || variant === "light",
|
|
1810
2478
|
"group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor": color !== "gray"
|
|
1811
2479
|
});
|
|
1812
|
-
return /* @__PURE__ */ (0,
|
|
2480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", className: deleteButtonClasses, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
1813
2481
|
"path",
|
|
1814
2482
|
{
|
|
1815
2483
|
fillRule: "evenodd",
|
|
@@ -1821,9 +2489,9 @@ var DeleteIcon = ({ color, variant, onClick }) => {
|
|
|
1821
2489
|
};
|
|
1822
2490
|
|
|
1823
2491
|
// src/tag/tag.tsx
|
|
1824
|
-
var
|
|
2492
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
1825
2493
|
function Tag({ id, children, color, variant = "normal", size = "medium", isEditable, onDelete }) {
|
|
1826
|
-
const wrapperClasses = (0,
|
|
2494
|
+
const wrapperClasses = (0, import_clsx33.default)("flex", "items-center", "justify-center", {
|
|
1827
2495
|
[import_component_theme20.tagColors[color]]: variant === "normal",
|
|
1828
2496
|
[import_component_theme20.tagLightColors[color]]: variant === "light",
|
|
1829
2497
|
"h-[14px] typography-label11regular": !isEditable && size === "x-small",
|
|
@@ -1835,17 +2503,17 @@ function Tag({ id, children, color, variant = "normal", size = "medium", isEdita
|
|
|
1835
2503
|
"py-0.5 px-1": !isEditable,
|
|
1836
2504
|
"py-1 px-2": isEditable
|
|
1837
2505
|
});
|
|
1838
|
-
return /* @__PURE__ */ (0,
|
|
2506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: wrapperClasses, children: [
|
|
1839
2507
|
children,
|
|
1840
|
-
isEditable ? /* @__PURE__ */ (0,
|
|
2508
|
+
isEditable ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(DeleteIcon, { onClick: () => onDelete(id), color, variant }) : null
|
|
1841
2509
|
] });
|
|
1842
2510
|
}
|
|
1843
2511
|
|
|
1844
2512
|
// src/text-area/text-area.tsx
|
|
1845
|
-
var
|
|
1846
|
-
var
|
|
1847
|
-
var
|
|
1848
|
-
var TextArea = (0,
|
|
2513
|
+
var import_clsx34 = require("clsx");
|
|
2514
|
+
var import_react40 = require("react");
|
|
2515
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2516
|
+
var TextArea = (0, import_react40.forwardRef)(
|
|
1849
2517
|
({
|
|
1850
2518
|
size = "medium",
|
|
1851
2519
|
isResizable = false,
|
|
@@ -1856,7 +2524,7 @@ var TextArea = (0, import_react27.forwardRef)(
|
|
|
1856
2524
|
height,
|
|
1857
2525
|
...props
|
|
1858
2526
|
}, ref) => {
|
|
1859
|
-
const classes = (0,
|
|
2527
|
+
const classes = (0, import_clsx34.clsx)(
|
|
1860
2528
|
"w-full rounded border outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder",
|
|
1861
2529
|
{
|
|
1862
2530
|
"border-supportError": isError && !disabled,
|
|
@@ -1870,7 +2538,7 @@ var TextArea = (0, import_react27.forwardRef)(
|
|
|
1870
2538
|
"resize-none": !isResizable
|
|
1871
2539
|
}
|
|
1872
2540
|
);
|
|
1873
|
-
return /* @__PURE__ */ (0,
|
|
2541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
1874
2542
|
"textarea",
|
|
1875
2543
|
{
|
|
1876
2544
|
ref,
|
|
@@ -1890,42 +2558,10 @@ var TextArea = (0, import_react27.forwardRef)(
|
|
|
1890
2558
|
);
|
|
1891
2559
|
TextArea.displayName = "TextArea";
|
|
1892
2560
|
|
|
1893
|
-
// src/text-input/text-input.tsx
|
|
1894
|
-
var import_clsx33 = require("clsx");
|
|
1895
|
-
var import_react28 = require("react");
|
|
1896
|
-
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1897
|
-
var TextInput = (0, import_react28.forwardRef)(
|
|
1898
|
-
({ size = "medium", isError = false, disabled = false, onClickClearButton, ...props }, ref) => {
|
|
1899
|
-
const isShowClearButton = !!onClickClearButton && props.value.length !== 0 && !disabled;
|
|
1900
|
-
const inputWrapClasses = (0, import_clsx33.clsx)("relative flex items-center gap-2 overflow-hidden rounded border", {
|
|
1901
|
-
"border-uiBorder02": !isError && !disabled,
|
|
1902
|
-
"border-supportError": isError && !disabled,
|
|
1903
|
-
"hover:border-hoverInput": !disabled && !isError,
|
|
1904
|
-
"hover:focus-within:border-activeInput": !isError,
|
|
1905
|
-
"focus-within:border-activeInput": !isError,
|
|
1906
|
-
"bg-disabled02 border-disabled01": disabled,
|
|
1907
|
-
"pr-2": size === "medium" && isShowClearButton,
|
|
1908
|
-
"pr-3": size === "large" && isShowClearButton
|
|
1909
|
-
});
|
|
1910
|
-
const inputClasses = (0, import_clsx33.clsx)("flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
|
|
1911
|
-
["typography-label14regular min-h-8 px-2"]: size === "medium",
|
|
1912
|
-
["typography-label16regular min-h-10 px-3"]: size === "large",
|
|
1913
|
-
"text-text01": !isError,
|
|
1914
|
-
"text-supportError": isError,
|
|
1915
|
-
"pr-0": isShowClearButton
|
|
1916
|
-
});
|
|
1917
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: inputWrapClasses, children: [
|
|
1918
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { ref, size: 1, className: inputClasses, disabled, onChange: props.onChange, ...props }),
|
|
1919
|
-
isShowClearButton && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(IconButton, { variant: "text", icon: "close", size: "small", onClick: onClickClearButton })
|
|
1920
|
-
] });
|
|
1921
|
-
}
|
|
1922
|
-
);
|
|
1923
|
-
TextInput.displayName = "TextInput";
|
|
1924
|
-
|
|
1925
2561
|
// src/toast/toast.tsx
|
|
1926
|
-
var
|
|
1927
|
-
var
|
|
1928
|
-
var
|
|
2562
|
+
var import_clsx35 = __toESM(require("clsx"));
|
|
2563
|
+
var import_react41 = require("react");
|
|
2564
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
1929
2565
|
var CLOSE_TIME_MSEC = 5e3;
|
|
1930
2566
|
function Toast({
|
|
1931
2567
|
state = "information",
|
|
@@ -1935,8 +2571,8 @@ function Toast({
|
|
|
1935
2571
|
children,
|
|
1936
2572
|
onClickClose
|
|
1937
2573
|
}) {
|
|
1938
|
-
const [isRemoving, setIsRemoving] = (0,
|
|
1939
|
-
const handleClose = (0,
|
|
2574
|
+
const [isRemoving, setIsRemoving] = (0, import_react41.useState)(false);
|
|
2575
|
+
const handleClose = (0, import_react41.useCallback)(() => {
|
|
1940
2576
|
if (isAnimation) {
|
|
1941
2577
|
setIsRemoving(true);
|
|
1942
2578
|
} else {
|
|
@@ -1944,17 +2580,17 @@ function Toast({
|
|
|
1944
2580
|
}
|
|
1945
2581
|
}, [isAnimation, onClickClose]);
|
|
1946
2582
|
const handleAnimationEnd = (e) => window.getComputedStyle(e.currentTarget).opacity === "0" && onClickClose();
|
|
1947
|
-
const wrapperClasses = (0,
|
|
2583
|
+
const wrapperClasses = (0, import_clsx35.default)("pointer-events-auto flex items-start gap-1 bg-white p-4 shadow-floatingShadow", {
|
|
1948
2584
|
["animate-toast-in"]: isAnimation && !isRemoving,
|
|
1949
2585
|
["animate-toast-out opacity-0"]: isAnimation && isRemoving
|
|
1950
2586
|
});
|
|
1951
|
-
const iconClasses = (0,
|
|
2587
|
+
const iconClasses = (0, import_clsx35.default)("flex items-center", {
|
|
1952
2588
|
"fill-supportSuccess": state === "success",
|
|
1953
2589
|
"fill-supportError": state === "error",
|
|
1954
2590
|
"fill-supportWarning": state === "warning",
|
|
1955
2591
|
"fill-supportInfo": state === "information"
|
|
1956
2592
|
});
|
|
1957
|
-
const textClasses = (0,
|
|
2593
|
+
const textClasses = (0, import_clsx35.default)("typography-body13regular flex-1 pt-[3px]", {
|
|
1958
2594
|
"text-supportError": state === "error",
|
|
1959
2595
|
"text-text01": state === "success" || state === "warning" || state === "information"
|
|
1960
2596
|
});
|
|
@@ -1964,7 +2600,7 @@ function Toast({
|
|
|
1964
2600
|
warning: "warning",
|
|
1965
2601
|
information: "information-filled"
|
|
1966
2602
|
};
|
|
1967
|
-
(0,
|
|
2603
|
+
(0, import_react41.useEffect)(() => {
|
|
1968
2604
|
const timer = window.setTimeout(() => {
|
|
1969
2605
|
if (isAutoClose) {
|
|
1970
2606
|
setIsRemoving(true);
|
|
@@ -1972,45 +2608,45 @@ function Toast({
|
|
|
1972
2608
|
}, CLOSE_TIME_MSEC);
|
|
1973
2609
|
return () => window.clearTimeout(timer);
|
|
1974
2610
|
}, [isAutoClose]);
|
|
1975
|
-
return /* @__PURE__ */ (0,
|
|
1976
|
-
/* @__PURE__ */ (0,
|
|
1977
|
-
/* @__PURE__ */ (0,
|
|
1978
|
-
/* @__PURE__ */ (0,
|
|
2611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: wrapperClasses, style: { width }, onAnimationEnd: handleAnimationEnd, children: [
|
|
2612
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { name: iconName[state] }) }),
|
|
2613
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: textClasses, children }),
|
|
2614
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(IconButton, { icon: "close", size: "medium", variant: "text", onClick: handleClose, isNoPadding: true })
|
|
1979
2615
|
] });
|
|
1980
2616
|
}
|
|
1981
2617
|
|
|
1982
2618
|
// src/toast/toast-provider.tsx
|
|
1983
|
-
var
|
|
2619
|
+
var import_react42 = require("react");
|
|
1984
2620
|
var import_react_dom3 = require("react-dom");
|
|
1985
|
-
var
|
|
1986
|
-
var ToastContext = (0,
|
|
2621
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2622
|
+
var ToastContext = (0, import_react42.createContext)({});
|
|
1987
2623
|
var ToastProvider = ({ children }) => {
|
|
1988
|
-
const [isClientRender, setIsClientRender] = (0,
|
|
1989
|
-
const [toasts, setToasts] = (0,
|
|
1990
|
-
const addToast = (0,
|
|
2624
|
+
const [isClientRender, setIsClientRender] = (0, import_react42.useState)(false);
|
|
2625
|
+
const [toasts, setToasts] = (0, import_react42.useState)([]);
|
|
2626
|
+
const addToast = (0, import_react42.useCallback)(({ message, state }) => {
|
|
1991
2627
|
setToasts((prev) => [...prev, { id: Math.trunc(Math.random() * 1e5), message, state }]);
|
|
1992
2628
|
}, []);
|
|
1993
|
-
const removeToast = (0,
|
|
2629
|
+
const removeToast = (0, import_react42.useCallback)((id) => {
|
|
1994
2630
|
setToasts((prev) => prev.filter((snackbar) => snackbar.id !== id));
|
|
1995
2631
|
}, []);
|
|
1996
|
-
(0,
|
|
2632
|
+
(0, import_react42.useEffect)(() => {
|
|
1997
2633
|
setIsClientRender(true);
|
|
1998
2634
|
}, []);
|
|
1999
|
-
return /* @__PURE__ */ (0,
|
|
2635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(ToastContext.Provider, { value: { addToast, removeToast }, children: [
|
|
2000
2636
|
children,
|
|
2001
2637
|
isClientRender && (0, import_react_dom3.createPortal)(
|
|
2002
|
-
/* @__PURE__ */ (0,
|
|
2638
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("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__ */ (0, import_jsx_runtime53.jsx)(Toast, { state, isAutoClose: true, isAnimation: true, onClickClose: () => removeToast(id), width: 475, children: message }, id)) }),
|
|
2003
2639
|
document.body
|
|
2004
2640
|
)
|
|
2005
2641
|
] });
|
|
2006
2642
|
};
|
|
2007
2643
|
var useToast = () => {
|
|
2008
|
-
return (0,
|
|
2644
|
+
return (0, import_react42.useContext)(ToastContext);
|
|
2009
2645
|
};
|
|
2010
2646
|
|
|
2011
2647
|
// src/toggle/toggle.tsx
|
|
2012
|
-
var
|
|
2013
|
-
var
|
|
2648
|
+
var import_clsx36 = __toESM(require("clsx"));
|
|
2649
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2014
2650
|
function Toggle({
|
|
2015
2651
|
id,
|
|
2016
2652
|
size = "medium",
|
|
@@ -2020,7 +2656,7 @@ function Toggle({
|
|
|
2020
2656
|
labelPosition = "right",
|
|
2021
2657
|
isDisabled = false
|
|
2022
2658
|
}) {
|
|
2023
|
-
const baseClasses = (0,
|
|
2659
|
+
const baseClasses = (0, import_clsx36.default)("relative flex items-center rounded-full", {
|
|
2024
2660
|
"bg-disabledOn": isDisabled && isChecked,
|
|
2025
2661
|
"bg-disabled01": isDisabled && !isChecked,
|
|
2026
2662
|
"bg-interactive01 peer-hover:bg-hover01": !isDisabled && isChecked,
|
|
@@ -2028,16 +2664,16 @@ function Toggle({
|
|
|
2028
2664
|
"w-8 h-4 px-[3px]": size === "small",
|
|
2029
2665
|
"w-12 h-6 px-1": size === "medium" || size === "large"
|
|
2030
2666
|
});
|
|
2031
|
-
const inputClasses = (0,
|
|
2667
|
+
const inputClasses = (0, import_clsx36.default)(
|
|
2032
2668
|
"peer absolute inset-0 z-[1] opacity-0",
|
|
2033
2669
|
isDisabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2034
2670
|
);
|
|
2035
|
-
const indicatorClasses = (0,
|
|
2671
|
+
const indicatorClasses = (0, import_clsx36.default)("rounded-full bg-iconOnColor", {
|
|
2036
2672
|
"w-2.5 h-2.5": size === "small",
|
|
2037
2673
|
"w-4 h-4": size === "medium" || size === "large",
|
|
2038
2674
|
"ml-auto": isChecked
|
|
2039
2675
|
});
|
|
2040
|
-
const labelClasses = (0,
|
|
2676
|
+
const labelClasses = (0, import_clsx36.default)("break-all", {
|
|
2041
2677
|
"mr-2": labelPosition === "left",
|
|
2042
2678
|
"ml-2": labelPosition === "right",
|
|
2043
2679
|
"typography-label14regular": size === "small" || size === "medium",
|
|
@@ -2045,9 +2681,9 @@ function Toggle({
|
|
|
2045
2681
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
2046
2682
|
"cursor-pointer text-text01": !isDisabled
|
|
2047
2683
|
});
|
|
2048
|
-
return /* @__PURE__ */ (0,
|
|
2049
|
-
label != null && labelPosition === "left" && /* @__PURE__ */ (0,
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
2684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "relative flex flex-[0_0_auto] items-center", children: [
|
|
2685
|
+
label != null && labelPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("label", { htmlFor: id, className: labelClasses, children: label }),
|
|
2686
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2051
2687
|
"input",
|
|
2052
2688
|
{
|
|
2053
2689
|
className: inputClasses,
|
|
@@ -2059,23 +2695,23 @@ function Toggle({
|
|
|
2059
2695
|
disabled: isDisabled
|
|
2060
2696
|
}
|
|
2061
2697
|
),
|
|
2062
|
-
/* @__PURE__ */ (0,
|
|
2063
|
-
label != null && labelPosition === "right" && /* @__PURE__ */ (0,
|
|
2698
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: baseClasses, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: indicatorClasses }) }),
|
|
2699
|
+
label != null && labelPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("label", { htmlFor: id, className: labelClasses, children: label })
|
|
2064
2700
|
] });
|
|
2065
2701
|
}
|
|
2066
2702
|
|
|
2067
2703
|
// src/tooltip/tooltip.tsx
|
|
2068
|
-
var
|
|
2704
|
+
var import_react44 = require("react");
|
|
2069
2705
|
var import_react_dom4 = require("react-dom");
|
|
2070
2706
|
|
|
2071
2707
|
// src/tooltip/tooltip-content.tsx
|
|
2072
|
-
var
|
|
2708
|
+
var import_clsx38 = __toESM(require("clsx"));
|
|
2073
2709
|
|
|
2074
2710
|
// src/tooltip/tail-icon.tsx
|
|
2075
|
-
var
|
|
2076
|
-
var
|
|
2711
|
+
var import_clsx37 = __toESM(require("clsx"));
|
|
2712
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2077
2713
|
var TailIcon = (props) => {
|
|
2078
|
-
const tailClasses = (0,
|
|
2714
|
+
const tailClasses = (0, import_clsx37.default)("absolute fill-uiBackgroundTooltip", {
|
|
2079
2715
|
"rotate-180": props.verticalPosition === "bottom",
|
|
2080
2716
|
"rotate-0": props.verticalPosition !== "bottom",
|
|
2081
2717
|
"-top-1": props.verticalPosition === "bottom" && props.size === "small",
|
|
@@ -2090,9 +2726,9 @@ var TailIcon = (props) => {
|
|
|
2090
2726
|
"left-1/2 -translate-x-2": props.horizontalAlign === "center" && props.size !== "small"
|
|
2091
2727
|
});
|
|
2092
2728
|
if (props.size === "small") {
|
|
2093
|
-
return /* @__PURE__ */ (0,
|
|
2729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("svg", { className: tailClasses, width: "8", height: "4", viewBox: "0 0 8 4", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("path", { d: "M4 4L0 0H8L4 4Z" }) });
|
|
2094
2730
|
} else {
|
|
2095
|
-
return /* @__PURE__ */ (0,
|
|
2731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2096
2732
|
"svg",
|
|
2097
2733
|
{
|
|
2098
2734
|
className: tailClasses,
|
|
@@ -2101,14 +2737,14 @@ var TailIcon = (props) => {
|
|
|
2101
2737
|
viewBox: "0 0 14 8",
|
|
2102
2738
|
fill: "none",
|
|
2103
2739
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2104
|
-
children: /* @__PURE__ */ (0,
|
|
2740
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("path", { d: "M7 8L0 0H14L7 8Z" })
|
|
2105
2741
|
}
|
|
2106
2742
|
);
|
|
2107
2743
|
}
|
|
2108
2744
|
};
|
|
2109
2745
|
|
|
2110
2746
|
// src/tooltip/tooltip-content.tsx
|
|
2111
|
-
var
|
|
2747
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2112
2748
|
var TooltipContent = ({
|
|
2113
2749
|
content,
|
|
2114
2750
|
horizontalAlign,
|
|
@@ -2118,7 +2754,7 @@ var TooltipContent = ({
|
|
|
2118
2754
|
maxWidth,
|
|
2119
2755
|
isPortal = false
|
|
2120
2756
|
}) => {
|
|
2121
|
-
const tooltipWrapperClasses = (0,
|
|
2757
|
+
const tooltipWrapperClasses = (0, import_clsx38.default)("absolute z-tooltip m-auto flex", {
|
|
2122
2758
|
"top-0": !isPortal && verticalPosition === "top",
|
|
2123
2759
|
"bottom-0": !isPortal && verticalPosition === "bottom",
|
|
2124
2760
|
"justify-start": horizontalAlign === "left",
|
|
@@ -2127,7 +2763,7 @@ var TooltipContent = ({
|
|
|
2127
2763
|
"w-[24px]": size === "small",
|
|
2128
2764
|
"w-[46px]": size !== "small"
|
|
2129
2765
|
});
|
|
2130
|
-
const tooltipBodyClasses = (0,
|
|
2766
|
+
const tooltipBodyClasses = (0, import_clsx38.default)(
|
|
2131
2767
|
"absolute z-tooltip inline-block w-max rounded bg-uiBackgroundTooltip text-textOnColor",
|
|
2132
2768
|
{
|
|
2133
2769
|
"typography-body12regular": size === "small",
|
|
@@ -2144,7 +2780,7 @@ var TooltipContent = ({
|
|
|
2144
2780
|
transform: `translate(${tooltipPosition.translateX}, ${tooltipPosition.translateY})`,
|
|
2145
2781
|
...tooltipPosition
|
|
2146
2782
|
} : {};
|
|
2147
|
-
return /* @__PURE__ */ (0,
|
|
2783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: tooltipWrapperClasses, style: tooltipWrapperStyle, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
2148
2784
|
"div",
|
|
2149
2785
|
{
|
|
2150
2786
|
className: tooltipBodyClasses,
|
|
@@ -2153,16 +2789,16 @@ var TooltipContent = ({
|
|
|
2153
2789
|
},
|
|
2154
2790
|
children: [
|
|
2155
2791
|
content,
|
|
2156
|
-
/* @__PURE__ */ (0,
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(TailIcon, { size, verticalPosition, horizontalAlign })
|
|
2157
2793
|
]
|
|
2158
2794
|
}
|
|
2159
2795
|
) });
|
|
2160
2796
|
};
|
|
2161
2797
|
|
|
2162
2798
|
// src/tooltip/tooltip-hook.ts
|
|
2163
|
-
var
|
|
2799
|
+
var import_react43 = require("react");
|
|
2164
2800
|
var useTooltip = () => {
|
|
2165
|
-
const calculatePosition = (0,
|
|
2801
|
+
const calculatePosition = (0, import_react43.useCallback)(
|
|
2166
2802
|
(args) => {
|
|
2167
2803
|
const result = {
|
|
2168
2804
|
maxWidth: "none",
|
|
@@ -2214,7 +2850,7 @@ var useTooltip = () => {
|
|
|
2214
2850
|
};
|
|
2215
2851
|
|
|
2216
2852
|
// src/tooltip/tooltip.tsx
|
|
2217
|
-
var
|
|
2853
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2218
2854
|
function Tooltip({
|
|
2219
2855
|
children,
|
|
2220
2856
|
content,
|
|
@@ -2226,8 +2862,8 @@ function Tooltip({
|
|
|
2226
2862
|
portalTarget
|
|
2227
2863
|
}) {
|
|
2228
2864
|
const { calculatePosition } = useTooltip();
|
|
2229
|
-
const [isVisible, setIsVisible] = (0,
|
|
2230
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
2865
|
+
const [isVisible, setIsVisible] = (0, import_react44.useState)(false);
|
|
2866
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react44.useState)({
|
|
2231
2867
|
maxWidth: "none",
|
|
2232
2868
|
width: "auto",
|
|
2233
2869
|
left: "0px",
|
|
@@ -2236,23 +2872,23 @@ function Tooltip({
|
|
|
2236
2872
|
translateX: "0",
|
|
2237
2873
|
translateY: "0"
|
|
2238
2874
|
});
|
|
2239
|
-
const targetRef = (0,
|
|
2240
|
-
const handleMouseOverWrapper = (0,
|
|
2875
|
+
const targetRef = (0, import_react44.useRef)(null);
|
|
2876
|
+
const handleMouseOverWrapper = (0, import_react44.useCallback)(() => {
|
|
2241
2877
|
if (isDisabledHover) {
|
|
2242
2878
|
return;
|
|
2243
2879
|
}
|
|
2244
2880
|
setIsVisible(true);
|
|
2245
2881
|
}, [isDisabledHover]);
|
|
2246
|
-
const handleMouseOutWrapper = (0,
|
|
2882
|
+
const handleMouseOutWrapper = (0, import_react44.useCallback)(() => {
|
|
2247
2883
|
setIsVisible(false);
|
|
2248
2884
|
}, []);
|
|
2249
|
-
(0,
|
|
2885
|
+
(0, import_react44.useEffect)(() => {
|
|
2250
2886
|
if (targetRef.current === null) return;
|
|
2251
2887
|
const dimensions = targetRef.current?.getBoundingClientRect();
|
|
2252
2888
|
const position = calculatePosition({ dimensions, maxWidth, verticalPosition, horizontalAlign, tooltipSize: size });
|
|
2253
2889
|
setTooltipPosition(position);
|
|
2254
2890
|
}, [calculatePosition, horizontalAlign, maxWidth, size, verticalPosition]);
|
|
2255
|
-
return /* @__PURE__ */ (0,
|
|
2891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2256
2892
|
"div",
|
|
2257
2893
|
{
|
|
2258
2894
|
ref: targetRef,
|
|
@@ -2261,7 +2897,7 @@ function Tooltip({
|
|
|
2261
2897
|
onMouseLeave: handleMouseOutWrapper,
|
|
2262
2898
|
children: [
|
|
2263
2899
|
children,
|
|
2264
|
-
isVisible && (portalTarget == null ? /* @__PURE__ */ (0,
|
|
2900
|
+
isVisible && (portalTarget == null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2265
2901
|
TooltipContent,
|
|
2266
2902
|
{
|
|
2267
2903
|
content,
|
|
@@ -2272,7 +2908,7 @@ function Tooltip({
|
|
|
2272
2908
|
tooltipPosition
|
|
2273
2909
|
}
|
|
2274
2910
|
) : (0, import_react_dom4.createPortal)(
|
|
2275
|
-
/* @__PURE__ */ (0,
|
|
2911
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2276
2912
|
TooltipContent,
|
|
2277
2913
|
{
|
|
2278
2914
|
isPortal: true,
|
|
@@ -2298,6 +2934,7 @@ function Tooltip({
|
|
|
2298
2934
|
Checkbox,
|
|
2299
2935
|
Dropdown,
|
|
2300
2936
|
EvaluationStar,
|
|
2937
|
+
FileInput,
|
|
2301
2938
|
Heading,
|
|
2302
2939
|
Icon,
|
|
2303
2940
|
IconButton,
|
|
@@ -2306,6 +2943,11 @@ function Tooltip({
|
|
|
2306
2943
|
NotificationInline,
|
|
2307
2944
|
Pagination,
|
|
2308
2945
|
PaginationSelect,
|
|
2946
|
+
PasswordInput,
|
|
2947
|
+
Popover,
|
|
2948
|
+
PopoverContent,
|
|
2949
|
+
PopoverTrigger,
|
|
2950
|
+
Popup,
|
|
2309
2951
|
Radio,
|
|
2310
2952
|
Search,
|
|
2311
2953
|
SegmentedControl,
|