@devalok/shilp-sutra 0.34.0 → 0.34.1

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 (172) hide show
  1. package/dist/_chunks/badge-group.js +306 -246
  2. package/dist/_chunks/chat.js +513 -0
  3. package/dist/_chunks/date-picker.js +748 -0
  4. package/dist/_chunks/document-preview.js +109 -90
  5. package/dist/_chunks/file-preview.js +492 -504
  6. package/dist/_chunks/framer.js +5564 -5613
  7. package/dist/_chunks/image-preview.js +127 -88
  8. package/dist/_chunks/keybinding.js +12 -14
  9. package/dist/_chunks/link-context.js +19 -16
  10. package/dist/_chunks/mention-suggestion.js +353 -350
  11. package/dist/_chunks/motion-provider.js +26 -20
  12. package/dist/_chunks/popover.js +127 -0
  13. package/dist/_chunks/primitives.js +7584 -6425
  14. package/dist/_chunks/rich-chat-input.js +2070 -0
  15. package/dist/_chunks/rolldown-runtime.js +21 -0
  16. package/dist/_chunks/shared.js +126 -0
  17. package/dist/_chunks/sonner.js +605 -734
  18. package/dist/_chunks/stat-row.js +418 -440
  19. package/dist/_chunks/tiptap.js +15850 -19964
  20. package/dist/_chunks/tree-view.js +231 -290
  21. package/dist/_chunks/use-calendar.js +161 -208
  22. package/dist/_chunks/vendor-client.js +314 -2199
  23. package/dist/_chunks/vendor-utils.js +1721 -2978
  24. package/dist/ai/ai-command-provider.js +23 -17
  25. package/dist/ai/block-renderer.js +68 -51
  26. package/dist/ai/blocks/index.js +2 -12
  27. package/dist/ai/command-bar.js +470 -519
  28. package/dist/ai/conversation.js +241 -227
  29. package/dist/ai/index.js +181 -167
  30. package/dist/ai/types.js +0 -1
  31. package/dist/composed/activity-feed.js +232 -202
  32. package/dist/composed/avatar-group.js +164 -222
  33. package/dist/composed/bulk-action-bar.js +174 -165
  34. package/dist/composed/command-palette.js +290 -308
  35. package/dist/composed/confirm-dialog.js +28 -48
  36. package/dist/composed/content-card.js +69 -108
  37. package/dist/composed/date-picker/index.js +3 -13
  38. package/dist/composed/deadline-indicator.js +68 -74
  39. package/dist/composed/emoji-picker.js +83 -110
  40. package/dist/composed/empty-state.js +64 -103
  41. package/dist/composed/error-boundary.js +129 -127
  42. package/dist/composed/file-preview.js +2 -12
  43. package/dist/composed/filter-bar.js +98 -130
  44. package/dist/composed/form-section.js +61 -45
  45. package/dist/composed/global-loading.js +34 -47
  46. package/dist/composed/index.js +34 -92
  47. package/dist/composed/inline-edit.js +92 -107
  48. package/dist/composed/lib/string-utils.js +8 -8
  49. package/dist/composed/loading-skeleton.js +103 -171
  50. package/dist/composed/markdown-viewer.js +187 -139
  51. package/dist/composed/master-detail.js +147 -156
  52. package/dist/composed/member-picker.js +46 -49
  53. package/dist/composed/multi-select-popover.js +181 -179
  54. package/dist/composed/page-header.js +54 -76
  55. package/dist/composed/page-skeletons.js +143 -127
  56. package/dist/composed/priority-indicator.js +105 -111
  57. package/dist/composed/responsive-overlay.js +36 -41
  58. package/dist/composed/rich-chat-input.js +2 -1860
  59. package/dist/composed/rich-text-editor.js +561 -424
  60. package/dist/composed/schedule-view.js +134 -185
  61. package/dist/composed/simple-tooltip.js +21 -21
  62. package/dist/composed/status-badge.js +133 -137
  63. package/dist/hooks/index.js +7 -12
  64. package/dist/hooks/use-color-mode.js +28 -25
  65. package/dist/hooks/use-mobile.js +13 -13
  66. package/dist/hooks/use-toast.js +2 -4
  67. package/dist/hooks/use-touch-device.js +9 -11
  68. package/dist/hooks/use-viewport-height.js +14 -14
  69. package/dist/motion/index.js +3 -11
  70. package/dist/motion/primitives-index.js +226 -186
  71. package/dist/shell/app-command-palette.js +203 -234
  72. package/dist/shell/bottom-navbar.js +150 -190
  73. package/dist/shell/command-registry.js +13 -14
  74. package/dist/shell/index.js +10 -20
  75. package/dist/shell/link-context.js +2 -5
  76. package/dist/shell/notification-center.js +238 -259
  77. package/dist/shell/notification-preferences.js +241 -184
  78. package/dist/shell/sidebar.js +251 -281
  79. package/dist/shell/top-bar.js +203 -237
  80. package/dist/tailwind/index.cjs +426 -442
  81. package/dist/tailwind/index.js +2 -4
  82. package/dist/tailwind/preset.js +443 -459
  83. package/dist/ui/accordion.js +52 -60
  84. package/dist/ui/alert-dialog.js +111 -156
  85. package/dist/ui/alert.js +177 -99
  86. package/dist/ui/aspect-ratio.js +13 -16
  87. package/dist/ui/autocomplete.js +112 -148
  88. package/dist/ui/avatar.js +196 -169
  89. package/dist/ui/badge-group.js +2 -7
  90. package/dist/ui/badge-indicator.js +42 -51
  91. package/dist/ui/badge.js +2 -15
  92. package/dist/ui/banner.js +76 -68
  93. package/dist/ui/breadcrumb.js +65 -84
  94. package/dist/ui/button-group.js +109 -102
  95. package/dist/ui/button-processing.js +69 -73
  96. package/dist/ui/button.js +393 -279
  97. package/dist/ui/card.js +151 -157
  98. package/dist/ui/charts/index.js +1002 -1319
  99. package/dist/ui/chat/index.js +2 -11
  100. package/dist/ui/checkbox.js +77 -100
  101. package/dist/ui/code.js +18 -32
  102. package/dist/ui/collapsible.js +21 -29
  103. package/dist/ui/color-input.js +453 -372
  104. package/dist/ui/color-swatch.js +60 -90
  105. package/dist/ui/combobox.js +244 -293
  106. package/dist/ui/container.js +18 -24
  107. package/dist/ui/context-menu.js +154 -203
  108. package/dist/ui/data-table-body.js +116 -213
  109. package/dist/ui/data-table-bulk-actions.js +43 -59
  110. package/dist/ui/data-table-card.js +84 -71
  111. package/dist/ui/data-table-context.js +39 -42
  112. package/dist/ui/data-table-header.js +98 -139
  113. package/dist/ui/data-table-pagination.js +69 -82
  114. package/dist/ui/data-table-toolbar.js +104 -130
  115. package/dist/ui/data-table.js +278 -354
  116. package/dist/ui/devalok-grain.js +77 -66
  117. package/dist/ui/dialog.js +122 -151
  118. package/dist/ui/dropdown-menu.js +152 -203
  119. package/dist/ui/file-upload.js +242 -266
  120. package/dist/ui/form.js +60 -56
  121. package/dist/ui/hover-card.js +54 -54
  122. package/dist/ui/icon-button.js +21 -26
  123. package/dist/ui/icon-context.js +17 -17
  124. package/dist/ui/icon-group.js +22 -29
  125. package/dist/ui/icon.js +201 -121
  126. package/dist/ui/index.js +74 -350
  127. package/dist/ui/input-otp.js +44 -48
  128. package/dist/ui/input.js +92 -169
  129. package/dist/ui/label.js +17 -22
  130. package/dist/ui/lib/date-utils.js +14 -11
  131. package/dist/ui/lib/motion.js +77 -36
  132. package/dist/ui/lib/utils.js +39 -16
  133. package/dist/ui/link.js +13 -24
  134. package/dist/ui/menubar.js +132 -210
  135. package/dist/ui/navigation-menu.js +163 -193
  136. package/dist/ui/number-input.js +72 -95
  137. package/dist/ui/pagination.js +122 -159
  138. package/dist/ui/popover.js +2 -131
  139. package/dist/ui/progress-ring.js +133 -143
  140. package/dist/ui/progress.js +51 -95
  141. package/dist/ui/radio.js +41 -50
  142. package/dist/ui/search-input.js +51 -53
  143. package/dist/ui/segmented-control.js +93 -114
  144. package/dist/ui/select.js +131 -157
  145. package/dist/ui/separator.js +15 -25
  146. package/dist/ui/sheet.js +135 -163
  147. package/dist/ui/sidebar.js +357 -600
  148. package/dist/ui/skeleton.js +179 -231
  149. package/dist/ui/slider.js +24 -34
  150. package/dist/ui/spinner.js +226 -205
  151. package/dist/ui/split-button.js +227 -276
  152. package/dist/ui/stack.js +56 -70
  153. package/dist/ui/stat-card.js +259 -251
  154. package/dist/ui/status-dot.js +67 -63
  155. package/dist/ui/stepper.js +119 -168
  156. package/dist/ui/switch.js +51 -54
  157. package/dist/ui/table.js +57 -90
  158. package/dist/ui/tabs.js +139 -156
  159. package/dist/ui/text.js +52 -59
  160. package/dist/ui/textarea.js +40 -57
  161. package/dist/ui/toast-types.js +0 -1
  162. package/dist/ui/toast.js +554 -536
  163. package/dist/ui/toaster.js +23 -33
  164. package/dist/ui/toggle-group.js +37 -41
  165. package/dist/ui/toggle.js +36 -40
  166. package/dist/ui/tooltip.js +80 -65
  167. package/dist/ui/tree-view/index.js +2 -6
  168. package/dist/ui/visually-hidden.js +12 -10
  169. package/llms-full.txt +1 -1
  170. package/package.json +1 -1
  171. package/dist/_chunks/date-time-picker.js +0 -851
  172. package/dist/_chunks/typing-indicator.js +0 -565
