@quan-erp/shared-ui 1.0.11 → 1.1.1
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,6 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
|
-
declare const Collapsible:
|
|
3
|
-
declare const CollapsibleTrigger:
|
|
4
|
-
declare const CollapsibleContent:
|
|
3
|
+
declare const Collapsible: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CollapsibleTrigger: React.ForwardRefExoticComponent<Omit<CollapsiblePrimitive.CollapsibleTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const CollapsibleContent: React.ForwardRefExoticComponent<Omit<CollapsiblePrimitive.CollapsibleContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
6
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
6
7
|
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
3
3
|
declare const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
|
|
4
|
-
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
5
5
|
declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
declare const ContextMenuPortal: React.FC<ContextMenuPrimitive.ContextMenuPortalProps>;
|
|
7
7
|
declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
|
|
@@ -4,9 +4,9 @@ declare const Drawer: {
|
|
|
4
4
|
({ shouldScaleBackground, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
|
-
declare const DrawerTrigger: React.ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DrawerTrigger: React.ForwardRefExoticComponent<Omit<import('@radix-ui/react-dialog').DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
declare const DrawerPortal: typeof import('vaul').Portal;
|
|
9
|
-
declare const DrawerClose: React.ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const DrawerClose: React.ForwardRefExoticComponent<Omit<import('@radix-ui/react-dialog').DialogCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
10
|
declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-dialog').DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-dialog').DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const DrawerHeader: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
3
|
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
-
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
7
|
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3
3
|
declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
|
|
4
|
-
declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
4
|
+
declare const HoverCardTrigger: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
5
5
|
declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
7
7
|
//# sourceMappingURL=hover-card.d.ts.map
|
|
@@ -6,7 +6,7 @@ declare const NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenu
|
|
|
6
6
|
declare const navigationMenuTriggerStyle: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
7
7
|
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
9
|
+
declare const NavigationMenuLink: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
10
|
declare const NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
3
|
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
-
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
3
|
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
4
4
|
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
declare const SelectValue: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
6
6
|
declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction } from "../ui/alert-dialog.js";
|
|
3
|
+
import "clsx";
|
|
4
|
+
import "tailwind-merge";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
3
6
|
import "react";
|
|
4
7
|
import "react-dom/client";
|
|
5
8
|
function ConfirmDialog({
|
|
@@ -8,16 +11,26 @@ function ConfirmDialog({
|
|
|
8
11
|
onClose,
|
|
9
12
|
onConfirm
|
|
10
13
|
}) {
|
|
11
|
-
return /* @__PURE__ */ jsx(AlertDialog, { open, onOpenChange: (next) => !next && onClose(false), children: /* @__PURE__ */ jsxs(AlertDialogContent, { children: [
|
|
12
|
-
/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [
|
|
13
|
-
/* @__PURE__ */ jsx(AlertDialogTitle, { children: options.title ?? "Are you sure?" }),
|
|
14
|
-
/* @__PURE__ */ jsx(AlertDialogDescription, { children: options.description ?? "This action cannot be undone." })
|
|
14
|
+
return /* @__PURE__ */ jsx(AlertDialog, { open, onOpenChange: (next) => !next && onClose(false), children: /* @__PURE__ */ jsxs(AlertDialogContent, { ...macrosSlot("confirm-dialog"), children: [
|
|
15
|
+
/* @__PURE__ */ jsxs(AlertDialogHeader, { ...macrosSlot("confirm-dialog-header"), children: [
|
|
16
|
+
/* @__PURE__ */ jsx(AlertDialogTitle, { ...macrosSlot("confirm-dialog-title"), children: options.title ?? "Are you sure?" }),
|
|
17
|
+
/* @__PURE__ */ jsx(AlertDialogDescription, { ...macrosSlot("confirm-dialog-description"), children: options.description ?? "This action cannot be undone." })
|
|
15
18
|
] }),
|
|
16
|
-
/* @__PURE__ */ jsxs(AlertDialogFooter, { className: "shared:flex shared:gap-2 shared:flex-row shared:justify-end", children: [
|
|
17
|
-
/* @__PURE__ */ jsx(
|
|
19
|
+
/* @__PURE__ */ jsxs(AlertDialogFooter, { ...macrosSlot("confirm-dialog-footer"), className: "shared:flex shared:gap-2 shared:flex-row shared:justify-end", children: [
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
AlertDialogCancel,
|
|
22
|
+
{
|
|
23
|
+
...macrosSlot("confirm-dialog-cancel"),
|
|
24
|
+
variant: "secondary",
|
|
25
|
+
className: "shared:self-end",
|
|
26
|
+
onClick: () => onClose(false),
|
|
27
|
+
children: options.cancelText ?? "Cancel"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
18
30
|
/* @__PURE__ */ jsx(
|
|
19
31
|
AlertDialogAction,
|
|
20
32
|
{
|
|
33
|
+
...macrosSlot("confirm-dialog-confirm"),
|
|
21
34
|
onClick: () => {
|
|
22
35
|
onClose(true);
|
|
23
36
|
onConfirm();
|
|
@@ -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 { useSortable } from "@dnd-kit/sortable";
|
|
4
5
|
import { CSS } from "@dnd-kit/utilities";
|
|
5
6
|
import { ApplicationTwo } from "@icon-park/react";
|
|
@@ -54,6 +55,7 @@ function DashboardItem({
|
|
|
54
55
|
},
|
|
55
56
|
style,
|
|
56
57
|
"data-plugin": pluginName || BUILTIN_PLUGIN_NAME,
|
|
58
|
+
...macrosSlot("dashboard-item"),
|
|
57
59
|
className: cn("shared:w-full shared:flex shared:flex-col shared:group shared:bg-primary/10 shared:outline-2 shared:hover:p-1 shared:hover:outline-primary/40 shared:outline-transparent shared:rounded-3xl shared:cupertino-corner shared:overflow-hidden", isDragging ? "shared:overscroll-none shared:touch-none" : "shared:transition-all shared:duration-300", wapperClassName),
|
|
58
60
|
children: [
|
|
59
61
|
/* @__PURE__ */ jsxs(
|
|
@@ -61,6 +63,7 @@ function DashboardItem({
|
|
|
61
63
|
{
|
|
62
64
|
...attributes,
|
|
63
65
|
...listeners,
|
|
66
|
+
...macrosSlot("dashboard-item-drag-handle"),
|
|
64
67
|
className: cn("shared:transition-all shared:duration-300 shared:cursor-grab shared:px-2 shared:py-2 shared:group-hover:px-2 shared:group-hover:py-2 shared:justify-between shared:font-bold shared:text-primary shared:text-sm shared:flex shared:items-center shared:gap-2 shared:overscroll-none shared:touch-none", titleClassName),
|
|
65
68
|
children: [
|
|
66
69
|
/* @__PURE__ */ jsxs("div", { className: "shared:flex shared:items-center shared:gap-2", children: [
|
|
@@ -76,7 +79,7 @@ function DashboardItem({
|
|
|
76
79
|
]
|
|
77
80
|
}
|
|
78
81
|
),
|
|
79
|
-
/* @__PURE__ */ jsx("div", { "data-plugin": pluginName, className: cn("shared:w-full shared:h-full shared:bg-background shared:rounded-2xl shared:border-2 shared:border-primary/10", className), children: visible && /* @__PURE__ */ jsx(ProtectedPage, { requiredApis: requiredApis || [], children }) })
|
|
82
|
+
/* @__PURE__ */ jsx("div", { "data-plugin": pluginName, ...macrosSlot("dashboard-item-content"), className: cn("shared:w-full shared:h-full shared:bg-background shared:rounded-2xl shared:border-2 shared:border-primary/10", className), children: visible && /* @__PURE__ */ jsx(ProtectedPage, { requiredApis: requiredApis || [], children }) })
|
|
80
83
|
]
|
|
81
84
|
}
|
|
82
85
|
);
|
|
@@ -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 "../../ui/accordion.js";
|
|
4
5
|
import "../../ui/alert.js";
|
|
5
6
|
import "../../ui/avatar.js";
|
|
@@ -19,7 +20,7 @@ import "@icon-park/react";
|
|
|
19
20
|
import "../../ui/carousel.js";
|
|
20
21
|
import "../../ui/chart.js";
|
|
21
22
|
import "../../ui/checkbox.js";
|
|
22
|
-
import "
|
|
23
|
+
import "../../ui/collapsible.js";
|
|
23
24
|
import "../../ui/command.js";
|
|
24
25
|
import "../../ui/context-menu.js";
|
|
25
26
|
import "@radix-ui/react-dialog";
|
|
@@ -68,6 +69,7 @@ function CursorBasedPagination({
|
|
|
68
69
|
return /* @__PURE__ */ jsxs(
|
|
69
70
|
"div",
|
|
70
71
|
{
|
|
72
|
+
...macrosSlot("data-table-cursor-pagination"),
|
|
71
73
|
className: cn(
|
|
72
74
|
// Keep it flex-row always to prevent stacking
|
|
73
75
|
"shared:border-border shared:bg-background/50 shared:mt-3 shared:flex shared:w-full shared:flex-row shared:items-center shared:justify-between shared:border-t shared:pt-3 shared:backdrop-blur-sm",
|
|
@@ -9,6 +9,7 @@ import { Button } from "../../ui/button.js";
|
|
|
9
9
|
import "react";
|
|
10
10
|
import { Layers, X, Zap } from "lucide-react";
|
|
11
11
|
import "react-day-picker";
|
|
12
|
+
import { macrosSlot } from "../../../lib/macros.js";
|
|
12
13
|
import { cn } from "../../../lib/utils.js";
|
|
13
14
|
import "../../ui/popover.js";
|
|
14
15
|
import "../../ui/drawer.js";
|
|
@@ -19,7 +20,7 @@ import "@icon-park/react";
|
|
|
19
20
|
import "../../ui/carousel.js";
|
|
20
21
|
import "../../ui/chart.js";
|
|
21
22
|
import "../../ui/checkbox.js";
|
|
22
|
-
import "
|
|
23
|
+
import "../../ui/collapsible.js";
|
|
23
24
|
import "../../ui/command.js";
|
|
24
25
|
import "../../ui/context-menu.js";
|
|
25
26
|
import "@radix-ui/react-dialog";
|
|
@@ -62,6 +63,7 @@ function DataTableBulkActionMenu({
|
|
|
62
63
|
return /* @__PURE__ */ jsxs(
|
|
63
64
|
"div",
|
|
64
65
|
{
|
|
66
|
+
...macrosSlot("data-table-bulk-action-menu"),
|
|
65
67
|
className: cn(
|
|
66
68
|
// Ultra-compact height (h-12 = 48px)
|
|
67
69
|
"shared:border-primary/20 shared:bg-primary/3 shared:relative shared:flex shared:min-h-12 shared:w-full shared:items-center shared:justify-between shared:gap-2 shared:rounded-xl shared:border shared:px-3 shared:py-1.5",
|
|
@@ -87,6 +89,7 @@ function DataTableBulkActionMenu({
|
|
|
87
89
|
{
|
|
88
90
|
variant: "ghost",
|
|
89
91
|
size: "sm",
|
|
92
|
+
...macrosSlot("data-table-bulk-clear"),
|
|
90
93
|
onClick: onClear,
|
|
91
94
|
className: "shared:text-muted-foreground hover:shared:bg-destructive/10 hover:shared:text-destructive shared:h-8 shared:gap-1.5 shared:rounded-lg shared:px-2 shared:text-[11px] shared:font-bold shared:transition-all",
|
|
92
95
|
children: [
|
|
@@ -9,6 +9,7 @@ import { Button } from "../../ui/button.js";
|
|
|
9
9
|
import "react";
|
|
10
10
|
import "lucide-react";
|
|
11
11
|
import "react-day-picker";
|
|
12
|
+
import { macrosSlot } from "../../../lib/macros.js";
|
|
12
13
|
import "clsx";
|
|
13
14
|
import "tailwind-merge";
|
|
14
15
|
import "../../ui/popover.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 "@radix-ui/react-dialog";
|
|
@@ -65,6 +66,7 @@ function DataTableBulkExportButton({
|
|
|
65
66
|
Button,
|
|
66
67
|
{
|
|
67
68
|
variant: "ghost",
|
|
69
|
+
...macrosSlot("data-table-bulk-export"),
|
|
68
70
|
className: "shared:h-8 shared:text-xs",
|
|
69
71
|
onClick: () => exportToCSV(selectedData, filename),
|
|
70
72
|
children: label
|
|
@@ -2,6 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { ArrowDownIcon, ArrowUpIcon, ChevronsUpDown, EyeOff } from "lucide-react";
|
|
3
3
|
import "react";
|
|
4
4
|
import { cn } from "../../../lib/utils.js";
|
|
5
|
+
import { macrosSlot } from "../../../lib/macros.js";
|
|
5
6
|
import "../../ui/accordion.js";
|
|
6
7
|
import "../../ui/alert.js";
|
|
7
8
|
import "../../ui/avatar.js";
|
|
@@ -19,7 +20,7 @@ import "@icon-park/react";
|
|
|
19
20
|
import "../../ui/carousel.js";
|
|
20
21
|
import "../../ui/chart.js";
|
|
21
22
|
import "../../ui/checkbox.js";
|
|
22
|
-
import "
|
|
23
|
+
import "../../ui/collapsible.js";
|
|
23
24
|
import "../../ui/command.js";
|
|
24
25
|
import "../../ui/context-menu.js";
|
|
25
26
|
import "@radix-ui/react-dialog";
|
|
@@ -64,6 +65,7 @@ function DataTableColumnHeader({
|
|
|
64
65
|
return /* @__PURE__ */ jsx(
|
|
65
66
|
"div",
|
|
66
67
|
{
|
|
68
|
+
...macrosSlot("data-table-column-header"),
|
|
67
69
|
className: cn("shared:flex shared:items-center shared:space-x-2 shared:whitespace-nowrap", className),
|
|
68
70
|
children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
69
71
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
@@ -71,6 +73,7 @@ function DataTableColumnHeader({
|
|
|
71
73
|
{
|
|
72
74
|
variant: "ghost",
|
|
73
75
|
size: "sm",
|
|
76
|
+
...macrosSlot("data-table-column-header-trigger"),
|
|
74
77
|
className: "data-[state=open]:shared:bg-accent shared:-ml-3 shared:h-8",
|
|
75
78
|
children: [
|
|
76
79
|
/* @__PURE__ */ jsx("span", { children: title }),
|
|
@@ -11,6 +11,7 @@ import "../../ui/button-group.js";
|
|
|
11
11
|
import "../../ui/button.js";
|
|
12
12
|
import "lucide-react";
|
|
13
13
|
import "react-day-picker";
|
|
14
|
+
import { macrosSlot } from "../../../lib/macros.js";
|
|
14
15
|
import { cn } from "../../../lib/utils.js";
|
|
15
16
|
import "../../ui/popover.js";
|
|
16
17
|
import "../../ui/drawer.js";
|
|
@@ -21,7 +22,7 @@ import "@icon-park/react";
|
|
|
21
22
|
import "../../ui/carousel.js";
|
|
22
23
|
import "../../ui/chart.js";
|
|
23
24
|
import "../../ui/checkbox.js";
|
|
24
|
-
import "
|
|
25
|
+
import "../../ui/collapsible.js";
|
|
25
26
|
import "../../ui/command.js";
|
|
26
27
|
import "../../ui/context-menu.js";
|
|
27
28
|
import "@radix-ui/react-dialog";
|
|
@@ -69,6 +70,7 @@ function DataTableBodyRow({
|
|
|
69
70
|
return /* @__PURE__ */ jsx(
|
|
70
71
|
TableRow,
|
|
71
72
|
{
|
|
73
|
+
...macrosSlot("data-table-row"),
|
|
72
74
|
className: cn(
|
|
73
75
|
"shared:group shared:transition-colors",
|
|
74
76
|
onRowClickFn && "shared:cursor-pointer",
|
|
@@ -3,6 +3,7 @@ import { flexRender } from "../../../node_modules/@tanstack/react-table/build/li
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { groupTableRowsBy } from "./group-table-rows.js";
|
|
5
5
|
import { cn } from "../../../lib/utils.js";
|
|
6
|
+
import { macrosSlot } from "../../../lib/macros.js";
|
|
6
7
|
function dataTableRowMemoPropsAreEqual(prev, next) {
|
|
7
8
|
return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.isSelected === next.isSelected && prev.onRowClickFn === next.onRowClickFn && prev.layoutKey === next.layoutKey;
|
|
8
9
|
}
|
|
@@ -31,6 +32,7 @@ function DataCard({
|
|
|
31
32
|
return /* @__PURE__ */ jsxs(
|
|
32
33
|
"div",
|
|
33
34
|
{
|
|
35
|
+
...macrosSlot("data-table-card"),
|
|
34
36
|
onClick: onRowClickFn ? handleClick : void 0,
|
|
35
37
|
className: cn(
|
|
36
38
|
"shared:group shared:border-border/40 shared:bg-card hover:shared:border-primary/40 shared:relative shared:flex shared:flex-col shared:rounded-xl shared:border shared:p-3 shared:shadow-sm shared:transition-all shared:duration-200 active:shared:scale-[0.98]",
|
|
@@ -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 "../../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 "@radix-ui/react-dialog";
|
|
@@ -76,6 +77,7 @@ function DataTablePagination({
|
|
|
76
77
|
return /* @__PURE__ */ jsxs(
|
|
77
78
|
"div",
|
|
78
79
|
{
|
|
80
|
+
...macrosSlot("data-table-pagination"),
|
|
79
81
|
className: cn(
|
|
80
82
|
// Forces flex-row on all screen sizes and prevents vertical stacking
|
|
81
83
|
"shared:border-border shared:bg-background/50 shared:mt-3 shared:flex shared:w-full shared:flex-row shared:items-center shared:justify-between shared:border-t shared:px-4 shared:py-3 shared:backdrop-blur-sm",
|
|
@@ -2,6 +2,7 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import { DataTableViewOptions } from "./data-table-view-options.js";
|
|
4
4
|
import { cn } from "../../../lib/utils.js";
|
|
5
|
+
import { macrosSlot } from "../../../lib/macros.js";
|
|
5
6
|
import "../../ui/accordion.js";
|
|
6
7
|
import "../../ui/alert.js";
|
|
7
8
|
import "../../ui/avatar.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 "@radix-ui/react-dialog";
|
|
@@ -105,6 +106,7 @@ function DataTableToolbar({
|
|
|
105
106
|
return /* @__PURE__ */ jsxs(
|
|
106
107
|
"header",
|
|
107
108
|
{
|
|
109
|
+
...macrosSlot("data-table-toolbar"),
|
|
108
110
|
className: cn(
|
|
109
111
|
"shared:flex shared:flex-row shared:items-center shared:justify-between shared:gap-4 shared:transition-all shared:duration-300 shared:ease-in-out",
|
|
110
112
|
// When hidden: slide up and fade out
|
|
@@ -7,6 +7,7 @@ import { useMediaQuery } from "../../../hooks/use-mobile.js";
|
|
|
7
7
|
import "uuid";
|
|
8
8
|
import "@quan-erp/shared-frontend-core";
|
|
9
9
|
import { cn } from "../../../lib/utils.js";
|
|
10
|
+
import { macrosSlot } from "../../../lib/macros.js";
|
|
10
11
|
import "../../ui/accordion.js";
|
|
11
12
|
import "../../ui/alert.js";
|
|
12
13
|
import "../../ui/avatar.js";
|
|
@@ -22,7 +23,7 @@ import "@icon-park/react";
|
|
|
22
23
|
import "../../ui/carousel.js";
|
|
23
24
|
import "../../ui/chart.js";
|
|
24
25
|
import { Checkbox } from "../../ui/checkbox.js";
|
|
25
|
-
import "
|
|
26
|
+
import "../../ui/collapsible.js";
|
|
26
27
|
import "../../ui/command.js";
|
|
27
28
|
import "../../ui/context-menu.js";
|
|
28
29
|
import "@radix-ui/react-dialog";
|
|
@@ -156,6 +157,7 @@ function DataTableViewOptions({
|
|
|
156
157
|
"button",
|
|
157
158
|
{
|
|
158
159
|
type: "button",
|
|
160
|
+
...macrosSlot(`data-table-view-mode-${m.id}`),
|
|
159
161
|
onPointerDown: (e) => e.preventDefault(),
|
|
160
162
|
onClick: () => setViewMode(m.id),
|
|
161
163
|
className: cn(
|
|
@@ -177,6 +179,7 @@ function DataTableViewOptions({
|
|
|
177
179
|
"input",
|
|
178
180
|
{
|
|
179
181
|
placeholder: "Filter...",
|
|
182
|
+
...macrosSlot("data-table-view-filter"),
|
|
180
183
|
value: searchTerm,
|
|
181
184
|
onChange: (e) => setSearchTerm(e.target.value),
|
|
182
185
|
onPointerDown: (e) => e.stopPropagation(),
|
|
@@ -190,6 +193,7 @@ function DataTableViewOptions({
|
|
|
190
193
|
variant: "ghost",
|
|
191
194
|
size: "icon",
|
|
192
195
|
type: "button",
|
|
196
|
+
...macrosSlot("data-table-view-toggle-all"),
|
|
193
197
|
onPointerDown: (e) => e.preventDefault(),
|
|
194
198
|
onClick: toggleAll,
|
|
195
199
|
className: "shared:h-8 shared:w-8",
|
|
@@ -203,6 +207,7 @@ function DataTableViewOptions({
|
|
|
203
207
|
{
|
|
204
208
|
variant: "outline",
|
|
205
209
|
size: "sm",
|
|
210
|
+
...macrosSlot("data-table-view-settings"),
|
|
206
211
|
className: "shared:group shared:bg-background/50 shared:relative shared:ml-auto shared:flex shared:h-8 shared:gap-2 shared:border-dashed active:shared:scale-95",
|
|
207
212
|
children: [
|
|
208
213
|
/* @__PURE__ */ jsx(Settings2, { className: "shared:text-muted-foreground shared:size-4 shared:transition-transform shared:duration-700 group-hover:shared:rotate-180" }),
|
|
@@ -249,6 +254,7 @@ function ColumnRowItem({
|
|
|
249
254
|
return /* @__PURE__ */ jsx(
|
|
250
255
|
"div",
|
|
251
256
|
{
|
|
257
|
+
...macrosSlot("data-table-column-visibility"),
|
|
252
258
|
className: cn(
|
|
253
259
|
"shared:group shared:flex shared:h-9 shared:items-center shared:rounded-md shared:px-2",
|
|
254
260
|
!isPinned && "shared:animate-in shared:slide-in-from-top-1 shared:fade-in"
|
|
@@ -291,6 +297,7 @@ function ColumnRowItem({
|
|
|
291
297
|
"button",
|
|
292
298
|
{
|
|
293
299
|
type: "button",
|
|
300
|
+
...macrosSlot("data-table-column-pin"),
|
|
294
301
|
onPointerDown: (e) => {
|
|
295
302
|
e.preventDefault();
|
|
296
303
|
e.stopPropagation();
|
|
@@ -14,6 +14,7 @@ import "@quan-erp/shared-frontend-core";
|
|
|
14
14
|
import { useScrollDirection } from "../../../hooks/use-scroll-direction.js";
|
|
15
15
|
import { EmptyState } from "../empty-screen.js";
|
|
16
16
|
import { cn } from "../../../lib/utils.js";
|
|
17
|
+
import { macrosSlot } from "../../../lib/macros.js";
|
|
17
18
|
import { PullToRefresh } from "../pull-to-refresh.js";
|
|
18
19
|
import "../../ui/accordion.js";
|
|
19
20
|
import "../../ui/alert.js";
|
|
@@ -31,7 +32,7 @@ import "@icon-park/react";
|
|
|
31
32
|
import "../../ui/carousel.js";
|
|
32
33
|
import "../../ui/chart.js";
|
|
33
34
|
import "../../ui/checkbox.js";
|
|
34
|
-
import "
|
|
35
|
+
import "../../ui/collapsible.js";
|
|
35
36
|
import "../../ui/command.js";
|
|
36
37
|
import "../../ui/context-menu.js";
|
|
37
38
|
import "@radix-ui/react-dialog";
|
|
@@ -318,6 +319,7 @@ function DataTable({
|
|
|
318
319
|
return /* @__PURE__ */ jsxs(
|
|
319
320
|
"div",
|
|
320
321
|
{
|
|
322
|
+
...macrosSlot("data-table"),
|
|
321
323
|
className: cn(
|
|
322
324
|
"shared:flex shared:h-full shared:w-full shared:flex-col shared:overflow-hidden",
|
|
323
325
|
isModal ? "lg:shared:p-3" : "",
|
|
@@ -406,7 +408,14 @@ function DataTable({
|
|
|
406
408
|
value: rowsPerPageValue,
|
|
407
409
|
onValueChange: handleRowsPerPageChange,
|
|
408
410
|
children: [
|
|
409
|
-
/* @__PURE__ */ jsx(
|
|
411
|
+
/* @__PURE__ */ jsx(
|
|
412
|
+
SelectTrigger,
|
|
413
|
+
{
|
|
414
|
+
...macrosSlot("data-table-page-size"),
|
|
415
|
+
className: "shared:h-8 shared:w-[120px]",
|
|
416
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
417
|
+
}
|
|
418
|
+
),
|
|
410
419
|
/* @__PURE__ */ jsxs(SelectContent, { children: [
|
|
411
420
|
DATA_TABLE_PAGE_SIZE_OPTIONS.map((size) => /* @__PURE__ */ jsx(SelectItem, { value: String(size), children: size }, size)),
|
|
412
421
|
/* @__PURE__ */ jsx(SelectItem, { value: "infinite", children: "Infinite" })
|
|
@@ -19,7 +19,7 @@ import "@quan-erp/shared-frontend-core";
|
|
|
19
19
|
import "../ui/carousel.js";
|
|
20
20
|
import "../ui/chart.js";
|
|
21
21
|
import "../ui/checkbox.js";
|
|
22
|
-
import "
|
|
22
|
+
import "../ui/collapsible.js";
|
|
23
23
|
import "../ui/command.js";
|
|
24
24
|
import "../ui/context-menu.js";
|
|
25
25
|
import "@radix-ui/react-dialog";
|
|
@@ -5,6 +5,7 @@ import { useMobileBackDialog } from "../../hooks/use-mobile-back-dialog.js";
|
|
|
5
5
|
import { useUserHandBehavior } from "../../hooks/use-user-hand-behavior.js";
|
|
6
6
|
import { Portal } from "./portal.js";
|
|
7
7
|
import { cn } from "../../lib/utils.js";
|
|
8
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
8
9
|
import { AnimatePresence } from "../../shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
|
|
9
10
|
import { motion } from "../../shared-ui/node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
10
11
|
const FAB_BUTTON = "FAB_BUTTON";
|
|
@@ -95,6 +96,7 @@ function FloatingActionButton({
|
|
|
95
96
|
"div",
|
|
96
97
|
{
|
|
97
98
|
"data-plugin": props.pluginName,
|
|
99
|
+
...macrosSlot("floating-action-button"),
|
|
98
100
|
className: cn(
|
|
99
101
|
"shared:absolute shared:bottom-0 shared:right-0 shared:cupertino-corner shared:transition-all shared:duration-500 shared:ease-[cubic-bezier(0.34,1.56,0.64,1)] shared:overflow-hidden shared:w-[var(--fab-width)] shared:h-[var(--fab-height)] shared:opacity-[var(--fab-opacity)] shared:pointer-events-auto",
|
|
100
102
|
adaptivePosition && props.adaptivePositionClassName ? props.adaptivePositionClassName(hand) : hand === "left" ? "shared:left-5" : "shared:right-5",
|
|
@@ -120,11 +122,19 @@ function FloatingActionButton({
|
|
|
120
122
|
function FloatingButton({ children, onClick }) {
|
|
121
123
|
const context = useContext(FloatingButtonContext);
|
|
122
124
|
if (!context) throw new Error("FloatingButton must be inside FloatingActionButton");
|
|
123
|
-
return /* @__PURE__ */ jsx(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
return /* @__PURE__ */ jsx(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
...macrosSlot("floating-action-button-trigger"),
|
|
129
|
+
className: "shared:absolute shared:left-0 shared:top-0 shared:w-full shared:h-full shared:flex shared:items-center shared:justify-center",
|
|
130
|
+
onClick: (event) => {
|
|
131
|
+
if (context.disabled) return;
|
|
132
|
+
if (context.expandable) context.setExpand(true);
|
|
133
|
+
onClick?.(event);
|
|
134
|
+
},
|
|
135
|
+
children
|
|
136
|
+
}
|
|
137
|
+
);
|
|
128
138
|
}
|
|
129
139
|
FloatingButton.typeTag = FAB_BUTTON;
|
|
130
140
|
function FloatingContainer({
|
|
@@ -177,6 +187,7 @@ function FloatingContainer({
|
|
|
177
187
|
e.stopPropagation();
|
|
178
188
|
close(e);
|
|
179
189
|
},
|
|
190
|
+
...macrosSlot("floating-action-button-menu"),
|
|
180
191
|
className: cn(
|
|
181
192
|
"shared:grid shared:grid-cols-2 shared:grid-rows-2 shared:gap-2 shared:absolute shared:inset-0 shared:top-0 shared:left-0 shared:p-3 shared:w-full shared:h-full",
|
|
182
193
|
!context.expand && "shared:pointer-events-none",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
3
4
|
import { useLazyLocaleTranslation, useLocaleTranslation } from "../../locale/locale.js";
|
|
4
5
|
const MENU_TAB_CLASSNAME = "shared:data-[active]:text-white shared:md:text-[1rem] shared:text-[1.2rem] shared:group-data-[type=bottom-nav]:text-2xl shared:group-data-[type=bottom-nav]:[&>svg]:text-2xl";
|
|
5
6
|
function MenuTab({ pluginName, icon, labelKey, locale, isBeta = false }) {
|
|
@@ -18,25 +19,33 @@ function MenuTabLazy({ pluginName, icon, labelKey, locale, isBeta = false }) {
|
|
|
18
19
|
return /* @__PURE__ */ jsx(MenuTabContent, { pluginName, icon, label: l.get(labelKey, labelKey), isBeta });
|
|
19
20
|
}
|
|
20
21
|
function MenuTabContent({ pluginName, icon, label, isBeta = false }) {
|
|
21
|
-
return /* @__PURE__ */ jsxs(
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
return /* @__PURE__ */ jsxs(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
"data-plugin": pluginName,
|
|
26
|
+
...macrosSlot("menu-tab"),
|
|
27
|
+
className: cn(
|
|
28
|
+
"shared:flex shared:items-center shared:justify-between shared:w-full shared:min-h-max shared:gap-2 shared:overflow-hidden",
|
|
29
|
+
"shared:group-data-[bottom-nav-selected=true]:text-primary"
|
|
30
|
+
),
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: cn(
|
|
33
|
+
"shared:flex shared:items-center shared:gap-2 shared:w-full shared:overflow-hidden",
|
|
34
|
+
"shared:group-data-[type=bottom-nav]:flex-col"
|
|
35
|
+
), children: [
|
|
36
|
+
icon,
|
|
37
|
+
/* @__PURE__ */ jsx("span", { className: cn(
|
|
38
|
+
"shared:text-ellipsis shared:overflow-hidden",
|
|
39
|
+
"shared:group-data-[type=bottom-nav]:line-clamp-1 shared:group-data-[type=bottom-nav]:text-[0.6rem] shared:group-data-[type=bottom-nav]:text-center"
|
|
40
|
+
), children: label })
|
|
41
|
+
] }),
|
|
42
|
+
isBeta && /* @__PURE__ */ jsx("div", { className: "shared:min-w-max shared:px-2 shared:py-1 shared:text-white shared:rounded-full shared:text-[0.5rem] shared:italic shared:bg-linear-to-r shared:from-purple-400 shared:to-red-400 shared:group-data-[type=bottom-nav]:hidden", children: "Beta" })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
37
46
|
}
|
|
38
47
|
function IconParkMenuTabIcon({ icon: Icon, className, pluginName, ...props }) {
|
|
39
|
-
return /* @__PURE__ */ jsx(Icon, { ...props, theme: "outline", "data-plugin": pluginName, className: cn(MENU_TAB_CLASSNAME, className) });
|
|
48
|
+
return /* @__PURE__ */ jsx(Icon, { ...props, ...macrosSlot("menu-tab-icon"), theme: "outline", "data-plugin": pluginName, className: cn(MENU_TAB_CLASSNAME, className) });
|
|
40
49
|
}
|
|
41
50
|
export {
|
|
42
51
|
IconParkMenuTabIcon,
|
|
@@ -4,14 +4,15 @@ import { motion } from "motion/react";
|
|
|
4
4
|
import { PluginAPI } from "@quan-erp/shared-frontend-core";
|
|
5
5
|
import { BUILTIN_PLUGIN_NAME } from "../../common/common.js";
|
|
6
6
|
import { cn } from "../../lib/utils.js";
|
|
7
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
7
8
|
function PageTitle({ children }) {
|
|
8
|
-
return /* @__PURE__ */ jsx("h1", { className: "shared:md:text-2xl shared:text-xl shared:font-bold", children });
|
|
9
|
+
return /* @__PURE__ */ jsx("h1", { ...macrosSlot("page-title"), className: "shared:md:text-2xl shared:text-xl shared:font-bold", children });
|
|
9
10
|
}
|
|
10
11
|
function PageContent({ children }) {
|
|
11
12
|
return children;
|
|
12
13
|
}
|
|
13
14
|
function PageNavTitle({ children }) {
|
|
14
|
-
return /* @__PURE__ */ jsx("div", { className: "shared:font-bold", children });
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { ...macrosSlot("page-nav-title"), className: "shared:font-bold", children });
|
|
15
16
|
}
|
|
16
17
|
function Page({
|
|
17
18
|
pluginName,
|
|
@@ -89,6 +90,7 @@ function Page({
|
|
|
89
90
|
ease: "easeOut"
|
|
90
91
|
},
|
|
91
92
|
"data-plugin": pluginName,
|
|
93
|
+
...macrosSlot("page"),
|
|
92
94
|
className: cn(`shared:flex shared:flex-col shared:md:p-6 shared:p-2 shared:gap-[1rem] shared:will-change-transform`, className),
|
|
93
95
|
children: [
|
|
94
96
|
title,
|