@gearbox-protocol/permissionless-ui 1.0.0

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 (104) hide show
  1. package/README.md +7 -0
  2. package/dist/cjs/components/alert-dialog.js +160 -0
  3. package/dist/cjs/components/back-button.js +57 -0
  4. package/dist/cjs/components/badge.js +61 -0
  5. package/dist/cjs/components/buttons/button.js +88 -0
  6. package/dist/cjs/components/buttons/copy-button.js +62 -0
  7. package/dist/cjs/components/buttons/external-button.js +62 -0
  8. package/dist/cjs/components/buttons/tab-button.js +60 -0
  9. package/dist/cjs/components/card.js +103 -0
  10. package/dist/cjs/components/checkbox.js +61 -0
  11. package/dist/cjs/components/danger-zone.js +35 -0
  12. package/dist/cjs/components/dialog.js +137 -0
  13. package/dist/cjs/components/dropdown-menu.js +200 -0
  14. package/dist/cjs/components/editable-table/edit-button.js +46 -0
  15. package/dist/cjs/components/editable-table/editable-table.js +93 -0
  16. package/dist/cjs/components/editable-table/updated-value.js +73 -0
  17. package/dist/cjs/components/index.js +72 -0
  18. package/dist/cjs/components/input.js +69 -0
  19. package/dist/cjs/components/label.js +54 -0
  20. package/dist/cjs/components/page-layout.js +36 -0
  21. package/dist/cjs/components/search-bar.js +66 -0
  22. package/dist/cjs/components/select.js +167 -0
  23. package/dist/cjs/components/skeleton.js +51 -0
  24. package/dist/cjs/components/table.js +121 -0
  25. package/dist/cjs/components/tabs.js +84 -0
  26. package/dist/cjs/components/textarea.js +56 -0
  27. package/dist/cjs/components/token-icon.js +57 -0
  28. package/dist/cjs/components/tooltip.js +63 -0
  29. package/dist/cjs/configs/index.js +38 -0
  30. package/dist/cjs/configs/tailwind.config.js +84 -0
  31. package/dist/cjs/index.js +24 -0
  32. package/dist/cjs/package.json +1 -0
  33. package/dist/cjs/utils/cn.js +32 -0
  34. package/dist/cjs/utils/copy.js +35 -0
  35. package/dist/cjs/utils/index.js +32 -0
  36. package/dist/esm/components/alert-dialog.js +116 -0
  37. package/dist/esm/components/back-button.js +23 -0
  38. package/dist/esm/components/badge.js +26 -0
  39. package/dist/esm/components/buttons/button.js +53 -0
  40. package/dist/esm/components/buttons/copy-button.js +28 -0
  41. package/dist/esm/components/buttons/external-button.js +28 -0
  42. package/dist/esm/components/buttons/tab-button.js +26 -0
  43. package/dist/esm/components/card.js +64 -0
  44. package/dist/esm/components/checkbox.js +27 -0
  45. package/dist/esm/components/danger-zone.js +11 -0
  46. package/dist/esm/components/dialog.js +97 -0
  47. package/dist/esm/components/dropdown-menu.js +152 -0
  48. package/dist/esm/components/editable-table/edit-button.js +22 -0
  49. package/dist/esm/components/editable-table/editable-table.js +68 -0
  50. package/dist/esm/components/editable-table/updated-value.js +49 -0
  51. package/dist/esm/components/index.js +26 -0
  52. package/dist/esm/components/input.js +35 -0
  53. package/dist/esm/components/label.js +20 -0
  54. package/dist/esm/components/page-layout.js +12 -0
  55. package/dist/esm/components/search-bar.js +42 -0
  56. package/dist/esm/components/select.js +124 -0
  57. package/dist/esm/components/skeleton.js +17 -0
  58. package/dist/esm/components/table.js +80 -0
  59. package/dist/esm/components/tabs.js +47 -0
  60. package/dist/esm/components/textarea.js +22 -0
  61. package/dist/esm/components/token-icon.js +23 -0
  62. package/dist/esm/components/tooltip.js +26 -0
  63. package/dist/esm/configs/index.js +4 -0
  64. package/dist/esm/configs/tailwind.config.js +64 -0
  65. package/dist/esm/index.js +2 -0
  66. package/dist/esm/package.json +1 -0
  67. package/dist/esm/utils/cn.js +8 -0
  68. package/dist/esm/utils/copy.js +11 -0
  69. package/dist/esm/utils/index.js +6 -0
  70. package/dist/globals.css +88 -0
  71. package/dist/types/components/alert-dialog.d.ts +20 -0
  72. package/dist/types/components/back-button.d.ts +7 -0
  73. package/dist/types/components/badge.d.ts +9 -0
  74. package/dist/types/components/buttons/button.d.ts +11 -0
  75. package/dist/types/components/buttons/copy-button.d.ts +8 -0
  76. package/dist/types/components/buttons/external-button.d.ts +7 -0
  77. package/dist/types/components/buttons/tab-button.d.ts +8 -0
  78. package/dist/types/components/card.d.ts +8 -0
  79. package/dist/types/components/checkbox.d.ts +4 -0
  80. package/dist/types/components/danger-zone.d.ts +5 -0
  81. package/dist/types/components/dialog.d.ts +16 -0
  82. package/dist/types/components/dropdown-menu.d.ts +27 -0
  83. package/dist/types/components/editable-table/edit-button.d.ts +7 -0
  84. package/dist/types/components/editable-table/editable-table.d.ts +31 -0
  85. package/dist/types/components/editable-table/updated-value.d.ts +12 -0
  86. package/dist/types/components/index.d.ts +26 -0
  87. package/dist/types/components/input.d.ts +7 -0
  88. package/dist/types/components/label.d.ts +5 -0
  89. package/dist/types/components/page-layout.d.ts +10 -0
  90. package/dist/types/components/search-bar.d.ts +8 -0
  91. package/dist/types/components/select.d.ts +13 -0
  92. package/dist/types/components/skeleton.d.ts +2 -0
  93. package/dist/types/components/table.d.ts +10 -0
  94. package/dist/types/components/tabs.d.ts +7 -0
  95. package/dist/types/components/textarea.d.ts +4 -0
  96. package/dist/types/components/token-icon.d.ts +6 -0
  97. package/dist/types/components/tooltip.d.ts +7 -0
  98. package/dist/types/configs/index.d.ts +1 -0
  99. package/dist/types/configs/tailwind.config.d.ts +3 -0
  100. package/dist/types/index.d.ts +2 -0
  101. package/dist/types/utils/cn.d.ts +2 -0
  102. package/dist/types/utils/copy.d.ts +4 -0
  103. package/dist/types/utils/index.d.ts +3 -0
  104. package/package.json +93 -0
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var checkbox_exports = {};
30
+ __export(checkbox_exports, {
31
+ Checkbox: () => Checkbox
32
+ });
33
+ module.exports = __toCommonJS(checkbox_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
36
+ var import_lucide_react = require("lucide-react");
37
+ var React = __toESM(require("react"));
38
+ var import_utils = __toESM(require('../utils/index.js'));
39
+ const Checkbox = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
40
+ CheckboxPrimitive.Root,
41
+ {
42
+ ref,
43
+ className: (0, import_utils.default)(
44
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
45
+ className
46
+ ),
47
+ ...props,
48
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
+ CheckboxPrimitive.Indicator,
50
+ {
51
+ className: (0, import_utils.default)("flex items-center justify-center text-current"),
52
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-4 w-4" })
53
+ }
54
+ )
55
+ }
56
+ ));
57
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ Checkbox
61
+ });
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var danger_zone_exports = {};
20
+ __export(danger_zone_exports, {
21
+ DangerZone: () => DangerZone
22
+ });
23
+ module.exports = __toCommonJS(danger_zone_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_card = require('./card.js');
26
+ function DangerZone({ children }) {
27
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.Card, { className: "border-destructive", children: [
28
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_card.CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_card.CardTitle, { className: "text-destructive", children: "Danger Zone" }) }),
29
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_card.CardContent, { children })
30
+ ] });
31
+ }
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ DangerZone
35
+ });
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var dialog_exports = {};
30
+ __export(dialog_exports, {
31
+ Dialog: () => Dialog,
32
+ DialogContent: () => DialogContent,
33
+ DialogDescription: () => DialogDescription,
34
+ DialogFooter: () => DialogFooter,
35
+ DialogHeader: () => DialogHeader,
36
+ DialogTitle: () => DialogTitle,
37
+ DialogTrigger: () => DialogTrigger
38
+ });
39
+ module.exports = __toCommonJS(dialog_exports);
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
42
+ var import_lucide_react = require("lucide-react");
43
+ var React = __toESM(require("react"));
44
+ var import_utils = __toESM(require('../utils/index.js'));
45
+ const Dialog = DialogPrimitive.Root;
46
+ const DialogTrigger = DialogPrimitive.Trigger;
47
+ const DialogPortal = DialogPrimitive.Portal;
48
+ const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
+ DialogPrimitive.Overlay,
50
+ {
51
+ ref,
52
+ className: (0, import_utils.default)(
53
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
54
+ className
55
+ ),
56
+ ...props
57
+ }
58
+ ));
59
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
60
+ const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DialogPortal, { children: [
61
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlay, {}),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
63
+ DialogPrimitive.Content,
64
+ {
65
+ ref,
66
+ className: (0, import_utils.default)(
67
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
68
+ className
69
+ ),
70
+ ...props,
71
+ children: [
72
+ children,
73
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-4 w-4" }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Close" })
76
+ ] })
77
+ ]
78
+ }
79
+ )
80
+ ] }));
81
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
82
+ const DialogHeader = ({
83
+ className,
84
+ ...props
85
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
+ "div",
87
+ {
88
+ className: (0, import_utils.default)(
89
+ "flex flex-col space-y-1.5 text-center sm:text-left",
90
+ className
91
+ ),
92
+ ...props
93
+ }
94
+ );
95
+ DialogHeader.displayName = "DialogHeader";
96
+ const DialogFooter = ({
97
+ className,
98
+ ...props
99
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
100
+ "div",
101
+ {
102
+ className: (0, import_utils.default)(
103
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
104
+ className
105
+ ),
106
+ ...props
107
+ }
108
+ );
109
+ DialogFooter.displayName = "DialogFooter";
110
+ const DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
111
+ DialogPrimitive.Title,
112
+ {
113
+ ref,
114
+ className: (0, import_utils.default)("text-3xl font-bold mb-6 text-white", className),
115
+ ...props
116
+ }
117
+ ));
118
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
119
+ const DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
+ DialogPrimitive.Description,
121
+ {
122
+ ref,
123
+ className: (0, import_utils.default)("text-sm text-muted-foreground", className),
124
+ ...props
125
+ }
126
+ ));
127
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
128
+ // Annotate the CommonJS export names for ESM import in node:
129
+ 0 && (module.exports = {
130
+ Dialog,
131
+ DialogContent,
132
+ DialogDescription,
133
+ DialogFooter,
134
+ DialogHeader,
135
+ DialogTitle,
136
+ DialogTrigger
137
+ });
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var dropdown_menu_exports = {};
30
+ __export(dropdown_menu_exports, {
31
+ DropdownMenu: () => DropdownMenu,
32
+ DropdownMenuCheckboxItem: () => DropdownMenuCheckboxItem,
33
+ DropdownMenuContent: () => DropdownMenuContent,
34
+ DropdownMenuGroup: () => DropdownMenuGroup,
35
+ DropdownMenuItem: () => DropdownMenuItem,
36
+ DropdownMenuLabel: () => DropdownMenuLabel,
37
+ DropdownMenuPortal: () => DropdownMenuPortal,
38
+ DropdownMenuRadioGroup: () => DropdownMenuRadioGroup,
39
+ DropdownMenuRadioItem: () => DropdownMenuRadioItem,
40
+ DropdownMenuSeparator: () => DropdownMenuSeparator,
41
+ DropdownMenuShortcut: () => DropdownMenuShortcut,
42
+ DropdownMenuSub: () => DropdownMenuSub,
43
+ DropdownMenuSubContent: () => DropdownMenuSubContent,
44
+ DropdownMenuSubTrigger: () => DropdownMenuSubTrigger,
45
+ DropdownMenuTrigger: () => DropdownMenuTrigger
46
+ });
47
+ module.exports = __toCommonJS(dropdown_menu_exports);
48
+ var import_jsx_runtime = require("react/jsx-runtime");
49
+ var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
50
+ var import_lucide_react = require("lucide-react");
51
+ var React = __toESM(require("react"));
52
+ var import_utils = __toESM(require('../utils/index.js'));
53
+ const DropdownMenu = DropdownMenuPrimitive.Root;
54
+ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
55
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
56
+ const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
57
+ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
58
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
59
+ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
60
+ DropdownMenuPrimitive.SubTrigger,
61
+ {
62
+ ref,
63
+ className: (0, import_utils.default)(
64
+ "flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
65
+ inset && "pl-8",
66
+ className
67
+ ),
68
+ ...props,
69
+ children: [
70
+ children,
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronRight, { className: "ml-auto" })
72
+ ]
73
+ }
74
+ ));
75
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
76
+ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
77
+ DropdownMenuPrimitive.SubContent,
78
+ {
79
+ ref,
80
+ className: (0, import_utils.default)(
81
+ "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",
82
+ className
83
+ ),
84
+ ...props
85
+ }
86
+ ));
87
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
88
+ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
+ DropdownMenuPrimitive.Content,
90
+ {
91
+ ref,
92
+ sideOffset,
93
+ className: (0, import_utils.default)(
94
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
95
+ "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",
96
+ className
97
+ ),
98
+ ...props
99
+ }
100
+ ) }));
101
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
102
+ const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
103
+ DropdownMenuPrimitive.Item,
104
+ {
105
+ ref,
106
+ className: (0, import_utils.default)(
107
+ "relative flex cursor-default select-none items-center gap-2 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 [&>svg]:size-4 [&>svg]:shrink-0",
108
+ inset && "pl-8",
109
+ className
110
+ ),
111
+ ...props
112
+ }
113
+ ));
114
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
115
+ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
116
+ DropdownMenuPrimitive.CheckboxItem,
117
+ {
118
+ ref,
119
+ className: (0, import_utils.default)(
120
+ "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",
121
+ className
122
+ ),
123
+ checked,
124
+ ...props,
125
+ children: [
126
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-4 w-4" }) }) }),
127
+ children
128
+ ]
129
+ }
130
+ ));
131
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
132
+ const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
133
+ DropdownMenuPrimitive.RadioItem,
134
+ {
135
+ ref,
136
+ className: (0, import_utils.default)(
137
+ "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",
138
+ className
139
+ ),
140
+ ...props,
141
+ children: [
142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Circle, { className: "h-2 w-2 fill-current" }) }) }),
143
+ children
144
+ ]
145
+ }
146
+ ));
147
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
148
+ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
+ DropdownMenuPrimitive.Label,
150
+ {
151
+ ref,
152
+ className: (0, import_utils.default)(
153
+ "px-2 py-1.5 text-sm font-semibold",
154
+ inset && "pl-8",
155
+ className
156
+ ),
157
+ ...props
158
+ }
159
+ ));
160
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
161
+ const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
162
+ DropdownMenuPrimitive.Separator,
163
+ {
164
+ ref,
165
+ className: (0, import_utils.default)("-mx-1 my-1 h-px bg-muted", className),
166
+ ...props
167
+ }
168
+ ));
169
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
170
+ const DropdownMenuShortcut = ({
171
+ className,
172
+ ...props
173
+ }) => {
174
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
175
+ "span",
176
+ {
177
+ className: (0, import_utils.default)("ml-auto text-xs tracking-widest opacity-60", className),
178
+ ...props
179
+ }
180
+ );
181
+ };
182
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
183
+ // Annotate the CommonJS export names for ESM import in node:
184
+ 0 && (module.exports = {
185
+ DropdownMenu,
186
+ DropdownMenuCheckboxItem,
187
+ DropdownMenuContent,
188
+ DropdownMenuGroup,
189
+ DropdownMenuItem,
190
+ DropdownMenuLabel,
191
+ DropdownMenuPortal,
192
+ DropdownMenuRadioGroup,
193
+ DropdownMenuRadioItem,
194
+ DropdownMenuSeparator,
195
+ DropdownMenuShortcut,
196
+ DropdownMenuSub,
197
+ DropdownMenuSubContent,
198
+ DropdownMenuSubTrigger,
199
+ DropdownMenuTrigger
200
+ });
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var edit_button_exports = {};
20
+ __export(edit_button_exports, {
21
+ EditButton: () => EditButton
22
+ });
23
+ module.exports = __toCommonJS(edit_button_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_lucide_react = require("lucide-react");
26
+ var import_button = require('../buttons/button.js');
27
+ function EditButton({
28
+ onClick,
29
+ customButton,
30
+ disabled
31
+ }) {
32
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: customButton ? "px-4 py-2" : "px-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
33
+ import_button.Button,
34
+ {
35
+ className: customButton ? "p-0 h-fit hover:bg-accent/0" : "p-2 h-fit",
36
+ variant: "ghost",
37
+ onClick,
38
+ disabled,
39
+ children: customButton ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Edit, { className: "h-4 w-4" })
40
+ }
41
+ ) });
42
+ }
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ EditButton
46
+ });
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var editable_table_exports = {};
20
+ __export(editable_table_exports, {
21
+ TableCellUpdatable: () => TableCellUpdatable,
22
+ TableEditable: () => TableEditable
23
+ });
24
+ module.exports = __toCommonJS(editable_table_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_tab_button = require('../buttons/tab-button.js');
27
+ var import_table = require('../table.js');
28
+ var import_updated_value = require('./updated-value.js');
29
+ function TableCellUpdatable({
30
+ oldValue,
31
+ newValue,
32
+ onEdit,
33
+ isEditable = true,
34
+ className,
35
+ align = "right",
36
+ customButton,
37
+ postfix,
38
+ disabled,
39
+ nowrap
40
+ }) {
41
+ const alignmentClass = {
42
+ left: "justify-start",
43
+ right: "justify-end",
44
+ center: "justify-center"
45
+ }[align];
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_table.TableCell, { className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `flex ${alignmentClass} w-full text-${align}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
+ import_updated_value.UpdatedValue,
48
+ {
49
+ oldValue,
50
+ newValue,
51
+ onEdit,
52
+ isEditable,
53
+ customButton,
54
+ postfix,
55
+ disabled,
56
+ nowrap
57
+ }
58
+ ) }) });
59
+ }
60
+ function TableEditable({
61
+ title,
62
+ onNew,
63
+ newButtonText = "New",
64
+ buttonLoadingText = "Adding...",
65
+ isLoading,
66
+ actions,
67
+ children,
68
+ disabled = false
69
+ }) {
70
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex justify-between items-center", children: [
72
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-2xl font-bold", children: title }),
73
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
74
+ onNew && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tab_button.TabButton, { onClick: onNew, disabled: isLoading || disabled, children: isLoading ? buttonLoadingText : newButtonText }),
75
+ actions?.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
+ import_tab_button.TabButton,
77
+ {
78
+ onClick: action.onClick,
79
+ disabled: action.isLoading || disabled,
80
+ children: action.isLoading ? action.loadingText || "Loading..." : action.text
81
+ },
82
+ index
83
+ ))
84
+ ] })
85
+ ] }),
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "rounded-lg border", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_table.Table, { children }) })
87
+ ] });
88
+ }
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ TableCellUpdatable,
92
+ TableEditable
93
+ });
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var updated_value_exports = {};
20
+ __export(updated_value_exports, {
21
+ UpdatedValue: () => UpdatedValue
22
+ });
23
+ module.exports = __toCommonJS(updated_value_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_edit_button = require('./edit-button.js');
26
+ function UpdatedValue({
27
+ oldValue,
28
+ newValue,
29
+ onEdit,
30
+ isEditable = true,
31
+ customButton,
32
+ postfix,
33
+ disabled = false,
34
+ nowrap = false
35
+ }) {
36
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center ", children: [
37
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex items-center gap-2", children: oldValue !== void 0 && oldValue !== newValue ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
38
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
39
+ "span",
40
+ {
41
+ className: `line-through text-muted-foreground ${nowrap ? "whitespace-nowrap" : ""}`,
42
+ children: oldValue
43
+ }
44
+ ),
45
+ " \u2192 ",
46
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: nowrap ? "whitespace-nowrap" : "", children: [
47
+ newValue,
48
+ postfix && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-muted-foreground", children: [
49
+ " ",
50
+ postfix
51
+ ] })
52
+ ] })
53
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: nowrap ? "whitespace-nowrap" : "", children: [
54
+ newValue,
55
+ postfix && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-muted-foreground", children: [
56
+ " ",
57
+ postfix
58
+ ] })
59
+ ] }) }),
60
+ isEditable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
61
+ import_edit_button.EditButton,
62
+ {
63
+ onClick: onEdit,
64
+ customButton,
65
+ disabled
66
+ }
67
+ ) })
68
+ ] });
69
+ }
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ UpdatedValue
73
+ });