@appcorp/stellar-solutions-modules 0.1.34 → 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,122 @@
1
+ "use strict";
2
+ /**
3
+ * Enhanced Table Footer Pagination Component
4
+ *
5
+ * Displays rows per page selector with internationalization and RTL/LTR support.
6
+ * Automatically adapts text direction and layout based on locale.
7
+ *
8
+ * Features:
9
+ * - Full i18n support with fallback text
10
+ * - RTL/LTR layout adaptation
11
+ * - Loading state handling
12
+ * - Accessibility attributes
13
+ * - Custom translation overrides
14
+ * - Responsive design
15
+ */
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.EnhancedTableFooterPagination = void 0;
21
+ var select_1 = require("./select");
22
+ var react_1 = __importDefault(require("react"));
23
+ var next_intl_1 = require("next-intl");
24
+ var use_rtl_1 = require("@/hooks/use-rtl");
25
+ var EnhancedTableFooterPagination = function (_a) {
26
+ var handleOnSelect = _a.handleOnSelect, listOptions = _a.listOptions, loading = _a.loading, nodeSelectKey = _a.nodeSelectKey, pageLimit = _a.pageLimit, labelText = _a.labelText, _b = _a.className, className = _b === void 0 ? "" : _b;
27
+ var t = (0, next_intl_1.useTranslations)();
28
+ var isRTL = (0, use_rtl_1.useRTL)();
29
+ // Get translated label text with fallback
30
+ var rowsPerPageLabel = labelText || t("common.rowsPerPage") || "Rows per page:";
31
+ return (react_1.default.createElement("div", { className: "flex items-center gap-2 ".concat(className), dir: isRTL ? "rtl" : "ltr" },
32
+ react_1.default.createElement("label", { htmlFor: "page-limit-select-".concat(nodeSelectKey), className: "text-sm text-muted-foreground whitespace-nowrap" }, rowsPerPageLabel),
33
+ react_1.default.createElement(select_1.Select, { value: String(pageLimit), onValueChange: function (value) {
34
+ return handleOnSelect(nodeSelectKey, { option: value });
35
+ }, disabled: loading },
36
+ react_1.default.createElement(select_1.SelectTrigger, { id: "page-limit-select-".concat(nodeSelectKey), className: "w-20", "aria-label": "".concat(rowsPerPageLabel, " ").concat(pageLimit) },
37
+ react_1.default.createElement(select_1.SelectValue, null)),
38
+ react_1.default.createElement(select_1.SelectContent, null, listOptions.map(function (option) { return (react_1.default.createElement(select_1.SelectItem, { key: option.option, value: option.option, "aria-label": "".concat(option.option, " rows per page") }, option.option)); })))));
39
+ };
40
+ exports.EnhancedTableFooterPagination = EnhancedTableFooterPagination;
41
+ // ============================================================================
42
+ // USAGE EXAMPLES
43
+ // ============================================================================
44
+ /*
45
+ Example 1: Basic usage with automatic i18n
46
+ <EnhancedTableFooterPagination
47
+ handleOnSelect={(key, value) => console.log(key, value)}
48
+ listOptions={[{ option: "10" }, { option: "25" }, { option: "50" }]}
49
+ loading={false}
50
+ nodeSelectKey="pageLimit"
51
+ pageLimit={10}
52
+ totalPages={5}
53
+ />
54
+
55
+ Example 2: With custom label text
56
+ <EnhancedTableFooterPagination
57
+ handleOnSelect={handlePageLimitChange}
58
+ listOptions={pageLimitOptions}
59
+ loading={isLoading}
60
+ nodeSelectKey="pageLimit"
61
+ pageLimit={currentPageLimit}
62
+ totalPages={totalPages}
63
+ labelText="Items per page:"
64
+ />
65
+
66
+ Example 3: With custom styling and RTL support
67
+ <EnhancedTableFooterPagination
68
+ handleOnSelect={handlePageLimitChange}
69
+ listOptions={pageLimitOptions}
70
+ loading={false}
71
+ nodeSelectKey="pageLimit"
72
+ pageLimit={25}
73
+ totalPages={10}
74
+ className="bg-gray-50 p-2 rounded-md"
75
+ />
76
+
77
+ RTL Layout Features:
78
+ - Automatic text direction detection and application
79
+ - Element order reversal for RTL languages
80
+ - Proper label-select association
81
+ - Accessibility attributes for screen readers
82
+ - Direction-specific CSS classes and DOM attributes
83
+ */
84
+ // ============================================================================
85
+ // COMPONENT ENHANCEMENTS SUMMARY
86
+ // ============================================================================
87
+ /*
88
+ Enhancements Applied:
89
+
90
+ 1. **Internationalization (i18n)**
91
+ - Translation support using next-intl
92
+ - Fallback text for missing translations
93
+ - Custom label text override capability
94
+ - Translatable "Rows per page:" label
95
+
96
+ 2. **RTL/LTR Layout Support**
97
+ - Automatic layout detection using useRTL hook
98
+ - Element order reversal for RTL languages (flex-row-reverse)
99
+ - Direction-aware CSS classes and attributes
100
+ - Proper text direction handling
101
+
102
+ 3. **Accessibility Improvements**
103
+ - Proper label-select association with htmlFor/id
104
+ - ARIA labels for screen readers
105
+ - Descriptive aria-label for select options
106
+ - Semantic HTML structure with label element
107
+
108
+ 4. **Developer Experience**
109
+ - Comprehensive JSDoc documentation
110
+ - Usage examples and patterns
111
+ - TypeScript interface improvements
112
+ - Flexible customization options
113
+
114
+ 5. **Code Quality**
115
+ - Clean, readable component structure
116
+ - Consistent naming conventions
117
+ - Performance-optimized rendering
118
+ - Maintainable and extensible design
119
+
120
+ Translation Key Required:
121
+ - common.rowsPerPage: "Rows per page:" / "ہر صفحے میں قطاریں:"
122
+ */
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { HeaderAction } from "./enhanced-table";
3
+ interface EnhancedTableHeaderActionProps {
4
+ headerActions: HeaderAction[];
5
+ }
6
+ export declare const EnhancedTableHeaderAction: FC<EnhancedTableHeaderActionProps>;
7
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EnhancedTableHeaderAction = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var button_1 = require("./button");
9
+ var EnhancedTableHeaderAction = function (_a) {
10
+ var headerActions = _a.headerActions;
11
+ return (react_1.default.createElement(react_1.default.Fragment, null, headerActions.length > 0 && (react_1.default.createElement("div", { className: "flex gap-2" }, headerActions
12
+ .filter(function (action) { return action.enabled !== false; })
13
+ .sort(function (a, b) { return (a.order || 0) - (b.order || 0); })
14
+ .map(function (action, index) { return (react_1.default.createElement(button_1.Button, { key: action.id || action.key || index, variant: action.variant || "default", onClick: function () {
15
+ if (action.onClick)
16
+ action.onClick();
17
+ if (action.handleOnClick)
18
+ action.handleOnClick();
19
+ } }, action.label)); })))));
20
+ };
21
+ exports.EnhancedTableHeaderAction = EnhancedTableHeaderAction;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ interface EnhancedTableHeaderSearchProps {
3
+ handleSearchInput: (key: string, value: string) => void;
4
+ loading: boolean;
5
+ searchDisabled?: boolean;
6
+ searchEnabled?: boolean;
7
+ searchId?: string;
8
+ searchPlaceholder?: string;
9
+ searchValue: string;
10
+ }
11
+ export declare const EnhancedTableHeaderSearch: FC<EnhancedTableHeaderSearchProps>;
12
+ export {};
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EnhancedTableHeaderSearch = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var lucide_react_1 = require("lucide-react");
9
+ var input_1 = require("./input");
10
+ var EnhancedTableHeaderSearch = function (_a) {
11
+ var handleSearchInput = _a.handleSearchInput, loading = _a.loading, _b = _a.searchDisabled, searchDisabled = _b === void 0 ? false : _b, _c = _a.searchEnabled, searchEnabled = _c === void 0 ? true : _c, _d = _a.searchId, searchId = _d === void 0 ? "table-search" : _d, _e = _a.searchPlaceholder, searchPlaceholder = _e === void 0 ? "Search..." : _e, searchValue = _a.searchValue;
12
+ return (react_1.default.createElement(react_1.default.Fragment, null, searchEnabled && (react_1.default.createElement("div", { className: "flex items-center gap-2 max-w-xl" },
13
+ react_1.default.createElement("div", { className: "relative flex-1" },
14
+ react_1.default.createElement(lucide_react_1.Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
15
+ react_1.default.createElement(input_1.Input, { id: searchId, placeholder: searchPlaceholder, value: searchValue, onChange: function (e) { return handleSearchInput("search", e.target.value); }, disabled: searchDisabled || loading, className: "pl-9" }))))));
16
+ };
17
+ exports.EnhancedTableHeaderSearch = EnhancedTableHeaderSearch;
@@ -0,0 +1,65 @@
1
+ import React from "react";
2
+ export interface TableColumn {
3
+ key?: string;
4
+ label: string;
5
+ width?: string;
6
+ componentType?: "ID" | "BOLD_TEXT" | "TEXT" | "ACTIONS";
7
+ }
8
+ export interface TableRow extends Record<string, unknown> {
9
+ id?: string;
10
+ [key: string]: unknown;
11
+ }
12
+ export interface RowAction {
13
+ id?: string;
14
+ key?: string;
15
+ label: string;
16
+ enabled?: boolean;
17
+ order?: number;
18
+ variant?: "default" | "destructive";
19
+ onClick?: (row: TableRow) => void;
20
+ handleOnClick?: (row: TableRow) => void;
21
+ handleAction?: (id: string) => void;
22
+ }
23
+ export interface HeaderAction {
24
+ id?: string;
25
+ key?: string;
26
+ label: string;
27
+ enabled?: boolean;
28
+ order?: number;
29
+ variant?: "default" | "outline" | "secondary";
30
+ onClick?: () => void;
31
+ handleOnClick?: () => void;
32
+ }
33
+ export interface PageLimitOption {
34
+ option: string;
35
+ }
36
+ export interface EnhancedTableProps {
37
+ tableHeadItems: TableColumn[];
38
+ tableBodyRows: TableRow[];
39
+ tableBodyCols: Array<{
40
+ key: string;
41
+ componentType: string;
42
+ }>;
43
+ tableHeading: string;
44
+ tableDescription?: string;
45
+ currentPage: number;
46
+ totalPages: number;
47
+ pageLimit: number;
48
+ listOptions: PageLimitOption[];
49
+ handleNextOnClick: () => void;
50
+ handlePreviousOnClick: () => void;
51
+ handleOnSelect: (node: string, value: object) => void;
52
+ isNextDisabled: boolean;
53
+ isPreviousDisabled: boolean;
54
+ searchEnabled?: boolean;
55
+ searchValue: string;
56
+ searchPlaceholder?: string;
57
+ searchId?: string;
58
+ searchDisabled?: boolean;
59
+ handleSearchInput: (key: string, value: string) => void;
60
+ headerActions: HeaderAction[];
61
+ rowActions: RowAction[];
62
+ loading: boolean;
63
+ nodeSelectKey?: string;
64
+ }
65
+ export declare const EnhancedTable: React.FC<EnhancedTableProps>;
@@ -0,0 +1,87 @@
1
+ "use client";
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.EnhancedTable = void 0;
8
+ var react_1 = __importDefault(require("react"));
9
+ var lucide_react_1 = require("lucide-react");
10
+ var table_1 = require("./table");
11
+ var button_1 = require("./button");
12
+ var dropdown_menu_1 = require("./dropdown-menu");
13
+ var utils_1 = require("@/lib/utils");
14
+ var enhanced_table_footer_action_1 = require("./enhanced-table-footer-action");
15
+ var enhanced_table_footer_page_1 = require("./enhanced-table-footer-page");
16
+ var enhanced_table_footer_pagination_1 = require("./enhanced-table-footer-pagination");
17
+ var popover_1 = require("./popover");
18
+ var enhanced_table_header_action_1 = require("./enhanced-table-header-action");
19
+ var enhanced_table_header_search_1 = require("./enhanced-table-header-search");
20
+ var badge_1 = require("./badge");
21
+ var EnhancedTable = function (_a) {
22
+ var currentPage = _a.currentPage, handleNextOnClick = _a.handleNextOnClick, handleOnSelect = _a.handleOnSelect, handlePreviousOnClick = _a.handlePreviousOnClick, handleSearchInput = _a.handleSearchInput, headerActions = _a.headerActions, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, loading = _a.loading, _b = _a.nodeSelectKey, nodeSelectKey = _b === void 0 ? "pageLimit" : _b, pageLimit = _a.pageLimit, rowActions = _a.rowActions, _c = _a.searchDisabled, searchDisabled = _c === void 0 ? false : _c, _d = _a.searchEnabled, searchEnabled = _d === void 0 ? true : _d, _e = _a.searchId, searchId = _e === void 0 ? "table-search" : _e, _f = _a.searchPlaceholder, searchPlaceholder = _f === void 0 ? "Search..." : _f, searchValue = _a.searchValue, tableBodyCols = _a.tableBodyCols, tableBodyRows = _a.tableBodyRows, tableDescription = _a.tableDescription, tableHeading = _a.tableHeading, tableHeadItems = _a.tableHeadItems, totalPages = _a.totalPages;
23
+ var renderCellContent = function (row, col) {
24
+ var value = row[col.key];
25
+ if (col.key === "action") {
26
+ return (react_1.default.createElement(dropdown_menu_1.DropdownMenu, null,
27
+ react_1.default.createElement(dropdown_menu_1.DropdownMenuTrigger, { asChild: true },
28
+ react_1.default.createElement(button_1.Button, { variant: "ghost", size: "icon" },
29
+ react_1.default.createElement(lucide_react_1.MoreHorizontal, { className: "h-4 w-4" }))),
30
+ react_1.default.createElement(dropdown_menu_1.DropdownMenuContent, { align: "end" }, rowActions
31
+ .filter(function (action) { return action.enabled !== false; })
32
+ .sort(function (a, b) { return (a.order || 0) - (b.order || 0); })
33
+ .map(function (action, index) { return (react_1.default.createElement(dropdown_menu_1.DropdownMenuItem, { key: action.id || action.key || index, variant: action.variant, onClick: function () {
34
+ if (action.onClick)
35
+ action.onClick(row);
36
+ if (action.handleOnClick)
37
+ action.handleOnClick(row);
38
+ if (action.handleAction && row.id)
39
+ action.handleAction(row.id);
40
+ } }, action.label)); }))));
41
+ }
42
+ if (col.componentType === "ID") {
43
+ return (react_1.default.createElement(popover_1.Popover, null,
44
+ react_1.default.createElement(popover_1.PopoverTrigger, { asChild: true },
45
+ react_1.default.createElement("span", { className: "text-xs text-muted-foreground font-mono" }, typeof value === "string"
46
+ ? "".concat(value.substring(0, 8), "...")
47
+ : String(value || ""))),
48
+ react_1.default.createElement(popover_1.PopoverContent, null,
49
+ react_1.default.createElement("span", { className: "text-xs text-muted-foreground font-mono" }, String(value)))));
50
+ }
51
+ if (col.componentType === "BOLD_TEXT") {
52
+ return react_1.default.createElement("span", { className: "font-semibold" }, String(value || ""));
53
+ }
54
+ if (col.componentType === "BOOLEAN") {
55
+ var isTrue = Boolean(value);
56
+ return (react_1.default.createElement(badge_1.Badge, { variant: "secondary", className: (0, utils_1.cn)("text-white font-medium", isTrue
57
+ ? "bg-green-500 hover:bg-green-600"
58
+ : "bg-red-500 hover:bg-red-600") }, isTrue ? "Yes" : "No"));
59
+ }
60
+ return react_1.default.createElement("span", null, String(value || ""));
61
+ };
62
+ // Create loading skeleton rows
63
+ var renderLoadingRows = function () {
64
+ return Array.from({ length: pageLimit || 5 }).map(function (_, index) { return (react_1.default.createElement(table_1.TableRow, { key: "loading-".concat(index), className: "hover:bg-muted/50" }, tableHeadItems.map(function (_, colIndex) { return (react_1.default.createElement(table_1.TableCell, { key: colIndex, className: "py-4" },
65
+ react_1.default.createElement("div", { className: "h-4 bg-muted animate-pulse rounded w-full" }))); }))); });
66
+ };
67
+ return (react_1.default.createElement("div", { className: "space-y-4" },
68
+ react_1.default.createElement("div", { className: "flex items-center justify-between" },
69
+ react_1.default.createElement("div", { className: "space-y-1" },
70
+ react_1.default.createElement("h2", { className: "text-2xl font-bold tracking-tight" }, tableHeading),
71
+ tableDescription && (react_1.default.createElement("p", { className: "text-muted-foreground" }, tableDescription))),
72
+ react_1.default.createElement("div", { className: "flex flex-row items-center justify-end gap-2" },
73
+ react_1.default.createElement(enhanced_table_header_search_1.EnhancedTableHeaderSearch, { handleSearchInput: handleSearchInput, loading: loading, searchDisabled: searchDisabled, searchEnabled: searchEnabled, searchId: searchId, searchPlaceholder: searchPlaceholder, searchValue: searchValue }),
74
+ react_1.default.createElement(enhanced_table_header_action_1.EnhancedTableHeaderAction, { headerActions: headerActions }))),
75
+ react_1.default.createElement("div", { className: "border rounded-md" },
76
+ react_1.default.createElement(table_1.Table, null,
77
+ react_1.default.createElement(table_1.TableHeader, null,
78
+ react_1.default.createElement(table_1.TableRow, null, tableHeadItems.map(function (header, index) { return (react_1.default.createElement(table_1.TableHead, { key: index, style: { width: header.width }, className: (0, utils_1.cn)("font-medium", index === 0 && "rounded-tl-md", index === tableHeadItems.length - 1 && "rounded-tr-md") }, header.label)); }))),
79
+ react_1.default.createElement(table_1.TableBody, null, loading ? (renderLoadingRows()) : tableBodyRows.length === 0 ? (react_1.default.createElement(table_1.TableRow, null,
80
+ react_1.default.createElement(table_1.TableCell, { colSpan: tableHeadItems.length, className: "h-24 text-center text-muted-foreground" }, "No results found."))) : (tableBodyRows.map(function (row, rowIndex) { return (react_1.default.createElement(table_1.TableRow, { key: rowIndex, className: "hover:bg-muted/50" }, tableBodyCols.map(function (col, colIndex) { return (react_1.default.createElement(table_1.TableCell, { key: colIndex, className: "py-4" }, renderCellContent(row, col))); }))); }))))),
81
+ react_1.default.createElement("div", { className: "flex items-center justify-between" },
82
+ react_1.default.createElement(enhanced_table_footer_pagination_1.EnhancedTableFooterPagination, { handleOnSelect: handleOnSelect, listOptions: listOptions, loading: loading, nodeSelectKey: nodeSelectKey, pageLimit: pageLimit, totalPages: totalPages }),
83
+ react_1.default.createElement("div", { className: "flex items-center gap-4" },
84
+ react_1.default.createElement(enhanced_table_footer_page_1.EnhancedTableFooterPage, { currentPage: currentPage, loading: loading, totalPages: totalPages }),
85
+ react_1.default.createElement(enhanced_table_footer_action_1.EnhancedTableFooterAction, { handleNextOnClick: handleNextOnClick, handlePreviousOnClick: handlePreviousOnClick, isNextDisabled: isNextDisabled, isPreviousDisabled: isPreviousDisabled, loading: loading })))));
86
+ };
87
+ exports.EnhancedTable = EnhancedTable;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ interface InputProps extends React.ComponentProps<"input"> {
3
+ error?: string;
4
+ info?: string;
5
+ label?: string;
6
+ }
7
+ declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
8
+ export { Input };
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ var __rest = (this && this.__rest) || function (s, e) {
47
+ var t = {};
48
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
49
+ t[p] = s[p];
50
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
51
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
52
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
53
+ t[p[i]] = s[p[i]];
54
+ }
55
+ return t;
56
+ };
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.Input = void 0;
59
+ var React = __importStar(require("react"));
60
+ var utils_1 = require("@/lib/utils");
61
+ var label_1 = require("@/components/ui/label");
62
+ var Input = React.forwardRef(function (_a, ref) {
63
+ var className = _a.className, type = _a.type, error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, props = __rest(_a, ["className", "type", "error", "info", "label", "required", "id"]);
64
+ // Determine if there's an error (for aria-invalid and styling)
65
+ var hasError = Boolean(error);
66
+ var inputElement = (React.createElement("input", __assign({ type: type, ref: ref, id: id, "data-slot": "input", "aria-invalid": hasError, required: required, className: (0, utils_1.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
67
+ // Error state styling
68
+ hasError &&
69
+ "border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20",
70
+ // Normal state when no error
71
+ !hasError &&
72
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className) }, props)));
73
+ // If label is provided, render the complete input with label structure
74
+ if (label) {
75
+ return (React.createElement("div", { className: "w-full space-y-2" },
76
+ React.createElement(label_1.Label, { htmlFor: id, required: required }, label),
77
+ inputElement,
78
+ (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))));
79
+ }
80
+ // If no label, render just the input with messages (backward compatibility)
81
+ return (React.createElement("div", { className: "w-full" },
82
+ inputElement,
83
+ (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))));
84
+ });
85
+ exports.Input = Input;
86
+ Input.displayName = "Input";
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as LabelPrimitive from "@radix-ui/react-label";
3
+ interface LabelProps extends React.ComponentProps<typeof LabelPrimitive.Root> {
4
+ required?: boolean;
5
+ }
6
+ declare function Label({ className, required, children, ...props }: LabelProps): React.JSX.Element;
7
+ export { Label };
@@ -0,0 +1,68 @@
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.Label = Label;
60
+ var React = __importStar(require("react"));
61
+ var LabelPrimitive = __importStar(require("@radix-ui/react-label"));
62
+ var utils_1 = require("@/lib/utils");
63
+ function Label(_a) {
64
+ var className = _a.className, _b = _a.required, required = _b === void 0 ? false : _b, children = _a.children, props = __rest(_a, ["className", "required", "children"]);
65
+ return (React.createElement(LabelPrimitive.Root, __assign({ "data-slot": "label", className: (0, utils_1.cn)("flex items-center gap-1 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className) }, props),
66
+ children,
67
+ required && (React.createElement("span", { className: "text-destructive text-sm", "aria-label": "required" }, "*"))));
68
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+ declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
4
+ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
5
+ declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
6
+ declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
7
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
@@ -0,0 +1,82 @@
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.Popover = Popover;
60
+ exports.PopoverTrigger = PopoverTrigger;
61
+ exports.PopoverContent = PopoverContent;
62
+ exports.PopoverAnchor = PopoverAnchor;
63
+ var React = __importStar(require("react"));
64
+ var PopoverPrimitive = __importStar(require("@radix-ui/react-popover"));
65
+ var utils_1 = require("@/lib/utils");
66
+ function Popover(_a) {
67
+ var props = __rest(_a, []);
68
+ return React.createElement(PopoverPrimitive.Root, __assign({ "data-slot": "popover" }, props));
69
+ }
70
+ function PopoverTrigger(_a) {
71
+ var props = __rest(_a, []);
72
+ return React.createElement(PopoverPrimitive.Trigger, __assign({ "data-slot": "popover-trigger" }, props));
73
+ }
74
+ function PopoverContent(_a) {
75
+ var className = _a.className, _b = _a.align, align = _b === void 0 ? "center" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 4 : _c, props = __rest(_a, ["className", "align", "sideOffset"]);
76
+ return (React.createElement(PopoverPrimitive.Portal, null,
77
+ React.createElement(PopoverPrimitive.Content, __assign({ "data-slot": "popover-content", align: align, sideOffset: sideOffset, 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className) }, props))));
78
+ }
79
+ function PopoverAnchor(_a) {
80
+ var props = __rest(_a, []);
81
+ return React.createElement(PopoverPrimitive.Anchor, __assign({ "data-slot": "popover-anchor" }, props));
82
+ }
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
4
+ declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
5
+ declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
6
+ declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
7
+ size?: "sm" | "default";
8
+ }): React.JSX.Element;
9
+ declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
10
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
11
+ declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
12
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
13
+ declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
14
+ declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
15
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };