@yenio-pld/blocks 1.2.0-rc.24 → 1.2.0-rc.26
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 +3 -3
- package/dist/index.cjs +54 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +54 -33
- package/dist/index.js.map +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/package.json +2 -1
- package/src/theme.css +99 -88
package/dist/index.d.cts
CHANGED
|
@@ -112,7 +112,7 @@ type AppNavGroup = {
|
|
|
112
112
|
collapsible?: boolean;
|
|
113
113
|
/** Optional badge next to the group label (e.g. pending compliance count). */
|
|
114
114
|
badge?: string | number;
|
|
115
|
-
/**
|
|
115
|
+
/** Initial open state for collapsible groups. Falls back to “any item active”. */
|
|
116
116
|
defaultOpen?: boolean;
|
|
117
117
|
};
|
|
118
118
|
type AppShellProps = {
|
package/dist/index.d.ts
CHANGED
|
@@ -112,7 +112,7 @@ type AppNavGroup = {
|
|
|
112
112
|
collapsible?: boolean;
|
|
113
113
|
/** Optional badge next to the group label (e.g. pending compliance count). */
|
|
114
114
|
badge?: string | number;
|
|
115
|
-
/**
|
|
115
|
+
/** Initial open state for collapsible groups. Falls back to “any item active”. */
|
|
116
116
|
defaultOpen?: boolean;
|
|
117
117
|
};
|
|
118
118
|
type AppShellProps = {
|
package/dist/index.js
CHANGED
|
@@ -344,6 +344,54 @@ function AppNavItems({
|
|
|
344
344
|
) }, `${group.label}:${item.href}`);
|
|
345
345
|
}) });
|
|
346
346
|
}
|
|
347
|
+
function CollapsibleNavGroup({
|
|
348
|
+
group,
|
|
349
|
+
renderLink,
|
|
350
|
+
setOpenMobile
|
|
351
|
+
}) {
|
|
352
|
+
const anyActive = group.items.some((item) => item.active === true);
|
|
353
|
+
const [open, setOpen] = useState(() => group.defaultOpen ?? anyActive);
|
|
354
|
+
const wasActive = useRef(anyActive);
|
|
355
|
+
useEffect(() => {
|
|
356
|
+
if (anyActive && !wasActive.current) setOpen(true);
|
|
357
|
+
wasActive.current = anyActive;
|
|
358
|
+
}, [anyActive]);
|
|
359
|
+
return /* @__PURE__ */ jsx(
|
|
360
|
+
Collapsible,
|
|
361
|
+
{
|
|
362
|
+
open,
|
|
363
|
+
onOpenChange: setOpen,
|
|
364
|
+
className: "group/collapsible",
|
|
365
|
+
children: /* @__PURE__ */ jsxs(SidebarGroup, { children: [
|
|
366
|
+
/* @__PURE__ */ jsxs(
|
|
367
|
+
SidebarGroupLabel,
|
|
368
|
+
{
|
|
369
|
+
render: /* @__PURE__ */ jsx(CollapsibleTrigger, { className: "flex w-full items-center gap-1" }),
|
|
370
|
+
children: [
|
|
371
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-left", children: group.label }),
|
|
372
|
+
group.badge !== void 0 && group.badge !== "" ? /* @__PURE__ */ jsx("span", { className: "rounded-md bg-sidebar-accent px-1.5 text-[0.65rem] font-medium tabular-nums text-sidebar-accent-foreground", children: group.badge }) : null,
|
|
373
|
+
/* @__PURE__ */ jsx(
|
|
374
|
+
ChevronDown,
|
|
375
|
+
{
|
|
376
|
+
"aria-hidden": "true",
|
|
377
|
+
className: "size-3.5 shrink-0 transition-transform group-data-[panel-open]/collapsible:rotate-180"
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
),
|
|
383
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(
|
|
384
|
+
AppNavItems,
|
|
385
|
+
{
|
|
386
|
+
group,
|
|
387
|
+
renderLink,
|
|
388
|
+
setOpenMobile
|
|
389
|
+
}
|
|
390
|
+
) }) })
|
|
391
|
+
] })
|
|
392
|
+
}
|
|
393
|
+
);
|
|
394
|
+
}
|
|
347
395
|
function AppNav({
|
|
348
396
|
nav,
|
|
349
397
|
navLabel,
|
|
@@ -364,39 +412,12 @@ function AppNav({
|
|
|
364
412
|
) })
|
|
365
413
|
] }, group.label);
|
|
366
414
|
}
|
|
367
|
-
const anyActive = group.items.some((item) => item.active === true);
|
|
368
415
|
return /* @__PURE__ */ jsx(
|
|
369
|
-
|
|
416
|
+
CollapsibleNavGroup,
|
|
370
417
|
{
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
/* @__PURE__ */ jsxs(
|
|
375
|
-
SidebarGroupLabel,
|
|
376
|
-
{
|
|
377
|
-
render: /* @__PURE__ */ jsx(CollapsibleTrigger, { className: "flex w-full items-center gap-1" }),
|
|
378
|
-
children: [
|
|
379
|
-
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-left", children: group.label }),
|
|
380
|
-
group.badge !== void 0 && group.badge !== "" ? /* @__PURE__ */ jsx("span", { className: "rounded-md bg-sidebar-accent px-1.5 text-[0.65rem] font-medium tabular-nums text-sidebar-accent-foreground", children: group.badge }) : null,
|
|
381
|
-
/* @__PURE__ */ jsx(
|
|
382
|
-
ChevronDown,
|
|
383
|
-
{
|
|
384
|
-
"aria-hidden": "true",
|
|
385
|
-
className: "size-3.5 shrink-0 transition-transform group-data-[panel-open]/collapsible:rotate-180"
|
|
386
|
-
}
|
|
387
|
-
)
|
|
388
|
-
]
|
|
389
|
-
}
|
|
390
|
-
),
|
|
391
|
-
/* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(
|
|
392
|
-
AppNavItems,
|
|
393
|
-
{
|
|
394
|
-
group,
|
|
395
|
-
renderLink,
|
|
396
|
-
setOpenMobile
|
|
397
|
-
}
|
|
398
|
-
) }) })
|
|
399
|
-
] })
|
|
418
|
+
group,
|
|
419
|
+
renderLink,
|
|
420
|
+
setOpenMobile
|
|
400
421
|
},
|
|
401
422
|
group.label
|
|
402
423
|
);
|
|
@@ -7305,7 +7326,7 @@ function SectionCard({
|
|
|
7305
7326
|
),
|
|
7306
7327
|
badge
|
|
7307
7328
|
] }),
|
|
7308
|
-
description ? /* @__PURE__ */ jsx(CardDescription, { children: description }) : null
|
|
7329
|
+
description ? /* @__PURE__ */ jsx(CardDescription, { className: "text-pretty", children: description }) : null
|
|
7309
7330
|
] }),
|
|
7310
7331
|
headerAction ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: headerAction }) : null
|
|
7311
7332
|
] }),
|
|
@@ -7450,7 +7471,7 @@ function SettingRow({
|
|
|
7450
7471
|
children: label
|
|
7451
7472
|
}
|
|
7452
7473
|
),
|
|
7453
|
-
description ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null
|
|
7474
|
+
description ? /* @__PURE__ */ jsx("p", { className: "text-pretty text-sm text-muted-foreground", children: description }) : null
|
|
7454
7475
|
] }),
|
|
7455
7476
|
/* @__PURE__ */ jsx("div", { className: "shrink-0 sm:text-right", children: control })
|
|
7456
7477
|
]
|