@medialane/ui 0.101.1 → 0.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert.cjs +75 -0
- package/dist/components/alert.cjs.map +1 -0
- package/dist/components/alert.d.cts +11 -0
- package/dist/components/alert.d.ts +11 -0
- package/dist/components/alert.js +39 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/badge.cjs +52 -0
- package/dist/components/badge.cjs.map +1 -0
- package/dist/components/badge.d.cts +13 -0
- package/dist/components/badge.d.ts +13 -0
- package/dist/components/badge.js +27 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.cjs +86 -0
- package/dist/components/button.cjs.map +1 -0
- package/dist/components/button.d.cts +14 -0
- package/dist/components/button.d.ts +14 -0
- package/dist/components/button.js +51 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/card.cjs +87 -0
- package/dist/components/card.cjs.map +1 -0
- package/dist/components/card.d.cts +10 -0
- package/dist/components/card.d.ts +10 -0
- package/dist/components/card.js +48 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/checkbox.cjs +63 -0
- package/dist/components/checkbox.cjs.map +1 -0
- package/dist/components/checkbox.d.cts +6 -0
- package/dist/components/checkbox.d.ts +6 -0
- package/dist/components/checkbox.js +29 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.cjs +47 -0
- package/dist/components/collapsible.cjs.map +1 -0
- package/dist/components/collapsible.d.cts +8 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +11 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/empty-or-error.cjs +88 -0
- package/dist/components/empty-or-error.cjs.map +1 -0
- package/dist/components/empty-or-error.d.cts +23 -0
- package/dist/components/empty-or-error.d.ts +23 -0
- package/dist/components/empty-or-error.js +54 -0
- package/dist/components/empty-or-error.js.map +1 -0
- package/dist/components/form.cjs +150 -0
- package/dist/components/form.cjs.map +1 -0
- package/dist/components/form.d.cts +29 -0
- package/dist/components/form.d.ts +29 -0
- package/dist/components/form.js +113 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/help-icon.cjs +47 -0
- package/dist/components/help-icon.cjs.map +1 -0
- package/dist/components/help-icon.d.cts +14 -0
- package/dist/components/help-icon.d.ts +14 -0
- package/dist/components/help-icon.js +23 -0
- package/dist/components/help-icon.js.map +1 -0
- package/dist/components/input.cjs +58 -0
- package/dist/components/input.cjs.map +1 -0
- package/dist/components/input.d.cts +5 -0
- package/dist/components/input.d.ts +5 -0
- package/dist/components/input.js +24 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.cjs +49 -0
- package/dist/components/label.cjs.map +1 -0
- package/dist/components/label.d.cts +8 -0
- package/dist/components/label.d.ts +8 -0
- package/dist/components/label.js +15 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/popover.cjs +66 -0
- package/dist/components/popover.cjs.map +1 -0
- package/dist/components/popover.d.cts +9 -0
- package/dist/components/popover.d.ts +9 -0
- package/dist/components/popover.js +29 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/portfolio-header.cjs +1 -1
- package/dist/components/portfolio-header.cjs.map +1 -1
- package/dist/components/portfolio-header.d.cts +1 -4
- package/dist/components/portfolio-header.d.ts +1 -4
- package/dist/components/portfolio-header.js +1 -1
- package/dist/components/portfolio-header.js.map +1 -1
- package/dist/components/select.cjs +163 -0
- package/dist/components/select.cjs.map +1 -0
- package/dist/components/select.d.cts +15 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +120 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/skeleton.cjs +42 -0
- package/dist/components/skeleton.cjs.map +1 -0
- package/dist/components/skeleton.d.cts +5 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +18 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/switch.cjs +63 -0
- package/dist/components/switch.cjs.map +1 -0
- package/dist/components/switch.d.cts +6 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +29 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/tabs.cjs +86 -0
- package/dist/components/tabs.cjs.map +1 -0
- package/dist/components/tabs.d.cts +9 -0
- package/dist/components/tabs.d.ts +9 -0
- package/dist/components/tabs.js +49 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/index.cjs +114 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -1
- package/package.json +21 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/card.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils/cn.js\";\n\nconst Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-lg border bg-card text-card-foreground shadow-sm\", className)}\n {...props}\n />\n )\n);\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex flex-col space-y-1.5 p-6\", className)} {...props} />\n )\n);\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"text-2xl font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n )\n);\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n));\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n )\n);\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center p-6 pt-0\", className)} {...props} />\n )\n);\nCardFooter.displayName = \"CardFooter\";\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };\n"],"mappings":"AAKI;AALJ,YAAY,WAAW;AACvB,SAAS,UAAU;AAEnB,MAAM,OAAO,MAAM;AAAA,EACjB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,4DAA4D,SAAS;AAAA,MAClF,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,KAAK,cAAc;AAEnB,MAAM,aAAa,MAAM;AAAA,EACvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,SAAI,KAAU,WAAW,GAAG,iCAAiC,SAAS,GAAI,GAAG,OAAO;AAEzF;AACA,WAAW,cAAc;AAEzB,MAAM,YAAY,MAAM;AAAA,EACtB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,sDAAsD,SAAS;AAAA,MAC5E,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,UAAU,cAAc;AAExB,MAAM,kBAAkB,MAAM,WAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAC,OAAE,KAAU,WAAW,GAAG,iCAAiC,SAAS,GAAI,GAAG,OAAO,CACpF;AACD,gBAAgB,cAAc;AAE9B,MAAM,cAAc,MAAM;AAAA,EACxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,SAAI,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OAAO;AAEpE;AACA,YAAY,cAAc;AAE1B,MAAM,aAAa,MAAM;AAAA,EACvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,SAAI,KAAU,WAAW,GAAG,8BAA8B,SAAS,GAAI,GAAG,OAAO;AAEtF;AACA,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var checkbox_exports = {};
|
|
31
|
+
__export(checkbox_exports, {
|
|
32
|
+
Checkbox: () => Checkbox
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(checkbox_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var React = __toESM(require("react"), 1);
|
|
37
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
38
|
+
var import_lucide_react = require("lucide-react");
|
|
39
|
+
var import_cn = require("../utils/cn.js");
|
|
40
|
+
const Checkbox = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
CheckboxPrimitive.Root,
|
|
42
|
+
{
|
|
43
|
+
ref,
|
|
44
|
+
className: (0, import_cn.cn)(
|
|
45
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
46
|
+
className
|
|
47
|
+
),
|
|
48
|
+
...props,
|
|
49
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
CheckboxPrimitive.Indicator,
|
|
51
|
+
{
|
|
52
|
+
className: (0, import_cn.cn)("flex items-center justify-center text-current"),
|
|
53
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-4 w-4" })
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
));
|
|
58
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
Checkbox
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=checkbox.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { Check } from \"lucide-react\";\n\nimport { cn } from \"../utils/cn.js\";\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\"flex items-center justify-center text-current\")}\n >\n <Check className=\"h-4 w-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBM;AArBN,YAAuB;AACvB,wBAAmC;AACnC,0BAAsB;AAEtB,gBAAmB;AAEnB,MAAM,WAAW,MAAM,WAGrB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,kBAAkB;AAAA,EAAlB;AAAA,IACC;AAAA,IACA,eAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,MAAC,kBAAkB;AAAA,MAAlB;AAAA,QACC,eAAW,cAAG,+CAA+C;AAAA,QAE7D,sDAAC,6BAAM,WAAU,WAAU;AAAA;AAAA,IAC7B;AAAA;AACF,CACD;AACD,SAAS,cAAc,kBAAkB,KAAK;","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
|
|
4
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
|
|
6
|
+
export { Checkbox };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
|
|
4
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
|
|
6
|
+
export { Checkbox };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
5
|
+
import { Check } from "lucide-react";
|
|
6
|
+
import { cn } from "../utils/cn.js";
|
|
7
|
+
const Checkbox = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8
|
+
CheckboxPrimitive.Root,
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
className: cn(
|
|
12
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
13
|
+
className
|
|
14
|
+
),
|
|
15
|
+
...props,
|
|
16
|
+
children: /* @__PURE__ */ jsx(
|
|
17
|
+
CheckboxPrimitive.Indicator,
|
|
18
|
+
{
|
|
19
|
+
className: cn("flex items-center justify-center text-current"),
|
|
20
|
+
children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" })
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
));
|
|
25
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
26
|
+
export {
|
|
27
|
+
Checkbox
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { Check } from \"lucide-react\";\n\nimport { cn } from \"../utils/cn.js\";\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\"flex items-center justify-center text-current\")}\n >\n <Check className=\"h-4 w-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n"],"mappings":";AAuBM;AArBN,YAAY,WAAW;AACvB,YAAY,uBAAuB;AACnC,SAAS,aAAa;AAEtB,SAAS,UAAU;AAEnB,MAAM,WAAW,MAAM,WAGrB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,kBAAkB;AAAA,EAAlB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,MAAC,kBAAkB;AAAA,MAAlB;AAAA,QACC,WAAW,GAAG,+CAA+C;AAAA,QAE7D,8BAAC,SAAM,WAAU,WAAU;AAAA;AAAA,IAC7B;AAAA;AACF,CACD;AACD,SAAS,cAAc,kBAAkB,KAAK;","names":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var collapsible_exports = {};
|
|
31
|
+
__export(collapsible_exports, {
|
|
32
|
+
Collapsible: () => Collapsible,
|
|
33
|
+
CollapsibleContent: () => CollapsibleContent,
|
|
34
|
+
CollapsibleTrigger: () => CollapsibleTrigger
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(collapsible_exports);
|
|
37
|
+
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"), 1);
|
|
38
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
|
39
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
40
|
+
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
Collapsible,
|
|
44
|
+
CollapsibleContent,
|
|
45
|
+
CollapsibleTrigger
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=collapsible.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/collapsible.tsx"],"sourcesContent":["\"use client\";\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\nconst Collapsible = CollapsiblePrimitive.Root;\n\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;\n\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAAsC;AAEtC,MAAM,cAAc,qBAAqB;AAEzC,MAAM,qBAAqB,qBAAqB;AAEhD,MAAM,qBAAqB,qBAAqB;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
3
|
+
|
|
4
|
+
declare const Collapsible: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const CollapsibleTrigger: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const CollapsibleContent: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
|
|
8
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
3
|
+
|
|
4
|
+
declare const Collapsible: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const CollapsibleTrigger: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const CollapsibleContent: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
|
|
8
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
3
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
|
4
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
5
|
+
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
6
|
+
export {
|
|
7
|
+
Collapsible,
|
|
8
|
+
CollapsibleContent,
|
|
9
|
+
CollapsibleTrigger
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=collapsible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/collapsible.tsx"],"sourcesContent":["\"use client\";\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\nconst Collapsible = CollapsiblePrimitive.Root;\n\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;\n\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"],"mappings":";AAEA,YAAY,0BAA0B;AAEtC,MAAM,cAAc,qBAAqB;AAEzC,MAAM,qBAAqB,qBAAqB;AAEhD,MAAM,qBAAqB,qBAAqB;","names":[]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var empty_or_error_exports = {};
|
|
31
|
+
__export(empty_or_error_exports, {
|
|
32
|
+
EmptyOrError: () => EmptyOrError
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(empty_or_error_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_skeleton = require("./skeleton.js");
|
|
37
|
+
var import_button = require("./button.js");
|
|
38
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
39
|
+
var import_lucide_react = require("lucide-react");
|
|
40
|
+
function EmptyOrError({
|
|
41
|
+
isLoading,
|
|
42
|
+
error,
|
|
43
|
+
isEmpty,
|
|
44
|
+
onRetry,
|
|
45
|
+
emptyTitle,
|
|
46
|
+
emptyDescription,
|
|
47
|
+
emptyCta,
|
|
48
|
+
emptyIcon,
|
|
49
|
+
skeletonCount = 4,
|
|
50
|
+
skeletonNode,
|
|
51
|
+
children
|
|
52
|
+
}) {
|
|
53
|
+
if (isLoading) {
|
|
54
|
+
if (skeletonNode) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: skeletonNode });
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-3", children: Array.from({ length: skeletonCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-20 w-full rounded-xl" }, i)) });
|
|
56
|
+
}
|
|
57
|
+
if (error) {
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-16 text-center space-y-4", children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-14 w-14 rounded-xl bg-destructive/10 flex items-center justify-center mx-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-7 w-7 text-destructive" }) }),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold text-lg", children: "Something went wrong" }),
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground max-w-xs mx-auto", children: error instanceof Error ? error.message : "Failed to load data. Please try again." }),
|
|
62
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { variant: "outline", size: "sm", onClick: onRetry, children: [
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.RefreshCw, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
64
|
+
"Try again"
|
|
65
|
+
] })
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
if (isEmpty) {
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-16 text-center space-y-4", children: [
|
|
70
|
+
emptyIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-14 w-14 rounded-xl bg-muted flex items-center justify-center mx-auto", children: emptyIcon }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold text-lg", children: emptyTitle }),
|
|
72
|
+
emptyDescription && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground max-w-xs mx-auto", children: emptyDescription }),
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-center gap-3", children: [
|
|
74
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { variant: "outline", size: "sm", onClick: onRetry, children: [
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.RefreshCw, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
76
|
+
"Refresh"
|
|
77
|
+
] }),
|
|
78
|
+
emptyCta && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { size: "sm", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: emptyCta.href, children: emptyCta.label }) })
|
|
79
|
+
] })
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
|
83
|
+
}
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
EmptyOrError
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=empty-or-error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/empty-or-error.tsx"],"sourcesContent":["\"use client\";\n\nimport { Skeleton } from \"./skeleton.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"next/link\";\nimport { RefreshCw, AlertCircle } from \"lucide-react\";\nimport { ReactNode } from \"react\";\n\ninterface EmptyOrErrorProps {\n isLoading: boolean;\n error?: unknown;\n isEmpty: boolean;\n onRetry?: () => void;\n emptyTitle: string;\n emptyDescription?: string;\n emptyCta?: { label: string; href: string };\n emptyIcon?: ReactNode;\n skeletonCount?: number;\n /** Optional custom skeleton renderer — replaces the default row skeletons */\n skeletonNode?: ReactNode;\n children?: ReactNode;\n}\n\nexport function EmptyOrError({\n isLoading,\n error,\n isEmpty,\n onRetry,\n emptyTitle,\n emptyDescription,\n emptyCta,\n emptyIcon,\n skeletonCount = 4,\n skeletonNode,\n children,\n}: EmptyOrErrorProps) {\n if (isLoading) {\n if (skeletonNode) return <>{skeletonNode}</>;\n return (\n <div className=\"space-y-3\">\n {Array.from({ length: skeletonCount }).map((_, i) => (\n <Skeleton key={i} className=\"h-20 w-full rounded-xl\" />\n ))}\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n <div className=\"h-14 w-14 rounded-xl bg-destructive/10 flex items-center justify-center mx-auto\">\n <AlertCircle className=\"h-7 w-7 text-destructive\" />\n </div>\n <p className=\"font-semibold text-lg\">Something went wrong</p>\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">\n {error instanceof Error ? error.message : \"Failed to load data. Please try again.\"}\n </p>\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Try again\n </Button>\n )}\n </div>\n );\n }\n\n if (isEmpty) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n {emptyIcon && (\n <div className=\"h-14 w-14 rounded-xl bg-muted flex items-center justify-center mx-auto\">\n {emptyIcon}\n </div>\n )}\n <p className=\"font-semibold text-lg\">{emptyTitle}</p>\n {emptyDescription && (\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">{emptyDescription}</p>\n )}\n <div className=\"flex items-center justify-center gap-3\">\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Refresh\n </Button>\n )}\n {emptyCta && (\n <Button size=\"sm\" asChild>\n <Link href={emptyCta.href}>{emptyCta.label}</Link>\n </Button>\n )}\n </div>\n </div>\n );\n }\n\n return <>{children}</>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqC6B;AAnC7B,sBAAyB;AACzB,oBAAuB;AACvB,kBAAiB;AACjB,0BAAuC;AAkBhC,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA;AACF,GAAsB;AACpB,MAAI,WAAW;AACb,QAAI,aAAc,QAAO,2EAAG,wBAAa;AACzC,WACE,4CAAC,SAAI,WAAU,aACZ,gBAAM,KAAK,EAAE,QAAQ,cAAc,CAAC,EAAE,IAAI,CAAC,GAAG,MAC7C,4CAAC,4BAAiB,WAAU,4BAAb,CAAsC,CACtD,GACH;AAAA,EAEJ;AAEA,MAAI,OAAO;AACT,WACE,6CAAC,SAAI,WAAU,+BACb;AAAA,kDAAC,SAAI,WAAU,mFACb,sDAAC,mCAAY,WAAU,4BAA2B,GACpD;AAAA,MACA,4CAAC,OAAE,WAAU,yBAAwB,kCAAoB;AAAA,MACzD,4CAAC,OAAE,WAAU,kDACV,2BAAiB,QAAQ,MAAM,UAAU,0CAC5C;AAAA,MACC,WACC,6CAAC,wBAAO,SAAQ,WAAU,MAAK,MAAK,SAAS,SAC3C;AAAA,oDAAC,iCAAU,WAAU,sBAAqB;AAAA,QAAE;AAAA,SAE9C;AAAA,OAEJ;AAAA,EAEJ;AAEA,MAAI,SAAS;AACX,WACE,6CAAC,SAAI,WAAU,+BACZ;AAAA,mBACC,4CAAC,SAAI,WAAU,0EACZ,qBACH;AAAA,MAEF,4CAAC,OAAE,WAAU,yBAAyB,sBAAW;AAAA,MAChD,oBACC,4CAAC,OAAE,WAAU,kDAAkD,4BAAiB;AAAA,MAElF,6CAAC,SAAI,WAAU,0CACZ;AAAA,mBACC,6CAAC,wBAAO,SAAQ,WAAU,MAAK,MAAK,SAAS,SAC3C;AAAA,sDAAC,iCAAU,WAAU,sBAAqB;AAAA,UAAE;AAAA,WAE9C;AAAA,QAED,YACC,4CAAC,wBAAO,MAAK,MAAK,SAAO,MACvB,sDAAC,YAAAA,SAAA,EAAK,MAAM,SAAS,MAAO,mBAAS,OAAM,GAC7C;AAAA,SAEJ;AAAA,OACF;AAAA,EAEJ;AAEA,SAAO,2EAAG,UAAS;AACrB;","names":["Link"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface EmptyOrErrorProps {
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
error?: unknown;
|
|
7
|
+
isEmpty: boolean;
|
|
8
|
+
onRetry?: () => void;
|
|
9
|
+
emptyTitle: string;
|
|
10
|
+
emptyDescription?: string;
|
|
11
|
+
emptyCta?: {
|
|
12
|
+
label: string;
|
|
13
|
+
href: string;
|
|
14
|
+
};
|
|
15
|
+
emptyIcon?: ReactNode;
|
|
16
|
+
skeletonCount?: number;
|
|
17
|
+
/** Optional custom skeleton renderer — replaces the default row skeletons */
|
|
18
|
+
skeletonNode?: ReactNode;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare function EmptyOrError({ isLoading, error, isEmpty, onRetry, emptyTitle, emptyDescription, emptyCta, emptyIcon, skeletonCount, skeletonNode, children, }: EmptyOrErrorProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
export { EmptyOrError };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface EmptyOrErrorProps {
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
error?: unknown;
|
|
7
|
+
isEmpty: boolean;
|
|
8
|
+
onRetry?: () => void;
|
|
9
|
+
emptyTitle: string;
|
|
10
|
+
emptyDescription?: string;
|
|
11
|
+
emptyCta?: {
|
|
12
|
+
label: string;
|
|
13
|
+
href: string;
|
|
14
|
+
};
|
|
15
|
+
emptyIcon?: ReactNode;
|
|
16
|
+
skeletonCount?: number;
|
|
17
|
+
/** Optional custom skeleton renderer — replaces the default row skeletons */
|
|
18
|
+
skeletonNode?: ReactNode;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare function EmptyOrError({ isLoading, error, isEmpty, onRetry, emptyTitle, emptyDescription, emptyCta, emptyIcon, skeletonCount, skeletonNode, children, }: EmptyOrErrorProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
export { EmptyOrError };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Skeleton } from "./skeleton.js";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import Link from "next/link";
|
|
6
|
+
import { RefreshCw, AlertCircle } from "lucide-react";
|
|
7
|
+
function EmptyOrError({
|
|
8
|
+
isLoading,
|
|
9
|
+
error,
|
|
10
|
+
isEmpty,
|
|
11
|
+
onRetry,
|
|
12
|
+
emptyTitle,
|
|
13
|
+
emptyDescription,
|
|
14
|
+
emptyCta,
|
|
15
|
+
emptyIcon,
|
|
16
|
+
skeletonCount = 4,
|
|
17
|
+
skeletonNode,
|
|
18
|
+
children
|
|
19
|
+
}) {
|
|
20
|
+
if (isLoading) {
|
|
21
|
+
if (skeletonNode) return /* @__PURE__ */ jsx(Fragment, { children: skeletonNode });
|
|
22
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: Array.from({ length: skeletonCount }).map((_, i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-20 w-full rounded-xl" }, i)) });
|
|
23
|
+
}
|
|
24
|
+
if (error) {
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", { className: "py-16 text-center space-y-4", children: [
|
|
26
|
+
/* @__PURE__ */ jsx("div", { className: "h-14 w-14 rounded-xl bg-destructive/10 flex items-center justify-center mx-auto", children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-7 w-7 text-destructive" }) }),
|
|
27
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-lg", children: "Something went wrong" }),
|
|
28
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground max-w-xs mx-auto", children: error instanceof Error ? error.message : "Failed to load data. Please try again." }),
|
|
29
|
+
onRetry && /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: onRetry, children: [
|
|
30
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
31
|
+
"Try again"
|
|
32
|
+
] })
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
if (isEmpty) {
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", { className: "py-16 text-center space-y-4", children: [
|
|
37
|
+
emptyIcon && /* @__PURE__ */ jsx("div", { className: "h-14 w-14 rounded-xl bg-muted flex items-center justify-center mx-auto", children: emptyIcon }),
|
|
38
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-lg", children: emptyTitle }),
|
|
39
|
+
emptyDescription && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground max-w-xs mx-auto", children: emptyDescription }),
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-3", children: [
|
|
41
|
+
onRetry && /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: onRetry, children: [
|
|
42
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
43
|
+
"Refresh"
|
|
44
|
+
] }),
|
|
45
|
+
emptyCta && /* @__PURE__ */ jsx(Button, { size: "sm", asChild: true, children: /* @__PURE__ */ jsx(Link, { href: emptyCta.href, children: emptyCta.label }) })
|
|
46
|
+
] })
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
EmptyOrError
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=empty-or-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/empty-or-error.tsx"],"sourcesContent":["\"use client\";\n\nimport { Skeleton } from \"./skeleton.js\";\nimport { Button } from \"./button.js\";\nimport Link from \"next/link\";\nimport { RefreshCw, AlertCircle } from \"lucide-react\";\nimport { ReactNode } from \"react\";\n\ninterface EmptyOrErrorProps {\n isLoading: boolean;\n error?: unknown;\n isEmpty: boolean;\n onRetry?: () => void;\n emptyTitle: string;\n emptyDescription?: string;\n emptyCta?: { label: string; href: string };\n emptyIcon?: ReactNode;\n skeletonCount?: number;\n /** Optional custom skeleton renderer — replaces the default row skeletons */\n skeletonNode?: ReactNode;\n children?: ReactNode;\n}\n\nexport function EmptyOrError({\n isLoading,\n error,\n isEmpty,\n onRetry,\n emptyTitle,\n emptyDescription,\n emptyCta,\n emptyIcon,\n skeletonCount = 4,\n skeletonNode,\n children,\n}: EmptyOrErrorProps) {\n if (isLoading) {\n if (skeletonNode) return <>{skeletonNode}</>;\n return (\n <div className=\"space-y-3\">\n {Array.from({ length: skeletonCount }).map((_, i) => (\n <Skeleton key={i} className=\"h-20 w-full rounded-xl\" />\n ))}\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n <div className=\"h-14 w-14 rounded-xl bg-destructive/10 flex items-center justify-center mx-auto\">\n <AlertCircle className=\"h-7 w-7 text-destructive\" />\n </div>\n <p className=\"font-semibold text-lg\">Something went wrong</p>\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">\n {error instanceof Error ? error.message : \"Failed to load data. Please try again.\"}\n </p>\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Try again\n </Button>\n )}\n </div>\n );\n }\n\n if (isEmpty) {\n return (\n <div className=\"py-16 text-center space-y-4\">\n {emptyIcon && (\n <div className=\"h-14 w-14 rounded-xl bg-muted flex items-center justify-center mx-auto\">\n {emptyIcon}\n </div>\n )}\n <p className=\"font-semibold text-lg\">{emptyTitle}</p>\n {emptyDescription && (\n <p className=\"text-sm text-muted-foreground max-w-xs mx-auto\">{emptyDescription}</p>\n )}\n <div className=\"flex items-center justify-center gap-3\">\n {onRetry && (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n <RefreshCw className=\"h-3.5 w-3.5 mr-1.5\" />\n Refresh\n </Button>\n )}\n {emptyCta && (\n <Button size=\"sm\" asChild>\n <Link href={emptyCta.href}>{emptyCta.label}</Link>\n </Button>\n )}\n </div>\n </div>\n );\n }\n\n return <>{children}</>;\n}\n"],"mappings":";AAqC6B,wBAqBnB,YArBmB;AAnC7B,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,WAAW,mBAAmB;AAkBhC,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA;AACF,GAAsB;AACpB,MAAI,WAAW;AACb,QAAI,aAAc,QAAO,gCAAG,wBAAa;AACzC,WACE,oBAAC,SAAI,WAAU,aACZ,gBAAM,KAAK,EAAE,QAAQ,cAAc,CAAC,EAAE,IAAI,CAAC,GAAG,MAC7C,oBAAC,YAAiB,WAAU,4BAAb,CAAsC,CACtD,GACH;AAAA,EAEJ;AAEA,MAAI,OAAO;AACT,WACE,qBAAC,SAAI,WAAU,+BACb;AAAA,0BAAC,SAAI,WAAU,mFACb,8BAAC,eAAY,WAAU,4BAA2B,GACpD;AAAA,MACA,oBAAC,OAAE,WAAU,yBAAwB,kCAAoB;AAAA,MACzD,oBAAC,OAAE,WAAU,kDACV,2BAAiB,QAAQ,MAAM,UAAU,0CAC5C;AAAA,MACC,WACC,qBAAC,UAAO,SAAQ,WAAU,MAAK,MAAK,SAAS,SAC3C;AAAA,4BAAC,aAAU,WAAU,sBAAqB;AAAA,QAAE;AAAA,SAE9C;AAAA,OAEJ;AAAA,EAEJ;AAEA,MAAI,SAAS;AACX,WACE,qBAAC,SAAI,WAAU,+BACZ;AAAA,mBACC,oBAAC,SAAI,WAAU,0EACZ,qBACH;AAAA,MAEF,oBAAC,OAAE,WAAU,yBAAyB,sBAAW;AAAA,MAChD,oBACC,oBAAC,OAAE,WAAU,kDAAkD,4BAAiB;AAAA,MAElF,qBAAC,SAAI,WAAU,0CACZ;AAAA,mBACC,qBAAC,UAAO,SAAQ,WAAU,MAAK,MAAK,SAAS,SAC3C;AAAA,8BAAC,aAAU,WAAU,sBAAqB;AAAA,UAAE;AAAA,WAE9C;AAAA,QAED,YACC,oBAAC,UAAO,MAAK,MAAK,SAAO,MACvB,8BAAC,QAAK,MAAM,SAAS,MAAO,mBAAS,OAAM,GAC7C;AAAA,SAEJ;AAAA,OACF;AAAA,EAEJ;AAEA,SAAO,gCAAG,UAAS;AACrB;","names":[]}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var form_exports = {};
|
|
31
|
+
__export(form_exports, {
|
|
32
|
+
Form: () => Form,
|
|
33
|
+
FormControl: () => FormControl,
|
|
34
|
+
FormDescription: () => FormDescription,
|
|
35
|
+
FormField: () => FormField,
|
|
36
|
+
FormItem: () => FormItem,
|
|
37
|
+
FormLabel: () => FormLabel,
|
|
38
|
+
FormMessage: () => FormMessage,
|
|
39
|
+
useFormField: () => useFormField
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(form_exports);
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
+
var React = __toESM(require("react"), 1);
|
|
44
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
45
|
+
var import_react_hook_form = require("react-hook-form");
|
|
46
|
+
var import_cn = require("../utils/cn.js");
|
|
47
|
+
var import_label = require("./label.js");
|
|
48
|
+
const Form = import_react_hook_form.FormProvider;
|
|
49
|
+
const FormFieldContext = React.createContext({});
|
|
50
|
+
const FormField = ({
|
|
51
|
+
...props
|
|
52
|
+
}) => {
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_hook_form.Controller, { ...props }) });
|
|
54
|
+
};
|
|
55
|
+
const useFormField = () => {
|
|
56
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
57
|
+
const itemContext = React.useContext(FormItemContext);
|
|
58
|
+
const { getFieldState, formState } = (0, import_react_hook_form.useFormContext)();
|
|
59
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
60
|
+
if (!fieldContext) {
|
|
61
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
62
|
+
}
|
|
63
|
+
const { id } = itemContext;
|
|
64
|
+
return {
|
|
65
|
+
id,
|
|
66
|
+
name: fieldContext.name,
|
|
67
|
+
formItemId: `${id}-form-item`,
|
|
68
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
69
|
+
formMessageId: `${id}-form-item-message`,
|
|
70
|
+
...fieldState
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
const FormItemContext = React.createContext({});
|
|
74
|
+
const FormItem = React.forwardRef(
|
|
75
|
+
({ className, ...props }, ref) => {
|
|
76
|
+
const id = React.useId();
|
|
77
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, className: (0, import_cn.cn)("space-y-2", className), ...props }) });
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
FormItem.displayName = "FormItem";
|
|
81
|
+
const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
|
|
82
|
+
const { error, formItemId } = useFormField();
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
+
import_label.Label,
|
|
85
|
+
{
|
|
86
|
+
ref,
|
|
87
|
+
className: (0, import_cn.cn)(error && "text-destructive", className),
|
|
88
|
+
htmlFor: formItemId,
|
|
89
|
+
...props
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
});
|
|
93
|
+
FormLabel.displayName = "FormLabel";
|
|
94
|
+
const FormControl = React.forwardRef(({ ...props }, ref) => {
|
|
95
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
96
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
97
|
+
import_react_slot.Slot,
|
|
98
|
+
{
|
|
99
|
+
ref,
|
|
100
|
+
id: formItemId,
|
|
101
|
+
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
102
|
+
"aria-invalid": !!error,
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
FormControl.displayName = "FormControl";
|
|
108
|
+
const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
|
|
109
|
+
const { formDescriptionId } = useFormField();
|
|
110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
111
|
+
"p",
|
|
112
|
+
{
|
|
113
|
+
ref,
|
|
114
|
+
id: formDescriptionId,
|
|
115
|
+
className: (0, import_cn.cn)("text-sm text-muted-foreground", className),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
FormDescription.displayName = "FormDescription";
|
|
121
|
+
const FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
122
|
+
const { error, formMessageId } = useFormField();
|
|
123
|
+
const body = error ? String(error?.message) : children;
|
|
124
|
+
if (!body) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
|
+
"p",
|
|
129
|
+
{
|
|
130
|
+
ref,
|
|
131
|
+
id: formMessageId,
|
|
132
|
+
className: (0, import_cn.cn)("text-sm font-medium text-destructive", className),
|
|
133
|
+
...props,
|
|
134
|
+
children: body
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
});
|
|
138
|
+
FormMessage.displayName = "FormMessage";
|
|
139
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
140
|
+
0 && (module.exports = {
|
|
141
|
+
Form,
|
|
142
|
+
FormControl,
|
|
143
|
+
FormDescription,
|
|
144
|
+
FormField,
|
|
145
|
+
FormItem,
|
|
146
|
+
FormLabel,
|
|
147
|
+
FormMessage,
|
|
148
|
+
useFormField
|
|
149
|
+
});
|
|
150
|
+
//# sourceMappingURL=form.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/form.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\";\nimport { cn } from \"../utils/cn.js\";\nimport { Label } from \"./label.js\";\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n }\n);\nFormItem.displayName = \"FormItem\";\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = \"FormLabel\";\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = \"FormControl\";\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n );\n});\nFormDescription.displayName = \"FormDescription\";\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n );\n});\nFormMessage.displayName = \"FormMessage\";\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCM;AAjCN,YAAuB;AAEvB,wBAAqB;AACrB,6BAOO;AACP,gBAAmB;AACnB,mBAAsB;AAEtB,MAAM,OAAO;AASb,MAAM,mBAAmB,MAAM,cAAqC,CAAC,CAA0B;AAE/F,MAAM,YAAY,CAGhB;AAAA,EACA,GAAG;AACL,MAA4C;AAC1C,SACE,4CAAC,iBAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAM,MAAM,KAAK,GACnD,sDAAC,qCAAY,GAAG,OAAO,GACzB;AAEJ;AAEA,MAAM,eAAe,MAAM;AACzB,QAAM,eAAe,MAAM,WAAW,gBAAgB;AACtD,QAAM,cAAc,MAAM,WAAW,eAAe;AACpD,QAAM,EAAE,eAAe,UAAU,QAAI,uCAAe;AAEpD,QAAM,aAAa,cAAc,aAAa,MAAM,SAAS;AAE7D,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AAEA,QAAM,EAAE,GAAG,IAAI;AAEf,SAAO;AAAA,IACL;AAAA,IACA,MAAM,aAAa;AAAA,IACnB,YAAY,GAAG,EAAE;AAAA,IACjB,mBAAmB,GAAG,EAAE;AAAA,IACxB,eAAe,GAAG,EAAE;AAAA,IACpB,GAAG;AAAA,EACL;AACF;AAMA,MAAM,kBAAkB,MAAM,cAAoC,CAAC,CAAyB;AAE5F,MAAM,WAAW,MAAM;AAAA,EACrB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAChC,UAAM,KAAK,MAAM,MAAM;AAEvB,WACE,4CAAC,gBAAgB,UAAhB,EAAyB,OAAO,EAAE,GAAG,GACpC,sDAAC,SAAI,KAAU,eAAW,cAAG,aAAa,SAAS,GAAI,GAAG,OAAO,GACnE;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;AAEvB,MAAM,YAAY,MAAM,WAGtB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,EAAE,OAAO,WAAW,IAAI,aAAa;AAE3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,cAAG,SAAS,oBAAoB,SAAS;AAAA,MACpD,SAAS;AAAA,MACR,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,UAAU,cAAc;AAExB,MAAM,cAAc,MAAM,WAGxB,CAAC,EAAE,GAAG,MAAM,GAAG,QAAQ;AACvB,QAAM,EAAE,OAAO,YAAY,mBAAmB,cAAc,IAAI,aAAa;AAE7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,oBAAkB,CAAC,QAAQ,GAAG,iBAAiB,KAAK,GAAG,iBAAiB,IAAI,aAAa;AAAA,MACzF,gBAAc,CAAC,CAAC;AAAA,MACf,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,YAAY,cAAc;AAE1B,MAAM,kBAAkB,MAAM,WAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,EAAE,kBAAkB,IAAI,aAAa;AAE3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,eAAW,cAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,gBAAgB,cAAc;AAE9B,MAAM,cAAc,MAAM,WAGxB,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAAQ;AAC5C,QAAM,EAAE,OAAO,cAAc,IAAI,aAAa;AAC9C,QAAM,OAAO,QAAQ,OAAO,OAAO,OAAO,IAAI;AAE9C,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,eAAW,cAAG,wCAAwC,SAAS;AAAA,MAC9D,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ,CAAC;AACD,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react_hook_form from 'react-hook-form';
|
|
3
|
+
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
|
+
|
|
7
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
8
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare const useFormField: () => {
|
|
10
|
+
invalid: boolean;
|
|
11
|
+
isDirty: boolean;
|
|
12
|
+
isTouched: boolean;
|
|
13
|
+
isValidating: boolean;
|
|
14
|
+
error?: react_hook_form.FieldError | undefined;
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
formItemId: string;
|
|
18
|
+
formDescriptionId: string;
|
|
19
|
+
formMessageId: string;
|
|
20
|
+
};
|
|
21
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
23
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement> & {
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
} & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
26
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
27
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
28
|
+
|
|
29
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|