@@ -1,239 +1,205 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as d, Fragment as j } from "react/jsx-runtime";
3
- import * as c from "react";
4
- import { useColorMode as D } from "../hooks/use-color-mode.js";
5
- import { Avatar as U, AvatarImage as z, AvatarFallback as A } from "../ui/avatar.js";
6
- import { DropdownMenu as L, DropdownMenuTrigger as S, DropdownMenuContent as F, DropdownMenuItem as f, DropdownMenuSeparator as h } from "../ui/dropdown-menu.js";
7
- import { Tooltip as x, TooltipTrigger as b, TooltipContent as N } from "../ui/tooltip.js";
8
- import { IconUser as O, IconSun as _, IconMoon as E, IconLogout as P } from "@tabler/icons-react";
9
- import { Icon as p } from "../ui/icon.js";
10
- import { cn as n } from "../ui/lib/utils.js";
11
- const w = c.forwardRef(
12
- ({ className: r, children: s, ...o }, t) => {
13
- const l = c.Children.toArray(s).some(
14
- (i) => c.isValidElement(i) && i.type === m
15
- );
16
- return /* @__PURE__ */ e(
17
- "header",
18
- {
19
- ...o,
20
- ref: t,
21
- className: n(
22
- "z-sticky w-full border-b border-surface-border-strong bg-surface-raised px-ds-05 py-ds-04 md:px-ds-06",
23
- l ? "grid grid-cols-[1fr_auto_1fr] items-center" : "flex items-center",
24
- r
25
- ),
26
- children: s
27
- }
28
- );
29
- }
30
- );
31
- w.displayName = "TopBar";
32
- const v = c.forwardRef(
33
- ({ className: r, children: s, ...o }, t) => /* @__PURE__ */ e(
34
- "div",
35
- {
36
- ref: t,
37
- className: n("flex items-center gap-ds-04", r),
38
- ...o,
39
- children: s
40
- }
41
- )
42
- );
43
- v.displayName = "TopBar.Left";
44
- const m = c.forwardRef(
45
- ({ className: r, children: s, ...o }, t) => /* @__PURE__ */ e(
46
- "div",
47
- {
48
- ref: t,
49
- className: n("flex items-center justify-center px-ds-04", r),
50
- ...o,
51
- children: s
52
- }
53
- )
54
- );
55
- m.displayName = "TopBar.Center";
56
- const y = c.forwardRef(
57
- ({ className: r, children: s, ...o }, t) => /* @__PURE__ */ e(
58
- "div",
59
- {
60
- ref: t,
61
- className: n("ml-auto flex items-center gap-ds-04", r),
62
- ...o,
63
- children: s
64
- }
65
- )
66
- );
67
- y.displayName = "TopBar.Right";
68
- const V = {
69
- tight: "gap-ds-02",
70
- default: "gap-ds-04",
71
- loose: "gap-ds-06"
72
- }, T = c.forwardRef(
73
- ({ gap: r = "default", className: s, children: o, ...t }, l) => /* @__PURE__ */ e(
74
- "div",
75
- {
76
- ref: l,
77
- className: n("flex items-center", V[r], s),
78
- ...t,
79
- children: o
80
- }
81
- )
82
- );
83
- T.displayName = "TopBar.Section";
84
- const B = c.forwardRef(({ icon: r, tooltip: s, className: o, ...t }, l) => /* @__PURE__ */ d(x, { children: [
85
- /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(
86
- "button",
87
- {
88
- ref: l,
89
- type: "button",
90
- "aria-label": s,
91
- className: n(
92
- "flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-raised-hover text-surface-fg-muted transition-[color,background-color,border-color,transform] hover:bg-surface-raised-active active:scale-90 duration-fast-01 ease-productive-standard",
93
- o
94
- ),
95
- ...t,
96
- children: /* @__PURE__ */ e("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm", "aria-hidden": "true", children: r })
97
- }
98
- ) }),
99
- /* @__PURE__ */ e(N, { side: "bottom", align: "center", children: s })
100
- ] }));
101
- B.displayName = "TopBar.IconButton";
102
- const C = c.forwardRef(
103
- ({ className: r, children: s, ...o }, t) => /* @__PURE__ */ e(
104
- "h2",
105
- {
106
- ref: t,
107
- className: n(
108
- "hidden text-ds-lg text-surface-fg md:block",
109
- r
110
- ),
111
- ...o,
112
- children: s
113
- }
114
- )
115
- );
116
- C.displayName = "TopBar.Title";
117
- const M = c.forwardRef(
118
- ({ user: r, onNavigate: s, onLogout: o, userMenuItems: t, className: l }, i) => {
119
- const { colorMode: u, toggleColorMode: k } = D();
120
- return /* @__PURE__ */ d(L, { children: [
121
- /* @__PURE__ */ d(x, { children: [
122
- /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
123
- "button",
124
- {
125
- ref: i,
126
- type: "button",
127
- className: n("flex items-center gap-ds-03 outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2", l),
128
- children: /* @__PURE__ */ d(U, { className: "h-ds-sm-plus w-ds-sm-plus cursor-pointer", children: [
129
- r.image ? /* @__PURE__ */ e(z, { src: r.image, alt: r.name }) : null,
130
- /* @__PURE__ */ e(A, { className: "bg-surface-raised-hover text-surface-fg", children: r.name?.charAt(0).toUpperCase() })
131
- ] })
132
- }
133
- ) }) }),
134
- /* @__PURE__ */ e(N, { side: "bottom", align: "center", children: "User Menu" })
135
- ] }),
136
- /* @__PURE__ */ d(
137
- F,
138
- {
139
- className: "w-[200px] rounded-ds-xl border border-surface-border-strong bg-surface-overlay p-0 shadow-floating",
140
- sideOffset: 8,
141
- align: "end",
142
- children: [
143
- /* @__PURE__ */ d("div", { className: "border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
144
- /* @__PURE__ */ e("p", { className: "text-ds-md text-surface-fg", children: r.name }),
145
- r.email && /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle truncate", children: r.email })
146
- ] }),
147
- /* @__PURE__ */ d(
148
- f,
149
- {
150
- className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
151
- onClick: () => s?.("/profile"),
152
- children: [
153
- /* @__PURE__ */ e(p, { icon: O, size: "sm", className: "text-surface-fg-muted" }),
154
- /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-muted", children: "Profile" })
155
- ]
156
- }
157
- ),
158
- t?.map((a, R) => {
159
- const I = {
160
- error: "text-error-11",
161
- success: "text-success-11",
162
- warning: "text-warning-11",
163
- info: "text-info-11"
164
- }, g = a.color ? I[a.color] ?? "text-surface-fg-muted" : "text-surface-fg-muted";
165
- return /* @__PURE__ */ d(c.Fragment, { children: [
166
- a.separator && /* @__PURE__ */ e(h, { className: "bg-surface-border" }),
167
- /* @__PURE__ */ d(
168
- f,
169
- {
170
- className: n(
171
- "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
172
- a.disabled && "pointer-events-none opacity-action-disabled"
173
- ),
174
- disabled: a.disabled,
175
- onClick: () => {
176
- a.disabled || (a.onClick ? a.onClick() : a.href && s?.(a.href));
177
- },
178
- children: [
179
- a.icon && /* @__PURE__ */ e(
180
- "span",
181
- {
182
- className: n(
183
- "[&>svg]:h-ico-sm [&>svg]:w-ico-sm",
184
- g
185
- ),
186
- children: a.icon
187
- }
188
- ),
189
- /* @__PURE__ */ e("span", { className: n("text-ds-md", g), children: a.label }),
190
- a.badge != null && a.badge !== !1 && (typeof a.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: a.badge }) : /* @__PURE__ */ e("span", { className: "ml-auto h-[8px] w-[8px] rounded-ds-full bg-error-9" }))
191
- ]
192
- }
193
- )
194
- ] }, a.label + R);
195
- }),
196
- /* @__PURE__ */ d(
197
- f,
198
- {
199
- className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
200
- onClick: k,
201
- children: [
202
- u === "dark" ? /* @__PURE__ */ e(p, { icon: _, size: "sm", className: "text-surface-fg-muted" }) : /* @__PURE__ */ e(p, { icon: E, size: "sm", className: "text-surface-fg-muted" }),
203
- /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-muted", children: u === "dark" ? "Light Mode" : "Dark Mode" })
204
- ]
205
- }
206
- ),
207
- o && /* @__PURE__ */ d(j, { children: [
208
- /* @__PURE__ */ e(h, { className: "bg-surface-border" }),
209
- /* @__PURE__ */ d(
210
- f,
211
- {
212
- className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
213
- onClick: o,
214
- children: [
215
- /* @__PURE__ */ e(p, { icon: P, size: "sm", className: "text-error-11" }),
216
- /* @__PURE__ */ e("span", { className: "text-ds-md text-error-11", children: "Logout" })
217
- ]
218
- }
219
- )
220
- ] })
221
- ]
222
- }
223
- )
224
- ] });
225
- }
226
- );
227
- M.displayName = "TopBar.UserMenu";
228
- const Y = Object.assign(w, {
229
- Left: v,
230
- Center: m,
231
- Right: y,
232
- Section: T,
233
- IconButton: B,
234
- Title: C,
235
- UserMenu: M
2
+ import { cn as e } from "../ui/lib/utils.js";
3
+ import { Icon as t } from "../ui/icon.js";
4
+ import { Avatar as n, AvatarFallback as r, AvatarImage as i } from "../ui/avatar.js";
5
+ import { DropdownMenu as a, DropdownMenuContent as o, DropdownMenuItem as s, DropdownMenuSeparator as c, DropdownMenuTrigger as l } from "../ui/dropdown-menu.js";
6
+ import { Tooltip as u, TooltipContent as d, TooltipTrigger as f } from "../ui/tooltip.js";
7
+ import { useColorMode as p } from "../hooks/use-color-mode.js";
8
+ import * as m from "react";
9
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
10
+ import { IconLogout as v, IconMoon as y, IconSun as b, IconUser as x } from "@tabler/icons-react";
11
+ //#region src/shell/top-bar.tsx
12
+ var S = m.forwardRef(({ className: t, children: n, ...r }, i) => {
13
+ let a = m.Children.toArray(n).some((e) => m.isValidElement(e) && e.type === w);
14
+ return /* @__PURE__ */ g("header", {
15
+ ...r,
16
+ ref: i,
17
+ className: e("z-sticky w-full border-b border-surface-border-strong bg-surface-raised px-ds-05 py-ds-04 md:px-ds-06", a ? "grid grid-cols-[1fr_auto_1fr] items-center" : "flex items-center", t),
18
+ children: n
19
+ });
236
20
  });
237
- export {
238
- Y as TopBar
239
- };
21
+ S.displayName = "TopBar";
22
+ var C = m.forwardRef(({ className: t, children: n, ...r }, i) => /* @__PURE__ */ g("div", {
23
+ ref: i,
24
+ className: e("flex items-center gap-ds-04", t),
25
+ ...r,
26
+ children: n
27
+ }));
28
+ C.displayName = "TopBar.Left";
29
+ var w = m.forwardRef(({ className: t, children: n, ...r }, i) => /* @__PURE__ */ g("div", {
30
+ ref: i,
31
+ className: e("flex items-center justify-center px-ds-04", t),
32
+ ...r,
33
+ children: n
34
+ }));
35
+ w.displayName = "TopBar.Center";
36
+ var T = m.forwardRef(({ className: t, children: n, ...r }, i) => /* @__PURE__ */ g("div", {
37
+ ref: i,
38
+ className: e("ml-auto flex items-center gap-ds-04", t),
39
+ ...r,
40
+ children: n
41
+ }));
42
+ T.displayName = "TopBar.Right";
43
+ var E = {
44
+ tight: "gap-ds-02",
45
+ default: "gap-ds-04",
46
+ loose: "gap-ds-06"
47
+ }, D = m.forwardRef(({ gap: t = "default", className: n, children: r, ...i }, a) => /* @__PURE__ */ g("div", {
48
+ ref: a,
49
+ className: e("flex items-center", E[t], n),
50
+ ...i,
51
+ children: r
52
+ }));
53
+ D.displayName = "TopBar.Section";
54
+ var O = m.forwardRef(({ icon: t, tooltip: n, className: r, ...i }, a) => /* @__PURE__ */ _(u, { children: [/* @__PURE__ */ g(f, {
55
+ asChild: !0,
56
+ children: /* @__PURE__ */ g("button", {
57
+ ref: a,
58
+ type: "button",
59
+ "aria-label": n,
60
+ className: e("flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-raised-hover text-surface-fg-muted transition-[color,background-color,border-color,transform] hover:bg-surface-raised-active active:scale-90 duration-fast-01 ease-productive-standard", r),
61
+ ...i,
62
+ children: /* @__PURE__ */ g("span", {
63
+ className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm",
64
+ "aria-hidden": "true",
65
+ children: t
66
+ })
67
+ })
68
+ }), /* @__PURE__ */ g(d, {
69
+ side: "bottom",
70
+ align: "center",
71
+ children: n
72
+ })] }));
73
+ O.displayName = "TopBar.IconButton";
74
+ var k = m.forwardRef(({ className: t, children: n, ...r }, i) => /* @__PURE__ */ g("h2", {
75
+ ref: i,
76
+ className: e("hidden text-ds-lg text-surface-fg md:block", t),
77
+ ...r,
78
+ children: n
79
+ }));
80
+ k.displayName = "TopBar.Title";
81
+ var A = m.forwardRef(({ user: S, onNavigate: C, onLogout: w, userMenuItems: T, className: E }, D) => {
82
+ let { colorMode: O, toggleColorMode: k } = p();
83
+ return /* @__PURE__ */ _(a, { children: [/* @__PURE__ */ _(u, { children: [/* @__PURE__ */ g(f, {
84
+ asChild: !0,
85
+ children: /* @__PURE__ */ g(l, {
86
+ asChild: !0,
87
+ children: /* @__PURE__ */ g("button", {
88
+ ref: D,
89
+ type: "button",
90
+ className: e("flex items-center gap-ds-03 outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2", E),
91
+ children: /* @__PURE__ */ _(n, {
92
+ className: "h-ds-sm-plus w-ds-sm-plus cursor-pointer",
93
+ children: [S.image ? /* @__PURE__ */ g(i, {
94
+ src: S.image,
95
+ alt: S.name
96
+ }) : null, /* @__PURE__ */ g(r, {
97
+ className: "bg-surface-raised-hover text-surface-fg",
98
+ children: S.name?.charAt(0).toUpperCase()
99
+ })]
100
+ })
101
+ })
102
+ })
103
+ }), /* @__PURE__ */ g(d, {
104
+ side: "bottom",
105
+ align: "center",
106
+ children: "User Menu"
107
+ })] }), /* @__PURE__ */ _(o, {
108
+ className: "w-[200px] rounded-ds-xl border border-surface-border-strong bg-surface-overlay p-0 shadow-floating",
109
+ sideOffset: 8,
110
+ align: "end",
111
+ children: [
112
+ /* @__PURE__ */ _("div", {
113
+ className: "border-b border-surface-border-strong px-ds-05 py-ds-04",
114
+ children: [/* @__PURE__ */ g("p", {
115
+ className: "text-ds-md text-surface-fg",
116
+ children: S.name
117
+ }), S.email && /* @__PURE__ */ g("p", {
118
+ className: "text-ds-sm text-surface-fg-subtle truncate",
119
+ children: S.email
120
+ })]
121
+ }),
122
+ /* @__PURE__ */ _(s, {
123
+ className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
124
+ onClick: () => C?.("/profile"),
125
+ children: [/* @__PURE__ */ g(t, {
126
+ icon: x,
127
+ size: "sm",
128
+ className: "text-surface-fg-muted"
129
+ }), /* @__PURE__ */ g("span", {
130
+ className: "text-ds-md text-surface-fg-muted",
131
+ children: "Profile"
132
+ })]
133
+ }),
134
+ T?.map((t, n) => {
135
+ let r = t.color ? {
136
+ error: "text-error-11",
137
+ success: "text-success-11",
138
+ warning: "text-warning-11",
139
+ info: "text-info-11"
140
+ }[t.color] ?? "text-surface-fg-muted" : "text-surface-fg-muted";
141
+ return /* @__PURE__ */ _(m.Fragment, { children: [t.separator && /* @__PURE__ */ g(c, { className: "bg-surface-border" }), /* @__PURE__ */ _(s, {
142
+ className: e("flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised", t.disabled && "pointer-events-none opacity-action-disabled"),
143
+ disabled: t.disabled,
144
+ onClick: () => {
145
+ t.disabled || (t.onClick ? t.onClick() : t.href && C?.(t.href));
146
+ },
147
+ children: [
148
+ t.icon && /* @__PURE__ */ g("span", {
149
+ className: e("[&>svg]:h-ico-sm [&>svg]:w-ico-sm", r),
150
+ children: t.icon
151
+ }),
152
+ /* @__PURE__ */ g("span", {
153
+ className: e("text-ds-md", r),
154
+ children: t.label
155
+ }),
156
+ t.badge != null && t.badge !== !1 && (typeof t.badge == "string" ? /* @__PURE__ */ g("span", {
157
+ 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",
158
+ children: t.badge
159
+ }) : /* @__PURE__ */ g("span", { className: "ml-auto h-[8px] w-[8px] rounded-ds-full bg-error-9" }))
160
+ ]
161
+ })] }, t.label + n);
162
+ }),
163
+ /* @__PURE__ */ _(s, {
164
+ className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
165
+ onClick: k,
166
+ children: [O === "dark" ? /* @__PURE__ */ g(t, {
167
+ icon: b,
168
+ size: "sm",
169
+ className: "text-surface-fg-muted"
170
+ }) : /* @__PURE__ */ g(t, {
171
+ icon: y,
172
+ size: "sm",
173
+ className: "text-surface-fg-muted"
174
+ }), /* @__PURE__ */ g("span", {
175
+ className: "text-ds-md text-surface-fg-muted",
176
+ children: O === "dark" ? "Light Mode" : "Dark Mode"
177
+ })]
178
+ }),
179
+ w && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(c, { className: "bg-surface-border" }), /* @__PURE__ */ _(s, {
180
+ className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
181
+ onClick: w,
182
+ children: [/* @__PURE__ */ g(t, {
183
+ icon: v,
184
+ size: "sm",
185
+ className: "text-error-11"
186
+ }), /* @__PURE__ */ g("span", {
187
+ className: "text-ds-md text-error-11",
188
+ children: "Logout"
189
+ })]
190
+ })] })
191
+ ]
192
+ })] });
193
+ });
194
+ A.displayName = "TopBar.UserMenu";
195
+ var j = Object.assign(S, {
196
+ Left: C,
197
+ Center: w,
198
+ Right: T,
199
+ Section: D,
200
+ IconButton: O,
201
+ Title: k,
202
+ UserMenu: A
203
+ });
204
+ //#endregion
205
+ export { j as TopBar };