@amogads/ui 1.1.3 → 1.1.5
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/index.js +2277 -675
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2297 -649
- package/dist/index.mjs.map +1 -1
- package/dist/pages.js +7111 -6890
- package/dist/pages.js.map +1 -1
- package/dist/pages.mjs +23240 -23019
- package/dist/pages.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4564,6 +4564,22 @@ function SidebarProvider({
|
|
|
4564
4564
|
window.addEventListener("keydown", handleKeyDown);
|
|
4565
4565
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
4566
4566
|
}, [toggleSidebar]);
|
|
4567
|
+
React7.useEffect(() => {
|
|
4568
|
+
const handleCustomToggle = (e) => {
|
|
4569
|
+
const customEvent = e;
|
|
4570
|
+
if (customEvent.detail && typeof customEvent.detail.open === "boolean") {
|
|
4571
|
+
if (isMobile) {
|
|
4572
|
+
setOpenMobile(customEvent.detail.open);
|
|
4573
|
+
} else {
|
|
4574
|
+
setOpen(customEvent.detail.open);
|
|
4575
|
+
}
|
|
4576
|
+
} else {
|
|
4577
|
+
toggleSidebar();
|
|
4578
|
+
}
|
|
4579
|
+
};
|
|
4580
|
+
window.addEventListener("amoga:toggle-sidebar", handleCustomToggle);
|
|
4581
|
+
return () => window.removeEventListener("amoga:toggle-sidebar", handleCustomToggle);
|
|
4582
|
+
}, [isMobile, setOpenMobile, setOpen, toggleSidebar]);
|
|
4567
4583
|
const state = open ? "expanded" : "collapsed";
|
|
4568
4584
|
const contextValue = React7.useMemo(
|
|
4569
4585
|
() => ({
|
|
@@ -11073,280 +11089,1905 @@ function AiChatHeader({
|
|
|
11073
11089
|
);
|
|
11074
11090
|
}
|
|
11075
11091
|
|
|
11076
|
-
// src/design-system/
|
|
11077
|
-
import
|
|
11078
|
-
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
}
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11092
|
+
// src/design-system/components/files/file-card-item.tsx
|
|
11093
|
+
import React19 from "react";
|
|
11094
|
+
import {
|
|
11095
|
+
Eye as Eye3,
|
|
11096
|
+
Download as Download2,
|
|
11097
|
+
FileText as FileText3,
|
|
11098
|
+
Image as ImageIcon,
|
|
11099
|
+
Film,
|
|
11100
|
+
FileSpreadsheet,
|
|
11101
|
+
FileCode,
|
|
11102
|
+
FileArchive,
|
|
11103
|
+
MoreHorizontal as MoreHorizontal4,
|
|
11104
|
+
Copy as Copy3,
|
|
11105
|
+
Trash2 as Trash26,
|
|
11106
|
+
Pencil as Pencil3,
|
|
11107
|
+
Share2 as Share22
|
|
11108
|
+
} from "lucide-react";
|
|
11109
|
+
import { formatDistanceToNow } from "date-fns";
|
|
11110
|
+
import { Fragment as Fragment3, jsx as jsx94, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
11111
|
+
function getFileCategoryTheme(category) {
|
|
11112
|
+
switch (category) {
|
|
11113
|
+
case "Pdf":
|
|
11114
|
+
return {
|
|
11115
|
+
bg: "bg-red-500/10 dark:bg-red-950/40",
|
|
11116
|
+
text: "text-red-600 dark:text-red-400",
|
|
11117
|
+
border: "border-red-200/40 dark:border-red-900/40",
|
|
11118
|
+
gradient: "from-red-500/20 to-orange-500/10"
|
|
11119
|
+
};
|
|
11120
|
+
case "Doc":
|
|
11121
|
+
return {
|
|
11122
|
+
bg: "bg-blue-500/10 dark:bg-blue-950/40",
|
|
11123
|
+
text: "text-blue-600 dark:text-blue-400",
|
|
11124
|
+
border: "border-blue-200/40 dark:border-blue-900/40",
|
|
11125
|
+
gradient: "from-blue-500/20 to-indigo-500/10"
|
|
11126
|
+
};
|
|
11127
|
+
case "Xls":
|
|
11128
|
+
case "Csv":
|
|
11129
|
+
return {
|
|
11130
|
+
bg: "bg-emerald-500/10 dark:bg-emerald-950/40",
|
|
11131
|
+
text: "text-emerald-600 dark:text-emerald-400",
|
|
11132
|
+
border: "border-emerald-200/40 dark:border-emerald-900/40",
|
|
11133
|
+
gradient: "from-emerald-500/20 to-teal-500/10"
|
|
11134
|
+
};
|
|
11135
|
+
case "Images":
|
|
11136
|
+
return {
|
|
11137
|
+
bg: "bg-amber-500/10 dark:bg-amber-950/40",
|
|
11138
|
+
text: "text-amber-600 dark:text-amber-400",
|
|
11139
|
+
border: "border-amber-200/40 dark:border-amber-900/40",
|
|
11140
|
+
gradient: "from-amber-500/20 to-yellow-500/10"
|
|
11141
|
+
};
|
|
11142
|
+
case "Videos":
|
|
11143
|
+
return {
|
|
11144
|
+
bg: "bg-purple-500/10 dark:bg-purple-950/40",
|
|
11145
|
+
text: "text-purple-600 dark:text-purple-400",
|
|
11146
|
+
border: "border-purple-200/40 dark:border-purple-900/40",
|
|
11147
|
+
gradient: "from-purple-500/20 to-pink-500/10"
|
|
11148
|
+
};
|
|
11149
|
+
case "Zip":
|
|
11150
|
+
return {
|
|
11151
|
+
bg: "bg-orange-500/10 dark:bg-orange-950/40",
|
|
11152
|
+
text: "text-orange-600 dark:text-orange-400",
|
|
11153
|
+
border: "border-orange-200/40 dark:border-orange-900/40",
|
|
11154
|
+
gradient: "from-orange-500/20 to-amber-500/10"
|
|
11155
|
+
};
|
|
11156
|
+
default:
|
|
11157
|
+
return {
|
|
11158
|
+
bg: "bg-indigo-500/10 dark:bg-indigo-950/40",
|
|
11159
|
+
text: "text-indigo-600 dark:text-indigo-400",
|
|
11160
|
+
border: "border-indigo-200/40 dark:border-indigo-900/40",
|
|
11161
|
+
gradient: "from-indigo-500/20 to-purple-500/10"
|
|
11162
|
+
};
|
|
11163
|
+
}
|
|
11123
11164
|
}
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11165
|
+
function formatBytes(bytes) {
|
|
11166
|
+
if (!bytes || bytes === 0) return "0 B";
|
|
11167
|
+
const k = 1024;
|
|
11168
|
+
const sizes = ["B", "KB", "MB", "GB", "TB"];
|
|
11169
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
11170
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${sizes[i]}`;
|
|
11171
|
+
}
|
|
11172
|
+
function FileCardItem({
|
|
11173
|
+
file,
|
|
11174
|
+
isSelected = false,
|
|
11175
|
+
viewMode = "grid",
|
|
11176
|
+
onSelect,
|
|
11177
|
+
onPreview,
|
|
11178
|
+
onDownload,
|
|
11179
|
+
onCopyLink,
|
|
11180
|
+
onRename,
|
|
11181
|
+
onDelete,
|
|
11182
|
+
onShare,
|
|
11183
|
+
className
|
|
11141
11184
|
}) {
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
title,
|
|
11161
|
-
description,
|
|
11162
|
-
badge,
|
|
11163
|
-
breadcrumbs,
|
|
11164
|
-
actions
|
|
11165
|
-
}
|
|
11166
|
-
)
|
|
11167
|
-
] }),
|
|
11168
|
-
highlights && /* @__PURE__ */ jsx95("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-4", children: highlights }),
|
|
11169
|
-
/* @__PURE__ */ jsxs57(
|
|
11170
|
-
"div",
|
|
11185
|
+
const theme = getFileCategoryTheme(file.category);
|
|
11186
|
+
const isImage = file.category === "Images" || /\.(jpg|jpeg|png|webp|svg|gif)$/i.test(file.fileName);
|
|
11187
|
+
const isVideo = file.category === "Videos" || /\.(mp4|webm|mov|mkv)$/i.test(file.fileName);
|
|
11188
|
+
const isPdf = file.category === "Pdf" || /\.pdf$/i.test(file.fileName);
|
|
11189
|
+
const isSheet = file.category === "Xls" || file.category === "Csv" || /\.(xls|xlsx|csv)$/i.test(file.fileName);
|
|
11190
|
+
const isZip = file.category === "Zip" || /\.(zip|rar|7z|tar|gz)$/i.test(file.fileName);
|
|
11191
|
+
const updatedTimeDisplay = React19.useMemo(() => {
|
|
11192
|
+
if (!file.updatedAt) return "Recently";
|
|
11193
|
+
try {
|
|
11194
|
+
const d = new Date(file.updatedAt);
|
|
11195
|
+
return formatDistanceToNow(d, { addSuffix: true });
|
|
11196
|
+
} catch {
|
|
11197
|
+
return "Recently";
|
|
11198
|
+
}
|
|
11199
|
+
}, [file.updatedAt]);
|
|
11200
|
+
if (viewMode === "table") {
|
|
11201
|
+
return /* @__PURE__ */ jsxs56(
|
|
11202
|
+
"tr",
|
|
11171
11203
|
{
|
|
11204
|
+
onClick: () => onSelect?.(file),
|
|
11172
11205
|
className: cn(
|
|
11173
|
-
"
|
|
11174
|
-
|
|
11206
|
+
"group border-b border-border/50 transition-colors hover:bg-muted/40 cursor-pointer",
|
|
11207
|
+
isSelected && "bg-primary/5",
|
|
11208
|
+
className
|
|
11175
11209
|
),
|
|
11176
11210
|
children: [
|
|
11177
|
-
/* @__PURE__ */
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
breadcrumbs,
|
|
11193
|
-
onBack,
|
|
11194
|
-
backLabel = "Back",
|
|
11195
|
-
submitLabel = "Save changes",
|
|
11196
|
-
cancelLabel = "Cancel",
|
|
11197
|
-
onCancel,
|
|
11198
|
-
isSubmitting = false,
|
|
11199
|
-
stickyFooter = false,
|
|
11200
|
-
secondaryActions,
|
|
11201
|
-
children,
|
|
11202
|
-
className,
|
|
11203
|
-
onSubmit,
|
|
11204
|
-
...props
|
|
11205
|
-
}) {
|
|
11206
|
-
return /* @__PURE__ */ jsxs58("div", { className: "flex flex-col gap-6 p-4 sm:p-6 md:p-8", children: [
|
|
11207
|
-
/* @__PURE__ */ jsxs58("div", { className: "flex flex-col gap-2", children: [
|
|
11208
|
-
onBack && /* @__PURE__ */ jsxs58(
|
|
11209
|
-
Button,
|
|
11210
|
-
{
|
|
11211
|
-
type: "button",
|
|
11212
|
-
variant: "ghost",
|
|
11213
|
-
size: "sm",
|
|
11214
|
-
onClick: onBack,
|
|
11215
|
-
className: "w-fit gap-1.5 px-0 text-xs text-muted-foreground hover:bg-transparent hover:text-foreground",
|
|
11216
|
-
children: [
|
|
11217
|
-
/* @__PURE__ */ jsx96(ArrowLeft4, { className: "h-3.5 w-3.5" }),
|
|
11218
|
-
backLabel
|
|
11219
|
-
]
|
|
11220
|
-
}
|
|
11221
|
-
),
|
|
11222
|
-
/* @__PURE__ */ jsx96(
|
|
11223
|
-
PageHeader,
|
|
11224
|
-
{
|
|
11225
|
-
title,
|
|
11226
|
-
description,
|
|
11227
|
-
badge,
|
|
11228
|
-
breadcrumbs
|
|
11229
|
-
}
|
|
11230
|
-
)
|
|
11231
|
-
] }),
|
|
11232
|
-
/* @__PURE__ */ jsxs58("form", { onSubmit, className: cn("space-y-8", className), ...props, children: [
|
|
11233
|
-
/* @__PURE__ */ jsx96("div", { className: "space-y-6", children }),
|
|
11234
|
-
/* @__PURE__ */ jsxs58(
|
|
11235
|
-
"div",
|
|
11236
|
-
{
|
|
11237
|
-
className: cn(
|
|
11238
|
-
"flex flex-wrap items-center justify-between gap-4 pt-6",
|
|
11239
|
-
stickyFooter && "sticky bottom-0 -mx-4 -mb-4 bg-background/95 p-4 backdrop-blur border-t sm:-mx-6 sm:-mb-6 sm:p-6 md:-mx-8 md:-mb-8 md:p-8"
|
|
11240
|
-
),
|
|
11241
|
-
children: [
|
|
11242
|
-
/* @__PURE__ */ jsx96("div", { children: secondaryActions }),
|
|
11243
|
-
/* @__PURE__ */ jsxs58("div", { className: "flex items-center gap-3", children: [
|
|
11244
|
-
onCancel && /* @__PURE__ */ jsx96(
|
|
11245
|
-
Button,
|
|
11246
|
-
{
|
|
11247
|
-
type: "button",
|
|
11248
|
-
variant: "outline",
|
|
11249
|
-
disabled: isSubmitting,
|
|
11250
|
-
onClick: onCancel,
|
|
11251
|
-
children: cancelLabel
|
|
11252
|
-
}
|
|
11253
|
-
),
|
|
11254
|
-
/* @__PURE__ */ jsx96(Button, { type: "submit", disabled: isSubmitting, children: isSubmitting ? "Saving..." : submitLabel })
|
|
11211
|
+
/* @__PURE__ */ jsx94("td", { className: "py-3 px-4", children: /* @__PURE__ */ jsxs56("div", { className: "flex items-center gap-3", children: [
|
|
11212
|
+
/* @__PURE__ */ jsx94(
|
|
11213
|
+
"div",
|
|
11214
|
+
{
|
|
11215
|
+
className: cn(
|
|
11216
|
+
"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border shadow-2xs",
|
|
11217
|
+
theme.bg,
|
|
11218
|
+
theme.border
|
|
11219
|
+
),
|
|
11220
|
+
children: isImage ? /* @__PURE__ */ jsx94(ImageIcon, { className: cn("h-4 w-4", theme.text) }) : isVideo ? /* @__PURE__ */ jsx94(Film, { className: cn("h-4 w-4", theme.text) }) : isPdf ? /* @__PURE__ */ jsx94(FileText3, { className: cn("h-4 w-4", theme.text) }) : isSheet ? /* @__PURE__ */ jsx94(FileSpreadsheet, { className: cn("h-4 w-4", theme.text) }) : isZip ? /* @__PURE__ */ jsx94(FileArchive, { className: cn("h-4 w-4", theme.text) }) : /* @__PURE__ */ jsx94(FileCode, { className: cn("h-4 w-4", theme.text) })
|
|
11221
|
+
}
|
|
11222
|
+
),
|
|
11223
|
+
/* @__PURE__ */ jsxs56("div", { className: "min-w-0", children: [
|
|
11224
|
+
/* @__PURE__ */ jsx94("p", { className: "font-semibold text-xs text-foreground truncate max-w-[240px] sm:max-w-xs", children: file.fileName }),
|
|
11225
|
+
/* @__PURE__ */ jsx94("p", { className: "text-[11px] text-muted-foreground", children: file.folderPath || file.section || "General" })
|
|
11255
11226
|
] })
|
|
11256
|
-
]
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
steps,
|
|
11270
|
-
currentStepIndex,
|
|
11271
|
-
onStepChange,
|
|
11272
|
-
onNext,
|
|
11273
|
-
onPrevious,
|
|
11274
|
-
onSubmit,
|
|
11275
|
-
nextLabel = "Next",
|
|
11276
|
-
previousLabel = "Previous",
|
|
11277
|
-
submitLabel = "Complete",
|
|
11278
|
-
isSubmitting = false,
|
|
11279
|
-
canProceed = true,
|
|
11280
|
-
children,
|
|
11281
|
-
className,
|
|
11282
|
-
...props
|
|
11283
|
-
}) {
|
|
11284
|
-
const isLastStep = currentStepIndex === steps.length - 1;
|
|
11285
|
-
const isFirstStep = currentStepIndex === 0;
|
|
11286
|
-
return /* @__PURE__ */ jsxs59("div", { className: cn("flex flex-col gap-6 p-4 sm:p-6 md:p-8", className), ...props, children: [
|
|
11287
|
-
/* @__PURE__ */ jsx97(PageHeader, { title, description }),
|
|
11288
|
-
/* @__PURE__ */ jsx97("nav", { "aria-label": "Wizard Progress", className: "py-2", children: /* @__PURE__ */ jsx97("ol", { className: "flex items-center justify-between gap-2 overflow-x-auto pb-2", children: steps.map((step, idx) => {
|
|
11289
|
-
const isCompleted = idx < currentStepIndex;
|
|
11290
|
-
const isCurrent = idx === currentStepIndex;
|
|
11291
|
-
const isClickable = onStepChange && idx < currentStepIndex;
|
|
11292
|
-
return /* @__PURE__ */ jsxs59(
|
|
11293
|
-
"li",
|
|
11294
|
-
{
|
|
11295
|
-
className: "flex flex-1 items-center gap-2.5 min-w-[120px]",
|
|
11296
|
-
children: [
|
|
11297
|
-
/* @__PURE__ */ jsxs59(
|
|
11227
|
+
] }) }),
|
|
11228
|
+
/* @__PURE__ */ jsx94("td", { className: "py-3 px-4 text-xs", children: /* @__PURE__ */ jsx94(
|
|
11229
|
+
Badge,
|
|
11230
|
+
{
|
|
11231
|
+
variant: "outline",
|
|
11232
|
+
className: cn("text-[10px] px-2 py-0.5 font-bold", theme.bg, theme.text, theme.border),
|
|
11233
|
+
children: file.category
|
|
11234
|
+
}
|
|
11235
|
+
) }),
|
|
11236
|
+
/* @__PURE__ */ jsx94("td", { className: "py-3 px-4 text-xs text-muted-foreground font-mono", children: formatBytes(file.fileSize) }),
|
|
11237
|
+
/* @__PURE__ */ jsx94("td", { className: "py-3 px-4 text-xs text-muted-foreground hidden sm:table-cell", children: updatedTimeDisplay }),
|
|
11238
|
+
/* @__PURE__ */ jsx94("td", { className: "py-3 px-4 text-right", children: /* @__PURE__ */ jsxs56("div", { className: "flex items-center justify-end gap-1", children: [
|
|
11239
|
+
/* @__PURE__ */ jsx94(
|
|
11298
11240
|
"button",
|
|
11299
11241
|
{
|
|
11300
11242
|
type: "button",
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
children:
|
|
11308
|
-
/* @__PURE__ */ jsx97(
|
|
11309
|
-
"span",
|
|
11310
|
-
{
|
|
11311
|
-
className: cn(
|
|
11312
|
-
"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold",
|
|
11313
|
-
isCompleted && "bg-primary text-primary-foreground",
|
|
11314
|
-
isCurrent && "border-2 border-primary bg-primary/10 text-primary font-bold",
|
|
11315
|
-
!isCompleted && !isCurrent && "border border-border bg-muted text-muted-foreground"
|
|
11316
|
-
),
|
|
11317
|
-
children: isCompleted ? /* @__PURE__ */ jsx97(Check7, { className: "h-4 w-4" }) : idx + 1
|
|
11318
|
-
}
|
|
11319
|
-
),
|
|
11320
|
-
/* @__PURE__ */ jsx97("div", { className: "hidden sm:block", children: /* @__PURE__ */ jsx97(
|
|
11321
|
-
"div",
|
|
11322
|
-
{
|
|
11323
|
-
className: cn(
|
|
11324
|
-
"text-xs font-medium",
|
|
11325
|
-
isCurrent ? "text-foreground font-semibold" : "text-muted-foreground"
|
|
11326
|
-
),
|
|
11327
|
-
children: step.title
|
|
11328
|
-
}
|
|
11329
|
-
) })
|
|
11330
|
-
]
|
|
11243
|
+
onClick: (e) => {
|
|
11244
|
+
e.stopPropagation();
|
|
11245
|
+
onPreview?.(file);
|
|
11246
|
+
},
|
|
11247
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
11248
|
+
title: "Preview",
|
|
11249
|
+
children: /* @__PURE__ */ jsx94(Eye3, { className: "h-4 w-4" })
|
|
11331
11250
|
}
|
|
11332
11251
|
),
|
|
11333
|
-
|
|
11334
|
-
"
|
|
11252
|
+
/* @__PURE__ */ jsx94(
|
|
11253
|
+
"button",
|
|
11335
11254
|
{
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11255
|
+
type: "button",
|
|
11256
|
+
onClick: (e) => {
|
|
11257
|
+
e.stopPropagation();
|
|
11258
|
+
onDownload?.(file);
|
|
11259
|
+
},
|
|
11260
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
11261
|
+
title: "Download",
|
|
11262
|
+
children: /* @__PURE__ */ jsx94(Download2, { className: "h-4 w-4" })
|
|
11340
11263
|
}
|
|
11341
|
-
)
|
|
11342
|
-
|
|
11343
|
-
|
|
11264
|
+
),
|
|
11265
|
+
/* @__PURE__ */ jsxs56(DropdownMenu, { children: [
|
|
11266
|
+
/* @__PURE__ */ jsx94(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx94(
|
|
11267
|
+
"button",
|
|
11268
|
+
{
|
|
11269
|
+
type: "button",
|
|
11270
|
+
onClick: (e) => e.stopPropagation(),
|
|
11271
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
11272
|
+
title: "More actions",
|
|
11273
|
+
children: /* @__PURE__ */ jsx94(MoreHorizontal4, { className: "h-4 w-4" })
|
|
11274
|
+
}
|
|
11275
|
+
) }),
|
|
11276
|
+
/* @__PURE__ */ jsxs56(DropdownMenuContent, { align: "end", className: "w-40 rounded-xl p-1 shadow-lg", children: [
|
|
11277
|
+
/* @__PURE__ */ jsxs56(
|
|
11278
|
+
DropdownMenuItem,
|
|
11279
|
+
{
|
|
11280
|
+
onClick: () => onPreview?.(file),
|
|
11281
|
+
className: "cursor-pointer text-xs flex items-center gap-2 py-1.5",
|
|
11282
|
+
children: [
|
|
11283
|
+
/* @__PURE__ */ jsx94(Eye3, { className: "h-3.5 w-3.5 text-blue-500" }),
|
|
11284
|
+
/* @__PURE__ */ jsx94("span", { children: "Preview" })
|
|
11285
|
+
]
|
|
11286
|
+
}
|
|
11287
|
+
),
|
|
11288
|
+
/* @__PURE__ */ jsxs56(
|
|
11289
|
+
DropdownMenuItem,
|
|
11290
|
+
{
|
|
11291
|
+
onClick: () => onDownload?.(file),
|
|
11292
|
+
className: "cursor-pointer text-xs flex items-center gap-2 py-1.5",
|
|
11293
|
+
children: [
|
|
11294
|
+
/* @__PURE__ */ jsx94(Download2, { className: "h-3.5 w-3.5 text-emerald-500" }),
|
|
11295
|
+
/* @__PURE__ */ jsx94("span", { children: "Download" })
|
|
11296
|
+
]
|
|
11297
|
+
}
|
|
11298
|
+
),
|
|
11299
|
+
/* @__PURE__ */ jsxs56(
|
|
11300
|
+
DropdownMenuItem,
|
|
11301
|
+
{
|
|
11302
|
+
onClick: () => onCopyLink?.(file),
|
|
11303
|
+
className: "cursor-pointer text-xs flex items-center gap-2 py-1.5",
|
|
11304
|
+
children: [
|
|
11305
|
+
/* @__PURE__ */ jsx94(Copy3, { className: "h-3.5 w-3.5 text-amber-500" }),
|
|
11306
|
+
/* @__PURE__ */ jsx94("span", { children: "Copy Link" })
|
|
11307
|
+
]
|
|
11308
|
+
}
|
|
11309
|
+
),
|
|
11310
|
+
onShare && /* @__PURE__ */ jsxs56(
|
|
11311
|
+
DropdownMenuItem,
|
|
11312
|
+
{
|
|
11313
|
+
onClick: () => onShare(file),
|
|
11314
|
+
className: "cursor-pointer text-xs flex items-center gap-2 py-1.5",
|
|
11315
|
+
children: [
|
|
11316
|
+
/* @__PURE__ */ jsx94(Share22, { className: "h-3.5 w-3.5 text-indigo-500" }),
|
|
11317
|
+
/* @__PURE__ */ jsx94("span", { children: "Share" })
|
|
11318
|
+
]
|
|
11319
|
+
}
|
|
11320
|
+
),
|
|
11321
|
+
onRename && /* @__PURE__ */ jsxs56(
|
|
11322
|
+
DropdownMenuItem,
|
|
11323
|
+
{
|
|
11324
|
+
onClick: () => onRename(file),
|
|
11325
|
+
className: "cursor-pointer text-xs flex items-center gap-2 py-1.5",
|
|
11326
|
+
children: [
|
|
11327
|
+
/* @__PURE__ */ jsx94(Pencil3, { className: "h-3.5 w-3.5 text-purple-500" }),
|
|
11328
|
+
/* @__PURE__ */ jsx94("span", { children: "Rename" })
|
|
11329
|
+
]
|
|
11330
|
+
}
|
|
11331
|
+
),
|
|
11332
|
+
onDelete && /* @__PURE__ */ jsxs56(Fragment3, { children: [
|
|
11333
|
+
/* @__PURE__ */ jsx94(DropdownMenuSeparator, {}),
|
|
11334
|
+
/* @__PURE__ */ jsxs56(
|
|
11335
|
+
DropdownMenuItem,
|
|
11336
|
+
{
|
|
11337
|
+
onClick: () => onDelete(file),
|
|
11338
|
+
className: "cursor-pointer text-xs flex items-center gap-2 py-1.5 text-rose-500 hover:text-rose-600 hover:bg-rose-50 dark:hover:bg-rose-950/30 rounded-md",
|
|
11339
|
+
children: [
|
|
11340
|
+
/* @__PURE__ */ jsx94(Trash26, { className: "h-3.5 w-3.5 text-rose-500" }),
|
|
11341
|
+
/* @__PURE__ */ jsx94("span", { children: "Delete" })
|
|
11342
|
+
]
|
|
11343
|
+
}
|
|
11344
|
+
)
|
|
11345
|
+
] })
|
|
11346
|
+
] })
|
|
11347
|
+
] })
|
|
11348
|
+
] }) })
|
|
11349
|
+
]
|
|
11350
|
+
}
|
|
11351
|
+
);
|
|
11352
|
+
}
|
|
11353
|
+
return /* @__PURE__ */ jsxs56(
|
|
11354
|
+
"div",
|
|
11355
|
+
{
|
|
11356
|
+
onClick: () => onSelect?.(file),
|
|
11357
|
+
className: cn(
|
|
11358
|
+
"group relative flex flex-col justify-between overflow-hidden rounded-2xl border border-border/80 bg-card p-3.5 shadow-2xs transition-all duration-200 hover:shadow-md hover:border-indigo-300 dark:hover:border-indigo-700/60 cursor-pointer select-none",
|
|
11359
|
+
isSelected && "border-indigo-500 ring-2 ring-indigo-500/20 bg-indigo-500/5",
|
|
11360
|
+
className
|
|
11361
|
+
),
|
|
11362
|
+
children: [
|
|
11363
|
+
/* @__PURE__ */ jsxs56("div", { className: "relative mb-3 flex items-center justify-center overflow-hidden rounded-xl bg-muted/20 border border-border/40 min-h-[105px]", children: [
|
|
11364
|
+
isImage && file.fileUrl ? /* @__PURE__ */ jsx94(
|
|
11365
|
+
"img",
|
|
11366
|
+
{
|
|
11367
|
+
src: file.fileUrl,
|
|
11368
|
+
alt: file.fileName,
|
|
11369
|
+
className: "h-28 w-full object-cover transition-transform duration-300 group-hover:scale-105",
|
|
11370
|
+
loading: "lazy"
|
|
11371
|
+
}
|
|
11372
|
+
) : /* @__PURE__ */ jsx94(
|
|
11373
|
+
"div",
|
|
11374
|
+
{
|
|
11375
|
+
className: cn(
|
|
11376
|
+
"flex h-16 w-16 items-center justify-center rounded-2xl border shadow-inner transition-transform duration-200 group-hover:scale-110",
|
|
11377
|
+
theme.bg,
|
|
11378
|
+
theme.border
|
|
11379
|
+
),
|
|
11380
|
+
children: isPdf ? /* @__PURE__ */ jsx94(FileText3, { className: cn("h-8 w-8", theme.text) }) : isVideo ? /* @__PURE__ */ jsx94(Film, { className: cn("h-8 w-8", theme.text) }) : isSheet ? /* @__PURE__ */ jsx94(FileSpreadsheet, { className: cn("h-8 w-8", theme.text) }) : isZip ? /* @__PURE__ */ jsx94(FileArchive, { className: cn("h-8 w-8", theme.text) }) : /* @__PURE__ */ jsx94(FileCode, { className: cn("h-8 w-8", theme.text) })
|
|
11381
|
+
}
|
|
11382
|
+
),
|
|
11383
|
+
/* @__PURE__ */ jsx94(
|
|
11384
|
+
Badge,
|
|
11385
|
+
{
|
|
11386
|
+
variant: "outline",
|
|
11387
|
+
className: cn(
|
|
11388
|
+
"absolute top-2 right-2 backdrop-blur-md text-[10px] font-bold px-1.5 py-0.5 shadow-2xs",
|
|
11389
|
+
theme.bg,
|
|
11390
|
+
theme.text,
|
|
11391
|
+
theme.border
|
|
11392
|
+
),
|
|
11393
|
+
children: file.category
|
|
11394
|
+
}
|
|
11395
|
+
)
|
|
11396
|
+
] }),
|
|
11397
|
+
/* @__PURE__ */ jsxs56("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
11398
|
+
/* @__PURE__ */ jsx94("h4", { className: "font-bold text-xs text-foreground truncate tracking-tight", title: file.fileName, children: file.fileName }),
|
|
11399
|
+
/* @__PURE__ */ jsxs56("div", { className: "flex items-center justify-between text-[11px] text-muted-foreground", children: [
|
|
11400
|
+
/* @__PURE__ */ jsx94("span", { className: "font-mono", children: formatBytes(file.fileSize) }),
|
|
11401
|
+
/* @__PURE__ */ jsx94("span", { className: "truncate", children: updatedTimeDisplay })
|
|
11402
|
+
] })
|
|
11403
|
+
] }),
|
|
11404
|
+
/* @__PURE__ */ jsxs56("div", { className: "mt-3 pt-2.5 flex items-center justify-between border-t border-border/50 text-muted-foreground", children: [
|
|
11405
|
+
/* @__PURE__ */ jsx94("span", { className: "text-[10px] text-muted-foreground/70 font-medium truncate max-w-[120px]", children: file.folderPath || file.section || "General" }),
|
|
11406
|
+
/* @__PURE__ */ jsxs56("div", { className: "flex items-center gap-1", children: [
|
|
11407
|
+
/* @__PURE__ */ jsx94(
|
|
11408
|
+
"button",
|
|
11409
|
+
{
|
|
11410
|
+
type: "button",
|
|
11411
|
+
onClick: (e) => {
|
|
11412
|
+
e.stopPropagation();
|
|
11413
|
+
onPreview?.(file);
|
|
11414
|
+
},
|
|
11415
|
+
className: "p-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
11416
|
+
title: "Preview file",
|
|
11417
|
+
children: /* @__PURE__ */ jsx94(Eye3, { className: "h-3.5 w-3.5" })
|
|
11418
|
+
}
|
|
11419
|
+
),
|
|
11420
|
+
/* @__PURE__ */ jsx94(
|
|
11421
|
+
"button",
|
|
11422
|
+
{
|
|
11423
|
+
type: "button",
|
|
11424
|
+
onClick: (e) => {
|
|
11425
|
+
e.stopPropagation();
|
|
11426
|
+
onDownload?.(file);
|
|
11427
|
+
},
|
|
11428
|
+
className: "p-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
11429
|
+
title: "Download file",
|
|
11430
|
+
children: /* @__PURE__ */ jsx94(Download2, { className: "h-3.5 w-3.5" })
|
|
11431
|
+
}
|
|
11432
|
+
),
|
|
11433
|
+
/* @__PURE__ */ jsxs56(DropdownMenu, { children: [
|
|
11434
|
+
/* @__PURE__ */ jsx94(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx94(
|
|
11435
|
+
"button",
|
|
11436
|
+
{
|
|
11437
|
+
type: "button",
|
|
11438
|
+
onClick: (e) => e.stopPropagation(),
|
|
11439
|
+
className: "p-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
11440
|
+
title: "More",
|
|
11441
|
+
children: /* @__PURE__ */ jsx94(MoreHorizontal4, { className: "h-3.5 w-3.5" })
|
|
11442
|
+
}
|
|
11443
|
+
) }),
|
|
11444
|
+
/* @__PURE__ */ jsxs56(DropdownMenuContent, { align: "end", className: "w-38 rounded-xl p-1 shadow-lg", children: [
|
|
11445
|
+
/* @__PURE__ */ jsxs56(
|
|
11446
|
+
DropdownMenuItem,
|
|
11447
|
+
{
|
|
11448
|
+
onClick: () => onPreview?.(file),
|
|
11449
|
+
className: "cursor-pointer text-xs flex items-center gap-2 py-1.5",
|
|
11450
|
+
children: [
|
|
11451
|
+
/* @__PURE__ */ jsx94(Eye3, { className: "h-3.5 w-3.5 text-blue-500" }),
|
|
11452
|
+
/* @__PURE__ */ jsx94("span", { children: "Preview" })
|
|
11453
|
+
]
|
|
11454
|
+
}
|
|
11455
|
+
),
|
|
11456
|
+
/* @__PURE__ */ jsxs56(
|
|
11457
|
+
DropdownMenuItem,
|
|
11458
|
+
{
|
|
11459
|
+
onClick: () => onDownload?.(file),
|
|
11460
|
+
className: "cursor-pointer text-xs flex items-center gap-2 py-1.5",
|
|
11461
|
+
children: [
|
|
11462
|
+
/* @__PURE__ */ jsx94(Download2, { className: "h-3.5 w-3.5 text-emerald-500" }),
|
|
11463
|
+
/* @__PURE__ */ jsx94("span", { children: "Download" })
|
|
11464
|
+
]
|
|
11465
|
+
}
|
|
11466
|
+
),
|
|
11467
|
+
/* @__PURE__ */ jsxs56(
|
|
11468
|
+
DropdownMenuItem,
|
|
11469
|
+
{
|
|
11470
|
+
onClick: () => onCopyLink?.(file),
|
|
11471
|
+
className: "cursor-pointer text-xs flex items-center gap-2 py-1.5",
|
|
11472
|
+
children: [
|
|
11473
|
+
/* @__PURE__ */ jsx94(Copy3, { className: "h-3.5 w-3.5 text-amber-500" }),
|
|
11474
|
+
/* @__PURE__ */ jsx94("span", { children: "Copy Link" })
|
|
11475
|
+
]
|
|
11476
|
+
}
|
|
11477
|
+
),
|
|
11478
|
+
onDelete && /* @__PURE__ */ jsxs56(Fragment3, { children: [
|
|
11479
|
+
/* @__PURE__ */ jsx94(DropdownMenuSeparator, {}),
|
|
11480
|
+
/* @__PURE__ */ jsxs56(
|
|
11481
|
+
DropdownMenuItem,
|
|
11482
|
+
{
|
|
11483
|
+
onClick: () => onDelete(file),
|
|
11484
|
+
className: "cursor-pointer text-xs flex items-center gap-2 py-1.5 text-rose-500 hover:text-rose-600 hover:bg-rose-50 dark:hover:bg-rose-950/30 rounded-md",
|
|
11485
|
+
children: [
|
|
11486
|
+
/* @__PURE__ */ jsx94(Trash26, { className: "h-3.5 w-3.5 text-rose-500" }),
|
|
11487
|
+
/* @__PURE__ */ jsx94("span", { children: "Delete" })
|
|
11488
|
+
]
|
|
11489
|
+
}
|
|
11490
|
+
)
|
|
11491
|
+
] })
|
|
11492
|
+
] })
|
|
11493
|
+
] })
|
|
11494
|
+
] })
|
|
11495
|
+
] })
|
|
11496
|
+
]
|
|
11497
|
+
}
|
|
11498
|
+
);
|
|
11499
|
+
}
|
|
11500
|
+
|
|
11501
|
+
// src/design-system/components/files/folder-tree-item.tsx
|
|
11502
|
+
import { FolderOpen, ChevronDown as ChevronDown3, ChevronRight as ChevronRight7, Folder } from "lucide-react";
|
|
11503
|
+
import { jsx as jsx95, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
11504
|
+
function FolderTreeItem({
|
|
11505
|
+
folder,
|
|
11506
|
+
isFolderActive,
|
|
11507
|
+
isExpanded,
|
|
11508
|
+
onToggleExpand,
|
|
11509
|
+
onSelectFolder,
|
|
11510
|
+
className
|
|
11511
|
+
}) {
|
|
11512
|
+
const isLevel0 = folder.level === 0;
|
|
11513
|
+
const isLevel1 = folder.level === 1;
|
|
11514
|
+
const isLevel2 = folder.level === 2;
|
|
11515
|
+
const hasChildren = isLevel0 || isLevel1;
|
|
11516
|
+
return /* @__PURE__ */ jsxs57(
|
|
11517
|
+
"div",
|
|
11518
|
+
{
|
|
11519
|
+
id: `folder-card-${folder.id}`,
|
|
11520
|
+
onClick: () => {
|
|
11521
|
+
if (hasChildren) {
|
|
11522
|
+
onToggleExpand(folder.id);
|
|
11523
|
+
} else {
|
|
11524
|
+
onSelectFolder(folder);
|
|
11525
|
+
}
|
|
11526
|
+
},
|
|
11527
|
+
className: cn(
|
|
11528
|
+
"group relative flex cursor-pointer items-center justify-between gap-2 rounded-xl py-1.5 px-2 transition-all duration-200 select-none border",
|
|
11529
|
+
isLevel0 && "font-bold bg-muted/20 border-border/50 my-1",
|
|
11530
|
+
isLevel1 && "ml-3 border-border/40 my-0.5",
|
|
11531
|
+
isLevel2 && "ml-6 border-transparent hover:bg-muted/40 my-0.5",
|
|
11532
|
+
isFolderActive ? "border-indigo-300 bg-indigo-500/15 text-indigo-600 dark:border-indigo-800 dark:bg-indigo-950/40 dark:text-indigo-400 font-bold shadow-2xs" : "bg-card hover:bg-indigo-500/5 hover:border-indigo-200/40",
|
|
11533
|
+
className
|
|
11534
|
+
),
|
|
11535
|
+
children: [
|
|
11536
|
+
isFolderActive && /* @__PURE__ */ jsx95("div", { className: "absolute top-1 bottom-1 left-0 w-1 rounded-l-full bg-indigo-600" }),
|
|
11537
|
+
/* @__PURE__ */ jsxs57("div", { className: "flex items-center gap-1.5 min-w-0 flex-1", children: [
|
|
11538
|
+
hasChildren && /* @__PURE__ */ jsx95(
|
|
11539
|
+
"button",
|
|
11540
|
+
{
|
|
11541
|
+
type: "button",
|
|
11542
|
+
onClick: (e) => onToggleExpand(folder.id, e),
|
|
11543
|
+
className: "flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer",
|
|
11544
|
+
children: isExpanded ? /* @__PURE__ */ jsx95(ChevronDown3, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx95(ChevronRight7, { className: "h-3 w-3" })
|
|
11545
|
+
}
|
|
11546
|
+
),
|
|
11547
|
+
/* @__PURE__ */ jsx95(
|
|
11548
|
+
"div",
|
|
11549
|
+
{
|
|
11550
|
+
className: cn(
|
|
11551
|
+
"flex shrink-0 items-center justify-center rounded-lg text-indigo-600 dark:text-indigo-400 transition-colors",
|
|
11552
|
+
isLevel0 ? "h-6 w-6 border border-indigo-200/40 bg-indigo-500/10" : isLevel1 ? "h-5.5 w-5.5 border border-indigo-200/30 bg-indigo-500/5" : "h-5 w-5"
|
|
11553
|
+
),
|
|
11554
|
+
children: isExpanded ? /* @__PURE__ */ jsx95(
|
|
11555
|
+
FolderOpen,
|
|
11556
|
+
{
|
|
11557
|
+
className: isLevel0 ? "h-3.5 w-3.5" : isLevel1 ? "h-3 w-3" : "h-3 w-3 text-indigo-500"
|
|
11558
|
+
}
|
|
11559
|
+
) : /* @__PURE__ */ jsx95(
|
|
11560
|
+
Folder,
|
|
11561
|
+
{
|
|
11562
|
+
className: isLevel0 ? "h-3.5 w-3.5" : isLevel1 ? "h-3 w-3" : "h-3 w-3 text-indigo-500"
|
|
11563
|
+
}
|
|
11564
|
+
)
|
|
11565
|
+
}
|
|
11566
|
+
),
|
|
11567
|
+
/* @__PURE__ */ jsx95(
|
|
11568
|
+
"span",
|
|
11569
|
+
{
|
|
11570
|
+
className: cn(
|
|
11571
|
+
"truncate text-foreground",
|
|
11572
|
+
isLevel0 ? "text-xs font-bold" : isLevel1 ? "text-[11px] font-semibold" : "text-[11px] font-medium",
|
|
11573
|
+
isFolderActive && "text-indigo-600 dark:text-indigo-400"
|
|
11574
|
+
),
|
|
11575
|
+
children: folder.name
|
|
11576
|
+
}
|
|
11577
|
+
)
|
|
11578
|
+
] }),
|
|
11579
|
+
/* @__PURE__ */ jsx95(
|
|
11580
|
+
Badge,
|
|
11581
|
+
{
|
|
11582
|
+
variant: isFolderActive ? "default" : "secondary",
|
|
11583
|
+
className: cn(
|
|
11584
|
+
"text-[10px] px-1.5 py-0 h-4 min-w-4 flex items-center justify-center font-mono",
|
|
11585
|
+
isFolderActive ? "bg-indigo-600 text-white" : "bg-muted text-muted-foreground group-hover:bg-indigo-500/10 group-hover:text-indigo-600"
|
|
11586
|
+
),
|
|
11587
|
+
children: folder.fileCount
|
|
11588
|
+
}
|
|
11589
|
+
)
|
|
11590
|
+
]
|
|
11591
|
+
}
|
|
11592
|
+
);
|
|
11593
|
+
}
|
|
11594
|
+
|
|
11595
|
+
// src/design-system/components/files/storage-stat-card.tsx
|
|
11596
|
+
import { HardDrive, FileText as FileText4, Image as ImageIcon2, Film as Film2, Database, ArrowUpRight as ArrowUpRight2 } from "lucide-react";
|
|
11597
|
+
import { jsx as jsx96, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
11598
|
+
function StorageStatCard({
|
|
11599
|
+
totalFiles,
|
|
11600
|
+
totalSizeBytes = 0,
|
|
11601
|
+
maxStorageBytes = 10 * 1024 * 1024 * 1024,
|
|
11602
|
+
// 10 GB default
|
|
11603
|
+
stats,
|
|
11604
|
+
onViewAllFiles,
|
|
11605
|
+
onUploadClick,
|
|
11606
|
+
className
|
|
11607
|
+
}) {
|
|
11608
|
+
const percentUsed = Math.min(
|
|
11609
|
+
100,
|
|
11610
|
+
Math.max(1, Math.round(totalSizeBytes / (maxStorageBytes || 1) * 100))
|
|
11611
|
+
);
|
|
11612
|
+
const defaultStats = stats || [
|
|
11613
|
+
{
|
|
11614
|
+
label: "Documents & PDFs",
|
|
11615
|
+
count: Math.round(totalFiles * 0.4),
|
|
11616
|
+
sizeBytes: Math.round(totalSizeBytes * 0.45),
|
|
11617
|
+
colorClass: "bg-red-500",
|
|
11618
|
+
icon: /* @__PURE__ */ jsx96(FileText4, { className: "h-4 w-4 text-red-500" })
|
|
11619
|
+
},
|
|
11620
|
+
{
|
|
11621
|
+
label: "Images & Photos",
|
|
11622
|
+
count: Math.round(totalFiles * 0.35),
|
|
11623
|
+
sizeBytes: Math.round(totalSizeBytes * 0.3),
|
|
11624
|
+
colorClass: "bg-amber-500",
|
|
11625
|
+
icon: /* @__PURE__ */ jsx96(ImageIcon2, { className: "h-4 w-4 text-amber-500" })
|
|
11626
|
+
},
|
|
11627
|
+
{
|
|
11628
|
+
label: "Media & Videos",
|
|
11629
|
+
count: Math.round(totalFiles * 0.15),
|
|
11630
|
+
sizeBytes: Math.round(totalSizeBytes * 0.2),
|
|
11631
|
+
colorClass: "bg-purple-500",
|
|
11632
|
+
icon: /* @__PURE__ */ jsx96(Film2, { className: "h-4 w-4 text-purple-500" })
|
|
11633
|
+
},
|
|
11634
|
+
{
|
|
11635
|
+
label: "Other & Archives",
|
|
11636
|
+
count: Math.max(0, totalFiles - Math.round(totalFiles * 0.9)),
|
|
11637
|
+
sizeBytes: Math.round(totalSizeBytes * 0.05),
|
|
11638
|
+
colorClass: "bg-indigo-500",
|
|
11639
|
+
icon: /* @__PURE__ */ jsx96(Database, { className: "h-4 w-4 text-indigo-500" })
|
|
11640
|
+
}
|
|
11641
|
+
];
|
|
11642
|
+
return /* @__PURE__ */ jsxs58(
|
|
11643
|
+
"div",
|
|
11644
|
+
{
|
|
11645
|
+
className: cn(
|
|
11646
|
+
"flex flex-col gap-4 rounded-2xl border border-border/80 bg-card p-4 shadow-2xs select-none",
|
|
11647
|
+
className
|
|
11648
|
+
),
|
|
11649
|
+
children: [
|
|
11650
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex items-center justify-between", children: [
|
|
11651
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex items-center gap-2.5", children: [
|
|
11652
|
+
/* @__PURE__ */ jsx96("div", { className: "flex h-9 w-9 items-center justify-center rounded-xl bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border border-indigo-200/40", children: /* @__PURE__ */ jsx96(HardDrive, { className: "h-5 w-5" }) }),
|
|
11653
|
+
/* @__PURE__ */ jsxs58("div", { children: [
|
|
11654
|
+
/* @__PURE__ */ jsx96("h3", { className: "text-xs font-bold text-foreground", children: "Storage Overview" }),
|
|
11655
|
+
/* @__PURE__ */ jsxs58("p", { className: "text-[11px] text-muted-foreground", children: [
|
|
11656
|
+
totalFiles,
|
|
11657
|
+
" items stored in workspace"
|
|
11658
|
+
] })
|
|
11659
|
+
] })
|
|
11660
|
+
] }),
|
|
11661
|
+
/* @__PURE__ */ jsxs58("div", { className: "text-right", children: [
|
|
11662
|
+
/* @__PURE__ */ jsx96("p", { className: "text-xs font-bold text-foreground font-mono", children: formatBytes(totalSizeBytes) }),
|
|
11663
|
+
/* @__PURE__ */ jsxs58("p", { className: "text-[10px] text-muted-foreground font-mono", children: [
|
|
11664
|
+
"of ",
|
|
11665
|
+
formatBytes(maxStorageBytes)
|
|
11666
|
+
] })
|
|
11667
|
+
] })
|
|
11668
|
+
] }),
|
|
11669
|
+
/* @__PURE__ */ jsxs58("div", { className: "space-y-1.5", children: [
|
|
11670
|
+
/* @__PURE__ */ jsx96("div", { className: "flex h-2.5 w-full overflow-hidden rounded-full bg-muted/60 p-0.5 border border-border/40", children: /* @__PURE__ */ jsx96(
|
|
11671
|
+
"div",
|
|
11672
|
+
{
|
|
11673
|
+
className: "h-full rounded-full bg-linear-to-r from-indigo-500 via-purple-500 to-amber-500 transition-all duration-500",
|
|
11674
|
+
style: { width: `${percentUsed}%` }
|
|
11675
|
+
}
|
|
11676
|
+
) }),
|
|
11677
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex justify-between text-[10px] text-muted-foreground", children: [
|
|
11678
|
+
/* @__PURE__ */ jsxs58("span", { children: [
|
|
11679
|
+
percentUsed,
|
|
11680
|
+
"% capacity utilized"
|
|
11681
|
+
] }),
|
|
11682
|
+
/* @__PURE__ */ jsxs58("span", { children: [
|
|
11683
|
+
formatBytes(Math.max(0, maxStorageBytes - totalSizeBytes)),
|
|
11684
|
+
" available"
|
|
11685
|
+
] })
|
|
11686
|
+
] })
|
|
11687
|
+
] }),
|
|
11688
|
+
/* @__PURE__ */ jsx96("div", { className: "grid grid-cols-2 gap-2 pt-1", children: defaultStats.map((item, idx) => /* @__PURE__ */ jsxs58(
|
|
11689
|
+
"div",
|
|
11690
|
+
{
|
|
11691
|
+
className: "flex items-center gap-2 rounded-xl border border-border/40 bg-muted/20 p-2",
|
|
11692
|
+
children: [
|
|
11693
|
+
/* @__PURE__ */ jsx96("div", { className: "shrink-0", children: item.icon }),
|
|
11694
|
+
/* @__PURE__ */ jsxs58("div", { className: "min-w-0 flex-1", children: [
|
|
11695
|
+
/* @__PURE__ */ jsx96("p", { className: "truncate text-[11px] font-semibold text-foreground", children: item.label }),
|
|
11696
|
+
/* @__PURE__ */ jsxs58("div", { className: "flex items-center justify-between text-[10px] text-muted-foreground", children: [
|
|
11697
|
+
/* @__PURE__ */ jsxs58("span", { children: [
|
|
11698
|
+
item.count,
|
|
11699
|
+
" files"
|
|
11700
|
+
] }),
|
|
11701
|
+
/* @__PURE__ */ jsx96("span", { className: "font-mono", children: formatBytes(item.sizeBytes) })
|
|
11702
|
+
] })
|
|
11703
|
+
] })
|
|
11704
|
+
]
|
|
11705
|
+
},
|
|
11706
|
+
idx
|
|
11707
|
+
)) }),
|
|
11708
|
+
(onViewAllFiles || onUploadClick) && /* @__PURE__ */ jsxs58("div", { className: "flex items-center justify-between pt-2 border-t border-border/50", children: [
|
|
11709
|
+
onViewAllFiles && /* @__PURE__ */ jsxs58(
|
|
11710
|
+
"button",
|
|
11711
|
+
{
|
|
11712
|
+
type: "button",
|
|
11713
|
+
onClick: onViewAllFiles,
|
|
11714
|
+
className: "text-xs font-semibold text-indigo-600 dark:text-indigo-400 hover:underline flex items-center gap-1 cursor-pointer",
|
|
11715
|
+
children: [
|
|
11716
|
+
/* @__PURE__ */ jsx96("span", { children: "Explore All Files" }),
|
|
11717
|
+
/* @__PURE__ */ jsx96(ArrowUpRight2, { className: "h-3.5 w-3.5" })
|
|
11718
|
+
]
|
|
11719
|
+
}
|
|
11720
|
+
),
|
|
11721
|
+
onUploadClick && /* @__PURE__ */ jsx96(
|
|
11722
|
+
"button",
|
|
11723
|
+
{
|
|
11724
|
+
type: "button",
|
|
11725
|
+
onClick: onUploadClick,
|
|
11726
|
+
className: "text-xs font-semibold bg-indigo-600 text-white hover:bg-indigo-700 px-3 py-1 rounded-lg transition-colors cursor-pointer",
|
|
11727
|
+
children: "Upload New"
|
|
11728
|
+
}
|
|
11729
|
+
)
|
|
11730
|
+
] })
|
|
11731
|
+
]
|
|
11732
|
+
}
|
|
11733
|
+
);
|
|
11734
|
+
}
|
|
11735
|
+
|
|
11736
|
+
// src/design-system/components/files/user-file-cards-view.tsx
|
|
11737
|
+
import { useState as useState12, useMemo as useMemo7 } from "react";
|
|
11738
|
+
import {
|
|
11739
|
+
Search as Search6,
|
|
11740
|
+
X as X5,
|
|
11741
|
+
FolderOpen as FolderOpen2,
|
|
11742
|
+
ArrowLeft as ArrowLeft3,
|
|
11743
|
+
ArrowUpDown,
|
|
11744
|
+
LayoutGrid,
|
|
11745
|
+
Table as TableIcon,
|
|
11746
|
+
ChevronLeft as ChevronLeft2,
|
|
11747
|
+
ChevronRight as ChevronRight9,
|
|
11748
|
+
Upload,
|
|
11749
|
+
Trash2 as Trash28,
|
|
11750
|
+
Download as Download3
|
|
11751
|
+
} from "lucide-react";
|
|
11752
|
+
|
|
11753
|
+
// src/features/Message/components/chat/header-actions.tsx
|
|
11754
|
+
import {
|
|
11755
|
+
Bell as Bell4,
|
|
11756
|
+
Flag as Flag4,
|
|
11757
|
+
MoreVertical as MoreVertical3,
|
|
11758
|
+
Reply,
|
|
11759
|
+
Forward,
|
|
11760
|
+
Pin as Pin4,
|
|
11761
|
+
Star as Star4,
|
|
11762
|
+
Heart as Heart4,
|
|
11763
|
+
Archive as Archive4,
|
|
11764
|
+
Trash2 as Trash27,
|
|
11765
|
+
X as X4
|
|
11766
|
+
} from "lucide-react";
|
|
11767
|
+
import { toast as toast2 } from "sonner";
|
|
11768
|
+
import { jsx as jsx97, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
11769
|
+
function HeaderActions({
|
|
11770
|
+
onDelete,
|
|
11771
|
+
onDownload,
|
|
11772
|
+
onPrint,
|
|
11773
|
+
onShare,
|
|
11774
|
+
onReply,
|
|
11775
|
+
onForward,
|
|
11776
|
+
onPin,
|
|
11777
|
+
onStar,
|
|
11778
|
+
onFavorite,
|
|
11779
|
+
onArchive,
|
|
11780
|
+
onActionThis,
|
|
11781
|
+
onClose
|
|
11782
|
+
}) {
|
|
11783
|
+
return /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-1 shrink-0 select-none", children: [
|
|
11784
|
+
/* @__PURE__ */ jsx97(
|
|
11785
|
+
"button",
|
|
11786
|
+
{
|
|
11787
|
+
type: "button",
|
|
11788
|
+
onClick: () => {
|
|
11789
|
+
if (onActionThis) onActionThis();
|
|
11790
|
+
else toast2.info("Act on this option selected");
|
|
11791
|
+
},
|
|
11792
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-amber-500 hover:text-amber-600 transition-colors cursor-pointer",
|
|
11793
|
+
title: "Act on this",
|
|
11794
|
+
children: /* @__PURE__ */ jsx97(Bell4, { className: "h-4.5 w-4.5" })
|
|
11795
|
+
}
|
|
11796
|
+
),
|
|
11797
|
+
/* @__PURE__ */ jsx97(
|
|
11798
|
+
"button",
|
|
11799
|
+
{
|
|
11800
|
+
type: "button",
|
|
11801
|
+
onClick: () => toast2.success("Flagged item"),
|
|
11802
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
11803
|
+
title: "Flag",
|
|
11804
|
+
children: /* @__PURE__ */ jsx97(Flag4, { className: "h-4.5 w-4.5" })
|
|
11805
|
+
}
|
|
11806
|
+
),
|
|
11807
|
+
/* @__PURE__ */ jsxs59(DropdownMenu, { children: [
|
|
11808
|
+
/* @__PURE__ */ jsx97(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx97(
|
|
11809
|
+
"button",
|
|
11810
|
+
{
|
|
11811
|
+
type: "button",
|
|
11812
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
|
|
11813
|
+
title: "More options",
|
|
11814
|
+
children: /* @__PURE__ */ jsx97(MoreVertical3, { className: "h-4.5 w-4.5" })
|
|
11815
|
+
}
|
|
11816
|
+
) }),
|
|
11817
|
+
/* @__PURE__ */ jsxs59(
|
|
11818
|
+
DropdownMenuContent,
|
|
11819
|
+
{
|
|
11820
|
+
align: "end",
|
|
11821
|
+
className: "w-48 border border-border/80 bg-background shadow-lg p-1 space-y-0.5",
|
|
11822
|
+
children: [
|
|
11823
|
+
/* @__PURE__ */ jsx97(
|
|
11824
|
+
DropdownMenuItem,
|
|
11825
|
+
{
|
|
11826
|
+
onClick: () => {
|
|
11827
|
+
if (onReply) onReply();
|
|
11828
|
+
else toast2.info("Reply option selected");
|
|
11829
|
+
},
|
|
11830
|
+
className: "cursor-pointer text-xs flex items-center justify-between py-2 px-2.5 font-medium hover:bg-muted/80 rounded-md",
|
|
11831
|
+
children: /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2.5", children: [
|
|
11832
|
+
/* @__PURE__ */ jsx97(Reply, { className: "h-4 w-4 text-blue-500" }),
|
|
11833
|
+
/* @__PURE__ */ jsx97("span", { className: "text-foreground", children: "Reply" })
|
|
11834
|
+
] })
|
|
11835
|
+
}
|
|
11836
|
+
),
|
|
11837
|
+
/* @__PURE__ */ jsx97(
|
|
11838
|
+
DropdownMenuItem,
|
|
11839
|
+
{
|
|
11840
|
+
onClick: () => {
|
|
11841
|
+
if (onForward) onForward();
|
|
11842
|
+
else toast2.info("Forward option selected");
|
|
11843
|
+
},
|
|
11844
|
+
className: "cursor-pointer text-xs flex items-center justify-between py-2 px-2.5 font-medium hover:bg-muted/80 rounded-md",
|
|
11845
|
+
children: /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2.5", children: [
|
|
11846
|
+
/* @__PURE__ */ jsx97(Forward, { className: "h-4 w-4 text-sky-400" }),
|
|
11847
|
+
/* @__PURE__ */ jsx97("span", { className: "text-foreground", children: "Forward" })
|
|
11848
|
+
] })
|
|
11849
|
+
}
|
|
11850
|
+
),
|
|
11851
|
+
/* @__PURE__ */ jsx97(
|
|
11852
|
+
DropdownMenuItem,
|
|
11853
|
+
{
|
|
11854
|
+
onClick: () => {
|
|
11855
|
+
if (onPin) onPin();
|
|
11856
|
+
else toast2.success("Message pinned");
|
|
11857
|
+
},
|
|
11858
|
+
className: "cursor-pointer text-xs flex items-center justify-between py-2 px-2.5 font-medium hover:bg-muted/80 rounded-md",
|
|
11859
|
+
children: /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2.5", children: [
|
|
11860
|
+
/* @__PURE__ */ jsx97(Pin4, { className: "h-4 w-4 text-purple-500" }),
|
|
11861
|
+
/* @__PURE__ */ jsx97("span", { className: "text-foreground", children: "Pin Message" })
|
|
11862
|
+
] })
|
|
11863
|
+
}
|
|
11864
|
+
),
|
|
11865
|
+
/* @__PURE__ */ jsx97(
|
|
11866
|
+
DropdownMenuItem,
|
|
11867
|
+
{
|
|
11868
|
+
onClick: () => {
|
|
11869
|
+
if (onStar) onStar();
|
|
11870
|
+
else toast2.success("Starred successfully");
|
|
11871
|
+
},
|
|
11872
|
+
className: "cursor-pointer text-xs flex items-center justify-between py-2 px-2.5 font-medium hover:bg-muted/80 rounded-md",
|
|
11873
|
+
children: /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2.5", children: [
|
|
11874
|
+
/* @__PURE__ */ jsx97(Star4, { className: "h-4 w-4 text-amber-500" }),
|
|
11875
|
+
/* @__PURE__ */ jsx97("span", { className: "text-foreground", children: "Star" })
|
|
11876
|
+
] })
|
|
11877
|
+
}
|
|
11878
|
+
),
|
|
11879
|
+
/* @__PURE__ */ jsx97(
|
|
11880
|
+
DropdownMenuItem,
|
|
11881
|
+
{
|
|
11882
|
+
onClick: () => {
|
|
11883
|
+
if (onFavorite) onFavorite();
|
|
11884
|
+
else toast2.success("Added to favorites");
|
|
11885
|
+
},
|
|
11886
|
+
className: "cursor-pointer text-xs flex items-center justify-between py-2 px-2.5 font-medium hover:bg-muted/80 rounded-md",
|
|
11887
|
+
children: /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2.5", children: [
|
|
11888
|
+
/* @__PURE__ */ jsx97(Heart4, { className: "h-4 w-4 text-rose-500" }),
|
|
11889
|
+
/* @__PURE__ */ jsx97("span", { className: "text-foreground", children: "Favorite" })
|
|
11890
|
+
] })
|
|
11891
|
+
}
|
|
11892
|
+
),
|
|
11893
|
+
/* @__PURE__ */ jsx97(
|
|
11894
|
+
DropdownMenuItem,
|
|
11895
|
+
{
|
|
11896
|
+
onClick: () => toast2.success("Flagged message"),
|
|
11897
|
+
className: "cursor-pointer text-xs flex items-center justify-between py-2 px-2.5 font-medium hover:bg-muted/80 rounded-md",
|
|
11898
|
+
children: /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2.5", children: [
|
|
11899
|
+
/* @__PURE__ */ jsx97(Flag4, { className: "h-4 w-4 text-red-500" }),
|
|
11900
|
+
/* @__PURE__ */ jsx97("span", { className: "text-foreground", children: "Flag" })
|
|
11901
|
+
] })
|
|
11902
|
+
}
|
|
11903
|
+
),
|
|
11904
|
+
/* @__PURE__ */ jsx97(
|
|
11905
|
+
DropdownMenuItem,
|
|
11906
|
+
{
|
|
11907
|
+
onClick: () => {
|
|
11908
|
+
if (onArchive) onArchive();
|
|
11909
|
+
else toast2.success("Archived successfully");
|
|
11910
|
+
},
|
|
11911
|
+
className: "cursor-pointer text-xs flex items-center justify-between py-2 px-2.5 font-medium hover:bg-muted/80 rounded-md",
|
|
11912
|
+
children: /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2.5", children: [
|
|
11913
|
+
/* @__PURE__ */ jsx97(Archive4, { className: "h-4 w-4 text-indigo-500" }),
|
|
11914
|
+
/* @__PURE__ */ jsx97("span", { className: "text-foreground", children: "Archive" })
|
|
11915
|
+
] })
|
|
11916
|
+
}
|
|
11917
|
+
),
|
|
11918
|
+
/* @__PURE__ */ jsx97(
|
|
11919
|
+
DropdownMenuItem,
|
|
11920
|
+
{
|
|
11921
|
+
onClick: () => {
|
|
11922
|
+
if (onActionThis) onActionThis();
|
|
11923
|
+
else toast2.info("Action This selected");
|
|
11924
|
+
},
|
|
11925
|
+
className: "cursor-pointer text-xs flex items-center justify-between py-2 px-2.5 font-medium hover:bg-muted/80 rounded-md",
|
|
11926
|
+
children: /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2.5", children: [
|
|
11927
|
+
/* @__PURE__ */ jsx97(Bell4, { className: "h-4 w-4 text-amber-500" }),
|
|
11928
|
+
/* @__PURE__ */ jsx97("span", { className: "text-foreground", children: "Action This" })
|
|
11929
|
+
] })
|
|
11930
|
+
}
|
|
11931
|
+
),
|
|
11932
|
+
/* @__PURE__ */ jsx97(
|
|
11933
|
+
DropdownMenuItem,
|
|
11934
|
+
{
|
|
11935
|
+
onClick: () => {
|
|
11936
|
+
if (onDelete) onDelete();
|
|
11937
|
+
else toast2.success("Item deleted");
|
|
11938
|
+
},
|
|
11939
|
+
className: "cursor-pointer text-xs flex items-center justify-between py-2 px-2.5 font-medium hover:bg-red-500/10 rounded-md text-red-500 focus:text-red-500",
|
|
11940
|
+
children: /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2.5", children: [
|
|
11941
|
+
/* @__PURE__ */ jsx97(Trash27, { className: "h-4 w-4 text-red-500" }),
|
|
11942
|
+
/* @__PURE__ */ jsx97("span", { className: "font-semibold text-red-500", children: "Delete" })
|
|
11943
|
+
] })
|
|
11944
|
+
}
|
|
11945
|
+
)
|
|
11946
|
+
]
|
|
11947
|
+
}
|
|
11948
|
+
)
|
|
11949
|
+
] }),
|
|
11950
|
+
onClose && /* @__PURE__ */ jsx97(
|
|
11951
|
+
"button",
|
|
11952
|
+
{
|
|
11953
|
+
type: "button",
|
|
11954
|
+
onClick: onClose,
|
|
11955
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer ml-0.5",
|
|
11956
|
+
title: "Close",
|
|
11957
|
+
"aria-label": "Close",
|
|
11958
|
+
children: /* @__PURE__ */ jsx97(X4, { className: "h-4.5 w-4.5" })
|
|
11959
|
+
}
|
|
11960
|
+
)
|
|
11961
|
+
] });
|
|
11962
|
+
}
|
|
11963
|
+
|
|
11964
|
+
// src/design-system/components/files/user-file-cards-view.tsx
|
|
11965
|
+
import { jsx as jsx98, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
11966
|
+
var CATEGORY_TABS = [
|
|
11967
|
+
{ label: "All Files", value: "all" },
|
|
11968
|
+
{ label: "PDFs", value: "Pdf" },
|
|
11969
|
+
{ label: "Documents", value: "Doc" },
|
|
11970
|
+
{ label: "Spreadsheets", value: "Xls" },
|
|
11971
|
+
{ label: "Images", value: "Images" },
|
|
11972
|
+
{ label: "Videos", value: "Videos" },
|
|
11973
|
+
{ label: "Archives", value: "Zip" }
|
|
11974
|
+
];
|
|
11975
|
+
function UserFileCardsView({
|
|
11976
|
+
folder,
|
|
11977
|
+
files,
|
|
11978
|
+
selectedFileId,
|
|
11979
|
+
onSelectFileForPreview,
|
|
11980
|
+
onDownloadFile,
|
|
11981
|
+
onDeleteFile,
|
|
11982
|
+
onCopyLink,
|
|
11983
|
+
onRenameFile,
|
|
11984
|
+
onShareFile,
|
|
11985
|
+
onUploadClick,
|
|
11986
|
+
onBack,
|
|
11987
|
+
className
|
|
11988
|
+
}) {
|
|
11989
|
+
const [searchQuery, setSearchQuery] = useState12("");
|
|
11990
|
+
const [selectedCategory, setSelectedCategory] = useState12("all");
|
|
11991
|
+
const [sortBy, setSortBy] = useState12("date");
|
|
11992
|
+
const [sortOrder, setSortOrder] = useState12("desc");
|
|
11993
|
+
const [viewMode, setViewMode] = useState12("grid");
|
|
11994
|
+
const [currentPage, setCurrentPage] = useState12(1);
|
|
11995
|
+
const itemsPerPage = viewMode === "grid" ? 12 : 20;
|
|
11996
|
+
const [selectedIds, setSelectedIds] = useState12(/* @__PURE__ */ new Set());
|
|
11997
|
+
const filteredFiles = useMemo7(() => {
|
|
11998
|
+
return files.filter((f) => {
|
|
11999
|
+
const matchCategory = selectedCategory === "all" || f.category.toLowerCase() === selectedCategory.toLowerCase() || selectedCategory === "Xls" && (f.category === "Csv" || f.category === "Xls");
|
|
12000
|
+
const matchSearch = !searchQuery.trim() || f.fileName.toLowerCase().includes(searchQuery.toLowerCase()) || f.folderPath && f.folderPath.toLowerCase().includes(searchQuery.toLowerCase());
|
|
12001
|
+
return matchCategory && matchSearch;
|
|
12002
|
+
});
|
|
12003
|
+
}, [files, selectedCategory, searchQuery]);
|
|
12004
|
+
const sortedFiles = useMemo7(() => {
|
|
12005
|
+
return [...filteredFiles].sort((a, b) => {
|
|
12006
|
+
let compare = 0;
|
|
12007
|
+
if (sortBy === "date") {
|
|
12008
|
+
const timeA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
|
|
12009
|
+
const timeB = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
|
|
12010
|
+
compare = timeB - timeA;
|
|
12011
|
+
} else if (sortBy === "name") {
|
|
12012
|
+
compare = a.fileName.localeCompare(b.fileName);
|
|
12013
|
+
} else if (sortBy === "size") {
|
|
12014
|
+
compare = (b.fileSize || 0) - (a.fileSize || 0);
|
|
12015
|
+
}
|
|
12016
|
+
return sortOrder === "asc" ? -compare : compare;
|
|
12017
|
+
});
|
|
12018
|
+
}, [filteredFiles, sortBy, sortOrder]);
|
|
12019
|
+
const totalPages = Math.ceil(sortedFiles.length / itemsPerPage) || 1;
|
|
12020
|
+
const paginatedFiles = useMemo7(() => {
|
|
12021
|
+
const start = (currentPage - 1) * itemsPerPage;
|
|
12022
|
+
return sortedFiles.slice(start, start + itemsPerPage);
|
|
12023
|
+
}, [sortedFiles, currentPage, itemsPerPage]);
|
|
12024
|
+
const totalBytes = useMemo7(() => {
|
|
12025
|
+
return files.reduce((acc, curr) => acc + (curr.fileSize || 0), 0);
|
|
12026
|
+
}, [files]);
|
|
12027
|
+
const toggleSelectAll = () => {
|
|
12028
|
+
if (selectedIds.size === paginatedFiles.length) {
|
|
12029
|
+
setSelectedIds(/* @__PURE__ */ new Set());
|
|
12030
|
+
} else {
|
|
12031
|
+
setSelectedIds(new Set(paginatedFiles.map((f) => f.id)));
|
|
12032
|
+
}
|
|
12033
|
+
};
|
|
12034
|
+
const toggleSelectOne = (id) => {
|
|
12035
|
+
setSelectedIds((prev) => {
|
|
12036
|
+
const next = new Set(prev);
|
|
12037
|
+
if (next.has(id)) next.delete(id);
|
|
12038
|
+
else next.add(id);
|
|
12039
|
+
return next;
|
|
12040
|
+
});
|
|
12041
|
+
};
|
|
12042
|
+
const handleBulkDownload = () => {
|
|
12043
|
+
const toDownload = files.filter((f) => selectedIds.has(f.id));
|
|
12044
|
+
toDownload.forEach((f) => onDownloadFile?.(f));
|
|
12045
|
+
};
|
|
12046
|
+
const handleBulkDelete = () => {
|
|
12047
|
+
const toDelete = files.filter((f) => selectedIds.has(f.id));
|
|
12048
|
+
toDelete.forEach((f) => onDeleteFile?.(f));
|
|
12049
|
+
setSelectedIds(/* @__PURE__ */ new Set());
|
|
12050
|
+
};
|
|
12051
|
+
return /* @__PURE__ */ jsxs60(
|
|
12052
|
+
"div",
|
|
12053
|
+
{
|
|
12054
|
+
className: cn(
|
|
12055
|
+
"flex h-full min-h-0 w-full flex-1 flex-col overflow-hidden bg-background select-none",
|
|
12056
|
+
className
|
|
12057
|
+
),
|
|
12058
|
+
children: [
|
|
12059
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex items-center justify-between border-b border-border bg-background px-4 py-3 shrink-0", children: [
|
|
12060
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex items-center gap-2.5 min-w-0", children: [
|
|
12061
|
+
onBack && /* @__PURE__ */ jsx98(
|
|
12062
|
+
"button",
|
|
12063
|
+
{
|
|
12064
|
+
type: "button",
|
|
12065
|
+
onClick: onBack,
|
|
12066
|
+
className: "flex h-8 w-8 items-center justify-center rounded-xl text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer",
|
|
12067
|
+
title: "Back",
|
|
12068
|
+
children: /* @__PURE__ */ jsx98(ArrowLeft3, { className: "h-4 w-4" })
|
|
12069
|
+
}
|
|
12070
|
+
),
|
|
12071
|
+
/* @__PURE__ */ jsx98("div", { className: "flex h-10 w-10 items-center justify-center rounded-xl bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border border-indigo-200/50 shrink-0 shadow-2xs", children: /* @__PURE__ */ jsx98(FolderOpen2, { className: "h-5 w-5" }) }),
|
|
12072
|
+
/* @__PURE__ */ jsxs60("div", { className: "min-w-0", children: [
|
|
12073
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex items-center gap-2", children: [
|
|
12074
|
+
/* @__PURE__ */ jsx98("h2", { className: "truncate text-sm font-bold text-foreground tracking-tight", children: folder?.name || "All Files & Folders" }),
|
|
12075
|
+
/* @__PURE__ */ jsxs60(Badge, { variant: "secondary", className: "text-[10px] px-1.5 py-0 h-4 font-mono", children: [
|
|
12076
|
+
filteredFiles.length,
|
|
12077
|
+
" files"
|
|
12078
|
+
] })
|
|
12079
|
+
] }),
|
|
12080
|
+
/* @__PURE__ */ jsxs60("p", { className: "truncate text-xs text-muted-foreground", children: [
|
|
12081
|
+
folder?.path || "Storage Space",
|
|
12082
|
+
" \xB7 Total size: ",
|
|
12083
|
+
formatBytes(totalBytes)
|
|
12084
|
+
] })
|
|
12085
|
+
] })
|
|
12086
|
+
] }),
|
|
12087
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
12088
|
+
onUploadClick && /* @__PURE__ */ jsxs60(
|
|
12089
|
+
Button,
|
|
12090
|
+
{
|
|
12091
|
+
size: "sm",
|
|
12092
|
+
onClick: onUploadClick,
|
|
12093
|
+
className: "gap-1.5 h-8 text-xs font-semibold shadow-xs",
|
|
12094
|
+
children: [
|
|
12095
|
+
/* @__PURE__ */ jsx98(Upload, { className: "h-3.5 w-3.5" }),
|
|
12096
|
+
/* @__PURE__ */ jsx98("span", { className: "hidden sm:inline", children: "Upload Files" })
|
|
12097
|
+
]
|
|
12098
|
+
}
|
|
12099
|
+
),
|
|
12100
|
+
/* @__PURE__ */ jsx98(HeaderActions, { onDelete: onBack })
|
|
12101
|
+
] })
|
|
12102
|
+
] }),
|
|
12103
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex flex-col gap-2.5 border-b border-border/60 bg-muted/10 p-3 shrink-0", children: [
|
|
12104
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
12105
|
+
/* @__PURE__ */ jsxs60("div", { className: "relative min-w-[200px] flex-1 max-w-md", children: [
|
|
12106
|
+
/* @__PURE__ */ jsx98(Search6, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
|
|
12107
|
+
/* @__PURE__ */ jsx98(
|
|
12108
|
+
Input,
|
|
12109
|
+
{
|
|
12110
|
+
value: searchQuery,
|
|
12111
|
+
onChange: (e) => {
|
|
12112
|
+
setSearchQuery(e.target.value);
|
|
12113
|
+
setCurrentPage(1);
|
|
12114
|
+
},
|
|
12115
|
+
placeholder: "Search files by name, type, or path...",
|
|
12116
|
+
className: "h-8.5 pl-8 pr-8 text-xs rounded-xl bg-background border-border/80"
|
|
12117
|
+
}
|
|
12118
|
+
),
|
|
12119
|
+
searchQuery && /* @__PURE__ */ jsx98(
|
|
12120
|
+
"button",
|
|
12121
|
+
{
|
|
12122
|
+
type: "button",
|
|
12123
|
+
onClick: () => setSearchQuery(""),
|
|
12124
|
+
className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
|
|
12125
|
+
children: /* @__PURE__ */ jsx98(X5, { className: "h-3.5 w-3.5" })
|
|
12126
|
+
}
|
|
12127
|
+
)
|
|
12128
|
+
] }),
|
|
12129
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex items-center gap-1.5", children: [
|
|
12130
|
+
/* @__PURE__ */ jsxs60(DropdownMenu, { children: [
|
|
12131
|
+
/* @__PURE__ */ jsx98(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs60(Button, { variant: "outline", size: "sm", className: "h-8 gap-1.5 text-xs rounded-xl", children: [
|
|
12132
|
+
/* @__PURE__ */ jsx98(ArrowUpDown, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
12133
|
+
/* @__PURE__ */ jsxs60("span", { className: "hidden sm:inline capitalize", children: [
|
|
12134
|
+
"Sort: ",
|
|
12135
|
+
sortBy
|
|
12136
|
+
] })
|
|
12137
|
+
] }) }),
|
|
12138
|
+
/* @__PURE__ */ jsxs60(DropdownMenuContent, { align: "end", className: "w-44 rounded-xl p-1 shadow-lg", children: [
|
|
12139
|
+
/* @__PURE__ */ jsx98(DropdownMenuLabel, { className: "text-[10px] text-muted-foreground uppercase font-bold tracking-wider", children: "Sort By" }),
|
|
12140
|
+
/* @__PURE__ */ jsx98(
|
|
12141
|
+
DropdownMenuItem,
|
|
12142
|
+
{
|
|
12143
|
+
onClick: () => setSortBy("date"),
|
|
12144
|
+
className: cn("text-xs cursor-pointer", sortBy === "date" && "font-bold text-primary"),
|
|
12145
|
+
children: "Last Updated"
|
|
12146
|
+
}
|
|
12147
|
+
),
|
|
12148
|
+
/* @__PURE__ */ jsx98(
|
|
12149
|
+
DropdownMenuItem,
|
|
12150
|
+
{
|
|
12151
|
+
onClick: () => setSortBy("name"),
|
|
12152
|
+
className: cn("text-xs cursor-pointer", sortBy === "name" && "font-bold text-primary"),
|
|
12153
|
+
children: "File Name (A-Z)"
|
|
12154
|
+
}
|
|
12155
|
+
),
|
|
12156
|
+
/* @__PURE__ */ jsx98(
|
|
12157
|
+
DropdownMenuItem,
|
|
12158
|
+
{
|
|
12159
|
+
onClick: () => setSortBy("size"),
|
|
12160
|
+
className: cn("text-xs cursor-pointer", sortBy === "size" && "font-bold text-primary"),
|
|
12161
|
+
children: "File Size"
|
|
12162
|
+
}
|
|
12163
|
+
),
|
|
12164
|
+
/* @__PURE__ */ jsx98(DropdownMenuSeparator, {}),
|
|
12165
|
+
/* @__PURE__ */ jsxs60(
|
|
12166
|
+
DropdownMenuItem,
|
|
12167
|
+
{
|
|
12168
|
+
onClick: () => setSortOrder((prev) => prev === "asc" ? "desc" : "asc"),
|
|
12169
|
+
className: "text-xs cursor-pointer",
|
|
12170
|
+
children: [
|
|
12171
|
+
"Order: ",
|
|
12172
|
+
sortOrder === "asc" ? "Ascending \u2191" : "Descending \u2193"
|
|
12173
|
+
]
|
|
12174
|
+
}
|
|
12175
|
+
)
|
|
12176
|
+
] })
|
|
12177
|
+
] }),
|
|
12178
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex items-center rounded-xl bg-muted/50 p-0.5 border border-border/60", children: [
|
|
12179
|
+
/* @__PURE__ */ jsx98(
|
|
12180
|
+
"button",
|
|
12181
|
+
{
|
|
12182
|
+
type: "button",
|
|
12183
|
+
onClick: () => setViewMode("grid"),
|
|
12184
|
+
className: cn(
|
|
12185
|
+
"flex h-7 w-7 items-center justify-center rounded-lg transition-all cursor-pointer",
|
|
12186
|
+
viewMode === "grid" ? "bg-background text-foreground shadow-2xs font-bold" : "text-muted-foreground hover:text-foreground"
|
|
12187
|
+
),
|
|
12188
|
+
title: "Grid View",
|
|
12189
|
+
children: /* @__PURE__ */ jsx98(LayoutGrid, { className: "h-3.5 w-3.5" })
|
|
12190
|
+
}
|
|
12191
|
+
),
|
|
12192
|
+
/* @__PURE__ */ jsx98(
|
|
12193
|
+
"button",
|
|
12194
|
+
{
|
|
12195
|
+
type: "button",
|
|
12196
|
+
onClick: () => setViewMode("table"),
|
|
12197
|
+
className: cn(
|
|
12198
|
+
"flex h-7 w-7 items-center justify-center rounded-lg transition-all cursor-pointer",
|
|
12199
|
+
viewMode === "table" ? "bg-background text-foreground shadow-2xs font-bold" : "text-muted-foreground hover:text-foreground"
|
|
12200
|
+
),
|
|
12201
|
+
title: "Table View",
|
|
12202
|
+
children: /* @__PURE__ */ jsx98(TableIcon, { className: "h-3.5 w-3.5" })
|
|
12203
|
+
}
|
|
12204
|
+
)
|
|
12205
|
+
] })
|
|
12206
|
+
] })
|
|
12207
|
+
] }),
|
|
12208
|
+
/* @__PURE__ */ jsx98("div", { className: "flex items-center gap-1.5 overflow-x-auto scrollbar-none pb-0.5", children: CATEGORY_TABS.map((tab) => /* @__PURE__ */ jsx98(
|
|
12209
|
+
"button",
|
|
12210
|
+
{
|
|
12211
|
+
type: "button",
|
|
12212
|
+
onClick: () => {
|
|
12213
|
+
setSelectedCategory(tab.value);
|
|
12214
|
+
setCurrentPage(1);
|
|
12215
|
+
},
|
|
12216
|
+
className: cn(
|
|
12217
|
+
"rounded-lg px-2.5 py-1 text-xs font-semibold whitespace-nowrap transition-all duration-200 cursor-pointer border",
|
|
12218
|
+
selectedCategory === tab.value ? "bg-indigo-600 text-white border-indigo-600 shadow-2xs" : "bg-background border-border/80 text-muted-foreground hover:text-foreground hover:bg-muted/40"
|
|
12219
|
+
),
|
|
12220
|
+
children: tab.label
|
|
12221
|
+
},
|
|
12222
|
+
tab.value
|
|
12223
|
+
)) })
|
|
12224
|
+
] }),
|
|
12225
|
+
selectedIds.size > 0 && /* @__PURE__ */ jsxs60("div", { className: "flex items-center justify-between bg-indigo-500/10 border-b border-indigo-200/40 px-4 py-2 text-xs", children: [
|
|
12226
|
+
/* @__PURE__ */ jsxs60("span", { className: "font-semibold text-indigo-700 dark:text-indigo-300", children: [
|
|
12227
|
+
selectedIds.size,
|
|
12228
|
+
" files selected"
|
|
12229
|
+
] }),
|
|
12230
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex items-center gap-2", children: [
|
|
12231
|
+
/* @__PURE__ */ jsxs60(
|
|
12232
|
+
Button,
|
|
12233
|
+
{
|
|
12234
|
+
size: "sm",
|
|
12235
|
+
variant: "outline",
|
|
12236
|
+
onClick: handleBulkDownload,
|
|
12237
|
+
className: "h-7 text-xs gap-1 bg-background",
|
|
12238
|
+
children: [
|
|
12239
|
+
/* @__PURE__ */ jsx98(Download3, { className: "h-3 w-3" }),
|
|
12240
|
+
/* @__PURE__ */ jsx98("span", { children: "Download" })
|
|
12241
|
+
]
|
|
12242
|
+
}
|
|
12243
|
+
),
|
|
12244
|
+
onDeleteFile && /* @__PURE__ */ jsxs60(
|
|
12245
|
+
Button,
|
|
12246
|
+
{
|
|
12247
|
+
size: "sm",
|
|
12248
|
+
variant: "destructive",
|
|
12249
|
+
onClick: handleBulkDelete,
|
|
12250
|
+
className: "h-7 text-xs gap-1",
|
|
12251
|
+
children: [
|
|
12252
|
+
/* @__PURE__ */ jsx98(Trash28, { className: "h-3 w-3" }),
|
|
12253
|
+
/* @__PURE__ */ jsx98("span", { children: "Delete" })
|
|
12254
|
+
]
|
|
12255
|
+
}
|
|
12256
|
+
),
|
|
12257
|
+
/* @__PURE__ */ jsx98(
|
|
12258
|
+
Button,
|
|
12259
|
+
{
|
|
12260
|
+
size: "sm",
|
|
12261
|
+
variant: "ghost",
|
|
12262
|
+
onClick: () => setSelectedIds(/* @__PURE__ */ new Set()),
|
|
12263
|
+
className: "h-7 text-xs",
|
|
12264
|
+
children: "Clear"
|
|
12265
|
+
}
|
|
12266
|
+
)
|
|
12267
|
+
] })
|
|
12268
|
+
] }),
|
|
12269
|
+
/* @__PURE__ */ jsx98("div", { className: "min-h-0 flex-1 overflow-y-auto p-4", children: paginatedFiles.length === 0 ? /* @__PURE__ */ jsxs60("div", { className: "flex h-64 flex-col items-center justify-center gap-3 text-center text-muted-foreground border-2 border-dashed border-border/60 rounded-2xl bg-muted/5 p-8", children: [
|
|
12270
|
+
/* @__PURE__ */ jsx98(FolderOpen2, { className: "h-10 w-10 text-muted-foreground/40" }),
|
|
12271
|
+
/* @__PURE__ */ jsxs60("div", { children: [
|
|
12272
|
+
/* @__PURE__ */ jsx98("p", { className: "text-sm font-bold text-foreground", children: "No files found" }),
|
|
12273
|
+
/* @__PURE__ */ jsx98("p", { className: "text-xs text-muted-foreground mt-0.5", children: searchQuery ? "No documents match your search criteria" : "This folder is currently empty. Upload your first document." })
|
|
12274
|
+
] }),
|
|
12275
|
+
onUploadClick && /* @__PURE__ */ jsxs60(Button, { size: "sm", onClick: onUploadClick, className: "gap-1.5 text-xs mt-2", children: [
|
|
12276
|
+
/* @__PURE__ */ jsx98(Upload, { className: "h-3.5 w-3.5" }),
|
|
12277
|
+
/* @__PURE__ */ jsx98("span", { children: "Upload New File" })
|
|
12278
|
+
] })
|
|
12279
|
+
] }) : viewMode === "grid" ? /* @__PURE__ */ jsx98("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3.5", children: paginatedFiles.map((file) => /* @__PURE__ */ jsx98(
|
|
12280
|
+
FileCardItem,
|
|
12281
|
+
{
|
|
12282
|
+
file,
|
|
12283
|
+
isSelected: file.id === selectedFileId || selectedIds.has(file.id),
|
|
12284
|
+
viewMode: "grid",
|
|
12285
|
+
onSelect: () => onSelectFileForPreview?.(file),
|
|
12286
|
+
onPreview: () => onSelectFileForPreview?.(file),
|
|
12287
|
+
onDownload: () => onDownloadFile?.(file),
|
|
12288
|
+
onCopyLink: () => onCopyLink?.(file),
|
|
12289
|
+
onRename: () => onRenameFile?.(file),
|
|
12290
|
+
onDelete: () => onDeleteFile?.(file),
|
|
12291
|
+
onShare: () => onShareFile?.(file)
|
|
12292
|
+
},
|
|
12293
|
+
file.id
|
|
12294
|
+
)) }) : /* @__PURE__ */ jsx98("div", { className: "overflow-hidden rounded-2xl border border-border/80 bg-card shadow-2xs", children: /* @__PURE__ */ jsxs60("table", { className: "w-full text-left text-xs border-collapse", children: [
|
|
12295
|
+
/* @__PURE__ */ jsx98("thead", { className: "border-b border-border/80 bg-muted/30 text-muted-foreground font-bold", children: /* @__PURE__ */ jsxs60("tr", { children: [
|
|
12296
|
+
/* @__PURE__ */ jsx98("th", { className: "py-2.5 px-4", children: "Name" }),
|
|
12297
|
+
/* @__PURE__ */ jsx98("th", { className: "py-2.5 px-4", children: "Category" }),
|
|
12298
|
+
/* @__PURE__ */ jsx98("th", { className: "py-2.5 px-4", children: "Size" }),
|
|
12299
|
+
/* @__PURE__ */ jsx98("th", { className: "py-2.5 px-4 hidden sm:table-cell", children: "Updated" }),
|
|
12300
|
+
/* @__PURE__ */ jsx98("th", { className: "py-2.5 px-4 text-right", children: "Actions" })
|
|
12301
|
+
] }) }),
|
|
12302
|
+
/* @__PURE__ */ jsx98("tbody", { children: paginatedFiles.map((file) => /* @__PURE__ */ jsx98(
|
|
12303
|
+
FileCardItem,
|
|
12304
|
+
{
|
|
12305
|
+
file,
|
|
12306
|
+
isSelected: file.id === selectedFileId || selectedIds.has(file.id),
|
|
12307
|
+
viewMode: "table",
|
|
12308
|
+
onSelect: () => onSelectFileForPreview?.(file),
|
|
12309
|
+
onPreview: () => onSelectFileForPreview?.(file),
|
|
12310
|
+
onDownload: () => onDownloadFile?.(file),
|
|
12311
|
+
onCopyLink: () => onCopyLink?.(file),
|
|
12312
|
+
onRename: () => onRenameFile?.(file),
|
|
12313
|
+
onDelete: () => onDeleteFile?.(file),
|
|
12314
|
+
onShare: () => onShareFile?.(file)
|
|
12315
|
+
},
|
|
12316
|
+
file.id
|
|
12317
|
+
)) })
|
|
12318
|
+
] }) }) }),
|
|
12319
|
+
totalPages > 1 && /* @__PURE__ */ jsxs60("div", { className: "flex items-center justify-between border-t border-border bg-background px-4 py-2.5 shrink-0 text-xs text-muted-foreground", children: [
|
|
12320
|
+
/* @__PURE__ */ jsxs60("span", { children: [
|
|
12321
|
+
"Showing ",
|
|
12322
|
+
(currentPage - 1) * itemsPerPage + 1,
|
|
12323
|
+
" -",
|
|
12324
|
+
" ",
|
|
12325
|
+
Math.min(currentPage * itemsPerPage, sortedFiles.length),
|
|
12326
|
+
" of ",
|
|
12327
|
+
sortedFiles.length
|
|
12328
|
+
] }),
|
|
12329
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex items-center gap-1", children: [
|
|
12330
|
+
/* @__PURE__ */ jsx98(
|
|
12331
|
+
Button,
|
|
12332
|
+
{
|
|
12333
|
+
variant: "outline",
|
|
12334
|
+
size: "sm",
|
|
12335
|
+
onClick: () => setCurrentPage((p) => Math.max(1, p - 1)),
|
|
12336
|
+
disabled: currentPage === 1,
|
|
12337
|
+
className: "h-7 w-7 p-0 rounded-lg",
|
|
12338
|
+
children: /* @__PURE__ */ jsx98(ChevronLeft2, { className: "h-3.5 w-3.5" })
|
|
12339
|
+
}
|
|
12340
|
+
),
|
|
12341
|
+
/* @__PURE__ */ jsxs60("span", { className: "px-2 font-mono font-bold text-foreground", children: [
|
|
12342
|
+
currentPage,
|
|
12343
|
+
" / ",
|
|
12344
|
+
totalPages
|
|
12345
|
+
] }),
|
|
12346
|
+
/* @__PURE__ */ jsx98(
|
|
12347
|
+
Button,
|
|
12348
|
+
{
|
|
12349
|
+
variant: "outline",
|
|
12350
|
+
size: "sm",
|
|
12351
|
+
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
12352
|
+
disabled: currentPage === totalPages,
|
|
12353
|
+
className: "h-7 w-7 p-0 rounded-lg",
|
|
12354
|
+
children: /* @__PURE__ */ jsx98(ChevronRight9, { className: "h-3.5 w-3.5" })
|
|
12355
|
+
}
|
|
12356
|
+
)
|
|
12357
|
+
] })
|
|
12358
|
+
] })
|
|
12359
|
+
]
|
|
12360
|
+
}
|
|
12361
|
+
);
|
|
12362
|
+
}
|
|
12363
|
+
|
|
12364
|
+
// src/design-system/components/files/file-upload-form.tsx
|
|
12365
|
+
import { useState as useState13, useRef as useRef7 } from "react";
|
|
12366
|
+
import {
|
|
12367
|
+
Bold,
|
|
12368
|
+
Italic,
|
|
12369
|
+
Underline,
|
|
12370
|
+
List,
|
|
12371
|
+
ListOrdered,
|
|
12372
|
+
Paperclip as Paperclip2,
|
|
12373
|
+
Save,
|
|
12374
|
+
ArrowLeft as ArrowLeft4,
|
|
12375
|
+
Eye as Eye4,
|
|
12376
|
+
X as X6,
|
|
12377
|
+
Loader2 as Loader22,
|
|
12378
|
+
FileText as FileText5,
|
|
12379
|
+
UploadCloud
|
|
12380
|
+
} from "lucide-react";
|
|
12381
|
+
import { jsx as jsx99, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
12382
|
+
var TEMPLATE_OPTIONS = [
|
|
12383
|
+
{ id: "1", name: "Standard Document" },
|
|
12384
|
+
{ id: "2", name: "Financial Invoice" },
|
|
12385
|
+
{ id: "3", name: "Report & Spreadsheet" },
|
|
12386
|
+
{ id: "4", name: "Contract & Legal" }
|
|
12387
|
+
];
|
|
12388
|
+
var FOLDER_OPTIONS = ["Finance", "Chat", "Files", "Email", "AI Chat", "Order"];
|
|
12389
|
+
var SUB_FOLDER_OPTIONS = [
|
|
12390
|
+
"Pdf",
|
|
12391
|
+
"Doc",
|
|
12392
|
+
"Xls",
|
|
12393
|
+
"Images",
|
|
12394
|
+
"Videos",
|
|
12395
|
+
"Ppt",
|
|
12396
|
+
"Txt",
|
|
12397
|
+
"Csv",
|
|
12398
|
+
"Zip",
|
|
12399
|
+
"Other"
|
|
12400
|
+
];
|
|
12401
|
+
function FileUploadForm({
|
|
12402
|
+
userEmail,
|
|
12403
|
+
folders,
|
|
12404
|
+
initialSubject = "",
|
|
12405
|
+
initialFolder = "Finance",
|
|
12406
|
+
initialSubFolder = "Pdf",
|
|
12407
|
+
onClose,
|
|
12408
|
+
onSave,
|
|
12409
|
+
onUploadSuccess,
|
|
12410
|
+
onPreviewAttachment,
|
|
12411
|
+
className
|
|
12412
|
+
}) {
|
|
12413
|
+
const [template, setTemplate] = useState13(TEMPLATE_OPTIONS[0].id);
|
|
12414
|
+
const [subject, setSubject] = useState13(initialSubject);
|
|
12415
|
+
const [folder, setFolder] = useState13(initialFolder);
|
|
12416
|
+
const [subFolder, setSubFolder] = useState13(initialSubFolder);
|
|
12417
|
+
const [remarks, setRemarks] = useState13("");
|
|
12418
|
+
const [body, setBody] = useState13("");
|
|
12419
|
+
const [attachments, setAttachments] = useState13([]);
|
|
12420
|
+
const [isSaving, setIsSaving] = useState13(false);
|
|
12421
|
+
const fileInputRef = useRef7(null);
|
|
12422
|
+
const handleFileChange = (e) => {
|
|
12423
|
+
const files = e.target.files;
|
|
12424
|
+
if (!files || files.length === 0) return;
|
|
12425
|
+
const newAttachments = Array.from(files).map((f) => ({
|
|
12426
|
+
id: `att-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
12427
|
+
name: f.name,
|
|
12428
|
+
type: f.type || "application/octet-stream",
|
|
12429
|
+
size: formatBytes(f.size),
|
|
12430
|
+
url: URL.createObjectURL(f),
|
|
12431
|
+
fileObj: f,
|
|
12432
|
+
progress: 100
|
|
12433
|
+
}));
|
|
12434
|
+
setAttachments((prev) => [...prev, ...newAttachments]);
|
|
12435
|
+
if (fileInputRef.current) fileInputRef.current.value = "";
|
|
12436
|
+
};
|
|
12437
|
+
const handleRemoveAttachment = (id) => {
|
|
12438
|
+
setAttachments((prev) => prev.filter((a) => a.id !== id));
|
|
12439
|
+
};
|
|
12440
|
+
const handleFormSubmit = async (e) => {
|
|
12441
|
+
e.preventDefault();
|
|
12442
|
+
setIsSaving(true);
|
|
12443
|
+
try {
|
|
12444
|
+
if (onSave) {
|
|
12445
|
+
await onSave({
|
|
12446
|
+
subject,
|
|
12447
|
+
folder,
|
|
12448
|
+
subFolder,
|
|
12449
|
+
remarks,
|
|
12450
|
+
body,
|
|
12451
|
+
attachments
|
|
12452
|
+
});
|
|
12453
|
+
}
|
|
12454
|
+
onUploadSuccess?.();
|
|
12455
|
+
} finally {
|
|
12456
|
+
setIsSaving(false);
|
|
12457
|
+
}
|
|
12458
|
+
};
|
|
12459
|
+
return /* @__PURE__ */ jsxs61(
|
|
12460
|
+
"div",
|
|
12461
|
+
{
|
|
12462
|
+
className: cn(
|
|
12463
|
+
"flex h-full min-h-0 w-full flex-1 flex-col overflow-hidden bg-background select-none",
|
|
12464
|
+
className
|
|
12465
|
+
),
|
|
12466
|
+
children: [
|
|
12467
|
+
/* @__PURE__ */ jsxs61("div", { className: "flex items-center justify-between border-b border-border bg-background px-4 py-3 shrink-0", children: [
|
|
12468
|
+
/* @__PURE__ */ jsxs61("div", { className: "flex items-center gap-2.5 min-w-0", children: [
|
|
12469
|
+
onClose && /* @__PURE__ */ jsx99(
|
|
12470
|
+
"button",
|
|
12471
|
+
{
|
|
12472
|
+
type: "button",
|
|
12473
|
+
onClick: onClose,
|
|
12474
|
+
className: "flex h-8 w-8 items-center justify-center rounded-xl text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer",
|
|
12475
|
+
title: "Back",
|
|
12476
|
+
children: /* @__PURE__ */ jsx99(ArrowLeft4, { className: "h-4 w-4" })
|
|
12477
|
+
}
|
|
12478
|
+
),
|
|
12479
|
+
/* @__PURE__ */ jsx99("div", { className: "flex h-10 w-10 items-center justify-center rounded-xl bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border border-indigo-200/50 shrink-0 shadow-2xs", children: /* @__PURE__ */ jsx99(FileText5, { className: "h-5 w-5" }) }),
|
|
12480
|
+
/* @__PURE__ */ jsxs61("div", { className: "min-w-0", children: [
|
|
12481
|
+
/* @__PURE__ */ jsx99("h2", { className: "truncate text-sm font-bold text-foreground tracking-tight", children: "Create & Upload Document" }),
|
|
12482
|
+
/* @__PURE__ */ jsx99("p", { className: "truncate text-xs text-muted-foreground", children: "Add metadata, descriptions, and attach files to your cloud storage" })
|
|
12483
|
+
] })
|
|
12484
|
+
] }),
|
|
12485
|
+
/* @__PURE__ */ jsxs61("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
12486
|
+
onClose && /* @__PURE__ */ jsx99(Button, { variant: "ghost", size: "sm", onClick: onClose, className: "h-8 text-xs", children: "Cancel" }),
|
|
12487
|
+
/* @__PURE__ */ jsxs61(
|
|
12488
|
+
Button,
|
|
12489
|
+
{
|
|
12490
|
+
size: "sm",
|
|
12491
|
+
onClick: handleFormSubmit,
|
|
12492
|
+
disabled: isSaving || !subject && attachments.length === 0,
|
|
12493
|
+
className: "h-8 gap-1.5 text-xs font-semibold shadow-xs bg-indigo-600 hover:bg-indigo-700 text-white",
|
|
12494
|
+
children: [
|
|
12495
|
+
isSaving ? /* @__PURE__ */ jsx99(Loader22, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx99(Save, { className: "h-3.5 w-3.5" }),
|
|
12496
|
+
/* @__PURE__ */ jsx99("span", { children: "Save & Upload" })
|
|
12497
|
+
]
|
|
12498
|
+
}
|
|
12499
|
+
)
|
|
12500
|
+
] })
|
|
12501
|
+
] }),
|
|
12502
|
+
/* @__PURE__ */ jsxs61("div", { className: "min-h-0 flex-1 overflow-y-auto p-4 space-y-4", children: [
|
|
12503
|
+
/* @__PURE__ */ jsxs61("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-3 p-3.5 rounded-2xl border border-border/80 bg-muted/10", children: [
|
|
12504
|
+
/* @__PURE__ */ jsxs61("div", { className: "space-y-1.5", children: [
|
|
12505
|
+
/* @__PURE__ */ jsx99(Label, { className: "text-xs font-semibold text-foreground", children: "Document Template" }),
|
|
12506
|
+
/* @__PURE__ */ jsxs61(Select, { value: template, onValueChange: setTemplate, children: [
|
|
12507
|
+
/* @__PURE__ */ jsx99(SelectTrigger, { className: "h-8.5 text-xs rounded-xl bg-background border-border/80", children: /* @__PURE__ */ jsx99(SelectValue, { placeholder: "Select template" }) }),
|
|
12508
|
+
/* @__PURE__ */ jsx99(SelectContent, { className: "rounded-xl shadow-lg", children: TEMPLATE_OPTIONS.map((t) => /* @__PURE__ */ jsx99(SelectItem, { value: t.id, className: "text-xs", children: t.name }, t.id)) })
|
|
12509
|
+
] })
|
|
12510
|
+
] }),
|
|
12511
|
+
/* @__PURE__ */ jsxs61("div", { className: "space-y-1.5", children: [
|
|
12512
|
+
/* @__PURE__ */ jsx99(Label, { className: "text-xs font-semibold text-foreground", children: "Target Space" }),
|
|
12513
|
+
/* @__PURE__ */ jsxs61(Select, { value: folder, onValueChange: setFolder, children: [
|
|
12514
|
+
/* @__PURE__ */ jsx99(SelectTrigger, { className: "h-8.5 text-xs rounded-xl bg-background border-border/80", children: /* @__PURE__ */ jsx99(SelectValue, { placeholder: "Select space" }) }),
|
|
12515
|
+
/* @__PURE__ */ jsx99(SelectContent, { className: "rounded-xl shadow-lg", children: (folders || FOLDER_OPTIONS.map((f) => ({ id: f, name: f }))).map((f) => /* @__PURE__ */ jsx99(SelectItem, { value: f.name, className: "text-xs", children: f.name }, f.id)) })
|
|
12516
|
+
] })
|
|
12517
|
+
] }),
|
|
12518
|
+
/* @__PURE__ */ jsxs61("div", { className: "space-y-1.5", children: [
|
|
12519
|
+
/* @__PURE__ */ jsx99(Label, { className: "text-xs font-semibold text-foreground", children: "Category Subfolder" }),
|
|
12520
|
+
/* @__PURE__ */ jsxs61(Select, { value: subFolder, onValueChange: setSubFolder, children: [
|
|
12521
|
+
/* @__PURE__ */ jsx99(SelectTrigger, { className: "h-8.5 text-xs rounded-xl bg-background border-border/80", children: /* @__PURE__ */ jsx99(SelectValue, { placeholder: "Select category" }) }),
|
|
12522
|
+
/* @__PURE__ */ jsx99(SelectContent, { className: "rounded-xl shadow-lg", children: SUB_FOLDER_OPTIONS.map((cat) => /* @__PURE__ */ jsx99(SelectItem, { value: cat, className: "text-xs", children: cat }, cat)) })
|
|
12523
|
+
] })
|
|
12524
|
+
] })
|
|
12525
|
+
] }),
|
|
12526
|
+
/* @__PURE__ */ jsxs61("div", { className: "space-y-1.5", children: [
|
|
12527
|
+
/* @__PURE__ */ jsx99(Label, { className: "text-xs font-semibold text-foreground", children: "Document Title / Subject" }),
|
|
12528
|
+
/* @__PURE__ */ jsx99(
|
|
12529
|
+
Input,
|
|
12530
|
+
{
|
|
12531
|
+
value: subject,
|
|
12532
|
+
onChange: (e) => setSubject(e.target.value),
|
|
12533
|
+
placeholder: "e.g. Q3 Sales & Performance Report",
|
|
12534
|
+
className: "h-9 text-xs rounded-xl bg-background border-border/80"
|
|
12535
|
+
}
|
|
12536
|
+
)
|
|
12537
|
+
] }),
|
|
12538
|
+
/* @__PURE__ */ jsxs61("div", { className: "space-y-1.5", children: [
|
|
12539
|
+
/* @__PURE__ */ jsx99(Label, { className: "text-xs font-semibold text-foreground", children: "Document Content / Notes" }),
|
|
12540
|
+
/* @__PURE__ */ jsxs61("div", { className: "rounded-2xl border border-border/80 overflow-hidden bg-background", children: [
|
|
12541
|
+
/* @__PURE__ */ jsxs61("div", { className: "flex items-center gap-1 border-b border-border/60 bg-muted/20 p-1.5", children: [
|
|
12542
|
+
/* @__PURE__ */ jsx99(
|
|
12543
|
+
"button",
|
|
12544
|
+
{
|
|
12545
|
+
type: "button",
|
|
12546
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground",
|
|
12547
|
+
title: "Bold",
|
|
12548
|
+
children: /* @__PURE__ */ jsx99(Bold, { className: "h-3.5 w-3.5" })
|
|
12549
|
+
}
|
|
12550
|
+
),
|
|
12551
|
+
/* @__PURE__ */ jsx99(
|
|
12552
|
+
"button",
|
|
12553
|
+
{
|
|
12554
|
+
type: "button",
|
|
12555
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground",
|
|
12556
|
+
title: "Italic",
|
|
12557
|
+
children: /* @__PURE__ */ jsx99(Italic, { className: "h-3.5 w-3.5" })
|
|
12558
|
+
}
|
|
12559
|
+
),
|
|
12560
|
+
/* @__PURE__ */ jsx99(
|
|
12561
|
+
"button",
|
|
12562
|
+
{
|
|
12563
|
+
type: "button",
|
|
12564
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground",
|
|
12565
|
+
title: "Underline",
|
|
12566
|
+
children: /* @__PURE__ */ jsx99(Underline, { className: "h-3.5 w-3.5" })
|
|
12567
|
+
}
|
|
12568
|
+
),
|
|
12569
|
+
/* @__PURE__ */ jsx99("div", { className: "h-4 w-px bg-border/80 mx-1" }),
|
|
12570
|
+
/* @__PURE__ */ jsx99(
|
|
12571
|
+
"button",
|
|
12572
|
+
{
|
|
12573
|
+
type: "button",
|
|
12574
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground",
|
|
12575
|
+
title: "Bullet List",
|
|
12576
|
+
children: /* @__PURE__ */ jsx99(List, { className: "h-3.5 w-3.5" })
|
|
12577
|
+
}
|
|
12578
|
+
),
|
|
12579
|
+
/* @__PURE__ */ jsx99(
|
|
12580
|
+
"button",
|
|
12581
|
+
{
|
|
12582
|
+
type: "button",
|
|
12583
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground",
|
|
12584
|
+
title: "Numbered List",
|
|
12585
|
+
children: /* @__PURE__ */ jsx99(ListOrdered, { className: "h-3.5 w-3.5" })
|
|
12586
|
+
}
|
|
12587
|
+
),
|
|
12588
|
+
/* @__PURE__ */ jsx99("div", { className: "h-4 w-px bg-border/80 mx-1" }),
|
|
12589
|
+
/* @__PURE__ */ jsxs61(
|
|
12590
|
+
"button",
|
|
12591
|
+
{
|
|
12592
|
+
type: "button",
|
|
12593
|
+
onClick: () => fileInputRef.current?.click(),
|
|
12594
|
+
className: "p-1.5 rounded-lg hover:bg-muted text-indigo-600 dark:text-indigo-400 font-semibold flex items-center gap-1 text-xs",
|
|
12595
|
+
title: "Attach Files",
|
|
12596
|
+
children: [
|
|
12597
|
+
/* @__PURE__ */ jsx99(Paperclip2, { className: "h-3.5 w-3.5" }),
|
|
12598
|
+
/* @__PURE__ */ jsx99("span", { children: "Attach" })
|
|
12599
|
+
]
|
|
12600
|
+
}
|
|
12601
|
+
)
|
|
12602
|
+
] }),
|
|
12603
|
+
/* @__PURE__ */ jsx99(
|
|
12604
|
+
"textarea",
|
|
12605
|
+
{
|
|
12606
|
+
value: body,
|
|
12607
|
+
onChange: (e) => setBody(e.target.value),
|
|
12608
|
+
placeholder: "Write or paste your document notes and text here...",
|
|
12609
|
+
rows: 4,
|
|
12610
|
+
className: "w-full p-3 text-xs bg-transparent border-0 focus:outline-hidden resize-y min-h-[90px]"
|
|
12611
|
+
}
|
|
12612
|
+
)
|
|
12613
|
+
] })
|
|
12614
|
+
] }),
|
|
12615
|
+
/* @__PURE__ */ jsxs61("div", { className: "space-y-2", children: [
|
|
12616
|
+
/* @__PURE__ */ jsxs61("div", { className: "flex items-center justify-between", children: [
|
|
12617
|
+
/* @__PURE__ */ jsxs61(Label, { className: "text-xs font-semibold text-foreground", children: [
|
|
12618
|
+
"Attachments (",
|
|
12619
|
+
attachments.length,
|
|
12620
|
+
")"
|
|
12621
|
+
] }),
|
|
12622
|
+
/* @__PURE__ */ jsx99(
|
|
12623
|
+
"input",
|
|
12624
|
+
{
|
|
12625
|
+
type: "file",
|
|
12626
|
+
multiple: true,
|
|
12627
|
+
ref: fileInputRef,
|
|
12628
|
+
onChange: handleFileChange,
|
|
12629
|
+
className: "hidden"
|
|
12630
|
+
}
|
|
12631
|
+
),
|
|
12632
|
+
/* @__PURE__ */ jsxs61(
|
|
12633
|
+
Button,
|
|
12634
|
+
{
|
|
12635
|
+
type: "button",
|
|
12636
|
+
variant: "outline",
|
|
12637
|
+
size: "sm",
|
|
12638
|
+
onClick: () => fileInputRef.current?.click(),
|
|
12639
|
+
className: "h-7 text-xs gap-1.5 rounded-xl border-dashed",
|
|
12640
|
+
children: [
|
|
12641
|
+
/* @__PURE__ */ jsx99(Paperclip2, { className: "h-3 w-3" }),
|
|
12642
|
+
/* @__PURE__ */ jsx99("span", { children: "Browse Files" })
|
|
12643
|
+
]
|
|
12644
|
+
}
|
|
12645
|
+
)
|
|
12646
|
+
] }),
|
|
12647
|
+
attachments.length === 0 ? /* @__PURE__ */ jsxs61(
|
|
12648
|
+
"div",
|
|
12649
|
+
{
|
|
12650
|
+
onClick: () => fileInputRef.current?.click(),
|
|
12651
|
+
className: "flex flex-col items-center justify-center gap-2 p-6 border-2 border-dashed border-border/80 rounded-2xl bg-muted/10 text-muted-foreground hover:border-indigo-400 hover:bg-indigo-50/20 dark:hover:bg-indigo-950/20 transition-all cursor-pointer text-center",
|
|
12652
|
+
children: [
|
|
12653
|
+
/* @__PURE__ */ jsx99(UploadCloud, { className: "h-8 w-8 text-indigo-500" }),
|
|
12654
|
+
/* @__PURE__ */ jsxs61("div", { children: [
|
|
12655
|
+
/* @__PURE__ */ jsx99("p", { className: "text-xs font-bold text-foreground", children: "Click to upload or drag and drop" }),
|
|
12656
|
+
/* @__PURE__ */ jsx99("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: "PDF, DOCX, XLSX, PNG, JPG, MP4 or ZIP up to 50MB" })
|
|
12657
|
+
] })
|
|
12658
|
+
]
|
|
12659
|
+
}
|
|
12660
|
+
) : /* @__PURE__ */ jsx99("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-2", children: attachments.map((att) => /* @__PURE__ */ jsxs61(
|
|
12661
|
+
"div",
|
|
12662
|
+
{
|
|
12663
|
+
className: "flex items-center justify-between gap-2 p-2.5 rounded-xl border border-border/80 bg-card shadow-2xs",
|
|
12664
|
+
children: [
|
|
12665
|
+
/* @__PURE__ */ jsxs61("div", { className: "flex items-center gap-2.5 min-w-0", children: [
|
|
12666
|
+
/* @__PURE__ */ jsx99("div", { className: "flex h-8 w-8 items-center justify-center rounded-lg bg-indigo-500/10 text-indigo-600 shrink-0", children: /* @__PURE__ */ jsx99(FileText5, { className: "h-4 w-4" }) }),
|
|
12667
|
+
/* @__PURE__ */ jsxs61("div", { className: "min-w-0", children: [
|
|
12668
|
+
/* @__PURE__ */ jsx99("p", { className: "truncate text-xs font-semibold text-foreground", children: att.name }),
|
|
12669
|
+
/* @__PURE__ */ jsx99("p", { className: "text-[10px] text-muted-foreground font-mono", children: att.size })
|
|
12670
|
+
] })
|
|
12671
|
+
] }),
|
|
12672
|
+
/* @__PURE__ */ jsxs61("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
12673
|
+
onPreviewAttachment && att.url && /* @__PURE__ */ jsx99(
|
|
12674
|
+
"button",
|
|
12675
|
+
{
|
|
12676
|
+
type: "button",
|
|
12677
|
+
onClick: () => onPreviewAttachment({ name: att.name, url: att.url }),
|
|
12678
|
+
className: "p-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground",
|
|
12679
|
+
title: "Preview",
|
|
12680
|
+
children: /* @__PURE__ */ jsx99(Eye4, { className: "h-3.5 w-3.5" })
|
|
12681
|
+
}
|
|
12682
|
+
),
|
|
12683
|
+
/* @__PURE__ */ jsx99(
|
|
12684
|
+
"button",
|
|
12685
|
+
{
|
|
12686
|
+
type: "button",
|
|
12687
|
+
onClick: () => handleRemoveAttachment(att.id),
|
|
12688
|
+
className: "p-1 rounded-lg hover:bg-rose-50 dark:hover:bg-rose-950/30 text-rose-500 hover:text-rose-600",
|
|
12689
|
+
title: "Remove",
|
|
12690
|
+
children: /* @__PURE__ */ jsx99(X6, { className: "h-3.5 w-3.5" })
|
|
12691
|
+
}
|
|
12692
|
+
)
|
|
12693
|
+
] })
|
|
12694
|
+
]
|
|
12695
|
+
},
|
|
12696
|
+
att.id
|
|
12697
|
+
)) })
|
|
12698
|
+
] }),
|
|
12699
|
+
/* @__PURE__ */ jsxs61("div", { className: "space-y-1.5", children: [
|
|
12700
|
+
/* @__PURE__ */ jsx99(Label, { className: "text-xs font-semibold text-foreground", children: "Remarks / Tags" }),
|
|
12701
|
+
/* @__PURE__ */ jsx99(
|
|
12702
|
+
Input,
|
|
12703
|
+
{
|
|
12704
|
+
value: remarks,
|
|
12705
|
+
onChange: (e) => setRemarks(e.target.value),
|
|
12706
|
+
placeholder: "e.g. Confidential, Q3 Approved, Client Copy",
|
|
12707
|
+
className: "h-8.5 text-xs rounded-xl bg-background border-border/80"
|
|
12708
|
+
}
|
|
12709
|
+
)
|
|
12710
|
+
] })
|
|
12711
|
+
] })
|
|
12712
|
+
]
|
|
12713
|
+
}
|
|
12714
|
+
);
|
|
12715
|
+
}
|
|
12716
|
+
|
|
12717
|
+
// src/design-system/templates/list-template.tsx
|
|
12718
|
+
import { jsx as jsx100, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
12719
|
+
function ListTemplate({
|
|
12720
|
+
title,
|
|
12721
|
+
description,
|
|
12722
|
+
badge,
|
|
12723
|
+
breadcrumbs,
|
|
12724
|
+
actions,
|
|
12725
|
+
searchPlaceholder,
|
|
12726
|
+
searchValue,
|
|
12727
|
+
onSearchChange,
|
|
12728
|
+
filters,
|
|
12729
|
+
activeFilters,
|
|
12730
|
+
onClearAllFilters,
|
|
12731
|
+
filterActions,
|
|
12732
|
+
children,
|
|
12733
|
+
footer,
|
|
12734
|
+
className,
|
|
12735
|
+
...props
|
|
12736
|
+
}) {
|
|
12737
|
+
const hasFilterBar = Boolean(onSearchChange) || Boolean(filters) || activeFilters && activeFilters.length > 0 || Boolean(filterActions);
|
|
12738
|
+
return /* @__PURE__ */ jsxs62("div", { className: cn("flex flex-col gap-6 p-4 sm:p-6 md:p-8", className), ...props, children: [
|
|
12739
|
+
/* @__PURE__ */ jsx100(
|
|
12740
|
+
PageHeader,
|
|
12741
|
+
{
|
|
12742
|
+
title,
|
|
12743
|
+
description,
|
|
12744
|
+
badge,
|
|
12745
|
+
breadcrumbs,
|
|
12746
|
+
actions
|
|
12747
|
+
}
|
|
12748
|
+
),
|
|
12749
|
+
hasFilterBar && /* @__PURE__ */ jsx100(
|
|
12750
|
+
FilterBar,
|
|
12751
|
+
{
|
|
12752
|
+
searchPlaceholder,
|
|
12753
|
+
searchValue,
|
|
12754
|
+
onSearchChange,
|
|
12755
|
+
filters,
|
|
12756
|
+
activeFilters,
|
|
12757
|
+
onClearAll: onClearAllFilters,
|
|
12758
|
+
actions: filterActions
|
|
12759
|
+
}
|
|
12760
|
+
),
|
|
12761
|
+
/* @__PURE__ */ jsx100("div", { className: "flex-1", children }),
|
|
12762
|
+
footer && /* @__PURE__ */ jsx100("div", { className: "pt-2", children: footer })
|
|
12763
|
+
] });
|
|
12764
|
+
}
|
|
12765
|
+
|
|
12766
|
+
// src/design-system/templates/detail-template.tsx
|
|
12767
|
+
import { ArrowLeft as ArrowLeft5 } from "lucide-react";
|
|
12768
|
+
import { jsx as jsx101, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
12769
|
+
function DetailTemplate({
|
|
12770
|
+
title,
|
|
12771
|
+
description,
|
|
12772
|
+
badge,
|
|
12773
|
+
breadcrumbs,
|
|
12774
|
+
actions,
|
|
12775
|
+
onBack,
|
|
12776
|
+
backLabel = "Back",
|
|
12777
|
+
highlights,
|
|
12778
|
+
sidebar,
|
|
12779
|
+
children,
|
|
12780
|
+
className,
|
|
12781
|
+
...props
|
|
12782
|
+
}) {
|
|
12783
|
+
return /* @__PURE__ */ jsxs63("div", { className: cn("flex flex-col gap-6 p-4 sm:p-6 md:p-8", className), ...props, children: [
|
|
12784
|
+
/* @__PURE__ */ jsxs63("div", { className: "flex flex-col gap-2", children: [
|
|
12785
|
+
onBack && /* @__PURE__ */ jsxs63(
|
|
12786
|
+
Button,
|
|
12787
|
+
{
|
|
12788
|
+
variant: "ghost",
|
|
12789
|
+
size: "sm",
|
|
12790
|
+
onClick: onBack,
|
|
12791
|
+
className: "w-fit gap-1.5 px-0 text-xs text-muted-foreground hover:bg-transparent hover:text-foreground",
|
|
12792
|
+
children: [
|
|
12793
|
+
/* @__PURE__ */ jsx101(ArrowLeft5, { className: "h-3.5 w-3.5" }),
|
|
12794
|
+
backLabel
|
|
12795
|
+
]
|
|
12796
|
+
}
|
|
12797
|
+
),
|
|
12798
|
+
/* @__PURE__ */ jsx101(
|
|
12799
|
+
PageHeader,
|
|
12800
|
+
{
|
|
12801
|
+
title,
|
|
12802
|
+
description,
|
|
12803
|
+
badge,
|
|
12804
|
+
breadcrumbs,
|
|
12805
|
+
actions
|
|
12806
|
+
}
|
|
12807
|
+
)
|
|
12808
|
+
] }),
|
|
12809
|
+
highlights && /* @__PURE__ */ jsx101("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-4", children: highlights }),
|
|
12810
|
+
/* @__PURE__ */ jsxs63(
|
|
12811
|
+
"div",
|
|
12812
|
+
{
|
|
12813
|
+
className: cn(
|
|
12814
|
+
"grid gap-6",
|
|
12815
|
+
sidebar ? "grid-cols-1 lg:grid-cols-3" : "grid-cols-1"
|
|
12816
|
+
),
|
|
12817
|
+
children: [
|
|
12818
|
+
/* @__PURE__ */ jsx101("div", { className: cn(sidebar ? "lg:col-span-2 space-y-6" : "space-y-6"), children }),
|
|
12819
|
+
sidebar && /* @__PURE__ */ jsx101("aside", { className: "space-y-6 lg:col-span-1", children: sidebar })
|
|
12820
|
+
]
|
|
12821
|
+
}
|
|
12822
|
+
)
|
|
12823
|
+
] });
|
|
12824
|
+
}
|
|
12825
|
+
|
|
12826
|
+
// src/design-system/templates/form-template.tsx
|
|
12827
|
+
import { ArrowLeft as ArrowLeft6 } from "lucide-react";
|
|
12828
|
+
import { jsx as jsx102, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
12829
|
+
function FormTemplate({
|
|
12830
|
+
title,
|
|
12831
|
+
description,
|
|
12832
|
+
badge,
|
|
12833
|
+
breadcrumbs,
|
|
12834
|
+
onBack,
|
|
12835
|
+
backLabel = "Back",
|
|
12836
|
+
submitLabel = "Save changes",
|
|
12837
|
+
cancelLabel = "Cancel",
|
|
12838
|
+
onCancel,
|
|
12839
|
+
isSubmitting = false,
|
|
12840
|
+
stickyFooter = false,
|
|
12841
|
+
secondaryActions,
|
|
12842
|
+
children,
|
|
12843
|
+
className,
|
|
12844
|
+
onSubmit,
|
|
12845
|
+
...props
|
|
12846
|
+
}) {
|
|
12847
|
+
return /* @__PURE__ */ jsxs64("div", { className: "flex flex-col gap-6 p-4 sm:p-6 md:p-8", children: [
|
|
12848
|
+
/* @__PURE__ */ jsxs64("div", { className: "flex flex-col gap-2", children: [
|
|
12849
|
+
onBack && /* @__PURE__ */ jsxs64(
|
|
12850
|
+
Button,
|
|
12851
|
+
{
|
|
12852
|
+
type: "button",
|
|
12853
|
+
variant: "ghost",
|
|
12854
|
+
size: "sm",
|
|
12855
|
+
onClick: onBack,
|
|
12856
|
+
className: "w-fit gap-1.5 px-0 text-xs text-muted-foreground hover:bg-transparent hover:text-foreground",
|
|
12857
|
+
children: [
|
|
12858
|
+
/* @__PURE__ */ jsx102(ArrowLeft6, { className: "h-3.5 w-3.5" }),
|
|
12859
|
+
backLabel
|
|
12860
|
+
]
|
|
12861
|
+
}
|
|
12862
|
+
),
|
|
12863
|
+
/* @__PURE__ */ jsx102(
|
|
12864
|
+
PageHeader,
|
|
12865
|
+
{
|
|
12866
|
+
title,
|
|
12867
|
+
description,
|
|
12868
|
+
badge,
|
|
12869
|
+
breadcrumbs
|
|
12870
|
+
}
|
|
12871
|
+
)
|
|
12872
|
+
] }),
|
|
12873
|
+
/* @__PURE__ */ jsxs64("form", { onSubmit, className: cn("space-y-8", className), ...props, children: [
|
|
12874
|
+
/* @__PURE__ */ jsx102("div", { className: "space-y-6", children }),
|
|
12875
|
+
/* @__PURE__ */ jsxs64(
|
|
12876
|
+
"div",
|
|
12877
|
+
{
|
|
12878
|
+
className: cn(
|
|
12879
|
+
"flex flex-wrap items-center justify-between gap-4 pt-6",
|
|
12880
|
+
stickyFooter && "sticky bottom-0 -mx-4 -mb-4 bg-background/95 p-4 backdrop-blur border-t sm:-mx-6 sm:-mb-6 sm:p-6 md:-mx-8 md:-mb-8 md:p-8"
|
|
12881
|
+
),
|
|
12882
|
+
children: [
|
|
12883
|
+
/* @__PURE__ */ jsx102("div", { children: secondaryActions }),
|
|
12884
|
+
/* @__PURE__ */ jsxs64("div", { className: "flex items-center gap-3", children: [
|
|
12885
|
+
onCancel && /* @__PURE__ */ jsx102(
|
|
12886
|
+
Button,
|
|
12887
|
+
{
|
|
12888
|
+
type: "button",
|
|
12889
|
+
variant: "outline",
|
|
12890
|
+
disabled: isSubmitting,
|
|
12891
|
+
onClick: onCancel,
|
|
12892
|
+
children: cancelLabel
|
|
12893
|
+
}
|
|
12894
|
+
),
|
|
12895
|
+
/* @__PURE__ */ jsx102(Button, { type: "submit", disabled: isSubmitting, children: isSubmitting ? "Saving..." : submitLabel })
|
|
12896
|
+
] })
|
|
12897
|
+
]
|
|
12898
|
+
}
|
|
12899
|
+
)
|
|
12900
|
+
] })
|
|
12901
|
+
] });
|
|
12902
|
+
}
|
|
12903
|
+
|
|
12904
|
+
// src/design-system/templates/wizard-template.tsx
|
|
12905
|
+
import { Check as Check8, ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight10 } from "lucide-react";
|
|
12906
|
+
import { jsx as jsx103, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
12907
|
+
function WizardTemplate({
|
|
12908
|
+
title,
|
|
12909
|
+
description,
|
|
12910
|
+
steps,
|
|
12911
|
+
currentStepIndex,
|
|
12912
|
+
onStepChange,
|
|
12913
|
+
onNext,
|
|
12914
|
+
onPrevious,
|
|
12915
|
+
onSubmit,
|
|
12916
|
+
nextLabel = "Next",
|
|
12917
|
+
previousLabel = "Previous",
|
|
12918
|
+
submitLabel = "Complete",
|
|
12919
|
+
isSubmitting = false,
|
|
12920
|
+
canProceed = true,
|
|
12921
|
+
children,
|
|
12922
|
+
className,
|
|
12923
|
+
...props
|
|
12924
|
+
}) {
|
|
12925
|
+
const isLastStep = currentStepIndex === steps.length - 1;
|
|
12926
|
+
const isFirstStep = currentStepIndex === 0;
|
|
12927
|
+
return /* @__PURE__ */ jsxs65("div", { className: cn("flex flex-col gap-6 p-4 sm:p-6 md:p-8", className), ...props, children: [
|
|
12928
|
+
/* @__PURE__ */ jsx103(PageHeader, { title, description }),
|
|
12929
|
+
/* @__PURE__ */ jsx103("nav", { "aria-label": "Wizard Progress", className: "py-2", children: /* @__PURE__ */ jsx103("ol", { className: "flex items-center justify-between gap-2 overflow-x-auto pb-2", children: steps.map((step, idx) => {
|
|
12930
|
+
const isCompleted = idx < currentStepIndex;
|
|
12931
|
+
const isCurrent = idx === currentStepIndex;
|
|
12932
|
+
const isClickable = onStepChange && idx < currentStepIndex;
|
|
12933
|
+
return /* @__PURE__ */ jsxs65(
|
|
12934
|
+
"li",
|
|
12935
|
+
{
|
|
12936
|
+
className: "flex flex-1 items-center gap-2.5 min-w-[120px]",
|
|
12937
|
+
children: [
|
|
12938
|
+
/* @__PURE__ */ jsxs65(
|
|
12939
|
+
"button",
|
|
12940
|
+
{
|
|
12941
|
+
type: "button",
|
|
12942
|
+
disabled: !isClickable,
|
|
12943
|
+
onClick: isClickable ? () => onStepChange(idx) : void 0,
|
|
12944
|
+
className: cn(
|
|
12945
|
+
"flex items-center gap-2 text-left transition-colors",
|
|
12946
|
+
isClickable && "cursor-pointer hover:opacity-80"
|
|
12947
|
+
),
|
|
12948
|
+
children: [
|
|
12949
|
+
/* @__PURE__ */ jsx103(
|
|
12950
|
+
"span",
|
|
12951
|
+
{
|
|
12952
|
+
className: cn(
|
|
12953
|
+
"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold",
|
|
12954
|
+
isCompleted && "bg-primary text-primary-foreground",
|
|
12955
|
+
isCurrent && "border-2 border-primary bg-primary/10 text-primary font-bold",
|
|
12956
|
+
!isCompleted && !isCurrent && "border border-border bg-muted text-muted-foreground"
|
|
12957
|
+
),
|
|
12958
|
+
children: isCompleted ? /* @__PURE__ */ jsx103(Check8, { className: "h-4 w-4" }) : idx + 1
|
|
12959
|
+
}
|
|
12960
|
+
),
|
|
12961
|
+
/* @__PURE__ */ jsx103("div", { className: "hidden sm:block", children: /* @__PURE__ */ jsx103(
|
|
12962
|
+
"div",
|
|
12963
|
+
{
|
|
12964
|
+
className: cn(
|
|
12965
|
+
"text-xs font-medium",
|
|
12966
|
+
isCurrent ? "text-foreground font-semibold" : "text-muted-foreground"
|
|
12967
|
+
),
|
|
12968
|
+
children: step.title
|
|
12969
|
+
}
|
|
12970
|
+
) })
|
|
12971
|
+
]
|
|
12972
|
+
}
|
|
12973
|
+
),
|
|
12974
|
+
idx < steps.length - 1 && /* @__PURE__ */ jsx103(
|
|
12975
|
+
"div",
|
|
12976
|
+
{
|
|
12977
|
+
className: cn(
|
|
12978
|
+
"h-0.5 flex-1 rounded-full",
|
|
12979
|
+
idx < currentStepIndex ? "bg-primary" : "bg-border"
|
|
12980
|
+
)
|
|
12981
|
+
}
|
|
12982
|
+
)
|
|
12983
|
+
]
|
|
12984
|
+
},
|
|
11344
12985
|
step.id
|
|
11345
12986
|
);
|
|
11346
12987
|
}) }) }),
|
|
11347
|
-
/* @__PURE__ */
|
|
11348
|
-
/* @__PURE__ */
|
|
11349
|
-
/* @__PURE__ */
|
|
12988
|
+
/* @__PURE__ */ jsx103("div", { className: "flex-1 rounded-lg border bg-card p-4 sm:p-6", children }),
|
|
12989
|
+
/* @__PURE__ */ jsxs65("div", { className: "flex items-center justify-between pt-2", children: [
|
|
12990
|
+
/* @__PURE__ */ jsxs65(
|
|
11350
12991
|
Button,
|
|
11351
12992
|
{
|
|
11352
12993
|
type: "button",
|
|
@@ -11354,12 +12995,12 @@ function WizardTemplate({
|
|
|
11354
12995
|
disabled: isFirstStep || isSubmitting,
|
|
11355
12996
|
onClick: onPrevious,
|
|
11356
12997
|
children: [
|
|
11357
|
-
/* @__PURE__ */
|
|
12998
|
+
/* @__PURE__ */ jsx103(ChevronLeft3, { className: "mr-1 h-4 w-4" }),
|
|
11358
12999
|
previousLabel
|
|
11359
13000
|
]
|
|
11360
13001
|
}
|
|
11361
13002
|
),
|
|
11362
|
-
isLastStep ? /* @__PURE__ */
|
|
13003
|
+
isLastStep ? /* @__PURE__ */ jsx103(
|
|
11363
13004
|
Button,
|
|
11364
13005
|
{
|
|
11365
13006
|
type: "button",
|
|
@@ -11367,7 +13008,7 @@ function WizardTemplate({
|
|
|
11367
13008
|
onClick: onSubmit,
|
|
11368
13009
|
children: isSubmitting ? "Submitting..." : submitLabel
|
|
11369
13010
|
}
|
|
11370
|
-
) : /* @__PURE__ */
|
|
13011
|
+
) : /* @__PURE__ */ jsxs65(
|
|
11371
13012
|
Button,
|
|
11372
13013
|
{
|
|
11373
13014
|
type: "button",
|
|
@@ -11375,7 +13016,7 @@ function WizardTemplate({
|
|
|
11375
13016
|
onClick: onNext,
|
|
11376
13017
|
children: [
|
|
11377
13018
|
nextLabel,
|
|
11378
|
-
/* @__PURE__ */
|
|
13019
|
+
/* @__PURE__ */ jsx103(ChevronRight10, { className: "ml-1 h-4 w-4" })
|
|
11379
13020
|
]
|
|
11380
13021
|
}
|
|
11381
13022
|
)
|
|
@@ -11384,7 +13025,7 @@ function WizardTemplate({
|
|
|
11384
13025
|
}
|
|
11385
13026
|
|
|
11386
13027
|
// src/design-system/templates/dashboard-template.tsx
|
|
11387
|
-
import { jsx as
|
|
13028
|
+
import { jsx as jsx104, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
11388
13029
|
function DashboardTemplate({
|
|
11389
13030
|
title,
|
|
11390
13031
|
description,
|
|
@@ -11398,8 +13039,8 @@ function DashboardTemplate({
|
|
|
11398
13039
|
className,
|
|
11399
13040
|
...props
|
|
11400
13041
|
}) {
|
|
11401
|
-
return /* @__PURE__ */
|
|
11402
|
-
/* @__PURE__ */
|
|
13042
|
+
return /* @__PURE__ */ jsxs66("div", { className: cn("flex flex-col gap-6 p-4 sm:p-6 md:p-8", className), ...props, children: [
|
|
13043
|
+
/* @__PURE__ */ jsx104(
|
|
11403
13044
|
PageHeader,
|
|
11404
13045
|
{
|
|
11405
13046
|
title,
|
|
@@ -11409,15 +13050,15 @@ function DashboardTemplate({
|
|
|
11409
13050
|
actions
|
|
11410
13051
|
}
|
|
11411
13052
|
),
|
|
11412
|
-
metrics && /* @__PURE__ */
|
|
11413
|
-
charts && /* @__PURE__ */
|
|
11414
|
-
activity && /* @__PURE__ */
|
|
11415
|
-
children && /* @__PURE__ */
|
|
13053
|
+
metrics && /* @__PURE__ */ jsx104("section", { "aria-label": "Key Metrics", className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-4", children: metrics }),
|
|
13054
|
+
charts && /* @__PURE__ */ jsx104("section", { "aria-label": "Charts and Visualizations", className: "grid gap-4 md:grid-cols-2 lg:grid-cols-7", children: charts }),
|
|
13055
|
+
activity && /* @__PURE__ */ jsx104("section", { "aria-label": "Recent Activity", className: "space-y-4", children: activity }),
|
|
13056
|
+
children && /* @__PURE__ */ jsx104("div", { className: "space-y-6", children })
|
|
11416
13057
|
] });
|
|
11417
13058
|
}
|
|
11418
13059
|
|
|
11419
13060
|
// src/design-system/templates/workspace-template.tsx
|
|
11420
|
-
import { jsx as
|
|
13061
|
+
import { jsx as jsx105, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
11421
13062
|
function WorkspaceTemplate({
|
|
11422
13063
|
header,
|
|
11423
13064
|
leftSidebar,
|
|
@@ -11427,7 +13068,7 @@ function WorkspaceTemplate({
|
|
|
11427
13068
|
className,
|
|
11428
13069
|
...props
|
|
11429
13070
|
}) {
|
|
11430
|
-
return /* @__PURE__ */
|
|
13071
|
+
return /* @__PURE__ */ jsxs67(
|
|
11431
13072
|
"div",
|
|
11432
13073
|
{
|
|
11433
13074
|
className: cn(
|
|
@@ -11436,13 +13077,13 @@ function WorkspaceTemplate({
|
|
|
11436
13077
|
),
|
|
11437
13078
|
...props,
|
|
11438
13079
|
children: [
|
|
11439
|
-
header && /* @__PURE__ */
|
|
11440
|
-
/* @__PURE__ */
|
|
11441
|
-
leftSidebar && /* @__PURE__ */
|
|
11442
|
-
/* @__PURE__ */
|
|
11443
|
-
rightSidebar && /* @__PURE__ */
|
|
13080
|
+
header && /* @__PURE__ */ jsx105("header", { className: "flex h-14 shrink-0 items-center border-b px-4 bg-background z-10", children: header }),
|
|
13081
|
+
/* @__PURE__ */ jsxs67("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
13082
|
+
leftSidebar && /* @__PURE__ */ jsx105("aside", { className: "hidden md:flex w-64 shrink-0 flex-col border-r bg-sidebar p-3 overflow-y-auto", children: leftSidebar }),
|
|
13083
|
+
/* @__PURE__ */ jsx105("main", { className: "flex flex-1 flex-col overflow-y-auto p-4 sm:p-6 bg-muted/20", children }),
|
|
13084
|
+
rightSidebar && /* @__PURE__ */ jsx105("aside", { className: "hidden lg:flex w-80 shrink-0 flex-col border-l bg-background p-4 overflow-y-auto", children: rightSidebar })
|
|
11444
13085
|
] }),
|
|
11445
|
-
footer && /* @__PURE__ */
|
|
13086
|
+
footer && /* @__PURE__ */ jsx105("footer", { className: "flex h-10 shrink-0 items-center border-t px-4 text-xs text-muted-foreground bg-background", children: footer })
|
|
11446
13087
|
]
|
|
11447
13088
|
}
|
|
11448
13089
|
);
|
|
@@ -11450,14 +13091,14 @@ function WorkspaceTemplate({
|
|
|
11450
13091
|
|
|
11451
13092
|
// src/design-system/templates/app-header.tsx
|
|
11452
13093
|
import { useEffect as useEffect14 } from "react";
|
|
11453
|
-
import { Bell as
|
|
13094
|
+
import { Bell as Bell5 } from "lucide-react";
|
|
11454
13095
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
11455
13096
|
|
|
11456
13097
|
// src/components/layout/header.tsx
|
|
11457
|
-
import { useEffect as useEffect13, useState as
|
|
11458
|
-
import { jsx as
|
|
13098
|
+
import { useEffect as useEffect13, useState as useState14 } from "react";
|
|
13099
|
+
import { jsx as jsx106, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
11459
13100
|
function Header({ className, fixed, children, ...props }) {
|
|
11460
|
-
const [offset, setOffset] =
|
|
13101
|
+
const [offset, setOffset] = useState14(0);
|
|
11461
13102
|
useEffect13(() => {
|
|
11462
13103
|
const onScroll = () => {
|
|
11463
13104
|
setOffset(document.body.scrollTop || document.documentElement.scrollTop);
|
|
@@ -11467,7 +13108,7 @@ function Header({ className, fixed, children, ...props }) {
|
|
|
11467
13108
|
}, []);
|
|
11468
13109
|
return (
|
|
11469
13110
|
// Page header container: fixed mode me top par sticky behavior deta hai.
|
|
11470
|
-
/* @__PURE__ */
|
|
13111
|
+
/* @__PURE__ */ jsx106(
|
|
11471
13112
|
"header",
|
|
11472
13113
|
{
|
|
11473
13114
|
className: cn(
|
|
@@ -11477,7 +13118,7 @@ function Header({ className, fixed, children, ...props }) {
|
|
|
11477
13118
|
className
|
|
11478
13119
|
),
|
|
11479
13120
|
...props,
|
|
11480
|
-
children: /* @__PURE__ */
|
|
13121
|
+
children: /* @__PURE__ */ jsxs68(
|
|
11481
13122
|
"div",
|
|
11482
13123
|
{
|
|
11483
13124
|
className: cn(
|
|
@@ -11486,7 +13127,7 @@ function Header({ className, fixed, children, ...props }) {
|
|
|
11486
13127
|
offset > 10 && fixed && "after:absolute after:inset-0 after:-z-10 after:bg-background/20 after:backdrop-blur-lg"
|
|
11487
13128
|
),
|
|
11488
13129
|
children: [
|
|
11489
|
-
/* @__PURE__ */
|
|
13130
|
+
/* @__PURE__ */ jsx106(AppLogo, { className: "shrink-0 md:hidden" }),
|
|
11490
13131
|
children
|
|
11491
13132
|
]
|
|
11492
13133
|
}
|
|
@@ -11498,8 +13139,8 @@ function Header({ className, fixed, children, ...props }) {
|
|
|
11498
13139
|
|
|
11499
13140
|
// src/components/search.tsx
|
|
11500
13141
|
import { SearchIcon as SearchIcon5 } from "lucide-react";
|
|
11501
|
-
import { jsx as
|
|
11502
|
-
function
|
|
13142
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
13143
|
+
function Search7({
|
|
11503
13144
|
className = "",
|
|
11504
13145
|
placeholder = "Search",
|
|
11505
13146
|
iconOnly = true,
|
|
@@ -11511,7 +13152,7 @@ function Search6({
|
|
|
11511
13152
|
search.setOpen(true);
|
|
11512
13153
|
}
|
|
11513
13154
|
};
|
|
11514
|
-
return /* @__PURE__ */
|
|
13155
|
+
return /* @__PURE__ */ jsx107(
|
|
11515
13156
|
Button,
|
|
11516
13157
|
{
|
|
11517
13158
|
...props,
|
|
@@ -11521,7 +13162,7 @@ function Search6({
|
|
|
11521
13162
|
"aria-label": "Search",
|
|
11522
13163
|
"aria-keyshortcuts": "Meta+K Control+K",
|
|
11523
13164
|
onClick: openSearch,
|
|
11524
|
-
children: /* @__PURE__ */
|
|
13165
|
+
children: /* @__PURE__ */ jsx107(SearchIcon5, { className: "size-5", "aria-hidden": "true" })
|
|
11525
13166
|
}
|
|
11526
13167
|
);
|
|
11527
13168
|
}
|
|
@@ -11690,7 +13331,7 @@ var useNotificationStore = create2((set, get) => ({
|
|
|
11690
13331
|
}));
|
|
11691
13332
|
|
|
11692
13333
|
// src/design-system/templates/app-header.tsx
|
|
11693
|
-
import { Fragment as
|
|
13334
|
+
import { Fragment as Fragment4, jsx as jsx108, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
11694
13335
|
function AppHeader({
|
|
11695
13336
|
title,
|
|
11696
13337
|
fixed = true,
|
|
@@ -11709,12 +13350,12 @@ function AppHeader({
|
|
|
11709
13350
|
unsubscribe();
|
|
11710
13351
|
};
|
|
11711
13352
|
}, [currentUser, fetchNotifications, subscribeToNotifications, unsubscribe]);
|
|
11712
|
-
return /* @__PURE__ */
|
|
11713
|
-
/* @__PURE__ */
|
|
11714
|
-
/* @__PURE__ */
|
|
11715
|
-
/* @__PURE__ */
|
|
13353
|
+
return /* @__PURE__ */ jsx108(Header, { fixed, className: "border-b bg-background", children: /* @__PURE__ */ jsx108("div", { className: "flex flex-1 items-center justify-between w-full", children: iconsPosition === "left" ? /* @__PURE__ */ jsxs69("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [
|
|
13354
|
+
/* @__PURE__ */ jsx108("h1", { className: "min-w-0 truncate text-base font-semibold sm:text-lg", children: title }),
|
|
13355
|
+
/* @__PURE__ */ jsxs69("div", { className: "flex items-center gap-1 sm:gap-2 shrink-0 ml-1", children: [
|
|
13356
|
+
/* @__PURE__ */ jsx108(Search7, { iconOnly: true }),
|
|
11716
13357
|
children,
|
|
11717
|
-
/* @__PURE__ */
|
|
13358
|
+
/* @__PURE__ */ jsxs69(
|
|
11718
13359
|
Button,
|
|
11719
13360
|
{
|
|
11720
13361
|
variant: "ghost",
|
|
@@ -11723,18 +13364,18 @@ function AppHeader({
|
|
|
11723
13364
|
"aria-label": "Notifications",
|
|
11724
13365
|
onClick: () => router.push("/notification"),
|
|
11725
13366
|
children: [
|
|
11726
|
-
/* @__PURE__ */
|
|
11727
|
-
unreadCount > 0 && /* @__PURE__ */
|
|
13367
|
+
/* @__PURE__ */ jsx108(Bell5, { className: "size-5" }),
|
|
13368
|
+
unreadCount > 0 && /* @__PURE__ */ jsx108("span", { className: "absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white shadow-xs", children: unreadCount > 5 ? "5+" : unreadCount })
|
|
11728
13369
|
]
|
|
11729
13370
|
}
|
|
11730
13371
|
)
|
|
11731
13372
|
] })
|
|
11732
|
-
] }) : /* @__PURE__ */
|
|
11733
|
-
/* @__PURE__ */
|
|
11734
|
-
/* @__PURE__ */
|
|
11735
|
-
/* @__PURE__ */
|
|
13373
|
+
] }) : /* @__PURE__ */ jsxs69(Fragment4, { children: [
|
|
13374
|
+
/* @__PURE__ */ jsx108("h1", { className: "min-w-0 truncate text-base font-semibold sm:text-lg", children: title }),
|
|
13375
|
+
/* @__PURE__ */ jsxs69("div", { className: "ml-auto flex items-center gap-2 sm:gap-3", children: [
|
|
13376
|
+
/* @__PURE__ */ jsx108(Search7, { iconOnly: true }),
|
|
11736
13377
|
children,
|
|
11737
|
-
/* @__PURE__ */
|
|
13378
|
+
/* @__PURE__ */ jsxs69(
|
|
11738
13379
|
Button,
|
|
11739
13380
|
{
|
|
11740
13381
|
variant: "ghost",
|
|
@@ -11743,8 +13384,8 @@ function AppHeader({
|
|
|
11743
13384
|
"aria-label": "Notifications",
|
|
11744
13385
|
onClick: () => router.push("/notification"),
|
|
11745
13386
|
children: [
|
|
11746
|
-
/* @__PURE__ */
|
|
11747
|
-
unreadCount > 0 && /* @__PURE__ */
|
|
13387
|
+
/* @__PURE__ */ jsx108(Bell5, { className: "size-5" }),
|
|
13388
|
+
unreadCount > 0 && /* @__PURE__ */ jsx108("span", { className: "absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white shadow-xs", children: unreadCount > 5 ? "5+" : unreadCount })
|
|
11748
13389
|
]
|
|
11749
13390
|
}
|
|
11750
13391
|
)
|
|
@@ -11856,7 +13497,7 @@ var sidebarData2 = {
|
|
|
11856
13497
|
};
|
|
11857
13498
|
|
|
11858
13499
|
// src/design-system/templates/app-logo.tsx
|
|
11859
|
-
import { jsx as
|
|
13500
|
+
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
11860
13501
|
function AppLogo({ className, onClick }) {
|
|
11861
13502
|
const { toggleSidebar, setOpenMobile, isMobile } = useSidebar();
|
|
11862
13503
|
const team = sidebarData2.teams[0];
|
|
@@ -11873,7 +13514,7 @@ function AppLogo({ className, onClick }) {
|
|
|
11873
13514
|
toggleSidebar();
|
|
11874
13515
|
}
|
|
11875
13516
|
};
|
|
11876
|
-
return /* @__PURE__ */
|
|
13517
|
+
return /* @__PURE__ */ jsx109(
|
|
11877
13518
|
Button,
|
|
11878
13519
|
{
|
|
11879
13520
|
type: "button",
|
|
@@ -11884,14 +13525,14 @@ function AppLogo({ className, onClick }) {
|
|
|
11884
13525
|
className
|
|
11885
13526
|
),
|
|
11886
13527
|
"aria-label": "Open sidebar menu",
|
|
11887
|
-
children: /* @__PURE__ */
|
|
13528
|
+
children: /* @__PURE__ */ jsx109("div", { className: "flex size-full items-center justify-center rounded-lg bg-primary text-primary-foreground", children: /* @__PURE__ */ jsx109(Logo, { className: "size-4" }) })
|
|
11888
13529
|
}
|
|
11889
13530
|
);
|
|
11890
13531
|
}
|
|
11891
13532
|
|
|
11892
13533
|
// src/context/layout-provider.tsx
|
|
11893
|
-
import { createContext as createContext9, useContext as useContext10, useState as
|
|
11894
|
-
import { jsx as
|
|
13534
|
+
import { createContext as createContext9, useContext as useContext10, useState as useState15 } from "react";
|
|
13535
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
11895
13536
|
var LAYOUT_COLLAPSIBLE_COOKIE_NAME = "layout_collapsible";
|
|
11896
13537
|
var LAYOUT_VARIANT_COOKIE_NAME = "layout_variant";
|
|
11897
13538
|
var LAYOUT_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -11899,15 +13540,15 @@ var DEFAULT_VARIANT = "inset";
|
|
|
11899
13540
|
var DEFAULT_COLLAPSIBLE = "icon";
|
|
11900
13541
|
var LayoutContext = createContext9(null);
|
|
11901
13542
|
function LayoutProvider({ children }) {
|
|
11902
|
-
const [collapsible, _setCollapsible] =
|
|
13543
|
+
const [collapsible, _setCollapsible] = useState15(() => {
|
|
11903
13544
|
const saved = getCookie(LAYOUT_COLLAPSIBLE_COOKIE_NAME);
|
|
11904
13545
|
return saved || DEFAULT_COLLAPSIBLE;
|
|
11905
13546
|
});
|
|
11906
|
-
const [variant, _setVariant] =
|
|
13547
|
+
const [variant, _setVariant] = useState15(() => {
|
|
11907
13548
|
const saved = getCookie(LAYOUT_VARIANT_COOKIE_NAME);
|
|
11908
13549
|
return saved || DEFAULT_VARIANT;
|
|
11909
13550
|
});
|
|
11910
|
-
const [showInlineNotFound, setShowInlineNotFound] =
|
|
13551
|
+
const [showInlineNotFound, setShowInlineNotFound] = useState15(false);
|
|
11911
13552
|
const setCollapsible = (newCollapsible) => {
|
|
11912
13553
|
_setCollapsible(newCollapsible);
|
|
11913
13554
|
setCookie(
|
|
@@ -11935,7 +13576,7 @@ function LayoutProvider({ children }) {
|
|
|
11935
13576
|
showInlineNotFound,
|
|
11936
13577
|
setShowInlineNotFound
|
|
11937
13578
|
};
|
|
11938
|
-
return /* @__PURE__ */
|
|
13579
|
+
return /* @__PURE__ */ jsx110(LayoutContext, { value: contextValue, children });
|
|
11939
13580
|
}
|
|
11940
13581
|
function useLayout() {
|
|
11941
13582
|
const context = useContext10(LayoutContext);
|
|
@@ -11962,13 +13603,13 @@ function useLayout() {
|
|
|
11962
13603
|
// src/design-system/templates/nav-group.tsx
|
|
11963
13604
|
import Link3 from "next/link";
|
|
11964
13605
|
import { usePathname } from "next/navigation";
|
|
11965
|
-
import { ChevronRight as
|
|
11966
|
-
import { jsx as
|
|
13606
|
+
import { ChevronRight as ChevronRight11, X as X7 } from "lucide-react";
|
|
13607
|
+
import { jsx as jsx111, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
11967
13608
|
function NavGroup({ title, items }) {
|
|
11968
13609
|
const { state, isMobile, openMobile, setOpenMobile } = useSidebar();
|
|
11969
13610
|
const href = usePathname();
|
|
11970
|
-
return /* @__PURE__ */
|
|
11971
|
-
/* @__PURE__ */
|
|
13611
|
+
return /* @__PURE__ */ jsxs70(SidebarGroup, { className: cn(title === "Menu" && "pt-0"), children: [
|
|
13612
|
+
/* @__PURE__ */ jsxs70(
|
|
11972
13613
|
SidebarGroupLabel,
|
|
11973
13614
|
{
|
|
11974
13615
|
className: cn(
|
|
@@ -11976,8 +13617,8 @@ function NavGroup({ title, items }) {
|
|
|
11976
13617
|
title === "Menu" && state !== "collapsed" && "sticky top-0 z-20 bg-sidebar py-1.5"
|
|
11977
13618
|
),
|
|
11978
13619
|
children: [
|
|
11979
|
-
/* @__PURE__ */
|
|
11980
|
-
title === "Menu" && !isMobile && /* @__PURE__ */
|
|
13620
|
+
/* @__PURE__ */ jsx111("span", { children: title }),
|
|
13621
|
+
title === "Menu" && !isMobile && /* @__PURE__ */ jsx111(
|
|
11981
13622
|
SidebarTrigger,
|
|
11982
13623
|
{
|
|
11983
13624
|
variant: "ghost",
|
|
@@ -11985,7 +13626,7 @@ function NavGroup({ title, items }) {
|
|
|
11985
13626
|
"aria-label": "Toggle sidebar"
|
|
11986
13627
|
}
|
|
11987
13628
|
),
|
|
11988
|
-
title === "Menu" && isMobile && openMobile && /* @__PURE__ */
|
|
13629
|
+
title === "Menu" && isMobile && openMobile && /* @__PURE__ */ jsx111(
|
|
11989
13630
|
Button,
|
|
11990
13631
|
{
|
|
11991
13632
|
type: "button",
|
|
@@ -11994,37 +13635,37 @@ function NavGroup({ title, items }) {
|
|
|
11994
13635
|
className: "size-6 shrink-0",
|
|
11995
13636
|
"aria-label": "Close sidebar",
|
|
11996
13637
|
onClick: () => setOpenMobile(false),
|
|
11997
|
-
children: /* @__PURE__ */
|
|
13638
|
+
children: /* @__PURE__ */ jsx111(X7, { className: "size-4", "aria-hidden": "true" })
|
|
11998
13639
|
}
|
|
11999
13640
|
)
|
|
12000
13641
|
]
|
|
12001
13642
|
}
|
|
12002
13643
|
),
|
|
12003
|
-
/* @__PURE__ */
|
|
13644
|
+
/* @__PURE__ */ jsx111(SidebarMenu, { children: items.map((item) => {
|
|
12004
13645
|
const key = `${item.title}-${item.url}`;
|
|
12005
13646
|
if (!item.items)
|
|
12006
|
-
return /* @__PURE__ */
|
|
13647
|
+
return /* @__PURE__ */ jsx111(SidebarMenuLink, { item, href }, key);
|
|
12007
13648
|
if (item.title === "Settings" && item.items.length === 0)
|
|
12008
|
-
return /* @__PURE__ */
|
|
13649
|
+
return /* @__PURE__ */ jsx111(SidebarMenuSettings, { item }, key);
|
|
12009
13650
|
if (state === "collapsed" && !isMobile)
|
|
12010
|
-
return /* @__PURE__ */
|
|
12011
|
-
return /* @__PURE__ */
|
|
13651
|
+
return /* @__PURE__ */ jsx111(SidebarMenuCollapsedDropdown, { item, href }, key);
|
|
13652
|
+
return /* @__PURE__ */ jsx111(SidebarMenuCollapsible, { item, href }, key);
|
|
12012
13653
|
}) })
|
|
12013
13654
|
] });
|
|
12014
13655
|
}
|
|
12015
13656
|
function NavBadge({ children }) {
|
|
12016
|
-
return /* @__PURE__ */
|
|
13657
|
+
return /* @__PURE__ */ jsx111(Badge, { className: "rounded-full px-1 py-0 text-xs", children });
|
|
12017
13658
|
}
|
|
12018
13659
|
function SidebarMenuLink({ item, href }) {
|
|
12019
13660
|
const { setOpenMobile } = useSidebar();
|
|
12020
13661
|
const { setShowInlineNotFound } = useLayout();
|
|
12021
|
-
return /* @__PURE__ */
|
|
13662
|
+
return /* @__PURE__ */ jsx111(SidebarMenuItem, { children: /* @__PURE__ */ jsx111(
|
|
12022
13663
|
SidebarMenuButton,
|
|
12023
13664
|
{
|
|
12024
13665
|
asChild: true,
|
|
12025
13666
|
isActive: checkIsActive(href, item),
|
|
12026
13667
|
tooltip: item.title,
|
|
12027
|
-
children: /* @__PURE__ */
|
|
13668
|
+
children: /* @__PURE__ */ jsxs70(
|
|
12028
13669
|
Link3,
|
|
12029
13670
|
{
|
|
12030
13671
|
href: item.url,
|
|
@@ -12033,9 +13674,9 @@ function SidebarMenuLink({ item, href }) {
|
|
|
12033
13674
|
setOpenMobile(false);
|
|
12034
13675
|
},
|
|
12035
13676
|
children: [
|
|
12036
|
-
item.icon && /* @__PURE__ */
|
|
12037
|
-
/* @__PURE__ */
|
|
12038
|
-
item.badge && /* @__PURE__ */
|
|
13677
|
+
item.icon && /* @__PURE__ */ jsx111(item.icon, {}),
|
|
13678
|
+
/* @__PURE__ */ jsx111("span", { children: item.title }),
|
|
13679
|
+
item.badge && /* @__PURE__ */ jsx111(NavBadge, { children: item.badge })
|
|
12039
13680
|
]
|
|
12040
13681
|
}
|
|
12041
13682
|
)
|
|
@@ -12045,7 +13686,7 @@ function SidebarMenuLink({ item, href }) {
|
|
|
12045
13686
|
function SidebarMenuSettings({ item }) {
|
|
12046
13687
|
const { setOpenMobile } = useSidebar();
|
|
12047
13688
|
const { showInlineNotFound, setShowInlineNotFound } = useLayout();
|
|
12048
|
-
return /* @__PURE__ */
|
|
13689
|
+
return /* @__PURE__ */ jsx111(SidebarMenuItem, { children: /* @__PURE__ */ jsxs70(
|
|
12049
13690
|
SidebarMenuButton,
|
|
12050
13691
|
{
|
|
12051
13692
|
tooltip: item.title,
|
|
@@ -12055,8 +13696,8 @@ function SidebarMenuSettings({ item }) {
|
|
|
12055
13696
|
setOpenMobile(false);
|
|
12056
13697
|
},
|
|
12057
13698
|
children: [
|
|
12058
|
-
item.icon && /* @__PURE__ */
|
|
12059
|
-
/* @__PURE__ */
|
|
13699
|
+
item.icon && /* @__PURE__ */ jsx111(item.icon, {}),
|
|
13700
|
+
/* @__PURE__ */ jsx111("span", { children: item.title })
|
|
12060
13701
|
]
|
|
12061
13702
|
}
|
|
12062
13703
|
) });
|
|
@@ -12067,25 +13708,25 @@ function SidebarMenuCollapsible({
|
|
|
12067
13708
|
}) {
|
|
12068
13709
|
const { setOpenMobile } = useSidebar();
|
|
12069
13710
|
const { setShowInlineNotFound } = useLayout();
|
|
12070
|
-
return /* @__PURE__ */
|
|
13711
|
+
return /* @__PURE__ */ jsx111(
|
|
12071
13712
|
Collapsible,
|
|
12072
13713
|
{
|
|
12073
13714
|
asChild: true,
|
|
12074
13715
|
defaultOpen: checkIsActive(href, item, true),
|
|
12075
13716
|
className: "group/collapsible",
|
|
12076
|
-
children: /* @__PURE__ */
|
|
12077
|
-
/* @__PURE__ */
|
|
12078
|
-
item.icon && /* @__PURE__ */
|
|
12079
|
-
/* @__PURE__ */
|
|
12080
|
-
item.badge && /* @__PURE__ */
|
|
12081
|
-
/* @__PURE__ */
|
|
13717
|
+
children: /* @__PURE__ */ jsxs70(SidebarMenuItem, { children: [
|
|
13718
|
+
/* @__PURE__ */ jsx111(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs70(SidebarMenuButton, { tooltip: item.title, children: [
|
|
13719
|
+
item.icon && /* @__PURE__ */ jsx111(item.icon, {}),
|
|
13720
|
+
/* @__PURE__ */ jsx111("span", { children: item.title }),
|
|
13721
|
+
item.badge && /* @__PURE__ */ jsx111(NavBadge, { children: item.badge }),
|
|
13722
|
+
/* @__PURE__ */ jsx111(ChevronRight11, { className: "ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 rtl:rotate-180" })
|
|
12082
13723
|
] }) }),
|
|
12083
|
-
/* @__PURE__ */
|
|
13724
|
+
/* @__PURE__ */ jsx111(CollapsibleContent, { className: "CollapsibleContent", children: /* @__PURE__ */ jsx111(SidebarMenuSub, { children: item.items.map((subItem) => /* @__PURE__ */ jsx111(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx111(
|
|
12084
13725
|
SidebarMenuSubButton,
|
|
12085
13726
|
{
|
|
12086
13727
|
asChild: true,
|
|
12087
13728
|
isActive: checkIsActive(href, subItem),
|
|
12088
|
-
children: /* @__PURE__ */
|
|
13729
|
+
children: /* @__PURE__ */ jsxs70(
|
|
12089
13730
|
Link3,
|
|
12090
13731
|
{
|
|
12091
13732
|
href: subItem.url,
|
|
@@ -12094,9 +13735,9 @@ function SidebarMenuCollapsible({
|
|
|
12094
13735
|
setOpenMobile(false);
|
|
12095
13736
|
},
|
|
12096
13737
|
children: [
|
|
12097
|
-
subItem.icon && /* @__PURE__ */
|
|
12098
|
-
/* @__PURE__ */
|
|
12099
|
-
subItem.badge && /* @__PURE__ */
|
|
13738
|
+
subItem.icon && /* @__PURE__ */ jsx111(subItem.icon, {}),
|
|
13739
|
+
/* @__PURE__ */ jsx111("span", { children: subItem.title }),
|
|
13740
|
+
subItem.badge && /* @__PURE__ */ jsx111(NavBadge, { children: subItem.badge })
|
|
12100
13741
|
]
|
|
12101
13742
|
}
|
|
12102
13743
|
)
|
|
@@ -12110,36 +13751,36 @@ function SidebarMenuCollapsedDropdown({
|
|
|
12110
13751
|
item,
|
|
12111
13752
|
href
|
|
12112
13753
|
}) {
|
|
12113
|
-
return /* @__PURE__ */
|
|
12114
|
-
/* @__PURE__ */
|
|
13754
|
+
return /* @__PURE__ */ jsx111(SidebarMenuItem, { children: /* @__PURE__ */ jsxs70(DropdownMenu, { children: [
|
|
13755
|
+
/* @__PURE__ */ jsx111(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs70(
|
|
12115
13756
|
SidebarMenuButton,
|
|
12116
13757
|
{
|
|
12117
13758
|
tooltip: item.title,
|
|
12118
13759
|
isActive: checkIsActive(href, item),
|
|
12119
13760
|
children: [
|
|
12120
|
-
item.icon && /* @__PURE__ */
|
|
12121
|
-
/* @__PURE__ */
|
|
12122
|
-
item.badge && /* @__PURE__ */
|
|
12123
|
-
/* @__PURE__ */
|
|
13761
|
+
item.icon && /* @__PURE__ */ jsx111(item.icon, {}),
|
|
13762
|
+
/* @__PURE__ */ jsx111("span", { children: item.title }),
|
|
13763
|
+
item.badge && /* @__PURE__ */ jsx111(NavBadge, { children: item.badge }),
|
|
13764
|
+
/* @__PURE__ */ jsx111(ChevronRight11, { className: "ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
12124
13765
|
]
|
|
12125
13766
|
}
|
|
12126
13767
|
) }),
|
|
12127
|
-
/* @__PURE__ */
|
|
12128
|
-
/* @__PURE__ */
|
|
13768
|
+
/* @__PURE__ */ jsxs70(DropdownMenuContent, { side: "right", align: "start", sideOffset: 4, children: [
|
|
13769
|
+
/* @__PURE__ */ jsxs70(DropdownMenuLabel, { children: [
|
|
12129
13770
|
item.title,
|
|
12130
13771
|
" ",
|
|
12131
13772
|
item.badge ? `(${item.badge})` : ""
|
|
12132
13773
|
] }),
|
|
12133
|
-
/* @__PURE__ */
|
|
12134
|
-
item.items.map((sub) => /* @__PURE__ */
|
|
13774
|
+
/* @__PURE__ */ jsx111(DropdownMenuSeparator, {}),
|
|
13775
|
+
item.items.map((sub) => /* @__PURE__ */ jsx111(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs70(
|
|
12135
13776
|
Link3,
|
|
12136
13777
|
{
|
|
12137
13778
|
href: sub.url,
|
|
12138
13779
|
className: `${checkIsActive(href, sub) ? "bg-secondary" : ""}`,
|
|
12139
13780
|
children: [
|
|
12140
|
-
sub.icon && /* @__PURE__ */
|
|
12141
|
-
/* @__PURE__ */
|
|
12142
|
-
sub.badge && /* @__PURE__ */
|
|
13781
|
+
sub.icon && /* @__PURE__ */ jsx111(sub.icon, {}),
|
|
13782
|
+
/* @__PURE__ */ jsx111("span", { className: "max-w-52 text-wrap", children: sub.title }),
|
|
13783
|
+
sub.badge && /* @__PURE__ */ jsx111("span", { className: "ms-auto text-xs", children: sub.badge })
|
|
12143
13784
|
]
|
|
12144
13785
|
}
|
|
12145
13786
|
) }, `${sub.title}-${sub.url}`))
|
|
@@ -12154,20 +13795,20 @@ function checkIsActive(href, item, mainNav = false) {
|
|
|
12154
13795
|
}
|
|
12155
13796
|
|
|
12156
13797
|
// src/design-system/templates/team-switcher.tsx
|
|
12157
|
-
import { jsx as
|
|
13798
|
+
import { jsx as jsx112, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
12158
13799
|
function TeamSwitcher({ teams }) {
|
|
12159
13800
|
useSidebar();
|
|
12160
13801
|
const activeTeam = teams[0];
|
|
12161
|
-
return /* @__PURE__ */
|
|
13802
|
+
return /* @__PURE__ */ jsx112(SidebarMenu, { children: /* @__PURE__ */ jsx112(SidebarMenuItem, { children: /* @__PURE__ */ jsxs71(
|
|
12162
13803
|
SidebarMenuButton,
|
|
12163
13804
|
{
|
|
12164
13805
|
size: "lg",
|
|
12165
13806
|
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
12166
13807
|
children: [
|
|
12167
|
-
/* @__PURE__ */
|
|
12168
|
-
/* @__PURE__ */
|
|
12169
|
-
/* @__PURE__ */
|
|
12170
|
-
/* @__PURE__ */
|
|
13808
|
+
/* @__PURE__ */ jsx112("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground", children: /* @__PURE__ */ jsx112(activeTeam.logo, { className: "size-4" }) }),
|
|
13809
|
+
/* @__PURE__ */ jsxs71("div", { className: "grid flex-1 text-start text-sm leading-tight", children: [
|
|
13810
|
+
/* @__PURE__ */ jsx112("span", { className: "truncate font-semibold", children: activeTeam.name }),
|
|
13811
|
+
/* @__PURE__ */ jsx112("span", { className: "truncate text-xs", children: activeTeam.plan })
|
|
12171
13812
|
] })
|
|
12172
13813
|
]
|
|
12173
13814
|
}
|
|
@@ -12183,22 +13824,22 @@ import {
|
|
|
12183
13824
|
} from "lucide-react";
|
|
12184
13825
|
|
|
12185
13826
|
// src/hooks/use-dialog-state.tsx
|
|
12186
|
-
import { useState as
|
|
13827
|
+
import { useState as useState16 } from "react";
|
|
12187
13828
|
function useDialogState(initialState2 = null) {
|
|
12188
|
-
const [open, _setOpen] =
|
|
13829
|
+
const [open, _setOpen] = useState16(initialState2);
|
|
12189
13830
|
const setOpen = (str) => _setOpen((prev) => prev === str ? null : str);
|
|
12190
13831
|
return [open, setOpen];
|
|
12191
13832
|
}
|
|
12192
13833
|
|
|
12193
13834
|
// src/components/config-drawer.tsx
|
|
12194
|
-
import { useState as
|
|
13835
|
+
import { useState as useState17 } from "react";
|
|
12195
13836
|
import { Root as Radio, Item as Item2 } from "@radix-ui/react-radio-group";
|
|
12196
|
-
import { Check as
|
|
13837
|
+
import { Check as Check9, CircleCheck, RotateCcw, Search as Search8, Settings as Settings3 } from "lucide-react";
|
|
12197
13838
|
|
|
12198
13839
|
// src/assets/custom/icon-theme-dark.tsx
|
|
12199
|
-
import { jsx as
|
|
13840
|
+
import { jsx as jsx113, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
12200
13841
|
function IconThemeDark(props) {
|
|
12201
|
-
return /* @__PURE__ */
|
|
13842
|
+
return /* @__PURE__ */ jsxs72(
|
|
12202
13843
|
"svg",
|
|
12203
13844
|
{
|
|
12204
13845
|
"data-name": "icon-theme-dark",
|
|
@@ -12206,27 +13847,27 @@ function IconThemeDark(props) {
|
|
|
12206
13847
|
viewBox: "0 0 79.86 51.14",
|
|
12207
13848
|
...props,
|
|
12208
13849
|
children: [
|
|
12209
|
-
/* @__PURE__ */
|
|
12210
|
-
/* @__PURE__ */
|
|
12211
|
-
/* @__PURE__ */
|
|
13850
|
+
/* @__PURE__ */ jsxs72("g", { fill: "#1d2b3f", children: [
|
|
13851
|
+
/* @__PURE__ */ jsx113("rect", { x: 0.53, y: 0.5, width: 78.83, height: 50.14, rx: 3.5, ry: 3.5 }),
|
|
13852
|
+
/* @__PURE__ */ jsx113("path", { d: "M75.86 1c1.65 0 3 1.35 3 3v43.14c0 1.65-1.35 3-3 3H4.03c-1.65 0-3-1.35-3-3V4c0-1.65 1.35-3 3-3h71.83m0-1H4.03c-2.21 0-4 1.79-4 4v43.14c0 2.21 1.79 4 4 4h71.83c2.21 0 4-1.79 4-4V4c0-2.21-1.79-4-4-4z" })
|
|
12212
13853
|
] }),
|
|
12213
|
-
/* @__PURE__ */
|
|
13854
|
+
/* @__PURE__ */ jsx113(
|
|
12214
13855
|
"path",
|
|
12215
13856
|
{
|
|
12216
13857
|
d: "M22.88 0h52.97c2.21 0 4 1.79 4 4v43.14c0 2.21-1.79 4-4 4H22.88V0z",
|
|
12217
13858
|
fill: "#0d1628"
|
|
12218
13859
|
}
|
|
12219
13860
|
),
|
|
12220
|
-
/* @__PURE__ */
|
|
12221
|
-
/* @__PURE__ */
|
|
13861
|
+
/* @__PURE__ */ jsx113("circle", { cx: 6.7, cy: 7.04, r: 3.54, fill: "#426187" }),
|
|
13862
|
+
/* @__PURE__ */ jsx113(
|
|
12222
13863
|
"path",
|
|
12223
13864
|
{
|
|
12224
13865
|
d: "M18.12 6.39h-5.87c-.6 0-1.09-.45-1.09-1s.49-1 1.09-1h5.87c.6 0 1.09.45 1.09 1s-.49 1-1.09 1zM16.55 9.77h-4.24c-.55 0-1-.45-1-1s.45-1 1-1h4.24c.55 0 1 .45 1 1s-.45 1-1 1zM18.32 17.37H4.59c-.69 0-1.25-.47-1.25-1.05s.56-1.05 1.25-1.05h13.73c.69 0 1.25.47 1.25 1.05s-.56 1.05-1.25 1.05zM15.34 21.26h-11c-.55 0-1-.41-1-.91s.45-.91 1-.91h11c.55 0 1 .41 1 .91s-.45.91-1 .91zM16.46 25.57H4.43c-.6 0-1.09-.44-1.09-.98s.49-.98 1.09-.98h12.03c.6 0 1.09.44 1.09.98s-.49.98-1.09.98z",
|
|
12225
13866
|
fill: "#426187"
|
|
12226
13867
|
}
|
|
12227
13868
|
),
|
|
12228
|
-
/* @__PURE__ */
|
|
12229
|
-
/* @__PURE__ */
|
|
13869
|
+
/* @__PURE__ */ jsxs72("g", { fill: "#2a62bc", children: [
|
|
13870
|
+
/* @__PURE__ */ jsx113(
|
|
12230
13871
|
"rect",
|
|
12231
13872
|
{
|
|
12232
13873
|
x: 33.36,
|
|
@@ -12238,7 +13879,7 @@ function IconThemeDark(props) {
|
|
|
12238
13879
|
opacity: 0.32
|
|
12239
13880
|
}
|
|
12240
13881
|
),
|
|
12241
|
-
/* @__PURE__ */
|
|
13882
|
+
/* @__PURE__ */ jsx113(
|
|
12242
13883
|
"rect",
|
|
12243
13884
|
{
|
|
12244
13885
|
x: 29.64,
|
|
@@ -12250,7 +13891,7 @@ function IconThemeDark(props) {
|
|
|
12250
13891
|
opacity: 0.44
|
|
12251
13892
|
}
|
|
12252
13893
|
),
|
|
12253
|
-
/* @__PURE__ */
|
|
13894
|
+
/* @__PURE__ */ jsx113(
|
|
12254
13895
|
"rect",
|
|
12255
13896
|
{
|
|
12256
13897
|
x: 37.16,
|
|
@@ -12262,7 +13903,7 @@ function IconThemeDark(props) {
|
|
|
12262
13903
|
opacity: 0.53
|
|
12263
13904
|
}
|
|
12264
13905
|
),
|
|
12265
|
-
/* @__PURE__ */
|
|
13906
|
+
/* @__PURE__ */ jsx113(
|
|
12266
13907
|
"rect",
|
|
12267
13908
|
{
|
|
12268
13909
|
x: 41.19,
|
|
@@ -12275,8 +13916,8 @@ function IconThemeDark(props) {
|
|
|
12275
13916
|
}
|
|
12276
13917
|
)
|
|
12277
13918
|
] }),
|
|
12278
|
-
/* @__PURE__ */
|
|
12279
|
-
/* @__PURE__ */
|
|
13919
|
+
/* @__PURE__ */ jsx113("circle", { cx: 62.74, cy: 16.32, r: 8, fill: "#2f5491", opacity: 0.5 }),
|
|
13920
|
+
/* @__PURE__ */ jsx113(
|
|
12280
13921
|
"path",
|
|
12281
13922
|
{
|
|
12282
13923
|
d: "M62.74 16.32l4.1-6.87c1.19.71 2.18 1.72 2.86 2.92s1.04 2.57 1.04 3.95h-8z",
|
|
@@ -12284,7 +13925,7 @@ function IconThemeDark(props) {
|
|
|
12284
13925
|
opacity: 0.74
|
|
12285
13926
|
}
|
|
12286
13927
|
),
|
|
12287
|
-
/* @__PURE__ */
|
|
13928
|
+
/* @__PURE__ */ jsx113(
|
|
12288
13929
|
"rect",
|
|
12289
13930
|
{
|
|
12290
13931
|
x: 29.64,
|
|
@@ -12302,9 +13943,9 @@ function IconThemeDark(props) {
|
|
|
12302
13943
|
}
|
|
12303
13944
|
|
|
12304
13945
|
// src/assets/custom/icon-theme-light.tsx
|
|
12305
|
-
import { jsx as
|
|
13946
|
+
import { jsx as jsx114, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
12306
13947
|
function IconThemeLight(props) {
|
|
12307
|
-
return /* @__PURE__ */
|
|
13948
|
+
return /* @__PURE__ */ jsxs73(
|
|
12308
13949
|
"svg",
|
|
12309
13950
|
{
|
|
12310
13951
|
"data-name": "icon-theme-light",
|
|
@@ -12312,27 +13953,27 @@ function IconThemeLight(props) {
|
|
|
12312
13953
|
viewBox: "0 0 79.86 51.14",
|
|
12313
13954
|
...props,
|
|
12314
13955
|
children: [
|
|
12315
|
-
/* @__PURE__ */
|
|
12316
|
-
/* @__PURE__ */
|
|
12317
|
-
/* @__PURE__ */
|
|
13956
|
+
/* @__PURE__ */ jsxs73("g", { fill: "#d9d9d9", children: [
|
|
13957
|
+
/* @__PURE__ */ jsx114("rect", { x: 0.53, y: 0.5, width: 78.83, height: 50.14, rx: 3.5, ry: 3.5 }),
|
|
13958
|
+
/* @__PURE__ */ jsx114("path", { d: "M75.86 1c1.65 0 3 1.35 3 3v43.14c0 1.65-1.35 3-3 3H4.03c-1.65 0-3-1.35-3-3V4c0-1.65 1.35-3 3-3h71.83m0-1H4.03c-2.21 0-4 1.79-4 4v43.14c0 2.21 1.79 4 4 4h71.83c2.21 0 4-1.79 4-4V4c0-2.21-1.79-4-4-4z" })
|
|
12318
13959
|
] }),
|
|
12319
|
-
/* @__PURE__ */
|
|
13960
|
+
/* @__PURE__ */ jsx114(
|
|
12320
13961
|
"path",
|
|
12321
13962
|
{
|
|
12322
13963
|
d: "M22.88 0h52.97c2.21 0 4 1.79 4 4v43.14c0 2.21-1.79 4-4 4H22.88V0z",
|
|
12323
13964
|
fill: "#ecedef"
|
|
12324
13965
|
}
|
|
12325
13966
|
),
|
|
12326
|
-
/* @__PURE__ */
|
|
12327
|
-
/* @__PURE__ */
|
|
13967
|
+
/* @__PURE__ */ jsx114("circle", { cx: 6.7, cy: 7.04, r: 3.54, fill: "#fff" }),
|
|
13968
|
+
/* @__PURE__ */ jsx114(
|
|
12328
13969
|
"path",
|
|
12329
13970
|
{
|
|
12330
13971
|
d: "M18.12 6.39h-5.87c-.6 0-1.09-.45-1.09-1s.49-1 1.09-1h5.87c.6 0 1.09.45 1.09 1s-.49 1-1.09 1zM16.55 9.77h-4.24c-.55 0-1-.45-1-1s.45-1 1-1h4.24c.55 0 1 .45 1 1s-.45 1-1 1zM18.32 17.37H4.59c-.69 0-1.25-.47-1.25-1.05s.56-1.05 1.25-1.05h13.73c.69 0 1.25.47 1.25 1.05s-.56 1.05-1.25 1.05zM15.34 21.26h-11c-.55 0-1-.41-1-.91s.45-.91 1-.91h11c.55 0 1 .41 1 .91s-.45.91-1 .91zM16.46 25.57H4.43c-.6 0-1.09-.44-1.09-.98s.49-.98 1.09-.98h12.03c.6 0 1.09.44 1.09.98s-.49.98-1.09.98z",
|
|
12331
13972
|
fill: "#fff"
|
|
12332
13973
|
}
|
|
12333
13974
|
),
|
|
12334
|
-
/* @__PURE__ */
|
|
12335
|
-
/* @__PURE__ */
|
|
13975
|
+
/* @__PURE__ */ jsxs73("g", { fill: "#c0c4c4", children: [
|
|
13976
|
+
/* @__PURE__ */ jsx114(
|
|
12336
13977
|
"rect",
|
|
12337
13978
|
{
|
|
12338
13979
|
x: 33.36,
|
|
@@ -12344,7 +13985,7 @@ function IconThemeLight(props) {
|
|
|
12344
13985
|
opacity: 0.32
|
|
12345
13986
|
}
|
|
12346
13987
|
),
|
|
12347
|
-
/* @__PURE__ */
|
|
13988
|
+
/* @__PURE__ */ jsx114(
|
|
12348
13989
|
"rect",
|
|
12349
13990
|
{
|
|
12350
13991
|
x: 29.64,
|
|
@@ -12356,7 +13997,7 @@ function IconThemeLight(props) {
|
|
|
12356
13997
|
opacity: 0.44
|
|
12357
13998
|
}
|
|
12358
13999
|
),
|
|
12359
|
-
/* @__PURE__ */
|
|
14000
|
+
/* @__PURE__ */ jsx114(
|
|
12360
14001
|
"rect",
|
|
12361
14002
|
{
|
|
12362
14003
|
x: 37.16,
|
|
@@ -12368,7 +14009,7 @@ function IconThemeLight(props) {
|
|
|
12368
14009
|
opacity: 0.53
|
|
12369
14010
|
}
|
|
12370
14011
|
),
|
|
12371
|
-
/* @__PURE__ */
|
|
14012
|
+
/* @__PURE__ */ jsx114(
|
|
12372
14013
|
"rect",
|
|
12373
14014
|
{
|
|
12374
14015
|
x: 41.19,
|
|
@@ -12381,12 +14022,12 @@ function IconThemeLight(props) {
|
|
|
12381
14022
|
}
|
|
12382
14023
|
)
|
|
12383
14024
|
] }),
|
|
12384
|
-
/* @__PURE__ */
|
|
12385
|
-
/* @__PURE__ */
|
|
12386
|
-
/* @__PURE__ */
|
|
12387
|
-
/* @__PURE__ */
|
|
14025
|
+
/* @__PURE__ */ jsx114("circle", { cx: 62.74, cy: 16.32, r: 8, fill: "#fff" }),
|
|
14026
|
+
/* @__PURE__ */ jsxs73("g", { fill: "#d9d9d9", children: [
|
|
14027
|
+
/* @__PURE__ */ jsx114("path", { d: "M63.62 15.82L67 10.15c.93.64 1.7 1.48 2.26 2.47.56.98.89 2.08.96 3.21h-6.6z" }),
|
|
14028
|
+
/* @__PURE__ */ jsx114("path", { d: "M67.14 10.88a6.977 6.977 0 012.52 4.44h-5.17l2.65-4.44m-.31-1.43l-4.1 6.87h8c0-1.39-.36-2.75-1.04-3.95s-1.67-2.21-2.86-2.92z" })
|
|
12388
14029
|
] }),
|
|
12389
|
-
/* @__PURE__ */
|
|
14030
|
+
/* @__PURE__ */ jsx114(
|
|
12390
14031
|
"rect",
|
|
12391
14032
|
{
|
|
12392
14033
|
x: 29.64,
|
|
@@ -12404,12 +14045,12 @@ function IconThemeLight(props) {
|
|
|
12404
14045
|
}
|
|
12405
14046
|
|
|
12406
14047
|
// src/assets/custom/icon-theme-system.tsx
|
|
12407
|
-
import { jsx as
|
|
14048
|
+
import { jsx as jsx115, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
12408
14049
|
function IconThemeSystem({
|
|
12409
14050
|
className,
|
|
12410
14051
|
...props
|
|
12411
14052
|
}) {
|
|
12412
|
-
return /* @__PURE__ */
|
|
14053
|
+
return /* @__PURE__ */ jsxs74(
|
|
12413
14054
|
"svg",
|
|
12414
14055
|
{
|
|
12415
14056
|
"data-name": "icon-theme-system",
|
|
@@ -12422,8 +14063,8 @@ function IconThemeSystem({
|
|
|
12422
14063
|
),
|
|
12423
14064
|
...props,
|
|
12424
14065
|
children: [
|
|
12425
|
-
/* @__PURE__ */
|
|
12426
|
-
/* @__PURE__ */
|
|
14066
|
+
/* @__PURE__ */ jsx115("path", { opacity: 0.2, d: "M0 0.03H22.88V51.17H0z" }),
|
|
14067
|
+
/* @__PURE__ */ jsx115(
|
|
12427
14068
|
"circle",
|
|
12428
14069
|
{
|
|
12429
14070
|
cx: 6.7,
|
|
@@ -12436,7 +14077,7 @@ function IconThemeSystem({
|
|
|
12436
14077
|
strokeMiterlimit: 10
|
|
12437
14078
|
}
|
|
12438
14079
|
),
|
|
12439
|
-
/* @__PURE__ */
|
|
14080
|
+
/* @__PURE__ */ jsx115(
|
|
12440
14081
|
"path",
|
|
12441
14082
|
{
|
|
12442
14083
|
d: "M18.12 6.39h-5.87c-.6 0-1.09-.45-1.09-1s.49-1 1.09-1h5.87c.6 0 1.09.45 1.09 1s-.49 1-1.09 1zM16.55 9.77h-4.24c-.55 0-1-.45-1-1s.45-1 1-1h4.24c.55 0 1 .45 1 1s-.45 1-1 1z",
|
|
@@ -12445,7 +14086,7 @@ function IconThemeSystem({
|
|
|
12445
14086
|
opacity: 0.75
|
|
12446
14087
|
}
|
|
12447
14088
|
),
|
|
12448
|
-
/* @__PURE__ */
|
|
14089
|
+
/* @__PURE__ */ jsx115(
|
|
12449
14090
|
"path",
|
|
12450
14091
|
{
|
|
12451
14092
|
d: "M18.32 17.37H4.59c-.69 0-1.25-.47-1.25-1.05s.56-1.05 1.25-1.05h13.73c.69 0 1.25.47 1.25 1.05s-.56 1.05-1.25 1.05z",
|
|
@@ -12454,7 +14095,7 @@ function IconThemeSystem({
|
|
|
12454
14095
|
opacity: 0.72
|
|
12455
14096
|
}
|
|
12456
14097
|
),
|
|
12457
|
-
/* @__PURE__ */
|
|
14098
|
+
/* @__PURE__ */ jsx115(
|
|
12458
14099
|
"path",
|
|
12459
14100
|
{
|
|
12460
14101
|
d: "M15.34 21.26h-11c-.55 0-1-.41-1-.91s.45-.91 1-.91h11c.55 0 1 .41 1 .91s-.45.91-1 .91z",
|
|
@@ -12463,7 +14104,7 @@ function IconThemeSystem({
|
|
|
12463
14104
|
opacity: 0.55
|
|
12464
14105
|
}
|
|
12465
14106
|
),
|
|
12466
|
-
/* @__PURE__ */
|
|
14107
|
+
/* @__PURE__ */ jsx115(
|
|
12467
14108
|
"path",
|
|
12468
14109
|
{
|
|
12469
14110
|
d: "M16.46 25.57H4.43c-.6 0-1.09-.44-1.09-.98s.49-.98 1.09-.98h12.03c.6 0 1.09.44 1.09.98s-.49.98-1.09.98z",
|
|
@@ -12472,7 +14113,7 @@ function IconThemeSystem({
|
|
|
12472
14113
|
opacity: 0.67
|
|
12473
14114
|
}
|
|
12474
14115
|
),
|
|
12475
|
-
/* @__PURE__ */
|
|
14116
|
+
/* @__PURE__ */ jsx115(
|
|
12476
14117
|
"rect",
|
|
12477
14118
|
{
|
|
12478
14119
|
x: 33.36,
|
|
@@ -12485,7 +14126,7 @@ function IconThemeSystem({
|
|
|
12485
14126
|
stroke: "none"
|
|
12486
14127
|
}
|
|
12487
14128
|
),
|
|
12488
|
-
/* @__PURE__ */
|
|
14129
|
+
/* @__PURE__ */ jsx115(
|
|
12489
14130
|
"rect",
|
|
12490
14131
|
{
|
|
12491
14132
|
x: 29.64,
|
|
@@ -12498,7 +14139,7 @@ function IconThemeSystem({
|
|
|
12498
14139
|
stroke: "none"
|
|
12499
14140
|
}
|
|
12500
14141
|
),
|
|
12501
|
-
/* @__PURE__ */
|
|
14142
|
+
/* @__PURE__ */ jsx115(
|
|
12502
14143
|
"rect",
|
|
12503
14144
|
{
|
|
12504
14145
|
x: 37.16,
|
|
@@ -12511,7 +14152,7 @@ function IconThemeSystem({
|
|
|
12511
14152
|
stroke: "none"
|
|
12512
14153
|
}
|
|
12513
14154
|
),
|
|
12514
|
-
/* @__PURE__ */
|
|
14155
|
+
/* @__PURE__ */ jsx115(
|
|
12515
14156
|
"rect",
|
|
12516
14157
|
{
|
|
12517
14158
|
x: 41.19,
|
|
@@ -12524,9 +14165,9 @@ function IconThemeSystem({
|
|
|
12524
14165
|
stroke: "none"
|
|
12525
14166
|
}
|
|
12526
14167
|
),
|
|
12527
|
-
/* @__PURE__ */
|
|
12528
|
-
/* @__PURE__ */
|
|
12529
|
-
/* @__PURE__ */
|
|
14168
|
+
/* @__PURE__ */ jsxs74("g", { children: [
|
|
14169
|
+
/* @__PURE__ */ jsx115("circle", { cx: 62.74, cy: 16.32, r: 8, opacity: 0.25 }),
|
|
14170
|
+
/* @__PURE__ */ jsx115(
|
|
12530
14171
|
"path",
|
|
12531
14172
|
{
|
|
12532
14173
|
d: "M62.74 16.32l4.1-6.87c1.19.71 2.18 1.72 2.86 2.92s1.04 2.57 1.04 3.95h-8z",
|
|
@@ -12534,7 +14175,7 @@ function IconThemeSystem({
|
|
|
12534
14175
|
}
|
|
12535
14176
|
)
|
|
12536
14177
|
] }),
|
|
12537
|
-
/* @__PURE__ */
|
|
14178
|
+
/* @__PURE__ */ jsx115(
|
|
12538
14179
|
"rect",
|
|
12539
14180
|
{
|
|
12540
14181
|
x: 29.64,
|
|
@@ -12555,7 +14196,7 @@ function IconThemeSystem({
|
|
|
12555
14196
|
}
|
|
12556
14197
|
|
|
12557
14198
|
// src/components/config-drawer.tsx
|
|
12558
|
-
import { jsx as
|
|
14199
|
+
import { jsx as jsx116, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
12559
14200
|
function ConfigDrawer({
|
|
12560
14201
|
trigger
|
|
12561
14202
|
}) {
|
|
@@ -12565,27 +14206,27 @@ function ConfigDrawer({
|
|
|
12565
14206
|
resetTheme();
|
|
12566
14207
|
resetColorTheme();
|
|
12567
14208
|
};
|
|
12568
|
-
return /* @__PURE__ */
|
|
12569
|
-
/* @__PURE__ */
|
|
14209
|
+
return /* @__PURE__ */ jsxs75(Sheet, { children: [
|
|
14210
|
+
/* @__PURE__ */ jsx116(SheetTrigger, { asChild: true, children: trigger ?? /* @__PURE__ */ jsx116(
|
|
12570
14211
|
Button,
|
|
12571
14212
|
{
|
|
12572
14213
|
size: "icon",
|
|
12573
14214
|
variant: "ghost",
|
|
12574
14215
|
"aria-label": "Open theme settings",
|
|
12575
14216
|
className: "rounded-full",
|
|
12576
|
-
children: /* @__PURE__ */
|
|
14217
|
+
children: /* @__PURE__ */ jsx116(Settings3, { "aria-hidden": "true" })
|
|
12577
14218
|
}
|
|
12578
14219
|
) }),
|
|
12579
|
-
/* @__PURE__ */
|
|
12580
|
-
/* @__PURE__ */
|
|
12581
|
-
/* @__PURE__ */
|
|
12582
|
-
/* @__PURE__ */
|
|
14220
|
+
/* @__PURE__ */ jsxs75(SheetContent, { className: "flex flex-col", children: [
|
|
14221
|
+
/* @__PURE__ */ jsxs75(SheetHeader, { className: "pb-0 text-start", children: [
|
|
14222
|
+
/* @__PURE__ */ jsx116(SheetTitle, { children: "Theme Settings" }),
|
|
14223
|
+
/* @__PURE__ */ jsx116(SheetDescription, { children: "Customize the look and feel of your dashboard." })
|
|
12583
14224
|
] }),
|
|
12584
|
-
/* @__PURE__ */
|
|
12585
|
-
/* @__PURE__ */
|
|
12586
|
-
/* @__PURE__ */
|
|
14225
|
+
/* @__PURE__ */ jsxs75("div", { className: "flex flex-1 flex-col gap-6 overflow-hidden px-4", children: [
|
|
14226
|
+
/* @__PURE__ */ jsx116(ThemeConfig, {}),
|
|
14227
|
+
/* @__PURE__ */ jsx116(ThemeListSelector, {})
|
|
12587
14228
|
] }),
|
|
12588
|
-
/* @__PURE__ */
|
|
14229
|
+
/* @__PURE__ */ jsx116(SheetFooter, { className: "gap-2", children: /* @__PURE__ */ jsx116(
|
|
12589
14230
|
Button,
|
|
12590
14231
|
{
|
|
12591
14232
|
variant: "destructive",
|
|
@@ -12603,7 +14244,7 @@ function SectionTitle({
|
|
|
12603
14244
|
resetAriaLabel,
|
|
12604
14245
|
className
|
|
12605
14246
|
}) {
|
|
12606
|
-
return /* @__PURE__ */
|
|
14247
|
+
return /* @__PURE__ */ jsxs75(
|
|
12607
14248
|
"div",
|
|
12608
14249
|
{
|
|
12609
14250
|
className: cn(
|
|
@@ -12612,7 +14253,7 @@ function SectionTitle({
|
|
|
12612
14253
|
),
|
|
12613
14254
|
children: [
|
|
12614
14255
|
title,
|
|
12615
|
-
showReset && onReset && /* @__PURE__ */
|
|
14256
|
+
showReset && onReset && /* @__PURE__ */ jsx116(
|
|
12616
14257
|
Button,
|
|
12617
14258
|
{
|
|
12618
14259
|
type: "button",
|
|
@@ -12621,7 +14262,7 @@ function SectionTitle({
|
|
|
12621
14262
|
className: "size-4 rounded-full",
|
|
12622
14263
|
onClick: onReset,
|
|
12623
14264
|
"aria-label": resetAriaLabel,
|
|
12624
|
-
children: /* @__PURE__ */
|
|
14265
|
+
children: /* @__PURE__ */ jsx116(RotateCcw, { className: "size-3" })
|
|
12625
14266
|
}
|
|
12626
14267
|
)
|
|
12627
14268
|
]
|
|
@@ -12632,7 +14273,7 @@ function RadioGroupItem2({
|
|
|
12632
14273
|
item,
|
|
12633
14274
|
isTheme = false
|
|
12634
14275
|
}) {
|
|
12635
|
-
return /* @__PURE__ */
|
|
14276
|
+
return /* @__PURE__ */ jsxs75(
|
|
12636
14277
|
Item2,
|
|
12637
14278
|
{
|
|
12638
14279
|
value: item.value,
|
|
@@ -12640,7 +14281,7 @@ function RadioGroupItem2({
|
|
|
12640
14281
|
"aria-label": `Select ${item.label.toLowerCase()}`,
|
|
12641
14282
|
"aria-describedby": `${item.value}-description`,
|
|
12642
14283
|
children: [
|
|
12643
|
-
/* @__PURE__ */
|
|
14284
|
+
/* @__PURE__ */ jsxs75(
|
|
12644
14285
|
"div",
|
|
12645
14286
|
{
|
|
12646
14287
|
className: cn(
|
|
@@ -12652,7 +14293,7 @@ function RadioGroupItem2({
|
|
|
12652
14293
|
"aria-hidden": "false",
|
|
12653
14294
|
"aria-label": `${item.label} option preview`,
|
|
12654
14295
|
children: [
|
|
12655
|
-
/* @__PURE__ */
|
|
14296
|
+
/* @__PURE__ */ jsx116(
|
|
12656
14297
|
CircleCheck,
|
|
12657
14298
|
{
|
|
12658
14299
|
className: cn(
|
|
@@ -12663,7 +14304,7 @@ function RadioGroupItem2({
|
|
|
12663
14304
|
"aria-hidden": "true"
|
|
12664
14305
|
}
|
|
12665
14306
|
),
|
|
12666
|
-
/* @__PURE__ */
|
|
14307
|
+
/* @__PURE__ */ jsx116(
|
|
12667
14308
|
item.icon,
|
|
12668
14309
|
{
|
|
12669
14310
|
className: cn(
|
|
@@ -12675,7 +14316,7 @@ function RadioGroupItem2({
|
|
|
12675
14316
|
]
|
|
12676
14317
|
}
|
|
12677
14318
|
),
|
|
12678
|
-
/* @__PURE__ */
|
|
14319
|
+
/* @__PURE__ */ jsx116(
|
|
12679
14320
|
"div",
|
|
12680
14321
|
{
|
|
12681
14322
|
className: "mt-1 text-xs",
|
|
@@ -12690,8 +14331,8 @@ function RadioGroupItem2({
|
|
|
12690
14331
|
}
|
|
12691
14332
|
function ThemeConfig() {
|
|
12692
14333
|
const { defaultTheme, theme, setTheme } = useTheme2();
|
|
12693
|
-
return /* @__PURE__ */
|
|
12694
|
-
/* @__PURE__ */
|
|
14334
|
+
return /* @__PURE__ */ jsxs75("div", { children: [
|
|
14335
|
+
/* @__PURE__ */ jsx116(
|
|
12695
14336
|
SectionTitle,
|
|
12696
14337
|
{
|
|
12697
14338
|
title: "Theme",
|
|
@@ -12700,7 +14341,7 @@ function ThemeConfig() {
|
|
|
12700
14341
|
resetAriaLabel: "Reset theme preference to default"
|
|
12701
14342
|
}
|
|
12702
14343
|
),
|
|
12703
|
-
/* @__PURE__ */
|
|
14344
|
+
/* @__PURE__ */ jsx116(
|
|
12704
14345
|
Radio,
|
|
12705
14346
|
{
|
|
12706
14347
|
value: theme,
|
|
@@ -12724,20 +14365,20 @@ function ThemeConfig() {
|
|
|
12724
14365
|
label: "Dark",
|
|
12725
14366
|
icon: IconThemeDark
|
|
12726
14367
|
}
|
|
12727
|
-
].map((item) => /* @__PURE__ */
|
|
14368
|
+
].map((item) => /* @__PURE__ */ jsx116(RadioGroupItem2, { item, isTheme: true }, item.value))
|
|
12728
14369
|
}
|
|
12729
14370
|
),
|
|
12730
|
-
/* @__PURE__ */
|
|
14371
|
+
/* @__PURE__ */ jsx116("div", { id: "theme-description", className: "sr-only", children: "Choose between system preference, light mode, or dark mode" })
|
|
12731
14372
|
] });
|
|
12732
14373
|
}
|
|
12733
14374
|
function ThemeListSelector() {
|
|
12734
|
-
const [search, setSearch] =
|
|
14375
|
+
const [search, setSearch] = useState17("");
|
|
12735
14376
|
const { colorTheme, setColorTheme } = useColorTheme();
|
|
12736
14377
|
const filtered = colorThemes.filter(
|
|
12737
14378
|
(t) => t.label.toLowerCase().includes(search.toLowerCase())
|
|
12738
14379
|
);
|
|
12739
|
-
return /* @__PURE__ */
|
|
12740
|
-
/* @__PURE__ */
|
|
14380
|
+
return /* @__PURE__ */ jsxs75("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
14381
|
+
/* @__PURE__ */ jsx116(
|
|
12741
14382
|
SectionTitle,
|
|
12742
14383
|
{
|
|
12743
14384
|
title: "Color Theme",
|
|
@@ -12746,9 +14387,9 @@ function ThemeListSelector() {
|
|
|
12746
14387
|
resetAriaLabel: "Reset color theme to default"
|
|
12747
14388
|
}
|
|
12748
14389
|
),
|
|
12749
|
-
/* @__PURE__ */
|
|
12750
|
-
/* @__PURE__ */
|
|
12751
|
-
/* @__PURE__ */
|
|
14390
|
+
/* @__PURE__ */ jsxs75("div", { className: "relative mb-2.5", children: [
|
|
14391
|
+
/* @__PURE__ */ jsx116(Search8, { className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
14392
|
+
/* @__PURE__ */ jsx116(
|
|
12752
14393
|
"input",
|
|
12753
14394
|
{
|
|
12754
14395
|
type: "text",
|
|
@@ -12764,21 +14405,21 @@ function ThemeListSelector() {
|
|
|
12764
14405
|
}
|
|
12765
14406
|
)
|
|
12766
14407
|
] }),
|
|
12767
|
-
/* @__PURE__ */
|
|
14408
|
+
/* @__PURE__ */ jsxs75("p", { className: "mb-2 text-xs text-muted-foreground font-medium", children: [
|
|
12768
14409
|
filtered.length,
|
|
12769
14410
|
" theme",
|
|
12770
14411
|
filtered.length !== 1 ? "s" : "",
|
|
12771
14412
|
" available"
|
|
12772
14413
|
] }),
|
|
12773
|
-
/* @__PURE__ */
|
|
14414
|
+
/* @__PURE__ */ jsxs75(
|
|
12774
14415
|
"div",
|
|
12775
14416
|
{
|
|
12776
14417
|
className: "flex-1 space-y-1 overflow-y-auto rounded-lg pr-1",
|
|
12777
14418
|
role: "radiogroup",
|
|
12778
14419
|
"aria-label": "Select color theme",
|
|
12779
14420
|
children: [
|
|
12780
|
-
filtered.length === 0 && /* @__PURE__ */
|
|
12781
|
-
filtered.map((ct) => /* @__PURE__ */
|
|
14421
|
+
filtered.length === 0 && /* @__PURE__ */ jsx116("p", { className: "py-8 text-center text-sm text-muted-foreground", children: "No themes found" }),
|
|
14422
|
+
filtered.map((ct) => /* @__PURE__ */ jsxs75(
|
|
12782
14423
|
"button",
|
|
12783
14424
|
{
|
|
12784
14425
|
onClick: () => setColorTheme(ct.name),
|
|
@@ -12790,7 +14431,7 @@ function ThemeListSelector() {
|
|
|
12790
14431
|
colorTheme === ct.name ? "bg-primary text-primary-foreground shadow-md" : "hover:bg-accent/80 hover:text-foreground border border-transparent hover:border-border/40"
|
|
12791
14432
|
),
|
|
12792
14433
|
children: [
|
|
12793
|
-
/* @__PURE__ */
|
|
14434
|
+
/* @__PURE__ */ jsx116("div", { className: "flex gap-1.5 shrink-0", children: ct.colors.map((color, i) => /* @__PURE__ */ jsx116(
|
|
12794
14435
|
"span",
|
|
12795
14436
|
{
|
|
12796
14437
|
className: cn(
|
|
@@ -12801,9 +14442,9 @@ function ThemeListSelector() {
|
|
|
12801
14442
|
},
|
|
12802
14443
|
i
|
|
12803
14444
|
)) }),
|
|
12804
|
-
/* @__PURE__ */
|
|
12805
|
-
/* @__PURE__ */
|
|
12806
|
-
ct.category === "tweakcn" && /* @__PURE__ */
|
|
14445
|
+
/* @__PURE__ */ jsxs75("div", { className: "flex items-center gap-1.5 truncate", children: [
|
|
14446
|
+
/* @__PURE__ */ jsx116("span", { className: "text-sm font-medium truncate", children: ct.label }),
|
|
14447
|
+
ct.category === "tweakcn" && /* @__PURE__ */ jsx116(
|
|
12807
14448
|
"span",
|
|
12808
14449
|
{
|
|
12809
14450
|
className: cn(
|
|
@@ -12813,7 +14454,7 @@ function ThemeListSelector() {
|
|
|
12813
14454
|
}
|
|
12814
14455
|
)
|
|
12815
14456
|
] }),
|
|
12816
|
-
colorTheme === ct.name && /* @__PURE__ */
|
|
14457
|
+
colorTheme === ct.name && /* @__PURE__ */ jsx116(Check9, { className: "ml-auto size-4 shrink-0", strokeWidth: 3 })
|
|
12817
14458
|
]
|
|
12818
14459
|
},
|
|
12819
14460
|
ct.name
|
|
@@ -12825,7 +14466,7 @@ function ThemeListSelector() {
|
|
|
12825
14466
|
}
|
|
12826
14467
|
|
|
12827
14468
|
// src/design-system/templates/nav-user.tsx
|
|
12828
|
-
import { Fragment as
|
|
14469
|
+
import { Fragment as Fragment5, jsx as jsx117, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
12829
14470
|
function NavUser({ user: fallbackUser }) {
|
|
12830
14471
|
const { isMobile } = useSidebar();
|
|
12831
14472
|
const [open, setOpen] = useDialogState();
|
|
@@ -12834,28 +14475,28 @@ function NavUser({ user: fallbackUser }) {
|
|
|
12834
14475
|
const userEmail = auth.user?.email || fallbackUser.email;
|
|
12835
14476
|
const userAvatar = auth.user?.picture || fallbackUser.avatar;
|
|
12836
14477
|
const userInitials = userName.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2);
|
|
12837
|
-
return /* @__PURE__ */
|
|
12838
|
-
/* @__PURE__ */
|
|
12839
|
-
/* @__PURE__ */
|
|
14478
|
+
return /* @__PURE__ */ jsxs76(Fragment5, { children: [
|
|
14479
|
+
/* @__PURE__ */ jsx117(SidebarMenu, { children: /* @__PURE__ */ jsx117(SidebarMenuItem, { children: /* @__PURE__ */ jsxs76(DropdownMenu, { modal: false, children: [
|
|
14480
|
+
/* @__PURE__ */ jsx117(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs76(
|
|
12840
14481
|
SidebarMenuButton,
|
|
12841
14482
|
{
|
|
12842
14483
|
size: "lg",
|
|
12843
14484
|
tooltip: userName,
|
|
12844
14485
|
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
12845
14486
|
children: [
|
|
12846
|
-
/* @__PURE__ */
|
|
12847
|
-
/* @__PURE__ */
|
|
12848
|
-
/* @__PURE__ */
|
|
14487
|
+
/* @__PURE__ */ jsxs76(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
14488
|
+
/* @__PURE__ */ jsx117(AvatarImage, { src: userAvatar, alt: userName }),
|
|
14489
|
+
/* @__PURE__ */ jsx117(AvatarFallback, { className: "rounded-lg", children: userInitials })
|
|
12849
14490
|
] }),
|
|
12850
|
-
/* @__PURE__ */
|
|
12851
|
-
/* @__PURE__ */
|
|
12852
|
-
/* @__PURE__ */
|
|
14491
|
+
/* @__PURE__ */ jsxs76("div", { className: "grid flex-1 text-start text-sm leading-tight", children: [
|
|
14492
|
+
/* @__PURE__ */ jsx117("span", { className: "truncate font-semibold", children: userName }),
|
|
14493
|
+
/* @__PURE__ */ jsx117("span", { className: "truncate text-xs text-muted-foreground", children: userEmail })
|
|
12853
14494
|
] }),
|
|
12854
|
-
/* @__PURE__ */
|
|
14495
|
+
/* @__PURE__ */ jsx117(ChevronsUpDown, { className: "ml-auto size-4 shrink-0" })
|
|
12855
14496
|
]
|
|
12856
14497
|
}
|
|
12857
14498
|
) }),
|
|
12858
|
-
/* @__PURE__ */
|
|
14499
|
+
/* @__PURE__ */ jsxs76(
|
|
12859
14500
|
DropdownMenuContent,
|
|
12860
14501
|
{
|
|
12861
14502
|
className: "w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",
|
|
@@ -12863,43 +14504,43 @@ function NavUser({ user: fallbackUser }) {
|
|
|
12863
14504
|
align: "end",
|
|
12864
14505
|
sideOffset: 4,
|
|
12865
14506
|
children: [
|
|
12866
|
-
/* @__PURE__ */
|
|
12867
|
-
/* @__PURE__ */
|
|
12868
|
-
/* @__PURE__ */
|
|
12869
|
-
/* @__PURE__ */
|
|
14507
|
+
/* @__PURE__ */ jsx117(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxs76("div", { className: "flex items-center gap-2 px-1 py-1.5 text-start text-sm", children: [
|
|
14508
|
+
/* @__PURE__ */ jsxs76(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
14509
|
+
/* @__PURE__ */ jsx117(AvatarImage, { src: userAvatar, alt: userName }),
|
|
14510
|
+
/* @__PURE__ */ jsx117(AvatarFallback, { className: "rounded-lg", children: userInitials })
|
|
12870
14511
|
] }),
|
|
12871
|
-
/* @__PURE__ */
|
|
12872
|
-
/* @__PURE__ */
|
|
12873
|
-
/* @__PURE__ */
|
|
14512
|
+
/* @__PURE__ */ jsxs76("div", { className: "grid flex-1 text-start text-sm leading-tight", children: [
|
|
14513
|
+
/* @__PURE__ */ jsx117("span", { className: "truncate font-semibold", children: userName }),
|
|
14514
|
+
/* @__PURE__ */ jsx117("span", { className: "truncate text-xs text-muted-foreground", children: userEmail })
|
|
12874
14515
|
] })
|
|
12875
14516
|
] }) }),
|
|
12876
|
-
/* @__PURE__ */
|
|
12877
|
-
/* @__PURE__ */
|
|
14517
|
+
/* @__PURE__ */ jsx117(DropdownMenuSeparator, {}),
|
|
14518
|
+
/* @__PURE__ */ jsx117(
|
|
12878
14519
|
ConfigDrawer,
|
|
12879
14520
|
{
|
|
12880
|
-
trigger: /* @__PURE__ */
|
|
12881
|
-
/* @__PURE__ */
|
|
14521
|
+
trigger: /* @__PURE__ */ jsxs76(DropdownMenuItem, { onSelect: (e) => e.preventDefault(), children: [
|
|
14522
|
+
/* @__PURE__ */ jsx117(Palette3, { className: "mr-2 h-4 w-4" }),
|
|
12882
14523
|
"Theme"
|
|
12883
14524
|
] })
|
|
12884
14525
|
}
|
|
12885
14526
|
),
|
|
12886
|
-
/* @__PURE__ */
|
|
14527
|
+
/* @__PURE__ */ jsx117(
|
|
12887
14528
|
ConfigDrawer,
|
|
12888
14529
|
{
|
|
12889
|
-
trigger: /* @__PURE__ */
|
|
12890
|
-
/* @__PURE__ */
|
|
14530
|
+
trigger: /* @__PURE__ */ jsxs76(DropdownMenuItem, { onSelect: (e) => e.preventDefault(), children: [
|
|
14531
|
+
/* @__PURE__ */ jsx117(Settings4, { className: "mr-2 h-4 w-4" }),
|
|
12891
14532
|
"Setting"
|
|
12892
14533
|
] })
|
|
12893
14534
|
}
|
|
12894
14535
|
),
|
|
12895
|
-
/* @__PURE__ */
|
|
12896
|
-
/* @__PURE__ */
|
|
14536
|
+
/* @__PURE__ */ jsx117(DropdownMenuSeparator, {}),
|
|
14537
|
+
/* @__PURE__ */ jsxs76(
|
|
12897
14538
|
DropdownMenuItem,
|
|
12898
14539
|
{
|
|
12899
14540
|
variant: "destructive",
|
|
12900
14541
|
onClick: () => setOpen(true),
|
|
12901
14542
|
children: [
|
|
12902
|
-
/* @__PURE__ */
|
|
14543
|
+
/* @__PURE__ */ jsx117(LogOut, { className: "mr-2 h-4 w-4" }),
|
|
12903
14544
|
"Sign out"
|
|
12904
14545
|
]
|
|
12905
14546
|
}
|
|
@@ -12908,19 +14549,19 @@ function NavUser({ user: fallbackUser }) {
|
|
|
12908
14549
|
}
|
|
12909
14550
|
)
|
|
12910
14551
|
] }) }) }),
|
|
12911
|
-
/* @__PURE__ */
|
|
14552
|
+
/* @__PURE__ */ jsx117(SignOutDialog, { open: !!open, onOpenChange: setOpen })
|
|
12912
14553
|
] });
|
|
12913
14554
|
}
|
|
12914
14555
|
|
|
12915
14556
|
// src/design-system/templates/app-sidebar.tsx
|
|
12916
|
-
import { jsx as
|
|
14557
|
+
import { jsx as jsx118, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
12917
14558
|
function AppSidebar() {
|
|
12918
14559
|
const { collapsible } = useLayout();
|
|
12919
|
-
return /* @__PURE__ */
|
|
12920
|
-
/* @__PURE__ */
|
|
12921
|
-
/* @__PURE__ */
|
|
12922
|
-
/* @__PURE__ */
|
|
12923
|
-
/* @__PURE__ */
|
|
14560
|
+
return /* @__PURE__ */ jsxs77(Sidebar, { collapsible, variant: "sidebar", children: [
|
|
14561
|
+
/* @__PURE__ */ jsxs77(SidebarHeader, { className: "p-2 pb-1", children: [
|
|
14562
|
+
/* @__PURE__ */ jsxs77("div", { className: "flex items-center justify-between gap-1", children: [
|
|
14563
|
+
/* @__PURE__ */ jsx118("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx118(TeamSwitcher, { teams: sidebarData2.teams }) }),
|
|
14564
|
+
/* @__PURE__ */ jsx118("div", { className: "group-data-[collapsible=icon]:hidden shrink-0", children: /* @__PURE__ */ jsx118(
|
|
12924
14565
|
SidebarTrigger,
|
|
12925
14566
|
{
|
|
12926
14567
|
variant: "ghost",
|
|
@@ -12929,7 +14570,7 @@ function AppSidebar() {
|
|
|
12929
14570
|
}
|
|
12930
14571
|
) })
|
|
12931
14572
|
] }),
|
|
12932
|
-
/* @__PURE__ */
|
|
14573
|
+
/* @__PURE__ */ jsx118("div", { className: "hidden group-data-[collapsible=icon]:flex justify-center pt-2 pb-1", children: /* @__PURE__ */ jsx118(
|
|
12933
14574
|
SidebarTrigger,
|
|
12934
14575
|
{
|
|
12935
14576
|
variant: "ghost",
|
|
@@ -12938,37 +14579,37 @@ function AppSidebar() {
|
|
|
12938
14579
|
}
|
|
12939
14580
|
) })
|
|
12940
14581
|
] }),
|
|
12941
|
-
/* @__PURE__ */
|
|
12942
|
-
/* @__PURE__ */
|
|
14582
|
+
/* @__PURE__ */ jsx118(SidebarContent, { children: sidebarData2.navGroups.map((props) => /* @__PURE__ */ jsx118(NavGroup, { ...props }, props.title)) }),
|
|
14583
|
+
/* @__PURE__ */ jsx118(SidebarFooter, { children: /* @__PURE__ */ jsx118(NavUser, { user: sidebarData2.user }) })
|
|
12943
14584
|
] });
|
|
12944
14585
|
}
|
|
12945
14586
|
|
|
12946
14587
|
// src/design-system/templates/app-title.tsx
|
|
12947
14588
|
import Link4 from "next/link";
|
|
12948
|
-
import { Menu, X as
|
|
12949
|
-
import { jsx as
|
|
14589
|
+
import { Menu, X as X8 } from "lucide-react";
|
|
14590
|
+
import { jsx as jsx119, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
12950
14591
|
function AppTitle() {
|
|
12951
14592
|
const { setOpenMobile } = useSidebar();
|
|
12952
|
-
return /* @__PURE__ */
|
|
14593
|
+
return /* @__PURE__ */ jsx119(SidebarMenu, { children: /* @__PURE__ */ jsx119(SidebarMenuItem, { children: /* @__PURE__ */ jsx119(
|
|
12953
14594
|
SidebarMenuButton,
|
|
12954
14595
|
{
|
|
12955
14596
|
size: "lg",
|
|
12956
14597
|
className: "gap-0 py-0 hover:bg-transparent active:bg-transparent",
|
|
12957
14598
|
asChild: true,
|
|
12958
|
-
children: /* @__PURE__ */
|
|
12959
|
-
/* @__PURE__ */
|
|
14599
|
+
children: /* @__PURE__ */ jsxs78("div", { children: [
|
|
14600
|
+
/* @__PURE__ */ jsxs78(
|
|
12960
14601
|
Link4,
|
|
12961
14602
|
{
|
|
12962
14603
|
href: "/",
|
|
12963
14604
|
onClick: () => setOpenMobile(false),
|
|
12964
14605
|
className: "grid flex-1 text-start text-sm leading-tight",
|
|
12965
14606
|
children: [
|
|
12966
|
-
/* @__PURE__ */
|
|
12967
|
-
/* @__PURE__ */
|
|
14607
|
+
/* @__PURE__ */ jsx119("span", { className: "truncate font-bold", children: "Shadcn-Admin" }),
|
|
14608
|
+
/* @__PURE__ */ jsx119("span", { className: "truncate text-xs", children: "Vite + ShadcnUI" })
|
|
12968
14609
|
]
|
|
12969
14610
|
}
|
|
12970
14611
|
),
|
|
12971
|
-
/* @__PURE__ */
|
|
14612
|
+
/* @__PURE__ */ jsx119(ToggleSidebar, {})
|
|
12972
14613
|
] })
|
|
12973
14614
|
}
|
|
12974
14615
|
) }) });
|
|
@@ -12979,7 +14620,7 @@ function ToggleSidebar({
|
|
|
12979
14620
|
...props
|
|
12980
14621
|
}) {
|
|
12981
14622
|
const { toggleSidebar } = useSidebar();
|
|
12982
|
-
return /* @__PURE__ */
|
|
14623
|
+
return /* @__PURE__ */ jsxs78(
|
|
12983
14624
|
Button,
|
|
12984
14625
|
{
|
|
12985
14626
|
"data-sidebar": "trigger",
|
|
@@ -12993,16 +14634,16 @@ function ToggleSidebar({
|
|
|
12993
14634
|
},
|
|
12994
14635
|
...props,
|
|
12995
14636
|
children: [
|
|
12996
|
-
/* @__PURE__ */
|
|
12997
|
-
/* @__PURE__ */
|
|
12998
|
-
/* @__PURE__ */
|
|
14637
|
+
/* @__PURE__ */ jsx119(X8, { className: "md:hidden" }),
|
|
14638
|
+
/* @__PURE__ */ jsx119(Menu, { className: "max-md:hidden" }),
|
|
14639
|
+
/* @__PURE__ */ jsx119("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
12999
14640
|
]
|
|
13000
14641
|
}
|
|
13001
14642
|
);
|
|
13002
14643
|
}
|
|
13003
14644
|
|
|
13004
14645
|
// src/design-system/templates/authenticated-layout.tsx
|
|
13005
|
-
import { useEffect as useEffect16, useState as
|
|
14646
|
+
import { useEffect as useEffect16, useState as useState18 } from "react";
|
|
13006
14647
|
import { usePathname as usePathname3 } from "next/navigation";
|
|
13007
14648
|
|
|
13008
14649
|
// src/components/layout/app-sidebar.tsx
|
|
@@ -13011,13 +14652,13 @@ import { useEffect as useEffect15 } from "react";
|
|
|
13011
14652
|
// src/components/layout/nav-group.tsx
|
|
13012
14653
|
import Link5 from "next/link";
|
|
13013
14654
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
13014
|
-
import { ChevronRight as
|
|
13015
|
-
import { jsx as
|
|
14655
|
+
import { ChevronRight as ChevronRight12, X as X9 } from "lucide-react";
|
|
14656
|
+
import { jsx as jsx120, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
13016
14657
|
function NavGroup2({ title, items }) {
|
|
13017
14658
|
const { state, isMobile, openMobile, setOpenMobile } = useSidebar();
|
|
13018
14659
|
const href = usePathname2();
|
|
13019
|
-
return /* @__PURE__ */
|
|
13020
|
-
/* @__PURE__ */
|
|
14660
|
+
return /* @__PURE__ */ jsxs79(SidebarGroup, { className: cn(title === "Menu" && "pt-0"), children: [
|
|
14661
|
+
/* @__PURE__ */ jsxs79(
|
|
13021
14662
|
SidebarGroupLabel,
|
|
13022
14663
|
{
|
|
13023
14664
|
className: cn(
|
|
@@ -13025,8 +14666,8 @@ function NavGroup2({ title, items }) {
|
|
|
13025
14666
|
title === "Menu" && state !== "collapsed" && "sticky top-0 z-20 bg-sidebar py-1.5"
|
|
13026
14667
|
),
|
|
13027
14668
|
children: [
|
|
13028
|
-
/* @__PURE__ */
|
|
13029
|
-
title === "Menu" && !isMobile && /* @__PURE__ */
|
|
14669
|
+
/* @__PURE__ */ jsx120("span", { children: title }),
|
|
14670
|
+
title === "Menu" && !isMobile && /* @__PURE__ */ jsx120(
|
|
13030
14671
|
SidebarTrigger,
|
|
13031
14672
|
{
|
|
13032
14673
|
variant: "ghost",
|
|
@@ -13034,7 +14675,7 @@ function NavGroup2({ title, items }) {
|
|
|
13034
14675
|
"aria-label": "Toggle sidebar"
|
|
13035
14676
|
}
|
|
13036
14677
|
),
|
|
13037
|
-
title === "Menu" && isMobile && openMobile && /* @__PURE__ */
|
|
14678
|
+
title === "Menu" && isMobile && openMobile && /* @__PURE__ */ jsx120(
|
|
13038
14679
|
Button,
|
|
13039
14680
|
{
|
|
13040
14681
|
type: "button",
|
|
@@ -13043,37 +14684,37 @@ function NavGroup2({ title, items }) {
|
|
|
13043
14684
|
className: "size-6 shrink-0",
|
|
13044
14685
|
"aria-label": "Close sidebar",
|
|
13045
14686
|
onClick: () => setOpenMobile(false),
|
|
13046
|
-
children: /* @__PURE__ */
|
|
14687
|
+
children: /* @__PURE__ */ jsx120(X9, { className: "size-4", "aria-hidden": "true" })
|
|
13047
14688
|
}
|
|
13048
14689
|
)
|
|
13049
14690
|
]
|
|
13050
14691
|
}
|
|
13051
14692
|
),
|
|
13052
|
-
/* @__PURE__ */
|
|
14693
|
+
/* @__PURE__ */ jsx120(SidebarMenu, { children: items.map((item) => {
|
|
13053
14694
|
const key = `${item.title}-${item.url}`;
|
|
13054
14695
|
if (!item.items)
|
|
13055
|
-
return /* @__PURE__ */
|
|
14696
|
+
return /* @__PURE__ */ jsx120(SidebarMenuLink2, { item, href }, key);
|
|
13056
14697
|
if (item.title === "Settings" && item.items.length === 0)
|
|
13057
|
-
return /* @__PURE__ */
|
|
14698
|
+
return /* @__PURE__ */ jsx120(SidebarMenuSettings2, { item }, key);
|
|
13058
14699
|
if (state === "collapsed" && !isMobile)
|
|
13059
|
-
return /* @__PURE__ */
|
|
13060
|
-
return /* @__PURE__ */
|
|
14700
|
+
return /* @__PURE__ */ jsx120(SidebarMenuCollapsedDropdown2, { item, href }, key);
|
|
14701
|
+
return /* @__PURE__ */ jsx120(SidebarMenuCollapsible2, { item, href }, key);
|
|
13061
14702
|
}) })
|
|
13062
14703
|
] });
|
|
13063
14704
|
}
|
|
13064
14705
|
function NavBadge2({ children }) {
|
|
13065
|
-
return /* @__PURE__ */
|
|
14706
|
+
return /* @__PURE__ */ jsx120(Badge, { className: "rounded-full px-1 py-0 text-xs", children });
|
|
13066
14707
|
}
|
|
13067
14708
|
function SidebarMenuLink2({ item, href }) {
|
|
13068
14709
|
const { setOpenMobile } = useSidebar();
|
|
13069
14710
|
const { setShowInlineNotFound } = useLayout();
|
|
13070
|
-
return /* @__PURE__ */
|
|
14711
|
+
return /* @__PURE__ */ jsx120(SidebarMenuItem, { children: /* @__PURE__ */ jsx120(
|
|
13071
14712
|
SidebarMenuButton,
|
|
13072
14713
|
{
|
|
13073
14714
|
asChild: true,
|
|
13074
14715
|
isActive: checkIsActive2(href, item),
|
|
13075
14716
|
tooltip: item.title,
|
|
13076
|
-
children: /* @__PURE__ */
|
|
14717
|
+
children: /* @__PURE__ */ jsxs79(
|
|
13077
14718
|
Link5,
|
|
13078
14719
|
{
|
|
13079
14720
|
href: item.url,
|
|
@@ -13082,9 +14723,9 @@ function SidebarMenuLink2({ item, href }) {
|
|
|
13082
14723
|
setOpenMobile(false);
|
|
13083
14724
|
},
|
|
13084
14725
|
children: [
|
|
13085
|
-
item.icon && /* @__PURE__ */
|
|
13086
|
-
/* @__PURE__ */
|
|
13087
|
-
item.badge && /* @__PURE__ */
|
|
14726
|
+
item.icon && /* @__PURE__ */ jsx120(item.icon, {}),
|
|
14727
|
+
/* @__PURE__ */ jsx120("span", { children: item.title }),
|
|
14728
|
+
item.badge && /* @__PURE__ */ jsx120(NavBadge2, { children: item.badge })
|
|
13088
14729
|
]
|
|
13089
14730
|
}
|
|
13090
14731
|
)
|
|
@@ -13094,7 +14735,7 @@ function SidebarMenuLink2({ item, href }) {
|
|
|
13094
14735
|
function SidebarMenuSettings2({ item }) {
|
|
13095
14736
|
const { setOpenMobile } = useSidebar();
|
|
13096
14737
|
const { showInlineNotFound, setShowInlineNotFound } = useLayout();
|
|
13097
|
-
return /* @__PURE__ */
|
|
14738
|
+
return /* @__PURE__ */ jsx120(SidebarMenuItem, { children: /* @__PURE__ */ jsxs79(
|
|
13098
14739
|
SidebarMenuButton,
|
|
13099
14740
|
{
|
|
13100
14741
|
tooltip: item.title,
|
|
@@ -13104,8 +14745,8 @@ function SidebarMenuSettings2({ item }) {
|
|
|
13104
14745
|
setOpenMobile(false);
|
|
13105
14746
|
},
|
|
13106
14747
|
children: [
|
|
13107
|
-
item.icon && /* @__PURE__ */
|
|
13108
|
-
/* @__PURE__ */
|
|
14748
|
+
item.icon && /* @__PURE__ */ jsx120(item.icon, {}),
|
|
14749
|
+
/* @__PURE__ */ jsx120("span", { children: item.title })
|
|
13109
14750
|
]
|
|
13110
14751
|
}
|
|
13111
14752
|
) });
|
|
@@ -13116,25 +14757,25 @@ function SidebarMenuCollapsible2({
|
|
|
13116
14757
|
}) {
|
|
13117
14758
|
const { setOpenMobile } = useSidebar();
|
|
13118
14759
|
const { setShowInlineNotFound } = useLayout();
|
|
13119
|
-
return /* @__PURE__ */
|
|
14760
|
+
return /* @__PURE__ */ jsx120(
|
|
13120
14761
|
Collapsible,
|
|
13121
14762
|
{
|
|
13122
14763
|
asChild: true,
|
|
13123
14764
|
defaultOpen: checkIsActive2(href, item, true),
|
|
13124
14765
|
className: "group/collapsible",
|
|
13125
|
-
children: /* @__PURE__ */
|
|
13126
|
-
/* @__PURE__ */
|
|
13127
|
-
item.icon && /* @__PURE__ */
|
|
13128
|
-
/* @__PURE__ */
|
|
13129
|
-
item.badge && /* @__PURE__ */
|
|
13130
|
-
/* @__PURE__ */
|
|
14766
|
+
children: /* @__PURE__ */ jsxs79(SidebarMenuItem, { children: [
|
|
14767
|
+
/* @__PURE__ */ jsx120(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs79(SidebarMenuButton, { tooltip: item.title, children: [
|
|
14768
|
+
item.icon && /* @__PURE__ */ jsx120(item.icon, {}),
|
|
14769
|
+
/* @__PURE__ */ jsx120("span", { children: item.title }),
|
|
14770
|
+
item.badge && /* @__PURE__ */ jsx120(NavBadge2, { children: item.badge }),
|
|
14771
|
+
/* @__PURE__ */ jsx120(ChevronRight12, { className: "ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 rtl:rotate-180" })
|
|
13131
14772
|
] }) }),
|
|
13132
|
-
/* @__PURE__ */
|
|
14773
|
+
/* @__PURE__ */ jsx120(CollapsibleContent, { className: "CollapsibleContent", children: /* @__PURE__ */ jsx120(SidebarMenuSub, { children: item.items.map((subItem) => /* @__PURE__ */ jsx120(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx120(
|
|
13133
14774
|
SidebarMenuSubButton,
|
|
13134
14775
|
{
|
|
13135
14776
|
asChild: true,
|
|
13136
14777
|
isActive: checkIsActive2(href, subItem),
|
|
13137
|
-
children: /* @__PURE__ */
|
|
14778
|
+
children: /* @__PURE__ */ jsxs79(
|
|
13138
14779
|
Link5,
|
|
13139
14780
|
{
|
|
13140
14781
|
href: subItem.url,
|
|
@@ -13143,9 +14784,9 @@ function SidebarMenuCollapsible2({
|
|
|
13143
14784
|
setOpenMobile(false);
|
|
13144
14785
|
},
|
|
13145
14786
|
children: [
|
|
13146
|
-
subItem.icon && /* @__PURE__ */
|
|
13147
|
-
/* @__PURE__ */
|
|
13148
|
-
subItem.badge && /* @__PURE__ */
|
|
14787
|
+
subItem.icon && /* @__PURE__ */ jsx120(subItem.icon, {}),
|
|
14788
|
+
/* @__PURE__ */ jsx120("span", { children: subItem.title }),
|
|
14789
|
+
subItem.badge && /* @__PURE__ */ jsx120(NavBadge2, { children: subItem.badge })
|
|
13149
14790
|
]
|
|
13150
14791
|
}
|
|
13151
14792
|
)
|
|
@@ -13159,36 +14800,36 @@ function SidebarMenuCollapsedDropdown2({
|
|
|
13159
14800
|
item,
|
|
13160
14801
|
href
|
|
13161
14802
|
}) {
|
|
13162
|
-
return /* @__PURE__ */
|
|
13163
|
-
/* @__PURE__ */
|
|
14803
|
+
return /* @__PURE__ */ jsx120(SidebarMenuItem, { children: /* @__PURE__ */ jsxs79(DropdownMenu, { children: [
|
|
14804
|
+
/* @__PURE__ */ jsx120(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs79(
|
|
13164
14805
|
SidebarMenuButton,
|
|
13165
14806
|
{
|
|
13166
14807
|
tooltip: item.title,
|
|
13167
14808
|
isActive: checkIsActive2(href, item),
|
|
13168
14809
|
children: [
|
|
13169
|
-
item.icon && /* @__PURE__ */
|
|
13170
|
-
/* @__PURE__ */
|
|
13171
|
-
item.badge && /* @__PURE__ */
|
|
13172
|
-
/* @__PURE__ */
|
|
14810
|
+
item.icon && /* @__PURE__ */ jsx120(item.icon, {}),
|
|
14811
|
+
/* @__PURE__ */ jsx120("span", { children: item.title }),
|
|
14812
|
+
item.badge && /* @__PURE__ */ jsx120(NavBadge2, { children: item.badge }),
|
|
14813
|
+
/* @__PURE__ */ jsx120(ChevronRight12, { className: "ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
13173
14814
|
]
|
|
13174
14815
|
}
|
|
13175
14816
|
) }),
|
|
13176
|
-
/* @__PURE__ */
|
|
13177
|
-
/* @__PURE__ */
|
|
14817
|
+
/* @__PURE__ */ jsxs79(DropdownMenuContent, { side: "right", align: "start", sideOffset: 4, children: [
|
|
14818
|
+
/* @__PURE__ */ jsxs79(DropdownMenuLabel, { children: [
|
|
13178
14819
|
item.title,
|
|
13179
14820
|
" ",
|
|
13180
14821
|
item.badge ? `(${item.badge})` : ""
|
|
13181
14822
|
] }),
|
|
13182
|
-
/* @__PURE__ */
|
|
13183
|
-
item.items.map((sub) => /* @__PURE__ */
|
|
14823
|
+
/* @__PURE__ */ jsx120(DropdownMenuSeparator, {}),
|
|
14824
|
+
item.items.map((sub) => /* @__PURE__ */ jsx120(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs79(
|
|
13184
14825
|
Link5,
|
|
13185
14826
|
{
|
|
13186
14827
|
href: sub.url,
|
|
13187
14828
|
className: `${checkIsActive2(href, sub) ? "bg-secondary" : ""}`,
|
|
13188
14829
|
children: [
|
|
13189
|
-
sub.icon && /* @__PURE__ */
|
|
13190
|
-
/* @__PURE__ */
|
|
13191
|
-
sub.badge && /* @__PURE__ */
|
|
14830
|
+
sub.icon && /* @__PURE__ */ jsx120(sub.icon, {}),
|
|
14831
|
+
/* @__PURE__ */ jsx120("span", { className: "max-w-52 text-wrap", children: sub.title }),
|
|
14832
|
+
sub.badge && /* @__PURE__ */ jsx120("span", { className: "ms-auto text-xs", children: sub.badge })
|
|
13192
14833
|
]
|
|
13193
14834
|
}
|
|
13194
14835
|
) }, `${sub.title}-${sub.url}`))
|
|
@@ -13207,7 +14848,7 @@ import {
|
|
|
13207
14848
|
ChevronsUpDown as ChevronsUpDown2,
|
|
13208
14849
|
LogOut as LogOut2,
|
|
13209
14850
|
User as User2,
|
|
13210
|
-
Bell as
|
|
14851
|
+
Bell as Bell6,
|
|
13211
14852
|
MessageCircle,
|
|
13212
14853
|
CreditCard,
|
|
13213
14854
|
ShoppingBag,
|
|
@@ -13215,7 +14856,7 @@ import {
|
|
|
13215
14856
|
Palette as Palette4
|
|
13216
14857
|
} from "lucide-react";
|
|
13217
14858
|
import Link6 from "next/link";
|
|
13218
|
-
import { Fragment as
|
|
14859
|
+
import { Fragment as Fragment6, jsx as jsx121, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
13219
14860
|
function NavUser2({ user: fallbackUser }) {
|
|
13220
14861
|
const { isMobile } = useSidebar();
|
|
13221
14862
|
const [open, setOpen] = useDialogState();
|
|
@@ -13225,28 +14866,28 @@ function NavUser2({ user: fallbackUser }) {
|
|
|
13225
14866
|
const userEmail = auth.user?.email || fallbackUser.email;
|
|
13226
14867
|
const userAvatar = auth.user?.picture || fallbackUser.avatar;
|
|
13227
14868
|
const userInitials = userName.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2);
|
|
13228
|
-
return /* @__PURE__ */
|
|
13229
|
-
/* @__PURE__ */
|
|
13230
|
-
/* @__PURE__ */
|
|
14869
|
+
return /* @__PURE__ */ jsxs80(Fragment6, { children: [
|
|
14870
|
+
/* @__PURE__ */ jsx121(SidebarMenu, { children: /* @__PURE__ */ jsx121(SidebarMenuItem, { children: /* @__PURE__ */ jsxs80(DropdownMenu, { modal: false, children: [
|
|
14871
|
+
/* @__PURE__ */ jsx121(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs80(
|
|
13231
14872
|
SidebarMenuButton,
|
|
13232
14873
|
{
|
|
13233
14874
|
size: "lg",
|
|
13234
14875
|
tooltip: userName,
|
|
13235
14876
|
className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
|
|
13236
14877
|
children: [
|
|
13237
|
-
/* @__PURE__ */
|
|
13238
|
-
/* @__PURE__ */
|
|
13239
|
-
/* @__PURE__ */
|
|
14878
|
+
/* @__PURE__ */ jsxs80(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
14879
|
+
/* @__PURE__ */ jsx121(AvatarImage, { src: userAvatar, alt: userName }),
|
|
14880
|
+
/* @__PURE__ */ jsx121(AvatarFallback, { className: "rounded-lg", children: userInitials })
|
|
13240
14881
|
] }),
|
|
13241
|
-
/* @__PURE__ */
|
|
13242
|
-
/* @__PURE__ */
|
|
13243
|
-
/* @__PURE__ */
|
|
14882
|
+
/* @__PURE__ */ jsxs80("div", { className: "grid flex-1 text-start text-sm leading-tight", children: [
|
|
14883
|
+
/* @__PURE__ */ jsx121("span", { className: "truncate font-semibold", children: userName }),
|
|
14884
|
+
/* @__PURE__ */ jsx121("span", { className: "truncate text-xs text-muted-foreground", children: userEmail })
|
|
13244
14885
|
] }),
|
|
13245
|
-
/* @__PURE__ */
|
|
14886
|
+
/* @__PURE__ */ jsx121(ChevronsUpDown2, { className: "ml-auto size-4 shrink-0" })
|
|
13246
14887
|
]
|
|
13247
14888
|
}
|
|
13248
14889
|
) }),
|
|
13249
|
-
/* @__PURE__ */
|
|
14890
|
+
/* @__PURE__ */ jsxs80(
|
|
13250
14891
|
DropdownMenuContent,
|
|
13251
14892
|
{
|
|
13252
14893
|
className: "w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",
|
|
@@ -13254,59 +14895,59 @@ function NavUser2({ user: fallbackUser }) {
|
|
|
13254
14895
|
align: "end",
|
|
13255
14896
|
sideOffset: 4,
|
|
13256
14897
|
children: [
|
|
13257
|
-
/* @__PURE__ */
|
|
13258
|
-
/* @__PURE__ */
|
|
13259
|
-
/* @__PURE__ */
|
|
13260
|
-
/* @__PURE__ */
|
|
14898
|
+
/* @__PURE__ */ jsx121(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxs80("div", { className: "flex items-center gap-2 px-1 py-1.5 text-start text-sm", children: [
|
|
14899
|
+
/* @__PURE__ */ jsxs80(Avatar, { className: "h-8 w-8 rounded-lg", children: [
|
|
14900
|
+
/* @__PURE__ */ jsx121(AvatarImage, { src: userAvatar, alt: userName }),
|
|
14901
|
+
/* @__PURE__ */ jsx121(AvatarFallback, { className: "rounded-lg", children: userInitials })
|
|
13261
14902
|
] }),
|
|
13262
|
-
/* @__PURE__ */
|
|
13263
|
-
/* @__PURE__ */
|
|
13264
|
-
/* @__PURE__ */
|
|
14903
|
+
/* @__PURE__ */ jsxs80("div", { className: "grid flex-1 text-start text-sm leading-tight", children: [
|
|
14904
|
+
/* @__PURE__ */ jsx121("span", { className: "truncate font-semibold", children: userName }),
|
|
14905
|
+
/* @__PURE__ */ jsx121("span", { className: "truncate text-xs text-muted-foreground", children: userEmail })
|
|
13265
14906
|
] })
|
|
13266
14907
|
] }) }),
|
|
13267
|
-
/* @__PURE__ */
|
|
13268
|
-
/* @__PURE__ */
|
|
13269
|
-
/* @__PURE__ */
|
|
14908
|
+
/* @__PURE__ */ jsx121(DropdownMenuSeparator, {}),
|
|
14909
|
+
/* @__PURE__ */ jsxs80(DropdownMenuItem, { onClick: () => setShowInlineNotFound(true), children: [
|
|
14910
|
+
/* @__PURE__ */ jsx121(User2, { className: "mr-2 h-4 w-4" }),
|
|
13270
14911
|
"My Profile"
|
|
13271
14912
|
] }),
|
|
13272
|
-
/* @__PURE__ */
|
|
13273
|
-
/* @__PURE__ */
|
|
14913
|
+
/* @__PURE__ */ jsxs80(DropdownMenuItem, { onClick: () => setShowInlineNotFound(true), children: [
|
|
14914
|
+
/* @__PURE__ */ jsx121(Bell6, { className: "mr-2 h-4 w-4" }),
|
|
13274
14915
|
"Notifications"
|
|
13275
14916
|
] }),
|
|
13276
|
-
/* @__PURE__ */
|
|
13277
|
-
/* @__PURE__ */
|
|
14917
|
+
/* @__PURE__ */ jsxs80(DropdownMenuItem, { onClick: () => setShowInlineNotFound(true), children: [
|
|
14918
|
+
/* @__PURE__ */ jsx121(MessageCircle, { className: "mr-2 h-4 w-4" }),
|
|
13278
14919
|
"Help & Support"
|
|
13279
14920
|
] }),
|
|
13280
|
-
/* @__PURE__ */
|
|
13281
|
-
/* @__PURE__ */
|
|
13282
|
-
/* @__PURE__ */
|
|
14921
|
+
/* @__PURE__ */ jsx121(DropdownMenuSeparator, {}),
|
|
14922
|
+
/* @__PURE__ */ jsxs80(DropdownMenuItem, { onClick: () => setShowInlineNotFound(true), children: [
|
|
14923
|
+
/* @__PURE__ */ jsx121(CreditCard, { className: "mr-2 h-4 w-4" }),
|
|
13283
14924
|
"Subscriptions"
|
|
13284
14925
|
] }),
|
|
13285
|
-
/* @__PURE__ */
|
|
13286
|
-
/* @__PURE__ */
|
|
14926
|
+
/* @__PURE__ */ jsx121(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs80(Link6, { href: "/apps", children: [
|
|
14927
|
+
/* @__PURE__ */ jsx121(ShoppingBag, { className: "mr-2 h-4 w-4" }),
|
|
13287
14928
|
"Buy Apps"
|
|
13288
14929
|
] }) }),
|
|
13289
|
-
/* @__PURE__ */
|
|
14930
|
+
/* @__PURE__ */ jsx121(
|
|
13290
14931
|
ConfigDrawer,
|
|
13291
14932
|
{
|
|
13292
|
-
trigger: /* @__PURE__ */
|
|
13293
|
-
/* @__PURE__ */
|
|
14933
|
+
trigger: /* @__PURE__ */ jsxs80(DropdownMenuItem, { onSelect: (e) => e.preventDefault(), children: [
|
|
14934
|
+
/* @__PURE__ */ jsx121(Palette4, { className: "mr-2 h-4 w-4" }),
|
|
13294
14935
|
"Theme Settings"
|
|
13295
14936
|
] })
|
|
13296
14937
|
}
|
|
13297
14938
|
),
|
|
13298
|
-
/* @__PURE__ */
|
|
13299
|
-
/* @__PURE__ */
|
|
14939
|
+
/* @__PURE__ */ jsxs80(DropdownMenuItem, { onClick: () => setShowInlineNotFound(true), children: [
|
|
14940
|
+
/* @__PURE__ */ jsx121(Settings5, { className: "mr-2 h-4 w-4" }),
|
|
13300
14941
|
"Settings"
|
|
13301
14942
|
] }),
|
|
13302
|
-
/* @__PURE__ */
|
|
13303
|
-
/* @__PURE__ */
|
|
14943
|
+
/* @__PURE__ */ jsx121(DropdownMenuSeparator, {}),
|
|
14944
|
+
/* @__PURE__ */ jsxs80(
|
|
13304
14945
|
DropdownMenuItem,
|
|
13305
14946
|
{
|
|
13306
14947
|
variant: "destructive",
|
|
13307
14948
|
onClick: () => setOpen(true),
|
|
13308
14949
|
children: [
|
|
13309
|
-
/* @__PURE__ */
|
|
14950
|
+
/* @__PURE__ */ jsx121(LogOut2, { className: "mr-2 h-4 w-4" }),
|
|
13310
14951
|
"Sign out"
|
|
13311
14952
|
]
|
|
13312
14953
|
}
|
|
@@ -13315,12 +14956,12 @@ function NavUser2({ user: fallbackUser }) {
|
|
|
13315
14956
|
}
|
|
13316
14957
|
)
|
|
13317
14958
|
] }) }) }),
|
|
13318
|
-
/* @__PURE__ */
|
|
14959
|
+
/* @__PURE__ */ jsx121(SignOutDialog, { open: !!open, onOpenChange: setOpen })
|
|
13319
14960
|
] });
|
|
13320
14961
|
}
|
|
13321
14962
|
|
|
13322
14963
|
// src/components/layout/app-sidebar.tsx
|
|
13323
|
-
import { jsx as
|
|
14964
|
+
import { jsx as jsx122, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
13324
14965
|
function AppSidebar2() {
|
|
13325
14966
|
const { collapsible } = useLayout();
|
|
13326
14967
|
const currentUser = useAuthStore((state) => state.auth.user);
|
|
@@ -13351,9 +14992,9 @@ function AppSidebar2() {
|
|
|
13351
14992
|
};
|
|
13352
14993
|
return (
|
|
13353
14994
|
// Sidebar ko fixed "sidebar" variant par lock kiya gaya hai (floating remove).
|
|
13354
|
-
/* @__PURE__ */
|
|
13355
|
-
/* @__PURE__ */
|
|
13356
|
-
/* @__PURE__ */
|
|
14995
|
+
/* @__PURE__ */ jsxs81(Sidebar, { collapsible, variant: "sidebar", children: [
|
|
14996
|
+
/* @__PURE__ */ jsx122(SidebarHeader, { className: "pb-0", children: /* @__PURE__ */ jsx122(TeamSwitcher, { teams: dynamicSidebarData.teams }) }),
|
|
14997
|
+
/* @__PURE__ */ jsx122("div", { className: "hidden group-data-[state=collapsed]:flex justify-center py-2", children: /* @__PURE__ */ jsx122(
|
|
13357
14998
|
SidebarTrigger,
|
|
13358
14999
|
{
|
|
13359
15000
|
variant: "ghost",
|
|
@@ -13361,16 +15002,16 @@ function AppSidebar2() {
|
|
|
13361
15002
|
"aria-label": "Toggle sidebar"
|
|
13362
15003
|
}
|
|
13363
15004
|
) }),
|
|
13364
|
-
/* @__PURE__ */
|
|
13365
|
-
/* @__PURE__ */
|
|
15005
|
+
/* @__PURE__ */ jsx122(SidebarContent, { children: dynamicSidebarData.navGroups.map((props) => /* @__PURE__ */ jsx122(NavGroup2, { ...props }, props.title)) }),
|
|
15006
|
+
/* @__PURE__ */ jsx122(SidebarFooter, { children: /* @__PURE__ */ jsx122(NavUser2, { user: dynamicSidebarData.user }) })
|
|
13366
15007
|
] })
|
|
13367
15008
|
);
|
|
13368
15009
|
}
|
|
13369
15010
|
|
|
13370
15011
|
// src/components/skip-to-main.tsx
|
|
13371
|
-
import { jsx as
|
|
15012
|
+
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
13372
15013
|
function SkipToMain() {
|
|
13373
|
-
return /* @__PURE__ */
|
|
15014
|
+
return /* @__PURE__ */ jsx123(
|
|
13374
15015
|
"a",
|
|
13375
15016
|
{
|
|
13376
15017
|
className: `fixed inset-s-44 z-999 -translate-y-52 bg-primary px-4 py-2 text-sm font-medium whitespace-nowrap text-primary-foreground opacity-95 shadow-sm transition hover:bg-primary/90 focus:translate-y-3 focus:transform focus-visible:ring-1 focus-visible:ring-ring`,
|
|
@@ -13382,7 +15023,7 @@ function SkipToMain() {
|
|
|
13382
15023
|
|
|
13383
15024
|
// src/features/errors/not-found-error.tsx
|
|
13384
15025
|
import { useRouter as useRouter3 } from "next/navigation";
|
|
13385
|
-
import { jsx as
|
|
15026
|
+
import { jsx as jsx124, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
13386
15027
|
function NotFoundError({
|
|
13387
15028
|
className,
|
|
13388
15029
|
embedded = false,
|
|
@@ -13400,8 +15041,8 @@ function NotFoundError({
|
|
|
13400
15041
|
if (onDismiss) onDismiss();
|
|
13401
15042
|
router.push("/");
|
|
13402
15043
|
};
|
|
13403
|
-
return /* @__PURE__ */
|
|
13404
|
-
/* @__PURE__ */
|
|
15044
|
+
return /* @__PURE__ */ jsx124("div", { className: cn(embedded ? "min-h-96 w-full py-8" : "h-svh", className), children: /* @__PURE__ */ jsxs82("div", { className: "m-auto flex h-full w-full flex-col items-center justify-center gap-2", children: [
|
|
15045
|
+
/* @__PURE__ */ jsx124(
|
|
13405
15046
|
"h1",
|
|
13406
15047
|
{
|
|
13407
15048
|
className: cn(
|
|
@@ -13411,31 +15052,31 @@ function NotFoundError({
|
|
|
13411
15052
|
children: "404"
|
|
13412
15053
|
}
|
|
13413
15054
|
),
|
|
13414
|
-
/* @__PURE__ */
|
|
13415
|
-
/* @__PURE__ */
|
|
15055
|
+
/* @__PURE__ */ jsx124("span", { className: "font-medium", children: "Oops! Page Not Found :-(!" }),
|
|
15056
|
+
/* @__PURE__ */ jsxs82("p", { className: "text-center text-muted-foreground", children: [
|
|
13416
15057
|
"It seems like the page you're looking for ",
|
|
13417
|
-
/* @__PURE__ */
|
|
15058
|
+
/* @__PURE__ */ jsx124("br", {}),
|
|
13418
15059
|
"does not exist or might have been removed."
|
|
13419
15060
|
] }),
|
|
13420
|
-
/* @__PURE__ */
|
|
13421
|
-
/* @__PURE__ */
|
|
13422
|
-
/* @__PURE__ */
|
|
15061
|
+
/* @__PURE__ */ jsxs82("div", { className: "mt-6 flex gap-4", children: [
|
|
15062
|
+
/* @__PURE__ */ jsx124(Button, { variant: "outline", onClick: handleGoBack, children: "Go Back" }),
|
|
15063
|
+
/* @__PURE__ */ jsx124(Button, { onClick: handleGoHome, children: "Back to Home" })
|
|
13423
15064
|
] })
|
|
13424
15065
|
] }) });
|
|
13425
15066
|
}
|
|
13426
15067
|
|
|
13427
15068
|
// src/design-system/templates/authenticated-layout.tsx
|
|
13428
|
-
import { Fragment as
|
|
15069
|
+
import { Fragment as Fragment7, jsx as jsx125, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
13429
15070
|
function AuthenticatedLayoutContent({ children }) {
|
|
13430
15071
|
const { showInlineNotFound, setShowInlineNotFound } = useLayout();
|
|
13431
15072
|
const pathname = usePathname3();
|
|
13432
15073
|
useEffect16(() => {
|
|
13433
15074
|
setShowInlineNotFound(false);
|
|
13434
15075
|
}, [pathname, setShowInlineNotFound]);
|
|
13435
|
-
return /* @__PURE__ */
|
|
13436
|
-
/* @__PURE__ */
|
|
13437
|
-
/* @__PURE__ */
|
|
13438
|
-
/* @__PURE__ */
|
|
15076
|
+
return /* @__PURE__ */ jsxs83(Fragment7, { children: [
|
|
15077
|
+
/* @__PURE__ */ jsx125(SkipToMain, {}),
|
|
15078
|
+
/* @__PURE__ */ jsx125(AppSidebar2, {}),
|
|
15079
|
+
/* @__PURE__ */ jsx125(
|
|
13439
15080
|
SidebarInset,
|
|
13440
15081
|
{
|
|
13441
15082
|
className: cn(
|
|
@@ -13443,7 +15084,7 @@ function AuthenticatedLayoutContent({ children }) {
|
|
|
13443
15084
|
"has-[[data-layout=fixed]]:h-svh has-data-[layout=fixed]:h-svh",
|
|
13444
15085
|
"peer-data-[variant=inset]:has-data-[layout=fixed]:h-[calc(100svh-(var(--spacing)*4))]"
|
|
13445
15086
|
),
|
|
13446
|
-
children: showInlineNotFound ? /* @__PURE__ */
|
|
15087
|
+
children: showInlineNotFound ? /* @__PURE__ */ jsx125(
|
|
13447
15088
|
NotFoundError,
|
|
13448
15089
|
{
|
|
13449
15090
|
embedded: true,
|
|
@@ -13455,8 +15096,8 @@ function AuthenticatedLayoutContent({ children }) {
|
|
|
13455
15096
|
] });
|
|
13456
15097
|
}
|
|
13457
15098
|
function AuthenticatedLayout({ children }) {
|
|
13458
|
-
const [defaultOpen, setDefaultOpen] =
|
|
13459
|
-
const [isMounted, setIsMounted] =
|
|
15099
|
+
const [defaultOpen, setDefaultOpen] = useState18(true);
|
|
15100
|
+
const [isMounted, setIsMounted] = useState18(false);
|
|
13460
15101
|
useEffect16(() => {
|
|
13461
15102
|
setDefaultOpen(getCookie("sidebar_state") !== "false");
|
|
13462
15103
|
setIsMounted(true);
|
|
@@ -13464,14 +15105,14 @@ function AuthenticatedLayout({ children }) {
|
|
|
13464
15105
|
if (!isMounted) {
|
|
13465
15106
|
return null;
|
|
13466
15107
|
}
|
|
13467
|
-
return /* @__PURE__ */
|
|
15108
|
+
return /* @__PURE__ */ jsx125(SearchProvider, { children: /* @__PURE__ */ jsx125(LayoutProvider, { children: /* @__PURE__ */ jsx125(SidebarProvider, { defaultOpen, children: /* @__PURE__ */ jsx125(AuthenticatedLayoutContent, { children }) }) }) });
|
|
13468
15109
|
}
|
|
13469
15110
|
|
|
13470
15111
|
// src/design-system/templates/header.tsx
|
|
13471
|
-
import { useEffect as useEffect17, useState as
|
|
13472
|
-
import { jsx as
|
|
15112
|
+
import { useEffect as useEffect17, useState as useState19 } from "react";
|
|
15113
|
+
import { jsx as jsx126, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
13473
15114
|
function Header2({ className, fixed, children, ...props }) {
|
|
13474
|
-
const [offset, setOffset] =
|
|
15115
|
+
const [offset, setOffset] = useState19(0);
|
|
13475
15116
|
useEffect17(() => {
|
|
13476
15117
|
const onScroll = () => {
|
|
13477
15118
|
setOffset(document.body.scrollTop || document.documentElement.scrollTop);
|
|
@@ -13481,7 +15122,7 @@ function Header2({ className, fixed, children, ...props }) {
|
|
|
13481
15122
|
}, []);
|
|
13482
15123
|
return (
|
|
13483
15124
|
// Page header container: fixed mode me top par sticky behavior deta hai.
|
|
13484
|
-
/* @__PURE__ */
|
|
15125
|
+
/* @__PURE__ */ jsx126(
|
|
13485
15126
|
"header",
|
|
13486
15127
|
{
|
|
13487
15128
|
className: cn(
|
|
@@ -13491,7 +15132,7 @@ function Header2({ className, fixed, children, ...props }) {
|
|
|
13491
15132
|
className
|
|
13492
15133
|
),
|
|
13493
15134
|
...props,
|
|
13494
|
-
children: /* @__PURE__ */
|
|
15135
|
+
children: /* @__PURE__ */ jsxs84(
|
|
13495
15136
|
"div",
|
|
13496
15137
|
{
|
|
13497
15138
|
className: cn(
|
|
@@ -13500,7 +15141,7 @@ function Header2({ className, fixed, children, ...props }) {
|
|
|
13500
15141
|
offset > 10 && fixed && "after:absolute after:inset-0 after:-z-10 after:bg-background/20 after:backdrop-blur-lg"
|
|
13501
15142
|
),
|
|
13502
15143
|
children: [
|
|
13503
|
-
/* @__PURE__ */
|
|
15144
|
+
/* @__PURE__ */ jsx126(AppLogo, { className: "shrink-0 md:hidden" }),
|
|
13504
15145
|
children
|
|
13505
15146
|
]
|
|
13506
15147
|
}
|
|
@@ -13511,9 +15152,9 @@ function Header2({ className, fixed, children, ...props }) {
|
|
|
13511
15152
|
}
|
|
13512
15153
|
|
|
13513
15154
|
// src/design-system/templates/main.tsx
|
|
13514
|
-
import { jsx as
|
|
15155
|
+
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
13515
15156
|
function Main({ fixed, className, fluid, ...props }) {
|
|
13516
|
-
return /* @__PURE__ */
|
|
15157
|
+
return /* @__PURE__ */ jsx127(
|
|
13517
15158
|
"main",
|
|
13518
15159
|
{
|
|
13519
15160
|
"data-layout": fixed ? "fixed" : "auto",
|
|
@@ -13532,20 +15173,20 @@ function Main({ fixed, className, fluid, ...props }) {
|
|
|
13532
15173
|
|
|
13533
15174
|
// src/design-system/templates/sidebar-search.tsx
|
|
13534
15175
|
import { SearchIcon as SearchIcon7 } from "lucide-react";
|
|
13535
|
-
import { jsx as
|
|
15176
|
+
import { jsx as jsx128, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
13536
15177
|
function SidebarSearch() {
|
|
13537
15178
|
const { setOpen } = useSearch();
|
|
13538
|
-
return /* @__PURE__ */
|
|
15179
|
+
return /* @__PURE__ */ jsx128(SidebarMenu, { children: /* @__PURE__ */ jsx128(SidebarMenuItem, { children: /* @__PURE__ */ jsxs85(
|
|
13539
15180
|
SidebarMenuButton,
|
|
13540
15181
|
{
|
|
13541
15182
|
onClick: () => setOpen(true),
|
|
13542
15183
|
tooltip: "Search (\u2318K)",
|
|
13543
15184
|
className: "bg-sidebar-accent/50 hover:bg-sidebar-accent border border-sidebar-border/60 text-muted-foreground hover:text-foreground",
|
|
13544
15185
|
children: [
|
|
13545
|
-
/* @__PURE__ */
|
|
13546
|
-
/* @__PURE__ */
|
|
13547
|
-
/* @__PURE__ */
|
|
13548
|
-
/* @__PURE__ */
|
|
15186
|
+
/* @__PURE__ */ jsx128(SearchIcon7, { className: "size-4 shrink-0" }),
|
|
15187
|
+
/* @__PURE__ */ jsx128("span", { className: "flex-1 text-left text-xs font-normal group-data-[collapsible=icon]:hidden", children: "Search..." }),
|
|
15188
|
+
/* @__PURE__ */ jsxs85("kbd", { className: "pointer-events-none hidden h-4 select-none items-center gap-0.5 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 group-data-[collapsible=icon]:hidden sm:flex", children: [
|
|
15189
|
+
/* @__PURE__ */ jsx128("span", { className: "text-[10px]", children: "\u2318" }),
|
|
13549
15190
|
"K"
|
|
13550
15191
|
] })
|
|
13551
15192
|
]
|
|
@@ -13556,7 +15197,7 @@ function SidebarSearch() {
|
|
|
13556
15197
|
// src/design-system/templates/top-nav.tsx
|
|
13557
15198
|
import Link7 from "next/link";
|
|
13558
15199
|
import { Menu as Menu2 } from "lucide-react";
|
|
13559
|
-
import { Fragment as
|
|
15200
|
+
import { Fragment as Fragment8, jsx as jsx129, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
13560
15201
|
function TopNav({ className, links, ...props }) {
|
|
13561
15202
|
const renderLink = ({
|
|
13562
15203
|
title,
|
|
@@ -13567,7 +15208,7 @@ function TopNav({ className, links, ...props }) {
|
|
|
13567
15208
|
}) => {
|
|
13568
15209
|
const className2 = `text-sm font-medium transition-colors hover:text-primary ${isActive ? "" : "text-muted-foreground"}`;
|
|
13569
15210
|
if (onClick) {
|
|
13570
|
-
return /* @__PURE__ */
|
|
15211
|
+
return /* @__PURE__ */ jsx129(
|
|
13571
15212
|
"button",
|
|
13572
15213
|
{
|
|
13573
15214
|
type: "button",
|
|
@@ -13579,7 +15220,7 @@ function TopNav({ className, links, ...props }) {
|
|
|
13579
15220
|
title
|
|
13580
15221
|
);
|
|
13581
15222
|
}
|
|
13582
|
-
return /* @__PURE__ */
|
|
15223
|
+
return /* @__PURE__ */ jsx129(
|
|
13583
15224
|
Link7,
|
|
13584
15225
|
{
|
|
13585
15226
|
href,
|
|
@@ -13590,9 +15231,9 @@ function TopNav({ className, links, ...props }) {
|
|
|
13590
15231
|
title
|
|
13591
15232
|
);
|
|
13592
15233
|
};
|
|
13593
|
-
return /* @__PURE__ */
|
|
13594
|
-
/* @__PURE__ */
|
|
13595
|
-
/* @__PURE__ */
|
|
15234
|
+
return /* @__PURE__ */ jsxs86(Fragment8, { children: [
|
|
15235
|
+
/* @__PURE__ */ jsxs86(DropdownMenu, { modal: false, children: [
|
|
15236
|
+
/* @__PURE__ */ jsx129(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs86(
|
|
13596
15237
|
Button,
|
|
13597
15238
|
{
|
|
13598
15239
|
size: "icon",
|
|
@@ -13602,18 +15243,18 @@ function TopNav({ className, links, ...props }) {
|
|
|
13602
15243
|
className
|
|
13603
15244
|
),
|
|
13604
15245
|
children: [
|
|
13605
|
-
/* @__PURE__ */
|
|
13606
|
-
/* @__PURE__ */
|
|
15246
|
+
/* @__PURE__ */ jsx129(Menu2, {}),
|
|
15247
|
+
/* @__PURE__ */ jsx129("span", { className: "sr-only", children: "Toggle navigation menu" })
|
|
13607
15248
|
]
|
|
13608
15249
|
}
|
|
13609
15250
|
) }),
|
|
13610
|
-
/* @__PURE__ */
|
|
15251
|
+
/* @__PURE__ */ jsx129(DropdownMenuContent, { side: "bottom", align: "start", children: links.map((link) => /* @__PURE__ */ jsx129(
|
|
13611
15252
|
DropdownMenuItem,
|
|
13612
15253
|
{
|
|
13613
15254
|
disabled: link.disabled,
|
|
13614
15255
|
onClick: link.onClick,
|
|
13615
15256
|
asChild: !link.onClick,
|
|
13616
|
-
children: link.onClick ? /* @__PURE__ */
|
|
15257
|
+
children: link.onClick ? /* @__PURE__ */ jsx129("span", { className: !link.isActive ? "text-muted-foreground" : "", children: link.title }) : /* @__PURE__ */ jsx129(
|
|
13617
15258
|
Link7,
|
|
13618
15259
|
{
|
|
13619
15260
|
href: link.href,
|
|
@@ -13626,7 +15267,7 @@ function TopNav({ className, links, ...props }) {
|
|
|
13626
15267
|
link.title
|
|
13627
15268
|
)) })
|
|
13628
15269
|
] }),
|
|
13629
|
-
/* @__PURE__ */
|
|
15270
|
+
/* @__PURE__ */ jsx129(
|
|
13630
15271
|
"nav",
|
|
13631
15272
|
{
|
|
13632
15273
|
className: cn(
|
|
@@ -13808,7 +15449,10 @@ export {
|
|
|
13808
15449
|
FieldSeparator,
|
|
13809
15450
|
FieldSet,
|
|
13810
15451
|
FieldTitle,
|
|
15452
|
+
FileCardItem,
|
|
15453
|
+
FileUploadForm,
|
|
13811
15454
|
FilterBar,
|
|
15455
|
+
FolderTreeItem,
|
|
13812
15456
|
Form,
|
|
13813
15457
|
FormControl,
|
|
13814
15458
|
FormDescription,
|
|
@@ -13961,6 +15605,7 @@ export {
|
|
|
13961
15605
|
Spinner,
|
|
13962
15606
|
Stats01,
|
|
13963
15607
|
StatusBadge,
|
|
15608
|
+
StorageStatCard,
|
|
13964
15609
|
Switch,
|
|
13965
15610
|
Table,
|
|
13966
15611
|
TableBody,
|
|
@@ -13988,12 +15633,15 @@ export {
|
|
|
13988
15633
|
TooltipTrigger,
|
|
13989
15634
|
TopNav,
|
|
13990
15635
|
TypingIndicator,
|
|
15636
|
+
UserFileCardsView,
|
|
13991
15637
|
WizardTemplate,
|
|
13992
15638
|
WorkspaceTemplate,
|
|
13993
15639
|
badgeVariants,
|
|
13994
15640
|
buttonGroupVariants,
|
|
13995
15641
|
buttonVariants,
|
|
13996
15642
|
downloadQrCode,
|
|
15643
|
+
formatBytes,
|
|
15644
|
+
getFileCategoryTheme,
|
|
13997
15645
|
navigationMenuTriggerStyle,
|
|
13998
15646
|
sidebarData2 as sidebarData,
|
|
13999
15647
|
statusBadgeVariants,
|