@momo-webplatform/mobase 0.0.3
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/README.md +23 -0
- package/package.json +154 -0
- package/publish/cjs/components/ui/button.js +60 -0
- package/publish/cjs/components/utils/SpinerIcon.js +7 -0
- package/publish/cjs/lib/utils.js +9 -0
- package/publish/cjs/src/components/Accordion/Accordion.js +44 -0
- package/publish/cjs/src/components/Accordion/index.js +8 -0
- package/publish/cjs/src/components/Alert/Alert.js +50 -0
- package/publish/cjs/src/components/AlertDialog/AlertDialog.js +62 -0
- package/publish/cjs/src/components/AlertDialog/index.js +14 -0
- package/publish/cjs/src/components/Avatar/Avatar.js +74 -0
- package/publish/cjs/src/components/Avatar/index.js +7 -0
- package/publish/cjs/src/components/Badge/Badge.js +24 -0
- package/publish/cjs/src/components/Button/Button.js +74 -0
- package/publish/cjs/src/components/Button/index.js +5 -0
- package/publish/cjs/src/components/Calendar/calendar.js +39 -0
- package/publish/cjs/src/components/Card/Card.js +47 -0
- package/publish/cjs/src/components/Checkbox/Checkbox.js +67 -0
- package/publish/cjs/src/components/Checkbox/index.js +9 -0
- package/publish/cjs/src/components/Collapsible/collapsible.js +33 -0
- package/publish/cjs/src/components/Command/command.js +62 -0
- package/publish/cjs/src/components/Dialog/dialog.js +57 -0
- package/publish/cjs/src/components/Drawer/drawer.js +57 -0
- package/publish/cjs/src/components/DropdownMenu/dropdownmenu.js +75 -0
- package/publish/cjs/src/components/HoverCard/hover-card.js +38 -0
- package/publish/cjs/src/components/IconButton/IconButton.js +67 -0
- package/publish/cjs/src/components/IconButton/index.js +5 -0
- package/publish/cjs/src/components/Input/input.js +34 -0
- package/publish/cjs/src/components/Label/Label.js +35 -0
- package/publish/cjs/src/components/Menubar/menubar.js +77 -0
- package/publish/cjs/src/components/NavigationMenu/navigation-menu.js +102 -0
- package/publish/cjs/src/components/Pagination/Pagination.js +52 -0
- package/publish/cjs/src/components/Popover/popover.js +37 -0
- package/publish/cjs/src/components/Progress/Progress.js +33 -0
- package/publish/cjs/src/components/RadioGroup/Radio.js +110 -0
- package/publish/cjs/src/components/RadioGroup/RadioGroup.js +53 -0
- package/publish/cjs/src/components/RadioGroup/index.js +6 -0
- package/publish/cjs/src/components/Select/Select.js +61 -0
- package/publish/cjs/src/components/Sheet/sheet.js +71 -0
- package/publish/cjs/src/components/Skeleton/skeleton.js +9 -0
- package/publish/cjs/src/components/Slider/slider.js +33 -0
- package/publish/cjs/src/components/Switch/Switch.js +54 -0
- package/publish/cjs/src/components/Switch/index.js +6 -0
- package/publish/cjs/src/components/Table/Table.js +53 -0
- package/publish/cjs/src/components/Tabs/Tabs.js +42 -0
- package/publish/cjs/src/components/Textarea/Textarea.js +14 -0
- package/publish/cjs/src/components/Toast/Toast.js +65 -0
- package/publish/cjs/src/components/Toast/toaster.js +14 -0
- package/publish/cjs/src/components/Toast/use-toast.js +155 -0
- package/publish/cjs/src/components/Tooltip/Tooltip.js +41 -0
- package/publish/cjs/src/helpers/clone-deep.js +15 -0
- package/publish/cjs/src/helpers/clone-deep.spec.js +22 -0
- package/publish/cjs/src/helpers/generic-forward-ref.js +5 -0
- package/publish/cjs/src/helpers/http.js +10 -0
- package/publish/cjs/src/helpers/is-client.js +7 -0
- package/publish/cjs/src/helpers/is-object.js +12 -0
- package/publish/cjs/src/helpers/is-object.spec.js +24 -0
- package/publish/cjs/src/helpers/merge-deep.js +29 -0
- package/publish/cjs/src/helpers/merge-deep.spec.js +56 -0
- package/publish/cjs/src/helpers/omit.js +16 -0
- package/publish/cjs/src/helpers/omit.spec.js +9 -0
- package/publish/cjs/src/index.js +19 -0
- package/publish/cjs/src/types/index.js +2 -0
- package/publish/cjs/tsconfig.lib.tsbuildinfo +1 -0
- package/publish/esm/components/ui/button.d.ts +11 -0
- package/publish/esm/components/ui/button.js +33 -0
- package/publish/esm/components/utils/SpinerIcon.d.ts +6 -0
- package/publish/esm/components/utils/SpinerIcon.js +5 -0
- package/publish/esm/lib/utils.d.ts +2 -0
- package/publish/esm/lib/utils.js +5 -0
- package/publish/esm/src/components/Accordion/Accordion.d.ts +20 -0
- package/publish/esm/src/components/Accordion/Accordion.js +15 -0
- package/publish/esm/src/components/Accordion/index.d.ts +2 -0
- package/publish/esm/src/components/Accordion/index.js +1 -0
- package/publish/esm/src/components/Alert/Alert.d.ts +8 -0
- package/publish/esm/src/components/Alert/Alert.js +22 -0
- package/publish/esm/src/components/AlertDialog/AlertDialog.d.ts +49 -0
- package/publish/esm/src/components/AlertDialog/AlertDialog.js +26 -0
- package/publish/esm/src/components/AlertDialog/index.d.ts +2 -0
- package/publish/esm/src/components/AlertDialog/index.js +5 -0
- package/publish/esm/src/components/Avatar/Avatar.d.ts +33 -0
- package/publish/esm/src/components/Avatar/Avatar.js +46 -0
- package/publish/esm/src/components/Avatar/index.d.ts +2 -0
- package/publish/esm/src/components/Avatar/index.js +1 -0
- package/publish/esm/src/components/Badge/Badge.d.ts +9 -0
- package/publish/esm/src/components/Badge/Badge.js +20 -0
- package/publish/esm/src/components/Button/Button.d.ts +26 -0
- package/publish/esm/src/components/Button/Button.js +44 -0
- package/publish/esm/src/components/Button/index.d.ts +2 -0
- package/publish/esm/src/components/Button/index.js +1 -0
- package/publish/esm/src/components/Calendar/calendar.d.ts +8 -0
- package/publish/esm/src/components/Calendar/calendar.js +36 -0
- package/publish/esm/src/components/Card/Card.d.ts +8 -0
- package/publish/esm/src/components/Card/Card.js +16 -0
- package/publish/esm/src/components/Checkbox/Checkbox.d.ts +40 -0
- package/publish/esm/src/components/Checkbox/Checkbox.js +36 -0
- package/publish/esm/src/components/Checkbox/index.d.ts +2 -0
- package/publish/esm/src/components/Checkbox/index.js +4 -0
- package/publish/esm/src/components/Collapsible/collapsible.d.ts +5 -0
- package/publish/esm/src/components/Collapsible/collapsible.js +5 -0
- package/publish/esm/src/components/Command/command.d.ts +50 -0
- package/publish/esm/src/components/Command/command.js +28 -0
- package/publish/esm/src/components/Dialog/dialog.d.ts +19 -0
- package/publish/esm/src/components/Dialog/dialog.js +22 -0
- package/publish/esm/src/components/Drawer/drawer.d.ts +24 -0
- package/publish/esm/src/components/Drawer/drawer.js +22 -0
- package/publish/esm/src/components/DropdownMenu/dropdownmenu.d.ts +27 -0
- package/publish/esm/src/components/DropdownMenu/dropdownmenu.js +35 -0
- package/publish/esm/src/components/HoverCard/hover-card.d.ts +6 -0
- package/publish/esm/src/components/HoverCard/hover-card.js +10 -0
- package/publish/esm/src/components/IconButton/IconButton.d.ts +22 -0
- package/publish/esm/src/components/IconButton/IconButton.js +40 -0
- package/publish/esm/src/components/IconButton/index.d.ts +2 -0
- package/publish/esm/src/components/IconButton/index.js +1 -0
- package/publish/esm/src/components/Input/input.d.ts +5 -0
- package/publish/esm/src/components/Input/input.js +8 -0
- package/publish/esm/src/components/Label/Label.d.ts +5 -0
- package/publish/esm/src/components/Label/Label.js +9 -0
- package/publish/esm/src/components/Menubar/menubar.d.ts +31 -0
- package/publish/esm/src/components/Menubar/menubar.js +36 -0
- package/publish/esm/src/components/NavigationMenu/navigation-menu.d.ts +13 -0
- package/publish/esm/src/components/NavigationMenu/navigation-menu.js +64 -0
- package/publish/esm/src/components/Pagination/Pagination.d.ts +19 -0
- package/publish/esm/src/components/Pagination/Pagination.js +20 -0
- package/publish/esm/src/components/Popover/popover.d.ts +6 -0
- package/publish/esm/src/components/Popover/popover.js +9 -0
- package/publish/esm/src/components/Progress/Progress.d.ts +4 -0
- package/publish/esm/src/components/Progress/Progress.js +7 -0
- package/publish/esm/src/components/RadioGroup/Radio.d.ts +22 -0
- package/publish/esm/src/components/RadioGroup/Radio.js +84 -0
- package/publish/esm/src/components/RadioGroup/RadioGroup.d.ts +44 -0
- package/publish/esm/src/components/RadioGroup/RadioGroup.js +25 -0
- package/publish/esm/src/components/RadioGroup/index.d.ts +2 -0
- package/publish/esm/src/components/RadioGroup/index.js +1 -0
- package/publish/esm/src/components/Select/Select.d.ts +13 -0
- package/publish/esm/src/components/Select/Select.js +26 -0
- package/publish/esm/src/components/Sheet/sheet.d.ts +25 -0
- package/publish/esm/src/components/Sheet/sheet.js +36 -0
- package/publish/esm/src/components/Skeleton/skeleton.d.ts +2 -0
- package/publish/esm/src/components/Skeleton/skeleton.js +6 -0
- package/publish/esm/src/components/Slider/slider.d.ts +4 -0
- package/publish/esm/src/components/Slider/slider.js +7 -0
- package/publish/esm/src/components/Switch/Switch.d.ts +37 -0
- package/publish/esm/src/components/Switch/Switch.js +26 -0
- package/publish/esm/src/components/Switch/index.d.ts +2 -0
- package/publish/esm/src/components/Switch/index.js +1 -0
- package/publish/esm/src/components/Table/Table.d.ts +10 -0
- package/publish/esm/src/components/Table/Table.js +20 -0
- package/publish/esm/src/components/Tabs/Tabs.d.ts +7 -0
- package/publish/esm/src/components/Tabs/Tabs.js +13 -0
- package/publish/esm/src/components/Textarea/Textarea.d.ts +5 -0
- package/publish/esm/src/components/Textarea/Textarea.js +8 -0
- package/publish/esm/src/components/Toast/Toast.d.ts +15 -0
- package/publish/esm/src/components/Toast/Toast.js +33 -0
- package/publish/esm/src/components/Toast/toaster.d.ts +1 -0
- package/publish/esm/src/components/Toast/toaster.js +10 -0
- package/publish/esm/src/components/Toast/use-toast.d.ts +44 -0
- package/publish/esm/src/components/Toast/use-toast.js +127 -0
- package/publish/esm/src/components/Tooltip/Tooltip.d.ts +8 -0
- package/publish/esm/src/components/Tooltip/Tooltip.js +11 -0
- package/publish/esm/src/helpers/clone-deep.d.ts +1 -0
- package/publish/esm/src/helpers/clone-deep.js +11 -0
- package/publish/esm/src/helpers/clone-deep.spec.d.ts +1 -0
- package/publish/esm/src/helpers/clone-deep.spec.js +20 -0
- package/publish/esm/src/helpers/generic-forward-ref.d.ts +5 -0
- package/publish/esm/src/helpers/generic-forward-ref.js +3 -0
- package/publish/esm/src/helpers/http.d.ts +1 -0
- package/publish/esm/src/helpers/http.js +6 -0
- package/publish/esm/src/helpers/is-client.d.ts +1 -0
- package/publish/esm/src/helpers/is-client.js +3 -0
- package/publish/esm/src/helpers/is-object.d.ts +6 -0
- package/publish/esm/src/helpers/is-object.js +8 -0
- package/publish/esm/src/helpers/is-object.spec.d.ts +1 -0
- package/publish/esm/src/helpers/is-object.spec.js +22 -0
- package/publish/esm/src/helpers/merge-deep.d.ts +7 -0
- package/publish/esm/src/helpers/merge-deep.js +25 -0
- package/publish/esm/src/helpers/merge-deep.spec.d.ts +1 -0
- package/publish/esm/src/helpers/merge-deep.spec.js +54 -0
- package/publish/esm/src/helpers/omit.d.ts +1 -0
- package/publish/esm/src/helpers/omit.js +12 -0
- package/publish/esm/src/helpers/omit.spec.d.ts +1 -0
- package/publish/esm/src/helpers/omit.spec.js +7 -0
- package/publish/esm/src/index.d.ts +3 -0
- package/publish/esm/src/index.js +3 -0
- package/publish/esm/src/types/index.d.ts +3 -0
- package/publish/esm/src/types/index.js +1 -0
- package/publish/esm/tsconfig.lib.tsbuildinfo +1 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SheetDescription = exports.SheetTitle = exports.SheetFooter = exports.SheetHeader = exports.SheetContent = exports.SheetClose = exports.SheetTrigger = exports.SheetOverlay = exports.SheetPortal = exports.Sheet = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const React = __importStar(require("react"));
|
|
29
|
+
const SheetPrimitive = __importStar(require("@radix-ui/react-dialog"));
|
|
30
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
31
|
+
const lucide_react_1 = require("lucide-react");
|
|
32
|
+
const utils_1 = require("@/lib/utils");
|
|
33
|
+
const Sheet = SheetPrimitive.Root;
|
|
34
|
+
exports.Sheet = Sheet;
|
|
35
|
+
const SheetTrigger = SheetPrimitive.Trigger;
|
|
36
|
+
exports.SheetTrigger = SheetTrigger;
|
|
37
|
+
const SheetClose = SheetPrimitive.Close;
|
|
38
|
+
exports.SheetClose = SheetClose;
|
|
39
|
+
const SheetPortal = SheetPrimitive.Portal;
|
|
40
|
+
exports.SheetPortal = SheetPortal;
|
|
41
|
+
const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(SheetPrimitive.Overlay, { className: (0, utils_1.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props, ref: ref })));
|
|
42
|
+
exports.SheetOverlay = SheetOverlay;
|
|
43
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
44
|
+
const sheetVariants = (0, class_variance_authority_1.cva)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", {
|
|
45
|
+
variants: {
|
|
46
|
+
side: {
|
|
47
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
48
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
49
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
50
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
side: "right",
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
const SheetContent = React.forwardRef(({ side = "right", className, children, ...props }, ref) => ((0, jsx_runtime_1.jsxs)(SheetPortal, { children: [(0, jsx_runtime_1.jsx)(SheetOverlay, {}), (0, jsx_runtime_1.jsxs)(SheetPrimitive.Content, { ref: ref, className: (0, utils_1.cn)(sheetVariants({ side }), className), ...props, children: [children, (0, jsx_runtime_1.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Close" })] })] })] })));
|
|
58
|
+
exports.SheetContent = SheetContent;
|
|
59
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
60
|
+
const SheetHeader = ({ className, ...props }) => ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("flex flex-col space-y-2 text-center sm:text-left", className), ...props }));
|
|
61
|
+
exports.SheetHeader = SheetHeader;
|
|
62
|
+
SheetHeader.displayName = "SheetHeader";
|
|
63
|
+
const SheetFooter = ({ className, ...props }) => ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
|
|
64
|
+
exports.SheetFooter = SheetFooter;
|
|
65
|
+
SheetFooter.displayName = "SheetFooter";
|
|
66
|
+
const SheetTitle = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(SheetPrimitive.Title, { ref: ref, className: (0, utils_1.cn)("text-lg font-semibold text-foreground", className), ...props })));
|
|
67
|
+
exports.SheetTitle = SheetTitle;
|
|
68
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
69
|
+
const SheetDescription = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(SheetPrimitive.Description, { ref: ref, className: (0, utils_1.cn)("text-sm text-muted-foreground", className), ...props })));
|
|
70
|
+
exports.SheetDescription = SheetDescription;
|
|
71
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Skeleton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const utils_1 = require("@/lib/utils");
|
|
6
|
+
function Skeleton({ className, ...props }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("animate-pulse rounded-md bg-muted", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
exports.Skeleton = Skeleton;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Slider = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const React = __importStar(require("react"));
|
|
29
|
+
const SliderPrimitive = __importStar(require("@radix-ui/react-slider"));
|
|
30
|
+
const utils_1 = require("@/lib/utils");
|
|
31
|
+
const Slider = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsxs)(SliderPrimitive.Root, { ref: ref, className: (0, utils_1.cn)("relative flex w-full touch-none select-none items-center", className), ...props, children: [(0, jsx_runtime_1.jsx)(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: (0, jsx_runtime_1.jsx)(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }), (0, jsx_runtime_1.jsx)(SliderPrimitive.Thumb, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" })] })));
|
|
32
|
+
exports.Slider = Slider;
|
|
33
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var _a, _b;
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.SwitchThumb = exports.Switch = exports.useSwitchContext = exports.SwitchProvider = exports.createSwitchScope = exports.createSwitchContext = void 0;
|
|
28
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
const React = __importStar(require("react"));
|
|
30
|
+
const SwitchPrimitives = __importStar(require("@radix-ui/react-switch"));
|
|
31
|
+
const react_context_1 = require("@radix-ui/react-context");
|
|
32
|
+
const react_primitive_1 = require("@radix-ui/react-primitive");
|
|
33
|
+
const utils_1 = require("@/lib/utils");
|
|
34
|
+
const SWITCH_NAME = "Switch";
|
|
35
|
+
_a = (0, react_context_1.createContextScope)(SWITCH_NAME), exports.createSwitchContext = _a[0], exports.createSwitchScope = _a[1];
|
|
36
|
+
_b = (0, exports.createSwitchContext)(SWITCH_NAME), exports.SwitchProvider = _b[0], exports.useSwitchContext = _b[1];
|
|
37
|
+
function getState(checked) {
|
|
38
|
+
return checked ? "checked" : "unchecked";
|
|
39
|
+
}
|
|
40
|
+
/* -------------------------------------------------------------------------------------------------
|
|
41
|
+
* SwitchThumb
|
|
42
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
43
|
+
const THUMB_NAME = "SwitchThumb";
|
|
44
|
+
const SwitchThumb = React.forwardRef((props, forwardedRef) => {
|
|
45
|
+
const { __scopeSwitch, ...thumbProps } = props;
|
|
46
|
+
const context = (0, exports.useSwitchContext)(THUMB_NAME, __scopeSwitch);
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(react_primitive_1.Primitive.span, { "data-state": getState(context.checked), "data-disabled": context.disabled ? "" : undefined, ...thumbProps, ref: forwardedRef }));
|
|
48
|
+
});
|
|
49
|
+
exports.SwitchThumb = SwitchThumb;
|
|
50
|
+
SwitchThumb.displayName = THUMB_NAME;
|
|
51
|
+
/* ---------------------------------------------------------------------------------------------- */
|
|
52
|
+
const Switch = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(SwitchPrimitives.Root, { className: (0, utils_1.cn)("peer inline-flex h-5 w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-default disabled:opacity-20 data-[state=checked]:bg-pink-500 data-[state=unchecked]:bg-gray-400", className), ...props, ref: ref, children: (0, jsx_runtime_1.jsx)(SwitchPrimitives.Thumb, { className: (0, utils_1.cn)("pointer-events-none relative cik before:content-[''] before:absolute before:w-1.5 before:h-1.5 before:rounded-full before:bg-pink-600 before:-translate-x-1/2 before:translate-y-1 disabled:opacity-20 before:data-[state=unchecked]:bg-gray-400 block h-3.5 w-3.5 bg-white rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0.5") }) })));
|
|
53
|
+
exports.Switch = Switch;
|
|
54
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SwitchThumb = exports.Switch = void 0;
|
|
4
|
+
var Switch_1 = require("./Switch");
|
|
5
|
+
Object.defineProperty(exports, "Switch", { enumerable: true, get: function () { return Switch_1.Switch; } });
|
|
6
|
+
Object.defineProperty(exports, "SwitchThumb", { enumerable: true, get: function () { return Switch_1.SwitchThumb; } });
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.TableCaption = exports.TableCell = exports.TableRow = exports.TableHead = exports.TableFooter = exports.TableBody = exports.TableHeader = exports.Table = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const React = __importStar(require("react"));
|
|
29
|
+
const utils_1 = require("@/lib/utils");
|
|
30
|
+
const Table = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { className: "relative w-full overflow-auto", children: (0, jsx_runtime_1.jsx)("table", { ref: ref, className: (0, utils_1.cn)("w-full caption-bottom text-sm", className), ...props }) })));
|
|
31
|
+
exports.Table = Table;
|
|
32
|
+
Table.displayName = "Table";
|
|
33
|
+
const TableHeader = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("thead", { ref: ref, className: (0, utils_1.cn)("[&_tr]:border-b", className), ...props })));
|
|
34
|
+
exports.TableHeader = TableHeader;
|
|
35
|
+
TableHeader.displayName = "TableHeader";
|
|
36
|
+
const TableBody = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("tbody", { ref: ref, className: (0, utils_1.cn)("[&_tr:last-child]:border-0", className), ...props })));
|
|
37
|
+
exports.TableBody = TableBody;
|
|
38
|
+
TableBody.displayName = "TableBody";
|
|
39
|
+
const TableFooter = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("tfoot", { ref: ref, className: (0, utils_1.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props })));
|
|
40
|
+
exports.TableFooter = TableFooter;
|
|
41
|
+
TableFooter.displayName = "TableFooter";
|
|
42
|
+
const TableRow = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("tr", { ref: ref, className: (0, utils_1.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className), ...props })));
|
|
43
|
+
exports.TableRow = TableRow;
|
|
44
|
+
TableRow.displayName = "TableRow";
|
|
45
|
+
const TableHead = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("th", { ref: ref, className: (0, utils_1.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className), ...props })));
|
|
46
|
+
exports.TableHead = TableHead;
|
|
47
|
+
TableHead.displayName = "TableHead";
|
|
48
|
+
const TableCell = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("td", { ref: ref, className: (0, utils_1.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0", className), ...props })));
|
|
49
|
+
exports.TableCell = TableCell;
|
|
50
|
+
TableCell.displayName = "TableCell";
|
|
51
|
+
const TableCaption = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)("caption", { ref: ref, className: (0, utils_1.cn)("mt-4 text-sm text-muted-foreground", className), ...props })));
|
|
52
|
+
exports.TableCaption = TableCaption;
|
|
53
|
+
TableCaption.displayName = "TableCaption";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.TabsContent = exports.TabsTrigger = exports.TabsList = exports.Tabs = void 0;
|
|
28
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
const React = __importStar(require("react"));
|
|
30
|
+
const TabsPrimitive = __importStar(require("@radix-ui/react-tabs"));
|
|
31
|
+
const utils_1 = require("@/lib/utils");
|
|
32
|
+
const Tabs = TabsPrimitive.Root;
|
|
33
|
+
exports.Tabs = Tabs;
|
|
34
|
+
const TabsList = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(TabsPrimitive.List, { ref: ref, className: (0, utils_1.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", className), ...props })));
|
|
35
|
+
exports.TabsList = TabsList;
|
|
36
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
37
|
+
const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(TabsPrimitive.Trigger, { ref: ref, className: (0, utils_1.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all 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=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm", className), ...props })));
|
|
38
|
+
exports.TabsTrigger = TabsTrigger;
|
|
39
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
40
|
+
const TabsContent = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(TabsPrimitive.Content, { ref: ref, className: (0, utils_1.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", className), ...props })));
|
|
41
|
+
exports.TabsContent = TabsContent;
|
|
42
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Textarea = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const utils_1 = require("@/lib/utils");
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const Textarea = react_1.default.forwardRef(({ className, ...props }, ref) => {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)("textarea", { className: (0, utils_1.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className), ref: ref, ...props }));
|
|
12
|
+
});
|
|
13
|
+
exports.Textarea = Textarea;
|
|
14
|
+
Textarea.displayName = "Textarea";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ToastAction = exports.ToastClose = exports.ToastDescription = exports.ToastTitle = exports.Toast = exports.ToastViewport = exports.ToastProvider = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const React = __importStar(require("react"));
|
|
29
|
+
const ToastPrimitives = __importStar(require("@radix-ui/react-toast"));
|
|
30
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
31
|
+
const lucide_react_1 = require("lucide-react");
|
|
32
|
+
const utils_1 = require("@/lib/utils");
|
|
33
|
+
const ToastProvider = ToastPrimitives.Provider;
|
|
34
|
+
exports.ToastProvider = ToastProvider;
|
|
35
|
+
const ToastViewport = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Viewport, { ref: ref, className: (0, utils_1.cn)("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]", className), ...props })));
|
|
36
|
+
exports.ToastViewport = ToastViewport;
|
|
37
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
38
|
+
const toastVariants = (0, class_variance_authority_1.cva)("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", {
|
|
39
|
+
variants: {
|
|
40
|
+
variant: {
|
|
41
|
+
default: "border bg-background text-foreground",
|
|
42
|
+
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
variant: "default",
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const Toast = React.forwardRef(({ className, variant, ...props }, ref) => {
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(ToastPrimitives.Root, { ref: ref, className: (0, utils_1.cn)(toastVariants({ variant }), className), ...props }));
|
|
51
|
+
});
|
|
52
|
+
exports.Toast = Toast;
|
|
53
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
54
|
+
const ToastAction = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Action, { ref: ref, className: (0, utils_1.cn)("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", className), ...props })));
|
|
55
|
+
exports.ToastAction = ToastAction;
|
|
56
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
57
|
+
const ToastClose = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Close, { ref: ref, className: (0, utils_1.cn)("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", className), "toast-close": "", ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "h-4 w-4" }) })));
|
|
58
|
+
exports.ToastClose = ToastClose;
|
|
59
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
60
|
+
const ToastTitle = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Title, { ref: ref, className: (0, utils_1.cn)("text-sm font-semibold", className), ...props })));
|
|
61
|
+
exports.ToastTitle = ToastTitle;
|
|
62
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
63
|
+
const ToastDescription = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Description, { ref: ref, className: (0, utils_1.cn)("text-sm opacity-90", className), ...props })));
|
|
64
|
+
exports.ToastDescription = ToastDescription;
|
|
65
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Toaster = void 0;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const Toast_1 = require("@/src/components/Toast/Toast");
|
|
7
|
+
const use_toast_1 = require("@/src/components/Toast/use-toast");
|
|
8
|
+
function Toaster() {
|
|
9
|
+
const { toasts } = (0, use_toast_1.useToast)();
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(Toast_1.ToastProvider, { children: [toasts.map(function ({ id, title, description, action, ...props }) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(Toast_1.Toast, { ...props, children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid gap-1", children: [title && (0, jsx_runtime_1.jsx)(Toast_1.ToastTitle, { children: title }), description && ((0, jsx_runtime_1.jsx)(Toast_1.ToastDescription, { children: description }))] }), action, (0, jsx_runtime_1.jsx)(Toast_1.ToastClose, {})] }, id));
|
|
12
|
+
}), (0, jsx_runtime_1.jsx)(Toast_1.ToastViewport, {})] }));
|
|
13
|
+
}
|
|
14
|
+
exports.Toaster = Toaster;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.toast = exports.useToast = exports.reducer = void 0;
|
|
27
|
+
// Inspired by react-hot-toast library
|
|
28
|
+
const React = __importStar(require("react"));
|
|
29
|
+
const TOAST_LIMIT = 1;
|
|
30
|
+
const TOAST_REMOVE_DELAY = 1000000;
|
|
31
|
+
const actionTypes = {
|
|
32
|
+
ADD_TOAST: "ADD_TOAST",
|
|
33
|
+
UPDATE_TOAST: "UPDATE_TOAST",
|
|
34
|
+
DISMISS_TOAST: "DISMISS_TOAST",
|
|
35
|
+
REMOVE_TOAST: "REMOVE_TOAST",
|
|
36
|
+
};
|
|
37
|
+
let count = 0;
|
|
38
|
+
function genId() {
|
|
39
|
+
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
|
40
|
+
return count.toString();
|
|
41
|
+
}
|
|
42
|
+
const toastTimeouts = new Map();
|
|
43
|
+
const addToRemoveQueue = (toastId) => {
|
|
44
|
+
if (toastTimeouts.has(toastId)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const timeout = setTimeout(() => {
|
|
48
|
+
toastTimeouts.delete(toastId);
|
|
49
|
+
dispatch({
|
|
50
|
+
type: "REMOVE_TOAST",
|
|
51
|
+
toastId: toastId,
|
|
52
|
+
});
|
|
53
|
+
}, TOAST_REMOVE_DELAY);
|
|
54
|
+
toastTimeouts.set(toastId, timeout);
|
|
55
|
+
};
|
|
56
|
+
const reducer = (state, action) => {
|
|
57
|
+
switch (action.type) {
|
|
58
|
+
case "ADD_TOAST":
|
|
59
|
+
return {
|
|
60
|
+
...state,
|
|
61
|
+
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
|
62
|
+
};
|
|
63
|
+
case "UPDATE_TOAST":
|
|
64
|
+
return {
|
|
65
|
+
...state,
|
|
66
|
+
toasts: state.toasts.map((t) => t.id === action.toast.id ? { ...t, ...action.toast } : t),
|
|
67
|
+
};
|
|
68
|
+
case "DISMISS_TOAST": {
|
|
69
|
+
const { toastId } = action;
|
|
70
|
+
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
|
71
|
+
// but I'll keep it here for simplicity
|
|
72
|
+
if (toastId) {
|
|
73
|
+
addToRemoveQueue(toastId);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
state.toasts.forEach((toast) => {
|
|
77
|
+
addToRemoveQueue(toast.id);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
...state,
|
|
82
|
+
toasts: state.toasts.map((t) => t.id === toastId || toastId === undefined
|
|
83
|
+
? {
|
|
84
|
+
...t,
|
|
85
|
+
open: false,
|
|
86
|
+
}
|
|
87
|
+
: t),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
case "REMOVE_TOAST":
|
|
91
|
+
if (action.toastId === undefined) {
|
|
92
|
+
return {
|
|
93
|
+
...state,
|
|
94
|
+
toasts: [],
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
...state,
|
|
99
|
+
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
exports.reducer = reducer;
|
|
104
|
+
const listeners = [];
|
|
105
|
+
let memoryState = { toasts: [] };
|
|
106
|
+
function dispatch(action) {
|
|
107
|
+
memoryState = (0, exports.reducer)(memoryState, action);
|
|
108
|
+
listeners.forEach((listener) => {
|
|
109
|
+
listener(memoryState);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function toast({ ...props }) {
|
|
113
|
+
const id = genId();
|
|
114
|
+
const update = (props) => dispatch({
|
|
115
|
+
type: "UPDATE_TOAST",
|
|
116
|
+
toast: { ...props, id },
|
|
117
|
+
});
|
|
118
|
+
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
|
119
|
+
dispatch({
|
|
120
|
+
type: "ADD_TOAST",
|
|
121
|
+
toast: {
|
|
122
|
+
...props,
|
|
123
|
+
id,
|
|
124
|
+
open: true,
|
|
125
|
+
onOpenChange: (open) => {
|
|
126
|
+
if (!open)
|
|
127
|
+
dismiss();
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
id: id,
|
|
133
|
+
dismiss,
|
|
134
|
+
update,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
exports.toast = toast;
|
|
138
|
+
function useToast() {
|
|
139
|
+
const [state, setState] = React.useState(memoryState);
|
|
140
|
+
React.useEffect(() => {
|
|
141
|
+
listeners.push(setState);
|
|
142
|
+
return () => {
|
|
143
|
+
const index = listeners.indexOf(setState);
|
|
144
|
+
if (index > -1) {
|
|
145
|
+
listeners.splice(index, 1);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}, [state]);
|
|
149
|
+
return {
|
|
150
|
+
...state,
|
|
151
|
+
toast,
|
|
152
|
+
dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId }),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
exports.useToast = useToast;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.TooltipArrow = exports.TooltipProvider = exports.TooltipContent = exports.TooltipTrigger = exports.Tooltip = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const React = __importStar(require("react"));
|
|
29
|
+
const TooltipPrimitive = __importStar(require("@radix-ui/react-tooltip"));
|
|
30
|
+
const utils_1 = require("@/lib/utils");
|
|
31
|
+
const TooltipProvider = TooltipPrimitive.Provider;
|
|
32
|
+
exports.TooltipProvider = TooltipProvider;
|
|
33
|
+
const Tooltip = TooltipPrimitive.Root;
|
|
34
|
+
exports.Tooltip = Tooltip;
|
|
35
|
+
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
36
|
+
exports.TooltipTrigger = TooltipTrigger;
|
|
37
|
+
const TooltipArrow = TooltipPrimitive.Arrow;
|
|
38
|
+
exports.TooltipArrow = TooltipArrow;
|
|
39
|
+
const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => ((0, jsx_runtime_1.jsx)(TooltipPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: (0, utils_1.cn)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props })));
|
|
40
|
+
exports.TooltipContent = TooltipContent;
|
|
41
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cloneDeep = void 0;
|
|
4
|
+
const is_object_1 = require("./is-object");
|
|
5
|
+
function cloneDeep(source) {
|
|
6
|
+
if (!(0, is_object_1.isObject)(source)) {
|
|
7
|
+
return source;
|
|
8
|
+
}
|
|
9
|
+
const output = {};
|
|
10
|
+
for (const key in source) {
|
|
11
|
+
output[key] = cloneDeep(source[key]);
|
|
12
|
+
}
|
|
13
|
+
return output;
|
|
14
|
+
}
|
|
15
|
+
exports.cloneDeep = cloneDeep;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const clone_deep_1 = require("./clone-deep");
|
|
5
|
+
(0, vitest_1.describe)('Helpers / cloneDeep', () => {
|
|
6
|
+
(0, vitest_1.it)('should clone a simple object', () => {
|
|
7
|
+
const source = { key: 'value' };
|
|
8
|
+
const cloned = (0, clone_deep_1.cloneDeep)(source);
|
|
9
|
+
(0, vitest_1.expect)(cloned).toEqual(source); // Check for deep equality
|
|
10
|
+
(0, vitest_1.expect)(cloned).not.toBe(source); // Ensure it's a deep clone, not the same reference
|
|
11
|
+
});
|
|
12
|
+
(0, vitest_1.it)('should handle null gracefully', () => {
|
|
13
|
+
const source = null;
|
|
14
|
+
const cloned = (0, clone_deep_1.cloneDeep)(source);
|
|
15
|
+
(0, vitest_1.expect)(cloned).toBeNull();
|
|
16
|
+
});
|
|
17
|
+
(0, vitest_1.it)('should handle undefined gracefully', () => {
|
|
18
|
+
const source = undefined;
|
|
19
|
+
const cloned = (0, clone_deep_1.cloneDeep)(source);
|
|
20
|
+
(0, vitest_1.expect)(cloned).toBeUndefined();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safeResJson = void 0;
|
|
4
|
+
const safeResJson = (res) => {
|
|
5
|
+
if (res.ok) {
|
|
6
|
+
return res.json();
|
|
7
|
+
}
|
|
8
|
+
throw new Error('Internal server error!');
|
|
9
|
+
};
|
|
10
|
+
exports.safeResJson = safeResJson;
|