@vritti/quantum-ui 0.3.6 → 0.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.
Files changed (110) hide show
  1. package/dist/Avatar.js +5 -5
  2. package/dist/Checkbox2.js +2 -2
  3. package/dist/ConfirmHost.js +109 -0
  4. package/dist/ConfirmHost.js.map +1 -0
  5. package/dist/Dialog.js +82 -64
  6. package/dist/Dialog.js.map +1 -1
  7. package/dist/DropdownMenu.js +2 -2
  8. package/dist/DropdownMenu.js.map +1 -1
  9. package/dist/Form.js +50 -26
  10. package/dist/Form.js.map +1 -1
  11. package/dist/Progress.js +2 -2
  12. package/dist/RadioGroup.js +2 -2
  13. package/dist/Sidebar.js +1 -1
  14. package/dist/Switch.js +2 -2
  15. package/dist/TabsSkeleton.js +1 -1
  16. package/dist/Toggle.js +1 -1
  17. package/dist/ViewTabs.js +1 -2
  18. package/dist/ViewTabs.js.map +1 -1
  19. package/dist/assets/quantum-ui.css +43 -5
  20. package/dist/cells.js +96 -64
  21. package/dist/cells.js.map +1 -1
  22. package/dist/components/ConfirmHost.js +2 -0
  23. package/dist/components/ConfirmHost.js.map +1 -0
  24. package/dist/components/Dialog.js +1 -1
  25. package/dist/components/RichTextEditor.js +1 -1
  26. package/dist/context/index.js +0 -1
  27. package/dist/context/index.js.map +1 -1
  28. package/dist/dropdown-menu.js +4 -3
  29. package/dist/dropdown-menu.js.map +1 -1
  30. package/dist/image-component.js +1 -1
  31. package/dist/index.js +3 -3
  32. package/dist/index12.js +3 -2
  33. package/dist/index12.js.map +1 -1
  34. package/dist/index13.js +3 -2
  35. package/dist/index13.js.map +1 -1
  36. package/dist/index14.js +7 -6
  37. package/dist/index14.js.map +1 -1
  38. package/dist/index15.js +1 -1
  39. package/dist/index16.js +1 -1
  40. package/dist/index18.js +1 -1
  41. package/dist/index20.js +1 -1
  42. package/dist/index21.js +1 -1
  43. package/dist/index23.js +1 -1
  44. package/dist/index25.js +3 -2534
  45. package/dist/index25.js.map +1 -1
  46. package/dist/index26.js +2526 -22
  47. package/dist/index26.js.map +1 -1
  48. package/dist/index27.js +32 -4
  49. package/dist/index27.js.map +1 -1
  50. package/dist/index28.js +4 -37
  51. package/dist/index28.js.map +1 -1
  52. package/dist/index29.js +1101 -287
  53. package/dist/index29.js.map +1 -1
  54. package/dist/index30.js +36 -8
  55. package/dist/index30.js.map +1 -1
  56. package/dist/index31.js +305 -25
  57. package/dist/index31.js.map +1 -1
  58. package/dist/index32.js +8 -60
  59. package/dist/index32.js.map +1 -1
  60. package/dist/index33.js +30 -11
  61. package/dist/index33.js.map +1 -1
  62. package/dist/index34.js +59 -35
  63. package/dist/index34.js.map +1 -1
  64. package/dist/index35.js +10 -36818
  65. package/dist/index35.js.map +1 -1
  66. package/dist/index36.js +36 -79
  67. package/dist/index36.js.map +1 -1
  68. package/dist/index37.js +36808 -184
  69. package/dist/index37.js.map +1 -1
  70. package/dist/index38.js +84 -0
  71. package/dist/index38.js.map +1 -0
  72. package/dist/index39.js +199 -0
  73. package/dist/index39.js.map +1 -0
  74. package/dist/index4.js +1 -1
  75. package/dist/lib/components/ConfirmHost/ConfirmHost.d.ts +39 -0
  76. package/dist/lib/components/ConfirmHost/ConfirmHost.d.ts.map +1 -0
  77. package/dist/lib/components/ConfirmHost/index.d.ts +2 -0
  78. package/dist/lib/components/ConfirmHost/index.d.ts.map +1 -0
  79. package/dist/lib/components/DataTable/components/DataTableImportDialog.d.ts.map +1 -1
  80. package/dist/lib/components/DataTable/components/DataTableViewTabs.d.ts.map +1 -1
  81. package/dist/lib/components/DataTable/components/DataTableViewsMenu.d.ts.map +1 -1
  82. package/dist/lib/components/DataTable/components/RowActions.d.ts.map +1 -1
  83. package/dist/lib/components/Dialog/Dialog.d.ts +15 -17
  84. package/dist/lib/components/Dialog/Dialog.d.ts.map +1 -1
  85. package/dist/lib/components/Dialog/index.d.ts +2 -2
  86. package/dist/lib/components/Dialog/index.d.ts.map +1 -1
  87. package/dist/lib/components/DropdownMenu/types.d.ts +2 -2
  88. package/dist/lib/components/DropdownMenu/types.d.ts.map +1 -1
  89. package/dist/lib/components/Form/Form.d.ts.map +1 -1
  90. package/dist/lib/components/index.d.ts +1 -0
  91. package/dist/lib/components/index.d.ts.map +1 -1
  92. package/dist/lib/context/index.d.ts +0 -1
  93. package/dist/lib/context/index.d.ts.map +1 -1
  94. package/dist/lib/hooks/useConfirm.d.ts +3 -3
  95. package/dist/lib/hooks/useConfirm.d.ts.map +1 -1
  96. package/dist/trash-2.js +17 -3
  97. package/dist/trash-2.js.map +1 -1
  98. package/dist/useConfirm.js +3 -7
  99. package/dist/useConfirm.js.map +1 -1
  100. package/dist/utils/motion.js +2 -2
  101. package/dist/value.js +1 -1
  102. package/package.json +5 -1
  103. package/dist/Combination.js +0 -1129
  104. package/dist/Combination.js.map +0 -1
  105. package/dist/ConfirmContext.js +0 -77
  106. package/dist/ConfirmContext.js.map +0 -1
  107. package/dist/lib/context/ConfirmContext.d.ts +0 -26
  108. package/dist/lib/context/ConfirmContext.d.ts.map +0 -1
  109. package/dist/plus.js +0 -18
  110. package/dist/plus.js.map +0 -1
