@devalok/shilp-sutra 0.30.0 → 0.32.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.
- package/README.md +82 -239
- package/dist/_chunks/badge-group.js +123 -171
- package/dist/_chunks/document-preview.js +92 -0
- package/dist/_chunks/file-preview.js +511 -0
- package/dist/_chunks/image-preview.js +90 -0
- package/dist/_chunks/primitives.js +109 -109
- package/dist/_chunks/stat-row.js +144 -124
- package/dist/_chunks/use-calendar.js +558 -490
- package/dist/ai/block-renderer.d.ts +2 -1
- package/dist/ai/block-renderer.d.ts.map +1 -1
- package/dist/ai/block-renderer.js +30 -29
- package/dist/ai/blocks/block-table.d.ts.map +1 -1
- package/dist/ai/blocks/confirm.d.ts.map +1 -1
- package/dist/ai/blocks/divider.d.ts.map +1 -1
- package/dist/ai/blocks/error.d.ts.map +1 -1
- package/dist/ai/blocks/info.d.ts.map +1 -1
- package/dist/ai/blocks/loading.d.ts.map +1 -1
- package/dist/ai/blocks/stat-row.d.ts.map +1 -1
- package/dist/ai/blocks/success.d.ts.map +1 -1
- package/dist/ai/blocks/text.d.ts.map +1 -1
- package/dist/ai/command-bar.d.ts +18 -0
- package/dist/ai/command-bar.d.ts.map +1 -1
- package/dist/ai/command-bar.js +126 -125
- package/dist/ai/conversation.d.ts +13 -1
- package/dist/ai/conversation.d.ts.map +1 -1
- package/dist/ai/conversation.js +78 -78
- package/dist/ai/types.d.ts +0 -1
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/ai/types.js +1 -0
- package/dist/composed/bulk-action-bar.d.ts +6 -4
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +102 -58
- package/dist/composed/command-palette.d.ts +9 -0
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +68 -68
- package/dist/composed/confirm-dialog.d.ts +1 -1
- package/dist/composed/confirm-dialog.d.ts.map +1 -1
- package/dist/composed/confirm-dialog.js +10 -10
- package/dist/composed/content-card.d.ts.map +1 -1
- package/dist/composed/date-picker/date-picker.d.ts +11 -1
- package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.d.ts +1 -1
- package/dist/composed/deadline-indicator.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.js +39 -36
- package/dist/composed/emoji-picker.d.ts +6 -0
- package/dist/composed/emoji-picker.d.ts.map +1 -1
- package/dist/composed/emoji-picker.js +22 -20
- package/dist/composed/error-boundary.d.ts +21 -1
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js +47 -32
- package/dist/composed/file-preview/audio-preview.d.ts +7 -0
- package/dist/composed/file-preview/audio-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/document-preview.d.ts +7 -0
- package/dist/composed/file-preview/document-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/embed-preview.d.ts +7 -0
- package/dist/composed/file-preview/embed-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/image-preview.d.ts +7 -0
- package/dist/composed/file-preview/image-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/shared.d.ts +20 -0
- package/dist/composed/file-preview/shared.d.ts.map +1 -0
- package/dist/composed/file-preview/video-preview.d.ts +6 -0
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -0
- package/dist/composed/file-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +10 -662
- package/dist/composed/filter-bar.d.ts +10 -2
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +42 -43
- package/dist/composed/form-section.d.ts +1 -1
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +22 -21
- package/dist/composed/index.d.ts +2 -2
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +58 -57
- package/dist/composed/inline-edit.d.ts +1 -1
- package/dist/composed/inline-edit.d.ts.map +1 -1
- package/dist/composed/inline-edit.js +33 -32
- package/dist/composed/lib/string-utils.d.ts.map +1 -1
- package/dist/composed/loading-skeleton.d.ts.map +1 -1
- package/dist/composed/markdown-viewer.d.ts +1 -1
- package/dist/composed/markdown-viewer.d.ts.map +1 -1
- package/dist/composed/markdown-viewer.js +60 -59
- package/dist/composed/master-detail.d.ts +11 -7
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +123 -84
- package/dist/composed/page-header.d.ts.map +1 -1
- package/dist/composed/page-skeletons.d.ts.map +1 -1
- package/dist/composed/priority-indicator.d.ts +1 -0
- package/dist/composed/priority-indicator.js +1 -0
- package/dist/composed/responsive-overlay.d.ts +8 -0
- package/dist/composed/responsive-overlay.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.d.ts +11 -3
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +21 -20
- package/dist/composed/schedule-view.d.ts +9 -1
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +8 -4
- package/dist/hooks/use-touch-device.d.ts +12 -0
- package/dist/hooks/use-touch-device.d.ts.map +1 -0
- package/dist/hooks/use-touch-device.js +13 -0
- package/dist/hooks/use-viewport-height.d.ts +11 -0
- package/dist/hooks/use-viewport-height.d.ts.map +1 -0
- package/dist/hooks/use-viewport-height.js +16 -0
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +72 -63
- package/dist/shell/command-registry.d.ts.map +1 -1
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +77 -77
- package/dist/shell/top-bar.d.ts +2 -2
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +61 -60
- package/dist/tailwind/index.cjs +51 -7
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +51 -7
- package/dist/tokens/primitives.css +3 -1
- package/dist/tokens/semantic.css +16 -13
- package/dist/tokens/typography.css +33 -4
- package/dist/ui/alert.d.ts +1 -0
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +42 -37
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +38 -39
- package/dist/ui/badge.d.ts +110 -2
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +8 -7
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +54 -74
- package/dist/ui/card.d.ts +5 -1
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +111 -79
- package/dist/ui/charts/area-chart.d.ts +2 -0
- package/dist/ui/charts/area-chart.d.ts.map +1 -1
- package/dist/ui/charts/bar-chart.d.ts +2 -0
- package/dist/ui/charts/bar-chart.d.ts.map +1 -1
- package/dist/ui/charts/chart-container.d.ts +2 -0
- package/dist/ui/charts/chart-container.d.ts.map +1 -1
- package/dist/ui/charts/index.js +583 -577
- package/dist/ui/charts/line-chart.d.ts +2 -0
- package/dist/ui/charts/line-chart.d.ts.map +1 -1
- package/dist/ui/charts/pie-chart.d.ts +2 -0
- package/dist/ui/charts/pie-chart.d.ts.map +1 -1
- package/dist/ui/charts/radar-chart.d.ts +2 -0
- package/dist/ui/charts/radar-chart.d.ts.map +1 -1
- package/dist/ui/checkbox.d.ts +2 -0
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +36 -27
- package/dist/ui/code.d.ts.map +1 -1
- package/dist/ui/color-input.js +5 -5
- package/dist/ui/combobox.d.ts +6 -1
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/container.d.ts.map +1 -1
- package/dist/ui/context-menu.js +1 -1
- package/dist/ui/data-table-body.d.ts +12 -0
- package/dist/ui/data-table-body.d.ts.map +1 -0
- package/dist/ui/data-table-body.js +219 -0
- package/dist/ui/data-table-bulk-actions.d.ts +19 -0
- package/dist/ui/data-table-bulk-actions.d.ts.map +1 -0
- package/dist/ui/data-table-bulk-actions.js +61 -0
- package/dist/ui/data-table-card.d.ts +9 -0
- package/dist/ui/data-table-card.d.ts.map +1 -0
- package/dist/ui/data-table-card.js +73 -0
- package/dist/ui/data-table-context.d.ts +62 -0
- package/dist/ui/data-table-context.d.ts.map +1 -0
- package/dist/ui/data-table-context.js +48 -0
- package/dist/ui/data-table-header.d.ts +10 -0
- package/dist/ui/data-table-header.d.ts.map +1 -0
- package/dist/ui/data-table-header.js +141 -0
- package/dist/ui/data-table-pagination.d.ts +13 -0
- package/dist/ui/data-table-pagination.d.ts.map +1 -0
- package/dist/ui/data-table-pagination.js +84 -0
- package/dist/ui/data-table.d.ts +11 -9
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +258 -573
- package/dist/ui/dialog.d.ts +6 -2
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +84 -82
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +3 -3
- package/dist/ui/icon-group.d.ts +2 -4
- package/dist/ui/icon-group.d.ts.map +1 -1
- package/dist/ui/icon-group.js +22 -23
- package/dist/ui/index.d.ts +1 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +94 -99
- package/dist/ui/label.js +1 -1
- package/dist/ui/lib/bottom-sheet.d.ts +16 -0
- package/dist/ui/lib/bottom-sheet.d.ts.map +1 -0
- package/dist/ui/lib/date-utils.d.ts.map +1 -1
- package/dist/ui/lib/motion.d.ts.map +1 -1
- package/dist/ui/lib/utils.d.ts.map +1 -1
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +64 -73
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +40 -44
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +19 -17
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/popover.js +107 -32
- package/dist/ui/progress-ring.d.ts.map +1 -1
- package/dist/ui/progress-ring.js +80 -80
- package/dist/ui/progress.js +4 -4
- package/dist/ui/radio.d.ts +5 -2
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +29 -20
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +13 -12
- package/dist/ui/segmented-control.d.ts +6 -108
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +86 -272
- package/dist/ui/select.d.ts +3 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +83 -71
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.d.ts +2 -0
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +102 -84
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +200 -175
- package/dist/ui/skeleton.d.ts.map +1 -1
- package/dist/ui/slider.js +14 -14
- package/dist/ui/stack.d.ts.map +1 -1
- package/dist/ui/status-dot.js +8 -8
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +33 -31
- package/dist/ui/switch.js +3 -3
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/tabs.d.ts +7 -0
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +102 -76
- package/dist/ui/text.d.ts.map +1 -1
- package/dist/ui/toast-types.d.ts +0 -1
- package/dist/ui/toast-types.d.ts.map +1 -1
- package/dist/ui/toast-types.js +0 -1
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +156 -150
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/tooltip.js +3 -3
- package/dist/ui/visually-hidden.d.ts.map +1 -1
- package/docs/components/ui/alert.md +3 -0
- package/docs/components/ui/badge.md +3 -0
- package/docs/components/ui/card.md +4 -0
- package/docs/components/ui/data-table-body.md +13 -0
- package/docs/components/ui/data-table-bulk-actions.md +13 -0
- package/docs/components/ui/data-table-card.md +13 -0
- package/docs/components/ui/data-table-context.md +13 -0
- package/docs/components/ui/data-table-header.md +13 -0
- package/docs/components/ui/data-table-pagination.md +13 -0
- package/docs/components/ui/select.md +4 -0
- package/docs/components/ui/tabs.md +4 -0
- package/llms-full.txt +97 -48
- package/llms.txt +46 -1
- package/package.json +37 -7
- package/dist/ui/chip.d.ts +0 -19
- package/dist/ui/chip.d.ts.map +0 -1
- package/dist/ui/chip.js +0 -14
- package/dist/ui/lib/use-ripple.d.ts +0 -14
- package/dist/ui/lib/use-ripple.d.ts.map +0 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as a, jsx as e, Fragment as H } from "react/jsx-runtime";
|
|
3
3
|
import * as $ from "react";
|
|
4
|
-
import { useRef as B, useCallback as
|
|
4
|
+
import { useRef as B, useCallback as v } from "react";
|
|
5
5
|
import { formatRelativeTime as G } from "../ui/lib/date-utils.js";
|
|
6
|
-
import { Popover as
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import { IconBell as
|
|
9
|
-
import { Icon as
|
|
6
|
+
import { Popover as X, PopoverTrigger as _, PopoverContent as q } from "../ui/popover.js";
|
|
7
|
+
import { Tooltip as J, TooltipTrigger as L, TooltipContent as Q } from "../ui/tooltip.js";
|
|
8
|
+
import { IconBell as U, IconChecks as V, IconInbox as W, IconX as Z } from "@tabler/icons-react";
|
|
9
|
+
import { Icon as x } from "../ui/icon.js";
|
|
10
10
|
import { cn as f } from "../ui/lib/utils.js";
|
|
11
|
-
import { Spinner as
|
|
12
|
-
import { m as
|
|
13
|
-
function
|
|
11
|
+
import { Spinner as ee } from "../ui/spinner.js";
|
|
12
|
+
import { u as te, m as w } from "../_chunks/framer.js";
|
|
13
|
+
function C(t, d) {
|
|
14
14
|
return t.getFullYear() === d.getFullYear() && t.getMonth() === d.getMonth() && t.getDate() === d.getDate();
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const d = new Date(t),
|
|
18
|
-
return
|
|
16
|
+
function se(t) {
|
|
17
|
+
const d = new Date(t), l = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
|
|
18
|
+
return n.setDate(l.getDate() - 1), C(d, l) ? "Today" : C(d, n) ? "Yesterday" : "Earlier";
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const R = {
|
|
21
21
|
INFO: "bg-info-9",
|
|
22
22
|
IMPORTANT: "bg-warning-9",
|
|
23
23
|
CRITICAL: "bg-error-9"
|
|
24
24
|
};
|
|
25
|
-
function
|
|
25
|
+
function re({
|
|
26
26
|
notification: t,
|
|
27
27
|
onRead: d,
|
|
28
|
-
onNavigate:
|
|
29
|
-
getRoute:
|
|
28
|
+
onNavigate: l,
|
|
29
|
+
getRoute: n,
|
|
30
30
|
onDismiss: c
|
|
31
31
|
}) {
|
|
32
|
-
const p =
|
|
33
|
-
t.isRead || d(t.id), p &&
|
|
32
|
+
const p = n(t), g = () => {
|
|
33
|
+
t.isRead || d(t.id), p && l(p);
|
|
34
34
|
};
|
|
35
35
|
return /* @__PURE__ */ a(
|
|
36
36
|
"div",
|
|
@@ -52,7 +52,7 @@ function te({
|
|
|
52
52
|
{
|
|
53
53
|
className: f(
|
|
54
54
|
"h-[8px] w-[8px] rounded-ds-full transition-opacity duration-fast-02 ease-productive-standard",
|
|
55
|
-
|
|
55
|
+
R[t.tier] || R.INFO,
|
|
56
56
|
t.isRead ? "opacity-20" : "opacity-100"
|
|
57
57
|
)
|
|
58
58
|
}
|
|
@@ -103,89 +103,89 @@ function te({
|
|
|
103
103
|
},
|
|
104
104
|
onKeyDown: (r) => r.stopPropagation(),
|
|
105
105
|
className: "absolute right-ds-03 top-ds-03 hidden rounded-ds-sm p-ds-01 text-surface-fg-subtle transition-[color,background-color,opacity] duration-fast-01 ease-productive-standard hover:bg-surface-raised-hover hover:text-surface-fg-muted group-hover:flex group-focus-within:flex",
|
|
106
|
-
children: /* @__PURE__ */ e(
|
|
106
|
+
children: /* @__PURE__ */ e(x, { icon: Z, size: "sm" })
|
|
107
107
|
}
|
|
108
108
|
)
|
|
109
109
|
]
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
|
-
const
|
|
113
|
+
const ae = $.forwardRef(
|
|
114
114
|
({
|
|
115
115
|
notifications: t = [],
|
|
116
116
|
unreadCount: d,
|
|
117
|
-
open:
|
|
118
|
-
onOpenChange:
|
|
117
|
+
open: l,
|
|
118
|
+
onOpenChange: n,
|
|
119
119
|
isLoading: c = !1,
|
|
120
120
|
hasMore: p = !1,
|
|
121
121
|
onFetchMore: g,
|
|
122
|
-
onMarkRead:
|
|
122
|
+
onMarkRead: b,
|
|
123
123
|
onMarkAllRead: r,
|
|
124
124
|
onNavigate: i,
|
|
125
125
|
getNotificationRoute: D,
|
|
126
126
|
onDismiss: I,
|
|
127
|
-
headerActions:
|
|
128
|
-
emptyState:
|
|
127
|
+
headerActions: k,
|
|
128
|
+
emptyState: T,
|
|
129
129
|
footerSlot: y,
|
|
130
|
-
popoverClassName:
|
|
131
|
-
className:
|
|
132
|
-
...
|
|
133
|
-
},
|
|
134
|
-
const
|
|
130
|
+
popoverClassName: j,
|
|
131
|
+
className: P,
|
|
132
|
+
...O
|
|
133
|
+
}, z) => {
|
|
134
|
+
const N = B(null), h = te(), o = d ?? t.filter((s) => !s.isRead).length, K = D ?? (() => null), Y = v(
|
|
135
135
|
(s) => {
|
|
136
|
-
|
|
136
|
+
n?.(!1), i?.(s);
|
|
137
137
|
},
|
|
138
|
-
[i,
|
|
139
|
-
),
|
|
138
|
+
[i, n]
|
|
139
|
+
), E = v(
|
|
140
140
|
(s) => {
|
|
141
|
-
|
|
141
|
+
b?.(s);
|
|
142
142
|
},
|
|
143
|
-
[
|
|
144
|
-
),
|
|
145
|
-
const s =
|
|
143
|
+
[b]
|
|
144
|
+
), F = v(() => {
|
|
145
|
+
const s = N.current;
|
|
146
146
|
!s || c || !p || s.scrollTop + s.clientHeight >= s.scrollHeight - 50 && g?.();
|
|
147
|
-
}, [c, p, g]),
|
|
147
|
+
}, [c, p, g]), S = t.reduce(
|
|
148
148
|
(s, u) => {
|
|
149
|
-
const m =
|
|
149
|
+
const m = se(u.createdAt);
|
|
150
150
|
return s[m] || (s[m] = []), s[m].push(u), s;
|
|
151
151
|
},
|
|
152
152
|
{}
|
|
153
|
-
),
|
|
154
|
-
return /* @__PURE__ */ a(
|
|
155
|
-
/* @__PURE__ */ a(
|
|
156
|
-
/* @__PURE__ */ e(
|
|
153
|
+
), A = ["Today", "Yesterday", "Earlier"];
|
|
154
|
+
return /* @__PURE__ */ a(X, { open: l, onOpenChange: n, children: [
|
|
155
|
+
/* @__PURE__ */ a(J, { children: [
|
|
156
|
+
/* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(_, { asChild: !0, children: /* @__PURE__ */ a(
|
|
157
157
|
"button",
|
|
158
158
|
{
|
|
159
|
-
...
|
|
160
|
-
ref:
|
|
161
|
-
"aria-label":
|
|
159
|
+
...O,
|
|
160
|
+
ref: z,
|
|
161
|
+
"aria-label": o > 0 ? `Notifications, ${o} unread` : "Notifications",
|
|
162
162
|
className: f(
|
|
163
163
|
"relative flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-surface-border-strong bg-surface-raised text-surface-fg-muted transition-colors ease-productive-standard hover:bg-surface-raised-hover",
|
|
164
|
-
|
|
164
|
+
P
|
|
165
165
|
),
|
|
166
166
|
children: [
|
|
167
|
-
/* @__PURE__ */ e(
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
/* @__PURE__ */ e(x, { icon: U, size: "sm" }),
|
|
168
|
+
o > 0 && /* @__PURE__ */ e(
|
|
169
|
+
w.span,
|
|
170
170
|
{
|
|
171
171
|
initial: { rotate: 0 },
|
|
172
|
-
animate: { rotate: [0, -3, 3, -1, 1, 0] },
|
|
173
|
-
transition: { duration: 0.4, ease: "easeInOut" },
|
|
172
|
+
animate: h ? void 0 : { rotate: [0, -3, 3, -1, 1, 0] },
|
|
173
|
+
transition: h ? { duration: 0 } : { duration: 0.4, ease: "easeInOut" },
|
|
174
174
|
className: "absolute -right-ds-01 -top-ds-01 flex h-4 min-w-4 items-center justify-center rounded-ds-full bg-accent-9 px-ds-02 text-ds-xs font-semibold text-accent-fg",
|
|
175
|
-
children:
|
|
175
|
+
children: o > 99 ? "99+" : o
|
|
176
176
|
}
|
|
177
177
|
)
|
|
178
178
|
]
|
|
179
179
|
}
|
|
180
180
|
) }) }),
|
|
181
|
-
/* @__PURE__ */ e(
|
|
181
|
+
/* @__PURE__ */ e(Q, { side: "bottom", align: "center", children: "Notifications" })
|
|
182
182
|
] }),
|
|
183
183
|
/* @__PURE__ */ a(
|
|
184
|
-
|
|
184
|
+
q,
|
|
185
185
|
{
|
|
186
186
|
className: f(
|
|
187
187
|
"w-[380px] rounded-ds-xl border border-surface-border-strong bg-surface-overlay p-0 shadow-floating",
|
|
188
|
-
|
|
188
|
+
j
|
|
189
189
|
),
|
|
190
190
|
sideOffset: 8,
|
|
191
191
|
align: "end",
|
|
@@ -193,52 +193,52 @@ const se = $.forwardRef(
|
|
|
193
193
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
|
|
194
194
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-ds-03", children: [
|
|
195
195
|
/* @__PURE__ */ e("h3", { className: "text-ds-md font-semibold text-surface-fg", children: "Notifications" }),
|
|
196
|
-
|
|
196
|
+
o > 0 && /* @__PURE__ */ e("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-ds-full bg-accent-2 px-ds-02b text-ds-sm font-semibold text-accent-11", children: o })
|
|
197
197
|
] }),
|
|
198
198
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-ds-03", children: [
|
|
199
|
-
|
|
199
|
+
o > 0 && r && /* @__PURE__ */ a(
|
|
200
200
|
"button",
|
|
201
201
|
{
|
|
202
202
|
type: "button",
|
|
203
203
|
onClick: r,
|
|
204
204
|
className: "flex items-center gap-ds-02 text-ds-sm text-surface-fg-subtle transition-colors hover:text-accent-11",
|
|
205
205
|
children: [
|
|
206
|
-
/* @__PURE__ */ e(
|
|
206
|
+
/* @__PURE__ */ e(x, { icon: V, size: "sm" }),
|
|
207
207
|
"Mark all read"
|
|
208
208
|
]
|
|
209
209
|
}
|
|
210
210
|
),
|
|
211
|
-
|
|
211
|
+
k
|
|
212
212
|
] })
|
|
213
213
|
] }),
|
|
214
214
|
/* @__PURE__ */ a(
|
|
215
215
|
"div",
|
|
216
216
|
{
|
|
217
|
-
ref:
|
|
218
|
-
onScroll:
|
|
217
|
+
ref: N,
|
|
218
|
+
onScroll: F,
|
|
219
219
|
className: "max-h-[420px] overflow-y-auto",
|
|
220
220
|
children: [
|
|
221
|
-
t.length === 0 ?
|
|
222
|
-
/* @__PURE__ */ e("div", { className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-surface-raised", children: /* @__PURE__ */ e(
|
|
221
|
+
t.length === 0 ? T || /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center px-ds-05 py-ds-09", children: [
|
|
222
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-surface-raised", children: /* @__PURE__ */ e(x, { icon: W, size: "lg", className: "text-surface-fg-subtle" }) }),
|
|
223
223
|
/* @__PURE__ */ e("p", { className: "mt-ds-04 text-ds-md text-surface-fg-subtle", children: "No notifications yet" }),
|
|
224
224
|
/* @__PURE__ */ e("p", { className: "mt-ds-02 text-ds-sm text-surface-fg-subtle", children: "You're all caught up!" })
|
|
225
|
-
] }) :
|
|
226
|
-
const u =
|
|
225
|
+
] }) : A.map((s) => {
|
|
226
|
+
const u = S[s];
|
|
227
227
|
return !u || u.length === 0 ? null : /* @__PURE__ */ a("div", { children: [
|
|
228
228
|
/* @__PURE__ */ e("div", { className: "sticky top-0 z-raised bg-surface-overlay px-ds-05 py-ds-02b", children: /* @__PURE__ */ e("span", { className: "text-ds-sm font-medium text-surface-fg-subtle", children: s }) }),
|
|
229
|
-
u.map((m,
|
|
230
|
-
|
|
229
|
+
u.map((m, M) => /* @__PURE__ */ e(
|
|
230
|
+
w.div,
|
|
231
231
|
{
|
|
232
|
-
initial: { opacity: 0 },
|
|
232
|
+
initial: h ? void 0 : { opacity: 0 },
|
|
233
233
|
animate: { opacity: 1 },
|
|
234
|
-
transition: { delay:
|
|
234
|
+
transition: h ? { duration: 0 } : { delay: M * 0.03 },
|
|
235
235
|
children: /* @__PURE__ */ e(
|
|
236
|
-
|
|
236
|
+
re,
|
|
237
237
|
{
|
|
238
238
|
notification: m,
|
|
239
|
-
onRead:
|
|
240
|
-
onNavigate:
|
|
241
|
-
getRoute:
|
|
239
|
+
onRead: E,
|
|
240
|
+
onNavigate: Y,
|
|
241
|
+
getRoute: K,
|
|
242
242
|
onDismiss: I
|
|
243
243
|
}
|
|
244
244
|
)
|
|
@@ -247,7 +247,7 @@ const se = $.forwardRef(
|
|
|
247
247
|
))
|
|
248
248
|
] }, s);
|
|
249
249
|
}),
|
|
250
|
-
c && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-ds-05", children: /* @__PURE__ */ e(
|
|
250
|
+
c && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-ds-05", children: /* @__PURE__ */ e(ee, {}) })
|
|
251
251
|
]
|
|
252
252
|
}
|
|
253
253
|
),
|
|
@@ -258,7 +258,7 @@ const se = $.forwardRef(
|
|
|
258
258
|
] });
|
|
259
259
|
}
|
|
260
260
|
);
|
|
261
|
-
|
|
261
|
+
ae.displayName = "NotificationCenter";
|
|
262
262
|
export {
|
|
263
|
-
|
|
263
|
+
ae as NotificationCenter
|
|
264
264
|
};
|
package/dist/shell/top-bar.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface UserMenuItem {
|
|
|
29
29
|
/** Whether the item is disabled */
|
|
30
30
|
disabled?: boolean;
|
|
31
31
|
}
|
|
32
|
-
interface TopBarRootProps extends React.HTMLAttributes<
|
|
32
|
+
interface TopBarRootProps extends React.HTMLAttributes<HTMLElement> {
|
|
33
33
|
children: React.ReactNode;
|
|
34
34
|
className?: string;
|
|
35
35
|
}
|
|
@@ -66,7 +66,7 @@ interface TopBarUserMenuProps {
|
|
|
66
66
|
className?: string;
|
|
67
67
|
}
|
|
68
68
|
export type TopBarProps = TopBarRootProps;
|
|
69
|
-
declare const TopBar: React.ForwardRefExoticComponent<TopBarRootProps & React.RefAttributes<
|
|
69
|
+
declare const TopBar: React.ForwardRefExoticComponent<TopBarRootProps & React.RefAttributes<HTMLElement>> & {
|
|
70
70
|
Left: React.ForwardRefExoticComponent<TopBarLeftProps & React.RefAttributes<HTMLDivElement>>;
|
|
71
71
|
Center: React.ForwardRefExoticComponent<TopBarCenterProps & React.RefAttributes<HTMLDivElement>>;
|
|
72
72
|
Right: React.ForwardRefExoticComponent<TopBarRightProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-bar.d.ts","sourceRoot":"","sources":["../../src/shell/top-bar.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;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;AAMD,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"top-bar.d.ts","sourceRoot":"","sources":["../../src/shell/top-bar.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;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;AAMD,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACjE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAgCD,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAmBD,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAmBD,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAmBD,QAAA,MAAM,MAAM;;;;CAIF,CAAA;AAEV,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE,GAAG,CAAC,EAAE,MAAM,OAAO,MAAM,CAAA;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAmBD,UAAU,qBACR,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;CAChB;AAkCD,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC;IACzE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAsBD,UAAU,mBAAmB;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAiJD,MAAM,MAAM,WAAW,GAAG,eAAe,CAAA;AAEzC,QAAA,MAAM,MAAM;;;;;;;;CAQV,CAAA;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
package/dist/shell/top-bar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
2
|
+
import { jsx as e, jsxs as n, Fragment as j } from "react/jsx-runtime";
|
|
3
3
|
import * as c from "react";
|
|
4
4
|
import { useColorMode as D } from "../hooks/use-color-mode.js";
|
|
5
5
|
import { Avatar as U, AvatarImage as z, AvatarFallback as A } from "../ui/avatar.js";
|
|
@@ -7,87 +7,88 @@ import { DropdownMenu as L, DropdownMenuTrigger as S, DropdownMenuContent as F,
|
|
|
7
7
|
import { Tooltip as h, TooltipTrigger as b, TooltipContent as N } from "../ui/tooltip.js";
|
|
8
8
|
import { IconUser as O, IconSun as _, IconMoon as E, IconLogout as P } from "@tabler/icons-react";
|
|
9
9
|
import { Icon as p } from "../ui/icon.js";
|
|
10
|
-
import { cn as
|
|
10
|
+
import { cn as d } from "../ui/lib/utils.js";
|
|
11
11
|
const w = c.forwardRef(
|
|
12
|
-
({ className: r, children:
|
|
13
|
-
const l = c.Children.toArray(
|
|
12
|
+
({ className: r, children: s, ...o }, t) => {
|
|
13
|
+
const l = c.Children.toArray(s).some(
|
|
14
14
|
(i) => c.isValidElement(i) && i.type === m
|
|
15
15
|
);
|
|
16
16
|
return /* @__PURE__ */ e(
|
|
17
|
-
"
|
|
17
|
+
"header",
|
|
18
18
|
{
|
|
19
19
|
...o,
|
|
20
20
|
ref: t,
|
|
21
|
-
className:
|
|
21
|
+
className: d(
|
|
22
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
23
|
l ? "grid grid-cols-[1fr_auto_1fr] items-center" : "flex items-center",
|
|
24
24
|
r
|
|
25
25
|
),
|
|
26
|
-
children:
|
|
26
|
+
children: s
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
w.displayName = "TopBar";
|
|
32
|
-
const
|
|
33
|
-
({ className: r, children:
|
|
32
|
+
const v = c.forwardRef(
|
|
33
|
+
({ className: r, children: s, ...o }, t) => /* @__PURE__ */ e(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
36
|
ref: t,
|
|
37
|
-
className:
|
|
37
|
+
className: d("flex items-center gap-ds-04", r),
|
|
38
38
|
...o,
|
|
39
|
-
children:
|
|
39
|
+
children: s
|
|
40
40
|
}
|
|
41
41
|
)
|
|
42
42
|
);
|
|
43
|
-
|
|
43
|
+
v.displayName = "TopBar.Left";
|
|
44
44
|
const m = c.forwardRef(
|
|
45
|
-
({ className: r, children:
|
|
45
|
+
({ className: r, children: s, ...o }, t) => /* @__PURE__ */ e(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
48
|
ref: t,
|
|
49
|
-
className:
|
|
49
|
+
className: d("flex items-center justify-center px-ds-04", r),
|
|
50
50
|
...o,
|
|
51
|
-
children:
|
|
51
|
+
children: s
|
|
52
52
|
}
|
|
53
53
|
)
|
|
54
54
|
);
|
|
55
55
|
m.displayName = "TopBar.Center";
|
|
56
|
-
const
|
|
57
|
-
({ className: r, children:
|
|
56
|
+
const y = c.forwardRef(
|
|
57
|
+
({ className: r, children: s, ...o }, t) => /* @__PURE__ */ e(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
60
|
ref: t,
|
|
61
|
-
className:
|
|
61
|
+
className: d("ml-auto flex items-center gap-ds-04", r),
|
|
62
62
|
...o,
|
|
63
|
-
children:
|
|
63
|
+
children: s
|
|
64
64
|
}
|
|
65
65
|
)
|
|
66
66
|
);
|
|
67
|
-
|
|
67
|
+
y.displayName = "TopBar.Right";
|
|
68
68
|
const V = {
|
|
69
69
|
tight: "gap-ds-02",
|
|
70
70
|
default: "gap-ds-04",
|
|
71
71
|
loose: "gap-ds-06"
|
|
72
|
-
},
|
|
73
|
-
({ gap: r = "default", className:
|
|
72
|
+
}, T = c.forwardRef(
|
|
73
|
+
({ gap: r = "default", className: s, children: o, ...t }, l) => /* @__PURE__ */ e(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
76
|
ref: l,
|
|
77
|
-
className:
|
|
77
|
+
className: d("flex items-center", V[r], s),
|
|
78
78
|
...t,
|
|
79
79
|
children: o
|
|
80
80
|
}
|
|
81
81
|
)
|
|
82
82
|
);
|
|
83
|
-
|
|
84
|
-
const B = c.forwardRef(({ icon: r, tooltip:
|
|
83
|
+
T.displayName = "TopBar.Section";
|
|
84
|
+
const B = c.forwardRef(({ icon: r, tooltip: s, className: o, ...t }, l) => /* @__PURE__ */ n(h, { children: [
|
|
85
85
|
/* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(
|
|
86
86
|
"button",
|
|
87
87
|
{
|
|
88
88
|
ref: l,
|
|
89
89
|
type: "button",
|
|
90
|
-
|
|
90
|
+
"aria-label": s,
|
|
91
|
+
className: d(
|
|
91
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",
|
|
92
93
|
o
|
|
93
94
|
),
|
|
@@ -95,36 +96,36 @@ const B = c.forwardRef(({ icon: r, tooltip: a, className: o, ...t }, l) => /* @_
|
|
|
95
96
|
children: /* @__PURE__ */ e("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm", "aria-hidden": "true", children: r })
|
|
96
97
|
}
|
|
97
98
|
) }),
|
|
98
|
-
/* @__PURE__ */ e(N, { side: "bottom", align: "center", children:
|
|
99
|
+
/* @__PURE__ */ e(N, { side: "bottom", align: "center", children: s })
|
|
99
100
|
] }));
|
|
100
101
|
B.displayName = "TopBar.IconButton";
|
|
101
102
|
const C = c.forwardRef(
|
|
102
|
-
({ className: r, children:
|
|
103
|
+
({ className: r, children: s, ...o }, t) => /* @__PURE__ */ e(
|
|
103
104
|
"h2",
|
|
104
105
|
{
|
|
105
106
|
ref: t,
|
|
106
|
-
className:
|
|
107
|
+
className: d(
|
|
107
108
|
"hidden text-ds-lg text-surface-fg md:block",
|
|
108
109
|
r
|
|
109
110
|
),
|
|
110
111
|
...o,
|
|
111
|
-
children:
|
|
112
|
+
children: s
|
|
112
113
|
}
|
|
113
114
|
)
|
|
114
115
|
);
|
|
115
116
|
C.displayName = "TopBar.Title";
|
|
116
117
|
const M = c.forwardRef(
|
|
117
|
-
({ user: r, onNavigate:
|
|
118
|
+
({ user: r, onNavigate: s, onLogout: o, userMenuItems: t, className: l }, i) => {
|
|
118
119
|
const { colorMode: u, toggleColorMode: k } = D();
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
return /* @__PURE__ */ n(L, { children: [
|
|
121
|
+
/* @__PURE__ */ n(h, { children: [
|
|
121
122
|
/* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
|
|
122
123
|
"button",
|
|
123
124
|
{
|
|
124
125
|
ref: i,
|
|
125
126
|
type: "button",
|
|
126
|
-
className:
|
|
127
|
-
children: /* @__PURE__ */
|
|
127
|
+
className: d("flex items-center gap-ds-03 outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2", l),
|
|
128
|
+
children: /* @__PURE__ */ n(U, { className: "h-ds-sm-plus w-ds-sm-plus cursor-pointer", children: [
|
|
128
129
|
r.image ? /* @__PURE__ */ e(z, { src: r.image, alt: r.name }) : null,
|
|
129
130
|
/* @__PURE__ */ e(A, { className: "bg-surface-raised-hover text-surface-fg", children: r.name?.charAt(0).toUpperCase() })
|
|
130
131
|
] })
|
|
@@ -132,67 +133,67 @@ const M = c.forwardRef(
|
|
|
132
133
|
) }) }),
|
|
133
134
|
/* @__PURE__ */ e(N, { side: "bottom", align: "center", children: "User Menu" })
|
|
134
135
|
] }),
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ n(
|
|
136
137
|
F,
|
|
137
138
|
{
|
|
138
139
|
className: "w-[200px] rounded-ds-xl border border-surface-border-strong bg-surface-overlay p-0 shadow-floating",
|
|
139
140
|
sideOffset: 8,
|
|
140
141
|
align: "end",
|
|
141
142
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ n("div", { className: "border-b border-surface-border-strong px-ds-05 py-ds-04", children: [
|
|
143
144
|
/* @__PURE__ */ e("p", { className: "text-ds-md text-surface-fg", children: r.name }),
|
|
144
145
|
r.email && /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-subtle truncate", children: r.email })
|
|
145
146
|
] }),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ n(
|
|
147
148
|
f,
|
|
148
149
|
{
|
|
149
150
|
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
|
|
150
|
-
onClick: () =>
|
|
151
|
+
onClick: () => s?.("/profile"),
|
|
151
152
|
children: [
|
|
152
153
|
/* @__PURE__ */ e(p, { icon: O, size: "sm", className: "text-surface-fg-muted" }),
|
|
153
154
|
/* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-muted", children: "Profile" })
|
|
154
155
|
]
|
|
155
156
|
}
|
|
156
157
|
),
|
|
157
|
-
t?.map((
|
|
158
|
+
t?.map((a, R) => {
|
|
158
159
|
const I = {
|
|
159
160
|
error: "text-error-11",
|
|
160
161
|
success: "text-success-11",
|
|
161
162
|
warning: "text-warning-11",
|
|
162
163
|
info: "text-info-11"
|
|
163
|
-
}, g =
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
|
|
166
|
-
/* @__PURE__ */
|
|
164
|
+
}, g = a.color ? I[a.color] ?? "text-surface-fg-muted" : "text-surface-fg-muted";
|
|
165
|
+
return /* @__PURE__ */ n(c.Fragment, { children: [
|
|
166
|
+
a.separator && /* @__PURE__ */ e(x, { className: "bg-surface-border" }),
|
|
167
|
+
/* @__PURE__ */ n(
|
|
167
168
|
f,
|
|
168
169
|
{
|
|
169
|
-
className:
|
|
170
|
+
className: d(
|
|
170
171
|
"flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
|
|
171
|
-
|
|
172
|
+
a.disabled && "pointer-events-none opacity-action-disabled"
|
|
172
173
|
),
|
|
173
|
-
disabled:
|
|
174
|
+
disabled: a.disabled,
|
|
174
175
|
onClick: () => {
|
|
175
|
-
|
|
176
|
+
a.disabled || (a.onClick ? a.onClick() : a.href && s?.(a.href));
|
|
176
177
|
},
|
|
177
178
|
children: [
|
|
178
|
-
|
|
179
|
+
a.icon && /* @__PURE__ */ e(
|
|
179
180
|
"span",
|
|
180
181
|
{
|
|
181
|
-
className:
|
|
182
|
+
className: d(
|
|
182
183
|
"[&>svg]:h-ico-sm [&>svg]:w-ico-sm",
|
|
183
184
|
g
|
|
184
185
|
),
|
|
185
|
-
children:
|
|
186
|
+
children: a.icon
|
|
186
187
|
}
|
|
187
188
|
),
|
|
188
|
-
/* @__PURE__ */ e("span", { className:
|
|
189
|
-
|
|
189
|
+
/* @__PURE__ */ e("span", { className: d("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" }))
|
|
190
191
|
]
|
|
191
192
|
}
|
|
192
193
|
)
|
|
193
|
-
] },
|
|
194
|
+
] }, a.label + R);
|
|
194
195
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ n(
|
|
196
197
|
f,
|
|
197
198
|
{
|
|
198
199
|
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
|
|
@@ -203,9 +204,9 @@ const M = c.forwardRef(
|
|
|
203
204
|
]
|
|
204
205
|
}
|
|
205
206
|
),
|
|
206
|
-
o && /* @__PURE__ */
|
|
207
|
+
o && /* @__PURE__ */ n(j, { children: [
|
|
207
208
|
/* @__PURE__ */ e(x, { className: "bg-surface-border" }),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ n(
|
|
209
210
|
f,
|
|
210
211
|
{
|
|
211
212
|
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-surface-raised",
|
|
@@ -225,10 +226,10 @@ const M = c.forwardRef(
|
|
|
225
226
|
);
|
|
226
227
|
M.displayName = "TopBar.UserMenu";
|
|
227
228
|
const Y = Object.assign(w, {
|
|
228
|
-
Left:
|
|
229
|
+
Left: v,
|
|
229
230
|
Center: m,
|
|
230
|
-
Right:
|
|
231
|
-
Section:
|
|
231
|
+
Right: y,
|
|
232
|
+
Section: T,
|
|
232
233
|
IconButton: B,
|
|
233
234
|
Title: C,
|
|
234
235
|
UserMenu: M
|