@moontra/moonui 2.3.5 → 2.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -18,9 +18,9 @@ var LabelPrimitive = require('@radix-ui/react-label');
18
18
  var PopoverPrimitive = require('@radix-ui/react-popover');
19
19
  var TabsPrimitive = require('@radix-ui/react-tabs');
20
20
  var DialogPrimitive = require('@radix-ui/react-dialog');
21
- var SelectPrimitive = require('@radix-ui/react-select');
22
- var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
23
21
  var dateFns = require('date-fns');
22
+ var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
23
+ var SelectPrimitive = require('@radix-ui/react-select');
24
24
  var SeparatorPrimitive = require('@radix-ui/react-separator');
25
25
  var TooltipPrimitive = require('@radix-ui/react-tooltip');
26
26
  var SwitchPrimitives = require('@radix-ui/react-switch');
@@ -52,8 +52,8 @@ var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
52
52
  var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
53
53
  var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
54
54
  var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
55
- var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
56
55
  var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
56
+ var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
57
57
  var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
58
58
  var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
59
59
  var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
@@ -3475,7 +3475,7 @@ var me = t__namespace.forwardRef((r, o) => {
3475
3475
  var e;
3476
3476
  return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
3477
3477
  }
3478
- function X8(e) {
3478
+ function X7(e) {
3479
3479
  let s = V()[e];
3480
3480
  s && E.setState("value", s.getAttribute(T));
3481
3481
  }
@@ -3490,10 +3490,10 @@ var me = t__namespace.forwardRef((r, o) => {
3490
3490
  s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
3491
3491
  i ? E.setState("value", i.getAttribute(T)) : Q(e);
3492
3492
  }
3493
- let oe = () => X8(V().length - 1), ie = (e) => {
3493
+ let oe = () => X7(V().length - 1), ie = (e) => {
3494
3494
  e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
3495
3495
  }, se = (e) => {
3496
- e.preventDefault(), e.metaKey ? X8(0) : e.altKey ? re(-1) : Q(-1);
3496
+ e.preventDefault(), e.metaKey ? X7(0) : e.altKey ? re(-1) : Q(-1);
3497
3497
  };
3498
3498
  return t__namespace.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
3499
3499
  var s;
@@ -3520,7 +3520,7 @@ var me = t__namespace.forwardRef((r, o) => {
3520
3520
  break;
3521
3521
  }
3522
3522
  case "Home": {
3523
- e.preventDefault(), X8(0);
3523
+ e.preventDefault(), X7(0);
3524
3524
  break;
3525
3525
  }
3526
3526
  case "End": {
@@ -6765,46 +6765,6 @@ function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
6765
6765
  rowsById: newFilteredRowsById
6766
6766
  };
6767
6767
  }
6768
- function getFacetedRowModel() {
6769
- return (table, columnId) => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter, table.getFilteredRowModel()], (preRowModel, columnFilters, globalFilter) => {
6770
- if (!preRowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
6771
- return preRowModel;
6772
- }
6773
- const filterableIds = [...columnFilters.map((d) => d.id).filter((d) => d !== columnId), globalFilter ? "__global__" : void 0].filter(Boolean);
6774
- const filterRowsImpl = (row) => {
6775
- for (let i = 0; i < filterableIds.length; i++) {
6776
- if (row.columnFilters[filterableIds[i]] === false) {
6777
- return false;
6778
- }
6779
- }
6780
- return true;
6781
- };
6782
- return filterRows(preRowModel.rows, filterRowsImpl, table);
6783
- }, getMemoOptions(table.options, "debugTable", "getFacetedRowModel"));
6784
- }
6785
- function getFacetedUniqueValues() {
6786
- return (table, columnId) => memo(() => {
6787
- var _table$getColumn;
6788
- return [(_table$getColumn = table.getColumn(columnId)) == null ? void 0 : _table$getColumn.getFacetedRowModel()];
6789
- }, (facetedRowModel) => {
6790
- if (!facetedRowModel)
6791
- return /* @__PURE__ */ new Map();
6792
- let facetedUniqueValues = /* @__PURE__ */ new Map();
6793
- for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
6794
- const values = facetedRowModel.flatRows[i].getUniqueValues(columnId);
6795
- for (let j = 0; j < values.length; j++) {
6796
- const value = values[j];
6797
- if (facetedUniqueValues.has(value)) {
6798
- var _facetedUniqueValues$;
6799
- facetedUniqueValues.set(value, ((_facetedUniqueValues$ = facetedUniqueValues.get(value)) != null ? _facetedUniqueValues$ : 0) + 1);
6800
- } else {
6801
- facetedUniqueValues.set(value, 1);
6802
- }
6803
- }
6804
- }
6805
- return facetedUniqueValues;
6806
- }, getMemoOptions(table.options, "debugTable", `getFacetedUniqueValues_${columnId}`));
6807
- }
6808
6768
  function getFilteredRowModel() {
6809
6769
  return (table) => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {
6810
6770
  if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
@@ -7261,749 +7221,52 @@ var TableCaption = t__namespace.forwardRef(({ className, ...props }, ref) => /*
7261
7221
  }
7262
7222
  ));
7263
7223
  TableCaption.displayName = "TableCaption";
7264
- var Select = SelectPrimitive__namespace.Root;
7265
- Select.displayName = "Select";
7266
- var SelectGroup = SelectPrimitive__namespace.Group;
7267
- var SelectValue = SelectPrimitive__namespace.Value;
7268
- var SelectTrigger = t__namespace.forwardRef(({ className, children, variant = "standard", size = "md", error, success, loading, leftIcon, rightIcon, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
7269
- SelectPrimitive__namespace.Trigger,
7270
- {
7271
- ref,
7272
- className: cn(
7273
- /* Base styles */
7274
- "flex w-full items-center justify-between gap-1 rounded-md transition-all duration-200",
7275
- "disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
7276
- "focus-visible:outline-none",
7277
- /* Error state */
7278
- error && "border-error focus-visible:ring-error/30 focus-visible:border-error",
7279
- /* Success state */
7280
- success && "border-success focus-visible:ring-success/30 focus-visible:border-success",
7281
- /* Size variants */
7282
- size === "sm" && "h-8 text-xs px-2",
7283
- size === "md" && "h-10 text-sm px-3",
7284
- size === "lg" && "h-12 text-base px-4",
7285
- /* Visual variants */
7286
- 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",
7287
- 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",
7288
- 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",
7289
- 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",
7290
- className
7291
- ),
7292
- ...props,
7293
- disabled: props.disabled || loading,
7294
- "data-error": error ? true : void 0,
7295
- "data-success": success ? true : void 0,
7296
- "data-loading": loading ? true : void 0,
7297
- children: [
7298
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center flex-1 gap-2", children: [
7299
- leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center text-gray-500 dark:text-gray-400", children: leftIcon }),
7300
- loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
7301
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground dark:text-gray-400" }),
7302
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground dark:text-gray-400", children: "Loading..." })
7303
- ] }) : children
7304
- ] }),
7305
- !loading && /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: rightIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-60", children: rightIcon }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-60 transition-transform duration-200 ease-out group-data-[state=open]:rotate-180" }) })
7306
- ]
7307
- }
7308
- ));
7309
- SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
7310
- var SelectScrollUpButton = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7311
- SelectPrimitive__namespace.ScrollUpButton,
7312
- {
7313
- ref,
7314
- className: cn(
7315
- "flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",
7316
- className
7317
- ),
7318
- ...props,
7319
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-4 w-4" })
7320
- }
7321
- ));
7322
- SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
7323
- var SelectScrollDownButton = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7324
- SelectPrimitive__namespace.ScrollDownButton,
7325
- {
7326
- ref,
7327
- className: cn(
7328
- "flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",
7329
- className
7330
- ),
7331
- ...props,
7332
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" })
7333
- }
7334
- ));
7335
- SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
7336
- var SelectContent = t__namespace.forwardRef(({ className, children, position = "popper", side = "bottom", sideOffset = 4, align = "start", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
7337
- SelectPrimitive__namespace.Content,
7338
- {
7339
- ref,
7340
- side,
7341
- sideOffset,
7342
- align,
7343
- avoidCollisions: false,
7344
- className: cn(
7345
- [
7346
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden",
7347
- "rounded-md border border-gray-200 dark:border-gray-700",
7348
- "bg-white dark:bg-gray-900 text-foreground",
7349
- "shadow-lg dark:shadow-gray-900/20",
7350
- "data-[state=open]:animate-in data-[state=closed]:animate-out",
7351
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
7352
- "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
7353
- "data-[state=open]:duration-150"
7354
- ],
7355
- 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",
7356
- className
7357
- ),
7358
- position,
7359
- ...props,
7360
- children: [
7361
- /* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
7224
+ function DataTableBasic({
7225
+ columns,
7226
+ data,
7227
+ enableSorting = true,
7228
+ enablePagination = true,
7229
+ enableSearch = true,
7230
+ pageSize = 10,
7231
+ searchPlaceholder = "Search...",
7232
+ emptyMessage = "No results found.",
7233
+ className
7234
+ }) {
7235
+ const [sorting, setSorting] = t__namespace.useState([]);
7236
+ const [globalFilter, setGlobalFilter] = t__namespace.useState("");
7237
+ const table = useReactTable({
7238
+ data,
7239
+ columns,
7240
+ onSortingChange: enableSorting ? setSorting : void 0,
7241
+ onGlobalFilterChange: enableSearch ? setGlobalFilter : void 0,
7242
+ getCoreRowModel: getCoreRowModel(),
7243
+ getPaginationRowModel: enablePagination ? getPaginationRowModel() : void 0,
7244
+ getSortedRowModel: enableSorting ? getSortedRowModel() : void 0,
7245
+ getFilteredRowModel: enableSearch ? getFilteredRowModel() : void 0,
7246
+ state: {
7247
+ sorting,
7248
+ globalFilter
7249
+ },
7250
+ initialState: {
7251
+ pagination: {
7252
+ pageSize
7253
+ }
7254
+ }
7255
+ });
7256
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-4", className), children: [
7257
+ enableSearch && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative max-w-sm", children: [
7258
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
7362
7259
  /* @__PURE__ */ jsxRuntime.jsx(
7363
- SelectPrimitive__namespace.Viewport,
7260
+ Input,
7364
7261
  {
7365
- className: cn(
7366
- "p-1",
7367
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
7368
- ),
7369
- children
7262
+ placeholder: searchPlaceholder,
7263
+ value: globalFilter,
7264
+ onChange: (event) => setGlobalFilter(event.target.value),
7265
+ className: "pl-8"
7370
7266
  }
7371
- ),
7372
- /* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
7373
- ]
7374
- }
7375
- ) }));
7376
- SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
7377
- var SelectLabel = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7378
- SelectPrimitive__namespace.Label,
7379
- {
7380
- ref,
7381
- className: cn("moonui-theme", "py-1.5 pl-8 pr-2 text-sm font-semibold", className),
7382
- ...props
7383
- }
7384
- ));
7385
- SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
7386
- var SelectItem = t__namespace.forwardRef(({ className, children, variant = "default", size = "md", rightIcon, customIndicator, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
7387
- SelectPrimitive__namespace.Item,
7388
- {
7389
- ref,
7390
- className: cn(
7391
- "relative flex w-full cursor-default select-none items-center rounded-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
7392
- /* Size variants */
7393
- size === "sm" && "py-1 pl-7 pr-2 text-xs",
7394
- size === "md" && "py-1.5 pl-8 pr-2 text-sm",
7395
- size === "lg" && "py-2 pl-9 pr-3 text-base",
7396
- /* Color variants */
7397
- variant === "default" && "focus:bg-accent focus:text-accent-foreground dark:focus:bg-gray-700 dark:focus:text-gray-100",
7398
- variant === "subtle" && "focus:bg-gray-100 dark:focus:bg-gray-800 focus:text-foreground dark:focus:text-gray-200",
7399
- 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",
7400
- 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",
7401
- 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",
7402
- className
7403
- ),
7404
- ...props,
7405
- children: [
7406
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: customIndicator || /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
7407
- /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children }),
7408
- rightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto pl-2 opacity-70", children: rightIcon })
7409
- ]
7410
- }
7411
- ));
7412
- SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
7413
- var SelectSeparator = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7414
- SelectPrimitive__namespace.Separator,
7415
- {
7416
- ref,
7417
- className: cn("moonui-theme", "-mx-1 my-1 h-px bg-muted dark:bg-gray-700", className),
7418
- ...props
7419
- }
7420
- ));
7421
- SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
7422
- var DropdownMenu = DropdownMenuPrimitive__namespace.Root;
7423
- var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
7424
- var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
7425
- var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
7426
- var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
7427
- var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
7428
- var DropdownMenuSubTrigger = t__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
7429
- DropdownMenuPrimitive__namespace.SubTrigger,
7430
- {
7431
- ref,
7432
- className: cn(
7433
- "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",
7434
- inset && "pl-8",
7435
- className
7436
- ),
7437
- ...props,
7438
- children: [
7439
- children,
7440
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "ml-auto h-4 w-4" })
7441
- ]
7442
- }
7443
- ));
7444
- DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
7445
- var DropdownMenuSubContent = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7446
- DropdownMenuPrimitive__namespace.SubContent,
7447
- {
7448
- ref,
7449
- className: cn(
7450
- "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",
7451
- className
7452
- ),
7453
- ...props
7454
- }
7455
- ));
7456
- DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
7457
- var DropdownMenuContent = t__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
7458
- DropdownMenuPrimitive__namespace.Content,
7459
- {
7460
- ref,
7461
- sideOffset,
7462
- className: cn(
7463
- "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",
7464
- className
7465
- ),
7466
- ...props
7467
- }
7468
- ) }));
7469
- DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
7470
- var DropdownMenuItem = t__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7471
- DropdownMenuPrimitive__namespace.Item,
7472
- {
7473
- ref,
7474
- className: cn(
7475
- "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",
7476
- inset && "pl-8",
7477
- className
7478
- ),
7479
- ...props
7480
- }
7481
- ));
7482
- DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
7483
- var DropdownMenuCheckboxItem = t__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
7484
- DropdownMenuPrimitive__namespace.CheckboxItem,
7485
- {
7486
- ref,
7487
- className: cn(
7488
- "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",
7489
- className
7490
- ),
7491
- checked,
7492
- ...props,
7493
- children: [
7494
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
7495
- children
7496
- ]
7497
- }
7498
- ));
7499
- DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
7500
- var DropdownMenuRadioItem = t__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
7501
- DropdownMenuPrimitive__namespace.RadioItem,
7502
- {
7503
- ref,
7504
- className: cn(
7505
- "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",
7506
- className
7507
- ),
7508
- ...props,
7509
- children: [
7510
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-2 w-2 fill-current" }) }) }),
7511
- children
7512
- ]
7513
- }
7514
- ));
7515
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
7516
- var DropdownMenuLabel = t__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7517
- DropdownMenuPrimitive__namespace.Label,
7518
- {
7519
- ref,
7520
- className: cn(
7521
- "px-2 py-1.5 text-sm font-semibold",
7522
- inset && "pl-8",
7523
- className
7524
- ),
7525
- ...props
7526
- }
7527
- ));
7528
- DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
7529
- var DropdownMenuSeparator = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7530
- DropdownMenuPrimitive__namespace.Separator,
7531
- {
7532
- ref,
7533
- className: cn("moonui-theme", "-mx-1 my-1 h-px bg-muted", className),
7534
- ...props
7535
- }
7536
- ));
7537
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive__namespace.Separator.displayName;
7538
- var DropdownMenuShortcut = ({
7539
- className,
7540
- ...props
7541
- }) => {
7542
- return /* @__PURE__ */ jsxRuntime.jsx(
7543
- "span",
7544
- {
7545
- className: cn("moonui-theme", "ml-auto text-xs tracking-widest opacity-60", className),
7546
- ...props
7547
- }
7548
- );
7549
- };
7550
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
7551
- var skeletonVariants = classVarianceAuthority.cva(
7552
- "animate-pulse rounded-md",
7553
- {
7554
- variants: {
7555
- variant: {
7556
- default: "bg-muted",
7557
- primary: "bg-primary/10",
7558
- secondary: "bg-secondary/10",
7559
- accent: "bg-accent"
7560
- },
7561
- size: {
7562
- default: "",
7563
- sm: "scale-90",
7564
- lg: "scale-110"
7565
- },
7566
- shape: {
7567
- rect: "rounded-md",
7568
- circle: "rounded-full",
7569
- pill: "rounded-full"
7570
- },
7571
- animation: {
7572
- pulse: "animate-pulse",
7573
- 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",
7574
- none: "animate-none"
7575
- }
7576
- },
7577
- defaultVariants: {
7578
- variant: "default",
7579
- size: "default",
7580
- shape: "rect",
7581
- animation: "pulse"
7582
- }
7583
- }
7584
- );
7585
- var Skeleton = t__namespace.forwardRef(
7586
- ({
7587
- className,
7588
- variant,
7589
- size,
7590
- shape,
7591
- animation,
7592
- height,
7593
- width,
7594
- isLoaded = false,
7595
- children,
7596
- fadeInDuration = 400,
7597
- motion: useMotion = false,
7598
- style,
7599
- ...props
7600
- }, ref) => {
7601
- const {
7602
- onDrag,
7603
- onDragEnd,
7604
- onDragStart,
7605
- onAnimationStart,
7606
- onAnimationEnd,
7607
- onAnimationIteration,
7608
- ...filteredProps
7609
- } = props;
7610
- if (isLoaded && children) {
7611
- if (useMotion) {
7612
- return /* @__PURE__ */ jsxRuntime.jsx(
7613
- framerMotion.motion.div,
7614
- {
7615
- ref,
7616
- initial: { opacity: 0 },
7617
- animate: { opacity: 1 },
7618
- transition: { duration: fadeInDuration / 1e3 },
7619
- className: cn("moonui-theme", className),
7620
- style: {
7621
- height,
7622
- width,
7623
- ...style
7624
- },
7625
- ...filteredProps,
7626
- children
7627
- }
7628
- );
7629
- }
7630
- return /* @__PURE__ */ jsxRuntime.jsx(
7631
- "div",
7632
- {
7633
- ref,
7634
- className: cn("moonui-theme", "animate-fade-in", className),
7635
- style: {
7636
- animationDuration: `${fadeInDuration}ms`,
7637
- height,
7638
- width,
7639
- ...style
7640
- },
7641
- ...props,
7642
- children
7643
- }
7644
- );
7645
- }
7646
- const SkeletonElement = useMotion ? framerMotion.motion.div : "div";
7647
- return /* @__PURE__ */ jsxRuntime.jsx(
7648
- SkeletonElement,
7649
- {
7650
- ref,
7651
- className: cn(
7652
- "moonui-theme",
7653
- skeletonVariants({ variant, size, shape, animation }),
7654
- "relative isolate",
7655
- className
7656
- ),
7657
- style: {
7658
- height,
7659
- width,
7660
- ...style
7661
- },
7662
- ...useMotion ? skeletonAnimation : {},
7663
- ...filteredProps
7664
- }
7665
- );
7666
- }
7667
- );
7668
- Skeleton.displayName = "Skeleton";
7669
- var SkeletonText = t__namespace.forwardRef(
7670
- ({
7671
- className,
7672
- lines = 3,
7673
- lineHeight = "0.85rem",
7674
- spacing = "0.5rem",
7675
- lastLineWidth = 80,
7676
- randomWidths = false,
7677
- variant = "default",
7678
- animation = "pulse",
7679
- ...props
7680
- }, ref) => {
7681
- return /* @__PURE__ */ jsxRuntime.jsx(
7682
- "div",
7683
- {
7684
- ref,
7685
- className: cn("moonui-theme", "flex flex-col", className),
7686
- style: { gap: spacing },
7687
- ...props,
7688
- children: Array.from({ length: lines }).map((_, i) => {
7689
- const isLastLine = i === lines - 1;
7690
- const widthPercentage = isLastLine ? lastLineWidth : randomWidths ? 85 + i % 3 * 5 : 100;
7691
- return /* @__PURE__ */ jsxRuntime.jsx(
7692
- Skeleton,
7693
- {
7694
- variant,
7695
- animation,
7696
- className: "w-full",
7697
- style: {
7698
- height: lineHeight,
7699
- width: `${widthPercentage}%`
7700
- }
7701
- },
7702
- i
7703
- );
7704
- })
7705
- }
7706
- );
7707
- }
7708
- );
7709
- SkeletonText.displayName = "SkeletonText";
7710
- var SkeletonAvatar = t__namespace.forwardRef(
7711
- ({
7712
- className,
7713
- size = "2.5rem",
7714
- variant = "default",
7715
- animation = "pulse",
7716
- ...props
7717
- }, ref) => {
7718
- return /* @__PURE__ */ jsxRuntime.jsx(
7719
- Skeleton,
7720
- {
7721
- ref,
7722
- variant,
7723
- animation,
7724
- shape: "circle",
7725
- className: cn("moonui-theme", "shrink-0", className),
7726
- style: {
7727
- height: size,
7728
- width: size
7729
- },
7730
- ...props
7731
- }
7732
- );
7733
- }
7734
- );
7735
- SkeletonAvatar.displayName = "SkeletonAvatar";
7736
- var SkeletonCard = t__namespace.forwardRef(
7737
- ({
7738
- className,
7739
- showHeader = true,
7740
- contentLines = 3,
7741
- showFooter = true,
7742
- variant = "default",
7743
- animation = "pulse",
7744
- ...props
7745
- }, ref) => {
7746
- return /* @__PURE__ */ jsxRuntime.jsxs(
7747
- "div",
7748
- {
7749
- ref,
7750
- className: cn(
7751
- "overflow-hidden rounded-md border border-border bg-background p-4",
7752
- className
7753
- ),
7754
- ...props,
7755
- children: [
7756
- showHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4 flex items-center gap-4", children: [
7757
- /* @__PURE__ */ jsxRuntime.jsx(SkeletonAvatar, { size: "2.5rem", variant, animation }),
7758
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
7759
- /* @__PURE__ */ jsxRuntime.jsx(
7760
- Skeleton,
7761
- {
7762
- variant,
7763
- animation,
7764
- className: "mb-2 h-4 w-1/3"
7765
- }
7766
- ),
7767
- /* @__PURE__ */ jsxRuntime.jsx(
7768
- Skeleton,
7769
- {
7770
- variant,
7771
- animation,
7772
- className: "h-3 w-1/4"
7773
- }
7774
- )
7775
- ] })
7776
- ] }),
7777
- /* @__PURE__ */ jsxRuntime.jsx(
7778
- SkeletonText,
7779
- {
7780
- lines: contentLines,
7781
- variant,
7782
- animation,
7783
- className: "mb-4"
7784
- }
7785
- ),
7786
- showFooter && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mt-4 pt-4 border-t border-border", children: [
7787
- /* @__PURE__ */ jsxRuntime.jsx(
7788
- Skeleton,
7789
- {
7790
- variant,
7791
- animation,
7792
- className: "h-4 w-1/4"
7793
- }
7794
- ),
7795
- /* @__PURE__ */ jsxRuntime.jsx(
7796
- Skeleton,
7797
- {
7798
- variant,
7799
- animation,
7800
- className: "h-4 w-1/5"
7801
- }
7802
- )
7803
- ] })
7804
- ]
7805
- }
7806
- );
7807
- }
7808
- );
7809
- SkeletonCard.displayName = "SkeletonCard";
7810
- classVarianceAuthority.cva(
7811
- "w-full",
7812
- {
7813
- variants: {
7814
- variant: {
7815
- default: "",
7816
- bordered: "border rounded-lg",
7817
- striped: "[&_tbody_tr:nth-child(even)]:bg-muted/50",
7818
- cards: "gap-4 [&_tbody]:flex [&_tbody]:flex-col [&_tbody_tr]:rounded-lg [&_tbody_tr]:border [&_tbody_tr]:p-4"
7819
- },
7820
- size: {
7821
- default: "",
7822
- sm: "text-sm [&_th]:py-2 [&_td]:py-2",
7823
- lg: "text-base [&_th]:py-4 [&_td]:py-4"
7824
- },
7825
- density: {
7826
- default: "",
7827
- compact: "[&_th]:py-1 [&_td]:py-1",
7828
- comfortable: "[&_th]:py-6 [&_td]:py-6"
7829
- }
7830
- },
7831
- defaultVariants: {
7832
- variant: "default",
7833
- size: "default",
7834
- density: "default"
7835
- }
7836
- }
7837
- );
7838
- function DataTableLoading() {
7839
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
7840
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
7841
- /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-8 w-[250px]" }),
7842
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
7843
- /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-8 w-8" }),
7844
- /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-8 w-8" })
7845
- ] })
7846
- ] }),
7847
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border", children: [
7848
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-4", children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-8 flex-1" }, i)) }) }),
7849
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 space-y-2", children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-12 w-full" }, i)) })
7850
- ] })
7851
- ] });
7852
- }
7853
- function DataTable({
7854
- columns,
7855
- data,
7856
- enableFiltering = true,
7857
- enableSorting = true,
7858
- enableColumnVisibility = true,
7859
- enableRowSelection = false,
7860
- enablePagination = true,
7861
- pageSizeOptions = [10, 20, 30, 50, 100],
7862
- defaultPageSize: defaultPageSize2 = 10,
7863
- filterPlaceholder = "Filter...",
7864
- filterColumn,
7865
- isLoading = false,
7866
- emptyMessage = "No results found.",
7867
- title,
7868
- description,
7869
- enableExport = false,
7870
- onExport,
7871
- enableRefresh = false,
7872
- onRefresh,
7873
- toolbarActions,
7874
- customFilter,
7875
- onRowClick,
7876
- variant,
7877
- size,
7878
- density,
7879
- className
7880
- }) {
7881
- const [sorting, setSorting] = t__namespace.useState([]);
7882
- const [columnFilters, setColumnFilters] = t__namespace.useState([]);
7883
- const [columnVisibility, setColumnVisibility] = t__namespace.useState({});
7884
- const [rowSelection, setRowSelection] = t__namespace.useState({});
7885
- const [globalFilter, setGlobalFilter] = t__namespace.useState("");
7886
- const table = useReactTable({
7887
- data,
7888
- columns,
7889
- onSortingChange: enableSorting ? setSorting : void 0,
7890
- onColumnFiltersChange: enableFiltering ? setColumnFilters : void 0,
7891
- onColumnVisibilityChange: enableColumnVisibility ? setColumnVisibility : void 0,
7892
- onRowSelectionChange: enableRowSelection ? setRowSelection : void 0,
7893
- onGlobalFilterChange: enableFiltering && !filterColumn ? setGlobalFilter : void 0,
7894
- getCoreRowModel: getCoreRowModel(),
7895
- getPaginationRowModel: enablePagination ? getPaginationRowModel() : void 0,
7896
- getSortedRowModel: enableSorting ? getSortedRowModel() : void 0,
7897
- getFilteredRowModel: enableFiltering ? getFilteredRowModel() : void 0,
7898
- getFacetedRowModel: enableFiltering ? getFacetedRowModel() : void 0,
7899
- getFacetedUniqueValues: enableFiltering ? getFacetedUniqueValues() : void 0,
7900
- state: {
7901
- sorting,
7902
- columnFilters,
7903
- columnVisibility,
7904
- rowSelection,
7905
- globalFilter
7906
- },
7907
- initialState: {
7908
- pagination: {
7909
- pageSize: defaultPageSize2
7910
- }
7911
- }
7912
- });
7913
- if (isLoading) {
7914
- return /* @__PURE__ */ jsxRuntime.jsx(DataTableLoading, {});
7915
- }
7916
- const selectedRows = table.getFilteredSelectedRowModel().rows;
7917
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("moonui-theme", "space-y-4", className), children: [
7918
- (title || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
7919
- title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold", children: title }),
7920
- description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description })
7921
- ] }),
7922
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
7923
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 max-w-sm", children: enableFiltering && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: customFilter || /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
7924
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
7925
- /* @__PURE__ */ jsxRuntime.jsx(
7926
- Input,
7927
- {
7928
- placeholder: filterPlaceholder,
7929
- value: filterColumn ? table.getColumn(filterColumn)?.getFilterValue() ?? "" : globalFilter,
7930
- onChange: (event) => {
7931
- const value = event.target.value;
7932
- if (filterColumn) {
7933
- table.getColumn(filterColumn)?.setFilterValue(value);
7934
- } else {
7935
- setGlobalFilter(value);
7936
- }
7937
- },
7938
- className: "pl-8"
7939
- }
7940
- ),
7941
- (filterColumn && table.getColumn(filterColumn)?.getFilterValue() || !filterColumn && globalFilter) && /* @__PURE__ */ jsxRuntime.jsx(
7942
- Button,
7943
- {
7944
- variant: "ghost",
7945
- size: "sm",
7946
- className: "absolute right-0 top-0 h-full px-2",
7947
- onClick: () => {
7948
- if (filterColumn) {
7949
- table.getColumn(filterColumn)?.setFilterValue("");
7950
- } else {
7951
- setGlobalFilter("");
7952
- }
7953
- },
7954
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
7955
- }
7956
- )
7957
- ] }) }) }),
7958
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
7959
- enableRowSelection && selectedRows.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "whitespace-nowrap", children: [
7960
- selectedRows.length,
7961
- " selected"
7962
- ] }),
7963
- toolbarActions,
7964
- enableExport && onExport && /* @__PURE__ */ jsxRuntime.jsxs(
7965
- Button,
7966
- {
7967
- variant: "outline",
7968
- size: "sm",
7969
- onClick: () => onExport(table.getFilteredRowModel().rows.map((row) => row.original)),
7970
- children: [
7971
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "mr-2 h-4 w-4" }),
7972
- "Export"
7973
- ]
7974
- }
7975
- ),
7976
- enableRefresh && onRefresh && /* @__PURE__ */ jsxRuntime.jsx(
7977
- Button,
7978
- {
7979
- variant: "outline",
7980
- size: "icon",
7981
- onClick: onRefresh,
7982
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "h-4 w-4" })
7983
- }
7984
- ),
7985
- enableColumnVisibility && /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
7986
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "icon", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Columns, { className: "h-4 w-4" }) }) }),
7987
- /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "end", className: "w-[180px]", children: [
7988
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuLabel, { children: "Toggle columns" }),
7989
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
7990
- table.getAllColumns().filter((column) => column.getCanHide()).map((column) => {
7991
- return /* @__PURE__ */ jsxRuntime.jsx(
7992
- DropdownMenuCheckboxItem,
7993
- {
7994
- className: "capitalize",
7995
- checked: column.getIsVisible(),
7996
- onCheckedChange: (value) => column.toggleVisibility(!!value),
7997
- children: column.id
7998
- },
7999
- column.id
8000
- );
8001
- })
8002
- ] })
8003
- ] })
8004
- ] })
8005
- ] }),
8006
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("rounded-lg", variant === "bordered" && "border"), children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
7267
+ )
7268
+ ] }) }),
7269
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
8007
7270
  /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: headerGroup.headers.map((header) => {
8008
7271
  return /* @__PURE__ */ jsxRuntime.jsx(TableHead, { children: header.isPlaceholder ? null : /* @__PURE__ */ jsxRuntime.jsxs(
8009
7272
  "div",
@@ -8023,27 +7286,17 @@ function DataTable({
8023
7286
  }
8024
7287
  ) }, header.id);
8025
7288
  }) }, headerGroup.id)) }),
