@zenkigen-inc/component-ui 1.19.3 → 1.20.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 +24 -4
- package/dist/index.d.ts +24 -4
- package/dist/index.js +278 -239
- package/dist/index.mjs +237 -199
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
Button: () => Button,
|
|
36
36
|
Checkbox: () => Checkbox,
|
|
37
37
|
DatePicker: () => DatePicker,
|
|
38
|
+
Divider: () => Divider,
|
|
38
39
|
Dropdown: () => Dropdown,
|
|
39
40
|
EvaluationStar: () => EvaluationStar,
|
|
40
41
|
FileInput: () => FileInput,
|
|
@@ -146,7 +147,7 @@ function Avatar({ size = "medium", ...props }) {
|
|
|
146
147
|
// src/breadcrumb/breadcrumb-item.tsx
|
|
147
148
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
148
149
|
var BreadcrumbItem = ({ children }) => {
|
|
149
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { className: "flex gap-2 after:content-['/'] last:after:content-none [&_a]:text-interactive02 [&_a]:hover:underline", children });
|
|
150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { className: "flex gap-2 after:content-['/'] last:after:content-none [&_a]:text-interactive02 [&_a]:hover:underline [&_a]:active:text-activeLink02 [&_a]:active:underline", children });
|
|
150
151
|
};
|
|
151
152
|
|
|
152
153
|
// src/breadcrumb/breadcrumb.tsx
|
|
@@ -1034,6 +1035,12 @@ var DatePicker = ({
|
|
|
1034
1035
|
DatePicker.ErrorMessage = DatePickerErrorMessage;
|
|
1035
1036
|
DatePicker.displayName = "DatePicker";
|
|
1036
1037
|
|
|
1038
|
+
// src/divider/divider.tsx
|
|
1039
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1040
|
+
function Divider() {
|
|
1041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("hr", { className: "h-px w-full border-0 bg-uiBorder01" });
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1037
1044
|
// src/dropdown/dropdown.tsx
|
|
1038
1045
|
var import_component_theme8 = require("@zenkigen-inc/component-theme");
|
|
1039
1046
|
var import_clsx13 = __toESM(require("clsx"));
|
|
@@ -1046,7 +1053,11 @@ var useOutsideClick = (ref, handler, enabled = true) => {
|
|
|
1046
1053
|
(0, import_react11.useEffect)(() => {
|
|
1047
1054
|
const listener = (event) => {
|
|
1048
1055
|
const element = ref?.current;
|
|
1049
|
-
|
|
1056
|
+
const target = event.target;
|
|
1057
|
+
if (target instanceof Node && target.isConnected === false) {
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
if (element == null || Boolean(element.contains(target ?? null))) {
|
|
1050
1061
|
return;
|
|
1051
1062
|
}
|
|
1052
1063
|
handler(event);
|
|
@@ -1072,7 +1083,7 @@ var DropdownContext = (0, import_react12.createContext)({
|
|
|
1072
1083
|
var import_component_theme7 = require("@zenkigen-inc/component-theme");
|
|
1073
1084
|
var import_clsx11 = __toESM(require("clsx"));
|
|
1074
1085
|
var import_react13 = require("react");
|
|
1075
|
-
var
|
|
1086
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1076
1087
|
function DropdownItem({ children, color = "gray", onClick }) {
|
|
1077
1088
|
const { setIsVisible } = (0, import_react13.useContext)(DropdownContext);
|
|
1078
1089
|
const handleClickItem = (event) => {
|
|
@@ -1087,13 +1098,13 @@ function DropdownItem({ children, color = "gray", onClick }) {
|
|
|
1087
1098
|
"fill-supportDanger text-supportDanger": color === "red"
|
|
1088
1099
|
}
|
|
1089
1100
|
);
|
|
1090
|
-
return /* @__PURE__ */ (0,
|
|
1101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { className: "flex w-full items-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { className: itemClasses, type: "button", onClick: handleClickItem, children }) });
|
|
1091
1102
|
}
|
|
1092
1103
|
|
|
1093
1104
|
// src/dropdown/dropdown-menu.tsx
|
|
1094
1105
|
var import_clsx12 = __toESM(require("clsx"));
|
|
1095
1106
|
var import_react14 = require("react");
|
|
1096
|
-
var
|
|
1107
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1097
1108
|
function DropdownMenu({
|
|
1098
1109
|
children,
|
|
1099
1110
|
maxHeight,
|
|
@@ -1110,7 +1121,7 @@ function DropdownMenu({
|
|
|
1110
1121
|
"right-0": horizontalAlign === "right",
|
|
1111
1122
|
"left-auto": horizontalAlign === "center"
|
|
1112
1123
|
});
|
|
1113
|
-
return isVisible && !isDisabled && /* @__PURE__ */ (0,
|
|
1124
|
+
return isVisible && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1114
1125
|
"ul",
|
|
1115
1126
|
{
|
|
1116
1127
|
className: wrapperClasses,
|
|
@@ -1125,7 +1136,7 @@ function DropdownMenu({
|
|
|
1125
1136
|
}
|
|
1126
1137
|
|
|
1127
1138
|
// src/dropdown/dropdown.tsx
|
|
1128
|
-
var
|
|
1139
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1129
1140
|
function Dropdown({
|
|
1130
1141
|
children,
|
|
1131
1142
|
target,
|
|
@@ -1193,12 +1204,12 @@ function Dropdown({
|
|
|
1193
1204
|
"typography-label14regular": size === "small" || size === "medium",
|
|
1194
1205
|
"typography-label16regular": size === "large"
|
|
1195
1206
|
});
|
|
1196
|
-
return /* @__PURE__ */ (0,
|
|
1207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1197
1208
|
DropdownContext.Provider,
|
|
1198
1209
|
{
|
|
1199
1210
|
value: { isVisible, setIsVisible, isDisabled, targetDimensions, variant, portalTargetRef },
|
|
1200
|
-
children: /* @__PURE__ */ (0,
|
|
1201
|
-
target ? /* @__PURE__ */ (0,
|
|
1211
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { ref: targetRef, className: wrapperClasses, children: [
|
|
1212
|
+
target ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1202
1213
|
"button",
|
|
1203
1214
|
{
|
|
1204
1215
|
type: "button",
|
|
@@ -1208,7 +1219,7 @@ function Dropdown({
|
|
|
1208
1219
|
disabled: isDisabled,
|
|
1209
1220
|
children: [
|
|
1210
1221
|
target,
|
|
1211
|
-
!isArrowHidden && /* @__PURE__ */ (0,
|
|
1222
|
+
!isArrowHidden && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "ml-2 flex items-center fill-icon01", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1212
1223
|
Icon,
|
|
1213
1224
|
{
|
|
1214
1225
|
name: isVisible ? "angle-small-up" : "angle-small-down",
|
|
@@ -1217,10 +1228,10 @@ function Dropdown({
|
|
|
1217
1228
|
) })
|
|
1218
1229
|
]
|
|
1219
1230
|
}
|
|
1220
|
-
) : /* @__PURE__ */ (0,
|
|
1221
|
-
icon && /* @__PURE__ */ (0,
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1223
|
-
!isArrowHidden && /* @__PURE__ */ (0,
|
|
1231
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", title, className: buttonClasses, onClick: handleToggle, disabled: isDisabled, children: [
|
|
1232
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "mr-1 flex", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: icon, size: size === "large" ? "medium" : "small" }) }),
|
|
1233
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: labelClasses, children: label }),
|
|
1234
|
+
!isArrowHidden && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: isVisible ? "angle-small-up" : "angle-small-down", size: "small" }) })
|
|
1224
1235
|
] }),
|
|
1225
1236
|
!portalTargetRef ? children : portalTargetRef != null && portalTargetRef.current && (0, import_react_dom.createPortal)(children, portalTargetRef.current)
|
|
1226
1237
|
] })
|
|
@@ -1235,7 +1246,7 @@ var import_component_icons2 = require("@zenkigen-inc/component-icons");
|
|
|
1235
1246
|
var import_component_theme9 = require("@zenkigen-inc/component-theme");
|
|
1236
1247
|
var import_clsx14 = __toESM(require("clsx"));
|
|
1237
1248
|
var import_react16 = require("react");
|
|
1238
|
-
var
|
|
1249
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1239
1250
|
function EvaluationStar({ value, isEditable = false, onChangeRating, size = "medium" }) {
|
|
1240
1251
|
const maxRating = 5;
|
|
1241
1252
|
const [currentRating, setCurrentRating] = (0, import_react16.useState)(value);
|
|
@@ -1254,26 +1265,26 @@ function EvaluationStar({ value, isEditable = false, onChangeRating, size = "med
|
|
|
1254
1265
|
const renderStar = (rating) => {
|
|
1255
1266
|
const color = rating <= currentRating ? "fill-yellow-yellow50" : "fill-icon03";
|
|
1256
1267
|
const IconComponent = import_component_icons2.iconElements["star-filled"];
|
|
1257
|
-
return /* @__PURE__ */ (0,
|
|
1268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1258
1269
|
"button",
|
|
1259
1270
|
{
|
|
1260
1271
|
type: "button",
|
|
1261
1272
|
onClick: () => handleChangeRating(rating),
|
|
1262
1273
|
className: (0, import_clsx14.default)(color, starClasses),
|
|
1263
1274
|
disabled: !isEditable,
|
|
1264
|
-
children: /* @__PURE__ */ (0,
|
|
1275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(IconComponent, {})
|
|
1265
1276
|
},
|
|
1266
1277
|
rating
|
|
1267
1278
|
);
|
|
1268
1279
|
};
|
|
1269
1280
|
const ratingStars = Array.from({ length: maxRating }, (_, index) => renderStar(index + 1));
|
|
1270
|
-
return /* @__PURE__ */ (0,
|
|
1281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex flex-row", children: ratingStars });
|
|
1271
1282
|
}
|
|
1272
1283
|
|
|
1273
1284
|
// src/file-input/file-input.tsx
|
|
1274
1285
|
var import_clsx15 = require("clsx");
|
|
1275
1286
|
var import_react17 = require("react");
|
|
1276
|
-
var
|
|
1287
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1277
1288
|
var ERROR_TYPES = {
|
|
1278
1289
|
SIZE_TOO_LARGE: "SIZE_TOO_LARGE",
|
|
1279
1290
|
UNSUPPORTED_FORMAT: "UNSUPPORTED_FORMAT"
|
|
@@ -1408,9 +1419,9 @@ var FileInput = (0, import_react17.forwardRef)(
|
|
|
1408
1419
|
{
|
|
1409
1420
|
"border-uiBorder03 bg-white text-text01": !isDisabled && !isDragOver && !hasErrors,
|
|
1410
1421
|
"border-activeInput bg-activeInput/5": !isDisabled && isDragOver && !hasErrors,
|
|
1411
|
-
"border-supportDanger bg-
|
|
1422
|
+
"border-supportDanger bg-uiBackground01": hasErrors && !isDisabled,
|
|
1412
1423
|
"cursor-pointer hover:bg-hover02 active:bg-active02": !isDisabled,
|
|
1413
|
-
"hover:bg-
|
|
1424
|
+
"hover:bg-hoverUiError active:bg-activeUiError": !isDisabled && hasErrors,
|
|
1414
1425
|
"border-disabled01 bg-disabled02 text-textPlaceholder cursor-not-allowed": isDisabled
|
|
1415
1426
|
}
|
|
1416
1427
|
);
|
|
@@ -1449,8 +1460,8 @@ var FileInput = (0, import_react17.forwardRef)(
|
|
|
1449
1460
|
return normalized.join(", ");
|
|
1450
1461
|
})();
|
|
1451
1462
|
if (variant === "button") {
|
|
1452
|
-
return /* @__PURE__ */ (0,
|
|
1453
|
-
/* @__PURE__ */ (0,
|
|
1463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1464
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: hasErrors ? "flex-1" : "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1454
1465
|
InternalButton,
|
|
1455
1466
|
{
|
|
1456
1467
|
size,
|
|
@@ -1458,14 +1469,14 @@ var FileInput = (0, import_react17.forwardRef)(
|
|
|
1458
1469
|
isDisabled,
|
|
1459
1470
|
width: "100%",
|
|
1460
1471
|
onClick: handleButtonClick,
|
|
1461
|
-
before: /* @__PURE__ */ (0,
|
|
1462
|
-
after: /* @__PURE__ */ (0,
|
|
1463
|
-
children: /* @__PURE__ */ (0,
|
|
1472
|
+
before: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "upload", size: "small" }),
|
|
1473
|
+
after: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, { children: selectedFile ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_clsx15.clsx)("typography-label12regular truncate", !isDisabled && "text-text01"), children: selectedFile.name }) : "" }),
|
|
1474
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "truncate", children: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E" })
|
|
1464
1475
|
}
|
|
1465
1476
|
) }),
|
|
1466
|
-
selectedFile && !isDisabled && /* @__PURE__ */ (0,
|
|
1467
|
-
hasErrors && hasErrorMessages && /* @__PURE__ */ (0,
|
|
1468
|
-
/* @__PURE__ */ (0,
|
|
1477
|
+
selectedFile && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(IconButton, { variant: "text", icon: "close", size: "small", onClick: handleClear }) }),
|
|
1478
|
+
hasErrors && hasErrorMessages && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { id: errorId, "data-testid": "error-messages", className: "typography-label12regular text-supportError", children: errorMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "break-all", children: message }, index)) }),
|
|
1479
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1469
1480
|
"input",
|
|
1470
1481
|
{
|
|
1471
1482
|
id: inputId,
|
|
@@ -1480,8 +1491,8 @@ var FileInput = (0, import_react17.forwardRef)(
|
|
|
1480
1491
|
)
|
|
1481
1492
|
] });
|
|
1482
1493
|
}
|
|
1483
|
-
return /* @__PURE__ */ (0,
|
|
1484
|
-
/* @__PURE__ */ (0,
|
|
1494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex min-w-[320px] flex-col gap-2", children: [
|
|
1495
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1485
1496
|
"div",
|
|
1486
1497
|
{
|
|
1487
1498
|
className: dropzoneClasses,
|
|
@@ -1501,25 +1512,25 @@ var FileInput = (0, import_react17.forwardRef)(
|
|
|
1501
1512
|
"aria-disabled": isDisabled,
|
|
1502
1513
|
...hasErrors && hasErrorMessages && { "aria-describedby": errorId },
|
|
1503
1514
|
children: [
|
|
1504
|
-
/* @__PURE__ */ (0,
|
|
1505
|
-
!selectedFile && /* @__PURE__ */ (0,
|
|
1515
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "upload-document", size: "large", color: isDisabled ? "icon03" : "icon01" }),
|
|
1516
|
+
!selectedFile && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "typography-body13regular select-none", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
1506
1517
|
"\u3053\u3053\u306B\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
1507
|
-
/* @__PURE__ */ (0,
|
|
1518
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("br", {}),
|
|
1508
1519
|
"\u307E\u305F\u306F\u3001",
|
|
1509
|
-
/* @__PURE__ */ (0,
|
|
1520
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_clsx15.clsx)(!isDisabled ? "text-link01" : ""), children: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E" }),
|
|
1510
1521
|
"\u3057\u3066\u304F\u3060\u3055\u3044\u3002"
|
|
1511
1522
|
] }) }) }),
|
|
1512
|
-
!selectedFile && /* @__PURE__ */ (0,
|
|
1513
|
-
/* @__PURE__ */ (0,
|
|
1514
|
-
/* @__PURE__ */ (0,
|
|
1515
|
-
/* @__PURE__ */ (0,
|
|
1516
|
-
/* @__PURE__ */ (0,
|
|
1523
|
+
!selectedFile && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
1524
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: (0, import_clsx15.clsx)("typography-label11regular", isDisabled ? "text-textPlaceholder" : "text-text02"), children: "\u5BFE\u5FDC\u5F62\u5F0F" }),
|
|
1525
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: (0, import_clsx15.clsx)("typography-body12regular", isDisabled ? "text-textPlaceholder" : "text-text01"), children: acceptLabel }),
|
|
1526
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: (0, import_clsx15.clsx)("typography-label11regular", isDisabled ? "text-textPlaceholder" : "text-text02"), children: "\u30B5\u30A4\u30BA" }),
|
|
1527
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: (0, import_clsx15.clsx)("typography-body12regular", isDisabled ? "text-textPlaceholder" : "text-text01"), children: maxSizeLabel })
|
|
1517
1528
|
] }),
|
|
1518
|
-
selectedFile && /* @__PURE__ */ (0,
|
|
1519
|
-
/* @__PURE__ */ (0,
|
|
1520
|
-
/* @__PURE__ */ (0,
|
|
1521
|
-
/* @__PURE__ */ (0,
|
|
1522
|
-
!isDisabled && /* @__PURE__ */ (0,
|
|
1529
|
+
selectedFile && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "mt-2 flex flex-col items-center gap-1", children: [
|
|
1530
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "typography-label11regular text-text02", children: "\u30D5\u30A1\u30A4\u30EB\u540D" }),
|
|
1531
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1532
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "typography-label14regular", children: selectedFile.name }),
|
|
1533
|
+
!isDisabled && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1523
1534
|
IconButton,
|
|
1524
1535
|
{
|
|
1525
1536
|
variant: "text",
|
|
@@ -1533,7 +1544,7 @@ var FileInput = (0, import_react17.forwardRef)(
|
|
|
1533
1544
|
)
|
|
1534
1545
|
] })
|
|
1535
1546
|
] }),
|
|
1536
|
-
/* @__PURE__ */ (0,
|
|
1547
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1537
1548
|
"input",
|
|
1538
1549
|
{
|
|
1539
1550
|
id: inputId,
|
|
@@ -1549,13 +1560,13 @@ var FileInput = (0, import_react17.forwardRef)(
|
|
|
1549
1560
|
]
|
|
1550
1561
|
}
|
|
1551
1562
|
),
|
|
1552
|
-
hasErrors && hasErrorMessages && /* @__PURE__ */ (0,
|
|
1563
|
+
hasErrors && hasErrorMessages && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1553
1564
|
"div",
|
|
1554
1565
|
{
|
|
1555
1566
|
id: errorId,
|
|
1556
1567
|
"data-testid": "error-messages",
|
|
1557
1568
|
className: "typography-body13regular flex flex-col text-supportDanger",
|
|
1558
|
-
children: errorMessages.map((message, index) => /* @__PURE__ */ (0,
|
|
1569
|
+
children: errorMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: message }, index))
|
|
1559
1570
|
}
|
|
1560
1571
|
)
|
|
1561
1572
|
] });
|
|
@@ -1566,14 +1577,14 @@ FileInput.displayName = "FileInput";
|
|
|
1566
1577
|
// src/heading/heading.tsx
|
|
1567
1578
|
var import_component_theme10 = require("@zenkigen-inc/component-theme");
|
|
1568
1579
|
var import_clsx16 = require("clsx");
|
|
1569
|
-
var
|
|
1580
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1570
1581
|
function Heading(props) {
|
|
1571
1582
|
const TagName = `h${props.level}`;
|
|
1572
1583
|
const classes = (0, import_clsx16.clsx)(`flex items-center text-text01`, import_component_theme10.typography.heading[TagName], {
|
|
1573
1584
|
"gap-2": props.level === 1,
|
|
1574
1585
|
"gap-1": props.level > 1
|
|
1575
1586
|
});
|
|
1576
|
-
return /* @__PURE__ */ (0,
|
|
1587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(TagName, { className: classes, children: [
|
|
1577
1588
|
props.before,
|
|
1578
1589
|
props.children,
|
|
1579
1590
|
props.after
|
|
@@ -1652,7 +1663,7 @@ var useRovingFocus = ({
|
|
|
1652
1663
|
|
|
1653
1664
|
// src/loading/loading.tsx
|
|
1654
1665
|
var import_clsx17 = __toESM(require("clsx"));
|
|
1655
|
-
var
|
|
1666
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1656
1667
|
function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
1657
1668
|
const wrapperClasses = (0, import_clsx17.default)(position, "left-0 top-0 z-20 flex w-full items-center justify-center");
|
|
1658
1669
|
const svgClasses = (0, import_clsx17.default)({
|
|
@@ -1660,8 +1671,8 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
1660
1671
|
"h-8 w-8": size === "medium",
|
|
1661
1672
|
"h-16 w-16": size === "large"
|
|
1662
1673
|
});
|
|
1663
|
-
return /* @__PURE__ */ (0,
|
|
1664
|
-
size === "small" && /* @__PURE__ */ (0,
|
|
1674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: wrapperClasses, style: { height }, children: [
|
|
1675
|
+
size === "small" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { className: svgClasses, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1665
1676
|
"circle",
|
|
1666
1677
|
{
|
|
1667
1678
|
className: "origin-center animate-circular-small-move stroke-interactive01",
|
|
@@ -1673,7 +1684,7 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
1673
1684
|
fill: "none"
|
|
1674
1685
|
}
|
|
1675
1686
|
) }),
|
|
1676
|
-
size === "medium" && /* @__PURE__ */ (0,
|
|
1687
|
+
size === "medium" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { className: svgClasses, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1677
1688
|
"circle",
|
|
1678
1689
|
{
|
|
1679
1690
|
className: "origin-center animate-circular-medium-move stroke-interactive01",
|
|
@@ -1685,7 +1696,7 @@ function Loading({ size = "medium", position = "fixed", height = "100%" }) {
|
|
|
1685
1696
|
fill: "none"
|
|
1686
1697
|
}
|
|
1687
1698
|
) }),
|
|
1688
|
-
size === "large" && /* @__PURE__ */ (0,
|
|
1699
|
+
size === "large" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { className: svgClasses, viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1689
1700
|
"circle",
|
|
1690
1701
|
{
|
|
1691
1702
|
className: "origin-center animate-circular-large-move stroke-interactive01",
|
|
@@ -1752,9 +1763,9 @@ function restoreProperty(element, property, value) {
|
|
|
1752
1763
|
}
|
|
1753
1764
|
|
|
1754
1765
|
// src/modal/modal-body.tsx
|
|
1755
|
-
var
|
|
1766
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1756
1767
|
function ModalBody({ children }) {
|
|
1757
|
-
return /* @__PURE__ */ (0,
|
|
1768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "overflow-y-auto", children });
|
|
1758
1769
|
}
|
|
1759
1770
|
|
|
1760
1771
|
// src/modal/modal-context.ts
|
|
@@ -1765,18 +1776,18 @@ var ModalContext = (0, import_react20.createContext)({
|
|
|
1765
1776
|
|
|
1766
1777
|
// src/modal/modal-footer.tsx
|
|
1767
1778
|
var import_clsx18 = __toESM(require("clsx"));
|
|
1768
|
-
var
|
|
1779
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1769
1780
|
function ModalFooter({ children, isNoBorder = false }) {
|
|
1770
1781
|
const wrapperClasses = (0, import_clsx18.default)("flex w-full shrink-0 items-center rounded-b-lg px-6 py-4", {
|
|
1771
1782
|
"border-t-[1px] border-uiBorder01": !isNoBorder
|
|
1772
1783
|
});
|
|
1773
|
-
return /* @__PURE__ */ (0,
|
|
1784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: wrapperClasses, children });
|
|
1774
1785
|
}
|
|
1775
1786
|
|
|
1776
1787
|
// src/modal/modal-header.tsx
|
|
1777
1788
|
var import_clsx19 = __toESM(require("clsx"));
|
|
1778
1789
|
var import_react21 = require("react");
|
|
1779
|
-
var
|
|
1790
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1780
1791
|
function ModalHeader({ children, isNoBorder = false }) {
|
|
1781
1792
|
const { onClose } = (0, import_react21.useContext)(ModalContext);
|
|
1782
1793
|
const headerClasses = (0, import_clsx19.default)(
|
|
@@ -1787,14 +1798,14 @@ function ModalHeader({ children, isNoBorder = false }) {
|
|
|
1787
1798
|
"h-12": onClose
|
|
1788
1799
|
}
|
|
1789
1800
|
);
|
|
1790
|
-
return /* @__PURE__ */ (0,
|
|
1791
|
-
/* @__PURE__ */ (0,
|
|
1792
|
-
onClose && /* @__PURE__ */ (0,
|
|
1801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: headerClasses, children: [
|
|
1802
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children }),
|
|
1803
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { icon: "close", size: "small", variant: "text", onClick: onClose })
|
|
1793
1804
|
] });
|
|
1794
1805
|
}
|
|
1795
1806
|
|
|
1796
1807
|
// src/modal/modal.tsx
|
|
1797
|
-
var
|
|
1808
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1798
1809
|
var LIMIT_WIDTH = 320;
|
|
1799
1810
|
var LIMIT_HEIGHT = 184;
|
|
1800
1811
|
function Modal({
|
|
@@ -1812,10 +1823,10 @@ function Modal({
|
|
|
1812
1823
|
(0, import_react22.useEffect)(() => {
|
|
1813
1824
|
setIsMounted(true);
|
|
1814
1825
|
}, []);
|
|
1815
|
-
return isMounted && isOpen ? /* @__PURE__ */ (0,
|
|
1816
|
-
/* @__PURE__ */ (0,
|
|
1826
|
+
return isMounted && isOpen ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
1827
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(BodyScrollLock, {}),
|
|
1817
1828
|
(0, import_react_dom2.createPortal)(
|
|
1818
|
-
/* @__PURE__ */ (0,
|
|
1829
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ModalContext.Provider, { value: { onClose }, children: /* @__PURE__ */ (0, import_jsx_runtime28.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_runtime28.jsx)(
|
|
1819
1830
|
"div",
|
|
1820
1831
|
{
|
|
1821
1832
|
role: "dialog",
|
|
@@ -1835,7 +1846,7 @@ Modal.Footer = ModalFooter;
|
|
|
1835
1846
|
|
|
1836
1847
|
// src/notification-inline/notification-inline.tsx
|
|
1837
1848
|
var import_clsx20 = require("clsx");
|
|
1838
|
-
var
|
|
1849
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1839
1850
|
function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
1840
1851
|
const wrapperClasses = (0, import_clsx20.clsx)("typography-body13regular flex items-center gap-1 rounded text-text01", {
|
|
1841
1852
|
"bg-uiBackgroundError": state === "attention",
|
|
@@ -1862,10 +1873,10 @@ function NotificationInline({ state = "default", size = "medium", ...props }) {
|
|
|
1862
1873
|
small: "small",
|
|
1863
1874
|
medium: "medium"
|
|
1864
1875
|
};
|
|
1865
|
-
return /* @__PURE__ */ (0,
|
|
1866
|
-
state !== "default" && /* @__PURE__ */ (0,
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
1868
|
-
props.showClose === true && /* @__PURE__ */ (0,
|
|
1876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: wrapperClasses, children: [
|
|
1877
|
+
state !== "default" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: iconName[state], size: iconSize[size] }) }),
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "flex-1", children: props.children }),
|
|
1879
|
+
props.showClose === true && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(IconButton, { icon: "close", size: "small", variant: "text", onClick: props.onClickClose }) })
|
|
1869
1880
|
] });
|
|
1870
1881
|
}
|
|
1871
1882
|
|
|
@@ -1880,7 +1891,7 @@ var PaginationContext = (0, import_react23.createContext)({
|
|
|
1880
1891
|
});
|
|
1881
1892
|
|
|
1882
1893
|
// src/pagination/pagination-button.tsx
|
|
1883
|
-
var
|
|
1894
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1884
1895
|
function PaginationButton({ page, onClick }) {
|
|
1885
1896
|
const { currentPage } = (0, import_react24.useContext)(PaginationContext);
|
|
1886
1897
|
const buttonClasses = (0, import_clsx21.clsx)(
|
|
@@ -1891,11 +1902,11 @@ function PaginationButton({ page, onClick }) {
|
|
|
1891
1902
|
{ "border border-uiBorder02": page === currentPage },
|
|
1892
1903
|
{ "border-transparent": page !== currentPage }
|
|
1893
1904
|
);
|
|
1894
|
-
return /* @__PURE__ */ (0,
|
|
1905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", className: buttonClasses, onClick: () => onClick(page), children: page });
|
|
1895
1906
|
}
|
|
1896
1907
|
|
|
1897
1908
|
// src/pagination/pagination.tsx
|
|
1898
|
-
var
|
|
1909
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1899
1910
|
var START_PAGE = 1;
|
|
1900
1911
|
function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick }) {
|
|
1901
1912
|
if (totalPage < START_PAGE) {
|
|
@@ -1931,14 +1942,14 @@ function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick })
|
|
|
1931
1942
|
const hasHeadEllipsis = firstPageInList !== null && firstPageInList > START_PAGE + 1;
|
|
1932
1943
|
const hasTailEllipsis = lastPageInList !== null && lastPageInList < totalPage - 1;
|
|
1933
1944
|
const hasLastPageButton = totalPage > START_PAGE;
|
|
1934
|
-
return /* @__PURE__ */ (0,
|
|
1945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1935
1946
|
PaginationContext.Provider,
|
|
1936
1947
|
{
|
|
1937
1948
|
value: {
|
|
1938
1949
|
currentPage: clampedCurrentPage
|
|
1939
1950
|
},
|
|
1940
|
-
children: /* @__PURE__ */ (0,
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
1951
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("ul", { className: "flex gap-1", children: [
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1942
1953
|
IconButton,
|
|
1943
1954
|
{
|
|
1944
1955
|
isDisabled: isFirstPage,
|
|
@@ -1948,12 +1959,12 @@ function Pagination({ currentPage, totalPage, sideNumPagesToShow = 3, onClick })
|
|
|
1948
1959
|
onClick: () => onClick(Math.max(START_PAGE, clampedCurrentPage - 1))
|
|
1949
1960
|
}
|
|
1950
1961
|
) }),
|
|
1951
|
-
/* @__PURE__ */ (0,
|
|
1952
|
-
hasHeadEllipsis && /* @__PURE__ */ (0,
|
|
1953
|
-
pageList.map((page, index) => /* @__PURE__ */ (0,
|
|
1954
|
-
hasTailEllipsis && /* @__PURE__ */ (0,
|
|
1955
|
-
hasLastPageButton && /* @__PURE__ */ (0,
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
1962
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PaginationButton, { onClick: () => onClick(START_PAGE), page: START_PAGE }) }),
|
|
1963
|
+
hasHeadEllipsis && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { className: threeDotIconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { name: "more", size: "small" }) }),
|
|
1964
|
+
pageList.map((page, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PaginationButton, { onClick: () => onClick(page), page }) }, index)),
|
|
1965
|
+
hasTailEllipsis && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { className: threeDotIconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { name: "more", size: "small" }) }),
|
|
1966
|
+
hasLastPageButton && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PaginationButton, { onClick: () => onClick(totalPage), page: totalPage }) }),
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1957
1968
|
IconButton,
|
|
1958
1969
|
{
|
|
1959
1970
|
isDisabled: isLastPage,
|
|
@@ -1987,7 +1998,7 @@ var SelectContext = (0, import_react25.createContext)({
|
|
|
1987
1998
|
var import_component_theme11 = require("@zenkigen-inc/component-theme");
|
|
1988
1999
|
var import_clsx22 = __toESM(require("clsx"));
|
|
1989
2000
|
var import_react26 = require("react");
|
|
1990
|
-
var
|
|
2001
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1991
2002
|
function SelectItem({ option }) {
|
|
1992
2003
|
const { setIsOptionListOpen, selectedOption, onChange, isError } = (0, import_react26.useContext)(SelectContext);
|
|
1993
2004
|
const handleClickItem = (option2) => {
|
|
@@ -2004,10 +2015,10 @@ function SelectItem({ option }) {
|
|
|
2004
2015
|
"pr-10": option.id !== selectedOption?.id
|
|
2005
2016
|
}
|
|
2006
2017
|
);
|
|
2007
|
-
return /* @__PURE__ */ (0,
|
|
2008
|
-
option.icon && /* @__PURE__ */ (0,
|
|
2009
|
-
/* @__PURE__ */ (0,
|
|
2010
|
-
option.id === selectedOption?.id && /* @__PURE__ */ (0,
|
|
2018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("li", { className: "flex w-full items-center", "data-id": option.id, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("button", { className: itemClasses, type: "button", onClick: () => handleClickItem(option), children: [
|
|
2019
|
+
option.icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { name: option.icon, size: "small" }),
|
|
2020
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "ml-1 flex-1 truncate text-left", children: option.label }),
|
|
2021
|
+
option.id === selectedOption?.id && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "ml-2 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { name: "check", size: "small" }) })
|
|
2011
2022
|
] }) }, option.id);
|
|
2012
2023
|
}
|
|
2013
2024
|
|
|
@@ -2015,7 +2026,7 @@ function SelectItem({ option }) {
|
|
|
2015
2026
|
var import_component_theme12 = require("@zenkigen-inc/component-theme");
|
|
2016
2027
|
var import_clsx23 = __toESM(require("clsx"));
|
|
2017
2028
|
var import_react27 = require("react");
|
|
2018
|
-
var
|
|
2029
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2019
2030
|
var SelectList = (0, import_react27.forwardRef)(({ children, maxHeight }, ref) => {
|
|
2020
2031
|
const { selectedOption, setIsOptionListOpen, variant, placeholder, onChange, floatingStyles, floatingRef } = (0, import_react27.useContext)(SelectContext);
|
|
2021
2032
|
const handleClickDeselect = () => {
|
|
@@ -2047,15 +2058,15 @@ var SelectList = (0, import_react27.forwardRef)(({ children, maxHeight }, ref) =
|
|
|
2047
2058
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
2048
2059
|
import_component_theme12.focusVisible.inset
|
|
2049
2060
|
);
|
|
2050
|
-
return /* @__PURE__ */ (0,
|
|
2061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("ul", { className: listClasses, style: { maxHeight, ...floatingStyles }, ref, children: [
|
|
2051
2062
|
children,
|
|
2052
|
-
placeholder != null && selectedOption !== null && /* @__PURE__ */ (0,
|
|
2063
|
+
placeholder != null && selectedOption !== null && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { className: deselectButtonClasses, type: "button", onClick: handleClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
|
|
2053
2064
|
] });
|
|
2054
2065
|
});
|
|
2055
2066
|
SelectList.displayName = "SelectList";
|
|
2056
2067
|
|
|
2057
2068
|
// src/select/select.tsx
|
|
2058
|
-
var
|
|
2069
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2059
2070
|
var FLOATING_OFFSET = 4;
|
|
2060
2071
|
function Select({
|
|
2061
2072
|
children,
|
|
@@ -2127,7 +2138,7 @@ function Select({
|
|
|
2127
2138
|
"typography-label14regular": size === "small" || size === "medium",
|
|
2128
2139
|
"typography-label16regular": size === "large"
|
|
2129
2140
|
});
|
|
2130
|
-
return /* @__PURE__ */ (0,
|
|
2141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2131
2142
|
SelectContext.Provider,
|
|
2132
2143
|
{
|
|
2133
2144
|
value: {
|
|
@@ -2141,8 +2152,8 @@ function Select({
|
|
|
2141
2152
|
floatingStyles,
|
|
2142
2153
|
floatingRef: refs.floating
|
|
2143
2154
|
},
|
|
2144
|
-
children: /* @__PURE__ */ (0,
|
|
2145
|
-
/* @__PURE__ */ (0,
|
|
2155
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: wrapperClasses, style: { width, maxWidth }, ref: targetRef, children: [
|
|
2156
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2146
2157
|
"button",
|
|
2147
2158
|
{
|
|
2148
2159
|
ref: refs.setReference,
|
|
@@ -2151,9 +2162,9 @@ function Select({
|
|
|
2151
2162
|
onClick: handleClickToggle,
|
|
2152
2163
|
disabled: isDisabled,
|
|
2153
2164
|
children: [
|
|
2154
|
-
selectedOption?.icon ? /* @__PURE__ */ (0,
|
|
2155
|
-
/* @__PURE__ */ (0,
|
|
2156
|
-
/* @__PURE__ */ (0,
|
|
2165
|
+
selectedOption?.icon ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mr-1 flex", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { name: selectedOption.icon, size: size === "large" ? "medium" : "small" }) }) : placeholder != null && placeholderIcon && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mr-1 flex", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { name: placeholderIcon, size: size === "large" ? "medium" : "small" }) }),
|
|
2166
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: labelClasses, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "truncate", children: selectedOption ? selectedOption.label : placeholder != null && placeholder }) }),
|
|
2167
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2157
2168
|
Icon,
|
|
2158
2169
|
{
|
|
2159
2170
|
name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
|
|
@@ -2163,7 +2174,7 @@ function Select({
|
|
|
2163
2174
|
]
|
|
2164
2175
|
}
|
|
2165
2176
|
),
|
|
2166
|
-
isOptionListOpen && !isDisabled && /* @__PURE__ */ (0,
|
|
2177
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react28.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "relative z-overlay", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectList, { ref: refs.setFloating, maxHeight: optionListMaxHeight, children }) }) })
|
|
2167
2178
|
] })
|
|
2168
2179
|
}
|
|
2169
2180
|
);
|
|
@@ -2171,7 +2182,7 @@ function Select({
|
|
|
2171
2182
|
Select.Option = SelectItem;
|
|
2172
2183
|
|
|
2173
2184
|
// src/pagination-select/pagination-select.tsx
|
|
2174
|
-
var
|
|
2185
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2175
2186
|
function PaginationSelect({
|
|
2176
2187
|
totalSize,
|
|
2177
2188
|
currentPage,
|
|
@@ -2194,20 +2205,20 @@ function PaginationSelect({
|
|
|
2194
2205
|
});
|
|
2195
2206
|
const minCount = totalSize ? (currentPage - 1) * sizePerPage + 1 : 0;
|
|
2196
2207
|
const maxCount = currentPage * sizePerPage > totalSize ? totalSize : currentPage * sizePerPage;
|
|
2197
|
-
return /* @__PURE__ */ (0,
|
|
2198
|
-
/* @__PURE__ */ (0,
|
|
2199
|
-
/* @__PURE__ */ (0,
|
|
2200
|
-
/* @__PURE__ */ (0,
|
|
2208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("nav", { "aria-label": "pagination", className: "flex items-center gap-x-1", children: [
|
|
2209
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-x-2", children: [
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "typography-label14regular flex gap-1 text-text01", children: [
|
|
2211
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: " ", children: [
|
|
2201
2212
|
minCount > 0 && `${minCount} - `,
|
|
2202
2213
|
maxCount
|
|
2203
2214
|
] }),
|
|
2204
|
-
/* @__PURE__ */ (0,
|
|
2215
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { children: [
|
|
2205
2216
|
"/ ",
|
|
2206
2217
|
totalSize
|
|
2207
2218
|
] }),
|
|
2208
|
-
/* @__PURE__ */ (0,
|
|
2219
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: countLabel })
|
|
2209
2220
|
] }),
|
|
2210
|
-
/* @__PURE__ */ (0,
|
|
2221
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2211
2222
|
Select,
|
|
2212
2223
|
{
|
|
2213
2224
|
size: "medium",
|
|
@@ -2216,17 +2227,17 @@ function PaginationSelect({
|
|
|
2216
2227
|
optionListMaxHeight,
|
|
2217
2228
|
onChange: (option) => option && onChange(Number(option.value)),
|
|
2218
2229
|
isDisabled: pageMax === 0,
|
|
2219
|
-
children: optionsList.map((option) => /* @__PURE__ */ (0,
|
|
2230
|
+
children: optionsList.map((option) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Select.Option, { option }, option.id))
|
|
2220
2231
|
}
|
|
2221
2232
|
),
|
|
2222
|
-
/* @__PURE__ */ (0,
|
|
2233
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "typography-label14regular text-text02", children: [
|
|
2223
2234
|
"/ ",
|
|
2224
2235
|
pageMax,
|
|
2225
2236
|
pageLabel
|
|
2226
2237
|
] })
|
|
2227
2238
|
] }),
|
|
2228
|
-
/* @__PURE__ */ (0,
|
|
2229
|
-
/* @__PURE__ */ (0,
|
|
2239
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center", children: [
|
|
2240
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2230
2241
|
IconButton,
|
|
2231
2242
|
{
|
|
2232
2243
|
variant: "text",
|
|
@@ -2236,7 +2247,7 @@ function PaginationSelect({
|
|
|
2236
2247
|
onClick: onClickPrevButton
|
|
2237
2248
|
}
|
|
2238
2249
|
),
|
|
2239
|
-
/* @__PURE__ */ (0,
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2240
2251
|
IconButton,
|
|
2241
2252
|
{
|
|
2242
2253
|
variant: "text",
|
|
@@ -2271,17 +2282,17 @@ var useTextInputCompoundContext = (componentName) => {
|
|
|
2271
2282
|
// src/text-input/text-input-error-message.tsx
|
|
2272
2283
|
var import_clsx25 = require("clsx");
|
|
2273
2284
|
var import_react31 = require("react");
|
|
2274
|
-
var
|
|
2285
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2275
2286
|
var TextInputErrorMessage = (0, import_react31.forwardRef)(
|
|
2276
2287
|
({ "aria-live": ariaLive = "assertive", ...props }, ref) => {
|
|
2277
2288
|
const { inputProps } = useTextInputCompoundContext("TextInput.ErrorMessage");
|
|
2278
|
-
const typographyClass = inputProps.size === "large" ? "typography-
|
|
2289
|
+
const typographyClass = inputProps.size === "large" ? "typography-label13regular" : "typography-label12regular";
|
|
2279
2290
|
const shouldRender = inputProps.isError === true;
|
|
2280
2291
|
if (!shouldRender) {
|
|
2281
2292
|
return null;
|
|
2282
2293
|
}
|
|
2283
2294
|
const errorMessageClassName = (0, import_clsx25.clsx)(typographyClass, "text-supportError");
|
|
2284
|
-
return /* @__PURE__ */ (0,
|
|
2295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
2285
2296
|
}
|
|
2286
2297
|
);
|
|
2287
2298
|
TextInputErrorMessage.displayName = "TextInput.ErrorMessage";
|
|
@@ -2289,17 +2300,17 @@ TextInputErrorMessage.displayName = "TextInput.ErrorMessage";
|
|
|
2289
2300
|
// src/text-input/text-input-helper-message.tsx
|
|
2290
2301
|
var import_clsx26 = require("clsx");
|
|
2291
2302
|
var import_react32 = require("react");
|
|
2292
|
-
var
|
|
2303
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2293
2304
|
var TextInputHelperMessage = (0, import_react32.forwardRef)((props, ref) => {
|
|
2294
2305
|
const { inputProps } = useTextInputCompoundContext("TextInput.HelperMessage");
|
|
2295
|
-
const typographyClass = inputProps.size === "large" ? "typography-
|
|
2306
|
+
const typographyClass = inputProps.size === "large" ? "typography-label13regular" : "typography-label12regular";
|
|
2296
2307
|
const helperMessageClassName = (0, import_clsx26.clsx)(typographyClass, "text-text02");
|
|
2297
|
-
return /* @__PURE__ */ (0,
|
|
2308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { ref, className: helperMessageClassName, ...props });
|
|
2298
2309
|
});
|
|
2299
2310
|
TextInputHelperMessage.displayName = "TextInput.HelperMessage";
|
|
2300
2311
|
|
|
2301
2312
|
// src/text-input/text-input.tsx
|
|
2302
|
-
var
|
|
2313
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2303
2314
|
function TextInputInner({
|
|
2304
2315
|
size = "medium",
|
|
2305
2316
|
isError = false,
|
|
@@ -2379,24 +2390,24 @@ function TextInputInner({
|
|
|
2379
2390
|
"pr-2": size === "medium" && hasTrailingElement,
|
|
2380
2391
|
"pr-3": size === "large" && hasTrailingElement
|
|
2381
2392
|
});
|
|
2382
|
-
const inputClasses = (0, import_clsx27.clsx)("flex-1 outline-
|
|
2393
|
+
const inputClasses = (0, import_clsx27.clsx)("flex-1 outline-none placeholder:text-textPlaceholder disabled:text-textPlaceholder", {
|
|
2383
2394
|
["typography-label14regular min-h-8 px-2"]: size === "medium",
|
|
2384
2395
|
["typography-label16regular min-h-10 px-3"]: size === "large",
|
|
2385
2396
|
"text-text01": !isError,
|
|
2386
2397
|
"text-supportError": isError,
|
|
2387
2398
|
"pr-0": hasTrailingElement
|
|
2388
2399
|
});
|
|
2389
|
-
const inputElement = /* @__PURE__ */ (0,
|
|
2390
|
-
/* @__PURE__ */ (0,
|
|
2400
|
+
const inputElement = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: inputWrapClasses, children: [
|
|
2401
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", { ref, size: 1, className: inputClasses, ...mergedInputProps }),
|
|
2391
2402
|
after,
|
|
2392
|
-
isShowClearButton && /* @__PURE__ */ (0,
|
|
2403
|
+
isShowClearButton && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(IconButton, { variant: "text", icon: "close", size: "small", onClick: onClickClearButton })
|
|
2393
2404
|
] });
|
|
2394
2405
|
const stackedChildren = enhancedChildren == null ? [] : import_react33.Children.toArray(enhancedChildren);
|
|
2395
2406
|
const hasMessageChildren = stackedChildren.length > 0;
|
|
2396
2407
|
if (!hasMessageChildren) {
|
|
2397
|
-
return /* @__PURE__ */ (0,
|
|
2408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TextInputCompoundContext.Provider, { value: contextValue, children: inputElement });
|
|
2398
2409
|
}
|
|
2399
|
-
return /* @__PURE__ */ (0,
|
|
2410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TextInputCompoundContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
2400
2411
|
inputElement,
|
|
2401
2412
|
stackedChildren
|
|
2402
2413
|
] }) });
|
|
@@ -2419,14 +2430,14 @@ var TextInput = attachStatics(TextInputPublic);
|
|
|
2419
2430
|
var InternalTextInput = attachStatics(InternalTextInputBase);
|
|
2420
2431
|
|
|
2421
2432
|
// src/password-input/password-input.tsx
|
|
2422
|
-
var
|
|
2433
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2423
2434
|
var PasswordInputBase = (0, import_react34.forwardRef)(function PasswordInput({ disabled = false, children, ...props }, ref) {
|
|
2424
2435
|
const [isPasswordVisible, setIsPasswordVisible] = (0, import_react34.useState)(false);
|
|
2425
2436
|
const { className: _className, ...textInputProps } = props;
|
|
2426
2437
|
const handlePasswordVisibilityToggle = () => {
|
|
2427
2438
|
setIsPasswordVisible((prev) => !prev);
|
|
2428
2439
|
};
|
|
2429
|
-
const passwordToggleButton = /* @__PURE__ */ (0,
|
|
2440
|
+
const passwordToggleButton = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2430
2441
|
IconButton,
|
|
2431
2442
|
{
|
|
2432
2443
|
variant: "text",
|
|
@@ -2437,7 +2448,7 @@ var PasswordInputBase = (0, import_react34.forwardRef)(function PasswordInput({
|
|
|
2437
2448
|
"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"
|
|
2438
2449
|
}
|
|
2439
2450
|
);
|
|
2440
|
-
return /* @__PURE__ */ (0,
|
|
2451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2441
2452
|
InternalTextInput,
|
|
2442
2453
|
{
|
|
2443
2454
|
ref,
|
|
@@ -2459,9 +2470,9 @@ var PasswordInput2 = Object.assign(PasswordInputBase, {
|
|
|
2459
2470
|
var import_react37 = require("react");
|
|
2460
2471
|
|
|
2461
2472
|
// src/popup/popup-body.tsx
|
|
2462
|
-
var
|
|
2473
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2463
2474
|
function PopupBody({ children }) {
|
|
2464
|
-
return /* @__PURE__ */ (0,
|
|
2475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "overflow-y-auto", children });
|
|
2465
2476
|
}
|
|
2466
2477
|
|
|
2467
2478
|
// src/popup/popup-context.ts
|
|
@@ -2472,27 +2483,27 @@ var PopupContext = (0, import_react35.createContext)({
|
|
|
2472
2483
|
});
|
|
2473
2484
|
|
|
2474
2485
|
// src/popup/popup-footer.tsx
|
|
2475
|
-
var
|
|
2486
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2476
2487
|
function PopupFooter({ children }) {
|
|
2477
|
-
return /* @__PURE__ */ (0,
|
|
2488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex w-full shrink-0 items-center rounded-b-lg px-6 py-3", children });
|
|
2478
2489
|
}
|
|
2479
2490
|
|
|
2480
2491
|
// src/popup/popup-header.tsx
|
|
2481
2492
|
var import_react36 = require("react");
|
|
2482
|
-
var
|
|
2493
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2483
2494
|
function PopupHeader({ children, before }) {
|
|
2484
2495
|
const { onClose } = (0, import_react36.useContext)(PopupContext);
|
|
2485
|
-
return /* @__PURE__ */ (0,
|
|
2486
|
-
/* @__PURE__ */ (0,
|
|
2496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.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: [
|
|
2497
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
2487
2498
|
before,
|
|
2488
2499
|
children
|
|
2489
2500
|
] }),
|
|
2490
|
-
onClose && /* @__PURE__ */ (0,
|
|
2501
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(IconButton, { icon: "close", size: "small", variant: "text", onClick: onClose })
|
|
2491
2502
|
] });
|
|
2492
2503
|
}
|
|
2493
2504
|
|
|
2494
2505
|
// src/popup/popup.tsx
|
|
2495
|
-
var
|
|
2506
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2496
2507
|
var LIMIT_WIDTH2 = 320;
|
|
2497
2508
|
var LIMIT_HEIGHT2 = 184;
|
|
2498
2509
|
function useOptionalPopoverContext() {
|
|
@@ -2507,7 +2518,7 @@ function Popup({ children, isOpen: controlledIsOpen, width = 480, height, onClos
|
|
|
2507
2518
|
if (!isOpen) {
|
|
2508
2519
|
return null;
|
|
2509
2520
|
}
|
|
2510
|
-
return /* @__PURE__ */ (0,
|
|
2521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(PopupContext.Provider, { value: { isOpen, onClose }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2511
2522
|
"div",
|
|
2512
2523
|
{
|
|
2513
2524
|
className: "grid max-h-full grid-rows-[max-content_1fr_max-content] flex-col rounded-lg bg-uiBackground01 shadow-floatingShadow",
|
|
@@ -2524,7 +2535,7 @@ Popup.Footer = PopupFooter;
|
|
|
2524
2535
|
var import_component_theme14 = require("@zenkigen-inc/component-theme");
|
|
2525
2536
|
var import_clsx28 = __toESM(require("clsx"));
|
|
2526
2537
|
var import_react38 = require("react");
|
|
2527
|
-
var
|
|
2538
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2528
2539
|
function Radio({ name, value, id, label, isChecked = false, isDisabled = false, onChange }) {
|
|
2529
2540
|
const [isMouseOver, setIsMouseOver] = (0, import_react38.useState)(false);
|
|
2530
2541
|
const handleMouseOverInput = (0, import_react38.useCallback)(() => {
|
|
@@ -2565,9 +2576,9 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
2565
2576
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
2566
2577
|
"cursor-pointer text-text01": !isDisabled
|
|
2567
2578
|
});
|
|
2568
|
-
return /* @__PURE__ */ (0,
|
|
2569
|
-
/* @__PURE__ */ (0,
|
|
2570
|
-
/* @__PURE__ */ (0,
|
|
2579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center", children: [
|
|
2580
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex size-6 items-center justify-center", children: [
|
|
2581
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2571
2582
|
"input",
|
|
2572
2583
|
{
|
|
2573
2584
|
type: "checkbox",
|
|
@@ -2582,32 +2593,32 @@ function Radio({ name, value, id, label, isChecked = false, isDisabled = false,
|
|
|
2582
2593
|
className: inputClasses
|
|
2583
2594
|
}
|
|
2584
2595
|
),
|
|
2585
|
-
/* @__PURE__ */ (0,
|
|
2586
|
-
/* @__PURE__ */ (0,
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2596
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: boxClasses, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "relative flex size-5 flex-[0_0_auto] items-center justify-center", children: [
|
|
2597
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: afterClasses }),
|
|
2598
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: hoverIndicatorClasses })
|
|
2588
2599
|
] }) })
|
|
2589
2600
|
] }),
|
|
2590
|
-
/* @__PURE__ */ (0,
|
|
2601
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("label", { htmlFor: id, className: labelClasses, children: label })
|
|
2591
2602
|
] });
|
|
2592
2603
|
}
|
|
2593
2604
|
|
|
2594
2605
|
// src/search/search.tsx
|
|
2595
2606
|
var import_clsx29 = require("clsx");
|
|
2596
2607
|
var import_react39 = require("react");
|
|
2597
|
-
var
|
|
2608
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2598
2609
|
var Search = (0, import_react39.forwardRef)(({ width = "100%", size = "medium", ...props }, ref) => {
|
|
2599
2610
|
const classes = (0, import_clsx29.clsx)(
|
|
2600
2611
|
"flex items-center rounded-full border border-uiBorder02 bg-uiBackground01 focus-within:border-activeInput",
|
|
2601
2612
|
{ "h-8 px-3": size === "medium" },
|
|
2602
2613
|
{ "h-10 px-4": size === "large" }
|
|
2603
2614
|
);
|
|
2604
|
-
const inputClasses = (0, import_clsx29.clsx)("mx-2 h-full flex-1 text-text01 outline-
|
|
2615
|
+
const inputClasses = (0, import_clsx29.clsx)("mx-2 h-full flex-1 text-text01 outline-none placeholder:text-textPlaceholder", {
|
|
2605
2616
|
["typography-label14regular"]: size === "medium",
|
|
2606
2617
|
["typography-label16regular"]: size === "large"
|
|
2607
2618
|
});
|
|
2608
|
-
return /* @__PURE__ */ (0,
|
|
2609
|
-
/* @__PURE__ */ (0,
|
|
2610
|
-
/* @__PURE__ */ (0,
|
|
2619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "relative", ref, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("form", { onSubmit: props.onSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: classes, style: { width }, children: [
|
|
2620
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Icon, { name: "search", color: "icon01", size: "medium" }),
|
|
2621
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2611
2622
|
"input",
|
|
2612
2623
|
{
|
|
2613
2624
|
type: "text",
|
|
@@ -2618,7 +2629,7 @@ var Search = (0, import_react39.forwardRef)(({ width = "100%", size = "medium",
|
|
|
2618
2629
|
onChange: props.onChange
|
|
2619
2630
|
}
|
|
2620
2631
|
),
|
|
2621
|
-
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */ (0,
|
|
2632
|
+
props.onClickClearButton && props.value && props.value.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2622
2633
|
IconButton,
|
|
2623
2634
|
{
|
|
2624
2635
|
variant: "text",
|
|
@@ -2643,7 +2654,7 @@ var SegmentedControlContext = (0, import_react40.createContext)(null);
|
|
|
2643
2654
|
var import_component_theme15 = require("@zenkigen-inc/component-theme");
|
|
2644
2655
|
var import_clsx30 = require("clsx");
|
|
2645
2656
|
var import_react41 = require("react");
|
|
2646
|
-
var
|
|
2657
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2647
2658
|
var SegmentedControlItem = ({
|
|
2648
2659
|
label,
|
|
2649
2660
|
value,
|
|
@@ -2702,7 +2713,7 @@ var SegmentedControlItem = ({
|
|
|
2702
2713
|
// States - Disabled
|
|
2703
2714
|
"text-disabled01 bg-transparent": isOptionDisabled === true
|
|
2704
2715
|
});
|
|
2705
|
-
return /* @__PURE__ */ (0,
|
|
2716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2706
2717
|
"button",
|
|
2707
2718
|
{
|
|
2708
2719
|
ref: buttonRef,
|
|
@@ -2719,7 +2730,7 @@ var SegmentedControlItem = ({
|
|
|
2719
2730
|
onMouseDown: handleMouseDown,
|
|
2720
2731
|
...rest,
|
|
2721
2732
|
children: [
|
|
2722
|
-
Boolean(icon) === true && icon && /* @__PURE__ */ (0,
|
|
2733
|
+
Boolean(icon) === true && icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2723
2734
|
"span",
|
|
2724
2735
|
{
|
|
2725
2736
|
className: (0, import_clsx30.clsx)("flex items-center", {
|
|
@@ -2727,17 +2738,17 @@ var SegmentedControlItem = ({
|
|
|
2727
2738
|
"fill-interactive01": isSelected === true && isOptionDisabled === false,
|
|
2728
2739
|
"fill-icon01": isSelected === false && isOptionDisabled === false
|
|
2729
2740
|
}),
|
|
2730
|
-
children: /* @__PURE__ */ (0,
|
|
2741
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Icon, { name: icon, size: "small" })
|
|
2731
2742
|
}
|
|
2732
2743
|
),
|
|
2733
|
-
Boolean(label) === true && /* @__PURE__ */ (0,
|
|
2744
|
+
Boolean(label) === true && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "whitespace-nowrap", children: label })
|
|
2734
2745
|
]
|
|
2735
2746
|
}
|
|
2736
2747
|
);
|
|
2737
2748
|
};
|
|
2738
2749
|
|
|
2739
2750
|
// src/segmented-control/segmented-control.tsx
|
|
2740
|
-
var
|
|
2751
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2741
2752
|
var SegmentedControl = ({
|
|
2742
2753
|
children,
|
|
2743
2754
|
value,
|
|
@@ -2782,7 +2793,7 @@ var SegmentedControl = ({
|
|
|
2782
2793
|
onBlur: handleBlurRovingFocus,
|
|
2783
2794
|
values: itemIds
|
|
2784
2795
|
};
|
|
2785
|
-
return /* @__PURE__ */ (0,
|
|
2796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SegmentedControlContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2786
2797
|
"div",
|
|
2787
2798
|
{
|
|
2788
2799
|
ref: containerRef,
|
|
@@ -2810,7 +2821,7 @@ var import_clsx32 = __toESM(require("clsx"));
|
|
|
2810
2821
|
// src/select-sort/select-item.tsx
|
|
2811
2822
|
var import_component_theme16 = require("@zenkigen-inc/component-theme");
|
|
2812
2823
|
var import_clsx31 = __toESM(require("clsx"));
|
|
2813
|
-
var
|
|
2824
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2814
2825
|
function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
2815
2826
|
const itemClasses = (0, import_clsx31.default)(
|
|
2816
2827
|
"typography-label14regular flex h-8 w-full items-center px-3 hover:bg-hover02 active:bg-active02",
|
|
@@ -2820,14 +2831,14 @@ function SelectItem2({ children, isSortKey, onClickItem }) {
|
|
|
2820
2831
|
"bg-uiBackground01 fill-icon01 text-interactive02": !isSortKey
|
|
2821
2832
|
}
|
|
2822
2833
|
);
|
|
2823
|
-
return /* @__PURE__ */ (0,
|
|
2824
|
-
/* @__PURE__ */ (0,
|
|
2825
|
-
isSortKey && /* @__PURE__ */ (0,
|
|
2834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { className: "flex w-full items-center", onClick: onClickItem, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("button", { className: itemClasses, type: "button", children: [
|
|
2835
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "ml-1 mr-6", children }),
|
|
2836
|
+
isSortKey && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Icon, { name: "check", size: "small" }) })
|
|
2826
2837
|
] }) });
|
|
2827
2838
|
}
|
|
2828
2839
|
|
|
2829
2840
|
// src/select-sort/select-list.tsx
|
|
2830
|
-
var
|
|
2841
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2831
2842
|
function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect }) {
|
|
2832
2843
|
const listClasses = (0, import_clsx32.default)(
|
|
2833
2844
|
"absolute z-dropdown w-max overflow-y-auto rounded bg-uiBackground01 py-2 shadow-floatingShadow",
|
|
@@ -2842,15 +2853,15 @@ function SelectList2({ size, variant, sortOrder, onClickItem, onClickDeselect })
|
|
|
2842
2853
|
"typography-label14regular flex h-8 w-full items-center px-3 text-interactive02 hover:bg-hover02 active:bg-active02",
|
|
2843
2854
|
import_component_theme17.focusVisible.inset
|
|
2844
2855
|
);
|
|
2845
|
-
return /* @__PURE__ */ (0,
|
|
2846
|
-
/* @__PURE__ */ (0,
|
|
2847
|
-
/* @__PURE__ */ (0,
|
|
2848
|
-
sortOrder !== null && onClickDeselect && /* @__PURE__ */ (0,
|
|
2856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("ul", { className: listClasses, children: [
|
|
2857
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectItem2, { isSortKey: sortOrder === "ascend", onClickItem: () => onClickItem("ascend"), children: "\u6607\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
2858
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectItem2, { isSortKey: sortOrder === "descend", onClickItem: () => onClickItem("descend"), children: "\u964D\u9806\u3067\u4E26\u3073\u66FF\u3048" }),
|
|
2859
|
+
sortOrder !== null && onClickDeselect && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { className: deselectButtonClasses, type: "button", onClick: onClickDeselect, children: "\u9078\u629E\u89E3\u9664" }) })
|
|
2849
2860
|
] });
|
|
2850
2861
|
}
|
|
2851
2862
|
|
|
2852
2863
|
// src/select-sort/select-sort.tsx
|
|
2853
|
-
var
|
|
2864
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2854
2865
|
function SelectSort({
|
|
2855
2866
|
size = "medium",
|
|
2856
2867
|
variant = "outline",
|
|
@@ -2900,16 +2911,16 @@ function SelectSort({
|
|
|
2900
2911
|
"mr-1": size === "x-small",
|
|
2901
2912
|
"mr-2": size !== "x-small"
|
|
2902
2913
|
});
|
|
2903
|
-
return /* @__PURE__ */ (0,
|
|
2904
|
-
/* @__PURE__ */ (0,
|
|
2905
|
-
/* @__PURE__ */ (0,
|
|
2906
|
-
/* @__PURE__ */ (0,
|
|
2914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: wrapperClasses, style: { width }, ref: targetRef, children: [
|
|
2915
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("button", { className: buttonClasses, type: "button", onClick: handleClickToggle, disabled: isDisabled, children: [
|
|
2916
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: labelClasses, children: label }),
|
|
2917
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "ml-auto flex items-center", children: isSortKey ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2907
2918
|
Icon,
|
|
2908
2919
|
{
|
|
2909
2920
|
name: sortOrder === "ascend" ? "arrow-up" : "arrow-down",
|
|
2910
2921
|
size: size === "large" ? "medium" : "small"
|
|
2911
2922
|
}
|
|
2912
|
-
) : /* @__PURE__ */ (0,
|
|
2923
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2913
2924
|
Icon,
|
|
2914
2925
|
{
|
|
2915
2926
|
name: isOptionListOpen ? "angle-small-up" : "angle-small-down",
|
|
@@ -2917,7 +2928,7 @@ function SelectSort({
|
|
|
2917
2928
|
}
|
|
2918
2929
|
) })
|
|
2919
2930
|
] }),
|
|
2920
|
-
isOptionListOpen && !isDisabled && /* @__PURE__ */ (0,
|
|
2931
|
+
isOptionListOpen && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2921
2932
|
SelectList2,
|
|
2922
2933
|
{
|
|
2923
2934
|
size,
|
|
@@ -2934,7 +2945,7 @@ function SelectSort({
|
|
|
2934
2945
|
var import_component_theme19 = require("@zenkigen-inc/component-theme");
|
|
2935
2946
|
var import_clsx34 = __toESM(require("clsx"));
|
|
2936
2947
|
var import_react44 = require("react");
|
|
2937
|
-
var
|
|
2948
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2938
2949
|
function SortButton({
|
|
2939
2950
|
size = "medium",
|
|
2940
2951
|
width,
|
|
@@ -2983,7 +2994,7 @@ function SortButton({
|
|
|
2983
2994
|
"mr-1": size === "x-small",
|
|
2984
2995
|
"mr-2": size !== "x-small"
|
|
2985
2996
|
});
|
|
2986
|
-
return /* @__PURE__ */ (0,
|
|
2997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: wrapperClasses, style: { width }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
2987
2998
|
"button",
|
|
2988
2999
|
{
|
|
2989
3000
|
className: buttonClasses,
|
|
@@ -2994,8 +3005,8 @@ function SortButton({
|
|
|
2994
3005
|
"aria-label": ariaLabel,
|
|
2995
3006
|
"aria-disabled": isDisabled,
|
|
2996
3007
|
children: [
|
|
2997
|
-
/* @__PURE__ */ (0,
|
|
2998
|
-
/* @__PURE__ */ (0,
|
|
3008
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: labelClasses, children: label }),
|
|
3009
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Icon, { name: getIconName(), size: size === "large" ? "medium" : "small" }) })
|
|
2999
3010
|
]
|
|
3000
3011
|
}
|
|
3001
3012
|
) });
|
|
@@ -3007,7 +3018,7 @@ var import_react45 = require("react");
|
|
|
3007
3018
|
|
|
3008
3019
|
// src/tab/tab-item.tsx
|
|
3009
3020
|
var import_clsx35 = require("clsx");
|
|
3010
|
-
var
|
|
3021
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3011
3022
|
var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
3012
3023
|
const classes = (0, import_clsx35.clsx)(
|
|
3013
3024
|
"group relative z-0 flex items-center justify-center gap-1 py-2 leading-[24px] before:absolute before:inset-x-0 before:bottom-0 before:h-[2px] hover:text-interactive01 disabled:pointer-events-none disabled:text-disabled01",
|
|
@@ -3022,7 +3033,7 @@ var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
|
3022
3033
|
"fill-interactive01": !isDisabled && isSelected,
|
|
3023
3034
|
"fill-icon01 group-hover:fill-interactive01": !isDisabled && !isSelected
|
|
3024
3035
|
});
|
|
3025
|
-
return /* @__PURE__ */ (0,
|
|
3036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3026
3037
|
"button",
|
|
3027
3038
|
{
|
|
3028
3039
|
type: "button",
|
|
@@ -3032,7 +3043,7 @@ var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
|
3032
3043
|
disabled: isDisabled,
|
|
3033
3044
|
onClick: () => props.onClick(props.id),
|
|
3034
3045
|
children: [
|
|
3035
|
-
icon != null && /* @__PURE__ */ (0,
|
|
3046
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: iconWrapperClasses, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { name: icon, size: "small" }) }),
|
|
3036
3047
|
props.children
|
|
3037
3048
|
]
|
|
3038
3049
|
}
|
|
@@ -3040,7 +3051,7 @@ var TabItem = ({ isSelected = false, isDisabled = false, icon, ...props }) => {
|
|
|
3040
3051
|
};
|
|
3041
3052
|
|
|
3042
3053
|
// src/tab/tab.tsx
|
|
3043
|
-
var
|
|
3054
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3044
3055
|
function Tab({ children, layout = "auto" }) {
|
|
3045
3056
|
const childrenCount = import_react45.Children.count(children);
|
|
3046
3057
|
const containerStyle = layout === "equal" ? { gridTemplateColumns: `repeat(${childrenCount}, minmax(0,1fr))` } : {};
|
|
@@ -3051,28 +3062,28 @@ function Tab({ children, layout = "auto" }) {
|
|
|
3051
3062
|
grid: layout === "equal"
|
|
3052
3063
|
}
|
|
3053
3064
|
);
|
|
3054
|
-
return /* @__PURE__ */ (0,
|
|
3065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { role: "tablist", className: containerClasses, style: containerStyle, children });
|
|
3055
3066
|
}
|
|
3056
3067
|
Tab.Item = TabItem;
|
|
3057
3068
|
|
|
3058
3069
|
// src/table/table-cell.tsx
|
|
3059
3070
|
var import_clsx37 = __toESM(require("clsx"));
|
|
3060
|
-
var
|
|
3071
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3061
3072
|
function TableCell({ children, className, isHeader = false }) {
|
|
3062
3073
|
const classes = (0, import_clsx37.default)("border-b border-uiBorder01", { "sticky top-0 z-10 bg-white": isHeader }, className);
|
|
3063
|
-
return /* @__PURE__ */ (0,
|
|
3074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: classes, children });
|
|
3064
3075
|
}
|
|
3065
3076
|
|
|
3066
3077
|
// src/table/table-row.tsx
|
|
3067
3078
|
var import_clsx38 = __toESM(require("clsx"));
|
|
3068
|
-
var
|
|
3079
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3069
3080
|
function TableRow({ children, isHoverBackgroundVisible = false }) {
|
|
3070
3081
|
const rowClasses = (0, import_clsx38.default)("contents", isHoverBackgroundVisible && "[&:hover>div]:bg-hoverUi02");
|
|
3071
|
-
return /* @__PURE__ */ (0,
|
|
3082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: rowClasses, children });
|
|
3072
3083
|
}
|
|
3073
3084
|
|
|
3074
3085
|
// src/table/table.tsx
|
|
3075
|
-
var
|
|
3086
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3076
3087
|
function Table({
|
|
3077
3088
|
width,
|
|
3078
3089
|
templateRows,
|
|
@@ -3081,7 +3092,7 @@ function Table({
|
|
|
3081
3092
|
autoRows,
|
|
3082
3093
|
children
|
|
3083
3094
|
}) {
|
|
3084
|
-
return /* @__PURE__ */ (0,
|
|
3095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3085
3096
|
"div",
|
|
3086
3097
|
{
|
|
3087
3098
|
className: "grid",
|
|
@@ -3106,7 +3117,7 @@ var import_clsx40 = __toESM(require("clsx"));
|
|
|
3106
3117
|
// src/tag/delete-icon.tsx
|
|
3107
3118
|
var import_component_theme20 = require("@zenkigen-inc/component-theme");
|
|
3108
3119
|
var import_clsx39 = __toESM(require("clsx"));
|
|
3109
|
-
var
|
|
3120
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3110
3121
|
var DeleteIcon = ({ color, variant, onClick }) => {
|
|
3111
3122
|
const deleteButtonClasses = (0, import_clsx39.default)(
|
|
3112
3123
|
"group ml-2 size-[14px] rounded-full p-0.5 hover:cursor-pointer hover:bg-iconOnColor focus-visible:bg-iconOnColor",
|
|
@@ -3116,7 +3127,7 @@ var DeleteIcon = ({ color, variant, onClick }) => {
|
|
|
3116
3127
|
"fill-interactive02": color === "gray" || variant === "light",
|
|
3117
3128
|
"group-hover:fill-interactive02 group-focus-visible:fill-interactive02 fill-iconOnColor": color !== "gray"
|
|
3118
3129
|
});
|
|
3119
|
-
return /* @__PURE__ */ (0,
|
|
3130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("button", { type: "button", className: deleteButtonClasses, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3120
3131
|
"path",
|
|
3121
3132
|
{
|
|
3122
3133
|
fillRule: "evenodd",
|
|
@@ -3128,7 +3139,7 @@ var DeleteIcon = ({ color, variant, onClick }) => {
|
|
|
3128
3139
|
};
|
|
3129
3140
|
|
|
3130
3141
|
// src/tag/tag.tsx
|
|
3131
|
-
var
|
|
3142
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3132
3143
|
function Tag({ id, children, color, variant = "normal", size = "medium", isEditable, onDelete }) {
|
|
3133
3144
|
const wrapperClasses = (0, import_clsx40.default)("flex", "items-center", "justify-center", {
|
|
3134
3145
|
[import_component_theme21.tagColors[color]]: variant === "normal",
|
|
@@ -3142,9 +3153,9 @@ function Tag({ id, children, color, variant = "normal", size = "medium", isEdita
|
|
|
3142
3153
|
"py-0.5 px-1": !isEditable,
|
|
3143
3154
|
"py-1 px-2": isEditable
|
|
3144
3155
|
});
|
|
3145
|
-
return /* @__PURE__ */ (0,
|
|
3156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: wrapperClasses, children: [
|
|
3146
3157
|
children,
|
|
3147
|
-
isEditable ? /* @__PURE__ */ (0,
|
|
3158
|
+
isEditable ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DeleteIcon, { onClick: () => onDelete(id), color, variant }) : null
|
|
3148
3159
|
] });
|
|
3149
3160
|
}
|
|
3150
3161
|
|
|
@@ -3166,17 +3177,17 @@ var useTextAreaCompoundContext = (componentName) => {
|
|
|
3166
3177
|
// src/text-area/text-area-error-message.tsx
|
|
3167
3178
|
var import_clsx41 = require("clsx");
|
|
3168
3179
|
var import_react47 = require("react");
|
|
3169
|
-
var
|
|
3180
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3170
3181
|
var TextAreaErrorMessage = (0, import_react47.forwardRef)(
|
|
3171
3182
|
({ "aria-live": ariaLive = "assertive", ...props }, ref) => {
|
|
3172
3183
|
const { textAreaProps } = useTextAreaCompoundContext("TextArea.ErrorMessage");
|
|
3173
|
-
const typographyClass = textAreaProps.size === "large" ? "typography-
|
|
3184
|
+
const typographyClass = textAreaProps.size === "large" ? "typography-label13regular" : "typography-label12regular";
|
|
3174
3185
|
const shouldRender = textAreaProps.isError === true;
|
|
3175
3186
|
if (!shouldRender) {
|
|
3176
3187
|
return null;
|
|
3177
3188
|
}
|
|
3178
3189
|
const errorMessageClassName = (0, import_clsx41.clsx)(typographyClass, "text-supportError");
|
|
3179
|
-
return /* @__PURE__ */ (0,
|
|
3190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { ref, className: errorMessageClassName, "aria-live": ariaLive, ...props });
|
|
3180
3191
|
}
|
|
3181
3192
|
);
|
|
3182
3193
|
TextAreaErrorMessage.displayName = "TextArea.ErrorMessage";
|
|
@@ -3184,17 +3195,17 @@ TextAreaErrorMessage.displayName = "TextArea.ErrorMessage";
|
|
|
3184
3195
|
// src/text-area/text-area-helper-message.tsx
|
|
3185
3196
|
var import_clsx42 = require("clsx");
|
|
3186
3197
|
var import_react48 = require("react");
|
|
3187
|
-
var
|
|
3198
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3188
3199
|
var TextAreaHelperMessage = (0, import_react48.forwardRef)((props, ref) => {
|
|
3189
3200
|
const { textAreaProps } = useTextAreaCompoundContext("TextArea.HelperMessage");
|
|
3190
|
-
const typographyClass = textAreaProps.size === "large" ? "typography-
|
|
3201
|
+
const typographyClass = textAreaProps.size === "large" ? "typography-label13regular" : "typography-label12regular";
|
|
3191
3202
|
const helperMessageClassName = (0, import_clsx42.clsx)(typographyClass, "text-text02");
|
|
3192
|
-
return /* @__PURE__ */ (0,
|
|
3203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { ref, className: helperMessageClassName, ...props });
|
|
3193
3204
|
});
|
|
3194
3205
|
TextAreaHelperMessage.displayName = "TextArea.HelperMessage";
|
|
3195
3206
|
|
|
3196
3207
|
// src/text-area/text-area.tsx
|
|
3197
|
-
var
|
|
3208
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3198
3209
|
function TextAreaInner({
|
|
3199
3210
|
size = "medium",
|
|
3200
3211
|
isResizable = false,
|
|
@@ -3205,6 +3216,9 @@ function TextAreaInner({
|
|
|
3205
3216
|
height,
|
|
3206
3217
|
children,
|
|
3207
3218
|
className,
|
|
3219
|
+
isCounterVisible = false,
|
|
3220
|
+
counterMaxLength,
|
|
3221
|
+
maxLength,
|
|
3208
3222
|
...props
|
|
3209
3223
|
}, ref) {
|
|
3210
3224
|
const autoGeneratedId = (0, import_react49.useId)();
|
|
@@ -3243,8 +3257,12 @@ function TextAreaInner({
|
|
|
3243
3257
|
}
|
|
3244
3258
|
return child;
|
|
3245
3259
|
});
|
|
3260
|
+
const counterLimit = counterMaxLength ?? maxLength;
|
|
3261
|
+
const counterId = isCounterVisible ? `${describedByBaseId}-counter` : null;
|
|
3262
|
+
const currentLength = typeof props.value === "string" ? props.value.length : 0;
|
|
3263
|
+
const isExceeded = counterLimit != null && currentLength > counterLimit;
|
|
3246
3264
|
const describedByFromProps = typeof props["aria-describedby"] === "string" ? props["aria-describedby"] : null;
|
|
3247
|
-
const describedByList = [describedByFromProps, ...helperMessageIds, ...errorIds].filter(
|
|
3265
|
+
const describedByList = [describedByFromProps, ...helperMessageIds, ...errorIds, counterId].filter(
|
|
3248
3266
|
(id) => typeof id === "string" && id.trim().length > 0
|
|
3249
3267
|
);
|
|
3250
3268
|
const describedByProps = describedByList.length > 0 ? {
|
|
@@ -3254,10 +3272,12 @@ function TextAreaInner({
|
|
|
3254
3272
|
const ariaInvalidFromProps = props["aria-invalid"];
|
|
3255
3273
|
const ariaInvalidValue = ariaInvalidFromProps != null ? ariaInvalidFromProps : shouldMarkInvalid ? true : null;
|
|
3256
3274
|
const ariaInvalidProps = ariaInvalidValue == null ? {} : { "aria-invalid": ariaInvalidValue };
|
|
3275
|
+
const maxLengthProps = counterMaxLength != null ? {} : maxLength != null ? { maxLength } : {};
|
|
3257
3276
|
const mergedTextAreaProps = {
|
|
3258
3277
|
...props,
|
|
3259
3278
|
...describedByProps,
|
|
3260
|
-
...ariaInvalidProps
|
|
3279
|
+
...ariaInvalidProps,
|
|
3280
|
+
...maxLengthProps
|
|
3261
3281
|
};
|
|
3262
3282
|
const textAreaWrapperClassName = (0, import_clsx43.clsx)(
|
|
3263
3283
|
"box-border flex w-full overflow-hidden rounded border",
|
|
@@ -3272,10 +3292,10 @@ function TextAreaInner({
|
|
|
3272
3292
|
className
|
|
3273
3293
|
);
|
|
3274
3294
|
const textAreaClassName = (0, import_clsx43.clsx)(
|
|
3275
|
-
"w-full border-none bg-uiBackground01 outline-
|
|
3295
|
+
"w-full border-none bg-uiBackground01 outline-none placeholder:text-textPlaceholder disabled:text-textPlaceholder",
|
|
3276
3296
|
{
|
|
3277
3297
|
"typography-body14regular px-2 py-2": size === "medium",
|
|
3278
|
-
"
|
|
3298
|
+
"typography-body16regular px-3 py-2": size === "large",
|
|
3279
3299
|
"field-sizing-content": autoHeight,
|
|
3280
3300
|
"text-text01": !isError,
|
|
3281
3301
|
"text-supportError": isError,
|
|
@@ -3284,7 +3304,7 @@ function TextAreaInner({
|
|
|
3284
3304
|
}
|
|
3285
3305
|
);
|
|
3286
3306
|
const hasHeight = height != null && String(height).trim().length > 0;
|
|
3287
|
-
const textAreaElement = /* @__PURE__ */ (0,
|
|
3307
|
+
const textAreaElement = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3288
3308
|
"div",
|
|
3289
3309
|
{
|
|
3290
3310
|
className: textAreaWrapperClassName,
|
|
@@ -3294,7 +3314,7 @@ function TextAreaInner({
|
|
|
3294
3314
|
...!autoHeight && hasHeight ? { height } : {},
|
|
3295
3315
|
...autoHeight && hasHeight ? { minHeight: height } : {}
|
|
3296
3316
|
},
|
|
3297
|
-
children: /* @__PURE__ */ (0,
|
|
3317
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3298
3318
|
"textarea",
|
|
3299
3319
|
{
|
|
3300
3320
|
ref,
|
|
@@ -3309,14 +3329,32 @@ function TextAreaInner({
|
|
|
3309
3329
|
)
|
|
3310
3330
|
}
|
|
3311
3331
|
);
|
|
3332
|
+
const counterElement = isCounterVisible ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3333
|
+
"div",
|
|
3334
|
+
{
|
|
3335
|
+
id: counterId,
|
|
3336
|
+
className: (0, import_clsx43.clsx)(
|
|
3337
|
+
"shrink-0",
|
|
3338
|
+
size === "large" ? "typography-label13regular" : "typography-label12regular",
|
|
3339
|
+
!disabled && isExceeded ? "text-supportError" : "text-text02"
|
|
3340
|
+
),
|
|
3341
|
+
"aria-live": "polite",
|
|
3342
|
+
children: counterLimit != null ? `${currentLength}/${counterLimit}\u6587\u5B57` : `${currentLength}\u6587\u5B57`
|
|
3343
|
+
}
|
|
3344
|
+
) : null;
|
|
3312
3345
|
const stackedChildren = enhancedChildren == null ? [] : import_react49.Children.toArray(enhancedChildren);
|
|
3313
3346
|
const hasMessageChildren = stackedChildren.length > 0;
|
|
3314
|
-
|
|
3315
|
-
|
|
3347
|
+
const hasBottomContent = hasMessageChildren || counterElement != null;
|
|
3348
|
+
if (!hasBottomContent) {
|
|
3349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TextAreaCompoundContext.Provider, { value: contextValue, children: textAreaElement });
|
|
3316
3350
|
}
|
|
3317
|
-
return /* @__PURE__ */ (0,
|
|
3351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TextAreaCompoundContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
3318
3352
|
textAreaElement,
|
|
3319
|
-
|
|
3353
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
3354
|
+
hasMessageChildren && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: stackedChildren }),
|
|
3355
|
+
!hasMessageChildren && counterElement != null && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex-1" }),
|
|
3356
|
+
counterElement
|
|
3357
|
+
] })
|
|
3320
3358
|
] }) });
|
|
3321
3359
|
}
|
|
3322
3360
|
var attachStatics2 = (component) => {
|
|
@@ -3333,7 +3371,7 @@ var TextArea = attachStatics2(TextAreaBase);
|
|
|
3333
3371
|
// src/toast/toast.tsx
|
|
3334
3372
|
var import_clsx44 = __toESM(require("clsx"));
|
|
3335
3373
|
var import_react50 = require("react");
|
|
3336
|
-
var
|
|
3374
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3337
3375
|
var CLOSE_TIME_MSEC = 5e3;
|
|
3338
3376
|
function Toast({
|
|
3339
3377
|
state = "information",
|
|
@@ -3380,17 +3418,17 @@ function Toast({
|
|
|
3380
3418
|
}, CLOSE_TIME_MSEC);
|
|
3381
3419
|
return () => window.clearTimeout(timer);
|
|
3382
3420
|
}, [isAutoClose]);
|
|
3383
|
-
return /* @__PURE__ */ (0,
|
|
3384
|
-
/* @__PURE__ */ (0,
|
|
3385
|
-
/* @__PURE__ */ (0,
|
|
3386
|
-
/* @__PURE__ */ (0,
|
|
3421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: wrapperClasses, style: { width }, onAnimationEnd: handleAnimationEnd, children: [
|
|
3422
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Icon, { name: iconName[state] }) }),
|
|
3423
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: textClasses, children }),
|
|
3424
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(IconButton, { icon: "close", size: "medium", variant: "text", onClick: handleClose, isNoPadding: true })
|
|
3387
3425
|
] });
|
|
3388
3426
|
}
|
|
3389
3427
|
|
|
3390
3428
|
// src/toast/toast-provider.tsx
|
|
3391
3429
|
var import_react51 = require("react");
|
|
3392
3430
|
var import_react_dom3 = require("react-dom");
|
|
3393
|
-
var
|
|
3431
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3394
3432
|
var ToastContext = (0, import_react51.createContext)({});
|
|
3395
3433
|
var ToastProvider = ({ children }) => {
|
|
3396
3434
|
const [isClientRender, setIsClientRender] = (0, import_react51.useState)(false);
|
|
@@ -3404,10 +3442,10 @@ var ToastProvider = ({ children }) => {
|
|
|
3404
3442
|
(0, import_react51.useEffect)(() => {
|
|
3405
3443
|
setIsClientRender(true);
|
|
3406
3444
|
}, []);
|
|
3407
|
-
return /* @__PURE__ */ (0,
|
|
3445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(ToastContext.Provider, { value: { addToast, removeToast }, children: [
|
|
3408
3446
|
children,
|
|
3409
3447
|
isClientRender && (0, import_react_dom3.createPortal)(
|
|
3410
|
-
/* @__PURE__ */ (0,
|
|
3448
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.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_runtime63.jsx)(Toast, { state, isAutoClose: true, isAnimation: true, onClickClose: () => removeToast(id), width: 475, children: message }, id)) }),
|
|
3411
3449
|
document.body
|
|
3412
3450
|
)
|
|
3413
3451
|
] });
|
|
@@ -3418,7 +3456,7 @@ var useToast = () => {
|
|
|
3418
3456
|
|
|
3419
3457
|
// src/toggle/toggle.tsx
|
|
3420
3458
|
var import_clsx45 = __toESM(require("clsx"));
|
|
3421
|
-
var
|
|
3459
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3422
3460
|
function Toggle({
|
|
3423
3461
|
id,
|
|
3424
3462
|
size = "medium",
|
|
@@ -3453,9 +3491,9 @@ function Toggle({
|
|
|
3453
3491
|
"pointer-events-none cursor-not-allowed text-disabled01": isDisabled,
|
|
3454
3492
|
"cursor-pointer text-text01": !isDisabled
|
|
3455
3493
|
});
|
|
3456
|
-
return /* @__PURE__ */ (0,
|
|
3457
|
-
label != null && labelPosition === "left" && /* @__PURE__ */ (0,
|
|
3458
|
-
/* @__PURE__ */ (0,
|
|
3494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "relative flex flex-[0_0_auto] items-center", children: [
|
|
3495
|
+
label != null && labelPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("label", { htmlFor: id, className: labelClasses, children: label }),
|
|
3496
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3459
3497
|
"input",
|
|
3460
3498
|
{
|
|
3461
3499
|
className: inputClasses,
|
|
@@ -3467,8 +3505,8 @@ function Toggle({
|
|
|
3467
3505
|
disabled: isDisabled
|
|
3468
3506
|
}
|
|
3469
3507
|
),
|
|
3470
|
-
/* @__PURE__ */ (0,
|
|
3471
|
-
label != null && labelPosition === "right" && /* @__PURE__ */ (0,
|
|
3508
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: baseClasses, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: indicatorClasses }) }),
|
|
3509
|
+
label != null && labelPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("label", { htmlFor: id, className: labelClasses, children: label })
|
|
3472
3510
|
] });
|
|
3473
3511
|
}
|
|
3474
3512
|
|
|
@@ -3481,7 +3519,7 @@ var import_clsx47 = __toESM(require("clsx"));
|
|
|
3481
3519
|
|
|
3482
3520
|
// src/tooltip/tail-icon.tsx
|
|
3483
3521
|
var import_clsx46 = __toESM(require("clsx"));
|
|
3484
|
-
var
|
|
3522
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3485
3523
|
var TailIcon = (props) => {
|
|
3486
3524
|
const tailClasses = (0, import_clsx46.default)("absolute fill-uiBackgroundTooltip", {
|
|
3487
3525
|
"rotate-180": props.verticalPosition === "bottom",
|
|
@@ -3498,9 +3536,9 @@ var TailIcon = (props) => {
|
|
|
3498
3536
|
"left-1/2 -translate-x-2": props.horizontalAlign === "center" && props.size !== "small"
|
|
3499
3537
|
});
|
|
3500
3538
|
if (props.size === "small") {
|
|
3501
|
-
return /* @__PURE__ */ (0,
|
|
3539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.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_runtime65.jsx)("path", { d: "M4 4L0 0H8L4 4Z" }) });
|
|
3502
3540
|
} else {
|
|
3503
|
-
return /* @__PURE__ */ (0,
|
|
3541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3504
3542
|
"svg",
|
|
3505
3543
|
{
|
|
3506
3544
|
className: tailClasses,
|
|
@@ -3509,14 +3547,14 @@ var TailIcon = (props) => {
|
|
|
3509
3547
|
viewBox: "0 0 14 8",
|
|
3510
3548
|
fill: "none",
|
|
3511
3549
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3512
|
-
children: /* @__PURE__ */ (0,
|
|
3550
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("path", { d: "M7 8L0 0H14L7 8Z" })
|
|
3513
3551
|
}
|
|
3514
3552
|
);
|
|
3515
3553
|
}
|
|
3516
3554
|
};
|
|
3517
3555
|
|
|
3518
3556
|
// src/tooltip/tooltip-content.tsx
|
|
3519
|
-
var
|
|
3557
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3520
3558
|
var TooltipContent = ({
|
|
3521
3559
|
content,
|
|
3522
3560
|
horizontalAlign,
|
|
@@ -3552,7 +3590,7 @@ var TooltipContent = ({
|
|
|
3552
3590
|
transform: `translate(${tooltipPosition.translateX}, ${tooltipPosition.translateY})`,
|
|
3553
3591
|
...tooltipPosition
|
|
3554
3592
|
} : {};
|
|
3555
|
-
return /* @__PURE__ */ (0,
|
|
3593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: tooltipWrapperClasses, style: tooltipWrapperStyle, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
3556
3594
|
"div",
|
|
3557
3595
|
{
|
|
3558
3596
|
className: tooltipBodyClasses,
|
|
@@ -3561,7 +3599,7 @@ var TooltipContent = ({
|
|
|
3561
3599
|
},
|
|
3562
3600
|
children: [
|
|
3563
3601
|
content,
|
|
3564
|
-
/* @__PURE__ */ (0,
|
|
3602
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TailIcon, { size, verticalPosition, horizontalAlign })
|
|
3565
3603
|
]
|
|
3566
3604
|
}
|
|
3567
3605
|
) });
|
|
@@ -3622,7 +3660,7 @@ var useTooltip = () => {
|
|
|
3622
3660
|
};
|
|
3623
3661
|
|
|
3624
3662
|
// src/tooltip/tooltip.tsx
|
|
3625
|
-
var
|
|
3663
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3626
3664
|
function Tooltip({
|
|
3627
3665
|
children,
|
|
3628
3666
|
content,
|
|
@@ -3660,7 +3698,7 @@ function Tooltip({
|
|
|
3660
3698
|
const position = calculatePosition({ dimensions, maxWidth, verticalPosition, horizontalAlign, tooltipSize: size });
|
|
3661
3699
|
setTooltipPosition(position);
|
|
3662
3700
|
}, [calculatePosition, horizontalAlign, maxWidth, size, verticalPosition]);
|
|
3663
|
-
return /* @__PURE__ */ (0,
|
|
3701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
3664
3702
|
"div",
|
|
3665
3703
|
{
|
|
3666
3704
|
ref: targetRef,
|
|
@@ -3669,7 +3707,7 @@ function Tooltip({
|
|
|
3669
3707
|
onMouseLeave: handleMouseOutWrapper,
|
|
3670
3708
|
children: [
|
|
3671
3709
|
children,
|
|
3672
|
-
isVisible && (portalTarget == null ? /* @__PURE__ */ (0,
|
|
3710
|
+
isVisible && (portalTarget == null ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3673
3711
|
TooltipContent,
|
|
3674
3712
|
{
|
|
3675
3713
|
content,
|
|
@@ -3680,7 +3718,7 @@ function Tooltip({
|
|
|
3680
3718
|
tooltipPosition
|
|
3681
3719
|
}
|
|
3682
3720
|
) : (0, import_react_dom4.createPortal)(
|
|
3683
|
-
/* @__PURE__ */ (0,
|
|
3721
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3684
3722
|
TooltipContent,
|
|
3685
3723
|
{
|
|
3686
3724
|
isPortal: true,
|
|
@@ -3705,6 +3743,7 @@ function Tooltip({
|
|
|
3705
3743
|
Button,
|
|
3706
3744
|
Checkbox,
|
|
3707
3745
|
DatePicker,
|
|
3746
|
+
Divider,
|
|
3708
3747
|
Dropdown,
|
|
3709
3748
|
EvaluationStar,
|
|
3710
3749
|
FileInput,
|