@skybin-tech/nebula-ui 0.0.18 → 0.0.19
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/cjs/hooks/useToast.cjs +97 -0
- package/dist/cjs/hooks/useToast.cjs.map +1 -0
- package/dist/cjs/index.cjs +56 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/primitives/calendar.cjs +48 -0
- package/dist/cjs/primitives/calendar.cjs.map +1 -0
- package/dist/cjs/primitives/command.cjs +91 -0
- package/dist/cjs/primitives/command.cjs.map +1 -0
- package/dist/cjs/primitives/dialog.cjs +96 -0
- package/dist/cjs/primitives/dialog.cjs.map +1 -0
- package/dist/cjs/primitives/popover.cjs +46 -0
- package/dist/cjs/primitives/popover.cjs.map +1 -0
- package/dist/cjs/primitives/scroll-area.cjs +57 -0
- package/dist/cjs/primitives/scroll-area.cjs.map +1 -0
- package/dist/cjs/primitives/sonner.cjs +23 -0
- package/dist/cjs/primitives/sonner.cjs.map +1 -0
- package/dist/cjs/primitives/table.cjs +77 -0
- package/dist/cjs/primitives/table.cjs.map +1 -0
- package/dist/cjs/primitives/toast.cjs +114 -0
- package/dist/cjs/primitives/toast.cjs.map +1 -0
- package/dist/cjs/primitives/toggle.cjs +57 -0
- package/dist/cjs/primitives/toggle.cjs.map +1 -0
- package/dist/components/Calendar/Calendar.d.ts +3 -0
- package/dist/components/Calendar/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar/index.d.ts +3 -0
- package/dist/components/Calendar/index.d.ts.map +1 -0
- package/dist/components/Command/Command.d.ts +2 -0
- package/dist/components/Command/Command.d.ts.map +1 -0
- package/dist/components/Command/index.d.ts +2 -0
- package/dist/components/Command/index.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/Dialog/index.d.ts.map +1 -0
- package/dist/components/Popover/Popover.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Popover/index.d.ts.map +1 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +2 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -0
- package/dist/components/ScrollArea/index.d.ts +2 -0
- package/dist/components/ScrollArea/index.d.ts.map +1 -0
- package/dist/components/Sonner/Sonner.d.ts +2 -0
- package/dist/components/Sonner/Sonner.d.ts.map +1 -0
- package/dist/components/Sonner/index.d.ts +2 -0
- package/dist/components/Sonner/index.d.ts.map +1 -0
- package/dist/components/Table/Table.d.ts +2 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/index.d.ts.map +1 -0
- package/dist/components/Toast/Toast.d.ts +2 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Toggle/Toggle.d.ts +2 -0
- package/dist/components/Toggle/Toggle.d.ts.map +1 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Toggle/index.d.ts.map +1 -0
- package/dist/hooks/useToast.d.ts +45 -0
- package/dist/hooks/useToast.d.ts.map +1 -0
- package/dist/hooks/useToast.js +80 -0
- package/dist/hooks/useToast.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -1
- package/dist/primitives/calendar.d.ts +9 -0
- package/dist/primitives/calendar.d.ts.map +1 -0
- package/dist/primitives/calendar.js +48 -0
- package/dist/primitives/calendar.js.map +1 -0
- package/dist/primitives/command.d.ts +81 -0
- package/dist/primitives/command.d.ts.map +1 -0
- package/dist/primitives/command.js +74 -0
- package/dist/primitives/command.js.map +1 -0
- package/dist/primitives/dialog.d.ts +20 -0
- package/dist/primitives/dialog.d.ts.map +1 -0
- package/dist/primitives/dialog.js +78 -0
- package/dist/primitives/dialog.js.map +1 -0
- package/dist/primitives/index.d.ts +10 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/popover.d.ts +8 -0
- package/dist/primitives/popover.d.ts.map +1 -0
- package/dist/primitives/popover.js +28 -0
- package/dist/primitives/popover.js.map +1 -0
- package/dist/primitives/scroll-area.d.ts +6 -0
- package/dist/primitives/scroll-area.d.ts.map +1 -0
- package/dist/primitives/scroll-area.js +39 -0
- package/dist/primitives/scroll-area.js.map +1 -0
- package/dist/primitives/sonner.d.ts +4 -0
- package/dist/primitives/sonner.d.ts.map +1 -0
- package/dist/primitives/sonner.js +23 -0
- package/dist/primitives/sonner.js.map +1 -0
- package/dist/primitives/table.d.ts +11 -0
- package/dist/primitives/table.d.ts.map +1 -0
- package/dist/primitives/table.js +60 -0
- package/dist/primitives/table.js.map +1 -0
- package/dist/primitives/toast.d.ts +16 -0
- package/dist/primitives/toast.d.ts.map +1 -0
- package/dist/primitives/toast.js +96 -0
- package/dist/primitives/toast.js.map +1 -0
- package/dist/primitives/toggle.d.ts +13 -0
- package/dist/primitives/toggle.d.ts.map +1 -0
- package/dist/primitives/toggle.js +39 -0
- package/dist/primitives/toggle.js.map +1 -0
- package/package.json +151 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
5
|
+
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
6
|
+
ScrollAreaPrimitive.Root,
|
|
7
|
+
{
|
|
8
|
+
ref,
|
|
9
|
+
className: cn("relative overflow-hidden", className),
|
|
10
|
+
...props,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
13
|
+
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
14
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
));
|
|
18
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
19
|
+
const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
20
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
orientation,
|
|
24
|
+
className: cn(
|
|
25
|
+
"flex touch-none select-none transition-colors",
|
|
26
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
27
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...props,
|
|
31
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
32
|
+
}
|
|
33
|
+
));
|
|
34
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
35
|
+
export {
|
|
36
|
+
ScrollArea,
|
|
37
|
+
ScrollBar
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=scroll-area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.js","sources":["../../src/primitives/scroll-area.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\"\nimport { cn } from \"@/utils/cn\"\n\nconst ScrollArea = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"relative overflow-hidden\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n))\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName\n\nconst ScrollBar = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" && \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n))\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName\n\nexport { ScrollArea, ScrollBar }\n"],"names":[],"mappings":";;;;AAIA,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC;AAAA,EAAC,oBAAoB;AAAA,EAApB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,4BAA4B,SAAS;AAAA,IAClD,GAAG;AAAA,IAEJ,UAAA;AAAA,MAAA,oBAAC,oBAAoB,UAApB,EAA6B,WAAU,mCACrC,UACH;AAAA,0BACC,WAAA,EAAU;AAAA,MACX,oBAAC,oBAAoB,QAApB,CAAA,CAA2B;AAAA,IAAA;AAAA,EAAA;AAC9B,CACD;AACD,WAAW,cAAc,oBAAoB,KAAK;AAElD,MAAM,YAAY,MAAM,WAGtB,CAAC,EAAE,WAAW,cAAc,YAAY,GAAG,SAAS,QACpD;AAAA,EAAC,oBAAoB;AAAA,EAApB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,gBAAgB,cAAc;AAAA,MAC9B,gBAAgB,gBAAgB;AAAA,MAChC;AAAA,IAAA;AAAA,IAED,GAAG;AAAA,IAEJ,UAAA,oBAAC,oBAAoB,iBAApB,EAAoC,WAAU,yCAAA,CAAyC;AAAA,EAAA;AAC1F,CACD;AACD,UAAU,cAAc,oBAAoB,oBAAoB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/primitives/sonner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE7D,iBAAS,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,2CAe1C;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Toaster as Toaster$1 } from "sonner";
|
|
3
|
+
function Toaster({ ...props }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
Toaster$1,
|
|
6
|
+
{
|
|
7
|
+
className: "toaster group",
|
|
8
|
+
toastOptions: {
|
|
9
|
+
classNames: {
|
|
10
|
+
toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
11
|
+
description: "group-[.toast]:text-muted-foreground",
|
|
12
|
+
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
13
|
+
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
Toaster
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=sonner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.js","sources":["../../src/primitives/sonner.tsx"],"sourcesContent":["import { Toaster as Sonner, type ToasterProps } from \"sonner\"\n\nfunction Toaster({ ...props }: ToasterProps) {\n return (\n <Sonner\n className=\"toaster group\"\n toastOptions={{\n classNames: {\n toast: \"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg\",\n description: \"group-[.toast]:text-muted-foreground\",\n actionButton: \"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground\",\n cancelButton: \"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground\",\n },\n }}\n {...props}\n />\n )\n}\n\nexport { Toaster }\n"],"names":["Sonner"],"mappings":";;AAEA,SAAS,QAAQ,EAAE,GAAG,SAAuB;AAC3C,SACE;AAAA,IAACA;AAAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,cAAc;AAAA,QACZ,YAAY;AAAA,UACV,OAAO;AAAA,UACP,aAAa;AAAA,UACb,cAAc;AAAA,UACd,cAAc;AAAA,QAAA;AAAA,MAChB;AAAA,MAED,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
3
|
+
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
4
|
+
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
|
+
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
6
|
+
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
|
7
|
+
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
8
|
+
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
|
+
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
11
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/primitives/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,KAAK,iHAMV,CAAA;AAGD,QAAA,MAAM,WAAW,+HAIhB,CAAA;AAGD,QAAA,MAAM,SAAS,+HAId,CAAA;AAGD,QAAA,MAAM,WAAW,+HAIhB,CAAA;AAGD,QAAA,MAAM,QAAQ,uHAQb,CAAA;AAGD,QAAA,MAAM,SAAS,2HAQd,CAAA;AAGD,QAAA,MAAM,SAAS,2HAId,CAAA;AAGD,QAAA,MAAM,YAAY,+HAIjB,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../utils/cn.js";
|
|
4
|
+
const Table = React.forwardRef(
|
|
5
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props }) })
|
|
6
|
+
);
|
|
7
|
+
Table.displayName = "Table";
|
|
8
|
+
const TableHeader = React.forwardRef(
|
|
9
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props })
|
|
10
|
+
);
|
|
11
|
+
TableHeader.displayName = "TableHeader";
|
|
12
|
+
const TableBody = React.forwardRef(
|
|
13
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props })
|
|
14
|
+
);
|
|
15
|
+
TableBody.displayName = "TableBody";
|
|
16
|
+
const TableFooter = React.forwardRef(
|
|
17
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("tfoot", { ref, className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props })
|
|
18
|
+
);
|
|
19
|
+
TableFooter.displayName = "TableFooter";
|
|
20
|
+
const TableRow = React.forwardRef(
|
|
21
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
22
|
+
"tr",
|
|
23
|
+
{
|
|
24
|
+
ref,
|
|
25
|
+
className: cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
);
|
|
30
|
+
TableRow.displayName = "TableRow";
|
|
31
|
+
const TableHead = React.forwardRef(
|
|
32
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
33
|
+
"th",
|
|
34
|
+
{
|
|
35
|
+
ref,
|
|
36
|
+
className: cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
TableHead.displayName = "TableHead";
|
|
42
|
+
const TableCell = React.forwardRef(
|
|
43
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("td", { ref, className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className), ...props })
|
|
44
|
+
);
|
|
45
|
+
TableCell.displayName = "TableCell";
|
|
46
|
+
const TableCaption = React.forwardRef(
|
|
47
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props })
|
|
48
|
+
);
|
|
49
|
+
TableCaption.displayName = "TableCaption";
|
|
50
|
+
export {
|
|
51
|
+
Table,
|
|
52
|
+
TableBody,
|
|
53
|
+
TableCaption,
|
|
54
|
+
TableCell,
|
|
55
|
+
TableFooter,
|
|
56
|
+
TableHead,
|
|
57
|
+
TableHeader,
|
|
58
|
+
TableRow
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sources":["../../src/primitives/table.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { cn } from \"@/utils/cn\"\n\nconst Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(\n ({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table ref={ref} className={cn(\"w-full caption-bottom text-sm\", className)} {...props} />\n </div>\n )\n)\nTable.displayName = \"Table\"\n\nconst TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <thead ref={ref} className={cn(\"[&_tr]:border-b\", className)} {...props} />\n )\n)\nTableHeader.displayName = \"TableHeader\"\n\nconst TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <tbody ref={ref} className={cn(\"[&_tr:last-child]:border-0\", className)} {...props} />\n )\n)\nTableBody.displayName = \"TableBody\"\n\nconst TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <tfoot ref={ref} className={cn(\"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0\", className)} {...props} />\n )\n)\nTableFooter.displayName = \"TableFooter\"\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(\n ({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\", className)}\n {...props}\n />\n )\n)\nTableRow.displayName = \"TableRow\"\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0\", className)}\n {...props}\n />\n )\n)\nTableHead.displayName = \"TableHead\"\n\nconst TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <td ref={ref} className={cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className)} {...props} />\n )\n)\nTableCell.displayName = \"TableCell\"\n\nconst TableCaption = React.forwardRef<HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement>>(\n ({ className, ...props }, ref) => (\n <caption ref={ref} className={cn(\"mt-4 text-sm text-muted-foreground\", className)} {...props} />\n )\n)\nTableCaption.displayName = \"TableCaption\"\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption }\n"],"names":[],"mappings":";;;AAGA,MAAM,QAAQ,MAAM;AAAA,EAClB,CAAC,EAAE,WAAW,GAAG,SAAS,4BACvB,OAAA,EAAI,WAAU,iCACb,UAAA,oBAAC,SAAA,EAAM,KAAU,WAAW,GAAG,iCAAiC,SAAS,GAAI,GAAG,MAAA,CAAO,EAAA,CACzF;AAEJ;AACA,MAAM,cAAc;AAEpB,MAAM,cAAc,MAAM;AAAA,EACxB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QACxB,oBAAC,SAAA,EAAM,KAAU,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,MAAA,CAAO;AAE7E;AACA,YAAY,cAAc;AAE1B,MAAM,YAAY,MAAM;AAAA,EACtB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QACxB,oBAAC,SAAA,EAAM,KAAU,WAAW,GAAG,8BAA8B,SAAS,GAAI,GAAG,MAAA,CAAO;AAExF;AACA,UAAU,cAAc;AAExB,MAAM,cAAc,MAAM;AAAA,EACxB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QACxB,oBAAC,SAAA,EAAM,KAAU,WAAW,GAAG,2DAA2D,SAAS,GAAI,GAAG,MAAA,CAAO;AAErH;AACA,YAAY,cAAc;AAE1B,MAAM,WAAW,MAAM;AAAA,EACrB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QACxB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,+EAA+E,SAAS;AAAA,MACrG,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AACA,SAAS,cAAc;AAEvB,MAAM,YAAY,MAAM;AAAA,EACtB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QACxB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,oGAAoG,SAAS;AAAA,MAC1H,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AACA,UAAU,cAAc;AAExB,MAAM,YAAY,MAAM;AAAA,EACtB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QACxB,oBAAC,MAAA,EAAG,KAAU,WAAW,GAAG,kDAAkD,SAAS,GAAI,GAAG,MAAA,CAAO;AAEzG;AACA,UAAU,cAAc;AAExB,MAAM,eAAe,MAAM;AAAA,EACzB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QACxB,oBAAC,WAAA,EAAQ,KAAU,WAAW,GAAG,sCAAsC,SAAS,GAAI,GAAG,MAAA,CAAO;AAElG;AACA,aAAa,cAAc;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
4
|
+
declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
|
|
5
|
+
declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
6
|
+
declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
7
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
|
|
9
|
+
declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
|
|
14
|
+
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
15
|
+
export { type ToastProps, type ToastActionElement, ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, };
|
|
16
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/primitives/toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,aAAa,8CAA2B,CAAA;AAE9C,QAAA,MAAM,aAAa,kKAYjB,CAAA;AAkBF,QAAA,MAAM,KAAK;;qHAUT,CAAA;AAGF,QAAA,MAAM,WAAW,kKAYf,CAAA;AAGF,QAAA,MAAM,UAAU,iKAed,CAAA;AAGF,QAAA,MAAM,UAAU,2JASd,CAAA;AAGF,QAAA,MAAM,gBAAgB,iKASpB,CAAA;AAGF,KAAK,UAAU,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,KAAK,CAAC,CAAA;AAC9D,KAAK,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAA;AAEhE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,aAAa,EACb,aAAa,EACb,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,GACZ,CAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { X } from "lucide-react";
|
|
6
|
+
import { cn } from "../utils/cn.js";
|
|
7
|
+
const ToastProvider = ToastPrimitives.Provider;
|
|
8
|
+
const ToastViewport = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9
|
+
ToastPrimitives.Viewport,
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
className: cn(
|
|
13
|
+
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
|
14
|
+
className
|
|
15
|
+
),
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
20
|
+
const toastVariants = cva(
|
|
21
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
22
|
+
{
|
|
23
|
+
variants: {
|
|
24
|
+
variant: {
|
|
25
|
+
default: "border bg-background text-foreground",
|
|
26
|
+
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "default"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
const Toast = React.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
35
|
+
ToastPrimitives.Root,
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
className: cn(toastVariants({ variant }), className),
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
));
|
|
42
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
43
|
+
const ToastAction = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
44
|
+
ToastPrimitives.Action,
|
|
45
|
+
{
|
|
46
|
+
ref,
|
|
47
|
+
className: cn(
|
|
48
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
|
49
|
+
className
|
|
50
|
+
),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
));
|
|
54
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
55
|
+
const ToastClose = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
56
|
+
ToastPrimitives.Close,
|
|
57
|
+
{
|
|
58
|
+
ref,
|
|
59
|
+
className: cn(
|
|
60
|
+
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
"toast-close": "",
|
|
64
|
+
...props,
|
|
65
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
66
|
+
}
|
|
67
|
+
));
|
|
68
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
69
|
+
const ToastTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
70
|
+
ToastPrimitives.Title,
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
className: cn("text-sm font-semibold", className),
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
));
|
|
77
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
78
|
+
const ToastDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
79
|
+
ToastPrimitives.Description,
|
|
80
|
+
{
|
|
81
|
+
ref,
|
|
82
|
+
className: cn("text-sm opacity-90", className),
|
|
83
|
+
...props
|
|
84
|
+
}
|
|
85
|
+
));
|
|
86
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
87
|
+
export {
|
|
88
|
+
Toast,
|
|
89
|
+
ToastAction,
|
|
90
|
+
ToastClose,
|
|
91
|
+
ToastDescription,
|
|
92
|
+
ToastProvider,
|
|
93
|
+
ToastTitle,
|
|
94
|
+
ToastViewport
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.js","sources":["../../src/primitives/toast.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as ToastPrimitives from \"@radix-ui/react-toast\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { X } from \"lucide-react\"\nimport { cn } from \"@/utils/cn\"\n\nconst ToastProvider = ToastPrimitives.Provider\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n \"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]\",\n className\n )}\n {...props}\n />\n))\nToastViewport.displayName = ToastPrimitives.Viewport.displayName\n\nconst toastVariants = cva(\n \"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n {\n variants: {\n variant: {\n default: \"border bg-background text-foreground\",\n destructive: \"destructive group border-destructive bg-destructive text-destructive-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n>(({ className, variant, ...props }, ref) => (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n))\nToast.displayName = ToastPrimitives.Root.displayName\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n \"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive\",\n className\n )}\n {...props}\n />\n))\nToastAction.displayName = ToastPrimitives.Action.displayName\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n \"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"h-4 w-4\" />\n </ToastPrimitives.Close>\n))\nToastClose.displayName = ToastPrimitives.Close.displayName\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn(\"text-sm font-semibold\", className)}\n {...props}\n />\n))\nToastTitle.displayName = ToastPrimitives.Title.displayName\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn(\"text-sm opacity-90\", className)}\n {...props}\n />\n))\nToastDescription.displayName = ToastPrimitives.Description.displayName\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>\ntype ToastActionElement = React.ReactElement<typeof ToastAction>\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n}\n"],"names":[],"mappings":";;;;;;AAMA,MAAM,gBAAgB,gBAAgB;AAEtC,MAAM,gBAAgB,MAAM,WAG1B,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IAAA;AAAA,IAED,GAAG;AAAA,EAAA;AACN,CACD;AACD,cAAc,cAAc,gBAAgB,SAAS;AAErD,MAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aAAa;AAAA,MAAA;AAAA,IACf;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAEA,MAAM,QAAQ,MAAM,WAIlB,CAAC,EAAE,WAAW,SAAS,GAAG,SAAS,QACnC;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,cAAc,EAAE,QAAA,CAAS,GAAG,SAAS;AAAA,IAClD,GAAG;AAAA,EAAA;AACN,CACD;AACD,MAAM,cAAc,gBAAgB,KAAK;AAEzC,MAAM,cAAc,MAAM,WAGxB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IAAA;AAAA,IAED,GAAG;AAAA,EAAA;AACN,CACD;AACD,YAAY,cAAc,gBAAgB,OAAO;AAEjD,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IAAA;AAAA,IAEF,eAAY;AAAA,IACX,GAAG;AAAA,IAEJ,UAAA,oBAAC,GAAA,EAAE,WAAU,UAAA,CAAU;AAAA,EAAA;AACzB,CACD;AACD,WAAW,cAAc,gBAAgB,MAAM;AAE/C,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,yBAAyB,SAAS;AAAA,IAC/C,GAAG;AAAA,EAAA;AACN,CACD;AACD,WAAW,cAAc,gBAAgB,MAAM;AAE/C,MAAM,mBAAmB,MAAM,WAG7B,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,sBAAsB,SAAS;AAAA,IAC5C,GAAG;AAAA,EAAA;AACN,CACD;AACD,iBAAiB,cAAc,gBAAgB,YAAY;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
4
|
+
declare const toggleVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
9
|
+
variant?: "default" | "outline" | null | undefined;
|
|
10
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { Toggle, toggleVariants };
|
|
13
|
+
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../src/primitives/toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,cAAc;;;8EAmBnB,CAAA;AAED,QAAA,MAAM,MAAM;;;yHAUV,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../utils/cn.js";
|
|
6
|
+
const toggleVariants = cva(
|
|
7
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-transparent",
|
|
12
|
+
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
default: "h-10 px-3 min-w-10",
|
|
16
|
+
sm: "h-9 px-2.5 min-w-9",
|
|
17
|
+
lg: "h-11 px-5 min-w-11"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
size: "default"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
27
|
+
TogglePrimitive.Root,
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
className: cn(toggleVariants({ variant, size, className })),
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
));
|
|
34
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
35
|
+
export {
|
|
36
|
+
Toggle,
|
|
37
|
+
toggleVariants
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.js","sources":["../../src/primitives/toggle.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"@/utils/cn\"\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n outline: \"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground\",\n },\n size: {\n default: \"h-10 px-3 min-w-10\",\n sm: \"h-9 px-2.5 min-w-9\",\n lg: \"h-11 px-5 min-w-11\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n))\nToggle.displayName = TogglePrimitive.Root.displayName\n\nexport { Toggle, toggleVariants }\n"],"names":[],"mappings":";;;;;AAKA,MAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,SAAS;AAAA,MAAA;AAAA,MAEX,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ;AAEA,MAAM,SAAS,MAAM,WAInB,CAAC,EAAE,WAAW,SAAS,MAAM,GAAG,SAAS,QACzC;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAA,CAAW,CAAC;AAAA,IACzD,GAAG;AAAA,EAAA;AACN,CACD;AACD,OAAO,cAAc,gBAAgB,KAAK;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skybin-tech/nebula-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Anwar <anwar@skybin.io>",
|
|
6
6
|
"description": "Reusable React component library with form validation using shadcn/ui patterns, react-hook-form, and Zod",
|
|
@@ -121,6 +121,106 @@
|
|
|
121
121
|
"types": "./dist/components/Separator/index.d.ts",
|
|
122
122
|
"default": "./dist/cjs/components/Separator/index.cjs"
|
|
123
123
|
}
|
|
124
|
+
},
|
|
125
|
+
"./components/Dialog": {
|
|
126
|
+
"import": {
|
|
127
|
+
"types": "./dist/components/Dialog/index.d.ts",
|
|
128
|
+
"default": "./dist/components/Dialog/index.js"
|
|
129
|
+
},
|
|
130
|
+
"require": {
|
|
131
|
+
"types": "./dist/components/Dialog/index.d.ts",
|
|
132
|
+
"default": "./dist/cjs/components/Dialog/index.cjs"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"./components/Popover": {
|
|
136
|
+
"import": {
|
|
137
|
+
"types": "./dist/components/Popover/index.d.ts",
|
|
138
|
+
"default": "./dist/components/Popover/index.js"
|
|
139
|
+
},
|
|
140
|
+
"require": {
|
|
141
|
+
"types": "./dist/components/Popover/index.d.ts",
|
|
142
|
+
"default": "./dist/cjs/components/Popover/index.cjs"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"./components/ScrollArea": {
|
|
146
|
+
"import": {
|
|
147
|
+
"types": "./dist/components/ScrollArea/index.d.ts",
|
|
148
|
+
"default": "./dist/components/ScrollArea/index.js"
|
|
149
|
+
},
|
|
150
|
+
"require": {
|
|
151
|
+
"types": "./dist/components/ScrollArea/index.d.ts",
|
|
152
|
+
"default": "./dist/cjs/components/ScrollArea/index.cjs"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"./components/Toggle": {
|
|
156
|
+
"import": {
|
|
157
|
+
"types": "./dist/components/Toggle/index.d.ts",
|
|
158
|
+
"default": "./dist/components/Toggle/index.js"
|
|
159
|
+
},
|
|
160
|
+
"require": {
|
|
161
|
+
"types": "./dist/components/Toggle/index.d.ts",
|
|
162
|
+
"default": "./dist/cjs/components/Toggle/index.cjs"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"./components/Table": {
|
|
166
|
+
"import": {
|
|
167
|
+
"types": "./dist/components/Table/index.d.ts",
|
|
168
|
+
"default": "./dist/components/Table/index.js"
|
|
169
|
+
},
|
|
170
|
+
"require": {
|
|
171
|
+
"types": "./dist/components/Table/index.d.ts",
|
|
172
|
+
"default": "./dist/cjs/components/Table/index.cjs"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"./components/Command": {
|
|
176
|
+
"import": {
|
|
177
|
+
"types": "./dist/components/Command/index.d.ts",
|
|
178
|
+
"default": "./dist/components/Command/index.js"
|
|
179
|
+
},
|
|
180
|
+
"require": {
|
|
181
|
+
"types": "./dist/components/Command/index.d.ts",
|
|
182
|
+
"default": "./dist/cjs/components/Command/index.cjs"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"./components/Calendar": {
|
|
186
|
+
"import": {
|
|
187
|
+
"types": "./dist/components/Calendar/index.d.ts",
|
|
188
|
+
"default": "./dist/components/Calendar/index.js"
|
|
189
|
+
},
|
|
190
|
+
"require": {
|
|
191
|
+
"types": "./dist/components/Calendar/index.d.ts",
|
|
192
|
+
"default": "./dist/cjs/components/Calendar/index.cjs"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"./components/Sonner": {
|
|
196
|
+
"import": {
|
|
197
|
+
"types": "./dist/components/Sonner/index.d.ts",
|
|
198
|
+
"default": "./dist/components/Sonner/index.js"
|
|
199
|
+
},
|
|
200
|
+
"require": {
|
|
201
|
+
"types": "./dist/components/Sonner/index.d.ts",
|
|
202
|
+
"default": "./dist/cjs/components/Sonner/index.cjs"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"./components/Toast": {
|
|
206
|
+
"import": {
|
|
207
|
+
"types": "./dist/components/Toast/index.d.ts",
|
|
208
|
+
"default": "./dist/components/Toast/index.js"
|
|
209
|
+
},
|
|
210
|
+
"require": {
|
|
211
|
+
"types": "./dist/components/Toast/index.d.ts",
|
|
212
|
+
"default": "./dist/cjs/components/Toast/index.cjs"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"./hooks/useToast": {
|
|
216
|
+
"import": {
|
|
217
|
+
"types": "./dist/hooks/useToast.d.ts",
|
|
218
|
+
"default": "./dist/hooks/useToast.js"
|
|
219
|
+
},
|
|
220
|
+
"require": {
|
|
221
|
+
"types": "./dist/hooks/useToast.d.ts",
|
|
222
|
+
"default": "./dist/cjs/hooks/useToast.cjs"
|
|
223
|
+
}
|
|
124
224
|
}
|
|
125
225
|
},
|
|
126
226
|
"typesVersions": {
|
|
@@ -154,6 +254,36 @@
|
|
|
154
254
|
],
|
|
155
255
|
"components/Separator": [
|
|
156
256
|
"./dist/components/Separator/index.d.ts"
|
|
257
|
+
],
|
|
258
|
+
"components/Dialog": [
|
|
259
|
+
"./dist/components/Dialog/index.d.ts"
|
|
260
|
+
],
|
|
261
|
+
"components/Popover": [
|
|
262
|
+
"./dist/components/Popover/index.d.ts"
|
|
263
|
+
],
|
|
264
|
+
"components/ScrollArea": [
|
|
265
|
+
"./dist/components/ScrollArea/index.d.ts"
|
|
266
|
+
],
|
|
267
|
+
"components/Toggle": [
|
|
268
|
+
"./dist/components/Toggle/index.d.ts"
|
|
269
|
+
],
|
|
270
|
+
"components/Table": [
|
|
271
|
+
"./dist/components/Table/index.d.ts"
|
|
272
|
+
],
|
|
273
|
+
"components/Command": [
|
|
274
|
+
"./dist/components/Command/index.d.ts"
|
|
275
|
+
],
|
|
276
|
+
"components/Calendar": [
|
|
277
|
+
"./dist/components/Calendar/index.d.ts"
|
|
278
|
+
],
|
|
279
|
+
"components/Sonner": [
|
|
280
|
+
"./dist/components/Sonner/index.d.ts"
|
|
281
|
+
],
|
|
282
|
+
"components/Toast": [
|
|
283
|
+
"./dist/components/Toast/index.d.ts"
|
|
284
|
+
],
|
|
285
|
+
"hooks/useToast": [
|
|
286
|
+
"./dist/hooks/useToast.d.ts"
|
|
157
287
|
]
|
|
158
288
|
}
|
|
159
289
|
},
|
|
@@ -175,19 +305,28 @@
|
|
|
175
305
|
"@hookform/resolvers": "^5.0.0",
|
|
176
306
|
"@radix-ui/react-avatar": ">=1.0.0",
|
|
177
307
|
"@radix-ui/react-checkbox": ">=1.0.0",
|
|
178
|
-
"@radix-ui/react-
|
|
308
|
+
"@radix-ui/react-dialog": ">=1.0.0",
|
|
309
|
+
"@radix-ui/react-dropdown-menu": ">=2.1.16",
|
|
179
310
|
"@radix-ui/react-label": ">=2.0.0",
|
|
311
|
+
"@radix-ui/react-popover": ">=1.0.0",
|
|
180
312
|
"@radix-ui/react-radio-group": ">=1.0.0",
|
|
313
|
+
"@radix-ui/react-scroll-area": ">=1.0.0",
|
|
181
314
|
"@radix-ui/react-select": ">=2.0.0",
|
|
182
315
|
"@radix-ui/react-separator": ">=1.0.0",
|
|
183
316
|
"@radix-ui/react-slot": ">=1.0.0",
|
|
184
317
|
"@radix-ui/react-switch": ">=1.0.0",
|
|
318
|
+
"@radix-ui/react-toast": ">=1.0.0",
|
|
319
|
+
"@radix-ui/react-toggle": ">=1.0.0",
|
|
185
320
|
"class-variance-authority": ">=0.7.0",
|
|
186
321
|
"clsx": ">=2.0.0",
|
|
322
|
+
"cmdk": ">=1.0.0",
|
|
323
|
+
"date-fns": ">=3.0.0",
|
|
187
324
|
"lucide-react": ">=0.400.0",
|
|
188
325
|
"react": "^18.0.0 || ^19.0.0",
|
|
326
|
+
"react-day-picker": ">=8.0.0",
|
|
189
327
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
190
328
|
"react-hook-form": "^7.0.0",
|
|
329
|
+
"sonner": ">=1.0.0",
|
|
191
330
|
"tailwind-merge": ">=2.0.0",
|
|
192
331
|
"tailwindcss": "^3.0.0 || ^4.0.0",
|
|
193
332
|
"zod": "^3.0.0 || ^4.0.0"
|
|
@@ -209,13 +348,18 @@
|
|
|
209
348
|
"@hookform/resolvers": "^5.2.2",
|
|
210
349
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
211
350
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
212
|
-
"@radix-ui/react-
|
|
351
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
352
|
+
"@radix-ui/react-dropdown-menu": "2.1.16",
|
|
213
353
|
"@radix-ui/react-label": "^2.1.8",
|
|
354
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
214
355
|
"@radix-ui/react-radio-group": "^1.3.8",
|
|
356
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
215
357
|
"@radix-ui/react-select": "^2.2.6",
|
|
216
358
|
"@radix-ui/react-separator": "^1.1.8",
|
|
217
359
|
"@radix-ui/react-slot": "^1.2.4",
|
|
218
360
|
"@radix-ui/react-switch": "^1.2.6",
|
|
361
|
+
"@radix-ui/react-toast": "^1.2.15",
|
|
362
|
+
"@radix-ui/react-toggle": "^1.1.10",
|
|
219
363
|
"@storybook/addon-a11y": "^10.2.17",
|
|
220
364
|
"@storybook/addon-docs": "^10.2.17",
|
|
221
365
|
"@storybook/addon-onboarding": "^10.2.17",
|
|
@@ -231,6 +375,8 @@
|
|
|
231
375
|
"@vitest/coverage-v8": "^4.1.0",
|
|
232
376
|
"class-variance-authority": "^0.7.1",
|
|
233
377
|
"clsx": "^2.1.1",
|
|
378
|
+
"cmdk": "^1.1.1",
|
|
379
|
+
"date-fns": "^4.1.0",
|
|
234
380
|
"esbuild": "^0.27.4",
|
|
235
381
|
"eslint": "^9.39.4",
|
|
236
382
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
@@ -241,8 +387,10 @@
|
|
|
241
387
|
"lucide-react": "^0.577.0",
|
|
242
388
|
"playwright": "^1.58.2",
|
|
243
389
|
"react": "^19.2.4",
|
|
390
|
+
"react-day-picker": "^9.14.0",
|
|
244
391
|
"react-dom": "^19.2.4",
|
|
245
392
|
"react-hook-form": "^7.71.2",
|
|
393
|
+
"sonner": "^2.0.7",
|
|
246
394
|
"storybook": "^10.2.17",
|
|
247
395
|
"tailwind-merge": "^3.5.0",
|
|
248
396
|
"tailwindcss": "^4.2.1",
|