8026
- /* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows?.length ? /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
8027
- framerMotion.motion.tr,
7289
+ /* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
7290
+ TableRow,
8028
7291
  {
8029
- initial: { opacity: 0, y: -10 },
8030
- animate: { opacity: 1, y: 0 },
8031
- exit: { opacity: 0, y: 10 },
8032
- transition: { duration: 0.2 },
8033
7292
  "data-state": row.getIsSelected() && "selected",
8034
- className: cn(
8035
- "border-b transition-colors",
8036
- onRowClick && "cursor-pointer hover:bg-muted/50",
8037
- row.getIsSelected() && "bg-muted"
8038
- ),
8039
- onClick: () => onRowClick?.(row.original),
8040
7293
  children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: flexRender(
8041
7294
  cell.column.columnDef.cell,
8042
7295
  cell.getContext()
8043
7296
  ) }, cell.id))
8044
7297
  },
8045
7298
  row.id
8046
- )) }) : /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(
7299
+ )) : /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(
8047
7300
  TableCell,
8048
7301
  {
8049
7302
  colSpan: columns.length,
@@ -8052,89 +7305,45 @@ function DataTable({
8052
7305
  }
8053
7306
  ) }) })
8054
7307
  ] }) }),
8055
- enablePagination && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [
8056
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
8057
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
8058
- table.getFilteredRowModel().rows.length,
7308
+ enablePagination && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end space-x-2", children: [
7309
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 text-sm text-muted-foreground", children: [
7310
+ table.getFilteredRowModel().rows.length,
7311
+ " row(s)"
7312
+ ] }),
7313
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-x-2", children: [
7314
+ /* @__PURE__ */ jsxRuntime.jsxs(
7315
+ Button,
7316
+ {
7317
+ variant: "outline",
7318
+ size: "sm",
7319
+ onClick: () => table.previousPage(),
7320
+ disabled: !table.getCanPreviousPage(),
7321
+ children: [
7322
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" }),
7323
+ "Previous"
7324
+ ]
7325
+ }
7326
+ ),
7327
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm", children: [
7328
+ "Page ",
7329
+ table.getState().pagination.pageIndex + 1,
8059
7330
  " of",
