@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 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)("div", { className: (0, import_cn20.cn)("flex flex-wrap items-center gap-1", className), children: [
2521
- visible.map((p) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2522
- Badge,
2523
- {
2524
- variant: "outline",
2525
- className: "text-[10px] font-mono py-0 font-normal",
2526
- children: p
2527
- },
2528
- p
2529
- )),
2530
- remaining.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Tooltip, { children: [
2531
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2532
- TooltipTrigger,
2533
- {
2534
- render: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2535
- Badge,
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
- variant: "secondary",
2538
- className: "text-[10px] font-mono py-0 cursor-default font-normal",
2539
- children: [
2540
- "+",
2541
- remaining.length
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
- /* @__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)) }) })
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("div", { className: cn20("flex flex-wrap items-center gap-1", className), children: [
2444
- visible.map((p) => /* @__PURE__ */ jsx24(
2445
- Badge,
2446
- {
2447
- variant: "outline",
2448
- className: "text-[10px] font-mono py-0 font-normal",
2449
- children: p
2450
- },
2451
- p
2452
- )),
2453
- remaining.length > 0 && /* @__PURE__ */ jsxs17(Tooltip, { children: [
2454
- /* @__PURE__ */ jsx24(
2455
- TooltipTrigger,
2456
- {
2457
- render: /* @__PURE__ */ jsxs17(
2458
- Badge,
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
- variant: "secondary",
2461
- className: "text-[10px] font-mono py-0 cursor-default font-normal",
2462
- children: [
2463
- "+",
2464
- remaining.length
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
- /* @__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)) }) })
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prediktif/ui",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",