package/dist/cells.js CHANGED
@@ -3,7 +3,7 @@ import { c as cn } from './utils.js';
3
3
  import { S as Skeleton } from './Skeleton.js';
4
4
  import { a as useDialog, u as useConfirm } from './useConfirm.js';
5
5
  import { B as Button } from './Button.js';
6
- import { D as Dialog } from './Dialog.js';
6
+ import { D as Dialog, a as DialogActions } from './Dialog.js';
7
7
  import { D as DropdownMenu } from './DropdownMenu.js';
8
8
  import { c as createLucideIcon } from './createLucideIcon.js';
9
9
  import { useMutation, useQueryClient, useQuery } from '@tanstack/react-query';
@@ -19,6 +19,7 @@ import { a as Eye, E as EyeOff } from './eye.js';
19
19
  import { B as Badge } from './Badge.js';
20
20
  import { F as Form } from './Form.js';
21
21
  import { U as UploadFile } from './UploadFile.js';
22
+ import { U as Upload } from './upload.js';
22
23
  import { T as TextAlignJustify, D as Download } from './text-align-justify.js';
23
24
  import { C as CircleCheck } from './circle-check.js';
24
25
  import { S as Select, a as SelectTrigger, b as SelectValue, c as SelectContent, d as SelectItem } from './select2.js';
@@ -36,7 +37,8 @@ import { a as Switch } from './Switch.js';
36
37
  import { a, o as object, s as string } from './schemas.js';
37
38
  import { T as TextField } from './TextField.js';
38
39
  import { S as Save, a as Share2 } from './share-2.js';
39
- import { P as Pencil, T as Trash2 } from './trash-2.js';
40
+ import { P as Pencil, a as Plus, T as Trash2 } from './trash-2.js';
41
+ import { T as TriangleAlert } from './triangle-alert.js';
40
42
  import { pluralize } from './utils/pluralize.js';
41
43
  import { C as Checkbox } from './Checkbox.js';
42
44
  import { g as getConfig } from './index7.js';
