@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
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Drawer as Drawer$1 } from "vaul";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
const DrawerContext = React.createContext({
|
|
6
7
|
direction: "bottom"
|
|
@@ -16,13 +17,16 @@ const Drawer = ({
|
|
|
16
17
|
}
|
|
17
18
|
) });
|
|
18
19
|
Drawer.displayName = "Drawer";
|
|
19
|
-
const DrawerTrigger = Drawer$1.Trigger;
|
|
20
|
+
const DrawerTrigger = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(Drawer$1.Trigger, { ref, ...macrosSlot("drawer-trigger"), ...props }));
|
|
21
|
+
DrawerTrigger.displayName = Drawer$1.Trigger.displayName;
|
|
20
22
|
const DrawerPortal = Drawer$1.Portal;
|
|
21
|
-
const DrawerClose = Drawer$1.Close;
|
|
23
|
+
const DrawerClose = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(Drawer$1.Close, { ref, ...macrosSlot("drawer-close"), ...props }));
|
|
24
|
+
DrawerClose.displayName = Drawer$1.Close.displayName;
|
|
22
25
|
const DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
23
26
|
Drawer$1.Overlay,
|
|
24
27
|
{
|
|
25
28
|
ref,
|
|
29
|
+
...macrosSlot("drawer-overlay"),
|
|
26
30
|
className: cn("shared:fixed shared:inset-0 shared:z-50 shared:bg-black/80", className),
|
|
27
31
|
...props
|
|
28
32
|
}
|
|
@@ -36,6 +40,7 @@ const DrawerContent = React.forwardRef(({ className, children, ...props }, ref)
|
|
|
36
40
|
Drawer$1.Content,
|
|
37
41
|
{
|
|
38
42
|
ref,
|
|
43
|
+
...macrosSlot("drawer-content"),
|
|
39
44
|
className: cn(
|
|
40
45
|
"shared:fixed shared:inset-x-0 shared:bottom-0 shared:z-50 shared:mt-24 shared:flex shared:h-auto shared:flex-col shared:rounded-t-3xl shared:border shared:bg-(--drawer-background)",
|
|
41
46
|
className
|
|
@@ -67,7 +72,7 @@ const DrawerFooter = ({
|
|
|
67
72
|
}) => /* @__PURE__ */ jsx(
|
|
68
73
|
"div",
|
|
69
74
|
{
|
|
70
|
-
className: cn("shared:mt-auto shared:flex shared:flex-
|
|
75
|
+
className: cn("shared:mt-auto shared:flex shared:flex-row shared:gap-2", className),
|
|
71
76
|
...props
|
|
72
77
|
}
|
|
73
78
|
);
|
|
@@ -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 DropdownMenuPrimitive from "@radix-ui/react-dropdown-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 DropdownMenu = DropdownMenuPrimitive.Root;
|
|
7
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
8
|
+
const DropdownMenuTrigger = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, { ref, ...macrosSlot("dropdown-menu-trigger"), ...props }));
|
|
9
|
+
DropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;
|
|
8
10
|
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
9
11
|
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
10
12
|
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
@@ -13,6 +15,7 @@ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, .
|
|
|
13
15
|
DropdownMenuPrimitive.SubTrigger,
|
|
14
16
|
{
|
|
15
17
|
ref,
|
|
18
|
+
...macrosSlot("dropdown-menu-sub-trigger"),
|
|
16
19
|
className: cn(
|
|
17
20
|
"shared:flex shared:cursor-default shared:select-none shared:items-center shared:gap-2 shared:rounded-sm shared:px-2 shared:py-1.5 shared:text-sm shared:outline-none shared:focus:bg-accent shared:data-[state=open]:bg-accent shared:[&_svg]:pointer-events-none shared:[&_svg]:size-4 shared:[&_svg]:shrink-0",
|
|
18
21
|
inset && "shared:pl-8",
|
|
@@ -30,6 +33,7 @@ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) =
|
|
|
30
33
|
DropdownMenuPrimitive.SubContent,
|
|
31
34
|
{
|
|
32
35
|
ref,
|
|
36
|
+
...macrosSlot("dropdown-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-dropdown-menu-content-transform-origin]",
|
|
35
39
|
className
|
|
@@ -42,6 +46,7 @@ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...pr
|
|
|
42
46
|
DropdownMenuPrimitive.Content,
|
|
43
47
|
{
|
|
44
48
|
ref,
|
|
49
|
+
...macrosSlot("dropdown-menu-content"),
|
|
45
50
|
sideOffset,
|
|
46
51
|
className: cn(
|
|
47
52
|
"shared:z-50 shared:max-h-[var(--radix-dropdown-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",
|
|
@@ -56,6 +61,7 @@ const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref)
|
|
|
56
61
|
DropdownMenuPrimitive.Item,
|
|
57
62
|
{
|
|
58
63
|
ref,
|
|
64
|
+
...macrosSlot("dropdown-menu-item"),
|
|
59
65
|
className: cn(
|
|
60
66
|
"shared:relative shared:flex shared:cursor-default shared:select-none shared:items-center shared:gap-2 shared:rounded-sm 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]:pointer-events-none shared:data-[disabled]:opacity-50 shared:[&>svg]:size-4 shared:[&>svg]:shrink-0",
|
|
61
67
|
inset && "shared:pl-8",
|
|
@@ -69,6 +75,7 @@ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checke
|
|
|
69
75
|
DropdownMenuPrimitive.CheckboxItem,
|
|
70
76
|
{
|
|
71
77
|
ref,
|
|
78
|
+
...macrosSlot("dropdown-menu-checkbox-item"),
|
|
72
79
|
className: cn(
|
|
73
80
|
"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:transition-colors shared:focus:bg-accent shared:focus:text-accent-foreground shared:data-[disabled]:pointer-events-none shared:data-[disabled]:opacity-50",
|
|
74
81
|
className
|
|
@@ -86,6 +93,7 @@ const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props
|
|
|
86
93
|
DropdownMenuPrimitive.RadioItem,
|
|
87
94
|
{
|
|
88
95
|
ref,
|
|
96
|
+
...macrosSlot("dropdown-menu-radio-item"),
|
|
89
97
|
className: cn(
|
|
90
98
|
"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:transition-colors shared:focus:bg-accent shared:focus:text-accent-foreground shared:data-[disabled]:pointer-events-none shared:data-[disabled]:opacity-50",
|
|
91
99
|
className
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
const HoverCard = HoverCardPrimitive.Root;
|
|
6
|
-
const HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
7
|
+
const HoverCardTrigger = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(HoverCardPrimitive.Trigger, { ref, ...macrosSlot("hover-card-trigger"), ...props }));
|
|
8
|
+
HoverCardTrigger.displayName = HoverCardPrimitive.Trigger.displayName;
|
|
7
9
|
const HoverCardContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8
10
|
HoverCardPrimitive.Content,
|
|
9
11
|
{
|
|
10
12
|
ref,
|
|
13
|
+
...macrosSlot("hover-card-content"),
|
|
11
14
|
align,
|
|
12
15
|
sideOffset,
|
|
13
16
|
className: cn(
|
|
@@ -2,11 +2,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { OTPInput, OTPInputContext } from "input-otp";
|
|
4
4
|
import { Minus } from "lucide-react";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
const InputOTP = React.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
8
|
OTPInput,
|
|
8
9
|
{
|
|
9
10
|
ref,
|
|
11
|
+
...macrosSlot("input"),
|
|
10
12
|
containerClassName: cn(
|
|
11
13
|
"shared:flex shared:items-center shared:gap-2 shared:has-[:disabled]:opacity-50",
|
|
12
14
|
containerClassName
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
const inputVariants = cva(
|
|
6
7
|
"shared:file:text-foreground shared:placeholder:text-muted-foreground shared:selection:bg-primary shared:selection:text-primary-foreground shared:dark:bg-input/30 shared:border-input shared:w-full shared:min-w-0 shared:rounded-full shared:cupertino-corner shared:border shared:bg-transparent shared:text-base shared:shadow-xs shared:transition-[color,box-shadow] shared:outline-none shared:file:inline-flex shared:file:h-7 shared:file:border-0 shared:file:bg-transparent shared:file:text-sm shared:file:font-medium shared:disabled:pointer-events-none shared:disabled:cursor-not-allowed shared:disabled:opacity-50 shared:md:text-sm 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",
|
|
@@ -24,7 +25,7 @@ const Input = React.forwardRef(
|
|
|
24
25
|
{
|
|
25
26
|
ref,
|
|
26
27
|
type,
|
|
27
|
-
"
|
|
28
|
+
...macrosSlot("input"),
|
|
28
29
|
className: cn(inputVariants({ inputSize, className })),
|
|
29
30
|
...props
|
|
30
31
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
function Label({
|
|
6
7
|
className,
|
|
@@ -9,7 +10,7 @@ function Label({
|
|
|
9
10
|
return /* @__PURE__ */ jsx(
|
|
10
11
|
LabelPrimitive.Root,
|
|
11
12
|
{
|
|
12
|
-
"
|
|
13
|
+
...macrosSlot("label"),
|
|
13
14
|
className: cn(
|
|
14
15
|
"shared:flex shared:items-center shared:gap-2 shared:text-sm shared:leading-none shared:font-medium shared:select-none shared:group-data-[disabled=true]:pointer-events-none shared:group-data-[disabled=true]:opacity-50 shared:peer-disabled:cursor-not-allowed shared:peer-disabled:opacity-50",
|
|
15
16
|
className
|
|
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
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
|
function MenubarMenu({
|
|
7
8
|
...props
|
|
@@ -44,6 +45,7 @@ const MenubarTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
44
45
|
MenubarPrimitive.Trigger,
|
|
45
46
|
{
|
|
46
47
|
ref,
|
|
48
|
+
...macrosSlot("menubar-trigger"),
|
|
47
49
|
className: cn(
|
|
48
50
|
"shared:flex shared:cursor-default shared:select-none shared:items-center shared:rounded-sm shared:px-3 shared:py-1 shared:text-sm shared:font-medium 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",
|
|
49
51
|
className
|
|
@@ -56,6 +58,7 @@ const MenubarSubTrigger = React.forwardRef(({ className, inset, children, ...pro
|
|
|
56
58
|
MenubarPrimitive.SubTrigger,
|
|
57
59
|
{
|
|
58
60
|
ref,
|
|
61
|
+
...macrosSlot("menubar-sub-trigger"),
|
|
59
62
|
className: cn(
|
|
60
63
|
"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",
|
|
61
64
|
inset && "shared:pl-8",
|
|
@@ -73,6 +76,7 @@ const MenubarSubContent = React.forwardRef(({ className, ...props }, ref) => /*
|
|
|
73
76
|
MenubarPrimitive.SubContent,
|
|
74
77
|
{
|
|
75
78
|
ref,
|
|
79
|
+
...macrosSlot("menubar-sub-content"),
|
|
76
80
|
className: cn(
|
|
77
81
|
"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-menubar-content-transform-origin]",
|
|
78
82
|
className
|
|
@@ -86,6 +90,7 @@ const MenubarContent = React.forwardRef(
|
|
|
86
90
|
MenubarPrimitive.Content,
|
|
87
91
|
{
|
|
88
92
|
ref,
|
|
93
|
+
...macrosSlot("menubar-content"),
|
|
89
94
|
align,
|
|
90
95
|
alignOffset,
|
|
91
96
|
sideOffset,
|
|
@@ -102,6 +107,7 @@ const MenubarItem = React.forwardRef(({ className, inset, ...props }, ref) => /*
|
|
|
102
107
|
MenubarPrimitive.Item,
|
|
103
108
|
{
|
|
104
109
|
ref,
|
|
110
|
+
...macrosSlot("menubar-item"),
|
|
105
111
|
className: cn(
|
|
106
112
|
"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",
|
|
107
113
|
inset && "shared:pl-8",
|
|
@@ -115,6 +121,7 @@ const MenubarCheckboxItem = React.forwardRef(({ className, children, checked, ..
|
|
|
115
121
|
MenubarPrimitive.CheckboxItem,
|
|
116
122
|
{
|
|
117
123
|
ref,
|
|
124
|
+
...macrosSlot("menubar-checkbox-item"),
|
|
118
125
|
className: cn(
|
|
119
126
|
"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",
|
|
120
127
|
className
|
|
@@ -132,6 +139,7 @@ const MenubarRadioItem = React.forwardRef(({ className, children, ...props }, re
|
|
|
132
139
|
MenubarPrimitive.RadioItem,
|
|
133
140
|
{
|
|
134
141
|
ref,
|
|
142
|
+
...macrosSlot("menubar-radio-item"),
|
|
135
143
|
className: cn(
|
|
136
144
|
"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",
|
|
137
145
|
className
|
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { ChevronDown } from "lucide-react";
|
|
6
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
6
7
|
import { cn } from "../../lib/utils.js";
|
|
7
8
|
const NavigationMenu = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
8
9
|
NavigationMenuPrimitive.Root,
|
|
@@ -40,6 +41,7 @@ const NavigationMenuTrigger = React.forwardRef(({ className, children, ...props
|
|
|
40
41
|
NavigationMenuPrimitive.Trigger,
|
|
41
42
|
{
|
|
42
43
|
ref,
|
|
44
|
+
...macrosSlot("navigation-menu-trigger"),
|
|
43
45
|
className: cn(navigationMenuTriggerStyle(), "shared:group", className),
|
|
44
46
|
...props,
|
|
45
47
|
children: [
|
|
@@ -60,6 +62,7 @@ const NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) =>
|
|
|
60
62
|
NavigationMenuPrimitive.Content,
|
|
61
63
|
{
|
|
62
64
|
ref,
|
|
65
|
+
...macrosSlot("navigation-menu-content"),
|
|
63
66
|
className: cn(
|
|
64
67
|
"shared:left-0 shared:top-0 shared:w-full shared:data-[motion^=from-]:animate-in shared:data-[motion^=to-]:animate-out shared:data-[motion^=from-]:fade-in shared:data-[motion^=to-]:fade-out shared:data-[motion=from-end]:slide-in-from-right-52 shared:data-[motion=from-start]:slide-in-from-left-52 shared:data-[motion=to-end]:slide-out-to-right-52 shared:data-[motion=to-start]:slide-out-to-left-52 shared:md:absolute shared:md:w-auto ",
|
|
65
68
|
className
|
|
@@ -68,7 +71,8 @@ const NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) =>
|
|
|
68
71
|
}
|
|
69
72
|
));
|
|
70
73
|
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
71
|
-
const NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
74
|
+
const NavigationMenuLink = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(NavigationMenuPrimitive.Link, { ref, ...macrosSlot("navigation-menu-link"), ...props }));
|
|
75
|
+
NavigationMenuLink.displayName = NavigationMenuPrimitive.Link.displayName;
|
|
72
76
|
const NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn("shared:absolute shared:left-0 shared:top-full shared:flex shared:justify-center"), children: /* @__PURE__ */ jsx(
|
|
73
77
|
NavigationMenuPrimitive.Viewport,
|
|
74
78
|
{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { MoreHorizontal, ChevronRight, ChevronLeft } from "lucide-react";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
import { buttonVariants } from "./button.js";
|
|
6
7
|
const Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
@@ -31,6 +32,7 @@ const PaginationLink = ({
|
|
|
31
32
|
}) => /* @__PURE__ */ jsx(
|
|
32
33
|
"a",
|
|
33
34
|
{
|
|
35
|
+
...macrosSlot("pagination-link"),
|
|
34
36
|
"aria-current": isActive ? "page" : void 0,
|
|
35
37
|
className: cn(
|
|
36
38
|
buttonVariants({
|
|
@@ -48,6 +50,7 @@ const PaginationPrevious = ({
|
|
|
48
50
|
}) => /* @__PURE__ */ jsxs(
|
|
49
51
|
PaginationLink,
|
|
50
52
|
{
|
|
53
|
+
...macrosSlot("pagination-previous"),
|
|
51
54
|
"aria-label": "Go to previous page",
|
|
52
55
|
className: cn("shared:gap-1 shared:pl-2.5", className),
|
|
53
56
|
...props,
|
|
@@ -64,6 +67,7 @@ const PaginationNext = ({
|
|
|
64
67
|
}) => /* @__PURE__ */ jsxs(
|
|
65
68
|
PaginationLink,
|
|
66
69
|
{
|
|
70
|
+
...macrosSlot("pagination-next"),
|
|
67
71
|
"aria-label": "Go to next page",
|
|
68
72
|
className: cn("shared:gap-1 shared:pr-2.5", className),
|
|
69
73
|
...props,
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
const Popover = PopoverPrimitive.Root;
|
|
6
|
-
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
7
|
+
const PopoverTrigger = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { ref, ...macrosSlot("popover-trigger"), ...props }));
|
|
8
|
+
PopoverTrigger.displayName = PopoverPrimitive.Trigger.displayName;
|
|
7
9
|
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
8
10
|
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
9
11
|
PopoverPrimitive.Content,
|
|
10
12
|
{
|
|
11
13
|
ref,
|
|
14
|
+
...macrosSlot("popover-content"),
|
|
12
15
|
align,
|
|
13
16
|
sideOffset,
|
|
14
17
|
className: cn(
|
|
@@ -2,11 +2,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
4
|
import { Circle } from "lucide-react";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
const RadioGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
7
8
|
return /* @__PURE__ */ jsx(
|
|
8
9
|
RadioGroupPrimitive.Root,
|
|
9
10
|
{
|
|
11
|
+
...macrosSlot("radio-group"),
|
|
10
12
|
className: cn("shared:grid shared:gap-2", className),
|
|
11
13
|
...props,
|
|
12
14
|
ref
|
|
@@ -19,6 +21,7 @@ const RadioGroupItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
19
21
|
RadioGroupPrimitive.Item,
|
|
20
22
|
{
|
|
21
23
|
ref,
|
|
24
|
+
...macrosSlot("radio-group-item"),
|
|
22
25
|
className: cn(
|
|
23
26
|
"shared:aspect-square shared:h-4 shared:w-4 shared:rounded-full shared:border shared:border-primary shared:text-primary shared:shadow shared:focus:outline-none shared:focus-visible:ring-1 shared:focus-visible:ring-ring shared:disabled:cursor-not-allowed shared:disabled:opacity-50",
|
|
24
27
|
className
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { GripVertical } from "lucide-react";
|
|
3
3
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
const ResizablePanelGroup = ({
|
|
6
7
|
className,
|
|
@@ -23,6 +24,7 @@ const ResizableHandle = ({
|
|
|
23
24
|
}) => /* @__PURE__ */ jsx(
|
|
24
25
|
ResizablePrimitive.PanelResizeHandle,
|
|
25
26
|
{
|
|
27
|
+
...macrosSlot("resizable-handle"),
|
|
26
28
|
className: cn(
|
|
27
29
|
"shared:relative shared:flex shared:w-px shared:items-center shared:justify-center shared:bg-border shared:after:absolute shared:after:inset-y-0 shared:after:left-1/2 shared:after:w-1 shared:after:-translate-x-1/2 shared:focus-visible:outline-none shared:focus-visible:ring-1 shared:focus-visible:ring-ring shared:focus-visible:ring-offset-1 shared:data-[panel-group-direction=vertical]:h-px shared:data-[panel-group-direction=vertical]:w-full shared:data-[panel-group-direction=vertical]:after:left-0 shared:data-[panel-group-direction=vertical]:after:h-1 shared:data-[panel-group-direction=vertical]:after:w-full shared:data-[panel-group-direction=vertical]:after:-translate-y-1/2 shared:data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>shared:div]:rotate-90",
|
|
28
30
|
className
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
4
|
import { ChevronDown, ChevronUp, Check } from "lucide-react";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
const Select = SelectPrimitive.Root;
|
|
7
8
|
const SelectGroup = SelectPrimitive.Group;
|
|
8
|
-
const SelectValue = SelectPrimitive.Value;
|
|
9
|
+
const SelectValue = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Value, { ref, ...macrosSlot("select-value"), ...props }));
|
|
10
|
+
SelectValue.displayName = SelectPrimitive.Value.displayName;
|
|
9
11
|
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
10
12
|
SelectPrimitive.Trigger,
|
|
11
13
|
{
|
|
12
14
|
ref,
|
|
15
|
+
...macrosSlot("select-trigger"),
|
|
13
16
|
className: cn(
|
|
14
17
|
"shared:flex shared:h-12 shared:md:h-9 shared:w-full shared:items-center shared:justify-between shared:whitespace-nowrap shared:rounded-3xl shared:cupertino-corner shared:border shared:border-input shared:bg-transparent shared:px-3 shared:py-2 shared:text-sm shared:data-[placeholder]:text-muted-foreground shared:focus:border shared:focus:border-primary shared:disabled:cursor-not-allowed shared:disabled:opacity-50 [&>shared:span]:line-clamp-1",
|
|
15
18
|
className
|
|
@@ -52,6 +55,7 @@ const SelectContent = React.forwardRef(({ className, children, position = "poppe
|
|
|
52
55
|
SelectPrimitive.Content,
|
|
53
56
|
{
|
|
54
57
|
ref,
|
|
58
|
+
...macrosSlot("select-content"),
|
|
55
59
|
className: cn(
|
|
56
60
|
"shared:relative shared:z-50 shared:max-h-[--radix-select-content-available-height] shared:min-w-[8rem] shared:overflow-y-auto shared:overflow-x-hidden shared:rounded-3xl shared:cupertino-corner shared:bg-popover 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-select-content-transform-origin]",
|
|
57
61
|
position === "popper" && "shared:data-[side=bottom]:translate-y-1 shared:data-[side=left]:-translate-x-1 shared:data-[side=right]:translate-x-1 shared:data-[side=top]:-translate-y-1",
|
|
@@ -80,6 +84,7 @@ const SelectLabel = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
80
84
|
SelectPrimitive.Label,
|
|
81
85
|
{
|
|
82
86
|
ref,
|
|
87
|
+
...macrosSlot("select-label"),
|
|
83
88
|
className: cn("shared:px-2 shared:py-1.5 shared:text-sm shared:font-semibold", className),
|
|
84
89
|
...props
|
|
85
90
|
}
|
|
@@ -89,6 +94,7 @@ const SelectItem = React.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
89
94
|
SelectPrimitive.Item,
|
|
90
95
|
{
|
|
91
96
|
ref,
|
|
97
|
+
...macrosSlot("select-item"),
|
|
92
98
|
className: cn(
|
|
93
99
|
"shared:relative shared:flex shared:w-full shared:cursor-default shared:select-none shared:items-center shared:rounded-3xl shared:cupertino-corner shared:py-3 shared:pl-4 shared:pr-10 shared:md:py-1.5 shared:md:pl-2 shared:md:pr-8 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",
|
|
94
100
|
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 Sheet({ ...props }) {
|
|
7
8
|
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
@@ -9,12 +10,12 @@ function Sheet({ ...props }) {
|
|
|
9
10
|
function SheetTrigger({
|
|
10
11
|
...props
|
|
11
12
|
}) {
|
|
12
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "
|
|
13
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ...macrosSlot("sheet-trigger"), ...props });
|
|
13
14
|
}
|
|
14
15
|
function SheetClose({
|
|
15
16
|
...props
|
|
16
17
|
}) {
|
|
17
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "
|
|
18
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...macrosSlot("sheet-close"), ...props });
|
|
18
19
|
}
|
|
19
20
|
function SheetPortal({
|
|
20
21
|
...props
|
|
@@ -28,7 +29,7 @@ function SheetOverlay({
|
|
|
28
29
|
return /* @__PURE__ */ jsx(
|
|
29
30
|
DialogPrimitive.Overlay,
|
|
30
31
|
{
|
|
31
|
-
"
|
|
32
|
+
...macrosSlot("sheet-overlay"),
|
|
32
33
|
className: cn(
|
|
33
34
|
"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",
|
|
34
35
|
className
|
|
@@ -49,7 +50,7 @@ function SheetContent({
|
|
|
49
50
|
/* @__PURE__ */ jsxs(
|
|
50
51
|
DialogPrimitive.Content,
|
|
51
52
|
{
|
|
52
|
-
"
|
|
53
|
+
...macrosSlot("sheet-content"),
|
|
53
54
|
className: cn(
|
|
54
55
|
"shared:bg-(--sheet-background) shared:data-[state=open]:animate-in shared:data-[state=closed]:animate-out shared:fixed shared:z-50 shared:flex shared:flex-col shared:gap-4 shared:shadow-lg shared:transition shared:ease-in-out shared:data-[state=closed]:duration-300 shared:data-[state=open]:duration-500",
|
|
55
56
|
side === "right" && "shared:data-[state=closed]:slide-out-to-right shared:data-[state=open]:slide-in-from-right shared:inset-y-0 shared:right-0 shared:h-full shared:w-3/4 shared:border-l shared:sm:max-w-sm shared:rounded-l-xl",
|
|
@@ -61,7 +62,7 @@ function SheetContent({
|
|
|
61
62
|
...props,
|
|
62
63
|
children: [
|
|
63
64
|
children,
|
|
64
|
-
showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "shared:p-2 shared:bg-muted shared:rounded-full shared:ring-offset-background shared:focus:ring-ring shared:data-[state=open]:bg-secondary 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:cursor-pointer", children: [
|
|
65
|
+
showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, { ...macrosSlot("sheet-close"), className: "shared:p-2 shared:bg-muted shared:rounded-full shared:ring-offset-background shared:focus:ring-ring shared:data-[state=open]:bg-secondary 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:cursor-pointer", children: [
|
|
65
66
|
/* @__PURE__ */ jsx(XIcon, { className: "shared:size-5" }),
|
|
66
67
|
/* @__PURE__ */ jsx("span", { className: "shared:sr-only", children: "Close" })
|
|
67
68
|
] })
|
|
@@ -4,6 +4,7 @@ import { Slot } from "@radix-ui/react-slot";
|
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { PanelLeft } from "lucide-react";
|
|
6
6
|
import { useMediaQuery } from "../../hooks/use-mobile.js";
|
|
7
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
7
8
|
import { cn } from "../../lib/utils.js";
|
|
8
9
|
import { Button } from "./button.js";
|
|
9
10
|
import { Input } from "./input.js";
|
|
@@ -196,6 +197,7 @@ const SidebarTrigger = React.forwardRef(({ className, onClick, ...props }, ref)
|
|
|
196
197
|
Button,
|
|
197
198
|
{
|
|
198
199
|
ref,
|
|
200
|
+
...macrosSlot("sidebar-trigger"),
|
|
199
201
|
"data-sidebar": "trigger",
|
|
200
202
|
variant: "ghost",
|
|
201
203
|
size: "icon",
|
|
@@ -219,6 +221,7 @@ const SidebarRail = React.forwardRef(({ className, ...props }, ref) => {
|
|
|
219
221
|
"button",
|
|
220
222
|
{
|
|
221
223
|
ref,
|
|
224
|
+
...macrosSlot("sidebar-rail"),
|
|
222
225
|
"data-sidebar": "rail",
|
|
223
226
|
"aria-label": "Toggle Sidebar",
|
|
224
227
|
tabIndex: -1,
|
|
@@ -354,6 +357,7 @@ const SidebarGroupAction = React.forwardRef(({ className, asChild = false, ...pr
|
|
|
354
357
|
Comp,
|
|
355
358
|
{
|
|
356
359
|
ref,
|
|
360
|
+
...macrosSlot("sidebar-group-action"),
|
|
357
361
|
"data-sidebar": "group-action",
|
|
358
362
|
className: cn(
|
|
359
363
|
"shared:absolute shared:right-3 shared:top-3.5 shared:flex shared:aspect-square shared:w-5 shared:items-center shared:justify-center shared:rounded-md shared:p-0 shared:text-sidebar-foreground shared:outline-none shared:ring-sidebar-ring shared:transition-transform shared:hover:bg-sidebar-accent shared:hover:text-sidebar-accent-foreground shared:focus-visible:ring-2 [&>shared:svg]:size-4 [&>shared:svg]:shrink-0",
|
|
@@ -433,6 +437,7 @@ const SidebarMenuButton = React.forwardRef(
|
|
|
433
437
|
Comp,
|
|
434
438
|
{
|
|
435
439
|
ref,
|
|
440
|
+
...macrosSlot("sidebar-menu-button"),
|
|
436
441
|
"data-sidebar": "menu-button",
|
|
437
442
|
"data-size": size,
|
|
438
443
|
"data-active": isActive,
|
|
@@ -469,6 +474,7 @@ const SidebarMenuAction = React.forwardRef(({ className, asChild = false, showOn
|
|
|
469
474
|
Comp,
|
|
470
475
|
{
|
|
471
476
|
ref,
|
|
477
|
+
...macrosSlot("sidebar-menu-action"),
|
|
472
478
|
"data-sidebar": "menu-action",
|
|
473
479
|
className: cn(
|
|
474
480
|
"shared:absolute shared:right-1 shared:top-1.5 shared:flex shared:aspect-square shared:w-5 shared:items-center shared:justify-center shared:rounded-md shared:p-0 shared:text-sidebar-foreground shared:outline-none shared:ring-sidebar-ring shared:transition-transform shared:hover:bg-sidebar-accent shared:hover:text-sidebar-accent-foreground shared:focus-visible:ring-2 shared:peer-hover/menu-button:text-sidebar-accent-foreground [&>shared:svg]:size-4 [&>shared:svg]:shrink-0",
|
|
@@ -560,6 +566,7 @@ const SidebarMenuSubButton = React.forwardRef(({ asChild = false, size = "md", i
|
|
|
560
566
|
Comp,
|
|
561
567
|
{
|
|
562
568
|
ref,
|
|
569
|
+
...macrosSlot("sidebar-menu-sub-button"),
|
|
563
570
|
"data-sidebar": "menu-sub-button",
|
|
564
571
|
"data-size": size,
|
|
565
572
|
"data-active": isActive,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
2
3
|
import { cn } from "../../lib/utils.js";
|
|
3
4
|
import { forwardRef, useState } from "react";
|
|
4
5
|
const Slider = forwardRef(
|
|
@@ -16,6 +17,7 @@ const Slider = forwardRef(
|
|
|
16
17
|
"div",
|
|
17
18
|
{
|
|
18
19
|
ref,
|
|
20
|
+
...macrosSlot("slider"),
|
|
19
21
|
className: cn("shared:relative shared:flex shared:w-full shared:touch-none shared:select-none shared:items-center shared:h-6.5 shared:md:h-5 shared:[--thumb-size:1.625rem] shared:md:[--thumb-size:1.25rem] shared:overflow-hidden", className, disabled && "shared:opacity-50"),
|
|
20
22
|
...props,
|
|
21
23
|
children: [
|
|
@@ -32,6 +34,7 @@ const Slider = forwardRef(
|
|
|
32
34
|
/* @__PURE__ */ jsx(
|
|
33
35
|
"div",
|
|
34
36
|
{
|
|
37
|
+
...macrosSlot("slider-thumb"),
|
|
35
38
|
className: "shared:absolute shared:block shared:h-6.5 shared:w-6.5 shared:md:h-5 shared:md:w-5 shared:rounded-full shared:border-2 shared:border-primary shared:bg-background shared:shadow shared:pointer-events-none shared:z-10",
|
|
36
39
|
style: {
|
|
37
40
|
left: `calc(${percentage}% - (${percentage / 100} * var(--thumb-size)))`
|
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
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 switchVariants = cva(
|
|
7
8
|
"shared:peer shared:inline-flex shared:shrink-0 shared:cursor-pointer shared:items-center shared:rounded-full shared:border-2 shared:border-transparent shared:shadow-sm shared:transition-all shared:duration-200 shared:focus-visible:outline-none shared:focus-visible:ring-2 shared:focus-visible:ring-ring shared:focus-visible:ring-offset-2 shared:focus-visible:ring-offset-background shared:disabled:cursor-not-allowed shared:disabled:opacity-50 shared:data-[state=checked]:bg-primary shared:data-[state=unchecked]:bg-input",
|
|
@@ -37,6 +38,7 @@ const Switch = React.forwardRef(({ className, switchSize, ...props }, ref) => /*
|
|
|
37
38
|
SwitchPrimitives.Root,
|
|
38
39
|
{
|
|
39
40
|
"data-plugin": "builtin",
|
|
41
|
+
...macrosSlot("switch"),
|
|
40
42
|
className: cn(switchVariants({ switchSize, className })),
|
|
41
43
|
...props,
|
|
42
44
|
ref,
|
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
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 TabsContext = React.createContext({ size: "default" });
|
|
7
8
|
const Tabs = React.forwardRef(
|
|
@@ -30,6 +31,7 @@ const TabsList = React.forwardRef(({ className, size, ...props }, ref) => {
|
|
|
30
31
|
TabsPrimitive.List,
|
|
31
32
|
{
|
|
32
33
|
ref,
|
|
34
|
+
...macrosSlot("tabs-list"),
|
|
33
35
|
className: cn(tabsListVariants({ size: activeSize, className })),
|
|
34
36
|
...props
|
|
35
37
|
}
|
|
@@ -58,6 +60,7 @@ const TabsTrigger = React.forwardRef(({ className, size, ...props }, ref) => {
|
|
|
58
60
|
TabsPrimitive.Trigger,
|
|
59
61
|
{
|
|
60
62
|
ref,
|
|
63
|
+
...macrosSlot("tabs-trigger"),
|
|
61
64
|
className: cn(tabsTriggerVariants({ size: activeSize, className })),
|
|
62
65
|
...props
|
|
63
66
|
}
|
|
@@ -68,6 +71,7 @@ const TabsContent = React.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
68
71
|
TabsPrimitive.Content,
|
|
69
72
|
{
|
|
70
73
|
ref,
|
|
74
|
+
...macrosSlot("tabs-content"),
|
|
71
75
|
className: cn(
|
|
72
76
|
"shared:mt-2 shared:ring-offset-background shared:focus-visible:outline-none shared:focus-visible:ring-2 shared:focus-visible:ring-ring shared:focus-visible:ring-offset-2",
|
|
73
77
|
className
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
const textareaVariants = cva(
|
|
6
7
|
"shared:border-input shared:placeholder:text-muted-foreground shared:focus-visible:border-ring shared:focus-visible:ring-ring/50 shared:aria-invalid:ring-destructive/20 shared:dark:aria-invalid:ring-destructive/40 shared:aria-invalid:border-destructive shared:dark:bg-input/30 shared:flex shared:field-sizing-content shared:w-full shared:rounded-3xl shared:cupertino-corner shared:border shared:bg-transparent shared:shadow-xs shared:transition-[color,box-shadow] shared:outline-none shared:focus-visible:ring-[3px] shared:disabled:cursor-not-allowed shared:disabled:opacity-50",
|
|
@@ -21,7 +22,7 @@ function Textarea({ className, inputSize, ...props }) {
|
|
|
21
22
|
return /* @__PURE__ */ jsx(
|
|
22
23
|
"textarea",
|
|
23
24
|
{
|
|
24
|
-
"
|
|
25
|
+
...macrosSlot("textarea"),
|
|
25
26
|
className: cn(textareaVariants({ inputSize, className })),
|
|
26
27
|
...props
|
|
27
28
|
}
|
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { Button } from "./button.js";
|
|
4
4
|
import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle } from "./dialog.js";
|
|
5
5
|
import { ButtonGroup } from "./button-group.js";
|
|
6
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
6
7
|
import { cn } from "../../lib/utils.js";
|
|
7
8
|
function polarToCartesian(cx, cy, r, angle) {
|
|
8
9
|
const rad = (angle - 90) * Math.PI / 180;
|
|
@@ -45,6 +46,7 @@ function Dial({
|
|
|
45
46
|
/* @__PURE__ */ jsxs(
|
|
46
47
|
"svg",
|
|
47
48
|
{
|
|
49
|
+
...macrosSlot("time-picker-dial"),
|
|
48
50
|
width: size,
|
|
49
51
|
height: size,
|
|
50
52
|
className: "shared:rounded-full shared:bg-muted shared:touch-none shared:select-none",
|
|
@@ -137,9 +139,9 @@ function TimePicker({
|
|
|
137
139
|
/* @__PURE__ */ jsxs(DialogContent, { className: "shared:w-[360px]", children: [
|
|
138
140
|
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Select time" }) }),
|
|
139
141
|
/* @__PURE__ */ jsxs("div", { className: "shared:flex shared:justify-center shared:gap-2 shared:text-2xl shared:font-semibold", children: [
|
|
140
|
-
/* @__PURE__ */ jsx("button", { onClick: () => setMode("hour"), className: cn(mode === "hour" ? "shared:underline" : "", "shared:cursor-pointer"), children: String(format === "12hr" ? hour % 12 : hour).padStart(2, "0").padStart(2, "0") }),
|
|
142
|
+
/* @__PURE__ */ jsx("button", { ...macrosSlot("time-picker-hour"), onClick: () => setMode("hour"), className: cn(mode === "hour" ? "shared:underline" : "", "shared:cursor-pointer"), children: String(format === "12hr" ? hour % 12 : hour).padStart(2, "0").padStart(2, "0") }),
|
|
141
143
|
/* @__PURE__ */ jsx("span", { children: ":" }),
|
|
142
|
-
/* @__PURE__ */ jsx("button", { onClick: () => setMode("minute"), className: cn(mode === "minute" ? "shared:underline" : "", "shared:cursor-pointer"), children: String(minute).padStart(2, "0") })
|
|
144
|
+
/* @__PURE__ */ jsx("button", { ...macrosSlot("time-picker-minute"), onClick: () => setMode("minute"), className: cn(mode === "minute" ? "shared:underline" : "", "shared:cursor-pointer"), children: String(minute).padStart(2, "0") })
|
|
143
145
|
] }),
|
|
144
146
|
mode === "hour" ? /* @__PURE__ */ jsx(
|
|
145
147
|
Dial,
|