@devalok/shilp-sutra 0.18.1 → 0.19.0

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.
Files changed (101) hide show
  1. package/dist/shell/bottom-navbar.js +4 -4
  2. package/dist/shell/sidebar.js +2 -2
  3. package/dist/shell/top-bar.d.ts +45 -20
  4. package/dist/shell/top-bar.d.ts.map +1 -1
  5. package/dist/shell/top-bar.js +222 -159
  6. package/dist/tokens/semantic.css +5 -5
  7. package/dist/ui/sidebar.js +11 -11
  8. package/docs/components/_header.md +85 -0
  9. package/docs/components/composed/activity-feed.md +43 -0
  10. package/docs/components/composed/avatar-group.md +32 -0
  11. package/docs/components/composed/command-palette.md +40 -0
  12. package/docs/components/composed/confirm-dialog.md +46 -0
  13. package/docs/components/composed/content-card.md +36 -0
  14. package/docs/components/composed/date-picker.md +130 -0
  15. package/docs/components/composed/empty-state.md +53 -0
  16. package/docs/components/composed/error-boundary.md +29 -0
  17. package/docs/components/composed/global-loading.md +27 -0
  18. package/docs/components/composed/loading-skeleton.md +51 -0
  19. package/docs/components/composed/member-picker.md +35 -0
  20. package/docs/components/composed/page-header.md +41 -0
  21. package/docs/components/composed/page-skeletons.md +32 -0
  22. package/docs/components/composed/priority-indicator.md +32 -0
  23. package/docs/components/composed/rich-text-editor.md +71 -0
  24. package/docs/components/composed/schedule-view.md +39 -0
  25. package/docs/components/composed/simple-tooltip.md +33 -0
  26. package/docs/components/composed/status-badge.md +42 -0
  27. package/docs/components/shell/app-command-palette.md +44 -0
  28. package/docs/components/shell/bottom-navbar.md +52 -0
  29. package/docs/components/shell/command-registry.md +48 -0
  30. package/docs/components/shell/link-context.md +41 -0
  31. package/docs/components/shell/notification-center.md +63 -0
  32. package/docs/components/shell/notification-preferences.md +42 -0
  33. package/docs/components/shell/sidebar.md +92 -0
  34. package/docs/components/shell/top-bar.md +140 -0
  35. package/docs/components/ui/accordion.md +48 -0
  36. package/docs/components/ui/alert-dialog.md +58 -0
  37. package/docs/components/ui/alert.md +43 -0
  38. package/docs/components/ui/aspect-ratio.md +25 -0
  39. package/docs/components/ui/autocomplete.md +48 -0
  40. package/docs/components/ui/avatar.md +34 -0
  41. package/docs/components/ui/badge.md +48 -0
  42. package/docs/components/ui/banner.md +36 -0
  43. package/docs/components/ui/breadcrumb.md +37 -0
  44. package/docs/components/ui/button-group.md +32 -0
  45. package/docs/components/ui/button.md +55 -0
  46. package/docs/components/ui/card.md +48 -0
  47. package/docs/components/ui/charts.md +43 -0
  48. package/docs/components/ui/checkbox.md +31 -0
  49. package/docs/components/ui/chip.md +44 -0
  50. package/docs/components/ui/code.md +28 -0
  51. package/docs/components/ui/collapsible.md +40 -0
  52. package/docs/components/ui/color-input.md +37 -0
  53. package/docs/components/ui/combobox.md +54 -0
  54. package/docs/components/ui/container.md +26 -0
  55. package/docs/components/ui/context-menu.md +43 -0
  56. package/docs/components/ui/data-table-toolbar.md +44 -0
  57. package/docs/components/ui/data-table.md +91 -0
  58. package/docs/components/ui/dialog.md +51 -0
  59. package/docs/components/ui/dropdown-menu.md +45 -0
  60. package/docs/components/ui/file-upload.md +41 -0
  61. package/docs/components/ui/form.md +51 -0
  62. package/docs/components/ui/hover-card.md +32 -0
  63. package/docs/components/ui/icon-button.md +33 -0
  64. package/docs/components/ui/input-otp.md +44 -0
  65. package/docs/components/ui/input.md +48 -0
  66. package/docs/components/ui/label.md +25 -0
  67. package/docs/components/ui/link.md +29 -0
  68. package/docs/components/ui/menubar.md +44 -0
  69. package/docs/components/ui/navigation-menu.md +46 -0
  70. package/docs/components/ui/number-input.md +44 -0
  71. package/docs/components/ui/pagination.md +48 -0
  72. package/docs/components/ui/popover.md +30 -0
  73. package/docs/components/ui/progress.md +29 -0
  74. package/docs/components/ui/radio.md +34 -0
  75. package/docs/components/ui/search-input.md +43 -0
  76. package/docs/components/ui/segmented-control.md +50 -0
  77. package/docs/components/ui/select.md +49 -0
  78. package/docs/components/ui/separator.md +29 -0
  79. package/docs/components/ui/sheet.md +47 -0
  80. package/docs/components/ui/sidebar.md +72 -0
  81. package/docs/components/ui/skeleton.md +77 -0
  82. package/docs/components/ui/slider.md +29 -0
  83. package/docs/components/ui/spinner.md +51 -0
  84. package/docs/components/ui/stack.md +39 -0
  85. package/docs/components/ui/stat-card.md +61 -0
  86. package/docs/components/ui/stepper.md +49 -0
  87. package/docs/components/ui/switch.md +34 -0
  88. package/docs/components/ui/table.md +47 -0
  89. package/docs/components/ui/tabs.md +56 -0
  90. package/docs/components/ui/text.md +37 -0
  91. package/docs/components/ui/textarea.md +39 -0
  92. package/docs/components/ui/toast.md +65 -0
  93. package/docs/components/ui/toaster.md +47 -0
  94. package/docs/components/ui/toggle-group.md +43 -0
  95. package/docs/components/ui/toggle.md +37 -0
  96. package/docs/components/ui/tooltip.md +33 -0
  97. package/docs/components/ui/tree-view.md +65 -0
  98. package/docs/components/ui/visually-hidden.md +21 -0
  99. package/llms-full.txt +164 -73
  100. package/llms.txt +1 -1
  101. package/package.json +699 -697