8060
7331
  " ",
8061
- table.getCoreRowModel().rows.length,
8062
- " row(s)"
8063
- ] }),
8064
- enableRowSelection && selectedRows.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
8065
- "\u2022 ",
8066
- selectedRows.length,
8067
- " selected"
8068
- ] })
8069
- ] }),
8070
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8071
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8072
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: "Rows per page" }),
8073
- /* @__PURE__ */ jsxRuntime.jsxs(
8074
- Select,
8075
- {
8076
- value: `${table.getState().pagination.pageSize}`,
8077
- onValueChange: (value) => {
8078
- table.setPageSize(Number(value));
8079
- },
8080
- children: [
8081
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
8082
- /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { side: "top", children: pageSizeOptions.map((pageSize) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize)) })
8083
- ]
8084
- }
8085
- )
7332
+ table.getPageCount()
8086
7333
  ] }),
8087
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
8088
- /* @__PURE__ */ jsxRuntime.jsx(
8089
- Button,
8090
- {
8091
- variant: "outline",
8092
- size: "icon",
8093
- onClick: () => table.setPageIndex(0),
8094
- disabled: !table.getCanPreviousPage(),
8095
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeft, { className: "h-4 w-4" })
8096
- }
8097
- ),
8098
- /* @__PURE__ */ jsxRuntime.jsx(
8099
- Button,
8100
- {
8101
- variant: "outline",
8102
- size: "icon",
8103
- onClick: () => table.previousPage(),
8104
- disabled: !table.getCanPreviousPage(),
8105
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
8106
- }
8107
- ),
8108
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-sm", children: [
8109
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Page" }),
8110
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-medium", children: [
8111
- table.getState().pagination.pageIndex + 1,
8112
- " of",
8113
- " ",
8114
- table.getPageCount()
8115
- ] })
8116
- ] }),
8117
- /* @__PURE__ */ jsxRuntime.jsx(
8118
- Button,
8119
- {
8120
- variant: "outline",
8121
- size: "icon",
8122
- onClick: () => table.nextPage(),
8123
- disabled: !table.getCanNextPage(),
8124
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
8125
- }
8126
- ),
8127
- /* @__PURE__ */ jsxRuntime.jsx(
8128
- Button,
8129
- {
8130
- variant: "outline",
8131
- size: "icon",
8132
- onClick: () => table.setPageIndex(table.getPageCount() - 1),
8133
- disabled: !table.getCanNextPage(),
8134
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsRight, { className: "h-4 w-4" })
8135
- }
8136
- )
8137
- ] })
7334
+ /* @__PURE__ */ jsxRuntime.jsxs(
7335
+ Button,
7336
+ {
7337
+ variant: "outline",
7338
+ size: "sm",
7339
+ onClick: () => table.nextPage(),
7340
+ disabled: !table.getCanNextPage(),
7341
+ children: [
7342
+ "Next",
7343
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
7344
+ ]
7345
+ }
7346
+ )
8138
7347
  ] })
