@quan-erp/shared-ui 1.0.10 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/collapsible.d.ts +4 -3
- package/dist/components/ui/context-menu.d.ts +1 -1
- package/dist/components/ui/drawer.d.ts +2 -2
- package/dist/components/ui/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/hover-card.d.ts +1 -1
- package/dist/components/ui/navigation-menu.d.ts +1 -1
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/select.d.ts +1 -1
- package/dist/es/components/custom/confirm-dialog.js +19 -6
- package/dist/es/components/custom/dashboard.js +4 -1
- package/dist/es/components/custom/data-table/cursor-based-pagination.js +3 -1
- package/dist/es/components/custom/data-table/data-table-bulk-action-menu.js +4 -1
- package/dist/es/components/custom/data-table/data-table-bulk-export.js +3 -1
- package/dist/es/components/custom/data-table/data-table-column-header.js +4 -1
- package/dist/es/components/custom/data-table/data-table-grid.js +3 -1
- package/dist/es/components/custom/data-table/data-table-list-view.js +2 -0
- package/dist/es/components/custom/data-table/data-table-pagination.js +3 -1
- package/dist/es/components/custom/data-table/data-table-toolbar.js +3 -1
- package/dist/es/components/custom/data-table/data-table-view-options.js +8 -1
- package/dist/es/components/custom/data-table/data-table.js +11 -2
- package/dist/es/components/custom/error-screen.js +1 -1
- package/dist/es/components/custom/floating-action-btn.js +16 -5
- package/dist/es/components/custom/menu-tab.js +26 -17
- package/dist/es/components/custom/page.js +4 -2
- package/dist/es/components/custom/protected-page.js +0 -54
- package/dist/es/components/custom/pull-to-refresh.js +5 -3
- package/dist/es/components/custom/responsive-dialog.js +26 -25
- package/dist/es/components/custom/scrollable.js +2 -0
- package/dist/es/components/custom/setting.js +12 -9
- package/dist/es/components/ui/accordion.js +4 -0
- package/dist/es/components/ui/alert-dialog.js +6 -5
- package/dist/es/components/ui/breadcrumb.js +2 -0
- package/dist/es/components/ui/button.js +2 -1
- package/dist/es/components/ui/calendar.js +3 -1
- package/dist/es/components/ui/chart.js +2 -0
- package/dist/es/components/ui/checkbox.js +2 -0
- package/dist/es/components/ui/collapsible.js +7 -2
- package/dist/es/components/ui/command.js +4 -0
- package/dist/es/components/ui/context-menu.js +10 -2
- package/dist/es/components/ui/dialog.js +7 -6
- package/dist/es/components/ui/drawer.js +8 -3
- package/dist/es/components/ui/dropdown-menu.js +10 -2
- package/dist/es/components/ui/hover-card.js +4 -1
- package/dist/es/components/ui/input-otp.js +2 -0
- package/dist/es/components/ui/input.js +2 -1
- package/dist/es/components/ui/label.js +2 -1
- package/dist/es/components/ui/menubar.js +8 -0
- package/dist/es/components/ui/navigation-menu.js +5 -1
- package/dist/es/components/ui/pagination.js +4 -0
- package/dist/es/components/ui/popover.js +4 -1
- package/dist/es/components/ui/radio-group.js +3 -0
- package/dist/es/components/ui/resizable.js +2 -0
- package/dist/es/components/ui/select.js +8 -2
- package/dist/es/components/ui/sheet.js +6 -5
- package/dist/es/components/ui/sidebar.js +7 -0
- package/dist/es/components/ui/slider.js +3 -0
- package/dist/es/components/ui/switch.js +2 -0
- package/dist/es/components/ui/tabs.js +4 -0
- package/dist/es/components/ui/textarea.js +2 -1
- package/dist/es/components/ui/time-picker.js +4 -2
- package/dist/es/components/ui/toggle-group.js +3 -0
- package/dist/es/components/ui/toggle.js +2 -1
- package/dist/es/components/ui/tooltip.js +3 -2
- package/dist/es/index.js +2 -0
- package/dist/es/lib/macros.js +15 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/macros.d.ts +8 -0
- package/package.json +3 -3
|
@@ -1,59 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PluginAPI } from "@quan-erp/shared-frontend-core";
|
|
3
|
-
import "@icon-park/react";
|
|
4
|
-
import "../ui/accordion.js";
|
|
5
|
-
import "../ui/alert.js";
|
|
6
|
-
import "../ui/avatar.js";
|
|
7
|
-
import "../ui/badge.js";
|
|
8
|
-
import "../ui/breadcrumb.js";
|
|
9
|
-
import "../ui/button-group.js";
|
|
10
|
-
import "../ui/button.js";
|
|
11
|
-
import "react";
|
|
12
|
-
import "lucide-react";
|
|
13
|
-
import "react-day-picker";
|
|
14
|
-
import "clsx";
|
|
15
|
-
import "tailwind-merge";
|
|
16
|
-
import "../ui/popover.js";
|
|
17
|
-
import "../ui/drawer.js";
|
|
18
|
-
import "../ui/select.js";
|
|
19
|
-
import "uuid";
|
|
20
|
-
import "../ui/carousel.js";
|
|
21
|
-
import "../ui/chart.js";
|
|
22
|
-
import "../ui/checkbox.js";
|
|
23
|
-
import "@radix-ui/react-collapsible";
|
|
24
|
-
import "../ui/command.js";
|
|
25
|
-
import "../ui/context-menu.js";
|
|
26
|
-
import "@radix-ui/react-dialog";
|
|
27
|
-
import "../ui/dropdown-menu.js";
|
|
28
|
-
import "../ui/field.js";
|
|
29
|
-
import "../ui/form.js";
|
|
30
|
-
import "../ui/hover-card.js";
|
|
31
|
-
import "../ui/input-group.js";
|
|
32
|
-
import "../ui/input-otp.js";
|
|
33
|
-
import "../ui/input.js";
|
|
34
|
-
import "../ui/item.js";
|
|
35
|
-
import "@radix-ui/react-label";
|
|
36
|
-
import "../ui/menubar.js";
|
|
37
|
-
import "../ui/navigation-menu.js";
|
|
38
|
-
import "../ui/pagination.js";
|
|
39
|
-
import "../ui/progress.js";
|
|
40
|
-
import "../ui/radio-group.js";
|
|
41
|
-
import "react-resizable-panels";
|
|
42
|
-
import "../ui/scroll-area.js";
|
|
43
|
-
import "@radix-ui/react-separator";
|
|
44
|
-
import "../ui/sidebar.js";
|
|
45
|
-
import "../ui/slider.js";
|
|
46
|
-
import "next-themes";
|
|
47
|
-
import "sonner";
|
|
48
|
-
import "../ui/spinner.js";
|
|
49
|
-
import "../ui/switch.js";
|
|
50
|
-
import "../ui/table.js";
|
|
51
|
-
import "../ui/tabs.js";
|
|
52
|
-
import "../ui/textarea.js";
|
|
53
|
-
import "../ui/toggle-group.js";
|
|
54
|
-
import "../ui/toggle.js";
|
|
55
|
-
import "@radix-ui/react-tooltip";
|
|
56
|
-
import "@radix-ui/react-alert-dialog";
|
|
57
3
|
function Protected(props) {
|
|
58
4
|
const ProtectedComponent = PluginAPI.use("builtin", "Protected");
|
|
59
5
|
return /* @__PURE__ */ jsx(ProtectedComponent, { ...props });
|
|
@@ -10,6 +10,7 @@ import "../ui/button-group.js";
|
|
|
10
10
|
import "../ui/button.js";
|
|
11
11
|
import "lucide-react";
|
|
12
12
|
import "react-day-picker";
|
|
13
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
13
14
|
import "clsx";
|
|
14
15
|
import "tailwind-merge";
|
|
15
16
|
import "../ui/popover.js";
|
|
@@ -20,7 +21,7 @@ import { Vibration } from "@quan-erp/shared-frontend-core";
|
|
|
20
21
|
import "../ui/carousel.js";
|
|
21
22
|
import "../ui/chart.js";
|
|
22
23
|
import "../ui/checkbox.js";
|
|
23
|
-
import "
|
|
24
|
+
import "../ui/collapsible.js";
|
|
24
25
|
import "../ui/command.js";
|
|
25
26
|
import "../ui/context-menu.js";
|
|
26
27
|
import "@radix-ui/react-dialog";
|
|
@@ -319,9 +320,9 @@ const PullToRefresh = React__default.memo(({
|
|
|
319
320
|
startDrag(e.pageX, e.pageY, e.target);
|
|
320
321
|
};
|
|
321
322
|
if (disabled) {
|
|
322
|
-
return /* @__PURE__ */ jsx("div", { className, children });
|
|
323
|
+
return /* @__PURE__ */ jsx("div", { className, ...macrosSlot("pull-to-refresh"), children });
|
|
323
324
|
}
|
|
324
|
-
return /* @__PURE__ */ jsxs("div", { className: `shared:relative shared:overflow-hidden shared:w-full shared:h-full shared:select-none ${className}`, "data-vaul-no-drag": true, children: [
|
|
325
|
+
return /* @__PURE__ */ jsxs("div", { className: `shared:relative shared:overflow-hidden shared:w-full shared:h-full shared:select-none ${className}`, "data-vaul-no-drag": true, ...macrosSlot("pull-to-refresh"), children: [
|
|
325
326
|
/* @__PURE__ */ jsx(
|
|
326
327
|
"div",
|
|
327
328
|
{
|
|
@@ -361,6 +362,7 @@ const PullToRefresh = React__default.memo(({
|
|
|
361
362
|
"div",
|
|
362
363
|
{
|
|
363
364
|
ref: containerRef,
|
|
365
|
+
...macrosSlot("pull-to-refresh-content"),
|
|
364
366
|
onTouchStart: handleTouchStart,
|
|
365
367
|
onMouseDown: handleMouseDown,
|
|
366
368
|
className: `shared:overflow-y-auto shared:w-full shared:h-full shared:scrollbar-thin shared:will-change-transform`,
|
|
@@ -12,6 +12,7 @@ import "../ui/button-group.js";
|
|
|
12
12
|
import "../ui/button.js";
|
|
13
13
|
import "lucide-react";
|
|
14
14
|
import "react-day-picker";
|
|
15
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
15
16
|
import { cn } from "../../lib/utils.js";
|
|
16
17
|
import "../ui/popover.js";
|
|
17
18
|
import { Drawer, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger } from "../ui/drawer.js";
|
|
@@ -20,7 +21,7 @@ import "@icon-park/react";
|
|
|
20
21
|
import "../ui/carousel.js";
|
|
21
22
|
import "../ui/chart.js";
|
|
22
23
|
import "../ui/checkbox.js";
|
|
23
|
-
import "
|
|
24
|
+
import "../ui/collapsible.js";
|
|
24
25
|
import "../ui/command.js";
|
|
25
26
|
import "../ui/context-menu.js";
|
|
26
27
|
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger } from "../ui/dialog.js";
|
|
@@ -92,61 +93,61 @@ function ResponsiveDialog({
|
|
|
92
93
|
const type = isMobile ? "mobile" : "desktop";
|
|
93
94
|
useMobileBackDialog({ open, onOpenChange, enable: trackBrowserBack });
|
|
94
95
|
if (isMobile) {
|
|
95
|
-
return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, { value: { type, desktopDialogType }, children: /* @__PURE__ */ jsx(Drawer, { open, "data-plugin": pluginName, onOpenChange, direction: "bottom", shouldScaleBackground: false, repositionInputs: false, ...props, children }) });
|
|
96
|
+
return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, { value: { type, desktopDialogType }, children: /* @__PURE__ */ jsx(Drawer, { open, "data-plugin": pluginName, ...macrosSlot("responsive-dialog"), onOpenChange, direction: "bottom", shouldScaleBackground: false, repositionInputs: false, ...props, children }) });
|
|
96
97
|
}
|
|
97
98
|
if (desktopDialogType === DesktopDialogType.DIALOG) {
|
|
98
|
-
return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, { value: { type, desktopDialogType }, children: /* @__PURE__ */ jsx(Dialog, { open, "data-plugin": pluginName, onOpenChange, ...props, children }) });
|
|
99
|
+
return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, { value: { type, desktopDialogType }, children: /* @__PURE__ */ jsx(Dialog, { open, "data-plugin": pluginName, ...macrosSlot("responsive-dialog"), onOpenChange, ...props, children }) });
|
|
99
100
|
}
|
|
100
|
-
return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, { value: { type, desktopDialogType }, children: /* @__PURE__ */ jsx(Sheet, { open, "data-plugin": pluginName, onOpenChange, ...props, children }) });
|
|
101
|
+
return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, { value: { type, desktopDialogType }, children: /* @__PURE__ */ jsx(Sheet, { open, "data-plugin": pluginName, ...macrosSlot("responsive-dialog"), onOpenChange, ...props, children }) });
|
|
101
102
|
}
|
|
102
103
|
function ResponsiveHeader({ children, pluginName, className }) {
|
|
103
104
|
const dialog = useDialogType();
|
|
104
|
-
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerHeader, { "data-plugin": pluginName, className, children });
|
|
105
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerHeader, { "data-plugin": pluginName, ...macrosSlot("responsive-dialog-header"), className, children });
|
|
105
106
|
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
106
|
-
return /* @__PURE__ */ jsx(DialogHeader, { "data-plugin": pluginName, className, children });
|
|
107
|
-
return /* @__PURE__ */ jsx(SheetHeader, { "data-plugin": pluginName, className, children });
|
|
107
|
+
return /* @__PURE__ */ jsx(DialogHeader, { "data-plugin": pluginName, ...macrosSlot("responsive-dialog-header"), className, children });
|
|
108
|
+
return /* @__PURE__ */ jsx(SheetHeader, { "data-plugin": pluginName, ...macrosSlot("responsive-dialog-header"), className, children });
|
|
108
109
|
}
|
|
109
110
|
function ResponsiveTitle({ children, className, pluginName }) {
|
|
110
111
|
const dialog = useDialogType();
|
|
111
|
-
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerTitle, { className, "data-plugin": pluginName, children });
|
|
112
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerTitle, { className, "data-plugin": pluginName, ...macrosSlot("responsive-dialog-title"), children });
|
|
112
113
|
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
113
|
-
return /* @__PURE__ */ jsx(DialogTitle, { className, "data-plugin": pluginName, children });
|
|
114
|
-
return /* @__PURE__ */ jsx(SheetTitle, { className, "data-plugin": pluginName, children });
|
|
114
|
+
return /* @__PURE__ */ jsx(DialogTitle, { className, "data-plugin": pluginName, ...macrosSlot("responsive-dialog-title"), children });
|
|
115
|
+
return /* @__PURE__ */ jsx(SheetTitle, { className, "data-plugin": pluginName, ...macrosSlot("responsive-dialog-title"), children });
|
|
115
116
|
}
|
|
116
117
|
function ResponsiveContent({ children, className, style, pluginName, showCloseButton }) {
|
|
117
118
|
const dialog = useDialogType();
|
|
118
|
-
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerContent, { style, "data-plugin": pluginName, className: cn("shared:p-3 shared:rounded-t-3xl shared:cupertino-corner shared:fixed shared:bottom-0 shared:left-0 shared:right-0 shared:low-end-device:duration-0! shared:mid-device:duration-75! shared:low-end-device:animation-duration-[0s]! shared:mid-device:animation-duration-[100ms]!", className), children });
|
|
119
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerContent, { style, "data-plugin": pluginName, ...macrosSlot("responsive-dialog-content"), className: cn("shared:p-3 shared:rounded-t-3xl shared:cupertino-corner shared:fixed shared:bottom-0 shared:left-0 shared:right-0 shared:low-end-device:duration-0! shared:mid-device:duration-75! shared:low-end-device:animation-duration-[0s]! shared:mid-device:animation-duration-[100ms]!", className), children });
|
|
119
120
|
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
120
|
-
return /* @__PURE__ */ jsx(DialogContent, { style, className: cn("shared:low-end-device:duration-0! shared:mid-device:duration-75! shared:low-end-device:animation-duration-[0s]! shared:mid-device:animation-duration-[100ms]!", className), "data-plugin": pluginName, showCloseButton, children });
|
|
121
|
-
return /* @__PURE__ */ jsx(SheetContent, { style, className: cn("shared:low-end-device:duration-0! shared:mid-device:duration-75! shared:low-end-device:animation-duration-[0s]! shared:mid-device:animation-duration-[100ms]!", className), "data-plugin": pluginName, showCloseButton, children });
|
|
121
|
+
return /* @__PURE__ */ jsx(DialogContent, { style, className: cn("shared:low-end-device:duration-0! shared:mid-device:duration-75! shared:low-end-device:animation-duration-[0s]! shared:mid-device:animation-duration-[100ms]!", className), "data-plugin": pluginName, ...macrosSlot("responsive-dialog-content"), showCloseButton, children });
|
|
122
|
+
return /* @__PURE__ */ jsx(SheetContent, { style, className: cn("shared:low-end-device:duration-0! shared:mid-device:duration-75! shared:low-end-device:animation-duration-[0s]! shared:mid-device:animation-duration-[100ms]!", className), "data-plugin": pluginName, ...macrosSlot("responsive-dialog-content"), showCloseButton, children });
|
|
122
123
|
}
|
|
123
124
|
function ResponsiveTrigger({ children, className, pluginName }) {
|
|
124
125
|
const dialog = useDialogType();
|
|
125
|
-
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerTrigger, { asChild: true, "data-plugin": pluginName, className, children });
|
|
126
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerTrigger, { asChild: true, "data-plugin": pluginName, ...macrosSlot("responsive-dialog-trigger"), className, children });
|
|
126
127
|
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
127
|
-
return /* @__PURE__ */ jsx(DialogTrigger, { asChild: true, "data-plugin": pluginName, className, children });
|
|
128
|
-
return /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, "data-plugin": pluginName, className, children });
|
|
128
|
+
return /* @__PURE__ */ jsx(DialogTrigger, { asChild: true, "data-plugin": pluginName, ...macrosSlot("responsive-dialog-trigger"), className, children });
|
|
129
|
+
return /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, "data-plugin": pluginName, ...macrosSlot("responsive-dialog-trigger"), className, children });
|
|
129
130
|
}
|
|
130
131
|
function ResponsiveDescription({ children, className, pluginName }) {
|
|
131
132
|
const dialog = useDialogType();
|
|
132
|
-
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerDescription, { className, children });
|
|
133
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerDescription, { className, "data-plugin": pluginName, ...macrosSlot("responsive-dialog-description"), children });
|
|
133
134
|
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
134
|
-
return /* @__PURE__ */ jsx(DialogDescription, { asChild: true, "data-plugin": pluginName, className, children });
|
|
135
|
-
return /* @__PURE__ */ jsx(SheetDescription, { asChild: true, "data-plugin": pluginName, className, children });
|
|
135
|
+
return /* @__PURE__ */ jsx(DialogDescription, { asChild: true, "data-plugin": pluginName, ...macrosSlot("responsive-dialog-description"), className, children });
|
|
136
|
+
return /* @__PURE__ */ jsx(SheetDescription, { asChild: true, "data-plugin": pluginName, ...macrosSlot("responsive-dialog-description"), className, children });
|
|
136
137
|
}
|
|
137
138
|
function ResponsiveFooter({ children, className, pluginName }) {
|
|
138
139
|
const dialog = useDialogType();
|
|
139
|
-
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerFooter, { "data-plugin": pluginName, className, children });
|
|
140
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerFooter, { "data-plugin": pluginName, ...macrosSlot("responsive-dialog-footer"), className, children });
|
|
140
141
|
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
141
|
-
return /* @__PURE__ */ jsx(DialogFooter, { "data-plugin": pluginName, className, children });
|
|
142
|
-
return /* @__PURE__ */ jsx(SheetFooter, { "data-plugin": pluginName, className, children });
|
|
142
|
+
return /* @__PURE__ */ jsx(DialogFooter, { "data-plugin": pluginName, ...macrosSlot("responsive-dialog-footer"), className, children });
|
|
143
|
+
return /* @__PURE__ */ jsx(SheetFooter, { "data-plugin": pluginName, ...macrosSlot("responsive-dialog-footer"), className, children });
|
|
143
144
|
}
|
|
144
145
|
function ResponsiveOverlay({ children, className, pluginName }) {
|
|
145
146
|
const dialog = useDialogType();
|
|
146
|
-
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerOverlay, { "data-plugin": pluginName, className, children });
|
|
147
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerOverlay, { "data-plugin": pluginName, ...macrosSlot("responsive-dialog-overlay"), className, children });
|
|
147
148
|
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
148
|
-
return /* @__PURE__ */ jsx(DialogOverlay, { "data-plugin": pluginName, className, children });
|
|
149
|
-
return /* @__PURE__ */ jsx(SheetOverlay, { "data-plugin": pluginName, className, children });
|
|
149
|
+
return /* @__PURE__ */ jsx(DialogOverlay, { "data-plugin": pluginName, ...macrosSlot("responsive-dialog-overlay"), className, children });
|
|
150
|
+
return /* @__PURE__ */ jsx(SheetOverlay, { "data-plugin": pluginName, ...macrosSlot("responsive-dialog-overlay"), className, children });
|
|
150
151
|
}
|
|
151
152
|
export {
|
|
152
153
|
DesktopDialogType,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
3
4
|
import { forwardRef, useRef } from "react";
|
|
4
5
|
const InfiniteScrollableDiv = forwardRef(
|
|
5
6
|
({
|
|
@@ -68,6 +69,7 @@ const InfiniteScrollableDiv = forwardRef(
|
|
|
68
69
|
"div",
|
|
69
70
|
{
|
|
70
71
|
ref: setRef,
|
|
72
|
+
...macrosSlot("infinite-scroll"),
|
|
71
73
|
onScroll: onScrollEvt,
|
|
72
74
|
onTouchStart: handleTouchStart,
|
|
73
75
|
onTouchMove: handleTouchMove,
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "clsx";
|
|
3
|
+
import "tailwind-merge";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
2
5
|
function SettingCardFooter({ children }) {
|
|
3
|
-
return /* @__PURE__ */ jsx("div", { className: "shared:text-[0.8rem] shared:opacity-65", children });
|
|
6
|
+
return /* @__PURE__ */ jsx("div", { ...macrosSlot("setting-card-footer"), className: "shared:text-[0.8rem] shared:opacity-65", children });
|
|
4
7
|
}
|
|
5
8
|
function SettingCardHeader({ children }) {
|
|
6
|
-
return /* @__PURE__ */ jsx("div", { className: "shared:flex shared:flex-col", children });
|
|
9
|
+
return /* @__PURE__ */ jsx("div", { ...macrosSlot("setting-card-header"), className: "shared:flex shared:flex-col", children });
|
|
7
10
|
}
|
|
8
11
|
function SettingSectionTitle({ children }) {
|
|
9
|
-
return /* @__PURE__ */ jsx("h4", { className: "shared:font-bold shared:text-primary shared:sticky shared:top-0 shared:p-3 shared:bg-muted shared:z-2", children });
|
|
12
|
+
return /* @__PURE__ */ jsx("h4", { ...macrosSlot("setting-section-title"), className: "shared:font-bold shared:text-primary shared:sticky shared:top-0 shared:p-3 shared:bg-muted shared:z-2", children });
|
|
10
13
|
}
|
|
11
14
|
function SettingCardContent({ children }) {
|
|
12
|
-
return /* @__PURE__ */ jsx("div", { className: "shared:flex shared:flex-col shared:gap-1", children });
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { ...macrosSlot("setting-card-content"), className: "shared:flex shared:flex-col shared:gap-1", children });
|
|
13
16
|
}
|
|
14
17
|
function SettingCard({ children }) {
|
|
15
|
-
return /* @__PURE__ */ jsx("div", { className: "shared:px-3 shared:py-4 shared:gap-3 shared:flex shared:flex-col shared:border shared:rounded-2xl shared:border-black/5", children });
|
|
18
|
+
return /* @__PURE__ */ jsx("div", { ...macrosSlot("setting-card"), className: "shared:px-3 shared:py-4 shared:gap-3 shared:flex shared:flex-col shared:border shared:rounded-2xl shared:border-black/5", children });
|
|
16
19
|
}
|
|
17
20
|
function SettingCardTitle({ children }) {
|
|
18
|
-
return /* @__PURE__ */ jsx("div", { className: "shared:font-bold shared:text-[1.1rem]", children });
|
|
21
|
+
return /* @__PURE__ */ jsx("div", { ...macrosSlot("setting-card-title"), className: "shared:font-bold shared:text-[1.1rem]", children });
|
|
19
22
|
}
|
|
20
23
|
function SettingCardSubtitle({ children }) {
|
|
21
|
-
return /* @__PURE__ */ jsx("div", { className: "shared:text-[0.8rem] shared:opacity-65", children });
|
|
24
|
+
return /* @__PURE__ */ jsx("div", { ...macrosSlot("setting-card-subtitle"), className: "shared:text-[0.8rem] shared:opacity-65", children });
|
|
22
25
|
}
|
|
23
26
|
function SettingCardLabel({ children }) {
|
|
24
|
-
return /* @__PURE__ */ jsx("div", { className: "shared:font-bold shared:text-[0.9rem]", children });
|
|
27
|
+
return /* @__PURE__ */ jsx("div", { ...macrosSlot("setting-card-label"), className: "shared:font-bold shared:text-[0.9rem]", children });
|
|
25
28
|
}
|
|
26
29
|
function SettingSection({ children, hyperLink }) {
|
|
27
|
-
return /* @__PURE__ */ jsx("div", { id: hyperLink, className: "shared:flex shared:flex-col shared:gap-[1rem] shared:h-max", children });
|
|
30
|
+
return /* @__PURE__ */ jsx("div", { id: hyperLink, ...macrosSlot("setting-section"), className: "shared:flex shared:flex-col shared:gap-[1rem] shared:h-max", children });
|
|
28
31
|
}
|
|
29
32
|
export {
|
|
30
33
|
SettingCard,
|
|
@@ -2,12 +2,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
4
4
|
import { ChevronDown } from "lucide-react";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
const Accordion = AccordionPrimitive.Root;
|
|
7
8
|
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8
9
|
AccordionPrimitive.Item,
|
|
9
10
|
{
|
|
10
11
|
ref,
|
|
12
|
+
...macrosSlot("accordion-item"),
|
|
11
13
|
className: cn("shared:border-b", className),
|
|
12
14
|
...props
|
|
13
15
|
}
|
|
@@ -17,6 +19,7 @@ const AccordionTrigger = React.forwardRef(({ className, children, ...props }, re
|
|
|
17
19
|
AccordionPrimitive.Trigger,
|
|
18
20
|
{
|
|
19
21
|
ref,
|
|
22
|
+
...macrosSlot("accordion-trigger"),
|
|
20
23
|
className: cn(
|
|
21
24
|
"shared:flex shared:flex-1 shared:items-center shared:justify-between shared:py-4 shared:text-sm shared:font-medium shared:transition-all shared:hover:underline shared:text-left shared:[&[data-state=open]>svg]:rotate-180",
|
|
22
25
|
className
|
|
@@ -33,6 +36,7 @@ const AccordionContent = React.forwardRef(({ className, children, ...props }, re
|
|
|
33
36
|
AccordionPrimitive.Content,
|
|
34
37
|
{
|
|
35
38
|
ref,
|
|
39
|
+
...macrosSlot("accordion-content"),
|
|
36
40
|
className: "shared:overflow-hidden shared:text-sm shared:data-[state=closed]:animate-accordion-up shared:data-[state=open]:animate-accordion-down",
|
|
37
41
|
...props,
|
|
38
42
|
children: /* @__PURE__ */ jsx("div", { className: cn("shared:pb-4 shared:pt-0", className), children })
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
import { Button } from "./button.js";
|
|
6
7
|
function AlertDialog({
|
|
@@ -11,7 +12,7 @@ function AlertDialog({
|
|
|
11
12
|
function AlertDialogTrigger({
|
|
12
13
|
...props
|
|
13
14
|
}) {
|
|
14
|
-
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Trigger, { "
|
|
15
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Trigger, { ...macrosSlot("alert-dialog-trigger"), ...props });
|
|
15
16
|
}
|
|
16
17
|
function AlertDialogPortal({
|
|
17
18
|
...props
|
|
@@ -25,7 +26,7 @@ function AlertDialogOverlay({
|
|
|
25
26
|
return /* @__PURE__ */ jsx(
|
|
26
27
|
AlertDialogPrimitive.Overlay,
|
|
27
28
|
{
|
|
28
|
-
"
|
|
29
|
+
...macrosSlot("alert-dialog-overlay"),
|
|
29
30
|
className: cn(
|
|
30
31
|
"shared:data-[state=open]:animate-in shared:data-[state=closed]:animate-out shared:data-[state=closed]:fade-out-0 shared:data-[state=open]:fade-in-0 shared:fixed shared:inset-0 shared:z-50 shared:bg-black/50",
|
|
31
32
|
className
|
|
@@ -44,7 +45,7 @@ function AlertDialogContent({
|
|
|
44
45
|
/* @__PURE__ */ jsx(
|
|
45
46
|
AlertDialogPrimitive.Content,
|
|
46
47
|
{
|
|
47
|
-
"
|
|
48
|
+
...macrosSlot("alert-dialog-content"),
|
|
48
49
|
"data-size": size,
|
|
49
50
|
className: cn(
|
|
50
51
|
"shared:bg-background shared:data-[state=open]:animate-in shared:data-[state=closed]:animate-out shared:data-[state=closed]:fade-out-0 shared:data-[state=open]:fade-in-0 shared:data-[state=closed]:zoom-out-95 shared:data-[state=open]:zoom-in-95 shared:group/alert-dialog-content shared:fixed shared:top-[50%] shared:left-[50%] shared:z-50 shared:grid shared:w-full shared:max-w-[calc(100%-2rem)] shared:translate-x-[-50%] shared:translate-y-[-50%] shared:gap-4 shared:rounded-3xl shared:cupertino-corner shared:border shared:p-6 shared:shadow-lg shared:duration-200 shared:data-[size=sm]:max-w-xs shared:data-[size=default]:sm:max-w-lg",
|
|
@@ -141,7 +142,7 @@ function AlertDialogAction({
|
|
|
141
142
|
return /* @__PURE__ */ jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsx(
|
|
142
143
|
AlertDialogPrimitive.Action,
|
|
143
144
|
{
|
|
144
|
-
"
|
|
145
|
+
...macrosSlot("alert-dialog-action"),
|
|
145
146
|
className: cn(className),
|
|
146
147
|
...props
|
|
147
148
|
}
|
|
@@ -156,7 +157,7 @@ function AlertDialogCancel({
|
|
|
156
157
|
return /* @__PURE__ */ jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsx(
|
|
157
158
|
AlertDialogPrimitive.Cancel,
|
|
158
159
|
{
|
|
159
|
-
"
|
|
160
|
+
...macrosSlot("alert-dialog-cancel"),
|
|
160
161
|
className: cn(className),
|
|
161
162
|
...props
|
|
162
163
|
}
|
|
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
import { MoreHorizontal, ChevronRight } from "lucide-react";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
const Breadcrumb = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
7
8
|
Breadcrumb.displayName = "Breadcrumb";
|
|
@@ -32,6 +33,7 @@ const BreadcrumbLink = React.forwardRef(({ asChild, className, ...props }, ref)
|
|
|
32
33
|
Comp,
|
|
33
34
|
{
|
|
34
35
|
ref,
|
|
36
|
+
...macrosSlot("breadcrumb-link"),
|
|
35
37
|
className: cn("shared:transition-colors shared:hover:text-foreground", className),
|
|
36
38
|
...props
|
|
37
39
|
}
|
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
const buttonVariants = cva(
|
|
7
8
|
"shared:inline-flex shared:items-center shared:justify-center shared:gap-2 shared:whitespace-nowrap shared:cupertino-corner shared:rounded-full shared:text-md shared:md:text-sm shared:font-medium shared:transition-all shared:cursor-pointer shared:disabled:cursor-not-allowed shared:disabled:pointer-events-none shared:disabled:opacity-50 shared:[&_svg]:pointer-events-none shared:[&_svg:not([class*='size-'])]:size-4 shared:shrink-0 shared:[&_svg]:shrink-0 shared:outline-none shared:focus-visible:border-ring shared:focus-visible:ring-ring/50 shared:focus-visible:ring-[3px] shared:aria-invalid:ring-destructive/20 shared:dark:aria-invalid:ring-destructive/40 shared:aria-invalid:border-destructive",
|
|
@@ -45,7 +46,7 @@ function Button({
|
|
|
45
46
|
return /* @__PURE__ */ jsx(
|
|
46
47
|
Comp,
|
|
47
48
|
{
|
|
48
|
-
"
|
|
49
|
+
...macrosSlot("button"),
|
|
49
50
|
className: cn(buttonVariants({ variant, size, className })),
|
|
50
51
|
...props
|
|
51
52
|
}
|
|
@@ -2,6 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from "lucide-react";
|
|
4
4
|
import { getDefaultClassNames, DayPicker } from "react-day-picker";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
import { Button, buttonVariants } from "./button.js";
|
|
7
8
|
import { Popover, PopoverTrigger, PopoverContent } from "./popover.js";
|
|
@@ -300,7 +301,7 @@ function Calendar({
|
|
|
300
301
|
return /* @__PURE__ */ jsx(
|
|
301
302
|
"div",
|
|
302
303
|
{
|
|
303
|
-
"
|
|
304
|
+
...macrosSlot("calendar"),
|
|
304
305
|
ref: rootRef,
|
|
305
306
|
className: cn(className2),
|
|
306
307
|
...props2
|
|
@@ -382,6 +383,7 @@ function CalendarDayButton({
|
|
|
382
383
|
ref,
|
|
383
384
|
variant: "ghost",
|
|
384
385
|
size: "icon",
|
|
386
|
+
...macrosSlot("calendar"),
|
|
385
387
|
"data-day": day.date.toLocaleDateString(),
|
|
386
388
|
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
387
389
|
"data-range-start": modifiers.range_start,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as RechartsPrimitive from "recharts";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
const THEMES = { light: "", dark: ".dark" };
|
|
6
7
|
const ChartContext = React.createContext(null);
|
|
@@ -17,6 +18,7 @@ const ChartContainer = React.forwardRef(({ id, className, children, config, ...p
|
|
|
17
18
|
return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
|
|
18
19
|
"div",
|
|
19
20
|
{
|
|
21
|
+
...macrosSlot("chart"),
|
|
20
22
|
"data-chart": chartId,
|
|
21
23
|
ref,
|
|
22
24
|
className: cn(
|
|
@@ -2,11 +2,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
4
|
import { Check } from "lucide-react";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
const Checkbox = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
8
|
CheckboxPrimitive.Root,
|
|
8
9
|
{
|
|
9
10
|
ref,
|
|
11
|
+
...macrosSlot("checkbox"),
|
|
10
12
|
className: cn(
|
|
11
13
|
"shared:grid shared:place-content-center shared:cursor-pointer shared:disabled:cursor-not-allowed shared:peer shared:h-4 shared:w-4 shared:shrink-0 shared:rounded-sm shared:border shared:border-primary shared:shadow shared:focus-visible:outline-none shared:focus-visible:ring-1 shared:focus-visible:ring-ring shared:disabled:opacity-50 shared:data-[state=checked]:bg-primary shared:data-[state=checked]:text-primary-foreground",
|
|
12
14
|
className
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
1
3
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
2
5
|
const Collapsible = CollapsiblePrimitive.Root;
|
|
3
|
-
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
4
|
-
|
|
6
|
+
const CollapsibleTrigger = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleTrigger, { ref, ...macrosSlot("collapsible-trigger"), ...props }));
|
|
7
|
+
CollapsibleTrigger.displayName = CollapsiblePrimitive.CollapsibleTrigger.displayName;
|
|
8
|
+
const CollapsibleContent = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleContent, { ref, ...macrosSlot("collapsible-content"), ...props }));
|
|
9
|
+
CollapsibleContent.displayName = CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
5
10
|
export {
|
|
6
11
|
Collapsible,
|
|
7
12
|
CollapsibleContent,
|
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import "@radix-ui/react-dialog";
|
|
4
4
|
import { Command as Command$1 } from "cmdk";
|
|
5
5
|
import { Search } from "lucide-react";
|
|
6
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
6
7
|
import { cn } from "../../lib/utils.js";
|
|
7
8
|
import { Dialog, DialogContent } from "./dialog.js";
|
|
8
9
|
const Command = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
@@ -26,6 +27,7 @@ const CommandInput = React.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
26
27
|
Command$1.Input,
|
|
27
28
|
{
|
|
28
29
|
ref,
|
|
30
|
+
...macrosSlot("command-input"),
|
|
29
31
|
className: cn(
|
|
30
32
|
"shared:flex shared:h-10 md:shared:h-12 shared:w-full shared:rounded-md shared:bg-transparent shared:py-3 shared:text-sm shared:outline-none shared:placeholder:text-muted-foreground shared:disabled:cursor-not-allowed shared:disabled:opacity-50",
|
|
31
33
|
className
|
|
@@ -39,6 +41,7 @@ const CommandList = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
39
41
|
Command$1.List,
|
|
40
42
|
{
|
|
41
43
|
ref,
|
|
44
|
+
...macrosSlot("command-list"),
|
|
42
45
|
className: cn("shared:max-h-[300px] shared:overflow-y-auto shared:overflow-x-hidden shared:scrollbar-thin shared:scrollbar-thumb-muted shared:flex-1 shared:touch-auto", className),
|
|
43
46
|
...props
|
|
44
47
|
}
|
|
@@ -78,6 +81,7 @@ const CommandItem = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
78
81
|
Command$1.Item,
|
|
79
82
|
{
|
|
80
83
|
ref,
|
|
84
|
+
...macrosSlot("command-item"),
|
|
81
85
|
className: cn(
|
|
82
86
|
"shared:relative shared:flex shared:cursor-default shared:gap-2 shared:select-none shared:items-center shared:rounded-2xl shared:cupertino-corner shared:px-2 shared:py-1.5 shared:text-sm shared:outline-none shared:transition-colors shared:focus:bg-accent shared:focus:text-accent-foreground shared:data-[disabled=true]:pointer-events-none shared:data-[selected=true]:bg-accent shared:data-[selected=true]:text-accent-foreground shared:data-[disabled=true]:opacity-50 shared:[&_svg]:pointer-events-none shared:[&_svg]:size-4 shared:[&_svg]:shrink-0",
|
|
83
87
|
className
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
4
4
|
import { ChevronRight, Check, Circle } from "lucide-react";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
const ContextMenu = ContextMenuPrimitive.Root;
|
|
7
|
-
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
8
|
+
const ContextMenuTrigger = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, { ref, ...macrosSlot("context-menu-trigger"), ...props }));
|
|
9
|
+
ContextMenuTrigger.displayName = ContextMenuPrimitive.Trigger.displayName;
|
|
8
10
|
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
9
11
|
const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
10
12
|
const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
@@ -13,6 +15,7 @@ const ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ..
|
|
|
13
15
|
ContextMenuPrimitive.SubTrigger,
|
|
14
16
|
{
|
|
15
17
|
ref,
|
|
18
|
+
...macrosSlot("context-menu-sub-trigger"),
|
|
16
19
|
className: cn(
|
|
17
20
|
"shared:flex shared:cursor-default shared:select-none shared:items-center shared:rounded-sm shared:px-2 shared:py-1.5 shared:text-sm shared:outline-none shared:focus:bg-accent shared:focus:text-accent-foreground shared:data-[state=open]:bg-accent shared:data-[state=open]:text-accent-foreground",
|
|
18
21
|
inset && "shared:pl-8",
|
|
@@ -30,6 +33,7 @@ const ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) =>
|
|
|
30
33
|
ContextMenuPrimitive.SubContent,
|
|
31
34
|
{
|
|
32
35
|
ref,
|
|
36
|
+
...macrosSlot("context-menu-sub-content"),
|
|
33
37
|
className: cn(
|
|
34
38
|
"shared:z-50 shared:min-w-[8rem] shared:overflow-hidden shared:rounded-md shared:border shared:bg-popover shared:p-1 shared:text-popover-foreground shared:shadow-lg shared:data-[state=open]:animate-in shared:data-[state=closed]:animate-out shared:data-[state=closed]:fade-out-0 shared:data-[state=open]:fade-in-0 shared:data-[state=closed]:zoom-out-95 shared:data-[state=open]:zoom-in-95 shared:data-[side=bottom]:slide-in-from-top-2 shared:data-[side=left]:slide-in-from-right-2 shared:data-[side=right]:slide-in-from-left-2 shared:data-[side=top]:slide-in-from-bottom-2 shared:origin-[--radix-context-menu-content-transform-origin]",
|
|
35
39
|
className
|
|
@@ -42,6 +46,7 @@ const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => /*
|
|
|
42
46
|
ContextMenuPrimitive.Content,
|
|
43
47
|
{
|
|
44
48
|
ref,
|
|
49
|
+
...macrosSlot("context-menu-content"),
|
|
45
50
|
className: cn(
|
|
46
51
|
"shared:z-50 shared:max-h-[--radix-context-menu-content-available-height] shared:min-w-[8rem] shared:overflow-y-auto shared:overflow-x-hidden shared:rounded-md shared:border shared:bg-popover shared:p-1 shared:text-popover-foreground shared:shadow-md shared:data-[state=open]:animate-in shared:data-[state=closed]:animate-out shared:data-[state=closed]:fade-out-0 shared:data-[state=open]:fade-in-0 shared:data-[state=closed]:zoom-out-95 shared:data-[state=open]:zoom-in-95 shared:data-[side=bottom]:slide-in-from-top-2 shared:data-[side=left]:slide-in-from-right-2 shared:data-[side=right]:slide-in-from-left-2 shared:data-[side=top]:slide-in-from-bottom-2 shared:origin-[--radix-context-menu-content-transform-origin]",
|
|
47
52
|
className
|
|
@@ -54,6 +59,7 @@ const ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
54
59
|
ContextMenuPrimitive.Item,
|
|
55
60
|
{
|
|
56
61
|
ref,
|
|
62
|
+
...macrosSlot("context-menu-item"),
|
|
57
63
|
className: cn(
|
|
58
64
|
"shared:relative shared:flex shared:cursor-default shared:select-none shared:items-center shared:rounded-sm shared:px-2 shared:py-1.5 shared:text-sm shared:outline-none shared:focus:bg-accent shared:focus:text-accent-foreground shared:data-[disabled]:pointer-events-none shared:data-[disabled]:opacity-50",
|
|
59
65
|
inset && "shared:pl-8",
|
|
@@ -67,6 +73,7 @@ const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked
|
|
|
67
73
|
ContextMenuPrimitive.CheckboxItem,
|
|
68
74
|
{
|
|
69
75
|
ref,
|
|
76
|
+
...macrosSlot("context-menu-checkbox-item"),
|
|
70
77
|
className: cn(
|
|
71
78
|
"shared:relative shared:flex shared:cursor-default shared:select-none shared:items-center shared:rounded-sm shared:py-1.5 shared:pl-8 shared:pr-2 shared:text-sm shared:outline-none shared:focus:bg-accent shared:focus:text-accent-foreground shared:data-[disabled]:pointer-events-none shared:data-[disabled]:opacity-50",
|
|
72
79
|
className
|
|
@@ -84,6 +91,7 @@ const ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }
|
|
|
84
91
|
ContextMenuPrimitive.RadioItem,
|
|
85
92
|
{
|
|
86
93
|
ref,
|
|
94
|
+
...macrosSlot("context-menu-radio-item"),
|
|
87
95
|
className: cn(
|
|
88
96
|
"shared:relative shared:flex shared:cursor-default shared:select-none shared:items-center shared:rounded-sm shared:py-1.5 shared:pl-8 shared:pr-2 shared:text-sm shared:outline-none shared:focus:bg-accent shared:focus:text-accent-foreground shared:data-[disabled]:pointer-events-none shared:data-[disabled]:opacity-50",
|
|
89
97
|
className
|
|
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
4
|
import { XIcon } from "lucide-react";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
function Dialog({
|
|
7
8
|
...props
|
|
@@ -11,7 +12,7 @@ function Dialog({
|
|
|
11
12
|
function DialogTrigger({
|
|
12
13
|
...props
|
|
13
14
|
}) {
|
|
14
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "
|
|
15
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ...macrosSlot("dialog-trigger"), ...props });
|
|
15
16
|
}
|
|
16
17
|
function DialogPortal({
|
|
17
18
|
...props
|
|
@@ -21,7 +22,7 @@ function DialogPortal({
|
|
|
21
22
|
function DialogClose({
|
|
22
23
|
...props
|
|
23
24
|
}) {
|
|
24
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "
|
|
25
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...macrosSlot("dialog-close"), ...props });
|
|
25
26
|
}
|
|
26
27
|
function DialogOverlay({
|
|
27
28
|
className,
|
|
@@ -30,7 +31,7 @@ function DialogOverlay({
|
|
|
30
31
|
return /* @__PURE__ */ jsx(
|
|
31
32
|
DialogPrimitive.Overlay,
|
|
32
33
|
{
|
|
33
|
-
"
|
|
34
|
+
...macrosSlot("dialog-overlay"),
|
|
34
35
|
className: cn(
|
|
35
36
|
"shared:data-[state=open]:animate-in shared:data-[state=closed]:animate-out shared:data-[state=closed]:fade-out-0 shared:data-[state=open]:fade-in-0 shared:fixed shared:inset-0 shared:z-50 shared:bg-black/50",
|
|
36
37
|
className
|
|
@@ -50,7 +51,7 @@ function DialogContent({
|
|
|
50
51
|
/* @__PURE__ */ jsxs(
|
|
51
52
|
DialogPrimitive.Content,
|
|
52
53
|
{
|
|
53
|
-
"
|
|
54
|
+
...macrosSlot("dialog-content"),
|
|
54
55
|
className: cn(
|
|
55
56
|
"shared:bg-(--dialog-background) shared:data-[state=open]:animate-in shared:data-[state=closed]:animate-out shared:data-[state=closed]:fade-out-0 shared:data-[state=open]:fade-in-0 shared:data-[state=closed]:zoom-out-95 shared:data-[state=open]:zoom-in-95 shared:fixed shared:top-[50%] shared:left-[50%] shared:z-50 shared:grid shared:w-full shared:max-w-[calc(100%-2rem)] shared:translate-x-[-50%] shared:translate-y-[-50%] shared:gap-4 shared:rounded-3xl shared:cupertino-corner shared:p-6 shared:shadow-lg shared:duration-200 shared:sm:max-w-lg",
|
|
56
57
|
className
|
|
@@ -61,7 +62,7 @@ function DialogContent({
|
|
|
61
62
|
showCloseButton && /* @__PURE__ */ jsxs(
|
|
62
63
|
DialogPrimitive.Close,
|
|
63
64
|
{
|
|
64
|
-
"
|
|
65
|
+
...macrosSlot("dialog-close"),
|
|
65
66
|
className: "shared:p-2 shared:bg-muted shared:rounded-full shared:ring-offset-background shared:focus:ring-ring shared:data-[state=open]:bg-accent shared:data-[state=open]:text-muted-foreground shared:absolute shared:top-4 shared:right-4 shared:opacity-70 shared:transition-opacity shared:hover:opacity-100 shared:focus:ring-2 shared:focus:ring-offset-2 shared:focus:outline-hidden shared:disabled:pointer-events-none shared:[&_svg]:pointer-events-none shared:[&_svg]:shrink-0 shared:[&_svg:not([class*='size-'])]:size-5 shared:cursor-pointer",
|
|
66
67
|
children: [
|
|
67
68
|
/* @__PURE__ */ jsx(XIcon, {}),
|
|
@@ -90,7 +91,7 @@ function DialogFooter({ className, ...props }) {
|
|
|
90
91
|
{
|
|
91
92
|
"data-slot": "dialog-footer",
|
|
92
93
|
className: cn(
|
|
93
|
-
"shared:flex shared:flex-col-reverse shared:gap-2 shared:sm:flex-row shared:sm:justify-end",
|
|
94
|
+
"shared:flex shared:p-0 shared:flex-col-reverse shared:gap-2 shared:sm:flex-row shared:sm:justify-end",
|
|
94
95
|
className
|
|
95
96
|
),
|
|
96
97
|
...props
|