@zenkigen-inc/component-ui 1.16.3 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +102 -43
- package/dist/index.d.ts +102 -43
- package/dist/index.js +324 -248
- package/dist/index.mjs +297 -222
- package/package.json +5 -3
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { clsx as clsx2 } from "clsx";
|
|
|
6
6
|
import { iconElements } from "@zenkigen-inc/component-icons";
|
|
7
7
|
import { iconColors } from "@zenkigen-inc/component-theme";
|
|
8
8
|
import { clsx } from "clsx";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
10
10
|
var Icon = ({ size = "medium", isDisabled = false, ...props }) => {
|
|
11
11
|
const classes = clsx(
|
|
12
12
|
"inline-block shrink-0",
|
|
@@ -24,7 +24,13 @@ var Icon = ({ size = "medium", isDisabled = false, ...props }) => {
|
|
|
24
24
|
},
|
|
25
25
|
props.className
|
|
26
26
|
);
|
|
27
|
-
|
|
27
|
+
const IconComponent = iconElements[props.name];
|
|
28
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("span", { className: classes, children: /* @__PURE__ */ jsx(
|
|
29
|
+
IconComponent,
|
|
30
|
+
{
|
|
31
|
+
...isDisabled !== true && typeof props.accentColor === "string" ? { accentClassName: `fill-${String(props.accentColor)}` } : {}
|
|
32
|
+
}
|
|
33
|
+
) }) });
|
|
28
34
|
};
|
|
29
35
|
|
|
30
36
|
// src/avatar/avatar.tsx
|
|
@@ -471,6 +477,7 @@ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "med
|
|
|
471
477
|
const starClasses = clsx8(focusVisible5.inset, { "w-6 h-6": size === "large", "w-4 h-4": size === "medium" });
|
|
472
478
|
const renderStar = (rating) => {
|
|
473
479
|
const color = rating <= currentRating ? "fill-yellow-yellow50" : "fill-icon03";
|
|
480
|
+
const IconComponent = iconElements2["star-filled"];
|
|
474
481
|
return /* @__PURE__ */ jsx11(
|
|
475
482
|
"button",
|
|
476
483
|
{
|
|
@@ -478,7 +485,7 @@ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "med
|
|
|
478
485
|
onClick: () => handleChangeRating(rating),
|
|
479
486
|
className: clsx8(color, starClasses),
|
|
480
487
|
disabled: !isEditable,
|
|
481
|
-
children:
|
|
488
|
+
children: /* @__PURE__ */ jsx11(IconComponent, {})
|
|
482
489
|
},
|
|
483
490
|
rating
|
|
484
491
|
);
|
|
@@ -618,7 +625,7 @@ function IconButton({
|
|
|
618
625
|
|
|
619
626
|
// src/loading/loading.tsx
|
|
620
627
|
import clsx11 from "clsx";
|
|
621
|
-
import { Fragment, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
628
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
622
629
|
function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
623
630
|
const wrapperClasses = clsx11(position, "left-0 top-0 z-20 flex w-full items-center justify-center");
|
|
624
631
|
const svgClasses = clsx11({
|
|
@@ -626,7 +633,7 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
626
633
|
"h-8 w-8": size === "medium",
|
|
627
634
|
"h-16 w-16": size === "large"
|
|
628
635
|
});
|
|
629
|
-
return /* @__PURE__ */ jsx13(
|
|
636
|
+
return /* @__PURE__ */ jsx13(Fragment2, { children: /* @__PURE__ */ jsxs5("div", { className: wrapperClasses, style: { height }, children: [
|
|
630
637
|
size === "small" && /* @__PURE__ */ jsx13("svg", { className: svgClasses, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx13(
|
|
631
638
|
"circle",
|
|
632
639
|
{
|
|
@@ -760,7 +767,7 @@ function ModalHeader({ children, isNoBorder = false }) {
|
|
|
760
767
|
}
|
|
761
768
|
|
|
762
769
|
// src/modal/modal.tsx
|
|
763
|
-
import { Fragment as
|
|
770
|
+
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
764
771
|
var LIMIT_WIDTH = 320;
|
|
765
772
|
var LIMIT_HEIGHT = 184;
|
|
766
773
|
function Modal({
|
|
@@ -778,7 +785,7 @@ function Modal({
|
|
|
778
785
|
useEffect2(() => {
|
|
779
786
|
setIsMounted(true);
|
|
780
787
|
}, []);
|
|
781
|
-
return isMounted && isOpen ? /* @__PURE__ */ jsxs7(
|
|
788
|
+
return isMounted && isOpen ? /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
782
789
|
/* @__PURE__ */ jsx17(BodyScrollLock, {}),
|
|
783
790
|
createPortal2(
|
|
784
791
|
/* @__PURE__ */ jsx17(ModalContext.Provider, { value: { onClose }, children: /* @__PURE__ */ jsx17("div", { className: "fixed left-0 top-0 z-overlay flex size-full items-center justify-center bg-backgroundOverlayBlack py-4", children: /* @__PURE__ */ jsx17(
|
|
@@ -911,9 +918,10 @@ function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick })
|
|
|
911
918
|
}
|
|
912
919
|
|
|
913
920
|
// src/select/select.tsx
|
|
921
|
+
import { autoUpdate, FloatingPortal, offset, size as sizeMiddleware, useFloating } from "@floating-ui/react";
|
|
914
922
|
import { focusVisible as focusVisible9, selectColors } from "@zenkigen-inc/component-theme";
|
|
915
923
|
import clsx18 from "clsx";
|
|
916
|
-
import { useRef as
|
|
924
|
+
import { useRef as useRef2, useState as useState6 } from "react";
|
|
917
925
|
|
|
918
926
|
// src/select/select-context.ts
|
|
919
927
|
import { createContext as createContext4 } from "react";
|
|
@@ -941,61 +949,63 @@ function SelectItem({ option }) {
|
|
|
941
949
|
{
|
|
942
950
|
"text-interactive01 fill-interactive01 bg-selectedUi": option.id === selectedOption?.id && !(isError ?? false),
|
|
943
951
|
"text-supportError fill-supportError bg-uiBackgroundError": option.id === selectedOption?.id && isError,
|
|
944
|
-
"text-interactive02 fill-icon01 bg-uiBackground01": option.id !== selectedOption?.id
|
|
952
|
+
"text-interactive02 fill-icon01 bg-uiBackground01": option.id !== selectedOption?.id,
|
|
953
|
+
"pr-10": option.id !== selectedOption?.id
|
|
945
954
|
}
|
|
946
955
|
);
|
|
947
956
|
return /* @__PURE__ */ jsx21("li", { className: "flex w-full items-center", "data-id": option.id, children: /* @__PURE__ */ jsxs10("button", { className: itemClasses, type: "button", onClick: () => handleClickItem(option), children: [
|
|
948
957
|
option.icon && /* @__PURE__ */ jsx21(Icon, { name: option.icon, size: "small" }),
|
|
949
|
-
/* @__PURE__ */ jsx21("span", { className: "ml-1
|
|
950
|
-
option.id === selectedOption?.id && /* @__PURE__ */ jsx21("div", { className: "ml-
|
|
958
|
+
/* @__PURE__ */ jsx21("span", { className: "ml-1 flex-1 truncate text-left", children: option.label }),
|
|
959
|
+
option.id === selectedOption?.id && /* @__PURE__ */ jsx21("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ jsx21(Icon, { name: "check", size: "small" }) })
|
|
951
960
|
] }) }, option.id);
|
|
952
961
|
}
|
|
953
962
|
|
|
954
963
|
// src/select/select-list.tsx
|
|
955
964
|
import { focusVisible as focusVisible8 } from "@zenkigen-inc/component-theme";
|
|
956
965
|
import clsx17 from "clsx";
|
|
957
|
-
import { useContext as useContext6, useLayoutEffect as useLayoutEffect2
|
|
966
|
+
import { forwardRef, useContext as useContext6, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
958
967
|
import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
959
|
-
|
|
960
|
-
const
|
|
961
|
-
const { size, selectedOption, setIsOptionListOpen, variant, placeholder, onChange } = useContext6(SelectContext);
|
|
968
|
+
var SelectList = forwardRef(({ children, maxHeight }, ref) => {
|
|
969
|
+
const { selectedOption, setIsOptionListOpen, variant, placeholder, onChange, floatingStyles, floatingRef } = useContext6(SelectContext);
|
|
962
970
|
const handleClickDeselect = () => {
|
|
963
971
|
onChange?.(null);
|
|
964
972
|
setIsOptionListOpen(false);
|
|
965
973
|
};
|
|
966
974
|
useLayoutEffect2(() => {
|
|
967
|
-
if (maxHeight != null &&
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
+
if (maxHeight != null && selectedOption != null) {
|
|
976
|
+
const container = floatingRef?.current;
|
|
977
|
+
if (container != null) {
|
|
978
|
+
const element = container.querySelector(`[data-id="${selectedOption.id}"]`);
|
|
979
|
+
if (element != null) {
|
|
980
|
+
const htmlElement = element;
|
|
981
|
+
const elementTop = htmlElement.offsetTop;
|
|
982
|
+
const elementHeight = htmlElement.offsetHeight;
|
|
983
|
+
const containerHeight = container.clientHeight;
|
|
984
|
+
const scrollTop = elementTop - (containerHeight - elementHeight) / 2;
|
|
985
|
+
container.scrollTo({
|
|
986
|
+
top: Math.max(0, scrollTop)
|
|
987
|
+
});
|
|
988
|
+
}
|
|
975
989
|
}
|
|
976
990
|
}
|
|
977
|
-
}, []);
|
|
978
|
-
const listClasses = clsx17(
|
|
979
|
-
"
|
|
980
|
-
|
|
981
|
-
"top-7": size === "x-small" || size === "small",
|
|
982
|
-
"top-9": size === "medium",
|
|
983
|
-
"top-11": size === "large",
|
|
984
|
-
"border-solid border border-uiBorder01": variant === "outline"
|
|
985
|
-
}
|
|
986
|
-
);
|
|
991
|
+
}, [selectedOption, maxHeight, floatingRef]);
|
|
992
|
+
const listClasses = clsx17("z-dropdown overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow", {
|
|
993
|
+
"border-solid border border-uiBorder01": variant === "outline"
|
|
994
|
+
});
|
|
987
995
|
const deselectButtonClasses = clsx17(
|
|
988
996
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
989
997
|
focusVisible8.inset
|
|
990
998
|
);
|
|
991
|
-
return /* @__PURE__ */ jsxs11("ul", { className: listClasses, style: { maxHeight }, ref, children: [
|
|
999
|
+
return /* @__PURE__ */ jsxs11("ul", { className: listClasses, style: { maxHeight, ...floatingStyles }, ref, children: [
|
|
992
1000
|
children,
|
|
993
1001
|
placeholder != null && selectedOption !== null && /* @__PURE__ */ jsx22("li", { children: /* @__PURE__ */ jsx22("button", { className: deselectButtonClasses, type: "button", onClick: handleClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
|
|
994
1002
|
] });
|
|
995
|
-
}
|
|
1003
|
+
});
|
|
1004
|
+
SelectList.displayName = "SelectList";
|
|
996
1005
|
|
|
997
1006
|
// src/select/select.tsx
|
|
998
1007
|
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1008
|
+
var FLOATING_OFFSET = 4;
|
|
999
1009
|
function Select({
|
|
1000
1010
|
children,
|
|
1001
1011
|
size = "medium",
|
|
@@ -1012,8 +1022,24 @@ function Select({
|
|
|
1012
1022
|
optionListMaxHeight
|
|
1013
1023
|
}) {
|
|
1014
1024
|
const [isOptionListOpen, setIsOptionListOpen] = useState6(false);
|
|
1015
|
-
const targetRef =
|
|
1025
|
+
const targetRef = useRef2(null);
|
|
1016
1026
|
useOutsideClick(targetRef, () => setIsOptionListOpen(false));
|
|
1027
|
+
const { refs, floatingStyles } = useFloating({
|
|
1028
|
+
open: isOptionListOpen,
|
|
1029
|
+
onOpenChange: setIsOptionListOpen,
|
|
1030
|
+
placement: "bottom-start",
|
|
1031
|
+
middleware: [
|
|
1032
|
+
offset(FLOATING_OFFSET),
|
|
1033
|
+
sizeMiddleware({
|
|
1034
|
+
apply({ availableWidth, elements, rects }) {
|
|
1035
|
+
const referenceWidth = rects.reference.width;
|
|
1036
|
+
elements.floating.style.minWidth = `${referenceWidth}px`;
|
|
1037
|
+
elements.floating.style.maxWidth = `${availableWidth}px`;
|
|
1038
|
+
}
|
|
1039
|
+
})
|
|
1040
|
+
],
|
|
1041
|
+
whileElementsMounted: autoUpdate
|
|
1042
|
+
});
|
|
1017
1043
|
const handleClickToggle = () => setIsOptionListOpen((prev) => !prev);
|
|
1018
1044
|
const buttonVariant = isError && !isDisabled ? `${variant}Error` : variant;
|
|
1019
1045
|
const isSelected = isOptionSelected && !isDisabled && selectedOption !== null && !isError;
|
|
@@ -1055,21 +1081,33 @@ function Select({
|
|
|
1055
1081
|
setIsOptionListOpen,
|
|
1056
1082
|
selectedOption,
|
|
1057
1083
|
onChange,
|
|
1058
|
-
isError
|
|
1084
|
+
isError,
|
|
1085
|
+
floatingStyles,
|
|
1086
|
+
floatingRef: refs.floating
|
|
1059
1087
|
},
|
|
1060
1088
|
children: /* @__PURE__ */ jsxs12("div", { className: wrapperClasses, style: { width, maxWidth }, ref: targetRef, children: [
|
|
1061
|
-
/* @__PURE__ */ jsxs12(
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1089
|
+
/* @__PURE__ */ jsxs12(
|
|
1090
|
+
"button",
|
|
1091
|
+
{
|
|
1092
|
+
ref: refs.setReference,
|
|
1093
|
+
className: buttonClasses,
|
|
1094
|
+
type: "button",
|
|
1095
|
+
onClick: handleClickToggle,
|
|
1096
|
+
disabled: isDisabled,
|
|
1097
|
+
children: [
|
|
1098
|
+
selectedOption?.icon ? /* @__PURE__ */ jsx23("div", { className: "mr-1 flex", children: /* @__PURE__ */ jsx23(Icon, { name: selectedOption.icon, size: size === "large" ? "medium" : "small" }) }) : placeholder != null && placeholderIcon && /* @__PURE__ */ jsx23("div", { className: "mr-1 flex", children: /* @__PURE__ */ jsx23(Icon, { name: placeholderIcon, size: size === "large" ? "medium" : "small" }) }),
|
|
1099
|
+
/* @__PURE__ */ jsx23("div", { className: labelClasses, children: /* @__PURE__ */ jsx23("div", { className: "truncate", children: selectedOption ? selectedOption.label : placeholder != null && placeholder }) }),
|
|
1100
|
+
/* @__PURE__ */ jsx23("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx23(
|
|
1101
|
+
Icon,
|
|
1102
|
+
{
|
|
1103
|
+
name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
|
|
1104
|
+
size: size === "large" ? "medium" : "small"
|
|
1105
|
+
}
|
|
1106
|
+
) })
|
|
1107
|
+
]
|
|
1108
|
+
}
|
|
1109
|
+
),
|
|
1110
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ jsx23(FloatingPortal, { children: /* @__PURE__ */ jsx23("div", { className: "relative z-overlay", children: /* @__PURE__ */ jsx23(SelectList, { ref: refs.setFloating, maxHeight: optionListMaxHeight, children }) }) })
|
|
1073
1111
|
] })
|
|
1074
1112
|
}
|
|
1075
1113
|
);
|
|
@@ -1150,13 +1188,81 @@ function PaginationSelect({
|
|
|
1150
1188
|
] });
|
|
1151
1189
|
}
|
|
1152
1190
|
|
|
1191
|
+
// src/password-input/password-input.tsx
|
|
1192
|
+
import { forwardRef as forwardRef3, useState as useState7 } from "react";
|
|
1193
|
+
|
|
1194
|
+
// src/text-input/text-input.tsx
|
|
1195
|
+
import { clsx as clsx19 } from "clsx";
|
|
1196
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
1197
|
+
import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1198
|
+
var TextInput = forwardRef2(
|
|
1199
|
+
({ size = "medium", isError = false, disabled = false, onClickClearButton, after, ...props }, ref) => {
|
|
1200
|
+
const isShowClearButton = !!onClickClearButton && props.value.length !== 0 && !disabled;
|
|
1201
|
+
const hasTrailingElement = isShowClearButton || after != null;
|
|
1202
|
+
const inputWrapClasses = clsx19("relative flex items-center gap-2 overflow-hidden rounded border", {
|
|
1203
|
+
"border-uiBorder02": !isError && !disabled,
|
|
1204
|
+
"border-supportError": isError && !disabled,
|
|
1205
|
+
"hover:border-hoverInput": !disabled && !isError,
|
|
1206
|
+
"hover:focus-within:border-activeInput": !isError,
|
|
1207
|
+
"focus-within:border-activeInput": !isError,
|
|
1208
|
+
"bg-disabled02 border-disabled01": disabled,
|
|
1209
|
+
"pr-2": size === "medium" && hasTrailingElement,
|
|
1210
|
+
"pr-3": size === "large" && hasTrailingElement
|
|
1211
|
+
});
|
|
1212
|
+
const inputClasses = clsx19("flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
|
|
1213
|
+
["typography-label14regular min-h-8 px-2"]: size === "medium",
|
|
1214
|
+
["typography-label16regular min-h-10 px-3"]: size === "large",
|
|
1215
|
+
"text-text01": !isError,
|
|
1216
|
+
"text-supportError": isError,
|
|
1217
|
+
"pr-0": hasTrailingElement
|
|
1218
|
+
});
|
|
1219
|
+
return /* @__PURE__ */ jsxs14("div", { className: inputWrapClasses, children: [
|
|
1220
|
+
/* @__PURE__ */ jsx25("input", { ref, size: 1, className: inputClasses, disabled, onChange: props.onChange, ...props }),
|
|
1221
|
+
after,
|
|
1222
|
+
isShowClearButton && /* @__PURE__ */ jsx25(IconButton, { variant: "text", icon: "close", size: "small", onClick: onClickClearButton })
|
|
1223
|
+
] });
|
|
1224
|
+
}
|
|
1225
|
+
);
|
|
1226
|
+
TextInput.displayName = "TextInput";
|
|
1227
|
+
|
|
1228
|
+
// src/password-input/password-input.tsx
|
|
1229
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1230
|
+
var PasswordInput = forwardRef3(({ disabled = false, ...props }, ref) => {
|
|
1231
|
+
const [isPasswordVisible, setIsPasswordVisible] = useState7(false);
|
|
1232
|
+
const handlePasswordVisibilityToggle = () => {
|
|
1233
|
+
setIsPasswordVisible(!isPasswordVisible);
|
|
1234
|
+
};
|
|
1235
|
+
const passwordToggleButton = /* @__PURE__ */ jsx26(
|
|
1236
|
+
IconButton,
|
|
1237
|
+
{
|
|
1238
|
+
variant: "text",
|
|
1239
|
+
icon: isPasswordVisible === true ? "visibility-off" : "visibility",
|
|
1240
|
+
size: "small",
|
|
1241
|
+
onClick: handlePasswordVisibilityToggle,
|
|
1242
|
+
isDisabled: disabled,
|
|
1243
|
+
"aria-label": isPasswordVisible === true ? "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u975E\u8868\u793A\u306B\u3059\u308B" : "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8868\u793A\u3059\u308B"
|
|
1244
|
+
}
|
|
1245
|
+
);
|
|
1246
|
+
return /* @__PURE__ */ jsx26(
|
|
1247
|
+
TextInput,
|
|
1248
|
+
{
|
|
1249
|
+
ref,
|
|
1250
|
+
type: isPasswordVisible === true ? "text" : "password",
|
|
1251
|
+
disabled,
|
|
1252
|
+
...props,
|
|
1253
|
+
...{ after: passwordToggleButton }
|
|
1254
|
+
}
|
|
1255
|
+
);
|
|
1256
|
+
});
|
|
1257
|
+
PasswordInput.displayName = "PasswordInput";
|
|
1258
|
+
|
|
1153
1259
|
// src/radio/radio.tsx
|
|
1154
1260
|
import { focusVisible as focusVisible10 } from "@zenkigen-inc/component-theme";
|
|
1155
|
-
import
|
|
1156
|
-
import { useCallback as useCallback5, useState as
|
|
1157
|
-
import { jsx as
|
|
1261
|
+
import clsx20 from "clsx";
|
|
1262
|
+
import { useCallback as useCallback5, useState as useState8 } from "react";
|
|
1263
|
+
import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1158
1264
|
function Radio({ name, value, id, label, isChecked = false, isDisabled = false, onChange }) {
|
|
1159
|
-
const [isMouseOver, setIsMouseOver] =
|
|
1265
|
+
const [isMouseOver, setIsMouseOver] = useState8(false);
|
|
1160
1266
|
const handleMouseOverInput = useCallback5(() => {
|
|
1161
1267
|
setIsMouseOver(true);
|
|
1162
1268
|
}, []);
|
|
@@ -1167,11 +1273,11 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
1167
1273
|
(e) => !isDisabled && onChange?.(e),
|
|
1168
1274
|
[isDisabled, onChange]
|
|
1169
1275
|
);
|
|
1170
|
-
const inputClasses =
|
|
1276
|
+
const inputClasses = clsx20("peer absolute z-[1] size-6 opacity-0", {
|
|
1171
1277
|
"cursor-not-allowed": isDisabled,
|
|
1172
1278
|
"cursor-pointer": !isDisabled
|
|
1173
1279
|
});
|
|
1174
|
-
const boxClasses =
|
|
1280
|
+
const boxClasses = clsx20(
|
|
1175
1281
|
"inline-flex size-5 items-center justify-center rounded-full border border-solid bg-white",
|
|
1176
1282
|
focusVisible10.normalPeer,
|
|
1177
1283
|
{
|
|
@@ -1182,22 +1288,22 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
1182
1288
|
"cursor-pointer": !isDisabled
|
|
1183
1289
|
}
|
|
1184
1290
|
);
|
|
1185
|
-
const afterClasses =
|
|
1291
|
+
const afterClasses = clsx20("absolute inset-0 m-auto block size-3 rounded-full", {
|
|
1186
1292
|
"bg-disabled01": isDisabled && isChecked,
|
|
1187
1293
|
"bg-activeSelectedUi": !isDisabled && isChecked,
|
|
1188
1294
|
"scale-0": !isChecked,
|
|
1189
1295
|
"scale-100": isChecked
|
|
1190
1296
|
});
|
|
1191
|
-
const hoverIndicatorClasses =
|
|
1297
|
+
const hoverIndicatorClasses = clsx20("inline-block size-3 rounded-full", {
|
|
1192
1298
|
"bg-hoverUi": !isDisabled && !isChecked && isMouseOver
|
|
1193
1299
|
});
|
|
1194
|
-
const labelClasses =
|
|
1300
|
+
const labelClasses = clsx20("typography-label14regular ml-2 flex-[1_0_0] select-none break-all", {
|
|
1195
1301
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
1196
1302
|
"cursor-pointer text-text01": !isDisabled
|
|
1197
1303
|
});
|
|
1198
|
-
return /* @__PURE__ */
|
|
1199
|
-
/* @__PURE__ */
|
|
1200
|
-
/* @__PURE__ */
|
|
1304
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex items-center", children: [
|
|
1305
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex size-6 items-center justify-center", children: [
|
|
1306
|
+
/* @__PURE__ */ jsx27(
|
|
1201
1307
|
"input",
|
|
1202
1308
|
{
|
|
1203
1309
|
type: "checkbox",
|
|
@@ -1212,32 +1318,32 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
1212
1318
|
className: inputClasses
|
|
1213
1319
|
}
|
|
1214
1320
|
),
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ jsx27("div", { className: boxClasses, children: /* @__PURE__ */ jsxs15("div", { className: "relative flex size-5 flex-[0_0_auto] items-center justify-center", children: [
|
|
1322
|
+
/* @__PURE__ */ jsx27("span", { className: afterClasses }),
|
|
1323
|
+
/* @__PURE__ */ jsx27("span", { className: hoverIndicatorClasses })
|
|
1218
1324
|
] }) })
|
|
1219
1325
|
] }),
|
|
1220
|
-
/* @__PURE__ */
|
|
1326
|
+
/* @__PURE__ */ jsx27("label", { htmlFor: id, className: labelClasses, children: label })
|
|
1221
1327
|
] });
|
|
1222
1328
|
}
|
|
1223
1329
|
|
|
1224
1330
|
// src/search/search.tsx
|
|
1225
|
-
import { clsx as
|
|
1226
|
-
import { forwardRef } from "react";
|
|
1227
|
-
import { jsx as
|
|
1228
|
-
var Search =
|
|
1229
|
-
const classes =
|
|
1331
|
+
import { clsx as clsx21 } from "clsx";
|
|
1332
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
1333
|
+
import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1334
|
+
var Search = forwardRef4(({ width = "100%", size = "medium", ...props }, ref) => {
|
|
1335
|
+
const classes = clsx21(
|
|
1230
1336
|
"flex items-center rounded-full border border-uiBorder02 bg-uiBackground01 focus-within:border-activeInput",
|
|
1231
1337
|
{ "h-8 px-3": size === "medium" },
|
|
1232
1338
|
{ "h-10 px-4": size === "large" }
|
|
1233
1339
|
);
|
|
1234
|
-
const inputClasses =
|
|
1340
|
+
const inputClasses = clsx21("mx-2 h-full flex-1 text-text01 outline-0 placeholder:text-textPlaceholder", {
|
|
1235
1341
|
["typography-label14regular"]: size === "medium",
|
|
1236
1342
|
["typography-label16regular"]: size === "large"
|
|
1237
1343
|
});
|
|
1238
|
-
return /* @__PURE__ */
|
|
1239
|
-
/* @__PURE__ */
|
|
1240
|
-
/* @__PURE__ */
|
|
1344
|
+
return /* @__PURE__ */ jsx28("div", { className: "relative", ref, children: /* @__PURE__ */ jsx28("form", { onSubmit: props.onSubmit, children: /* @__PURE__ */ jsxs16("div", { className: classes, style: { width }, children: [
|
|
1345
|
+
/* @__PURE__ */ jsx28(Icon, { name: "search", color: "icon01", size: "medium" }),
|
|
1346
|
+
/* @__PURE__ */ jsx28(
|
|
1241
1347
|
"input",
|
|
1242
1348
|
{
|
|
1243
1349
|
type: "text",
|
|
@@ -1248,7 +1354,7 @@ var Search = forwardRef(({ width = "100%", size = "medium", ...props }, ref) =>
|
|
|
1248
1354
|
onChange: props.onChange
|
|
1249
1355
|
}
|
|
1250
1356
|
),
|
|
1251
|
-
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */
|
|
1357
|
+
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */ jsx28(
|
|
1252
1358
|
IconButton,
|
|
1253
1359
|
{
|
|
1254
1360
|
variant: "text",
|
|
@@ -1263,7 +1369,7 @@ var Search = forwardRef(({ width = "100%", size = "medium", ...props }, ref) =>
|
|
|
1263
1369
|
Search.displayName = "Search";
|
|
1264
1370
|
|
|
1265
1371
|
// src/segmented-control/segmented-control.tsx
|
|
1266
|
-
import React2, { Children, useRef as
|
|
1372
|
+
import React2, { Children, useRef as useRef4 } from "react";
|
|
1267
1373
|
|
|
1268
1374
|
// src/segmented-control/segmented-control-context.ts
|
|
1269
1375
|
import { createContext as createContext5 } from "react";
|
|
@@ -1271,9 +1377,9 @@ var SegmentedControlContext = createContext5(null);
|
|
|
1271
1377
|
|
|
1272
1378
|
// src/segmented-control/segmented-control-item.tsx
|
|
1273
1379
|
import { focusVisible as focusVisible11 } from "@zenkigen-inc/component-theme";
|
|
1274
|
-
import { clsx as
|
|
1275
|
-
import { useContext as useContext7, useEffect as useEffect3, useRef as
|
|
1276
|
-
import { jsx as
|
|
1380
|
+
import { clsx as clsx22 } from "clsx";
|
|
1381
|
+
import { useContext as useContext7, useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
1382
|
+
import { jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1277
1383
|
var SegmentedControlItem = ({
|
|
1278
1384
|
label,
|
|
1279
1385
|
value,
|
|
@@ -1283,8 +1389,8 @@ var SegmentedControlItem = ({
|
|
|
1283
1389
|
...rest
|
|
1284
1390
|
}) => {
|
|
1285
1391
|
const context = useContext7(SegmentedControlContext);
|
|
1286
|
-
const buttonRef =
|
|
1287
|
-
const lastInteractionWasMouse =
|
|
1392
|
+
const buttonRef = useRef3(null);
|
|
1393
|
+
const lastInteractionWasMouse = useRef3(false);
|
|
1288
1394
|
if (context === null) {
|
|
1289
1395
|
throw new Error("SegmentedControl.Item must be used within SegmentedControl");
|
|
1290
1396
|
}
|
|
@@ -1322,7 +1428,7 @@ var SegmentedControlItem = ({
|
|
|
1322
1428
|
lastInteractionWasMouse.current = false;
|
|
1323
1429
|
onBlur?.();
|
|
1324
1430
|
};
|
|
1325
|
-
const buttonClasses =
|
|
1431
|
+
const buttonClasses = clsx22("relative flex items-center justify-center gap-1 rounded", focusVisible11.normal, {
|
|
1326
1432
|
"px-2 min-h-[24px] typography-label12regular": size === "small",
|
|
1327
1433
|
"px-4 min-h-[32px] typography-label14regular": size === "medium",
|
|
1328
1434
|
// States - Default with hover
|
|
@@ -1332,7 +1438,7 @@ var SegmentedControlItem = ({
|
|
|
1332
1438
|
// States - Disabled
|
|
1333
1439
|
"text-disabled01 bg-transparent": isOptionDisabled === true
|
|
1334
1440
|
});
|
|
1335
|
-
return /* @__PURE__ */
|
|
1441
|
+
return /* @__PURE__ */ jsxs17(
|
|
1336
1442
|
"button",
|
|
1337
1443
|
{
|
|
1338
1444
|
ref: buttonRef,
|
|
@@ -1349,25 +1455,25 @@ var SegmentedControlItem = ({
|
|
|
1349
1455
|
onMouseDown: handleMouseDown,
|
|
1350
1456
|
...rest,
|
|
1351
1457
|
children: [
|
|
1352
|
-
Boolean(icon) === true && icon && /* @__PURE__ */
|
|
1458
|
+
Boolean(icon) === true && icon && /* @__PURE__ */ jsx29(
|
|
1353
1459
|
"span",
|
|
1354
1460
|
{
|
|
1355
|
-
className:
|
|
1461
|
+
className: clsx22("flex items-center", {
|
|
1356
1462
|
"fill-disabled01": isOptionDisabled === true,
|
|
1357
1463
|
"fill-interactive01": isSelected === true && isOptionDisabled === false,
|
|
1358
1464
|
"fill-icon01": isSelected === false && isOptionDisabled === false
|
|
1359
1465
|
}),
|
|
1360
|
-
children: /* @__PURE__ */
|
|
1466
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: icon, size: "small" })
|
|
1361
1467
|
}
|
|
1362
1468
|
),
|
|
1363
|
-
Boolean(label) === true && /* @__PURE__ */
|
|
1469
|
+
Boolean(label) === true && /* @__PURE__ */ jsx29("span", { className: "whitespace-nowrap", children: label })
|
|
1364
1470
|
]
|
|
1365
1471
|
}
|
|
1366
1472
|
);
|
|
1367
1473
|
};
|
|
1368
1474
|
|
|
1369
1475
|
// src/segmented-control/segmented-control.tsx
|
|
1370
|
-
import { Fragment as
|
|
1476
|
+
import { Fragment as Fragment4, jsx as jsx30 } from "react/jsx-runtime";
|
|
1371
1477
|
var SegmentedControl = ({
|
|
1372
1478
|
children,
|
|
1373
1479
|
value,
|
|
@@ -1377,7 +1483,7 @@ var SegmentedControl = ({
|
|
|
1377
1483
|
"aria-label": ariaLabel,
|
|
1378
1484
|
...rest
|
|
1379
1485
|
}) => {
|
|
1380
|
-
const containerRef =
|
|
1486
|
+
const containerRef = useRef4(null);
|
|
1381
1487
|
const itemIds = Children.toArray(children).filter((child) => {
|
|
1382
1488
|
if (!React2.isValidElement(child) || typeof child.props !== "object" || child.props === null || !("value" in child.props)) {
|
|
1383
1489
|
return false;
|
|
@@ -1412,7 +1518,7 @@ var SegmentedControl = ({
|
|
|
1412
1518
|
onBlur: handleBlurRovingFocus,
|
|
1413
1519
|
values: itemIds
|
|
1414
1520
|
};
|
|
1415
|
-
return /* @__PURE__ */
|
|
1521
|
+
return /* @__PURE__ */ jsx30(Fragment4, { children: /* @__PURE__ */ jsx30(SegmentedControlContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx30(
|
|
1416
1522
|
"div",
|
|
1417
1523
|
{
|
|
1418
1524
|
ref: containerRef,
|
|
@@ -1430,19 +1536,19 @@ SegmentedControl.Item = SegmentedControlItem;
|
|
|
1430
1536
|
|
|
1431
1537
|
// src/select-sort/select-sort.tsx
|
|
1432
1538
|
import { buttonColors as buttonColors4, focusVisible as focusVisible14 } from "@zenkigen-inc/component-theme";
|
|
1433
|
-
import
|
|
1434
|
-
import { useCallback as useCallback6, useRef as
|
|
1539
|
+
import clsx25 from "clsx";
|
|
1540
|
+
import { useCallback as useCallback6, useRef as useRef5, useState as useState9 } from "react";
|
|
1435
1541
|
|
|
1436
1542
|
// src/select-sort/select-list.tsx
|
|
1437
1543
|
import { focusVisible as focusVisible13 } from "@zenkigen-inc/component-theme";
|
|
1438
|
-
import
|
|
1544
|
+
import clsx24 from "clsx";
|
|
1439
1545
|
|
|
1440
1546
|
// src/select-sort/select-item.tsx
|
|
1441
1547
|
import { focusVisible as focusVisible12 } from "@zenkigen-inc/component-theme";
|
|
1442
|
-
import
|
|
1443
|
-
import { jsx as
|
|
1548
|
+
import clsx23 from "clsx";
|
|
1549
|
+
import { jsx as jsx31, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1444
1550
|
function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
1445
|
-
const itemClasses =
|
|
1551
|
+
const itemClasses = clsx23(
|
|
1446
1552
|
"typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
1447
1553
|
focusVisible12.inset,
|
|
1448
1554
|
{
|
|
@@ -1450,16 +1556,16 @@ function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
|
1450
1556
|
"bg-uiBackground01 fill-icon01 text-interactive02": !isSortKey
|
|
1451
1557
|
}
|
|
1452
1558
|
);
|
|
1453
|
-
return /* @__PURE__ */
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
-
isSortKey && /* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ jsx31("li", { className: "flex w-full items-center", onClick: onClickItem, children: /* @__PURE__ */ jsxs18("button", { className: itemClasses, type: "button", children: [
|
|
1560
|
+
/* @__PURE__ */ jsx31("span", { className: "ml-1 mr-6", children }),
|
|
1561
|
+
isSortKey && /* @__PURE__ */ jsx31("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx31(Icon, { name: "check", size: "small" }) })
|
|
1456
1562
|
] }) });
|
|
1457
1563
|
}
|
|
1458
1564
|
|
|
1459
1565
|
// src/select-sort/select-list.tsx
|
|
1460
|
-
import { jsx as
|
|
1566
|
+
import { jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1461
1567
|
function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect }) {
|
|
1462
|
-
const listClasses =
|
|
1568
|
+
const listClasses = clsx24(
|
|
1463
1569
|
"absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow",
|
|
1464
1570
|
{
|
|
1465
1571
|
"top-7": size === "x-small" || size === "small",
|
|
@@ -1468,19 +1574,19 @@ function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect })
|
|
|
1468
1574
|
"border-solid border border-uiBorder01": variant === "outline"
|
|
1469
1575
|
}
|
|
1470
1576
|
);
|
|
1471
|
-
const deselectButtonClasses =
|
|
1577
|
+
const deselectButtonClasses = clsx24(
|
|
1472
1578
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
1473
1579
|
focusVisible13.inset
|
|
1474
1580
|
);
|
|
1475
|
-
return /* @__PURE__ */
|
|
1476
|
-
/* @__PURE__ */
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
sortOrder !== null && onClickDeselect && /* @__PURE__ */
|
|
1581
|
+
return /* @__PURE__ */ jsxs19("ul", { className: listClasses, children: [
|
|
1582
|
+
/* @__PURE__ */ jsx32(SelectItem2, { isSortKey: sortOrder === "ascend", onClickItem: () => onClickItem("ascend"), children: "\u6607\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
1583
|
+
/* @__PURE__ */ jsx32(SelectItem2, { isSortKey: sortOrder === "descend", onClickItem: () => onClickItem("descend"), children: "\u964D\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
1584
|
+
sortOrder !== null && onClickDeselect && /* @__PURE__ */ jsx32("li", { children: /* @__PURE__ */ jsx32("button", { className: deselectButtonClasses, type: "button", onClick: onClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
|
|
1479
1585
|
] });
|
|
1480
1586
|
}
|
|
1481
1587
|
|
|
1482
1588
|
// src/select-sort/select-sort.tsx
|
|
1483
|
-
import { jsx as
|
|
1589
|
+
import { jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1484
1590
|
function SelectSort({
|
|
1485
1591
|
size = "medium",
|
|
1486
1592
|
variant = "outline",
|
|
@@ -1492,8 +1598,8 @@ function SelectSort({
|
|
|
1492
1598
|
onChange,
|
|
1493
1599
|
onClickDeselect
|
|
1494
1600
|
}) {
|
|
1495
|
-
const [isOptionListOpen, setIsOptionListOpen] =
|
|
1496
|
-
const targetRef =
|
|
1601
|
+
const [isOptionListOpen, setIsOptionListOpen] = useState9(false);
|
|
1602
|
+
const targetRef = useRef5(null);
|
|
1497
1603
|
useOutsideClick(targetRef, () => setIsOptionListOpen(false));
|
|
1498
1604
|
const handleClickToggle = () => setIsOptionListOpen((prev) => !prev);
|
|
1499
1605
|
const handleClickItem = useCallback6(
|
|
@@ -1503,13 +1609,13 @@ function SelectSort({
|
|
|
1503
1609
|
},
|
|
1504
1610
|
[onChange]
|
|
1505
1611
|
);
|
|
1506
|
-
const wrapperClasses =
|
|
1612
|
+
const wrapperClasses = clsx25("relative flex shrink-0 items-center gap-1 rounded", {
|
|
1507
1613
|
"h-6": size === "x-small" || size === "small",
|
|
1508
1614
|
"h-8": size === "medium",
|
|
1509
1615
|
"h-10": size === "large",
|
|
1510
1616
|
"cursor-not-allowed": isDisabled
|
|
1511
1617
|
});
|
|
1512
|
-
const buttonClasses =
|
|
1618
|
+
const buttonClasses = clsx25(
|
|
1513
1619
|
"flex size-full items-center rounded",
|
|
1514
1620
|
buttonColors4[variant].hover,
|
|
1515
1621
|
buttonColors4[variant].active,
|
|
@@ -1523,23 +1629,23 @@ function SelectSort({
|
|
|
1523
1629
|
"pointer-events-none": isDisabled
|
|
1524
1630
|
}
|
|
1525
1631
|
);
|
|
1526
|
-
const labelClasses =
|
|
1632
|
+
const labelClasses = clsx25("truncate", {
|
|
1527
1633
|
"typography-label12regular": size === "x-small",
|
|
1528
1634
|
"typography-label14regular": size === "small" || size === "medium",
|
|
1529
1635
|
"typography-label16regular": size === "large",
|
|
1530
1636
|
"mr-1": size === "x-small",
|
|
1531
1637
|
"mr-2": size !== "x-small"
|
|
1532
1638
|
});
|
|
1533
|
-
return /* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1536
|
-
/* @__PURE__ */
|
|
1639
|
+
return /* @__PURE__ */ jsxs20("div", { className: wrapperClasses, style: { width }, ref: targetRef, children: [
|
|
1640
|
+
/* @__PURE__ */ jsxs20("button", { className: buttonClasses, type: "button", onClick: handleClickToggle, disabled: isDisabled, children: [
|
|
1641
|
+
/* @__PURE__ */ jsx33("div", { className: labelClasses, children: label }),
|
|
1642
|
+
/* @__PURE__ */ jsx33("div", { className: "ml-auto flex items-center", children: isSortKey ? /* @__PURE__ */ jsx33(
|
|
1537
1643
|
Icon,
|
|
1538
1644
|
{
|
|
1539
1645
|
name: sortOrder === "ascend" ? "arrow-up" : "arrow-down",
|
|
1540
1646
|
size: size === "large" ? "medium" : "small"
|
|
1541
1647
|
}
|
|
1542
|
-
) : /* @__PURE__ */
|
|
1648
|
+
) : /* @__PURE__ */ jsx33(
|
|
1543
1649
|
Icon,
|
|
1544
1650
|
{
|
|
1545
1651
|
name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
|
|
@@ -1547,7 +1653,7 @@ function SelectSort({
|
|
|
1547
1653
|
}
|
|
1548
1654
|
) })
|
|
1549
1655
|
] }),
|
|
1550
|
-
isOptionListOpen && !isDisabled && /* @__PURE__ */
|
|
1656
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ jsx33(
|
|
1551
1657
|
SelectList2,
|
|
1552
1658
|
{
|
|
1553
1659
|
size,
|
|
@@ -1562,9 +1668,9 @@ function SelectSort({
|
|
|
1562
1668
|
|
|
1563
1669
|
// src/sort-button/sort-button.tsx
|
|
1564
1670
|
import { buttonColors as buttonColors5, focusVisible as focusVisible15 } from "@zenkigen-inc/component-theme";
|
|
1565
|
-
import
|
|
1671
|
+
import clsx26 from "clsx";
|
|
1566
1672
|
import { useCallback as useCallback7 } from "react";
|
|
1567
|
-
import { jsx as
|
|
1673
|
+
import { jsx as jsx34, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1568
1674
|
function SortButton({
|
|
1569
1675
|
size = "medium",
|
|
1570
1676
|
width,
|
|
@@ -1584,13 +1690,13 @@ function SortButton({
|
|
|
1584
1690
|
if (sortOrder === "descend") return "arrow-down";
|
|
1585
1691
|
return "angle-small-down";
|
|
1586
1692
|
};
|
|
1587
|
-
const wrapperClasses =
|
|
1693
|
+
const wrapperClasses = clsx26("relative flex shrink-0 items-center gap-1 rounded", {
|
|
1588
1694
|
"h-6": size === "x-small" || size === "small",
|
|
1589
1695
|
"h-8": size === "medium",
|
|
1590
1696
|
"h-10": size === "large",
|
|
1591
1697
|
"cursor-not-allowed": isDisabled
|
|
1592
1698
|
});
|
|
1593
|
-
const buttonClasses =
|
|
1699
|
+
const buttonClasses = clsx26(
|
|
1594
1700
|
"flex size-full items-center rounded",
|
|
1595
1701
|
buttonColors5.text.hover,
|
|
1596
1702
|
buttonColors5.text.active,
|
|
@@ -1606,14 +1712,14 @@ function SortButton({
|
|
|
1606
1712
|
"pointer-events-none": isDisabled
|
|
1607
1713
|
}
|
|
1608
1714
|
);
|
|
1609
|
-
const labelClasses =
|
|
1715
|
+
const labelClasses = clsx26("truncate", {
|
|
1610
1716
|
"typography-label12regular": size === "x-small",
|
|
1611
1717
|
"typography-label14regular": size === "small" || size === "medium",
|
|
1612
1718
|
"typography-label16regular": size === "large",
|
|
1613
1719
|
"mr-1": size === "x-small",
|
|
1614
1720
|
"mr-2": size !== "x-small"
|
|
1615
1721
|
});
|
|
1616
|
-
return /* @__PURE__ */
|
|
1722
|
+
return /* @__PURE__ */ jsx34("div", { className: wrapperClasses, style: { width }, children: /* @__PURE__ */ jsxs21(
|
|
1617
1723
|
"button",
|
|
1618
1724
|
{
|
|
1619
1725
|
className: buttonClasses,
|
|
@@ -1624,22 +1730,22 @@ function SortButton({
|
|
|
1624
1730
|
"aria-label": ariaLabel,
|
|
1625
1731
|
"aria-disabled": isDisabled,
|
|
1626
1732
|
children: [
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1733
|
+
/* @__PURE__ */ jsx34("div", { className: labelClasses, children: label }),
|
|
1734
|
+
/* @__PURE__ */ jsx34("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx34(Icon, { name: getIconName(), size: size === "large" ? "medium" : "small" }) })
|
|
1629
1735
|
]
|
|
1630
1736
|
}
|
|
1631
1737
|
) });
|
|
1632
1738
|
}
|
|
1633
1739
|
|
|
1634
1740
|
// src/tab/tab.tsx
|
|
1635
|
-
import { clsx as
|
|
1741
|
+
import { clsx as clsx28 } from "clsx";
|
|
1636
1742
|
import { Children as Children2 } from "react";
|
|
1637
1743
|
|
|
1638
1744
|
// src/tab/tab-item.tsx
|
|
1639
|
-
import { clsx as
|
|
1640
|
-
import { jsx as
|
|
1745
|
+
import { clsx as clsx27 } from "clsx";
|
|
1746
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1641
1747
|
var TabItem = ({ isSelected = false, ...props }) => {
|
|
1642
|
-
const classes =
|
|
1748
|
+
const classes = clsx27(
|
|
1643
1749
|
"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",
|
|
1644
1750
|
{
|
|
1645
1751
|
"typography-label14regular": !isSelected,
|
|
@@ -1648,7 +1754,7 @@ var TabItem = ({ isSelected = false, ...props }) => {
|
|
|
1648
1754
|
"before:bg-interactive01 hover:before:bg-interactive01 pointer-events-none": isSelected
|
|
1649
1755
|
}
|
|
1650
1756
|
);
|
|
1651
|
-
return /* @__PURE__ */
|
|
1757
|
+
return /* @__PURE__ */ jsx35(
|
|
1652
1758
|
"button",
|
|
1653
1759
|
{
|
|
1654
1760
|
type: "button",
|
|
@@ -1663,39 +1769,39 @@ var TabItem = ({ isSelected = false, ...props }) => {
|
|
|
1663
1769
|
};
|
|
1664
1770
|
|
|
1665
1771
|
// src/tab/tab.tsx
|
|
1666
|
-
import { jsx as
|
|
1772
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1667
1773
|
function Tab({ children, layout = "auto" }) {
|
|
1668
1774
|
const childrenCount = Children2.count(children);
|
|
1669
1775
|
const containerStyle = layout === "equal" ? { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` } : {};
|
|
1670
|
-
const containerClasses =
|
|
1776
|
+
const containerClasses = clsx28(
|
|
1671
1777
|
"relative gap-4 px-6 before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-uiBorder01",
|
|
1672
1778
|
{
|
|
1673
1779
|
flex: layout === "auto",
|
|
1674
1780
|
grid: layout === "equal"
|
|
1675
1781
|
}
|
|
1676
1782
|
);
|
|
1677
|
-
return /* @__PURE__ */
|
|
1783
|
+
return /* @__PURE__ */ jsx36("div", { role: "tablist", className: containerClasses, style: containerStyle, children });
|
|
1678
1784
|
}
|
|
1679
1785
|
Tab.Item = TabItem;
|
|
1680
1786
|
|
|
1681
1787
|
// src/table/table-cell.tsx
|
|
1682
|
-
import
|
|
1683
|
-
import { jsx as
|
|
1788
|
+
import clsx29 from "clsx";
|
|
1789
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1684
1790
|
function TableCell({ children, className, isHeader = false }) {
|
|
1685
|
-
const classes =
|
|
1686
|
-
return /* @__PURE__ */
|
|
1791
|
+
const classes = clsx29("border-b border-uiBorder01", { "sticky top-0 z-10 bg-white": isHeader }, className);
|
|
1792
|
+
return /* @__PURE__ */ jsx37("div", { className: classes, children });
|
|
1687
1793
|
}
|
|
1688
1794
|
|
|
1689
1795
|
// src/table/table-row.tsx
|
|
1690
|
-
import
|
|
1691
|
-
import { jsx as
|
|
1796
|
+
import clsx30 from "clsx";
|
|
1797
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1692
1798
|
function TableRow({ children, isHoverBackgroundVisible = false }) {
|
|
1693
|
-
const rowClasses =
|
|
1694
|
-
return /* @__PURE__ */
|
|
1799
|
+
const rowClasses = clsx30("contents", isHoverBackgroundVisible && "[&:hover>div]:bg-hoverUi02");
|
|
1800
|
+
return /* @__PURE__ */ jsx38("div", { className: rowClasses, children });
|
|
1695
1801
|
}
|
|
1696
1802
|
|
|
1697
1803
|
// src/table/table.tsx
|
|
1698
|
-
import { jsx as
|
|
1804
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1699
1805
|
function Table({
|
|
1700
1806
|
width,
|
|
1701
1807
|
templateRows,
|
|
@@ -1704,7 +1810,7 @@ function Table({
|
|
|
1704
1810
|
autoRows,
|
|
1705
1811
|
children
|
|
1706
1812
|
}) {
|
|
1707
|
-
return /* @__PURE__ */
|
|
1813
|
+
return /* @__PURE__ */ jsx39(
|
|
1708
1814
|
"div",
|
|
1709
1815
|
{
|
|
1710
1816
|
className: "grid",
|
|
@@ -1724,22 +1830,22 @@ Table.Cell = TableCell;
|
|
|
1724
1830
|
|
|
1725
1831
|
// src/tag/tag.tsx
|
|
1726
1832
|
import { tagColors, tagLightColors } from "@zenkigen-inc/component-theme";
|
|
1727
|
-
import
|
|
1833
|
+
import clsx32 from "clsx";
|
|
1728
1834
|
|
|
1729
1835
|
// src/tag/delete-icon.tsx
|
|
1730
1836
|
import { focusVisible as focusVisible16 } from "@zenkigen-inc/component-theme";
|
|
1731
|
-
import
|
|
1732
|
-
import { jsx as
|
|
1837
|
+
import clsx31 from "clsx";
|
|
1838
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1733
1839
|
var DeleteIcon = ({ color, variant, onClick }) => {
|
|
1734
|
-
const deleteButtonClasses =
|
|
1840
|
+
const deleteButtonClasses = clsx31(
|
|
1735
1841
|
"group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor",
|
|
1736
1842
|
focusVisible16.normal
|
|
1737
1843
|
);
|
|
1738
|
-
const deletePathClasses =
|
|
1844
|
+
const deletePathClasses = clsx31({
|
|
1739
1845
|
"fill-interactive02": color === "gray" || variant === "light",
|
|
1740
1846
|
"group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor": color !== "gray"
|
|
1741
1847
|
});
|
|
1742
|
-
return /* @__PURE__ */
|
|
1848
|
+
return /* @__PURE__ */ jsx40("button", { type: "button", className: deleteButtonClasses, onClick, children: /* @__PURE__ */ jsx40("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx40(
|
|
1743
1849
|
"path",
|
|
1744
1850
|
{
|
|
1745
1851
|
fillRule: "evenodd",
|
|
@@ -1751,9 +1857,9 @@ var DeleteIcon = ({ color, variant, onClick }) => {
|
|
|
1751
1857
|
};
|
|
1752
1858
|
|
|
1753
1859
|
// src/tag/tag.tsx
|
|
1754
|
-
import { jsx as
|
|
1860
|
+
import { jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1755
1861
|
function Tag({ id, children, color, variant = "normal", size = "medium", isEditable, onDelete }) {
|
|
1756
|
-
const wrapperClasses =
|
|
1862
|
+
const wrapperClasses = clsx32("flex", "items-center", "justify-center", {
|
|
1757
1863
|
[tagColors[color]]: variant === "normal",
|
|
1758
1864
|
[tagLightColors[color]]: variant === "light",
|
|
1759
1865
|
"h-[14px] typography-label11regular": !isEditable && size === "x-small",
|
|
@@ -1765,17 +1871,17 @@ function Tag({ id, children, color, variant = "normal", size = "medium", isEdita
|
|
|
1765
1871
|
"py-0.5 px-1": !isEditable,
|
|
1766
1872
|
"py-1 px-2": isEditable
|
|
1767
1873
|
});
|
|
1768
|
-
return /* @__PURE__ */
|
|
1874
|
+
return /* @__PURE__ */ jsxs22("div", { className: wrapperClasses, children: [
|
|
1769
1875
|
children,
|
|
1770
|
-
isEditable ? /* @__PURE__ */
|
|
1876
|
+
isEditable ? /* @__PURE__ */ jsx41(DeleteIcon, { onClick: () => onDelete(id), color, variant }) : null
|
|
1771
1877
|
] });
|
|
1772
1878
|
}
|
|
1773
1879
|
|
|
1774
1880
|
// src/text-area/text-area.tsx
|
|
1775
|
-
import { clsx as
|
|
1776
|
-
import { forwardRef as
|
|
1777
|
-
import { jsx as
|
|
1778
|
-
var TextArea =
|
|
1881
|
+
import { clsx as clsx33 } from "clsx";
|
|
1882
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
1883
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1884
|
+
var TextArea = forwardRef5(
|
|
1779
1885
|
({
|
|
1780
1886
|
size = "medium",
|
|
1781
1887
|
isResizable = false,
|
|
@@ -1786,7 +1892,7 @@ var TextArea = forwardRef2(
|
|
|
1786
1892
|
height,
|
|
1787
1893
|
...props
|
|
1788
1894
|
}, ref) => {
|
|
1789
|
-
const classes =
|
|
1895
|
+
const classes = clsx33(
|
|
1790
1896
|
"w-full rounded border outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder",
|
|
1791
1897
|
{
|
|
1792
1898
|
"border-supportError": isError && !disabled,
|
|
@@ -1800,7 +1906,7 @@ var TextArea = forwardRef2(
|
|
|
1800
1906
|
"resize-none": !isResizable
|
|
1801
1907
|
}
|
|
1802
1908
|
);
|
|
1803
|
-
return /* @__PURE__ */
|
|
1909
|
+
return /* @__PURE__ */ jsx42("div", { className: "flex", children: /* @__PURE__ */ jsx42(
|
|
1804
1910
|
"textarea",
|
|
1805
1911
|
{
|
|
1806
1912
|
ref,
|
|
@@ -1820,42 +1926,10 @@ var TextArea = forwardRef2(
|
|
|
1820
1926
|
);
|
|
1821
1927
|
TextArea.displayName = "TextArea";
|
|
1822
1928
|
|
|
1823
|
-
// src/text-input/text-input.tsx
|
|
1824
|
-
import { clsx as clsx33 } from "clsx";
|
|
1825
|
-
import { forwardRef as forwardRef3 } from "react";
|
|
1826
|
-
import { jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1827
|
-
var TextInput = forwardRef3(
|
|
1828
|
-
({ size = "medium", isError = false, disabled = false, onClickClearButton, ...props }, ref) => {
|
|
1829
|
-
const isShowClearButton = !!onClickClearButton && props.value.length !== 0 && !disabled;
|
|
1830
|
-
const inputWrapClasses = clsx33("relative flex items-center gap-2 overflow-hidden rounded border", {
|
|
1831
|
-
"border-uiBorder02": !isError && !disabled,
|
|
1832
|
-
"border-supportError": isError && !disabled,
|
|
1833
|
-
"hover:border-hoverInput": !disabled && !isError,
|
|
1834
|
-
"hover:focus-within:border-activeInput": !isError,
|
|
1835
|
-
"focus-within:border-activeInput": !isError,
|
|
1836
|
-
"bg-disabled02 border-disabled01": disabled,
|
|
1837
|
-
"pr-2": size === "medium" && isShowClearButton,
|
|
1838
|
-
"pr-3": size === "large" && isShowClearButton
|
|
1839
|
-
});
|
|
1840
|
-
const inputClasses = clsx33("flex-1 outline-0 placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
|
|
1841
|
-
["typography-label14regular min-h-8 px-2"]: size === "medium",
|
|
1842
|
-
["typography-label16regular min-h-10 px-3"]: size === "large",
|
|
1843
|
-
"text-text01": !isError,
|
|
1844
|
-
"text-supportError": isError,
|
|
1845
|
-
"pr-0": isShowClearButton
|
|
1846
|
-
});
|
|
1847
|
-
return /* @__PURE__ */ jsxs22("div", { className: inputWrapClasses, children: [
|
|
1848
|
-
/* @__PURE__ */ jsx41("input", { ref, size: 1, className: inputClasses, disabled, onChange: props.onChange, ...props }),
|
|
1849
|
-
isShowClearButton && /* @__PURE__ */ jsx41(IconButton, { variant: "text", icon: "close", size: "small", onClick: onClickClearButton })
|
|
1850
|
-
] });
|
|
1851
|
-
}
|
|
1852
|
-
);
|
|
1853
|
-
TextInput.displayName = "TextInput";
|
|
1854
|
-
|
|
1855
1929
|
// src/toast/toast.tsx
|
|
1856
1930
|
import clsx34 from "clsx";
|
|
1857
|
-
import { useCallback as useCallback8, useEffect as useEffect4, useState as
|
|
1858
|
-
import { jsx as
|
|
1931
|
+
import { useCallback as useCallback8, useEffect as useEffect4, useState as useState10 } from "react";
|
|
1932
|
+
import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1859
1933
|
var CLOSE_TIME_MSEC = 5e3;
|
|
1860
1934
|
function Toast({
|
|
1861
1935
|
state = "information",
|
|
@@ -1865,7 +1939,7 @@ function Toast({
|
|
|
1865
1939
|
children,
|
|
1866
1940
|
onClickClose
|
|
1867
1941
|
}) {
|
|
1868
|
-
const [isRemoving, setIsRemoving] =
|
|
1942
|
+
const [isRemoving, setIsRemoving] = useState10(false);
|
|
1869
1943
|
const handleClose = useCallback8(() => {
|
|
1870
1944
|
if (isAnimation) {
|
|
1871
1945
|
setIsRemoving(true);
|
|
@@ -1903,20 +1977,20 @@ function Toast({
|
|
|
1903
1977
|
return () => window.clearTimeout(timer);
|
|
1904
1978
|
}, [isAutoClose]);
|
|
1905
1979
|
return /* @__PURE__ */ jsxs23("div", { className: wrapperClasses, style: { width }, onAnimationEnd: handleAnimationEnd, children: [
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
/* @__PURE__ */
|
|
1908
|
-
/* @__PURE__ */
|
|
1980
|
+
/* @__PURE__ */ jsx43("div", { className: iconClasses, children: /* @__PURE__ */ jsx43(Icon, { name: iconName[state] }) }),
|
|
1981
|
+
/* @__PURE__ */ jsx43("p", { className: textClasses, children }),
|
|
1982
|
+
/* @__PURE__ */ jsx43(IconButton, { icon: "close", size: "medium", variant: "text", onClick: handleClose, isNoPadding: true })
|
|
1909
1983
|
] });
|
|
1910
1984
|
}
|
|
1911
1985
|
|
|
1912
1986
|
// src/toast/toast-provider.tsx
|
|
1913
|
-
import { createContext as createContext6, useCallback as useCallback9, useContext as useContext8, useEffect as useEffect5, useState as
|
|
1987
|
+
import { createContext as createContext6, useCallback as useCallback9, useContext as useContext8, useEffect as useEffect5, useState as useState11 } from "react";
|
|
1914
1988
|
import { createPortal as createPortal3 } from "react-dom";
|
|
1915
|
-
import { jsx as
|
|
1989
|
+
import { jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1916
1990
|
var ToastContext = createContext6({});
|
|
1917
1991
|
var ToastProvider = ({ children }) => {
|
|
1918
|
-
const [isClientRender, setIsClientRender] =
|
|
1919
|
-
const [toasts, setToasts] =
|
|
1992
|
+
const [isClientRender, setIsClientRender] = useState11(false);
|
|
1993
|
+
const [toasts, setToasts] = useState11([]);
|
|
1920
1994
|
const addToast = useCallback9(({ message, state }) => {
|
|
1921
1995
|
setToasts((prev) => [...prev, { id: Math.trunc(Math.random() * 1e5), message, state }]);
|
|
1922
1996
|
}, []);
|
|
@@ -1929,7 +2003,7 @@ var ToastProvider = ({ children }) => {
|
|
|
1929
2003
|
return /* @__PURE__ */ jsxs24(ToastContext.Provider, { value: { addToast, removeToast }, children: [
|
|
1930
2004
|
children,
|
|
1931
2005
|
isClientRender && createPortal3(
|
|
1932
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ jsx44("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__ */ jsx44(Toast, { state, isAutoClose: true, isAnimation: true, onClickClose: () => removeToast(id), width: 475, children: message }, id)) }),
|
|
1933
2007
|
document.body
|
|
1934
2008
|
)
|
|
1935
2009
|
] });
|
|
@@ -1940,7 +2014,7 @@ var useToast = () => {
|
|
|
1940
2014
|
|
|
1941
2015
|
// src/toggle/toggle.tsx
|
|
1942
2016
|
import clsx35 from "clsx";
|
|
1943
|
-
import { jsx as
|
|
2017
|
+
import { jsx as jsx45, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1944
2018
|
function Toggle({
|
|
1945
2019
|
id,
|
|
1946
2020
|
size = "medium",
|
|
@@ -1976,8 +2050,8 @@ function Toggle({
|
|
|
1976
2050
|
"cursor-pointer text-text01": !isDisabled
|
|
1977
2051
|
});
|
|
1978
2052
|
return /* @__PURE__ */ jsxs25("div", { className: "relative flex flex-[0_0_auto] items-center", children: [
|
|
1979
|
-
label != null && labelPosition === "left" && /* @__PURE__ */
|
|
1980
|
-
/* @__PURE__ */
|
|
2053
|
+
label != null && labelPosition === "left" && /* @__PURE__ */ jsx45("label", { htmlFor: id, className: labelClasses, children: label }),
|
|
2054
|
+
/* @__PURE__ */ jsx45(
|
|
1981
2055
|
"input",
|
|
1982
2056
|
{
|
|
1983
2057
|
className: inputClasses,
|
|
@@ -1989,13 +2063,13 @@ function Toggle({
|
|
|
1989
2063
|
disabled: isDisabled
|
|
1990
2064
|
}
|
|
1991
2065
|
),
|
|
1992
|
-
/* @__PURE__ */
|
|
1993
|
-
label != null && labelPosition === "right" && /* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ jsx45("div", { className: baseClasses, children: /* @__PURE__ */ jsx45("span", { className: indicatorClasses }) }),
|
|
2067
|
+
label != null && labelPosition === "right" && /* @__PURE__ */ jsx45("label", { htmlFor: id, className: labelClasses, children: label })
|
|
1994
2068
|
] });
|
|
1995
2069
|
}
|
|
1996
2070
|
|
|
1997
2071
|
// src/tooltip/tooltip.tsx
|
|
1998
|
-
import { useCallback as useCallback11, useEffect as useEffect6, useRef as
|
|
2072
|
+
import { useCallback as useCallback11, useEffect as useEffect6, useRef as useRef6, useState as useState12 } from "react";
|
|
1999
2073
|
import { createPortal as createPortal4 } from "react-dom";
|
|
2000
2074
|
|
|
2001
2075
|
// src/tooltip/tooltip-content.tsx
|
|
@@ -2003,7 +2077,7 @@ import clsx37 from "clsx";
|
|
|
2003
2077
|
|
|
2004
2078
|
// src/tooltip/tail-icon.tsx
|
|
2005
2079
|
import clsx36 from "clsx";
|
|
2006
|
-
import { jsx as
|
|
2080
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2007
2081
|
var TailIcon = (props) => {
|
|
2008
2082
|
const tailClasses = clsx36("absolute fill-uiBackgroundTooltip", {
|
|
2009
2083
|
"rotate-180": props.verticalPosition === "bottom",
|
|
@@ -2020,9 +2094,9 @@ var TailIcon = (props) => {
|
|
|
2020
2094
|
"left-1/2 -translate-x-2": props.horizontalAlign === "center" && props.size !== "small"
|
|
2021
2095
|
});
|
|
2022
2096
|
if (props.size === "small") {
|
|
2023
|
-
return /* @__PURE__ */
|
|
2097
|
+
return /* @__PURE__ */ jsx46("svg", { className: tailClasses, width: "8", height: "4", viewBox: "0 0 8 4", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx46("path", { d: "M4 4L0 0H8L4 4Z" }) });
|
|
2024
2098
|
} else {
|
|
2025
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ jsx46(
|
|
2026
2100
|
"svg",
|
|
2027
2101
|
{
|
|
2028
2102
|
className: tailClasses,
|
|
@@ -2031,14 +2105,14 @@ var TailIcon = (props) => {
|
|
|
2031
2105
|
viewBox: "0 0 14 8",
|
|
2032
2106
|
fill: "none",
|
|
2033
2107
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2034
|
-
children: /* @__PURE__ */
|
|
2108
|
+
children: /* @__PURE__ */ jsx46("path", { d: "M7 8L0 0H14L7 8Z" })
|
|
2035
2109
|
}
|
|
2036
2110
|
);
|
|
2037
2111
|
}
|
|
2038
2112
|
};
|
|
2039
2113
|
|
|
2040
2114
|
// src/tooltip/tooltip-content.tsx
|
|
2041
|
-
import { jsx as
|
|
2115
|
+
import { jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2042
2116
|
var TooltipContent = ({
|
|
2043
2117
|
content,
|
|
2044
2118
|
horizontalAlign,
|
|
@@ -2074,7 +2148,7 @@ var TooltipContent = ({
|
|
|
2074
2148
|
transform: `translate(${tooltipPosition.translateX}, ${tooltipPosition.translateY})`,
|
|
2075
2149
|
...tooltipPosition
|
|
2076
2150
|
} : {};
|
|
2077
|
-
return /* @__PURE__ */
|
|
2151
|
+
return /* @__PURE__ */ jsx47("div", { className: tooltipWrapperClasses, style: tooltipWrapperStyle, children: /* @__PURE__ */ jsxs26(
|
|
2078
2152
|
"div",
|
|
2079
2153
|
{
|
|
2080
2154
|
className: tooltipBodyClasses,
|
|
@@ -2083,7 +2157,7 @@ var TooltipContent = ({
|
|
|
2083
2157
|
},
|
|
2084
2158
|
children: [
|
|
2085
2159
|
content,
|
|
2086
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ jsx47(TailIcon, { size, verticalPosition, horizontalAlign })
|
|
2087
2161
|
]
|
|
2088
2162
|
}
|
|
2089
2163
|
) });
|
|
@@ -2144,7 +2218,7 @@ var useTooltip = () => {
|
|
|
2144
2218
|
};
|
|
2145
2219
|
|
|
2146
2220
|
// src/tooltip/tooltip.tsx
|
|
2147
|
-
import { jsx as
|
|
2221
|
+
import { jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2148
2222
|
function Tooltip({
|
|
2149
2223
|
children,
|
|
2150
2224
|
content,
|
|
@@ -2156,8 +2230,8 @@ function Tooltip({
|
|
|
2156
2230
|
portalTarget
|
|
2157
2231
|
}) {
|
|
2158
2232
|
const { calculatePosition } = useTooltip();
|
|
2159
|
-
const [isVisible, setIsVisible] =
|
|
2160
|
-
const [tooltipPosition, setTooltipPosition] =
|
|
2233
|
+
const [isVisible, setIsVisible] = useState12(false);
|
|
2234
|
+
const [tooltipPosition, setTooltipPosition] = useState12({
|
|
2161
2235
|
maxWidth: "none",
|
|
2162
2236
|
width: "auto",
|
|
2163
2237
|
left: "0px",
|
|
@@ -2166,7 +2240,7 @@ function Tooltip({
|
|
|
2166
2240
|
translateX: "0",
|
|
2167
2241
|
translateY: "0"
|
|
2168
2242
|
});
|
|
2169
|
-
const targetRef =
|
|
2243
|
+
const targetRef = useRef6(null);
|
|
2170
2244
|
const handleMouseOverWrapper = useCallback11(() => {
|
|
2171
2245
|
if (isDisabledHover) {
|
|
2172
2246
|
return;
|
|
@@ -2191,7 +2265,7 @@ function Tooltip({
|
|
|
2191
2265
|
onMouseLeave: handleMouseOutWrapper,
|
|
2192
2266
|
children: [
|
|
2193
2267
|
children,
|
|
2194
|
-
isVisible && (portalTarget == null ? /* @__PURE__ */
|
|
2268
|
+
isVisible && (portalTarget == null ? /* @__PURE__ */ jsx48(
|
|
2195
2269
|
TooltipContent,
|
|
2196
2270
|
{
|
|
2197
2271
|
content,
|
|
@@ -2202,7 +2276,7 @@ function Tooltip({
|
|
|
2202
2276
|
tooltipPosition
|
|
2203
2277
|
}
|
|
2204
2278
|
) : createPortal4(
|
|
2205
|
-
/* @__PURE__ */
|
|
2279
|
+
/* @__PURE__ */ jsx48(
|
|
2206
2280
|
TooltipContent,
|
|
2207
2281
|
{
|
|
2208
2282
|
isPortal: true,
|
|
@@ -2235,6 +2309,7 @@ export {
|
|
|
2235
2309
|
NotificationInline,
|
|
2236
2310
|
Pagination,
|
|
2237
2311
|
PaginationSelect,
|
|
2312
|
+
PasswordInput,
|
|
2238
2313
|
Radio,
|
|
2239
2314
|
Search,
|
|
2240
2315
|
SegmentedControl,
|