8139
7348
  ] })
8140
7349
  ] });
@@ -8153,13 +7362,6 @@ function createSortableHeader(label) {
8153
7362
  }
8154
7363
  );
8155
7364
  }
8156
- function createFilterableColumn(accessorKey, header, filterFn) {
8157
- return {
8158
- accessorKey,
8159
- header: createSortableHeader(header),
8160
- filterFn
8161
- };
8162
- }
8163
7365
  function Calendar({
8164
7366
  mode = "single",
8165
7367
  selected,
@@ -8815,54 +8017,183 @@ function DraggableList({
8815
8017
  renderItem,
8816
8018
  keyExtractor,
8817
8019
  className,
8818
- disabled = false
8819
- }) {
8820
- const [draggedIndex, setDraggedIndex] = t__namespace.useState(null);
8821
- const handleDragStart = (e, index) => {
8822
- if (disabled)
8823
- return;
8824
- setDraggedIndex(index);
8825
- e.dataTransfer.effectAllowed = "move";
8826
- };
8827
- const handleDragOver = (e) => {
8828
- e.preventDefault();
8829
- e.dataTransfer.dropEffect = "move";
8830
- };
8831
- const handleDrop = (e, dropIndex) => {
8832
- e.preventDefault();
8833
- if (disabled || draggedIndex === null || draggedIndex === dropIndex) {
8834
- setDraggedIndex(null);
8835
- return;
8836
- }
8837
- const newItems = [...items];
8838
- const draggedItem = newItems[draggedIndex];
8839
- newItems.splice(draggedIndex, 1);
8840
- newItems.splice(dropIndex, 0, draggedItem);
8841
- onReorder(newItems);
8842
- setDraggedIndex(null);
8843
- };
8844
- const handleDragEnd = () => {
8845
- setDraggedIndex(null);
8846
- };
8847
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("moonui-theme", "space-y-2", className), children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
8848
- "div",
8020
+ disabled = false
8021
+ }) {
8022
+ const [draggedIndex, setDraggedIndex] = t__namespace.useState(null);
8023
+ const handleDragStart = (e, index) => {
8024
+ if (disabled)
8025
+ return;
8026
+ setDraggedIndex(index);
8027
+ e.dataTransfer.effectAllowed = "move";
8028
+ };
8029
+ const handleDragOver = (e) => {
8030
+ e.preventDefault();
8031
+ e.dataTransfer.dropEffect = "move";
8032
+ };
8033
+ const handleDrop = (e, dropIndex) => {
8034
+ e.preventDefault();
8035
+ if (disabled || draggedIndex === null || draggedIndex === dropIndex) {
8036
+ setDraggedIndex(null);
8037
+ return;
8038
+ }
8039
+ const newItems = [...items];
8040
+ const draggedItem = newItems[draggedIndex];
8041
+ newItems.splice(draggedIndex, 1);
8042
+ newItems.splice(dropIndex, 0, draggedItem);
8043
+ onReorder(newItems);
8044
+ setDraggedIndex(null);
8045
+ };
8046
+ const handleDragEnd = () => {
8047
+ setDraggedIndex(null);
8048
+ };
8049
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("moonui-theme", "space-y-2", className), children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
8050
+ "div",
8051
+ {
8052
+ draggable: !disabled,
8053
+ onDragStart: (e) => handleDragStart(e, index),
8054
+ onDragOver: handleDragOver,
8055
+ onDrop: (e) => handleDrop(e, index),
8056
+ onDragEnd: handleDragEnd,
8057
+ className: cn(
8058
+ "transition-opacity duration-200",
8059
+ !disabled && "cursor-move hover:opacity-80",
8060
+ draggedIndex === index && "opacity-50",
8061
+ disabled && "cursor-not-allowed"
8062
+ ),
8063
+ children: renderItem(item, index)
8064
+ },
8065
+ keyExtractor(item)
8066
+ )) });
8067
+ }
8068
+ var DropdownMenu = DropdownMenuPrimitive__namespace.Root;
8069
+ var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
8070
+ var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
8071
+ var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
8072
+ var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
8073
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
8074
+ var DropdownMenuSubTrigger = t__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
8075
+ DropdownMenuPrimitive__namespace.SubTrigger,
8076
+ {
8077
+ ref,
8078
+ className: cn(
8079
+ "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",
8080
+ inset && "pl-8",
8081
+ className
8082
+ ),
8083
+ ...props,
8084
+ children: [
8085
+ children,
8086
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "ml-auto h-4 w-4" })
8087
+ ]
8088
+ }
8089
+ ));
8090
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
8091
+ var DropdownMenuSubContent = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
8092
+ DropdownMenuPrimitive__namespace.SubContent,
8093
+ {
8094
+ ref,
8095
+ className: cn(
8096
+ "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",
8097
+ className
8098
+ ),
8099
+ ...props
8100
+ }
8101
+ ));
8102
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
8103
+ var DropdownMenuContent = t__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
8104
+ DropdownMenuPrimitive__namespace.Content,
8105
+ {
8106
+ ref,
8107
+ sideOffset,
8108
+ className: cn(
8109
+ "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",
8110
+ className
8111
+ ),
8112
+ ...props
8113
+ }
8114
+ ) }));
8115
+ DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
8116
+ var DropdownMenuItem = t__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
8117
+ DropdownMenuPrimitive__namespace.Item,
8118
+ {
8119
+ ref,
8120
+ className: cn(
8121
+ "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",
8122
+ inset && "pl-8",
8123
+ className
8124
+ ),
8125
+ ...props
8126
+ }
8127
+ ));
8128
+ DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
8129
+ var DropdownMenuCheckboxItem = t__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
8130
+ DropdownMenuPrimitive__namespace.CheckboxItem,
8131
+ {
8132
+ ref,
8133
+ className: cn(
8134
+ "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",
8135
+ className
8136
+ ),
8137
+ checked,
8138
+ ...props,
8139
+ children: [
8140
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
8141
+ children
8142
+ ]
8143
+ }
8144
+ ));
8145
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
8146
+ var DropdownMenuRadioItem = t__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
8147
+ DropdownMenuPrimitive__namespace.RadioItem,
8148
+ {
8149
+ ref,
8150
+ className: cn(
8151
+ "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",
8152
+ className
8153
+ ),
8154
+ ...props,
8155
+ children: [
8156
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-2 w-2 fill-current" }) }) }),
8157
+ children
8158
+ ]
8159
+ }
8160
+ ));
8161
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
8162
+ var DropdownMenuLabel = t__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
8163
+ DropdownMenuPrimitive__namespace.Label,
8164
+ {
8165
+ ref,
8166
+ className: cn(
8167
+ "px-2 py-1.5 text-sm font-semibold",
8168
+ inset && "pl-8",
8169
+ className
8170
+ ),
8171
+ ...props
8172
+ }
8173
+ ));
8174
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
8175
+ var DropdownMenuSeparator = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
8176
+ DropdownMenuPrimitive__namespace.Separator,
8177
+ {
8178
+ ref,
8179
+ className: cn("moonui-theme", "-mx-1 my-1 h-px bg-muted", className),
8180
+ ...props
8181
+ }
8182
+ ));
8183
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive__namespace.Separator.displayName;
8184
+ var DropdownMenuShortcut = ({
8185
+ className,
8186
+ ...props
8187
+ }) => {
8188
+ return /* @__PURE__ */ jsxRuntime.jsx(
8189
+ "span",
8849
8190
  {
8850
- draggable: !disabled,
8851
- onDragStart: (e) => handleDragStart(e, index),
8852
- onDragOver: handleDragOver,
8853
- onDrop: (e) => handleDrop(e, index),
8854
- onDragEnd: handleDragEnd,
8855
- className: cn(
8856
- "transition-opacity duration-200",
8857
- !disabled && "cursor-move hover:opacity-80",
8858
- draggedIndex === index && "opacity-50",
8859
- disabled && "cursor-not-allowed"
8860
- ),
8861
- children: renderItem(item, index)
8862
- },
8863
- keyExtractor(item)
8864
- )) });
8865
- }
8191
+ className: cn("moonui-theme", "ml-auto text-xs tracking-widest opacity-60", className),
8192
+ ...props
8193
+ }
8194
+ );
8195
+ };
8196
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
8866
8197
  var progressVariants = classVarianceAuthority.cva(
8867
8198
  "relative overflow-hidden bg-muted",
8868
8199
  {
@@ -9928,83 +9259,241 @@ var PaginationContent = t__namespace.forwardRef(({ className, ...props }, ref) =
9928
9259
  "ul",
9929
9260
  {
9930
9261
  ref,
9931
- className: cn("moonui-theme", "flex flex-row items-center gap-1", className),
9262
+ className: cn("moonui-theme", "flex flex-row items-center gap-1", className),
9263
+ ...props
9264
+ }
9265
+ ));
9266
+ PaginationContent.displayName = "PaginationContent";
9267
+ var PaginationItem = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: cn("moonui-theme", "", className), ...props }));
9268
+ PaginationItem.displayName = "PaginationItem";
9269
+ var PaginationLink = ({
9270
+ className,
9271
+ isActive,
9272
+ size = "icon",
9273
+ ...props
9274
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
9275
+ "a",
9276
+ {
9277
+ "aria-current": isActive ? "page" : void 0,
9278
+ className: cn(
9279
+ buttonVariants({
9280
+ variant: isActive ? "outline" : "ghost",
9281
+ size
9282
+ }),
9283
+ className
9284
+ ),
9285
+ ...props
9286
+ }
9287
+ );
9288
+ PaginationLink.displayName = "PaginationLink";
9289
+ var PaginationPrevious = ({
9290
+ className,
9291
+ ...props
9292
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(
9293
+ PaginationLink,
9294
+ {
9295
+ "aria-label": "Go to previous page",
9296
+ size: "md",
9297
+ className: cn("moonui-theme", "gap-1 pl-2.5", className),
9298
+ ...props,
9299
+ children: [
9300
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" }),
9301
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Previous" })
9302
+ ]
9303
+ }
9304
+ );
9305
+ PaginationPrevious.displayName = "PaginationPrevious";
9306
+ var PaginationNext = ({
9307
+ className,
9308
+ ...props
9309
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(
9310
+ PaginationLink,
9311
+ {
9312
+ "aria-label": "Go to next page",
9313
+ size: "md",
9314
+ className: cn("moonui-theme", "gap-1 pr-2.5", className),
9315
+ ...props,
9316
+ children: [
9317
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Next" }),
9318
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
9319
+ ]
9320
+ }
9321
+ );
9322
+ PaginationNext.displayName = "PaginationNext";
9323
+ var PaginationEllipsis = ({
9324
+ className,
9325
+ ...props
9326
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(
9327
+ "span",
9328
+ {
9329
+ "aria-hidden": true,
9330
+ className: cn("moonui-theme", "flex h-9 w-9 items-center justify-center", className),
9331
+ ...props,
9332
+ children: [
9333
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" }),
9334
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More pages" })
9335
+ ]
9336
+ }
9337
+ );
9338
+ PaginationEllipsis.displayName = "PaginationEllipsis";
9339
+ var Select = SelectPrimitive__namespace.Root;
9340
+ Select.displayName = "Select";
9341
+ var SelectGroup = SelectPrimitive__namespace.Group;
9342
+ var SelectValue = SelectPrimitive__namespace.Value;
9343
+ var SelectTrigger = t__namespace.forwardRef(({ className, children, variant = "standard", size = "md", error, success, loading, leftIcon, rightIcon, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
9344
+ SelectPrimitive__namespace.Trigger,
9345
+ {
9346
+ ref,
9347
+ className: cn(
9348
+ /* Base styles */
9349
+ "flex w-full items-center justify-between gap-1 rounded-md transition-all duration-200",
9350
+ "disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
9351
+ "focus-visible:outline-none",
9352
+ /* Error state */
9353
+ error && "border-error focus-visible:ring-error/30 focus-visible:border-error",
9354
+ /* Success state */
9355
+ success && "border-success focus-visible:ring-success/30 focus-visible:border-success",
9356
+ /* Size variants */
9357
+ size === "sm" && "h-8 text-xs px-2",
9358
+ size === "md" && "h-10 text-sm px-3",
9359
+ size === "lg" && "h-12 text-base px-4",
9360
+ /* Visual variants */
9361
+ 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",
9362
+ 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",
9363
+ 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",
9364
+ 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",
9365
+ className
9366
+ ),
9367
+ ...props,
9368
+ disabled: props.disabled || loading,
9369
+ "data-error": error ? true : void 0,
9370
+ "data-success": success ? true : void 0,
9371
+ "data-loading": loading ? true : void 0,
9372
+ children: [
9373
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center flex-1 gap-2", children: [
9374
+ leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center text-gray-500 dark:text-gray-400", children: leftIcon }),
9375
+ loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
9376
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground dark:text-gray-400" }),
9377
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground dark:text-gray-400", children: "Loading..." })
9378
+ ] }) : children
9379
+ ] }),
9380
+ !loading && /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: rightIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-60", children: rightIcon }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-60 transition-transform duration-200 ease-out group-data-[state=open]:rotate-180" }) })
9381
+ ]
9382
+ }
9383
+ ));
9384
+ SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
9385
+ var SelectScrollUpButton = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
9386
+ SelectPrimitive__namespace.ScrollUpButton,
9387
+ {
9388
+ ref,
9389
+ className: cn(
9390
+ "flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",
9391
+ className
9392
+ ),
9393
+ ...props,
9394
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-4 w-4" })
9395
+ }
9396
+ ));
9397
+ SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
9398
+ var SelectScrollDownButton = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
9399
+ SelectPrimitive__namespace.ScrollDownButton,
9400
+ {
9401
+ ref,
9402
+ className: cn(
9403
+ "flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",
9404
+ className
9405
+ ),
9406
+ ...props,
9407
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" })
9408
+ }
9409
+ ));
9410
+ SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
9411
+ var SelectContent = t__namespace.forwardRef(({ className, children, position = "popper", side = "bottom", sideOffset = 4, align = "start", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
9412
+ SelectPrimitive__namespace.Content,
9413
+ {
9414
+ ref,
9415
+ side,
9416
+ sideOffset,
9417
+ align,
9418
+ avoidCollisions: false,
9419
+ className: cn(
9420
+ [
9421
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden",
9422
+ "rounded-md border border-gray-200 dark:border-gray-700",
9423
+ "bg-white dark:bg-gray-900 text-foreground",
9424
+ "shadow-lg dark:shadow-gray-900/20",
9425
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
9426
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
9427
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
9428
+ "data-[state=open]:duration-150"
9429
+ ],
9430
+ 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",
9431
+ className
9432
+ ),
9433
+ position,
9434
+ ...props,
9435
+ children: [
9436
+ /* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
9437
+ /* @__PURE__ */ jsxRuntime.jsx(
9438
+ SelectPrimitive__namespace.Viewport,
9439
+ {
9440
+ className: cn(
9441
+ "p-1",
9442
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
9443
+ ),
9444
+ children
9445
+ }
9446
+ ),
9447
+ /* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
9448
+ ]
9449
+ }
9450
+ ) }));
9451
+ SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
9452
+ var SelectLabel = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
9453
+ SelectPrimitive__namespace.Label,
9454
+ {
9455
+ ref,
9456
+ className: cn("moonui-theme", "py-1.5 pl-8 pr-2 text-sm font-semibold", className),
9932
9457
  ...props
9933
9458
  }
9934
9459
  ));
9935
- PaginationContent.displayName = "PaginationContent";
9936
- var PaginationItem = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: cn("moonui-theme", "", className), ...props }));
9937
- PaginationItem.displayName = "PaginationItem";
9938
- var PaginationLink = ({
9939
- className,
9940
- isActive,
9941
- size = "icon",
9942
- ...props
9943
- }) => /* @__PURE__ */ jsxRuntime.jsx(
9944
- "a",
9460
+ SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
9461
+ var SelectItem = t__namespace.forwardRef(({ className, children, variant = "default", size = "md", rightIcon, customIndicator, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
9462
+ SelectPrimitive__namespace.Item,
9945
9463
  {
9946
- "aria-current": isActive ? "page" : void 0,
9464
+ ref,
9947
9465
  className: cn(
9948
- buttonVariants({
9949
- variant: isActive ? "outline" : "ghost",
9950
- size
9951
- }),
9466
+ "relative flex w-full cursor-default select-none items-center rounded-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
9467
+ /* Size variants */
9468
+ size === "sm" && "py-1 pl-7 pr-2 text-xs",
9469
+ size === "md" && "py-1.5 pl-8 pr-2 text-sm",
9470
+ size === "lg" && "py-2 pl-9 pr-3 text-base",
9471
+ /* Color variants */
9472
+ variant === "default" && "focus:bg-accent focus:text-accent-foreground dark:focus:bg-gray-700 dark:focus:text-gray-100",
9473
+ variant === "subtle" && "focus:bg-gray-100 dark:focus:bg-gray-800 focus:text-foreground dark:focus:text-gray-200",
9474
+ 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",
9475
+ 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",
9476
+ 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",
9952
9477
  className
9953
9478
  ),
9954
- ...props
9955
- }
9956
- );
9957
- PaginationLink.displayName = "PaginationLink";
9958
- var PaginationPrevious = ({
9959
- className,
9960
- ...props
9961
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
9962
- PaginationLink,
9963
- {
9964
- "aria-label": "Go to previous page",
9965
- size: "md",
9966
- className: cn("moonui-theme", "gap-1 pl-2.5", className),
9967
- ...props,
9968
- children: [
9969
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" }),
9970
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Previous" })
9971
- ]
9972
- }
9973
- );
9974
- PaginationPrevious.displayName = "PaginationPrevious";
9975
- var PaginationNext = ({
9976
- className,
9977
- ...props
9978
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
9979
- PaginationLink,
9980
- {
9981
- "aria-label": "Go to next page",
9982
- size: "md",
9983
- className: cn("moonui-theme", "gap-1 pr-2.5", className),
9984
9479
  ...props,
9985
9480
  children: [
9986
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Next" }),
9987
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
9481
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: customIndicator || /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
9482
+ /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children }),
9483
+ rightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto pl-2 opacity-70", children: rightIcon })
9988
9484
  ]
9989
9485
  }
9990
- );
9991
- PaginationNext.displayName = "PaginationNext";
9992
- var PaginationEllipsis = ({
9993
- className,
9994
- ...props
9995
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
9996
- "span",
9486
+ ));
9487
+ SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
9488
+ var SelectSeparator = t__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
9489
+ SelectPrimitive__namespace.Separator,
9997
9490
  {
9998
- "aria-hidden": true,
9999
- className: cn("moonui-theme", "flex h-9 w-9 items-center justify-center", className),
10000
- ...props,
10001
- children: [
10002
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "h-4 w-4" }),
10003
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "More pages" })
10004
- ]
9491
+ ref,
9492
+ className: cn("moonui-theme", "-mx-1 my-1 h-px bg-muted dark:bg-gray-700", className),
9493
+ ...props
10005
9494
  }
10006
- );
10007
- PaginationEllipsis.displayName = "PaginationEllipsis";
9495
+ ));
9496
+ SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
10008
9497
  var countryCodes = [
10009
9498
  { code: "+1", country: "US", flag: "\u{1F1FA}\u{1F1F8}", name: "United States" },
10010
9499
  { code: "+44", country: "GB", flag: "\u{1F1EC}\u{1F1E7}", name: "United Kingdom" },
@@ -12084,106 +11573,365 @@ var SimpleEditor = t__namespace.default.forwardRef(
12084
11573
  },
12085
11574
  disabled
12086
11575
  }
12087
- )
12088
- ] })
12089
- ]
11576
+ )
11577
+ ] })
11578
+ ]
11579
+ }
11580
+ ) });
11581
+ return /* @__PURE__ */ jsxRuntime.jsxs(
11582
+ "div",
11583
+ {
11584
+ ref,
11585
+ className: cn(
11586
+ "border border-gray-200 dark:border-zinc-700 rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-ring focus-within:border-transparent",
11587
+ disabled && "opacity-50 cursor-not-allowed",
11588
+ className
11589
+ ),
11590
+ ...props,
11591
+ children: [
11592
+ toolbar,
11593
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
11594
+ isPreview ? /* @__PURE__ */ jsxRuntime.jsx(
11595
+ framerMotion.motion.div,
11596
+ {
11597
+ initial: { opacity: 0 },
11598
+ animate: { opacity: 1 },
11599
+ className: "bg-slate-50 dark:bg-zinc-900/95",
11600
+ style: { minHeight, maxHeight, overflow: "auto" },
11601
+ children: /* @__PURE__ */ jsxRuntime.jsx(
11602
+ "textarea",
11603
+ {
11604
+ ref: sourceRef,
11605
+ value: sourceContent,
11606
+ onChange: (e) => setSourceContent(e.target.value),
11607
+ 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",
11608
+ style: { minHeight: minHeight - 32 },
11609
+ disabled,
11610
+ placeholder: "HTML source code..."
11611
+ }
11612
+ )
11613
+ }
11614
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
11615
+ framerMotion.motion.div,
11616
+ {
11617
+ ref: editorRef,
11618
+ contentEditable: !disabled,
11619
+ suppressContentEditableWarning: true,
11620
+ className: cn(
11621
+ "p-4 outline-none prose prose-sm dark:prose-invert max-w-none overflow-y-auto",
11622
+ "bg-slate-50 dark:bg-zinc-900/95",
11623
+ "text-gray-900 dark:text-gray-100",
11624
+ "focus:ring-0",
11625
+ "[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4",
11626
+ "[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mb-3",
11627
+ "[&_h3]:text-xl [&_h3]:font-bold [&_h3]:mb-2",
11628
+ "[&_h4]:text-lg [&_h4]:font-bold [&_h4]:mb-2",
11629
+ "[&_h5]:text-base [&_h5]:font-bold [&_h5]:mb-1",
11630
+ "[&_h6]:text-sm [&_h6]:font-bold [&_h6]:mb-1",
11631
+ "[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-4",
11632
+ "[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-4",
11633
+ "[&_li]:mb-1",
11634
+ "[&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:pl-4 [&_blockquote]:italic",
11635
+ "[&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto"
11636
+ ),
11637
+ style: { minHeight, maxHeight },
11638
+ onInput: handleInput,
11639
+ onKeyDown: handleKeyDown,
11640
+ "data-placeholder": placeholder,
11641
+ initial: { opacity: 0 },
11642
+ animate: { opacity: 1 }
11643
+ }
11644
+ ),
11645
+ !content && !isPreview && /* @__PURE__ */ jsxRuntime.jsx(
11646
+ "div",
11647
+ {
11648
+ className: "absolute top-4 left-4 text-muted-foreground pointer-events-none",
11649
+ style: { fontSize: "16px" },
11650
+ children: placeholder
11651
+ }
11652
+ )
11653
+ ] }),
11654
+ /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(CharacterCount, { content }) })
11655
+ ]
11656
+ }
11657
+ );
11658
+ }
11659
+ );
11660
+ SimpleEditor.displayName = "SimpleEditor";
11661
+ var CharacterCount = ({ content }) => {
11662
+ const [count4, setCount] = t.useState(0);
11663
+ t.useEffect(() => {
11664
+ const getPlainText = (html) => {
11665
+ const div = document.createElement("div");
11666
+ div.innerHTML = html;
11667
+ return div.textContent || div.innerText || "";
11668
+ };
11669
+ setCount(getPlainText(content).length);
11670
+ }, [content]);
11671
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11672
+ count4,
11673
+ " characters"
11674
+ ] });
11675
+ };
11676
+ var skeletonVariants = classVarianceAuthority.cva(
11677
+ "animate-pulse rounded-md",
11678
+ {
11679
+ variants: {
11680
+ variant: {
11681
+ default: "bg-muted",
11682
+ primary: "bg-primary/10",
11683
+ secondary: "bg-secondary/10",
11684
+ accent: "bg-accent"
11685
+ },
11686
+ size: {
11687
+ default: "",
11688
+ sm: "scale-90",
11689
+ lg: "scale-110"
11690
+ },
11691
+ shape: {
11692
+ rect: "rounded-md",
11693
+ circle: "rounded-full",
11694
+ pill: "rounded-full"
11695
+ },
11696
+ animation: {
11697
+ pulse: "animate-pulse",
11698
+ 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",
11699
+ none: "animate-none"
11700
+ }
11701
+ },
11702
+ defaultVariants: {
11703
+ variant: "default",
11704
+ size: "default",
11705
+ shape: "rect",
11706
+ animation: "pulse"
11707
+ }
11708
+ }
11709
+ );
11710
+ var Skeleton = t__namespace.forwardRef(
11711
+ ({
11712
+ className,
11713
+ variant,
11714
+ size,
11715
+ shape,
11716
+ animation,
11717
+ height,
11718
+ width,
11719
+ isLoaded = false,
11720
+ children,
11721
+ fadeInDuration = 400,
11722
+ motion: useMotion = false,
11723
+ style,
11724
+ ...props
11725
+ }, ref) => {
11726
+ const {
11727
+ onDrag,
11728
+ onDragEnd,
11729
+ onDragStart,
11730
+ onAnimationStart,
11731
+ onAnimationEnd,
11732
+ onAnimationIteration,
11733
+ ...filteredProps
11734
+ } = props;
11735
+ if (isLoaded && children) {
11736
+ if (useMotion) {
11737
+ return /* @__PURE__ */ jsxRuntime.jsx(
11738
+ framerMotion.motion.div,
11739
+ {
11740
+ ref,
11741
+ initial: { opacity: 0 },
11742
+ animate: { opacity: 1 },
11743
+ transition: { duration: fadeInDuration / 1e3 },
11744
+ className: cn("moonui-theme", className),
11745
+ style: {
11746
+ height,
11747
+ width,
11748
+ ...style
11749
+ },
11750
+ ...filteredProps,
11751
+ children
11752
+ }
11753
+ );
11754
+ }
11755
+ return /* @__PURE__ */ jsxRuntime.jsx(
11756
+ "div",
11757
+ {
11758
+ ref,
11759
+ className: cn("moonui-theme", "animate-fade-in", className),
11760
+ style: {
11761
+ animationDuration: `${fadeInDuration}ms`,
11762
+ height,
11763
+ width,
11764
+ ...style
11765
+ },
11766
+ ...props,
11767
+ children
11768
+ }
11769
+ );
11770
+ }
11771
+ const SkeletonElement = useMotion ? framerMotion.motion.div : "div";
11772
+ return /* @__PURE__ */ jsxRuntime.jsx(
11773
+ SkeletonElement,
11774
+ {
11775
+ ref,
11776
+ className: cn(
11777
+ "moonui-theme",
11778
+ skeletonVariants({ variant, size, shape, animation }),
11779
+ "relative isolate",
11780
+ className
11781
+ ),
11782
+ style: {
11783
+ height,
11784
+ width,
11785
+ ...style
11786
+ },
11787
+ ...useMotion ? skeletonAnimation : {},
11788
+ ...filteredProps
11789
+ }
11790
+ );
11791
+ }
11792
+ );
11793
+ Skeleton.displayName = "Skeleton";
11794
+ var SkeletonText = t__namespace.forwardRef(
11795
+ ({
11796
+ className,
11797
+ lines = 3,
11798
+ lineHeight = "0.85rem",
11799
+ spacing = "0.5rem",
11800
+ lastLineWidth = 80,
11801
+ randomWidths = false,
11802
+ variant = "default",
11803
+ animation = "pulse",
11804
+ ...props
11805
+ }, ref) => {
11806
+ return /* @__PURE__ */ jsxRuntime.jsx(
11807
+ "div",
11808
+ {
11809
+ ref,
11810
+ className: cn("moonui-theme", "flex flex-col", className),
11811
+ style: { gap: spacing },
11812
+ ...props,
11813
+ children: Array.from({ length: lines }).map((_, i) => {
11814
+ const isLastLine = i === lines - 1;
11815
+ const widthPercentage = isLastLine ? lastLineWidth : randomWidths ? 85 + i % 3 * 5 : 100;
11816
+ return /* @__PURE__ */ jsxRuntime.jsx(
11817
+ Skeleton,
11818
+ {
11819
+ variant,
11820
+ animation,
11821
+ className: "w-full",
11822
+ style: {
11823
+ height: lineHeight,
11824
+ width: `${widthPercentage}%`
11825
+ }
11826
+ },
11827
+ i
11828
+ );
11829
+ })
12090
11830
  }
12091
- ) });
11831
+ );
11832
+ }
11833
+ );
11834
+ SkeletonText.displayName = "SkeletonText";
11835
+ var SkeletonAvatar = t__namespace.forwardRef(
11836
+ ({
11837
+ className,
11838
+ size = "2.5rem",
11839
+ variant = "default",
11840
+ animation = "pulse",
11841
+ ...props
11842
+ }, ref) => {
11843
+ return /* @__PURE__ */ jsxRuntime.jsx(
11844
+ Skeleton,
11845
+ {
11846
+ ref,
11847
+ variant,
11848
+ animation,
11849
+ shape: "circle",
11850
+ className: cn("moonui-theme", "shrink-0", className),
11851
+ style: {
11852
+ height: size,
11853
+ width: size
11854
+ },
11855
+ ...props
11856
+ }
11857
+ );
11858
+ }
11859
+ );
11860
+ SkeletonAvatar.displayName = "SkeletonAvatar";
11861
+ var SkeletonCard = t__namespace.forwardRef(
11862
+ ({
11863
+ className,
11864
+ showHeader = true,
11865
+ contentLines = 3,
11866
+ showFooter = true,
11867
+ variant = "default",
11868
+ animation = "pulse",
11869
+ ...props
11870
+ }, ref) => {
12092
11871
  return /* @__PURE__ */ jsxRuntime.jsxs(
12093
11872
  "div",
12094
11873
  {
12095
11874
  ref,
12096
11875
  className: cn(
12097
- "border border-gray-200 dark:border-zinc-700 rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-ring focus-within:border-transparent",
12098
- disabled && "opacity-50 cursor-not-allowed",
11876
+ "overflow-hidden rounded-md border border-border bg-background p-4",
12099
11877
  className
12100
11878
  ),
12101
11879
  ...props,
12102
11880
  children: [
12103
- toolbar,
12104
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
12105
- isPreview ? /* @__PURE__ */ jsxRuntime.jsx(
12106
- framerMotion.motion.div,
12107
- {
12108
- initial: { opacity: 0 },
12109
- animate: { opacity: 1 },
12110
- className: "bg-slate-50 dark:bg-zinc-900/95",
12111
- style: { minHeight, maxHeight, overflow: "auto" },
12112
- children: /* @__PURE__ */ jsxRuntime.jsx(
12113
- "textarea",
12114
- {
12115
- ref: sourceRef,
12116
- value: sourceContent,
12117
- onChange: (e) => setSourceContent(e.target.value),
12118
- 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",
12119
- style: { minHeight: minHeight - 32 },
12120
- disabled,
12121
- placeholder: "HTML source code..."
12122
- }
12123
- )
12124
- }
12125
- ) : /* @__PURE__ */ jsxRuntime.jsx(
12126
- framerMotion.motion.div,
11881
+ showHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4 flex items-center gap-4", children: [
11882
+ /* @__PURE__ */ jsxRuntime.jsx(SkeletonAvatar, { size: "2.5rem", variant, animation }),
11883
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
11884
+ /* @__PURE__ */ jsxRuntime.jsx(
11885
+ Skeleton,
11886
+ {
11887
+ variant,
11888
+ animation,
11889
+ className: "mb-2 h-4 w-1/3"
11890
+ }
11891
+ ),
11892
+ /* @__PURE__ */ jsxRuntime.jsx(
11893
+ Skeleton,
11894
+ {
11895
+ variant,
11896
+ animation,
11897
+ className: "h-3 w-1/4"
11898
+ }
11899
+ )
11900
+ ] })
11901
+ ] }),
11902
+ /* @__PURE__ */ jsxRuntime.jsx(
11903
+ SkeletonText,
11904
+ {
11905
+ lines: contentLines,
11906
+ variant,
11907
+ animation,
11908
+ className: "mb-4"
11909
+ }
11910
+ ),
11911
+ showFooter && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mt-4 pt-4 border-t border-border", children: [
11912
+ /* @__PURE__ */ jsxRuntime.jsx(
11913
+ Skeleton,
12127
11914
  {
12128
- ref: editorRef,
12129
- contentEditable: !disabled,
12130
- suppressContentEditableWarning: true,
12131
- className: cn(
12132
- "p-4 outline-none prose prose-sm dark:prose-invert max-w-none overflow-y-auto",
12133
- "bg-slate-50 dark:bg-zinc-900/95",
12134
- "text-gray-900 dark:text-gray-100",
12135
- "focus:ring-0",
12136
- "[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4",
12137
- "[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mb-3",
12138
- "[&_h3]:text-xl [&_h3]:font-bold [&_h3]:mb-2",
12139
- "[&_h4]:text-lg [&_h4]:font-bold [&_h4]:mb-2",
12140
- "[&_h5]:text-base [&_h5]:font-bold [&_h5]:mb-1",
12141
- "[&_h6]:text-sm [&_h6]:font-bold [&_h6]:mb-1",
12142
- "[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-4",
12143
- "[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-4",
12144
- "[&_li]:mb-1",
12145
- "[&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:pl-4 [&_blockquote]:italic",
12146
- "[&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto"
12147
- ),
12148
- style: { minHeight, maxHeight },
12149
- onInput: handleInput,
12150
- onKeyDown: handleKeyDown,
12151
- "data-placeholder": placeholder,
12152
- initial: { opacity: 0 },
12153
- animate: { opacity: 1 }
11915
+ variant,
11916
+ animation,
11917
+ className: "h-4 w-1/4"
12154
11918
  }
12155
11919
  ),
