@appcorp/shadcn 1.2.0 → 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.js +5 -9
- 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.js +12 -20
- 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,48 +1,3 @@
|
|
|
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
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
47
2
|
var t = {};
|
|
48
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -54,17 +9,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
54
9
|
}
|
|
55
10
|
return t;
|
|
56
11
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
var EnhancedInput = React.forwardRef(function (_a, ref) {
|
|
64
|
-
var className = _a.className, type = _a.type, error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, testIdWrapper = _a.testIdWrapper, testIdInput = _a.testIdInput, testIdLabel = _a.testIdLabel, testIdMessage = _a.testIdMessage, testIdError = _a.testIdError, testIdInfo = _a.testIdInfo, props = __rest(_a, ["className", "type", "error", "info", "label", "required", "id", "testIdWrapper", "testIdInput", "testIdLabel", "testIdMessage", "testIdError", "testIdInfo"]);
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import { cn } from "../lib/utils";
|
|
14
|
+
import { EnhancedLabel } from "./enhanced-label";
|
|
15
|
+
import { Input } from "./ui/input";
|
|
16
|
+
const EnhancedInput = React.forwardRef((_a, ref) => {
|
|
17
|
+
var { className, type, error, info, label, required, id, testIdWrapper, testIdInput, testIdLabel, testIdMessage, testIdError, testIdInfo } = _a, props = __rest(_a, ["className", "type", "error", "info", "label", "required", "id", "testIdWrapper", "testIdInput", "testIdLabel", "testIdMessage", "testIdError", "testIdInfo"]);
|
|
65
18
|
// Determine if there's an error (for aria-invalid and styling)
|
|
66
|
-
|
|
67
|
-
|
|
19
|
+
const hasError = Boolean(error);
|
|
20
|
+
const inputElement = (React.createElement(Input, Object.assign({ type: type, ref: ref, id: id, "aria-invalid": hasError, required: required, "data-testid": testIdInput, className: cn(
|
|
68
21
|
// Error state styling
|
|
69
22
|
hasError &&
|
|
70
23
|
"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20",
|
|
@@ -74,7 +27,7 @@ var EnhancedInput = React.forwardRef(function (_a, ref) {
|
|
|
74
27
|
// If label is provided, render the complete input with label structure
|
|
75
28
|
if (label) {
|
|
76
29
|
return (React.createElement("div", { className: "w-full space-y-2", "data-testid": testIdWrapper },
|
|
77
|
-
React.createElement(
|
|
30
|
+
React.createElement(EnhancedLabel, { htmlFor: id, required: required, "data-testid": testIdLabel }, label),
|
|
78
31
|
inputElement,
|
|
79
32
|
(error || info) && (React.createElement("div", { "data-testid": testIdMessage }, error ? (React.createElement("p", { className: "text-xs text-destructive", "data-testid": testIdError }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400", "data-testid": testIdInfo }, info)) : null))));
|
|
80
33
|
}
|
|
@@ -83,5 +36,5 @@ var EnhancedInput = React.forwardRef(function (_a, ref) {
|
|
|
83
36
|
inputElement,
|
|
84
37
|
(error || info) && (React.createElement("div", { "data-testid": testIdMessage }, error ? (React.createElement("p", { className: "text-xs text-destructive", "data-testid": testIdError }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400", "data-testid": testIdInfo }, info)) : null))));
|
|
85
38
|
});
|
|
86
|
-
exports.EnhancedInput = EnhancedInput;
|
|
87
39
|
EnhancedInput.displayName = "EnhancedInput";
|
|
40
|
+
export { EnhancedInput };
|
|
@@ -1,49 +1,4 @@
|
|
|
1
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
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
3
|
var t = {};
|
|
49
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -55,14 +10,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
55
10
|
}
|
|
56
11
|
return t;
|
|
57
12
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var utils_1 = require("../lib/utils");
|
|
62
|
-
var label_1 = require("./ui/label");
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { cn } from "../lib/utils";
|
|
15
|
+
import { Label } from "./ui/label";
|
|
63
16
|
function EnhancedLabel(_a) {
|
|
64
|
-
var
|
|
65
|
-
return (React.createElement(
|
|
17
|
+
var { className, required = false, children, testIdLabel, testIdRequired } = _a, props = __rest(_a, ["className", "required", "children", "testIdLabel", "testIdRequired"]);
|
|
18
|
+
return (React.createElement(Label, Object.assign({ "data-slot": "label", "data-testid": testIdLabel, className: cn("flex items-center gap-1 select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 min-h-5", className) }, props),
|
|
66
19
|
children,
|
|
67
20
|
required && (React.createElement("span", { className: "text-destructive text-sm", "aria-label": "required", "data-testid": testIdRequired }, "*"))));
|
|
68
21
|
}
|
|
22
|
+
export { EnhancedLabel };
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return (react_1.default.createElement("div", { className: (0, utils_1.cn)("w-full space-y-2", className) },
|
|
15
|
-
label ? react_1.default.createElement(enhanced_label_1.EnhancedLabel, null, label) : null,
|
|
16
|
-
react_1.default.createElement(radio_group_1.RadioGroup, { value: value, onValueChange: onValueChange }, options.map(function (option) {
|
|
17
|
-
var id = "".concat(name, "-").concat(option.value);
|
|
18
|
-
return (react_1.default.createElement("div", { key: option.value, className: "flex items-center space-x-2" },
|
|
19
|
-
react_1.default.createElement(radio_group_1.RadioGroupItem, { id: id, value: option.value }),
|
|
20
|
-
react_1.default.createElement(enhanced_label_1.EnhancedLabel, { htmlFor: id }, option.label)));
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { EnhancedLabel } from "./enhanced-label";
|
|
4
|
+
import { RadioGroup, RadioGroupItem } from "./ui/radio-group";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
export const EnhancedRadio = ({ className, label, name, onValueChange, options, value, }) => {
|
|
7
|
+
return (React.createElement("div", { className: cn("w-full space-y-2", className) },
|
|
8
|
+
label ? React.createElement(EnhancedLabel, null, label) : null,
|
|
9
|
+
React.createElement(RadioGroup, { value: value, onValueChange: onValueChange }, options.map((option) => {
|
|
10
|
+
const id = `${name}-${option.value}`;
|
|
11
|
+
return (React.createElement("div", { key: option.value, className: "flex items-center space-x-2" },
|
|
12
|
+
React.createElement(RadioGroupItem, { id: id, value: option.value }),
|
|
13
|
+
React.createElement(EnhancedLabel, { htmlFor: id }, option.label)));
|
|
21
14
|
}))));
|
|
22
15
|
};
|
|
23
|
-
exports.EnhancedRadio = EnhancedRadio;
|
|
@@ -1,49 +1,4 @@
|
|
|
1
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
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
3
|
var t = {};
|
|
49
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -55,27 +10,24 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
55
10
|
}
|
|
56
11
|
return t;
|
|
57
12
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var
|
|
64
|
-
var EnhancedSelect = function (_a) {
|
|
65
|
-
var error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, children = _a.children, testIdWrapper = _a.testIdWrapper, testIdLabel = _a.testIdLabel, testIdMessage = _a.testIdMessage, testIdError = _a.testIdError, testIdInfo = _a.testIdInfo, selectProps = __rest(_a, ["error", "info", "label", "required", "id", "children", "testIdWrapper", "testIdLabel", "testIdMessage", "testIdError", "testIdInfo"]);
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { cn } from "../lib/utils";
|
|
15
|
+
import { Select, SelectTrigger } from "./ui/select";
|
|
16
|
+
import { EnhancedLabel } from "./enhanced-label";
|
|
17
|
+
const EnhancedSelect = (_a) => {
|
|
18
|
+
var { error, info, label, required, id, children, testIdWrapper, testIdLabel, testIdMessage, testIdError, testIdInfo } = _a, selectProps = __rest(_a, ["error", "info", "label", "required", "id", "children", "testIdWrapper", "testIdLabel", "testIdMessage", "testIdError", "testIdInfo"]);
|
|
66
19
|
return (React.createElement("div", { className: "w-full space-y-2", "data-testid": testIdWrapper },
|
|
67
|
-
label && (React.createElement(
|
|
68
|
-
React.createElement(
|
|
20
|
+
label && (React.createElement(EnhancedLabel, { htmlFor: id, required: required, testIdLabel: testIdLabel }, label)),
|
|
21
|
+
React.createElement(Select, Object.assign({}, selectProps), children),
|
|
69
22
|
(error || info) && (React.createElement("div", { "data-testid": testIdMessage }, error ? (React.createElement("p", { className: "text-xs text-destructive", "data-testid": testIdError }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400", "data-testid": testIdInfo }, info)) : null))));
|
|
70
23
|
};
|
|
71
|
-
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return (React.createElement(select_1.SelectTrigger, __assign({ ref: ref, "aria-invalid": hasError, className: (0, utils_1.cn)(
|
|
24
|
+
const EnhancedSelectTrigger = React.forwardRef((_a, ref) => {
|
|
25
|
+
var { className, error, children } = _a, props = __rest(_a, ["className", "error", "children"]);
|
|
26
|
+
const hasError = Boolean(error);
|
|
27
|
+
return (React.createElement(SelectTrigger, Object.assign({ ref: ref, "aria-invalid": hasError, className: cn(
|
|
76
28
|
// Error state styling
|
|
77
29
|
hasError &&
|
|
78
30
|
"border-destructive focus:ring-destructive/20 focus:border-destructive", className) }, props), children));
|
|
79
31
|
});
|
|
80
|
-
exports.EnhancedSelectTrigger = EnhancedSelectTrigger;
|
|
81
32
|
EnhancedSelectTrigger.displayName = "EnhancedSelectTrigger";
|
|
33
|
+
export { EnhancedSelect, EnhancedSelectTrigger };
|
|
@@ -1,49 +1,4 @@
|
|
|
1
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
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
3
|
var t = {};
|
|
49
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -55,26 +10,24 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
55
10
|
}
|
|
56
11
|
return t;
|
|
57
12
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var slider_1 = require("./ui/slider");
|
|
64
|
-
var EnhancedSlider = React.forwardRef(function (_a, ref) {
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { cn } from "../lib/utils";
|
|
15
|
+
import { EnhancedLabel } from "./enhanced-label";
|
|
16
|
+
import { Slider } from "./ui/slider";
|
|
17
|
+
const EnhancedSlider = React.forwardRef((_a, ref) => {
|
|
65
18
|
var _b, _c, _d, _e;
|
|
66
|
-
var
|
|
19
|
+
var { className, label, info, error, min, max, testIdWrapper, testIdLabel, testIdMessage, testIdError, testIdInfo, testIdSlider, testIdMin, testIdMax } = _a, props = __rest(_a, ["className", "label", "info", "error", "min", "max", "testIdWrapper", "testIdLabel", "testIdMessage", "testIdError", "testIdInfo", "testIdSlider", "testIdMin", "testIdMax"]);
|
|
67
20
|
// Prefer explicit min/max props; fall back to Slider props
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
21
|
+
const sliderMin = (_c = min !== null && min !== void 0 ? min : (_b = props.defaultValue) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : 0;
|
|
22
|
+
const sliderMax = (_e = max !== null && max !== void 0 ? max : (_d = props.defaultValue) === null || _d === void 0 ? void 0 : _d[1]) !== null && _e !== void 0 ? _e : 100;
|
|
23
|
+
const sliderElement = (React.createElement(Slider, Object.assign({ ref: ref, className: cn("w-full", className), "data-testid": testIdSlider, min: sliderMin, max: sliderMax }, props)));
|
|
71
24
|
return (React.createElement("div", { className: "w-full space-y-2", "data-testid": testIdWrapper },
|
|
72
|
-
label && (React.createElement(
|
|
25
|
+
label && (React.createElement(EnhancedLabel, { "data-testid": testIdLabel, className: "mb-0" }, label)),
|
|
73
26
|
React.createElement("div", { className: "flex items-center justify-between text-xs text-muted-foreground" },
|
|
74
27
|
React.createElement("span", { "data-testid": testIdMin }, min),
|
|
75
28
|
React.createElement("span", { "data-testid": testIdMax }, max)),
|
|
76
29
|
sliderElement,
|
|
77
30
|
(error || info) && (React.createElement("div", { "data-testid": testIdMessage }, error ? (React.createElement("p", { className: "text-xs text-destructive", "data-testid": testIdError }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400", "data-testid": testIdInfo }, info)) : null))));
|
|
78
31
|
});
|
|
79
|
-
exports.EnhancedSlider = EnhancedSlider;
|
|
80
32
|
EnhancedSlider.displayName = "EnhancedSlider";
|
|
33
|
+
export { EnhancedSlider };
|
|
@@ -1,49 +1,4 @@
|
|
|
1
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
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
3
|
var t = {};
|
|
49
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -55,27 +10,25 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
55
10
|
}
|
|
56
11
|
return t;
|
|
57
12
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var
|
|
64
|
-
var EnhancedSwitch = 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, description = _a.description, testIdWrapper = _a.testIdWrapper, testIdLabel = _a.testIdLabel, testIdSwitch = _a.testIdSwitch, testIdThumb = _a.testIdThumb, testIdDescription = _a.testIdDescription, testIdMessage = _a.testIdMessage, testIdError = _a.testIdError, testIdInfo = _a.testIdInfo, props = __rest(_a, ["className", "error", "info", "label", "required", "id", "description", "testIdWrapper", "testIdLabel", "testIdSwitch", "testIdThumb", "testIdDescription", "testIdMessage", "testIdError", "testIdInfo"]);
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
15
|
+
import { cn } from "../lib/utils";
|
|
16
|
+
import { EnhancedLabel } from "./enhanced-label";
|
|
17
|
+
const EnhancedSwitch = React.forwardRef((_a, ref) => {
|
|
18
|
+
var { className, error, info, label, required, id, description, testIdWrapper, testIdLabel, testIdSwitch, testIdThumb, testIdDescription, testIdMessage, testIdError, testIdInfo } = _a, props = __rest(_a, ["className", "error", "info", "label", "required", "id", "description", "testIdWrapper", "testIdLabel", "testIdSwitch", "testIdThumb", "testIdDescription", "testIdMessage", "testIdError", "testIdInfo"]);
|
|
66
19
|
// Determine if there's an error (for aria-invalid and styling)
|
|
67
|
-
|
|
68
|
-
|
|
20
|
+
const hasError = Boolean(error);
|
|
21
|
+
const switchElement = (React.createElement(SwitchPrimitives.Root, Object.assign({ ref: ref, id: id, "data-slot": "switch", "data-testid": testIdSwitch, "aria-invalid": hasError, required: required, className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
69
22
|
// Error state styling
|
|
70
23
|
hasError &&
|
|
71
24
|
"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(SwitchPrimitives.Thumb, { "data-slot": "switch-thumb", "data-testid": testIdThumb, className:
|
|
25
|
+
React.createElement(SwitchPrimitives.Thumb, { "data-slot": "switch-thumb", "data-testid": testIdThumb, className: cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") })));
|
|
73
26
|
// If label is provided, render the complete switch with label structure
|
|
74
27
|
if (label) {
|
|
75
28
|
return (React.createElement("div", { className: "w-full space-y-2", "data-testid": testIdWrapper },
|
|
76
29
|
React.createElement("div", { className: "flex items-center justify-between space-x-2" },
|
|
77
30
|
React.createElement("div", null,
|
|
78
|
-
React.createElement(
|
|
31
|
+
React.createElement(EnhancedLabel, { htmlFor: id, required: required, testIdLabel: testIdLabel }, label),
|
|
79
32
|
description && (React.createElement("p", { className: "text-sm text-gray-400", "data-testid": testIdDescription }, description))),
|
|
80
33
|
switchElement),
|
|
81
34
|
(error || info) && (React.createElement("div", { "data-testid": testIdMessage }, error ? (React.createElement("p", { className: "text-xs text-destructive", "data-testid": testIdError }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400", "data-testid": testIdInfo }, info)) : null))));
|
|
@@ -85,5 +38,5 @@ var EnhancedSwitch = React.forwardRef(function (_a, ref) {
|
|
|
85
38
|
switchElement,
|
|
86
39
|
(error || info) && (React.createElement("div", { "data-testid": testIdMessage }, error ? (React.createElement("p", { className: "text-xs text-destructive", "data-testid": testIdError }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400", "data-testid": testIdInfo }, info)) : null))));
|
|
87
40
|
});
|
|
88
|
-
exports.EnhancedSwitch = EnhancedSwitch;
|
|
89
41
|
EnhancedSwitch.displayName = "EnhancedSwitch";
|
|
42
|
+
export { EnhancedSwitch };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Enhanced Table Footer Action Component
|
|
4
3
|
*
|
|
@@ -13,28 +12,21 @@
|
|
|
13
12
|
* - Disabled state handling
|
|
14
13
|
* - Loading state support
|
|
15
14
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
exports.EnhancedTableFooterAction = void 0;
|
|
21
|
-
var react_1 = __importDefault(require("react"));
|
|
22
|
-
var lucide_react_1 = require("lucide-react");
|
|
23
|
-
var button_1 = require("./ui/button");
|
|
24
|
-
var EnhancedTableFooterAction = function (_a) {
|
|
25
|
-
var handleNextOnClick = _a.handleNextOnClick, handlePreviousOnClick = _a.handlePreviousOnClick, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, _b = _a.isRTL, isRTL = _b === void 0 ? false : _b, loading = _a.loading, _c = _a.nextPageLabel, nextPageLabel = _c === void 0 ? "Next page" : _c, _d = _a.previousPageLabel, previousPageLabel = _d === void 0 ? "Previous page" : _d, testIdWrapper = _a.testIdWrapper, testIdPrevious = _a.testIdPrevious, testIdNext = _a.testIdNext, testIdPreviousIcon = _a.testIdPreviousIcon, testIdNextIcon = _a.testIdNextIcon;
|
|
15
|
+
import React from "react";
|
|
16
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
17
|
+
import { Button } from "./ui/button";
|
|
18
|
+
export const EnhancedTableFooterAction = ({ handleNextOnClick, handlePreviousOnClick, isNextDisabled, isPreviousDisabled, isRTL = false, loading, nextPageLabel = "Next page", previousPageLabel = "Previous page", testIdWrapper, testIdPrevious, testIdNext, testIdPreviousIcon, testIdNextIcon, }) => {
|
|
26
19
|
// In RTL, arrows should be swapped:
|
|
27
20
|
// Previous should show → (ChevronRight) as it goes to the right in RTL reading order
|
|
28
21
|
// Next should show ← (ChevronLeft) as it goes to the left in RTL reading order
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
const PreviousIcon = isRTL ? ChevronRight : ChevronLeft;
|
|
23
|
+
const NextIcon = isRTL ? ChevronLeft : ChevronRight;
|
|
24
|
+
return (React.createElement("div", { className: `flex gap-1 ${isRTL ? "flex-row-reverse" : ""}`, "data-testid": testIdWrapper },
|
|
25
|
+
React.createElement(Button, { variant: "outline", size: "icon", "data-testid": testIdPrevious, onClick: handlePreviousOnClick, disabled: isPreviousDisabled || loading, "aria-label": previousPageLabel, title: previousPageLabel, className: `${isRTL ? "rotate-180" : ""}` },
|
|
26
|
+
React.createElement(PreviousIcon, { className: "h-4 w-4", "data-testid": testIdPreviousIcon })),
|
|
27
|
+
React.createElement(Button, { variant: "outline", size: "icon", "data-testid": testIdNext, onClick: handleNextOnClick, disabled: isNextDisabled || loading, "aria-label": nextPageLabel, title: nextPageLabel, className: `${isRTL ? "rotate-180" : ""}` },
|
|
28
|
+
React.createElement(NextIcon, { className: "h-4 w-4", "data-testid": testIdNextIcon }))));
|
|
36
29
|
};
|
|
37
|
-
exports.EnhancedTableFooterAction = EnhancedTableFooterAction;
|
|
38
30
|
// ============================================================================
|
|
39
31
|
// USAGE EXAMPLES
|
|
40
32
|
// ============================================================================
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Enhanced Table Footer Page Component
|
|
4
3
|
*
|
|
@@ -12,32 +11,25 @@
|
|
|
12
11
|
* - Accessibility attributes
|
|
13
12
|
* - Custom translation overrides
|
|
14
13
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
exports.EnhancedTableFooterPage = void 0;
|
|
20
|
-
var react_1 = __importDefault(require("react"));
|
|
21
|
-
var EnhancedTableFooterPage = function (_a) {
|
|
22
|
-
var currentPage = _a.currentPage, _b = _a.isRTL, isRTL = _b === void 0 ? false : _b, loading = _a.loading, _c = _a.loadingLabel, loadingLabel = _c === void 0 ? "Loading" : _c, _d = _a.ofLabel, ofLabel = _d === void 0 ? "of" : _d, _e = _a.pageLabel, pageLabel = _e === void 0 ? "Page" : _e, totalPages = _a.totalPages, _f = _a.className, className = _f === void 0 ? "" : _f, testIdWrapper = _a.testIdWrapper, testIdCurrent = _a.testIdCurrent, testIdPageLabel = _a.testIdPageLabel, testIdOfLabel = _a.testIdOfLabel, testIdTotal = _a.testIdTotal, testIdLoadingWrapper = _a.testIdLoadingWrapper, testIdLoadingSpinner = _a.testIdLoadingSpinner;
|
|
23
|
-
return (react_1.default.createElement("div", { className: "flex items-center gap-2 ".concat(isRTL ? "rtl" : "ltr", " ").concat(className), dir: isRTL ? "rtl" : "ltr", role: "status", "aria-live": "polite", "aria-label": "".concat(pageLabel, " ").concat(currentPage, " ").concat(ofLabel, " ").concat(totalPages), "data-testid": testIdWrapper },
|
|
24
|
-
react_1.default.createElement("span", { className: "text-sm text-muted-foreground" }, isRTL ? (
|
|
14
|
+
import React from "react";
|
|
15
|
+
export const EnhancedTableFooterPage = ({ currentPage, isRTL = false, loading, loadingLabel = "Loading", ofLabel = "of", pageLabel = "Page", totalPages, className = "", testIdWrapper, testIdCurrent, testIdPageLabel, testIdOfLabel, testIdTotal, testIdLoadingWrapper, testIdLoadingSpinner, }) => {
|
|
16
|
+
return (React.createElement("div", { className: `flex items-center gap-2 ${isRTL ? "rtl" : "ltr"} ${className}`, dir: isRTL ? "rtl" : "ltr", role: "status", "aria-live": "polite", "aria-label": `${pageLabel} ${currentPage} ${ofLabel} ${totalPages}`, "data-testid": testIdWrapper },
|
|
17
|
+
React.createElement("span", { className: "text-sm text-muted-foreground" }, isRTL ? (
|
|
25
18
|
// RTL layout: Numbers read right-to-left but maintain logical order
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
React.createElement("span", { className: "inline-flex items-center gap-1" },
|
|
20
|
+
React.createElement("span", { "data-testid": testIdTotal }, totalPages),
|
|
21
|
+
React.createElement("span", { "data-testid": testIdOfLabel }, ofLabel),
|
|
22
|
+
React.createElement("span", { "data-testid": testIdCurrent }, currentPage),
|
|
23
|
+
React.createElement("span", { "data-testid": testIdPageLabel }, pageLabel))) : (
|
|
31
24
|
// LTR layout: "Page currentPage of totalPages"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
loading && (
|
|
38
|
-
|
|
25
|
+
React.createElement("span", { className: "inline-flex items-center gap-1" },
|
|
26
|
+
React.createElement("span", { "data-testid": testIdPageLabel }, pageLabel),
|
|
27
|
+
React.createElement("span", { "data-testid": testIdCurrent }, currentPage),
|
|
28
|
+
React.createElement("span", { "data-testid": testIdOfLabel }, ofLabel),
|
|
29
|
+
React.createElement("span", { "data-testid": testIdTotal }, totalPages)))),
|
|
30
|
+
loading && (React.createElement("div", { className: `flex items-center gap-2 ${isRTL ? "order-first" : "order-last"}`, "aria-label": loadingLabel, "data-testid": testIdLoadingWrapper },
|
|
31
|
+
React.createElement("div", { className: "w-4 h-4 border-2 border-primary border-t-transparent rounded-full animate-spin", role: "progressbar", "aria-label": loadingLabel, "data-testid": testIdLoadingSpinner })))));
|
|
39
32
|
};
|
|
40
|
-
exports.EnhancedTableFooterPage = EnhancedTableFooterPage;
|
|
41
33
|
// ============================================================================
|
|
42
34
|
// USAGE EXAMPLES
|
|
43
35
|
// ============================================================================
|