@@ -82,7 +82,7 @@ const B = w.forwardRef(
82
82
  /* @__PURE__ */ t(
83
83
  "div",
84
84
  {
85
- className: "absolute bottom-[72px] left-0 right-0 rounded-t-ds-2xl border-t border-surface-border-strong bg-surface-1 p-ds-05 pb-ds-03",
85
+ className: "absolute bottom-[72px] left-0 right-0 rounded-t-ds-2xl border-t border-surface-border-strong bg-surface-2 p-ds-05 pb-ds-03",
86
86
  onClick: (e) => e.stopPropagation(),
87
87
  onKeyDown: (e) => e.stopPropagation(),
88
88
  children: [
@@ -93,7 +93,7 @@ const B = w.forwardRef(
93
93
  {
94
94
  onClick: () => c(!1),
95
95
  "aria-label": "Close more menu",
96
- className: "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-full hover:bg-surface-2",
96
+ className: "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-full hover:bg-surface-3",
97
97
  children: /* @__PURE__ */ s(k, { className: "h-ico-sm w-ico-sm text-surface-fg-muted", "aria-hidden": "true" })
98
98
  }
99
99
  )
@@ -105,7 +105,7 @@ const B = w.forwardRef(
105
105
  onClick: () => c(!1),
106
106
  className: o(
107
107
  "flex flex-col items-center gap-ds-02b rounded-ds-xl p-ds-04 text-ds-sm transition-colors",
108
- m(e.href, e.exact) ? "bg-surface-2 text-accent-11" : "text-surface-fg-subtle hover:bg-surface-2"
108
+ m(e.href, e.exact) ? "bg-surface-3 text-accent-11" : "text-surface-fg-subtle hover:bg-surface-3"
109
109
  ),
110
110
  children: [
111
111
  /* @__PURE__ */ s("span", { className: "[&>svg]:h-ico-md [&>svg]:w-ico-md", children: e.icon }),
@@ -127,7 +127,7 @@ const B = w.forwardRef(
127
127
  ref: b,
128
128
  "aria-label": "Mobile navigation",
129
129
  className: o(
130
- "fixed bottom-0 left-0 right-0 z-sticky flex w-full flex-row items-start justify-between border-t border-surface-border-strong bg-surface-1 px-ds-05 pb-ds-05b pt-0 md:hidden",
130
+ "fixed bottom-0 left-0 right-0 z-sticky flex w-full flex-row items-start justify-between border-t border-surface-border-strong bg-surface-2 px-ds-05 pb-ds-05b pt-0 md:hidden",
131
131
  h
132
132
  ),
133
133
  children: [
@@ -45,7 +45,7 @@ function re({ className: r }) {
45
45
  }
46
46
  );
47
47
  }
48
- const B = "relative gap-ds-04 rounded-ds-lg px-ds-04 py-ds-03 transition-colors", F = "bg-accent-2 text-accent-11 after:absolute after:right-0 after:top-0 after:h-full after:w-ds-01 after:rounded-l-ds-full after:bg-accent-9 after:content-['']", G = "text-surface-fg-subtle hover:bg-surface-2 hover:text-surface-fg";
48
+ const B = "relative gap-ds-04 rounded-ds-lg px-ds-04 py-ds-03 transition-colors", F = "bg-accent-2 text-accent-11 after:absolute after:right-0 after:top-0 after:h-full after:w-ds-01 after:rounded-l-ds-full after:bg-accent-9 after:content-['']", G = "text-surface-fg-subtle hover:bg-surface-3 hover:text-surface-fg";
49
49
  function se({
50
50
  item: r,
51
51
  isActive: t,
@@ -86,7 +86,7 @@ function se({
86
86
  /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(
87
87
  "button",
88
88
  {
89
- className: "absolute right-ds-02 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-2 hover:text-surface-fg group-data-[collapsible=icon]:hidden",
89
+ className: "absolute right-ds-02 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-3 hover:text-surface-fg group-data-[collapsible=icon]:hidden",
90
90
  "aria-label": `Toggle ${r.title}`,
91
91
  children: /* @__PURE__ */ e(ae, { className: "h-4 w-4 transition-transform duration-fast-02 ease-productive-standard group-data-[state=open]/collapsible:rotate-90" })
92
92
  }
@@ -1,7 +1,9 @@
1
1
  "use client";
2
2
  /**
3
- * TopBar -- Application top bar with sidebar trigger, user menu, and action
4
- * buttons. All data is props-driven (no Zustand stores or Remix hooks).
3
+ * TopBar v2 Composition-based application top bar.
4
+ *
5
+ * Subcomponents: TopBar.Left, TopBar.Center, TopBar.Right,
6
+ * TopBar.Section, TopBar.IconButton, TopBar.Title, TopBar.UserMenu.
5
7
  */
6
8
  import * as React from 'react';
7
9
  export interface TopBarUser {
@@ -27,28 +29,51 @@ export interface UserMenuItem {
27
29
  /** Whether the item is disabled */
28
30
  disabled?: boolean;
29
31
  }
30
- export interface TopBarProps extends React.HTMLAttributes<HTMLDivElement> {
31
- /** Page title displayed on desktop */
32
- pageTitle?: string;
33
- /** Current user information for the avatar dropdown */
34
- user?: TopBarUser | null;
35
- /** Called when the user clicks a navigation item (e.g. "Profile", "Login") */
32
+ interface TopBarRootProps extends React.HTMLAttributes<HTMLDivElement> {
33
+ children: React.ReactNode;
34
+ className?: string;
35
+ }
36
+ interface TopBarLeftProps extends React.HTMLAttributes<HTMLDivElement> {
37
+ children: React.ReactNode;
38
+ }
39
+ interface TopBarCenterProps extends React.HTMLAttributes<HTMLDivElement> {
40
+ children: React.ReactNode;
41
+ }
42
+ interface TopBarRightProps extends React.HTMLAttributes<HTMLDivElement> {
43
+ children: React.ReactNode;
44
+ }
45
+ declare const gapMap: {
46
+ readonly tight: "gap-ds-02";
47
+ readonly default: "gap-ds-04";
48
+ readonly loose: "gap-ds-06";
49
+ };
50
+ interface TopBarSectionProps extends React.HTMLAttributes<HTMLDivElement> {
51
+ gap?: keyof typeof gapMap;
52
+ children: React.ReactNode;
53
+ }
54
+ interface TopBarIconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
55
+ icon: React.ReactNode;
56
+ tooltip: string;
57
+ }
58
+ interface TopBarTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
59
+ children: React.ReactNode;
60
+ }
61
+ interface TopBarUserMenuProps {
62
+ user: TopBarUser;
36
63
  onNavigate?: (path: string) => void;
37
- /** Called when the user clicks the logout button */
38
64
  onLogout?: () => void;
39
- /** Called when the search button is clicked */
40
- onSearchClick?: () => void;
41
- /** Called when the AI chat button is clicked */
42
- onAiChatClick?: () => void;
43
- /** Optional mobile logo element */
44
- mobileLogo?: React.ReactNode;
45
- /** Notification center slot -- render your NotificationCenter here */
46
- notificationSlot?: React.ReactNode;
47
- /** Custom menu items rendered between Profile and Dark/Light Mode */
48
65
  userMenuItems?: UserMenuItem[];
49
- /** Additional className */
50
66
  className?: string;
51
67
  }
52
- declare const TopBar: React.ForwardRefExoticComponent<TopBarProps & React.RefAttributes<HTMLDivElement>>;
68
+ export type TopBarProps = TopBarRootProps;
69
+ declare const TopBar: React.ForwardRefExoticComponent<TopBarRootProps & React.RefAttributes<HTMLDivElement>> & {
70
+ Left: React.ForwardRefExoticComponent<TopBarLeftProps & React.RefAttributes<HTMLDivElement>>;
71
+ Center: React.ForwardRefExoticComponent<TopBarCenterProps & React.RefAttributes<HTMLDivElement>>;
72
+ Right: React.ForwardRefExoticComponent<TopBarRightProps & React.RefAttributes<HTMLDivElement>>;
73
+ Section: React.ForwardRefExoticComponent<TopBarSectionProps & React.RefAttributes<HTMLDivElement>>;
74
+ IconButton: React.ForwardRefExoticComponent<TopBarIconButtonProps & React.RefAttributes<HTMLButtonElement>>;
75
+ Title: React.ForwardRefExoticComponent<TopBarTitleProps & React.RefAttributes<HTMLHeadingElement>>;
76
+ UserMenu: React.ForwardRefExoticComponent<TopBarUserMenuProps & React.RefAttributes<HTMLButtonElement>>;
77
+ };
53
78
  export { TopBar };
54
79
  //# sourceMappingURL=top-bar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"top-bar.d.ts","sourceRoot":"","sources":["../../src/shell/top-bar.tsx"],"names":[],"mappings":"AAEA;;;GAGG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAuB9B,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,gCAAgC;IAChC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACxB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IACxB,8EAA8E;IAC9E,UAAU,CAAC,EAAE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,EAAE,MAAM,CAAA;CACnB;AAiJD,MAAM,MAAM,WAAW,GAAG,eAAe,CAAA;AAEzC,QAAA,MAAM,MAAM;;;;;;;;CAQV,CAAA;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -1,175 +1,238 @@
1
1
  "use client";
2
- import { jsxs as s, jsx as e, Fragment as I } from "react/jsx-runtime";
3
- import * as w from "react";
4
- import { useColorMode as j } from "../hooks/use-color-mode.js";
5
- import { Avatar as A, AvatarImage as K, AvatarFallback as F } from "../ui/avatar.js";
6
- import { DropdownMenu as U, DropdownMenuTrigger as B, DropdownMenuContent as E, DropdownMenuItem as a, DropdownMenuSeparator as N } from "../ui/dropdown-menu.js";
7
- import { Tooltip as t, TooltipTrigger as n, TooltipContent as i } from "../ui/tooltip.js";
8
- import { SidebarTrigger as R } from "../ui/sidebar.js";
9
- import { IconSearch as z, IconSparkles as L, IconUser as O, IconSun as P, IconMoon as q, IconLogout as G } from "@tabler/icons-react";
10
- import { cn as l } from "../ui/lib/utils.js";
11
- const H = w.forwardRef(
12
- ({
13
- pageTitle: m = "",
14
- user: c,
15
- onNavigate: d,
16
- onLogout: f,
17
- onSearchClick: u,
18
- onAiChatClick: p,
19
- mobileLogo: h,
20
- notificationSlot: y,
21
- userMenuItems: o,
22
- className: C,
23
- ...k
24
- }, v) => {
25
- var g;
26
- const { colorMode: b, toggleColorMode: M } = j(), S = () => {
27
- u ? u() : document.dispatchEvent(
28
- new KeyboardEvent("keydown", {
29
- key: "k",
30
- ctrlKey: !0,
31
- bubbles: !0
32
- })
33
- );
34
- };
35
- return /* @__PURE__ */ s(
2
+ import { jsx as e, jsxs as c, Fragment as D } from "react/jsx-runtime";
3
+ import * as l from "react";
4
+ import { useColorMode as U } from "../hooks/use-color-mode.js";
5
+ import { Avatar as A, AvatarImage as I, AvatarFallback as L } from "../ui/avatar.js";
6
+ import { DropdownMenu as S, DropdownMenuTrigger as F, DropdownMenuContent as O, DropdownMenuItem as f, DropdownMenuSeparator as h } from "../ui/dropdown-menu.js";
7
+ import { Tooltip as x, TooltipTrigger as b, TooltipContent as w } from "../ui/tooltip.js";
8
+ import { IconUser as _, IconSun as z, IconMoon as E, IconLogout as P } from "@tabler/icons-react";
9
+ import { cn as d } from "../ui/lib/utils.js";
10
+ const N = l.forwardRef(
11
+ ({ className: r, children: s, ...t }, a) => {
12
+ const n = l.Children.toArray(s).some(
13
+ (i) => l.isValidElement(i) && i.type === p
14
+ );
15
+ return /* @__PURE__ */ e(
36
16
  "div",
37
17
  {
38
- ...k,
39
- ref: v,
40
- className: l(
41
- "z-sticky flex w-full items-center border-b border-surface-border-strong bg-surface-1 px-ds-05 py-ds-04 md:px-ds-06",
42
- C
18
+ ...t,
19
+ ref: a,
20
+ className: d(
21
+ "z-sticky w-full border-b border-surface-border-strong bg-surface-2 px-ds-05 py-ds-04 md:px-ds-06",
22
+ n ? "grid grid-cols-[1fr_auto_1fr] items-center" : "flex items-center",
23
+ r
43
24
  ),
44
- children: [
45
- /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-04", children: [
46
- /* @__PURE__ */ e(R, { className: "hidden text-surface-fg-muted md:flex" }),
47
- h && /* @__PURE__ */ e("div", { className: "md:hidden", children: h }),
48
- m && /* @__PURE__ */ e("h2", { className: "hidden text-ds-lg text-surface-fg md:block", children: m })
49
- ] }),
50
- /* @__PURE__ */ s("div", { className: "ml-auto flex items-center gap-ds-03 md:gap-ds-05", children: [
51
- /* @__PURE__ */ s(t, { children: [
52
- /* @__PURE__ */ e(n, { asChild: !0, children: /* @__PURE__ */ e(
53
- "button",
54
- {
55
- type: "button",
56
- onClick: S,
57
- "aria-label": "Search (Ctrl+K)",
58
- className: "flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-2 text-surface-fg-muted transition-colors hover:bg-surface-3",
59
- children: /* @__PURE__ */ e(z, { className: "h-ico-sm w-ico-sm", "aria-hidden": "true" })
60
- }
61
- ) }),
62
- /* @__PURE__ */ e(i, { side: "bottom", align: "center", children: "Search (Ctrl+K)" })
63
- ] }),
64
- y,
65
- p && /* @__PURE__ */ s(t, { children: [
66
- /* @__PURE__ */ e(n, { asChild: !0, children: /* @__PURE__ */ e(
67
- "button",
68
- {
69
- type: "button",
70
- onClick: p,
71
- "aria-label": "AI Chat",
72
- className: "flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-2 text-surface-fg-muted transition-colors hover:bg-surface-3",
73
- children: /* @__PURE__ */ e(L, { className: "h-ico-sm w-ico-sm", "aria-hidden": "true" })
74
- }
75
- ) }),
76
- /* @__PURE__ */ e(i, { side: "bottom", align: "center", children: "AI Chat" })
25
+ children: s
26
+ }
27
+ );
28
+ }
29
+ );
30
+ N.displayName = "TopBar";
31
+ const T = l.forwardRef(
32
+ ({ className: r, children: s, ...t }, a) => /* @__PURE__ */ e(
33
+ "div",
34
+ {
35
+ ref: a,
36
+ className: d("flex items-center gap-ds-04", r),
37
+ ...t,
38
+ children: s
39
+ }
40
+ )
41
+ );
42
+ T.displayName = "TopBar.Left";
43
+ const p = l.forwardRef(
44
+ ({ className: r, children: s, ...t }, a) => /* @__PURE__ */ e(
45
+ "div",
46
+ {
47
+ ref: a,
48
+ className: d("flex items-center justify-center px-ds-04", r),
49
+ ...t,
50
+ children: s
51
+ }
52
+ )
53
+ );
54
+ p.displayName = "TopBar.Center";
55
+ const y = l.forwardRef(
56
+ ({ className: r, children: s, ...t }, a) => /* @__PURE__ */ e(
57
+ "div",
58
+ {
59
+ ref: a,
60
+ className: d("ml-auto flex items-center gap-ds-04", r),
61
+ ...t,
62
+ children: s
63
+ }
64
+ )
65
+ );
66
+ y.displayName = "TopBar.Right";
67
+ const V = {
68
+ tight: "gap-ds-02",
69
+ default: "gap-ds-04",
70
+ loose: "gap-ds-06"
71
+ }, B = l.forwardRef(
72
+ ({ gap: r = "default", className: s, children: t, ...a }, n) => /* @__PURE__ */ e(
73
+ "div",
74
+ {
75
+ ref: n,
76
+ className: d("flex items-center", V[r], s),
77
+ ...a,
78
+ children: t
79
+ }
80
+ )
81
+ );
82
+ B.displayName = "TopBar.Section";
83
+ const C = l.forwardRef(({ icon: r, tooltip: s, className: t, ...a }, n) => /* @__PURE__ */ c(x, { children: [
84
+ /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(
85
+ "button",
86
+ {
87
+ ref: n,
88
+ type: "button",
89
+ className: d(
90
+ "flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-3 text-surface-fg-muted transition-colors hover:bg-surface-4",
91
+ t
92
+ ),
93
+ ...a,
94
+ children: /* @__PURE__ */ e("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm", "aria-hidden": "true", children: r })
95
+ }
96
+ ) }),
97
+ /* @__PURE__ */ e(w, { side: "bottom", align: "center", children: s })
98
+ ] }));
99
+ C.displayName = "TopBar.IconButton";
100
+ const M = l.forwardRef(
101
+ ({ className: r, children: s, ...t }, a) => /* @__PURE__ */ e(
102
+ "h2",
103
+ {
104
+ ref: a,
105
+ className: d(
106
+ "hidden text-ds-lg text-surface-fg md:block",
107
+ r
108
+ ),
109
+ ...t,
110
+ children: s
111
+ }
112
+ )
113
+ );
114
+ M.displayName = "TopBar.Title";
115
+ const R = l.forwardRef(
116
+ ({ user: r, onNavigate: s, onLogout: t, userMenuItems: a, className: n }, i) => {
117
+ var u;
118
+ const { colorMode: m, toggleColorMode: k } = U();
119
+ return /* @__PURE__ */ c(S, { children: [
120
+ /* @__PURE__ */ c(x, { children: [
121
+ /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(F, { asChild: !0, children: /* @__PURE__ */ e(
122
+ "button",
123
+ {
124
+ ref: i,
125
+ type: "button",
126
+ className: d("flex items-center gap-ds-03 outline-none", n),
127
+ children: /* @__PURE__ */ c(A, { className: "h-ds-sm-plus w-ds-sm-plus cursor-pointer", children: [
128
+ r.image ? /* @__PURE__ */ e(I, { src: r.image, alt: r.name }) : null,
129
+ /* @__PURE__ */ e(L, { className: "bg-surface-3 text-surface-fg", children: (u = r.name) == null ? void 0 : u.charAt(0).toUpperCase() })
130
+ ] })
131
+ }
132
+ ) }) }),
133
+ /* @__PURE__ */ e(w, { side: "bottom", align: "center", children: "User Menu" })
134
+ ] }),
135
+ /* @__PURE__ */ c(
136
+ O,
137
+ {
138
+ className: "w-[200px] rounded-ds-xl border border-surface-border-strong bg-surface-1 p-0 shadow-03",
139
+ sideOffset: 8,
140
+ align: "end",
141
+ children: [
142
+ /* @__PURE__ */ c("div", { className: "border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
143
+ /* @__PURE__ */ e("p", { className: "text-ds-md text-surface-fg", children: r.name }),
144
+ r.email && /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle", children: r.email })
77
145
  ] }),
78
- c && /* @__PURE__ */ s(U, { children: [
79
- /* @__PURE__ */ s(t, { children: [
80
- /* @__PURE__ */ e(n, { asChild: !0, children: /* @__PURE__ */ e(B, { asChild: !0, children: /* @__PURE__ */ e("button", { type: "button", className: "flex items-center gap-ds-03 outline-none", children: /* @__PURE__ */ s(A, { className: "h-ds-sm-plus w-ds-sm-plus cursor-pointer", children: [
81
- c.image ? /* @__PURE__ */ e(K, { src: c.image, alt: c.name }) : null,
82
- /* @__PURE__ */ e(F, { className: "bg-surface-2 text-surface-fg", children: (g = c.name) == null ? void 0 : g.charAt(0).toUpperCase() })
83
- ] }) }) }) }),
84
- /* @__PURE__ */ e(i, { side: "bottom", align: "center", children: "User Menu" })
85
- ] }),
86
- /* @__PURE__ */ s(
87
- E,
88
- {
89
- className: "w-[200px] rounded-ds-xl border border-surface-border-strong bg-surface-1 p-0 shadow-03",
90
- sideOffset: 8,
91
- align: "end",
92
- children: [
93
- /* @__PURE__ */ s("div", { className: "border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
94
- /* @__PURE__ */ e("p", { className: "text-ds-md text-surface-fg", children: c.name }),
95
- c.email && /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle", children: c.email })
96
- ] }),
97
- /* @__PURE__ */ s(
98
- a,
99
- {
100
- className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-2",
101
- onClick: () => d == null ? void 0 : d("/profile"),
102
- children: [
103
- /* @__PURE__ */ e(O, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }),
104
- /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-muted", children: "Profile" })
105
- ]
106
- }
146
+ /* @__PURE__ */ c(
147
+ f,
148
+ {
149
+ className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-2",
150
+ onClick: () => s == null ? void 0 : s("/profile"),
151
+ children: [
152
+ /* @__PURE__ */ e(_, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }),
153
+ /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-muted", children: "Profile" })
154
+ ]
155
+ }
156
+ ),
157
+ a == null ? void 0 : a.map((o, v) => {
158
+ const j = {
159
+ error: "text-error-11",
160
+ success: "text-success-11",
161
+ warning: "text-warning-11",
162
+ info: "text-info-11"
163
+ }, g = o.color ? j[o.color] ?? "text-surface-fg-muted" : "text-surface-fg-muted";
164
+ return /* @__PURE__ */ c(l.Fragment, { children: [
165
+ o.separator && /* @__PURE__ */ e(h, { className: "bg-surface-border" }),
166
+ /* @__PURE__ */ c(
167
+ f,
168
+ {
169
+ className: d(
170
+ "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-2",
171
+ o.disabled && "pointer-events-none opacity-action-disabled"
107
172
  ),
108
- o == null ? void 0 : o.map((r, T) => {
109
- const D = {
110
- error: "text-error-11",
111
- success: "text-success-11",
112
- warning: "text-warning-11",
113
- info: "text-info-11"
114
- }, x = r.color ? D[r.color] ?? "text-surface-fg-muted" : "text-surface-fg-muted";
115
- return /* @__PURE__ */ s(w.Fragment, { children: [
116
- r.separator && /* @__PURE__ */ e(N, { className: "bg-surface-border" }),
117
- /* @__PURE__ */ s(
118
- a,
119
- {
120
- className: l(
121
- "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-2",
122
- r.disabled && "pointer-events-none opacity-action-disabled"
123
- ),
124
- disabled: r.disabled,
125
- onClick: () => {
126
- r.disabled || (r.onClick ? r.onClick() : r.href && (d == null || d(r.href)));
127
- },
128
- children: [
129
- r.icon && /* @__PURE__ */ e("span", { className: l("[&>svg]:h-ico-sm [&>svg]:w-ico-sm", x), children: r.icon }),
130
- /* @__PURE__ */ e("span", { className: l("text-ds-md", x), children: r.label }),
131
- r.badge != null && r.badge !== !1 && (typeof r.badge == "string" ? /* @__PURE__ */ e("span", { className: "ml-auto inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-ds-full bg-error-9 px-ds-02 text-[10px] font-semibold leading-none text-accent-fg", children: r.badge }) : /* @__PURE__ */ e("span", { className: "ml-auto h-[8px] w-[8px] rounded-ds-full bg-error-9" }))
132
- ]
133
- }
134
- )
135
- ] }, r.label + T);
136
- }),
137
- /* @__PURE__ */ s(
138
- a,
139
- {
140
- className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-2",
141
- onClick: M,
142
- children: [
143
- b === "dark" ? /* @__PURE__ */ e(P, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) : /* @__PURE__ */ e(q, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }),
144
- /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-muted", children: b === "dark" ? "Light Mode" : "Dark Mode" })
145
- ]
146
- }
147
- ),
148
- f && /* @__PURE__ */ s(I, { children: [
149
- /* @__PURE__ */ e(N, { className: "bg-surface-border" }),
150
- /* @__PURE__ */ s(
151
- a,
173
+ disabled: o.disabled,
174
+ onClick: () => {
175
+ o.disabled || (o.onClick ? o.onClick() : o.href && (s == null || s(o.href)));
176
+ },
177
+ children: [
178
+ o.icon && /* @__PURE__ */ e(
179
+ "span",
152
180
  {
153
- className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-2",
154
- onClick: f,
155
- children: [
156
- /* @__PURE__ */ e(G, { className: "h-ico-sm w-ico-sm text-error-11" }),
157
- /* @__PURE__ */ e("span", { className: "text-ds-md text-error-11", children: "Logout" })
158
- ]
181
+ className: d(
182
+ "[&>svg]:h-ico-sm [&>svg]:w-ico-sm",
183
+ g
184
+ ),
185
+ children: o.icon
159
186
  }
160
- )
161
- ] })
187
+ ),
188
+ /* @__PURE__ */ e("span", { className: d("text-ds-md", g), children: o.label }),
189
+ o.badge != null && o.badge !== !1 && (typeof o.badge == "string" ? /* @__PURE__ */ e("span", { className: "ml-auto inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-ds-full bg-error-9 px-ds-02 text-[10px] font-semibold leading-none text-accent-fg", children: o.badge }) : /* @__PURE__ */ e("span", { className: "ml-auto h-[8px] w-[8px] rounded-ds-full bg-error-9" }))
190
+ ]
191
+ }
192
+ )
193
+ ] }, o.label + v);
194
+ }),
195
+ /* @__PURE__ */ c(
196
+ f,
197
+ {
198
+ className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-2",
199
+ onClick: k,
200
+ children: [
201
+ m === "dark" ? /* @__PURE__ */ e(z, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }) : /* @__PURE__ */ e(E, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }),
202
+ /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-muted", children: m === "dark" ? "Light Mode" : "Dark Mode" })
203
+ ]
204
+ }
205
+ ),
206
+ t && /* @__PURE__ */ c(D, { children: [
207
+ /* @__PURE__ */ e(h, { className: "bg-surface-border" }),
208
+ /* @__PURE__ */ c(
209
+ f,
210
+ {
211
+ className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-2",
212
+ onClick: t,
213
+ children: [
214
+ /* @__PURE__ */ e(P, { className: "h-ico-sm w-ico-sm text-error-11" }),
215
+ /* @__PURE__ */ e("span", { className: "text-ds-md text-error-11", children: "Logout" })
162
216
  ]
163
217
  }
164
218
  )
165
219
  ] })
166
- ] })
167
- ]
168
- }
169
- );
220
+ ]
221
+ }
222
+ )
223
+ ] });
170
224
  }
171
225
  );
172
- H.displayName = "TopBar";
226
+ R.displayName = "TopBar.UserMenu";
227
+ const X = Object.assign(N, {
228
+ Left: T,
229
+ Center: p,
230
+ Right: y,
231
+ Section: B,
232
+ IconButton: C,
233
+ Title: M,
234
+ UserMenu: R
235
+ });
173
236
  export {
174
- H as TopBar
237
+ X as TopBar
175
238
  };
@@ -104,8 +104,8 @@
104
104
  --color-surface-fg: var(--neutral-12);
105
105
  --color-surface-fg-muted: var(--neutral-11);
106
106
  --color-surface-fg-subtle: var(--neutral-8);
107
- --color-surface-border: var(--neutral-6);
108
- --color-surface-border-strong: var(--neutral-7);
107
+ --color-surface-border: var(--neutral-5);
108
+ --color-surface-border-strong: var(--neutral-6);
109
109
 
110
110
  /* ═══════════════════════════════════════════════════════════
111
111
  STATUS — Error
@@ -353,9 +353,9 @@
353
353
  --color-info-fg: var(--neutral-12);
354
354
 
355
355
  /* Dark mode borders need lower contrast — bright borders look harsh.
356
- Drop 2 steps: subtle=4 (L=0.29), strong=5 (L=0.34) */
357
- --color-surface-border: var(--neutral-4);
358
- --color-surface-border-strong: var(--neutral-5);
356
+ Drop to step 3/4 for subtle resting borders that don't overpower surfaces */
357
+ --color-surface-border: var(--neutral-3);
358
+ --color-surface-border-strong: var(--neutral-4);
359
359
 
360
360
  /* Overlay */
361
361
  --color-overlay: oklch(0 0 0 / 0.70);