@devalok/shilp-sutra 0.6.2 → 0.8.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/dist/_virtual/client.js +5 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/react-dom-client.development.js +5 -0
- package/dist/_virtual/react-dom-client.production.js +5 -0
- package/dist/_virtual/scheduler.development.js +5 -0
- package/dist/_virtual/scheduler.production.js +5 -0
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +84 -73
- package/dist/composed/confirm-dialog.d.ts +27 -0
- package/dist/composed/confirm-dialog.d.ts.map +1 -0
- package/dist/composed/confirm-dialog.js +45 -0
- package/dist/composed/extensions/emoji-suggestion.d.ts +9 -0
- package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -0
- package/dist/composed/extensions/emoji-suggestion.js +119 -0
- package/dist/composed/extensions/file-attachment.d.ts +4 -0
- package/dist/composed/extensions/file-attachment.d.ts.map +1 -0
- package/dist/composed/extensions/file-attachment.js +55 -0
- package/dist/composed/extensions/mention-suggestion.d.ts +10 -0
- package/dist/composed/extensions/mention-suggestion.d.ts.map +1 -0
- package/dist/composed/extensions/mention-suggestion.js +79 -0
- package/dist/composed/index.d.ts +3 -1
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +28 -26
- package/dist/composed/rich-text-editor.d.ts +19 -0
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +347 -176
- package/dist/composed/status-badge.d.ts +11 -1
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +48 -20
- package/dist/hooks/use-color-mode.d.ts.map +1 -1
- package/dist/hooks/use-color-mode.js +8 -4
- package/dist/hooks/use-mobile.d.ts +5 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/node_modules/.pnpm/@emoji-mart_data@1.2.1/node_modules/@emoji-mart/data/sets/15/native.json.js +40141 -0
- package/dist/node_modules/.pnpm/@emoji-mart_react@1.1.1_emoji-mart@5.6.0_react@19.2.4/node_modules/@emoji-mart/react/dist/module.js +17 -0
- package/dist/node_modules/.pnpm/emoji-mart@5.6.0/node_modules/emoji-mart/dist/module.js +2958 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.development.js +17062 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/cjs/react-dom-client.production.js +9790 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.4_react@19.2.4/node_modules/react-dom/client.js +20 -0
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.development.js +237 -0
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js +234 -0
- package/dist/node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/index.js +11 -0
- package/dist/primitives/_internal/react-arrow.js +8 -19
- package/dist/primitives/_internal/react-compose-refs.js +14 -14
- package/dist/primitives/_internal/react-context.js +41 -39
- package/dist/primitives/_internal/react-dismissable-layer.js +62 -90
- package/dist/primitives/_internal/react-popper.js +107 -169
- package/dist/primitives/_internal/react-portal.js +1 -1
- package/dist/primitives/_internal/react-primitive.js +1 -1
- package/dist/primitives/_internal/react-use-size.js +8 -8
- package/dist/primitives/react-slot.js +12 -12
- package/dist/shell/app-command-palette.d.ts +3 -1
- package/dist/shell/app-command-palette.d.ts.map +1 -1
- package/dist/shell/app-command-palette.js +35 -34
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +31 -31
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/notification-center.d.ts +10 -0
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +129 -117
- package/dist/shell/top-bar.d.ts +20 -0
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +100 -70
- package/dist/tailwind/index.cjs +3 -0
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +3 -0
- package/dist/tokens/semantic.css +10 -1
- package/dist/ui/alert.js +42 -63
- package/dist/ui/avatar.js +20 -62
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +89 -112
- package/dist/ui/banner.js +12 -12
- package/dist/ui/button-group.js +14 -29
- package/dist/ui/button.js +64 -108
- package/dist/ui/card.js +18 -62
- package/dist/ui/checkbox.js +1 -21
- package/dist/ui/chip.d.ts.map +1 -1
- package/dist/ui/chip.js +1 -1
- package/dist/ui/color-input.d.ts +17 -0
- package/dist/ui/color-input.d.ts.map +1 -0
- package/dist/ui/color-input.js +88 -0
- package/dist/ui/combobox.d.ts +20 -11
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/dialog.js +9 -9
- package/dist/ui/form.js +14 -35
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +314 -312
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +31 -56
- package/dist/ui/label.js +1 -15
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +39 -35
- package/dist/ui/popover.js +6 -6
- package/dist/ui/separator.js +4 -19
- package/dist/ui/sheet.js +21 -21
- package/dist/ui/spinner.js +1 -36
- package/dist/ui/switch.js +1 -20
- package/dist/ui/tabs.js +20 -47
- package/dist/ui/textarea.d.ts.map +1 -1
- package/dist/ui/textarea.js +30 -24
- package/dist/ui/toast.js +18 -18
- package/dist/ui/tooltip.js +6 -17
- package/llms-full.txt +123 -13
- package/llms.txt +9 -6
- package/package.json +80 -11
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { Popover as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { IconBell as
|
|
2
|
+
import { jsxs as r, jsx as t, Fragment as S } from "react/jsx-runtime";
|
|
3
|
+
import * as H from "react";
|
|
4
|
+
import { useRef as z, useCallback as b } from "react";
|
|
5
|
+
import { Popover as B, PopoverTrigger as G, PopoverContent as L } from "../ui/popover.js";
|
|
6
|
+
import { Tooltip as O, TooltipTrigger as X, TooltipContent as _ } from "../ui/tooltip.js";
|
|
7
|
+
import { IconBell as q, IconChecks as F, IconInbox as J, IconX as Q } from "@tabler/icons-react";
|
|
8
8
|
import { cn as x } from "../ui/lib/utils.js";
|
|
9
|
-
function
|
|
10
|
-
const l = Date.now(),
|
|
11
|
-
return c < 60 ? "just now" :
|
|
9
|
+
function U(e) {
|
|
10
|
+
const l = Date.now(), i = new Date(e).getTime(), d = l - i, c = Math.floor(d / 1e3), n = Math.floor(c / 60), a = Math.floor(n / 60), m = Math.floor(a / 24);
|
|
11
|
+
return c < 60 ? "just now" : n < 60 ? `${n}m ago` : a < 24 ? `${a}h ago` : m < 7 ? `${m}d ago` : new Date(e).toLocaleDateString(void 0, {
|
|
12
12
|
day: "numeric",
|
|
13
13
|
month: "short"
|
|
14
14
|
});
|
|
@@ -16,50 +16,36 @@ function L(e) {
|
|
|
16
16
|
function N(e, l) {
|
|
17
17
|
return e.getFullYear() === l.getFullYear() && e.getMonth() === l.getMonth() && e.getDate() === l.getDate();
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const l = new Date(e),
|
|
21
|
-
return d.setDate(
|
|
19
|
+
function V(e) {
|
|
20
|
+
const l = new Date(e), i = /* @__PURE__ */ new Date(), d = /* @__PURE__ */ new Date();
|
|
21
|
+
return d.setDate(i.getDate() - 1), N(l, i) ? "Today" : N(l, d) ? "Yesterday" : "Earlier";
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const v = {
|
|
24
24
|
INFO: "bg-info",
|
|
25
25
|
IMPORTANT: "bg-warning",
|
|
26
26
|
CRITICAL: "bg-error"
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
if (!e.entityType) return null;
|
|
30
|
-
switch (e.entityType) {
|
|
31
|
-
case "TASK":
|
|
32
|
-
return e.projectId ? `/projects/${e.projectId}/board` : null;
|
|
33
|
-
case "BREAK_REQUEST":
|
|
34
|
-
return "/breaks";
|
|
35
|
-
case "ATTENDANCE":
|
|
36
|
-
return "/attendance";
|
|
37
|
-
case "CLIENT_REQUEST":
|
|
38
|
-
return e.projectId ? `/projects/${e.projectId}/requests` : null;
|
|
39
|
-
case "REVIEW_REQUEST":
|
|
40
|
-
return e.projectId ? `/projects/${e.projectId}/board` : null;
|
|
41
|
-
case "PROJECT":
|
|
42
|
-
return e.projectId ? `/projects/${e.projectId}/board` : "/projects";
|
|
43
|
-
default:
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function z({
|
|
28
|
+
function W({
|
|
48
29
|
notification: e,
|
|
49
30
|
onRead: l,
|
|
50
|
-
onNavigate:
|
|
51
|
-
getRoute: d
|
|
31
|
+
onNavigate: i,
|
|
32
|
+
getRoute: d,
|
|
33
|
+
onDismiss: c
|
|
52
34
|
}) {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
const n = d(e), a = () => {
|
|
36
|
+
e.isRead || l(e.id), n && i(n);
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ r(
|
|
39
|
+
"div",
|
|
56
40
|
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
role: "button",
|
|
42
|
+
tabIndex: 0,
|
|
43
|
+
onClick: a,
|
|
44
|
+
onKeyDown: (o) => {
|
|
45
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), a());
|
|
60
46
|
},
|
|
61
47
|
className: x(
|
|
62
|
-
"flex w-full items-start gap-ds-04 px-ds-05 py-ds-04 text-left transition-colors",
|
|
48
|
+
"group relative flex w-full cursor-pointer items-start gap-ds-04 px-ds-05 py-ds-04 text-left transition-colors",
|
|
63
49
|
"hover:bg-layer-02",
|
|
64
50
|
!e.isRead && "bg-interactive/[0.03]"
|
|
65
51
|
),
|
|
@@ -69,12 +55,12 @@ function z({
|
|
|
69
55
|
{
|
|
70
56
|
className: x(
|
|
71
57
|
"h-[8px] w-[8px] rounded-ds-full",
|
|
72
|
-
|
|
58
|
+
v[e.tier] || v.INFO,
|
|
73
59
|
e.isRead && "opacity-[0.38]"
|
|
74
60
|
)
|
|
75
61
|
}
|
|
76
62
|
) }),
|
|
77
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
78
64
|
/* @__PURE__ */ t(
|
|
79
65
|
"p",
|
|
80
66
|
{
|
|
@@ -86,138 +72,164 @@ function z({
|
|
|
86
72
|
}
|
|
87
73
|
),
|
|
88
74
|
e.body && /* @__PURE__ */ t("p", { className: "mt-ds-01 line-clamp-2 text-ds-sm text-text-placeholder", children: e.body }),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */ t("span", { className: "text-ds-sm text-text-placeholder", children:
|
|
91
|
-
e.project && /* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ r("div", { className: "mt-ds-02 flex items-center gap-ds-03", children: [
|
|
76
|
+
/* @__PURE__ */ t("span", { className: "text-ds-sm text-text-placeholder", children: U(e.createdAt) }),
|
|
77
|
+
e.project && /* @__PURE__ */ r(S, { children: [
|
|
92
78
|
/* @__PURE__ */ t("span", { className: "text-text-placeholder", children: "·" }),
|
|
93
79
|
/* @__PURE__ */ t("span", { className: "truncate text-ds-sm text-text-placeholder", children: e.project.title })
|
|
94
80
|
] })
|
|
95
81
|
] })
|
|
96
82
|
] }),
|
|
97
|
-
!e.isRead && /* @__PURE__ */ t("div", { className: "mt-ds-02b shrink-0", children: /* @__PURE__ */ t("span", { className: "block h-[8px] w-[8px] rounded-ds-full bg-interactive" }) })
|
|
83
|
+
!e.isRead && /* @__PURE__ */ t("div", { className: "mt-ds-02b shrink-0", children: /* @__PURE__ */ t("span", { className: "block h-[8px] w-[8px] rounded-ds-full bg-interactive" }) }),
|
|
84
|
+
c && /* @__PURE__ */ t(
|
|
85
|
+
"button",
|
|
86
|
+
{
|
|
87
|
+
type: "button",
|
|
88
|
+
"aria-label": `Dismiss notification: ${e.title}`,
|
|
89
|
+
onClick: (o) => {
|
|
90
|
+
o.stopPropagation(), c(e.id);
|
|
91
|
+
},
|
|
92
|
+
onKeyDown: (o) => o.stopPropagation(),
|
|
93
|
+
className: "absolute right-ds-03 top-ds-03 hidden rounded-ds-sm p-ds-01 text-text-placeholder hover:bg-layer-03 hover:text-text-secondary group-hover:flex group-focus-within:flex",
|
|
94
|
+
children: /* @__PURE__ */ t(Q, { className: "h-ico-sm w-ico-sm" })
|
|
95
|
+
}
|
|
96
|
+
)
|
|
98
97
|
]
|
|
99
98
|
}
|
|
100
99
|
);
|
|
101
100
|
}
|
|
102
|
-
const
|
|
101
|
+
const Z = H.forwardRef(
|
|
103
102
|
({
|
|
104
103
|
notifications: e = [],
|
|
105
104
|
unreadCount: l,
|
|
106
|
-
open:
|
|
105
|
+
open: i,
|
|
107
106
|
onOpenChange: d,
|
|
108
107
|
isLoading: c = !1,
|
|
109
|
-
hasMore:
|
|
110
|
-
onFetchMore:
|
|
108
|
+
hasMore: n = !1,
|
|
109
|
+
onFetchMore: a,
|
|
111
110
|
onMarkRead: m,
|
|
112
|
-
onMarkAllRead:
|
|
113
|
-
onNavigate:
|
|
111
|
+
onMarkAllRead: o,
|
|
112
|
+
onNavigate: f,
|
|
114
113
|
getNotificationRoute: w,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
onDismiss: D,
|
|
115
|
+
headerActions: I,
|
|
116
|
+
emptyState: T,
|
|
117
|
+
footerSlot: g,
|
|
118
|
+
popoverClassName: j,
|
|
119
|
+
className: C,
|
|
120
|
+
...R
|
|
121
|
+
}, k) => {
|
|
122
|
+
const y = z(null), u = l ?? e.filter((s) => !s.isRead).length, P = w ?? (() => null), Y = b(
|
|
123
|
+
(s) => {
|
|
124
|
+
d == null || d(!1), f == null || f(s);
|
|
121
125
|
},
|
|
122
|
-
[
|
|
123
|
-
),
|
|
124
|
-
(
|
|
125
|
-
m == null || m(
|
|
126
|
+
[f, d]
|
|
127
|
+
), $ = b(
|
|
128
|
+
(s) => {
|
|
129
|
+
m == null || m(s);
|
|
126
130
|
},
|
|
127
131
|
[m]
|
|
128
|
-
),
|
|
129
|
-
const
|
|
130
|
-
!
|
|
131
|
-
}, [c,
|
|
132
|
-
(
|
|
133
|
-
const p =
|
|
134
|
-
return
|
|
132
|
+
), A = b(() => {
|
|
133
|
+
const s = y.current;
|
|
134
|
+
!s || c || !n || s.scrollTop + s.clientHeight >= s.scrollHeight - 50 && (a == null || a());
|
|
135
|
+
}, [c, n, a]), E = e.reduce(
|
|
136
|
+
(s, h) => {
|
|
137
|
+
const p = V(h.createdAt);
|
|
138
|
+
return s[p] || (s[p] = []), s[p].push(h), s;
|
|
135
139
|
},
|
|
136
140
|
{}
|
|
137
|
-
),
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */ t(
|
|
141
|
+
), K = ["Today", "Yesterday", "Earlier"];
|
|
142
|
+
return /* @__PURE__ */ r(B, { open: i, onOpenChange: d, children: [
|
|
143
|
+
/* @__PURE__ */ r(O, { children: [
|
|
144
|
+
/* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ r(
|
|
141
145
|
"button",
|
|
142
146
|
{
|
|
143
|
-
...
|
|
144
|
-
ref:
|
|
145
|
-
"aria-label":
|
|
147
|
+
...R,
|
|
148
|
+
ref: k,
|
|
149
|
+
"aria-label": u > 0 ? `Notifications, ${u} unread` : "Notifications",
|
|
146
150
|
className: x(
|
|
147
151
|
"relative flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-border bg-layer-02 text-text-secondary transition-colors hover:bg-layer-03",
|
|
148
|
-
|
|
152
|
+
C
|
|
149
153
|
),
|
|
150
154
|
children: [
|
|
151
|
-
/* @__PURE__ */ t(
|
|
152
|
-
|
|
155
|
+
/* @__PURE__ */ t(q, { className: "h-ico-sm w-ico-sm", "aria-hidden": "true" }),
|
|
156
|
+
u > 0 && /* @__PURE__ */ t("span", { className: "absolute -right-ds-01 -top-ds-01 flex h-4 min-w-4 items-center justify-center rounded-ds-full bg-interactive px-ds-02 text-ds-xs font-semibold text-text-on-color", children: u > 99 ? "99+" : u })
|
|
153
157
|
]
|
|
154
158
|
}
|
|
155
159
|
) }) }),
|
|
156
|
-
/* @__PURE__ */ t(
|
|
160
|
+
/* @__PURE__ */ t(_, { side: "bottom", align: "center", children: "Notifications" })
|
|
157
161
|
] }),
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
|
|
162
|
+
/* @__PURE__ */ r(
|
|
163
|
+
L,
|
|
160
164
|
{
|
|
161
|
-
className:
|
|
165
|
+
className: x(
|
|
166
|
+
"w-[380px] rounded-ds-xl border border-border bg-layer-01 p-0 shadow-03",
|
|
167
|
+
j
|
|
168
|
+
),
|
|
162
169
|
sideOffset: 8,
|
|
163
170
|
align: "end",
|
|
164
171
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b border-border px-ds-05 py-ds-04", children: [
|
|
173
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-ds-03", children: [
|
|
167
174
|
/* @__PURE__ */ t("h3", { className: "text-ds-md font-semibold text-text-primary", children: "Notifications" }),
|
|
168
|
-
|
|
175
|
+
u > 0 && /* @__PURE__ */ t("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-ds-full bg-interactive/10 px-ds-02b text-ds-sm font-semibold text-interactive", children: u })
|
|
169
176
|
] }),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
177
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-ds-03", children: [
|
|
178
|
+
u > 0 && o && /* @__PURE__ */ r(
|
|
179
|
+
"button",
|
|
180
|
+
{
|
|
181
|
+
type: "button",
|
|
182
|
+
onClick: o,
|
|
183
|
+
className: "flex items-center gap-ds-02 text-ds-sm text-text-placeholder transition-colors hover:text-interactive",
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ t(F, { className: "h-ico-sm w-ico-sm" }),
|
|
186
|
+
"Mark all read"
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
I
|
|
191
|
+
] })
|
|
182
192
|
] }),
|
|
183
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ r(
|
|
184
194
|
"div",
|
|
185
195
|
{
|
|
186
196
|
ref: y,
|
|
187
|
-
onScroll:
|
|
197
|
+
onScroll: A,
|
|
188
198
|
className: "max-h-[420px] overflow-y-auto",
|
|
189
199
|
children: [
|
|
190
|
-
e.length === 0 ? /* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */ t("div", { className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-layer-02", children: /* @__PURE__ */ t(
|
|
200
|
+
e.length === 0 ? T || /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center px-ds-05 py-ds-09", children: [
|
|
201
|
+
/* @__PURE__ */ t("div", { className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-layer-02", children: /* @__PURE__ */ t(J, { className: "h-ico-lg w-ico-lg text-text-placeholder" }) }),
|
|
192
202
|
/* @__PURE__ */ t("p", { className: "mt-ds-04 text-ds-md text-text-placeholder", children: "No notifications yet" }),
|
|
193
203
|
/* @__PURE__ */ t("p", { className: "mt-ds-02 text-ds-sm text-text-placeholder", children: "You're all caught up!" })
|
|
194
|
-
] }) :
|
|
195
|
-
const
|
|
196
|
-
return !
|
|
197
|
-
/* @__PURE__ */ t("div", { className: "sticky top-0 z-raised bg-layer-01 px-ds-05 py-ds-02b", children: /* @__PURE__ */ t("span", { className: "text-ds-sm font-medium text-text-placeholder", children:
|
|
198
|
-
|
|
199
|
-
|
|
204
|
+
] }) : K.map((s) => {
|
|
205
|
+
const h = E[s];
|
|
206
|
+
return !h || h.length === 0 ? null : /* @__PURE__ */ r("div", { children: [
|
|
207
|
+
/* @__PURE__ */ t("div", { className: "sticky top-0 z-raised bg-layer-01 px-ds-05 py-ds-02b", children: /* @__PURE__ */ t("span", { className: "text-ds-sm font-medium text-text-placeholder", children: s }) }),
|
|
208
|
+
h.map((p) => /* @__PURE__ */ t(
|
|
209
|
+
W,
|
|
200
210
|
{
|
|
201
211
|
notification: p,
|
|
202
|
-
onRead:
|
|
203
|
-
onNavigate:
|
|
204
|
-
getRoute:
|
|
212
|
+
onRead: $,
|
|
213
|
+
onNavigate: Y,
|
|
214
|
+
getRoute: P,
|
|
215
|
+
onDismiss: D
|
|
205
216
|
},
|
|
206
217
|
p.id
|
|
207
218
|
))
|
|
208
|
-
] },
|
|
219
|
+
] }, s);
|
|
209
220
|
}),
|
|
210
221
|
c && /* @__PURE__ */ t("div", { className: "flex items-center justify-center py-ds-05", children: /* @__PURE__ */ t("div", { className: "h-ico-md w-ico-md animate-spin rounded-ds-full border-2 border-border border-t-interactive" }) })
|
|
211
222
|
]
|
|
212
223
|
}
|
|
213
|
-
)
|
|
224
|
+
),
|
|
225
|
+
g && /* @__PURE__ */ t("div", { className: "border-t border-border px-ds-05 py-ds-03", children: g })
|
|
214
226
|
]
|
|
215
227
|
}
|
|
216
228
|
)
|
|
217
229
|
] });
|
|
218
230
|
}
|
|
219
231
|
);
|
|
220
|
-
|
|
232
|
+
Z.displayName = "NotificationCenter";
|
|
221
233
|
export {
|
|
222
|
-
|
|
234
|
+
Z as NotificationCenter
|
|
223
235
|
};
|
package/dist/shell/top-bar.d.ts
CHANGED
|
@@ -9,6 +9,24 @@ export interface TopBarUser {
|
|
|
9
9
|
email?: string;
|
|
10
10
|
image?: string | null;
|
|
11
11
|
}
|
|
12
|
+
export interface UserMenuItem {
|
|
13
|
+
/** Display label */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Optional icon (ReactNode) */
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
/** Navigate via onNavigate when clicked */
|
|
18
|
+
href?: string;
|
|
19
|
+
/** Custom click handler */
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
/** Render a separator before this item */
|
|
22
|
+
separator?: boolean;
|
|
23
|
+
/** Text color semantic token (e.g. "error") — maps to text-{color} */
|
|
24
|
+
color?: string;
|
|
25
|
+
/** Badge content — string for count, true for dot indicator */
|
|
26
|
+
badge?: string | boolean;
|
|
27
|
+
/** Whether the item is disabled */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
}
|
|
12
30
|
export interface TopBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
31
|
/** Page title displayed on desktop */
|
|
14
32
|
pageTitle?: string;
|
|
@@ -26,6 +44,8 @@ export interface TopBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
26
44
|
mobileLogo?: React.ReactNode;
|
|
27
45
|
/** Notification center slot -- render your NotificationCenter here */
|
|
28
46
|
notificationSlot?: React.ReactNode;
|
|
47
|
+
/** Custom menu items rendered between Profile and Dark/Light Mode */
|
|
48
|
+
userMenuItems?: UserMenuItem[];
|
|
29
49
|
/** Additional className */
|
|
30
50
|
className?: string;
|
|
31
51
|
}
|
|
@@ -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,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,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,mCAAmC;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAClC,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAMD,QAAA,MAAM,MAAM,
|
|
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,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,mCAAmC;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAClC,qEAAqE;IACrE,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;IAC9B,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAMD,QAAA,MAAM,MAAM,oFAwOX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
package/dist/shell/top-bar.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { useColorMode as
|
|
5
|
-
import { Avatar as
|
|
6
|
-
import { DropdownMenu as
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import { SidebarTrigger as
|
|
9
|
-
import { IconSearch as
|
|
10
|
-
import { cn as
|
|
11
|
-
const
|
|
2
|
+
import { jsxs as s, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
3
|
+
import * as g 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 d, DropdownMenuSeparator as w } from "../ui/dropdown-menu.js";
|
|
7
|
+
import { Tooltip as c, 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 o } from "../ui/lib/utils.js";
|
|
11
|
+
const H = g.forwardRef(
|
|
12
12
|
({
|
|
13
|
-
pageTitle:
|
|
14
|
-
user:
|
|
15
|
-
onNavigate:
|
|
16
|
-
onLogout:
|
|
17
|
-
onSearchClick:
|
|
18
|
-
onAiChatClick:
|
|
19
|
-
mobileLogo:
|
|
20
|
-
notificationSlot:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
pageTitle: m = "",
|
|
14
|
+
user: l,
|
|
15
|
+
onNavigate: t,
|
|
16
|
+
onLogout: p,
|
|
17
|
+
onSearchClick: h,
|
|
18
|
+
onAiChatClick: x,
|
|
19
|
+
mobileLogo: b,
|
|
20
|
+
notificationSlot: N,
|
|
21
|
+
userMenuItems: a,
|
|
22
|
+
className: C,
|
|
23
|
+
...k
|
|
24
|
+
}, v) => {
|
|
25
|
+
var u;
|
|
26
|
+
const { colorMode: f, toggleColorMode: M } = j(), S = () => {
|
|
27
|
+
h ? h() : document.dispatchEvent(
|
|
27
28
|
new KeyboardEvent("keydown", {
|
|
28
29
|
key: "k",
|
|
29
30
|
ctrlKey: !0,
|
|
@@ -31,99 +32,128 @@ const L = C.forwardRef(
|
|
|
31
32
|
})
|
|
32
33
|
);
|
|
33
34
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ s(
|
|
35
36
|
"div",
|
|
36
37
|
{
|
|
37
|
-
...
|
|
38
|
-
ref:
|
|
39
|
-
className:
|
|
38
|
+
...k,
|
|
39
|
+
ref: v,
|
|
40
|
+
className: o(
|
|
40
41
|
"z-sticky flex w-full items-center border-b border-border bg-layer-01 px-ds-05 py-ds-04 md:px-ds-06",
|
|
41
|
-
|
|
42
|
+
C
|
|
42
43
|
),
|
|
43
44
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */ e(
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-04", children: [
|
|
46
|
+
/* @__PURE__ */ e(R, { className: "hidden text-text-secondary md:flex" }),
|
|
47
|
+
b && /* @__PURE__ */ e("div", { className: "md:hidden", children: b }),
|
|
48
|
+
m && /* @__PURE__ */ e("h2", { className: "hidden text-ds-lg text-text-primary md:block", children: m })
|
|
48
49
|
] }),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */ e(
|
|
50
|
+
/* @__PURE__ */ s("div", { className: "ml-auto flex items-center gap-ds-03 md:gap-ds-05", children: [
|
|
51
|
+
/* @__PURE__ */ s(c, { children: [
|
|
52
|
+
/* @__PURE__ */ e(n, { asChild: !0, children: /* @__PURE__ */ e(
|
|
52
53
|
"button",
|
|
53
54
|
{
|
|
54
55
|
type: "button",
|
|
55
|
-
onClick:
|
|
56
|
+
onClick: S,
|
|
56
57
|
"aria-label": "Search (Ctrl+K)",
|
|
57
58
|
className: "flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-border bg-layer-02 text-text-secondary transition-colors hover:bg-layer-03",
|
|
58
|
-
children: /* @__PURE__ */ e(
|
|
59
|
+
children: /* @__PURE__ */ e(z, { className: "h-ico-sm w-ico-sm", "aria-hidden": "true" })
|
|
59
60
|
}
|
|
60
61
|
) }),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
+
/* @__PURE__ */ e(i, { side: "bottom", align: "center", children: "Search (Ctrl+K)" })
|
|
62
63
|
] }),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */ e(
|
|
64
|
+
N,
|
|
65
|
+
x && /* @__PURE__ */ s(c, { children: [
|
|
66
|
+
/* @__PURE__ */ e(n, { asChild: !0, children: /* @__PURE__ */ e(
|
|
66
67
|
"button",
|
|
67
68
|
{
|
|
68
69
|
type: "button",
|
|
69
|
-
onClick:
|
|
70
|
+
onClick: x,
|
|
70
71
|
"aria-label": "AI Chat",
|
|
71
72
|
className: "flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-full border border-border bg-layer-02 text-text-secondary transition-colors hover:bg-layer-03",
|
|
72
|
-
children: /* @__PURE__ */ e(
|
|
73
|
+
children: /* @__PURE__ */ e(L, { className: "h-ico-sm w-ico-sm", "aria-hidden": "true" })
|
|
73
74
|
}
|
|
74
75
|
) }),
|
|
75
|
-
/* @__PURE__ */ e(
|
|
76
|
+
/* @__PURE__ */ e(i, { side: "bottom", align: "center", children: "AI Chat" })
|
|
76
77
|
] }),
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */ e(
|
|
80
|
-
|
|
81
|
-
/* @__PURE__ */ e(
|
|
78
|
+
l && /* @__PURE__ */ s(U, { children: [
|
|
79
|
+
/* @__PURE__ */ s(c, { 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
|
+
l.image ? /* @__PURE__ */ e(K, { src: l.image, alt: l.name }) : null,
|
|
82
|
+
/* @__PURE__ */ e(F, { className: "bg-layer-02 text-text-primary", children: (u = l.name) == null ? void 0 : u.charAt(0).toUpperCase() })
|
|
82
83
|
] }) }) }) }),
|
|
83
|
-
/* @__PURE__ */ e(
|
|
84
|
+
/* @__PURE__ */ e(i, { side: "bottom", align: "center", children: "User Menu" })
|
|
84
85
|
] }),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
86
|
+
/* @__PURE__ */ s(
|
|
87
|
+
E,
|
|
87
88
|
{
|
|
88
89
|
className: "w-[200px] rounded-ds-xl border border-border bg-layer-01 p-0 shadow-03",
|
|
89
90
|
sideOffset: 8,
|
|
90
91
|
align: "end",
|
|
91
92
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */ e("p", { className: "text-ds-md text-text-primary", children:
|
|
94
|
-
|
|
93
|
+
/* @__PURE__ */ s("div", { className: "border-b border-border px-ds-05 py-ds-04", children: [
|
|
94
|
+
/* @__PURE__ */ e("p", { className: "text-ds-md text-text-primary", children: l.name }),
|
|
95
|
+
l.email && /* @__PURE__ */ e("p", { className: "text-ds-sm text-text-placeholder", children: l.email })
|
|
95
96
|
] }),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ s(
|
|
97
98
|
d,
|
|
98
99
|
{
|
|
99
100
|
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-layer-02",
|
|
100
|
-
onClick: () =>
|
|
101
|
+
onClick: () => t == null ? void 0 : t("/profile"),
|
|
101
102
|
children: [
|
|
102
|
-
/* @__PURE__ */ e(
|
|
103
|
+
/* @__PURE__ */ e(O, { className: "h-ico-sm w-ico-sm text-text-secondary" }),
|
|
103
104
|
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-secondary", children: "Profile" })
|
|
104
105
|
]
|
|
105
106
|
}
|
|
106
107
|
),
|
|
107
|
-
|
|
108
|
+
a == null ? void 0 : a.map((r, T) => {
|
|
109
|
+
const D = {
|
|
110
|
+
error: "text-error",
|
|
111
|
+
success: "text-success",
|
|
112
|
+
warning: "text-warning",
|
|
113
|
+
info: "text-info"
|
|
114
|
+
}, y = r.color ? D[r.color] ?? "text-text-secondary" : "text-text-secondary";
|
|
115
|
+
return /* @__PURE__ */ s(g.Fragment, { children: [
|
|
116
|
+
r.separator && /* @__PURE__ */ e(w, { className: "bg-border" }),
|
|
117
|
+
/* @__PURE__ */ s(
|
|
118
|
+
d,
|
|
119
|
+
{
|
|
120
|
+
className: o(
|
|
121
|
+
"flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-layer-02",
|
|
122
|
+
r.disabled && "pointer-events-none opacity-[0.38]"
|
|
123
|
+
),
|
|
124
|
+
disabled: r.disabled,
|
|
125
|
+
onClick: () => {
|
|
126
|
+
r.disabled || (r.onClick ? r.onClick() : r.href && (t == null || t(r.href)));
|
|
127
|
+
},
|
|
128
|
+
children: [
|
|
129
|
+
r.icon && /* @__PURE__ */ e("span", { className: o("[&>svg]:h-ico-sm [&>svg]:w-ico-sm", y), children: r.icon }),
|
|
130
|
+
/* @__PURE__ */ e("span", { className: o("text-ds-md", y), 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 px-ds-02 text-[10px] font-semibold leading-none text-text-on-color", children: r.badge }) : /* @__PURE__ */ e("span", { className: "ml-auto h-[8px] w-[8px] rounded-ds-full bg-error" }))
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] }, r.label + T);
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ s(
|
|
108
138
|
d,
|
|
109
139
|
{
|
|
110
140
|
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-layer-02",
|
|
111
|
-
onClick:
|
|
141
|
+
onClick: M,
|
|
112
142
|
children: [
|
|
113
|
-
|
|
114
|
-
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-secondary", children:
|
|
143
|
+
f === "dark" ? /* @__PURE__ */ e(P, { className: "h-ico-sm w-ico-sm text-text-secondary" }) : /* @__PURE__ */ e(q, { className: "h-ico-sm w-ico-sm text-text-secondary" }),
|
|
144
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-secondary", children: f === "dark" ? "Light Mode" : "Dark Mode" })
|
|
115
145
|
]
|
|
116
146
|
}
|
|
117
147
|
),
|
|
118
|
-
|
|
119
|
-
/* @__PURE__ */ e(
|
|
120
|
-
/* @__PURE__ */
|
|
148
|
+
p && /* @__PURE__ */ s(I, { children: [
|
|
149
|
+
/* @__PURE__ */ e(w, { className: "bg-border" }),
|
|
150
|
+
/* @__PURE__ */ s(
|
|
121
151
|
d,
|
|
122
152
|
{
|
|
123
153
|
className: "flex w-full cursor-pointer items-center gap-ds-03 px-ds-05 py-ds-04 hover:bg-layer-02",
|
|
124
|
-
onClick:
|
|
154
|
+
onClick: p,
|
|
125
155
|
children: [
|
|
126
|
-
/* @__PURE__ */ e(
|
|
156
|
+
/* @__PURE__ */ e(G, { className: "h-ico-sm w-ico-sm text-error" }),
|
|
127
157
|
/* @__PURE__ */ e("span", { className: "text-ds-md text-error", children: "Logout" })
|
|
128
158
|
]
|
|
129
159
|
}
|
|
@@ -139,7 +169,7 @@ const L = C.forwardRef(
|
|
|
139
169
|
);
|
|
140
170
|
}
|
|
141
171
|
);
|
|
142
|
-
|
|
172
|
+
H.displayName = "TopBar";
|
|
143
173
|
export {
|
|
144
|
-
|
|
174
|
+
H as TopBar
|
|
145
175
|
};
|