12156
- !content && !isPreview && /* @__PURE__ */ jsxRuntime.jsx(
12157
- "div",
11920
+ /* @__PURE__ */ jsxRuntime.jsx(
11921
+ Skeleton,
12158
11922
  {
12159
- className: "absolute top-4 left-4 text-muted-foreground pointer-events-none",
12160
- style: { fontSize: "16px" },
12161
- children: placeholder
11923
+ variant,
11924
+ animation,
11925
+ className: "h-4 w-1/5"
12162
11926
  }
12163
11927
  )
12164
- ] }),
12165
- /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(CharacterCount, { content }) })
11928
+ ] })
12166
11929
  ]
12167
11930
  }
12168
11931
  );
12169
11932
  }
12170
11933
  );
12171
- SimpleEditor.displayName = "SimpleEditor";
12172
- var CharacterCount = ({ content }) => {
12173
- const [count4, setCount] = t.useState(0);
12174
- t.useEffect(() => {
12175
- const getPlainText = (html) => {
12176
- const div = document.createElement("div");
12177
- div.innerHTML = html;
12178
- return div.textContent || div.innerText || "";
12179
- };
12180
- setCount(getPlainText(content).length);
12181
- }, [content]);
12182
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12183
- count4,
12184
- " characters"
12185
- ] });
12186
- };
11934
+ SkeletonCard.displayName = "SkeletonCard";
12187
11935
  var SwipeableCard = t__namespace.forwardRef(
12188
11936
  ({ className, children, onSwipeLeft, onSwipeRight, threshold = 100, disabled = false, ...props }, ref) => {
12189
11937
  const [startX, setStartX] = t__namespace.useState(0);
@@ -12719,7 +12467,6 @@ exports.CommandItem = CommandItem;
12719
12467
  exports.CommandList = CommandList;
12720
12468
  exports.CommandSeparator = CommandSeparator;
12721
12469
  exports.CommandShortcut = CommandShortcut;
12722
- exports.DataTable = DataTable;
12723
12470
  exports.DatePicker = DatePicker;
12724
12471
  exports.DateRangePicker = DateRangePicker;
12725
12472
  exports.DateTimePicker = DateTimePicker;
@@ -12809,7 +12556,7 @@ exports.MoonUICommandItem = CommandItem;
12809
12556
  exports.MoonUICommandList = CommandList;
12810
12557
  exports.MoonUICommandSeparator = CommandSeparator;
12811
12558
  exports.MoonUICommandShortcut = CommandShortcut;
12812
- exports.MoonUIDataTable = DataTable;
12559
+ exports.MoonUIDataTableBasic = DataTableBasic;
12813
12560
  exports.MoonUIDatePicker = DatePicker;
12814
12561
  exports.MoonUIDateRangePicker = DateRangePicker;
12815
12562
  exports.MoonUIDateTimePicker = DateTimePicker;
@@ -12996,10 +12743,9 @@ exports.buttonVariants = buttonVariants;
12996
12743
  exports.cn = cn;
12997
12744
  exports.collapsibleContentVariants = collapsibleContentVariants;
12998
12745
  exports.collapsibleTriggerVariants = collapsibleTriggerVariants;
12999
- exports.createFilterableColumn = createFilterableColumn;
13000
- exports.createSortableHeader = createSortableHeader;
13001
12746
  exports.moonUIBadgeVariants = badgeVariants;
13002
12747
  exports.moonUIButtonVariants = buttonVariants;
12748
+ exports.moonUICreateSortableHeader = createSortableHeader;
13003
12749
  exports.moonUISkeletonVariants = skeletonVariants;
13004
12750
  exports.moonUIToggleVariants = toggleVariants;
13005
12751
  exports.popoverContentVariants = popoverContentVariants;