@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @yenio-pld/blocks
2
2
 
3
- Shared UI for Yenio applications: shadcn primitives, the provisional theme, product chrome, and PLD components.
3
+ Shared UI for Alhajero applications: shadcn primitives, the Onyx & Gold theme, product chrome, and PLD components.
4
4
 
5
5
  The main entry is a Client Component boundary (`"use client"`). Import avatar helpers from `@yenio-pld/blocks/avatar` and cookie helpers from `@yenio-pld/blocks/consent` in React Server Components. Import `THEME_INIT_SCRIPT` from `@yenio-pld/blocks/theme-init` in root layouts. That entry has no client boundary.
6
6
 
@@ -27,7 +27,7 @@ Scan the built package so utilities are not purged:
27
27
  @source "../../node_modules/@yenio-pld/blocks/dist/**/*.{js,cjs,mjs}";
28
28
  ```
29
29
 
30
- Import the shared light and dark palette. Do not paste `:root` / `.dark` color tokens into the app. `src/theme.css` is the only color-token source. The palette is provisional (precise, calm, trustworthy) until brand sign-off.
30
+ Import the shared light and dark palette. Do not paste `:root` / `.dark` color tokens into the app. `src/theme.css` is the only color-token source. The palette is Alhajero Onyx & Gold (cream + onyx primary in light; gold primary in dark).
31
31
 
32
32
  ```css
33
33
  @import "tailwindcss";
@@ -90,7 +90,7 @@ pnpm storybook
90
90
  pnpm build-storybook
91
91
  ```
92
92
 
93
- Storybook serves on port 6006. The static build writes `storybook-static/`. Preview CSS imports `src/theme.css` and loads Inter.
93
+ Storybook serves on port 6006. The static build writes `storybook-static/`. Preview CSS imports `src/theme.css` and loads Inter plus Outfit.
94
94
 
95
95
  ## Quality gate
96
96
 
package/dist/index.cjs CHANGED
@@ -365,6 +365,54 @@ function AppNavItems({
365
365
  ) }, `${group.label}:${item.href}`);
366
366
  }) });
367
367
  }
368
+ function CollapsibleNavGroup({
369
+ group,
370
+ renderLink,
371
+ setOpenMobile
372
+ }) {
373
+ const anyActive = group.items.some((item) => item.active === true);
374
+ const [open, setOpen] = React6.useState(() => group.defaultOpen ?? anyActive);
375
+ const wasActive = React6.useRef(anyActive);
376
+ React6.useEffect(() => {
377
+ if (anyActive && !wasActive.current) setOpen(true);
378
+ wasActive.current = anyActive;
379
+ }, [anyActive]);
380
+ return /* @__PURE__ */ jsxRuntime.jsx(
381
+ collapsible_js.Collapsible,
382
+ {
383
+ open,
384
+ onOpenChange: setOpen,
385
+ className: "group/collapsible",
386
+ children: /* @__PURE__ */ jsxRuntime.jsxs(sidebar_js.SidebarGroup, { children: [
387
+ /* @__PURE__ */ jsxRuntime.jsxs(
388
+ sidebar_js.SidebarGroupLabel,
389
+ {
390
+ render: /* @__PURE__ */ jsxRuntime.jsx(collapsible_js.CollapsibleTrigger, { className: "flex w-full items-center gap-1" }),
391
+ children: [
392
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-left", children: group.label }),
393
+ group.badge !== void 0 && group.badge !== "" ? /* @__PURE__ */ jsxRuntime.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,
394
+ /* @__PURE__ */ jsxRuntime.jsx(
395
+ lucideReact.ChevronDown,
396
+ {
397
+ "aria-hidden": "true",
398
+ className: "size-3.5 shrink-0 transition-transform group-data-[panel-open]/collapsible:rotate-180"
399
+ }
400
+ )
401
+ ]
402
+ }
403
+ ),
404
+ /* @__PURE__ */ jsxRuntime.jsx(collapsible_js.CollapsibleContent, { children: /* @__PURE__ */ jsxRuntime.jsx(sidebar_js.SidebarGroupContent, { children: /* @__PURE__ */ jsxRuntime.jsx(
405
+ AppNavItems,
406
+ {
407
+ group,
408
+ renderLink,
409
+ setOpenMobile
410
+ }
411
+ ) }) })
412
+ ] })
413
+ }
414
+ );
415
+ }
368
416
  function AppNav({
369
417
  nav,
370
418
  navLabel,
@@ -385,39 +433,12 @@ function AppNav({
385
433
  ) })
386
434
  ] }, group.label);
387
435
  }
388
- const anyActive = group.items.some((item) => item.active === true);
389
436
  return /* @__PURE__ */ jsxRuntime.jsx(
390
- collapsible_js.Collapsible,
437
+ CollapsibleNavGroup,
391
438
  {
392
- defaultOpen: group.defaultOpen ?? anyActive,
393
- className: "group/collapsible",
394
- children: /* @__PURE__ */ jsxRuntime.jsxs(sidebar_js.SidebarGroup, { children: [
395
- /* @__PURE__ */ jsxRuntime.jsxs(
396
- sidebar_js.SidebarGroupLabel,
397
- {
398
- render: /* @__PURE__ */ jsxRuntime.jsx(collapsible_js.CollapsibleTrigger, { className: "flex w-full items-center gap-1" }),
399
- children: [
400
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-left", children: group.label }),
401
- group.badge !== void 0 && group.badge !== "" ? /* @__PURE__ */ jsxRuntime.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,
402
- /* @__PURE__ */ jsxRuntime.jsx(
403
- lucideReact.ChevronDown,
404
- {
405
- "aria-hidden": "true",
406
- className: "size-3.5 shrink-0 transition-transform group-data-[panel-open]/collapsible:rotate-180"
407
- }
408
- )
409
- ]
410
- }
411
- ),
412
- /* @__PURE__ */ jsxRuntime.jsx(collapsible_js.CollapsibleContent, { children: /* @__PURE__ */ jsxRuntime.jsx(sidebar_js.SidebarGroupContent, { children: /* @__PURE__ */ jsxRuntime.jsx(
413
- AppNavItems,
414
- {
415
- group,
416
- renderLink,
417
- setOpenMobile
418
- }
419
- ) }) })
420
- ] })
439
+ group,
440
+ renderLink,
441
+ setOpenMobile
421
442
  },
422
443
  group.label
423
444
  );
@@ -7326,7 +7347,7 @@ function SectionCard({
7326
7347
  ),
7327
7348
  badge
7328
7349
  ] }),
7329
- description ? /* @__PURE__ */ jsxRuntime.jsx(card_js.CardDescription, { children: description }) : null
7350
+ description ? /* @__PURE__ */ jsxRuntime.jsx(card_js.CardDescription, { className: "text-pretty", children: description }) : null
7330
7351
  ] }),
7331
7352
  headerAction ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: headerAction }) : null
7332
7353
  ] }),
@@ -7471,7 +7492,7 @@ function SettingRow({
7471
7492
  children: label
7472
7493
  }
7473
7494
  ),
7474
- description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null
7495
+ description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-pretty text-sm text-muted-foreground", children: description }) : null
7475
7496
  ] }),
7476
7497
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 sm:text-right", children: control })
7477
7498
  ]