@tonyarbor/components 0.2.0 → 0.4.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/Avatar.d.mts +42 -0
- package/dist/Avatar.d.ts +42 -0
- package/dist/Avatar.js +158 -0
- package/dist/Avatar.js.map +1 -0
- package/dist/Avatar.mjs +7 -0
- package/dist/Avatar.mjs.map +1 -0
- package/dist/Banner.d.mts +59 -0
- package/dist/Banner.d.ts +59 -0
- package/dist/Banner.js +222 -0
- package/dist/Banner.js.map +1 -0
- package/dist/Banner.mjs +7 -0
- package/dist/Banner.mjs.map +1 -0
- package/dist/Breadcrumbs.d.mts +51 -0
- package/dist/Breadcrumbs.d.ts +51 -0
- package/dist/Breadcrumbs.js +276 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/Breadcrumbs.mjs +7 -0
- package/dist/Breadcrumbs.mjs.map +1 -0
- package/dist/Checkbox.d.mts +4 -0
- package/dist/Checkbox.d.ts +4 -0
- package/dist/Checkbox.js +45 -16
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.mjs +1 -1
- package/dist/DatePicker.d.mts +68 -0
- package/dist/DatePicker.d.ts +68 -0
- package/dist/DatePicker.js +490 -0
- package/dist/DatePicker.js.map +1 -0
- package/dist/DatePicker.mjs +7 -0
- package/dist/DatePicker.mjs.map +1 -0
- package/dist/Pagination.d.mts +36 -0
- package/dist/Pagination.d.ts +36 -0
- package/dist/Pagination.js +301 -0
- package/dist/Pagination.js.map +1 -0
- package/dist/Pagination.mjs +7 -0
- package/dist/Pagination.mjs.map +1 -0
- package/dist/Radio.js +32 -12
- package/dist/Radio.js.map +1 -1
- package/dist/Radio.mjs +1 -1
- package/dist/SearchGlobal.d.mts +45 -0
- package/dist/SearchGlobal.d.ts +45 -0
- package/dist/SearchGlobal.js +209 -0
- package/dist/SearchGlobal.js.map +1 -0
- package/dist/SearchGlobal.mjs +7 -0
- package/dist/SearchGlobal.mjs.map +1 -0
- package/dist/SearchOnPage.d.mts +45 -0
- package/dist/SearchOnPage.d.ts +45 -0
- package/dist/SearchOnPage.js +171 -0
- package/dist/SearchOnPage.js.map +1 -0
- package/dist/SearchOnPage.mjs +7 -0
- package/dist/SearchOnPage.mjs.map +1 -0
- package/dist/Table.d.mts +80 -0
- package/dist/Table.d.ts +80 -0
- package/dist/Table.js +347 -0
- package/dist/Table.js.map +1 -0
- package/dist/Table.mjs +8 -0
- package/dist/Table.mjs.map +1 -0
- package/dist/TableControls.d.mts +76 -0
- package/dist/TableControls.d.ts +76 -0
- package/dist/TableControls.js +461 -0
- package/dist/TableControls.js.map +1 -0
- package/dist/TableControls.mjs +7 -0
- package/dist/TableControls.mjs.map +1 -0
- package/dist/TableFooterPagination.d.mts +56 -0
- package/dist/TableFooterPagination.d.ts +56 -0
- package/dist/TableFooterPagination.js +499 -0
- package/dist/TableFooterPagination.js.map +1 -0
- package/dist/TableFooterPagination.mjs +7 -0
- package/dist/TableFooterPagination.mjs.map +1 -0
- package/dist/Tabs.d.mts +50 -0
- package/dist/Tabs.d.ts +50 -0
- package/dist/Tabs.js +187 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Tabs.mjs +7 -0
- package/dist/Tabs.mjs.map +1 -0
- package/dist/TextArea.d.mts +64 -0
- package/dist/TextArea.d.ts +64 -0
- package/dist/TextArea.js +171 -0
- package/dist/TextArea.js.map +1 -0
- package/dist/TextArea.mjs +7 -0
- package/dist/TextArea.mjs.map +1 -0
- package/dist/Toast.d.mts +48 -0
- package/dist/Toast.d.ts +48 -0
- package/dist/Toast.js +169 -0
- package/dist/Toast.js.map +1 -0
- package/dist/Toast.mjs +7 -0
- package/dist/Toast.mjs.map +1 -0
- package/dist/Toggle.d.mts +48 -0
- package/dist/Toggle.d.ts +48 -0
- package/dist/Toggle.js +291 -0
- package/dist/Toggle.js.map +1 -0
- package/dist/Toggle.mjs +7 -0
- package/dist/Toggle.mjs.map +1 -0
- package/dist/Tooltip.d.mts +32 -0
- package/dist/Tooltip.d.ts +32 -0
- package/dist/Tooltip.js +109 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/Tooltip.mjs +7 -0
- package/dist/Tooltip.mjs.map +1 -0
- package/dist/chunk-52TG3BFX.mjs +463 -0
- package/dist/chunk-52TG3BFX.mjs.map +1 -0
- package/dist/chunk-AI2U34CF.mjs +159 -0
- package/dist/chunk-AI2U34CF.mjs.map +1 -0
- package/dist/chunk-B7RX3TPX.mjs +135 -0
- package/dist/chunk-B7RX3TPX.mjs.map +1 -0
- package/dist/chunk-C25FFMRQ.mjs +255 -0
- package/dist/chunk-C25FFMRQ.mjs.map +1 -0
- package/dist/{chunk-BCYJIUQX.mjs → chunk-CUTYEIFE.mjs} +47 -18
- package/dist/chunk-CUTYEIFE.mjs.map +1 -0
- package/dist/chunk-DULH2KRW.mjs +133 -0
- package/dist/chunk-DULH2KRW.mjs.map +1 -0
- package/dist/chunk-G5NVKF2G.mjs +434 -0
- package/dist/chunk-G5NVKF2G.mjs.map +1 -0
- package/dist/chunk-JSG27ZZS.mjs +122 -0
- package/dist/chunk-JSG27ZZS.mjs.map +1 -0
- package/dist/{chunk-ARBHNHO7.mjs → chunk-M6DVBEEL.mjs} +33 -13
- package/dist/chunk-M6DVBEEL.mjs.map +1 -0
- package/dist/chunk-MBUMR2XJ.mjs +135 -0
- package/dist/chunk-MBUMR2XJ.mjs.map +1 -0
- package/dist/chunk-MNH2TGUX.mjs +73 -0
- package/dist/chunk-MNH2TGUX.mjs.map +1 -0
- package/dist/chunk-RQP6ZGD7.mjs +240 -0
- package/dist/chunk-RQP6ZGD7.mjs.map +1 -0
- package/dist/chunk-RRMG2SSZ.mjs +265 -0
- package/dist/chunk-RRMG2SSZ.mjs.map +1 -0
- package/dist/chunk-U4JXKZZG.mjs +186 -0
- package/dist/chunk-U4JXKZZG.mjs.map +1 -0
- package/dist/chunk-UPBHDBAK.mjs +173 -0
- package/dist/chunk-UPBHDBAK.mjs.map +1 -0
- package/dist/chunk-W55QJIAN.mjs +467 -0
- package/dist/chunk-W55QJIAN.mjs.map +1 -0
- package/dist/chunk-YV4OXFIM.mjs +151 -0
- package/dist/chunk-YV4OXFIM.mjs.map +1 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +3414 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +63 -3
- package/package.json +78 -1
- package/dist/chunk-ARBHNHO7.mjs.map +0 -1
- package/dist/chunk-BCYJIUQX.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -30,14 +30,29 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
+
Avatar: () => Avatar,
|
|
34
|
+
Banner: () => Banner,
|
|
35
|
+
Breadcrumbs: () => Breadcrumbs,
|
|
33
36
|
Button: () => Button,
|
|
34
37
|
Card: () => Card,
|
|
35
38
|
Checkbox: () => Checkbox,
|
|
36
39
|
Combobox: () => Combobox,
|
|
40
|
+
DatePicker: () => DatePicker,
|
|
37
41
|
Input: () => Input,
|
|
38
42
|
NumericInput: () => NumericInput,
|
|
43
|
+
Pagination: () => Pagination,
|
|
39
44
|
Radio: () => Radio,
|
|
40
|
-
|
|
45
|
+
SearchGlobal: () => SearchGlobal,
|
|
46
|
+
SearchOnPage: () => SearchOnPage,
|
|
47
|
+
Table: () => Table,
|
|
48
|
+
TableControls: () => TableControls,
|
|
49
|
+
TableFooterPagination: () => TableFooterPagination,
|
|
50
|
+
Tabs: () => Tabs,
|
|
51
|
+
Tag: () => Tag,
|
|
52
|
+
TextArea: () => TextArea,
|
|
53
|
+
Toast: () => Toast,
|
|
54
|
+
Toggle: () => Toggle,
|
|
55
|
+
Tooltip: () => Tooltip
|
|
41
56
|
});
|
|
42
57
|
module.exports = __toCommonJS(src_exports);
|
|
43
58
|
|
|
@@ -1079,10 +1094,10 @@ var import_clsx7 = require("clsx");
|
|
|
1079
1094
|
var import_lucide_react2 = require("lucide-react");
|
|
1080
1095
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1081
1096
|
var checkboxStyles = {
|
|
1082
|
-
width: "
|
|
1083
|
-
height: "
|
|
1084
|
-
border: "
|
|
1085
|
-
// grey-
|
|
1097
|
+
width: "16px",
|
|
1098
|
+
height: "16px",
|
|
1099
|
+
border: "1px solid #7e7e7e",
|
|
1100
|
+
// grey-500
|
|
1086
1101
|
borderRadius: "4px",
|
|
1087
1102
|
display: "flex",
|
|
1088
1103
|
alignItems: "center",
|
|
@@ -1093,9 +1108,18 @@ var checkboxStyles = {
|
|
|
1093
1108
|
backgroundColor: "#ffffff"
|
|
1094
1109
|
};
|
|
1095
1110
|
var checkedStyles = {
|
|
1096
|
-
backgroundColor: "#
|
|
1097
|
-
// brand-
|
|
1098
|
-
|
|
1111
|
+
backgroundColor: "#0e8a0e",
|
|
1112
|
+
// brand-600
|
|
1113
|
+
border: "1px solid #0e8a0e"
|
|
1114
|
+
};
|
|
1115
|
+
var checkedHoverStyles = {
|
|
1116
|
+
backgroundColor: "#005700",
|
|
1117
|
+
// brand-800
|
|
1118
|
+
border: "1px solid #005700"
|
|
1119
|
+
};
|
|
1120
|
+
var uncheckedHoverStyles = {
|
|
1121
|
+
border: "1px solid #474747"
|
|
1122
|
+
// grey-700
|
|
1099
1123
|
};
|
|
1100
1124
|
var labelStyles4 = {
|
|
1101
1125
|
fontSize: "13px",
|
|
@@ -1119,10 +1143,24 @@ var Checkbox = React7.forwardRef(
|
|
|
1119
1143
|
style,
|
|
1120
1144
|
"data-testid": dataTestId,
|
|
1121
1145
|
name,
|
|
1122
|
-
value
|
|
1146
|
+
value,
|
|
1147
|
+
indeterminate = false
|
|
1123
1148
|
}, ref) => {
|
|
1124
1149
|
const [isFocused, setIsFocused] = React7.useState(false);
|
|
1150
|
+
const [isHovered, setIsHovered] = React7.useState(false);
|
|
1125
1151
|
const checkboxId = React7.useId();
|
|
1152
|
+
const innerRef = React7.useRef(null);
|
|
1153
|
+
React7.useEffect(() => {
|
|
1154
|
+
const node = innerRef.current;
|
|
1155
|
+
if (node) {
|
|
1156
|
+
node.indeterminate = indeterminate;
|
|
1157
|
+
if (typeof ref === "function") {
|
|
1158
|
+
ref(node);
|
|
1159
|
+
} else if (ref) {
|
|
1160
|
+
ref.current = node;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}, [indeterminate, ref]);
|
|
1126
1164
|
const handleChange = (e) => {
|
|
1127
1165
|
if (!disabled) {
|
|
1128
1166
|
onChange?.(e.target.checked);
|
|
@@ -1130,12 +1168,16 @@ var Checkbox = React7.forwardRef(
|
|
|
1130
1168
|
};
|
|
1131
1169
|
const boxStyle = {
|
|
1132
1170
|
...checkboxStyles,
|
|
1133
|
-
...checked && !disabled && checkedStyles,
|
|
1134
|
-
...
|
|
1135
|
-
...
|
|
1136
|
-
...
|
|
1171
|
+
...(checked || indeterminate) && !disabled && checkedStyles,
|
|
1172
|
+
...isHovered && !disabled && !(checked || indeterminate) && uncheckedHoverStyles,
|
|
1173
|
+
...isHovered && !disabled && (checked || indeterminate) && checkedHoverStyles,
|
|
1174
|
+
...disabled && !checked && !indeterminate && { backgroundColor: "#efefef", border: "1px solid #b3b3b3" },
|
|
1175
|
+
...disabled && (checked || indeterminate) && { backgroundColor: "#b3b3b3", border: "1px solid #b3b3b3" },
|
|
1176
|
+
...isFocused && !disabled && {
|
|
1177
|
+
boxShadow: "0px 0px 0px 3px #3cad51"
|
|
1178
|
+
}
|
|
1137
1179
|
};
|
|
1138
|
-
const checkmarkColor =
|
|
1180
|
+
const checkmarkColor = "#ffffff";
|
|
1139
1181
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1140
1182
|
"div",
|
|
1141
1183
|
{
|
|
@@ -1146,7 +1188,7 @@ var Checkbox = React7.forwardRef(
|
|
|
1146
1188
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1147
1189
|
"input",
|
|
1148
1190
|
{
|
|
1149
|
-
ref,
|
|
1191
|
+
ref: innerRef,
|
|
1150
1192
|
id: checkboxId,
|
|
1151
1193
|
type: "checkbox",
|
|
1152
1194
|
checked,
|
|
@@ -1162,13 +1204,15 @@ var Checkbox = React7.forwardRef(
|
|
|
1162
1204
|
width: 0,
|
|
1163
1205
|
height: 0
|
|
1164
1206
|
},
|
|
1165
|
-
"aria-checked": checked
|
|
1207
|
+
"aria-checked": indeterminate ? "mixed" : checked
|
|
1166
1208
|
}
|
|
1167
1209
|
),
|
|
1168
1210
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1169
1211
|
"label",
|
|
1170
1212
|
{
|
|
1171
1213
|
htmlFor: checkboxId,
|
|
1214
|
+
onMouseEnter: () => !disabled && setIsHovered(true),
|
|
1215
|
+
onMouseLeave: () => !disabled && setIsHovered(false),
|
|
1172
1216
|
style: {
|
|
1173
1217
|
display: "flex",
|
|
1174
1218
|
alignItems: "center",
|
|
@@ -1176,7 +1220,7 @@ var Checkbox = React7.forwardRef(
|
|
|
1176
1220
|
cursor: disabled ? "not-allowed" : "pointer"
|
|
1177
1221
|
},
|
|
1178
1222
|
children: [
|
|
1179
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: boxStyle, children: checked && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.Check, { size:
|
|
1223
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: boxStyle, children: (checked || indeterminate) && (indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.Minus, { size: 12, color: checkmarkColor, strokeWidth: 3 }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.Check, { size: 16, color: checkmarkColor, strokeWidth: 3 })) }),
|
|
1180
1224
|
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1181
1225
|
"span",
|
|
1182
1226
|
{
|
|
@@ -1203,10 +1247,10 @@ var React8 = __toESM(require("react"));
|
|
|
1203
1247
|
var import_clsx8 = require("clsx");
|
|
1204
1248
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1205
1249
|
var radioStyles = {
|
|
1206
|
-
width: "
|
|
1207
|
-
height: "
|
|
1208
|
-
border: "
|
|
1209
|
-
// grey-
|
|
1250
|
+
width: "16px",
|
|
1251
|
+
height: "16px",
|
|
1252
|
+
border: "1px solid #7e7e7e",
|
|
1253
|
+
// grey-500
|
|
1210
1254
|
borderRadius: "50%",
|
|
1211
1255
|
display: "flex",
|
|
1212
1256
|
alignItems: "center",
|
|
@@ -1217,17 +1261,29 @@ var radioStyles = {
|
|
|
1217
1261
|
backgroundColor: "#ffffff"
|
|
1218
1262
|
};
|
|
1219
1263
|
var checkedStyles2 = {
|
|
1220
|
-
|
|
1221
|
-
// brand-
|
|
1264
|
+
border: "1px solid #0e8a0e"
|
|
1265
|
+
// brand-600
|
|
1266
|
+
};
|
|
1267
|
+
var checkedHoverStyles2 = {
|
|
1268
|
+
border: "1px solid #005700"
|
|
1269
|
+
// brand-800
|
|
1270
|
+
};
|
|
1271
|
+
var uncheckedHoverStyles2 = {
|
|
1272
|
+
border: "1px solid #2f2f2f"
|
|
1273
|
+
// grey-900
|
|
1222
1274
|
};
|
|
1223
1275
|
var innerDotStyles = {
|
|
1224
1276
|
width: "10px",
|
|
1225
1277
|
height: "10px",
|
|
1226
1278
|
borderRadius: "50%",
|
|
1227
|
-
backgroundColor: "#
|
|
1228
|
-
// brand-
|
|
1279
|
+
backgroundColor: "#0e8a0e",
|
|
1280
|
+
// brand-600
|
|
1229
1281
|
transition: "all 0.2s ease-in-out"
|
|
1230
1282
|
};
|
|
1283
|
+
var innerDotHoverStyles = {
|
|
1284
|
+
backgroundColor: "#005700"
|
|
1285
|
+
// brand-800
|
|
1286
|
+
};
|
|
1231
1287
|
var labelStyles5 = {
|
|
1232
1288
|
fontSize: "13px",
|
|
1233
1289
|
color: "#2f2f2f",
|
|
@@ -1253,6 +1309,7 @@ var Radio = React8.forwardRef(
|
|
|
1253
1309
|
value
|
|
1254
1310
|
}, ref) => {
|
|
1255
1311
|
const [isFocused, setIsFocused] = React8.useState(false);
|
|
1312
|
+
const [isHovered, setIsHovered] = React8.useState(false);
|
|
1256
1313
|
const radioId = React8.useId();
|
|
1257
1314
|
const handleChange = (e) => {
|
|
1258
1315
|
if (!disabled) {
|
|
@@ -1262,13 +1319,18 @@ var Radio = React8.forwardRef(
|
|
|
1262
1319
|
const circleStyle = {
|
|
1263
1320
|
...radioStyles,
|
|
1264
1321
|
...checked && !disabled && checkedStyles2,
|
|
1265
|
-
...disabled && !checked &&
|
|
1266
|
-
...disabled && checked &&
|
|
1267
|
-
...
|
|
1322
|
+
...isHovered && !disabled && !checked && uncheckedHoverStyles2,
|
|
1323
|
+
...isHovered && !disabled && checked && checkedHoverStyles2,
|
|
1324
|
+
...disabled && !checked && { backgroundColor: "#efefef", border: "1px solid #7e7e7e" },
|
|
1325
|
+
...disabled && checked && { backgroundColor: "#efefef", border: "1px solid #7e7e7e" },
|
|
1326
|
+
...isFocused && !disabled && {
|
|
1327
|
+
boxShadow: "0px 0px 0px 3px #3cad51"
|
|
1328
|
+
}
|
|
1268
1329
|
};
|
|
1269
1330
|
const dotStyle = {
|
|
1270
1331
|
...innerDotStyles,
|
|
1271
|
-
|
|
1332
|
+
...isHovered && !disabled && innerDotHoverStyles,
|
|
1333
|
+
...disabled && { backgroundColor: "#7e7e7e" }
|
|
1272
1334
|
};
|
|
1273
1335
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1274
1336
|
"div",
|
|
@@ -1303,6 +1365,8 @@ var Radio = React8.forwardRef(
|
|
|
1303
1365
|
"label",
|
|
1304
1366
|
{
|
|
1305
1367
|
htmlFor: radioId,
|
|
1368
|
+
onMouseEnter: () => !disabled && setIsHovered(true),
|
|
1369
|
+
onMouseLeave: () => !disabled && setIsHovered(false),
|
|
1306
1370
|
style: {
|
|
1307
1371
|
display: "flex",
|
|
1308
1372
|
alignItems: "center",
|
|
@@ -1331,15 +1395,3335 @@ var Radio = React8.forwardRef(
|
|
|
1331
1395
|
}
|
|
1332
1396
|
);
|
|
1333
1397
|
Radio.displayName = "Radio";
|
|
1398
|
+
|
|
1399
|
+
// src/DatePicker/DatePicker.tsx
|
|
1400
|
+
var React9 = __toESM(require("react"));
|
|
1401
|
+
var import_clsx9 = require("clsx");
|
|
1402
|
+
var Popover = __toESM(require("@radix-ui/react-popover"));
|
|
1403
|
+
var import_lucide_react3 = require("lucide-react");
|
|
1404
|
+
var import_date_fns = require("date-fns");
|
|
1405
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1406
|
+
var wrapperStyles3 = {
|
|
1407
|
+
display: "flex",
|
|
1408
|
+
flexDirection: "column",
|
|
1409
|
+
gap: "4px"
|
|
1410
|
+
};
|
|
1411
|
+
var labelStyles6 = {
|
|
1412
|
+
fontSize: "11px",
|
|
1413
|
+
fontWeight: 600,
|
|
1414
|
+
color: "#2f2f2f",
|
|
1415
|
+
textTransform: "uppercase",
|
|
1416
|
+
letterSpacing: "0.5px",
|
|
1417
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
1418
|
+
};
|
|
1419
|
+
var inputContainerStyles = {
|
|
1420
|
+
position: "relative",
|
|
1421
|
+
display: "flex",
|
|
1422
|
+
alignItems: "center"
|
|
1423
|
+
};
|
|
1424
|
+
var inputStyles3 = {
|
|
1425
|
+
width: "100%",
|
|
1426
|
+
height: "36px",
|
|
1427
|
+
padding: "0 36px 0 12px",
|
|
1428
|
+
fontSize: "13px",
|
|
1429
|
+
border: "1px solid #d1d1d1",
|
|
1430
|
+
borderRadius: "8px",
|
|
1431
|
+
outline: "none",
|
|
1432
|
+
transition: "all 0.2s ease-in-out",
|
|
1433
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1434
|
+
backgroundColor: "#ffffff",
|
|
1435
|
+
color: "#2f2f2f"
|
|
1436
|
+
};
|
|
1437
|
+
var iconButtonStyles = {
|
|
1438
|
+
position: "absolute",
|
|
1439
|
+
right: "8px",
|
|
1440
|
+
display: "flex",
|
|
1441
|
+
alignItems: "center",
|
|
1442
|
+
justifyContent: "center",
|
|
1443
|
+
padding: "4px",
|
|
1444
|
+
cursor: "pointer",
|
|
1445
|
+
color: "#595959",
|
|
1446
|
+
backgroundColor: "transparent",
|
|
1447
|
+
border: "none"
|
|
1448
|
+
};
|
|
1449
|
+
var helperTextStyles4 = {
|
|
1450
|
+
fontSize: "11px",
|
|
1451
|
+
color: "#595959",
|
|
1452
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
1453
|
+
};
|
|
1454
|
+
var calendarPopoverStyles = {
|
|
1455
|
+
backgroundColor: "#ffffff",
|
|
1456
|
+
border: "1px solid #efefef",
|
|
1457
|
+
borderRadius: "8px",
|
|
1458
|
+
padding: "16px",
|
|
1459
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
|
|
1460
|
+
minWidth: "320px",
|
|
1461
|
+
zIndex: 1e3
|
|
1462
|
+
};
|
|
1463
|
+
var calendarHeaderStyles = {
|
|
1464
|
+
display: "flex",
|
|
1465
|
+
alignItems: "center",
|
|
1466
|
+
justifyContent: "space-between",
|
|
1467
|
+
marginBottom: "16px",
|
|
1468
|
+
gap: "8px"
|
|
1469
|
+
};
|
|
1470
|
+
var monthYearContainerStyles = {
|
|
1471
|
+
display: "flex",
|
|
1472
|
+
gap: "8px",
|
|
1473
|
+
flex: 1
|
|
1474
|
+
};
|
|
1475
|
+
var selectStyles = {
|
|
1476
|
+
padding: "6px 8px",
|
|
1477
|
+
fontSize: "13px",
|
|
1478
|
+
border: "1px solid #d1d1d1",
|
|
1479
|
+
borderRadius: "6px",
|
|
1480
|
+
backgroundColor: "#ffffff",
|
|
1481
|
+
color: "#2f2f2f",
|
|
1482
|
+
cursor: "pointer",
|
|
1483
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1484
|
+
outline: "none"
|
|
1485
|
+
};
|
|
1486
|
+
var navButtonStyles = {
|
|
1487
|
+
display: "flex",
|
|
1488
|
+
alignItems: "center",
|
|
1489
|
+
justifyContent: "center",
|
|
1490
|
+
width: "28px",
|
|
1491
|
+
height: "28px",
|
|
1492
|
+
border: "none",
|
|
1493
|
+
backgroundColor: "transparent",
|
|
1494
|
+
cursor: "pointer",
|
|
1495
|
+
borderRadius: "4px",
|
|
1496
|
+
color: "#2f2f2f",
|
|
1497
|
+
transition: "background-color 0.2s"
|
|
1498
|
+
};
|
|
1499
|
+
var weekDaysStyles = {
|
|
1500
|
+
display: "grid",
|
|
1501
|
+
gridTemplateColumns: "repeat(7, 1fr)",
|
|
1502
|
+
gap: "4px",
|
|
1503
|
+
marginBottom: "8px"
|
|
1504
|
+
};
|
|
1505
|
+
var weekDayStyles = {
|
|
1506
|
+
fontSize: "11px",
|
|
1507
|
+
fontWeight: 600,
|
|
1508
|
+
color: "#7e7e7e",
|
|
1509
|
+
textAlign: "center",
|
|
1510
|
+
padding: "4px",
|
|
1511
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
1512
|
+
};
|
|
1513
|
+
var daysGridStyles = {
|
|
1514
|
+
display: "grid",
|
|
1515
|
+
gridTemplateColumns: "repeat(7, 1fr)",
|
|
1516
|
+
gap: "4px"
|
|
1517
|
+
};
|
|
1518
|
+
var dayButtonStyles = {
|
|
1519
|
+
width: "36px",
|
|
1520
|
+
height: "36px",
|
|
1521
|
+
display: "flex",
|
|
1522
|
+
alignItems: "center",
|
|
1523
|
+
justifyContent: "center",
|
|
1524
|
+
border: "none",
|
|
1525
|
+
backgroundColor: "transparent",
|
|
1526
|
+
borderRadius: "50%",
|
|
1527
|
+
cursor: "pointer",
|
|
1528
|
+
fontSize: "13px",
|
|
1529
|
+
color: "#2f2f2f",
|
|
1530
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1531
|
+
transition: "all 0.2s"
|
|
1532
|
+
};
|
|
1533
|
+
var footerStyles = {
|
|
1534
|
+
display: "flex",
|
|
1535
|
+
justifyContent: "flex-end",
|
|
1536
|
+
marginTop: "12px",
|
|
1537
|
+
paddingTop: "12px",
|
|
1538
|
+
borderTop: "1px solid #efefef"
|
|
1539
|
+
};
|
|
1540
|
+
var todayButtonStyles = {
|
|
1541
|
+
padding: "6px 12px",
|
|
1542
|
+
fontSize: "13px",
|
|
1543
|
+
fontWeight: 500,
|
|
1544
|
+
color: "#16a33d",
|
|
1545
|
+
backgroundColor: "transparent",
|
|
1546
|
+
border: "none",
|
|
1547
|
+
cursor: "pointer",
|
|
1548
|
+
borderRadius: "6px",
|
|
1549
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1550
|
+
transition: "background-color 0.2s"
|
|
1551
|
+
};
|
|
1552
|
+
var MONTHS = [
|
|
1553
|
+
"January",
|
|
1554
|
+
"February",
|
|
1555
|
+
"March",
|
|
1556
|
+
"April",
|
|
1557
|
+
"May",
|
|
1558
|
+
"June",
|
|
1559
|
+
"July",
|
|
1560
|
+
"August",
|
|
1561
|
+
"September",
|
|
1562
|
+
"October",
|
|
1563
|
+
"November",
|
|
1564
|
+
"December"
|
|
1565
|
+
];
|
|
1566
|
+
var WEEKDAYS = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
|
|
1567
|
+
var DatePicker = React9.forwardRef(
|
|
1568
|
+
({
|
|
1569
|
+
value,
|
|
1570
|
+
onChange,
|
|
1571
|
+
label,
|
|
1572
|
+
placeholder = "DD/MM/YYYY",
|
|
1573
|
+
helperText,
|
|
1574
|
+
error,
|
|
1575
|
+
state = "default",
|
|
1576
|
+
disabled = false,
|
|
1577
|
+
className,
|
|
1578
|
+
style,
|
|
1579
|
+
"data-testid": dataTestId,
|
|
1580
|
+
minDate,
|
|
1581
|
+
maxDate,
|
|
1582
|
+
dateFormat = "dd/MM/yyyy"
|
|
1583
|
+
}, ref) => {
|
|
1584
|
+
const [open, setOpen] = React9.useState(false);
|
|
1585
|
+
const [inputValue, setInputValue] = React9.useState("");
|
|
1586
|
+
const [viewDate, setViewDate] = React9.useState(value || /* @__PURE__ */ new Date());
|
|
1587
|
+
const inputId = React9.useId();
|
|
1588
|
+
React9.useEffect(() => {
|
|
1589
|
+
if (value && (0, import_date_fns.isValid)(value)) {
|
|
1590
|
+
setInputValue((0, import_date_fns.format)(value, dateFormat));
|
|
1591
|
+
} else {
|
|
1592
|
+
setInputValue("");
|
|
1593
|
+
}
|
|
1594
|
+
}, [value, dateFormat]);
|
|
1595
|
+
React9.useEffect(() => {
|
|
1596
|
+
if (value && (0, import_date_fns.isValid)(value)) {
|
|
1597
|
+
setViewDate(value);
|
|
1598
|
+
}
|
|
1599
|
+
}, [value]);
|
|
1600
|
+
const handleInputChange = (e) => {
|
|
1601
|
+
const newValue = e.target.value;
|
|
1602
|
+
setInputValue(newValue);
|
|
1603
|
+
const parsedDate = (0, import_date_fns.parse)(newValue, dateFormat, /* @__PURE__ */ new Date());
|
|
1604
|
+
if ((0, import_date_fns.isValid)(parsedDate)) {
|
|
1605
|
+
onChange?.(parsedDate);
|
|
1606
|
+
setViewDate(parsedDate);
|
|
1607
|
+
}
|
|
1608
|
+
};
|
|
1609
|
+
const handleInputBlur = () => {
|
|
1610
|
+
if (value && (0, import_date_fns.isValid)(value)) {
|
|
1611
|
+
setInputValue((0, import_date_fns.format)(value, dateFormat));
|
|
1612
|
+
} else if (!inputValue) {
|
|
1613
|
+
onChange?.(void 0);
|
|
1614
|
+
}
|
|
1615
|
+
};
|
|
1616
|
+
const handleDateSelect = (date) => {
|
|
1617
|
+
onChange?.(date);
|
|
1618
|
+
setOpen(false);
|
|
1619
|
+
};
|
|
1620
|
+
const handleTodayClick = () => {
|
|
1621
|
+
const today = /* @__PURE__ */ new Date();
|
|
1622
|
+
onChange?.(today);
|
|
1623
|
+
setViewDate(today);
|
|
1624
|
+
setOpen(false);
|
|
1625
|
+
};
|
|
1626
|
+
const handleMonthChange = (e) => {
|
|
1627
|
+
const newMonth = parseInt(e.target.value, 10);
|
|
1628
|
+
const newDate = new Date(viewDate);
|
|
1629
|
+
newDate.setMonth(newMonth);
|
|
1630
|
+
setViewDate(newDate);
|
|
1631
|
+
};
|
|
1632
|
+
const handleYearChange = (e) => {
|
|
1633
|
+
const newYear = parseInt(e.target.value, 10);
|
|
1634
|
+
const newDate = new Date(viewDate);
|
|
1635
|
+
newDate.setFullYear(newYear);
|
|
1636
|
+
setViewDate(newDate);
|
|
1637
|
+
};
|
|
1638
|
+
const handlePrevMonth = () => {
|
|
1639
|
+
setViewDate((0, import_date_fns.subMonths)(viewDate, 1));
|
|
1640
|
+
};
|
|
1641
|
+
const handleNextMonth = () => {
|
|
1642
|
+
setViewDate((0, import_date_fns.addMonths)(viewDate, 1));
|
|
1643
|
+
};
|
|
1644
|
+
const monthStart = (0, import_date_fns.startOfMonth)(viewDate);
|
|
1645
|
+
const monthEnd = (0, import_date_fns.endOfMonth)(viewDate);
|
|
1646
|
+
const startDate = (0, import_date_fns.startOfWeek)(monthStart, { weekStartsOn: 1 });
|
|
1647
|
+
const endDate = (0, import_date_fns.endOfWeek)(monthEnd, { weekStartsOn: 1 });
|
|
1648
|
+
const days = (0, import_date_fns.eachDayOfInterval)({ start: startDate, end: endDate });
|
|
1649
|
+
const isDateDisabled = (date) => {
|
|
1650
|
+
if (minDate && date < minDate) return true;
|
|
1651
|
+
if (maxDate && date > maxDate) return true;
|
|
1652
|
+
return false;
|
|
1653
|
+
};
|
|
1654
|
+
const currentYear = viewDate.getFullYear();
|
|
1655
|
+
const yearOptions = Array.from({ length: 201 }, (_, i) => currentYear - 100 + i);
|
|
1656
|
+
const currentState = error ? "error" : state;
|
|
1657
|
+
const getInputStyles = () => {
|
|
1658
|
+
const styles = { ...inputStyles3 };
|
|
1659
|
+
if (disabled) {
|
|
1660
|
+
styles.backgroundColor = "#f8f8f8";
|
|
1661
|
+
styles.borderColor = "#efefef";
|
|
1662
|
+
styles.color = "#7e7e7e";
|
|
1663
|
+
styles.cursor = "not-allowed";
|
|
1664
|
+
} else if (currentState === "error") {
|
|
1665
|
+
styles.borderColor = "#e02f1d";
|
|
1666
|
+
} else if (currentState === "success") {
|
|
1667
|
+
styles.borderColor = "#16a33d";
|
|
1668
|
+
}
|
|
1669
|
+
return styles;
|
|
1670
|
+
};
|
|
1671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1672
|
+
"div",
|
|
1673
|
+
{
|
|
1674
|
+
className: (0, import_clsx9.clsx)("arbor-datepicker-wrapper", className),
|
|
1675
|
+
style: { ...wrapperStyles3, ...style },
|
|
1676
|
+
"data-testid": dataTestId,
|
|
1677
|
+
children: [
|
|
1678
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: inputId, style: labelStyles6, children: label }),
|
|
1679
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Popover.Root, { open, onOpenChange: setOpen, children: [
|
|
1680
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: inputContainerStyles, children: [
|
|
1681
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1682
|
+
"input",
|
|
1683
|
+
{
|
|
1684
|
+
ref,
|
|
1685
|
+
id: inputId,
|
|
1686
|
+
type: "text",
|
|
1687
|
+
value: inputValue,
|
|
1688
|
+
onChange: handleInputChange,
|
|
1689
|
+
onBlur: handleInputBlur,
|
|
1690
|
+
placeholder,
|
|
1691
|
+
disabled,
|
|
1692
|
+
style: getInputStyles(),
|
|
1693
|
+
"aria-label": label || "Date picker"
|
|
1694
|
+
}
|
|
1695
|
+
),
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1697
|
+
"button",
|
|
1698
|
+
{
|
|
1699
|
+
type: "button",
|
|
1700
|
+
style: {
|
|
1701
|
+
...iconButtonStyles,
|
|
1702
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
1703
|
+
},
|
|
1704
|
+
disabled,
|
|
1705
|
+
"aria-label": "Open calendar",
|
|
1706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Calendar, { size: 16 })
|
|
1707
|
+
}
|
|
1708
|
+
) })
|
|
1709
|
+
] }),
|
|
1710
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1711
|
+
Popover.Content,
|
|
1712
|
+
{
|
|
1713
|
+
align: "start",
|
|
1714
|
+
sideOffset: 4,
|
|
1715
|
+
style: calendarPopoverStyles,
|
|
1716
|
+
children: [
|
|
1717
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: calendarHeaderStyles, children: [
|
|
1718
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1719
|
+
"button",
|
|
1720
|
+
{
|
|
1721
|
+
type: "button",
|
|
1722
|
+
onClick: handlePrevMonth,
|
|
1723
|
+
style: navButtonStyles,
|
|
1724
|
+
onMouseEnter: (e) => {
|
|
1725
|
+
e.currentTarget.style.backgroundColor = "#f8f8f8";
|
|
1726
|
+
},
|
|
1727
|
+
onMouseLeave: (e) => {
|
|
1728
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
1729
|
+
},
|
|
1730
|
+
"aria-label": "Previous month",
|
|
1731
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ChevronLeft, { size: 16 })
|
|
1732
|
+
}
|
|
1733
|
+
),
|
|
1734
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: monthYearContainerStyles, children: [
|
|
1735
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1736
|
+
"select",
|
|
1737
|
+
{
|
|
1738
|
+
value: viewDate.getMonth(),
|
|
1739
|
+
onChange: handleMonthChange,
|
|
1740
|
+
style: selectStyles,
|
|
1741
|
+
"aria-label": "Select month",
|
|
1742
|
+
children: MONTHS.map((month, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: index, children: month }, month))
|
|
1743
|
+
}
|
|
1744
|
+
),
|
|
1745
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1746
|
+
"select",
|
|
1747
|
+
{
|
|
1748
|
+
value: viewDate.getFullYear(),
|
|
1749
|
+
onChange: handleYearChange,
|
|
1750
|
+
style: selectStyles,
|
|
1751
|
+
"aria-label": "Select year",
|
|
1752
|
+
children: yearOptions.map((year) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: year, children: year }, year))
|
|
1753
|
+
}
|
|
1754
|
+
)
|
|
1755
|
+
] }),
|
|
1756
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1757
|
+
"button",
|
|
1758
|
+
{
|
|
1759
|
+
type: "button",
|
|
1760
|
+
onClick: handleNextMonth,
|
|
1761
|
+
style: navButtonStyles,
|
|
1762
|
+
onMouseEnter: (e) => {
|
|
1763
|
+
e.currentTarget.style.backgroundColor = "#f8f8f8";
|
|
1764
|
+
},
|
|
1765
|
+
onMouseLeave: (e) => {
|
|
1766
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
1767
|
+
},
|
|
1768
|
+
"aria-label": "Next month",
|
|
1769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ChevronRight, { size: 16 })
|
|
1770
|
+
}
|
|
1771
|
+
)
|
|
1772
|
+
] }),
|
|
1773
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: weekDaysStyles, children: WEEKDAYS.map((day) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: weekDayStyles, children: day }, day)) }),
|
|
1774
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: daysGridStyles, children: days.map((day) => {
|
|
1775
|
+
const isCurrentMonth = day.getMonth() === viewDate.getMonth();
|
|
1776
|
+
const isSelected = value && (0, import_date_fns.isSameDay)(day, value);
|
|
1777
|
+
const isTodayDate = (0, import_date_fns.isToday)(day);
|
|
1778
|
+
const isDayDisabled = isDateDisabled(day);
|
|
1779
|
+
const getDayButtonStyles = () => {
|
|
1780
|
+
const styles = { ...dayButtonStyles };
|
|
1781
|
+
if (!isCurrentMonth) {
|
|
1782
|
+
styles.color = "#d1d1d1";
|
|
1783
|
+
}
|
|
1784
|
+
if (isDayDisabled) {
|
|
1785
|
+
styles.color = "#d1d1d1";
|
|
1786
|
+
styles.cursor = "not-allowed";
|
|
1787
|
+
}
|
|
1788
|
+
if (isSelected) {
|
|
1789
|
+
styles.backgroundColor = "#3cad51";
|
|
1790
|
+
styles.color = "#ffffff";
|
|
1791
|
+
} else if (isTodayDate && !isDayDisabled) {
|
|
1792
|
+
styles.fontWeight = 600;
|
|
1793
|
+
styles.color = "#16a33d";
|
|
1794
|
+
}
|
|
1795
|
+
return styles;
|
|
1796
|
+
};
|
|
1797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1798
|
+
"button",
|
|
1799
|
+
{
|
|
1800
|
+
type: "button",
|
|
1801
|
+
onClick: () => !isDayDisabled && handleDateSelect(day),
|
|
1802
|
+
disabled: isDayDisabled,
|
|
1803
|
+
style: getDayButtonStyles(),
|
|
1804
|
+
onMouseEnter: (e) => {
|
|
1805
|
+
if (!isSelected && !isDayDisabled && isCurrentMonth) {
|
|
1806
|
+
e.currentTarget.style.backgroundColor = "#f8f8f8";
|
|
1807
|
+
}
|
|
1808
|
+
},
|
|
1809
|
+
onMouseLeave: (e) => {
|
|
1810
|
+
if (!isSelected) {
|
|
1811
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
1812
|
+
}
|
|
1813
|
+
},
|
|
1814
|
+
"aria-label": (0, import_date_fns.format)(day, "MMMM d, yyyy"),
|
|
1815
|
+
"aria-selected": isSelected,
|
|
1816
|
+
children: (0, import_date_fns.format)(day, "d")
|
|
1817
|
+
},
|
|
1818
|
+
day.toISOString()
|
|
1819
|
+
);
|
|
1820
|
+
}) }),
|
|
1821
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: footerStyles, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1822
|
+
"button",
|
|
1823
|
+
{
|
|
1824
|
+
type: "button",
|
|
1825
|
+
onClick: handleTodayClick,
|
|
1826
|
+
style: todayButtonStyles,
|
|
1827
|
+
onMouseEnter: (e) => {
|
|
1828
|
+
e.currentTarget.style.backgroundColor = "#f8f8f8";
|
|
1829
|
+
},
|
|
1830
|
+
onMouseLeave: (e) => {
|
|
1831
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
1832
|
+
},
|
|
1833
|
+
children: "Today"
|
|
1834
|
+
}
|
|
1835
|
+
) })
|
|
1836
|
+
]
|
|
1837
|
+
}
|
|
1838
|
+
) })
|
|
1839
|
+
] }),
|
|
1840
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { ...helperTextStyles4, color: "#e02f1d" }, children: error }),
|
|
1841
|
+
!error && helperText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: helperTextStyles4, children: helperText })
|
|
1842
|
+
]
|
|
1843
|
+
}
|
|
1844
|
+
);
|
|
1845
|
+
}
|
|
1846
|
+
);
|
|
1847
|
+
DatePicker.displayName = "DatePicker";
|
|
1848
|
+
|
|
1849
|
+
// src/Toast/Toast.tsx
|
|
1850
|
+
var React10 = __toESM(require("react"));
|
|
1851
|
+
var import_clsx10 = require("clsx");
|
|
1852
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1853
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1854
|
+
var baseToastStyles = {
|
|
1855
|
+
width: "360px",
|
|
1856
|
+
padding: "16px",
|
|
1857
|
+
borderRadius: "8px",
|
|
1858
|
+
border: "1px solid",
|
|
1859
|
+
display: "flex",
|
|
1860
|
+
alignItems: "center",
|
|
1861
|
+
gap: "12px",
|
|
1862
|
+
boxShadow: "0px 4px 12px 0px rgba(32, 32, 32, 0.08)",
|
|
1863
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
1864
|
+
};
|
|
1865
|
+
var messageStyles = {
|
|
1866
|
+
fontSize: "13px",
|
|
1867
|
+
fontWeight: 600,
|
|
1868
|
+
flex: 1
|
|
1869
|
+
};
|
|
1870
|
+
var closeButtonStyles = {
|
|
1871
|
+
width: "24px",
|
|
1872
|
+
height: "24px",
|
|
1873
|
+
borderRadius: "50%",
|
|
1874
|
+
border: "none",
|
|
1875
|
+
background: "transparent",
|
|
1876
|
+
cursor: "pointer",
|
|
1877
|
+
display: "flex",
|
|
1878
|
+
alignItems: "center",
|
|
1879
|
+
justifyContent: "center",
|
|
1880
|
+
flexShrink: 0,
|
|
1881
|
+
transition: "background-color 0.2s ease-in-out"
|
|
1882
|
+
};
|
|
1883
|
+
var variantConfig = {
|
|
1884
|
+
information: {
|
|
1885
|
+
backgroundColor: "#f5fbff",
|
|
1886
|
+
borderColor: "#2c8bca",
|
|
1887
|
+
textColor: "#053a61",
|
|
1888
|
+
icon: import_lucide_react4.Info,
|
|
1889
|
+
iconColor: "#2c8bca",
|
|
1890
|
+
closeHoverBg: "#e0f3ff"
|
|
1891
|
+
},
|
|
1892
|
+
danger: {
|
|
1893
|
+
backgroundColor: "#fff5f5",
|
|
1894
|
+
borderColor: "#c93232",
|
|
1895
|
+
textColor: "#610202",
|
|
1896
|
+
icon: import_lucide_react4.AlertCircle,
|
|
1897
|
+
iconColor: "#c93232",
|
|
1898
|
+
closeHoverBg: "#ffe0e0"
|
|
1899
|
+
},
|
|
1900
|
+
warning: {
|
|
1901
|
+
backgroundColor: "#fffaf5",
|
|
1902
|
+
borderColor: "#e4720d",
|
|
1903
|
+
textColor: "#611f00",
|
|
1904
|
+
icon: import_lucide_react4.AlertTriangle,
|
|
1905
|
+
iconColor: "#e4720d",
|
|
1906
|
+
closeHoverBg: "#ffedd5"
|
|
1907
|
+
},
|
|
1908
|
+
success: {
|
|
1909
|
+
backgroundColor: "#f0faf3",
|
|
1910
|
+
borderColor: "#5ec171",
|
|
1911
|
+
textColor: "#024002",
|
|
1912
|
+
icon: import_lucide_react4.CheckCircle,
|
|
1913
|
+
iconColor: "#5ec171",
|
|
1914
|
+
closeHoverBg: "#d9f2df"
|
|
1915
|
+
},
|
|
1916
|
+
caution: {
|
|
1917
|
+
backgroundColor: "#fffdf5",
|
|
1918
|
+
borderColor: "#edae06",
|
|
1919
|
+
textColor: "#613f00",
|
|
1920
|
+
icon: import_lucide_react4.AlertOctagon,
|
|
1921
|
+
iconColor: "#edae06",
|
|
1922
|
+
closeHoverBg: "#fff8d5"
|
|
1923
|
+
}
|
|
1924
|
+
};
|
|
1925
|
+
var Toast = React10.forwardRef(
|
|
1926
|
+
({
|
|
1927
|
+
variant,
|
|
1928
|
+
message,
|
|
1929
|
+
onClose,
|
|
1930
|
+
className,
|
|
1931
|
+
style,
|
|
1932
|
+
"data-testid": dataTestId
|
|
1933
|
+
}, ref) => {
|
|
1934
|
+
const [isCloseHovered, setIsCloseHovered] = React10.useState(false);
|
|
1935
|
+
const config = variantConfig[variant];
|
|
1936
|
+
const IconComponent = config.icon;
|
|
1937
|
+
const toastStyle = {
|
|
1938
|
+
...baseToastStyles,
|
|
1939
|
+
backgroundColor: config.backgroundColor,
|
|
1940
|
+
borderColor: config.borderColor,
|
|
1941
|
+
...style
|
|
1942
|
+
};
|
|
1943
|
+
const closeStyle = {
|
|
1944
|
+
...closeButtonStyles,
|
|
1945
|
+
...isCloseHovered && { backgroundColor: config.closeHoverBg }
|
|
1946
|
+
};
|
|
1947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1948
|
+
"div",
|
|
1949
|
+
{
|
|
1950
|
+
ref,
|
|
1951
|
+
className: (0, import_clsx10.clsx)("arbor-toast", `arbor-toast-${variant}`, className),
|
|
1952
|
+
style: toastStyle,
|
|
1953
|
+
"data-testid": dataTestId,
|
|
1954
|
+
role: "alert",
|
|
1955
|
+
"aria-live": "polite",
|
|
1956
|
+
children: [
|
|
1957
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconComponent, { size: 16, color: config.iconColor, style: { flexShrink: 0 } }),
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { ...messageStyles, color: config.textColor }, children: message }),
|
|
1959
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1960
|
+
"button",
|
|
1961
|
+
{
|
|
1962
|
+
onClick: onClose,
|
|
1963
|
+
onMouseEnter: () => setIsCloseHovered(true),
|
|
1964
|
+
onMouseLeave: () => setIsCloseHovered(false),
|
|
1965
|
+
style: closeStyle,
|
|
1966
|
+
"aria-label": "Close notification",
|
|
1967
|
+
type: "button",
|
|
1968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: "18px", lineHeight: 1, color: "#595959", fontWeight: "bold" }, children: "\xD7" })
|
|
1969
|
+
}
|
|
1970
|
+
)
|
|
1971
|
+
]
|
|
1972
|
+
}
|
|
1973
|
+
);
|
|
1974
|
+
}
|
|
1975
|
+
);
|
|
1976
|
+
Toast.displayName = "Toast";
|
|
1977
|
+
|
|
1978
|
+
// src/Tooltip/Tooltip.tsx
|
|
1979
|
+
var React11 = __toESM(require("react"));
|
|
1980
|
+
var import_clsx11 = require("clsx");
|
|
1981
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1982
|
+
var tooltipStyles = {
|
|
1983
|
+
position: "absolute",
|
|
1984
|
+
bottom: "calc(100% + 8px)",
|
|
1985
|
+
left: "50%",
|
|
1986
|
+
transform: "translateX(-50%)",
|
|
1987
|
+
backgroundColor: "#2f2f2f",
|
|
1988
|
+
color: "#ffffff",
|
|
1989
|
+
padding: "12px",
|
|
1990
|
+
borderRadius: "8px",
|
|
1991
|
+
boxShadow: "0px 4px 12px 0px rgba(32, 32, 32, 0.08)",
|
|
1992
|
+
fontSize: "13px",
|
|
1993
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
1994
|
+
fontWeight: 400,
|
|
1995
|
+
lineHeight: 1.5,
|
|
1996
|
+
whiteSpace: "nowrap",
|
|
1997
|
+
pointerEvents: "none",
|
|
1998
|
+
zIndex: 1e3,
|
|
1999
|
+
opacity: 0,
|
|
2000
|
+
transition: "opacity 0.2s ease-in-out"
|
|
2001
|
+
};
|
|
2002
|
+
var wrapperStyles4 = {
|
|
2003
|
+
position: "relative",
|
|
2004
|
+
display: "inline-block"
|
|
2005
|
+
};
|
|
2006
|
+
var Tooltip = React11.forwardRef(
|
|
2007
|
+
({
|
|
2008
|
+
content,
|
|
2009
|
+
children,
|
|
2010
|
+
className,
|
|
2011
|
+
style,
|
|
2012
|
+
"data-testid": dataTestId
|
|
2013
|
+
}, ref) => {
|
|
2014
|
+
const [isVisible, setIsVisible] = React11.useState(false);
|
|
2015
|
+
const visibleTooltipStyles = {
|
|
2016
|
+
...tooltipStyles,
|
|
2017
|
+
opacity: isVisible ? 1 : 0,
|
|
2018
|
+
...style
|
|
2019
|
+
};
|
|
2020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2021
|
+
"div",
|
|
2022
|
+
{
|
|
2023
|
+
ref,
|
|
2024
|
+
style: wrapperStyles4,
|
|
2025
|
+
onMouseEnter: () => setIsVisible(true),
|
|
2026
|
+
onMouseLeave: () => setIsVisible(false),
|
|
2027
|
+
"data-testid": dataTestId,
|
|
2028
|
+
children: [
|
|
2029
|
+
children,
|
|
2030
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2031
|
+
"div",
|
|
2032
|
+
{
|
|
2033
|
+
className: (0, import_clsx11.clsx)("arbor-tooltip", className),
|
|
2034
|
+
style: visibleTooltipStyles,
|
|
2035
|
+
role: "tooltip",
|
|
2036
|
+
"aria-hidden": !isVisible,
|
|
2037
|
+
children: content
|
|
2038
|
+
}
|
|
2039
|
+
)
|
|
2040
|
+
]
|
|
2041
|
+
}
|
|
2042
|
+
);
|
|
2043
|
+
}
|
|
2044
|
+
);
|
|
2045
|
+
Tooltip.displayName = "Tooltip";
|
|
2046
|
+
|
|
2047
|
+
// src/Toggle/Toggle.tsx
|
|
2048
|
+
var React12 = __toESM(require("react"));
|
|
2049
|
+
var import_clsx12 = require("clsx");
|
|
2050
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2051
|
+
var toggleContainerStyles = {
|
|
2052
|
+
width: "40px",
|
|
2053
|
+
height: "24px",
|
|
2054
|
+
borderRadius: "16px",
|
|
2055
|
+
border: "1px solid",
|
|
2056
|
+
position: "relative",
|
|
2057
|
+
cursor: "pointer",
|
|
2058
|
+
transition: "all 0.2s ease-in-out"
|
|
2059
|
+
};
|
|
2060
|
+
var knobStyles = {
|
|
2061
|
+
width: "18px",
|
|
2062
|
+
height: "18px",
|
|
2063
|
+
borderRadius: "50%",
|
|
2064
|
+
position: "absolute",
|
|
2065
|
+
top: "50%",
|
|
2066
|
+
transform: "translateY(-50%)",
|
|
2067
|
+
transition: "all 0.2s ease-in-out"
|
|
2068
|
+
};
|
|
2069
|
+
var labelStyles7 = {
|
|
2070
|
+
fontSize: "13px",
|
|
2071
|
+
color: "#2f2f2f",
|
|
2072
|
+
cursor: "pointer",
|
|
2073
|
+
userSelect: "none",
|
|
2074
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
2075
|
+
};
|
|
2076
|
+
var wrapperStyles5 = {
|
|
2077
|
+
display: "flex",
|
|
2078
|
+
alignItems: "center",
|
|
2079
|
+
gap: "8px"
|
|
2080
|
+
};
|
|
2081
|
+
var Toggle = React12.forwardRef(
|
|
2082
|
+
({
|
|
2083
|
+
label,
|
|
2084
|
+
checked = false,
|
|
2085
|
+
onChange,
|
|
2086
|
+
disabled = false,
|
|
2087
|
+
className,
|
|
2088
|
+
style,
|
|
2089
|
+
"data-testid": dataTestId,
|
|
2090
|
+
name,
|
|
2091
|
+
value
|
|
2092
|
+
}, ref) => {
|
|
2093
|
+
const [isFocused, setIsFocused] = React12.useState(false);
|
|
2094
|
+
const [isHovered, setIsHovered] = React12.useState(false);
|
|
2095
|
+
const [isActive, setIsActive] = React12.useState(false);
|
|
2096
|
+
const toggleId = React12.useId();
|
|
2097
|
+
const handleChange = (e) => {
|
|
2098
|
+
if (!disabled) {
|
|
2099
|
+
onChange?.(e.target.checked);
|
|
2100
|
+
}
|
|
2101
|
+
};
|
|
2102
|
+
const getContainerStyles = () => {
|
|
2103
|
+
if (disabled) {
|
|
2104
|
+
return {
|
|
2105
|
+
...toggleContainerStyles,
|
|
2106
|
+
backgroundColor: checked ? "#d1d1d1" : "#ffffff",
|
|
2107
|
+
borderColor: checked ? "#d1d1d1" : "#d1d1d1",
|
|
2108
|
+
cursor: "not-allowed"
|
|
2109
|
+
};
|
|
2110
|
+
}
|
|
2111
|
+
if (checked) {
|
|
2112
|
+
if (isActive && isFocused) {
|
|
2113
|
+
return {
|
|
2114
|
+
...toggleContainerStyles,
|
|
2115
|
+
backgroundColor: "#024002",
|
|
2116
|
+
borderColor: "#024002",
|
|
2117
|
+
boxShadow: "0px 0px 0px 3px #3cad51"
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
if (isActive) {
|
|
2121
|
+
return {
|
|
2122
|
+
...toggleContainerStyles,
|
|
2123
|
+
backgroundColor: "#024002",
|
|
2124
|
+
borderColor: "#024002"
|
|
2125
|
+
};
|
|
2126
|
+
}
|
|
2127
|
+
if (isHovered) {
|
|
2128
|
+
return {
|
|
2129
|
+
...toggleContainerStyles,
|
|
2130
|
+
backgroundColor: "#005700",
|
|
2131
|
+
borderColor: "#005700"
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
if (isFocused) {
|
|
2135
|
+
return {
|
|
2136
|
+
...toggleContainerStyles,
|
|
2137
|
+
backgroundColor: "#0b800b",
|
|
2138
|
+
borderColor: "#0b800b",
|
|
2139
|
+
boxShadow: "0px 0px 0px 3px #3cad51"
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
return {
|
|
2143
|
+
...toggleContainerStyles,
|
|
2144
|
+
backgroundColor: "#0b800b",
|
|
2145
|
+
borderColor: "#0b800b"
|
|
2146
|
+
};
|
|
2147
|
+
} else {
|
|
2148
|
+
if (isActive && isFocused) {
|
|
2149
|
+
return {
|
|
2150
|
+
...toggleContainerStyles,
|
|
2151
|
+
backgroundColor: "#efefef",
|
|
2152
|
+
borderColor: "#2f2f2f",
|
|
2153
|
+
boxShadow: "0px 0px 0px 3px #3cad51"
|
|
2154
|
+
};
|
|
2155
|
+
}
|
|
2156
|
+
if (isActive) {
|
|
2157
|
+
return {
|
|
2158
|
+
...toggleContainerStyles,
|
|
2159
|
+
backgroundColor: "#efefef",
|
|
2160
|
+
borderColor: "#2f2f2f"
|
|
2161
|
+
};
|
|
2162
|
+
}
|
|
2163
|
+
if (isHovered) {
|
|
2164
|
+
return {
|
|
2165
|
+
...toggleContainerStyles,
|
|
2166
|
+
backgroundColor: "#f8f8f8",
|
|
2167
|
+
borderColor: "#595959"
|
|
2168
|
+
};
|
|
2169
|
+
}
|
|
2170
|
+
if (isFocused) {
|
|
2171
|
+
return {
|
|
2172
|
+
...toggleContainerStyles,
|
|
2173
|
+
backgroundColor: "#ffffff",
|
|
2174
|
+
borderColor: "#7e7e7e",
|
|
2175
|
+
boxShadow: "0px 0px 0px 3px #3cad51"
|
|
2176
|
+
};
|
|
2177
|
+
}
|
|
2178
|
+
return {
|
|
2179
|
+
...toggleContainerStyles,
|
|
2180
|
+
backgroundColor: "#ffffff",
|
|
2181
|
+
borderColor: "#7e7e7e"
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2184
|
+
};
|
|
2185
|
+
const getKnobStyles = () => {
|
|
2186
|
+
const baseKnob = {
|
|
2187
|
+
...knobStyles,
|
|
2188
|
+
left: checked ? "18px" : "2px"
|
|
2189
|
+
};
|
|
2190
|
+
if (disabled) {
|
|
2191
|
+
return {
|
|
2192
|
+
...baseKnob,
|
|
2193
|
+
backgroundColor: checked ? "#f8f8f8" : "#d1d1d1"
|
|
2194
|
+
};
|
|
2195
|
+
}
|
|
2196
|
+
if (checked) {
|
|
2197
|
+
if (isActive) {
|
|
2198
|
+
return {
|
|
2199
|
+
...baseKnob,
|
|
2200
|
+
backgroundColor: "#efefef"
|
|
2201
|
+
};
|
|
2202
|
+
}
|
|
2203
|
+
if (isHovered) {
|
|
2204
|
+
return {
|
|
2205
|
+
...baseKnob,
|
|
2206
|
+
backgroundColor: "#f8f8f8"
|
|
2207
|
+
};
|
|
2208
|
+
}
|
|
2209
|
+
return {
|
|
2210
|
+
...baseKnob,
|
|
2211
|
+
backgroundColor: "#ffffff"
|
|
2212
|
+
};
|
|
2213
|
+
} else {
|
|
2214
|
+
if (isActive) {
|
|
2215
|
+
return {
|
|
2216
|
+
...baseKnob,
|
|
2217
|
+
backgroundColor: "#2f2f2f"
|
|
2218
|
+
};
|
|
2219
|
+
}
|
|
2220
|
+
if (isHovered) {
|
|
2221
|
+
return {
|
|
2222
|
+
...baseKnob,
|
|
2223
|
+
backgroundColor: "#595959"
|
|
2224
|
+
};
|
|
2225
|
+
}
|
|
2226
|
+
return {
|
|
2227
|
+
...baseKnob,
|
|
2228
|
+
backgroundColor: "#7e7e7e"
|
|
2229
|
+
};
|
|
2230
|
+
}
|
|
2231
|
+
};
|
|
2232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2233
|
+
"div",
|
|
2234
|
+
{
|
|
2235
|
+
className: (0, import_clsx12.clsx)("arbor-toggle-wrapper", className),
|
|
2236
|
+
style: { ...wrapperStyles5, ...style },
|
|
2237
|
+
"data-testid": dataTestId,
|
|
2238
|
+
children: [
|
|
2239
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2240
|
+
"input",
|
|
2241
|
+
{
|
|
2242
|
+
ref,
|
|
2243
|
+
id: toggleId,
|
|
2244
|
+
type: "checkbox",
|
|
2245
|
+
checked,
|
|
2246
|
+
onChange: handleChange,
|
|
2247
|
+
onFocus: () => setIsFocused(true),
|
|
2248
|
+
onBlur: () => setIsFocused(false),
|
|
2249
|
+
disabled,
|
|
2250
|
+
name,
|
|
2251
|
+
value,
|
|
2252
|
+
style: {
|
|
2253
|
+
position: "absolute",
|
|
2254
|
+
opacity: 0,
|
|
2255
|
+
width: 0,
|
|
2256
|
+
height: 0
|
|
2257
|
+
},
|
|
2258
|
+
"aria-checked": checked
|
|
2259
|
+
}
|
|
2260
|
+
),
|
|
2261
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2262
|
+
"label",
|
|
2263
|
+
{
|
|
2264
|
+
htmlFor: toggleId,
|
|
2265
|
+
onMouseEnter: () => !disabled && setIsHovered(true),
|
|
2266
|
+
onMouseLeave: () => !disabled && setIsHovered(false),
|
|
2267
|
+
onMouseDown: () => !disabled && setIsActive(true),
|
|
2268
|
+
onMouseUp: () => !disabled && setIsActive(false),
|
|
2269
|
+
style: {
|
|
2270
|
+
display: "flex",
|
|
2271
|
+
alignItems: "center",
|
|
2272
|
+
gap: "8px",
|
|
2273
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
2274
|
+
},
|
|
2275
|
+
children: [
|
|
2276
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: getContainerStyles(), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: getKnobStyles() }) }),
|
|
2277
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2278
|
+
"span",
|
|
2279
|
+
{
|
|
2280
|
+
style: {
|
|
2281
|
+
...labelStyles7,
|
|
2282
|
+
color: disabled ? "#7e7e7e" : "#2f2f2f",
|
|
2283
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
2284
|
+
},
|
|
2285
|
+
children: label
|
|
2286
|
+
}
|
|
2287
|
+
)
|
|
2288
|
+
]
|
|
2289
|
+
}
|
|
2290
|
+
)
|
|
2291
|
+
]
|
|
2292
|
+
}
|
|
2293
|
+
);
|
|
2294
|
+
}
|
|
2295
|
+
);
|
|
2296
|
+
Toggle.displayName = "Toggle";
|
|
2297
|
+
|
|
2298
|
+
// src/TextArea/TextArea.tsx
|
|
2299
|
+
var React13 = __toESM(require("react"));
|
|
2300
|
+
var import_clsx13 = require("clsx");
|
|
2301
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2302
|
+
var labelStyles8 = {
|
|
2303
|
+
fontSize: "13px",
|
|
2304
|
+
fontWeight: 600,
|
|
2305
|
+
color: "#2f2f2f",
|
|
2306
|
+
marginBottom: "0px",
|
|
2307
|
+
display: "block",
|
|
2308
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
2309
|
+
};
|
|
2310
|
+
var textareaWrapperStyles = {
|
|
2311
|
+
position: "relative",
|
|
2312
|
+
width: "100%"
|
|
2313
|
+
};
|
|
2314
|
+
var textareaStyles = {
|
|
2315
|
+
width: "100%",
|
|
2316
|
+
minHeight: "72px",
|
|
2317
|
+
padding: "8px",
|
|
2318
|
+
fontSize: "13px",
|
|
2319
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
2320
|
+
border: "1px solid",
|
|
2321
|
+
borderRadius: "8px",
|
|
2322
|
+
outline: "none",
|
|
2323
|
+
resize: "vertical",
|
|
2324
|
+
transition: "all 0.2s ease-in-out",
|
|
2325
|
+
lineHeight: "1.5"
|
|
2326
|
+
};
|
|
2327
|
+
var helperTextStyles5 = {
|
|
2328
|
+
fontSize: "13px",
|
|
2329
|
+
marginTop: "4px",
|
|
2330
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
2331
|
+
};
|
|
2332
|
+
var TextArea = React13.forwardRef(
|
|
2333
|
+
({
|
|
2334
|
+
label,
|
|
2335
|
+
placeholder,
|
|
2336
|
+
value,
|
|
2337
|
+
onChange,
|
|
2338
|
+
state = "default",
|
|
2339
|
+
error,
|
|
2340
|
+
helperText,
|
|
2341
|
+
disabled = false,
|
|
2342
|
+
rows = 3,
|
|
2343
|
+
className,
|
|
2344
|
+
style,
|
|
2345
|
+
"data-testid": dataTestId,
|
|
2346
|
+
name
|
|
2347
|
+
}, ref) => {
|
|
2348
|
+
const [isFocused, setIsFocused] = React13.useState(false);
|
|
2349
|
+
const [isHovered, setIsHovered] = React13.useState(false);
|
|
2350
|
+
const textareaId = React13.useId();
|
|
2351
|
+
const actualState = error ? "error" : state;
|
|
2352
|
+
const getBorderColor = () => {
|
|
2353
|
+
if (disabled) {
|
|
2354
|
+
return "#dfdfdf";
|
|
2355
|
+
}
|
|
2356
|
+
if (actualState === "error") {
|
|
2357
|
+
return "#c93232";
|
|
2358
|
+
}
|
|
2359
|
+
if (actualState === "success") {
|
|
2360
|
+
return "#0e8a0e";
|
|
2361
|
+
}
|
|
2362
|
+
if (isFocused) {
|
|
2363
|
+
return "#0e8a0e";
|
|
2364
|
+
}
|
|
2365
|
+
if (isHovered) {
|
|
2366
|
+
return "#7e7e7e";
|
|
2367
|
+
}
|
|
2368
|
+
return "#dfdfdf";
|
|
2369
|
+
};
|
|
2370
|
+
const getBackgroundColor = () => {
|
|
2371
|
+
if (disabled) {
|
|
2372
|
+
return "#efefef";
|
|
2373
|
+
}
|
|
2374
|
+
return "#ffffff";
|
|
2375
|
+
};
|
|
2376
|
+
const getBoxShadow = () => {
|
|
2377
|
+
if (isFocused && !disabled) {
|
|
2378
|
+
if (actualState === "error") {
|
|
2379
|
+
return "0px 0px 0px 3px rgba(201, 50, 50, 0.2)";
|
|
2380
|
+
}
|
|
2381
|
+
return "0px 0px 0px 3px #3cad51";
|
|
2382
|
+
}
|
|
2383
|
+
return void 0;
|
|
2384
|
+
};
|
|
2385
|
+
const textareaStylesCombined = {
|
|
2386
|
+
...textareaStyles,
|
|
2387
|
+
borderColor: getBorderColor(),
|
|
2388
|
+
backgroundColor: getBackgroundColor(),
|
|
2389
|
+
boxShadow: getBoxShadow(),
|
|
2390
|
+
color: disabled ? "#7e7e7e" : "#2f2f2f",
|
|
2391
|
+
cursor: disabled ? "not-allowed" : "text"
|
|
2392
|
+
};
|
|
2393
|
+
const helperColor = error ? "#c93232" : actualState === "success" ? "#0e8a0e" : "#595959";
|
|
2394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2395
|
+
"div",
|
|
2396
|
+
{
|
|
2397
|
+
className: (0, import_clsx13.clsx)("arbor-textarea-wrapper", className),
|
|
2398
|
+
style,
|
|
2399
|
+
"data-testid": dataTestId,
|
|
2400
|
+
children: [
|
|
2401
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: textareaId, style: labelStyles8, children: label }),
|
|
2402
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { height: "8px" } }),
|
|
2403
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: textareaWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2404
|
+
"textarea",
|
|
2405
|
+
{
|
|
2406
|
+
ref,
|
|
2407
|
+
id: textareaId,
|
|
2408
|
+
name,
|
|
2409
|
+
placeholder,
|
|
2410
|
+
value,
|
|
2411
|
+
onChange,
|
|
2412
|
+
disabled,
|
|
2413
|
+
rows,
|
|
2414
|
+
onFocus: () => setIsFocused(true),
|
|
2415
|
+
onBlur: () => setIsFocused(false),
|
|
2416
|
+
onMouseEnter: () => setIsHovered(true),
|
|
2417
|
+
onMouseLeave: () => setIsHovered(false),
|
|
2418
|
+
style: textareaStylesCombined
|
|
2419
|
+
}
|
|
2420
|
+
) }),
|
|
2421
|
+
(error || helperText) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { ...helperTextStyles5, color: helperColor }, role: error ? "alert" : void 0, children: error || helperText })
|
|
2422
|
+
]
|
|
2423
|
+
}
|
|
2424
|
+
);
|
|
2425
|
+
}
|
|
2426
|
+
);
|
|
2427
|
+
TextArea.displayName = "TextArea";
|
|
2428
|
+
|
|
2429
|
+
// src/Tabs/Tabs.tsx
|
|
2430
|
+
var React14 = __toESM(require("react"));
|
|
2431
|
+
var import_clsx14 = require("clsx");
|
|
2432
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2433
|
+
var tabsContainerStyles = {
|
|
2434
|
+
display: "flex",
|
|
2435
|
+
alignItems: "flex-start",
|
|
2436
|
+
gap: "12px",
|
|
2437
|
+
borderBottom: "1px solid #f8f8f8",
|
|
2438
|
+
paddingBottom: "1px",
|
|
2439
|
+
width: "100%"
|
|
2440
|
+
};
|
|
2441
|
+
var tabItemWrapperStyles = {
|
|
2442
|
+
display: "flex",
|
|
2443
|
+
flexDirection: "column",
|
|
2444
|
+
alignItems: "center",
|
|
2445
|
+
cursor: "pointer",
|
|
2446
|
+
position: "relative"
|
|
2447
|
+
};
|
|
2448
|
+
var tabItemStyles = {
|
|
2449
|
+
display: "flex",
|
|
2450
|
+
alignItems: "center",
|
|
2451
|
+
justifyContent: "center",
|
|
2452
|
+
gap: "8px",
|
|
2453
|
+
padding: "8px 12px",
|
|
2454
|
+
borderRadius: "8px",
|
|
2455
|
+
fontSize: "14px",
|
|
2456
|
+
lineHeight: "1.5",
|
|
2457
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
2458
|
+
outline: "none",
|
|
2459
|
+
transition: "all 0.2s ease-in-out",
|
|
2460
|
+
userSelect: "none"
|
|
2461
|
+
};
|
|
2462
|
+
var underlineStyles = {
|
|
2463
|
+
width: "100%",
|
|
2464
|
+
height: "2px",
|
|
2465
|
+
borderTopLeftRadius: "4px",
|
|
2466
|
+
borderTopRightRadius: "4px",
|
|
2467
|
+
transition: "background-color 0.2s ease-in-out"
|
|
2468
|
+
};
|
|
2469
|
+
var Tabs = React14.forwardRef(
|
|
2470
|
+
({
|
|
2471
|
+
tabs,
|
|
2472
|
+
activeTab,
|
|
2473
|
+
onTabChange,
|
|
2474
|
+
className,
|
|
2475
|
+
style,
|
|
2476
|
+
"data-testid": dataTestId
|
|
2477
|
+
}, ref) => {
|
|
2478
|
+
const [hoveredTab, setHoveredTab] = React14.useState(null);
|
|
2479
|
+
const [focusedTab, setFocusedTab] = React14.useState(null);
|
|
2480
|
+
const currentActiveTab = activeTab || (tabs.length > 0 ? tabs[0].value : "");
|
|
2481
|
+
const handleTabClick = (value) => {
|
|
2482
|
+
onTabChange?.(value);
|
|
2483
|
+
};
|
|
2484
|
+
const handleKeyDown = (e, value) => {
|
|
2485
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2486
|
+
e.preventDefault();
|
|
2487
|
+
handleTabClick(value);
|
|
2488
|
+
}
|
|
2489
|
+
};
|
|
2490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2491
|
+
"div",
|
|
2492
|
+
{
|
|
2493
|
+
ref,
|
|
2494
|
+
className: (0, import_clsx14.clsx)("arbor-tabs", className),
|
|
2495
|
+
style: { ...tabsContainerStyles, ...style },
|
|
2496
|
+
"data-testid": dataTestId,
|
|
2497
|
+
role: "tablist",
|
|
2498
|
+
children: tabs.map((tab) => {
|
|
2499
|
+
const isActive = tab.value === currentActiveTab;
|
|
2500
|
+
const isHovered = tab.value === hoveredTab;
|
|
2501
|
+
const isFocused = tab.value === focusedTab;
|
|
2502
|
+
const getTextColor = () => {
|
|
2503
|
+
if (isActive) {
|
|
2504
|
+
return "#0e8a0e";
|
|
2505
|
+
}
|
|
2506
|
+
if (isHovered) {
|
|
2507
|
+
return "#202020";
|
|
2508
|
+
}
|
|
2509
|
+
return "#2f2f2f";
|
|
2510
|
+
};
|
|
2511
|
+
const getFontWeight = () => {
|
|
2512
|
+
return isActive ? 600 : 500;
|
|
2513
|
+
};
|
|
2514
|
+
const getUnderlineColor = () => {
|
|
2515
|
+
if (isActive) {
|
|
2516
|
+
return "#0e8a0e";
|
|
2517
|
+
}
|
|
2518
|
+
if (isHovered) {
|
|
2519
|
+
return "#d1d1d1";
|
|
2520
|
+
}
|
|
2521
|
+
return "transparent";
|
|
2522
|
+
};
|
|
2523
|
+
const getBoxShadow = () => {
|
|
2524
|
+
if (isFocused) {
|
|
2525
|
+
return "0px 0px 0px 3px #3cad51";
|
|
2526
|
+
}
|
|
2527
|
+
return void 0;
|
|
2528
|
+
};
|
|
2529
|
+
const tabItemStylesCombined = {
|
|
2530
|
+
...tabItemStyles,
|
|
2531
|
+
color: getTextColor(),
|
|
2532
|
+
fontWeight: getFontWeight(),
|
|
2533
|
+
boxShadow: getBoxShadow(),
|
|
2534
|
+
backgroundColor: isFocused ? "rgba(255, 255, 255, 0.01)" : "transparent"
|
|
2535
|
+
};
|
|
2536
|
+
const underlineStylesCombined = {
|
|
2537
|
+
...underlineStyles,
|
|
2538
|
+
backgroundColor: getUnderlineColor()
|
|
2539
|
+
};
|
|
2540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2541
|
+
"div",
|
|
2542
|
+
{
|
|
2543
|
+
style: tabItemWrapperStyles,
|
|
2544
|
+
onMouseEnter: () => setHoveredTab(tab.value),
|
|
2545
|
+
onMouseLeave: () => setHoveredTab(null),
|
|
2546
|
+
children: [
|
|
2547
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2548
|
+
"div",
|
|
2549
|
+
{
|
|
2550
|
+
role: "tab",
|
|
2551
|
+
"aria-selected": isActive,
|
|
2552
|
+
tabIndex: isActive ? 0 : -1,
|
|
2553
|
+
onClick: () => handleTabClick(tab.value),
|
|
2554
|
+
onKeyDown: (e) => handleKeyDown(e, tab.value),
|
|
2555
|
+
onFocus: () => setFocusedTab(tab.value),
|
|
2556
|
+
onBlur: () => setFocusedTab(null),
|
|
2557
|
+
style: tabItemStylesCombined,
|
|
2558
|
+
children: [
|
|
2559
|
+
tab.icon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { display: "flex", alignItems: "center" }, children: tab.icon }),
|
|
2560
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: tab.label })
|
|
2561
|
+
]
|
|
2562
|
+
}
|
|
2563
|
+
),
|
|
2564
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: underlineStylesCombined })
|
|
2565
|
+
]
|
|
2566
|
+
},
|
|
2567
|
+
tab.value
|
|
2568
|
+
);
|
|
2569
|
+
})
|
|
2570
|
+
}
|
|
2571
|
+
);
|
|
2572
|
+
}
|
|
2573
|
+
);
|
|
2574
|
+
Tabs.displayName = "Tabs";
|
|
2575
|
+
|
|
2576
|
+
// src/Banner/Banner.tsx
|
|
2577
|
+
var React15 = __toESM(require("react"));
|
|
2578
|
+
var import_clsx15 = require("clsx");
|
|
2579
|
+
var import_lucide_react5 = require("lucide-react");
|
|
2580
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2581
|
+
var containerStyles2 = {
|
|
2582
|
+
display: "flex",
|
|
2583
|
+
alignItems: "flex-start",
|
|
2584
|
+
padding: "16px",
|
|
2585
|
+
borderRadius: "8px",
|
|
2586
|
+
border: "1px solid",
|
|
2587
|
+
width: "100%",
|
|
2588
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
2589
|
+
};
|
|
2590
|
+
var iconContainerStyles = {
|
|
2591
|
+
flexShrink: 0,
|
|
2592
|
+
width: "24px",
|
|
2593
|
+
height: "24px",
|
|
2594
|
+
display: "flex",
|
|
2595
|
+
alignItems: "center",
|
|
2596
|
+
justifyContent: "center"
|
|
2597
|
+
};
|
|
2598
|
+
var contentContainerStyles = {
|
|
2599
|
+
flex: 1,
|
|
2600
|
+
display: "flex",
|
|
2601
|
+
flexDirection: "column",
|
|
2602
|
+
minWidth: 0
|
|
2603
|
+
};
|
|
2604
|
+
var titleStyles = {
|
|
2605
|
+
fontSize: "18px",
|
|
2606
|
+
fontWeight: 600,
|
|
2607
|
+
lineHeight: "1.25",
|
|
2608
|
+
marginBottom: "8px"
|
|
2609
|
+
};
|
|
2610
|
+
var messageStyles2 = {
|
|
2611
|
+
fontSize: "13px",
|
|
2612
|
+
fontWeight: 400,
|
|
2613
|
+
lineHeight: "1.5",
|
|
2614
|
+
margin: 0
|
|
2615
|
+
};
|
|
2616
|
+
var actionContainerStyles = {
|
|
2617
|
+
display: "flex",
|
|
2618
|
+
flexDirection: "column",
|
|
2619
|
+
justifyContent: "flex-end",
|
|
2620
|
+
alignItems: "flex-end",
|
|
2621
|
+
alignSelf: "stretch",
|
|
2622
|
+
flexShrink: 0
|
|
2623
|
+
};
|
|
2624
|
+
var actionButtonStyles = {
|
|
2625
|
+
background: "none",
|
|
2626
|
+
border: "none",
|
|
2627
|
+
padding: 0,
|
|
2628
|
+
fontSize: "13px",
|
|
2629
|
+
fontWeight: 600,
|
|
2630
|
+
lineHeight: "1.5",
|
|
2631
|
+
textDecoration: "underline",
|
|
2632
|
+
textUnderlinePosition: "from-font",
|
|
2633
|
+
cursor: "pointer",
|
|
2634
|
+
fontFamily: "inherit"
|
|
2635
|
+
};
|
|
2636
|
+
var closeButtonStyles2 = {
|
|
2637
|
+
background: "none",
|
|
2638
|
+
border: "none",
|
|
2639
|
+
padding: "4px",
|
|
2640
|
+
cursor: "pointer",
|
|
2641
|
+
display: "flex",
|
|
2642
|
+
alignItems: "center",
|
|
2643
|
+
justifyContent: "center",
|
|
2644
|
+
flexShrink: 0,
|
|
2645
|
+
marginLeft: "8px"
|
|
2646
|
+
};
|
|
2647
|
+
var variantConfig2 = {
|
|
2648
|
+
warning: {
|
|
2649
|
+
backgroundColor: "#fffaf5",
|
|
2650
|
+
borderColor: "#e4720d",
|
|
2651
|
+
textColor: "#611f00",
|
|
2652
|
+
actionColor: "#a74102",
|
|
2653
|
+
icon: import_lucide_react5.AlertTriangle
|
|
2654
|
+
},
|
|
2655
|
+
destructive: {
|
|
2656
|
+
backgroundColor: "#fff5f5",
|
|
2657
|
+
borderColor: "#c93232",
|
|
2658
|
+
textColor: "#610202",
|
|
2659
|
+
actionColor: "#920a0a",
|
|
2660
|
+
icon: import_lucide_react5.AlertCircle
|
|
2661
|
+
},
|
|
2662
|
+
information: {
|
|
2663
|
+
backgroundColor: "#f5fbff",
|
|
2664
|
+
borderColor: "#2c8bca",
|
|
2665
|
+
textColor: "#053a61",
|
|
2666
|
+
actionColor: "#024f83",
|
|
2667
|
+
icon: import_lucide_react5.Info
|
|
2668
|
+
},
|
|
2669
|
+
neutral: {
|
|
2670
|
+
backgroundColor: "transparent",
|
|
2671
|
+
borderColor: "#b3b3b3",
|
|
2672
|
+
textColor: "#2f2f2f",
|
|
2673
|
+
actionColor: "#2f2f2f",
|
|
2674
|
+
icon: import_lucide_react5.Info
|
|
2675
|
+
}
|
|
2676
|
+
};
|
|
2677
|
+
var Banner = React15.forwardRef(
|
|
2678
|
+
({
|
|
2679
|
+
variant = "information",
|
|
2680
|
+
title,
|
|
2681
|
+
message,
|
|
2682
|
+
icon = true,
|
|
2683
|
+
actionLabel,
|
|
2684
|
+
onAction,
|
|
2685
|
+
onClose,
|
|
2686
|
+
className,
|
|
2687
|
+
style,
|
|
2688
|
+
"data-testid": dataTestId
|
|
2689
|
+
}, ref) => {
|
|
2690
|
+
const config = variantConfig2[variant];
|
|
2691
|
+
const DefaultIcon = config.icon;
|
|
2692
|
+
const showIcon = icon !== false;
|
|
2693
|
+
const iconElement = icon === true || icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DefaultIcon, { size: 20, strokeWidth: 2 }) : icon;
|
|
2694
|
+
const containerStylesCombined = {
|
|
2695
|
+
...containerStyles2,
|
|
2696
|
+
backgroundColor: config.backgroundColor,
|
|
2697
|
+
borderColor: config.borderColor,
|
|
2698
|
+
color: config.textColor,
|
|
2699
|
+
gap: showIcon ? "16px" : "0px",
|
|
2700
|
+
...style
|
|
2701
|
+
};
|
|
2702
|
+
const titleStylesCombined = {
|
|
2703
|
+
...titleStyles,
|
|
2704
|
+
color: config.textColor
|
|
2705
|
+
};
|
|
2706
|
+
const messageStylesCombined = {
|
|
2707
|
+
...messageStyles2,
|
|
2708
|
+
color: config.textColor
|
|
2709
|
+
};
|
|
2710
|
+
const actionButtonStylesCombined = {
|
|
2711
|
+
...actionButtonStyles,
|
|
2712
|
+
color: config.actionColor
|
|
2713
|
+
};
|
|
2714
|
+
const closeButtonStylesCombined = {
|
|
2715
|
+
...closeButtonStyles2,
|
|
2716
|
+
color: config.textColor
|
|
2717
|
+
};
|
|
2718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2719
|
+
"div",
|
|
2720
|
+
{
|
|
2721
|
+
ref,
|
|
2722
|
+
className: (0, import_clsx15.clsx)("arbor-banner", `arbor-banner--${variant}`, className),
|
|
2723
|
+
style: containerStylesCombined,
|
|
2724
|
+
"data-testid": dataTestId,
|
|
2725
|
+
role: "alert",
|
|
2726
|
+
children: [
|
|
2727
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { ...iconContainerStyles, color: config.textColor }, children: iconElement }),
|
|
2728
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: contentContainerStyles, children: [
|
|
2729
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: titleStylesCombined, children: title }),
|
|
2730
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: messageStylesCombined, children: message })
|
|
2731
|
+
] }),
|
|
2732
|
+
actionLabel && onAction && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: actionContainerStyles, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2733
|
+
"button",
|
|
2734
|
+
{
|
|
2735
|
+
type: "button",
|
|
2736
|
+
onClick: onAction,
|
|
2737
|
+
style: actionButtonStylesCombined,
|
|
2738
|
+
children: actionLabel
|
|
2739
|
+
}
|
|
2740
|
+
) }),
|
|
2741
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2742
|
+
"button",
|
|
2743
|
+
{
|
|
2744
|
+
type: "button",
|
|
2745
|
+
onClick: onClose,
|
|
2746
|
+
style: closeButtonStylesCombined,
|
|
2747
|
+
"aria-label": "Close banner",
|
|
2748
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.X, { size: 20 })
|
|
2749
|
+
}
|
|
2750
|
+
)
|
|
2751
|
+
]
|
|
2752
|
+
}
|
|
2753
|
+
);
|
|
2754
|
+
}
|
|
2755
|
+
);
|
|
2756
|
+
Banner.displayName = "Banner";
|
|
2757
|
+
|
|
2758
|
+
// src/Pagination/Pagination.tsx
|
|
2759
|
+
var React16 = __toESM(require("react"));
|
|
2760
|
+
var import_clsx16 = require("clsx");
|
|
2761
|
+
var import_lucide_react6 = require("lucide-react");
|
|
2762
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2763
|
+
var containerStyles3 = {
|
|
2764
|
+
display: "flex",
|
|
2765
|
+
alignItems: "center",
|
|
2766
|
+
gap: "8px",
|
|
2767
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
2768
|
+
};
|
|
2769
|
+
var buttonStyles3 = {
|
|
2770
|
+
width: "24px",
|
|
2771
|
+
height: "24px",
|
|
2772
|
+
borderRadius: "50%",
|
|
2773
|
+
border: "none",
|
|
2774
|
+
background: "transparent",
|
|
2775
|
+
cursor: "pointer",
|
|
2776
|
+
display: "flex",
|
|
2777
|
+
alignItems: "center",
|
|
2778
|
+
justifyContent: "center",
|
|
2779
|
+
padding: 0,
|
|
2780
|
+
transition: "background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out",
|
|
2781
|
+
flexShrink: 0,
|
|
2782
|
+
WebkitTapHighlightColor: "transparent",
|
|
2783
|
+
outline: "none"
|
|
2784
|
+
};
|
|
2785
|
+
var buttonDisabledStyles = {
|
|
2786
|
+
cursor: "not-allowed",
|
|
2787
|
+
opacity: 0.5
|
|
2788
|
+
};
|
|
2789
|
+
var labelStyles9 = {
|
|
2790
|
+
fontSize: "13px",
|
|
2791
|
+
fontWeight: 600,
|
|
2792
|
+
lineHeight: "1.5",
|
|
2793
|
+
color: "#2f2f2f"
|
|
2794
|
+
};
|
|
2795
|
+
var inputWrapperStyles = {
|
|
2796
|
+
display: "flex",
|
|
2797
|
+
alignItems: "center",
|
|
2798
|
+
gap: "8px"
|
|
2799
|
+
};
|
|
2800
|
+
var inputStyles4 = {
|
|
2801
|
+
width: "60px",
|
|
2802
|
+
paddingTop: "12px",
|
|
2803
|
+
paddingBottom: "12px",
|
|
2804
|
+
paddingLeft: "16px",
|
|
2805
|
+
paddingRight: "16px",
|
|
2806
|
+
fontSize: "13px",
|
|
2807
|
+
fontWeight: 400,
|
|
2808
|
+
lineHeight: "1.5",
|
|
2809
|
+
color: "#2f2f2f",
|
|
2810
|
+
backgroundColor: "white",
|
|
2811
|
+
border: "1px solid #dfdfdf",
|
|
2812
|
+
borderRadius: "8px",
|
|
2813
|
+
fontFamily: "inherit",
|
|
2814
|
+
textAlign: "center",
|
|
2815
|
+
outline: "none"
|
|
2816
|
+
};
|
|
2817
|
+
var inputFocusStyles = {
|
|
2818
|
+
boxShadow: "0px 0px 0px 3px #3cad51"
|
|
2819
|
+
};
|
|
2820
|
+
var textStyles = {
|
|
2821
|
+
fontSize: "13px",
|
|
2822
|
+
fontWeight: 400,
|
|
2823
|
+
lineHeight: "1.5",
|
|
2824
|
+
color: "#2f2f2f"
|
|
2825
|
+
};
|
|
2826
|
+
var Pagination = React16.forwardRef(
|
|
2827
|
+
({
|
|
2828
|
+
currentPage,
|
|
2829
|
+
totalPages,
|
|
2830
|
+
onPageChange,
|
|
2831
|
+
className,
|
|
2832
|
+
style,
|
|
2833
|
+
"data-testid": dataTestId
|
|
2834
|
+
}, ref) => {
|
|
2835
|
+
const [inputValue, setInputValue] = React16.useState(currentPage.toString());
|
|
2836
|
+
const [focusedButton, setFocusedButton] = React16.useState(null);
|
|
2837
|
+
const [hoveredButton, setHoveredButton] = React16.useState(null);
|
|
2838
|
+
const [activeButton, setActiveButton] = React16.useState(null);
|
|
2839
|
+
const [inputFocused, setInputFocused] = React16.useState(false);
|
|
2840
|
+
React16.useEffect(() => {
|
|
2841
|
+
setInputValue(currentPage.toString());
|
|
2842
|
+
}, [currentPage]);
|
|
2843
|
+
const handleFirstPage = () => {
|
|
2844
|
+
if (currentPage !== 1) {
|
|
2845
|
+
onPageChange(1);
|
|
2846
|
+
}
|
|
2847
|
+
};
|
|
2848
|
+
const handlePreviousPage = () => {
|
|
2849
|
+
if (currentPage > 1) {
|
|
2850
|
+
onPageChange(currentPage - 1);
|
|
2851
|
+
}
|
|
2852
|
+
};
|
|
2853
|
+
const handleNextPage = () => {
|
|
2854
|
+
if (currentPage < totalPages) {
|
|
2855
|
+
onPageChange(currentPage + 1);
|
|
2856
|
+
}
|
|
2857
|
+
};
|
|
2858
|
+
const handleLastPage = () => {
|
|
2859
|
+
if (currentPage !== totalPages) {
|
|
2860
|
+
onPageChange(totalPages);
|
|
2861
|
+
}
|
|
2862
|
+
};
|
|
2863
|
+
const handleInputChange = (e) => {
|
|
2864
|
+
const value = e.target.value;
|
|
2865
|
+
if (value === "" || /^\d+$/.test(value)) {
|
|
2866
|
+
setInputValue(value);
|
|
2867
|
+
}
|
|
2868
|
+
};
|
|
2869
|
+
const handleInputBlur = () => {
|
|
2870
|
+
setInputFocused(false);
|
|
2871
|
+
const pageNumber = parseInt(inputValue, 10);
|
|
2872
|
+
if (isNaN(pageNumber) || pageNumber < 1) {
|
|
2873
|
+
setInputValue(currentPage.toString());
|
|
2874
|
+
} else if (pageNumber > totalPages) {
|
|
2875
|
+
setInputValue(totalPages.toString());
|
|
2876
|
+
onPageChange(totalPages);
|
|
2877
|
+
} else if (pageNumber !== currentPage) {
|
|
2878
|
+
onPageChange(pageNumber);
|
|
2879
|
+
}
|
|
2880
|
+
};
|
|
2881
|
+
const handleInputKeyDown = (e) => {
|
|
2882
|
+
if (e.key === "Enter") {
|
|
2883
|
+
handleInputBlur();
|
|
2884
|
+
e.target.blur();
|
|
2885
|
+
}
|
|
2886
|
+
};
|
|
2887
|
+
const getButtonStyle = (buttonName, disabled) => {
|
|
2888
|
+
if (disabled) {
|
|
2889
|
+
return { ...buttonStyles3, ...buttonDisabledStyles };
|
|
2890
|
+
}
|
|
2891
|
+
const isHovered = hoveredButton === buttonName;
|
|
2892
|
+
const isFocused = focusedButton === buttonName;
|
|
2893
|
+
const isActive = activeButton === buttonName;
|
|
2894
|
+
const style2 = {
|
|
2895
|
+
...buttonStyles3
|
|
2896
|
+
};
|
|
2897
|
+
if (isHovered && !isFocused && !isActive) {
|
|
2898
|
+
style2.backgroundColor = "#efefef";
|
|
2899
|
+
}
|
|
2900
|
+
if (isActive && !isFocused) {
|
|
2901
|
+
style2.backgroundColor = "transparent";
|
|
2902
|
+
}
|
|
2903
|
+
if (isFocused) {
|
|
2904
|
+
style2.boxShadow = "0px 0px 0px 3px #3cad51";
|
|
2905
|
+
style2.backgroundColor = "rgba(255, 255, 255, 0.01)";
|
|
2906
|
+
}
|
|
2907
|
+
return style2;
|
|
2908
|
+
};
|
|
2909
|
+
const isFirstDisabled = currentPage === 1;
|
|
2910
|
+
const isPreviousDisabled = currentPage === 1;
|
|
2911
|
+
const isNextDisabled = currentPage === totalPages;
|
|
2912
|
+
const isLastDisabled = currentPage === totalPages;
|
|
2913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2914
|
+
"div",
|
|
2915
|
+
{
|
|
2916
|
+
ref,
|
|
2917
|
+
className: (0, import_clsx16.clsx)("arbor-pagination", className),
|
|
2918
|
+
style: { ...containerStyles3, ...style },
|
|
2919
|
+
"data-testid": dataTestId,
|
|
2920
|
+
children: [
|
|
2921
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2922
|
+
"button",
|
|
2923
|
+
{
|
|
2924
|
+
type: "button",
|
|
2925
|
+
onClick: handleFirstPage,
|
|
2926
|
+
disabled: isFirstDisabled,
|
|
2927
|
+
onMouseEnter: () => setHoveredButton("first"),
|
|
2928
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
2929
|
+
onMouseDown: () => setActiveButton("first"),
|
|
2930
|
+
onMouseUp: () => setActiveButton(null),
|
|
2931
|
+
onFocus: () => setFocusedButton("first"),
|
|
2932
|
+
onBlur: () => setFocusedButton(null),
|
|
2933
|
+
style: getButtonStyle("first", isFirstDisabled),
|
|
2934
|
+
"aria-label": "Go to first page",
|
|
2935
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.ChevronsLeft, { size: 16, color: "#2f2f2f" })
|
|
2936
|
+
}
|
|
2937
|
+
),
|
|
2938
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2939
|
+
"button",
|
|
2940
|
+
{
|
|
2941
|
+
type: "button",
|
|
2942
|
+
onClick: handlePreviousPage,
|
|
2943
|
+
disabled: isPreviousDisabled,
|
|
2944
|
+
onMouseEnter: () => setHoveredButton("previous"),
|
|
2945
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
2946
|
+
onMouseDown: () => setActiveButton("previous"),
|
|
2947
|
+
onMouseUp: () => setActiveButton(null),
|
|
2948
|
+
onFocus: () => setFocusedButton("previous"),
|
|
2949
|
+
onBlur: () => setFocusedButton(null),
|
|
2950
|
+
style: getButtonStyle("previous", isPreviousDisabled),
|
|
2951
|
+
"aria-label": "Go to previous page",
|
|
2952
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.ChevronLeft, { size: 16, color: "#2f2f2f" })
|
|
2953
|
+
}
|
|
2954
|
+
),
|
|
2955
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: inputWrapperStyles, children: [
|
|
2956
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: labelStyles9, children: "Page" }),
|
|
2957
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2958
|
+
"input",
|
|
2959
|
+
{
|
|
2960
|
+
type: "text",
|
|
2961
|
+
value: inputValue,
|
|
2962
|
+
onChange: handleInputChange,
|
|
2963
|
+
onBlur: handleInputBlur,
|
|
2964
|
+
onFocus: () => setInputFocused(true),
|
|
2965
|
+
onKeyDown: handleInputKeyDown,
|
|
2966
|
+
style: {
|
|
2967
|
+
...inputStyles4,
|
|
2968
|
+
...inputFocused && inputFocusStyles
|
|
2969
|
+
},
|
|
2970
|
+
"aria-label": `Page ${currentPage} of ${totalPages}`
|
|
2971
|
+
}
|
|
2972
|
+
),
|
|
2973
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: textStyles, children: [
|
|
2974
|
+
"of ",
|
|
2975
|
+
totalPages
|
|
2976
|
+
] })
|
|
2977
|
+
] }),
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2979
|
+
"button",
|
|
2980
|
+
{
|
|
2981
|
+
type: "button",
|
|
2982
|
+
onClick: handleNextPage,
|
|
2983
|
+
disabled: isNextDisabled,
|
|
2984
|
+
onMouseEnter: () => setHoveredButton("next"),
|
|
2985
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
2986
|
+
onMouseDown: () => setActiveButton("next"),
|
|
2987
|
+
onMouseUp: () => setActiveButton(null),
|
|
2988
|
+
onFocus: () => setFocusedButton("next"),
|
|
2989
|
+
onBlur: () => setFocusedButton(null),
|
|
2990
|
+
style: getButtonStyle("next", isNextDisabled),
|
|
2991
|
+
"aria-label": "Go to next page",
|
|
2992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.ChevronRight, { size: 16, color: "#2f2f2f" })
|
|
2993
|
+
}
|
|
2994
|
+
),
|
|
2995
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2996
|
+
"button",
|
|
2997
|
+
{
|
|
2998
|
+
type: "button",
|
|
2999
|
+
onClick: handleLastPage,
|
|
3000
|
+
disabled: isLastDisabled,
|
|
3001
|
+
onMouseEnter: () => setHoveredButton("last"),
|
|
3002
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3003
|
+
onMouseDown: () => setActiveButton("last"),
|
|
3004
|
+
onMouseUp: () => setActiveButton(null),
|
|
3005
|
+
onFocus: () => setFocusedButton("last"),
|
|
3006
|
+
onBlur: () => setFocusedButton(null),
|
|
3007
|
+
style: getButtonStyle("last", isLastDisabled),
|
|
3008
|
+
"aria-label": "Go to last page",
|
|
3009
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react6.ChevronsRight, { size: 16, color: "#2f2f2f" })
|
|
3010
|
+
}
|
|
3011
|
+
)
|
|
3012
|
+
]
|
|
3013
|
+
}
|
|
3014
|
+
);
|
|
3015
|
+
}
|
|
3016
|
+
);
|
|
3017
|
+
Pagination.displayName = "Pagination";
|
|
3018
|
+
|
|
3019
|
+
// src/TableFooterPagination/TableFooterPagination.tsx
|
|
3020
|
+
var React17 = __toESM(require("react"));
|
|
3021
|
+
var import_clsx17 = require("clsx");
|
|
3022
|
+
var import_lucide_react7 = require("lucide-react");
|
|
3023
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3024
|
+
var containerStyles4 = {
|
|
3025
|
+
display: "flex",
|
|
3026
|
+
alignItems: "center",
|
|
3027
|
+
justifyContent: "space-between",
|
|
3028
|
+
backgroundColor: "white",
|
|
3029
|
+
paddingTop: "4px",
|
|
3030
|
+
paddingBottom: 0,
|
|
3031
|
+
paddingLeft: 0,
|
|
3032
|
+
paddingRight: 0,
|
|
3033
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
3034
|
+
};
|
|
3035
|
+
var textStyles2 = {
|
|
3036
|
+
fontSize: "13px",
|
|
3037
|
+
fontWeight: 400,
|
|
3038
|
+
lineHeight: "1.5",
|
|
3039
|
+
color: "#2f2f2f",
|
|
3040
|
+
minWidth: "165px"
|
|
3041
|
+
};
|
|
3042
|
+
var paginationWrapperStyles = {
|
|
3043
|
+
display: "flex",
|
|
3044
|
+
alignItems: "center",
|
|
3045
|
+
justifyContent: "center",
|
|
3046
|
+
gap: "8px",
|
|
3047
|
+
minWidth: "165px",
|
|
3048
|
+
flexWrap: "wrap"
|
|
3049
|
+
};
|
|
3050
|
+
var paginationButtonStyles = {
|
|
3051
|
+
width: "32px",
|
|
3052
|
+
height: "32px",
|
|
3053
|
+
minWidth: "32px",
|
|
3054
|
+
minHeight: "32px",
|
|
3055
|
+
maxWidth: "32px",
|
|
3056
|
+
maxHeight: "32px",
|
|
3057
|
+
borderRadius: "99px",
|
|
3058
|
+
border: "none",
|
|
3059
|
+
background: "white",
|
|
3060
|
+
cursor: "pointer",
|
|
3061
|
+
display: "flex",
|
|
3062
|
+
alignItems: "center",
|
|
3063
|
+
justifyContent: "center",
|
|
3064
|
+
padding: 0,
|
|
3065
|
+
transition: "background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out",
|
|
3066
|
+
flexShrink: 0,
|
|
3067
|
+
WebkitTapHighlightColor: "transparent",
|
|
3068
|
+
outline: "none"
|
|
3069
|
+
};
|
|
3070
|
+
var paginationButtonDisabledStyles = {
|
|
3071
|
+
cursor: "not-allowed",
|
|
3072
|
+
opacity: 0.5
|
|
3073
|
+
};
|
|
3074
|
+
var paginationLabelStyles = {
|
|
3075
|
+
fontSize: "13px",
|
|
3076
|
+
fontWeight: 400,
|
|
3077
|
+
lineHeight: "1.5",
|
|
3078
|
+
color: "#2f2f2f"
|
|
3079
|
+
};
|
|
3080
|
+
var paginationInputWrapperStyles = {
|
|
3081
|
+
display: "flex",
|
|
3082
|
+
alignItems: "center",
|
|
3083
|
+
gap: "8px"
|
|
3084
|
+
};
|
|
3085
|
+
var paginationInputStyles = {
|
|
3086
|
+
width: "60px",
|
|
3087
|
+
paddingTop: "12px",
|
|
3088
|
+
paddingBottom: "12px",
|
|
3089
|
+
paddingLeft: "16px",
|
|
3090
|
+
paddingRight: "16px",
|
|
3091
|
+
fontSize: "13px",
|
|
3092
|
+
fontWeight: 400,
|
|
3093
|
+
lineHeight: "1.5",
|
|
3094
|
+
color: "#2f2f2f",
|
|
3095
|
+
backgroundColor: "white",
|
|
3096
|
+
border: "1px solid #dfdfdf",
|
|
3097
|
+
borderRadius: "8px",
|
|
3098
|
+
fontFamily: "inherit",
|
|
3099
|
+
textAlign: "center",
|
|
3100
|
+
outline: "none"
|
|
3101
|
+
};
|
|
3102
|
+
var paginationInputFocusStyles = {
|
|
3103
|
+
boxShadow: "0px 0px 0px 3px #3cad51"
|
|
3104
|
+
};
|
|
3105
|
+
var rightAlignedStyles = {
|
|
3106
|
+
display: "flex",
|
|
3107
|
+
gap: "16px",
|
|
3108
|
+
alignItems: "center",
|
|
3109
|
+
justifyContent: "flex-end",
|
|
3110
|
+
minWidth: "165px"
|
|
3111
|
+
};
|
|
3112
|
+
var perPageButtonStyles = {
|
|
3113
|
+
height: "32px",
|
|
3114
|
+
backgroundColor: "white",
|
|
3115
|
+
border: "1px solid #d1d1d1",
|
|
3116
|
+
borderRadius: "8px",
|
|
3117
|
+
display: "flex",
|
|
3118
|
+
alignItems: "center",
|
|
3119
|
+
gap: "8px",
|
|
3120
|
+
paddingLeft: "12px",
|
|
3121
|
+
paddingRight: "8px",
|
|
3122
|
+
paddingTop: "8px",
|
|
3123
|
+
paddingBottom: "8px",
|
|
3124
|
+
cursor: "pointer",
|
|
3125
|
+
transition: "background-color 0.2s ease-in-out",
|
|
3126
|
+
outline: "none"
|
|
3127
|
+
};
|
|
3128
|
+
var perPageTextStyles = {
|
|
3129
|
+
fontSize: "13px",
|
|
3130
|
+
fontWeight: 600,
|
|
3131
|
+
lineHeight: "1.5",
|
|
3132
|
+
color: "#2f2f2f",
|
|
3133
|
+
textAlign: "center"
|
|
3134
|
+
};
|
|
3135
|
+
var expandButtonStyles = {
|
|
3136
|
+
height: "32px",
|
|
3137
|
+
minHeight: "32px",
|
|
3138
|
+
backgroundColor: "#efefef",
|
|
3139
|
+
border: "none",
|
|
3140
|
+
borderRadius: "99px",
|
|
3141
|
+
display: "flex",
|
|
3142
|
+
alignItems: "center",
|
|
3143
|
+
justifyContent: "center",
|
|
3144
|
+
paddingLeft: "16px",
|
|
3145
|
+
paddingRight: "16px",
|
|
3146
|
+
paddingTop: 0,
|
|
3147
|
+
paddingBottom: 0,
|
|
3148
|
+
gap: 0,
|
|
3149
|
+
cursor: "pointer",
|
|
3150
|
+
transition: "background-color 0.2s ease-in-out",
|
|
3151
|
+
outline: "none"
|
|
3152
|
+
};
|
|
3153
|
+
var expandButtonTextStyles = {
|
|
3154
|
+
fontSize: "13px",
|
|
3155
|
+
fontWeight: 600,
|
|
3156
|
+
lineHeight: "1.5",
|
|
3157
|
+
color: "#2f2f2f",
|
|
3158
|
+
textAlign: "center"
|
|
3159
|
+
};
|
|
3160
|
+
var TableFooterPagination = React17.forwardRef(
|
|
3161
|
+
({
|
|
3162
|
+
currentPage,
|
|
3163
|
+
totalPages,
|
|
3164
|
+
onPageChange,
|
|
3165
|
+
totalResults,
|
|
3166
|
+
currentResults,
|
|
3167
|
+
itemsPerPage,
|
|
3168
|
+
onItemsPerPageChange,
|
|
3169
|
+
onExpandTable,
|
|
3170
|
+
className,
|
|
3171
|
+
style,
|
|
3172
|
+
"data-testid": dataTestId
|
|
3173
|
+
}, ref) => {
|
|
3174
|
+
const [inputValue, setInputValue] = React17.useState(currentPage.toString());
|
|
3175
|
+
const [focusedButton, setFocusedButton] = React17.useState(null);
|
|
3176
|
+
const [hoveredButton, setHoveredButton] = React17.useState(null);
|
|
3177
|
+
const [activeButton, setActiveButton] = React17.useState(null);
|
|
3178
|
+
const [inputFocused, setInputFocused] = React17.useState(false);
|
|
3179
|
+
const [perPageHovered, setPerPageHovered] = React17.useState(false);
|
|
3180
|
+
const [expandHovered, setExpandHovered] = React17.useState(false);
|
|
3181
|
+
React17.useEffect(() => {
|
|
3182
|
+
setInputValue(currentPage.toString());
|
|
3183
|
+
}, [currentPage]);
|
|
3184
|
+
const handleFirstPage = () => {
|
|
3185
|
+
if (currentPage !== 1) {
|
|
3186
|
+
onPageChange(1);
|
|
3187
|
+
}
|
|
3188
|
+
};
|
|
3189
|
+
const handlePreviousPage = () => {
|
|
3190
|
+
if (currentPage > 1) {
|
|
3191
|
+
onPageChange(currentPage - 1);
|
|
3192
|
+
}
|
|
3193
|
+
};
|
|
3194
|
+
const handleNextPage = () => {
|
|
3195
|
+
if (currentPage < totalPages) {
|
|
3196
|
+
onPageChange(currentPage + 1);
|
|
3197
|
+
}
|
|
3198
|
+
};
|
|
3199
|
+
const handleLastPage = () => {
|
|
3200
|
+
if (currentPage !== totalPages) {
|
|
3201
|
+
onPageChange(totalPages);
|
|
3202
|
+
}
|
|
3203
|
+
};
|
|
3204
|
+
const handleInputChange = (e) => {
|
|
3205
|
+
const value = e.target.value;
|
|
3206
|
+
if (value === "" || /^\d+$/.test(value)) {
|
|
3207
|
+
setInputValue(value);
|
|
3208
|
+
}
|
|
3209
|
+
};
|
|
3210
|
+
const handleInputBlur = () => {
|
|
3211
|
+
setInputFocused(false);
|
|
3212
|
+
const pageNumber = parseInt(inputValue, 10);
|
|
3213
|
+
if (isNaN(pageNumber) || pageNumber < 1) {
|
|
3214
|
+
setInputValue(currentPage.toString());
|
|
3215
|
+
} else if (pageNumber > totalPages) {
|
|
3216
|
+
setInputValue(totalPages.toString());
|
|
3217
|
+
onPageChange(totalPages);
|
|
3218
|
+
} else if (pageNumber !== currentPage) {
|
|
3219
|
+
onPageChange(pageNumber);
|
|
3220
|
+
}
|
|
3221
|
+
};
|
|
3222
|
+
const handleInputKeyDown = (e) => {
|
|
3223
|
+
if (e.key === "Enter") {
|
|
3224
|
+
handleInputBlur();
|
|
3225
|
+
e.target.blur();
|
|
3226
|
+
}
|
|
3227
|
+
};
|
|
3228
|
+
const getButtonStyle = (buttonName, disabled) => {
|
|
3229
|
+
if (disabled) {
|
|
3230
|
+
return { ...paginationButtonStyles, ...paginationButtonDisabledStyles };
|
|
3231
|
+
}
|
|
3232
|
+
const isHovered = hoveredButton === buttonName;
|
|
3233
|
+
const isFocused = focusedButton === buttonName;
|
|
3234
|
+
const isActive = activeButton === buttonName;
|
|
3235
|
+
const style2 = {
|
|
3236
|
+
...paginationButtonStyles
|
|
3237
|
+
};
|
|
3238
|
+
if (isHovered && !isFocused && !isActive) {
|
|
3239
|
+
style2.backgroundColor = "#efefef";
|
|
3240
|
+
}
|
|
3241
|
+
if (isActive && !isFocused) {
|
|
3242
|
+
style2.backgroundColor = "transparent";
|
|
3243
|
+
}
|
|
3244
|
+
if (isFocused) {
|
|
3245
|
+
style2.boxShadow = "0px 0px 0px 3px #3cad51";
|
|
3246
|
+
style2.backgroundColor = "rgba(255, 255, 255, 0.01)";
|
|
3247
|
+
}
|
|
3248
|
+
return style2;
|
|
3249
|
+
};
|
|
3250
|
+
const isFirstDisabled = currentPage === 1;
|
|
3251
|
+
const isPreviousDisabled = currentPage === 1;
|
|
3252
|
+
const isNextDisabled = currentPage === totalPages;
|
|
3253
|
+
const isLastDisabled = currentPage === totalPages;
|
|
3254
|
+
const resultText = currentResults === totalResults ? `Showing ${totalResults} results` : `Showing ${currentResults} of ${totalResults} results`;
|
|
3255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3256
|
+
"div",
|
|
3257
|
+
{
|
|
3258
|
+
ref,
|
|
3259
|
+
className: (0, import_clsx17.clsx)("arbor-table-footer-pagination", className),
|
|
3260
|
+
style: { ...containerStyles4, ...style },
|
|
3261
|
+
"data-testid": dataTestId,
|
|
3262
|
+
children: [
|
|
3263
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: textStyles2, children: resultText }),
|
|
3264
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: paginationWrapperStyles, children: [
|
|
3265
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3266
|
+
"button",
|
|
3267
|
+
{
|
|
3268
|
+
type: "button",
|
|
3269
|
+
onClick: handleFirstPage,
|
|
3270
|
+
disabled: isFirstDisabled,
|
|
3271
|
+
onMouseEnter: () => setHoveredButton("first"),
|
|
3272
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3273
|
+
onMouseDown: () => setActiveButton("first"),
|
|
3274
|
+
onMouseUp: () => setActiveButton(null),
|
|
3275
|
+
onFocus: () => setFocusedButton("first"),
|
|
3276
|
+
onBlur: () => setFocusedButton(null),
|
|
3277
|
+
style: getButtonStyle("first", isFirstDisabled),
|
|
3278
|
+
"aria-label": "Go to first page",
|
|
3279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3280
|
+
"svg",
|
|
3281
|
+
{
|
|
3282
|
+
width: "16",
|
|
3283
|
+
height: "16",
|
|
3284
|
+
viewBox: "0 0 16 16",
|
|
3285
|
+
fill: "none",
|
|
3286
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3287
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3288
|
+
"path",
|
|
3289
|
+
{
|
|
3290
|
+
d: "M7 12L3 8L7 4M11 12L7 8L11 4",
|
|
3291
|
+
stroke: "#2f2f2f",
|
|
3292
|
+
strokeWidth: "1.5",
|
|
3293
|
+
strokeLinecap: "round",
|
|
3294
|
+
strokeLinejoin: "round"
|
|
3295
|
+
}
|
|
3296
|
+
)
|
|
3297
|
+
}
|
|
3298
|
+
)
|
|
3299
|
+
}
|
|
3300
|
+
),
|
|
3301
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3302
|
+
"button",
|
|
3303
|
+
{
|
|
3304
|
+
type: "button",
|
|
3305
|
+
onClick: handlePreviousPage,
|
|
3306
|
+
disabled: isPreviousDisabled,
|
|
3307
|
+
onMouseEnter: () => setHoveredButton("previous"),
|
|
3308
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3309
|
+
onMouseDown: () => setActiveButton("previous"),
|
|
3310
|
+
onMouseUp: () => setActiveButton(null),
|
|
3311
|
+
onFocus: () => setFocusedButton("previous"),
|
|
3312
|
+
onBlur: () => setFocusedButton(null),
|
|
3313
|
+
style: getButtonStyle("previous", isPreviousDisabled),
|
|
3314
|
+
"aria-label": "Go to previous page",
|
|
3315
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3316
|
+
"svg",
|
|
3317
|
+
{
|
|
3318
|
+
width: "16",
|
|
3319
|
+
height: "16",
|
|
3320
|
+
viewBox: "0 0 16 16",
|
|
3321
|
+
fill: "none",
|
|
3322
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3324
|
+
"path",
|
|
3325
|
+
{
|
|
3326
|
+
d: "M10 12L6 8L10 4",
|
|
3327
|
+
stroke: "#2f2f2f",
|
|
3328
|
+
strokeWidth: "1.5",
|
|
3329
|
+
strokeLinecap: "round",
|
|
3330
|
+
strokeLinejoin: "round"
|
|
3331
|
+
}
|
|
3332
|
+
)
|
|
3333
|
+
}
|
|
3334
|
+
)
|
|
3335
|
+
}
|
|
3336
|
+
),
|
|
3337
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: paginationInputWrapperStyles, children: [
|
|
3338
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: paginationLabelStyles, children: "Page" }),
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3340
|
+
"input",
|
|
3341
|
+
{
|
|
3342
|
+
type: "text",
|
|
3343
|
+
value: inputValue,
|
|
3344
|
+
onChange: handleInputChange,
|
|
3345
|
+
onBlur: handleInputBlur,
|
|
3346
|
+
onFocus: () => setInputFocused(true),
|
|
3347
|
+
onKeyDown: handleInputKeyDown,
|
|
3348
|
+
style: {
|
|
3349
|
+
...paginationInputStyles,
|
|
3350
|
+
...inputFocused && paginationInputFocusStyles
|
|
3351
|
+
},
|
|
3352
|
+
"aria-label": `Page ${currentPage} of ${totalPages}`
|
|
3353
|
+
}
|
|
3354
|
+
),
|
|
3355
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { style: paginationLabelStyles, children: [
|
|
3356
|
+
"of ",
|
|
3357
|
+
totalPages
|
|
3358
|
+
] })
|
|
3359
|
+
] }),
|
|
3360
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3361
|
+
"button",
|
|
3362
|
+
{
|
|
3363
|
+
type: "button",
|
|
3364
|
+
onClick: handleNextPage,
|
|
3365
|
+
disabled: isNextDisabled,
|
|
3366
|
+
onMouseEnter: () => setHoveredButton("next"),
|
|
3367
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3368
|
+
onMouseDown: () => setActiveButton("next"),
|
|
3369
|
+
onMouseUp: () => setActiveButton(null),
|
|
3370
|
+
onFocus: () => setFocusedButton("next"),
|
|
3371
|
+
onBlur: () => setFocusedButton(null),
|
|
3372
|
+
style: getButtonStyle("next", isNextDisabled),
|
|
3373
|
+
"aria-label": "Go to next page",
|
|
3374
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3375
|
+
"svg",
|
|
3376
|
+
{
|
|
3377
|
+
width: "16",
|
|
3378
|
+
height: "16",
|
|
3379
|
+
viewBox: "0 0 16 16",
|
|
3380
|
+
fill: "none",
|
|
3381
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3383
|
+
"path",
|
|
3384
|
+
{
|
|
3385
|
+
d: "M6 4L10 8L6 12",
|
|
3386
|
+
stroke: "#2f2f2f",
|
|
3387
|
+
strokeWidth: "1.5",
|
|
3388
|
+
strokeLinecap: "round",
|
|
3389
|
+
strokeLinejoin: "round"
|
|
3390
|
+
}
|
|
3391
|
+
)
|
|
3392
|
+
}
|
|
3393
|
+
)
|
|
3394
|
+
}
|
|
3395
|
+
),
|
|
3396
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3397
|
+
"button",
|
|
3398
|
+
{
|
|
3399
|
+
type: "button",
|
|
3400
|
+
onClick: handleLastPage,
|
|
3401
|
+
disabled: isLastDisabled,
|
|
3402
|
+
onMouseEnter: () => setHoveredButton("last"),
|
|
3403
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3404
|
+
onMouseDown: () => setActiveButton("last"),
|
|
3405
|
+
onMouseUp: () => setActiveButton(null),
|
|
3406
|
+
onFocus: () => setFocusedButton("last"),
|
|
3407
|
+
onBlur: () => setFocusedButton(null),
|
|
3408
|
+
style: getButtonStyle("last", isLastDisabled),
|
|
3409
|
+
"aria-label": "Go to last page",
|
|
3410
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3411
|
+
"svg",
|
|
3412
|
+
{
|
|
3413
|
+
width: "16",
|
|
3414
|
+
height: "16",
|
|
3415
|
+
viewBox: "0 0 16 16",
|
|
3416
|
+
fill: "none",
|
|
3417
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3418
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3419
|
+
"path",
|
|
3420
|
+
{
|
|
3421
|
+
d: "M9 4L13 8L9 12M5 4L9 8L5 12",
|
|
3422
|
+
stroke: "#2f2f2f",
|
|
3423
|
+
strokeWidth: "1.5",
|
|
3424
|
+
strokeLinecap: "round",
|
|
3425
|
+
strokeLinejoin: "round"
|
|
3426
|
+
}
|
|
3427
|
+
)
|
|
3428
|
+
}
|
|
3429
|
+
)
|
|
3430
|
+
}
|
|
3431
|
+
)
|
|
3432
|
+
] }),
|
|
3433
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: rightAlignedStyles, children: [
|
|
3434
|
+
onItemsPerPageChange && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3435
|
+
"button",
|
|
3436
|
+
{
|
|
3437
|
+
type: "button",
|
|
3438
|
+
onClick: () => onItemsPerPageChange(itemsPerPage),
|
|
3439
|
+
onMouseEnter: () => setPerPageHovered(true),
|
|
3440
|
+
onMouseLeave: () => setPerPageHovered(false),
|
|
3441
|
+
style: {
|
|
3442
|
+
...perPageButtonStyles,
|
|
3443
|
+
backgroundColor: perPageHovered ? "#f5f5f5" : "white"
|
|
3444
|
+
},
|
|
3445
|
+
"aria-label": "Items per page",
|
|
3446
|
+
children: [
|
|
3447
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { style: perPageTextStyles, children: [
|
|
3448
|
+
itemsPerPage,
|
|
3449
|
+
" per page"
|
|
3450
|
+
] }),
|
|
3451
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react7.ChevronDown, { size: 16, color: "#2f2f2f" })
|
|
3452
|
+
]
|
|
3453
|
+
}
|
|
3454
|
+
),
|
|
3455
|
+
onExpandTable && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3456
|
+
"button",
|
|
3457
|
+
{
|
|
3458
|
+
type: "button",
|
|
3459
|
+
onClick: onExpandTable,
|
|
3460
|
+
onMouseEnter: () => setExpandHovered(true),
|
|
3461
|
+
onMouseLeave: () => setExpandHovered(false),
|
|
3462
|
+
style: {
|
|
3463
|
+
...expandButtonStyles,
|
|
3464
|
+
backgroundColor: expandHovered ? "#e5e5e5" : "#efefef"
|
|
3465
|
+
},
|
|
3466
|
+
"aria-label": "Expand table",
|
|
3467
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: expandButtonTextStyles, children: "Expand table" })
|
|
3468
|
+
}
|
|
3469
|
+
)
|
|
3470
|
+
] })
|
|
3471
|
+
]
|
|
3472
|
+
}
|
|
3473
|
+
);
|
|
3474
|
+
}
|
|
3475
|
+
);
|
|
3476
|
+
TableFooterPagination.displayName = "TableFooterPagination";
|
|
3477
|
+
|
|
3478
|
+
// src/TableControls/TableControls.tsx
|
|
3479
|
+
var React18 = __toESM(require("react"));
|
|
3480
|
+
var import_clsx18 = require("clsx");
|
|
3481
|
+
var Popover2 = __toESM(require("@radix-ui/react-popover"));
|
|
3482
|
+
var import_lucide_react8 = require("lucide-react");
|
|
3483
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3484
|
+
var containerStyles5 = {
|
|
3485
|
+
display: "flex",
|
|
3486
|
+
alignItems: "center",
|
|
3487
|
+
justifyContent: "space-between",
|
|
3488
|
+
paddingTop: "8px",
|
|
3489
|
+
paddingBottom: "8px",
|
|
3490
|
+
paddingLeft: 0,
|
|
3491
|
+
paddingRight: 0,
|
|
3492
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
3493
|
+
};
|
|
3494
|
+
var actions1Styles = {
|
|
3495
|
+
display: "flex",
|
|
3496
|
+
gap: "12px",
|
|
3497
|
+
alignItems: "center"
|
|
3498
|
+
};
|
|
3499
|
+
var actions2Styles = {
|
|
3500
|
+
display: "flex",
|
|
3501
|
+
gap: "12px",
|
|
3502
|
+
alignItems: "center",
|
|
3503
|
+
justifyContent: "flex-end",
|
|
3504
|
+
flexGrow: 1,
|
|
3505
|
+
paddingRight: "4px"
|
|
3506
|
+
};
|
|
3507
|
+
var dropdownButtonStyles = {
|
|
3508
|
+
height: "32px",
|
|
3509
|
+
backgroundColor: "white",
|
|
3510
|
+
border: "1px solid #d1d1d1",
|
|
3511
|
+
borderRadius: "8px",
|
|
3512
|
+
display: "flex",
|
|
3513
|
+
alignItems: "center",
|
|
3514
|
+
justifyContent: "center",
|
|
3515
|
+
gap: "8px",
|
|
3516
|
+
paddingLeft: "12px",
|
|
3517
|
+
paddingRight: "8px",
|
|
3518
|
+
paddingTop: 0,
|
|
3519
|
+
paddingBottom: 0,
|
|
3520
|
+
cursor: "pointer",
|
|
3521
|
+
transition: "background-color 0.2s ease-in-out",
|
|
3522
|
+
outline: "none"
|
|
3523
|
+
};
|
|
3524
|
+
var dropdownTextStyles = {
|
|
3525
|
+
fontSize: "13px",
|
|
3526
|
+
fontWeight: 600,
|
|
3527
|
+
lineHeight: "1.5",
|
|
3528
|
+
color: "#2f2f2f",
|
|
3529
|
+
textAlign: "center"
|
|
3530
|
+
};
|
|
3531
|
+
var iconButtonStyles2 = {
|
|
3532
|
+
width: "32px",
|
|
3533
|
+
height: "32px",
|
|
3534
|
+
borderRadius: "99px",
|
|
3535
|
+
border: "none",
|
|
3536
|
+
backgroundColor: "white",
|
|
3537
|
+
cursor: "pointer",
|
|
3538
|
+
display: "flex",
|
|
3539
|
+
alignItems: "center",
|
|
3540
|
+
justifyContent: "center",
|
|
3541
|
+
padding: 0,
|
|
3542
|
+
transition: "background-color 0.2s ease-in-out",
|
|
3543
|
+
flexShrink: 0,
|
|
3544
|
+
outline: "none"
|
|
3545
|
+
};
|
|
3546
|
+
var iconButtonDisabledStyles = {
|
|
3547
|
+
cursor: "not-allowed",
|
|
3548
|
+
opacity: 0.5
|
|
3549
|
+
};
|
|
3550
|
+
var popoverContentStyles = {
|
|
3551
|
+
backgroundColor: "white",
|
|
3552
|
+
border: "1px solid #d1d1d1",
|
|
3553
|
+
borderRadius: "8px",
|
|
3554
|
+
padding: "8px",
|
|
3555
|
+
minWidth: "180px",
|
|
3556
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
|
|
3557
|
+
zIndex: 1e3
|
|
3558
|
+
};
|
|
3559
|
+
var menuItemStyles = {
|
|
3560
|
+
padding: "8px 12px",
|
|
3561
|
+
fontSize: "13px",
|
|
3562
|
+
color: "#2f2f2f",
|
|
3563
|
+
cursor: "pointer",
|
|
3564
|
+
borderRadius: "4px",
|
|
3565
|
+
border: "none",
|
|
3566
|
+
backgroundColor: "white",
|
|
3567
|
+
width: "100%",
|
|
3568
|
+
textAlign: "left",
|
|
3569
|
+
transition: "background-color 0.2s ease-in-out"
|
|
3570
|
+
};
|
|
3571
|
+
var TableControls = React18.forwardRef(
|
|
3572
|
+
({
|
|
3573
|
+
selectedCount = 0,
|
|
3574
|
+
onActionsClick,
|
|
3575
|
+
onUndoClick,
|
|
3576
|
+
onRedoClick,
|
|
3577
|
+
onHideColumnsClick,
|
|
3578
|
+
onSearchClick,
|
|
3579
|
+
onDownloadClick,
|
|
3580
|
+
onTooltipsClick,
|
|
3581
|
+
tooltipsEnabled = false,
|
|
3582
|
+
onSettingsClick,
|
|
3583
|
+
onExpandClick,
|
|
3584
|
+
undoDisabled = false,
|
|
3585
|
+
redoDisabled = false,
|
|
3586
|
+
className,
|
|
3587
|
+
style,
|
|
3588
|
+
"data-testid": dataTestId
|
|
3589
|
+
}, ref) => {
|
|
3590
|
+
const [hoveredButton, setHoveredButton] = React18.useState(null);
|
|
3591
|
+
const [focusedButton, setFocusedButton] = React18.useState(null);
|
|
3592
|
+
const [actionsOpen, setActionsOpen] = React18.useState(false);
|
|
3593
|
+
const [hideColumnsOpen, setHideColumnsOpen] = React18.useState(false);
|
|
3594
|
+
const getIconButtonStyle = (buttonName, disabled = false) => {
|
|
3595
|
+
if (disabled) {
|
|
3596
|
+
return { ...iconButtonStyles2, ...iconButtonDisabledStyles };
|
|
3597
|
+
}
|
|
3598
|
+
const isHovered = hoveredButton === buttonName;
|
|
3599
|
+
const isFocused = focusedButton === buttonName;
|
|
3600
|
+
return {
|
|
3601
|
+
...iconButtonStyles2,
|
|
3602
|
+
backgroundColor: isHovered ? "#f5f5f5" : "white",
|
|
3603
|
+
boxShadow: isFocused ? "0 0 0 3px #3cad51" : "none"
|
|
3604
|
+
};
|
|
3605
|
+
};
|
|
3606
|
+
const getDropdownButtonStyle = (buttonName) => {
|
|
3607
|
+
const isHovered = hoveredButton === buttonName;
|
|
3608
|
+
const isFocused = focusedButton === buttonName;
|
|
3609
|
+
return {
|
|
3610
|
+
...dropdownButtonStyles,
|
|
3611
|
+
backgroundColor: isHovered ? "#f5f5f5" : "white",
|
|
3612
|
+
boxShadow: isFocused ? "0 0 0 3px #3cad51" : "none"
|
|
3613
|
+
};
|
|
3614
|
+
};
|
|
3615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3616
|
+
"div",
|
|
3617
|
+
{
|
|
3618
|
+
ref,
|
|
3619
|
+
className: (0, import_clsx18.clsx)("arbor-table-controls", className),
|
|
3620
|
+
style: { ...containerStyles5, ...style },
|
|
3621
|
+
"data-testid": dataTestId,
|
|
3622
|
+
children: [
|
|
3623
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: actions1Styles, children: [
|
|
3624
|
+
onActionsClick && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Popover2.Root, { open: actionsOpen, onOpenChange: setActionsOpen, children: [
|
|
3625
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Popover2.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3626
|
+
"button",
|
|
3627
|
+
{
|
|
3628
|
+
type: "button",
|
|
3629
|
+
onClick: () => {
|
|
3630
|
+
setActionsOpen(!actionsOpen);
|
|
3631
|
+
onActionsClick();
|
|
3632
|
+
},
|
|
3633
|
+
onMouseEnter: () => setHoveredButton("actions"),
|
|
3634
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3635
|
+
onFocus: () => setFocusedButton("actions"),
|
|
3636
|
+
onBlur: () => setFocusedButton(null),
|
|
3637
|
+
style: getDropdownButtonStyle("actions"),
|
|
3638
|
+
"aria-label": "Actions",
|
|
3639
|
+
children: [
|
|
3640
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { style: dropdownTextStyles, children: [
|
|
3641
|
+
"Actions (",
|
|
3642
|
+
selectedCount,
|
|
3643
|
+
")"
|
|
3644
|
+
] }),
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.ChevronDown, { size: 16, color: "#2f2f2f" })
|
|
3646
|
+
]
|
|
3647
|
+
}
|
|
3648
|
+
) }),
|
|
3649
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Popover2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3650
|
+
Popover2.Content,
|
|
3651
|
+
{
|
|
3652
|
+
style: popoverContentStyles,
|
|
3653
|
+
sideOffset: 4,
|
|
3654
|
+
align: "start",
|
|
3655
|
+
children: [
|
|
3656
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3657
|
+
"button",
|
|
3658
|
+
{
|
|
3659
|
+
style: menuItemStyles,
|
|
3660
|
+
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "#f5f5f5",
|
|
3661
|
+
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "white",
|
|
3662
|
+
onClick: () => {
|
|
3663
|
+
console.log("Edit selected items");
|
|
3664
|
+
setActionsOpen(false);
|
|
3665
|
+
},
|
|
3666
|
+
children: "Edit selected items"
|
|
3667
|
+
}
|
|
3668
|
+
),
|
|
3669
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3670
|
+
"button",
|
|
3671
|
+
{
|
|
3672
|
+
style: menuItemStyles,
|
|
3673
|
+
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "#f5f5f5",
|
|
3674
|
+
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "white",
|
|
3675
|
+
onClick: () => {
|
|
3676
|
+
console.log("Delete selected items");
|
|
3677
|
+
setActionsOpen(false);
|
|
3678
|
+
},
|
|
3679
|
+
children: "Delete selected items"
|
|
3680
|
+
}
|
|
3681
|
+
),
|
|
3682
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3683
|
+
"button",
|
|
3684
|
+
{
|
|
3685
|
+
style: menuItemStyles,
|
|
3686
|
+
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "#f5f5f5",
|
|
3687
|
+
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "white",
|
|
3688
|
+
onClick: () => {
|
|
3689
|
+
console.log("Export selected items");
|
|
3690
|
+
setActionsOpen(false);
|
|
3691
|
+
},
|
|
3692
|
+
children: "Export selected items"
|
|
3693
|
+
}
|
|
3694
|
+
)
|
|
3695
|
+
]
|
|
3696
|
+
}
|
|
3697
|
+
) })
|
|
3698
|
+
] }),
|
|
3699
|
+
onUndoClick && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3700
|
+
"button",
|
|
3701
|
+
{
|
|
3702
|
+
type: "button",
|
|
3703
|
+
onClick: onUndoClick,
|
|
3704
|
+
disabled: undoDisabled,
|
|
3705
|
+
onMouseEnter: () => setHoveredButton("undo"),
|
|
3706
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3707
|
+
onFocus: () => setFocusedButton("undo"),
|
|
3708
|
+
onBlur: () => setFocusedButton(null),
|
|
3709
|
+
style: getIconButtonStyle("undo", undoDisabled),
|
|
3710
|
+
"aria-label": "Undo",
|
|
3711
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Undo2, { size: 16, color: "#2f2f2f" })
|
|
3712
|
+
}
|
|
3713
|
+
),
|
|
3714
|
+
onRedoClick && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3715
|
+
"button",
|
|
3716
|
+
{
|
|
3717
|
+
type: "button",
|
|
3718
|
+
onClick: onRedoClick,
|
|
3719
|
+
disabled: redoDisabled,
|
|
3720
|
+
onMouseEnter: () => setHoveredButton("redo"),
|
|
3721
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3722
|
+
onFocus: () => setFocusedButton("redo"),
|
|
3723
|
+
onBlur: () => setFocusedButton(null),
|
|
3724
|
+
style: getIconButtonStyle("redo", redoDisabled),
|
|
3725
|
+
"aria-label": "Redo",
|
|
3726
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Redo2, { size: 16, color: "#2f2f2f" })
|
|
3727
|
+
}
|
|
3728
|
+
),
|
|
3729
|
+
onHideColumnsClick && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Popover2.Root, { open: hideColumnsOpen, onOpenChange: setHideColumnsOpen, children: [
|
|
3730
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Popover2.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3731
|
+
"button",
|
|
3732
|
+
{
|
|
3733
|
+
type: "button",
|
|
3734
|
+
onClick: () => {
|
|
3735
|
+
setHideColumnsOpen(!hideColumnsOpen);
|
|
3736
|
+
onHideColumnsClick();
|
|
3737
|
+
},
|
|
3738
|
+
onMouseEnter: () => setHoveredButton("hideColumns"),
|
|
3739
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3740
|
+
onFocus: () => setFocusedButton("hideColumns"),
|
|
3741
|
+
onBlur: () => setFocusedButton(null),
|
|
3742
|
+
style: getDropdownButtonStyle("hideColumns"),
|
|
3743
|
+
"aria-label": "Hide Columns",
|
|
3744
|
+
children: [
|
|
3745
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: dropdownTextStyles, children: "Hide Columns" }),
|
|
3746
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.ChevronDown, { size: 16, color: "#2f2f2f" })
|
|
3747
|
+
]
|
|
3748
|
+
}
|
|
3749
|
+
) }),
|
|
3750
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Popover2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3751
|
+
Popover2.Content,
|
|
3752
|
+
{
|
|
3753
|
+
style: popoverContentStyles,
|
|
3754
|
+
sideOffset: 4,
|
|
3755
|
+
align: "start",
|
|
3756
|
+
children: [
|
|
3757
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3758
|
+
"button",
|
|
3759
|
+
{
|
|
3760
|
+
style: menuItemStyles,
|
|
3761
|
+
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "#f5f5f5",
|
|
3762
|
+
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "white",
|
|
3763
|
+
onClick: () => {
|
|
3764
|
+
console.log("Hide Name column");
|
|
3765
|
+
setHideColumnsOpen(false);
|
|
3766
|
+
},
|
|
3767
|
+
children: "Name"
|
|
3768
|
+
}
|
|
3769
|
+
),
|
|
3770
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3771
|
+
"button",
|
|
3772
|
+
{
|
|
3773
|
+
style: menuItemStyles,
|
|
3774
|
+
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "#f5f5f5",
|
|
3775
|
+
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "white",
|
|
3776
|
+
onClick: () => {
|
|
3777
|
+
console.log("Hide Email column");
|
|
3778
|
+
setHideColumnsOpen(false);
|
|
3779
|
+
},
|
|
3780
|
+
children: "Email"
|
|
3781
|
+
}
|
|
3782
|
+
),
|
|
3783
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3784
|
+
"button",
|
|
3785
|
+
{
|
|
3786
|
+
style: menuItemStyles,
|
|
3787
|
+
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "#f5f5f5",
|
|
3788
|
+
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "white",
|
|
3789
|
+
onClick: () => {
|
|
3790
|
+
console.log("Hide Status column");
|
|
3791
|
+
setHideColumnsOpen(false);
|
|
3792
|
+
},
|
|
3793
|
+
children: "Status"
|
|
3794
|
+
}
|
|
3795
|
+
),
|
|
3796
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3797
|
+
"button",
|
|
3798
|
+
{
|
|
3799
|
+
style: menuItemStyles,
|
|
3800
|
+
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "#f5f5f5",
|
|
3801
|
+
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "white",
|
|
3802
|
+
onClick: () => {
|
|
3803
|
+
console.log("Hide Date column");
|
|
3804
|
+
setHideColumnsOpen(false);
|
|
3805
|
+
},
|
|
3806
|
+
children: "Date"
|
|
3807
|
+
}
|
|
3808
|
+
)
|
|
3809
|
+
]
|
|
3810
|
+
}
|
|
3811
|
+
) })
|
|
3812
|
+
] })
|
|
3813
|
+
] }),
|
|
3814
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: actions2Styles, children: [
|
|
3815
|
+
onSearchClick && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3816
|
+
"button",
|
|
3817
|
+
{
|
|
3818
|
+
type: "button",
|
|
3819
|
+
onClick: onSearchClick,
|
|
3820
|
+
onMouseEnter: () => setHoveredButton("search"),
|
|
3821
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3822
|
+
onFocus: () => setFocusedButton("search"),
|
|
3823
|
+
onBlur: () => setFocusedButton(null),
|
|
3824
|
+
style: getIconButtonStyle("search"),
|
|
3825
|
+
"aria-label": "Search",
|
|
3826
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Search, { size: 16, color: "#2f2f2f" })
|
|
3827
|
+
}
|
|
3828
|
+
),
|
|
3829
|
+
onDownloadClick && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3830
|
+
"button",
|
|
3831
|
+
{
|
|
3832
|
+
type: "button",
|
|
3833
|
+
onClick: onDownloadClick,
|
|
3834
|
+
onMouseEnter: () => setHoveredButton("download"),
|
|
3835
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3836
|
+
onFocus: () => setFocusedButton("download"),
|
|
3837
|
+
onBlur: () => setFocusedButton(null),
|
|
3838
|
+
style: getIconButtonStyle("download"),
|
|
3839
|
+
"aria-label": "Download",
|
|
3840
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Download, { size: 16, color: "#2f2f2f" })
|
|
3841
|
+
}
|
|
3842
|
+
),
|
|
3843
|
+
onTooltipsClick && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3844
|
+
"button",
|
|
3845
|
+
{
|
|
3846
|
+
type: "button",
|
|
3847
|
+
onClick: onTooltipsClick,
|
|
3848
|
+
onMouseEnter: () => setHoveredButton("tooltips"),
|
|
3849
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3850
|
+
onFocus: () => setFocusedButton("tooltips"),
|
|
3851
|
+
onBlur: () => setFocusedButton(null),
|
|
3852
|
+
style: getIconButtonStyle("tooltips"),
|
|
3853
|
+
"aria-label": tooltipsEnabled ? "Disable tooltips" : "Enable tooltips",
|
|
3854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3855
|
+
import_lucide_react8.MessageSquare,
|
|
3856
|
+
{
|
|
3857
|
+
size: 16,
|
|
3858
|
+
color: "#2f2f2f"
|
|
3859
|
+
}
|
|
3860
|
+
)
|
|
3861
|
+
}
|
|
3862
|
+
),
|
|
3863
|
+
onSettingsClick && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3864
|
+
"button",
|
|
3865
|
+
{
|
|
3866
|
+
type: "button",
|
|
3867
|
+
onClick: onSettingsClick,
|
|
3868
|
+
onMouseEnter: () => setHoveredButton("settings"),
|
|
3869
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3870
|
+
onFocus: () => setFocusedButton("settings"),
|
|
3871
|
+
onBlur: () => setFocusedButton(null),
|
|
3872
|
+
style: getIconButtonStyle("settings"),
|
|
3873
|
+
"aria-label": "Settings",
|
|
3874
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Settings, { size: 16, color: "#2f2f2f" })
|
|
3875
|
+
}
|
|
3876
|
+
),
|
|
3877
|
+
onExpandClick && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3878
|
+
"button",
|
|
3879
|
+
{
|
|
3880
|
+
type: "button",
|
|
3881
|
+
onClick: onExpandClick,
|
|
3882
|
+
onMouseEnter: () => setHoveredButton("expand"),
|
|
3883
|
+
onMouseLeave: () => setHoveredButton(null),
|
|
3884
|
+
onFocus: () => setFocusedButton("expand"),
|
|
3885
|
+
onBlur: () => setFocusedButton(null),
|
|
3886
|
+
style: getIconButtonStyle("expand"),
|
|
3887
|
+
"aria-label": "Expand",
|
|
3888
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Expand, { size: 16, color: "#2f2f2f" })
|
|
3889
|
+
}
|
|
3890
|
+
)
|
|
3891
|
+
] })
|
|
3892
|
+
]
|
|
3893
|
+
}
|
|
3894
|
+
);
|
|
3895
|
+
}
|
|
3896
|
+
);
|
|
3897
|
+
TableControls.displayName = "TableControls";
|
|
3898
|
+
|
|
3899
|
+
// src/Table/Table.tsx
|
|
3900
|
+
var React19 = __toESM(require("react"));
|
|
3901
|
+
var import_clsx19 = require("clsx");
|
|
3902
|
+
var import_lucide_react9 = require("lucide-react");
|
|
3903
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3904
|
+
var tableStyles = {
|
|
3905
|
+
width: "100%",
|
|
3906
|
+
borderCollapse: "separate",
|
|
3907
|
+
borderSpacing: 0,
|
|
3908
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
3909
|
+
};
|
|
3910
|
+
var headerCellStyles = {
|
|
3911
|
+
height: "44px",
|
|
3912
|
+
paddingLeft: "16px",
|
|
3913
|
+
paddingRight: "16px",
|
|
3914
|
+
paddingTop: 0,
|
|
3915
|
+
paddingBottom: 0,
|
|
3916
|
+
backgroundColor: "#f8f8f8",
|
|
3917
|
+
borderBottom: "1px solid #efefef",
|
|
3918
|
+
fontSize: "13px",
|
|
3919
|
+
fontWeight: 600,
|
|
3920
|
+
color: "#2f2f2f",
|
|
3921
|
+
textAlign: "left",
|
|
3922
|
+
position: "relative"
|
|
3923
|
+
};
|
|
3924
|
+
var checkboxCellStyles = {
|
|
3925
|
+
width: "48px",
|
|
3926
|
+
paddingLeft: "16px",
|
|
3927
|
+
paddingRight: "8px"
|
|
3928
|
+
};
|
|
3929
|
+
var bodyCellStyles = {
|
|
3930
|
+
height: "41px",
|
|
3931
|
+
paddingLeft: "16px",
|
|
3932
|
+
paddingRight: "16px",
|
|
3933
|
+
paddingTop: "8px",
|
|
3934
|
+
paddingBottom: "8px",
|
|
3935
|
+
borderBottom: "1px solid #efefef",
|
|
3936
|
+
fontSize: "13px",
|
|
3937
|
+
color: "#2f2f2f"
|
|
3938
|
+
};
|
|
3939
|
+
var menuButtonStyles = {
|
|
3940
|
+
width: "24px",
|
|
3941
|
+
height: "24px",
|
|
3942
|
+
border: "none",
|
|
3943
|
+
backgroundColor: "transparent",
|
|
3944
|
+
cursor: "pointer",
|
|
3945
|
+
display: "inline-flex",
|
|
3946
|
+
alignItems: "center",
|
|
3947
|
+
justifyContent: "center",
|
|
3948
|
+
padding: 0,
|
|
3949
|
+
marginLeft: "8px",
|
|
3950
|
+
borderRadius: "4px",
|
|
3951
|
+
transition: "background-color 0.2s ease-in-out"
|
|
3952
|
+
};
|
|
3953
|
+
var rowStyles = {
|
|
3954
|
+
transition: "background-color 0.1s ease-in-out"
|
|
3955
|
+
};
|
|
3956
|
+
var Table = React19.forwardRef(
|
|
3957
|
+
({
|
|
3958
|
+
columns,
|
|
3959
|
+
rows,
|
|
3960
|
+
onRowSelectionChange,
|
|
3961
|
+
onSelectAllChange,
|
|
3962
|
+
allSelected = false,
|
|
3963
|
+
someSelected = false,
|
|
3964
|
+
className,
|
|
3965
|
+
style,
|
|
3966
|
+
"data-testid": dataTestId
|
|
3967
|
+
}, ref) => {
|
|
3968
|
+
const [hoveredRow, setHoveredRow] = React19.useState(null);
|
|
3969
|
+
const [hoveredMenuButton, setHoveredMenuButton] = React19.useState(null);
|
|
3970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3971
|
+
"table",
|
|
3972
|
+
{
|
|
3973
|
+
ref,
|
|
3974
|
+
className: (0, import_clsx19.clsx)("arbor-table", className),
|
|
3975
|
+
style: { ...tableStyles, ...style },
|
|
3976
|
+
"data-testid": dataTestId,
|
|
3977
|
+
children: [
|
|
3978
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("tr", { children: [
|
|
3979
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("th", { style: { ...headerCellStyles, ...checkboxCellStyles }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3980
|
+
Checkbox,
|
|
3981
|
+
{
|
|
3982
|
+
checked: allSelected,
|
|
3983
|
+
indeterminate: someSelected && !allSelected,
|
|
3984
|
+
onChange: onSelectAllChange,
|
|
3985
|
+
"aria-label": "Select all rows"
|
|
3986
|
+
}
|
|
3987
|
+
) }),
|
|
3988
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3989
|
+
"th",
|
|
3990
|
+
{
|
|
3991
|
+
style: {
|
|
3992
|
+
...headerCellStyles,
|
|
3993
|
+
...column.width ? { width: column.width } : {}
|
|
3994
|
+
},
|
|
3995
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
3996
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: column.label }),
|
|
3997
|
+
column.showMenu !== false && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3998
|
+
"button",
|
|
3999
|
+
{
|
|
4000
|
+
type: "button",
|
|
4001
|
+
onMouseEnter: () => setHoveredMenuButton(`header-${column.key}`),
|
|
4002
|
+
onMouseLeave: () => setHoveredMenuButton(null),
|
|
4003
|
+
style: {
|
|
4004
|
+
...menuButtonStyles,
|
|
4005
|
+
backgroundColor: hoveredMenuButton === `header-${column.key}` ? "#f5f5f5" : "transparent"
|
|
4006
|
+
},
|
|
4007
|
+
"aria-label": `${column.label} options`,
|
|
4008
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.MoreVertical, { size: 16, color: "#595959" })
|
|
4009
|
+
}
|
|
4010
|
+
)
|
|
4011
|
+
] })
|
|
4012
|
+
},
|
|
4013
|
+
column.key
|
|
4014
|
+
))
|
|
4015
|
+
] }) }),
|
|
4016
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("tbody", { children: rows.map((row, index) => {
|
|
4017
|
+
const isOdd = index % 2 === 0;
|
|
4018
|
+
const isHovered = hoveredRow === row.id;
|
|
4019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
4020
|
+
"tr",
|
|
4021
|
+
{
|
|
4022
|
+
onMouseEnter: () => setHoveredRow(row.id),
|
|
4023
|
+
onMouseLeave: () => setHoveredRow(null),
|
|
4024
|
+
style: {
|
|
4025
|
+
...rowStyles,
|
|
4026
|
+
backgroundColor: isHovered ? "#fafafa" : isOdd ? "white" : "#f8f8f8"
|
|
4027
|
+
},
|
|
4028
|
+
children: [
|
|
4029
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("td", { style: { ...bodyCellStyles, ...checkboxCellStyles }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
4030
|
+
Checkbox,
|
|
4031
|
+
{
|
|
4032
|
+
checked: row.selected || false,
|
|
4033
|
+
onChange: (checked) => onRowSelectionChange?.(row.id, checked),
|
|
4034
|
+
"aria-label": `Select row ${row.id}`
|
|
4035
|
+
}
|
|
4036
|
+
) }),
|
|
4037
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("td", { style: bodyCellStyles, children: row.cells[column.key] }, column.key))
|
|
4038
|
+
]
|
|
4039
|
+
},
|
|
4040
|
+
row.id
|
|
4041
|
+
);
|
|
4042
|
+
}) })
|
|
4043
|
+
]
|
|
4044
|
+
}
|
|
4045
|
+
);
|
|
4046
|
+
}
|
|
4047
|
+
);
|
|
4048
|
+
Table.displayName = "Table";
|
|
4049
|
+
|
|
4050
|
+
// src/Avatar/Avatar.tsx
|
|
4051
|
+
var React20 = __toESM(require("react"));
|
|
4052
|
+
var import_lucide_react10 = require("lucide-react");
|
|
4053
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4054
|
+
var sizeConfig = {
|
|
4055
|
+
small: {
|
|
4056
|
+
size: 20,
|
|
4057
|
+
fontSize: 0,
|
|
4058
|
+
// Too small for initials
|
|
4059
|
+
fontWeight: 400,
|
|
4060
|
+
iconSize: 12,
|
|
4061
|
+
borderRadius: "99px"
|
|
4062
|
+
},
|
|
4063
|
+
medium: {
|
|
4064
|
+
size: 32,
|
|
4065
|
+
fontSize: 13,
|
|
4066
|
+
fontWeight: 400,
|
|
4067
|
+
iconSize: 16,
|
|
4068
|
+
borderRadius: "99px"
|
|
4069
|
+
},
|
|
4070
|
+
large: {
|
|
4071
|
+
size: 48,
|
|
4072
|
+
fontSize: 13,
|
|
4073
|
+
fontWeight: 400,
|
|
4074
|
+
iconSize: 24,
|
|
4075
|
+
borderRadius: "4px"
|
|
4076
|
+
},
|
|
4077
|
+
"extra-large": {
|
|
4078
|
+
size: 96,
|
|
4079
|
+
fontSize: 27,
|
|
4080
|
+
fontWeight: 600,
|
|
4081
|
+
iconSize: 48,
|
|
4082
|
+
borderRadius: "8px"
|
|
4083
|
+
}
|
|
4084
|
+
};
|
|
4085
|
+
var Avatar = React20.forwardRef(
|
|
4086
|
+
({
|
|
4087
|
+
size = "medium",
|
|
4088
|
+
src,
|
|
4089
|
+
initials,
|
|
4090
|
+
alt = "Avatar",
|
|
4091
|
+
className,
|
|
4092
|
+
style,
|
|
4093
|
+
"data-testid": dataTestId
|
|
4094
|
+
}, ref) => {
|
|
4095
|
+
const [isHovered, setIsHovered] = React20.useState(false);
|
|
4096
|
+
const [imageError, setImageError] = React20.useState(false);
|
|
4097
|
+
const config = sizeConfig[size];
|
|
4098
|
+
const hasHoverState = size === "small";
|
|
4099
|
+
const containerStyles6 = {
|
|
4100
|
+
width: `${config.size}px`,
|
|
4101
|
+
height: `${config.size}px`,
|
|
4102
|
+
borderRadius: config.borderRadius,
|
|
4103
|
+
border: "1px solid #efefef",
|
|
4104
|
+
overflow: "hidden",
|
|
4105
|
+
position: "relative",
|
|
4106
|
+
backgroundColor: "#f8f8f8",
|
|
4107
|
+
display: "flex",
|
|
4108
|
+
alignItems: "center",
|
|
4109
|
+
justifyContent: "center",
|
|
4110
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4111
|
+
cursor: "default",
|
|
4112
|
+
boxSizing: "border-box",
|
|
4113
|
+
...style
|
|
4114
|
+
};
|
|
4115
|
+
const hoverOverlayStyles = {
|
|
4116
|
+
position: "absolute",
|
|
4117
|
+
inset: 0,
|
|
4118
|
+
pointerEvents: "none",
|
|
4119
|
+
boxShadow: isHovered && hasHoverState ? "inset 0px 4px 100px 0px rgba(32, 32, 32, 0.3)" : "none",
|
|
4120
|
+
borderRadius: config.borderRadius,
|
|
4121
|
+
transition: "box-shadow 0.2s ease-in-out"
|
|
4122
|
+
};
|
|
4123
|
+
const imageStyles = {
|
|
4124
|
+
width: "100%",
|
|
4125
|
+
height: "100%",
|
|
4126
|
+
objectFit: "cover"
|
|
4127
|
+
};
|
|
4128
|
+
const initialsStyles = {
|
|
4129
|
+
fontSize: `${config.fontSize}px`,
|
|
4130
|
+
fontWeight: config.fontWeight,
|
|
4131
|
+
color: "#2f2f2f",
|
|
4132
|
+
lineHeight: 1.5,
|
|
4133
|
+
textAlign: "center",
|
|
4134
|
+
userSelect: "none"
|
|
4135
|
+
};
|
|
4136
|
+
const showImage = src && !imageError;
|
|
4137
|
+
const showInitials = !showImage && initials && size !== "small";
|
|
4138
|
+
const showPlaceholder = !showImage && !showInitials;
|
|
4139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
4140
|
+
"div",
|
|
4141
|
+
{
|
|
4142
|
+
ref,
|
|
4143
|
+
className,
|
|
4144
|
+
style: containerStyles6,
|
|
4145
|
+
onMouseEnter: () => setIsHovered(true),
|
|
4146
|
+
onMouseLeave: () => setIsHovered(false),
|
|
4147
|
+
"data-testid": dataTestId,
|
|
4148
|
+
children: [
|
|
4149
|
+
showImage && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4150
|
+
"img",
|
|
4151
|
+
{
|
|
4152
|
+
src,
|
|
4153
|
+
alt,
|
|
4154
|
+
style: imageStyles,
|
|
4155
|
+
onError: () => setImageError(true)
|
|
4156
|
+
}
|
|
4157
|
+
),
|
|
4158
|
+
showInitials && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: initialsStyles, children: initials.slice(0, 2).toUpperCase() }),
|
|
4159
|
+
showPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.User, { size: config.iconSize, color: "#d1d1d1", strokeWidth: 2 }),
|
|
4160
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: hoverOverlayStyles })
|
|
4161
|
+
]
|
|
4162
|
+
}
|
|
4163
|
+
);
|
|
4164
|
+
}
|
|
4165
|
+
);
|
|
4166
|
+
Avatar.displayName = "Avatar";
|
|
4167
|
+
|
|
4168
|
+
// src/SearchGlobal/SearchGlobal.tsx
|
|
4169
|
+
var React21 = __toESM(require("react"));
|
|
4170
|
+
var import_lucide_react11 = require("lucide-react");
|
|
4171
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4172
|
+
var SearchGlobal = React21.forwardRef(
|
|
4173
|
+
({
|
|
4174
|
+
value = "",
|
|
4175
|
+
onChange,
|
|
4176
|
+
onSubmit,
|
|
4177
|
+
onClear,
|
|
4178
|
+
placeholder = "Search",
|
|
4179
|
+
className,
|
|
4180
|
+
style,
|
|
4181
|
+
"data-testid": dataTestId
|
|
4182
|
+
}, ref) => {
|
|
4183
|
+
const [isFocused, setIsFocused] = React21.useState(false);
|
|
4184
|
+
const [isHovered, setIsHovered] = React21.useState(false);
|
|
4185
|
+
const inputRef = React21.useRef(null);
|
|
4186
|
+
React21.useImperativeHandle(ref, () => inputRef.current);
|
|
4187
|
+
const handleFocus = () => {
|
|
4188
|
+
setIsFocused(true);
|
|
4189
|
+
};
|
|
4190
|
+
const handleBlur = () => {
|
|
4191
|
+
setIsFocused(false);
|
|
4192
|
+
};
|
|
4193
|
+
const handleChange = (e) => {
|
|
4194
|
+
onChange?.(e.target.value);
|
|
4195
|
+
};
|
|
4196
|
+
const handleKeyDown = (e) => {
|
|
4197
|
+
if (e.key === "Enter") {
|
|
4198
|
+
onSubmit?.(value);
|
|
4199
|
+
}
|
|
4200
|
+
};
|
|
4201
|
+
const handleClear = () => {
|
|
4202
|
+
onChange?.("");
|
|
4203
|
+
onClear?.();
|
|
4204
|
+
inputRef.current?.focus();
|
|
4205
|
+
};
|
|
4206
|
+
const containerStyles6 = {
|
|
4207
|
+
position: "relative",
|
|
4208
|
+
width: isFocused ? "300px" : "160px",
|
|
4209
|
+
height: "32px",
|
|
4210
|
+
backgroundColor: isFocused ? "#ffffff" : isHovered ? "#efefef" : "#f8f8f8",
|
|
4211
|
+
borderRadius: "16px",
|
|
4212
|
+
padding: "8px 16px",
|
|
4213
|
+
display: "flex",
|
|
4214
|
+
alignItems: "center",
|
|
4215
|
+
gap: isFocused ? "8px" : "8px",
|
|
4216
|
+
cursor: "text",
|
|
4217
|
+
transition: "all 0.2s ease-in-out",
|
|
4218
|
+
boxSizing: "border-box",
|
|
4219
|
+
border: isFocused ? "1px solid #efefef" : "none",
|
|
4220
|
+
boxShadow: isFocused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
4221
|
+
marginLeft: isFocused ? "-140px" : "0",
|
|
4222
|
+
// Expand to the left
|
|
4223
|
+
...style
|
|
4224
|
+
};
|
|
4225
|
+
const iconContainerStyles2 = {
|
|
4226
|
+
display: "flex",
|
|
4227
|
+
alignItems: "center",
|
|
4228
|
+
justifyContent: "center",
|
|
4229
|
+
flexShrink: 0,
|
|
4230
|
+
padding: "2px"
|
|
4231
|
+
};
|
|
4232
|
+
const inputStyles5 = {
|
|
4233
|
+
border: "none",
|
|
4234
|
+
outline: "none",
|
|
4235
|
+
backgroundColor: "transparent",
|
|
4236
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4237
|
+
fontSize: "13px",
|
|
4238
|
+
fontWeight: 400,
|
|
4239
|
+
color: "#2f2f2f",
|
|
4240
|
+
lineHeight: "1.5",
|
|
4241
|
+
flex: 1,
|
|
4242
|
+
width: "100%",
|
|
4243
|
+
minWidth: 0
|
|
4244
|
+
};
|
|
4245
|
+
const keyboardShortcutStyles = {
|
|
4246
|
+
display: "flex",
|
|
4247
|
+
alignItems: "center",
|
|
4248
|
+
gap: "0px",
|
|
4249
|
+
flexShrink: 0
|
|
4250
|
+
};
|
|
4251
|
+
const keyStyles = {
|
|
4252
|
+
border: "1px solid #2f2f2f",
|
|
4253
|
+
borderRadius: "5px",
|
|
4254
|
+
padding: "0px 3px",
|
|
4255
|
+
height: "16px",
|
|
4256
|
+
display: "flex",
|
|
4257
|
+
alignItems: "center",
|
|
4258
|
+
justifyContent: "center",
|
|
4259
|
+
fontFamily: "'Work Sans', sans-serif",
|
|
4260
|
+
fontSize: "8px",
|
|
4261
|
+
fontWeight: 400,
|
|
4262
|
+
color: "#2f2f2f",
|
|
4263
|
+
letterSpacing: "-0.08px",
|
|
4264
|
+
lineHeight: "1.5",
|
|
4265
|
+
minWidth: "16px"
|
|
4266
|
+
};
|
|
4267
|
+
const plusStyles = {
|
|
4268
|
+
fontFamily: "'Work Sans', sans-serif",
|
|
4269
|
+
fontSize: "8px",
|
|
4270
|
+
fontWeight: 400,
|
|
4271
|
+
color: "#2f2f2f",
|
|
4272
|
+
letterSpacing: "-0.08px",
|
|
4273
|
+
lineHeight: "1.5",
|
|
4274
|
+
padding: "0 2px"
|
|
4275
|
+
};
|
|
4276
|
+
const clearButtonStyles = {
|
|
4277
|
+
display: "flex",
|
|
4278
|
+
alignItems: "center",
|
|
4279
|
+
justifyContent: "center",
|
|
4280
|
+
flexShrink: 0,
|
|
4281
|
+
width: "16px",
|
|
4282
|
+
height: "16px",
|
|
4283
|
+
cursor: "pointer",
|
|
4284
|
+
border: "none",
|
|
4285
|
+
background: "none",
|
|
4286
|
+
padding: 0
|
|
4287
|
+
};
|
|
4288
|
+
const showKeyboardShortcut = isHovered && !isFocused;
|
|
4289
|
+
const showClearButton = isFocused;
|
|
4290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4291
|
+
"div",
|
|
4292
|
+
{
|
|
4293
|
+
className,
|
|
4294
|
+
style: containerStyles6,
|
|
4295
|
+
onMouseEnter: () => setIsHovered(true),
|
|
4296
|
+
onMouseLeave: () => setIsHovered(false),
|
|
4297
|
+
onClick: () => inputRef.current?.focus(),
|
|
4298
|
+
"data-testid": dataTestId,
|
|
4299
|
+
children: [
|
|
4300
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: iconContainerStyles2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.Search, { size: 12, color: "#2f2f2f", strokeWidth: 2 }) }),
|
|
4301
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4302
|
+
"input",
|
|
4303
|
+
{
|
|
4304
|
+
ref: inputRef,
|
|
4305
|
+
type: "text",
|
|
4306
|
+
value,
|
|
4307
|
+
onChange: handleChange,
|
|
4308
|
+
onFocus: handleFocus,
|
|
4309
|
+
onBlur: handleBlur,
|
|
4310
|
+
onKeyDown: handleKeyDown,
|
|
4311
|
+
placeholder: isFocused ? "" : placeholder,
|
|
4312
|
+
style: inputStyles5
|
|
4313
|
+
}
|
|
4314
|
+
),
|
|
4315
|
+
showKeyboardShortcut && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: keyboardShortcutStyles, children: [
|
|
4316
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: keyStyles, children: "\u2318" }),
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: plusStyles, children: "+" }),
|
|
4318
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: keyStyles, children: "K" })
|
|
4319
|
+
] }),
|
|
4320
|
+
showClearButton && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4321
|
+
"button",
|
|
4322
|
+
{
|
|
4323
|
+
type: "button",
|
|
4324
|
+
onClick: handleClear,
|
|
4325
|
+
style: clearButtonStyles,
|
|
4326
|
+
"aria-label": "Clear search",
|
|
4327
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.X, { size: 13.333, color: "#2f2f2f", strokeWidth: 2 })
|
|
4328
|
+
}
|
|
4329
|
+
)
|
|
4330
|
+
]
|
|
4331
|
+
}
|
|
4332
|
+
);
|
|
4333
|
+
}
|
|
4334
|
+
);
|
|
4335
|
+
SearchGlobal.displayName = "SearchGlobal";
|
|
4336
|
+
|
|
4337
|
+
// src/SearchOnPage/SearchOnPage.tsx
|
|
4338
|
+
var React22 = __toESM(require("react"));
|
|
4339
|
+
var import_lucide_react12 = require("lucide-react");
|
|
4340
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4341
|
+
var SearchOnPage = React22.forwardRef(
|
|
4342
|
+
({
|
|
4343
|
+
value = "",
|
|
4344
|
+
onChange,
|
|
4345
|
+
onSubmit,
|
|
4346
|
+
onClear,
|
|
4347
|
+
placeholder = "Search Reports",
|
|
4348
|
+
className,
|
|
4349
|
+
style,
|
|
4350
|
+
"data-testid": dataTestId
|
|
4351
|
+
}, ref) => {
|
|
4352
|
+
const [isFocused, setIsFocused] = React22.useState(false);
|
|
4353
|
+
const [isHovered, setIsHovered] = React22.useState(false);
|
|
4354
|
+
const inputRef = React22.useRef(null);
|
|
4355
|
+
React22.useImperativeHandle(ref, () => inputRef.current);
|
|
4356
|
+
const handleFocus = () => {
|
|
4357
|
+
setIsFocused(true);
|
|
4358
|
+
};
|
|
4359
|
+
const handleBlur = () => {
|
|
4360
|
+
setIsFocused(false);
|
|
4361
|
+
};
|
|
4362
|
+
const handleChange = (e) => {
|
|
4363
|
+
onChange?.(e.target.value);
|
|
4364
|
+
};
|
|
4365
|
+
const handleKeyDown = (e) => {
|
|
4366
|
+
if (e.key === "Enter") {
|
|
4367
|
+
onSubmit?.(value);
|
|
4368
|
+
}
|
|
4369
|
+
};
|
|
4370
|
+
const handleClear = () => {
|
|
4371
|
+
onChange?.("");
|
|
4372
|
+
onClear?.();
|
|
4373
|
+
inputRef.current?.focus();
|
|
4374
|
+
};
|
|
4375
|
+
const containerStyles6 = {
|
|
4376
|
+
position: "relative",
|
|
4377
|
+
width: "200px",
|
|
4378
|
+
height: "32px",
|
|
4379
|
+
backgroundColor: isFocused ? "#ffffff" : isHovered ? "#efefef" : "#ffffff",
|
|
4380
|
+
borderRadius: "16px",
|
|
4381
|
+
padding: "8px 16px",
|
|
4382
|
+
display: "flex",
|
|
4383
|
+
alignItems: "center",
|
|
4384
|
+
gap: "8px",
|
|
4385
|
+
cursor: "text",
|
|
4386
|
+
transition: "all 0.2s ease-in-out",
|
|
4387
|
+
boxSizing: "border-box",
|
|
4388
|
+
border: isFocused ? "1px solid #efefef" : "none",
|
|
4389
|
+
boxShadow: isFocused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
4390
|
+
...style
|
|
4391
|
+
};
|
|
4392
|
+
const iconContainerStyles2 = {
|
|
4393
|
+
display: "flex",
|
|
4394
|
+
alignItems: "center",
|
|
4395
|
+
justifyContent: "center",
|
|
4396
|
+
flexShrink: 0,
|
|
4397
|
+
padding: "2px"
|
|
4398
|
+
};
|
|
4399
|
+
const inputStyles5 = {
|
|
4400
|
+
border: "none",
|
|
4401
|
+
outline: "none",
|
|
4402
|
+
backgroundColor: "transparent",
|
|
4403
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4404
|
+
fontSize: "13px",
|
|
4405
|
+
fontWeight: 400,
|
|
4406
|
+
color: "#2f2f2f",
|
|
4407
|
+
lineHeight: "1.5",
|
|
4408
|
+
flex: 1,
|
|
4409
|
+
width: "100%",
|
|
4410
|
+
minWidth: 0
|
|
4411
|
+
};
|
|
4412
|
+
const clearButtonStyles = {
|
|
4413
|
+
display: "flex",
|
|
4414
|
+
alignItems: "center",
|
|
4415
|
+
justifyContent: "center",
|
|
4416
|
+
flexShrink: 0,
|
|
4417
|
+
width: "16px",
|
|
4418
|
+
height: "16px",
|
|
4419
|
+
cursor: "pointer",
|
|
4420
|
+
border: "none",
|
|
4421
|
+
background: "none",
|
|
4422
|
+
padding: 0
|
|
4423
|
+
};
|
|
4424
|
+
const showClearButton = isFocused && value.length > 0;
|
|
4425
|
+
const iconColor = isFocused || isHovered ? "#2f2f2f" : "#595959";
|
|
4426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4427
|
+
"div",
|
|
4428
|
+
{
|
|
4429
|
+
className,
|
|
4430
|
+
style: containerStyles6,
|
|
4431
|
+
onMouseEnter: () => setIsHovered(true),
|
|
4432
|
+
onMouseLeave: () => setIsHovered(false),
|
|
4433
|
+
onClick: () => inputRef.current?.focus(),
|
|
4434
|
+
"data-testid": dataTestId,
|
|
4435
|
+
children: [
|
|
4436
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: iconContainerStyles2, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.Search, { size: 12, color: iconColor, strokeWidth: 2 }) }),
|
|
4437
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4438
|
+
"input",
|
|
4439
|
+
{
|
|
4440
|
+
ref: inputRef,
|
|
4441
|
+
type: "text",
|
|
4442
|
+
value,
|
|
4443
|
+
onChange: handleChange,
|
|
4444
|
+
onFocus: handleFocus,
|
|
4445
|
+
onBlur: handleBlur,
|
|
4446
|
+
onKeyDown: handleKeyDown,
|
|
4447
|
+
placeholder: isFocused ? "" : placeholder,
|
|
4448
|
+
style: inputStyles5
|
|
4449
|
+
}
|
|
4450
|
+
),
|
|
4451
|
+
showClearButton && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4452
|
+
"button",
|
|
4453
|
+
{
|
|
4454
|
+
type: "button",
|
|
4455
|
+
onClick: handleClear,
|
|
4456
|
+
style: clearButtonStyles,
|
|
4457
|
+
"aria-label": "Clear search",
|
|
4458
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.X, { size: 13.333, color: "#2f2f2f", strokeWidth: 2 })
|
|
4459
|
+
}
|
|
4460
|
+
)
|
|
4461
|
+
]
|
|
4462
|
+
}
|
|
4463
|
+
);
|
|
4464
|
+
}
|
|
4465
|
+
);
|
|
4466
|
+
SearchOnPage.displayName = "SearchOnPage";
|
|
4467
|
+
|
|
4468
|
+
// src/Breadcrumbs/Breadcrumbs.tsx
|
|
4469
|
+
var React23 = __toESM(require("react"));
|
|
4470
|
+
var import_lucide_react13 = require("lucide-react");
|
|
4471
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4472
|
+
var Breadcrumbs = React23.forwardRef(
|
|
4473
|
+
({
|
|
4474
|
+
items,
|
|
4475
|
+
onCopy,
|
|
4476
|
+
className,
|
|
4477
|
+
style,
|
|
4478
|
+
"data-testid": dataTestId
|
|
4479
|
+
}, ref) => {
|
|
4480
|
+
const [hoveredIndex, setHoveredIndex] = React23.useState(null);
|
|
4481
|
+
const [focusedIndex, setFocusedIndex] = React23.useState(null);
|
|
4482
|
+
const [showCopyTooltip, setShowCopyTooltip] = React23.useState(false);
|
|
4483
|
+
const [ellipsisFocused, setEllipsisFocused] = React23.useState(false);
|
|
4484
|
+
const [ellipsisHovered, setEllipsisHovered] = React23.useState(false);
|
|
4485
|
+
const displayItems = React23.useMemo(() => {
|
|
4486
|
+
if (items.length > 6) {
|
|
4487
|
+
return [items[0], { label: "...", isEllipsis: true }, items[items.length - 1]];
|
|
4488
|
+
}
|
|
4489
|
+
return items;
|
|
4490
|
+
}, [items]);
|
|
4491
|
+
const handleCopy = () => {
|
|
4492
|
+
onCopy?.();
|
|
4493
|
+
const trail = items.map((item) => item.label).join(" / ");
|
|
4494
|
+
navigator.clipboard.writeText(trail);
|
|
4495
|
+
};
|
|
4496
|
+
const containerStyles6 = {
|
|
4497
|
+
display: "flex",
|
|
4498
|
+
alignItems: "center",
|
|
4499
|
+
gap: "8px",
|
|
4500
|
+
...style
|
|
4501
|
+
};
|
|
4502
|
+
const breadcrumbItemStyles = (index, isActive, isEllipsis) => {
|
|
4503
|
+
const isFocused = focusedIndex === index;
|
|
4504
|
+
if (isEllipsis) {
|
|
4505
|
+
return {
|
|
4506
|
+
display: "flex",
|
|
4507
|
+
alignItems: "center",
|
|
4508
|
+
gap: "4px",
|
|
4509
|
+
height: "24px",
|
|
4510
|
+
overflow: "hidden"
|
|
4511
|
+
};
|
|
4512
|
+
}
|
|
4513
|
+
return {
|
|
4514
|
+
display: "flex",
|
|
4515
|
+
alignItems: "center",
|
|
4516
|
+
gap: "4px",
|
|
4517
|
+
height: "24px",
|
|
4518
|
+
overflow: "hidden",
|
|
4519
|
+
backgroundColor: isFocused ? "rgba(255, 255, 255, 0.01)" : "transparent",
|
|
4520
|
+
borderRadius: "99px",
|
|
4521
|
+
boxShadow: isFocused ? "0px 0px 0px 3px #3cad51" : "none",
|
|
4522
|
+
padding: isFocused ? "0 6px" : "0 2px",
|
|
4523
|
+
margin: isFocused ? "0" : "0 4px",
|
|
4524
|
+
cursor: isActive ? "default" : "pointer",
|
|
4525
|
+
textDecoration: "none"
|
|
4526
|
+
};
|
|
4527
|
+
};
|
|
4528
|
+
const linkStyles = (isActive, isHovered) => ({
|
|
4529
|
+
fontFamily: isActive ? "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" : "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4530
|
+
fontSize: "13px",
|
|
4531
|
+
fontWeight: isActive ? 600 : 400,
|
|
4532
|
+
color: isActive ? isHovered ? "#0e8a0e" : "#2f2f2f" : isHovered ? "#0e8a0e" : "#595959",
|
|
4533
|
+
lineHeight: "1.5",
|
|
4534
|
+
whiteSpace: "nowrap"
|
|
4535
|
+
});
|
|
4536
|
+
const dividerStyles = {
|
|
4537
|
+
fontFamily: "'PT Sans', sans-serif",
|
|
4538
|
+
fontSize: "14px",
|
|
4539
|
+
color: "#595959",
|
|
4540
|
+
lineHeight: "normal",
|
|
4541
|
+
whiteSpace: "nowrap"
|
|
4542
|
+
};
|
|
4543
|
+
const ellipsisButtonStyles = {
|
|
4544
|
+
display: "flex",
|
|
4545
|
+
alignItems: "center",
|
|
4546
|
+
justifyContent: "center",
|
|
4547
|
+
width: "24px",
|
|
4548
|
+
height: "24px",
|
|
4549
|
+
borderRadius: "99px",
|
|
4550
|
+
border: "none",
|
|
4551
|
+
background: "transparent",
|
|
4552
|
+
cursor: "pointer",
|
|
4553
|
+
backgroundColor: ellipsisFocused ? "rgba(255, 255, 255, 0.01)" : ellipsisHovered ? "#efefef" : "transparent",
|
|
4554
|
+
boxShadow: ellipsisFocused ? "0px 0px 0px 3px #3cad51" : "none"
|
|
4555
|
+
};
|
|
4556
|
+
const copyButtonStyles = {
|
|
4557
|
+
display: "flex",
|
|
4558
|
+
alignItems: "center",
|
|
4559
|
+
justifyContent: "center",
|
|
4560
|
+
width: "24px",
|
|
4561
|
+
height: "24px",
|
|
4562
|
+
borderRadius: "99px",
|
|
4563
|
+
border: "none",
|
|
4564
|
+
background: showCopyTooltip ? "#efefef" : "transparent",
|
|
4565
|
+
cursor: "pointer",
|
|
4566
|
+
position: "relative"
|
|
4567
|
+
};
|
|
4568
|
+
const tooltipStyles2 = {
|
|
4569
|
+
position: "absolute",
|
|
4570
|
+
top: "100%",
|
|
4571
|
+
left: "50%",
|
|
4572
|
+
transform: "translateX(-50%)",
|
|
4573
|
+
marginTop: "8px",
|
|
4574
|
+
backgroundColor: "#2f2f2f",
|
|
4575
|
+
color: "white",
|
|
4576
|
+
padding: "12px",
|
|
4577
|
+
borderRadius: "8px",
|
|
4578
|
+
fontSize: "13px",
|
|
4579
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
4580
|
+
fontWeight: 400,
|
|
4581
|
+
lineHeight: "1.5",
|
|
4582
|
+
whiteSpace: "nowrap",
|
|
4583
|
+
boxShadow: "0px 4px 12px rgba(32, 32, 32, 0.08)",
|
|
4584
|
+
zIndex: 1e3
|
|
4585
|
+
};
|
|
4586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4587
|
+
"div",
|
|
4588
|
+
{
|
|
4589
|
+
ref,
|
|
4590
|
+
className,
|
|
4591
|
+
style: containerStyles6,
|
|
4592
|
+
"data-testid": dataTestId,
|
|
4593
|
+
children: displayItems.map((item, index) => {
|
|
4594
|
+
const isActive = index === displayItems.length - 1;
|
|
4595
|
+
const isEllipsis = "isEllipsis" in item && item.isEllipsis;
|
|
4596
|
+
if (isEllipsis) {
|
|
4597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(React23.Fragment, { children: [
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4599
|
+
"button",
|
|
4600
|
+
{
|
|
4601
|
+
style: ellipsisButtonStyles,
|
|
4602
|
+
onFocus: () => setEllipsisFocused(true),
|
|
4603
|
+
onBlur: () => setEllipsisFocused(false),
|
|
4604
|
+
onMouseEnter: () => setEllipsisHovered(true),
|
|
4605
|
+
onMouseLeave: () => setEllipsisHovered(false),
|
|
4606
|
+
"aria-label": "More breadcrumbs",
|
|
4607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4608
|
+
import_lucide_react13.MoreHorizontal,
|
|
4609
|
+
{
|
|
4610
|
+
size: 12,
|
|
4611
|
+
color: "#2f2f2f",
|
|
4612
|
+
strokeWidth: 2,
|
|
4613
|
+
style: { display: "block", flexShrink: 0 }
|
|
4614
|
+
}
|
|
4615
|
+
)
|
|
4616
|
+
}
|
|
4617
|
+
),
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: dividerStyles, children: " /" })
|
|
4619
|
+
] }, `ellipsis-${index}`);
|
|
4620
|
+
}
|
|
4621
|
+
const breadcrumbItem = item;
|
|
4622
|
+
if (isActive) {
|
|
4623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(React23.Fragment, { children: [
|
|
4624
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4625
|
+
"div",
|
|
4626
|
+
{
|
|
4627
|
+
style: breadcrumbItemStyles(index, true),
|
|
4628
|
+
onMouseEnter: () => setHoveredIndex(index),
|
|
4629
|
+
onMouseLeave: () => setHoveredIndex(null),
|
|
4630
|
+
onFocus: () => setFocusedIndex(index),
|
|
4631
|
+
onBlur: () => setFocusedIndex(null),
|
|
4632
|
+
tabIndex: 0,
|
|
4633
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: linkStyles(true, hoveredIndex === index), children: breadcrumbItem.label })
|
|
4634
|
+
}
|
|
4635
|
+
),
|
|
4636
|
+
onCopy && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4637
|
+
"button",
|
|
4638
|
+
{
|
|
4639
|
+
style: copyButtonStyles,
|
|
4640
|
+
onClick: handleCopy,
|
|
4641
|
+
onMouseEnter: () => setShowCopyTooltip(true),
|
|
4642
|
+
onMouseLeave: () => setShowCopyTooltip(false),
|
|
4643
|
+
"aria-label": "Copy breadcrumb trail",
|
|
4644
|
+
children: [
|
|
4645
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4646
|
+
import_lucide_react13.Link,
|
|
4647
|
+
{
|
|
4648
|
+
size: 12,
|
|
4649
|
+
color: "#2f2f2f",
|
|
4650
|
+
strokeWidth: 2,
|
|
4651
|
+
style: { display: "block", flexShrink: 0 }
|
|
4652
|
+
}
|
|
4653
|
+
),
|
|
4654
|
+
showCopyTooltip && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: tooltipStyles2, children: "Copy breadcrumb trail" })
|
|
4655
|
+
]
|
|
4656
|
+
}
|
|
4657
|
+
)
|
|
4658
|
+
] }, index);
|
|
4659
|
+
}
|
|
4660
|
+
const Element = breadcrumbItem.href ? "a" : "button";
|
|
4661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(React23.Fragment, { children: [
|
|
4662
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4663
|
+
Element,
|
|
4664
|
+
{
|
|
4665
|
+
...breadcrumbItem.href ? { href: breadcrumbItem.href } : {},
|
|
4666
|
+
style: {
|
|
4667
|
+
...breadcrumbItemStyles(index, false),
|
|
4668
|
+
border: "none",
|
|
4669
|
+
background: "transparent"
|
|
4670
|
+
},
|
|
4671
|
+
onClick: (e) => {
|
|
4672
|
+
if (!breadcrumbItem.href && breadcrumbItem.onClick) {
|
|
4673
|
+
e.preventDefault();
|
|
4674
|
+
breadcrumbItem.onClick();
|
|
4675
|
+
}
|
|
4676
|
+
},
|
|
4677
|
+
onMouseEnter: () => setHoveredIndex(index),
|
|
4678
|
+
onMouseLeave: () => setHoveredIndex(null),
|
|
4679
|
+
onFocus: () => setFocusedIndex(index),
|
|
4680
|
+
onBlur: () => setFocusedIndex(null),
|
|
4681
|
+
children: [
|
|
4682
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: linkStyles(false, hoveredIndex === index), children: breadcrumbItem.label }),
|
|
4683
|
+
breadcrumbItem.hasDropdown && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4684
|
+
import_lucide_react13.ChevronDown,
|
|
4685
|
+
{
|
|
4686
|
+
size: 12,
|
|
4687
|
+
color: hoveredIndex === index ? "#0e8a0e" : "#595959",
|
|
4688
|
+
strokeWidth: 2,
|
|
4689
|
+
style: { marginLeft: "2px", display: "inline-block", flexShrink: 0 }
|
|
4690
|
+
}
|
|
4691
|
+
)
|
|
4692
|
+
]
|
|
4693
|
+
}
|
|
4694
|
+
),
|
|
4695
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: dividerStyles, children: " /" })
|
|
4696
|
+
] }, index);
|
|
4697
|
+
})
|
|
4698
|
+
}
|
|
4699
|
+
);
|
|
4700
|
+
}
|
|
4701
|
+
);
|
|
4702
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1334
4703
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1335
4704
|
0 && (module.exports = {
|
|
4705
|
+
Avatar,
|
|
4706
|
+
Banner,
|
|
4707
|
+
Breadcrumbs,
|
|
1336
4708
|
Button,
|
|
1337
4709
|
Card,
|
|
1338
4710
|
Checkbox,
|
|
1339
4711
|
Combobox,
|
|
4712
|
+
DatePicker,
|
|
1340
4713
|
Input,
|
|
1341
4714
|
NumericInput,
|
|
4715
|
+
Pagination,
|
|
1342
4716
|
Radio,
|
|
1343
|
-
|
|
4717
|
+
SearchGlobal,
|
|
4718
|
+
SearchOnPage,
|
|
4719
|
+
Table,
|
|
4720
|
+
TableControls,
|
|
4721
|
+
TableFooterPagination,
|
|
4722
|
+
Tabs,
|
|
4723
|
+
Tag,
|
|
4724
|
+
TextArea,
|
|
4725
|
+
Toast,
|
|
4726
|
+
Toggle,
|
|
4727
|
+
Tooltip
|
|
1344
4728
|
});
|
|
1345
4729
|
//# sourceMappingURL=index.js.map
|