@octaviaflow/core 3.0.13 → 3.0.14

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 CHANGED
@@ -11575,14 +11575,22 @@ function ExpandedLayout({
11575
11575
  pinned,
11576
11576
  onPinToggle
11577
11577
  }) {
11578
+ const hasFooterControl = Boolean(onPinToggle || onToggle);
11578
11579
  return /* @__PURE__ */ jsxs68(Fragment16, { children: [
11579
- /* @__PURE__ */ jsxs68("div", { className: "ods-sidebar__header", children: [
11580
+ (logo || brand) && /* @__PURE__ */ jsxs68("div", { className: "ods-sidebar__header", children: [
11580
11581
  logo && /* @__PURE__ */ jsx69("div", { className: "ods-sidebar__logo", children: logo }),
11581
11582
  brand && /* @__PURE__ */ jsxs68("div", { className: "ods-sidebar__brand", children: [
11582
11583
  /* @__PURE__ */ jsx69("span", { className: "ods-sidebar__brand-name", children: brand.name }),
11583
11584
  brand.subtitle && /* @__PURE__ */ jsx69("span", { className: "ods-sidebar__brand-sub", children: brand.subtitle })
11584
- ] }),
11585
- onPinToggle && /* @__PURE__ */ jsx69(
11585
+ ] })
11586
+ ] }),
11587
+ /* @__PURE__ */ jsx69("div", { className: "ods-sidebar__body", children: sections.map((section, sIdx) => /* @__PURE__ */ jsxs68("div", { className: "ods-sidebar__section", children: [
11588
+ section.label && /* @__PURE__ */ jsx69("div", { className: "ods-sidebar__section-label", children: section.label }),
11589
+ section.items.map((item) => /* @__PURE__ */ jsx69(ExpandedItem, { item, level: 0 }, item.id))
11590
+ ] }, section.id ?? sIdx)) }),
11591
+ (footerItems || user || hasFooterControl) && /* @__PURE__ */ jsxs68("div", { className: "ods-sidebar__footer", children: [
11592
+ footerItems && footerItems.length > 0 && /* @__PURE__ */ jsx69("div", { className: "ods-sidebar__footer-list", children: footerItems.map((item) => /* @__PURE__ */ jsx69(ExpandedItem, { item, level: 0 }, item.id)) }),
11593
+ hasFooterControl && /* @__PURE__ */ jsx69("div", { className: "ods-sidebar__footer-control", children: onPinToggle ? /* @__PURE__ */ jsxs68(
11586
11594
  "button",
11587
11595
  {
11588
11596
  type: "button",
@@ -11590,48 +11598,57 @@ function ExpandedLayout({
11590
11598
  onClick: onPinToggle,
11591
11599
  "aria-label": pinned ? "Unpin sidebar" : "Pin sidebar",
11592
11600
  "aria-pressed": pinned,
11593
- children: /* @__PURE__ */ jsx69("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx69(
11594
- "path",
11595
- {
11596
- d: "M5.5 1h3v3l2 3h-3v3l-1.5 2L4.5 10V7h-3l2-3V1z",
11597
- stroke: "currentColor",
11598
- strokeWidth: "1.3",
11599
- strokeLinejoin: "round",
11600
- fill: pinned ? "currentColor" : "none"
11601
- }
11602
- ) })
11601
+ children: [
11602
+ /* @__PURE__ */ jsx69(PinIcon, { pinned: !!pinned }),
11603
+ /* @__PURE__ */ jsx69("span", { className: "ods-sidebar__pin-label", children: pinned ? "Unpin" : "Pin sidebar" })
11604
+ ]
11603
11605
  }
11604
- ),
11605
- onToggle && !onPinToggle && /* @__PURE__ */ jsx69(
11606
+ ) : /* @__PURE__ */ jsxs68(
11606
11607
  "button",
11607
11608
  {
11608
11609
  type: "button",
11609
11610
  className: "ods-sidebar__collapse",
11610
11611
  onClick: onToggle,
11611
11612
  "aria-label": "Collapse sidebar",
11612
- children: /* @__PURE__ */ jsx69("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx69(
11613
- "path",
11614
- {
11615
- d: "M3 3v10M11 5l-3 3 3 3",
11616
- stroke: "currentColor",
11617
- strokeWidth: "1.5",
11618
- strokeLinecap: "round",
11619
- strokeLinejoin: "round"
11620
- }
11621
- ) })
11613
+ children: [
11614
+ /* @__PURE__ */ jsx69("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx69(
11615
+ "path",
11616
+ {
11617
+ d: "M3 3v10M11 5l-3 3 3 3",
11618
+ stroke: "currentColor",
11619
+ strokeWidth: "1.5",
11620
+ strokeLinecap: "round",
11621
+ strokeLinejoin: "round"
11622
+ }
11623
+ ) }),
11624
+ /* @__PURE__ */ jsx69("span", { className: "ods-sidebar__pin-label", children: "Collapse" })
11625
+ ]
11622
11626
  }
11623
- )
11624
- ] }),
11625
- /* @__PURE__ */ jsx69("div", { className: "ods-sidebar__body", children: sections.map((section, sIdx) => /* @__PURE__ */ jsxs68("div", { className: "ods-sidebar__section", children: [
11626
- section.label && /* @__PURE__ */ jsx69("div", { className: "ods-sidebar__section-label", children: section.label }),
11627
- section.items.map((item) => /* @__PURE__ */ jsx69(ExpandedItem, { item, level: 0 }, item.id))
11628
- ] }, section.id ?? sIdx)) }),
11629
- (footerItems || user) && /* @__PURE__ */ jsxs68("div", { className: "ods-sidebar__footer", children: [
11630
- footerItems && footerItems.length > 0 && /* @__PURE__ */ jsx69("div", { className: "ods-sidebar__footer-list", children: footerItems.map((item) => /* @__PURE__ */ jsx69(ExpandedItem, { item, level: 0 }, item.id)) }),
11627
+ ) }),
11631
11628
  user && /* @__PURE__ */ jsx69(SidebarUserCard, { user })
11632
11629
  ] })
11633
11630
  ] });
11634
11631
  }
11632
+ function PinIcon({ pinned }) {
11633
+ return /* @__PURE__ */ jsxs68(
11634
+ "svg",
11635
+ {
11636
+ width: "14",
11637
+ height: "14",
11638
+ viewBox: "0 0 16 16",
11639
+ fill: pinned ? "currentColor" : "none",
11640
+ stroke: "currentColor",
11641
+ strokeWidth: "1.5",
11642
+ strokeLinejoin: "round",
11643
+ strokeLinecap: "round",
11644
+ "aria-hidden": "true",
11645
+ children: [
11646
+ /* @__PURE__ */ jsx69("path", { d: "M10.5 1.5 14.5 5.5 11.5 8.5 11 11 5 5 7.5 4.5z" }),
11647
+ /* @__PURE__ */ jsx69("path", { d: "M5 5 1.5 14.5" })
11648
+ ]
11649
+ }
11650
+ );
11651
+ }
11635
11652
  function ExpandedItem({ item, level }) {
11636
11653
  const hasChildren = !!(item.children && item.children.length > 0);
11637
11654
  const [open, setOpen] = useState21(