@appcorp/shadcn 1.1.99 → 2.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.
- package/components/app-sidebar.js +16 -23
- package/components/audio.js +11 -19
- package/components/dashboard.js +27 -65
- package/components/drawer-generic.js +20 -28
- package/components/enhanced-checkbox.js +10 -57
- package/components/enhanced-combobox.js +99 -143
- package/components/enhanced-drawer-footer.js +22 -31
- package/components/enhanced-drawer-header.js +6 -14
- package/components/enhanced-dropzone-impl.d.ts +32 -0
- package/components/enhanced-dropzone-impl.js +218 -0
- package/components/enhanced-dropzone.d.ts +2 -63
- package/components/enhanced-dropzone.js +6 -294
- package/components/enhanced-input.js +10 -57
- package/components/enhanced-label.js +6 -52
- package/components/enhanced-radio.js +12 -20
- package/components/enhanced-select.js +13 -61
- package/components/enhanced-slider.js +11 -58
- package/components/enhanced-switch.js +11 -58
- package/components/enhanced-table-footer-action.js +11 -19
- package/components/enhanced-table-footer-page.js +16 -24
- package/components/enhanced-table-footer-pagination.js +11 -21
- package/components/enhanced-table-header-action.js +22 -30
- package/components/enhanced-table-header-search.js +9 -17
- package/components/enhanced-table.js +125 -153
- package/components/enhanced-textarea.js +10 -57
- package/components/field.d.ts +1 -1
- package/components/field.js +31 -88
- package/components/image-resize-dialog.js +61 -159
- package/components/nav-main.js +32 -78
- package/components/nav-projects.js +37 -48
- package/components/nav-user.js +41 -51
- package/components/show-toast.d.ts +2 -0
- package/components/show-toast.js +7 -0
- package/components/sidebar.d.ts +1 -1
- package/components/sidebar.js +115 -184
- package/components/team-switcher.js +36 -47
- package/components/theme-provider.js +36 -84
- package/components/timeline.d.ts +12 -0
- package/components/timeline.js +13 -0
- package/components/tooltip.js +10 -59
- package/components/ui/accordion.js +17 -67
- package/components/ui/alert-dialog.js +32 -89
- package/components/ui/alert.d.ts +1 -1
- package/components/ui/alert.js +14 -63
- package/components/ui/area-chart-v1-impl.d.ts +19 -0
- package/components/ui/area-chart-v1-impl.js +75 -0
- package/components/ui/area-chart-v1.d.ts +2 -19
- package/components/ui/area-chart-v1.js +4 -113
- package/components/ui/aspect-ratio.js +3 -39
- package/components/ui/avatar.js +13 -62
- package/components/ui/badge.d.ts +2 -2
- package/components/ui/badge.js +7 -55
- package/components/ui/breadcrumb.js +27 -80
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +10 -58
- package/components/ui/calendar-impl.d.ts +8 -0
- package/components/ui/calendar-impl.js +55 -0
- package/components/ui/calendar.d.ts +2 -8
- package/components/ui/calendar.js +5 -108
- package/components/ui/card.js +21 -73
- package/components/ui/carousel-impl.d.ts +18 -0
- package/components/ui/carousel-impl.js +117 -0
- package/components/ui/carousel.d.ts +6 -18
- package/components/ui/carousel.js +8 -170
- package/components/ui/chart-impl.d.ts +62 -0
- package/components/ui/chart-impl.js +162 -0
- package/components/ui/chart.d.ts +7 -62
- package/components/ui/chart.js +9 -219
- package/components/ui/checkbox.js +10 -57
- package/components/ui/collapsible.js +5 -43
- package/components/ui/combobox.js +22 -58
- package/components/ui/command-impl.d.ts +80 -0
- package/components/ui/command-impl.js +63 -0
- package/components/ui/command.d.ts +9 -80
- package/components/ui/command.js +12 -117
- package/components/ui/context-menu.js +41 -102
- package/components/ui/dialog.js +28 -84
- package/components/ui/drawer-impl.d.ts +22 -0
- package/components/ui/drawer-impl.js +56 -0
- package/components/ui/drawer.d.ts +10 -22
- package/components/ui/drawer.js +13 -111
- package/components/ui/dropdown-menu.js +41 -102
- package/components/ui/form.d.ts +4 -2
- package/components/ui/form.js +41 -95
- package/components/ui/hover-card.js +9 -58
- package/components/ui/input-otp-impl.d.ts +34 -0
- package/components/ui/input-otp-impl.js +43 -0
- package/components/ui/input-otp.d.ts +4 -34
- package/components/ui/input-otp.js +7 -92
- package/components/ui/input.js +6 -53
- package/components/ui/label.d.ts +1 -1
- package/components/ui/label.js +9 -56
- package/components/ui/language-selector.js +17 -55
- package/components/ui/menubar.js +46 -108
- package/components/ui/navigation-menu.d.ts +1 -1
- package/components/ui/navigation-menu.js +29 -84
- package/components/ui/pagination.js +30 -83
- package/components/ui/popover.js +10 -60
- package/components/ui/progress.js +8 -55
- package/components/ui/radio-group.js +12 -60
- package/components/ui/resizable-impl.d.ts +24 -0
- package/components/ui/resizable-impl.js +27 -0
- package/components/ui/resizable.d.ts +3 -24
- package/components/ui/resizable.js +6 -78
- package/components/ui/scroll-area.js +10 -58
- package/components/ui/select.js +34 -90
- package/components/ui/separator.js +7 -54
- package/components/ui/sheet.d.ts +1 -1
- package/components/ui/sheet.js +30 -86
- package/components/ui/skeleton.js +5 -21
- package/components/ui/slider.js +10 -57
- package/components/ui/sonner.js +7 -24
- package/components/ui/switch.js +8 -55
- package/components/ui/table.js +27 -81
- package/components/ui/tabs.js +14 -64
- package/components/ui/textarea.js +6 -53
- package/components/ui/theme-switcher.js +41 -91
- package/components/ui/toggle.d.ts +2 -2
- package/components/ui/toggle.js +9 -57
- package/data/admin-dashboard.js +16 -19
- package/hooks/use-enhanced-combobox.js +47 -124
- package/hooks/use-mobile.js +8 -44
- package/hooks/use-outside-click.js +6 -10
- package/lib/themes.js +1 -4
- package/lib/toast-utils.js +78 -120
- package/lib/utils.js +4 -11
- package/package.json +9 -90
- package/utils/transform-breadcrumbs.js +4 -8
- package/utils/transform-navitems.js +7 -22
- package/components/aceternity-ui/apple-cards-carousel.d.ts +0 -35
- package/components/aceternity-ui/apple-cards-carousel.js +0 -263
- package/components/shadcn-example/ai-chat/chat-interface.d.ts +0 -11
- package/components/shadcn-example/ai-chat/chat-interface.js +0 -70
- package/components/shadcn-example/ai-chat/index.d.ts +0 -38
- package/components/shadcn-example/ai-chat/index.js +0 -66
- package/components/shadcn-example/ai-chat/sidebar.d.ts +0 -15
- package/components/shadcn-example/ai-chat/sidebar.js +0 -68
- package/components/shadcn-example/ai-chat/welcome-section.d.ts +0 -12
- package/components/shadcn-example/ai-chat/welcome-section.js +0 -26
- package/components/shadcn-example/authentication/index.d.ts +0 -24
- package/components/shadcn-example/authentication/index.js +0 -59
- package/components/shadcn-example/authentication/user-auth-form.d.ts +0 -11
- package/components/shadcn-example/authentication/user-auth-form.js +0 -54
- package/components/shadcn-example/blog-detail-page/comment-section.d.ts +0 -15
- package/components/shadcn-example/blog-detail-page/comment-section.js +0 -83
- package/components/shadcn-example/blog-detail-page/content.d.ts +0 -7
- package/components/shadcn-example/blog-detail-page/content.js +0 -15
- package/components/shadcn-example/blog-detail-page/header.d.ts +0 -11
- package/components/shadcn-example/blog-detail-page/header.js +0 -36
- package/components/shadcn-example/blog-detail-page/index.d.ts +0 -25
- package/components/shadcn-example/blog-detail-page/index.js +0 -74
- package/components/shadcn-example/blog-page/blog-post-card.d.ts +0 -13
- package/components/shadcn-example/blog-page/blog-post-card.js +0 -30
- package/components/shadcn-example/blog-page/featured-post-sidebar-item.d.ts +0 -10
- package/components/shadcn-example/blog-page/featured-post-sidebar-item.js +0 -19
- package/components/shadcn-example/blog-page/index.d.ts +0 -20
- package/components/shadcn-example/blog-page/index.js +0 -36
- package/components/shadcn-example/coming-soon/countdown.d.ts +0 -2
- package/components/shadcn-example/coming-soon/countdown.js +0 -82
- package/components/shadcn-example/coming-soon/index.d.ts +0 -10
- package/components/shadcn-example/coming-soon/index.js +0 -41
- package/components/shadcn-io/color-picker/index.d.ts +0 -43
- package/components/shadcn-io/color-picker/index.js +0 -304
- package/components/shadcn-io/copy-button/index.d.ts +0 -16
- package/components/shadcn-io/copy-button/index.js +0 -121
- package/components/shadcn-io/dropzone/index.d.ts +0 -19
- package/components/shadcn-io/dropzone/index.js +0 -131
- package/components/shadcn-io/gantt/index.d.ts +0 -145
- package/components/shadcn-io/gantt/index.js +0 -766
- package/components/shadcn-io/table/index.d.ts +0 -60
- package/components/shadcn-io/table/index.js +0 -138
- package/templates/appcorp-v1/footer/bottom-bar.d.ts +0 -6
- package/templates/appcorp-v1/footer/bottom-bar.js +0 -25
- package/templates/appcorp-v1/footer/cta.d.ts +0 -6
- package/templates/appcorp-v1/footer/cta.js +0 -21
- package/templates/appcorp-v1/footer/footer-grid.d.ts +0 -14
- package/templates/appcorp-v1/footer/footer-grid.js +0 -52
- package/templates/appcorp-v1/footer/index.d.ts +0 -3
- package/templates/appcorp-v1/footer/index.js +0 -28
- package/templates/appcorp-v1/footer/newsletter.d.ts +0 -11
- package/templates/appcorp-v1/footer/newsletter.js +0 -28
- package/templates/appcorp-v1/footer/stats.d.ts +0 -6
- package/templates/appcorp-v1/footer/stats.js +0 -15
- package/templates/appcorp-v1/header/announcement-bar.d.ts +0 -3
- package/templates/appcorp-v1/header/announcement-bar.js +0 -15
- package/templates/appcorp-v1/header/dropdown-panel.d.ts +0 -8
- package/templates/appcorp-v1/header/dropdown-panel.js +0 -72
- package/templates/appcorp-v1/header/index.d.ts +0 -12
- package/templates/appcorp-v1/header/index.js +0 -16
- package/templates/appcorp-v1/header/mobile-menu.d.ts +0 -14
- package/templates/appcorp-v1/header/mobile-menu.js +0 -101
- package/templates/appcorp-v1/header/navigation-bar.d.ts +0 -3
- package/templates/appcorp-v1/header/navigation-bar.js +0 -117
- package/templates/appcorp-v1/header/social-button.d.ts +0 -7
- package/templates/appcorp-v1/header/social-button.js +0 -48
- package/templates/appcorp-v1/home.d.ts +0 -3
- package/templates/appcorp-v1/home.js +0 -27
- package/templates/data/appcorp-v1.d.ts +0 -93
- package/templates/data/appcorp-v1.js +0 -348
- package/templates/data/edupilotpro-v1.d.ts +0 -33
- package/templates/data/edupilotpro-v1.js +0 -116
- package/templates/data/school-v1.d.ts +0 -328
- package/templates/data/school-v1.js +0 -1563
- package/templates/edupilotpro-v1/feature-card.d.ts +0 -13
- package/templates/edupilotpro-v1/feature-card.js +0 -28
- package/templates/edupilotpro-v1/mockups/dashboard-mockup.d.ts +0 -3
- package/templates/edupilotpro-v1/mockups/dashboard-mockup.js +0 -55
- package/templates/school-v1/footer.d.ts +0 -3
- package/templates/school-v1/footer.js +0 -75
- package/templates/school-v1/index.d.ts +0 -18
- package/templates/school-v1/index.js +0 -60
- package/templates/school-v1/navigation.d.ts +0 -3
- package/templates/school-v1/navigation.js +0 -123
- package/templates/school-v1/sections/about.d.ts +0 -3
- package/templates/school-v1/sections/about.js +0 -49
- package/templates/school-v1/sections/admissions.d.ts +0 -3
- package/templates/school-v1/sections/admissions.js +0 -77
- package/templates/school-v1/sections/contact.d.ts +0 -3
- package/templates/school-v1/sections/contact.js +0 -67
- package/templates/school-v1/sections/faqs.d.ts +0 -3
- package/templates/school-v1/sections/faqs.js +0 -50
- package/templates/school-v1/sections/hero.d.ts +0 -3
- package/templates/school-v1/sections/hero.js +0 -132
- package/templates/school-v1/sections/management.d.ts +0 -3
- package/templates/school-v1/sections/management.js +0 -34
- package/templates/school-v1/sections/policies.d.ts +0 -3
- package/templates/school-v1/sections/policies.js +0 -127
- package/templates/school-v1/sections/programs.d.ts +0 -3
- package/templates/school-v1/sections/programs.js +0 -107
- package/templates/school-v1/sections/testimonials.d.ts +0 -3
- package/templates/school-v1/sections/testimonials.js +0 -46
- package/templates/school-v1/sections/why-choose-us.d.ts +0 -3
- package/templates/school-v1/sections/why-choose-us.js +0 -57
|
@@ -1,136 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
-
function step(op) {
|
|
49
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
52
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
-
switch (op[0]) {
|
|
54
|
-
case 0: case 1: t = op; break;
|
|
55
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
-
default:
|
|
59
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
-
if (t[2]) _.ops.pop();
|
|
64
|
-
_.trys.pop(); continue;
|
|
65
|
-
}
|
|
66
|
-
op = body.call(thisArg, _);
|
|
67
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
|
-
exports.useEnhancedCombobox = void 0;
|
|
73
|
-
var react_1 = __importStar(require("react"));
|
|
74
|
-
var fetch_data_1 = require("@react-pakistan/util-functions/general/fetch-data");
|
|
75
|
-
var api_methods_1 = require("@react-pakistan/util-functions/constants/api-methods");
|
|
76
|
-
var use_debounce_1 = require("@react-pakistan/util-functions/hooks/use-debounce");
|
|
77
|
-
var enhanced_combobox_1 = require("../components/enhanced-combobox");
|
|
78
|
-
var useEnhancedCombobox = function (_a) {
|
|
79
|
-
var emptyText = _a.emptyText, error = _a.error, formatSearchResult = _a.formatSearchResult, id = _a.id, info = _a.info, label = _a.label, onValueChange = _a.onValueChange, options = _a.options, placeholder = _a.placeholder, required = _a.required, searchEndpoint = _a.searchEndpoint, searchPlaceholder = _a.searchPlaceholder, value = _a.value;
|
|
80
|
-
var _b = (0, react_1.useState)(""), searchQuery = _b[0], setSearchQuery = _b[1];
|
|
81
|
-
var _c = (0, react_1.useState)([]), searchOptions = _c[0], setSearchOptions = _c[1];
|
|
82
|
-
var _d = (0, react_1.useState)(false), loading = _d[0], setLoading = _d[1];
|
|
83
|
-
var debouncedSearchQuery = (0, use_debounce_1.useDebounce)(searchQuery, 800);
|
|
84
|
-
(0, react_1.useEffect)(function () {
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
|
+
import { EnhancedCombobox } from "../components/enhanced-combobox";
|
|
3
|
+
const API_METHODS = { GET: "GET" };
|
|
4
|
+
function useDebounce(value, delay) {
|
|
5
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const timer = setTimeout(() => setDebouncedValue(value), delay);
|
|
8
|
+
return () => clearTimeout(timer);
|
|
9
|
+
}, [value, delay]);
|
|
10
|
+
return debouncedValue;
|
|
11
|
+
}
|
|
12
|
+
export const useEnhancedCombobox = ({ emptyText, error, formatSearchResult, id, info, label, onValueChange, options, placeholder, required, searchEndpoint, searchPlaceholder, value, }) => {
|
|
13
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
14
|
+
const [searchOptions, setSearchOptions] = useState([]);
|
|
15
|
+
const [loading, setLoading] = useState(false);
|
|
16
|
+
const debouncedSearchQuery = useDebounce(searchQuery, 800);
|
|
17
|
+
useEffect(() => {
|
|
85
18
|
if (!debouncedSearchQuery) {
|
|
86
19
|
setSearchOptions([]);
|
|
87
20
|
setLoading(false);
|
|
88
21
|
return;
|
|
89
22
|
}
|
|
90
23
|
setLoading(true);
|
|
91
|
-
(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
setSearchOptions([]);
|
|
118
|
-
return [3 /*break*/, 4];
|
|
119
|
-
case 3:
|
|
120
|
-
setLoading(false);
|
|
121
|
-
return [7 /*endfinally*/];
|
|
122
|
-
case 4: return [2 /*return*/];
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}); })();
|
|
24
|
+
(async () => {
|
|
25
|
+
try {
|
|
26
|
+
const { fetchData } = await import("@react-pakistan/util-functions/general/fetch-data");
|
|
27
|
+
const { data } = await fetchData({
|
|
28
|
+
url: searchEndpoint,
|
|
29
|
+
method: API_METHODS.GET,
|
|
30
|
+
params: { searchQuery: debouncedSearchQuery },
|
|
31
|
+
});
|
|
32
|
+
const formatter = formatSearchResult ||
|
|
33
|
+
((item) => {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
return ({
|
|
36
|
+
label: String((_a = item.label) !== null && _a !== void 0 ? _a : ""),
|
|
37
|
+
value: String((_b = item.value) !== null && _b !== void 0 ? _b : ""),
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
setSearchOptions((data.items || []).map(formatter));
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error("Failed to fetch expense categories:", error);
|
|
44
|
+
setSearchOptions([]);
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
setLoading(false);
|
|
48
|
+
}
|
|
49
|
+
})();
|
|
126
50
|
}, [debouncedSearchQuery, searchEndpoint]);
|
|
127
|
-
|
|
51
|
+
const mappedOptions = useMemo(() => {
|
|
128
52
|
return searchOptions.length > 0 ? searchOptions : options;
|
|
129
53
|
}, [searchOptions, options]);
|
|
130
|
-
|
|
54
|
+
const handleSearchChange = useCallback((query) => {
|
|
131
55
|
setSearchQuery(query);
|
|
132
56
|
}, []);
|
|
133
|
-
|
|
57
|
+
const enhancedComboboxElement = useMemo(() => (React.createElement(EnhancedCombobox, { emptyText: emptyText, error: error, id: id, info: info, label: label, loading: loading, onSearchChange: handleSearchChange, onValueChange: onValueChange, options: mappedOptions, placeholder: placeholder, required: required, searchPlaceholder: searchPlaceholder, value: value })), [
|
|
134
58
|
emptyText,
|
|
135
59
|
error,
|
|
136
60
|
handleSearchChange,
|
|
@@ -145,6 +69,5 @@ var useEnhancedCombobox = function (_a) {
|
|
|
145
69
|
searchPlaceholder,
|
|
146
70
|
value,
|
|
147
71
|
]);
|
|
148
|
-
return { enhancedComboboxElement
|
|
72
|
+
return { enhancedComboboxElement };
|
|
149
73
|
};
|
|
150
|
-
exports.useEnhancedCombobox = useEnhancedCombobox;
|
package/hooks/use-mobile.js
CHANGED
|
@@ -1,51 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.useIsMobile = useIsMobile;
|
|
37
|
-
var React = __importStar(require("react"));
|
|
38
|
-
var MOBILE_BREAKPOINT = 768;
|
|
39
|
-
function useIsMobile() {
|
|
40
|
-
var _a = React.useState(undefined), isMobile = _a[0], setIsMobile = _a[1];
|
|
41
|
-
React.useEffect(function () {
|
|
42
|
-
var mql = window.matchMedia("(max-width: ".concat(MOBILE_BREAKPOINT - 1, "px)"));
|
|
43
|
-
var onChange = function () {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const MOBILE_BREAKPOINT = 768;
|
|
3
|
+
export function useIsMobile() {
|
|
4
|
+
const [isMobile, setIsMobile] = React.useState(undefined);
|
|
5
|
+
React.useEffect(() => {
|
|
6
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
7
|
+
const onChange = () => {
|
|
44
8
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
45
9
|
};
|
|
46
10
|
mql.addEventListener("change", onChange);
|
|
47
11
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
48
|
-
return
|
|
12
|
+
return () => mql.removeEventListener("change", onChange);
|
|
49
13
|
}, []);
|
|
50
14
|
return !!isMobile;
|
|
51
15
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
(0, react_1.useEffect)(function () {
|
|
7
|
-
var listener = function (event) {
|
|
8
|
-
var target = event.target;
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
export const useOutsideClick = (ref, callback) => {
|
|
3
|
+
useEffect(() => {
|
|
4
|
+
const listener = (event) => {
|
|
5
|
+
const target = event.target;
|
|
9
6
|
// DO NOTHING if the element being clicked is the target element or their children
|
|
10
7
|
if (!ref.current || (target && ref.current.contains(target))) {
|
|
11
8
|
return;
|
|
@@ -14,10 +11,9 @@ var useOutsideClick = function (ref, callback) {
|
|
|
14
11
|
};
|
|
15
12
|
document.addEventListener("mousedown", listener);
|
|
16
13
|
document.addEventListener("touchstart", listener);
|
|
17
|
-
return
|
|
14
|
+
return () => {
|
|
18
15
|
document.removeEventListener("mousedown", listener);
|
|
19
16
|
document.removeEventListener("touchstart", listener);
|
|
20
17
|
};
|
|
21
18
|
}, [ref, callback]);
|
|
22
19
|
};
|
|
23
|
-
exports.useOutsideClick = useOutsideClick;
|
package/lib/themes.js
CHANGED
package/lib/toast-utils.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Shared Toast Utilities
|
|
4
3
|
*
|
|
@@ -13,28 +12,11 @@
|
|
|
13
12
|
* - TypeScript support with proper interfaces
|
|
14
13
|
* - Convenience functions for common use cases
|
|
15
14
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
return t;
|
|
24
|
-
};
|
|
25
|
-
return __assign.apply(this, arguments);
|
|
26
|
-
};
|
|
27
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
|
-
};
|
|
30
|
-
var _a;
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.showThemeInfoToast = exports.showThemeWarningToast = exports.showThemeErrorToast = exports.showThemeSuccessToast = exports.showInfoToast = exports.showWarningToast = exports.showErrorToast = exports.showSuccessToast = exports.generateThemeToast = exports.generateToast = exports.TOAST_VARIANT = void 0;
|
|
33
|
-
var react_1 = __importDefault(require("react"));
|
|
34
|
-
var sonner_1 = require("sonner");
|
|
35
|
-
var lucide_react_1 = require("lucide-react");
|
|
15
|
+
import React from "react";
|
|
16
|
+
import { toast } from "sonner";
|
|
17
|
+
import { AlertCircle, AlertTriangle, CheckCircle, Info, } from "lucide-react";
|
|
36
18
|
// Theme-aware toast styling
|
|
37
|
-
|
|
19
|
+
const THEME_TOAST_STYLES = {
|
|
38
20
|
light: {
|
|
39
21
|
className: "bg-background text-foreground border-border shadow-lg [&_[data-title]]:text-primary [&_[data-title]]:font-semibold [&_[data-icon]]:text-primary/90 [&_[data-description]]:text-primary [&_[data-description]]:opacity-100",
|
|
40
22
|
style: {
|
|
@@ -53,34 +35,33 @@ var THEME_TOAST_STYLES = {
|
|
|
53
35
|
},
|
|
54
36
|
};
|
|
55
37
|
// Toast types matching the previous Vista notification types
|
|
56
|
-
var TOAST_VARIANT;
|
|
38
|
+
export var TOAST_VARIANT;
|
|
57
39
|
(function (TOAST_VARIANT) {
|
|
58
40
|
TOAST_VARIANT["ERROR"] = "error";
|
|
59
41
|
TOAST_VARIANT["INFO"] = "info";
|
|
60
42
|
TOAST_VARIANT["SUCCESS"] = "success";
|
|
61
43
|
TOAST_VARIANT["WARNING"] = "warning";
|
|
62
|
-
})(TOAST_VARIANT || (
|
|
44
|
+
})(TOAST_VARIANT || (TOAST_VARIANT = {}));
|
|
63
45
|
// Icon mapping for each variant using object notation
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return TOAST_ICON_MAP[variant] ||
|
|
46
|
+
const TOAST_ICON_MAP = {
|
|
47
|
+
[TOAST_VARIANT.ERROR]: AlertCircle,
|
|
48
|
+
[TOAST_VARIANT.INFO]: Info,
|
|
49
|
+
[TOAST_VARIANT.SUCCESS]: CheckCircle,
|
|
50
|
+
[TOAST_VARIANT.WARNING]: AlertTriangle,
|
|
51
|
+
};
|
|
52
|
+
const getToastIcon = (variant) => {
|
|
53
|
+
return TOAST_ICON_MAP[variant] || Info;
|
|
72
54
|
};
|
|
73
55
|
// Create icon element helper
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return
|
|
56
|
+
const createIconElement = (variant) => {
|
|
57
|
+
const Icon = getToastIcon(variant);
|
|
58
|
+
return React.createElement("span", { "data-icon": true, className: "inline-flex items-center" }, React.createElement(Icon, { className: "h-4 w-4" }));
|
|
77
59
|
};
|
|
78
60
|
// Enhanced theme-aware toast function
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var toastOptions = __assign({ description: description, duration: duration, icon: iconElement, className: "group-[.toaster]:bg-popover group-[.toaster]:text-popover-foreground group-[.toaster]:border-border", style: {
|
|
61
|
+
export const generateToast = ({ variant, title, description, duration = 4000, action, }) => {
|
|
62
|
+
const iconElement = createIconElement(variant);
|
|
63
|
+
const toastOptions = Object.assign({ description,
|
|
64
|
+
duration, icon: iconElement, className: "group-[.toaster]:bg-popover group-[.toaster]:text-popover-foreground group-[.toaster]:border-border", style: {
|
|
84
65
|
minWidth: "320px",
|
|
85
66
|
maxWidth: "420px",
|
|
86
67
|
} }, (action && {
|
|
@@ -90,123 +71,100 @@ var generateToast = function (_a) {
|
|
|
90
71
|
},
|
|
91
72
|
}));
|
|
92
73
|
// Toast method mapping using object notation
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
_b[TOAST_VARIANT.INFO] = function () {
|
|
102
|
-
return sonner_1.toast.info(title || "Information", toastOptions);
|
|
103
|
-
},
|
|
104
|
-
_b);
|
|
105
|
-
var toastMethod = TOAST_METHOD_MAP[variant];
|
|
74
|
+
const TOAST_METHOD_MAP = {
|
|
75
|
+
[TOAST_VARIANT.SUCCESS]: () => toast.success(title || "Success", toastOptions),
|
|
76
|
+
[TOAST_VARIANT.ERROR]: () => toast.error(title || "Error", toastOptions),
|
|
77
|
+
[TOAST_VARIANT.WARNING]: () => toast.warning(title || "Warning", toastOptions),
|
|
78
|
+
[TOAST_VARIANT.INFO]: () => toast.info(title || "Information", toastOptions),
|
|
79
|
+
};
|
|
80
|
+
const toastMethod = TOAST_METHOD_MAP[variant];
|
|
106
81
|
return toastMethod
|
|
107
82
|
? toastMethod()
|
|
108
|
-
:
|
|
83
|
+
: toast(title || description, toastOptions);
|
|
109
84
|
};
|
|
110
|
-
exports.generateToast = generateToast;
|
|
111
85
|
// Theme-aware toast generation function
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
var variant = _a.variant, title = _a.title, description = _a.description, _c = _a.duration, duration = _c === void 0 ? 4000 : _c, action = _a.action, _d = _a.theme, theme = _d === void 0 ? "system" : _d;
|
|
115
|
-
var iconElement = createIconElement(variant);
|
|
86
|
+
export const generateThemeToast = ({ variant, title, description, duration = 4000, action, theme = "system", }) => {
|
|
87
|
+
const iconElement = createIconElement(variant);
|
|
116
88
|
// Apply theme-specific styling
|
|
117
|
-
|
|
118
|
-
|
|
89
|
+
const themeStyle = theme === "dark" ? THEME_TOAST_STYLES.dark : THEME_TOAST_STYLES.light;
|
|
90
|
+
const toastOptions = Object.assign({ description,
|
|
91
|
+
duration, icon: iconElement, className: `${themeStyle.className} toast-theme-${theme}`, style: Object.assign(Object.assign({}, themeStyle.style), { minWidth: "320px", maxWidth: "420px" }) }, (action && {
|
|
119
92
|
action: {
|
|
120
93
|
label: action.label,
|
|
121
94
|
onClick: action.onClick,
|
|
122
95
|
},
|
|
123
96
|
}));
|
|
124
97
|
// Toast method mapping using object notation
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
_b[TOAST_VARIANT.WARNING] = function () {
|
|
134
|
-
return sonner_1.toast.warning(title || "Warning", toastOptions);
|
|
135
|
-
},
|
|
136
|
-
_b);
|
|
137
|
-
var toastMethod = TOAST_METHOD_MAP[variant];
|
|
98
|
+
const TOAST_METHOD_MAP = {
|
|
99
|
+
[TOAST_VARIANT.ERROR]: () => toast.error(title || "Error", toastOptions),
|
|
100
|
+
[TOAST_VARIANT.INFO]: () => toast.info(title || "Information", toastOptions),
|
|
101
|
+
[TOAST_VARIANT.SUCCESS]: () => toast.success(title || "Success", toastOptions),
|
|
102
|
+
[TOAST_VARIANT.WARNING]: () => toast.warning(title || "Warning", toastOptions),
|
|
103
|
+
};
|
|
104
|
+
const toastMethod = TOAST_METHOD_MAP[variant];
|
|
138
105
|
return toastMethod
|
|
139
106
|
? toastMethod()
|
|
140
|
-
:
|
|
107
|
+
: toast(title || description, toastOptions);
|
|
141
108
|
};
|
|
142
|
-
exports.generateThemeToast = generateThemeToast;
|
|
143
109
|
// Convenience functions for each toast type
|
|
144
|
-
|
|
145
|
-
|
|
110
|
+
export const showSuccessToast = (description, title) => {
|
|
111
|
+
generateToast({
|
|
146
112
|
variant: TOAST_VARIANT.SUCCESS,
|
|
147
|
-
title
|
|
148
|
-
description
|
|
113
|
+
title,
|
|
114
|
+
description,
|
|
149
115
|
});
|
|
150
116
|
};
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
(0, exports.generateToast)({
|
|
117
|
+
export const showErrorToast = (description, title) => {
|
|
118
|
+
generateToast({
|
|
154
119
|
variant: TOAST_VARIANT.ERROR,
|
|
155
|
-
title
|
|
156
|
-
description
|
|
120
|
+
title,
|
|
121
|
+
description,
|
|
157
122
|
});
|
|
158
123
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
(0, exports.generateToast)({
|
|
124
|
+
export const showWarningToast = (description, title) => {
|
|
125
|
+
generateToast({
|
|
162
126
|
variant: TOAST_VARIANT.WARNING,
|
|
163
|
-
title
|
|
164
|
-
description
|
|
127
|
+
title,
|
|
128
|
+
description,
|
|
165
129
|
});
|
|
166
130
|
};
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
(0, exports.generateToast)({
|
|
131
|
+
export const showInfoToast = (description, title) => {
|
|
132
|
+
generateToast({
|
|
170
133
|
variant: TOAST_VARIANT.INFO,
|
|
171
|
-
title
|
|
172
|
-
description
|
|
134
|
+
title,
|
|
135
|
+
description,
|
|
173
136
|
});
|
|
174
137
|
};
|
|
175
|
-
exports.showInfoToast = showInfoToast;
|
|
176
138
|
// Theme-aware convenience functions
|
|
177
|
-
|
|
178
|
-
|
|
139
|
+
export const showThemeSuccessToast = (description, title, theme) => {
|
|
140
|
+
generateThemeToast({
|
|
179
141
|
variant: TOAST_VARIANT.SUCCESS,
|
|
180
|
-
title
|
|
181
|
-
description
|
|
182
|
-
theme
|
|
142
|
+
title,
|
|
143
|
+
description,
|
|
144
|
+
theme,
|
|
183
145
|
});
|
|
184
146
|
};
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
(0, exports.generateThemeToast)({
|
|
147
|
+
export const showThemeErrorToast = (description, title, theme) => {
|
|
148
|
+
generateThemeToast({
|
|
188
149
|
variant: TOAST_VARIANT.ERROR,
|
|
189
|
-
title
|
|
190
|
-
description
|
|
191
|
-
theme
|
|
150
|
+
title,
|
|
151
|
+
description,
|
|
152
|
+
theme,
|
|
192
153
|
});
|
|
193
154
|
};
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
(0, exports.generateThemeToast)({
|
|
155
|
+
export const showThemeWarningToast = (description, title, theme) => {
|
|
156
|
+
generateThemeToast({
|
|
197
157
|
variant: TOAST_VARIANT.WARNING,
|
|
198
|
-
title
|
|
199
|
-
description
|
|
200
|
-
theme
|
|
158
|
+
title,
|
|
159
|
+
description,
|
|
160
|
+
theme,
|
|
201
161
|
});
|
|
202
162
|
};
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
(0, exports.generateThemeToast)({
|
|
163
|
+
export const showThemeInfoToast = (description, title, theme) => {
|
|
164
|
+
generateThemeToast({
|
|
206
165
|
variant: TOAST_VARIANT.INFO,
|
|
207
|
-
title
|
|
208
|
-
description
|
|
209
|
-
theme
|
|
166
|
+
title,
|
|
167
|
+
description,
|
|
168
|
+
theme,
|
|
210
169
|
});
|
|
211
170
|
};
|
|
212
|
-
exports.showThemeInfoToast = showThemeInfoToast;
|
package/lib/utils.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var tailwind_merge_1 = require("tailwind-merge");
|
|
6
|
-
function cn() {
|
|
7
|
-
var inputs = [];
|
|
8
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9
|
-
inputs[_i] = arguments[_i];
|
|
10
|
-
}
|
|
11
|
-
return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
export function cn(...inputs) {
|
|
4
|
+
return twMerge(clsx(inputs));
|
|
12
5
|
}
|