@appcorp/stellar-solutions-modules 0.1.35 → 0.1.36
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/theme-provider.d.ts +9 -0
- package/components/theme-provider.js +122 -0
- package/components/ui/card.d.ts +9 -0
- package/components/ui/card.js +94 -0
- package/components/ui/combobox.d.ts +70 -0
- package/components/ui/combobox.js +315 -0
- package/components/ui/command.d.ts +18 -0
- package/components/ui/command.js +115 -0
- package/components/ui/dialog.d.ts +15 -0
- package/components/ui/dialog.js +118 -0
- package/components/ui/enhanced-table-footer-pagination.d.ts +1 -3
- package/components/ui/form.d.ts +24 -0
- package/components/ui/form.js +125 -0
- package/components/ui/separator.d.ts +4 -0
- package/components/ui/separator.js +66 -0
- package/components/ui/textarea.d.ts +8 -0
- package/components/ui/textarea.js +86 -0
- package/i18n/navigation.d.ts +340 -0
- package/i18n/navigation.js +9 -0
- package/i18n/request.d.ts +2 -0
- package/i18n/request.js +95 -0
- package/i18n/routing.d.ts +18 -0
- package/i18n/routing.js +9 -0
- package/index.d.ts +26 -0
- package/index.js +42 -0
- package/package.json +12 -11
|
@@ -0,0 +1,115 @@
|
|
|
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.Command = Command;
|
|
60
|
+
exports.CommandDialog = CommandDialog;
|
|
61
|
+
exports.CommandInput = CommandInput;
|
|
62
|
+
exports.CommandList = CommandList;
|
|
63
|
+
exports.CommandEmpty = CommandEmpty;
|
|
64
|
+
exports.CommandGroup = CommandGroup;
|
|
65
|
+
exports.CommandItem = CommandItem;
|
|
66
|
+
exports.CommandShortcut = CommandShortcut;
|
|
67
|
+
exports.CommandSeparator = CommandSeparator;
|
|
68
|
+
var React = __importStar(require("react"));
|
|
69
|
+
var cmdk_1 = require("cmdk");
|
|
70
|
+
var lucide_react_1 = require("lucide-react");
|
|
71
|
+
var utils_1 = require("@/lib/utils");
|
|
72
|
+
var dialog_1 = require("@/components/ui/dialog");
|
|
73
|
+
function Command(_a) {
|
|
74
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
75
|
+
return (React.createElement(cmdk_1.Command, __assign({ "data-slot": "command", className: (0, utils_1.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className) }, props)));
|
|
76
|
+
}
|
|
77
|
+
function CommandDialog(_a) {
|
|
78
|
+
var _b = _a.title, title = _b === void 0 ? "Command Palette" : _b, _c = _a.description, description = _c === void 0 ? "Search for a command to run..." : _c, children = _a.children, className = _a.className, _d = _a.showCloseButton, showCloseButton = _d === void 0 ? true : _d, props = __rest(_a, ["title", "description", "children", "className", "showCloseButton"]);
|
|
79
|
+
return (React.createElement(dialog_1.Dialog, __assign({}, props),
|
|
80
|
+
React.createElement(dialog_1.DialogHeader, { className: "sr-only" },
|
|
81
|
+
React.createElement(dialog_1.DialogTitle, null, title),
|
|
82
|
+
React.createElement(dialog_1.DialogDescription, null, description)),
|
|
83
|
+
React.createElement(dialog_1.DialogContent, { className: (0, utils_1.cn)("overflow-hidden p-0", className), showCloseButton: showCloseButton },
|
|
84
|
+
React.createElement(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5" }, children))));
|
|
85
|
+
}
|
|
86
|
+
function CommandInput(_a) {
|
|
87
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
88
|
+
return (React.createElement("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3" },
|
|
89
|
+
React.createElement(lucide_react_1.SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
90
|
+
React.createElement(cmdk_1.Command.Input, __assign({ "data-slot": "command-input", className: (0, utils_1.cn)("placeholder:text-muted-foreground flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className) }, props))));
|
|
91
|
+
}
|
|
92
|
+
function CommandList(_a) {
|
|
93
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
94
|
+
return (React.createElement(cmdk_1.Command.List, __assign({ "data-slot": "command-list", className: (0, utils_1.cn)("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className) }, props)));
|
|
95
|
+
}
|
|
96
|
+
function CommandEmpty(_a) {
|
|
97
|
+
var props = __rest(_a, []);
|
|
98
|
+
return (React.createElement(cmdk_1.Command.Empty, __assign({ "data-slot": "command-empty", className: "py-6 text-center text-sm" }, props)));
|
|
99
|
+
}
|
|
100
|
+
function CommandGroup(_a) {
|
|
101
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
102
|
+
return (React.createElement(cmdk_1.Command.Group, __assign({ "data-slot": "command-group", className: (0, utils_1.cn)("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className) }, props)));
|
|
103
|
+
}
|
|
104
|
+
function CommandSeparator(_a) {
|
|
105
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
106
|
+
return (React.createElement(cmdk_1.Command.Separator, __assign({ "data-slot": "command-separator", className: (0, utils_1.cn)("bg-border -mx-1 h-px", className) }, props)));
|
|
107
|
+
}
|
|
108
|
+
function CommandItem(_a) {
|
|
109
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
110
|
+
return (React.createElement(cmdk_1.Command.Item, __assign({ "data-slot": "command-item", className: (0, utils_1.cn)("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className) }, props)));
|
|
111
|
+
}
|
|
112
|
+
function CommandShortcut(_a) {
|
|
113
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
114
|
+
return (React.createElement("span", __assign({ "data-slot": "command-shortcut", className: (0, utils_1.cn)("text-muted-foreground ml-auto text-xs tracking-widest", className) }, props)));
|
|
115
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,118 @@
|
|
|
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.Dialog = Dialog;
|
|
60
|
+
exports.DialogClose = DialogClose;
|
|
61
|
+
exports.DialogContent = DialogContent;
|
|
62
|
+
exports.DialogDescription = DialogDescription;
|
|
63
|
+
exports.DialogFooter = DialogFooter;
|
|
64
|
+
exports.DialogHeader = DialogHeader;
|
|
65
|
+
exports.DialogOverlay = DialogOverlay;
|
|
66
|
+
exports.DialogPortal = DialogPortal;
|
|
67
|
+
exports.DialogTitle = DialogTitle;
|
|
68
|
+
exports.DialogTrigger = DialogTrigger;
|
|
69
|
+
var React = __importStar(require("react"));
|
|
70
|
+
var DialogPrimitive = __importStar(require("@radix-ui/react-dialog"));
|
|
71
|
+
var lucide_react_1 = require("lucide-react");
|
|
72
|
+
var utils_1 = require("@/lib/utils");
|
|
73
|
+
function Dialog(_a) {
|
|
74
|
+
var props = __rest(_a, []);
|
|
75
|
+
return React.createElement(DialogPrimitive.Root, __assign({ "data-slot": "dialog" }, props));
|
|
76
|
+
}
|
|
77
|
+
function DialogTrigger(_a) {
|
|
78
|
+
var props = __rest(_a, []);
|
|
79
|
+
return React.createElement(DialogPrimitive.Trigger, __assign({ "data-slot": "dialog-trigger" }, props));
|
|
80
|
+
}
|
|
81
|
+
function DialogPortal(_a) {
|
|
82
|
+
var props = __rest(_a, []);
|
|
83
|
+
return React.createElement(DialogPrimitive.Portal, __assign({ "data-slot": "dialog-portal" }, props));
|
|
84
|
+
}
|
|
85
|
+
function DialogClose(_a) {
|
|
86
|
+
var props = __rest(_a, []);
|
|
87
|
+
return React.createElement(DialogPrimitive.Close, __assign({ "data-slot": "dialog-close" }, props));
|
|
88
|
+
}
|
|
89
|
+
function DialogOverlay(_a) {
|
|
90
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
91
|
+
return (React.createElement(DialogPrimitive.Overlay, __assign({ "data-slot": "dialog-overlay", className: (0, utils_1.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className) }, props)));
|
|
92
|
+
}
|
|
93
|
+
function DialogContent(_a) {
|
|
94
|
+
var className = _a.className, children = _a.children, _b = _a.showCloseButton, showCloseButton = _b === void 0 ? true : _b, props = __rest(_a, ["className", "children", "showCloseButton"]);
|
|
95
|
+
return (React.createElement(DialogPortal, { "data-slot": "dialog-portal" },
|
|
96
|
+
React.createElement(DialogOverlay, null),
|
|
97
|
+
React.createElement(DialogPrimitive.Content, __assign({ "data-slot": "dialog-content", className: (0, utils_1.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", className) }, props),
|
|
98
|
+
children,
|
|
99
|
+
showCloseButton && (React.createElement(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4" },
|
|
100
|
+
React.createElement(lucide_react_1.XIcon, null),
|
|
101
|
+
React.createElement("span", { className: "sr-only" }, "Close"))))));
|
|
102
|
+
}
|
|
103
|
+
function DialogHeader(_a) {
|
|
104
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
105
|
+
return (React.createElement("div", __assign({ "data-slot": "dialog-header", className: (0, utils_1.cn)("flex flex-col gap-2 text-center sm:text-left", className) }, props)));
|
|
106
|
+
}
|
|
107
|
+
function DialogFooter(_a) {
|
|
108
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
109
|
+
return (React.createElement("div", __assign({ "data-slot": "dialog-footer", className: (0, utils_1.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className) }, props)));
|
|
110
|
+
}
|
|
111
|
+
function DialogTitle(_a) {
|
|
112
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
113
|
+
return (React.createElement(DialogPrimitive.Title, __assign({ "data-slot": "dialog-title", className: (0, utils_1.cn)("text-lg leading-none font-semibold", className) }, props)));
|
|
114
|
+
}
|
|
115
|
+
function DialogDescription(_a) {
|
|
116
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
117
|
+
return (React.createElement(DialogPrimitive.Description, __assign({ "data-slot": "dialog-description", className: (0, utils_1.cn)("text-muted-foreground text-sm", className) }, props)));
|
|
118
|
+
}
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
* - Responsive design
|
|
14
14
|
*/
|
|
15
15
|
import { FC } from "react";
|
|
16
|
-
|
|
17
|
-
option: string;
|
|
18
|
-
}
|
|
16
|
+
import { PageLimitOption } from "./enhanced-table";
|
|
19
17
|
interface EnhancedTableFooterPageProps {
|
|
20
18
|
/** Handler for page limit selection changes */
|
|
21
19
|
handleOnSelect: (node: string, value: object) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
|
|
5
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
6
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
|
|
7
|
+
declare const useFormField: () => {
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
isDirty: boolean;
|
|
10
|
+
isTouched: boolean;
|
|
11
|
+
isValidating: boolean;
|
|
12
|
+
error?: import("react-hook-form").FieldError;
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
formItemId: string;
|
|
16
|
+
formDescriptionId: string;
|
|
17
|
+
formMessageId: string;
|
|
18
|
+
};
|
|
19
|
+
declare function FormItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
20
|
+
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
|
|
21
|
+
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): React.JSX.Element;
|
|
22
|
+
declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
23
|
+
declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element | null;
|
|
24
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
@@ -0,0 +1,125 @@
|
|
|
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.FormField = exports.Form = exports.useFormField = void 0;
|
|
60
|
+
exports.FormItem = FormItem;
|
|
61
|
+
exports.FormLabel = FormLabel;
|
|
62
|
+
exports.FormControl = FormControl;
|
|
63
|
+
exports.FormDescription = FormDescription;
|
|
64
|
+
exports.FormMessage = FormMessage;
|
|
65
|
+
var React = __importStar(require("react"));
|
|
66
|
+
var react_slot_1 = require("@radix-ui/react-slot");
|
|
67
|
+
var react_hook_form_1 = require("react-hook-form");
|
|
68
|
+
var utils_1 = require("@/lib/utils");
|
|
69
|
+
var label_1 = require("@/components/ui/label");
|
|
70
|
+
var Form = react_hook_form_1.FormProvider;
|
|
71
|
+
exports.Form = Form;
|
|
72
|
+
var FormFieldContext = React.createContext({});
|
|
73
|
+
var FormField = function (_a) {
|
|
74
|
+
var props = __rest(_a, []);
|
|
75
|
+
return (React.createElement(FormFieldContext.Provider, { value: { name: props.name } },
|
|
76
|
+
React.createElement(react_hook_form_1.Controller, __assign({}, props))));
|
|
77
|
+
};
|
|
78
|
+
exports.FormField = FormField;
|
|
79
|
+
var useFormField = function () {
|
|
80
|
+
var fieldContext = React.useContext(FormFieldContext);
|
|
81
|
+
var itemContext = React.useContext(FormItemContext);
|
|
82
|
+
var getFieldState = (0, react_hook_form_1.useFormContext)().getFieldState;
|
|
83
|
+
var formState = (0, react_hook_form_1.useFormState)({ name: fieldContext.name });
|
|
84
|
+
var fieldState = getFieldState(fieldContext.name, formState);
|
|
85
|
+
if (!fieldContext) {
|
|
86
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
87
|
+
}
|
|
88
|
+
var id = itemContext.id;
|
|
89
|
+
return __assign({ id: id, name: fieldContext.name, formItemId: "".concat(id, "-form-item"), formDescriptionId: "".concat(id, "-form-item-description"), formMessageId: "".concat(id, "-form-item-message") }, fieldState);
|
|
90
|
+
};
|
|
91
|
+
exports.useFormField = useFormField;
|
|
92
|
+
var FormItemContext = React.createContext({});
|
|
93
|
+
function FormItem(_a) {
|
|
94
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
95
|
+
var id = React.useId();
|
|
96
|
+
return (React.createElement(FormItemContext.Provider, { value: { id: id } },
|
|
97
|
+
React.createElement("div", __assign({ "data-slot": "form-item", className: (0, utils_1.cn)("grid gap-2", className) }, props))));
|
|
98
|
+
}
|
|
99
|
+
function FormLabel(_a) {
|
|
100
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
101
|
+
var _b = useFormField(), error = _b.error, formItemId = _b.formItemId;
|
|
102
|
+
return (React.createElement(label_1.Label, __assign({ "data-slot": "form-label", "data-error": !!error, className: (0, utils_1.cn)("data-[error=true]:text-destructive", className), htmlFor: formItemId }, props)));
|
|
103
|
+
}
|
|
104
|
+
function FormControl(_a) {
|
|
105
|
+
var props = __rest(_a, []);
|
|
106
|
+
var _b = useFormField(), error = _b.error, formItemId = _b.formItemId, formDescriptionId = _b.formDescriptionId, formMessageId = _b.formMessageId;
|
|
107
|
+
return (React.createElement(react_slot_1.Slot, __assign({ "data-slot": "form-control", id: formItemId, "aria-describedby": !error
|
|
108
|
+
? "".concat(formDescriptionId)
|
|
109
|
+
: "".concat(formDescriptionId, " ").concat(formMessageId), "aria-invalid": !!error }, props)));
|
|
110
|
+
}
|
|
111
|
+
function FormDescription(_a) {
|
|
112
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
113
|
+
var formDescriptionId = useFormField().formDescriptionId;
|
|
114
|
+
return (React.createElement("p", __assign({ "data-slot": "form-description", id: formDescriptionId, className: (0, utils_1.cn)("text-muted-foreground text-sm", className) }, props)));
|
|
115
|
+
}
|
|
116
|
+
function FormMessage(_a) {
|
|
117
|
+
var _b;
|
|
118
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
119
|
+
var _c = useFormField(), error = _c.error, formMessageId = _c.formMessageId;
|
|
120
|
+
var body = error ? String((_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : "") : props.children;
|
|
121
|
+
if (!body) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
return (React.createElement("p", __assign({ "data-slot": "form-message", id: formMessageId, className: (0, utils_1.cn)("text-destructive text-sm", className) }, props), body));
|
|
125
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,66 @@
|
|
|
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.Separator = Separator;
|
|
60
|
+
var React = __importStar(require("react"));
|
|
61
|
+
var SeparatorPrimitive = __importStar(require("@radix-ui/react-separator"));
|
|
62
|
+
var utils_1 = require("@/lib/utils");
|
|
63
|
+
function Separator(_a) {
|
|
64
|
+
var className = _a.className, _b = _a.orientation, orientation = _b === void 0 ? "horizontal" : _b, _c = _a.decorative, decorative = _c === void 0 ? true : _c, props = __rest(_a, ["className", "orientation", "decorative"]);
|
|
65
|
+
return (React.createElement(SeparatorPrimitive.Root, __assign({ "data-slot": "separator", decorative: decorative, orientation: orientation, className: (0, utils_1.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className) }, props)));
|
|
66
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface TextareaProps extends React.ComponentProps<"textarea"> {
|
|
3
|
+
error?: string;
|
|
4
|
+
info?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const Textarea: React.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
8
|
+
export { Textarea };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
47
|
+
var t = {};
|
|
48
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
+
t[p] = s[p];
|
|
50
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
+
t[p[i]] = s[p[i]];
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
};
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
exports.Textarea = void 0;
|
|
59
|
+
var React = __importStar(require("react"));
|
|
60
|
+
var utils_1 = require("@/lib/utils");
|
|
61
|
+
var label_1 = require("@/components/ui/label");
|
|
62
|
+
var Textarea = React.forwardRef(function (_a, ref) {
|
|
63
|
+
var className = _a.className, error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, props = __rest(_a, ["className", "error", "info", "label", "required", "id"]);
|
|
64
|
+
// Determine if there's an error (for aria-invalid and styling)
|
|
65
|
+
var hasError = Boolean(error);
|
|
66
|
+
var textareaElement = (React.createElement("textarea", __assign({ ref: ref, id: id, "data-slot": "textarea", "aria-invalid": hasError, required: required, className: (0, utils_1.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input min-h-[80px] w-full min-w-0 rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none resize-vertical disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
67
|
+
// Error state styling
|
|
68
|
+
hasError &&
|
|
69
|
+
"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/20",
|
|
70
|
+
// Normal state when no error
|
|
71
|
+
!hasError &&
|
|
72
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className) }, props)));
|
|
73
|
+
// If label is provided, render the complete textarea with label structure
|
|
74
|
+
if (label) {
|
|
75
|
+
return (React.createElement("div", { className: "w-full space-y-2" },
|
|
76
|
+
React.createElement(label_1.Label, { htmlFor: id, required: required }, label),
|
|
77
|
+
textareaElement,
|
|
78
|
+
(error || info) && (React.createElement("div", null, error ? (React.createElement("p", { className: "text-xs text-destructive" }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400" }, info)) : null))));
|
|
79
|
+
}
|
|
80
|
+
// If no label, render just the textarea with messages (backward compatibility)
|
|
81
|
+
return (React.createElement("div", { className: "w-full" },
|
|
82
|
+
textareaElement,
|
|
83
|
+
(error || info) && (React.createElement("div", null, error ? (React.createElement("p", { className: "text-xs text-destructive" }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400" }, info)) : null))));
|
|
84
|
+
});
|
|
85
|
+
exports.Textarea = Textarea;
|
|
86
|
+
Textarea.displayName = "Textarea";
|