@prediktif/ui 0.1.28 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +40 -29
- package/dist/index.mjs +40 -29
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -194,6 +194,7 @@ interface PermissionBadgesProps {
|
|
|
194
194
|
permissions?: string[] | null;
|
|
195
195
|
maxDisplay?: number;
|
|
196
196
|
className?: string;
|
|
197
|
+
wrap?: boolean;
|
|
197
198
|
}
|
|
198
199
|
declare const PermissionBadges: react.NamedExoticComponent<PermissionBadgesProps>;
|
|
199
200
|
declare const PermissionsBadges: react.NamedExoticComponent<PermissionBadgesProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -194,6 +194,7 @@ interface PermissionBadgesProps {
|
|
|
194
194
|
permissions?: string[] | null;
|
|
195
195
|
maxDisplay?: number;
|
|
196
196
|
className?: string;
|
|
197
|
+
wrap?: boolean;
|
|
197
198
|
}
|
|
198
199
|
declare const PermissionBadges: react.NamedExoticComponent<PermissionBadgesProps>;
|
|
199
200
|
declare const PermissionsBadges: react.NamedExoticComponent<PermissionBadgesProps>;
|
package/dist/index.js
CHANGED
|
@@ -2511,42 +2511,53 @@ var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
|
2511
2511
|
var PermissionBadges = (0, import_react12.memo)(function PermissionBadges2({
|
|
2512
2512
|
permissions,
|
|
2513
2513
|
maxDisplay = 3,
|
|
2514
|
-
className
|
|
2514
|
+
className,
|
|
2515
|
+
wrap = false
|
|
2515
2516
|
}) {
|
|
2516
2517
|
const perms = permissions != null ? permissions : [];
|
|
2517
2518
|
if (perms.length === 0) return null;
|
|
2518
2519
|
const visible = perms.slice(0, maxDisplay);
|
|
2519
2520
|
const remaining = perms.slice(maxDisplay);
|
|
2520
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2522
|
+
"div",
|
|
2523
|
+
{
|
|
2524
|
+
className: (0, import_cn20.cn)(
|
|
2525
|
+
"flex items-center gap-1",
|
|
2526
|
+
wrap ? "flex-wrap" : "flex-nowrap",
|
|
2527
|
+
className
|
|
2528
|
+
),
|
|
2529
|
+
children: [
|
|
2530
|
+
visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2531
|
+
Badge,
|
|
2532
|
+
{
|
|
2533
|
+
variant: "outline",
|
|
2534
|
+
className: "text-[10px] font-mono py-0 font-normal shrink-0",
|
|
2535
|
+
children: p
|
|
2536
|
+
},
|
|
2537
|
+
p
|
|
2538
|
+
)),
|
|
2539
|
+
remaining.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Tooltip, { children: [
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2541
|
+
TooltipTrigger,
|
|
2536
2542
|
{
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2544
|
+
Badge,
|
|
2545
|
+
{
|
|
2546
|
+
variant: "secondary",
|
|
2547
|
+
className: "text-[10px] font-mono py-0 cursor-default font-normal shrink-0",
|
|
2548
|
+
children: [
|
|
2549
|
+
"+",
|
|
2550
|
+
remaining.length
|
|
2551
|
+
]
|
|
2552
|
+
}
|
|
2553
|
+
)
|
|
2543
2554
|
}
|
|
2544
|
-
)
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2555
|
+
),
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TooltipContent, { className: "max-w-xs", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col gap-0.5 text-xs font-mono", children: remaining.map((p) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: p }, p)) }) })
|
|
2557
|
+
] })
|
|
2558
|
+
]
|
|
2559
|
+
}
|
|
2560
|
+
);
|
|
2550
2561
|
});
|
|
2551
2562
|
var PermissionsBadges = PermissionBadges;
|
|
2552
2563
|
|
package/dist/index.mjs
CHANGED
|
@@ -2434,42 +2434,53 @@ import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
|
2434
2434
|
var PermissionBadges = memo12(function PermissionBadges2({
|
|
2435
2435
|
permissions,
|
|
2436
2436
|
maxDisplay = 3,
|
|
2437
|
-
className
|
|
2437
|
+
className,
|
|
2438
|
+
wrap = false
|
|
2438
2439
|
}) {
|
|
2439
2440
|
const perms = permissions != null ? permissions : [];
|
|
2440
2441
|
if (perms.length === 0) return null;
|
|
2441
2442
|
const visible = perms.slice(0, maxDisplay);
|
|
2442
2443
|
const remaining = perms.slice(maxDisplay);
|
|
2443
|
-
return /* @__PURE__ */ jsxs17(
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2444
|
+
return /* @__PURE__ */ jsxs17(
|
|
2445
|
+
"div",
|
|
2446
|
+
{
|
|
2447
|
+
className: cn20(
|
|
2448
|
+
"flex items-center gap-1",
|
|
2449
|
+
wrap ? "flex-wrap" : "flex-nowrap",
|
|
2450
|
+
className
|
|
2451
|
+
),
|
|
2452
|
+
children: [
|
|
2453
|
+
visible.map((p) => /* @__PURE__ */ jsx24(
|
|
2454
|
+
Badge,
|
|
2455
|
+
{
|
|
2456
|
+
variant: "outline",
|
|
2457
|
+
className: "text-[10px] font-mono py-0 font-normal shrink-0",
|
|
2458
|
+
children: p
|
|
2459
|
+
},
|
|
2460
|
+
p
|
|
2461
|
+
)),
|
|
2462
|
+
remaining.length > 0 && /* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
2463
|
+
/* @__PURE__ */ jsx24(
|
|
2464
|
+
TooltipTrigger,
|
|
2459
2465
|
{
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
+
render: /* @__PURE__ */ jsxs17(
|
|
2467
|
+
Badge,
|
|
2468
|
+
{
|
|
2469
|
+
variant: "secondary",
|
|
2470
|
+
className: "text-[10px] font-mono py-0 cursor-default font-normal shrink-0",
|
|
2471
|
+
children: [
|
|
2472
|
+
"+",
|
|
2473
|
+
remaining.length
|
|
2474
|
+
]
|
|
2475
|
+
}
|
|
2476
|
+
)
|
|
2466
2477
|
}
|
|
2467
|
-
)
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2478
|
+
),
|
|
2479
|
+
/* @__PURE__ */ jsx24(TooltipContent, { className: "max-w-xs", children: /* @__PURE__ */ jsx24("div", { className: "flex flex-col gap-0.5 text-xs font-mono", children: remaining.map((p) => /* @__PURE__ */ jsx24("span", { children: p }, p)) }) })
|
|
2480
|
+
] })
|
|
2481
|
+
]
|
|
2482
|
+
}
|
|
2483
|
+
);
|
|
2473
2484
|
});
|
|
2474
2485
|
var PermissionsBadges = PermissionBadges;
|
|
2475
2486
|
|