@l3mpire/ui 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +612 -606
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +615 -609
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1270,454 +1270,17 @@ var Switch = React9.forwardRef(({ className, label, disabled, id, ...props }, re
|
|
|
1270
1270
|
Switch.displayName = "Switch";
|
|
1271
1271
|
|
|
1272
1272
|
// src/components/ui/search-bar.tsx
|
|
1273
|
-
var React10 = __toESM(require("react"));
|
|
1274
|
-
var import_class_variance_authority7 = require("class-variance-authority");
|
|
1275
|
-
var import_icons8 = require("@l3mpire/icons");
|
|
1276
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1277
|
-
var searchBarVariants = (0, import_class_variance_authority7.cva)(
|
|
1278
|
-
[
|
|
1279
|
-
"inline-flex w-full items-center rounded-md border transition-colors",
|
|
1280
|
-
"border-search-bar-border-default",
|
|
1281
|
-
"hover:border-search-bar-border-hover",
|
|
1282
|
-
"focus-within:border-search-bar-border-active",
|
|
1283
|
-
"focus-within:shadow-focus-ring"
|
|
1284
|
-
],
|
|
1285
|
-
{
|
|
1286
|
-
variants: {
|
|
1287
|
-
variant: {
|
|
1288
|
-
white: "bg-search-bar-white-bg",
|
|
1289
|
-
grey: "bg-search-bar-grey-bg"
|
|
1290
|
-
},
|
|
1291
|
-
size: {
|
|
1292
|
-
sm: "gap-sm px-base py-sm",
|
|
1293
|
-
md: "gap-base px-md py-base"
|
|
1294
|
-
}
|
|
1295
|
-
},
|
|
1296
|
-
defaultVariants: { variant: "white", size: "md" }
|
|
1297
|
-
}
|
|
1298
|
-
);
|
|
1299
|
-
var inputStyle = "flex-1 min-w-0 bg-transparent outline-none text-sm font-regular leading-sm text-search-bar-text placeholder:text-search-bar-placeholder";
|
|
1300
|
-
var clearButtonStyle = "inline-flex shrink-0 items-center justify-center p-xs rounded-base text-search-bar-clear hover:bg-black/5 transition-colors";
|
|
1301
|
-
var SearchBar = React10.forwardRef(
|
|
1302
|
-
({
|
|
1303
|
-
className,
|
|
1304
|
-
variant,
|
|
1305
|
-
size = "md",
|
|
1306
|
-
value,
|
|
1307
|
-
defaultValue,
|
|
1308
|
-
onChange,
|
|
1309
|
-
onClear,
|
|
1310
|
-
hasShortcut = false,
|
|
1311
|
-
placeholder = "Search...",
|
|
1312
|
-
...props
|
|
1313
|
-
}, ref) => {
|
|
1314
|
-
const [internalValue, setInternalValue] = React10.useState(defaultValue ?? "");
|
|
1315
|
-
const isControlled = value !== void 0;
|
|
1316
|
-
const currentValue = isControlled ? value : internalValue;
|
|
1317
|
-
const hasValue = String(currentValue).length > 0;
|
|
1318
|
-
const iconSize = size === "sm" ? "xs" : "sm";
|
|
1319
|
-
const handleChange = (e) => {
|
|
1320
|
-
if (!isControlled) setInternalValue(e.target.value);
|
|
1321
|
-
onChange?.(e);
|
|
1322
|
-
};
|
|
1323
|
-
const handleClear = () => {
|
|
1324
|
-
if (!isControlled) setInternalValue("");
|
|
1325
|
-
onClear?.();
|
|
1326
|
-
};
|
|
1327
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn(searchBarVariants({ variant, size }), className), children: [
|
|
1328
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1329
|
-
import_icons8.Icon,
|
|
1330
|
-
{
|
|
1331
|
-
icon: import_icons8.faMagnifyingGlassSolid,
|
|
1332
|
-
size: iconSize,
|
|
1333
|
-
className: "shrink-0 text-search-bar-icon"
|
|
1334
|
-
}
|
|
1335
|
-
),
|
|
1336
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1337
|
-
"input",
|
|
1338
|
-
{
|
|
1339
|
-
ref,
|
|
1340
|
-
type: "text",
|
|
1341
|
-
value: currentValue,
|
|
1342
|
-
defaultValue: void 0,
|
|
1343
|
-
onChange: handleChange,
|
|
1344
|
-
placeholder,
|
|
1345
|
-
className: inputStyle,
|
|
1346
|
-
...props
|
|
1347
|
-
}
|
|
1348
|
-
),
|
|
1349
|
-
hasShortcut && !hasValue && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "shrink-0 text-xs text-search-bar-placeholder", children: "\u2318K" }),
|
|
1350
|
-
hasValue && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Tooltip, { children: [
|
|
1351
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1352
|
-
"button",
|
|
1353
|
-
{
|
|
1354
|
-
type: "button",
|
|
1355
|
-
onClick: handleClear,
|
|
1356
|
-
className: clearButtonStyle,
|
|
1357
|
-
"aria-label": "Erase",
|
|
1358
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons8.Icon, { icon: import_icons8.faXmarkSolid, size: "xs" })
|
|
1359
|
-
}
|
|
1360
|
-
) }),
|
|
1361
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipContent, { children: "Erase" })
|
|
1362
|
-
] }) })
|
|
1363
|
-
] });
|
|
1364
|
-
}
|
|
1365
|
-
);
|
|
1366
|
-
SearchBar.displayName = "SearchBar";
|
|
1367
|
-
|
|
1368
|
-
// src/components/ui/avatar.tsx
|
|
1369
|
-
var React11 = __toESM(require("react"));
|
|
1370
|
-
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
1371
|
-
var import_class_variance_authority8 = require("class-variance-authority");
|
|
1372
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1373
|
-
var avatarVariants = (0, import_class_variance_authority8.cva)(
|
|
1374
|
-
"relative inline-flex shrink-0 items-center justify-center overflow-clip",
|
|
1375
|
-
{
|
|
1376
|
-
variants: {
|
|
1377
|
-
size: {
|
|
1378
|
-
sm: "size-4",
|
|
1379
|
-
md: "size-5",
|
|
1380
|
-
lg: "size-6",
|
|
1381
|
-
xl: "size-8"
|
|
1382
|
-
},
|
|
1383
|
-
shape: {
|
|
1384
|
-
rounded: "rounded-full",
|
|
1385
|
-
squared: ""
|
|
1386
|
-
}
|
|
1387
|
-
},
|
|
1388
|
-
compoundVariants: [
|
|
1389
|
-
{ shape: "squared", size: "sm", class: "rounded-xs" },
|
|
1390
|
-
{ shape: "squared", size: "md", class: "rounded-sm" },
|
|
1391
|
-
{ shape: "squared", size: "lg", class: "rounded-base" },
|
|
1392
|
-
{ shape: "squared", size: "xl", class: "rounded-base" }
|
|
1393
|
-
],
|
|
1394
|
-
defaultVariants: {
|
|
1395
|
-
size: "xl",
|
|
1396
|
-
shape: "rounded"
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
);
|
|
1400
|
-
var initialsFontSize = {
|
|
1401
|
-
sm: "text-[8px] leading-[14px]",
|
|
1402
|
-
md: "text-xs leading-2xs",
|
|
1403
|
-
lg: "text-sm leading-sm",
|
|
1404
|
-
xl: "text-base leading-base"
|
|
1405
|
-
};
|
|
1406
|
-
var Avatar = React11.forwardRef(({ className, size = "xl", shape = "rounded", src, alt, initials, badge, ...props }, ref) => {
|
|
1407
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative inline-flex", children: [
|
|
1408
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1409
|
-
AvatarPrimitive.Root,
|
|
1410
|
-
{
|
|
1411
|
-
ref,
|
|
1412
|
-
className: cn(
|
|
1413
|
-
avatarVariants({ size, shape }),
|
|
1414
|
-
"bg-avatar-fallback-bg",
|
|
1415
|
-
className
|
|
1416
|
-
),
|
|
1417
|
-
...props,
|
|
1418
|
-
children: [
|
|
1419
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1420
|
-
AvatarPrimitive.Image,
|
|
1421
|
-
{
|
|
1422
|
-
src,
|
|
1423
|
-
alt: alt ?? "",
|
|
1424
|
-
className: "absolute inset-0 size-full object-cover"
|
|
1425
|
-
}
|
|
1426
|
-
),
|
|
1427
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1428
|
-
AvatarPrimitive.Fallback,
|
|
1429
|
-
{
|
|
1430
|
-
delayMs: 0,
|
|
1431
|
-
className: cn(
|
|
1432
|
-
"font-medium",
|
|
1433
|
-
"text-avatar-fallback-text",
|
|
1434
|
-
"select-none text-center",
|
|
1435
|
-
initialsFontSize[size ?? "xl"]
|
|
1436
|
-
),
|
|
1437
|
-
children: initials ?? "??"
|
|
1438
|
-
}
|
|
1439
|
-
)
|
|
1440
|
-
]
|
|
1441
|
-
}
|
|
1442
|
-
),
|
|
1443
|
-
badge && size === "xl" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute bottom-0 right-0 size-4 overflow-clip rounded-full", children: badge })
|
|
1444
|
-
] });
|
|
1445
|
-
});
|
|
1446
|
-
Avatar.displayName = "Avatar";
|
|
1447
|
-
|
|
1448
|
-
// src/components/ui/checkbox.tsx
|
|
1449
1273
|
var React12 = __toESM(require("react"));
|
|
1450
|
-
var
|
|
1274
|
+
var import_class_variance_authority8 = require("class-variance-authority");
|
|
1451
1275
|
var import_icons9 = require("@l3mpire/icons");
|
|
1452
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1453
|
-
var rootStyles = {
|
|
1454
|
-
base: "peer shrink-0 size-4 rounded-sm inline-flex items-center justify-center transition-colors cursor-pointer focus-visible:outline-none",
|
|
1455
|
-
unchecked: [
|
|
1456
|
-
"bg-checkbox-unchecked-bg",
|
|
1457
|
-
"border border-checkbox-unchecked-border-default",
|
|
1458
|
-
"hover:border-checkbox-unchecked-border-hover",
|
|
1459
|
-
"active:border-checkbox-unchecked-border-pressed",
|
|
1460
|
-
"active:[box-shadow:0_0_0_3px_#316bff26]"
|
|
1461
|
-
],
|
|
1462
|
-
checked: [
|
|
1463
|
-
"data-[state=checked]:bg-checkbox-checked-bg-default",
|
|
1464
|
-
"data-[state=checked]:border-transparent",
|
|
1465
|
-
"data-[state=checked]:hover:bg-checkbox-checked-bg-hover",
|
|
1466
|
-
"data-[state=checked]:active:bg-checkbox-checked-bg-pressed",
|
|
1467
|
-
"data-[state=checked]:active:[box-shadow:0_0_0_3px_#316bff26]"
|
|
1468
|
-
],
|
|
1469
|
-
disabled: [
|
|
1470
|
-
"disabled:pointer-events-none",
|
|
1471
|
-
"disabled:bg-checkbox-disabled-bg",
|
|
1472
|
-
"disabled:border-checkbox-disabled-border",
|
|
1473
|
-
"data-[state=checked]:disabled:bg-checkbox-disabled-bg",
|
|
1474
|
-
"data-[state=checked]:disabled:border-transparent"
|
|
1475
|
-
]
|
|
1476
|
-
};
|
|
1477
|
-
var iconStyle = {
|
|
1478
|
-
default: "text-checkbox-checked-icon",
|
|
1479
|
-
disabled: "text-checkbox-disabled-icon"
|
|
1480
|
-
};
|
|
1481
|
-
var labelBase2 = "cursor-pointer select-none overflow-hidden text-ellipsis whitespace-nowrap text-sm font-medium leading-sm";
|
|
1482
|
-
var labelColor2 = {
|
|
1483
|
-
default: "text-checkbox-label-default",
|
|
1484
|
-
disabled: "pointer-events-none text-checkbox-label-disabled"
|
|
1485
|
-
};
|
|
1486
|
-
var Checkbox = React12.forwardRef(({ className, label, disabled, id, ...props }, ref) => {
|
|
1487
|
-
const innerId = id ?? React12.useId();
|
|
1488
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "inline-flex items-center gap-base", children: [
|
|
1489
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1490
|
-
CheckboxPrimitive.Root,
|
|
1491
|
-
{
|
|
1492
|
-
ref,
|
|
1493
|
-
id: innerId,
|
|
1494
|
-
disabled,
|
|
1495
|
-
className: cn(
|
|
1496
|
-
rootStyles.base,
|
|
1497
|
-
rootStyles.unchecked,
|
|
1498
|
-
rootStyles.checked,
|
|
1499
|
-
rootStyles.disabled,
|
|
1500
|
-
className
|
|
1501
|
-
),
|
|
1502
|
-
...props,
|
|
1503
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1504
|
-
CheckboxPrimitive.Indicator,
|
|
1505
|
-
{
|
|
1506
|
-
forceMount: true,
|
|
1507
|
-
className: cn(
|
|
1508
|
-
"flex items-center justify-center transition-opacity",
|
|
1509
|
-
"data-[state=unchecked]:opacity-0",
|
|
1510
|
-
"data-[state=checked]:opacity-100",
|
|
1511
|
-
"data-[state=indeterminate]:opacity-100"
|
|
1512
|
-
),
|
|
1513
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1514
|
-
import_icons9.Icon,
|
|
1515
|
-
{
|
|
1516
|
-
icon: import_icons9.faCheckSolid,
|
|
1517
|
-
size: "xs",
|
|
1518
|
-
className: iconStyle[disabled ? "disabled" : "default"]
|
|
1519
|
-
}
|
|
1520
|
-
)
|
|
1521
|
-
}
|
|
1522
|
-
)
|
|
1523
|
-
}
|
|
1524
|
-
),
|
|
1525
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1526
|
-
"label",
|
|
1527
|
-
{
|
|
1528
|
-
htmlFor: innerId,
|
|
1529
|
-
className: cn(labelBase2, labelColor2[disabled ? "disabled" : "default"]),
|
|
1530
|
-
children: label
|
|
1531
|
-
}
|
|
1532
|
-
)
|
|
1533
|
-
] });
|
|
1534
|
-
});
|
|
1535
|
-
Checkbox.displayName = "Checkbox";
|
|
1536
|
-
|
|
1537
|
-
// src/components/ui/dropdown-menu.tsx
|
|
1538
|
-
var React13 = __toESM(require("react"));
|
|
1539
|
-
var DropdownMenuPrimitive2 = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1540
|
-
var import_icons10 = require("@l3mpire/icons");
|
|
1541
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1542
|
-
var textSm = "text-sm font-regular leading-sm";
|
|
1543
|
-
var textXs = "text-xs font-regular leading-xs";
|
|
1544
|
-
var textXsMedium = "text-xs font-medium leading-xs";
|
|
1545
|
-
var textSmMedium = "text-sm font-medium leading-sm";
|
|
1546
|
-
var containerStyle = [
|
|
1547
|
-
"flex flex-col gap-base overflow-clip",
|
|
1548
|
-
"bg-dropdown-bg",
|
|
1549
|
-
"border border-dropdown-border",
|
|
1550
|
-
"rounded-md",
|
|
1551
|
-
"p-base",
|
|
1552
|
-
"shadow-lg"
|
|
1553
|
-
];
|
|
1554
|
-
var DropdownMenu = React13.forwardRef(
|
|
1555
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref, className: cn(containerStyle, className), ...props, children })
|
|
1556
|
-
);
|
|
1557
|
-
DropdownMenu.displayName = "DropdownMenu";
|
|
1558
|
-
var DropdownMenuRoot = DropdownMenuPrimitive2.Root;
|
|
1559
|
-
var DropdownMenuTrigger = DropdownMenuPrimitive2.Trigger;
|
|
1560
|
-
var DropdownMenuContent = React13.forwardRef(({ className, sideOffset = 4, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DropdownMenuPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1561
|
-
DropdownMenuPrimitive2.Content,
|
|
1562
|
-
{
|
|
1563
|
-
ref,
|
|
1564
|
-
sideOffset,
|
|
1565
|
-
className: cn(
|
|
1566
|
-
containerStyle,
|
|
1567
|
-
"z-50",
|
|
1568
|
-
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
1569
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
1570
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1571
|
-
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
1572
|
-
className
|
|
1573
|
-
),
|
|
1574
|
-
...props,
|
|
1575
|
-
children
|
|
1576
|
-
}
|
|
1577
|
-
) }));
|
|
1578
|
-
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
1579
|
-
var DropdownMenuList = React13.forwardRef(
|
|
1580
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref, className: cn("flex flex-col", className), role: "listbox", ...props, children })
|
|
1581
|
-
);
|
|
1582
|
-
DropdownMenuList.displayName = "DropdownMenuList";
|
|
1583
|
-
var itemStyle = "flex items-center gap-base p-base rounded-base cursor-pointer hover:bg-dropdown-item-hover";
|
|
1584
|
-
var DropdownMenuItem = React13.forwardRef(
|
|
1585
|
-
({
|
|
1586
|
-
className,
|
|
1587
|
-
icon,
|
|
1588
|
-
avatar,
|
|
1589
|
-
flag,
|
|
1590
|
-
label,
|
|
1591
|
-
description,
|
|
1592
|
-
badge,
|
|
1593
|
-
action,
|
|
1594
|
-
isActive,
|
|
1595
|
-
children,
|
|
1596
|
-
...props
|
|
1597
|
-
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1598
|
-
"div",
|
|
1599
|
-
{
|
|
1600
|
-
ref,
|
|
1601
|
-
role: "option",
|
|
1602
|
-
"aria-selected": isActive,
|
|
1603
|
-
className: cn(
|
|
1604
|
-
itemStyle,
|
|
1605
|
-
isActive && "bg-dropdown-item-hover",
|
|
1606
|
-
className
|
|
1607
|
-
),
|
|
1608
|
-
...props,
|
|
1609
|
-
children: [
|
|
1610
|
-
children,
|
|
1611
|
-
avatar,
|
|
1612
|
-
flag,
|
|
1613
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1614
|
-
import_icons10.Icon,
|
|
1615
|
-
{
|
|
1616
|
-
icon,
|
|
1617
|
-
size: "sm",
|
|
1618
|
-
className: "shrink-0 text-dropdown-item-icon"
|
|
1619
|
-
}
|
|
1620
|
-
),
|
|
1621
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-1 items-center gap-sm min-w-0", children: [
|
|
1622
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("truncate shrink-0", textSm, "text-dropdown-item-text"), children: label }),
|
|
1623
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("truncate", textXs, "text-dropdown-item-secondary"), children: description })
|
|
1624
|
-
] }),
|
|
1625
|
-
badge,
|
|
1626
|
-
action
|
|
1627
|
-
]
|
|
1628
|
-
}
|
|
1629
|
-
)
|
|
1630
|
-
);
|
|
1631
|
-
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
1632
|
-
var DropdownMenuRadixItem = React13.forwardRef(
|
|
1633
|
-
({
|
|
1634
|
-
className,
|
|
1635
|
-
icon,
|
|
1636
|
-
avatar,
|
|
1637
|
-
flag,
|
|
1638
|
-
label,
|
|
1639
|
-
description,
|
|
1640
|
-
badge,
|
|
1641
|
-
action,
|
|
1642
|
-
children,
|
|
1643
|
-
...props
|
|
1644
|
-
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1645
|
-
DropdownMenuPrimitive2.Item,
|
|
1646
|
-
{
|
|
1647
|
-
ref,
|
|
1648
|
-
className: cn(
|
|
1649
|
-
itemStyle,
|
|
1650
|
-
"outline-none focus:bg-dropdown-item-hover",
|
|
1651
|
-
className
|
|
1652
|
-
),
|
|
1653
|
-
...props,
|
|
1654
|
-
children: [
|
|
1655
|
-
children,
|
|
1656
|
-
avatar,
|
|
1657
|
-
flag,
|
|
1658
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1659
|
-
import_icons10.Icon,
|
|
1660
|
-
{
|
|
1661
|
-
icon,
|
|
1662
|
-
size: "sm",
|
|
1663
|
-
className: "shrink-0 text-dropdown-item-icon"
|
|
1664
|
-
}
|
|
1665
|
-
),
|
|
1666
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-1 items-center gap-sm min-w-0", children: [
|
|
1667
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("truncate shrink-0", textSm, "text-dropdown-item-text"), children: label }),
|
|
1668
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("truncate", textXs, "text-dropdown-item-secondary"), children: description })
|
|
1669
|
-
] }),
|
|
1670
|
-
badge,
|
|
1671
|
-
action
|
|
1672
|
-
]
|
|
1673
|
-
}
|
|
1674
|
-
)
|
|
1675
|
-
);
|
|
1676
|
-
DropdownMenuRadixItem.displayName = "DropdownMenuRadixItem";
|
|
1677
|
-
var DropdownMenuHeading = React13.forwardRef(({ className, action, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1678
|
-
"div",
|
|
1679
|
-
{
|
|
1680
|
-
ref,
|
|
1681
|
-
className: cn(
|
|
1682
|
-
"flex items-center gap-base p-base rounded-base",
|
|
1683
|
-
className
|
|
1684
|
-
),
|
|
1685
|
-
...props,
|
|
1686
|
-
children: [
|
|
1687
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("flex-1 truncate uppercase", textXsMedium, "text-dropdown-heading-text"), children }),
|
|
1688
|
-
action
|
|
1689
|
-
]
|
|
1690
|
-
}
|
|
1691
|
-
));
|
|
1692
|
-
DropdownMenuHeading.displayName = "DropdownMenuHeading";
|
|
1693
|
-
var clearStyle = [
|
|
1694
|
-
"sticky bottom-0 -mx-base -mb-base",
|
|
1695
|
-
"flex items-center justify-center",
|
|
1696
|
-
"h-10 min-w-[80px] px-md py-[10px]",
|
|
1697
|
-
"bg-gradient-to-t from-[#fbfbfb] from-[10%] to-white",
|
|
1698
|
-
"border border-dropdown-border",
|
|
1699
|
-
"shadow-sm",
|
|
1700
|
-
"cursor-pointer"
|
|
1701
|
-
];
|
|
1702
|
-
var DropdownMenuClear = React13.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1703
|
-
"button",
|
|
1704
|
-
{
|
|
1705
|
-
ref,
|
|
1706
|
-
type: "button",
|
|
1707
|
-
className: cn(clearStyle, textSmMedium, "text-dropdown-clear-text", className),
|
|
1708
|
-
...props,
|
|
1709
|
-
children
|
|
1710
|
-
}
|
|
1711
|
-
));
|
|
1712
|
-
DropdownMenuClear.displayName = "DropdownMenuClear";
|
|
1713
1276
|
|
|
1714
1277
|
// src/components/ui/sidebar.tsx
|
|
1715
|
-
var
|
|
1716
|
-
var
|
|
1278
|
+
var React11 = __toESM(require("react"));
|
|
1279
|
+
var import_icons8 = require("@l3mpire/icons");
|
|
1717
1280
|
|
|
1718
1281
|
// src/components/ui/product-logo.tsx
|
|
1719
|
-
var
|
|
1720
|
-
var
|
|
1282
|
+
var React10 = __toESM(require("react"));
|
|
1283
|
+
var import_class_variance_authority7 = require("class-variance-authority");
|
|
1721
1284
|
|
|
1722
1285
|
// src/assets/logos/lemlist-sm-picto.svg
|
|
1723
1286
|
var lemlist_sm_picto_default = '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M16.4386 0H3.56138C1.59448 0 0 1.59448 0 3.56138V16.4386C0 18.4055 1.59448 20 3.56138 20H16.4386C18.4055 20 20 18.4055 20 16.4386V3.56138C20 1.59448 18.4055 0 16.4386 0Z" fill="#316BFF"/>\n<path d="M14.6428 13.3821V14.1178C14.6428 14.4076 14.4076 14.6428 14.1178 14.6428H7.41337C6.30968 14.5723 5.42773 13.6903 5.35718 12.5866V5.88215C5.35718 5.59237 5.59236 5.35719 5.88215 5.35719H6.61794C6.90772 5.35719 7.14291 5.59237 7.14291 5.88215V11.4922C7.14291 12.2464 7.75355 12.8571 8.50782 12.8571H14.1178C14.4076 12.8571 14.6428 13.0923 14.6428 13.3821Z" fill="white"/>\n<path d="M14.1178 5.35718H9.45362C9.16369 5.35718 8.92865 5.59222 8.92865 5.88215V6.61795C8.92865 6.90788 9.16369 7.14291 9.45362 7.14291H14.1178C14.4078 7.14291 14.6428 6.90788 14.6428 6.61795V5.88215C14.6428 5.59222 14.4078 5.35718 14.1178 5.35718Z" fill="white"/>\n<path d="M13.2846 9.10755H9.45362C9.16369 9.10755 8.92865 9.34259 8.92865 9.63252V10.3683C8.92865 10.6582 9.16369 10.8933 9.45362 10.8933H13.2846C13.5746 10.8933 13.8096 10.6582 13.8096 10.3683V9.63252C13.8096 9.34259 13.5746 9.10755 13.2846 9.10755Z" fill="white"/>\n</svg>\n';
|
|
@@ -1846,8 +1409,8 @@ var lemcal_md_logotype_dark_default = '<svg width="111" height="28" viewBox="0 0
|
|
|
1846
1409
|
var lemcal_lg_logotype_dark_default = '<svg width="127" height="32" viewBox="0 0 127 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M43.4336 6.48746V25.7729C43.4336 26.237 43.0592 26.6136 42.5979 26.6136H41.1979C40.7366 26.6136 40.3622 26.237 40.3622 25.7729V6.48746C40.3622 6.02341 40.7366 5.6468 41.1979 5.6468H42.5979C43.0592 5.6468 43.4336 6.02341 43.4336 6.48746Z" fill="white"/>\n<path d="M49.4964 20.2429C49.7651 22.4932 51.613 23.962 54.2967 23.962C55.5402 23.962 57.0525 23.5652 58.0393 22.8429C58.3696 22.6008 58.8228 22.6291 59.117 22.9156L59.9313 23.7105C60.2883 24.0589 60.2696 24.6453 59.8845 24.9601C58.3522 26.2137 56.194 26.8418 54.2365 26.8418C49.4054 26.8418 46.3046 23.7522 46.3046 19.0135C46.3046 14.2749 49.4362 11.305 54.0279 11.305C58.6196 11.305 61.6923 13.9548 61.477 19.4372C61.4597 19.8878 61.0893 20.2443 60.6413 20.2443H49.495L49.4964 20.2429ZM58.4712 17.6335C58.292 15.2944 56.5925 14.0637 54.1175 14.0637C51.8805 14.0637 50.0326 15.2931 49.5552 17.6335H58.4712Z" fill="white"/>\n<path d="M73.9362 25.7729V17.9998C73.9362 16.0508 72.3678 14.4273 70.4303 14.4663C68.2975 14.508 66.9577 16.3212 66.9577 18.4854V25.7729C66.9577 26.2369 66.5833 26.6136 66.122 26.6136H64.7221C64.2607 26.6136 63.8864 26.2369 63.8864 25.7729V12.514C63.8864 12.05 64.2607 11.6733 64.7221 11.6733H65.9977C66.4256 11.6733 66.7839 11.9975 66.8294 12.4252L66.9591 13.775C67.7934 12.1555 69.5237 11.5556 71.0748 11.5556C72.9534 11.5556 74.8615 12.3357 75.6972 14.5255C76.8899 12.3357 78.7392 11.5865 80.7369 11.5865C84.7924 11.5865 86.9692 14.1664 86.9692 18.4262V25.7742C86.9692 26.2383 86.5948 26.6149 86.1335 26.6149H84.7041C84.2428 26.6149 83.8684 26.2383 83.8684 25.7742V17.8344C83.8684 16.0199 82.4297 14.4999 80.6259 14.4973C78.445 14.4932 77.0397 16.2943 77.0397 18.4867V25.7742C77.0397 26.2383 76.6653 26.6149 76.204 26.6149H74.7746C74.3133 26.6149 73.9389 26.2383 73.9389 25.7742L73.9362 25.7729Z" fill="white"/>\n<path d="M102.135 23.9274C102.492 24.2811 102.46 24.8703 102.068 25.185C100.613 26.3566 99.014 26.8663 97.1942 26.8663C92.9595 26.8663 89.4415 24.1964 89.4415 19.0973C89.4415 13.9981 92.9301 11.3282 97.1942 11.3282C98.9338 11.3282 100.431 11.7909 101.819 12.9073C102.203 13.2167 102.243 13.7897 101.904 14.1474L101.069 15.0258C100.786 15.3244 100.326 15.3728 99.9901 15.1347C99.1571 14.5456 98.1716 14.2685 97.225 14.2685C94.5707 14.2685 92.5129 16.1583 92.5129 19.0973C92.5129 22.2165 94.6603 23.8669 97.1942 23.8669C98.2265 23.8669 99.2774 23.6019 100.149 22.9563C100.481 22.7101 100.939 22.7424 101.232 23.0329L102.135 23.9274Z" fill="white"/>\n<path d="M117.171 11.6677H118.513C118.975 11.6677 119.349 12.0443 119.349 12.5084V25.7779C119.349 26.2419 118.975 26.6185 118.513 26.6185H117.212C116.771 26.6185 116.406 26.2728 116.378 25.8303L116.278 24.0228C115.294 25.9126 113.027 26.8125 111.209 26.8125C106.915 26.842 103.665 24.0524 103.665 19.0138C103.665 13.9752 107.034 11.3052 111.269 11.3052C113.356 11.3052 115.354 12.2952 116.278 13.9752L116.337 12.4774C116.354 12.0255 116.723 11.6691 117.172 11.6691L117.171 11.6677ZM106.735 19.0138C106.735 22.0738 108.882 23.9327 111.505 23.9327C117.857 23.9327 117.857 14.1245 111.505 14.1245C108.882 14.1245 106.735 15.9847 106.735 19.0138Z" fill="white"/>\n<path d="M126.118 6.48746V25.7729C126.118 26.237 125.743 26.6136 125.282 26.6136H123.882C123.421 26.6136 123.046 26.237 123.046 25.7729V6.48746C123.046 6.02341 123.421 5.6468 123.882 5.6468H125.282C125.743 5.6468 126.118 6.02341 126.118 6.48746Z" fill="white"/>\n<path d="M26.1467 0H5.66461C2.53613 0 0 2.55117 0 5.69821V26.3018C0 29.4488 2.53613 32 5.66461 32H26.1467C29.2752 32 31.8113 29.4488 31.8113 26.3018V5.69821C31.8113 2.55117 29.2752 0 26.1467 0Z" fill="#FF4D4D"/>\n<path d="M16.6453 14.6362H15.199C14.7829 14.6362 14.4456 14.9754 14.4456 15.3938V16.8682C14.4456 17.2866 14.7829 17.6258 15.199 17.6258H16.6453C17.0615 17.6258 17.3988 17.2866 17.3988 16.8682V15.3938C17.3988 14.9754 17.0615 14.6362 16.6453 14.6362Z" fill="#0C1521"/>\n<path d="M20.3798 13.8921V12.4371C20.3798 12.0189 20.0423 11.6795 19.6264 11.6795H13.7556C12.5078 11.6795 11.4953 12.6976 11.4953 13.9521L11.4666 18.3396C11.4666 19.5955 12.4792 20.6122 13.7269 20.6122H18.0636C19.3126 20.6122 20.3239 19.7839 20.3239 18.5294V18.3423C20.3239 17.9241 20.6614 17.5861 21.0773 17.5861H22.5189C22.9348 17.5861 23.2724 17.9241 23.2724 18.3423V19.8573C23.2724 21.5047 22.2013 22.8995 20.7197 23.3751C20.3676 23.4887 19.9902 23.5501 19.5995 23.5501H12.1818C11.7911 23.5501 11.4885 23.4887 11.135 23.3751C9.65469 22.8995 8.51031 21.5047 8.51031 19.8587L8.53897 12.4442C8.53897 10.7969 9.61048 9.24501 11.0921 8.76938C11.1811 8.74132 11.3982 8.71593 11.4899 8.69456L11.4907 8.07134C11.4907 7.61041 11.8628 7.23632 12.3212 7.23632H13.6146C14.073 7.23632 14.4451 7.61041 14.4451 8.07134V8.69535H17.3929V8.07134C17.3929 7.61041 17.7649 7.23632 18.2234 7.23632H19.5238C19.9822 7.23632 20.3543 7.61041 20.3543 8.07134V8.68418C20.446 8.70556 20.658 8.73094 20.747 8.759C22.2287 9.23329 23.301 10.7955 23.301 12.4429V13.8921C23.301 14.3102 22.9635 14.6496 22.5476 14.6496H21.1332C20.7173 14.6496 20.3798 14.3102 20.3798 13.8921Z" fill="#0C1521"/>\n</svg>\n';
|
|
1847
1410
|
|
|
1848
1411
|
// src/components/ui/product-logo.tsx
|
|
1849
|
-
var
|
|
1850
|
-
var productLogoVariants = (0,
|
|
1412
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1413
|
+
var productLogoVariants = (0, import_class_variance_authority7.cva)(["inline-flex items-center shrink-0"], {
|
|
1851
1414
|
variants: {
|
|
1852
1415
|
size: {
|
|
1853
1416
|
sm: "",
|
|
@@ -1859,198 +1422,641 @@ var productLogoVariants = (0, import_class_variance_authority9.cva)(["inline-fle
|
|
|
1859
1422
|
defaultVariants: {
|
|
1860
1423
|
size: "lg"
|
|
1861
1424
|
}
|
|
1862
|
-
});
|
|
1863
|
-
var svgMap = {
|
|
1864
|
-
lemlist: {
|
|
1865
|
-
sm: { light: { picto: lemlist_sm_picto_default, logotype: lemlist_sm_logotype_default }, dark: { picto: lemlist_sm_picto_dark_default, logotype: lemlist_sm_logotype_dark_default } },
|
|
1866
|
-
md: { light: { picto: lemlist_md_picto_default, logotype: lemlist_md_logotype_default }, dark: { picto: lemlist_md_picto_dark_default, logotype: lemlist_md_logotype_dark_default } },
|
|
1867
|
-
lg: { light: { picto: lemlist_lg_picto_default, logotype: lemlist_lg_logotype_default }, dark: { picto: lemlist_lg_picto_dark_default, logotype: lemlist_lg_logotype_dark_default } },
|
|
1868
|
-
xl: { light: { picto: lemlist_xl_picto_default }, dark: { picto: lemlist_xl_picto_dark_default } }
|
|
1869
|
-
},
|
|
1870
|
-
lemwarm: {
|
|
1871
|
-
sm: { light: { picto: lemwarm_sm_picto_default, logotype: lemwarm_sm_logotype_default }, dark: { picto: lemwarm_sm_picto_dark_default, logotype: lemwarm_sm_logotype_dark_default } },
|
|
1872
|
-
md: { light: { picto: lemwarm_md_picto_default, logotype: lemwarm_md_logotype_default }, dark: { picto: lemwarm_md_picto_dark_default, logotype: lemwarm_md_logotype_dark_default } },
|
|
1873
|
-
lg: { light: { picto: lemwarm_lg_picto_default, logotype: lemwarm_lg_logotype_default }, dark: { picto: lemwarm_lg_picto_dark_default, logotype: lemwarm_lg_logotype_dark_default } },
|
|
1874
|
-
xl: { light: { picto: lemwarm_xl_picto_default }, dark: { picto: lemwarm_xl_picto_dark_default } }
|
|
1875
|
-
},
|
|
1876
|
-
lemcal: {
|
|
1877
|
-
sm: { light: { picto: lemcal_sm_picto_default, logotype: lemcal_sm_logotype_default }, dark: { picto: lemcal_sm_picto_dark_default, logotype: lemcal_sm_logotype_dark_default } },
|
|
1878
|
-
md: { light: { picto: lemcal_md_picto_default, logotype: lemcal_md_logotype_default }, dark: { picto: lemcal_md_picto_dark_default, logotype: lemcal_md_logotype_dark_default } },
|
|
1879
|
-
lg: { light: { picto: lemcal_lg_picto_default, logotype: lemcal_lg_logotype_default }, dark: { picto: lemcal_lg_picto_dark_default, logotype: lemcal_lg_logotype_dark_default } },
|
|
1880
|
-
xl: { light: { picto: lemcal_xl_picto_default }, dark: { picto: lemcal_xl_picto_dark_default } }
|
|
1425
|
+
});
|
|
1426
|
+
var svgMap = {
|
|
1427
|
+
lemlist: {
|
|
1428
|
+
sm: { light: { picto: lemlist_sm_picto_default, logotype: lemlist_sm_logotype_default }, dark: { picto: lemlist_sm_picto_dark_default, logotype: lemlist_sm_logotype_dark_default } },
|
|
1429
|
+
md: { light: { picto: lemlist_md_picto_default, logotype: lemlist_md_logotype_default }, dark: { picto: lemlist_md_picto_dark_default, logotype: lemlist_md_logotype_dark_default } },
|
|
1430
|
+
lg: { light: { picto: lemlist_lg_picto_default, logotype: lemlist_lg_logotype_default }, dark: { picto: lemlist_lg_picto_dark_default, logotype: lemlist_lg_logotype_dark_default } },
|
|
1431
|
+
xl: { light: { picto: lemlist_xl_picto_default }, dark: { picto: lemlist_xl_picto_dark_default } }
|
|
1432
|
+
},
|
|
1433
|
+
lemwarm: {
|
|
1434
|
+
sm: { light: { picto: lemwarm_sm_picto_default, logotype: lemwarm_sm_logotype_default }, dark: { picto: lemwarm_sm_picto_dark_default, logotype: lemwarm_sm_logotype_dark_default } },
|
|
1435
|
+
md: { light: { picto: lemwarm_md_picto_default, logotype: lemwarm_md_logotype_default }, dark: { picto: lemwarm_md_picto_dark_default, logotype: lemwarm_md_logotype_dark_default } },
|
|
1436
|
+
lg: { light: { picto: lemwarm_lg_picto_default, logotype: lemwarm_lg_logotype_default }, dark: { picto: lemwarm_lg_picto_dark_default, logotype: lemwarm_lg_logotype_dark_default } },
|
|
1437
|
+
xl: { light: { picto: lemwarm_xl_picto_default }, dark: { picto: lemwarm_xl_picto_dark_default } }
|
|
1438
|
+
},
|
|
1439
|
+
lemcal: {
|
|
1440
|
+
sm: { light: { picto: lemcal_sm_picto_default, logotype: lemcal_sm_logotype_default }, dark: { picto: lemcal_sm_picto_dark_default, logotype: lemcal_sm_logotype_dark_default } },
|
|
1441
|
+
md: { light: { picto: lemcal_md_picto_default, logotype: lemcal_md_logotype_default }, dark: { picto: lemcal_md_picto_dark_default, logotype: lemcal_md_logotype_dark_default } },
|
|
1442
|
+
lg: { light: { picto: lemcal_lg_picto_default, logotype: lemcal_lg_logotype_default }, dark: { picto: lemcal_lg_picto_dark_default, logotype: lemcal_lg_logotype_dark_default } },
|
|
1443
|
+
xl: { light: { picto: lemcal_xl_picto_default }, dark: { picto: lemcal_xl_picto_dark_default } }
|
|
1444
|
+
}
|
|
1445
|
+
};
|
|
1446
|
+
function useIsDarkTheme() {
|
|
1447
|
+
const [isDark, setIsDark] = React10.useState(false);
|
|
1448
|
+
React10.useEffect(() => {
|
|
1449
|
+
const root = document.documentElement;
|
|
1450
|
+
const check = () => setIsDark(root.getAttribute("data-theme") === "dark");
|
|
1451
|
+
check();
|
|
1452
|
+
const observer = new MutationObserver(check);
|
|
1453
|
+
observer.observe(root, { attributes: true, attributeFilter: ["data-theme"] });
|
|
1454
|
+
return () => observer.disconnect();
|
|
1455
|
+
}, []);
|
|
1456
|
+
return isDark;
|
|
1457
|
+
}
|
|
1458
|
+
function SvgImage({ svg, alt, className }) {
|
|
1459
|
+
const dataUri = React10.useMemo(
|
|
1460
|
+
() => `data:image/svg+xml,${encodeURIComponent(svg)}`,
|
|
1461
|
+
[svg]
|
|
1462
|
+
);
|
|
1463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: dataUri, alt, className });
|
|
1464
|
+
}
|
|
1465
|
+
var ProductLogo = React10.forwardRef(
|
|
1466
|
+
({ className, product = "lemlist", size = "lg", hasText = true, ...props }, ref) => {
|
|
1467
|
+
const resolvedSize = size ?? "lg";
|
|
1468
|
+
const isDark = useIsDarkTheme();
|
|
1469
|
+
const entry = svgMap[product][resolvedSize][isDark ? "dark" : "light"];
|
|
1470
|
+
const svg = hasText && entry.logotype ? entry.logotype : entry.picto;
|
|
1471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1472
|
+
"div",
|
|
1473
|
+
{
|
|
1474
|
+
ref,
|
|
1475
|
+
className: cn(productLogoVariants({ size }), className),
|
|
1476
|
+
...props,
|
|
1477
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SvgImage, { svg, alt: `${product} logo`, className: "h-auto w-auto" })
|
|
1478
|
+
}
|
|
1479
|
+
);
|
|
1480
|
+
}
|
|
1481
|
+
);
|
|
1482
|
+
ProductLogo.displayName = "ProductLogo";
|
|
1483
|
+
|
|
1484
|
+
// src/components/ui/sidebar.tsx
|
|
1485
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1486
|
+
var SidebarContext = React11.createContext({
|
|
1487
|
+
isCollapsed: false,
|
|
1488
|
+
isHovered: false,
|
|
1489
|
+
setCollapsed: () => {
|
|
1490
|
+
}
|
|
1491
|
+
});
|
|
1492
|
+
function useSidebarContext() {
|
|
1493
|
+
return React11.useContext(SidebarContext);
|
|
1494
|
+
}
|
|
1495
|
+
var SidebarHeader = React11.forwardRef(
|
|
1496
|
+
({ className, ...props }, ref) => {
|
|
1497
|
+
const { isCollapsed, isHovered, setCollapsed } = useSidebarContext();
|
|
1498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1499
|
+
"div",
|
|
1500
|
+
{
|
|
1501
|
+
ref,
|
|
1502
|
+
className: cn(
|
|
1503
|
+
"flex items-center shrink-0 h-[44px] border-b border-sidebar-border",
|
|
1504
|
+
isCollapsed ? "justify-center px-lg" : "justify-between px-lg",
|
|
1505
|
+
className
|
|
1506
|
+
),
|
|
1507
|
+
...props,
|
|
1508
|
+
children: isCollapsed ? (
|
|
1509
|
+
// Collapsed: show picto, on sidebar hover show expand button
|
|
1510
|
+
isHovered ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1511
|
+
"button",
|
|
1512
|
+
{
|
|
1513
|
+
onClick: () => setCollapsed(false),
|
|
1514
|
+
className: "flex items-center justify-center size-6 rounded-base hover:bg-sidebar-item-hover-bg transition-colors cursor-pointer",
|
|
1515
|
+
"aria-label": "Expand sidebar",
|
|
1516
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons8.Icon, { icon: import_icons8.faArrowRightFromLineOutline, size: "xs", className: "text-sidebar-item-default-icon" })
|
|
1517
|
+
}
|
|
1518
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ProductLogo, { product: "lemlist", size: "sm", hasText: false })
|
|
1519
|
+
) : (
|
|
1520
|
+
// Expanded: logo + collapse button
|
|
1521
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1522
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ProductLogo, { product: "lemlist", size: "sm", hasText: true }),
|
|
1523
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1524
|
+
"button",
|
|
1525
|
+
{
|
|
1526
|
+
onClick: () => setCollapsed(true),
|
|
1527
|
+
className: "flex items-center justify-center size-6 rounded-base hover:bg-sidebar-item-hover-bg transition-colors cursor-pointer",
|
|
1528
|
+
"aria-label": "Collapse sidebar",
|
|
1529
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons8.Icon, { icon: import_icons8.faArrowLeftFromLineOutline, size: "xs", className: "text-sidebar-item-default-icon" })
|
|
1530
|
+
}
|
|
1531
|
+
)
|
|
1532
|
+
] })
|
|
1533
|
+
)
|
|
1534
|
+
}
|
|
1535
|
+
);
|
|
1536
|
+
}
|
|
1537
|
+
);
|
|
1538
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
1539
|
+
var Sidebar = React11.forwardRef(
|
|
1540
|
+
({ className, isCollapsed: isCollapsedProp = false, onCollapsedChange, children, ...props }, ref) => {
|
|
1541
|
+
const [isCollapsedInternal, setCollapsedInternal] = React11.useState(isCollapsedProp);
|
|
1542
|
+
const [isHovered, setIsHovered] = React11.useState(false);
|
|
1543
|
+
React11.useEffect(() => {
|
|
1544
|
+
setCollapsedInternal(isCollapsedProp);
|
|
1545
|
+
}, [isCollapsedProp]);
|
|
1546
|
+
const setCollapsed = React11.useCallback(
|
|
1547
|
+
(collapsed) => {
|
|
1548
|
+
setCollapsedInternal(collapsed);
|
|
1549
|
+
onCollapsedChange?.(collapsed);
|
|
1550
|
+
},
|
|
1551
|
+
[onCollapsedChange]
|
|
1552
|
+
);
|
|
1553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SidebarContext.Provider, { value: { isCollapsed: isCollapsedInternal, isHovered, setCollapsed }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1554
|
+
"aside",
|
|
1555
|
+
{
|
|
1556
|
+
ref,
|
|
1557
|
+
onMouseEnter: () => setIsHovered(true),
|
|
1558
|
+
onMouseLeave: () => setIsHovered(false),
|
|
1559
|
+
className: cn(
|
|
1560
|
+
"flex flex-col shrink-0 bg-sidebar-bg border-r border-sidebar-border h-full transition-[width] duration-200",
|
|
1561
|
+
isCollapsedInternal ? "w-[72px]" : "w-[298px]",
|
|
1562
|
+
className
|
|
1563
|
+
),
|
|
1564
|
+
...props,
|
|
1565
|
+
children: [
|
|
1566
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SidebarHeader, {}),
|
|
1567
|
+
(() => {
|
|
1568
|
+
const childArray = React11.Children.toArray(children);
|
|
1569
|
+
const footer = childArray.filter(
|
|
1570
|
+
(child) => React11.isValidElement(child) && child.type?.displayName === "SidebarFooter"
|
|
1571
|
+
);
|
|
1572
|
+
const rest = childArray.filter(
|
|
1573
|
+
(child) => !(React11.isValidElement(child) && child.type?.displayName === "SidebarFooter")
|
|
1574
|
+
);
|
|
1575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1576
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex flex-col gap-lg p-lg flex-1 overflow-y-auto", children: rest }),
|
|
1577
|
+
footer
|
|
1578
|
+
] });
|
|
1579
|
+
})()
|
|
1580
|
+
]
|
|
1581
|
+
}
|
|
1582
|
+
) });
|
|
1583
|
+
}
|
|
1584
|
+
);
|
|
1585
|
+
Sidebar.displayName = "Sidebar";
|
|
1586
|
+
var SidebarSection = React11.forwardRef(
|
|
1587
|
+
({ className, children, ...props }, ref) => {
|
|
1588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1589
|
+
"div",
|
|
1590
|
+
{
|
|
1591
|
+
ref,
|
|
1592
|
+
className: cn("flex flex-col w-full", className),
|
|
1593
|
+
...props,
|
|
1594
|
+
children
|
|
1595
|
+
}
|
|
1596
|
+
);
|
|
1881
1597
|
}
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
const check = () => setIsDark(root.getAttribute("data-theme") === "dark");
|
|
1888
|
-
check();
|
|
1889
|
-
const observer = new MutationObserver(check);
|
|
1890
|
-
observer.observe(root, { attributes: true, attributeFilter: ["data-theme"] });
|
|
1891
|
-
return () => observer.disconnect();
|
|
1892
|
-
}, []);
|
|
1893
|
-
return isDark;
|
|
1894
|
-
}
|
|
1895
|
-
function SvgImage({ svg, alt, className }) {
|
|
1896
|
-
const dataUri = React14.useMemo(
|
|
1897
|
-
() => `data:image/svg+xml,${encodeURIComponent(svg)}`,
|
|
1898
|
-
[svg]
|
|
1899
|
-
);
|
|
1900
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: dataUri, alt, className });
|
|
1901
|
-
}
|
|
1902
|
-
var ProductLogo = React14.forwardRef(
|
|
1903
|
-
({ className, product = "lemlist", size = "lg", hasText = true, ...props }, ref) => {
|
|
1904
|
-
const resolvedSize = size ?? "lg";
|
|
1905
|
-
const isDark = useIsDarkTheme();
|
|
1906
|
-
const entry = svgMap[product][resolvedSize][isDark ? "dark" : "light"];
|
|
1907
|
-
const svg = hasText && entry.logotype ? entry.logotype : entry.picto;
|
|
1908
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1598
|
+
);
|
|
1599
|
+
SidebarSection.displayName = "SidebarSection";
|
|
1600
|
+
var SidebarFooter = React11.forwardRef(
|
|
1601
|
+
({ className, children, ...props }, ref) => {
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1909
1603
|
"div",
|
|
1910
1604
|
{
|
|
1911
1605
|
ref,
|
|
1912
|
-
className: cn(
|
|
1606
|
+
className: cn(
|
|
1607
|
+
"flex flex-col p-lg bg-sidebar-footer-bg border-t border-sidebar-border mt-auto w-full",
|
|
1608
|
+
className
|
|
1609
|
+
),
|
|
1913
1610
|
...props,
|
|
1914
|
-
children
|
|
1611
|
+
children
|
|
1915
1612
|
}
|
|
1916
1613
|
);
|
|
1917
1614
|
}
|
|
1918
1615
|
);
|
|
1919
|
-
|
|
1616
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
1920
1617
|
|
|
1921
|
-
// src/components/ui/
|
|
1922
|
-
var
|
|
1923
|
-
var
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1618
|
+
// src/components/ui/search-bar.tsx
|
|
1619
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1620
|
+
var searchBarVariants = (0, import_class_variance_authority8.cva)(
|
|
1621
|
+
[
|
|
1622
|
+
"inline-flex w-full items-center rounded-md border transition-colors",
|
|
1623
|
+
"border-search-bar-border-default",
|
|
1624
|
+
"hover:border-search-bar-border-hover",
|
|
1625
|
+
"focus-within:border-search-bar-border-active",
|
|
1626
|
+
"focus-within:shadow-focus-ring"
|
|
1627
|
+
],
|
|
1628
|
+
{
|
|
1629
|
+
variants: {
|
|
1630
|
+
variant: {
|
|
1631
|
+
white: "bg-search-bar-white-bg",
|
|
1632
|
+
grey: "bg-search-bar-grey-bg"
|
|
1633
|
+
},
|
|
1634
|
+
size: {
|
|
1635
|
+
sm: "gap-sm px-base py-sm",
|
|
1636
|
+
md: "gap-base px-md py-base"
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
defaultVariants: { variant: "white", size: "md" }
|
|
1640
|
+
}
|
|
1641
|
+
);
|
|
1642
|
+
var inputStyle = "flex-1 min-w-0 bg-transparent outline-none text-sm font-regular leading-sm text-search-bar-text placeholder:text-search-bar-placeholder";
|
|
1643
|
+
var clearButtonStyle = "inline-flex shrink-0 items-center justify-center p-xs rounded-base text-search-bar-clear hover:bg-black/5 transition-colors";
|
|
1644
|
+
var SearchBar = React12.forwardRef(
|
|
1645
|
+
({
|
|
1646
|
+
className,
|
|
1647
|
+
variant,
|
|
1648
|
+
size = "md",
|
|
1649
|
+
value,
|
|
1650
|
+
defaultValue,
|
|
1651
|
+
onChange,
|
|
1652
|
+
onClear,
|
|
1653
|
+
hasShortcut = false,
|
|
1654
|
+
placeholder = "Search...",
|
|
1655
|
+
...props
|
|
1656
|
+
}, ref) => {
|
|
1657
|
+
const [internalValue, setInternalValue] = React12.useState(defaultValue ?? "");
|
|
1658
|
+
const isControlled = value !== void 0;
|
|
1659
|
+
const currentValue = isControlled ? value : internalValue;
|
|
1660
|
+
const hasValue = String(currentValue).length > 0;
|
|
1661
|
+
const iconSize = size === "sm" ? "xs" : "sm";
|
|
1662
|
+
const sidebarCtx = useSidebarContext();
|
|
1663
|
+
const isCollapsed = sidebarCtx.isCollapsed;
|
|
1664
|
+
const handleChange = (e) => {
|
|
1665
|
+
if (!isControlled) setInternalValue(e.target.value);
|
|
1666
|
+
onChange?.(e);
|
|
1667
|
+
};
|
|
1668
|
+
const handleClear = () => {
|
|
1669
|
+
if (!isControlled) setInternalValue("");
|
|
1670
|
+
onClear?.();
|
|
1671
|
+
};
|
|
1672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn(searchBarVariants({ variant, size }), isCollapsed && "justify-center", className), children: [
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1674
|
+
import_icons9.Icon,
|
|
1675
|
+
{
|
|
1676
|
+
icon: import_icons9.faMagnifyingGlassSolid,
|
|
1677
|
+
size: iconSize,
|
|
1678
|
+
className: "shrink-0 text-search-bar-icon"
|
|
1679
|
+
}
|
|
1680
|
+
),
|
|
1681
|
+
!isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1682
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1683
|
+
"input",
|
|
1684
|
+
{
|
|
1685
|
+
ref,
|
|
1686
|
+
type: "text",
|
|
1687
|
+
value: currentValue,
|
|
1688
|
+
defaultValue: void 0,
|
|
1689
|
+
onChange: handleChange,
|
|
1690
|
+
placeholder,
|
|
1691
|
+
className: inputStyle,
|
|
1692
|
+
...props
|
|
1693
|
+
}
|
|
1694
|
+
),
|
|
1695
|
+
hasShortcut && !hasValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "shrink-0 text-xs text-search-bar-placeholder", children: "\u2318K" }),
|
|
1696
|
+
hasValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Tooltip, { children: [
|
|
1697
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1698
|
+
"button",
|
|
1699
|
+
{
|
|
1700
|
+
type: "button",
|
|
1701
|
+
onClick: handleClear,
|
|
1702
|
+
className: clearButtonStyle,
|
|
1703
|
+
"aria-label": "Erase",
|
|
1704
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons9.Icon, { icon: import_icons9.faXmarkSolid, size: "xs" })
|
|
1705
|
+
}
|
|
1706
|
+
) }),
|
|
1707
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipContent, { children: "Erase" })
|
|
1708
|
+
] }) })
|
|
1709
|
+
] })
|
|
1710
|
+
] });
|
|
1711
|
+
}
|
|
1712
|
+
);
|
|
1713
|
+
SearchBar.displayName = "SearchBar";
|
|
1714
|
+
|
|
1715
|
+
// src/components/ui/avatar.tsx
|
|
1716
|
+
var React13 = __toESM(require("react"));
|
|
1717
|
+
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
1718
|
+
var import_class_variance_authority9 = require("class-variance-authority");
|
|
1719
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1720
|
+
var avatarVariants = (0, import_class_variance_authority9.cva)(
|
|
1721
|
+
"relative inline-flex shrink-0 items-center justify-center overflow-clip",
|
|
1722
|
+
{
|
|
1723
|
+
variants: {
|
|
1724
|
+
size: {
|
|
1725
|
+
sm: "size-4",
|
|
1726
|
+
md: "size-5",
|
|
1727
|
+
lg: "size-6",
|
|
1728
|
+
xl: "size-8"
|
|
1729
|
+
},
|
|
1730
|
+
shape: {
|
|
1731
|
+
rounded: "rounded-full",
|
|
1732
|
+
squared: ""
|
|
1733
|
+
}
|
|
1734
|
+
},
|
|
1735
|
+
compoundVariants: [
|
|
1736
|
+
{ shape: "squared", size: "sm", class: "rounded-xs" },
|
|
1737
|
+
{ shape: "squared", size: "md", class: "rounded-sm" },
|
|
1738
|
+
{ shape: "squared", size: "lg", class: "rounded-base" },
|
|
1739
|
+
{ shape: "squared", size: "xl", class: "rounded-base" }
|
|
1740
|
+
],
|
|
1741
|
+
defaultVariants: {
|
|
1742
|
+
size: "xl",
|
|
1743
|
+
shape: "rounded"
|
|
1744
|
+
}
|
|
1927
1745
|
}
|
|
1746
|
+
);
|
|
1747
|
+
var initialsFontSize = {
|
|
1748
|
+
sm: "text-[8px] leading-[14px]",
|
|
1749
|
+
md: "text-xs leading-2xs",
|
|
1750
|
+
lg: "text-sm leading-sm",
|
|
1751
|
+
xl: "text-base leading-base"
|
|
1752
|
+
};
|
|
1753
|
+
var Avatar = React13.forwardRef(({ className, size = "xl", shape = "rounded", src, alt, initials, badge, ...props }, ref) => {
|
|
1754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative inline-flex", children: [
|
|
1755
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1756
|
+
AvatarPrimitive.Root,
|
|
1757
|
+
{
|
|
1758
|
+
ref,
|
|
1759
|
+
className: cn(
|
|
1760
|
+
avatarVariants({ size, shape }),
|
|
1761
|
+
"bg-avatar-fallback-bg",
|
|
1762
|
+
className
|
|
1763
|
+
),
|
|
1764
|
+
...props,
|
|
1765
|
+
children: [
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1767
|
+
AvatarPrimitive.Image,
|
|
1768
|
+
{
|
|
1769
|
+
src,
|
|
1770
|
+
alt: alt ?? "",
|
|
1771
|
+
className: "absolute inset-0 size-full object-cover"
|
|
1772
|
+
}
|
|
1773
|
+
),
|
|
1774
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1775
|
+
AvatarPrimitive.Fallback,
|
|
1776
|
+
{
|
|
1777
|
+
delayMs: 0,
|
|
1778
|
+
className: cn(
|
|
1779
|
+
"font-medium",
|
|
1780
|
+
"text-avatar-fallback-text",
|
|
1781
|
+
"select-none text-center",
|
|
1782
|
+
initialsFontSize[size ?? "xl"]
|
|
1783
|
+
),
|
|
1784
|
+
children: initials ?? "??"
|
|
1785
|
+
}
|
|
1786
|
+
)
|
|
1787
|
+
]
|
|
1788
|
+
}
|
|
1789
|
+
),
|
|
1790
|
+
badge && size === "xl" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "absolute bottom-0 right-0 size-4 overflow-clip rounded-full", children: badge })
|
|
1791
|
+
] });
|
|
1928
1792
|
});
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
var
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1793
|
+
Avatar.displayName = "Avatar";
|
|
1794
|
+
|
|
1795
|
+
// src/components/ui/checkbox.tsx
|
|
1796
|
+
var React14 = __toESM(require("react"));
|
|
1797
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
1798
|
+
var import_icons10 = require("@l3mpire/icons");
|
|
1799
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1800
|
+
var rootStyles = {
|
|
1801
|
+
base: "peer shrink-0 size-4 rounded-sm inline-flex items-center justify-center transition-colors cursor-pointer focus-visible:outline-none",
|
|
1802
|
+
unchecked: [
|
|
1803
|
+
"bg-checkbox-unchecked-bg",
|
|
1804
|
+
"border border-checkbox-unchecked-border-default",
|
|
1805
|
+
"hover:border-checkbox-unchecked-border-hover",
|
|
1806
|
+
"active:border-checkbox-unchecked-border-pressed",
|
|
1807
|
+
"active:[box-shadow:0_0_0_3px_#316bff26]"
|
|
1808
|
+
],
|
|
1809
|
+
checked: [
|
|
1810
|
+
"data-[state=checked]:bg-checkbox-checked-bg-default",
|
|
1811
|
+
"data-[state=checked]:border-transparent",
|
|
1812
|
+
"data-[state=checked]:hover:bg-checkbox-checked-bg-hover",
|
|
1813
|
+
"data-[state=checked]:active:bg-checkbox-checked-bg-pressed",
|
|
1814
|
+
"data-[state=checked]:active:[box-shadow:0_0_0_3px_#316bff26]"
|
|
1815
|
+
],
|
|
1816
|
+
disabled: [
|
|
1817
|
+
"disabled:pointer-events-none",
|
|
1818
|
+
"disabled:bg-checkbox-disabled-bg",
|
|
1819
|
+
"disabled:border-checkbox-disabled-border",
|
|
1820
|
+
"data-[state=checked]:disabled:bg-checkbox-disabled-bg",
|
|
1821
|
+
"data-[state=checked]:disabled:border-transparent"
|
|
1822
|
+
]
|
|
1823
|
+
};
|
|
1824
|
+
var iconStyle = {
|
|
1825
|
+
default: "text-checkbox-checked-icon",
|
|
1826
|
+
disabled: "text-checkbox-disabled-icon"
|
|
1827
|
+
};
|
|
1828
|
+
var labelBase2 = "cursor-pointer select-none overflow-hidden text-ellipsis whitespace-nowrap text-sm font-medium leading-sm";
|
|
1829
|
+
var labelColor2 = {
|
|
1830
|
+
default: "text-checkbox-label-default",
|
|
1831
|
+
disabled: "pointer-events-none text-checkbox-label-disabled"
|
|
1832
|
+
};
|
|
1833
|
+
var Checkbox = React14.forwardRef(({ className, label, disabled, id, ...props }, ref) => {
|
|
1834
|
+
const innerId = id ?? React14.useId();
|
|
1835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "inline-flex items-center gap-base", children: [
|
|
1836
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1837
|
+
CheckboxPrimitive.Root,
|
|
1937
1838
|
{
|
|
1938
1839
|
ref,
|
|
1840
|
+
id: innerId,
|
|
1841
|
+
disabled,
|
|
1939
1842
|
className: cn(
|
|
1940
|
-
|
|
1941
|
-
|
|
1843
|
+
rootStyles.base,
|
|
1844
|
+
rootStyles.unchecked,
|
|
1845
|
+
rootStyles.checked,
|
|
1846
|
+
rootStyles.disabled,
|
|
1942
1847
|
className
|
|
1943
1848
|
),
|
|
1944
1849
|
...props,
|
|
1945
|
-
children:
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
"
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
// Expanded: logo + collapse button
|
|
1958
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1959
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ProductLogo, { product: "lemlist", size: "sm", hasText: true }),
|
|
1960
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1961
|
-
"button",
|
|
1850
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1851
|
+
CheckboxPrimitive.Indicator,
|
|
1852
|
+
{
|
|
1853
|
+
forceMount: true,
|
|
1854
|
+
className: cn(
|
|
1855
|
+
"flex items-center justify-center transition-opacity",
|
|
1856
|
+
"data-[state=unchecked]:opacity-0",
|
|
1857
|
+
"data-[state=checked]:opacity-100",
|
|
1858
|
+
"data-[state=indeterminate]:opacity-100"
|
|
1859
|
+
),
|
|
1860
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1861
|
+
import_icons10.Icon,
|
|
1962
1862
|
{
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
"
|
|
1966
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons11.Icon, { icon: import_icons11.faArrowLeftFromLineOutline, size: "xs", className: "text-sidebar-item-default-icon" })
|
|
1863
|
+
icon: import_icons10.faCheckSolid,
|
|
1864
|
+
size: "xs",
|
|
1865
|
+
className: iconStyle[disabled ? "disabled" : "default"]
|
|
1967
1866
|
}
|
|
1968
1867
|
)
|
|
1969
|
-
|
|
1868
|
+
}
|
|
1970
1869
|
)
|
|
1971
1870
|
}
|
|
1972
|
-
)
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
SidebarHeader.displayName = "SidebarHeader";
|
|
1976
|
-
var Sidebar = React15.forwardRef(
|
|
1977
|
-
({ className, isCollapsed: isCollapsedProp = false, onCollapsedChange, children, ...props }, ref) => {
|
|
1978
|
-
const [isCollapsedInternal, setCollapsedInternal] = React15.useState(isCollapsedProp);
|
|
1979
|
-
const [isHovered, setIsHovered] = React15.useState(false);
|
|
1980
|
-
React15.useEffect(() => {
|
|
1981
|
-
setCollapsedInternal(isCollapsedProp);
|
|
1982
|
-
}, [isCollapsedProp]);
|
|
1983
|
-
const setCollapsed = React15.useCallback(
|
|
1984
|
-
(collapsed) => {
|
|
1985
|
-
setCollapsedInternal(collapsed);
|
|
1986
|
-
onCollapsedChange?.(collapsed);
|
|
1987
|
-
},
|
|
1988
|
-
[onCollapsedChange]
|
|
1989
|
-
);
|
|
1990
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SidebarContext.Provider, { value: { isCollapsed: isCollapsedInternal, isHovered, setCollapsed }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1991
|
-
"aside",
|
|
1871
|
+
),
|
|
1872
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1873
|
+
"label",
|
|
1992
1874
|
{
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
className: cn(
|
|
1997
|
-
"flex flex-col shrink-0 bg-sidebar-bg border-r border-sidebar-border h-full transition-[width] duration-200",
|
|
1998
|
-
isCollapsedInternal ? "w-[72px]" : "w-[298px]",
|
|
1999
|
-
className
|
|
2000
|
-
),
|
|
2001
|
-
...props,
|
|
2002
|
-
children: [
|
|
2003
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SidebarHeader, {}),
|
|
2004
|
-
(() => {
|
|
2005
|
-
const childArray = React15.Children.toArray(children);
|
|
2006
|
-
const footer = childArray.filter(
|
|
2007
|
-
(child) => React15.isValidElement(child) && child.type?.displayName === "SidebarFooter"
|
|
2008
|
-
);
|
|
2009
|
-
const rest = childArray.filter(
|
|
2010
|
-
(child) => !(React15.isValidElement(child) && child.type?.displayName === "SidebarFooter")
|
|
2011
|
-
);
|
|
2012
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
2013
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col gap-lg p-lg flex-1 overflow-y-auto", children: rest }),
|
|
2014
|
-
footer
|
|
2015
|
-
] });
|
|
2016
|
-
})()
|
|
2017
|
-
]
|
|
1875
|
+
htmlFor: innerId,
|
|
1876
|
+
className: cn(labelBase2, labelColor2[disabled ? "disabled" : "default"]),
|
|
1877
|
+
children: label
|
|
2018
1878
|
}
|
|
2019
|
-
)
|
|
2020
|
-
}
|
|
1879
|
+
)
|
|
1880
|
+
] });
|
|
1881
|
+
});
|
|
1882
|
+
Checkbox.displayName = "Checkbox";
|
|
1883
|
+
|
|
1884
|
+
// src/components/ui/dropdown-menu.tsx
|
|
1885
|
+
var React15 = __toESM(require("react"));
|
|
1886
|
+
var DropdownMenuPrimitive2 = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1887
|
+
var import_icons11 = require("@l3mpire/icons");
|
|
1888
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1889
|
+
var textSm = "text-sm font-regular leading-sm";
|
|
1890
|
+
var textXs = "text-xs font-regular leading-xs";
|
|
1891
|
+
var textXsMedium = "text-xs font-medium leading-xs";
|
|
1892
|
+
var textSmMedium = "text-sm font-medium leading-sm";
|
|
1893
|
+
var containerStyle = [
|
|
1894
|
+
"flex flex-col gap-base overflow-clip",
|
|
1895
|
+
"bg-dropdown-bg",
|
|
1896
|
+
"border border-dropdown-border",
|
|
1897
|
+
"rounded-md",
|
|
1898
|
+
"p-base",
|
|
1899
|
+
"shadow-lg"
|
|
1900
|
+
];
|
|
1901
|
+
var DropdownMenu = React15.forwardRef(
|
|
1902
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref, className: cn(containerStyle, className), ...props, children })
|
|
2021
1903
|
);
|
|
2022
|
-
|
|
2023
|
-
var
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
1904
|
+
DropdownMenu.displayName = "DropdownMenu";
|
|
1905
|
+
var DropdownMenuRoot = DropdownMenuPrimitive2.Root;
|
|
1906
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive2.Trigger;
|
|
1907
|
+
var DropdownMenuContent = React15.forwardRef(({ className, sideOffset = 4, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1908
|
+
DropdownMenuPrimitive2.Content,
|
|
1909
|
+
{
|
|
1910
|
+
ref,
|
|
1911
|
+
sideOffset,
|
|
1912
|
+
className: cn(
|
|
1913
|
+
containerStyle,
|
|
1914
|
+
"z-50",
|
|
1915
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
1916
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
1917
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1918
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
1919
|
+
className
|
|
1920
|
+
),
|
|
1921
|
+
...props,
|
|
1922
|
+
children
|
|
2034
1923
|
}
|
|
1924
|
+
) }));
|
|
1925
|
+
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
1926
|
+
var DropdownMenuList = React15.forwardRef(
|
|
1927
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref, className: cn("flex flex-col", className), role: "listbox", ...props, children })
|
|
2035
1928
|
);
|
|
2036
|
-
|
|
2037
|
-
var
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
1929
|
+
DropdownMenuList.displayName = "DropdownMenuList";
|
|
1930
|
+
var itemStyle = "flex items-center gap-base p-base rounded-base cursor-pointer hover:bg-dropdown-item-hover";
|
|
1931
|
+
var DropdownMenuItem = React15.forwardRef(
|
|
1932
|
+
({
|
|
1933
|
+
className,
|
|
1934
|
+
icon,
|
|
1935
|
+
avatar,
|
|
1936
|
+
flag,
|
|
1937
|
+
label,
|
|
1938
|
+
description,
|
|
1939
|
+
badge,
|
|
1940
|
+
action,
|
|
1941
|
+
isActive,
|
|
1942
|
+
children,
|
|
1943
|
+
...props
|
|
1944
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1945
|
+
"div",
|
|
1946
|
+
{
|
|
1947
|
+
ref,
|
|
1948
|
+
role: "option",
|
|
1949
|
+
"aria-selected": isActive,
|
|
1950
|
+
className: cn(
|
|
1951
|
+
itemStyle,
|
|
1952
|
+
isActive && "bg-dropdown-item-hover",
|
|
1953
|
+
className
|
|
1954
|
+
),
|
|
1955
|
+
...props,
|
|
1956
|
+
children: [
|
|
1957
|
+
children,
|
|
1958
|
+
avatar,
|
|
1959
|
+
flag,
|
|
1960
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1961
|
+
import_icons11.Icon,
|
|
1962
|
+
{
|
|
1963
|
+
icon,
|
|
1964
|
+
size: "sm",
|
|
1965
|
+
className: "shrink-0 text-dropdown-item-icon"
|
|
1966
|
+
}
|
|
2046
1967
|
),
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-1 items-center gap-sm min-w-0", children: [
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: cn("truncate shrink-0", textSm, "text-dropdown-item-text"), children: label }),
|
|
1970
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: cn("truncate", textXs, "text-dropdown-item-secondary"), children: description })
|
|
1971
|
+
] }),
|
|
1972
|
+
badge,
|
|
1973
|
+
action
|
|
1974
|
+
]
|
|
1975
|
+
}
|
|
1976
|
+
)
|
|
2052
1977
|
);
|
|
2053
|
-
|
|
1978
|
+
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
1979
|
+
var DropdownMenuRadixItem = React15.forwardRef(
|
|
1980
|
+
({
|
|
1981
|
+
className,
|
|
1982
|
+
icon,
|
|
1983
|
+
avatar,
|
|
1984
|
+
flag,
|
|
1985
|
+
label,
|
|
1986
|
+
description,
|
|
1987
|
+
badge,
|
|
1988
|
+
action,
|
|
1989
|
+
children,
|
|
1990
|
+
...props
|
|
1991
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1992
|
+
DropdownMenuPrimitive2.Item,
|
|
1993
|
+
{
|
|
1994
|
+
ref,
|
|
1995
|
+
className: cn(
|
|
1996
|
+
itemStyle,
|
|
1997
|
+
"outline-none focus:bg-dropdown-item-hover",
|
|
1998
|
+
className
|
|
1999
|
+
),
|
|
2000
|
+
...props,
|
|
2001
|
+
children: [
|
|
2002
|
+
children,
|
|
2003
|
+
avatar,
|
|
2004
|
+
flag,
|
|
2005
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2006
|
+
import_icons11.Icon,
|
|
2007
|
+
{
|
|
2008
|
+
icon,
|
|
2009
|
+
size: "sm",
|
|
2010
|
+
className: "shrink-0 text-dropdown-item-icon"
|
|
2011
|
+
}
|
|
2012
|
+
),
|
|
2013
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-1 items-center gap-sm min-w-0", children: [
|
|
2014
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: cn("truncate shrink-0", textSm, "text-dropdown-item-text"), children: label }),
|
|
2015
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: cn("truncate", textXs, "text-dropdown-item-secondary"), children: description })
|
|
2016
|
+
] }),
|
|
2017
|
+
badge,
|
|
2018
|
+
action
|
|
2019
|
+
]
|
|
2020
|
+
}
|
|
2021
|
+
)
|
|
2022
|
+
);
|
|
2023
|
+
DropdownMenuRadixItem.displayName = "DropdownMenuRadixItem";
|
|
2024
|
+
var DropdownMenuHeading = React15.forwardRef(({ className, action, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2025
|
+
"div",
|
|
2026
|
+
{
|
|
2027
|
+
ref,
|
|
2028
|
+
className: cn(
|
|
2029
|
+
"flex items-center gap-base p-base rounded-base",
|
|
2030
|
+
className
|
|
2031
|
+
),
|
|
2032
|
+
...props,
|
|
2033
|
+
children: [
|
|
2034
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: cn("flex-1 truncate uppercase", textXsMedium, "text-dropdown-heading-text"), children }),
|
|
2035
|
+
action
|
|
2036
|
+
]
|
|
2037
|
+
}
|
|
2038
|
+
));
|
|
2039
|
+
DropdownMenuHeading.displayName = "DropdownMenuHeading";
|
|
2040
|
+
var clearStyle = [
|
|
2041
|
+
"sticky bottom-0 -mx-base -mb-base",
|
|
2042
|
+
"flex items-center justify-center",
|
|
2043
|
+
"h-10 min-w-[80px] px-md py-[10px]",
|
|
2044
|
+
"bg-gradient-to-t from-[#fbfbfb] from-[10%] to-white",
|
|
2045
|
+
"border border-dropdown-border",
|
|
2046
|
+
"shadow-sm",
|
|
2047
|
+
"cursor-pointer"
|
|
2048
|
+
];
|
|
2049
|
+
var DropdownMenuClear = React15.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2050
|
+
"button",
|
|
2051
|
+
{
|
|
2052
|
+
ref,
|
|
2053
|
+
type: "button",
|
|
2054
|
+
className: cn(clearStyle, textSmMedium, "text-dropdown-clear-text", className),
|
|
2055
|
+
...props,
|
|
2056
|
+
children
|
|
2057
|
+
}
|
|
2058
|
+
));
|
|
2059
|
+
DropdownMenuClear.displayName = "DropdownMenuClear";
|
|
2054
2060
|
|
|
2055
2061
|
// src/components/ui/sidebar-heading-item.tsx
|
|
2056
2062
|
var React16 = __toESM(require("react"));
|