@mesob/ui 0.2.0 → 0.2.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.
- package/dist/components/alert-dialog.js +22 -22
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/alert.js.map +1 -1
- package/dist/components/animated-tabs.js +1 -1
- package/dist/components/animated-tabs.js.map +1 -1
- package/dist/components/app-header-actions.js +118 -103
- package/dist/components/app-header-actions.js.map +1 -1
- package/dist/components/app-sidebar.js +69 -69
- package/dist/components/app-sidebar.js.map +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.d.ts +6 -3
- package/dist/components/button.js +16 -8
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js +24 -16
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/carousel.js +28 -20
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/command.js +5 -5
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.js +2 -2
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/data-table/index.js +162 -153
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/dialog.js +2 -2
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js +2 -2
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/entity/index.js +261 -256
- package/dist/components/entity/index.js.map +1 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input-group.js +27 -19
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/menubar.js +3 -3
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/navigation-menu.js +1 -1
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/page/index.js +36 -28
- package/dist/components/page/index.js.map +1 -1
- package/dist/components/pagination.js +20 -20
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/section/index.js +29 -21
- package/dist/components/section/index.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/sheet.js +2 -2
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/shell.js +44 -36
- package/dist/components/shell.js.map +1 -1
- package/dist/components/sidebar.js +83 -75
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/spotlight-search.js +67 -59
- package/dist/components/spotlight-search.js.map +1 -1
- package/dist/components/theme-toggle.js +21 -13
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/hooks/use-translation.js +3 -2
- package/dist/hooks/use-translation.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +94 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/theme-schema.d.ts +21 -0
- package/dist/lib/theme-schema.js +95 -0
- package/dist/lib/theme-schema.js.map +1 -0
- package/package.json +2 -5
- package/src/styles/globals.css +0 -130
|
@@ -59,18 +59,18 @@ function AvatarFallback({
|
|
|
59
59
|
// src/components/button.tsx
|
|
60
60
|
import { Slot } from "@radix-ui/react-slot";
|
|
61
61
|
import { cva } from "class-variance-authority";
|
|
62
|
-
import {
|
|
62
|
+
import { jsxs } from "react/jsx-runtime";
|
|
63
63
|
var buttonVariants = cva(
|
|
64
64
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
65
65
|
{
|
|
66
66
|
variants: {
|
|
67
67
|
variant: {
|
|
68
|
-
default: "bg-primary text-primary-foreground hover:bg-primary
|
|
69
|
-
destructive: "bg-destructive text-
|
|
70
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
71
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary
|
|
68
|
+
default: "bg-primary text-primary-foreground hover:bg-primary-600 dark:hover:bg-primary-400",
|
|
69
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
70
|
+
outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
71
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-600 dark:hover:bg-secondary-400",
|
|
72
72
|
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
73
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
73
|
+
link: "text-primary underline-offset-4 hover:text-primary-600 dark:hover:text-primary-400 hover:underline"
|
|
74
74
|
},
|
|
75
75
|
size: {
|
|
76
76
|
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
@@ -92,15 +92,23 @@ function Button({
|
|
|
92
92
|
variant,
|
|
93
93
|
size,
|
|
94
94
|
asChild = false,
|
|
95
|
+
leftIcon,
|
|
96
|
+
rightIcon,
|
|
97
|
+
children,
|
|
95
98
|
...props
|
|
96
99
|
}) {
|
|
97
100
|
const Comp = asChild ? Slot : "button";
|
|
98
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ jsxs(
|
|
99
102
|
Comp,
|
|
100
103
|
{
|
|
101
104
|
"data-slot": "button",
|
|
102
105
|
className: cn(buttonVariants({ variant, size, className })),
|
|
103
|
-
...props
|
|
106
|
+
...props,
|
|
107
|
+
children: [
|
|
108
|
+
leftIcon,
|
|
109
|
+
children,
|
|
110
|
+
rightIcon
|
|
111
|
+
]
|
|
104
112
|
}
|
|
105
113
|
);
|
|
106
114
|
}
|
|
@@ -108,16 +116,16 @@ function Button({
|
|
|
108
116
|
// src/components/dropdown-menu.tsx
|
|
109
117
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
110
118
|
import { IconCheck, IconChevronRight, IconCircle } from "@tabler/icons-react";
|
|
111
|
-
import { jsx as
|
|
119
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
112
120
|
function DropdownMenu({
|
|
113
121
|
...props
|
|
114
122
|
}) {
|
|
115
|
-
return /* @__PURE__ */
|
|
123
|
+
return /* @__PURE__ */ jsx2(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
116
124
|
}
|
|
117
125
|
function DropdownMenuTrigger({
|
|
118
126
|
...props
|
|
119
127
|
}) {
|
|
120
|
-
return /* @__PURE__ */
|
|
128
|
+
return /* @__PURE__ */ jsx2(
|
|
121
129
|
DropdownMenuPrimitive.Trigger,
|
|
122
130
|
{
|
|
123
131
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -130,13 +138,13 @@ function DropdownMenuContent({
|
|
|
130
138
|
sideOffset = 4,
|
|
131
139
|
...props
|
|
132
140
|
}) {
|
|
133
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ jsx2(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx2(
|
|
134
142
|
DropdownMenuPrimitive.Content,
|
|
135
143
|
{
|
|
136
144
|
"data-slot": "dropdown-menu-content",
|
|
137
145
|
sideOffset,
|
|
138
146
|
className: cn(
|
|
139
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
147
|
+
"bg-popover text-popover-foreground border-border data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
140
148
|
className
|
|
141
149
|
),
|
|
142
150
|
...props
|
|
@@ -149,7 +157,7 @@ function DropdownMenuItem({
|
|
|
149
157
|
variant = "default",
|
|
150
158
|
...props
|
|
151
159
|
}) {
|
|
152
|
-
return /* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ jsx2(
|
|
153
161
|
DropdownMenuPrimitive.Item,
|
|
154
162
|
{
|
|
155
163
|
"data-slot": "dropdown-menu-item",
|
|
@@ -167,7 +175,7 @@ function DropdownMenuSeparator({
|
|
|
167
175
|
className,
|
|
168
176
|
...props
|
|
169
177
|
}) {
|
|
170
|
-
return /* @__PURE__ */
|
|
178
|
+
return /* @__PURE__ */ jsx2(
|
|
171
179
|
DropdownMenuPrimitive.Separator,
|
|
172
180
|
{
|
|
173
181
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -179,7 +187,7 @@ function DropdownMenuSeparator({
|
|
|
179
187
|
|
|
180
188
|
// src/components/tooltip.tsx
|
|
181
189
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
182
|
-
import { jsx as
|
|
190
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
183
191
|
|
|
184
192
|
// src/components/mesob-context.tsx
|
|
185
193
|
import {
|
|
@@ -187,14 +195,14 @@ import {
|
|
|
187
195
|
useContext,
|
|
188
196
|
useMemo
|
|
189
197
|
} from "react";
|
|
190
|
-
import { jsx as
|
|
198
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
191
199
|
var MesobContext = createContext(null);
|
|
192
200
|
function useMesob() {
|
|
193
201
|
return useContext(MesobContext);
|
|
194
202
|
}
|
|
195
203
|
|
|
196
204
|
// src/components/link.tsx
|
|
197
|
-
import { jsx as
|
|
205
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
198
206
|
function Link({
|
|
199
207
|
href,
|
|
200
208
|
children,
|
|
@@ -205,9 +213,9 @@ function Link({
|
|
|
205
213
|
const mesob = useMesob();
|
|
206
214
|
const LinkComponent = mesob?.linkComponent ?? "a";
|
|
207
215
|
if (LinkComponent === "a") {
|
|
208
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ jsx5("a", { href, className, onClick, ...props, children });
|
|
209
217
|
}
|
|
210
|
-
return /* @__PURE__ */
|
|
218
|
+
return /* @__PURE__ */ jsx5(
|
|
211
219
|
LinkComponent,
|
|
212
220
|
{
|
|
213
221
|
href,
|
|
@@ -222,27 +230,27 @@ function Link({
|
|
|
222
230
|
// src/components/dialog.tsx
|
|
223
231
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
224
232
|
import { IconX } from "@tabler/icons-react";
|
|
225
|
-
import { jsx as
|
|
233
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
226
234
|
function Dialog({
|
|
227
235
|
...props
|
|
228
236
|
}) {
|
|
229
|
-
return /* @__PURE__ */
|
|
237
|
+
return /* @__PURE__ */ jsx6(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
230
238
|
}
|
|
231
239
|
function DialogPortal({
|
|
232
240
|
...props
|
|
233
241
|
}) {
|
|
234
|
-
return /* @__PURE__ */
|
|
242
|
+
return /* @__PURE__ */ jsx6(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
235
243
|
}
|
|
236
244
|
function DialogOverlay({
|
|
237
245
|
className,
|
|
238
246
|
...props
|
|
239
247
|
}) {
|
|
240
|
-
return /* @__PURE__ */
|
|
248
|
+
return /* @__PURE__ */ jsx6(
|
|
241
249
|
DialogPrimitive.Overlay,
|
|
242
250
|
{
|
|
243
251
|
"data-slot": "dialog-overlay",
|
|
244
252
|
className: cn(
|
|
245
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-
|
|
253
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:opacity-100 fixed inset-0 z-50 bg-[var(--overlay,oklch(0_0_0/0.5))]",
|
|
246
254
|
className
|
|
247
255
|
),
|
|
248
256
|
...props
|
|
@@ -255,27 +263,27 @@ function DialogContent({
|
|
|
255
263
|
showCloseButton = true,
|
|
256
264
|
...props
|
|
257
265
|
}) {
|
|
258
|
-
return /* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */ jsxs4(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
267
|
+
/* @__PURE__ */ jsx6(DialogOverlay, {}),
|
|
268
|
+
/* @__PURE__ */ jsxs4(
|
|
261
269
|
DialogPrimitive.Content,
|
|
262
270
|
{
|
|
263
271
|
"data-slot": "dialog-content",
|
|
264
272
|
className: cn(
|
|
265
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-
|
|
273
|
+
"bg-background text-foreground border-border data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-[51] grid w-full min-w-[280px] max-w-[calc(100vw-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:min-w-[320px] sm:max-w-[32rem]",
|
|
266
274
|
className
|
|
267
275
|
),
|
|
268
276
|
...props,
|
|
269
277
|
children: [
|
|
270
278
|
children,
|
|
271
|
-
showCloseButton && /* @__PURE__ */
|
|
279
|
+
showCloseButton && /* @__PURE__ */ jsxs4(
|
|
272
280
|
DialogPrimitive.Close,
|
|
273
281
|
{
|
|
274
282
|
"data-slot": "dialog-close",
|
|
275
283
|
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
276
284
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ jsx6(IconX, {}),
|
|
286
|
+
/* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Close" })
|
|
279
287
|
]
|
|
280
288
|
}
|
|
281
289
|
)
|
|
@@ -285,7 +293,7 @@ function DialogContent({
|
|
|
285
293
|
] });
|
|
286
294
|
}
|
|
287
295
|
function DialogHeader({ className, ...props }) {
|
|
288
|
-
return /* @__PURE__ */
|
|
296
|
+
return /* @__PURE__ */ jsx6(
|
|
289
297
|
"div",
|
|
290
298
|
{
|
|
291
299
|
"data-slot": "dialog-header",
|
|
@@ -298,7 +306,7 @@ function DialogTitle({
|
|
|
298
306
|
className,
|
|
299
307
|
...props
|
|
300
308
|
}) {
|
|
301
|
-
return /* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ jsx6(
|
|
302
310
|
DialogPrimitive.Title,
|
|
303
311
|
{
|
|
304
312
|
"data-slot": "dialog-title",
|
|
@@ -311,7 +319,7 @@ function DialogDescription({
|
|
|
311
319
|
className,
|
|
312
320
|
...props
|
|
313
321
|
}) {
|
|
314
|
-
return /* @__PURE__ */
|
|
322
|
+
return /* @__PURE__ */ jsx6(
|
|
315
323
|
DialogPrimitive.Description,
|
|
316
324
|
{
|
|
317
325
|
"data-slot": "dialog-description",
|
|
@@ -324,17 +332,17 @@ function DialogDescription({
|
|
|
324
332
|
// src/components/command.tsx
|
|
325
333
|
import { IconSearch } from "@tabler/icons-react";
|
|
326
334
|
import { Command as CommandPrimitive } from "cmdk";
|
|
327
|
-
import { jsx as
|
|
335
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
328
336
|
function Command({
|
|
329
337
|
className,
|
|
330
338
|
...props
|
|
331
339
|
}) {
|
|
332
|
-
return /* @__PURE__ */
|
|
340
|
+
return /* @__PURE__ */ jsx7(
|
|
333
341
|
CommandPrimitive,
|
|
334
342
|
{
|
|
335
343
|
"data-slot": "command",
|
|
336
344
|
className: cn(
|
|
337
|
-
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
345
|
+
"bg-popover text-popover-foreground flex h-full min-h-0 w-full flex-col overflow-hidden rounded-md",
|
|
338
346
|
className
|
|
339
347
|
),
|
|
340
348
|
...props
|
|
@@ -349,17 +357,17 @@ function CommandDialog({
|
|
|
349
357
|
showCloseButton = true,
|
|
350
358
|
...props
|
|
351
359
|
}) {
|
|
352
|
-
return /* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
/* @__PURE__ */
|
|
360
|
+
return /* @__PURE__ */ jsxs5(Dialog, { ...props, children: [
|
|
361
|
+
/* @__PURE__ */ jsxs5(DialogHeader, { className: "sr-only", children: [
|
|
362
|
+
/* @__PURE__ */ jsx7(DialogTitle, { children: title }),
|
|
363
|
+
/* @__PURE__ */ jsx7(DialogDescription, { children: description })
|
|
356
364
|
] }),
|
|
357
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ jsx7(
|
|
358
366
|
DialogContent,
|
|
359
367
|
{
|
|
360
368
|
className: cn("overflow-hidden p-0", className),
|
|
361
369
|
showCloseButton,
|
|
362
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ jsx7(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
|
|
363
371
|
}
|
|
364
372
|
)
|
|
365
373
|
] });
|
|
@@ -368,14 +376,14 @@ function CommandInput({
|
|
|
368
376
|
className,
|
|
369
377
|
...props
|
|
370
378
|
}) {
|
|
371
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */ jsxs5(
|
|
372
380
|
"div",
|
|
373
381
|
{
|
|
374
382
|
"data-slot": "command-input-wrapper",
|
|
375
|
-
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
383
|
+
className: "border-border flex h-9 items-center gap-2 border-b px-3",
|
|
376
384
|
children: [
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ jsx7(IconSearch, { className: "size-4 shrink-0 opacity-50" }),
|
|
386
|
+
/* @__PURE__ */ jsx7(
|
|
379
387
|
CommandPrimitive.Input,
|
|
380
388
|
{
|
|
381
389
|
"data-slot": "command-input",
|
|
@@ -394,7 +402,7 @@ function CommandList({
|
|
|
394
402
|
className,
|
|
395
403
|
...props
|
|
396
404
|
}) {
|
|
397
|
-
return /* @__PURE__ */
|
|
405
|
+
return /* @__PURE__ */ jsx7(
|
|
398
406
|
CommandPrimitive.List,
|
|
399
407
|
{
|
|
400
408
|
"data-slot": "command-list",
|
|
@@ -409,11 +417,11 @@ function CommandList({
|
|
|
409
417
|
function CommandEmpty({
|
|
410
418
|
...props
|
|
411
419
|
}) {
|
|
412
|
-
return /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ jsx7(
|
|
413
421
|
CommandPrimitive.Empty,
|
|
414
422
|
{
|
|
415
423
|
"data-slot": "command-empty",
|
|
416
|
-
className: "py-6 text-center text-sm",
|
|
424
|
+
className: "text-muted-foreground py-6 text-center text-sm",
|
|
417
425
|
...props
|
|
418
426
|
}
|
|
419
427
|
);
|
|
@@ -422,7 +430,7 @@ function CommandGroup({
|
|
|
422
430
|
className,
|
|
423
431
|
...props
|
|
424
432
|
}) {
|
|
425
|
-
return /* @__PURE__ */
|
|
433
|
+
return /* @__PURE__ */ jsx7(
|
|
426
434
|
CommandPrimitive.Group,
|
|
427
435
|
{
|
|
428
436
|
"data-slot": "command-group",
|
|
@@ -438,7 +446,7 @@ function CommandSeparator({
|
|
|
438
446
|
className,
|
|
439
447
|
...props
|
|
440
448
|
}) {
|
|
441
|
-
return /* @__PURE__ */
|
|
449
|
+
return /* @__PURE__ */ jsx7(
|
|
442
450
|
CommandPrimitive.Separator,
|
|
443
451
|
{
|
|
444
452
|
"data-slot": "command-separator",
|
|
@@ -451,7 +459,7 @@ function CommandItem({
|
|
|
451
459
|
className,
|
|
452
460
|
...props
|
|
453
461
|
}) {
|
|
454
|
-
return /* @__PURE__ */
|
|
462
|
+
return /* @__PURE__ */ jsx7(
|
|
455
463
|
CommandPrimitive.Item,
|
|
456
464
|
{
|
|
457
465
|
"data-slot": "command-item",
|
|
@@ -467,7 +475,7 @@ function CommandItem({
|
|
|
467
475
|
// src/components/spotlight-search.tsx
|
|
468
476
|
import { IconSearch as IconSearch2 } from "@tabler/icons-react";
|
|
469
477
|
import * as React from "react";
|
|
470
|
-
import { Fragment as Fragment2, jsx as
|
|
478
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
471
479
|
function SpotlightSearch({
|
|
472
480
|
groups = [],
|
|
473
481
|
placeholder = "Search...",
|
|
@@ -487,27 +495,27 @@ function SpotlightSearch({
|
|
|
487
495
|
document.addEventListener("keydown", down);
|
|
488
496
|
return () => document.removeEventListener("keydown", down);
|
|
489
497
|
}, []);
|
|
490
|
-
return /* @__PURE__ */
|
|
491
|
-
/* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
499
|
+
/* @__PURE__ */ jsxs6(
|
|
492
500
|
Button,
|
|
493
501
|
{
|
|
494
502
|
variant: "outline",
|
|
495
503
|
className: cn(
|
|
496
|
-
"relative h-9 w-9 p-0 xl:h-9 xl:w-60 xl:justify-start xl:px-3 xl:py-2",
|
|
504
|
+
"relative h-9 min-w-9 p-0 xl:h-9 xl:min-w-[12rem] xl:w-60 xl:justify-start xl:px-3 xl:py-2",
|
|
497
505
|
triggerClassName
|
|
498
506
|
),
|
|
499
507
|
onClick: () => setOpen(true),
|
|
500
508
|
children: [
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
-
/* @__PURE__ */
|
|
504
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ jsx8(IconSearch2, { className: "h-4 w-4 xl:mr-2" }),
|
|
510
|
+
/* @__PURE__ */ jsx8("span", { className: "hidden xl:inline-flex", children: "Search..." }),
|
|
511
|
+
/* @__PURE__ */ jsxs6("kbd", { className: "border-border pointer-events-none absolute right-1.5 top-1/2 hidden h-5 -translate-y-1/2 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 xl:flex", children: [
|
|
512
|
+
/* @__PURE__ */ jsx8("span", { className: "text-xs", children: "\u2318" }),
|
|
505
513
|
"K"
|
|
506
514
|
] })
|
|
507
515
|
]
|
|
508
516
|
}
|
|
509
517
|
),
|
|
510
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ jsxs6(
|
|
511
519
|
CommandDialog,
|
|
512
520
|
{
|
|
513
521
|
open,
|
|
@@ -517,12 +525,12 @@ function SpotlightSearch({
|
|
|
517
525
|
showCloseButton: false,
|
|
518
526
|
className,
|
|
519
527
|
children: [
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
-
/* @__PURE__ */
|
|
523
|
-
groups.map((group, index) => /* @__PURE__ */
|
|
524
|
-
index > 0 && /* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ jsx8(CommandInput, { placeholder, onValueChange: onSearch }),
|
|
529
|
+
/* @__PURE__ */ jsxs6(CommandList, { children: [
|
|
530
|
+
/* @__PURE__ */ jsx8(CommandEmpty, { children: emptyMessage }),
|
|
531
|
+
groups.map((group, index) => /* @__PURE__ */ jsxs6(React.Fragment, { children: [
|
|
532
|
+
index > 0 && /* @__PURE__ */ jsx8(CommandSeparator, {}),
|
|
533
|
+
/* @__PURE__ */ jsx8(CommandGroup, { heading: group.heading, children: group.items.map((item) => /* @__PURE__ */ jsxs6(
|
|
526
534
|
CommandItem,
|
|
527
535
|
{
|
|
528
536
|
onSelect: () => {
|
|
@@ -531,8 +539,8 @@ function SpotlightSearch({
|
|
|
531
539
|
},
|
|
532
540
|
children: [
|
|
533
541
|
item.icon,
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
item.shortcut && /* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ jsx8("span", { children: item.title }),
|
|
543
|
+
item.shortcut && /* @__PURE__ */ jsx8("kbd", { className: "border-border pointer-events-none ml-auto hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex", children: item.shortcut })
|
|
536
544
|
]
|
|
537
545
|
},
|
|
538
546
|
item.id
|
|
@@ -547,7 +555,7 @@ function SpotlightSearch({
|
|
|
547
555
|
|
|
548
556
|
// src/components/app-header-actions.tsx
|
|
549
557
|
import { IconBell, IconLogout } from "@tabler/icons-react";
|
|
550
|
-
import { Fragment as Fragment3, jsx as
|
|
558
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
551
559
|
function AppHeaderActions({
|
|
552
560
|
user,
|
|
553
561
|
onLogout,
|
|
@@ -561,61 +569,68 @@ function AppHeaderActions({
|
|
|
561
569
|
const initials = user?.fullName?.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) || "U";
|
|
562
570
|
const displayName = user?.fullName ?? "Account";
|
|
563
571
|
const displaySubtext = user?.email ?? user?.phone ?? user?.handle ?? "";
|
|
564
|
-
return /* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
572
|
+
return /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
|
|
573
|
+
/* @__PURE__ */ jsx9(SpotlightSearch, { groups: searchGroups }),
|
|
566
574
|
actions,
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
575
|
+
/* @__PURE__ */ jsx9(Button, { variant: "ghost", size: "icon", className: "relative", children: /* @__PURE__ */ jsx9(IconBell, { className: "size-5" }) }),
|
|
576
|
+
/* @__PURE__ */ jsxs7(DropdownMenu, { children: [
|
|
577
|
+
/* @__PURE__ */ jsx9(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs7(
|
|
578
|
+
Button,
|
|
579
|
+
{
|
|
580
|
+
variant: "ghost",
|
|
581
|
+
className: "flex items-center gap-3 px-3 py-2 h-auto rounded-md min-h-9 hover:bg-accent/70 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
582
|
+
children: [
|
|
583
|
+
/* @__PURE__ */ jsxs7(Avatar, { className: "size-8 shrink-0", children: [
|
|
584
|
+
/* @__PURE__ */ jsx9(AvatarImage, { src: user?.image ?? void 0 }),
|
|
585
|
+
/* @__PURE__ */ jsx9(AvatarFallback, { className: "text-xs", children: initials })
|
|
586
|
+
] }),
|
|
587
|
+
/* @__PURE__ */ jsxs7("div", { className: "hidden flex-col items-start text-left md:flex min-w-0", children: [
|
|
588
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm font-medium", children: displayName }),
|
|
589
|
+
/* @__PURE__ */ jsx9("span", { className: "text-xs text-muted-foreground", children: displaySubtext })
|
|
590
|
+
] })
|
|
591
|
+
]
|
|
592
|
+
}
|
|
593
|
+
) }),
|
|
594
|
+
/* @__PURE__ */ jsxs7(DropdownMenuContent, { align: "end", className: "w-56", children: [
|
|
595
|
+
topMenuItems.map((item) => /* @__PURE__ */ jsx9(
|
|
581
596
|
DropdownMenuItem,
|
|
582
597
|
{
|
|
583
598
|
onClick: item.onClick,
|
|
584
599
|
variant: item.variant,
|
|
585
600
|
asChild: item.href ? true : void 0,
|
|
586
|
-
children: item.href ? /* @__PURE__ */
|
|
587
|
-
item.icon && /* @__PURE__ */
|
|
601
|
+
children: item.href ? /* @__PURE__ */ jsxs7(Link, { href: item.href, onClick: item.onClick, children: [
|
|
602
|
+
item.icon && /* @__PURE__ */ jsx9("span", { className: "mr-2", children: item.icon }),
|
|
588
603
|
item.label
|
|
589
|
-
] }) : /* @__PURE__ */
|
|
590
|
-
item.icon && /* @__PURE__ */
|
|
604
|
+
] }) : /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
605
|
+
item.icon && /* @__PURE__ */ jsx9("span", { className: "mr-2", children: item.icon }),
|
|
591
606
|
item.label
|
|
592
607
|
] })
|
|
593
608
|
},
|
|
594
609
|
item.href ?? item.label
|
|
595
610
|
)),
|
|
596
|
-
topMenuItems.length > 0 && menuItems.length > 0 && /* @__PURE__ */
|
|
597
|
-
menuItems.map((item) => /* @__PURE__ */
|
|
611
|
+
topMenuItems.length > 0 && menuItems.length > 0 && /* @__PURE__ */ jsx9(DropdownMenuSeparator, {}),
|
|
612
|
+
menuItems.map((item) => /* @__PURE__ */ jsx9(
|
|
598
613
|
DropdownMenuItem,
|
|
599
614
|
{
|
|
600
615
|
onClick: item.onClick,
|
|
601
616
|
variant: item.variant,
|
|
602
617
|
asChild: item.href ? true : void 0,
|
|
603
|
-
children: item.href ? /* @__PURE__ */
|
|
604
|
-
item.icon && /* @__PURE__ */
|
|
618
|
+
children: item.href ? /* @__PURE__ */ jsxs7(Link, { href: item.href, onClick: item.onClick, children: [
|
|
619
|
+
item.icon && /* @__PURE__ */ jsx9("span", { className: "mr-2", children: item.icon }),
|
|
605
620
|
item.label
|
|
606
|
-
] }) : /* @__PURE__ */
|
|
607
|
-
item.icon && /* @__PURE__ */
|
|
621
|
+
] }) : /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
622
|
+
item.icon && /* @__PURE__ */ jsx9("span", { className: "mr-2", children: item.icon }),
|
|
608
623
|
item.label
|
|
609
624
|
] })
|
|
610
625
|
},
|
|
611
626
|
item.href ?? item.label
|
|
612
627
|
)),
|
|
613
|
-
accountMenuFooter && (topMenuItems.length > 0 || menuItems.length > 0) && /* @__PURE__ */
|
|
628
|
+
accountMenuFooter && (topMenuItems.length > 0 || menuItems.length > 0) && /* @__PURE__ */ jsx9(DropdownMenuSeparator, {}),
|
|
614
629
|
accountMenuFooter,
|
|
615
|
-
onLogout && /* @__PURE__ */
|
|
616
|
-
(topMenuItems.length > 0 || menuItems.length > 0 || accountMenuFooter) && /* @__PURE__ */
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
isLoggingOut ? /* @__PURE__ */
|
|
630
|
+
onLogout && /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
631
|
+
(topMenuItems.length > 0 || menuItems.length > 0 || accountMenuFooter) && /* @__PURE__ */ jsx9(DropdownMenuSeparator, {}),
|
|
632
|
+
/* @__PURE__ */ jsxs7(DropdownMenuItem, { onClick: onLogout, variant: "destructive", children: [
|
|
633
|
+
isLoggingOut ? /* @__PURE__ */ jsx9("span", { className: "mr-2", children: "..." }) : /* @__PURE__ */ jsx9(IconLogout, { className: "mr-2 size-4" }),
|
|
619
634
|
"Log out"
|
|
620
635
|
] })
|
|
621
636
|
] })
|