@@ -18018,6 +18020,8 @@ const DirectAction = ({ action, disabledAll }) => {
18018
18020
  Dialog,
18019
18021
  {
18020
18022
  handle: dialog,
18023
+ icon: action.icon,
18024
+ iconVariant: action.variant === "destructive" ? "destructive" : "default",
18021
18025
  title: action.dialog.title,
18022
18026
  description: action.dialog.description,
18023
18027
  badgeSlot: action.dialog.badgeSlot,
@@ -21627,6 +21631,7 @@ function DataTableImportDialog({
21627
21631
  Dialog,
21628
21632
  {
21629
21633
  handle: dialogHandle,
21634
+ icon: Upload,
21630
21635
  title,
21631
21636
  description,
21632
21637
  className: !isUploadStep && result && !result.success ? "max-w-3xl" : void 0,
@@ -21707,19 +21712,30 @@ function CreateViewDialog({ tableSlug, open, onClose }) {
21707
21712
  return /* @__PURE__ */ jsx(
21708
21713
  Dialog,
21709
21714
  {
21710
- mode: "form",
21711
21715
  handle,
21716
+ icon: Plus,
21712
21717
  title: "Create New View",
21713
21718
  description: "Save the current filters and sort as a named view.",
21714
- form,
21715
- mutation: mut,
21716
- transformSubmit: (data) => ({
21717
- name: data.name.trim(),
21718
- tableSlug,
21719
- state: useDataTableStore.getState().tables[tableSlug]?.activeState ?? EMPTY_TABLE_STATE
21720
- }),
21721
- submitLabel: "Save",
21722
- children: /* @__PURE__ */ jsx(TextField, { name: "name", label: "View name", placeholder: "e.g. High Region Providers" })
21719
+ content: (close) => /* @__PURE__ */ jsxs(
21720
+ Form,
21721
+ {
21722
+ form,
21723
+ mutation: mut,
21724
+ className: "space-y-4",
21725
+ transformSubmit: (data) => ({
21726
+ name: data.name.trim(),
21727
+ tableSlug,
21728
+ state: useDataTableStore.getState().tables[tableSlug]?.activeState ?? EMPTY_TABLE_STATE
21729
+ }),
21730
+ children: [
21731
+ /* @__PURE__ */ jsx(TextField, { name: "name", label: "View name", placeholder: "e.g. High Region Providers" }),
21732
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
21733
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: close, children: "Cancel" }),
21734
+ /* @__PURE__ */ jsx(Button, { type: "submit", loadingText: "Saving...", children: "Save" })
21735
+ ] })
21736
+ ]
21737
+ }
21738
+ )
21723
21739
  }
21724
21740
  );
21725
21741
  }
@@ -21749,18 +21765,29 @@ function RenameViewDialog({ tableSlug, open, onClose, initialName }) {
21749
21765
  return /* @__PURE__ */ jsx(
21750
21766
  Dialog,
21751
21767
  {
21752
- mode: "form",
21753
21768
  handle,
21769
+ icon: Pencil,
21754
21770
  title: "Rename View",
21755
21771
  description: `Change the name of "${initialName}".`,
21756
- form,
21757
- mutation: mut,
21758
- transformSubmit: (data) => ({
21759
- id: activeViewId ?? "",
21760
- name: data.name.trim()
21761
- }),
21762
- submitLabel: "Rename",
21763
- children: /* @__PURE__ */ jsx(TextField, { name: "name", label: "View name" })
21772
+ content: (close) => /* @__PURE__ */ jsxs(
21773
+ Form,
21774
+ {
21775
+ form,
21776
+ mutation: mut,
21777
+ className: "space-y-4",
21778
+ transformSubmit: (data) => ({
21779
+ id: activeViewId ?? "",
21780
+ name: data.name.trim()
21781
+ }),
21782
+ children: [
21783
+ /* @__PURE__ */ jsx(TextField, { name: "name", label: "View name" }),
21784
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
21785
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: close, children: "Cancel" }),
21786
+ /* @__PURE__ */ jsx(Button, { type: "submit", loadingText: "Saving...", children: "Rename" })
21787
+ ] })
21788
+ ]
21789
+ }
21790
+ )
21764
21791
  }
21765
21792
  );
21766
21793
  }
@@ -21795,52 +21822,55 @@ function ManageViewsDialog({ tableSlug, open, onClose }) {
21795
21822
  if (!v) onClose();
21796
21823
  }
21797
21824
  };
