@vectramindnpm/unified-design-system 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +258 -258
- package/dist/components.css +387 -387
- package/dist/fonts.css +12 -12
- package/dist/index.cjs +255 -192
- package/dist/index.cjs.map +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +258 -195
- package/dist/index.js.map +1 -1
- package/dist/shadcn-base.css +36 -36
- package/dist/styles.css +11 -11
- package/dist/theme.css +92 -92
- package/package.json +92 -90
- package/tailwind-preset.js +84 -84
package/dist/index.cjs
CHANGED
|
@@ -738,7 +738,6 @@ TooltipContent.displayName = "TooltipContent";
|
|
|
738
738
|
// src/components/ui/button.tsx
|
|
739
739
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
740
740
|
var { color: color3 } = semanticTokens_default;
|
|
741
|
-
var DEFAULT_VARIANT = "ghost";
|
|
742
741
|
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
743
742
|
"",
|
|
744
743
|
{
|
|
@@ -778,7 +777,7 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
|
778
777
|
}
|
|
779
778
|
},
|
|
780
779
|
defaultVariants: {
|
|
781
|
-
variant:
|
|
780
|
+
variant: "primary",
|
|
782
781
|
size: "default",
|
|
783
782
|
shape: "default"
|
|
784
783
|
}
|
|
@@ -837,7 +836,7 @@ var pillDisabled = "opacity-50 cursor-not-allowed";
|
|
|
837
836
|
var selectedGradient = "border border-interactive-brand bg-gradient-to-r from-[var(--color-button-selected-gradient-start)] via-[var(--color-button-selected-gradient-mid)] to-interactive-brand text-white font-extrabold";
|
|
838
837
|
var Button = React4.forwardRef(
|
|
839
838
|
({ className, variant, size, shape, asChild = false, children, style, selected, tooltipText, ...props }, ref) => {
|
|
840
|
-
const finalVariant = variant ??
|
|
839
|
+
const finalVariant = variant ?? "primary";
|
|
841
840
|
const finalSize = size ?? "default";
|
|
842
841
|
const isPill = shape === "pill";
|
|
843
842
|
const isLink = finalVariant === "link";
|
|
@@ -851,7 +850,7 @@ var Button = React4.forwardRef(
|
|
|
851
850
|
const composed = cn(
|
|
852
851
|
baseClasses2,
|
|
853
852
|
isPill ? "rounded-full" : "",
|
|
854
|
-
variantClasses[colorBase],
|
|
853
|
+
variant ? variantClasses[colorBase] : "",
|
|
855
854
|
// Link never carries the size scale's own padding/height — it reads as inline text.
|
|
856
855
|
isLink ? "h-auto p-0" : isPill ? pillSizeClasses[finalSize] : sizeClasses[finalSize],
|
|
857
856
|
isPill ? selected ? pillSelected : pillUnselected : selected ? selectedGradient : "",
|
|
@@ -862,15 +861,19 @@ var Button = React4.forwardRef(
|
|
|
862
861
|
buttonVariants({ variant: finalVariant, size: finalSize, shape, className })
|
|
863
862
|
);
|
|
864
863
|
const mergedStyle = {
|
|
865
|
-
...variantStyles[colorBase],
|
|
864
|
+
...variant ? variantStyles[colorBase] : void 0,
|
|
866
865
|
...isPill && selected ? { ["--pill-selected-bg"]: `${color3.text.blue}24` } : void 0,
|
|
867
866
|
...style
|
|
868
867
|
};
|
|
868
|
+
const accessibleProps = {
|
|
869
|
+
"aria-label": props["aria-label"] ?? tooltipText,
|
|
870
|
+
...props
|
|
871
|
+
};
|
|
869
872
|
const element = asChild && React4.isValidElement(children) ? React4.cloneElement(children, {
|
|
870
873
|
className: cn(composed, children.props?.className),
|
|
871
874
|
ref,
|
|
872
|
-
...
|
|
873
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: cn(composed), ref, style: mergedStyle, ...
|
|
875
|
+
...accessibleProps
|
|
876
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { className: cn(composed), ref, style: mergedStyle, ...accessibleProps, children });
|
|
874
877
|
if (!tooltipText) {
|
|
875
878
|
return element;
|
|
876
879
|
}
|
|
@@ -993,13 +996,14 @@ var ButtonIcon = React5.forwardRef(
|
|
|
993
996
|
name,
|
|
994
997
|
variant,
|
|
995
998
|
size,
|
|
996
|
-
color: color6
|
|
999
|
+
color: color6,
|
|
997
1000
|
hoverColor,
|
|
998
1001
|
bgColor,
|
|
999
1002
|
bgHoverColor,
|
|
1000
1003
|
actionColor,
|
|
1001
1004
|
tooltipText,
|
|
1002
1005
|
showTooltip = false,
|
|
1006
|
+
label,
|
|
1003
1007
|
disabled,
|
|
1004
1008
|
className,
|
|
1005
1009
|
type = "button",
|
|
@@ -1010,12 +1014,13 @@ var ButtonIcon = React5.forwardRef(
|
|
|
1010
1014
|
}, ref) => {
|
|
1011
1015
|
const isModalClose = variant === "modalClose";
|
|
1012
1016
|
const isRefresh = variant === "refresh";
|
|
1017
|
+
const isFilled = variant === "filled";
|
|
1013
1018
|
const resolvedBg = bgColor ? { base: bgColor, hover: bgHoverColor } : actionColor ? actionColorTokens[actionColor] : void 0;
|
|
1014
1019
|
const effectiveSize = isRefresh ? "sm" : size;
|
|
1015
|
-
const effectiveColor = isRefresh ? "primary" : color6;
|
|
1020
|
+
const effectiveColor = isRefresh ? "primary" : color6 ?? (isFilled ? "white" : "primary");
|
|
1016
1021
|
const effectiveHoverColor = isRefresh ? "primary" : isModalClose ? "danger" : hoverColor;
|
|
1017
1022
|
const effectiveShowTooltip = isRefresh ? true : showTooltip;
|
|
1018
|
-
const effectiveTooltipText = tooltipText;
|
|
1023
|
+
const effectiveTooltipText = tooltipText ?? label ?? props["aria-label"];
|
|
1019
1024
|
const colorProps = getIconColorProps(effectiveColor, effectiveHoverColor, resolvedBg);
|
|
1020
1025
|
const icon = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1021
1026
|
"button",
|
|
@@ -1254,77 +1259,24 @@ Checkbox.displayName = "Checkbox";
|
|
|
1254
1259
|
|
|
1255
1260
|
// src/components/ui/delete-action.tsx
|
|
1256
1261
|
var import_react = require("react");
|
|
1262
|
+
var import_react_i18next = require("react-i18next");
|
|
1257
1263
|
|
|
1258
|
-
// src/
|
|
1259
|
-
var
|
|
1260
|
-
var import_class_variance_authority5 = require("class-variance-authority");
|
|
1261
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1262
|
-
var Icon = React8.forwardRef(
|
|
1263
|
-
({
|
|
1264
|
-
name,
|
|
1265
|
-
variant,
|
|
1266
|
-
size,
|
|
1267
|
-
color: color6 = "primary",
|
|
1268
|
-
hoverColor,
|
|
1269
|
-
tooltipText,
|
|
1270
|
-
showTooltip = false,
|
|
1271
|
-
disabled,
|
|
1272
|
-
className,
|
|
1273
|
-
onClick,
|
|
1274
|
-
style,
|
|
1275
|
-
...props
|
|
1276
|
-
}, ref) => {
|
|
1277
|
-
const colorProps = getIconColorProps(color6, hoverColor);
|
|
1278
|
-
const icon = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1279
|
-
"i",
|
|
1280
|
-
{
|
|
1281
|
-
ref,
|
|
1282
|
-
className: cn(
|
|
1283
|
-
`${name}`,
|
|
1284
|
-
iconVariants({ variant, size }),
|
|
1285
|
-
colorProps.className,
|
|
1286
|
-
onClick && !disabled && "cursor-pointer",
|
|
1287
|
-
className
|
|
1288
|
-
),
|
|
1289
|
-
onClick,
|
|
1290
|
-
style: { ...colorProps.style, ...style },
|
|
1291
|
-
role: onClick ? "button" : void 0,
|
|
1292
|
-
tabIndex: onClick ? 0 : void 0,
|
|
1293
|
-
"aria-label": tooltipText || name,
|
|
1294
|
-
onKeyDown: (e) => {
|
|
1295
|
-
if (!onClick) return;
|
|
1296
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1297
|
-
e.preventDefault();
|
|
1298
|
-
onClick(
|
|
1299
|
-
e
|
|
1300
|
-
);
|
|
1301
|
-
}
|
|
1302
|
-
},
|
|
1303
|
-
...props
|
|
1304
|
-
}
|
|
1305
|
-
);
|
|
1306
|
-
if (!showTooltip) {
|
|
1307
|
-
return icon;
|
|
1308
|
-
}
|
|
1309
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Tooltip, { children: [
|
|
1310
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipTrigger, { asChild: true, children: icon }),
|
|
1311
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipContent, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: tooltipText || name }) })
|
|
1312
|
-
] });
|
|
1313
|
-
}
|
|
1314
|
-
);
|
|
1315
|
-
Icon.displayName = "Icon";
|
|
1264
|
+
// src/helpers/helpersIndex.ts
|
|
1265
|
+
var getTranslationKey = () => "translations";
|
|
1316
1266
|
|
|
1317
1267
|
// src/components/ui/delete-action.tsx
|
|
1318
|
-
var
|
|
1268
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1319
1269
|
var DeleteAction = ({ onClick, tooltipText, showTooltip = true, className }) => {
|
|
1320
|
-
|
|
1321
|
-
|
|
1270
|
+
const translationKey = getTranslationKey();
|
|
1271
|
+
const { t } = (0, import_react_i18next.useTranslation)(translationKey);
|
|
1272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1273
|
+
ButtonIcon,
|
|
1322
1274
|
{
|
|
1323
1275
|
name: "icon-neo-trash",
|
|
1324
1276
|
hoverColor: "danger",
|
|
1325
1277
|
onClick,
|
|
1326
1278
|
showTooltip,
|
|
1327
|
-
tooltipText: tooltipText || "
|
|
1279
|
+
tooltipText: tooltipText || t("ActionNames.delete"),
|
|
1328
1280
|
className
|
|
1329
1281
|
}
|
|
1330
1282
|
);
|
|
@@ -1332,25 +1284,28 @@ var DeleteAction = ({ onClick, tooltipText, showTooltip = true, className }) =>
|
|
|
1332
1284
|
var delete_action_default = DeleteAction;
|
|
1333
1285
|
|
|
1334
1286
|
// src/components/ui/dialog.tsx
|
|
1335
|
-
var
|
|
1336
|
-
var
|
|
1337
|
-
var
|
|
1287
|
+
var React9 = __toESM(require("react"), 1);
|
|
1288
|
+
var import_react_i18next2 = require("react-i18next");
|
|
1289
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1290
|
+
var DialogContext = React9.createContext(void 0);
|
|
1338
1291
|
function useDialog() {
|
|
1339
|
-
const context =
|
|
1292
|
+
const context = React9.useContext(DialogContext);
|
|
1340
1293
|
if (!context) {
|
|
1341
1294
|
throw new Error("Dialog components must be used within Dialog");
|
|
1342
1295
|
}
|
|
1343
1296
|
return context;
|
|
1344
1297
|
}
|
|
1345
1298
|
var Dialog = ({ open: controlledOpen, onOpenChange, children }) => {
|
|
1346
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
1299
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React9.useState(false);
|
|
1300
|
+
const [titleId, setTitleId] = React9.useState(void 0);
|
|
1301
|
+
const [descriptionId, setDescriptionId] = React9.useState(void 0);
|
|
1347
1302
|
const open = controlledOpen !== void 0 ? controlledOpen : uncontrolledOpen;
|
|
1348
1303
|
const setOpen = onOpenChange || setUncontrolledOpen;
|
|
1349
|
-
return /* @__PURE__ */ (0,
|
|
1304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogContext.Provider, { value: { open, onOpenChange: setOpen, titleId, descriptionId, setTitleId, setDescriptionId }, children });
|
|
1350
1305
|
};
|
|
1351
|
-
var DialogTrigger =
|
|
1306
|
+
var DialogTrigger = React9.forwardRef(({ onClick, ...props }, ref) => {
|
|
1352
1307
|
const { onOpenChange } = useDialog();
|
|
1353
|
-
return /* @__PURE__ */ (0,
|
|
1308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1354
1309
|
Button,
|
|
1355
1310
|
{
|
|
1356
1311
|
ref,
|
|
@@ -1368,11 +1323,11 @@ DialogTrigger.displayName = "DialogTrigger";
|
|
|
1368
1323
|
var DialogPortal = ({ children }) => {
|
|
1369
1324
|
const { open } = useDialog();
|
|
1370
1325
|
if (!open) return null;
|
|
1371
|
-
return /* @__PURE__ */ (0,
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
|
|
1372
1327
|
};
|
|
1373
|
-
var DialogClose =
|
|
1328
|
+
var DialogClose = React9.forwardRef(({ onClick, ...props }, ref) => {
|
|
1374
1329
|
const { onOpenChange } = useDialog();
|
|
1375
|
-
return /* @__PURE__ */ (0,
|
|
1330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1376
1331
|
Button,
|
|
1377
1332
|
{
|
|
1378
1333
|
ref,
|
|
@@ -1387,9 +1342,9 @@ var DialogClose = React10.forwardRef(({ onClick, ...props }, ref) => {
|
|
|
1387
1342
|
);
|
|
1388
1343
|
});
|
|
1389
1344
|
DialogClose.displayName = "DialogClose";
|
|
1390
|
-
var DialogOverlay =
|
|
1345
|
+
var DialogOverlay = React9.forwardRef(({ className, onClick, closeOnClick = true, ...props }, ref) => {
|
|
1391
1346
|
const { onOpenChange } = useDialog();
|
|
1392
|
-
return /* @__PURE__ */ (0,
|
|
1347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1393
1348
|
"div",
|
|
1394
1349
|
{
|
|
1395
1350
|
ref,
|
|
@@ -1406,9 +1361,10 @@ var DialogOverlay = React10.forwardRef(({ className, onClick, closeOnClick = tru
|
|
|
1406
1361
|
);
|
|
1407
1362
|
});
|
|
1408
1363
|
DialogOverlay.displayName = "DialogOverlay";
|
|
1409
|
-
var DialogContent =
|
|
1410
|
-
const { onOpenChange } = useDialog();
|
|
1411
|
-
|
|
1364
|
+
var DialogContent = React9.forwardRef(({ className, children, showCloseButton = true, closeOnEscape = true, closeOnOverlayClick = true, ...props }, ref) => {
|
|
1365
|
+
const { onOpenChange, titleId, descriptionId } = useDialog();
|
|
1366
|
+
const { t } = (0, import_react_i18next2.useTranslation)("translations");
|
|
1367
|
+
React9.useEffect(() => {
|
|
1412
1368
|
if (!closeOnEscape) return;
|
|
1413
1369
|
const handleEscape = (e) => {
|
|
1414
1370
|
if (e.key === "Escape") {
|
|
@@ -1418,12 +1374,16 @@ var DialogContent = React10.forwardRef(({ className, children, showCloseButton =
|
|
|
1418
1374
|
document.addEventListener("keydown", handleEscape);
|
|
1419
1375
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
1420
1376
|
}, [onOpenChange, closeOnEscape]);
|
|
1421
|
-
return /* @__PURE__ */ (0,
|
|
1422
|
-
/* @__PURE__ */ (0,
|
|
1423
|
-
/* @__PURE__ */ (0,
|
|
1377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogPortal, { children: [
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogOverlay, { closeOnClick: closeOnOverlayClick }),
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1424
1380
|
"div",
|
|
1425
1381
|
{
|
|
1426
1382
|
ref,
|
|
1383
|
+
role: "dialog",
|
|
1384
|
+
"aria-modal": "true",
|
|
1385
|
+
"aria-labelledby": titleId,
|
|
1386
|
+
"aria-describedby": descriptionId,
|
|
1427
1387
|
className: cn(
|
|
1428
1388
|
"fixed left-[50%] top-[50%] z-[var(--zindex-modal)] grid w-full max-w-6xl translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 animate-in fade-in-0 zoom-in-95 rounded-lg",
|
|
1429
1389
|
className
|
|
@@ -1432,14 +1392,15 @@ var DialogContent = React10.forwardRef(({ className, children, showCloseButton =
|
|
|
1432
1392
|
...props,
|
|
1433
1393
|
children: [
|
|
1434
1394
|
children,
|
|
1435
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
1395
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1436
1396
|
ButtonIcon,
|
|
1437
1397
|
{
|
|
1438
1398
|
type: "button",
|
|
1439
1399
|
name: "icon-neo-close",
|
|
1440
1400
|
variant: "modalClose",
|
|
1441
1401
|
className: "absolute right-4 top-4",
|
|
1442
|
-
onClick: () => onOpenChange(false)
|
|
1402
|
+
onClick: () => onOpenChange(false),
|
|
1403
|
+
tooltipText: t("ActionNames.close")
|
|
1443
1404
|
}
|
|
1444
1405
|
)
|
|
1445
1406
|
]
|
|
@@ -1451,7 +1412,7 @@ DialogContent.displayName = "DialogContent";
|
|
|
1451
1412
|
var DialogHeader = ({
|
|
1452
1413
|
className,
|
|
1453
1414
|
...props
|
|
1454
|
-
}) => /* @__PURE__ */ (0,
|
|
1415
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1455
1416
|
"div",
|
|
1456
1417
|
{
|
|
1457
1418
|
className: cn(
|
|
@@ -1465,7 +1426,7 @@ DialogHeader.displayName = "DialogHeader";
|
|
|
1465
1426
|
var DialogFooter = ({
|
|
1466
1427
|
className,
|
|
1467
1428
|
...props
|
|
1468
|
-
}) => /* @__PURE__ */ (0,
|
|
1429
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1469
1430
|
"div",
|
|
1470
1431
|
{
|
|
1471
1432
|
className: cn(
|
|
@@ -1476,52 +1437,72 @@ var DialogFooter = ({
|
|
|
1476
1437
|
}
|
|
1477
1438
|
);
|
|
1478
1439
|
DialogFooter.displayName = "DialogFooter";
|
|
1479
|
-
var DialogTitle =
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1440
|
+
var DialogTitle = React9.forwardRef(({ className, id, ...props }, ref) => {
|
|
1441
|
+
const generatedId = React9.useId();
|
|
1442
|
+
const resolvedId = id ?? generatedId;
|
|
1443
|
+
const { setTitleId } = useDialog();
|
|
1444
|
+
React9.useEffect(() => {
|
|
1445
|
+
setTitleId(resolvedId);
|
|
1446
|
+
return () => setTitleId(void 0);
|
|
1447
|
+
}, [resolvedId, setTitleId]);
|
|
1448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1449
|
+
"h2",
|
|
1450
|
+
{
|
|
1451
|
+
ref,
|
|
1452
|
+
id: resolvedId,
|
|
1453
|
+
className: cn(
|
|
1454
|
+
"text-heading font-semibold leading-none tracking-tight",
|
|
1455
|
+
className
|
|
1456
|
+
),
|
|
1457
|
+
...props
|
|
1458
|
+
}
|
|
1459
|
+
);
|
|
1460
|
+
});
|
|
1490
1461
|
DialogTitle.displayName = "DialogTitle";
|
|
1491
|
-
var DialogDescription =
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
)
|
|
1462
|
+
var DialogDescription = React9.forwardRef(({ className, id, ...props }, ref) => {
|
|
1463
|
+
const generatedId = React9.useId();
|
|
1464
|
+
const resolvedId = id ?? generatedId;
|
|
1465
|
+
const { setDescriptionId } = useDialog();
|
|
1466
|
+
React9.useEffect(() => {
|
|
1467
|
+
setDescriptionId(resolvedId);
|
|
1468
|
+
return () => setDescriptionId(void 0);
|
|
1469
|
+
}, [resolvedId, setDescriptionId]);
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1471
|
+
"p",
|
|
1472
|
+
{
|
|
1473
|
+
ref,
|
|
1474
|
+
id: resolvedId,
|
|
1475
|
+
className: cn("text-body text-muted-foreground", className),
|
|
1476
|
+
...props
|
|
1477
|
+
}
|
|
1478
|
+
);
|
|
1479
|
+
});
|
|
1499
1480
|
DialogDescription.displayName = "DialogDescription";
|
|
1500
1481
|
|
|
1501
1482
|
// src/components/ui/dropdown-menu.tsx
|
|
1502
|
-
var
|
|
1483
|
+
var React10 = __toESM(require("react"), 1);
|
|
1503
1484
|
var import_react_dom2 = require("react-dom");
|
|
1504
1485
|
var import_lucide_react = require("lucide-react");
|
|
1505
|
-
var
|
|
1506
|
-
var DropdownMenuContext =
|
|
1486
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1487
|
+
var DropdownMenuContext = React10.createContext(void 0);
|
|
1507
1488
|
function useDropdownMenu() {
|
|
1508
|
-
const context =
|
|
1489
|
+
const context = React10.useContext(DropdownMenuContext);
|
|
1509
1490
|
if (!context) {
|
|
1510
1491
|
throw new Error("DropdownMenu components must be used within DropdownMenu");
|
|
1511
1492
|
}
|
|
1512
1493
|
return context;
|
|
1513
1494
|
}
|
|
1514
1495
|
var DropdownMenu = ({ open: controlledOpen, onOpenChange, children }) => {
|
|
1515
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
1496
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React10.useState(false);
|
|
1516
1497
|
const open = controlledOpen !== void 0 ? controlledOpen : uncontrolledOpen;
|
|
1517
1498
|
const setOpen = onOpenChange || setUncontrolledOpen;
|
|
1518
|
-
const triggerRef =
|
|
1519
|
-
return /* @__PURE__ */ (0,
|
|
1499
|
+
const triggerRef = React10.useRef(null);
|
|
1500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownMenuContext.Provider, { value: { open, setOpen, triggerRef }, children });
|
|
1520
1501
|
};
|
|
1521
|
-
var DropdownMenuTrigger =
|
|
1502
|
+
var DropdownMenuTrigger = React10.forwardRef(({ onClick, children, asChild, ...props }, ref) => {
|
|
1522
1503
|
const { setOpen, open, triggerRef } = useDropdownMenu();
|
|
1523
|
-
if (asChild &&
|
|
1524
|
-
return
|
|
1504
|
+
if (asChild && React10.isValidElement(children)) {
|
|
1505
|
+
return React10.cloneElement(children, {
|
|
1525
1506
|
ref: (node) => {
|
|
1526
1507
|
triggerRef.current = node;
|
|
1527
1508
|
if (ref) {
|
|
@@ -1540,7 +1521,7 @@ var DropdownMenuTrigger = React11.forwardRef(({ onClick, children, asChild, ...p
|
|
|
1540
1521
|
}
|
|
1541
1522
|
});
|
|
1542
1523
|
}
|
|
1543
|
-
return /* @__PURE__ */ (0,
|
|
1524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1544
1525
|
Button,
|
|
1545
1526
|
{
|
|
1546
1527
|
ref: (node) => {
|
|
@@ -1565,19 +1546,19 @@ var DropdownMenuTrigger = React11.forwardRef(({ onClick, children, asChild, ...p
|
|
|
1565
1546
|
});
|
|
1566
1547
|
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
1567
1548
|
var DropdownMenuGroup = ({ children }) => {
|
|
1568
|
-
return /* @__PURE__ */ (0,
|
|
1549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { role: "group", children });
|
|
1569
1550
|
};
|
|
1570
1551
|
var DropdownMenuPortal = ({ children }) => {
|
|
1571
1552
|
const portalRoot = document.getElementById("fpneo") || document.body;
|
|
1572
1553
|
return (0, import_react_dom2.createPortal)(children, portalRoot);
|
|
1573
1554
|
};
|
|
1574
1555
|
var DropdownMenuSub = ({ children }) => {
|
|
1575
|
-
return /* @__PURE__ */ (0,
|
|
1556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children });
|
|
1576
1557
|
};
|
|
1577
1558
|
var DropdownMenuRadioGroup = ({ children }) => {
|
|
1578
|
-
return /* @__PURE__ */ (0,
|
|
1559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { role: "radiogroup", children });
|
|
1579
1560
|
};
|
|
1580
|
-
var DropdownMenuSubTrigger =
|
|
1561
|
+
var DropdownMenuSubTrigger = React10.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1581
1562
|
"div",
|
|
1582
1563
|
{
|
|
1583
1564
|
ref,
|
|
@@ -1589,12 +1570,12 @@ var DropdownMenuSubTrigger = React11.forwardRef(({ className, inset, children, .
|
|
|
1589
1570
|
...props,
|
|
1590
1571
|
children: [
|
|
1591
1572
|
children,
|
|
1592
|
-
/* @__PURE__ */ (0,
|
|
1573
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react.ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
1593
1574
|
]
|
|
1594
1575
|
}
|
|
1595
1576
|
));
|
|
1596
1577
|
DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
|
|
1597
|
-
var DropdownMenuSubContent =
|
|
1578
|
+
var DropdownMenuSubContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1598
1579
|
"div",
|
|
1599
1580
|
{
|
|
1600
1581
|
ref,
|
|
@@ -1606,13 +1587,13 @@ var DropdownMenuSubContent = React11.forwardRef(({ className, ...props }, ref) =
|
|
|
1606
1587
|
}
|
|
1607
1588
|
));
|
|
1608
1589
|
DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
|
|
1609
|
-
var DropdownMenuContent =
|
|
1590
|
+
var DropdownMenuContent = React10.forwardRef(({ className, sideOffset = 4, align = "end", ...props }, ref) => {
|
|
1610
1591
|
const { open, setOpen, triggerRef } = useDropdownMenu();
|
|
1611
|
-
const contentRef =
|
|
1612
|
-
const [position, setPosition] =
|
|
1613
|
-
const [isPositioned, setIsPositioned] =
|
|
1614
|
-
|
|
1615
|
-
|
|
1592
|
+
const contentRef = React10.useRef(null);
|
|
1593
|
+
const [position, setPosition] = React10.useState({ top: 0, left: 0 });
|
|
1594
|
+
const [isPositioned, setIsPositioned] = React10.useState(false);
|
|
1595
|
+
React10.useImperativeHandle(ref, () => contentRef.current);
|
|
1596
|
+
React10.useEffect(() => {
|
|
1616
1597
|
if (!open || !triggerRef.current) {
|
|
1617
1598
|
setIsPositioned(false);
|
|
1618
1599
|
return;
|
|
@@ -1667,7 +1648,7 @@ var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, align
|
|
|
1667
1648
|
window.removeEventListener("resize", updatePosition);
|
|
1668
1649
|
};
|
|
1669
1650
|
}, [open, sideOffset, align, triggerRef]);
|
|
1670
|
-
|
|
1651
|
+
React10.useEffect(() => {
|
|
1671
1652
|
if (!open) return;
|
|
1672
1653
|
const handleClickOutside = (e) => {
|
|
1673
1654
|
if (contentRef.current && !contentRef.current.contains(e.target) && triggerRef.current && !triggerRef.current.contains(e.target)) {
|
|
@@ -1687,7 +1668,7 @@ var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, align
|
|
|
1687
1668
|
};
|
|
1688
1669
|
}, [open, setOpen, triggerRef]);
|
|
1689
1670
|
if (!open) return null;
|
|
1690
|
-
return /* @__PURE__ */ (0,
|
|
1671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownMenuPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1691
1672
|
"div",
|
|
1692
1673
|
{
|
|
1693
1674
|
ref: contentRef,
|
|
@@ -1705,9 +1686,9 @@ var DropdownMenuContent = React11.forwardRef(({ className, sideOffset = 4, align
|
|
|
1705
1686
|
) });
|
|
1706
1687
|
});
|
|
1707
1688
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
1708
|
-
var DropdownMenuItem =
|
|
1689
|
+
var DropdownMenuItem = React10.forwardRef(({ className, inset, onClick, ...props }, ref) => {
|
|
1709
1690
|
const { setOpen } = useDropdownMenu();
|
|
1710
|
-
return /* @__PURE__ */ (0,
|
|
1691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1711
1692
|
"div",
|
|
1712
1693
|
{
|
|
1713
1694
|
ref,
|
|
@@ -1725,7 +1706,7 @@ var DropdownMenuItem = React11.forwardRef(({ className, inset, onClick, ...props
|
|
|
1725
1706
|
);
|
|
1726
1707
|
});
|
|
1727
1708
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
1728
|
-
var DropdownMenuCheckboxItem =
|
|
1709
|
+
var DropdownMenuCheckboxItem = React10.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1729
1710
|
"div",
|
|
1730
1711
|
{
|
|
1731
1712
|
ref,
|
|
@@ -1735,13 +1716,13 @@ var DropdownMenuCheckboxItem = React11.forwardRef(({ className, children, checke
|
|
|
1735
1716
|
),
|
|
1736
1717
|
...props,
|
|
1737
1718
|
children: [
|
|
1738
|
-
/* @__PURE__ */ (0,
|
|
1719
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: checked && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react.Check, { className: "h-4 w-4" }) }),
|
|
1739
1720
|
children
|
|
1740
1721
|
]
|
|
1741
1722
|
}
|
|
1742
1723
|
));
|
|
1743
1724
|
DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
|
|
1744
|
-
var DropdownMenuRadioItem =
|
|
1725
|
+
var DropdownMenuRadioItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1745
1726
|
"div",
|
|
1746
1727
|
{
|
|
1747
1728
|
ref,
|
|
@@ -1751,13 +1732,13 @@ var DropdownMenuRadioItem = React11.forwardRef(({ className, children, ...props
|
|
|
1751
1732
|
),
|
|
1752
1733
|
...props,
|
|
1753
1734
|
children: [
|
|
1754
|
-
/* @__PURE__ */ (0,
|
|
1735
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react.Circle, { className: "h-2 w-2 fill-current" }) }),
|
|
1755
1736
|
children
|
|
1756
1737
|
]
|
|
1757
1738
|
}
|
|
1758
1739
|
));
|
|
1759
1740
|
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
|
1760
|
-
var DropdownMenuLabel =
|
|
1741
|
+
var DropdownMenuLabel = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1761
1742
|
"div",
|
|
1762
1743
|
{
|
|
1763
1744
|
ref,
|
|
@@ -1770,7 +1751,7 @@ var DropdownMenuLabel = React11.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1770
1751
|
}
|
|
1771
1752
|
));
|
|
1772
1753
|
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
1773
|
-
var DropdownMenuSeparator =
|
|
1754
|
+
var DropdownMenuSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1774
1755
|
"div",
|
|
1775
1756
|
{
|
|
1776
1757
|
ref,
|
|
@@ -1783,7 +1764,7 @@ var DropdownMenuShortcut = ({
|
|
|
1783
1764
|
className,
|
|
1784
1765
|
...props
|
|
1785
1766
|
}) => {
|
|
1786
|
-
return /* @__PURE__ */ (0,
|
|
1767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1787
1768
|
"span",
|
|
1788
1769
|
{
|
|
1789
1770
|
className: cn("ml-auto text-label tracking-widest opacity-60", className),
|
|
@@ -1797,9 +1778,9 @@ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
|
1797
1778
|
var import_react2 = require("react");
|
|
1798
1779
|
|
|
1799
1780
|
// src/components/ui/input.tsx
|
|
1800
|
-
var
|
|
1781
|
+
var React11 = __toESM(require("react"), 1);
|
|
1801
1782
|
var import_formik = require("formik");
|
|
1802
|
-
var
|
|
1783
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1803
1784
|
var baseClasses = [
|
|
1804
1785
|
"flex h-[2.571rem] w-full items-center rounded-[0.65rem] px-4 py-0",
|
|
1805
1786
|
"text-[0.8125rem] text-[var(--color-neutral-800)]",
|
|
@@ -1816,7 +1797,7 @@ var baseClasses = [
|
|
|
1816
1797
|
"disabled:cursor-not-allowed",
|
|
1817
1798
|
"disabled:opacity-50"
|
|
1818
1799
|
].join(" ");
|
|
1819
|
-
var Input =
|
|
1800
|
+
var Input = React11.forwardRef(
|
|
1820
1801
|
({
|
|
1821
1802
|
as = "input",
|
|
1822
1803
|
className,
|
|
@@ -1827,10 +1808,10 @@ var Input = React12.forwardRef(
|
|
|
1827
1808
|
innerRef,
|
|
1828
1809
|
...props
|
|
1829
1810
|
}, ref) => {
|
|
1830
|
-
const internalRef =
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1811
|
+
const internalRef = React11.useRef(null);
|
|
1812
|
+
React11.useImperativeHandle(ref, () => internalRef.current);
|
|
1813
|
+
React11.useImperativeHandle(innerRef, () => internalRef.current);
|
|
1814
|
+
React11.useEffect(() => {
|
|
1834
1815
|
if (autoFocus) {
|
|
1835
1816
|
internalRef.current?.focus();
|
|
1836
1817
|
}
|
|
@@ -1841,7 +1822,7 @@ var Input = React12.forwardRef(
|
|
|
1841
1822
|
className
|
|
1842
1823
|
);
|
|
1843
1824
|
if (as === "field") {
|
|
1844
|
-
return /* @__PURE__ */ (0,
|
|
1825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1845
1826
|
import_formik.Field,
|
|
1846
1827
|
{
|
|
1847
1828
|
innerRef: internalRef,
|
|
@@ -1853,7 +1834,7 @@ var Input = React12.forwardRef(
|
|
|
1853
1834
|
}
|
|
1854
1835
|
);
|
|
1855
1836
|
}
|
|
1856
|
-
return /* @__PURE__ */ (0,
|
|
1837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1857
1838
|
"input",
|
|
1858
1839
|
{
|
|
1859
1840
|
ref: internalRef,
|
|
@@ -1869,7 +1850,7 @@ var Input = React12.forwardRef(
|
|
|
1869
1850
|
Input.displayName = "Input";
|
|
1870
1851
|
|
|
1871
1852
|
// src/components/ui/expandable-search.tsx
|
|
1872
|
-
var
|
|
1853
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1873
1854
|
var ExpandableSearch = ({ onSearch, placeholder = "Search...", className = "" }) => {
|
|
1874
1855
|
const [isExpanded, setIsExpanded] = (0, import_react2.useState)(false);
|
|
1875
1856
|
const [searchValue, setSearchValue] = (0, import_react2.useState)("");
|
|
@@ -1898,9 +1879,9 @@ var ExpandableSearch = ({ onSearch, placeholder = "Search...", className = "" })
|
|
|
1898
1879
|
inputRef.current.focus();
|
|
1899
1880
|
}
|
|
1900
1881
|
};
|
|
1901
|
-
return /* @__PURE__ */ (0,
|
|
1902
|
-
/* @__PURE__ */ (0,
|
|
1903
|
-
/* @__PURE__ */ (0,
|
|
1882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `flex items-center ${className}`, children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2 transition-all duration-300 ease-in-out", children: [
|
|
1883
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative flex justify-center items-center", children: [
|
|
1884
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1904
1885
|
Input,
|
|
1905
1886
|
{
|
|
1906
1887
|
ref: inputRef,
|
|
@@ -1911,25 +1892,25 @@ var ExpandableSearch = ({ onSearch, placeholder = "Search...", className = "" })
|
|
|
1911
1892
|
className: "formfield__search"
|
|
1912
1893
|
}
|
|
1913
1894
|
),
|
|
1914
|
-
searchValue && /* @__PURE__ */ (0,
|
|
1895
|
+
searchValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1915
1896
|
Button,
|
|
1916
1897
|
{
|
|
1917
1898
|
onClick: handleClear,
|
|
1918
1899
|
variant: "ghost",
|
|
1919
1900
|
size: "icon",
|
|
1920
1901
|
className: "absolute right-3 top-1/2 -translate-y-1/2 text-neutral-600 hover:text-[var(--color-ext-4b5563)] transition-colors",
|
|
1921
|
-
children: /* @__PURE__ */ (0,
|
|
1902
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { className: "icon-neo-close text-[0.875rem]" })
|
|
1922
1903
|
}
|
|
1923
1904
|
)
|
|
1924
1905
|
] }),
|
|
1925
|
-
/* @__PURE__ */ (0,
|
|
1926
|
-
] }) : /* @__PURE__ */ (0,
|
|
1906
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button, { variant: "ghost", size: "icon", onClick: handleToggle, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { className: "icon-neo-close text-[0.875rem]" }) })
|
|
1907
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button, { variant: "ghost", size: "icon", onClick: handleToggle, className: "header__round-btn", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { className: "icon-neo-search" }) }) });
|
|
1927
1908
|
};
|
|
1928
1909
|
|
|
1929
1910
|
// src/components/ui/file-input.tsx
|
|
1930
|
-
var
|
|
1931
|
-
var
|
|
1932
|
-
var FileInput =
|
|
1911
|
+
var React13 = __toESM(require("react"), 1);
|
|
1912
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1913
|
+
var FileInput = React13.forwardRef(
|
|
1933
1914
|
({
|
|
1934
1915
|
id,
|
|
1935
1916
|
className,
|
|
@@ -1941,10 +1922,10 @@ var FileInput = React14.forwardRef(
|
|
|
1941
1922
|
disabled,
|
|
1942
1923
|
...props
|
|
1943
1924
|
}, ref) => {
|
|
1944
|
-
const generatedId =
|
|
1925
|
+
const generatedId = React13.useId();
|
|
1945
1926
|
const inputId = id ?? generatedId;
|
|
1946
|
-
const content = /* @__PURE__ */ (0,
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
1927
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1928
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1948
1929
|
"input",
|
|
1949
1930
|
{
|
|
1950
1931
|
ref,
|
|
@@ -1955,17 +1936,18 @@ var FileInput = React14.forwardRef(
|
|
|
1955
1936
|
...props
|
|
1956
1937
|
}
|
|
1957
1938
|
),
|
|
1958
|
-
children && /* @__PURE__ */ (0,
|
|
1939
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: inputId, className: labelClassName, style: labelStyle, ...labelProps, children })
|
|
1959
1940
|
] });
|
|
1960
|
-
return wrapperClassName ? /* @__PURE__ */ (0,
|
|
1941
|
+
return wrapperClassName ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: wrapperClassName, children: content }) : content;
|
|
1961
1942
|
}
|
|
1962
1943
|
);
|
|
1963
1944
|
FileInput.displayName = "FileInput";
|
|
1964
1945
|
|
|
1965
1946
|
// src/components/ui/form-field.tsx
|
|
1966
|
-
var import_react3 = require("react");
|
|
1947
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
1967
1948
|
var import_formik2 = require("formik");
|
|
1968
|
-
var
|
|
1949
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1950
|
+
var LABELABLE_TAGS = /* @__PURE__ */ new Set(["input", "select", "textarea"]);
|
|
1969
1951
|
var FormField = ({
|
|
1970
1952
|
label,
|
|
1971
1953
|
required,
|
|
@@ -1973,19 +1955,87 @@ var FormField = ({
|
|
|
1973
1955
|
error,
|
|
1974
1956
|
hint,
|
|
1975
1957
|
children,
|
|
1976
|
-
className
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
children
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1958
|
+
className,
|
|
1959
|
+
id
|
|
1960
|
+
}) => {
|
|
1961
|
+
const generatedId = import_react3.default.useId();
|
|
1962
|
+
const fieldId = id ?? generatedId;
|
|
1963
|
+
let renderedChildren = children;
|
|
1964
|
+
if (label && import_react3.default.isValidElement(children) && (children.type === import_formik2.Field || typeof children.type === "string" && LABELABLE_TAGS.has(children.type)) && !children.props.id) {
|
|
1965
|
+
renderedChildren = import_react3.default.cloneElement(children, { id: fieldId });
|
|
1966
|
+
}
|
|
1967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: cn("form__field", className), children: [
|
|
1968
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "formfield__label", htmlFor: fieldId, children: [
|
|
1969
|
+
label,
|
|
1970
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "required-field", children: "*" })
|
|
1971
|
+
] }),
|
|
1972
|
+
renderedChildren,
|
|
1973
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-[0.75rem] text-neutral-600 mt-1", children: hint }),
|
|
1974
|
+
errorName && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_formik2.ErrorMessage, { name: errorName, component: "p", className: "form-error" }),
|
|
1975
|
+
!errorName && error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "form-error", children: error })
|
|
1976
|
+
] });
|
|
1977
|
+
};
|
|
1987
1978
|
var form_field_default = FormField;
|
|
1988
1979
|
|
|
1980
|
+
// src/components/ui/icon.tsx
|
|
1981
|
+
var React15 = __toESM(require("react"), 1);
|
|
1982
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
1983
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1984
|
+
var Icon = React15.forwardRef(
|
|
1985
|
+
({
|
|
1986
|
+
name,
|
|
1987
|
+
variant,
|
|
1988
|
+
size,
|
|
1989
|
+
color: color6 = "primary",
|
|
1990
|
+
hoverColor,
|
|
1991
|
+
tooltipText,
|
|
1992
|
+
showTooltip = false,
|
|
1993
|
+
disabled,
|
|
1994
|
+
className,
|
|
1995
|
+
onClick,
|
|
1996
|
+
style,
|
|
1997
|
+
...props
|
|
1998
|
+
}, ref) => {
|
|
1999
|
+
const colorProps = getIconColorProps(color6, hoverColor);
|
|
2000
|
+
const icon = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2001
|
+
"i",
|
|
2002
|
+
{
|
|
2003
|
+
ref,
|
|
2004
|
+
className: cn(
|
|
2005
|
+
`${name}`,
|
|
2006
|
+
iconVariants({ variant, size }),
|
|
2007
|
+
colorProps.className,
|
|
2008
|
+
onClick && !disabled && "cursor-pointer",
|
|
2009
|
+
className
|
|
2010
|
+
),
|
|
2011
|
+
onClick,
|
|
2012
|
+
style: { ...colorProps.style, ...style },
|
|
2013
|
+
role: onClick ? "button" : void 0,
|
|
2014
|
+
tabIndex: onClick ? 0 : void 0,
|
|
2015
|
+
"aria-hidden": onClick ? "true" : "false",
|
|
2016
|
+
onKeyDown: (e) => {
|
|
2017
|
+
if (!onClick) return;
|
|
2018
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2019
|
+
e.preventDefault();
|
|
2020
|
+
onClick(
|
|
2021
|
+
e
|
|
2022
|
+
);
|
|
2023
|
+
}
|
|
2024
|
+
},
|
|
2025
|
+
...props
|
|
2026
|
+
}
|
|
2027
|
+
);
|
|
2028
|
+
if (!showTooltip) {
|
|
2029
|
+
return icon;
|
|
2030
|
+
}
|
|
2031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Tooltip, { children: [
|
|
2032
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TooltipTrigger, { asChild: true, children: icon }),
|
|
2033
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TooltipContent, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: tooltipText || name }) })
|
|
2034
|
+
] });
|
|
2035
|
+
}
|
|
2036
|
+
);
|
|
2037
|
+
Icon.displayName = "Icon";
|
|
2038
|
+
|
|
1989
2039
|
// src/components/ui/list.tsx
|
|
1990
2040
|
var React16 = __toESM(require("react"), 1);
|
|
1991
2041
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
@@ -2284,6 +2334,7 @@ var ScrollArea = React20.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
2284
2334
|
"div",
|
|
2285
2335
|
{
|
|
2286
2336
|
ref,
|
|
2337
|
+
tabIndex: 0,
|
|
2287
2338
|
className: cn(
|
|
2288
2339
|
"relative overflow-y-auto overflow-x-hidden",
|
|
2289
2340
|
"[&::-webkit-scrollbar]:w-[0.375rem]",
|
|
@@ -2457,8 +2508,12 @@ var Tab = React22.forwardRef(
|
|
|
2457
2508
|
variant,
|
|
2458
2509
|
size,
|
|
2459
2510
|
disabled,
|
|
2460
|
-
onClick
|
|
2511
|
+
onClick,
|
|
2512
|
+
id,
|
|
2513
|
+
panelId
|
|
2461
2514
|
}, ref) => {
|
|
2515
|
+
const generatedId = React22.useId();
|
|
2516
|
+
const resolvedId = id ?? generatedId;
|
|
2462
2517
|
const handleKeyDown = (e) => {
|
|
2463
2518
|
if (disabled) return;
|
|
2464
2519
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -2470,9 +2525,11 @@ var Tab = React22.forwardRef(
|
|
|
2470
2525
|
"div",
|
|
2471
2526
|
{
|
|
2472
2527
|
ref,
|
|
2528
|
+
id: resolvedId,
|
|
2473
2529
|
role: "tab",
|
|
2474
2530
|
"aria-selected": active,
|
|
2475
2531
|
"aria-disabled": disabled,
|
|
2532
|
+
"aria-controls": panelId,
|
|
2476
2533
|
tabIndex: disabled ? -1 : active ? 0 : -1,
|
|
2477
2534
|
onClick: !disabled ? onClick : void 0,
|
|
2478
2535
|
onKeyDown: handleKeyDown,
|
|
@@ -2844,7 +2901,8 @@ var TimePicker = ({
|
|
|
2844
2901
|
},
|
|
2845
2902
|
name: "icon-neo-close",
|
|
2846
2903
|
color: "muted",
|
|
2847
|
-
size: "xs"
|
|
2904
|
+
size: "xs",
|
|
2905
|
+
tooltipText: "Clear time"
|
|
2848
2906
|
}
|
|
2849
2907
|
),
|
|
2850
2908
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("i", { className: "icon-neo-time-four shared-time-picker__icon" })
|
|
@@ -3012,6 +3070,7 @@ var TruncatedTextByWidth = ({ text, className }) => {
|
|
|
3012
3070
|
|
|
3013
3071
|
// src/components/ui/view-toggle.tsx
|
|
3014
3072
|
var React28 = __toESM(require("react"), 1);
|
|
3073
|
+
var import_react_i18next3 = require("react-i18next");
|
|
3015
3074
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3016
3075
|
var VIEW_MODE_KEY = "fp_view_mode";
|
|
3017
3076
|
var useViewMode = () => {
|
|
@@ -3027,6 +3086,8 @@ var useViewMode = () => {
|
|
|
3027
3086
|
return [viewMode, setAndPersist];
|
|
3028
3087
|
};
|
|
3029
3088
|
var ViewToggle = ({ viewMode = "grid" /* GRID */, onViewModeChange }) => {
|
|
3089
|
+
const translationKey = getTranslationKey();
|
|
3090
|
+
const { t } = (0, import_react_i18next3.useTranslation)(translationKey);
|
|
3030
3091
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "view-toggle", children: [
|
|
3031
3092
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip, { children: [
|
|
3032
3093
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
@@ -3037,10 +3098,11 @@ var ViewToggle = ({ viewMode = "grid" /* GRID */, onViewModeChange }) => {
|
|
|
3037
3098
|
className: `view-toggle__btn${viewMode === "grid" /* GRID */ ? " view-toggle__btn--active" : ""}`,
|
|
3038
3099
|
variant: "ghost",
|
|
3039
3100
|
size: "icon",
|
|
3040
|
-
|
|
3101
|
+
"aria-label": t("ActionNames.gridView") || "Grid view",
|
|
3102
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("i", { className: "icon-neo-grid", "aria-hidden": "true" })
|
|
3041
3103
|
}
|
|
3042
3104
|
) }),
|
|
3043
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipContent, { children: "Grid view" })
|
|
3105
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipContent, { children: t("ActionNames.gridView") || "Grid view" })
|
|
3044
3106
|
] }),
|
|
3045
3107
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip, { children: [
|
|
3046
3108
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
@@ -3051,10 +3113,11 @@ var ViewToggle = ({ viewMode = "grid" /* GRID */, onViewModeChange }) => {
|
|
|
3051
3113
|
className: `view-toggle__btn${viewMode === "list" /* LIST */ ? " view-toggle__btn--active" : ""}`,
|
|
3052
3114
|
variant: "ghost",
|
|
3053
3115
|
size: "icon",
|
|
3054
|
-
|
|
3116
|
+
"aria-label": t("ActionNames.listView") || "List view",
|
|
3117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("i", { className: "icon-neo-list", "aria-hidden": "true" })
|
|
3055
3118
|
}
|
|
3056
3119
|
) }),
|
|
3057
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipContent, { children: "List view" })
|
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipContent, { children: t("ActionNames.listView") || "List view" })
|
|
3058
3121
|
] })
|
|
3059
3122
|
] });
|
|
3060
3123
|
};
|