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