@appcorp/stellar-solutions-modules 0.1.33 → 0.1.35

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 (157) hide show
  1. package/README.md +128 -19
  2. package/components/theme-switcher.d.ts +4 -0
  3. package/components/theme-switcher.js +60 -0
  4. package/components/ui/badge.d.ts +9 -0
  5. package/components/ui/badge.js +82 -0
  6. package/components/ui/button.d.ts +10 -0
  7. package/components/ui/button.js +91 -0
  8. package/components/ui/checkbox.d.ts +9 -0
  9. package/components/ui/checkbox.js +87 -0
  10. package/components/ui/drawer.d.ts +13 -0
  11. package/components/ui/drawer.js +115 -0
  12. package/components/ui/dropdown-menu.d.ts +25 -0
  13. package/components/ui/dropdown-menu.js +148 -0
  14. package/components/ui/enhanced-table-footer-action.d.ts +34 -0
  15. package/components/ui/enhanced-table-footer-action.js +117 -0
  16. package/components/ui/enhanced-table-footer-page.d.ts +32 -0
  17. package/components/ui/enhanced-table-footer-page.js +140 -0
  18. package/components/ui/enhanced-table-footer-pagination.d.ts +38 -0
  19. package/components/ui/enhanced-table-footer-pagination.js +122 -0
  20. package/components/ui/enhanced-table-header-action.d.ts +7 -0
  21. package/components/ui/enhanced-table-header-action.js +21 -0
  22. package/components/ui/enhanced-table-header-search.d.ts +12 -0
  23. package/components/ui/enhanced-table-header-search.js +17 -0
  24. package/components/ui/enhanced-table.d.ts +65 -0
  25. package/components/ui/enhanced-table.js +87 -0
  26. package/components/ui/input.d.ts +8 -0
  27. package/components/ui/input.js +86 -0
  28. package/components/ui/label.d.ts +7 -0
  29. package/components/ui/label.js +68 -0
  30. package/components/ui/popover.d.ts +7 -0
  31. package/components/ui/popover.js +82 -0
  32. package/components/ui/select.d.ts +15 -0
  33. package/components/ui/select.js +127 -0
  34. package/components/ui/sonner.d.ts +4 -0
  35. package/components/ui/sonner.js +54 -0
  36. package/components/ui/switch.d.ts +9 -0
  37. package/components/ui/switch.js +89 -0
  38. package/components/ui/table.d.ts +10 -0
  39. package/components/ui/table.js +101 -0
  40. package/global-modules/bank/actions.d.ts +200 -0
  41. package/global-modules/bank/actions.js +124 -0
  42. package/global-modules/bank/bank.d.ts +2 -0
  43. package/global-modules/bank/bank.js +87 -0
  44. package/global-modules/bank/constants.d.ts +45 -0
  45. package/global-modules/bank/constants.js +98 -0
  46. package/global-modules/bank/context.d.ts +41 -0
  47. package/global-modules/bank/context.js +419 -0
  48. package/global-modules/bank/drawer.d.ts +31 -0
  49. package/global-modules/bank/drawer.js +114 -0
  50. package/global-modules/bank/form.d.ts +22 -0
  51. package/global-modules/bank/form.js +68 -0
  52. package/global-modules/bank/reducer.d.ts +25 -0
  53. package/global-modules/bank/reducer.js +161 -0
  54. package/global-modules/bank/types.d.ts +217 -0
  55. package/global-modules/bank/types.js +81 -0
  56. package/global-modules/bank/validate.d.ts +13 -0
  57. package/global-modules/bank/validate.js +22 -0
  58. package/global-modules/branch/actions.d.ts +154 -37
  59. package/global-modules/branch/actions.js +148 -6
  60. package/global-modules/branch/branch.d.ts +2 -2
  61. package/global-modules/branch/branch.js +46 -32
  62. package/global-modules/branch/constants.d.ts +34 -24
  63. package/global-modules/branch/constants.js +101 -122
  64. package/global-modules/branch/context.d.ts +33 -2
  65. package/global-modules/branch/context.js +195 -164
  66. package/global-modules/branch/drawer.d.ts +26 -3
  67. package/global-modules/branch/drawer.js +101 -6
  68. package/global-modules/branch/form.d.ts +15 -1
  69. package/global-modules/branch/form.js +54 -71
  70. package/global-modules/branch/reducer.d.ts +23 -2
  71. package/global-modules/branch/reducer.js +148 -118
  72. package/global-modules/branch/types.d.ts +196 -69
  73. package/global-modules/branch/types.js +66 -7
  74. package/global-modules/branch/validate.d.ts +1 -1
  75. package/global-modules/branch/validate.js +15 -11
  76. package/global-modules/payment-mode/actions.d.ts +154 -37
  77. package/global-modules/payment-mode/actions.js +148 -6
  78. package/global-modules/payment-mode/constants.d.ts +34 -17
  79. package/global-modules/payment-mode/constants.js +90 -66
  80. package/global-modules/payment-mode/context.d.ts +33 -2
  81. package/global-modules/payment-mode/context.js +185 -163
  82. package/global-modules/payment-mode/drawer.d.ts +26 -3
  83. package/global-modules/payment-mode/drawer.js +104 -9
  84. package/global-modules/payment-mode/form.d.ts +16 -2
  85. package/global-modules/payment-mode/form.js +45 -74
  86. package/global-modules/payment-mode/payment-mode.d.ts +25 -2
  87. package/global-modules/payment-mode/payment-mode.js +90 -23
  88. package/global-modules/payment-mode/reducer.d.ts +23 -2
  89. package/global-modules/payment-mode/reducer.js +140 -114
  90. package/global-modules/payment-mode/types.d.ts +327 -112
  91. package/global-modules/payment-mode/types.js +162 -11
  92. package/global-modules/payment-mode/validate.d.ts +1 -1
  93. package/global-modules/payment-mode/validate.js +7 -5
  94. package/global-modules/preferences/actions.d.ts +126 -27
  95. package/global-modules/preferences/actions.js +128 -4
  96. package/global-modules/preferences/constants.d.ts +46 -31
  97. package/global-modules/preferences/constants.js +129 -66
  98. package/global-modules/preferences/context.d.ts +2 -2
  99. package/global-modules/preferences/context.js +43 -43
  100. package/global-modules/preferences/currency.js +15 -10
  101. package/global-modules/preferences/preferences.d.ts +2 -2
  102. package/global-modules/preferences/preferences.js +3 -5
  103. package/global-modules/preferences/validate.d.ts +1 -1
  104. package/global-modules/preferences/validate.js +7 -7
  105. package/global-modules/tax/actions.d.ts +155 -38
  106. package/global-modules/tax/actions.js +149 -7
  107. package/global-modules/tax/constants.d.ts +31 -39
  108. package/global-modules/tax/constants.js +83 -114
  109. package/global-modules/tax/context.d.ts +33 -2
  110. package/global-modules/tax/context.js +146 -132
  111. package/global-modules/tax/drawer.d.ts +26 -3
  112. package/global-modules/tax/drawer.js +101 -6
  113. package/global-modules/tax/form.d.ts +20 -3
  114. package/global-modules/tax/form.js +101 -74
  115. package/global-modules/tax/reducer.d.ts +23 -2
  116. package/global-modules/tax/reducer.js +143 -24
  117. package/global-modules/tax/tax.d.ts +25 -2
  118. package/global-modules/tax/tax.js +92 -28
  119. package/global-modules/tax/types.d.ts +332 -102
  120. package/global-modules/tax/types.js +179 -11
  121. package/global-modules/tax/validate.d.ts +1 -1
  122. package/global-modules/tax/validate.js +9 -8
  123. package/hooks/use-rtl.d.ts +44 -0
  124. package/hooks/use-rtl.js +75 -0
  125. package/lib/themes.d.ts +147 -0
  126. package/lib/themes.js +150 -0
  127. package/lib/toast-utils.d.ts +44 -0
  128. package/lib/toast-utils.js +212 -0
  129. package/lib/utils.d.ts +2 -0
  130. package/lib/utils.js +12 -0
  131. package/package.json +21 -4
  132. package/supabase/supabase.d.ts +80 -1
  133. package/supabase/supabase.js +281 -6
  134. package/global-modules/branch/form-elements.d.ts +0 -3
  135. package/global-modules/branch/form-elements.js +0 -41
  136. package/global-modules/payment-mode/form-elements.d.ts +0 -3
  137. package/global-modules/payment-mode/form-elements.js +0 -41
  138. package/global-modules/preferences/bank.d.ts +0 -2
  139. package/global-modules/preferences/bank.js +0 -11
  140. package/global-modules/preferences/branch-drawer.js +0 -36
  141. package/global-modules/preferences/branch-form-elements.js +0 -30
  142. package/global-modules/preferences/branch-form.d.ts +0 -0
  143. package/global-modules/preferences/branch-form.js +0 -33
  144. package/global-modules/preferences/branch.d.ts +0 -0
  145. package/global-modules/preferences/branch.js +0 -106
  146. package/global-modules/preferences/payment-mode-drawer.d.ts +0 -0
  147. package/global-modules/preferences/payment-mode-drawer.js +0 -36
  148. package/global-modules/preferences/payment-mode-form-elements.d.ts +0 -0
  149. package/global-modules/preferences/payment-mode-form-elements.js +0 -30
  150. package/global-modules/preferences/payment-mode-form.d.ts +0 -0
  151. package/global-modules/preferences/payment-mode-form.js +0 -33
  152. package/global-modules/preferences/payment-mode.d.ts +0 -0
  153. package/global-modules/preferences/payment-mode.js +0 -94
  154. package/global-modules/tax/form-elements.d.ts +0 -3
  155. package/global-modules/tax/form-elements.js +0 -41
  156. /package/{global-modules/preferences/branch-drawer.d.ts → constants.d.ts} +0 -0
  157. /package/{global-modules/preferences/branch-form-elements.d.ts → constants.js} +0 -0