21798
- return /* @__PURE__ */ jsx(
21825
+ return /* @__PURE__ */ jsxs(
21799
21826
  Dialog,
21800
21827
  {
21801
21828
  handle,
21829
+ icon: Settings2,
21802
21830
  title: "Manage Views",
21803
21831
  description: "Share or delete saved views for this table.",
21804
- footer: /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onClose, children: "Close" }),
21805
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 py-2 max-h-64 overflow-y-auto", children: [
21806
- views.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground text-center py-4", children: "No saved views yet." }),
21807
- views.map((view) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between rounded-md px-3 py-2 hover:bg-accent/50", children: [
21808
- /* @__PURE__ */ jsx("span", { className: "text-sm truncate", children: view.name }),
21809
- view.isOwn && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [
21810
- /* @__PURE__ */ jsx(
21811
- Button,
21812
- {
21813
- variant: "ghost",
21814
- size: "icon",
21815
- className: "size-7 text-muted-foreground hover:text-foreground",
21816
- title: view.isShared ? "Make private" : "Share with everyone",
21817
- onClick: () => shareMut.mutate({ id: view.id, isShared: !view.isShared }),
21818
- disabled: shareMut.isPending,
21819
- children: view.isShared ? /* @__PURE__ */ jsx(EyeOff, { className: "size-4" }) : /* @__PURE__ */ jsx(Share2, { className: "size-4" })
21820
- }
21821
- ),
21822
- /* @__PURE__ */ jsx(
21823
- Button,
21824
- {
21825
- variant: "ghost",
21826
- size: "icon",
21827
- className: "size-7 text-destructive hover:text-destructive",
21828
- onClick: async () => {
21829
- const confirmed = await confirm({
21830
- title: `Delete "${view.name}"?`,
21831
- description: "This view will be permanently removed.",
21832
- confirmLabel: "Delete",
21833
- variant: "destructive"
21834
- });
21835
- if (confirmed) deleteMut.mutate(view.id);
21836
- },
21837
- disabled: deleteMut.isPending,
21838
- children: /* @__PURE__ */ jsx(Trash2, { className: "size-4" })
21839
- }
21840
- )
21841
- ] })
21842
- ] }, view.id))
21843
- ] })
21832
+ children: [
21833
+ /* @__PURE__ */ jsxs("div", { className: "flex max-h-80 min-h-32 flex-col gap-1 overflow-y-auto py-1", children: [
21834
+ views.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground text-center py-4", children: "No saved views yet." }),
21835
+ views.map((view) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between rounded-md px-3 py-2 hover:bg-accent/50", children: [
21836
+ /* @__PURE__ */ jsx("span", { className: "text-sm truncate", children: view.name }),
21837
+ view.isOwn && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [
21838
+ /* @__PURE__ */ jsx(
21839
+ Button,
21840
+ {
21841
+ variant: "ghost",
21842
+ size: "icon",
21843
+ className: "size-7 text-muted-foreground hover:text-foreground",
21844
+ title: view.isShared ? "Make private" : "Share with everyone",
21845
+ onClick: () => shareMut.mutate({ id: view.id, isShared: !view.isShared }),
21846
+ disabled: shareMut.isPending,
21847
+ children: view.isShared ? /* @__PURE__ */ jsx(EyeOff, { className: "size-4" }) : /* @__PURE__ */ jsx(Share2, { className: "size-4" })
21848
+ }
21849
+ ),
21850
+ /* @__PURE__ */ jsx(
21851
+ Button,
21852
+ {
21853
+ variant: "ghost",
21854
+ size: "icon",
21855
+ className: "size-7 text-destructive hover:text-destructive",
21856
+ onClick: async () => {
21857
+ const confirmed = await confirm({
21858
+ title: `Delete "${view.name}"?`,
21859
+ description: "This view will be permanently removed.",
21860
+ confirmLabel: "Delete",
21861
+ variant: "destructive"
21862
+ });
21863
+ if (confirmed) deleteMut.mutate(view.id);
21864
+ },
21865
+ disabled: deleteMut.isPending,
21866
+ children: /* @__PURE__ */ jsx(Trash2, { className: "size-4" })
21867
+ }
21868
+ )
21869
+ ] })
21870
+ ] }, view.id))
21871
+ ] }),
21872
+ /* @__PURE__ */ jsx("div", { className: "-mx-6 mt-4 flex flex-col-reverse gap-2 border-t px-6 pt-4 sm:flex-row sm:justify-end", children: /* @__PURE__ */ jsx(Button, { variant: "outline", onClick: onClose, children: "Close" }) })
21873
+ ]
21844
21874
  }
21845
21875
  );
21846
21876
  }
@@ -22027,9 +22057,11 @@ function DataTableViewTabs({ slug }) {
22027
22057
  Dialog,
22028
22058
  {
22029
22059
  handle: dirtyGuard,
22060
+ icon: TriangleAlert,
22061
+ iconVariant: "warning",
22030
22062
  title: "Unsaved Changes",
22031
22063
  description: "This view has unsaved changes. What would you like to do?",
22032
- footer: /* @__PURE__ */ jsxs("div", { className: "flex gap-2 justify-end w-full", children: [
22064
+ children: /* @__PURE__ */ jsxs("div", { className: "flex gap-2 justify-end w-full", children: [
22033
22065
  /* @__PURE__ */ jsx(
22034
22066
  Button,
22035
22067
  {
@@ -22080,7 +22112,7 @@ const densityClasses = {
22080
22112
  };
22081
22113
  const MODE_HEIGHTS = {
22082
22114
  page: "calc(100vh - 280px)",
22083
- tab: "calc(100vh - 328px)",
22115
+ tab: "calc(100vh - 320px)",
22084
22116
  compact: "calc(100vh - 570px)"
22085
22117
  };
22086
22118
  function buildNoResultsDescription(flags) {