@moontra/moonui 2.3.5 → 2.3.8
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.d.mts +18 -77
- package/dist/index.d.ts +18 -77
- package/dist/index.global.js +29 -69
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +838 -1083
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +837 -1080
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/badge.tsx +14 -2
- package/src/components/ui/data-table-basic.tsx +261 -0
- package/src/components/ui/index.ts +4 -3
- package/src/components/ui/data-table.tsx +0 -623
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as t from 'react';
|
|
4
4
|
import t__default, { useState, useCallback, useEffect } from 'react';
|
|
5
5
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
6
|
-
import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, CreditCard, Minus, Search,
|
|
6
|
+
import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, CreditCard, Minus, Search, ChevronRight, Circle, Upload, ChevronUp, Phone, Bold, Italic, Underline, Strikethrough, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Code, Link, Image, Palette, Undo, Redo, Edit, Eye, Copy, ArrowDown, ArrowUp, ArrowUpDown, ChevronLeft, Calendar as Calendar$1, Clock, CheckCircle, Star, GitFork, ExternalLink, Crown, Lock, Zap, Video, Music, FileText, File } from 'lucide-react';
|
|
7
7
|
export { Palette, Pipette } from 'lucide-react';
|
|
8
8
|
import { clsx } from 'clsx';
|
|
9
9
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -18,10 +18,10 @@ import * as LabelPrimitive from '@radix-ui/react-label';
|
|
|
18
18
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
19
19
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
20
20
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
21
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
22
|
-
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
23
21
|
import { isValid, format, isSameMonth, isToday, subMonths, addMonths, isSameDay, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek } from 'date-fns';
|
|
24
22
|
export { format } from 'date-fns';
|
|
23
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
24
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
25
25
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
26
26
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
27
27
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
@@ -341,7 +341,9 @@ var badgeVariants = cva(
|
|
|
341
341
|
"inline-flex items-center justify-center gap-1.5",
|
|
342
342
|
"font-medium transition-colors duration-200",
|
|
343
343
|
"border focus:outline-none",
|
|
344
|
-
"focus-visible:ring-2 focus-visible:ring-offset-1"
|
|
344
|
+
"focus-visible:ring-2 focus-visible:ring-offset-1",
|
|
345
|
+
// Auto spacing between badges
|
|
346
|
+
"mr-2 mb-2 last:mr-0"
|
|
345
347
|
],
|
|
346
348
|
{
|
|
347
349
|
variants: {
|
|
@@ -433,6 +435,7 @@ function Badge({
|
|
|
433
435
|
onRemove,
|
|
434
436
|
leftIcon,
|
|
435
437
|
rightIcon,
|
|
438
|
+
noAutoSpacing,
|
|
436
439
|
children,
|
|
437
440
|
...props
|
|
438
441
|
}) {
|
|
@@ -453,7 +456,13 @@ function Badge({
|
|
|
453
456
|
return /* @__PURE__ */ jsxs(
|
|
454
457
|
"div",
|
|
455
458
|
{
|
|
456
|
-
className: cn(
|
|
459
|
+
className: cn(
|
|
460
|
+
"moonui-theme",
|
|
461
|
+
badgeVariants({ variant, size, radius }),
|
|
462
|
+
// Remove auto-spacing if noAutoSpacing is true
|
|
463
|
+
noAutoSpacing && "mr-0 mb-0",
|
|
464
|
+
className
|
|
465
|
+
),
|
|
457
466
|
"data-removable": removable ? "" : void 0,
|
|
458
467
|
...props,
|
|
459
468
|
children: [
|
|
@@ -3443,7 +3452,7 @@ var me = t.forwardRef((r, o) => {
|
|
|
3443
3452
|
var e;
|
|
3444
3453
|
return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
|
|
3445
3454
|
}
|
|
3446
|
-
function
|
|
3455
|
+
function X7(e) {
|
|
3447
3456
|
let s = V()[e];
|
|
3448
3457
|
s && E.setState("value", s.getAttribute(T));
|
|
3449
3458
|
}
|
|
@@ -3458,10 +3467,10 @@ var me = t.forwardRef((r, o) => {
|
|
|
3458
3467
|
s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
|
|
3459
3468
|
i ? E.setState("value", i.getAttribute(T)) : Q(e);
|
|
3460
3469
|
}
|
|
3461
|
-
let oe = () =>
|
|
3470
|
+
let oe = () => X7(V().length - 1), ie = (e) => {
|
|
3462
3471
|
e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
|
|
3463
3472
|
}, se = (e) => {
|
|
3464
|
-
e.preventDefault(), e.metaKey ?
|
|
3473
|
+
e.preventDefault(), e.metaKey ? X7(0) : e.altKey ? re(-1) : Q(-1);
|
|
3465
3474
|
};
|
|
3466
3475
|
return t.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
|
|
3467
3476
|
var s;
|
|
@@ -3488,7 +3497,7 @@ var me = t.forwardRef((r, o) => {
|
|
|
3488
3497
|
break;
|
|
3489
3498
|
}
|
|
3490
3499
|
case "Home": {
|
|
3491
|
-
e.preventDefault(),
|
|
3500
|
+
e.preventDefault(), X7(0);
|
|
3492
3501
|
break;
|
|
3493
3502
|
}
|
|
3494
3503
|
case "End": {
|
|
@@ -6733,46 +6742,6 @@ function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
|
|
|
6733
6742
|
rowsById: newFilteredRowsById
|
|
6734
6743
|
};
|
|
6735
6744
|
}
|
|
6736
|
-
function getFacetedRowModel() {
|
|
6737
|
-
return (table, columnId) => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter, table.getFilteredRowModel()], (preRowModel, columnFilters, globalFilter) => {
|
|
6738
|
-
if (!preRowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
|
|
6739
|
-
return preRowModel;
|
|
6740
|
-
}
|
|
6741
|
-
const filterableIds = [...columnFilters.map((d) => d.id).filter((d) => d !== columnId), globalFilter ? "__global__" : void 0].filter(Boolean);
|
|
6742
|
-
const filterRowsImpl = (row) => {
|
|
6743
|
-
for (let i = 0; i < filterableIds.length; i++) {
|
|
6744
|
-
if (row.columnFilters[filterableIds[i]] === false) {
|
|
6745
|
-
return false;
|
|
6746
|
-
}
|
|
6747
|
-
}
|
|
6748
|
-
return true;
|
|
6749
|
-
};
|
|
6750
|
-
return filterRows(preRowModel.rows, filterRowsImpl, table);
|
|
6751
|
-
}, getMemoOptions(table.options, "debugTable", "getFacetedRowModel"));
|
|
6752
|
-
}
|
|
6753
|
-
function getFacetedUniqueValues() {
|
|
6754
|
-
return (table, columnId) => memo(() => {
|
|
6755
|
-
var _table$getColumn;
|
|
6756
|
-
return [(_table$getColumn = table.getColumn(columnId)) == null ? void 0 : _table$getColumn.getFacetedRowModel()];
|
|
6757
|
-
}, (facetedRowModel) => {
|
|
6758
|
-
if (!facetedRowModel)
|
|
6759
|
-
return /* @__PURE__ */ new Map();
|
|
6760
|
-
let facetedUniqueValues = /* @__PURE__ */ new Map();
|
|
6761
|
-
for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
|
|
6762
|
-
const values = facetedRowModel.flatRows[i].getUniqueValues(columnId);
|
|
6763
|
-
for (let j = 0; j < values.length; j++) {
|
|
6764
|
-
const value = values[j];
|
|
6765
|
-
if (facetedUniqueValues.has(value)) {
|
|
6766
|
-
var _facetedUniqueValues$;
|
|
6767
|
-
facetedUniqueValues.set(value, ((_facetedUniqueValues$ = facetedUniqueValues.get(value)) != null ? _facetedUniqueValues$ : 0) + 1);
|
|
6768
|
-
} else {
|
|
6769
|
-
facetedUniqueValues.set(value, 1);
|
|
6770
|
-
}
|
|
6771
|
-
}
|
|
6772
|
-
}
|
|
6773
|
-
return facetedUniqueValues;
|
|
6774
|
-
}, getMemoOptions(table.options, "debugTable", `getFacetedUniqueValues_${columnId}`));
|
|
6775
|
-
}
|
|
6776
6745
|
function getFilteredRowModel() {
|
|
6777
6746
|
return (table) => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {
|
|
6778
6747
|
if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
|
|
@@ -7229,749 +7198,52 @@ var TableCaption = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
7229
7198
|
}
|
|
7230
7199
|
));
|
|
7231
7200
|
TableCaption.displayName = "TableCaption";
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
children: [
|
|
7266
|
-
/* @__PURE__ */
|
|
7267
|
-
leftIcon && /* @__PURE__ */ jsx("span", { className: "flex items-center justify-center text-gray-500 dark:text-gray-400", children: leftIcon }),
|
|
7268
|
-
loading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7269
|
-
/* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground dark:text-gray-400" }),
|
|
7270
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground dark:text-gray-400", children: "Loading..." })
|
|
7271
|
-
] }) : children
|
|
7272
|
-
] }),
|
|
7273
|
-
!loading && /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: rightIcon ? /* @__PURE__ */ jsx("span", { className: "opacity-60", children: rightIcon }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-60 transition-transform duration-200 ease-out group-data-[state=open]:rotate-180" }) })
|
|
7274
|
-
]
|
|
7275
|
-
}
|
|
7276
|
-
));
|
|
7277
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
7278
|
-
var SelectScrollUpButton = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7279
|
-
SelectPrimitive.ScrollUpButton,
|
|
7280
|
-
{
|
|
7281
|
-
ref,
|
|
7282
|
-
className: cn(
|
|
7283
|
-
"flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",
|
|
7284
|
-
className
|
|
7285
|
-
),
|
|
7286
|
-
...props,
|
|
7287
|
-
children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
|
|
7288
|
-
}
|
|
7289
|
-
));
|
|
7290
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
7291
|
-
var SelectScrollDownButton = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7292
|
-
SelectPrimitive.ScrollDownButton,
|
|
7293
|
-
{
|
|
7294
|
-
ref,
|
|
7295
|
-
className: cn(
|
|
7296
|
-
"flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",
|
|
7297
|
-
className
|
|
7298
|
-
),
|
|
7299
|
-
...props,
|
|
7300
|
-
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
7301
|
-
}
|
|
7302
|
-
));
|
|
7303
|
-
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
7304
|
-
var SelectContent = t.forwardRef(({ className, children, position = "popper", side = "bottom", sideOffset = 4, align = "start", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
7305
|
-
SelectPrimitive.Content,
|
|
7306
|
-
{
|
|
7307
|
-
ref,
|
|
7308
|
-
side,
|
|
7309
|
-
sideOffset,
|
|
7310
|
-
align,
|
|
7311
|
-
avoidCollisions: false,
|
|
7312
|
-
className: cn(
|
|
7313
|
-
[
|
|
7314
|
-
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden",
|
|
7315
|
-
"rounded-md border border-gray-200 dark:border-gray-700",
|
|
7316
|
-
"bg-white dark:bg-gray-900 text-foreground",
|
|
7317
|
-
"shadow-lg dark:shadow-gray-900/20",
|
|
7318
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
7319
|
-
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
7320
|
-
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
7321
|
-
"data-[state=open]:duration-150"
|
|
7322
|
-
],
|
|
7323
|
-
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
7324
|
-
className
|
|
7325
|
-
),
|
|
7326
|
-
position,
|
|
7327
|
-
...props,
|
|
7328
|
-
children: [
|
|
7329
|
-
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
7201
|
+
function DataTableBasic({
|
|
7202
|
+
columns,
|
|
7203
|
+
data,
|
|
7204
|
+
enableSorting = true,
|
|
7205
|
+
enablePagination = true,
|
|
7206
|
+
enableSearch = true,
|
|
7207
|
+
pageSize = 10,
|
|
7208
|
+
searchPlaceholder = "Search...",
|
|
7209
|
+
emptyMessage = "No results found.",
|
|
7210
|
+
className
|
|
7211
|
+
}) {
|
|
7212
|
+
const [sorting, setSorting] = t.useState([]);
|
|
7213
|
+
const [globalFilter, setGlobalFilter] = t.useState("");
|
|
7214
|
+
const table = useReactTable({
|
|
7215
|
+
data,
|
|
7216
|
+
columns,
|
|
7217
|
+
onSortingChange: enableSorting ? setSorting : void 0,
|
|
7218
|
+
onGlobalFilterChange: enableSearch ? setGlobalFilter : void 0,
|
|
7219
|
+
getCoreRowModel: getCoreRowModel(),
|
|
7220
|
+
getPaginationRowModel: enablePagination ? getPaginationRowModel() : void 0,
|
|
7221
|
+
getSortedRowModel: enableSorting ? getSortedRowModel() : void 0,
|
|
7222
|
+
getFilteredRowModel: enableSearch ? getFilteredRowModel() : void 0,
|
|
7223
|
+
state: {
|
|
7224
|
+
sorting,
|
|
7225
|
+
globalFilter
|
|
7226
|
+
},
|
|
7227
|
+
initialState: {
|
|
7228
|
+
pagination: {
|
|
7229
|
+
pageSize
|
|
7230
|
+
}
|
|
7231
|
+
}
|
|
7232
|
+
});
|
|
7233
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), children: [
|
|
7234
|
+
enableSearch && /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxs("div", { className: "relative max-w-sm", children: [
|
|
7235
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
7330
7236
|
/* @__PURE__ */ jsx(
|
|
7331
|
-
|
|
7237
|
+
Input,
|
|
7332
7238
|
{
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
children
|
|
7239
|
+
placeholder: searchPlaceholder,
|
|
7240
|
+
value: globalFilter,
|
|
7241
|
+
onChange: (event) => setGlobalFilter(event.target.value),
|
|
7242
|
+
className: "pl-8"
|
|
7338
7243
|
}
|
|
7339
|
-
)
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
}
|
|
7343
|
-
) }));
|
|
7344
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
7345
|
-
var SelectLabel = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7346
|
-
SelectPrimitive.Label,
|
|
7347
|
-
{
|
|
7348
|
-
ref,
|
|
7349
|
-
className: cn("moonui-theme", "py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
7350
|
-
...props
|
|
7351
|
-
}
|
|
7352
|
-
));
|
|
7353
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
7354
|
-
var SelectItem = t.forwardRef(({ className, children, variant = "default", size = "md", rightIcon, customIndicator, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7355
|
-
SelectPrimitive.Item,
|
|
7356
|
-
{
|
|
7357
|
-
ref,
|
|
7358
|
-
className: cn(
|
|
7359
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
7360
|
-
/* Size variants */
|
|
7361
|
-
size === "sm" && "py-1 pl-7 pr-2 text-xs",
|
|
7362
|
-
size === "md" && "py-1.5 pl-8 pr-2 text-sm",
|
|
7363
|
-
size === "lg" && "py-2 pl-9 pr-3 text-base",
|
|
7364
|
-
/* Color variants */
|
|
7365
|
-
variant === "default" && "focus:bg-accent focus:text-accent-foreground dark:focus:bg-gray-700 dark:focus:text-gray-100",
|
|
7366
|
-
variant === "subtle" && "focus:bg-gray-100 dark:focus:bg-gray-800 focus:text-foreground dark:focus:text-gray-200",
|
|
7367
|
-
variant === "destructive" && "text-error dark:text-red-400 focus:bg-error/10 dark:focus:bg-red-900/20 focus:text-error dark:focus:text-red-300",
|
|
7368
|
-
variant === "success" && "text-success dark:text-green-400 focus:bg-success/10 dark:focus:bg-green-900/20 focus:text-success dark:focus:text-green-300",
|
|
7369
|
-
variant === "warning" && "text-warning dark:text-yellow-400 focus:bg-warning/10 dark:focus:bg-yellow-900/20 focus:text-warning dark:focus:text-yellow-300",
|
|
7370
|
-
className
|
|
7371
|
-
),
|
|
7372
|
-
...props,
|
|
7373
|
-
children: [
|
|
7374
|
-
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: customIndicator || /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
7375
|
-
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children }),
|
|
7376
|
-
rightIcon && /* @__PURE__ */ jsx("span", { className: "ml-auto pl-2 opacity-70", children: rightIcon })
|
|
7377
|
-
]
|
|
7378
|
-
}
|
|
7379
|
-
));
|
|
7380
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
7381
|
-
var SelectSeparator = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7382
|
-
SelectPrimitive.Separator,
|
|
7383
|
-
{
|
|
7384
|
-
ref,
|
|
7385
|
-
className: cn("moonui-theme", "-mx-1 my-1 h-px bg-muted dark:bg-gray-700", className),
|
|
7386
|
-
...props
|
|
7387
|
-
}
|
|
7388
|
-
));
|
|
7389
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
7390
|
-
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
7391
|
-
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
7392
|
-
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
7393
|
-
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
7394
|
-
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
7395
|
-
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
7396
|
-
var DropdownMenuSubTrigger = t.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7397
|
-
DropdownMenuPrimitive.SubTrigger,
|
|
7398
|
-
{
|
|
7399
|
-
ref,
|
|
7400
|
-
className: cn(
|
|
7401
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
7402
|
-
inset && "pl-8",
|
|
7403
|
-
className
|
|
7404
|
-
),
|
|
7405
|
-
...props,
|
|
7406
|
-
children: [
|
|
7407
|
-
children,
|
|
7408
|
-
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
7409
|
-
]
|
|
7410
|
-
}
|
|
7411
|
-
));
|
|
7412
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
7413
|
-
var DropdownMenuSubContent = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7414
|
-
DropdownMenuPrimitive.SubContent,
|
|
7415
|
-
{
|
|
7416
|
-
ref,
|
|
7417
|
-
className: cn(
|
|
7418
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
7419
|
-
className
|
|
7420
|
-
),
|
|
7421
|
-
...props
|
|
7422
|
-
}
|
|
7423
|
-
));
|
|
7424
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
7425
|
-
var DropdownMenuContent = t.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
7426
|
-
DropdownMenuPrimitive.Content,
|
|
7427
|
-
{
|
|
7428
|
-
ref,
|
|
7429
|
-
sideOffset,
|
|
7430
|
-
className: cn(
|
|
7431
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
7432
|
-
className
|
|
7433
|
-
),
|
|
7434
|
-
...props
|
|
7435
|
-
}
|
|
7436
|
-
) }));
|
|
7437
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
7438
|
-
var DropdownMenuItem = t.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7439
|
-
DropdownMenuPrimitive.Item,
|
|
7440
|
-
{
|
|
7441
|
-
ref,
|
|
7442
|
-
className: cn(
|
|
7443
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
7444
|
-
inset && "pl-8",
|
|
7445
|
-
className
|
|
7446
|
-
),
|
|
7447
|
-
...props
|
|
7448
|
-
}
|
|
7449
|
-
));
|
|
7450
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
7451
|
-
var DropdownMenuCheckboxItem = t.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7452
|
-
DropdownMenuPrimitive.CheckboxItem,
|
|
7453
|
-
{
|
|
7454
|
-
ref,
|
|
7455
|
-
className: cn(
|
|
7456
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
7457
|
-
className
|
|
7458
|
-
),
|
|
7459
|
-
checked,
|
|
7460
|
-
...props,
|
|
7461
|
-
children: [
|
|
7462
|
-
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
7463
|
-
children
|
|
7464
|
-
]
|
|
7465
|
-
}
|
|
7466
|
-
));
|
|
7467
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
7468
|
-
var DropdownMenuRadioItem = t.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7469
|
-
DropdownMenuPrimitive.RadioItem,
|
|
7470
|
-
{
|
|
7471
|
-
ref,
|
|
7472
|
-
className: cn(
|
|
7473
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
7474
|
-
className
|
|
7475
|
-
),
|
|
7476
|
-
...props,
|
|
7477
|
-
children: [
|
|
7478
|
-
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
7479
|
-
children
|
|
7480
|
-
]
|
|
7481
|
-
}
|
|
7482
|
-
));
|
|
7483
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
7484
|
-
var DropdownMenuLabel = t.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7485
|
-
DropdownMenuPrimitive.Label,
|
|
7486
|
-
{
|
|
7487
|
-
ref,
|
|
7488
|
-
className: cn(
|
|
7489
|
-
"px-2 py-1.5 text-sm font-semibold",
|
|
7490
|
-
inset && "pl-8",
|
|
7491
|
-
className
|
|
7492
|
-
),
|
|
7493
|
-
...props
|
|
7494
|
-
}
|
|
7495
|
-
));
|
|
7496
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
7497
|
-
var DropdownMenuSeparator = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7498
|
-
DropdownMenuPrimitive.Separator,
|
|
7499
|
-
{
|
|
7500
|
-
ref,
|
|
7501
|
-
className: cn("moonui-theme", "-mx-1 my-1 h-px bg-muted", className),
|
|
7502
|
-
...props
|
|
7503
|
-
}
|
|
7504
|
-
));
|
|
7505
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
7506
|
-
var DropdownMenuShortcut = ({
|
|
7507
|
-
className,
|
|
7508
|
-
...props
|
|
7509
|
-
}) => {
|
|
7510
|
-
return /* @__PURE__ */ jsx(
|
|
7511
|
-
"span",
|
|
7512
|
-
{
|
|
7513
|
-
className: cn("moonui-theme", "ml-auto text-xs tracking-widest opacity-60", className),
|
|
7514
|
-
...props
|
|
7515
|
-
}
|
|
7516
|
-
);
|
|
7517
|
-
};
|
|
7518
|
-
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
7519
|
-
var skeletonVariants = cva(
|
|
7520
|
-
"animate-pulse rounded-md",
|
|
7521
|
-
{
|
|
7522
|
-
variants: {
|
|
7523
|
-
variant: {
|
|
7524
|
-
default: "bg-muted",
|
|
7525
|
-
primary: "bg-primary/10",
|
|
7526
|
-
secondary: "bg-secondary/10",
|
|
7527
|
-
accent: "bg-accent"
|
|
7528
|
-
},
|
|
7529
|
-
size: {
|
|
7530
|
-
default: "",
|
|
7531
|
-
sm: "scale-90",
|
|
7532
|
-
lg: "scale-110"
|
|
7533
|
-
},
|
|
7534
|
-
shape: {
|
|
7535
|
-
rect: "rounded-md",
|
|
7536
|
-
circle: "rounded-full",
|
|
7537
|
-
pill: "rounded-full"
|
|
7538
|
-
},
|
|
7539
|
-
animation: {
|
|
7540
|
-
pulse: "animate-pulse",
|
|
7541
|
-
wave: "overflow-hidden relative after:absolute after:inset-0 after:-translate-x-full after:animate-[shimmer_2s_infinite] after:bg-gradient-to-r after:from-transparent after:via-white/10 after:to-transparent dark:after:via-white/5",
|
|
7542
|
-
none: "animate-none"
|
|
7543
|
-
}
|
|
7544
|
-
},
|
|
7545
|
-
defaultVariants: {
|
|
7546
|
-
variant: "default",
|
|
7547
|
-
size: "default",
|
|
7548
|
-
shape: "rect",
|
|
7549
|
-
animation: "pulse"
|
|
7550
|
-
}
|
|
7551
|
-
}
|
|
7552
|
-
);
|
|
7553
|
-
var Skeleton = t.forwardRef(
|
|
7554
|
-
({
|
|
7555
|
-
className,
|
|
7556
|
-
variant,
|
|
7557
|
-
size,
|
|
7558
|
-
shape,
|
|
7559
|
-
animation,
|
|
7560
|
-
height,
|
|
7561
|
-
width,
|
|
7562
|
-
isLoaded = false,
|
|
7563
|
-
children,
|
|
7564
|
-
fadeInDuration = 400,
|
|
7565
|
-
motion: useMotion = false,
|
|
7566
|
-
style,
|
|
7567
|
-
...props
|
|
7568
|
-
}, ref) => {
|
|
7569
|
-
const {
|
|
7570
|
-
onDrag,
|
|
7571
|
-
onDragEnd,
|
|
7572
|
-
onDragStart,
|
|
7573
|
-
onAnimationStart,
|
|
7574
|
-
onAnimationEnd,
|
|
7575
|
-
onAnimationIteration,
|
|
7576
|
-
...filteredProps
|
|
7577
|
-
} = props;
|
|
7578
|
-
if (isLoaded && children) {
|
|
7579
|
-
if (useMotion) {
|
|
7580
|
-
return /* @__PURE__ */ jsx(
|
|
7581
|
-
motion.div,
|
|
7582
|
-
{
|
|
7583
|
-
ref,
|
|
7584
|
-
initial: { opacity: 0 },
|
|
7585
|
-
animate: { opacity: 1 },
|
|
7586
|
-
transition: { duration: fadeInDuration / 1e3 },
|
|
7587
|
-
className: cn("moonui-theme", className),
|
|
7588
|
-
style: {
|
|
7589
|
-
height,
|
|
7590
|
-
width,
|
|
7591
|
-
...style
|
|
7592
|
-
},
|
|
7593
|
-
...filteredProps,
|
|
7594
|
-
children
|
|
7595
|
-
}
|
|
7596
|
-
);
|
|
7597
|
-
}
|
|
7598
|
-
return /* @__PURE__ */ jsx(
|
|
7599
|
-
"div",
|
|
7600
|
-
{
|
|
7601
|
-
ref,
|
|
7602
|
-
className: cn("moonui-theme", "animate-fade-in", className),
|
|
7603
|
-
style: {
|
|
7604
|
-
animationDuration: `${fadeInDuration}ms`,
|
|
7605
|
-
height,
|
|
7606
|
-
width,
|
|
7607
|
-
...style
|
|
7608
|
-
},
|
|
7609
|
-
...props,
|
|
7610
|
-
children
|
|
7611
|
-
}
|
|
7612
|
-
);
|
|
7613
|
-
}
|
|
7614
|
-
const SkeletonElement = useMotion ? motion.div : "div";
|
|
7615
|
-
return /* @__PURE__ */ jsx(
|
|
7616
|
-
SkeletonElement,
|
|
7617
|
-
{
|
|
7618
|
-
ref,
|
|
7619
|
-
className: cn(
|
|
7620
|
-
"moonui-theme",
|
|
7621
|
-
skeletonVariants({ variant, size, shape, animation }),
|
|
7622
|
-
"relative isolate",
|
|
7623
|
-
className
|
|
7624
|
-
),
|
|
7625
|
-
style: {
|
|
7626
|
-
height,
|
|
7627
|
-
width,
|
|
7628
|
-
...style
|
|
7629
|
-
},
|
|
7630
|
-
...useMotion ? skeletonAnimation : {},
|
|
7631
|
-
...filteredProps
|
|
7632
|
-
}
|
|
7633
|
-
);
|
|
7634
|
-
}
|
|
7635
|
-
);
|
|
7636
|
-
Skeleton.displayName = "Skeleton";
|
|
7637
|
-
var SkeletonText = t.forwardRef(
|
|
7638
|
-
({
|
|
7639
|
-
className,
|
|
7640
|
-
lines = 3,
|
|
7641
|
-
lineHeight = "0.85rem",
|
|
7642
|
-
spacing = "0.5rem",
|
|
7643
|
-
lastLineWidth = 80,
|
|
7644
|
-
randomWidths = false,
|
|
7645
|
-
variant = "default",
|
|
7646
|
-
animation = "pulse",
|
|
7647
|
-
...props
|
|
7648
|
-
}, ref) => {
|
|
7649
|
-
return /* @__PURE__ */ jsx(
|
|
7650
|
-
"div",
|
|
7651
|
-
{
|
|
7652
|
-
ref,
|
|
7653
|
-
className: cn("moonui-theme", "flex flex-col", className),
|
|
7654
|
-
style: { gap: spacing },
|
|
7655
|
-
...props,
|
|
7656
|
-
children: Array.from({ length: lines }).map((_, i) => {
|
|
7657
|
-
const isLastLine = i === lines - 1;
|
|
7658
|
-
const widthPercentage = isLastLine ? lastLineWidth : randomWidths ? 85 + i % 3 * 5 : 100;
|
|
7659
|
-
return /* @__PURE__ */ jsx(
|
|
7660
|
-
Skeleton,
|
|
7661
|
-
{
|
|
7662
|
-
variant,
|
|
7663
|
-
animation,
|
|
7664
|
-
className: "w-full",
|
|
7665
|
-
style: {
|
|
7666
|
-
height: lineHeight,
|
|
7667
|
-
width: `${widthPercentage}%`
|
|
7668
|
-
}
|
|
7669
|
-
},
|
|
7670
|
-
i
|
|
7671
|
-
);
|
|
7672
|
-
})
|
|
7673
|
-
}
|
|
7674
|
-
);
|
|
7675
|
-
}
|
|
7676
|
-
);
|
|
7677
|
-
SkeletonText.displayName = "SkeletonText";
|
|
7678
|
-
var SkeletonAvatar = t.forwardRef(
|
|
7679
|
-
({
|
|
7680
|
-
className,
|
|
7681
|
-
size = "2.5rem",
|
|
7682
|
-
variant = "default",
|
|
7683
|
-
animation = "pulse",
|
|
7684
|
-
...props
|
|
7685
|
-
}, ref) => {
|
|
7686
|
-
return /* @__PURE__ */ jsx(
|
|
7687
|
-
Skeleton,
|
|
7688
|
-
{
|
|
7689
|
-
ref,
|
|
7690
|
-
variant,
|
|
7691
|
-
animation,
|
|
7692
|
-
shape: "circle",
|
|
7693
|
-
className: cn("moonui-theme", "shrink-0", className),
|
|
7694
|
-
style: {
|
|
7695
|
-
height: size,
|
|
7696
|
-
width: size
|
|
7697
|
-
},
|
|
7698
|
-
...props
|
|
7699
|
-
}
|
|
7700
|
-
);
|
|
7701
|
-
}
|
|
7702
|
-
);
|
|
7703
|
-
SkeletonAvatar.displayName = "SkeletonAvatar";
|
|
7704
|
-
var SkeletonCard = t.forwardRef(
|
|
7705
|
-
({
|
|
7706
|
-
className,
|
|
7707
|
-
showHeader = true,
|
|
7708
|
-
contentLines = 3,
|
|
7709
|
-
showFooter = true,
|
|
7710
|
-
variant = "default",
|
|
7711
|
-
animation = "pulse",
|
|
7712
|
-
...props
|
|
7713
|
-
}, ref) => {
|
|
7714
|
-
return /* @__PURE__ */ jsxs(
|
|
7715
|
-
"div",
|
|
7716
|
-
{
|
|
7717
|
-
ref,
|
|
7718
|
-
className: cn(
|
|
7719
|
-
"overflow-hidden rounded-md border border-border bg-background p-4",
|
|
7720
|
-
className
|
|
7721
|
-
),
|
|
7722
|
-
...props,
|
|
7723
|
-
children: [
|
|
7724
|
-
showHeader && /* @__PURE__ */ jsxs("div", { className: "mb-4 flex items-center gap-4", children: [
|
|
7725
|
-
/* @__PURE__ */ jsx(SkeletonAvatar, { size: "2.5rem", variant, animation }),
|
|
7726
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
7727
|
-
/* @__PURE__ */ jsx(
|
|
7728
|
-
Skeleton,
|
|
7729
|
-
{
|
|
7730
|
-
variant,
|
|
7731
|
-
animation,
|
|
7732
|
-
className: "mb-2 h-4 w-1/3"
|
|
7733
|
-
}
|
|
7734
|
-
),
|
|
7735
|
-
/* @__PURE__ */ jsx(
|
|
7736
|
-
Skeleton,
|
|
7737
|
-
{
|
|
7738
|
-
variant,
|
|
7739
|
-
animation,
|
|
7740
|
-
className: "h-3 w-1/4"
|
|
7741
|
-
}
|
|
7742
|
-
)
|
|
7743
|
-
] })
|
|
7744
|
-
] }),
|
|
7745
|
-
/* @__PURE__ */ jsx(
|
|
7746
|
-
SkeletonText,
|
|
7747
|
-
{
|
|
7748
|
-
lines: contentLines,
|
|
7749
|
-
variant,
|
|
7750
|
-
animation,
|
|
7751
|
-
className: "mb-4"
|
|
7752
|
-
}
|
|
7753
|
-
),
|
|
7754
|
-
showFooter && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mt-4 pt-4 border-t border-border", children: [
|
|
7755
|
-
/* @__PURE__ */ jsx(
|
|
7756
|
-
Skeleton,
|
|
7757
|
-
{
|
|
7758
|
-
variant,
|
|
7759
|
-
animation,
|
|
7760
|
-
className: "h-4 w-1/4"
|
|
7761
|
-
}
|
|
7762
|
-
),
|
|
7763
|
-
/* @__PURE__ */ jsx(
|
|
7764
|
-
Skeleton,
|
|
7765
|
-
{
|
|
7766
|
-
variant,
|
|
7767
|
-
animation,
|
|
7768
|
-
className: "h-4 w-1/5"
|
|
7769
|
-
}
|
|
7770
|
-
)
|
|
7771
|
-
] })
|
|
7772
|
-
]
|
|
7773
|
-
}
|
|
7774
|
-
);
|
|
7775
|
-
}
|
|
7776
|
-
);
|
|
7777
|
-
SkeletonCard.displayName = "SkeletonCard";
|
|
7778
|
-
cva(
|
|
7779
|
-
"w-full",
|
|
7780
|
-
{
|
|
7781
|
-
variants: {
|
|
7782
|
-
variant: {
|
|
7783
|
-
default: "",
|
|
7784
|
-
bordered: "border rounded-lg",
|
|
7785
|
-
striped: "[&_tbody_tr:nth-child(even)]:bg-muted/50",
|
|
7786
|
-
cards: "gap-4 [&_tbody]:flex [&_tbody]:flex-col [&_tbody_tr]:rounded-lg [&_tbody_tr]:border [&_tbody_tr]:p-4"
|
|
7787
|
-
},
|
|
7788
|
-
size: {
|
|
7789
|
-
default: "",
|
|
7790
|
-
sm: "text-sm [&_th]:py-2 [&_td]:py-2",
|
|
7791
|
-
lg: "text-base [&_th]:py-4 [&_td]:py-4"
|
|
7792
|
-
},
|
|
7793
|
-
density: {
|
|
7794
|
-
default: "",
|
|
7795
|
-
compact: "[&_th]:py-1 [&_td]:py-1",
|
|
7796
|
-
comfortable: "[&_th]:py-6 [&_td]:py-6"
|
|
7797
|
-
}
|
|
7798
|
-
},
|
|
7799
|
-
defaultVariants: {
|
|
7800
|
-
variant: "default",
|
|
7801
|
-
size: "default",
|
|
7802
|
-
density: "default"
|
|
7803
|
-
}
|
|
7804
|
-
}
|
|
7805
|
-
);
|
|
7806
|
-
function DataTableLoading() {
|
|
7807
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
7808
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
7809
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-[250px]" }),
|
|
7810
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
7811
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8" }),
|
|
7812
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8" })
|
|
7813
|
-
] })
|
|
7814
|
-
] }),
|
|
7815
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border", children: [
|
|
7816
|
-
/* @__PURE__ */ jsx("div", { className: "p-4", children: /* @__PURE__ */ jsx("div", { className: "flex gap-4", children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-8 flex-1" }, i)) }) }),
|
|
7817
|
-
/* @__PURE__ */ jsx("div", { className: "p-4 space-y-2", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }, i)) })
|
|
7818
|
-
] })
|
|
7819
|
-
] });
|
|
7820
|
-
}
|
|
7821
|
-
function DataTable({
|
|
7822
|
-
columns,
|
|
7823
|
-
data,
|
|
7824
|
-
enableFiltering = true,
|
|
7825
|
-
enableSorting = true,
|
|
7826
|
-
enableColumnVisibility = true,
|
|
7827
|
-
enableRowSelection = false,
|
|
7828
|
-
enablePagination = true,
|
|
7829
|
-
pageSizeOptions = [10, 20, 30, 50, 100],
|
|
7830
|
-
defaultPageSize: defaultPageSize2 = 10,
|
|
7831
|
-
filterPlaceholder = "Filter...",
|
|
7832
|
-
filterColumn,
|
|
7833
|
-
isLoading = false,
|
|
7834
|
-
emptyMessage = "No results found.",
|
|
7835
|
-
title,
|
|
7836
|
-
description,
|
|
7837
|
-
enableExport = false,
|
|
7838
|
-
onExport,
|
|
7839
|
-
enableRefresh = false,
|
|
7840
|
-
onRefresh,
|
|
7841
|
-
toolbarActions,
|
|
7842
|
-
customFilter,
|
|
7843
|
-
onRowClick,
|
|
7844
|
-
variant,
|
|
7845
|
-
size,
|
|
7846
|
-
density,
|
|
7847
|
-
className
|
|
7848
|
-
}) {
|
|
7849
|
-
const [sorting, setSorting] = t.useState([]);
|
|
7850
|
-
const [columnFilters, setColumnFilters] = t.useState([]);
|
|
7851
|
-
const [columnVisibility, setColumnVisibility] = t.useState({});
|
|
7852
|
-
const [rowSelection, setRowSelection] = t.useState({});
|
|
7853
|
-
const [globalFilter, setGlobalFilter] = t.useState("");
|
|
7854
|
-
const table = useReactTable({
|
|
7855
|
-
data,
|
|
7856
|
-
columns,
|
|
7857
|
-
onSortingChange: enableSorting ? setSorting : void 0,
|
|
7858
|
-
onColumnFiltersChange: enableFiltering ? setColumnFilters : void 0,
|
|
7859
|
-
onColumnVisibilityChange: enableColumnVisibility ? setColumnVisibility : void 0,
|
|
7860
|
-
onRowSelectionChange: enableRowSelection ? setRowSelection : void 0,
|
|
7861
|
-
onGlobalFilterChange: enableFiltering && !filterColumn ? setGlobalFilter : void 0,
|
|
7862
|
-
getCoreRowModel: getCoreRowModel(),
|
|
7863
|
-
getPaginationRowModel: enablePagination ? getPaginationRowModel() : void 0,
|
|
7864
|
-
getSortedRowModel: enableSorting ? getSortedRowModel() : void 0,
|
|
7865
|
-
getFilteredRowModel: enableFiltering ? getFilteredRowModel() : void 0,
|
|
7866
|
-
getFacetedRowModel: enableFiltering ? getFacetedRowModel() : void 0,
|
|
7867
|
-
getFacetedUniqueValues: enableFiltering ? getFacetedUniqueValues() : void 0,
|
|
7868
|
-
state: {
|
|
7869
|
-
sorting,
|
|
7870
|
-
columnFilters,
|
|
7871
|
-
columnVisibility,
|
|
7872
|
-
rowSelection,
|
|
7873
|
-
globalFilter
|
|
7874
|
-
},
|
|
7875
|
-
initialState: {
|
|
7876
|
-
pagination: {
|
|
7877
|
-
pageSize: defaultPageSize2
|
|
7878
|
-
}
|
|
7879
|
-
}
|
|
7880
|
-
});
|
|
7881
|
-
if (isLoading) {
|
|
7882
|
-
return /* @__PURE__ */ jsx(DataTableLoading, {});
|
|
7883
|
-
}
|
|
7884
|
-
const selectedRows = table.getFilteredSelectedRowModel().rows;
|
|
7885
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("moonui-theme", "space-y-4", className), children: [
|
|
7886
|
-
(title || description) && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
7887
|
-
title && /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: title }),
|
|
7888
|
-
description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description })
|
|
7889
|
-
] }),
|
|
7890
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
7891
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 max-w-sm", children: enableFiltering && /* @__PURE__ */ jsx(Fragment, { children: customFilter || /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
7892
|
-
/* @__PURE__ */ jsx(Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
7893
|
-
/* @__PURE__ */ jsx(
|
|
7894
|
-
Input,
|
|
7895
|
-
{
|
|
7896
|
-
placeholder: filterPlaceholder,
|
|
7897
|
-
value: filterColumn ? table.getColumn(filterColumn)?.getFilterValue() ?? "" : globalFilter,
|
|
7898
|
-
onChange: (event) => {
|
|
7899
|
-
const value = event.target.value;
|
|
7900
|
-
if (filterColumn) {
|
|
7901
|
-
table.getColumn(filterColumn)?.setFilterValue(value);
|
|
7902
|
-
} else {
|
|
7903
|
-
setGlobalFilter(value);
|
|
7904
|
-
}
|
|
7905
|
-
},
|
|
7906
|
-
className: "pl-8"
|
|
7907
|
-
}
|
|
7908
|
-
),
|
|
7909
|
-
(filterColumn && table.getColumn(filterColumn)?.getFilterValue() || !filterColumn && globalFilter) && /* @__PURE__ */ jsx(
|
|
7910
|
-
Button,
|
|
7911
|
-
{
|
|
7912
|
-
variant: "ghost",
|
|
7913
|
-
size: "sm",
|
|
7914
|
-
className: "absolute right-0 top-0 h-full px-2",
|
|
7915
|
-
onClick: () => {
|
|
7916
|
-
if (filterColumn) {
|
|
7917
|
-
table.getColumn(filterColumn)?.setFilterValue("");
|
|
7918
|
-
} else {
|
|
7919
|
-
setGlobalFilter("");
|
|
7920
|
-
}
|
|
7921
|
-
},
|
|
7922
|
-
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
7923
|
-
}
|
|
7924
|
-
)
|
|
7925
|
-
] }) }) }),
|
|
7926
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7927
|
-
enableRowSelection && selectedRows.length > 0 && /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className: "whitespace-nowrap", children: [
|
|
7928
|
-
selectedRows.length,
|
|
7929
|
-
" selected"
|
|
7930
|
-
] }),
|
|
7931
|
-
toolbarActions,
|
|
7932
|
-
enableExport && onExport && /* @__PURE__ */ jsxs(
|
|
7933
|
-
Button,
|
|
7934
|
-
{
|
|
7935
|
-
variant: "outline",
|
|
7936
|
-
size: "sm",
|
|
7937
|
-
onClick: () => onExport(table.getFilteredRowModel().rows.map((row) => row.original)),
|
|
7938
|
-
children: [
|
|
7939
|
-
/* @__PURE__ */ jsx(Download, { className: "mr-2 h-4 w-4" }),
|
|
7940
|
-
"Export"
|
|
7941
|
-
]
|
|
7942
|
-
}
|
|
7943
|
-
),
|
|
7944
|
-
enableRefresh && onRefresh && /* @__PURE__ */ jsx(
|
|
7945
|
-
Button,
|
|
7946
|
-
{
|
|
7947
|
-
variant: "outline",
|
|
7948
|
-
size: "icon",
|
|
7949
|
-
onClick: onRefresh,
|
|
7950
|
-
children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" })
|
|
7951
|
-
}
|
|
7952
|
-
),
|
|
7953
|
-
enableColumnVisibility && /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
7954
|
-
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", children: /* @__PURE__ */ jsx(Columns, { className: "h-4 w-4" }) }) }),
|
|
7955
|
-
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-[180px]", children: [
|
|
7956
|
-
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Toggle columns" }),
|
|
7957
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
7958
|
-
table.getAllColumns().filter((column) => column.getCanHide()).map((column) => {
|
|
7959
|
-
return /* @__PURE__ */ jsx(
|
|
7960
|
-
DropdownMenuCheckboxItem,
|
|
7961
|
-
{
|
|
7962
|
-
className: "capitalize",
|
|
7963
|
-
checked: column.getIsVisible(),
|
|
7964
|
-
onCheckedChange: (value) => column.toggleVisibility(!!value),
|
|
7965
|
-
children: column.id
|
|
7966
|
-
},
|
|
7967
|
-
column.id
|
|
7968
|
-
);
|
|
7969
|
-
})
|
|
7970
|
-
] })
|
|
7971
|
-
] })
|
|
7972
|
-
] })
|
|
7973
|
-
] }),
|
|
7974
|
-
/* @__PURE__ */ jsx("div", { className: cn("rounded-lg", variant === "bordered" && "border"), children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
7244
|
+
)
|
|
7245
|
+
] }) }),
|
|
7246
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
7975
7247
|
/* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { children: headerGroup.headers.map((header) => {
|
|
7976
7248
|
return /* @__PURE__ */ jsx(TableHead, { children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs(
|
|
7977
7249
|
"div",
|
|
@@ -7991,27 +7263,17 @@ function DataTable({
|
|
|
7991
7263
|
}
|
|
7992
7264
|
) }, header.id);
|
|
7993
7265
|
}) }, headerGroup.id)) }),
|
|
7994
|
-
/* @__PURE__ */ jsx(TableBody, { children: table.getRowModel().rows?.length ?
|
|
7995
|
-
|
|
7266
|
+
/* @__PURE__ */ jsx(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(
|
|
7267
|
+
TableRow,
|
|
7996
7268
|
{
|
|
7997
|
-
initial: { opacity: 0, y: -10 },
|
|
7998
|
-
animate: { opacity: 1, y: 0 },
|
|
7999
|
-
exit: { opacity: 0, y: 10 },
|
|
8000
|
-
transition: { duration: 0.2 },
|
|
8001
7269
|
"data-state": row.getIsSelected() && "selected",
|
|
8002
|
-
className: cn(
|
|
8003
|
-
"border-b transition-colors",
|
|
8004
|
-
onRowClick && "cursor-pointer hover:bg-muted/50",
|
|
8005
|
-
row.getIsSelected() && "bg-muted"
|
|
8006
|
-
),
|
|
8007
|
-
onClick: () => onRowClick?.(row.original),
|
|
8008
7270
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, { children: flexRender(
|
|
8009
7271
|
cell.column.columnDef.cell,
|
|
8010
7272
|
cell.getContext()
|
|
8011
7273
|
) }, cell.id))
|
|
8012
7274
|
},
|
|
8013
7275
|
row.id
|
|
8014
|
-
))
|
|
7276
|
+
)) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
|
|
8015
7277
|
TableCell,
|
|
8016
7278
|
{
|
|
8017
7279
|
colSpan: columns.length,
|
|
@@ -8020,89 +7282,45 @@ function DataTable({
|
|
|
8020
7282
|
}
|
|
8021
7283
|
) }) })
|
|
8022
7284
|
] }) }),
|
|
8023
|
-
enablePagination && /* @__PURE__ */ jsxs("div", { className: "flex
|
|
8024
|
-
/* @__PURE__ */ jsxs("div", { className: "flex
|
|
8025
|
-
|
|
8026
|
-
|
|
7285
|
+
enablePagination && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end space-x-2", children: [
|
|
7286
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 text-sm text-muted-foreground", children: [
|
|
7287
|
+
table.getFilteredRowModel().rows.length,
|
|
7288
|
+
" row(s)"
|
|
7289
|
+
] }),
|
|
7290
|
+
/* @__PURE__ */ jsxs("div", { className: "space-x-2", children: [
|
|
7291
|
+
/* @__PURE__ */ jsxs(
|
|
7292
|
+
Button,
|
|
7293
|
+
{
|
|
7294
|
+
variant: "outline",
|
|
7295
|
+
size: "sm",
|
|
7296
|
+
onClick: () => table.previousPage(),
|
|
7297
|
+
disabled: !table.getCanPreviousPage(),
|
|
7298
|
+
children: [
|
|
7299
|
+
/* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
7300
|
+
"Previous"
|
|
7301
|
+
]
|
|
7302
|
+
}
|
|
7303
|
+
),
|
|
7304
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm", children: [
|
|
7305
|
+
"Page ",
|
|
7306
|
+
table.getState().pagination.pageIndex + 1,
|
|
8027
7307
|
" of",
|
|
8028
7308
|
" ",
|
|
8029
|
-
table.
|
|
8030
|
-
" row(s)"
|
|
8031
|
-
] }),
|
|
8032
|
-
enableRowSelection && selectedRows.length > 0 && /* @__PURE__ */ jsxs("span", { children: [
|
|
8033
|
-
"\u2022 ",
|
|
8034
|
-
selectedRows.length,
|
|
8035
|
-
" selected"
|
|
8036
|
-
] })
|
|
8037
|
-
] }),
|
|
8038
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8039
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8040
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm", children: "Rows per page" }),
|
|
8041
|
-
/* @__PURE__ */ jsxs(
|
|
8042
|
-
Select,
|
|
8043
|
-
{
|
|
8044
|
-
value: `${table.getState().pagination.pageSize}`,
|
|
8045
|
-
onValueChange: (value) => {
|
|
8046
|
-
table.setPageSize(Number(value));
|
|
8047
|
-
},
|
|
8048
|
-
children: [
|
|
8049
|
-
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
|
|
8050
|
-
/* @__PURE__ */ jsx(SelectContent, { side: "top", children: pageSizeOptions.map((pageSize) => /* @__PURE__ */ jsx(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize)) })
|
|
8051
|
-
]
|
|
8052
|
-
}
|
|
8053
|
-
)
|
|
7309
|
+
table.getPageCount()
|
|
8054
7310
|
] }),
|
|
8055
|
-
/* @__PURE__ */ jsxs(
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
{
|
|
8069
|
-
variant: "outline",
|
|
8070
|
-
size: "icon",
|
|
8071
|
-
onClick: () => table.previousPage(),
|
|
8072
|
-
disabled: !table.getCanPreviousPage(),
|
|
8073
|
-
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
|
|
8074
|
-
}
|
|
8075
|
-
),
|
|
8076
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm", children: [
|
|
8077
|
-
/* @__PURE__ */ jsx("span", { children: "Page" }),
|
|
8078
|
-
/* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
|
|
8079
|
-
table.getState().pagination.pageIndex + 1,
|
|
8080
|
-
" of",
|
|
8081
|
-
" ",
|
|
8082
|
-
table.getPageCount()
|
|
8083
|
-
] })
|
|
8084
|
-
] }),
|
|
8085
|
-
/* @__PURE__ */ jsx(
|
|
8086
|
-
Button,
|
|
8087
|
-
{
|
|
8088
|
-
variant: "outline",
|
|
8089
|
-
size: "icon",
|
|
8090
|
-
onClick: () => table.nextPage(),
|
|
8091
|
-
disabled: !table.getCanNextPage(),
|
|
8092
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
8093
|
-
}
|
|
8094
|
-
),
|
|
8095
|
-
/* @__PURE__ */ jsx(
|
|
8096
|
-
Button,
|
|
8097
|
-
{
|
|
8098
|
-
variant: "outline",
|
|
8099
|
-
size: "icon",
|
|
8100
|
-
onClick: () => table.setPageIndex(table.getPageCount() - 1),
|
|
8101
|
-
disabled: !table.getCanNextPage(),
|
|
8102
|
-
children: /* @__PURE__ */ jsx(ChevronsRight, { className: "h-4 w-4" })
|
|
8103
|
-
}
|
|
8104
|
-
)
|
|
8105
|
-
] })
|
|
7311
|
+
/* @__PURE__ */ jsxs(
|
|
7312
|
+
Button,
|
|
7313
|
+
{
|
|
7314
|
+
variant: "outline",
|
|
7315
|
+
size: "sm",
|
|
7316
|
+
onClick: () => table.nextPage(),
|
|
7317
|
+
disabled: !table.getCanNextPage(),
|
|
7318
|
+
children: [
|
|
7319
|
+
"Next",
|
|
7320
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
7321
|
+
]
|
|
7322
|
+
}
|
|
7323
|
+
)
|
|
8106
7324
|
] })
|
|
8107
7325
|
] })
|
|
8108
7326
|
] });
|
|
@@ -8121,13 +7339,6 @@ function createSortableHeader(label) {
|
|
|
8121
7339
|
}
|
|
8122
7340
|
);
|
|
8123
7341
|
}
|
|
8124
|
-
function createFilterableColumn(accessorKey, header, filterFn) {
|
|
8125
|
-
return {
|
|
8126
|
-
accessorKey,
|
|
8127
|
-
header: createSortableHeader(header),
|
|
8128
|
-
filterFn
|
|
8129
|
-
};
|
|
8130
|
-
}
|
|
8131
7342
|
function Calendar({
|
|
8132
7343
|
mode = "single",
|
|
8133
7344
|
selected,
|
|
@@ -8783,54 +7994,183 @@ function DraggableList({
|
|
|
8783
7994
|
renderItem,
|
|
8784
7995
|
keyExtractor,
|
|
8785
7996
|
className,
|
|
8786
|
-
disabled = false
|
|
8787
|
-
}) {
|
|
8788
|
-
const [draggedIndex, setDraggedIndex] = t.useState(null);
|
|
8789
|
-
const handleDragStart = (e, index) => {
|
|
8790
|
-
if (disabled)
|
|
8791
|
-
return;
|
|
8792
|
-
setDraggedIndex(index);
|
|
8793
|
-
e.dataTransfer.effectAllowed = "move";
|
|
8794
|
-
};
|
|
8795
|
-
const handleDragOver = (e) => {
|
|
8796
|
-
e.preventDefault();
|
|
8797
|
-
e.dataTransfer.dropEffect = "move";
|
|
8798
|
-
};
|
|
8799
|
-
const handleDrop = (e, dropIndex) => {
|
|
8800
|
-
e.preventDefault();
|
|
8801
|
-
if (disabled || draggedIndex === null || draggedIndex === dropIndex) {
|
|
8802
|
-
setDraggedIndex(null);
|
|
8803
|
-
return;
|
|
8804
|
-
}
|
|
8805
|
-
const newItems = [...items];
|
|
8806
|
-
const draggedItem = newItems[draggedIndex];
|
|
8807
|
-
newItems.splice(draggedIndex, 1);
|
|
8808
|
-
newItems.splice(dropIndex, 0, draggedItem);
|
|
8809
|
-
onReorder(newItems);
|
|
8810
|
-
setDraggedIndex(null);
|
|
8811
|
-
};
|
|
8812
|
-
const handleDragEnd = () => {
|
|
8813
|
-
setDraggedIndex(null);
|
|
8814
|
-
};
|
|
8815
|
-
return /* @__PURE__ */ jsx("div", { className: cn("moonui-theme", "space-y-2", className), children: items.map((item, index) => /* @__PURE__ */ jsx(
|
|
8816
|
-
"div",
|
|
7997
|
+
disabled = false
|
|
7998
|
+
}) {
|
|
7999
|
+
const [draggedIndex, setDraggedIndex] = t.useState(null);
|
|
8000
|
+
const handleDragStart = (e, index) => {
|
|
8001
|
+
if (disabled)
|
|
8002
|
+
return;
|
|
8003
|
+
setDraggedIndex(index);
|
|
8004
|
+
e.dataTransfer.effectAllowed = "move";
|
|
8005
|
+
};
|
|
8006
|
+
const handleDragOver = (e) => {
|
|
8007
|
+
e.preventDefault();
|
|
8008
|
+
e.dataTransfer.dropEffect = "move";
|
|
8009
|
+
};
|
|
8010
|
+
const handleDrop = (e, dropIndex) => {
|
|
8011
|
+
e.preventDefault();
|
|
8012
|
+
if (disabled || draggedIndex === null || draggedIndex === dropIndex) {
|
|
8013
|
+
setDraggedIndex(null);
|
|
8014
|
+
return;
|
|
8015
|
+
}
|
|
8016
|
+
const newItems = [...items];
|
|
8017
|
+
const draggedItem = newItems[draggedIndex];
|
|
8018
|
+
newItems.splice(draggedIndex, 1);
|
|
8019
|
+
newItems.splice(dropIndex, 0, draggedItem);
|
|
8020
|
+
onReorder(newItems);
|
|
8021
|
+
setDraggedIndex(null);
|
|
8022
|
+
};
|
|
8023
|
+
const handleDragEnd = () => {
|
|
8024
|
+
setDraggedIndex(null);
|
|
8025
|
+
};
|
|
8026
|
+
return /* @__PURE__ */ jsx("div", { className: cn("moonui-theme", "space-y-2", className), children: items.map((item, index) => /* @__PURE__ */ jsx(
|
|
8027
|
+
"div",
|
|
8028
|
+
{
|
|
8029
|
+
draggable: !disabled,
|
|
8030
|
+
onDragStart: (e) => handleDragStart(e, index),
|
|
8031
|
+
onDragOver: handleDragOver,
|
|
8032
|
+
onDrop: (e) => handleDrop(e, index),
|
|
8033
|
+
onDragEnd: handleDragEnd,
|
|
8034
|
+
className: cn(
|
|
8035
|
+
"transition-opacity duration-200",
|
|
8036
|
+
!disabled && "cursor-move hover:opacity-80",
|
|
8037
|
+
draggedIndex === index && "opacity-50",
|
|
8038
|
+
disabled && "cursor-not-allowed"
|
|
8039
|
+
),
|
|
8040
|
+
children: renderItem(item, index)
|
|
8041
|
+
},
|
|
8042
|
+
keyExtractor(item)
|
|
8043
|
+
)) });
|
|
8044
|
+
}
|
|
8045
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
8046
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
8047
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
8048
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
8049
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
8050
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
8051
|
+
var DropdownMenuSubTrigger = t.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
8052
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
8053
|
+
{
|
|
8054
|
+
ref,
|
|
8055
|
+
className: cn(
|
|
8056
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
8057
|
+
inset && "pl-8",
|
|
8058
|
+
className
|
|
8059
|
+
),
|
|
8060
|
+
...props,
|
|
8061
|
+
children: [
|
|
8062
|
+
children,
|
|
8063
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
|
|
8064
|
+
]
|
|
8065
|
+
}
|
|
8066
|
+
));
|
|
8067
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
8068
|
+
var DropdownMenuSubContent = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8069
|
+
DropdownMenuPrimitive.SubContent,
|
|
8070
|
+
{
|
|
8071
|
+
ref,
|
|
8072
|
+
className: cn(
|
|
8073
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
8074
|
+
className
|
|
8075
|
+
),
|
|
8076
|
+
...props
|
|
8077
|
+
}
|
|
8078
|
+
));
|
|
8079
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
8080
|
+
var DropdownMenuContent = t.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
8081
|
+
DropdownMenuPrimitive.Content,
|
|
8082
|
+
{
|
|
8083
|
+
ref,
|
|
8084
|
+
sideOffset,
|
|
8085
|
+
className: cn(
|
|
8086
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
8087
|
+
className
|
|
8088
|
+
),
|
|
8089
|
+
...props
|
|
8090
|
+
}
|
|
8091
|
+
) }));
|
|
8092
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
8093
|
+
var DropdownMenuItem = t.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8094
|
+
DropdownMenuPrimitive.Item,
|
|
8095
|
+
{
|
|
8096
|
+
ref,
|
|
8097
|
+
className: cn(
|
|
8098
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
8099
|
+
inset && "pl-8",
|
|
8100
|
+
className
|
|
8101
|
+
),
|
|
8102
|
+
...props
|
|
8103
|
+
}
|
|
8104
|
+
));
|
|
8105
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
8106
|
+
var DropdownMenuCheckboxItem = t.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
8107
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
8108
|
+
{
|
|
8109
|
+
ref,
|
|
8110
|
+
className: cn(
|
|
8111
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
8112
|
+
className
|
|
8113
|
+
),
|
|
8114
|
+
checked,
|
|
8115
|
+
...props,
|
|
8116
|
+
children: [
|
|
8117
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
8118
|
+
children
|
|
8119
|
+
]
|
|
8120
|
+
}
|
|
8121
|
+
));
|
|
8122
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
8123
|
+
var DropdownMenuRadioItem = t.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
8124
|
+
DropdownMenuPrimitive.RadioItem,
|
|
8125
|
+
{
|
|
8126
|
+
ref,
|
|
8127
|
+
className: cn(
|
|
8128
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
8129
|
+
className
|
|
8130
|
+
),
|
|
8131
|
+
...props,
|
|
8132
|
+
children: [
|
|
8133
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
8134
|
+
children
|
|
8135
|
+
]
|
|
8136
|
+
}
|
|
8137
|
+
));
|
|
8138
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
8139
|
+
var DropdownMenuLabel = t.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8140
|
+
DropdownMenuPrimitive.Label,
|
|
8141
|
+
{
|
|
8142
|
+
ref,
|
|
8143
|
+
className: cn(
|
|
8144
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
8145
|
+
inset && "pl-8",
|
|
8146
|
+
className
|
|
8147
|
+
),
|
|
8148
|
+
...props
|
|
8149
|
+
}
|
|
8150
|
+
));
|
|
8151
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
8152
|
+
var DropdownMenuSeparator = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8153
|
+
DropdownMenuPrimitive.Separator,
|
|
8154
|
+
{
|
|
8155
|
+
ref,
|
|
8156
|
+
className: cn("moonui-theme", "-mx-1 my-1 h-px bg-muted", className),
|
|
8157
|
+
...props
|
|
8158
|
+
}
|
|
8159
|
+
));
|
|
8160
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
8161
|
+
var DropdownMenuShortcut = ({
|
|
8162
|
+
className,
|
|
8163
|
+
...props
|
|
8164
|
+
}) => {
|
|
8165
|
+
return /* @__PURE__ */ jsx(
|
|
8166
|
+
"span",
|
|
8817
8167
|
{
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
"transition-opacity duration-200",
|
|
8825
|
-
!disabled && "cursor-move hover:opacity-80",
|
|
8826
|
-
draggedIndex === index && "opacity-50",
|
|
8827
|
-
disabled && "cursor-not-allowed"
|
|
8828
|
-
),
|
|
8829
|
-
children: renderItem(item, index)
|
|
8830
|
-
},
|
|
8831
|
-
keyExtractor(item)
|
|
8832
|
-
)) });
|
|
8833
|
-
}
|
|
8168
|
+
className: cn("moonui-theme", "ml-auto text-xs tracking-widest opacity-60", className),
|
|
8169
|
+
...props
|
|
8170
|
+
}
|
|
8171
|
+
);
|
|
8172
|
+
};
|
|
8173
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
8834
8174
|
var progressVariants = cva(
|
|
8835
8175
|
"relative overflow-hidden bg-muted",
|
|
8836
8176
|
{
|
|
@@ -9896,83 +9236,241 @@ var PaginationContent = t.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
9896
9236
|
"ul",
|
|
9897
9237
|
{
|
|
9898
9238
|
ref,
|
|
9899
|
-
className: cn("moonui-theme", "flex flex-row items-center gap-1", className),
|
|
9239
|
+
className: cn("moonui-theme", "flex flex-row items-center gap-1", className),
|
|
9240
|
+
...props
|
|
9241
|
+
}
|
|
9242
|
+
));
|
|
9243
|
+
PaginationContent.displayName = "PaginationContent";
|
|
9244
|
+
var PaginationItem = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("li", { ref, className: cn("moonui-theme", "", className), ...props }));
|
|
9245
|
+
PaginationItem.displayName = "PaginationItem";
|
|
9246
|
+
var PaginationLink = ({
|
|
9247
|
+
className,
|
|
9248
|
+
isActive,
|
|
9249
|
+
size = "icon",
|
|
9250
|
+
...props
|
|
9251
|
+
}) => /* @__PURE__ */ jsx(
|
|
9252
|
+
"a",
|
|
9253
|
+
{
|
|
9254
|
+
"aria-current": isActive ? "page" : void 0,
|
|
9255
|
+
className: cn(
|
|
9256
|
+
buttonVariants({
|
|
9257
|
+
variant: isActive ? "outline" : "ghost",
|
|
9258
|
+
size
|
|
9259
|
+
}),
|
|
9260
|
+
className
|
|
9261
|
+
),
|
|
9262
|
+
...props
|
|
9263
|
+
}
|
|
9264
|
+
);
|
|
9265
|
+
PaginationLink.displayName = "PaginationLink";
|
|
9266
|
+
var PaginationPrevious = ({
|
|
9267
|
+
className,
|
|
9268
|
+
...props
|
|
9269
|
+
}) => /* @__PURE__ */ jsxs(
|
|
9270
|
+
PaginationLink,
|
|
9271
|
+
{
|
|
9272
|
+
"aria-label": "Go to previous page",
|
|
9273
|
+
size: "md",
|
|
9274
|
+
className: cn("moonui-theme", "gap-1 pl-2.5", className),
|
|
9275
|
+
...props,
|
|
9276
|
+
children: [
|
|
9277
|
+
/* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
9278
|
+
/* @__PURE__ */ jsx("span", { children: "Previous" })
|
|
9279
|
+
]
|
|
9280
|
+
}
|
|
9281
|
+
);
|
|
9282
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
9283
|
+
var PaginationNext = ({
|
|
9284
|
+
className,
|
|
9285
|
+
...props
|
|
9286
|
+
}) => /* @__PURE__ */ jsxs(
|
|
9287
|
+
PaginationLink,
|
|
9288
|
+
{
|
|
9289
|
+
"aria-label": "Go to next page",
|
|
9290
|
+
size: "md",
|
|
9291
|
+
className: cn("moonui-theme", "gap-1 pr-2.5", className),
|
|
9292
|
+
...props,
|
|
9293
|
+
children: [
|
|
9294
|
+
/* @__PURE__ */ jsx("span", { children: "Next" }),
|
|
9295
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
9296
|
+
]
|
|
9297
|
+
}
|
|
9298
|
+
);
|
|
9299
|
+
PaginationNext.displayName = "PaginationNext";
|
|
9300
|
+
var PaginationEllipsis = ({
|
|
9301
|
+
className,
|
|
9302
|
+
...props
|
|
9303
|
+
}) => /* @__PURE__ */ jsxs(
|
|
9304
|
+
"span",
|
|
9305
|
+
{
|
|
9306
|
+
"aria-hidden": true,
|
|
9307
|
+
className: cn("moonui-theme", "flex h-9 w-9 items-center justify-center", className),
|
|
9308
|
+
...props,
|
|
9309
|
+
children: [
|
|
9310
|
+
/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }),
|
|
9311
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
|
|
9312
|
+
]
|
|
9313
|
+
}
|
|
9314
|
+
);
|
|
9315
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
9316
|
+
var Select = SelectPrimitive.Root;
|
|
9317
|
+
Select.displayName = "Select";
|
|
9318
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
9319
|
+
var SelectValue = SelectPrimitive.Value;
|
|
9320
|
+
var SelectTrigger = t.forwardRef(({ className, children, variant = "standard", size = "md", error, success, loading, leftIcon, rightIcon, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
9321
|
+
SelectPrimitive.Trigger,
|
|
9322
|
+
{
|
|
9323
|
+
ref,
|
|
9324
|
+
className: cn(
|
|
9325
|
+
/* Base styles */
|
|
9326
|
+
"flex w-full items-center justify-between gap-1 rounded-md transition-all duration-200",
|
|
9327
|
+
"disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
9328
|
+
"focus-visible:outline-none",
|
|
9329
|
+
/* Error state */
|
|
9330
|
+
error && "border-error focus-visible:ring-error/30 focus-visible:border-error",
|
|
9331
|
+
/* Success state */
|
|
9332
|
+
success && "border-success focus-visible:ring-success/30 focus-visible:border-success",
|
|
9333
|
+
/* Size variants */
|
|
9334
|
+
size === "sm" && "h-8 text-xs px-2",
|
|
9335
|
+
size === "md" && "h-10 text-sm px-3",
|
|
9336
|
+
size === "lg" && "h-12 text-base px-4",
|
|
9337
|
+
/* Visual variants */
|
|
9338
|
+
variant === "standard" && "border border-gray-300 dark:border-gray-700 bg-background dark:bg-gray-900 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50 focus-visible:border-primary dark:focus-visible:border-primary",
|
|
9339
|
+
variant === "outline" && "border border-gray-300 dark:border-gray-700 bg-transparent hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50 focus-visible:border-primary dark:focus-visible:border-primary",
|
|
9340
|
+
variant === "ghost" && "border-none bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50",
|
|
9341
|
+
variant === "underline" && "border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary",
|
|
9342
|
+
className
|
|
9343
|
+
),
|
|
9344
|
+
...props,
|
|
9345
|
+
disabled: props.disabled || loading,
|
|
9346
|
+
"data-error": error ? true : void 0,
|
|
9347
|
+
"data-success": success ? true : void 0,
|
|
9348
|
+
"data-loading": loading ? true : void 0,
|
|
9349
|
+
children: [
|
|
9350
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center flex-1 gap-2", children: [
|
|
9351
|
+
leftIcon && /* @__PURE__ */ jsx("span", { className: "flex items-center justify-center text-gray-500 dark:text-gray-400", children: leftIcon }),
|
|
9352
|
+
loading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9353
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground dark:text-gray-400" }),
|
|
9354
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground dark:text-gray-400", children: "Loading..." })
|
|
9355
|
+
] }) : children
|
|
9356
|
+
] }),
|
|
9357
|
+
!loading && /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: rightIcon ? /* @__PURE__ */ jsx("span", { className: "opacity-60", children: rightIcon }) : /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-60 transition-transform duration-200 ease-out group-data-[state=open]:rotate-180" }) })
|
|
9358
|
+
]
|
|
9359
|
+
}
|
|
9360
|
+
));
|
|
9361
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
9362
|
+
var SelectScrollUpButton = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9363
|
+
SelectPrimitive.ScrollUpButton,
|
|
9364
|
+
{
|
|
9365
|
+
ref,
|
|
9366
|
+
className: cn(
|
|
9367
|
+
"flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",
|
|
9368
|
+
className
|
|
9369
|
+
),
|
|
9370
|
+
...props,
|
|
9371
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
|
|
9372
|
+
}
|
|
9373
|
+
));
|
|
9374
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
9375
|
+
var SelectScrollDownButton = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9376
|
+
SelectPrimitive.ScrollDownButton,
|
|
9377
|
+
{
|
|
9378
|
+
ref,
|
|
9379
|
+
className: cn(
|
|
9380
|
+
"flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",
|
|
9381
|
+
className
|
|
9382
|
+
),
|
|
9383
|
+
...props,
|
|
9384
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
9385
|
+
}
|
|
9386
|
+
));
|
|
9387
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
9388
|
+
var SelectContent = t.forwardRef(({ className, children, position = "popper", side = "bottom", sideOffset = 4, align = "start", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
9389
|
+
SelectPrimitive.Content,
|
|
9390
|
+
{
|
|
9391
|
+
ref,
|
|
9392
|
+
side,
|
|
9393
|
+
sideOffset,
|
|
9394
|
+
align,
|
|
9395
|
+
avoidCollisions: false,
|
|
9396
|
+
className: cn(
|
|
9397
|
+
[
|
|
9398
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden",
|
|
9399
|
+
"rounded-md border border-gray-200 dark:border-gray-700",
|
|
9400
|
+
"bg-white dark:bg-gray-900 text-foreground",
|
|
9401
|
+
"shadow-lg dark:shadow-gray-900/20",
|
|
9402
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
9403
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
9404
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
9405
|
+
"data-[state=open]:duration-150"
|
|
9406
|
+
],
|
|
9407
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
9408
|
+
className
|
|
9409
|
+
),
|
|
9410
|
+
position,
|
|
9411
|
+
...props,
|
|
9412
|
+
children: [
|
|
9413
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
9414
|
+
/* @__PURE__ */ jsx(
|
|
9415
|
+
SelectPrimitive.Viewport,
|
|
9416
|
+
{
|
|
9417
|
+
className: cn(
|
|
9418
|
+
"p-1",
|
|
9419
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
9420
|
+
),
|
|
9421
|
+
children
|
|
9422
|
+
}
|
|
9423
|
+
),
|
|
9424
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
9425
|
+
]
|
|
9426
|
+
}
|
|
9427
|
+
) }));
|
|
9428
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
9429
|
+
var SelectLabel = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9430
|
+
SelectPrimitive.Label,
|
|
9431
|
+
{
|
|
9432
|
+
ref,
|
|
9433
|
+
className: cn("moonui-theme", "py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
9900
9434
|
...props
|
|
9901
9435
|
}
|
|
9902
9436
|
));
|
|
9903
|
-
|
|
9904
|
-
var
|
|
9905
|
-
|
|
9906
|
-
var PaginationLink = ({
|
|
9907
|
-
className,
|
|
9908
|
-
isActive,
|
|
9909
|
-
size = "icon",
|
|
9910
|
-
...props
|
|
9911
|
-
}) => /* @__PURE__ */ jsx(
|
|
9912
|
-
"a",
|
|
9437
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
9438
|
+
var SelectItem = t.forwardRef(({ className, children, variant = "default", size = "md", rightIcon, customIndicator, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
9439
|
+
SelectPrimitive.Item,
|
|
9913
9440
|
{
|
|
9914
|
-
|
|
9441
|
+
ref,
|
|
9915
9442
|
className: cn(
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9443
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
9444
|
+
/* Size variants */
|
|
9445
|
+
size === "sm" && "py-1 pl-7 pr-2 text-xs",
|
|
9446
|
+
size === "md" && "py-1.5 pl-8 pr-2 text-sm",
|
|
9447
|
+
size === "lg" && "py-2 pl-9 pr-3 text-base",
|
|
9448
|
+
/* Color variants */
|
|
9449
|
+
variant === "default" && "focus:bg-accent focus:text-accent-foreground dark:focus:bg-gray-700 dark:focus:text-gray-100",
|
|
9450
|
+
variant === "subtle" && "focus:bg-gray-100 dark:focus:bg-gray-800 focus:text-foreground dark:focus:text-gray-200",
|
|
9451
|
+
variant === "destructive" && "text-error dark:text-red-400 focus:bg-error/10 dark:focus:bg-red-900/20 focus:text-error dark:focus:text-red-300",
|
|
9452
|
+
variant === "success" && "text-success dark:text-green-400 focus:bg-success/10 dark:focus:bg-green-900/20 focus:text-success dark:focus:text-green-300",
|
|
9453
|
+
variant === "warning" && "text-warning dark:text-yellow-400 focus:bg-warning/10 dark:focus:bg-yellow-900/20 focus:text-warning dark:focus:text-yellow-300",
|
|
9920
9454
|
className
|
|
9921
9455
|
),
|
|
9922
|
-
...props
|
|
9923
|
-
}
|
|
9924
|
-
);
|
|
9925
|
-
PaginationLink.displayName = "PaginationLink";
|
|
9926
|
-
var PaginationPrevious = ({
|
|
9927
|
-
className,
|
|
9928
|
-
...props
|
|
9929
|
-
}) => /* @__PURE__ */ jsxs(
|
|
9930
|
-
PaginationLink,
|
|
9931
|
-
{
|
|
9932
|
-
"aria-label": "Go to previous page",
|
|
9933
|
-
size: "md",
|
|
9934
|
-
className: cn("moonui-theme", "gap-1 pl-2.5", className),
|
|
9935
|
-
...props,
|
|
9936
|
-
children: [
|
|
9937
|
-
/* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
9938
|
-
/* @__PURE__ */ jsx("span", { children: "Previous" })
|
|
9939
|
-
]
|
|
9940
|
-
}
|
|
9941
|
-
);
|
|
9942
|
-
PaginationPrevious.displayName = "PaginationPrevious";
|
|
9943
|
-
var PaginationNext = ({
|
|
9944
|
-
className,
|
|
9945
|
-
...props
|
|
9946
|
-
}) => /* @__PURE__ */ jsxs(
|
|
9947
|
-
PaginationLink,
|
|
9948
|
-
{
|
|
9949
|
-
"aria-label": "Go to next page",
|
|
9950
|
-
size: "md",
|
|
9951
|
-
className: cn("moonui-theme", "gap-1 pr-2.5", className),
|
|
9952
9456
|
...props,
|
|
9953
9457
|
children: [
|
|
9954
|
-
/* @__PURE__ */ jsx("span", { children: "
|
|
9955
|
-
/* @__PURE__ */ jsx(
|
|
9458
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: customIndicator || /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
|
|
9459
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children }),
|
|
9460
|
+
rightIcon && /* @__PURE__ */ jsx("span", { className: "ml-auto pl-2 opacity-70", children: rightIcon })
|
|
9956
9461
|
]
|
|
9957
9462
|
}
|
|
9958
|
-
);
|
|
9959
|
-
|
|
9960
|
-
var
|
|
9961
|
-
|
|
9962
|
-
...props
|
|
9963
|
-
}) => /* @__PURE__ */ jsxs(
|
|
9964
|
-
"span",
|
|
9463
|
+
));
|
|
9464
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
9465
|
+
var SelectSeparator = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9466
|
+
SelectPrimitive.Separator,
|
|
9965
9467
|
{
|
|
9966
|
-
|
|
9967
|
-
className: cn("moonui-theme", "
|
|
9968
|
-
...props
|
|
9969
|
-
children: [
|
|
9970
|
-
/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }),
|
|
9971
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
|
|
9972
|
-
]
|
|
9468
|
+
ref,
|
|
9469
|
+
className: cn("moonui-theme", "-mx-1 my-1 h-px bg-muted dark:bg-gray-700", className),
|
|
9470
|
+
...props
|
|
9973
9471
|
}
|
|
9974
|
-
);
|
|
9975
|
-
|
|
9472
|
+
));
|
|
9473
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
9976
9474
|
var countryCodes = [
|
|
9977
9475
|
{ code: "+1", country: "US", flag: "\u{1F1FA}\u{1F1F8}", name: "United States" },
|
|
9978
9476
|
{ code: "+44", country: "GB", flag: "\u{1F1EC}\u{1F1E7}", name: "United Kingdom" },
|
|
@@ -12052,106 +11550,365 @@ var SimpleEditor = t__default.forwardRef(
|
|
|
12052
11550
|
},
|
|
12053
11551
|
disabled
|
|
12054
11552
|
}
|
|
12055
|
-
)
|
|
12056
|
-
] })
|
|
12057
|
-
]
|
|
11553
|
+
)
|
|
11554
|
+
] })
|
|
11555
|
+
]
|
|
11556
|
+
}
|
|
11557
|
+
) });
|
|
11558
|
+
return /* @__PURE__ */ jsxs(
|
|
11559
|
+
"div",
|
|
11560
|
+
{
|
|
11561
|
+
ref,
|
|
11562
|
+
className: cn(
|
|
11563
|
+
"border border-gray-200 dark:border-zinc-700 rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-ring focus-within:border-transparent",
|
|
11564
|
+
disabled && "opacity-50 cursor-not-allowed",
|
|
11565
|
+
className
|
|
11566
|
+
),
|
|
11567
|
+
...props,
|
|
11568
|
+
children: [
|
|
11569
|
+
toolbar,
|
|
11570
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
11571
|
+
isPreview ? /* @__PURE__ */ jsx(
|
|
11572
|
+
motion.div,
|
|
11573
|
+
{
|
|
11574
|
+
initial: { opacity: 0 },
|
|
11575
|
+
animate: { opacity: 1 },
|
|
11576
|
+
className: "bg-slate-50 dark:bg-zinc-900/95",
|
|
11577
|
+
style: { minHeight, maxHeight, overflow: "auto" },
|
|
11578
|
+
children: /* @__PURE__ */ jsx(
|
|
11579
|
+
"textarea",
|
|
11580
|
+
{
|
|
11581
|
+
ref: sourceRef,
|
|
11582
|
+
value: sourceContent,
|
|
11583
|
+
onChange: (e) => setSourceContent(e.target.value),
|
|
11584
|
+
className: "w-full h-full bg-transparent p-4 font-mono text-sm text-gray-900 dark:text-gray-100 resize-none focus:outline-none",
|
|
11585
|
+
style: { minHeight: minHeight - 32 },
|
|
11586
|
+
disabled,
|
|
11587
|
+
placeholder: "HTML source code..."
|
|
11588
|
+
}
|
|
11589
|
+
)
|
|
11590
|
+
}
|
|
11591
|
+
) : /* @__PURE__ */ jsx(
|
|
11592
|
+
motion.div,
|
|
11593
|
+
{
|
|
11594
|
+
ref: editorRef,
|
|
11595
|
+
contentEditable: !disabled,
|
|
11596
|
+
suppressContentEditableWarning: true,
|
|
11597
|
+
className: cn(
|
|
11598
|
+
"p-4 outline-none prose prose-sm dark:prose-invert max-w-none overflow-y-auto",
|
|
11599
|
+
"bg-slate-50 dark:bg-zinc-900/95",
|
|
11600
|
+
"text-gray-900 dark:text-gray-100",
|
|
11601
|
+
"focus:ring-0",
|
|
11602
|
+
"[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4",
|
|
11603
|
+
"[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mb-3",
|
|
11604
|
+
"[&_h3]:text-xl [&_h3]:font-bold [&_h3]:mb-2",
|
|
11605
|
+
"[&_h4]:text-lg [&_h4]:font-bold [&_h4]:mb-2",
|
|
11606
|
+
"[&_h5]:text-base [&_h5]:font-bold [&_h5]:mb-1",
|
|
11607
|
+
"[&_h6]:text-sm [&_h6]:font-bold [&_h6]:mb-1",
|
|
11608
|
+
"[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-4",
|
|
11609
|
+
"[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-4",
|
|
11610
|
+
"[&_li]:mb-1",
|
|
11611
|
+
"[&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:pl-4 [&_blockquote]:italic",
|
|
11612
|
+
"[&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto"
|
|
11613
|
+
),
|
|
11614
|
+
style: { minHeight, maxHeight },
|
|
11615
|
+
onInput: handleInput,
|
|
11616
|
+
onKeyDown: handleKeyDown,
|
|
11617
|
+
"data-placeholder": placeholder,
|
|
11618
|
+
initial: { opacity: 0 },
|
|
11619
|
+
animate: { opacity: 1 }
|
|
11620
|
+
}
|
|
11621
|
+
),
|
|
11622
|
+
!content && !isPreview && /* @__PURE__ */ jsx(
|
|
11623
|
+
"div",
|
|
11624
|
+
{
|
|
11625
|
+
className: "absolute top-4 left-4 text-muted-foreground pointer-events-none",
|
|
11626
|
+
style: { fontSize: "16px" },
|
|
11627
|
+
children: placeholder
|
|
11628
|
+
}
|
|
11629
|
+
)
|
|
11630
|
+
] }),
|
|
11631
|
+
/* @__PURE__ */ jsx("div", { className: "px-4 py-2 border-t bg-gray-50/50 dark:bg-zinc-800/50 backdrop-blur-sm text-xs text-gray-600 dark:text-gray-400", children: /* @__PURE__ */ jsx(CharacterCount, { content }) })
|
|
11632
|
+
]
|
|
11633
|
+
}
|
|
11634
|
+
);
|
|
11635
|
+
}
|
|
11636
|
+
);
|
|
11637
|
+
SimpleEditor.displayName = "SimpleEditor";
|
|
11638
|
+
var CharacterCount = ({ content }) => {
|
|
11639
|
+
const [count4, setCount] = useState(0);
|
|
11640
|
+
useEffect(() => {
|
|
11641
|
+
const getPlainText = (html) => {
|
|
11642
|
+
const div = document.createElement("div");
|
|
11643
|
+
div.innerHTML = html;
|
|
11644
|
+
return div.textContent || div.innerText || "";
|
|
11645
|
+
};
|
|
11646
|
+
setCount(getPlainText(content).length);
|
|
11647
|
+
}, [content]);
|
|
11648
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11649
|
+
count4,
|
|
11650
|
+
" characters"
|
|
11651
|
+
] });
|
|
11652
|
+
};
|
|
11653
|
+
var skeletonVariants = cva(
|
|
11654
|
+
"animate-pulse rounded-md",
|
|
11655
|
+
{
|
|
11656
|
+
variants: {
|
|
11657
|
+
variant: {
|
|
11658
|
+
default: "bg-muted",
|
|
11659
|
+
primary: "bg-primary/10",
|
|
11660
|
+
secondary: "bg-secondary/10",
|
|
11661
|
+
accent: "bg-accent"
|
|
11662
|
+
},
|
|
11663
|
+
size: {
|
|
11664
|
+
default: "",
|
|
11665
|
+
sm: "scale-90",
|
|
11666
|
+
lg: "scale-110"
|
|
11667
|
+
},
|
|
11668
|
+
shape: {
|
|
11669
|
+
rect: "rounded-md",
|
|
11670
|
+
circle: "rounded-full",
|
|
11671
|
+
pill: "rounded-full"
|
|
11672
|
+
},
|
|
11673
|
+
animation: {
|
|
11674
|
+
pulse: "animate-pulse",
|
|
11675
|
+
wave: "overflow-hidden relative after:absolute after:inset-0 after:-translate-x-full after:animate-[shimmer_2s_infinite] after:bg-gradient-to-r after:from-transparent after:via-white/10 after:to-transparent dark:after:via-white/5",
|
|
11676
|
+
none: "animate-none"
|
|
11677
|
+
}
|
|
11678
|
+
},
|
|
11679
|
+
defaultVariants: {
|
|
11680
|
+
variant: "default",
|
|
11681
|
+
size: "default",
|
|
11682
|
+
shape: "rect",
|
|
11683
|
+
animation: "pulse"
|
|
11684
|
+
}
|
|
11685
|
+
}
|
|
11686
|
+
);
|
|
11687
|
+
var Skeleton = t.forwardRef(
|
|
11688
|
+
({
|
|
11689
|
+
className,
|
|
11690
|
+
variant,
|
|
11691
|
+
size,
|
|
11692
|
+
shape,
|
|
11693
|
+
animation,
|
|
11694
|
+
height,
|
|
11695
|
+
width,
|
|
11696
|
+
isLoaded = false,
|
|
11697
|
+
children,
|
|
11698
|
+
fadeInDuration = 400,
|
|
11699
|
+
motion: useMotion = false,
|
|
11700
|
+
style,
|
|
11701
|
+
...props
|
|
11702
|
+
}, ref) => {
|
|
11703
|
+
const {
|
|
11704
|
+
onDrag,
|
|
11705
|
+
onDragEnd,
|
|
11706
|
+
onDragStart,
|
|
11707
|
+
onAnimationStart,
|
|
11708
|
+
onAnimationEnd,
|
|
11709
|
+
onAnimationIteration,
|
|
11710
|
+
...filteredProps
|
|
11711
|
+
} = props;
|
|
11712
|
+
if (isLoaded && children) {
|
|
11713
|
+
if (useMotion) {
|
|
11714
|
+
return /* @__PURE__ */ jsx(
|
|
11715
|
+
motion.div,
|
|
11716
|
+
{
|
|
11717
|
+
ref,
|
|
11718
|
+
initial: { opacity: 0 },
|
|
11719
|
+
animate: { opacity: 1 },
|
|
11720
|
+
transition: { duration: fadeInDuration / 1e3 },
|
|
11721
|
+
className: cn("moonui-theme", className),
|
|
11722
|
+
style: {
|
|
11723
|
+
height,
|
|
11724
|
+
width,
|
|
11725
|
+
...style
|
|
11726
|
+
},
|
|
11727
|
+
...filteredProps,
|
|
11728
|
+
children
|
|
11729
|
+
}
|
|
11730
|
+
);
|
|
11731
|
+
}
|
|
11732
|
+
return /* @__PURE__ */ jsx(
|
|
11733
|
+
"div",
|
|
11734
|
+
{
|
|
11735
|
+
ref,
|
|
11736
|
+
className: cn("moonui-theme", "animate-fade-in", className),
|
|
11737
|
+
style: {
|
|
11738
|
+
animationDuration: `${fadeInDuration}ms`,
|
|
11739
|
+
height,
|
|
11740
|
+
width,
|
|
11741
|
+
...style
|
|
11742
|
+
},
|
|
11743
|
+
...props,
|
|
11744
|
+
children
|
|
11745
|
+
}
|
|
11746
|
+
);
|
|
11747
|
+
}
|
|
11748
|
+
const SkeletonElement = useMotion ? motion.div : "div";
|
|
11749
|
+
return /* @__PURE__ */ jsx(
|
|
11750
|
+
SkeletonElement,
|
|
11751
|
+
{
|
|
11752
|
+
ref,
|
|
11753
|
+
className: cn(
|
|
11754
|
+
"moonui-theme",
|
|
11755
|
+
skeletonVariants({ variant, size, shape, animation }),
|
|
11756
|
+
"relative isolate",
|
|
11757
|
+
className
|
|
11758
|
+
),
|
|
11759
|
+
style: {
|
|
11760
|
+
height,
|
|
11761
|
+
width,
|
|
11762
|
+
...style
|
|
11763
|
+
},
|
|
11764
|
+
...useMotion ? skeletonAnimation : {},
|
|
11765
|
+
...filteredProps
|
|
11766
|
+
}
|
|
11767
|
+
);
|
|
11768
|
+
}
|
|
11769
|
+
);
|
|
11770
|
+
Skeleton.displayName = "Skeleton";
|
|
11771
|
+
var SkeletonText = t.forwardRef(
|
|
11772
|
+
({
|
|
11773
|
+
className,
|
|
11774
|
+
lines = 3,
|
|
11775
|
+
lineHeight = "0.85rem",
|
|
11776
|
+
spacing = "0.5rem",
|
|
11777
|
+
lastLineWidth = 80,
|
|
11778
|
+
randomWidths = false,
|
|
11779
|
+
variant = "default",
|
|
11780
|
+
animation = "pulse",
|
|
11781
|
+
...props
|
|
11782
|
+
}, ref) => {
|
|
11783
|
+
return /* @__PURE__ */ jsx(
|
|
11784
|
+
"div",
|
|
11785
|
+
{
|
|
11786
|
+
ref,
|
|
11787
|
+
className: cn("moonui-theme", "flex flex-col", className),
|
|
11788
|
+
style: { gap: spacing },
|
|
11789
|
+
...props,
|
|
11790
|
+
children: Array.from({ length: lines }).map((_, i) => {
|
|
11791
|
+
const isLastLine = i === lines - 1;
|
|
11792
|
+
const widthPercentage = isLastLine ? lastLineWidth : randomWidths ? 85 + i % 3 * 5 : 100;
|
|
11793
|
+
return /* @__PURE__ */ jsx(
|
|
11794
|
+
Skeleton,
|
|
11795
|
+
{
|
|
11796
|
+
variant,
|
|
11797
|
+
animation,
|
|
11798
|
+
className: "w-full",
|
|
11799
|
+
style: {
|
|
11800
|
+
height: lineHeight,
|
|
11801
|
+
width: `${widthPercentage}%`
|
|
11802
|
+
}
|
|
11803
|
+
},
|
|
11804
|
+
i
|
|
11805
|
+
);
|
|
11806
|
+
})
|
|
12058
11807
|
}
|
|
12059
|
-
)
|
|
11808
|
+
);
|
|
11809
|
+
}
|
|
11810
|
+
);
|
|
11811
|
+
SkeletonText.displayName = "SkeletonText";
|
|
11812
|
+
var SkeletonAvatar = t.forwardRef(
|
|
11813
|
+
({
|
|
11814
|
+
className,
|
|
11815
|
+
size = "2.5rem",
|
|
11816
|
+
variant = "default",
|
|
11817
|
+
animation = "pulse",
|
|
11818
|
+
...props
|
|
11819
|
+
}, ref) => {
|
|
11820
|
+
return /* @__PURE__ */ jsx(
|
|
11821
|
+
Skeleton,
|
|
11822
|
+
{
|
|
11823
|
+
ref,
|
|
11824
|
+
variant,
|
|
11825
|
+
animation,
|
|
11826
|
+
shape: "circle",
|
|
11827
|
+
className: cn("moonui-theme", "shrink-0", className),
|
|
11828
|
+
style: {
|
|
11829
|
+
height: size,
|
|
11830
|
+
width: size
|
|
11831
|
+
},
|
|
11832
|
+
...props
|
|
11833
|
+
}
|
|
11834
|
+
);
|
|
11835
|
+
}
|
|
11836
|
+
);
|
|
11837
|
+
SkeletonAvatar.displayName = "SkeletonAvatar";
|
|
11838
|
+
var SkeletonCard = t.forwardRef(
|
|
11839
|
+
({
|
|
11840
|
+
className,
|
|
11841
|
+
showHeader = true,
|
|
11842
|
+
contentLines = 3,
|
|
11843
|
+
showFooter = true,
|
|
11844
|
+
variant = "default",
|
|
11845
|
+
animation = "pulse",
|
|
11846
|
+
...props
|
|
11847
|
+
}, ref) => {
|
|
12060
11848
|
return /* @__PURE__ */ jsxs(
|
|
12061
11849
|
"div",
|
|
12062
11850
|
{
|
|
12063
11851
|
ref,
|
|
12064
11852
|
className: cn(
|
|
12065
|
-
"
|
|
12066
|
-
disabled && "opacity-50 cursor-not-allowed",
|
|
11853
|
+
"overflow-hidden rounded-md border border-border bg-background p-4",
|
|
12067
11854
|
className
|
|
12068
11855
|
),
|
|
12069
11856
|
...props,
|
|
12070
11857
|
children: [
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12082
|
-
|
|
12083
|
-
|
|
12084
|
-
|
|
12085
|
-
|
|
12086
|
-
|
|
12087
|
-
|
|
12088
|
-
|
|
12089
|
-
|
|
12090
|
-
|
|
12091
|
-
|
|
12092
|
-
|
|
12093
|
-
|
|
12094
|
-
|
|
11858
|
+
showHeader && /* @__PURE__ */ jsxs("div", { className: "mb-4 flex items-center gap-4", children: [
|
|
11859
|
+
/* @__PURE__ */ jsx(SkeletonAvatar, { size: "2.5rem", variant, animation }),
|
|
11860
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
11861
|
+
/* @__PURE__ */ jsx(
|
|
11862
|
+
Skeleton,
|
|
11863
|
+
{
|
|
11864
|
+
variant,
|
|
11865
|
+
animation,
|
|
11866
|
+
className: "mb-2 h-4 w-1/3"
|
|
11867
|
+
}
|
|
11868
|
+
),
|
|
11869
|
+
/* @__PURE__ */ jsx(
|
|
11870
|
+
Skeleton,
|
|
11871
|
+
{
|
|
11872
|
+
variant,
|
|
11873
|
+
animation,
|
|
11874
|
+
className: "h-3 w-1/4"
|
|
11875
|
+
}
|
|
11876
|
+
)
|
|
11877
|
+
] })
|
|
11878
|
+
] }),
|
|
11879
|
+
/* @__PURE__ */ jsx(
|
|
11880
|
+
SkeletonText,
|
|
11881
|
+
{
|
|
11882
|
+
lines: contentLines,
|
|
11883
|
+
variant,
|
|
11884
|
+
animation,
|
|
11885
|
+
className: "mb-4"
|
|
11886
|
+
}
|
|
11887
|
+
),
|
|
11888
|
+
showFooter && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mt-4 pt-4 border-t border-border", children: [
|
|
11889
|
+
/* @__PURE__ */ jsx(
|
|
11890
|
+
Skeleton,
|
|
12095
11891
|
{
|
|
12096
|
-
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
className: cn(
|
|
12100
|
-
"p-4 outline-none prose prose-sm dark:prose-invert max-w-none overflow-y-auto",
|
|
12101
|
-
"bg-slate-50 dark:bg-zinc-900/95",
|
|
12102
|
-
"text-gray-900 dark:text-gray-100",
|
|
12103
|
-
"focus:ring-0",
|
|
12104
|
-
"[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4",
|
|
12105
|
-
"[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mb-3",
|
|
12106
|
-
"[&_h3]:text-xl [&_h3]:font-bold [&_h3]:mb-2",
|
|
12107
|
-
"[&_h4]:text-lg [&_h4]:font-bold [&_h4]:mb-2",
|
|
12108
|
-
"[&_h5]:text-base [&_h5]:font-bold [&_h5]:mb-1",
|
|
12109
|
-
"[&_h6]:text-sm [&_h6]:font-bold [&_h6]:mb-1",
|
|
12110
|
-
"[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-4",
|
|
12111
|
-
"[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-4",
|
|
12112
|
-
"[&_li]:mb-1",
|
|
12113
|
-
"[&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:pl-4 [&_blockquote]:italic",
|
|
12114
|
-
"[&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto"
|
|
12115
|
-
),
|
|
12116
|
-
style: { minHeight, maxHeight },
|
|
12117
|
-
onInput: handleInput,
|
|
12118
|
-
onKeyDown: handleKeyDown,
|
|
12119
|
-
"data-placeholder": placeholder,
|
|
12120
|
-
initial: { opacity: 0 },
|
|
12121
|
-
animate: { opacity: 1 }
|
|
11892
|
+
variant,
|
|
11893
|
+
animation,
|
|
11894
|
+
className: "h-4 w-1/4"
|
|
12122
11895
|
}
|
|
12123
11896
|
),
|
|
12124
|
-
|
|
12125
|
-
|
|
11897
|
+
/* @__PURE__ */ jsx(
|
|
11898
|
+
Skeleton,
|
|
12126
11899
|
{
|
|
12127
|
-
|
|
12128
|
-
|
|
12129
|
-
|
|
11900
|
+
variant,
|
|
11901
|
+
animation,
|
|
11902
|
+
className: "h-4 w-1/5"
|
|
12130
11903
|
}
|
|
12131
11904
|
)
|
|
12132
|
-
] })
|
|
12133
|
-
/* @__PURE__ */ jsx("div", { className: "px-4 py-2 border-t bg-gray-50/50 dark:bg-zinc-800/50 backdrop-blur-sm text-xs text-gray-600 dark:text-gray-400", children: /* @__PURE__ */ jsx(CharacterCount, { content }) })
|
|
11905
|
+
] })
|
|
12134
11906
|
]
|
|
12135
11907
|
}
|
|
12136
11908
|
);
|
|
12137
11909
|
}
|
|
12138
11910
|
);
|
|
12139
|
-
|
|
12140
|
-
var CharacterCount = ({ content }) => {
|
|
12141
|
-
const [count4, setCount] = useState(0);
|
|
12142
|
-
useEffect(() => {
|
|
12143
|
-
const getPlainText = (html) => {
|
|
12144
|
-
const div = document.createElement("div");
|
|
12145
|
-
div.innerHTML = html;
|
|
12146
|
-
return div.textContent || div.innerText || "";
|
|
12147
|
-
};
|
|
12148
|
-
setCount(getPlainText(content).length);
|
|
12149
|
-
}, [content]);
|
|
12150
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12151
|
-
count4,
|
|
12152
|
-
" characters"
|
|
12153
|
-
] });
|
|
12154
|
-
};
|
|
11911
|
+
SkeletonCard.displayName = "SkeletonCard";
|
|
12155
11912
|
var SwipeableCard = t.forwardRef(
|
|
12156
11913
|
({ className, children, onSwipeLeft, onSwipeRight, threshold = 100, disabled = false, ...props }, ref) => {
|
|
12157
11914
|
const [startX, setStartX] = t.useState(0);
|
|
@@ -12627,6 +12384,6 @@ function Toaster() {
|
|
|
12627
12384
|
*)
|
|
12628
12385
|
*/
|
|
12629
12386
|
|
|
12630
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardCVCInput, CardContent, CardDescription, CardExpiryInput, CardFooter, CardHeader, CardNumberInput, CardTitle, CardZipInput, Checkbox, CheckboxGroup, CheckboxLabel, CheckboxWithLabel, Collapsible2 as Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorPicker, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut,
|
|
12387
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardCVCInput, CardContent, CardDescription, CardExpiryInput, CardFooter, CardHeader, CardNumberInput, CardTitle, CardZipInput, Checkbox, CheckboxGroup, CheckboxLabel, CheckboxWithLabel, Collapsible2 as Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorPicker, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DatePicker, DateRangePicker, DateTimePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogForm, DialogHeader, DialogTitle, DialogTrigger, DraggableList, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FileUpload, FreeBadge, GestureDrawer, GitHubStarButton, GitHubStars, GradientPicker, Input, Label, LockedComponent, MonthPicker, MoonLogo, MoonLogoAnimated, MoonLogoIcon, Accordion as MoonUIAccordion, AccordionContent as MoonUIAccordionContent, AccordionItem as MoonUIAccordionItem, AccordionTrigger as MoonUIAccordionTrigger, Alert as MoonUIAlert, AlertDescription as MoonUIAlertDescription, AlertTitle as MoonUIAlertTitle, AspectRatio as MoonUIAspectRatio, Avatar as MoonUIAvatar, AvatarFallback as MoonUIAvatarFallback, AvatarGroup as MoonUIAvatarGroup, AvatarImage as MoonUIAvatarImage, Badge as MoonUIBadge, Breadcrumb as MoonUIBreadcrumb, BreadcrumbEllipsis as MoonUIBreadcrumbEllipsis, BreadcrumbItem as MoonUIBreadcrumbItem, BreadcrumbLink as MoonUIBreadcrumbLink, BreadcrumbList as MoonUIBreadcrumbList, BreadcrumbPage as MoonUIBreadcrumbPage, BreadcrumbSeparator as MoonUIBreadcrumbSeparator, Button as MoonUIButton, Card as MoonUICard, CardCVCInput as MoonUICardCVCInput, CardContent as MoonUICardContent, CardDescription as MoonUICardDescription, CardExpiryInput as MoonUICardExpiryInput, CardFooter as MoonUICardFooter, CardHeader as MoonUICardHeader, CardNumberInput as MoonUICardNumberInput, CardTitle as MoonUICardTitle, CardZipInput as MoonUICardZipInput, Checkbox as MoonUICheckbox, CheckboxGroup as MoonUICheckboxGroup, CheckboxLabel as MoonUICheckboxLabel, CheckboxWithLabel as MoonUICheckboxWithLabel, Collapsible2 as MoonUICollapsible, CollapsibleContent2 as MoonUICollapsibleContent, CollapsibleTrigger2 as MoonUICollapsibleTrigger, ColorPicker as MoonUIColorPicker, Command as MoonUICommand, CommandDialog as MoonUICommandDialog, CommandEmpty as MoonUICommandEmpty, CommandGroup as MoonUICommandGroup, CommandInput as MoonUICommandInput, CommandItem as MoonUICommandItem, CommandList as MoonUICommandList, CommandSeparator as MoonUICommandSeparator, CommandShortcut as MoonUICommandShortcut, DataTableBasic as MoonUIDataTableBasic, DatePicker as MoonUIDatePicker, DateRangePicker as MoonUIDateRangePicker, DateTimePicker as MoonUIDateTimePicker, Dialog as MoonUIDialog, DialogClose as MoonUIDialogClose, DialogContent as MoonUIDialogContent, DialogDescription as MoonUIDialogDescription, DialogFooter as MoonUIDialogFooter, DialogHeader as MoonUIDialogHeader, DialogTitle as MoonUIDialogTitle, DialogTrigger as MoonUIDialogTrigger, DraggableList as MoonUIDraggableList, DropdownMenu as MoonUIDropdownMenu, DropdownMenuCheckboxItem as MoonUIDropdownMenuCheckboxItem, DropdownMenuContent as MoonUIDropdownMenuContent, DropdownMenuGroup as MoonUIDropdownMenuGroup, DropdownMenuItem as MoonUIDropdownMenuItem, DropdownMenuLabel as MoonUIDropdownMenuLabel, DropdownMenuPortal as MoonUIDropdownMenuPortal, DropdownMenuRadioGroup as MoonUIDropdownMenuRadioGroup, DropdownMenuRadioItem as MoonUIDropdownMenuRadioItem, DropdownMenuSeparator as MoonUIDropdownMenuSeparator, DropdownMenuShortcut as MoonUIDropdownMenuShortcut, DropdownMenuSub as MoonUIDropdownMenuSub, DropdownMenuSubContent as MoonUIDropdownMenuSubContent, DropdownMenuSubTrigger as MoonUIDropdownMenuSubTrigger, DropdownMenuTrigger as MoonUIDropdownMenuTrigger, FileUpload as MoonUIFileUpload, FreeBadge as MoonUIFreeBadge, GestureDrawer as MoonUIGestureDrawer, GitHubStars as MoonUIGitHubStars, GradientPicker as MoonUIGradientPicker, Input as MoonUIInput, Label as MoonUILabel, LockedComponent as MoonUILockedComponent, MonthPicker as MoonUIMonthPicker, MoonLogo as MoonUIMoonLogo, Pagination as MoonUIPagination, PaginationContent as MoonUIPaginationContent, PaginationEllipsis as MoonUIPaginationEllipsis, PaginationItem as MoonUIPaginationItem, PaginationLink as MoonUIPaginationLink, PaginationNext as MoonUIPaginationNext, PaginationPrevious as MoonUIPaginationPrevious, PhoneInput as MoonUIPhoneInput, Popover as MoonUIPopover, PopoverContent as MoonUIPopoverContent, PopoverTrigger as MoonUIPopoverTrigger, ProBadge as MoonUIProBadge, ProComponentWrapper as MoonUIProComponentWrapper, Progress as MoonUIProgress, RadioGroup2 as MoonUIRadioGroup, RadioGroupItem as MoonUIRadioGroupItem, RadioItemWithLabel as MoonUIRadioItemWithLabel, RadioLabel as MoonUIRadioLabel, RichTextEditor as MoonUIRichTextEditor, ScrollArea2 as MoonUIScrollArea, ScrollBar as MoonUIScrollBar, Select as MoonUISelect, SelectContent as MoonUISelectContent, SelectGroup as MoonUISelectGroup, SelectItem as MoonUISelectItem, SelectLabel as MoonUISelectLabel, SelectScrollDownButton as MoonUISelectScrollDownButton, SelectScrollUpButton as MoonUISelectScrollUpButton, SelectSeparator as MoonUISelectSeparator, SelectTrigger as MoonUISelectTrigger, SelectValue as MoonUISelectValue, Separator3 as MoonUISeparator, SimpleColorPicker as MoonUISimpleColorPicker, SimpleEditor as MoonUISimpleEditor, Skeleton as MoonUISkeleton, SkeletonAvatar as MoonUISkeletonAvatar, SkeletonCard as MoonUISkeletonCard, SkeletonText as MoonUISkeletonText, Slider as MoonUISlider, SwipeableCard as MoonUISwipeableCard, Switch as MoonUISwitch, Table as MoonUITable, TableBody as MoonUITableBody, TableCaption as MoonUITableCaption, TableCell as MoonUITableCell, TableFooter as MoonUITableFooter, TableHead as MoonUITableHead, TableHeader as MoonUITableHeader, TableRow as MoonUITableRow, Tabs as MoonUITabs, TabsContent as MoonUITabsContent, TabsList as MoonUITabsList, TabsTrigger as MoonUITabsTrigger, TagsInput as MoonUITagsInput, Textarea as MoonUITextarea, Toast as MoonUIToast, ToastAction as MoonUIToastAction, ToastClose as MoonUIToastClose, ToastDescription as MoonUIToastDescription, ToastProvider as MoonUIToastProvider, ToastTitle as MoonUIToastTitle, ToastViewport as MoonUIToastViewport, Toaster as MoonUIToaster, Toggle2 as MoonUIToggle, Tooltip as MoonUITooltip, TooltipContent as MoonUITooltipContent, TooltipProvider as MoonUITooltipProvider, TooltipTrigger as MoonUITooltipTrigger, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PhoneInput, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverFooter, PopoverHeader, PopoverSeparator, PopoverTrigger, ProBadge, ProComponentWrapper, Progress, RadioGroup2 as RadioGroup, RadioGroupItem, RadioItemWithLabel, RadioLabel, RichTextEditor, ScrollArea2 as ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, SimpleColorPicker, SimpleEditor, SimpleTooltip, Skeleton, SkeletonAvatar, SkeletonCard, SkeletonText, Slider, SwipeableCard, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagsInput, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Toggle2 as Toggle, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, aspectRatioVariants, badgeVariants, buttonVariants, cn, collapsibleContentVariants, collapsibleTriggerVariants, badgeVariants as moonUIBadgeVariants, buttonVariants as moonUIButtonVariants, createSortableHeader as moonUICreateSortableHeader, skeletonVariants as moonUISkeletonVariants, toggleVariants as moonUIToggleVariants, popoverContentVariants, progressVariants, separatorVariants, skeletonVariants, toast, toggleVariants, tooltipVariants, useToast };
|
|
12631
12388
|
//# sourceMappingURL=out.js.map
|
|
12632
12389
|
//# sourceMappingURL=index.mjs.map
|