@@ -0,0 +1,127 @@
1
+ "use client";
2
+ "use strict";
3
+ var __assign = (this && this.__assign) || function () {
4
+ __assign = Object.assign || function(t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
+ t[p] = s[p];
9
+ }
10
+ return t;
11
+ };
12
+ return __assign.apply(this, arguments);
13
+ };
14
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ var desc = Object.getOwnPropertyDescriptor(m, k);
17
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
+ desc = { enumerable: true, get: function() { return m[k]; } };
19
+ }
20
+ Object.defineProperty(o, k2, desc);
21
+ }) : (function(o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ }));
25
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
27
+ }) : function(o, v) {
28
+ o["default"] = v;
29
+ });
30
+ var __importStar = (this && this.__importStar) || (function () {
31
+ var ownKeys = function(o) {
32
+ ownKeys = Object.getOwnPropertyNames || function (o) {
33
+ var ar = [];
34
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
35
+ return ar;
36
+ };
37
+ return ownKeys(o);
38
+ };
39
+ return function (mod) {
40
+ if (mod && mod.__esModule) return mod;
41
+ var result = {};
42
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ })();
47
+ var __rest = (this && this.__rest) || function (s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
+ t[p[i]] = s[p[i]];
55
+ }
56
+ return t;
57
+ };
58
+ Object.defineProperty(exports, "__esModule", { value: true });
59
+ exports.Select = Select;
60
+ exports.SelectContent = SelectContent;
61
+ exports.SelectGroup = SelectGroup;
62
+ exports.SelectItem = SelectItem;
63
+ exports.SelectLabel = SelectLabel;
64
+ exports.SelectScrollDownButton = SelectScrollDownButton;
65
+ exports.SelectScrollUpButton = SelectScrollUpButton;
66
+ exports.SelectSeparator = SelectSeparator;
67
+ exports.SelectTrigger = SelectTrigger;
68
+ exports.SelectValue = SelectValue;
69
+ var React = __importStar(require("react"));
70
+ var SelectPrimitive = __importStar(require("@radix-ui/react-select"));
71
+ var lucide_react_1 = require("lucide-react");
72
+ var utils_1 = require("@/lib/utils");
73
+ function Select(_a) {
74
+ var props = __rest(_a, []);
75
+ return React.createElement(SelectPrimitive.Root, __assign({ "data-slot": "select" }, props));
76
+ }
77
+ function SelectGroup(_a) {
78
+ var props = __rest(_a, []);
79
+ return React.createElement(SelectPrimitive.Group, __assign({ "data-slot": "select-group" }, props));
80
+ }
81
+ function SelectValue(_a) {
82
+ var props = __rest(_a, []);
83
+ return React.createElement(SelectPrimitive.Value, __assign({ "data-slot": "select-value" }, props));
84
+ }
85
+ function SelectTrigger(_a) {
86
+ var className = _a.className, _b = _a.size, size = _b === void 0 ? "default" : _b, children = _a.children, props = __rest(_a, ["className", "size", "children"]);
87
+ return (React.createElement(SelectPrimitive.Trigger, __assign({ "data-slot": "select-trigger", "data-size": size, className: (0, utils_1.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className) }, props),
88
+ children,
89
+ React.createElement(SelectPrimitive.Icon, { asChild: true },
90
+ React.createElement(lucide_react_1.ChevronDownIcon, { className: "size-4 opacity-50" }))));
91
+ }
92
+ function SelectContent(_a) {
93
+ var className = _a.className, children = _a.children, _b = _a.position, position = _b === void 0 ? "popper" : _b, props = __rest(_a, ["className", "children", "position"]);
94
+ return (React.createElement(SelectPrimitive.Portal, null,
95
+ React.createElement(SelectPrimitive.Content, __assign({ "data-slot": "select-content", className: (0, utils_1.cn)("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" &&
96
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position }, props),
97
+ React.createElement(SelectScrollUpButton, null),
98
+ React.createElement(SelectPrimitive.Viewport, { className: (0, utils_1.cn)("p-1", position === "popper" &&
99
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1") }, children),
100
+ React.createElement(SelectScrollDownButton, null))));
101
+ }
102
+ function SelectLabel(_a) {
103
+ var className = _a.className, props = __rest(_a, ["className"]);
104
+ return (React.createElement(SelectPrimitive.Label, __assign({ "data-slot": "select-label", className: (0, utils_1.cn)("text-muted-foreground px-2 py-1.5 text-xs", className) }, props)));
105
+ }
106
+ function SelectItem(_a) {
107
+ var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
108
+ return (React.createElement(SelectPrimitive.Item, __assign({ "data-slot": "select-item", className: (0, utils_1.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className) }, props),
109
+ React.createElement("span", { className: "absolute right-2 flex size-3.5 items-center justify-center" },
110
+ React.createElement(SelectPrimitive.ItemIndicator, null,
111
+ React.createElement(lucide_react_1.CheckIcon, { className: "size-4" }))),
112
+ React.createElement(SelectPrimitive.ItemText, null, children)));
113
+ }
114
+ function SelectSeparator(_a) {
115
+ var className = _a.className, props = __rest(_a, ["className"]);
116
+ return (React.createElement(SelectPrimitive.Separator, __assign({ "data-slot": "select-separator", className: (0, utils_1.cn)("bg-border pointer-events-none -mx-1 my-1 h-px", className) }, props)));
117
+ }
118
+ function SelectScrollUpButton(_a) {
119
+ var className = _a.className, props = __rest(_a, ["className"]);
120
+ return (React.createElement(SelectPrimitive.ScrollUpButton, __assign({ "data-slot": "select-scroll-up-button", className: (0, utils_1.cn)("flex cursor-default items-center justify-center py-1", className) }, props),
121
+ React.createElement(lucide_react_1.ChevronUpIcon, { className: "size-4" })));
122
+ }
123
+ function SelectScrollDownButton(_a) {
124
+ var className = _a.className, props = __rest(_a, ["className"]);
125
+ return (React.createElement(SelectPrimitive.ScrollDownButton, __assign({ "data-slot": "select-scroll-down-button", className: (0, utils_1.cn)("flex cursor-default items-center justify-center py-1", className) }, props),
126
+ React.createElement(lucide_react_1.ChevronDownIcon, { className: "size-4" })));
127
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { ToasterProps } from "sonner";
3
+ declare const Toaster: ({ ...props }: ToasterProps) => React.JSX.Element;
4
+ export { Toaster };
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ "use strict";
3
+ var __assign = (this && this.__assign) || function () {
4
+ __assign = Object.assign || function(t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
+ t[p] = s[p];
9
+ }
10
+ return t;
11
+ };
12
+ return __assign.apply(this, arguments);
13
+ };
14
+ var __rest = (this && this.__rest) || function (s, e) {
15
+ var t = {};
16
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
17
+ t[p] = s[p];
18
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
19
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
20
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
21
+ t[p[i]] = s[p[i]];
22
+ }
23
+ return t;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Toaster = void 0;
30
+ var react_1 = __importDefault(require("react"));
31
+ var next_themes_1 = require("next-themes");
32
+ var sonner_1 = require("sonner");
33
+ var Toaster = function (_a) {
34
+ var props = __rest(_a, []);
35
+ var _b = (0, next_themes_1.useTheme)().theme, theme = _b === void 0 ? "system" : _b;
36
+ return (react_1.default.createElement(sonner_1.Toaster, __assign({ theme: theme, position: "bottom-right", expand: true, richColors: true, closeButton: true, className: "toaster group", style: {
37
+ "--normal-bg": "var(--popover)",
38
+ "--normal-text": "var(--popover-foreground)",
39
+ "--normal-border": "var(--border)",
40
+ }, toastOptions: {
41
+ classNames: {
42
+ toast: "group toast group-[.toaster]:bg-popover group-[.toaster]:text-popover-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg group-[.toaster]:rounded-lg group-[.toaster]:backdrop-blur-md group-[.toaster]:bg-opacity-95",
43
+ description: "group-[.toast]:text-muted-foreground group-[.toast]:text-sm",
44
+ actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground group-[.toast]:hover:bg-primary/90",
45
+ cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground group-[.toast]:hover:bg-muted/90",
46
+ closeButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground group-[.toast]:border-border group-[.toast]:hover:bg-destructive group-[.toast]:hover:text-destructive-foreground group-[.toast]:hover:border-destructive group-[.toast]:focus:bg-destructive group-[.toast]:focus:text-destructive-foreground group-[.toast]:focus:border-destructive group-[.toast]:focus:outline-none group-[.toast]:focus:ring-2 group-[.toast]:focus:ring-destructive group-[.toast]:focus:ring-offset-2 group-[.toast]:focus:ring-offset-popover group-[.toast]:transition-all group-[.toast]:duration-200 group-[.toast]:ease-in-out group-[.toast]:rounded-md group-[.toast]:border group-[.toast]:shadow-md group-[.toast]:active:scale-95 group-[.toast]:hover:shadow-lg group-[.toast]:backdrop-blur-sm",
47
+ },
48
+ style: {
49
+ minWidth: "320px",
50
+ maxWidth: "420px",
51
+ },
52
+ } }, props)));
53
+ };
54
+ exports.Toaster = Toaster;
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import * as SwitchPrimitive from "@radix-ui/react-switch";
3
+ interface SwitchProps extends React.ComponentProps<typeof SwitchPrimitive.Root> {
4
+ error?: string;
5
+ info?: string;
6
+ label?: string;
7
+ }
8
+ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
9
+ export { Switch };
@@ -0,0 +1,89 @@
1
+ "use client";
2
+ "use strict";
3
+ var __assign = (this && this.__assign) || function () {
4
+ __assign = Object.assign || function(t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
+ t[p] = s[p];
9
+ }
10
+ return t;
11
+ };
12
+ return __assign.apply(this, arguments);
13
+ };
14
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ var desc = Object.getOwnPropertyDescriptor(m, k);
17
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
+ desc = { enumerable: true, get: function() { return m[k]; } };
19
+ }
20
+ Object.defineProperty(o, k2, desc);
21
+ }) : (function(o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ }));
25
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
27
+ }) : function(o, v) {
28
+ o["default"] = v;
29
+ });
30
+ var __importStar = (this && this.__importStar) || (function () {
31
+ var ownKeys = function(o) {
32
+ ownKeys = Object.getOwnPropertyNames || function (o) {
33
+ var ar = [];
34
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
35
+ return ar;
36
+ };
37
+ return ownKeys(o);
38
+ };
39
+ return function (mod) {
40
+ if (mod && mod.__esModule) return mod;
41
+ var result = {};
42
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ })();
47
+ var __rest = (this && this.__rest) || function (s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
+ t[p[i]] = s[p[i]];
55
+ }
56
+ return t;
57
+ };
58
+ Object.defineProperty(exports, "__esModule", { value: true });
59
+ exports.Switch = void 0;
60
+ var React = __importStar(require("react"));
61
+ var SwitchPrimitive = __importStar(require("@radix-ui/react-switch"));
62
+ var utils_1 = require("@/lib/utils");
63
+ var label_1 = require("@/components/ui/label");
64
+ var Switch = React.forwardRef(function (_a, ref) {
65
+ var className = _a.className, error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, props = __rest(_a, ["className", "error", "info", "label", "required", "id"]);
66
+ // Determine if there's an error (for aria-invalid and styling)
67
+ var hasError = Boolean(error);
68
+ var switchElement = (React.createElement(SwitchPrimitive.Root, __assign({ ref: ref, id: id, "data-slot": "switch", "aria-invalid": hasError, required: required, className: (0, utils_1.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
69
+ // Error state styling
70
+ hasError &&
71
+ "data-[state=checked]:bg-destructive data-[state=unchecked]:bg-destructive/20 border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20", className) }, props),
72
+ React.createElement(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: (0, utils_1.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0",
73
+ // Error state thumb styling
74
+ hasError && "dark:data-[state=checked]:bg-destructive-foreground") })));
75
+ // If label is provided, render the complete switch with label structure
76
+ if (label) {
77
+ return (React.createElement("div", { className: "w-full space-y-2" },
78
+ React.createElement("div", { className: "flex items-center justify-between space-x-2" },
79
+ React.createElement(label_1.Label, { htmlFor: id, required: required }, label),
80
+ switchElement),
81
+ (error || info) && (React.createElement("div", null, error ? (React.createElement("p", { className: "text-xs text-destructive" }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400" }, info)) : null))));
82
+ }
83
+ // If no label, render just the switch with messages (backward compatibility)
84
+ return (React.createElement("div", { className: "w-full" },
85
+ switchElement,
86
+ (error || info) && (React.createElement("div", null, error ? (React.createElement("p", { className: "text-xs text-destructive" }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400" }, info)) : null))));
87
+ });
88
+ exports.Switch = Switch;
89
+ Switch.displayName = SwitchPrimitive.Root.displayName;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ declare function Table({ className, ...props }: React.ComponentProps<"table">): React.JSX.Element;
3
+ declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
4
+ declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
5
+ declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): React.JSX.Element;
6
+ declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): React.JSX.Element;
7
+ declare function TableHead({ className, ...props }: React.ComponentProps<"th">): React.JSX.Element;
8
+ declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.JSX.Element;
9
+ declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.JSX.Element;
10
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
@@ -0,0 +1,101 @@
1
+ "use client";
2
+ "use strict";
3
+ var __assign = (this && this.__assign) || function () {
4
+ __assign = Object.assign || function(t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
+ t[p] = s[p];
9
+ }
10
+ return t;
11
+ };
12
+ return __assign.apply(this, arguments);
13
+ };
14
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ var desc = Object.getOwnPropertyDescriptor(m, k);
17
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
+ desc = { enumerable: true, get: function() { return m[k]; } };
19
+ }
20
+ Object.defineProperty(o, k2, desc);
21
+ }) : (function(o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ }));
25
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
27
+ }) : function(o, v) {
28
+ o["default"] = v;
29
+ });
30
+ var __importStar = (this && this.__importStar) || (function () {
31
+ var ownKeys = function(o) {
32
+ ownKeys = Object.getOwnPropertyNames || function (o) {
33
+ var ar = [];
34
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
35
+ return ar;
36
+ };
37
+ return ownKeys(o);
38
+ };
39
+ return function (mod) {
40
+ if (mod && mod.__esModule) return mod;
41
+ var result = {};
42
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ })();
47
+ var __rest = (this && this.__rest) || function (s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
+ t[p[i]] = s[p[i]];
55
+ }
56
+ return t;
57
+ };
58
+ Object.defineProperty(exports, "__esModule", { value: true });
59
+ exports.Table = Table;
60
+ exports.TableHeader = TableHeader;
61
+ exports.TableBody = TableBody;
62
+ exports.TableFooter = TableFooter;
63
+ exports.TableHead = TableHead;
64
+ exports.TableRow = TableRow;
65
+ exports.TableCell = TableCell;
66
+ exports.TableCaption = TableCaption;
67
+ var React = __importStar(require("react"));
68
+ var utils_1 = require("@/lib/utils");
69
+ function Table(_a) {
70
+ var className = _a.className, props = __rest(_a, ["className"]);
71
+ return (React.createElement("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto" },
72
+ React.createElement("table", __assign({ "data-slot": "table", className: (0, utils_1.cn)("w-full caption-bottom text-sm", className) }, props))));
73
+ }
74
+ function TableHeader(_a) {
75
+ var className = _a.className, props = __rest(_a, ["className"]);
76
+ return (React.createElement("thead", __assign({ "data-slot": "table-header", className: (0, utils_1.cn)("[&_tr]:border-b", className) }, props)));
77
+ }
78
+ function TableBody(_a) {
79
+ var className = _a.className, props = __rest(_a, ["className"]);
80
+ return (React.createElement("tbody", __assign({ "data-slot": "table-body", className: (0, utils_1.cn)("[&_tr:last-child]:border-0", className) }, props)));
81
+ }
82
+ function TableFooter(_a) {
83
+ var className = _a.className, props = __rest(_a, ["className"]);
84
+ return (React.createElement("tfoot", __assign({ "data-slot": "table-footer", className: (0, utils_1.cn)("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className) }, props)));
85
+ }
86
+ function TableRow(_a) {
87
+ var className = _a.className, props = __rest(_a, ["className"]);
88
+ return (React.createElement("tr", __assign({ "data-slot": "table-row", className: (0, utils_1.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className) }, props)));
89
+ }
90
+ function TableHead(_a) {
91
+ var className = _a.className, props = __rest(_a, ["className"]);
92
+ return (React.createElement("th", __assign({ "data-slot": "table-head", className: (0, utils_1.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className) }, props)));
93
+ }
94
+ function TableCell(_a) {
95
+ var className = _a.className, props = __rest(_a, ["className"]);
96
+ return (React.createElement("td", __assign({ "data-slot": "table-cell", className: (0, utils_1.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className) }, props)));
97
+ }
98
+ function TableCaption(_a) {
99
+ var className = _a.className, props = __rest(_a, ["className"]);
100
+ return (React.createElement("caption", __assign({ "data-slot": "table-caption", className: (0, utils_1.cn)("text-muted-foreground mt-4 text-sm", className) }, props)));
101
+ }
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Bank Actions
3
+ *
4
+ * This module defines all action types and interfaces for the Bank state management.
5
+ * Actions are organized by functionality and follow consistent naming patterns.
6
+ *
7
+ * Organization:
8
+ * - Action Types Enum (grouped by functionality)
9
+ * - Reset Actions (form/error reset)
10
+ * - Form Data Actions (input fields, form state)
11
+ * - UI State Actions (drawers, buttons)
12
+ * - List Management Actions (banks, pagination)
13
+ * - Search Actions (queries)
14
+ * - Union Type Export
15
+ * - Action Creators (helper functions)
16
+ * - Type Utilities (guards and helpers)
17
+ *
18
+ * Naming Convention: Bank{Operation}{Target}Action
19
+ * Examples: BankSetInputFieldAction, BankResetFormAction
20
+ */
21
+ import { BANK_DRAWER, BankForm, BankTypeBE } from "./types";
22
+ export declare enum BANK_ACTION_TYPES {
23
+ RESET_ERRORS = "RESET_ERRORS",
24
+ RESET_FORM = "RESET_FORM",
25
+ SET_INPUT_FIELD = "SET_INPUT_FIELD",
26
+ SET_FORM = "SET_FORM",
27
+ SET_ERRORS = "SET_ERRORS",
28
+ SET_DISABLE_SAVE_BUTTON = "SET_DISABLE_SAVE_BUTTON",
29
+ SET_DRAWER = "SET_DRAWER",
30
+ SET_BANKS = "SET_BANKS",
31
+ SET_COUNT = "SET_COUNT",
32
+ SET_CURRENT_PAGE = "SET_CURRENT_PAGE",
33
+ SET_PAGE_LIMIT = "SET_PAGE_LIMIT",
34
+ SET_SEARCH_QUERY = "SET_SEARCH_QUERY"
35
+ }
36
+ /**
37
+ * Reset form validation errors
38
+ */
39
+ export type BankResetErrorsAction = {
40
+ type: BANK_ACTION_TYPES.RESET_ERRORS;
41
+ };
42
+ /**
43
+ * Reset entire form to initial state
44
+ */
45
+ export type BankResetFormAction = {
46
+ type: BANK_ACTION_TYPES.RESET_FORM;
47
+ };
48
+ /**
49
+ * Update individual form field dynamically
50
+ */
51
+ export type BankSetInputFieldAction = {
52
+ type: BANK_ACTION_TYPES.SET_INPUT_FIELD;
53
+ payload: {
54
+ key: keyof BankForm;
55
+ value: string | string[] | boolean | number | number[];
56
+ };
57
+ };
58
+ /**
59
+ * Set entire form data (used when editing existing bank)
60
+ */
61
+ export type BankSetFormAction = {
62
+ type: BANK_ACTION_TYPES.SET_FORM;
63
+ payload: {
64
+ form: BankTypeBE;
65
+ };
66
+ };
67
+ /**
68
+ * Set form validation errors
69
+ */
70
+ export type BankSetErrorsAction = {
71
+ type: BANK_ACTION_TYPES.SET_ERRORS;
72
+ payload: {
73
+ errors: Record<string, string>;
74
+ };
75
+ };
76
+ /**
77
+ * Control save button state (enabled/disabled)
78
+ */
79
+ export type BankSetDisableSaveButtonAction = {
80
+ type: BANK_ACTION_TYPES.SET_DISABLE_SAVE_BUTTON;
81
+ payload: {
82
+ disableSaveButton: boolean;
83
+ };
84
+ };
85
+ /**
86
+ * Manage drawer state (open/closed with specific drawer type)
87
+ */
88
+ export type BankSetDrawerAction = {
89
+ type: BANK_ACTION_TYPES.SET_DRAWER;
90
+ payload: {
91
+ drawer: null | BANK_DRAWER;
92
+ };
93
+ };
94
+ /**
95
+ * Set banks list data
96
+ */
97
+ export type BankSetBanksAction = {
98
+ type: BANK_ACTION_TYPES.SET_BANKS;
99
+ payload: {
100
+ banks: BankTypeBE[];
101
+ };
102
+ };
103
+ /**
104
+ * Set total count of banks (for pagination)
105
+ */
106
+ export type BankSetCountAction = {
107
+ type: BANK_ACTION_TYPES.SET_COUNT;
108
+ payload: {
109
+ count: number;
110
+ };
111
+ };
112
+ /**
113
+ * Update current page number
114
+ */
115
+ export type BankSetCurrentPageAction = {
116
+ type: BANK_ACTION_TYPES.SET_CURRENT_PAGE;
117
+ payload: {
118
+ currentPage: number;
119
+ };
120
+ };
121
+ /**
122
+ * Update page limit (items per page)
123
+ */
124
+ export type BankSetPageLimitAction = {
125
+ type: BANK_ACTION_TYPES.SET_PAGE_LIMIT;
126
+ payload: {
127
+ pageLimit: number;
128
+ };
129
+ };
130
+ /**
131
+ * Update search query for banks
132
+ */
133
+ export type BankSetSearchQueryAction = {
134
+ type: BANK_ACTION_TYPES.SET_SEARCH_QUERY;
135
+ payload: {
136
+ searchQuery: string;
137
+ };
138
+ };
139
+ /**
140
+ * All bank-related actions grouped by functionality
141
+ */
142
+ export type BankActions = BankResetErrorsAction | BankResetFormAction | BankSetInputFieldAction | BankSetFormAction | BankSetErrorsAction | BankSetDisableSaveButtonAction | BankSetDrawerAction | BankSetBanksAction | BankSetCountAction | BankSetCurrentPageAction | BankSetPageLimitAction | BankSetSearchQueryAction;
143
+ /**
144
+ * Type guard for reset actions
145
+ */
146
+ export type BankResetActions = BankResetErrorsAction | BankResetFormAction;
147
+ /**
148
+ * Type guard for form-related actions
149
+ */
150
+ export type BankFormActions = BankSetInputFieldAction | BankSetFormAction | BankSetErrorsAction;
151
+ /**
152
+ * Type guard for UI state actions
153
+ */
154
+ export type BankUIActions = BankSetDisableSaveButtonAction | BankSetDrawerAction;
155
+ /**
156
+ * Type guard for list management actions
157
+ */
158
+ export type BankListActions = BankSetBanksAction | BankSetCountAction | BankSetCurrentPageAction | BankSetPageLimitAction;
159
+ /**
160
+ * Action creators for common bank operations
161
+ * These provide type-safe action creation with better developer experience
162
+ */
163
+ export declare const bankActionCreators: {
164
+ readonly resetErrors: () => BankResetErrorsAction;
165
+ readonly resetForm: () => BankResetFormAction;
166
+ readonly setInputField: (key: keyof BankForm, value: string | string[] | boolean | number | number[]) => BankSetInputFieldAction;
167
+ readonly setForm: (form: BankTypeBE) => BankSetFormAction;
168
+ readonly setErrors: (errors: Record<string, string>) => BankSetErrorsAction;
169
+ readonly setDisableSaveButton: (disableSaveButton: boolean) => BankSetDisableSaveButtonAction;
170
+ readonly setDrawer: (drawer: null | BANK_DRAWER) => BankSetDrawerAction;
171
+ readonly setBanks: (banks: BankTypeBE[]) => BankSetBanksAction;
172
+ readonly setCount: (count: number) => BankSetCountAction;
173
+ readonly setCurrentPage: (currentPage: number) => BankSetCurrentPageAction;
174
+ readonly setPageLimit: (pageLimit: number) => BankSetPageLimitAction;
175
+ readonly setSearchQuery: (searchQuery: string) => BankSetSearchQueryAction;
176
+ };
177
+ /**
178
+ * Extract action type from action object
179
+ */
180
+ export type ActionType<T extends BankActions> = T["type"];
181
+ /**
182
+ * Extract payload type from action object
183
+ */
184
+ export type ActionPayload<T extends BankActions> = T extends {
185
+ payload: infer P;
186
+ } ? P : never;
187
+ /**
188
+ * Utility type to check if action has payload
189
+ */
190
+ export type HasPayload<T extends BankActions> = T extends {
191
+ payload: unknown;
192
+ } ? true : false;
193
+ /**
194
+ * Runtime type guards for action validation
195
+ */
196
+ export declare const isBankAction: (action: unknown) => action is BankActions;
197
+ /**
198
+ * Type guard for reset actions
199
+ */
200
+ export declare const isResetAction: (action: BankActions) => action is BankResetActions;