@appcorp/shadcn 1.2.0 → 2.0.1
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 +1 -41
- package/components/audio.js +1 -21
- package/components/dashboard.js +1 -67
- package/components/drawer-generic.js +1 -47
- package/components/enhanced-checkbox.js +1 -86
- package/components/enhanced-combobox.js +1 -315
- package/components/enhanced-drawer-footer.js +1 -39
- package/components/enhanced-drawer-header.js +1 -15
- package/components/enhanced-dropzone-impl.d.ts +32 -0
- package/components/enhanced-dropzone-impl.js +1 -0
- package/components/enhanced-dropzone.d.ts +2 -63
- package/components/enhanced-dropzone.js +1 -296
- package/components/enhanced-input.js +1 -87
- package/components/enhanced-label.js +1 -68
- package/components/enhanced-radio.js +1 -23
- package/components/enhanced-select.js +1 -81
- package/components/enhanced-slider.js +1 -80
- package/components/enhanced-switch.js +1 -89
- package/components/enhanced-table-footer-action.js +1 -110
- package/components/enhanced-table-footer-page.js +1 -132
- package/components/enhanced-table-footer-pagination.js +1 -118
- package/components/enhanced-table-header-action.js +1 -40
- package/components/enhanced-table-header-search.js +1 -18
- package/components/enhanced-table.js +1 -329
- package/components/enhanced-textarea.js +1 -87
- package/components/field.d.ts +1 -1
- package/components/field.js +1 -153
- package/components/image-resize-dialog.js +1 -180
- package/components/nav-main.js +1 -86
- package/components/nav-projects.js +1 -50
- package/components/nav-user.js +1 -62
- package/components/show-toast.js +1 -11
- package/components/sidebar.d.ts +1 -1
- package/components/sidebar.js +1 -326
- package/components/team-switcher.js +1 -53
- package/components/theme-provider.js +1 -160
- package/components/timeline.js +1 -21
- package/components/tooltip.js +1 -85
- package/components/ui/accordion.js +1 -87
- package/components/ui/alert-dialog.js +1 -120
- package/components/ui/alert.d.ts +1 -1
- package/components/ui/alert.js +1 -90
- package/components/ui/area-chart-v1-impl.d.ts +19 -0
- package/components/ui/area-chart-v1-impl.js +1 -0
- package/components/ui/area-chart-v1.d.ts +2 -19
- package/components/ui/area-chart-v1.js +1 -114
- package/components/ui/aspect-ratio.js +1 -40
- package/components/ui/avatar.js +1 -80
- package/components/ui/badge.d.ts +2 -2
- package/components/ui/badge.js +1 -80
- package/components/ui/breadcrumb.js +1 -107
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +1 -92
- package/components/ui/calendar-impl.d.ts +8 -0
- package/components/ui/calendar-impl.js +1 -0
- package/components/ui/calendar.d.ts +2 -8
- package/components/ui/calendar.js +1 -109
- package/components/ui/card.js +1 -96
- package/components/ui/carousel-impl.d.ts +18 -0
- package/components/ui/carousel-impl.js +1 -0
- package/components/ui/carousel.d.ts +6 -18
- package/components/ui/carousel.js +1 -171
- package/components/ui/chart-impl.d.ts +62 -0
- package/components/ui/chart-impl.js +7 -0
- package/components/ui/chart.d.ts +7 -62
- package/components/ui/chart.js +1 -220
- package/components/ui/checkbox.js +1 -71
- package/components/ui/collapsible.js +1 -44
- package/components/ui/combobox.js +1 -88
- package/components/ui/command-impl.d.ts +80 -0
- package/components/ui/command-impl.js +1 -0
- package/components/ui/command.d.ts +9 -80
- package/components/ui/command.js +1 -118
- package/components/ui/context-menu.js +1 -141
- package/components/ui/dialog.js +1 -113
- package/components/ui/drawer-impl.d.ts +22 -0
- package/components/ui/drawer-impl.js +1 -0
- package/components/ui/drawer.d.ts +10 -22
- package/components/ui/drawer.js +1 -112
- package/components/ui/dropdown-menu.js +1 -143
- package/components/ui/form.d.ts +4 -2
- package/components/ui/form.js +1 -132
- package/components/ui/hover-card.js +1 -72
- package/components/ui/input-otp-impl.d.ts +34 -0
- package/components/ui/input-otp-impl.js +1 -0
- package/components/ui/input-otp.d.ts +4 -34
- package/components/ui/input-otp.js +1 -93
- package/components/ui/input.js +1 -66
- package/components/ui/label.d.ts +1 -1
- package/components/ui/label.js +1 -70
- package/components/ui/language-selector.js +1 -63
- package/components/ui/menubar.js +1 -165
- package/components/ui/navigation-menu.d.ts +1 -1
- package/components/ui/navigation-menu.js +1 -114
- package/components/ui/pagination.js +1 -113
- package/components/ui/popover.js +1 -75
- package/components/ui/progress.js +1 -69
- package/components/ui/radio-group.js +1 -77
- package/components/ui/resizable-impl.d.ts +24 -0
- package/components/ui/resizable-impl.js +1 -0
- package/components/ui/resizable.d.ts +3 -24
- package/components/ui/resizable.js +1 -79
- package/components/ui/scroll-area.js +1 -80
- package/components/ui/select.js +1 -127
- package/components/ui/separator.js +1 -68
- package/components/ui/sheet.d.ts +1 -1
- package/components/ui/sheet.js +1 -127
- package/components/ui/skeleton.js +1 -34
- package/components/ui/slider.js +1 -79
- package/components/ui/sonner.js +1 -45
- package/components/ui/switch.js +1 -69
- package/components/ui/table.js +1 -109
- package/components/ui/tabs.js +1 -82
- package/components/ui/textarea.js +1 -66
- package/components/ui/theme-switcher.js +1 -152
- package/components/ui/toggle.d.ts +2 -2
- package/components/ui/toggle.js +1 -87
- package/data/admin-dashboard.js +1 -304
- package/hooks/use-enhanced-combobox.js +1 -150
- package/hooks/use-mobile.js +1 -51
- package/hooks/use-outside-click.js +1 -23
- package/lib/themes.js +1 -150
- package/lib/toast-utils.js +1 -212
- package/lib/utils.js +1 -12
- package/package.json +9 -90
- package/utils/transform-breadcrumbs.js +1 -11
- package/utils/transform-navitems.js +1 -33
- 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,68 +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
|
-
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.EnhancedLabel = EnhancedLabel;
|
|
60
|
-
var React = __importStar(require("react"));
|
|
61
|
-
var utils_1 = require("../lib/utils");
|
|
62
|
-
var label_1 = require("./ui/label");
|
|
63
|
-
function EnhancedLabel(_a) {
|
|
64
|
-
var className = _a.className, _b = _a.required, required = _b === void 0 ? false : _b, children = _a.children, testIdLabel = _a.testIdLabel, testIdRequired = _a.testIdRequired, props = __rest(_a, ["className", "required", "children", "testIdLabel", "testIdRequired"]);
|
|
65
|
-
return (React.createElement(label_1.Label, __assign({ "data-slot": "label", "data-testid": testIdLabel, className: (0, utils_1.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
|
-
children,
|
|
67
|
-
required && (React.createElement("span", { className: "text-destructive text-sm", "aria-label": "required", "data-testid": testIdRequired }, "*"))));
|
|
68
|
-
}
|
|
1
|
+
"use strict";"use client";var i=function(t,n){var a={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.indexOf(e)<0&&(a[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(t);r<e.length;r++)n.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(t,e[r])&&(a[e[r]]=t[e[r]]);return a};import*as l from"react";import{cn as c}from"../lib/utils";import{Label as d}from"./ui/label";function p(t){var{className:n,required:a=!1,children:e,testIdLabel:r,testIdRequired:o}=t,s=i(t,["className","required","children","testIdLabel","testIdRequired"]);return l.createElement(d,Object.assign({"data-slot":"label","data-testid":r,className:c("flex items-center gap-1 select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 min-h-5",n)},s),e,a&&l.createElement("span",{className:"text-destructive text-sm","aria-label":"required","data-testid":o},"*"))}export{p as EnhancedLabel};
|
|
@@ -1,23 +1 @@
|
|
|
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.EnhancedRadio = void 0;
|
|
8
|
-
var react_1 = __importDefault(require("react"));
|
|
9
|
-
var enhanced_label_1 = require("./enhanced-label");
|
|
10
|
-
var radio_group_1 = require("./ui/radio-group");
|
|
11
|
-
var utils_1 = require("../lib/utils");
|
|
12
|
-
var EnhancedRadio = function (_a) {
|
|
13
|
-
var className = _a.className, label = _a.label, name = _a.name, onValueChange = _a.onValueChange, options = _a.options, value = _a.value;
|
|
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)));
|
|
21
|
-
}))));
|
|
22
|
-
};
|
|
23
|
-
exports.EnhancedRadio = EnhancedRadio;
|
|
1
|
+
"use strict";"use client";import e from"react";import{EnhancedLabel as r}from"./enhanced-label";import{RadioGroup as i,RadioGroupItem as s}from"./ui/radio-group";import{cn as d}from"../lib/utils";export const EnhancedRadio=({className:m,label:l,name:c,onValueChange:n,options:u,value:o})=>e.createElement("div",{className:d("w-full space-y-2",m)},l?e.createElement(r,null,l):null,e.createElement(i,{value:o,onValueChange:n},u.map(a=>{const t=`${c}-${a.value}`;return e.createElement("div",{key:a.value,className:"flex items-center space-x-2"},e.createElement(s,{id:t,value:a.value}),e.createElement(r,{htmlFor:t},a.label))})));
|
|
@@ -1,81 +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
|
-
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.EnhancedSelectTrigger = exports.EnhancedSelect = void 0;
|
|
60
|
-
var React = __importStar(require("react"));
|
|
61
|
-
var utils_1 = require("../lib/utils");
|
|
62
|
-
var select_1 = require("./ui/select");
|
|
63
|
-
var enhanced_label_1 = require("./enhanced-label");
|
|
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"]);
|
|
66
|
-
return (React.createElement("div", { className: "w-full space-y-2", "data-testid": testIdWrapper },
|
|
67
|
-
label && (React.createElement(enhanced_label_1.EnhancedLabel, { htmlFor: id, required: required, testIdLabel: testIdLabel }, label)),
|
|
68
|
-
React.createElement(select_1.Select, __assign({}, selectProps), children),
|
|
69
|
-
(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
|
-
};
|
|
71
|
-
exports.EnhancedSelect = EnhancedSelect;
|
|
72
|
-
var EnhancedSelectTrigger = React.forwardRef(function (_a, ref) {
|
|
73
|
-
var className = _a.className, error = _a.error, children = _a.children, props = __rest(_a, ["className", "error", "children"]);
|
|
74
|
-
var hasError = Boolean(error);
|
|
75
|
-
return (React.createElement(select_1.SelectTrigger, __assign({ ref: ref, "aria-invalid": hasError, className: (0, utils_1.cn)(
|
|
76
|
-
// Error state styling
|
|
77
|
-
hasError &&
|
|
78
|
-
"border-destructive focus:ring-destructive/20 focus:border-destructive", className) }, props), children));
|
|
79
|
-
});
|
|
80
|
-
exports.EnhancedSelectTrigger = EnhancedSelectTrigger;
|
|
81
|
-
EnhancedSelectTrigger.displayName = "EnhancedSelectTrigger";
|
|
1
|
+
"use strict";"use client";var o=function(t,s){var a={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&s.indexOf(e)<0&&(a[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(t);r<e.length;r++)s.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(t,e[r])&&(a[e[r]]=t[e[r]]);return a};import*as l from"react";import{cn as E}from"../lib/utils";import{Select as g,SelectTrigger as h}from"./ui/select";import{EnhancedLabel as I}from"./enhanced-label";const v=t=>{var{error:s,info:a,label:e,required:r,id:n,children:c,testIdWrapper:i,testIdLabel:m,testIdMessage:f,testIdError:p,testIdInfo:u}=t,b=o(t,["error","info","label","required","id","children","testIdWrapper","testIdLabel","testIdMessage","testIdError","testIdInfo"]);return l.createElement("div",{className:"w-full space-y-2","data-testid":i},e&&l.createElement(I,{htmlFor:n,required:r,testIdLabel:m},e),l.createElement(g,Object.assign({},b),c),(s||a)&&l.createElement("div",{"data-testid":f},s?l.createElement("p",{className:"text-xs text-destructive","data-testid":p},s):a?l.createElement("p",{className:"text-xs text-blue-600 dark:text-blue-400","data-testid":u},a):null))},d=l.forwardRef((t,s)=>{var{className:a,error:e,children:r}=t,n=o(t,["className","error","children"]);const c=!!e;return l.createElement(h,Object.assign({ref:s,"aria-invalid":c,className:E(c&&"border-destructive focus:ring-destructive/20 focus:border-destructive",a)},n),r)});d.displayName="EnhancedSelectTrigger";export{v as EnhancedSelect,d as EnhancedSelectTrigger};
|
|
@@ -1,80 +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
|
-
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.EnhancedSlider = void 0;
|
|
60
|
-
var React = __importStar(require("react"));
|
|
61
|
-
var utils_1 = require("../lib/utils");
|
|
62
|
-
var enhanced_label_1 = require("./enhanced-label");
|
|
63
|
-
var slider_1 = require("./ui/slider");
|
|
64
|
-
var EnhancedSlider = React.forwardRef(function (_a, ref) {
|
|
65
|
-
var _b, _c, _d, _e;
|
|
66
|
-
var className = _a.className, label = _a.label, info = _a.info, error = _a.error, min = _a.min, max = _a.max, testIdWrapper = _a.testIdWrapper, testIdLabel = _a.testIdLabel, testIdMessage = _a.testIdMessage, testIdError = _a.testIdError, testIdInfo = _a.testIdInfo, testIdSlider = _a.testIdSlider, testIdMin = _a.testIdMin, testIdMax = _a.testIdMax, props = __rest(_a, ["className", "label", "info", "error", "min", "max", "testIdWrapper", "testIdLabel", "testIdMessage", "testIdError", "testIdInfo", "testIdSlider", "testIdMin", "testIdMax"]);
|
|
67
|
-
// Prefer explicit min/max props; fall back to Slider props
|
|
68
|
-
var 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;
|
|
69
|
-
var 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;
|
|
70
|
-
var sliderElement = (React.createElement(slider_1.Slider, __assign({ ref: ref, className: (0, utils_1.cn)("w-full", className), "data-testid": testIdSlider, min: sliderMin, max: sliderMax }, props)));
|
|
71
|
-
return (React.createElement("div", { className: "w-full space-y-2", "data-testid": testIdWrapper },
|
|
72
|
-
label && (React.createElement(enhanced_label_1.EnhancedLabel, { "data-testid": testIdLabel, className: "mb-0" }, label)),
|
|
73
|
-
React.createElement("div", { className: "flex items-center justify-between text-xs text-muted-foreground" },
|
|
74
|
-
React.createElement("span", { "data-testid": testIdMin }, min),
|
|
75
|
-
React.createElement("span", { "data-testid": testIdMax }, max)),
|
|
76
|
-
sliderElement,
|
|
77
|
-
(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
|
-
});
|
|
79
|
-
exports.EnhancedSlider = EnhancedSlider;
|
|
80
|
-
EnhancedSlider.displayName = "EnhancedSlider";
|
|
1
|
+
"use strict";"use client";var w=function(t,s){var l={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&s.indexOf(e)<0&&(l[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,e=Object.getOwnPropertySymbols(t);a<e.length;a++)s.indexOf(e[a])<0&&Object.prototype.propertyIsEnumerable.call(t,e[a])&&(l[e[a]]=t[e[a]]);return l};import*as r from"react";import{cn as S}from"../lib/utils";import{EnhancedLabel as _}from"./enhanced-label";import{Slider as j}from"./ui/slider";const u=r.forwardRef((t,s)=>{var l,e,a,i,{className:p,label:f,info:o,error:c,min:d,max:n,testIdWrapper:x,testIdLabel:I,testIdMessage:b,testIdError:v,testIdInfo:E,testIdSlider:y,testIdMin:O,testIdMax:N}=t,m=w(t,["className","label","info","error","min","max","testIdWrapper","testIdLabel","testIdMessage","testIdError","testIdInfo","testIdSlider","testIdMin","testIdMax"]);const M=(e=d??((l=m.defaultValue)===null||l===void 0?void 0:l[0]))!==null&&e!==void 0?e:0,g=(i=n??((a=m.defaultValue)===null||a===void 0?void 0:a[1]))!==null&&i!==void 0?i:100,h=r.createElement(j,Object.assign({ref:s,className:S("w-full",p),"data-testid":y,min:M,max:g},m));return r.createElement("div",{className:"w-full space-y-2","data-testid":x},f&&r.createElement(_,{"data-testid":I,className:"mb-0"},f),r.createElement("div",{className:"flex items-center justify-between text-xs text-muted-foreground"},r.createElement("span",{"data-testid":O},d),r.createElement("span",{"data-testid":N},n)),h,(c||o)&&r.createElement("div",{"data-testid":b},c?r.createElement("p",{className:"text-xs text-destructive","data-testid":v},c):o?r.createElement("p",{className:"text-xs text-blue-600 dark:text-blue-400","data-testid":E},o):null))});u.displayName="EnhancedSlider";export{u as EnhancedSlider};
|
|
@@ -1,89 +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
|
-
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.EnhancedSwitch = void 0;
|
|
60
|
-
var React = __importStar(require("react"));
|
|
61
|
-
var SwitchPrimitives = __importStar(require("@radix-ui/react-switch"));
|
|
62
|
-
var utils_1 = require("../lib/utils");
|
|
63
|
-
var enhanced_label_1 = require("./enhanced-label");
|
|
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"]);
|
|
66
|
-
// Determine if there's an error (for aria-invalid and styling)
|
|
67
|
-
var hasError = Boolean(error);
|
|
68
|
-
var switchElement = (React.createElement(SwitchPrimitives.Root, __assign({ ref: ref, id: id, "data-slot": "switch", "data-testid": testIdSwitch, "aria-invalid": hasError, required: required, className: (0, utils_1.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
|
-
// Error state styling
|
|
70
|
-
hasError &&
|
|
71
|
-
"data-[state=checked]:bg-destructive data-[state=unchecked]:bg-destructive/20 border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20", className) }, props),
|
|
72
|
-
React.createElement(SwitchPrimitives.Thumb, { "data-slot": "switch-thumb", "data-testid": testIdThumb, className: (0, utils_1.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
|
-
// If label is provided, render the complete switch with label structure
|
|
74
|
-
if (label) {
|
|
75
|
-
return (React.createElement("div", { className: "w-full space-y-2", "data-testid": testIdWrapper },
|
|
76
|
-
React.createElement("div", { className: "flex items-center justify-between space-x-2" },
|
|
77
|
-
React.createElement("div", null,
|
|
78
|
-
React.createElement(enhanced_label_1.EnhancedLabel, { htmlFor: id, required: required, testIdLabel: testIdLabel }, label),
|
|
79
|
-
description && (React.createElement("p", { className: "text-sm text-gray-400", "data-testid": testIdDescription }, description))),
|
|
80
|
-
switchElement),
|
|
81
|
-
(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))));
|
|
82
|
-
}
|
|
83
|
-
// If no label, render just the switch with messages (backward compatibility)
|
|
84
|
-
return (React.createElement("div", { className: "w-full", "data-testid": testIdWrapper },
|
|
85
|
-
switchElement,
|
|
86
|
-
(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
|
-
});
|
|
88
|
-
exports.EnhancedSwitch = EnhancedSwitch;
|
|
89
|
-
EnhancedSwitch.displayName = "EnhancedSwitch";
|
|
1
|
+
"use strict";"use client";var N=function(r,i){var s={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&i.indexOf(e)<0&&(s[e]=r[e]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,e=Object.getOwnPropertySymbols(r);a<e.length;a++)i.indexOf(e[a])<0&&Object.prototype.propertyIsEnumerable.call(r,e[a])&&(s[e[a]]=r[e[a]]);return s};import*as t from"react";import*as h from"@radix-ui/react-switch";import{cn as v}from"../lib/utils";import{EnhancedLabel as k}from"./enhanced-label";const x=t.forwardRef((r,i)=>{var{className:s,error:e,info:a,label:d,required:n,id:c,description:l,testIdWrapper:o,testIdLabel:g,testIdSwitch:E,testIdThumb:w,testIdDescription:I,testIdMessage:u,testIdError:m,testIdInfo:b}=r,y=N(r,["className","error","info","label","required","id","description","testIdWrapper","testIdLabel","testIdSwitch","testIdThumb","testIdDescription","testIdMessage","testIdError","testIdInfo"]);const f=!!e,p=t.createElement(h.Root,Object.assign({ref:i,id:c,"data-slot":"switch","data-testid":E,"aria-invalid":f,required:n,className:v("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",f&&"data-[state=checked]:bg-destructive data-[state=unchecked]:bg-destructive/20 border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20",s)},y),t.createElement(h.Thumb,{"data-slot":"switch-thumb","data-testid":w,className:v("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")}));return d?t.createElement("div",{className:"w-full space-y-2","data-testid":o},t.createElement("div",{className:"flex items-center justify-between space-x-2"},t.createElement("div",null,t.createElement(k,{htmlFor:c,required:n,testIdLabel:g},d),l&&t.createElement("p",{className:"text-sm text-gray-400","data-testid":I},l)),p),(e||a)&&t.createElement("div",{"data-testid":u},e?t.createElement("p",{className:"text-xs text-destructive","data-testid":m},e):a?t.createElement("p",{className:"text-xs text-blue-600 dark:text-blue-400","data-testid":b},a):null)):t.createElement("div",{className:"w-full","data-testid":o},p,(e||a)&&t.createElement("div",{"data-testid":u},e?t.createElement("p",{className:"text-xs text-destructive","data-testid":m},e):a?t.createElement("p",{className:"text-xs text-blue-600 dark:text-blue-400","data-testid":b},a):null))});x.displayName="EnhancedSwitch";export{x as EnhancedSwitch};
|
|
@@ -1,110 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Enhanced Table Footer Action Component
|
|
4
|
-
*
|
|
5
|
-
* Navigation buttons for table pagination with RTL/LTR support.
|
|
6
|
-
* Automatically adjusts arrow directions and button order based on locale.
|
|
7
|
-
*
|
|
8
|
-
* Features:
|
|
9
|
-
* - RTL/LTR arrow direction adjustment
|
|
10
|
-
* - Button order reversal for RTL layouts
|
|
11
|
-
* - Accessibility attributes
|
|
12
|
-
* - Internationalized aria labels
|
|
13
|
-
* - Disabled state handling
|
|
14
|
-
* - Loading state support
|
|
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.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;
|
|
26
|
-
// In RTL, arrows should be swapped:
|
|
27
|
-
// Previous should show → (ChevronRight) as it goes to the right in RTL reading order
|
|
28
|
-
// Next should show ← (ChevronLeft) as it goes to the left in RTL reading order
|
|
29
|
-
var PreviousIcon = isRTL ? lucide_react_1.ChevronRight : lucide_react_1.ChevronLeft;
|
|
30
|
-
var NextIcon = isRTL ? lucide_react_1.ChevronLeft : lucide_react_1.ChevronRight;
|
|
31
|
-
return (react_1.default.createElement("div", { className: "flex gap-1 ".concat(isRTL ? "flex-row-reverse" : ""), "data-testid": testIdWrapper },
|
|
32
|
-
react_1.default.createElement(button_1.Button, { variant: "outline", size: "icon", "data-testid": testIdPrevious, onClick: handlePreviousOnClick, disabled: isPreviousDisabled || loading, "aria-label": previousPageLabel, title: previousPageLabel, className: "".concat(isRTL ? "rotate-180" : "") },
|
|
33
|
-
react_1.default.createElement(PreviousIcon, { className: "h-4 w-4", "data-testid": testIdPreviousIcon })),
|
|
34
|
-
react_1.default.createElement(button_1.Button, { variant: "outline", size: "icon", "data-testid": testIdNext, onClick: handleNextOnClick, disabled: isNextDisabled || loading, "aria-label": nextPageLabel, title: nextPageLabel, className: "".concat(isRTL ? "rotate-180" : "") },
|
|
35
|
-
react_1.default.createElement(NextIcon, { className: "h-4 w-4", "data-testid": testIdNextIcon }))));
|
|
36
|
-
};
|
|
37
|
-
exports.EnhancedTableFooterAction = EnhancedTableFooterAction;
|
|
38
|
-
// ============================================================================
|
|
39
|
-
// USAGE EXAMPLES
|
|
40
|
-
// ============================================================================
|
|
41
|
-
/*
|
|
42
|
-
Example 1: Basic usage with automatic i18n and RTL support
|
|
43
|
-
<EnhancedTableFooterAction
|
|
44
|
-
handlePreviousOnClick={() => setCurrentPage(prev => prev - 1)}
|
|
45
|
-
handleNextOnClick={() => setCurrentPage(prev => prev + 1)}
|
|
46
|
-
isPreviousDisabled={currentPage === 1}
|
|
47
|
-
isNextDisabled={currentPage === totalPages}
|
|
48
|
-
loading={false}
|
|
49
|
-
/>
|
|
50
|
-
|
|
51
|
-
Example 2: With custom aria labels
|
|
52
|
-
<EnhancedTableFooterAction
|
|
53
|
-
handlePreviousOnClick={handlePrevious}
|
|
54
|
-
handleNextOnClick={handleNext}
|
|
55
|
-
isPreviousDisabled={isPreviousDisabled}
|
|
56
|
-
isNextDisabled={isNextDisabled}
|
|
57
|
-
loading={isLoading}
|
|
58
|
-
ariaLabels={{
|
|
59
|
-
previous: "Go to previous page",
|
|
60
|
-
next: "Go to next page"
|
|
61
|
-
}}
|
|
62
|
-
/>
|
|
63
|
-
|
|
64
|
-
Example 3: Loading state
|
|
65
|
-
<EnhancedTableFooterAction
|
|
66
|
-
handlePreviousOnClick={handlePrevious}
|
|
67
|
-
handleNextOnClick={handleNext}
|
|
68
|
-
loading={true} // Both buttons will be disabled
|
|
69
|
-
/>
|
|
70
|
-
|
|
71
|
-
RTL Behavior:
|
|
72
|
-
- In LTR languages (English): Previous (←) | Next (→)
|
|
73
|
-
- In RTL languages (Arabic/Urdu): Previous (→) | Next (←)
|
|
74
|
-
- Button order is reversed in RTL: [Next] [Previous]
|
|
75
|
-
- Arrows automatically adjust to reading direction
|
|
76
|
-
*/
|
|
77
|
-
// ============================================================================
|
|
78
|
-
// COMPONENT ENHANCEMENTS SUMMARY
|
|
79
|
-
// ============================================================================
|
|
80
|
-
/*
|
|
81
|
-
Enhancements Applied:
|
|
82
|
-
|
|
83
|
-
1. **RTL/LTR Layout Support**
|
|
84
|
-
- Automatic arrow direction adjustment based on locale
|
|
85
|
-
- Button order reversal for RTL layouts (flex-row-reverse)
|
|
86
|
-
- Direction-aware icon selection (ChevronLeft/Right swap)
|
|
87
|
-
- Proper navigation flow for both reading directions
|
|
88
|
-
|
|
89
|
-
2. **Internationalization (i18n)**
|
|
90
|
-
- Translation support using next-intl
|
|
91
|
-
- Fallback aria labels for accessibility
|
|
92
|
-
- Custom aria label override capability
|
|
93
|
-
- Tooltip support with title attributes
|
|
94
|
-
|
|
95
|
-
3. **Accessibility Improvements**
|
|
96
|
-
- ARIA labels for screen readers
|
|
97
|
-
- Title attributes for tooltips
|
|
98
|
-
- Proper button semantics
|
|
99
|
-
- Keyboard navigation support
|
|
100
|
-
|
|
101
|
-
4. **Visual Consistency**
|
|
102
|
-
- Maintains button spacing and alignment
|
|
103
|
-
- Consistent with existing table footer components
|
|
104
|
-
- Proper disabled state handling
|
|
105
|
-
- Loading state support
|
|
106
|
-
|
|
107
|
-
Translation Keys Added:
|
|
108
|
-
- common.previousPage: "Previous page" / "پچھلا صفحہ"
|
|
109
|
-
- common.nextPage: "Next page" / "اگلا صفحہ"
|
|
110
|
-
*/
|
|
1
|
+
"use strict";import t from"react";import{ChevronLeft as i,ChevronRight as l}from"lucide-react";import{Button as n}from"./ui/button";export const EnhancedTableFooterAction=({handleNextOnClick:c,handlePreviousOnClick:s,isNextDisabled:m,isPreviousDisabled:d,isRTL:e=!1,loading:a,nextPageLabel:o="Next page",previousPageLabel:r="Previous page",testIdWrapper:f,testIdPrevious:v,testIdNext:N,testIdPreviousIcon:h,testIdNextIcon:p})=>{const E=e?l:i,u=e?i:l;return t.createElement("div",{className:`flex gap-1 ${e?"flex-row-reverse":""}`,"data-testid":f},t.createElement(n,{variant:"outline",size:"icon","data-testid":v,onClick:s,disabled:d||a,"aria-label":r,title:r,className:`${e?"rotate-180":""}`},t.createElement(E,{className:"h-4 w-4","data-testid":h})),t.createElement(n,{variant:"outline",size:"icon","data-testid":N,onClick:c,disabled:m||a,"aria-label":o,title:o,className:`${e?"rotate-180":""}`},t.createElement(u,{className:"h-4 w-4","data-testid":p})))};
|
|
@@ -1,132 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Enhanced Table Footer Page Component
|
|
4
|
-
*
|
|
5
|
-
* Displays pagination information with internationalization and RTL/LTR support.
|
|
6
|
-
* Automatically adapts text direction and order based on locale.
|
|
7
|
-
*
|
|
8
|
-
* Features:
|
|
9
|
-
* - Full i18n support with fallback text
|
|
10
|
-
* - RTL/LTR layout adaptation
|
|
11
|
-
* - Loading state indicator
|
|
12
|
-
* - Accessibility attributes
|
|
13
|
-
* - Custom translation overrides
|
|
14
|
-
*/
|
|
15
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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 ? (
|
|
25
|
-
// RTL layout: Numbers read right-to-left but maintain logical order
|
|
26
|
-
react_1.default.createElement("span", { className: "inline-flex items-center gap-1" },
|
|
27
|
-
react_1.default.createElement("span", { "data-testid": testIdTotal }, totalPages),
|
|
28
|
-
react_1.default.createElement("span", { "data-testid": testIdOfLabel }, ofLabel),
|
|
29
|
-
react_1.default.createElement("span", { "data-testid": testIdCurrent }, currentPage),
|
|
30
|
-
react_1.default.createElement("span", { "data-testid": testIdPageLabel }, pageLabel))) : (
|
|
31
|
-
// LTR layout: "Page currentPage of totalPages"
|
|
32
|
-
react_1.default.createElement("span", { className: "inline-flex items-center gap-1" },
|
|
33
|
-
react_1.default.createElement("span", { "data-testid": testIdPageLabel }, pageLabel),
|
|
34
|
-
react_1.default.createElement("span", { "data-testid": testIdCurrent }, currentPage),
|
|
35
|
-
react_1.default.createElement("span", { "data-testid": testIdOfLabel }, ofLabel),
|
|
36
|
-
react_1.default.createElement("span", { "data-testid": testIdTotal }, totalPages)))),
|
|
37
|
-
loading && (react_1.default.createElement("div", { className: "flex items-center gap-2 ".concat(isRTL ? "order-first" : "order-last"), "aria-label": loadingLabel, "data-testid": testIdLoadingWrapper },
|
|
38
|
-
react_1.default.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
|
-
};
|
|
40
|
-
exports.EnhancedTableFooterPage = EnhancedTableFooterPage;
|
|
41
|
-
// ============================================================================
|
|
42
|
-
// USAGE EXAMPLES
|
|
43
|
-
// ============================================================================
|
|
44
|
-
/*
|
|
45
|
-
Example 1: Basic usage with automatic i18n
|
|
46
|
-
<EnhancedTableFooterPage
|
|
47
|
-
currentPage={2}
|
|
48
|
-
totalPages={10}
|
|
49
|
-
loading={false}
|
|
50
|
-
/>
|
|
51
|
-
|
|
52
|
-
Example 2: With custom translations
|
|
53
|
-
<EnhancedTableFooterPage
|
|
54
|
-
currentPage={1}
|
|
55
|
-
totalPages={5}
|
|
56
|
-
loading={true}
|
|
57
|
-
translationMap={{
|
|
58
|
-
pageLabel: "صفحہ", // Urdu for "Page"
|
|
59
|
-
ofLabel: "کا", // Urdu for "of"
|
|
60
|
-
loadingLabel: "لوڈ ہو رہا ہے" // Urdu for "Loading"
|
|
61
|
-
}}
|
|
62
|
-
/>
|
|
63
|
-
|
|
64
|
-
Example 3: With custom styling
|
|
65
|
-
<EnhancedTableFooterPage
|
|
66
|
-
currentPage={3}
|
|
67
|
-
totalPages={7}
|
|
68
|
-
loading={false}
|
|
69
|
-
className="bg-gray-50 p-2 rounded-md"
|
|
70
|
-
/>
|
|
71
|
-
|
|
72
|
-
Translation Keys (Already Added to messages files):
|
|
73
|
-
English (en.json):
|
|
74
|
-
{
|
|
75
|
-
"common": {
|
|
76
|
-
"page": "Page",
|
|
77
|
-
"of": "of",
|
|
78
|
-
"loading": "Loading"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
Urdu (ur.json):
|
|
83
|
-
{
|
|
84
|
-
"common": {
|
|
85
|
-
"page": "صفحہ",
|
|
86
|
-
"of": "کا",
|
|
87
|
-
"loading": "لوڈ ہو رہا ہے"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
RTL Layout Features:
|
|
92
|
-
- Automatic text direction detection and application
|
|
93
|
-
- Proper order of page information in RTL languages
|
|
94
|
-
- RTL-aware loading indicator positioning
|
|
95
|
-
- Accessibility attributes for screen readers
|
|
96
|
-
- Direction-specific CSS classes and DOM attributes
|
|
97
|
-
*/
|
|
98
|
-
// ============================================================================
|
|
99
|
-
// COMPONENT ENHANCEMENTS SUMMARY
|
|
100
|
-
// ============================================================================
|
|
101
|
-
/*
|
|
102
|
-
Enhancements Applied:
|
|
103
|
-
|
|
104
|
-
1. **Internationalization (i18n)**
|
|
105
|
-
- Full translation support using next-intl
|
|
106
|
-
- Fallback text for missing translations
|
|
107
|
-
- Custom translation override capability
|
|
108
|
-
|
|
109
|
-
2. **RTL/LTR Layout Support**
|
|
110
|
-
- Automatic layout detection using useRTL hook
|
|
111
|
-
- Proper text ordering for RTL languages
|
|
112
|
-
- Direction-aware CSS classes and attributes
|
|
113
|
-
- RTL-appropriate visual element positioning
|
|
114
|
-
|
|
115
|
-
3. **Accessibility Improvements**
|
|
116
|
-
- ARIA labels for screen readers
|
|
117
|
-
- Role attributes for semantic meaning
|
|
118
|
-
- Live region announcements for dynamic content
|
|
119
|
-
- Proper labeling of interactive elements
|
|
120
|
-
|
|
121
|
-
4. **Developer Experience**
|
|
122
|
-
- Comprehensive JSDoc documentation
|
|
123
|
-
- Usage examples and patterns
|
|
124
|
-
- TypeScript interface improvements
|
|
125
|
-
- Flexible customization options
|
|
126
|
-
|
|
127
|
-
5. **Code Quality**
|
|
128
|
-
- Clean, readable component structure
|
|
129
|
-
- Consistent naming conventions
|
|
130
|
-
- Performance-optimized rendering
|
|
131
|
-
- Maintainable and extensible design
|
|
132
|
-
*/
|
|
1
|
+
"use strict";import e from"react";export const EnhancedTableFooterPage=({currentPage:a,isRTL:t=!1,loading:p,loadingLabel:l="Loading",ofLabel:r="of",pageLabel:n="Page",totalPages:s,className:E="",testIdWrapper:o,testIdCurrent:d,testIdPageLabel:i,testIdOfLabel:m,testIdTotal:c,testIdLoadingWrapper:f,testIdLoadingSpinner:x})=>e.createElement("div",{className:`flex items-center gap-2 ${t?"rtl":"ltr"} ${E}`,dir:t?"rtl":"ltr",role:"status","aria-live":"polite","aria-label":`${n} ${a} ${r} ${s}`,"data-testid":o},e.createElement("span",{className:"text-sm text-muted-foreground"},t?e.createElement("span",{className:"inline-flex items-center gap-1"},e.createElement("span",{"data-testid":c},s),e.createElement("span",{"data-testid":m},r),e.createElement("span",{"data-testid":d},a),e.createElement("span",{"data-testid":i},n)):e.createElement("span",{className:"inline-flex items-center gap-1"},e.createElement("span",{"data-testid":i},n),e.createElement("span",{"data-testid":d},a),e.createElement("span",{"data-testid":m},r),e.createElement("span",{"data-testid":c},s))),p&&e.createElement("div",{className:`flex items-center gap-2 ${t?"order-first":"order-last"}`,"aria-label":l,"data-testid":f},e.createElement("div",{className:"w-4 h-4 border-2 border-primary border-t-transparent rounded-full animate-spin",role:"progressbar","aria-label":l,"data-testid":x})));
|