@designa8/vibedesign-openai-internal-v1-2-176b 0.0.1 → 0.0.3
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 +1 -1
- package/dist/index.cjs +194 -56
- package/dist/index.js +194 -56
- package/dist/styles.css +12 -0
- package/package.json +1 -1
- package/src/atoms/Icon/icons.data.ts +25 -0
- package/src/atoms/Sidebar/preview.tsx +90 -7
- package/src/atoms/SidebarDesktop/SidebarDesktop.tsx +125 -29
- package/src/atoms/SidebarMobile/SidebarMobile.tsx +112 -33
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-openai-internal-v1-2-176b
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.0.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.0.3**.
|
|
4
4
|
Tokens, atoms, molecules, organisms, and templates — import from the package root;
|
|
5
5
|
never hardcode visual values in consumer code.
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -221,7 +221,32 @@ var ICON_REGISTRY = {
|
|
|
221
221
|
"moon": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }] },
|
|
222
222
|
"code": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "m16 18 6-6-6-6" }, { tag: "path", d: "m8 6-6 6 6 6" }] },
|
|
223
223
|
"square-pen": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }, { tag: "path", d: "M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z" }] },
|
|
224
|
-
"mic": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M12 19v3" }, { tag: "path", d: "M19 10v2a7 7 0 0 1-14 0v-2" }, { tag: "rect", x: "9", y: "2", width: "6", height: "13", rx: "3" }] }
|
|
224
|
+
"mic": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M12 19v3" }, { tag: "path", d: "M19 10v2a7 7 0 0 1-14 0v-2" }, { tag: "rect", x: "9", y: "2", width: "6", height: "13", rx: "3" }] },
|
|
225
|
+
"credit-card": { viewBox: "0 0 24 24", nodes: [{ tag: "rect", width: "20", height: "14", x: "2", y: "5", rx: "2" }, { tag: "line", x1: "2", x2: "22", y1: "10", y2: "10" }] },
|
|
226
|
+
"wallet": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1" }, { tag: "path", d: "M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4" }] },
|
|
227
|
+
"receipt": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z" }, { tag: "path", d: "M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8" }, { tag: "path", d: "M12 17.5v-11" }] },
|
|
228
|
+
"eye": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }, { tag: "circle", cx: "12", cy: "12", r: "3" }] },
|
|
229
|
+
"refresh-cw": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }, { tag: "path", d: "M21 3v5h-5" }, { tag: "path", d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }, { tag: "path", d: "M8 16H3v5" }] },
|
|
230
|
+
"rotate-ccw": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }, { tag: "path", d: "M3 3v5h5" }] },
|
|
231
|
+
"download": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M12 15V3" }, { tag: "path", d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }, { tag: "path", d: "m7 10 5 5 5-5" }] },
|
|
232
|
+
"funnel": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" }] },
|
|
233
|
+
"clock": { viewBox: "0 0 24 24", nodes: [{ tag: "circle", cx: "12", cy: "12", r: "10" }, { tag: "polyline", points: "12 6 12 12 16 14" }] },
|
|
234
|
+
"terminal": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M12 19h8" }, { tag: "path", d: "m4 17 6-6-6-6" }] },
|
|
235
|
+
"gauge": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "m12 14 4-4" }, { tag: "path", d: "M3.34 19a10 10 0 1 1 17.32 0" }] },
|
|
236
|
+
"trending-up": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M16 7h6v6" }, { tag: "path", d: "m22 7-8.5 8.5-5-5L2 17" }] },
|
|
237
|
+
"trending-down": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M16 17h6v-6" }, { tag: "path", d: "m22 17-8.5-8.5-5 5L2 7" }] },
|
|
238
|
+
"circle-alert": { viewBox: "0 0 24 24", nodes: [{ tag: "circle", cx: "12", cy: "12", r: "10" }, { tag: "line", x1: "12", x2: "12", y1: "8", y2: "12" }, { tag: "line", x1: "12", x2: "12.01", y1: "16", y2: "16" }] },
|
|
239
|
+
"arrow-left": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "m12 19-7-7 7-7" }, { tag: "path", d: "M19 12H5" }] },
|
|
240
|
+
"list": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M3 12h.01" }, { tag: "path", d: "M3 18h.01" }, { tag: "path", d: "M3 6h.01" }, { tag: "path", d: "M8 12h13" }, { tag: "path", d: "M8 18h13" }, { tag: "path", d: "M8 6h13" }] },
|
|
241
|
+
"folder": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }] },
|
|
242
|
+
"webhook": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2" }, { tag: "path", d: "m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06" }, { tag: "path", d: "m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8" }] },
|
|
243
|
+
"circle-dot": { viewBox: "0 0 24 24", nodes: [{ tag: "circle", cx: "12", cy: "12", r: "10" }, { tag: "circle", cx: "12", cy: "12", r: "1" }] },
|
|
244
|
+
"users": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }, { tag: "circle", cx: "9", cy: "7", r: "4" }, { tag: "path", d: "M22 21v-2a4 4 0 0 0-3-3.87" }, { tag: "path", d: "M16 3.13a4 4 0 0 1 0 7.75" }] },
|
|
245
|
+
"user-plus": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }, { tag: "circle", cx: "9", cy: "7", r: "4" }, { tag: "line", x1: "19", x2: "19", y1: "8", y2: "14" }, { tag: "line", x1: "22", x2: "16", y1: "11", y2: "11" }] },
|
|
246
|
+
"eye-off": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }, { tag: "path", d: "M14.084 14.158a3 3 0 0 1-4.242-4.242" }, { tag: "path", d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }, { tag: "path", d: "m2 2 20 20" }] },
|
|
247
|
+
"filter": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" }] },
|
|
248
|
+
"lock": { viewBox: "0 0 24 24", nodes: [{ tag: "rect", width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }, { tag: "path", d: "M7 11V7a5 5 0 0 1 10 0v4" }] },
|
|
249
|
+
"external-link": { viewBox: "0 0 24 24", nodes: [{ tag: "path", d: "M15 3h6v6" }, { tag: "path", d: "M10 14 21 3" }, { tag: "path", d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }] }
|
|
225
250
|
};
|
|
226
251
|
|
|
227
252
|
// virtual-pkg:src/atoms/Icon/Icon.tsx
|
|
@@ -7563,6 +7588,7 @@ var defaultSidebarPromo = {
|
|
|
7563
7588
|
icon: "zap"
|
|
7564
7589
|
};
|
|
7565
7590
|
var focusRing2 = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue";
|
|
7591
|
+
var countLabel = (count) => count > 9 ? "9+" : String(count);
|
|
7566
7592
|
var SidebarDesktop = React72.forwardRef(
|
|
7567
7593
|
({
|
|
7568
7594
|
brandName = "AI Platform",
|
|
@@ -7573,8 +7599,12 @@ var SidebarDesktop = React72.forwardRef(
|
|
|
7573
7599
|
sections = defaultSidebarSections,
|
|
7574
7600
|
promo = defaultSidebarPromo,
|
|
7575
7601
|
userName = "Alex Smith",
|
|
7602
|
+
userAvatarSrc,
|
|
7603
|
+
onUserClick,
|
|
7604
|
+
notificationCount = 0,
|
|
7576
7605
|
onSettingsClick,
|
|
7577
7606
|
onNotificationsClick,
|
|
7607
|
+
onNavigate,
|
|
7578
7608
|
folded: foldedProp,
|
|
7579
7609
|
defaultFolded = false,
|
|
7580
7610
|
onFoldedChange,
|
|
@@ -7591,6 +7621,9 @@ var SidebarDesktop = React72.forwardRef(
|
|
|
7591
7621
|
onFoldedChange?.(v);
|
|
7592
7622
|
};
|
|
7593
7623
|
const currentOrg = organizations.find((o) => o.value === org);
|
|
7624
|
+
const unread = notificationCount > 0;
|
|
7625
|
+
const bellLabel = unread ? `Notifications, ${notificationCount} unread` : "Notifications";
|
|
7626
|
+
const promoItem = promo ? { label: promo.title, icon: promo.icon ?? "zap", href: promo.href } : null;
|
|
7594
7627
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
7595
7628
|
"aside",
|
|
7596
7629
|
{
|
|
@@ -7643,25 +7676,36 @@ var SidebarDesktop = React72.forwardRef(
|
|
|
7643
7676
|
) }),
|
|
7644
7677
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("nav", { id: navId, "aria-label": "Main", className: "min-h-0 flex-1 overflow-y-auto overscroll-contain pb-sm", children: sections.map((section, si) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: cn63("flex flex-col gap-xxs", si > 0 && "mt-base"), children: [
|
|
7645
7678
|
section.label ? folded ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "sr-only", children: section.label }) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "px-base pb-xxs text-caption text-muted", children: section.label }) : null,
|
|
7646
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("ul", { className: cn63("flex flex-col gap-xxs", folded ? "items-center" : "px-sm"), children: section.items.map((item) =>
|
|
7647
|
-
"
|
|
7648
|
-
{
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7679
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("ul", { className: cn63("flex flex-col gap-xxs", folded ? "items-center" : "px-sm"), children: section.items.map((item) => {
|
|
7680
|
+
const hasBadge = item.badge !== void 0 && item.badge !== null && item.badge !== "";
|
|
7681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("li", { className: folded ? void 0 : "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
7682
|
+
"a",
|
|
7683
|
+
{
|
|
7684
|
+
href: item.href,
|
|
7685
|
+
"aria-current": item.active ? "page" : void 0,
|
|
7686
|
+
"aria-label": folded ? item.label : void 0,
|
|
7687
|
+
title: folded ? item.label : void 0,
|
|
7688
|
+
onClick: onNavigate ? (event) => onNavigate(item, event) : void 0,
|
|
7689
|
+
className: cn63(
|
|
7690
|
+
"flex cursor-pointer items-center rounded-sm text-body-md transition-colors duration-150 ease-out",
|
|
7691
|
+
focusRing2,
|
|
7692
|
+
folded ? "relative size-9 justify-center" : "h-9 w-full gap-sm px-sm",
|
|
7693
|
+
item.active ? "bg-surface-strong text-ink" : "text-ink hover:bg-surface-soft active:bg-surface-strong"
|
|
7694
|
+
),
|
|
7695
|
+
children: [
|
|
7696
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Icon, { name: item.icon, size: 18, className: "text-body" }),
|
|
7697
|
+
folded ? null : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: hasBadge ? "min-w-0 flex-1 truncate" : "truncate", children: item.label }),
|
|
7698
|
+
hasBadge ? folded ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
7699
|
+
"span",
|
|
7700
|
+
{
|
|
7701
|
+
"aria-hidden": "true",
|
|
7702
|
+
className: "absolute right-xs top-xs h-2 w-2 rounded-full bg-primary"
|
|
7703
|
+
}
|
|
7704
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Badge, { size: "sm", className: "ml-auto", children: item.badge }) : null
|
|
7705
|
+
]
|
|
7706
|
+
}
|
|
7707
|
+
) }, item.label);
|
|
7708
|
+
}) })
|
|
7665
7709
|
] }, section.label ?? si)) }),
|
|
7666
7710
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: cn63("flex shrink-0 flex-col gap-sm border-t border-hairline-soft py-sm", folded ? "items-center" : "px-sm"), children: [
|
|
7667
7711
|
promo ? /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
@@ -7670,6 +7714,7 @@ var SidebarDesktop = React72.forwardRef(
|
|
|
7670
7714
|
href: promo.href,
|
|
7671
7715
|
"aria-label": folded ? promo.title : void 0,
|
|
7672
7716
|
title: folded ? promo.title : void 0,
|
|
7717
|
+
onClick: onNavigate && promoItem ? (event) => onNavigate(promoItem, event) : void 0,
|
|
7673
7718
|
className: cn63(
|
|
7674
7719
|
"group flex cursor-pointer items-center rounded-md transition-colors duration-150 ease-out hover:bg-surface-soft active:bg-surface-strong",
|
|
7675
7720
|
focusRing2,
|
|
@@ -7695,14 +7740,60 @@ var SidebarDesktop = React72.forwardRef(
|
|
|
7695
7740
|
}
|
|
7696
7741
|
) : null,
|
|
7697
7742
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: cn63("flex items-center", folded ? "flex-col gap-xs" : "justify-between gap-sm pl-xs"), children: [
|
|
7698
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.
|
|
7699
|
-
|
|
7743
|
+
onUserClick ? folded ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
7744
|
+
Button,
|
|
7745
|
+
{
|
|
7746
|
+
variant: "ghost",
|
|
7747
|
+
size: "md",
|
|
7748
|
+
iconOnly: true,
|
|
7749
|
+
"aria-label": `Account: ${userName}`,
|
|
7750
|
+
onClick: onUserClick,
|
|
7751
|
+
className: "h-9 w-9",
|
|
7752
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Avatar, { name: userName, initials: userName.charAt(0), src: userAvatarSrc, size: "md" })
|
|
7753
|
+
}
|
|
7754
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
7755
|
+
Button,
|
|
7756
|
+
{
|
|
7757
|
+
variant: "ghost",
|
|
7758
|
+
size: "md",
|
|
7759
|
+
"aria-label": `Account: ${userName}`,
|
|
7760
|
+
onClick: onUserClick,
|
|
7761
|
+
className: "min-w-0 flex-1 justify-start gap-sm px-xs",
|
|
7762
|
+
children: [
|
|
7763
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Avatar, { name: userName, initials: userName.charAt(0), src: userAvatarSrc, size: "md" }),
|
|
7764
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "min-w-0 truncate text-body-md text-ink", children: userName })
|
|
7765
|
+
]
|
|
7766
|
+
}
|
|
7767
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("span", { className: "flex min-w-0 items-center gap-sm", children: [
|
|
7768
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Avatar, { name: userName, initials: userName.charAt(0), src: userAvatarSrc, size: "md" }),
|
|
7700
7769
|
folded ? null : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "truncate text-body-md text-ink", children: userName })
|
|
7701
7770
|
] }),
|
|
7702
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("span", { className: cn63("flex items-center gap-xxs", folded && "flex-col"), children: [
|
|
7703
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(IconButton, { icon: "settings", "aria-label": "Settings", variant: "ghost", size: "md", onClick: onSettingsClick }),
|
|
7704
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.
|
|
7705
|
-
|
|
7771
|
+
onSettingsClick || onNotificationsClick ? /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("span", { className: cn63("flex items-center gap-xxs", folded && "flex-col"), children: [
|
|
7772
|
+
onSettingsClick ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(IconButton, { icon: "settings", "aria-label": "Settings", variant: "ghost", size: "md", onClick: onSettingsClick }) : null,
|
|
7773
|
+
onNotificationsClick ? /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("span", { className: "relative inline-flex", children: [
|
|
7774
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
7775
|
+
IconButton,
|
|
7776
|
+
{
|
|
7777
|
+
icon: "bell",
|
|
7778
|
+
"aria-label": bellLabel,
|
|
7779
|
+
variant: "ghost",
|
|
7780
|
+
size: "md",
|
|
7781
|
+
onClick: onNotificationsClick
|
|
7782
|
+
}
|
|
7783
|
+
),
|
|
7784
|
+
unread ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
7785
|
+
Badge,
|
|
7786
|
+
{
|
|
7787
|
+
"aria-hidden": "true",
|
|
7788
|
+
variant: "solid",
|
|
7789
|
+
tone: "error",
|
|
7790
|
+
size: "sm",
|
|
7791
|
+
className: "pointer-events-none absolute -right-xxs -top-xxs",
|
|
7792
|
+
children: countLabel(notificationCount)
|
|
7793
|
+
}
|
|
7794
|
+
) : null
|
|
7795
|
+
] }) : null
|
|
7796
|
+
] }) : null
|
|
7706
7797
|
] })
|
|
7707
7798
|
] })
|
|
7708
7799
|
]
|
|
@@ -7717,6 +7808,7 @@ var React73 = __toESM(require("react"));
|
|
|
7717
7808
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
7718
7809
|
var cn64 = (...parts) => parts.filter(Boolean).join(" ");
|
|
7719
7810
|
var focusRing3 = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue";
|
|
7811
|
+
var countLabel2 = (count) => count > 9 ? "9+" : String(count);
|
|
7720
7812
|
var SidebarMobile = React73.forwardRef(
|
|
7721
7813
|
({
|
|
7722
7814
|
brandName = "AI Platform",
|
|
@@ -7727,8 +7819,14 @@ var SidebarMobile = React73.forwardRef(
|
|
|
7727
7819
|
sections = defaultSidebarSections,
|
|
7728
7820
|
promo = defaultSidebarPromo,
|
|
7729
7821
|
userName = "Alex Smith",
|
|
7822
|
+
userAvatarSrc,
|
|
7823
|
+
onUserClick,
|
|
7824
|
+
notificationCount = 0,
|
|
7730
7825
|
onSettingsClick,
|
|
7731
7826
|
onNotificationsClick,
|
|
7827
|
+
onNavigate,
|
|
7828
|
+
actions,
|
|
7829
|
+
drawerFooter,
|
|
7732
7830
|
open: openProp,
|
|
7733
7831
|
onOpenChange,
|
|
7734
7832
|
className,
|
|
@@ -7739,6 +7837,8 @@ var SidebarMobile = React73.forwardRef(
|
|
|
7739
7837
|
const open = openProp ?? inner;
|
|
7740
7838
|
const org = organization ?? orgInner;
|
|
7741
7839
|
const navId = React73.useId();
|
|
7840
|
+
const unread = notificationCount > 0;
|
|
7841
|
+
const bellLabel = unread ? `Notifications, ${notificationCount} unread` : "Notifications";
|
|
7742
7842
|
const setOpen = React73.useCallback(
|
|
7743
7843
|
(v) => {
|
|
7744
7844
|
if (openProp === void 0) setInner(v);
|
|
@@ -7746,8 +7846,49 @@ var SidebarMobile = React73.forwardRef(
|
|
|
7746
7846
|
},
|
|
7747
7847
|
[openProp, onOpenChange]
|
|
7748
7848
|
);
|
|
7849
|
+
const handleNavigate = (item, event) => {
|
|
7850
|
+
onNavigate?.(item, event);
|
|
7851
|
+
setOpen(false);
|
|
7852
|
+
};
|
|
7853
|
+
const promoItem = promo ? { label: promo.title, icon: promo.icon ?? "zap", href: promo.href } : null;
|
|
7854
|
+
const defaultFooter = /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex w-full items-center justify-between gap-sm", children: [
|
|
7855
|
+
onUserClick ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
7856
|
+
Button,
|
|
7857
|
+
{
|
|
7858
|
+
variant: "ghost",
|
|
7859
|
+
size: "md",
|
|
7860
|
+
"aria-label": `Account: ${userName}`,
|
|
7861
|
+
onClick: onUserClick,
|
|
7862
|
+
className: "min-w-0 flex-1 justify-start gap-sm px-xs",
|
|
7863
|
+
children: [
|
|
7864
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Avatar, { name: userName, initials: userName.charAt(0), src: userAvatarSrc, size: "md" }),
|
|
7865
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "min-w-0 truncate text-body-md text-ink", children: userName })
|
|
7866
|
+
]
|
|
7867
|
+
}
|
|
7868
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "flex min-w-0 items-center gap-sm", children: [
|
|
7869
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Avatar, { name: userName, initials: userName.charAt(0), src: userAvatarSrc, size: "md" }),
|
|
7870
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "truncate text-body-md text-ink", children: userName })
|
|
7871
|
+
] }),
|
|
7872
|
+
onSettingsClick || onNotificationsClick ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "flex items-center gap-xxs", children: [
|
|
7873
|
+
onSettingsClick ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(IconButton, { icon: "settings", "aria-label": "Settings", variant: "ghost", size: "md", onClick: onSettingsClick }) : null,
|
|
7874
|
+
onNotificationsClick ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "relative inline-flex", children: [
|
|
7875
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(IconButton, { icon: "bell", "aria-label": bellLabel, variant: "ghost", size: "md", onClick: onNotificationsClick }),
|
|
7876
|
+
unread ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7877
|
+
Badge,
|
|
7878
|
+
{
|
|
7879
|
+
"aria-hidden": "true",
|
|
7880
|
+
variant: "solid",
|
|
7881
|
+
tone: "error",
|
|
7882
|
+
size: "sm",
|
|
7883
|
+
className: "pointer-events-none absolute -right-xxs -top-xxs",
|
|
7884
|
+
children: countLabel2(notificationCount)
|
|
7885
|
+
}
|
|
7886
|
+
) : null
|
|
7887
|
+
] }) : null
|
|
7888
|
+
] }) : null
|
|
7889
|
+
] });
|
|
7749
7890
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("header", { ref, className: cn64("w-full", className), ...props, children: [
|
|
7750
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "relative flex h-14 w-full items-center rounded-lg border border-hairline bg-canvas px-sm text-ink", children: [
|
|
7891
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "relative flex h-14 w-full items-center justify-between rounded-lg border border-hairline bg-canvas px-sm text-ink", children: [
|
|
7751
7892
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7752
7893
|
Button,
|
|
7753
7894
|
{
|
|
@@ -7761,7 +7902,8 @@ var SidebarMobile = React73.forwardRef(
|
|
|
7761
7902
|
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Icon, { name: "menu", size: 20 })
|
|
7762
7903
|
}
|
|
7763
7904
|
),
|
|
7764
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "pointer-events-none absolute inset-x-0 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "pointer-events-auto", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Logo, { name: brandName, href: brandHref, size: "md" }) }) })
|
|
7905
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "pointer-events-none absolute inset-x-0 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "pointer-events-auto", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Logo, { name: brandName, href: brandHref, size: "md" }) }) }),
|
|
7906
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "relative z-10 flex shrink-0 items-center gap-xs", children: actions }) : null
|
|
7765
7907
|
] }),
|
|
7766
7908
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7767
7909
|
Drawer,
|
|
@@ -7772,16 +7914,7 @@ var SidebarMobile = React73.forwardRef(
|
|
|
7772
7914
|
side: "left",
|
|
7773
7915
|
title: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Logo, { name: brandName, size: "md" }),
|
|
7774
7916
|
"aria-label": brandName,
|
|
7775
|
-
footer:
|
|
7776
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "flex min-w-0 items-center gap-sm", children: [
|
|
7777
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Avatar, { name: userName, initials: userName.charAt(0), size: "md" }),
|
|
7778
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "truncate text-body-md text-ink", children: userName })
|
|
7779
|
-
] }),
|
|
7780
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "flex items-center gap-xxs", children: [
|
|
7781
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(IconButton, { icon: "settings", "aria-label": "Settings", variant: "ghost", size: "md", onClick: onSettingsClick }),
|
|
7782
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(IconButton, { icon: "bell", "aria-label": "Notifications", variant: "ghost", size: "md", onClick: onNotificationsClick })
|
|
7783
|
-
] })
|
|
7784
|
-
] }),
|
|
7917
|
+
footer: drawerFooter ?? defaultFooter,
|
|
7785
7918
|
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex flex-col gap-base", children: [
|
|
7786
7919
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7787
7920
|
Dropdown,
|
|
@@ -7797,28 +7930,33 @@ var SidebarMobile = React73.forwardRef(
|
|
|
7797
7930
|
),
|
|
7798
7931
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("nav", { "aria-label": "Main", className: "-mx-sm flex flex-col gap-base", children: sections.map((section, si) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex flex-col gap-xxs", children: [
|
|
7799
7932
|
section.label ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "px-sm pb-xxs text-caption text-muted", children: section.label }) : null,
|
|
7800
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("ul", { className: "flex flex-col gap-xxs", children: section.items.map((item) =>
|
|
7801
|
-
"
|
|
7802
|
-
{
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7933
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("ul", { className: "flex flex-col gap-xxs", children: section.items.map((item) => {
|
|
7934
|
+
const hasBadge = item.badge !== void 0 && item.badge !== null && item.badge !== "";
|
|
7935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
7936
|
+
"a",
|
|
7937
|
+
{
|
|
7938
|
+
href: item.href,
|
|
7939
|
+
"aria-current": item.active ? "page" : void 0,
|
|
7940
|
+
onClick: (event) => handleNavigate(item, event),
|
|
7941
|
+
className: cn64(
|
|
7942
|
+
"flex h-9 w-full cursor-pointer items-center gap-sm rounded-sm px-sm text-body-md transition-colors duration-150 ease-out",
|
|
7943
|
+
focusRing3,
|
|
7944
|
+
item.active ? "bg-surface-strong text-ink" : "text-ink hover:bg-surface-soft active:bg-surface-strong"
|
|
7945
|
+
),
|
|
7946
|
+
children: [
|
|
7947
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Icon, { name: item.icon, size: 18, className: "text-body" }),
|
|
7948
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
7949
|
+
hasBadge ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Badge, { size: "sm", className: "ml-auto", children: item.badge }) : null
|
|
7950
|
+
]
|
|
7951
|
+
}
|
|
7952
|
+
) }, item.label);
|
|
7953
|
+
}) })
|
|
7817
7954
|
] }, section.label ?? si)) }),
|
|
7818
|
-
promo ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
7955
|
+
promo && promoItem ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
7819
7956
|
"a",
|
|
7820
7957
|
{
|
|
7821
7958
|
href: promo.href,
|
|
7959
|
+
onClick: (event) => handleNavigate(promoItem, event),
|
|
7822
7960
|
className: cn64(
|
|
7823
7961
|
"group flex cursor-pointer items-center gap-sm rounded-md border border-hairline px-md py-sm transition-colors duration-150 ease-out hover:bg-surface-soft active:bg-surface-strong",
|
|
7824
7962
|
focusRing3
|